[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/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/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/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/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/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 - monster_spawn function?

monster_spawn function?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

monster_spawn function?

Postby ceriux » Mon Mar 12, 2012 6:02 am

yes im making a wave based mod for my own use, but the problem iv come across is this. i cant get it to work! i tried doing if (wave == x) {monster_army} this obviously doesn't work. so iv been trying to use e = spawn(); and in monster_army i set entity = soldier; . but i think this just gave me an error when trying to call soldier = spawn(); from my monster_spawn function. what am i doing wrong? what do i need to do to fix it?
User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: monster_spawn function?

Postby Baker » Mon Mar 12, 2012 8:02 am

DMSP is a mod that spawns monsters in deathmatch maps, which is why it is called DMSP. (Deathmatch single player). http://strlen.com/maps/dmsp/index.html

Back story done, continuing ... this mod spawns monsters out of thin air.

1) dmsp.qc thread: viewtopic.php?t=2587 where hondobondo shares dmsp.qc which I guess he got from Aardappel.
2) This .qc file is in the download here: http://www.moddb.com/members/hondobondo ... collection
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: monster_spawn function?

Postby andrewj » Mon Mar 12, 2012 10:35 am

andrewj
 
Posts: 133
Joined: Mon Aug 30, 2010 3:29 pm
Location: Australia

Re: monster_spawn function?

Postby Ace12GA » Mon Mar 12, 2012 1:20 pm

I wrote some code that semi randomizes the monster spawns for soldiers, dogs, and enforcers, in single player maps. Its in this thread: viewtopic.php?f=2&t=4776

Essentially I used some logic to determine where near an existing spawn I could spawn a monster, and randomly picked how many to spawn. It is straight forward enough, and effective.
Ace12GA
 
Posts: 56
Joined: Sat Jan 28, 2012 12:08 am

Re: monster_spawn function?

Postby ceriux » Mon Mar 12, 2012 5:29 pm

thanks for the info guys ill be sure to look into it all.
User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: monster_spawn function?

Postby ceriux » Mon Mar 12, 2012 6:19 pm

so basically i have to make a selectspawnpoint for my monsters. similar to the one for the player. then dependent on the wave tell it to spawn one? thats okay, but what if i wanted to spawn 3 or 4 of one monster or 2 of one and 3 of another?
User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: monster_spawn function?

Postby Ace12GA » Mon Mar 12, 2012 7:10 pm

Ace12GA
 
Posts: 56
Joined: Sat Jan 28, 2012 12:08 am

Re: monster_spawn function?

Postby ceriux » Tue Mar 13, 2012 5:51 am

so, creating a wave based monster spawner is seriously this indepth? it seems like it should be easier... ugh my qc is rusty again..

also im not sure if iv seen qc that uses while? and why do you need a random number?

also found , going to look through it as i try to understand your code. just to see if its any similar so i can compare and learn something.

and does anyone think it would be easier to adapt something like this to my purpose? instead of spawning a bot that acts like a monster actually use it to spawn my monsters? http://quakewiki.net/archives/aicafe/tu ... tutor9.htm
User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: monster_spawn function?

Postby Ace12GA » Tue Mar 13, 2012 12:44 pm

I used random just to create a certain degree of randomness to how many of each monster is spawned. It was purely an example. Yes, qc can use while loops. The id code does it, I do it, and it works quite nicely. It would be insanely hard to do a lot of things without a looping structure or two.
Ace12GA
 
Posts: 56
Joined: Sat Jan 28, 2012 12:08 am

Re: monster_spawn function?

Postby ajay » Tue Mar 13, 2012 7:59 pm

My current mod, which is basically a wave gametype, cunningly hidden in a story, has avoided all this spawning malarky while I've been testing and just used teleporting monsters. It can't really stay like that, as it gets bigger and more complicated. This code is properly helpful, though, being a control freak with a 'story' to tell, I'll not be randomising
User avatar
ajay
 
Posts: 559
Joined: Fri Oct 29, 2004 6:44 am
Location: Swindon, UK

Re: monster_spawn function?

Postby frag.machine » Wed Mar 14, 2012 1:28 am

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: 2120
Joined: Sat Nov 25, 2006 1:49 pm

Re: monster_spawn function?

Postby ceriux » Wed Mar 14, 2012 2:37 am

well, when i get my code bug free. ill post the src up.
User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: monster_spawn function?

Postby ceriux » Wed Mar 14, 2012 3:55 am

User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: monster_spawn function?

Postby ceriux » Fri Mar 16, 2012 4:44 am

okay in attempting to make my wave coding easier, i tried setting soldiers back to 0 at the beginning of a new round, which causes a problem like the one above where craploads of monsters keep spawn and continuously explode... how can i do this with out this problem?
User avatar
ceriux
 
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: monster_spawn function?

Postby goldenboy » Fri Mar 16, 2012 5:34 pm

User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 2 guests