Doom3world

The world is yours! Doom 3 - Quake 4 - ET:QW - Prey - Rage
It is currently Fri Jul 30, 2010 10:05 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Interesting ways to spawn entities...
PostPosted: Fri Sep 09, 2005 4:39 am 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 5959
Location: Here, not there.
Felt that we were hijacking the "My Self-Constructing Map" thread, so I'll put this here.

I make a small map/script combo that makes a mover move on a spline as long as you're triggering it, AND it spawns zombies wherever the mover is. So, the zombies kinda have a random spawn point. Here's some vid's & the map/script file I made:

http://www.sterlingshield.net/home/stev ... 12.mov.zip
http://www.sterlingshield.net/home/stev ... 12.wmv.zip

http://www.sterlingshield.net/home/stev ... _spawn.zip


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Fri Sep 09, 2005 8:46 am 
Offline
picked up 100 armour
User avatar

Joined: Thu May 26, 2005 4:29 pm
Posts: 120
lol, that ABombGrenade is great fun :)

_________________
· [ http://www.dcs-designs.de ] · [ http://www.ns-co.net ] · [ http://www.team-mirage.net ] ·


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 09, 2005 2:16 pm 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 5959
Location: Here, not there.
oh.. yeah... i should point out that unles you have my mod installed, you won't have the cool insta-uber-kill holy hand grenade. :)


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 6:32 am 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 5959
Location: Here, not there.
I just spent about 3 hours working on a scripting setup to call a random zombie into the game. :) You'll need to change the names of the zombies (I am using custom ones) but here's all 22 zombies (minus the ones w/o heads... they were useless to me!)

Code:
//////////////////////////////////////////////////////////
//                                           //
//      random zombie spawner                //
//                                          //
//////////////////////////////////////////////////////////

void random_zombie_spawner(vector spawnpos)
{
   float num_zom_types = 22 - 1;      //number of zombie types to choose from.  ALL must be setup below!  NOTE: 1 is subtracted because the random function could pick 0
   float x = 0;            //temp counting var
   float random_x = int(sys.random(num_zom_types));         //random number generated
   entity zombie_spawn;

   sys.println(random_x);
   if (random_x == 0)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_boney");
      zombie_spawn.activate(zombie_spawn);
    }

   if (random_x == 1)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_fat");
      zombie_spawn.activate(zombie_spawn);
    }
   
   if (random_x == 2)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_fat2");
      zombie_spawn.activate(zombie_spawn);
    }

   if (random_x == 3)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_fat_wrench");
      zombie_spawn.activate(zombie_spawn);
    }
   
   if (random_x == 4)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_maint");
      zombie_spawn.activate(zombie_spawn);
    }

   if (random_x == 5)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_maint2");
      zombie_spawn.activate(zombie_spawn);
    }
   
   if (random_x == 6)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_maint_fast");
      zombie_spawn.activate(zombie_spawn);
    }

   if (random_x == 7)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_morgue");
      zombie_spawn.activate(zombie_spawn);
    }
   if (random_x == 8)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_jumpsuit");
      zombie_spawn.activate(zombie_spawn);
    }

   if (random_x == 9)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_maint_bald");
      zombie_spawn.activate(zombie_spawn);
    }
   
   if (random_x == 10)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_maint_no_jaw");
      zombie_spawn.activate(zombie_spawn);
    }

   if (random_x == 11)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_maint_nojaw");
      zombie_spawn.activate(zombie_spawn);
    }
   
   if (random_x == 12)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_maint_wrench");
      zombie_spawn.activate(zombie_spawn);
    }

   if (random_x == 13)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_maint_skinny");
      zombie_spawn.activate(zombie_spawn);
    }
   
   if (random_x == 14)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_suit_bloodymouth");
      zombie_spawn.activate(zombie_spawn);
    }

   if (random_x == 15)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_suit_skinny");
      zombie_spawn.activate(zombie_spawn);
    }

   if (random_x == 16)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_labcoat_limb");
      zombie_spawn.activate(zombie_spawn);
    }

   if (random_x == 17)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_labcoat_skinny");
      zombie_spawn.activate(zombie_spawn);
    }
   
   if (random_x == 18)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_labcoat_pipe");
      zombie_spawn.activate(zombie_spawn);
    }

   if (random_x == 19)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_tshirt_bald");
      zombie_spawn.activate(zombie_spawn);
    }
   
   if (random_x == 20)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_tshirt_blown");
      zombie_spawn.activate(zombie_spawn);
    }

   if (random_x == 21)
    {
      sys.setSpawnArg("origin", spawnpos);
      zombie_spawn = sys.spawn("monster_zombie_hs_maint_flashlight");
      zombie_spawn.activate(zombie_spawn);
    }

}



