[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Random monster spawning

Random monster spawning

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Random monster spawning

Postby Biodude » Sun Nov 13, 2011 1:17 am

Hey, what would it take to make a box in world craft, and inside that box monsters randomly spawn on a timer. The box would be invisable ingame, but what could I do to make this? would the only way be making a ton of random monster spawns on timers or what?

thanks
User avatar
Biodude
 
Posts: 186
Joined: Wed Aug 27, 2008 7:17 pm

Re: Random monster spawning

Postby Alex » Mon Nov 14, 2011 3:51 pm

I think part of the problem there would be making sure monsters don't spawn in places that they can't (like inside a wall) or places that they shouldn't (over some lava, or a corner where they get stuck).

Maybe you can populate the area you are looking at with something like a bunch of info_player_deathmatch's and use some of the code in client.qc for random monster respawns.

Not sure exactly how you wanted to use this, but if your aim was to add some randomness to the monster placing (since, if you play a level enough you get to know where all the badguys are and it gets predictable and boring), you could always do this:

In worldcraft, if you know you want to have a monster dog in a certain room, place 4 of them in different spots. Rename them all to monster_dog_random. In the dog.qc, copy void () mosnter_dog and rename it monster_dog_random. Add in a random function that determines whether the dog spawn actually takes place (as is seen in weapons.qc for the axe animation).
if (r > .25) {
return;
}
else {
spawn the dog.

On average you'll get 1 dog in that room. Sometimes there might be 0, other times, 4. That's a basic way of doing it, but it helps shake things up a bit and ad some randomness.

Alex
Alex
 
Posts: 24
Joined: Sun Feb 13, 2011 6:24 pm

Re: Random monster spawning

Postby goldenboy » Wed Nov 16, 2011 8:58 am

I know two things that would get you halfway there.

1. Hordespawn. The code for func_hordespawn is both in Chapters and RMQ. Originally from Scourge of Armagon, IIRC. You would have to expand the code so the spawned monsters use a randomly selected classname and spawn function (out of a list), and basically set the count or duration to infinite. Would do what you asked, but it's a point entity, not a box. Simply continuously spawns (spams?) monsters in a certain interval and basically swamps the player in monsters. Infamously used in some Quoth maps to hordespawn Vorelings.

2. Pineapple's Randomizer. Part of RMQ (don't know if this was released standalone). This requires pre-selection and placement of the monsters you want to spawn. This would work if you only wanted a limited amount of monsters to spawn. It is more aimed at (pseudo-) randomly populating a map every time you play than continuous spawning.

This isn't quite what you asked for, but you could probably use it to get there. You didn't say what you wanted it for, though. :wink:
User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Re: Random monster spawning

Postby hondobondo » Tue Nov 22, 2011 2:34 am


hondobondo
 
Posts: 207
Joined: Tue Sep 26, 2006 2:48 am

Re: Random monster spawning

Postby Biodude » Thu Nov 24, 2011 2:16 pm

I'll check it out, thanks guys :)
User avatar
Biodude
 
Posts: 186
Joined: Wed Aug 27, 2008 7:17 pm


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 3 guests