Spawn Question?


(Benfun7) #1

Hi,
Can someone tell me, or give me a link of a tutorial that tells how to make it so you spawn at a differnt place after an object is exploded? Just like how you spawn at the second location after the tank blows the tunnel doors on fuel dump?
Thanks,
Ben


(nUllSkillZ) #2

You could take a look at Goldrush Map and Script.


(Benfun7) #3

Ok I hate to say it but… I looked over both the script and the map file. Dont want to sound dumb but all I could figure out is, I need a team_ctf_bluespawn in the second place I want to spawn and I need the script to tell the game to make me spawn there when a certin object is exploded. Can somone please tell me the rest? Or are there any tutorials about that? Please someone.

Thanks,
Ben


(Orange) #4

Have you searched the forums yet?
This has been discussed 8*10^234 times already.
Look for “forward spawn”. Good luck.


(nUllSkillZ) #5

Goldrush Map + Script as example

There are three “team_WOLF_objective”-entities:

[ol]
[li]Allied 1st Spawn
[/li][list:bb1e84c3a8]
[li]classname: team_WOLF_objective
[/li][li]targetname: alliedspawnblob
[/li][li]scriptname: alliedspawnblob
[/li][li]spawnflags: 2 ( = default_allies)
[/li][li]description: Allied Spawn
[/li][/ol]
[li]Axis 1st Spawn = Allied 2nd Spawn
[/li][ul]
[li]classname: team_WOLF_objective
[/li][li]targetname: tankdepotblob
[/li][li]scriptname: tankdepotblob
[/li][li]spawnflags: 1 ( = default_axis)
[/li][li]description: Tank Depot
[/li][/ul]
[li]Axis 2nd Spawn
[/li][ul]
[li]classname: team_WOLF_objective
[/li][li]targetname: axisspawnblob
[/li][li]scriptname: axisspawnblob
[/li][li]spawnflags: 1 ( = default_axis)
[/li][li]description: Axis Spawn
[/li][/ul]
[/list:o:bb1e84c3a8]

The “Tank Depot”-spawn is the one that will change on a certain event.

All the “team_CTF_bluespawn”-entites at the “Tank Depot”-spawn have the following key/value-pairs:

[ul]
[li]classname: team_CTF_bluespawn
[/li][li]spawnflags: 1 ( = invulnerable)
[/li][li]targetname: tankdepot_allied_spawns
[/li][li]sriptname: tankdepot_allied_spawns
[/li][/ul]

All the “team_CTF_redspawn”-entites at the “Tank Depot”-spawn have the following key/value-pairs:

[ul]
[li]classname: team_CTF_redspawn
[/li][li]spawnflags: 3 ( = invulnerable + startactive)
[/li][li]targetname: tankdepot_axis_spawns
[/li][li]sriptname: tankdepot_axis_spawns
[/li][/ul]

“team_CTF_bluespawn”-entities at allied 1st spawn:

[ul]
[li]classname: team_CTF_bluespawn
[/li][li]spawnflags: 3 ( = invulnerable + startactive)
[/li][li]targetname: alliedspawn
[/li][li]sriptname: alliedspawn
[/li][/ul]

“team_CTF_redspawn”-entities at axis 2nd spawn:

[ul]
[li]classname: team_CTF_redspawn
[/li][li]spawnflags: 3 ( = invulnerable + startactive)
[/li][li]targetname: axisspawn
[/li][li]sriptname: axisspawn
[/li][/ul]

First you set the spawns as they should be at the beginning:


game_manager
{
	spawn
	{
		// ...
		// syntax: setautospawn <target spawn> <team>
		// with <targetspawn> = value of the description key
		setautospawn	"Tank Depot"	0
		setautospawn	"Allied Spawn"	1
		// ...
	}
	// ...
}

If a certain event takes place a trigger within the “game_manager”-scriptblock is called (in this case “allies_steal_tank”).
Within this trigger-scriptblock the spawns are changed:


game_manager
{
	// ...
	trigger allies_steal_tank
	{
		// ...

		alertentity tankdepot_axis_spawns
		alertentity tankdepot_allied_spawns
		alertentity tankdepotblob		// Tank Depot team_WOLF_objective

		setautospawn	"Axis Spawn"	0
		setautospawn	"Tank Depot"	1

		// ...
	}
	// ...
}

I think thats all you need.


(Benfun7) #6

Yes that will do it I think. Thanks so much for explaining that in depth.

Thanks again,
Ben


(Benfun7) #7

The last thing I do not understand is, how do you make is so you spawn there when somthing is blown up instead of when the tank is stolen?

Thanks,
Ben


(nUllSkillZ) #8

Just call the trigger “allies_steal_tank” from the death-event of the “func_explosive”-entity.


(Loffy) #9

Hi!
The thing you want to dynamite, it is a func_explosive?
// Loffy


(Benfun7) #10

Yes, It is a big steal door like on the depot on fueldump. :slight_smile:
Ben


(lysek) #11

hey can u tell me how do u lookup a fueldump.map ? is there a way to de-bsp the map ?


(Benfun7) #12

I just got around to working on my map. Now I am getting this error? Can you please tell me what I did wrong?

Thanks,
Ben

game_manager 
{ 
   spawn 
   { 
      // ... 
      // syntax: setautospawn <target spawn> <team> 
      // with <targetspawn> = value of the description key 
      setautospawn   "Tank Depot"   0 
      setautospawn   "Allied Spawn"   1 
      // ... 
   } 
   // ... 
} 
game_manager
{ 
   // ... 
   trigger allies_steal_tank 
   { 
      // ... 

      alertentity tankdepot_axis_spawns 
      alertentity tankdepot_allied_spawns 
      alertentity tankdepotblob      // Tank Depot team_WOLF_objective 

      setautospawn   "Axis Spawn"   0 
      setautospawn   "Tank Depot"   1 

      // ... 
   } 
   // ... 
} 
           
