posted 03-08-2002 08:17 AMI want to have spiders running around on the floors of my level that you can squish or shoot, the insect would only need to run around and do nothing, and when you walk over it or shoot it, the spider will die. ive been thinking on how to do this, im not sure but can all this be done in the bot scripts? or would i need some code?
Anyone got some ideas or pointers on this topic please do post it, links one simmilar topics are also welcome.
posted 03-08-2002 04:28 PMSounds complicated Hunter, been looking at the bot scripts, not much controll in those, not even move speed and couldent get it to not use weapons or not pick up some of them.
Seems it will require alot more work then i thought, thanks for the help Hunter but i dont understand what you mean but im gonna poke around in the bot codes and gonna see if i can find anything about the stuff your talking about.
ofc, any additional pointers on where to start in the code would be great.
posted 03-08-2002 05:48 PMUhhh sorry .... using the botcode for such simple things is pure overkill. A new entitytype masked as damageable with a touch function, a periodically called think function will do the job nice and smooth. Of course with proper code on the client side for drawing.
Plus for spawning just create a new entity(-type) like "roach spawner" that spawns a mapper specified number of roaches at it's origin. And cares for keeping the number of roaches in game constant.
I.e. when a roach is killed just make it spawn a new one (easy to do by setting the parent entity of each roach to the spawner which spawned it).
- Acryl
[This message has been edited by Acryl : 03-08-2002.]
Just wait till I get my monster code done , I'll write 3 or more tutorials on getting some monsters or enemies to work. Would be nice for your coak-roach.
------------------ [PR]JazzD, Team leader and lead coder of Mage Legend:Fortress of Darkness Prsoftware at planetquake!
about not using the bot code for the roach: I want it to move around and away from the players and maybe even nibble at dead player corpses, then doing it as a bot wouldent be overkill? And using bot code would take much less coding or am i mistaken.
Originally posted by Acryl: Uhhh sorry .... using the botcode for such simple things is pure overkill. A new entitytype masked as damageable with a touch function, a periodically called think function will do the job nice and smooth. Of course with proper code on the client side for drawing.
Plus for spawning just create a new entity(-type) like "roach spawner" that spawns a mapper specified number of roaches at it's origin. And cares for keeping the number of roaches in game constant.
I.e. when a roach is killed just make it spawn a new one (easy to do by setting the parent entity of each roach to the spawner which spawned it).
- Acryl
[This message has been edited by Acryl : 03-08-2002.]
True...but I'm not a mapper so the code side just kinda came to me first. Plus, with a little more code it could be possible to spawn these into any map.
...with a little more code it could be possible to spawn these into any map.
]-[ ~ ]<
hmm I think with less code because it's easier to let them just spawn somewhere, I did it like this with my monsters first, it was quite hard to let them be placeable in the editor.
Randomly spawning entities out of "thin air" is not easier than creating a new entity flag. There are many, many considerations to do this effectively.
Originally posted by -=Hunter-Killer=-: True...but I'm not a mapper so the code side just kinda came to me first. Plus, with a little more code it could be possible to spawn these into any map.
Neither am I ... and I was talking about the code side. Creating a completely new EntityType like ET_MONSTER (or ET_ROACH in this case) isn't that much work as most people expect. And additional spawner entity needs even less coding, but ok ... if you don't care where your roaches spawn it's definitely no problem to have them spawn randomly in the map.
@Mayday: No matter what you want them to do, an entirely new entity will suit your needs best. Using the botcode is still overkill since bots are emulating clients whose behaviour is way more complex than the one of roaches. All of the things you mentioned can be done rather easily done.
When you create a new entity type you can hook the move function for your roaches into G_RunFrame like:
code:
if ( ent->s.eType == ET_ROACH ) { G_RunRoach( ent ); continue; }