View previous topic :: View next topic |
Author |
Message |
Jukki
Joined: 07 Apr 2010 Posts: 19
|
Posted: Sun Aug 01, 2010 5:27 am Post subject: spawing monsters |
|
|
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) |
|
Back to top |
|
 |
Arkage
Joined: 19 Nov 2009 Posts: 27
|
Posted: Sun Aug 01, 2010 5:36 am Post subject: |
|
|
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. |
|
Back to top |
|
 |
Jukki
Joined: 07 Apr 2010 Posts: 19
|
Posted: Sun Aug 01, 2010 5:41 am Post subject: |
|
|
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? |
|
Back to top |
|
 |
Arkage
Joined: 19 Nov 2009 Posts: 27
|
Posted: Sun Aug 01, 2010 5:56 am Post subject: |
|
|
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. |
|
Back to top |
|
 |
Jukki
Joined: 07 Apr 2010 Posts: 19
|
Posted: Sun Aug 01, 2010 6:00 am Post subject: |
|
|
ok thx arkage
so basicaly. i could merge sams and player spawn together?
and thanx for that self thing |
|
Back to top |
|
 |
frag.machine

Joined: 25 Nov 2006 Posts: 728
|
Posted: Sun Aug 01, 2010 3:10 pm Post subject: |
|
|
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.  _________________ frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/ |
|
Back to top |
|
 |
hondobondo
Joined: 26 Sep 2006 Posts: 101
|
Posted: Sun Aug 01, 2010 4:13 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
Jukki
Joined: 07 Apr 2010 Posts: 19
|
Posted: Sun Aug 01, 2010 6:04 pm Post subject: |
|
|
thx all. arkage especialy ( he helped me with this )
i made zombies spawn in different round and to monster_knight etity i am gona use that thing you gaved me hono boy because the spawn to same place >__< |
|
Back to top |
|
 |
|