Respawning dead enemies
Moderator: InsideQC Admins
8 posts
• Page 1 of 1
Respawning dead enemies
I'm trying to write a simple respawning function. If an enemy is killed by the player, after an X amount of seconds another enemy is spawned in a random entity from the map.
Any ideas? Thanks in advance!
Any ideas? Thanks in advance!
- JasonX
- Posts: 411
- Joined: Tue Apr 21, 2009 2:08 pm
I'd say the "any entity" idea is prone to run-time problems like spawning monsters into walls. A more easier to do way would be "any other dead monster", like in doom nightmare mode. Also, you'll need to precache all required monster models and sounds during startup. Otherwise, it's kinda straight code.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
frag.machine wrote:I'd say the "any entity" idea is prone to run-time problems like spawning monsters into walls. A more easier to do way would be "any other dead monster", like in doom nightmare mode. Also, you'll need to precache all required monster models and sounds during startup. Otherwise, it's kinda straight code.
Oh, by any entity i meant any "info_mymonster" on the map.
How can i know when the monster is dead, so i can call the monster spawn function again?
- JasonX
- Posts: 411
- Joined: Tue Apr 21, 2009 2:08 pm
From the top of my mind, this should do the trick:
- Code: Select all
if ((monster.health <= 0) && (monster.solid == SOLID_NOT)) {
// spawn another monster
}
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest

