Inside3D!
     

monster_dogs in QW?
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Mon Sep 24, 2007 11:30 pm    Post subject: monster_dogs in QW? Reply with quote

Is it at all possible to spawn a rotweiler in QW?
I tried adding dog.qc and monsters.qc.
I precached the .wavs and .mdl files in world.qc.
It won't compile.

Am I barking up the wrong tree?
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Tue Sep 25, 2007 12:17 am    Post subject: Reply with quote

We aren't psychic. Post error messages.
Back to top
View user's profile Send private message
Orion



Joined: 12 Jan 2007
Posts: 413
Location: Brazil

PostPosted: Tue Sep 25, 2007 1:04 am    Post subject: Reply with quote

Have you ONLY added dog.qc and monsters.qc??
Man, that's why it won't compile. You should add fight.qc, and ai.qc too.

In progs.src the 4 files should be in this order:

Code:

fight.qc
ai.qc
monsters.qc
dog.qc


I hope it works... If you receive any other error, post them here and we will help you.
_________________
There's no signature here. Stop looking for one.
Back to top
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Tue Sep 25, 2007 3:21 am    Post subject: Reply with quote

Ok, I added the other 2 .qc files.
Still getting an error though.
The error is:

couldn't open file fight.qc
error in misc.qc on line 732


I tried moving the 4 files (fight.qc, ai.qc, monsters.qc, and dog.qc) around in progs.src. Always returns the same error with the exception of it's always an error in a different file. But it's always the file that preceeds these 4 new ones.
I got the fight.qc from this website. Could it be corrupt?
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Tue Sep 25, 2007 3:42 am    Post subject: Reply with quote

ok, rookie mistake. had the file named wrong.
Still errors though.

compiling fight.qc
in function CheckAttack (line 56),
fight.qc:123: error: unknown value "SUB_AttackFinished".
in function SoldierCheckAttack (line 234),
fight.qc:123: error: unknown value "SUB_AttackFinished".
in function ShamCheckAttack (line 293),
fight.qc:298: warning: Local "enemy_yaw" defined with name of a global
fight.qc:339: error: unknown value "SUB_AttackFinished".
in function OgreCheckAttack (line 353),
fight.qc:405: error: unknown value "SUB_AttackFinished".


So then I added soldier.qc, shambler.qc, and ogre.qc to progs.src below dog.qc. That didn't help though Sad
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Orion



Joined: 12 Jan 2007
Posts: 413
Location: Brazil

PostPosted: Tue Sep 25, 2007 4:07 am    Post subject: Reply with quote

Well, take out the shambler, ogre and soldier from progs.src.
SUB_AttackFinished() isn't used in QW, but you can make a new one.
Paste this code at the very bottom of subs.qc:

Code:

void(float normal) SUB_AttackFinished =
{
   self.cnt = 0;   // refire count for nightmare
   if (skill != 3)
      self.attack_finished = time + normal;
};

_________________
There's no signature here. Stop looking for one.
Back to top
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Tue Sep 25, 2007 4:33 pm    Post subject: Reply with quote

ok, couple more errors:

compiling subs.qc
in function SetMovedir (line 12),
subs.qc:25: warning: SetMovedir: not all control paths return a value
in function SubAttackFinished (line 287),
subs.qc:290: error: unknown value "skill".
subs.qc:290: error: type mismatch for != (_variant and float)


Remember I have FrikbotX installed. I guess that's where the "skill" error is coming from.

Is this what the bottom of subs.qc should look like::


Code:
//
// fire targets
//
   if (self.target)
   {
      act = activator;
      t = world;
      do
      {
         t = find (t, targetname, self.target);
         if (!t)
         {
            return;
         }
         stemp = self;
         otemp = other;
         self = t;
         other = stemp;
         if (self.use != SUB_Null)
         {
            if (self.use)
               self.use ();
         }
         self = stemp;
         other = otemp;
         activator = act;
      } while ( 1 );
   }
   

};

void(float normal) SUB_AttackFinished =
{
   self.cnt = 0;      // refire count for nightmare
   if (skill != 3)
      self.attack_finished = time + normal;
};

_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Orion



Joined: 12 Jan 2007
Posts: 413
Location: Brazil

PostPosted: Tue Sep 25, 2007 4:53 pm    Post subject: Reply with quote

Open defs.qc and add this to the very bottom:

Code:

float skill;


Now at StartFrame() in world.qc add this:

Code:

skill = cvar("skill");


"skill" cvar will be updated every frame now.
You can add the line anywhere in StartFrame(), I reccomend adding after the cvar declarations.
_________________
There's no signature here. Stop looking for one.
Back to top
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Tue Sep 25, 2007 9:27 pm    Post subject: Reply with quote