this is an example for how you'd call it (for those "new" guys who don't want to spend 3 hours like I did!)

Code:
void car_spawner()
{
   vector spawnpos1 = '680 256 24';
   vector spawnpos2 = '-712 -32 24';

   random_zombie_spawner(spawnpos1);
   random_zombie_spawner(spawnpos2);
}


of course the spawn position can be a variable, I just had definate points in mind (plus it save an entity in the long run).

Enjoy!


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 3:29 pm 
Offline
"...mostly harmless?!"
User avatar

Joined: Fri Nov 09, 2001 12:00 am
Posts: 5123
Location: UK, York
The script doesn't loop right? All it's doing is calling in 'a' monster chosen from the list?

If it looped I was wondering how you'd stop spawn fragging, is there an 'on death spawn' function?

_________________
Modeling and modding tutorials and tips


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Thu Sep 15, 2005 4:36 pm 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 5959
Location: Here, not there.
no, it's not looped. "car_spawner" is called when you trigger a trigger multi but I put in a 14 second wait there. not because I didn't want many zombies but because the computer will slow when it starts spawning lots of things in a short time.


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Fri Sep 16, 2005 4:51 am 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 5959
Location: Here, not there.
kat wrote:
If it looped I was wondering how you'd stop spawn fragging, is there an 'on death spawn' function?


forgot to say earlier that you can't spawn frag, only telefrag. Whe spawned in the same spot, entites don't doanything. They just keep piling up. :)

That's not why I posted though... I was playing with my script & watched "the hitchhikers guide to the galexy" dvd today... and I love the way the "Heart of Gold" appears/disapears from teleporting... so I made something simular with d3. :)

Of course I made some videos (mov wmv) and have happly included the map/script for people to look at.

Basicly, when you enter a teleporter, it will randomly spawn 9 "things" (ranging from monsters to bfg's to mop buckets) & then make them disapear (sorry, didn't spend the time to put in a cool looking "poof" effect).

Then you pop out. :)


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Sat Sep 17, 2005 4:53 pm 
Offline
is sad because his cool title went away
User avatar

Joined: Sat Mar 08, 2003 3:14 pm
Posts: 684
Location: Americanized
I like this Friar. Thanks for sharing it.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 17, 2005 7:35 pm 
Offline
Captured the Flag

Joined: Thu Jan 06, 2005 8:56 pm
Posts: 1880
Location: 127.0.0.1
Maybe to make this truly HHGTTG, you could move the player to a random (read: improbable) part of the map after the teleport ;)

_________________
Check out Classic Doom 3!
Support OmegaDrive


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Sat Sep 17, 2005 8:06 pm 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 5959
Location: Here, not there.
actuatly that's 100% possible if you use random intigers to assign the origin points, but odds are most of the time you'd wind up in the void. :)

A possible way to do that it to make a new rand_teleport_dest texture with a func_rand_teleport_dest function. Then you can have the teleporter scan for all instances of "func_rand_teleport_dest" instances, picks a random one, THEN it picks a random point in that entity to spawn too, minus 74 units from it's bounding box top.. so you don't spawn in the cieling. :)

very good idea!

_________________
Fuzzy Logic Inc
PAINTBALL DOOM 3!!!!
Check out my Q2 server! q2server.fuzzylogicinc.com :D
Doom 3, Paintball! d3server.fuzzylogicinc.com


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Sat Sep 17, 2005 8:13 pm 
Offline
Captured the Flag

Joined: Thu Jan 06, 2005 8:56 pm
Posts: 1880
Location: 127.0.0.1
Of course it's possible ;)

The texture/func idea would work, but it would probably be even more practical to pick a random point (perhaps grab the min-max of x,y,z and make that your range) and test to see if the player's bounding box would fit without being in the void or in a brush.

Ah, dynamics.

_________________
Check out Classic Doom 3!
Support OmegaDrive


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Sun Sep 18, 2005 1:03 am 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 5959
Location: Here, not there.
that would be easier in the short run, but with the theoritical limit of D3 levels (i heard one is ws ~13km?), that's a LOT of points to cover. :) searching within a function would just eliminate a lot of possible void spawns.

I was thinking I could even use this idea on a weapon: the telefrag gun. Basicly, you pull the trigger & you teleport to the location of a random monser (or player in MP). Of course it could be worse to do that, but that would be the fun (fire the gun to avoid being hit by a BFG only to telefrag a guy who was falling into the void!)

_________________
Fuzzy Logic Inc
PAINTBALL DOOM 3!!!!
Check out my Q2 server! q2server.fuzzylogicinc.com :D
Doom 3, Paintball! d3server.fuzzylogicinc.com


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Sun Sep 18, 2005 2:34 am 
Offline
Captured the Flag