depotgate 
{
   spawn
   {
   wait 200 
   constructible_class 3
   }

   death
   {
   allies_steal_tank
   }
}
antenna 
{
   spawn
   {
   wait 200 
   constructible_class 3
   }

   death
   {
   wm_endround
   }
}
bridge
{ 
   spawn 
   { 
      wait 200 
      constructible_class 2 
      constructible_constructxpbonus 1 
      constructible_destructxpbonus 1 
      setstate bridge default 
      setstate crates invisible 
   } 

   buildstart final 
   { 
      setstate bridge underconstruction 
      setstate crates default 
   } 

   built final 
   { 
      setstate bridge default 
      setstate crates invisible 
      wm_announce "They have repaired the bridge!" 
   } 

   decayed final 
   { 
      setstate bridge invisible 
      setstate crates default 
   } 

   death 
   { 
      setstate bridge invisible 
      setstate crates default 
      wm_announce "We've destroyed the bridge!" 
   } 
} 
gate
{ 
   spawn 
   { 
      wait 200 
      constructible_class 2 
      constructible_constructxpbonus 1 
      constructible_destructxpbonus 1 
      setstate gate invisible 
      setstate crates2 default 
   } 

   buildstart final 
   { 
      setstate gate underconstruction 
      setstate crates2 default 
   } 

   built final 
   { 
      setstate gate default 
      setstate crates2 invisible 
      wm_announce "Built the antinam defence!" 
   } 

   decayed final 
   { 
      setstate gate invisible 
      setstate crates2 default 
   } 

   death 
   { 
      setstate gate invisible 
      setstate crates2 default 
      wm_announce "Destroyed the Antina Defence!" 
   } 
}



(Benfun7) #13

I checked and everything is spelled right and is in the right case.


(nUllSkillZ) #14

Do the team_WOLF_objective-entites have the right description?
key: description
value: Tank Depot (without “”)


(Benfun7) #15

Yes they do.


(Benfun7) #16

I added “wait 500” to the script and it worked!

Thanks so much for your help nULLSkillZ,
Ben

Just call the trigger “allies_steal_tank” from the death-event of the “func_explosive”-entity.

One other thing do you mean just add this to my script? Or do I need to do more?


depotgate 
{
   spawn
   {
   wait 200 
   constructible_class 3
   }

   death
   {
   trigger allies_steal_tank <------------
   }
}


(nUllSkillZ) #17

I’ve just seen that you have two game_manager-scriptblocks.
Should be like that:


game_manager
{
   spawn
   {
      // ...
      // syntax: setautospawn <target spawn> <team>
      // with <targetspawn> = value of the description key
      setautospawn   "Tank Depot"   0
      setautospawn   "Allied Spawn"   1
      // ...
   }

   trigger allies_steal_tank
   {
      // ...

      alertentity tankdepot_axis_spawns
      alertentity tankdepot_allied_spawns
      alertentity tankdepotblob      // Tank Depot team_WOLF_objective

      setautospawn   "Axis Spawn"   0
      setautospawn   "Tank Depot"   1

      // ...
   }
   // ...
}

Edit:

Must be:


trigger game_manager allies_steal_tank


(Benfun7) #18

I figured that out.

Ok thanks so much!


(nUllSkillZ) #19

Have you seen the [edit] of my last post?


(Benfun7) #20

Yes thanks. I did that, but when I blow the depot gate I dont spawn at the tank depot.

This is my script now:

game_manager 
{ 
   spawn 
   { 
      // ... 
      // syntax: setautospawn <target spawn> <team> 
      // with <targetspawn> = value of the description key 
      wait 500
      setautospawn   "Tank Depot"   0 
      setautospawn   "Allied Spawn"   1 
      // ... 
   } 
   // ... 
} 

trigger allies_steal_tank 
   { 
    setautospawn   "Axis Spawn"   0 
    setautospawn   "Tank Depot"   1  
   } 
} 
           
depotgate 
{
   spawn
   {
   wait 200 
   constructible_class 3
   }

   death
   {
   trigger game_manager allies_steal_tank 
   }
}
antenna 
{
   spawn 
   {
   wait 200 
   constructible_class 3
   }

   death
   {
   wm_endround
   }
}
bridge
{ 
   spawn 
   { 
      wait 200 
      constructible_class 2 
      constructible_constructxpbonus 1 
      constructible_destructxpbonus 1 
      setstate bridge default 
      setstate crates invisible 
   } 

   buildstart final 
   { 
      setstate bridge underconstruction 
      setstate crates default 
   } 

   built final 
   { 
      setstate bridge default 
      setstate crates invisible 
      wm_announce "They have repaired the bridge!" 
   } 

   decayed final 
   { 
      setstate bridge invisible 
      setstate crates default 
   } 

   death 
   { 
      setstate bridge invisible 
      setstate crates default 
      wm_announce "We've destroyed the bridge!" 
   } 
} 
gate
{ 
   spawn 
   { 
      wait 200 
      constructible_class 2 
      constructible_constructxpbonus 1 
      constructible_destructxpbonus 1 
      setstate gate invisible 
      setstate crates2 default 
   } 

   buildstart final 
   { 
      setstate gate underconstruction 
      setstate crates2 default 
   } 

   built final 
   { 
      setstate gate default 
      setstate crates2 invisible 
      wm_announce "Built the antinam defence!" 
   } 

   decayed final 
   { 
      setstate gate invisible 
      setstate crates2 default 
   } 

   death 
   { 
      setstate gate invisible 
      setstate crates2 default 
      wm_announce "Destroyed the Antina Defence!" 
   } 
}