Thanks Orion!
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Wed Sep 26, 2007 12:15 am    Post subject: Reply with quote

Ok, it's all compiled but it added 38 more warnings.

Now I'm trying to get a dog to spawn each time a client logs into the server. How is this done?

I tried adding this code in PutClientInServer:

Code:
void() monster_dog =
{
   if (deathmatch)
   {
      remove(self);
      return;
   }
   precache_model ("progs/h_dog.mdl");
   precache_model ("progs/dog.mdl");

   precache_sound ("dog/dattack1.wav");
   precache_sound ("dog/ddeath.wav");
   precache_sound ("dog/dpain1.wav");
   precache_sound ("dog/dsight.wav");
   precache_sound ("dog/idle.wav");

   self.solid = SOLID_SLIDEBOX;
   self.movetype = MOVETYPE_STEP;

   setmodel (self, "progs/dog.mdl");

   setsize (self, '-32 -32 -24', '32 32 40');
   self.health = 25;

   self.th_stand = dog_stand1;
   self.th_walk = dog_walk1;
   self.th_run = dog_run1;
   self.th_pain = dog_pain;
   self.th_die = dog_die;
   self.th_melee = dog_atta1;
   self.th_missile = dog_leap1;

   walkmonster_start();
};


getting a bunch of errors though.
Then I tried adding just this:

Code:
monster_dog ();


No luck there either.
Obviously, I'm new at this. I wish I was grasping this a little better.
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Orion



Joined: 12 Jan 2007
Posts: 413
Location: Brazil

PostPosted: Wed Sep 26, 2007 1:04 am    Post subject: Reply with quote

Remove the (if (deathmatch)) stuff, otherwise the dog won't work for deathmatch.

You have put monster_dog or dog.qc before client.qc right?

The precaches you should put at the very end of worldspawn() in world.qc or at W_Precache() in weapons.qc, because you can only do precaches in spawn functions, worldspawn() is called by the engine itself, and W_Precache() is called by worldspawn().

So, a spawn function is a function called by the engine iteself or by worldspawn(). An ammo box for example is spawned by worldspawn(), you won't find any item stuff in worldspawn(), but they're "owned" by worldspawn.

You should do the following:

Add this code at the very end of PutClientInServer():

Code:

local entity dog;
dog = spawn ();
spot = SelectSpawnPoint ();
dog.origin = spot.origin;
dog.nextthink = time + 0.1;
dog.think = monster_dog;
spawn_tfog (dog.origin);
spawn_tdeath (dog.origin, dog);


There's already a SelectSpawnPoint() call at the top of the function, but we should call another one otherwise the dog will spawn inside you. I've added a tfog flash and a tdeath, that will telefrag anyone who is stuck in it.

Just a recap, do you want to spawn a dog every time a client connects to a server or every time a client respawns?

If you want every time a client connects, you should add all that stuff at the very top of ClientConnect() in client.qc, and remove'em from PutClientInserver().

And don't forget to create a (local entity dog, spot;) line to don't get errors.

PutClientInServer() is called everytime a client respawns (see respawn()), not when a client connects.

Good luck with your mod! Smile
_________________
There's no signature here. Stop looking for one.
Back to top
View user's profile Send private message
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Wed Sep 26, 2007 2:05 am    Post subject: Reply with quote

Two steps forward, one step backward.
So I moved the 4 new .qc files above client.qc in progs,src.
Two new errors:

unknown value "ThrowGib". and
unknown value "ThrowHead".


in dog.qc, function dog_die.

Quote:
And don't forget to create a (local entity dog, spot;) line to don't get errors.


What do you mean by this? Is this for defs.qc?
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Orion



Joined: 12 Jan 2007
Posts: 413
Location: Brazil

PostPosted: Wed Sep 26, 2007 2:20 am    Post subject: Reply with quote

Add this at the very top of dog.qc:

Code:

void(string gibname, float dm) ThrowGib;
void(string gibname, float dm) ThrowHead;


The entities should be at the very top of ClientConnect() in world.qc, not defs.qc.

Code:

void() ClientConnect =
{
   local entity dog, spot;


The start of the function should look like the code above.
_________________
There's no signature here. Stop looking for one.
Back to top
View user's profile Send private message
Electro



Joined: 29 Dec 2004
Posts: 241
Location: Brisbane, Australia

PostPosted: Wed Sep 26, 2007 3:13 am    Post subject: Reply with quote

cujo!
_________________
Unit reporting!
http://www.bendarling.net/
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
redrum



Joined: 28 Mar 2007
Posts: 367
Location: Long Island, New York

PostPosted: Wed Sep 26, 2007 4:04 am    Post subject: Reply with quote

OK, thanks. Try it out tomorrow.
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group