Joined: Thu Jan 06, 2005 8:56 pm
Posts: 1880
Location: 127.0.0.1
The Happy Friar wrote:
that would be easier in the short run, but with the theoritical limit of D3 levels (i heard one is ws ~13km?), that's a LOT of points to cover. :)


Not if you shortened your range of searching to the min-max of the map on each axis. You'd still get voidspace, but not as much.

Telefrag gun sounds fun, but how would somebody get out into the void? :P

_________________
Check out Classic Doom 3!
Support OmegaDrive


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Sun Sep 18, 2005 3:20 am 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 5959
Location: Here, not there.
if you limited the area to a certain part of the map then you wouldn't be able to random spawn anywhere, just in a certain area. That still could be usefull though. :)

Sorry, I didn't mean void, I meant one of those instant-death pits.

_________________
Fuzzy Logic Inc
PAINTBALL DOOM 3!!!!
Check out my Q2 server! q2server.fuzzylogicinc.com :D
Doom 3, Paintball! d3server.fuzzylogicinc.com


Top
 Profile E-mail  
 
 Post subject: guis
PostPosted: Mon Sep 19, 2005 11:02 am 
Offline
picked up 100 armour

Joined: Wed Jun 08, 2005 11:33 am
Posts: 129
Location: Decatur, Alabama---USA
hey happy have a question you should be able to answer......

ok i have a cabinet where you put the code in and it opens
easy enough right.....
well its always unlocked from that point on... what im wanting it to do is have it relock like this

1. enter code
2. cabinet opens
3. get stuff in cabinet
4. cabinet door closes
5 gui resets and door relocks

i do not have a clue about how to script so in the entity editor is there a perameter i can set the gui so it will reset
if so please share what i need to have the key and value to make it work...

sorry if im off the subject....


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 19, 2005 2:55 pm 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 5959
Location: Here, not there.
i don't know how GUI's work, sorry.. but i'll try & help.

is the cabinet opening a mp5anim or something else (ie a model moving)? If it an md5, you'd probley need a closing animation. Me (perosonally), I'd find the md5anim file & try reversing the sequence by hand , ie making a new md5anim file & placing the last frame first (not the frame numbers, just the coords), etc.

if it was a cabinet I made (from brushes) then I'd just write a trigger/script combo. when you open the cabinet it places a triger_multi is right behind you, far enough away so that when you want away it shuts the cabinet. it calls a script that shuts the cabinet (a rotate call, move, something). Make sure you have something in the script that checks to see if the cabinet is alreay open.

in eather case, after the door shuts, I belive you could use a script to re-set the GUI settings. That's the part where I'm not sure what to do.

_________________
Fuzzy Logic Inc
PAINTBALL DOOM 3!!!!
Check out my Q2 server! q2server.fuzzylogicinc.com :D
Doom 3, Paintball! d3server.fuzzylogicinc.com


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Mon Sep 19, 2005 3:05 pm 
Offline
picked up 100 armour

Joined: Wed Jun 08, 2005 11:33 am
Posts: 129
Location: Decatur, Alabama---USA
well actually its a door that im useing a gui cabinet lock code on. But its the same princaple. After looking at the lights out power generator, its scripted, i would have to assume if it were easier than a script they would have just done it in the entity editor.......thanks for your reply--- scripting sucks, to many variables that have to be "exact" to be worth while i think


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 20, 2005 9:05 pm 
Offline
is sad because his cool title went away
User avatar

Joined: Sat Mar 08, 2003 3:14 pm
Posts: 684
Location: Americanized
Quote:
scripting sucks, to many variables that have to be "exact" to be worth while i think


You'd probably make more progress with things such as your random lock GUI if you just stuck it out with the scripting system. As anal as it is, it's still very powerful.


Top
 Profile  
 
 Post subject: gui
PostPosted: Tue Sep 20, 2005 10:50 pm 
Offline
picked up 100 armour

Joined: Wed Jun 08, 2005 11:33 am
Posts: 129
Location: Decatur, Alabama---USA
i agree but i do not have a clue so i have to just make due
tried it before but no luck and i do not feel like being upset over it , lol


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 21, 2005 2:31 am 
Offline
Very Senior Forum Poster
User avatar

Joined: Sun May 29, 2005 10:02 pm
Posts: 5959
Location: Here, not there.
i'd just recomend you keep trying. A few mnths ago icouldn' cript a mover to a spline.

Now I spawn from them. :D

_________________
Fuzzy Logic Inc
PAINTBALL DOOM 3!!!!
Check out my Q2 server! q2server.fuzzylogicinc.com :D
Doom 3, Paintball! d3server.fuzzylogicinc.com


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group