Inside3D!
     

monster_dogs in QW?
Goto page Previous  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: Wed Sep 26, 2007 4:44 pm    Post subject: Reply with quote

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


I only found Clientconnect() in client.qc.?

So I put it there, I'm still not spawning cujo.

Check this code for me:

Code:
                void() monster_dog =                                                       //cujo
{
                self.solid = SOLID_SLIDEBOX;
                self.movetype = MOVETYPE_STEP;
                setmodel (self, "progs/dog.mdl");

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

                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();

                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);

};


This is at the end of void() PutClientInServer =

Getting an error:
error: expected;, found monster_dog
_________________
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: 414
Location: Brazil

PostPosted: Wed Sep 26, 2007 5:02 pm    Post subject: Reply with quote

Sorry, I got confused.
ClientConnect() is in client.qc, and add the code at the very bottom of ClientConnect():

Code:

local entity dog, spot;                                                               
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);


You can't put any function inside another function.
Remove the code above from monster_dog(), and move monster_dog() out PutClientInServer(), move monster_dog() above PutClientInServer().

PS: Go to the PasteBin, that I've posted modified ai.qc, fight.qc and server.qc, otherwise you may get "function was not defined" errors.
Don't forget to backup the original ones.

ai.qc:
http://www.inside3d.com/pastebin.php?action=show&id=158

fight.qc:
http://www.inside3d.com/pastebin.php?action=show&id=159

server.qc:
http://www.inside3d.com/pastebin.php?action=show&id=160
_________________
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 8:17 pm    Post subject: Reply with quote

error: monster_dog redeclared, prev instance in dog.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: 414
Location: Brazil

PostPosted: Wed Sep 26, 2007 10:26 pm    Post subject: Reply with quote

Remove monster_dog from dog.qc.
_________________
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: Thu Sep 27, 2007 3:45 am    Post subject: Reply with quote

No more errors! Very Happy

No cujo 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: 414
Location: Brazil

PostPosted: Thu Sep 27, 2007 3:51 am    Post subject: Reply with quote

Have you put the specified code at the very bottom of ClientCommect() (client.qc)?

If you put, the dog won't spawn inside you, he'll spawn anywhere in the map, in any respawn spots. Mabe you didn't find one.
Just sometimes he'll spawn inside you, and when this occurs, he telefrags himself.
_________________
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: Thu Sep 27, 2007 4:32 am    Post subject: Reply with quote

Here's my ClientConnect:

Code:
void() ClientConnect =
{
        local entity dog, spot;                                                          //cujo
        ClientInRankings(); // FrikBot                                                   //frikbot
   bprint (PRINT_HIGH, self.netname);
   bprint (PRINT_HIGH, " entered Spisi's Fragfest!\n");
   
        // a client connecting during an intermission can cause problems
   if (intermission_running)
      GotoNextMap ();
        //stuffcmd(self, "impulse 100;\n");                                              //adds a bot when player connects to server


        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);

};


Server error message:

Client redrum connected
redrum entered Spisi's Fragfest!
CALL1 13912(visible)()
ai.qc : FindTarget
ai.qc : ai_stand
dog.qc : dog_stand1
<NO FUNCTION>
NULL function
SV_Error: Program error


BTW thanks for your time and patience! Smile
_________________
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: 414
Location: Brazil

PostPosted: Thu Sep 27, 2007 4:37 am    Post subject: Reply with quote

Weird...
Try this:

At the very bottom of monster_dog there's a walkmonster_start() call.
Change it to walkmonster_start_go(); and add a (self.classname = "monster_dog"Wink line at the very top of monster_dog().
_________________
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: Thu Sep 27, 2007 4:50 am    Post subject: Reply with quote

Errors, (expected;, found self) here's the code:

Code:
void() monster_dog =                                                                        //cujo
{
                self.classname = "monster_dog"
                self.solid = SOLID_SLIDEBOX;
                self.movetype = MOVETYPE_STEP;
                setmodel (self, "progs/dog.mdl");

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

                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_go();
           
};

_________________
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: 414
Location: Brazil

PostPosted: Thu Sep 27, 2007 4:59 am    Post subject: Reply with quote

The semicolon at the end of self.classname = "monster_dog" is missing, the emoticon hidden it.
It should be:

self.classname = "monster_dog";
_________________
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: Thu Sep 27, 2007 5:05 am    Post subject: Reply with quote

Damn, I should have noticed that!

Anyway, didn't work. Server error:

Client redrum connected
redrum entered Spisi's Fragfest!
walkmonster in wall at: ' 0.0 -142.0 -183.0'
CALL1 13912(visible)()
ai.qc : FindTarget
ai.qc : ai_stand
dog.qc : dog_stand6
<NO FUNCTION>
NULL function
SV_Error: Program error

_________________
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: Thu Sep 27, 2007 5:12 am    Post subject: Reply with quote

Ok, I was able to log in without the server crashing. Smile
I then switched to spectator mode. I saw cujo! Smile
I then reconnected in normal mode. When I came into cujo's view it then crashed. Sad
I tried it twice, and the same thing happened.
_________________
Welcome to the Overlook Hotel 69.113.123.178:27500
Back to top
View user's profile Send private message Send e-mail
Preach



Joined: 25 Nov 2004
Posts: 122

PostPosted: Thu Sep 27, 2007 9:53 am    Post subject: Reply with quote

The error seems to be suggesting that the function called "visible" is a null_function. That probably means you've made a prototype for the function but not actually defined it. If you add the "visible" function to the end of the ai file then it should prevent that crash.
Back to top
View user's profile Send private message
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Thu Sep 27, 2007 11:15 am    Post subject: Reply with quote

Is it even compileable without defining prototypes? Or maybe that's just a warning?
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
Preach



Joined: 25 Nov 2004
Posts: 122

PostPosted: Thu Sep 27, 2007 12:49 pm    Post subject: Reply with quote

Urre wrote:
Is it even compileable without defining prototypes? Or maybe that's just a warning?


Pretty sure it's just a warning in fte and probably frikqcc since they support all the function pointers stuff. Prototyping is kinda like defining the function and assigning it a null pointer, then giving it the correct pointer when you actually define it (I'd imagine). Having a null pointer for a function might be useful for extension checking or something.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 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