Forum

spawing monsters

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

spawing monsters

Postby Jukki » Sun Aug 01, 2010 5:27 am

hello hello. game wich i am making is round based. There will be unlimited amount of them. Every round there will spawn more and more zombies. my question is

1. how i can make them spawn in right place (my old code MADE them spawn but to origon. (middle)

2.then how i make them spawn so they dont get on top of each other.

i would realy be happy if you help me with this. I am still dump...

(btw. i am using lil modified knight)
Jukki
 
Posts: 214
Joined: Wed Apr 07, 2010 4:59 am

Postby Arkage » Sun Aug 01, 2010 5:36 am

Have look at the select spawn point code for the players re-spawn, I cant remember the function name. Then copy it to work with you spawn entity, eg, info_zombie_spawn.

You will then need to edit the monsters main function to take a vector as a parameter.

Then you will need to store a copy of self, set the position of the monster and then restore self (self in this case will be the player as the match has already started when the zombies are spawning) to the back up (I had the odd bug where I was the monster with out it :) ).

Then just in you wave code pick a random spawn and call the monsters spawn function. I think there is a thread on here that deals with some thing similar.

Note: parts of what i have said might not make sense, it 6.35 am.
User avatar
Arkage
 
Posts: 66
Joined: Thu Nov 19, 2009 4:17 pm

Postby Jukki » Sun Aug 01, 2010 5:41 am

Arkage wrote:Have look at the select spawn point code for the players re-spawn, I cant remember the function name. Then copy it to work with you spawn entity, eg, info_zombie_spawn.

You will then need to edit the monsters main function to take a vector as a parameter.

Then you will need to store a copy of self, set the position of the monster and then restore self (self in this case will be the player as the match has already started when the zombies are spawning) to the back up (I had the odd bug where I was the monster with out it :) ).

Then just in you wave code pick a random spawn and call the monsters spawn function. I think there is a thread on here that deals with some thing similar.

Note: parts of what i have said might not make sense, it 6.35 am.


yes i tryed to copy paste and edit player respawn function but no succes

and yes there was a post by samuk BUT he spawning was where the old died

what you mean by copy of selfO.o?
Jukki
 
Posts: 214
Joined: Wed Apr 07, 2010 4:59 am

Postby Arkage » Sun Aug 01, 2010 5:56 am

local entity old_self;
old_self = self;

// set the monster origin

self = old_self;

Self in this case points to the player so if set the origin with out doing that it would change the players origin.

That thread by Sam is the one I meant. The Principals are the same, instead of spawning it at the spot where the pod died give it the co ords of the spawn point.
User avatar
Arkage
 
Posts: 66
Joined: Thu Nov 19, 2009 4:17 pm

Postby Jukki » Sun Aug 01, 2010 6:00 am

ok thx arkage

so basicaly. i could merge sams and player spawn together?

and thanx for that self thing
Jukki
 
Posts: 214
Joined: Wed Apr 07, 2010 4:59 am

Postby frag.machine » Sun Aug 01, 2010 3:10 pm

Jukki wrote:ok thx arkage

so basicaly. i could merge sams and player spawn together?

and thanx for that self thing


I suggest you read the cited code an try to understand what's happening instead of just copy, paste & pray to work. :)
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby hondobondo » Sun Aug 01, 2010 4:13 pm

go here:

http://www.moddb.com/members/hondobondo/downloads/classic-bondo-mod-collection and look at gfdmsp.exe

look at the code under misc, dmsp.qc. you'll need to track down all the variables and function calls in world.qc and defs.qc. this is from aardappel's dmsp mod. it will solve all your problems. the two functions in dmsp.qc will both select a spawn point and cycle to the next empty spawn point. i even figured out a way to spawn a mob instead of just one monster, but that's not in there

if you want i could probably email this one file. it's pretty small
hondobondo
 
Posts: 207
Joined: Tue Sep 26, 2006 2:48 am

Postby Jukki » Sun Aug 01, 2010 6:04 pm

thx all. arkage especialy ( he helped me with this :P )

i made zombies spawn in different round :D and to monster_knight etity i am gona use that thing you gaved me hono boy because the spawn to same place >__<
Jukki
 
Posts: 214
Joined: Wed Apr 07, 2010 4:59 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest