Forum

now its the fame thrower

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

now its the fame thrower

Postby MeTcHsteekle » Tue Sep 02, 2008 4:23 am

hello again

so i took the flame thrower tutorial and made it its own lil thing

and then i did the doctor shadowborg'ses tutorial on the [proper] way to add a weapon to quake

so it was all going good untill i shot a bit o fire out

then i was interuppted mid "hey its working :D" thought with yet another host error :(

Introduction

EDICT 86:
modelindex 93.0
absmin '543.0 425.1 44.8'
absmax '545.0 427.1 46.8'
movetype 9.0
solid 2.0
origin '544.0 426.1 45.8'
velocity ' 0.0 500.0 6.4'
classname fire
model progs/s_explod.spr
touch Flame_Touch()
owner entity 1

===========================
Host_Error: PR_ExecuteProgram: NULL function
===========================

Connected to a ProQuake server

VERSION 1.09 SERVER (58922 CRC)



Introduction
]fov 120

EDICT 86:
modelindex 93.0
absmin '541.8 426.3 48.3'
absmax '543.8 428.3 50.3'
movetype 9.0
solid 2.0
origin '542.8 427.3 49.3'
velocity ' -4.3 499.6 18.9'
classname fire
model progs/s_explod.spr
touch Flame_Touch()
owner entity 1

===========================
Host_Error: PR_ExecuteProgram: NULL function
===========================

]condump


as you all might be catching on, these errors stump me and foil me plans
i really cant under stand this one because it spit a bunch of numbers out at me

any help is apprecated (as i cant seem to help myself at all with these things)

yet another mid night posting, will it make sence this time in the morning?
bah
MeTcHsteekle
 
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

Postby Spike » Tue Sep 02, 2008 2:20 pm

You're using the explosion sprite without a think function? Wouldn't that look a bit ugly?

Or more specifically, if you set the nextthink without setting the think function, then you'll get the exact same symptoms as shown (the engine detects the nextthink, clears the field, calls the think function... then finds that its not set! panic!).
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby MeTcHsteekle » Tue Sep 02, 2008 10:18 pm

htat helped a bit but now it has a probem with shooting nails :?

and it will still crash if it dosent touch a monster, perhaps the code is fubar (like aways)

Code: Select all
//+++++++++++++++++++
// naplam spray gun :D
//+++++++++++++++++++
void(vector org) Flame_Burn =
{
   local entity flame;

   flame = spawn ();
   flame.owner = self;
   flame.classname = "fire";
   flame.movetype = MOVETYPE_FLYMISSILE;
   flame.solid = SOLID_NOT;
   flame.origin = org;
   flame.velocity = '0 0 15';
   setmodel (flame, "progs/s_explod.spr");
   setsize (flame, '0 0 0', '0 0 0');
   flame.think = s_explode1;
   flame.nextthink = time + 0.01;

};

void() Flame_Think =
{
   local float r;

   if (self.enemy.waterlevel == 3 || self.enemy.health <= 0)
   {
      // do somthing!!
      BecomeExplosion ();
      return;
   }
   self.origin = self.enemy.origin + '0 0 25';
   if (r < 0.3) //how often hurt and scream
      T_Damage (self.enemy, self, self.owner, 1); // how much thau shalt feel thy burn
   self.nextthink = time + 0.01;
// nextthink has to be fast or the consequences will be dire >8O
};

void(vector org, entity e) Flame_Onfire =
{
   local entity flame;

   flame = spawn ();
   flame.owner = self.owner;
   flame.enemy = e;
   flame.classname = "fire";
   flame.movetype = MOVETYPE_NONE;
   flame.solid = SOLID_NOT;
   flame.origin = org;
   flame.velocity = '0 0 0';
   setmodel (flame, "progs/sphere.mdl");
   setsize (flame, '0 0 -15', '0 0 0');
   flame.nextthink = time + 0.01;
   flame.think = Flame_Think;
   flame.effects = flame.effects | EF_DIMLIGHT;
};

void() Flame_Touch =
{
   local float r;
   local vector org;

   if (other.takedamage)
   {
      org = other.origin;
      org_z = self.origin_z;
      Flame_Burn (org);
      T_Damage (other, self, self.owner, 8); // amu of dmg dnt u like sort hnd?
      remove (self); // and gon lik it nvr hppn
      r = random ();
      if (r < 0.2)// how oftn tey get on fire
      {
         if ((other.classname == "player"))
         {
            centerprint (other, " U R ON FIRE\n - SUKKS TO BE YOU!!!!!!!! -");
            stuffcmd (other,"bf\n");
         }
         Flame_Onfire (org, other);
      }
   } // *GASP* 8O
};

void() W_FireNapalm =
{
   local entity flame;

   self.currentammo = self.ammo_shells = self.ammo_shells - 3;

   sound (self, CHAN_WEAPON, "hknight/hit.wav", 1, ATTN_NORM);
   flame = spawn ();
   flame.owner = self;
   flame.movetype = MOVETYPE_FLYMISSILE;
   flame.solid = SOLID_BBOX;
   flame.classname = "fire";
   makevectors (self.v_angle);
   flame.velocity = aim (self, 100000);
   flame.velocity = flame.velocity * 500;
   flame.touch = Flame_Touch;
   setmodel (flame, "progs/s_explod.spr");
   setsize (flame, '0 0 0', '0 0 0');
   setorigin (flame, self.origin + (v_forward * 16) + '0 0 16');
   flame.nextthink = time + 0.25;   //how far awy frm brrl bfor it flms up
   // W_attack, self.attack_finished - wld contrl how clse tgter thy come oot
};
bah
MeTcHsteekle
 
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

Postby Spike » Wed Sep 03, 2008 7:55 am

Either that is old code, or you ignored what I said.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby MeTcHsteekle » Wed Sep 03, 2008 7:16 pm

...ooooh did u mean under the W_fire functin??

because what i did was i saw some of the next thinks where before the first thinks :0 ill trya and add thinks to the right places now ;]
bah
MeTcHsteekle
 
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

Postby MeTcHsteekle » Thu Sep 04, 2008 12:18 am

well it works now...kinda it sorta flys one fire out and then shoots nails :? and apperantly if i dont have nails it will skipp to the lightning gun [wich nake sence, but not wanted]

i think its the think i used

i did

w_fire napalm think as Flame_Burn hmmm perhaps Flame_Think??

that seems to make sence because thats the think function

bah i guess ill guess right eventully
bah
MeTcHsteekle
 
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

Postby Spike » Thu Sep 04, 2008 5:31 pm

I would recommend SUB_Remove.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby MeTcHsteekle » Thu Sep 04, 2008 7:50 pm

thank you the flamethrowerpart works now [extended the nextthink time] :D

now i have to figure out why it only shoots once per click and why it shoots lightning along with it [ seems to be somthing to do with the frame im starting the player in "lightattack_1" or somthing]
bah
MeTcHsteekle
 
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

Postby Orion » Thu Sep 04, 2008 8:13 pm

Instead of calling player_light1(); at W_Attack(), you can call either player_shot1(); or player_rocket1();

Otherwise the player will shoot 2 weapons at once... don't forget to call W_FireFlame(); below player_shot1() at the flamethrower attack part.

Hope this helps.
User avatar
Orion
 
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil

Postby MeTcHsteekle » Thu Sep 04, 2008 9:43 pm

oh so it has to be rock or shot ..ok ill see if i can remeber that from now on

thanks evryone :D:D:D:D:D:D:D:D:D = emence happiness
bah
MeTcHsteekle
 
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest