Forward Spawn problem


(eRRoLfLyNN) #1

Hi, hope someone can help, I can’t think of anything else to try :frowning:

Allies are attacking, when they blow a gate it creates a 2nd spawn and they should autospawn at it. This is only for Allies, and Axis never have a spawn at this place.

I have team_wolf_objs at both, and the team_ctf_blue spawns at both
Spawn 1 wolf obj scriptname = sewerspawnblob
Spawn 2 wolf obj scriptname = tunnelspawnblob
Spawn 2 ctf flags scriptname = tunnelspawn

A cut from my script:


//Allies Packing Tunnel Spawn Stuff

tunnelspawnblob
{
	spawn
	{
		wait 50
		setstate tunnelspawnblob invisible
		setstate tunnelspawn invisible
	}

	trigger changespawn
	{
		wait 50
		setstate tunnelspawnblob default
		setstate tunnelspawn default
		wait 100
		setautospawn	"Packing Tunnel"	1
	}
}
//Dyna Obj - Blow the Truck Gate
truckgate
{
	spawn
	{
		wait 200
		constructible_class 3
	}

	death
	{
		wm_announce "^2Allies have destroyed the Truck Gate"
		wait 50
		trigger tunnelspawnblob changespawn
		wm_objective_status 4 1 1
		wm_objective_status 4 0 2
	}

}

It looks like it works fine until you try to spawn at the 2nd spawn. In limbo, when the gate is blown, the 2nd flag appears, and the number 1 (me testing) moves from the 1st flag to the 2nd. But when I /kill I keep spawning at the 1st spawn, even if I try to change it manually.

The only thing I can think is that the 2nd spawn may be close to the 1st and getting confused. But I’ve tried moving it further away, with no success.

Any ideas?


(die die) #2

i sux at scripting but i think this file will help you from EB
http://www.spyjuice.com/spawn_exchange.htm


(DerSaidin) #3

At a guess, I’d say that you should check your team_CTF_bluespawn entities.
It sounds like the wolf obj is getting enabled but the actuall spawnpoints (the team_CTF_bluespawn) are either not getting enabled, or are setup wrong.


(nUllSkillZ) #4

You can’t set the spawnblob’s default or invisible.
You have to use alertentity.
Please take a look at Goldrush map and script.
It’s the easiest way to get this to work.


(eRRoLfLyNN) #5

I set the 2nd spawn team_ctf_bluespawns all with Start Active and it worked. I can’t believe that, it really doesn’t make sense. It seems you have to start them active, make them & the wolf obj invisible at the start of the round in the script, then make them active/default when you need them. Whereas I kept thinking I needed to set them not active to begin with. I can’t believe that took 3 hours of my life!! :moo:

@ nUllSkillZ
Doesn’t alertentity change it from Allies to Axis & vice versa? This spawn is for Allies only, and the setstate blob visible seems to work fine. It may not be right though.


(]UBC[ McNite) #6

(deleted cuz for some strange reason my post showed up twice)


(]UBC[ McNite) #7

You have to use alertentity.

Alertentity is not needed for something like that. I only use it in my new map at a capturable flag, and it sux. I got it working now, but don’t ask me how lol. It def doesn’t work with reasoning. If anyhow possible, don’t use alertentity imo.

For the engine room spawn in TheRiver II Redux this works:

entities:
team_WOLF_obj: spawnflags 2, script-/targetname spawnstation_wobj
teamCTF_bluespawn: spawnflags 3, target-/scriptname spawnstation

code:

tramengine
{
		built final
	{
		wm_announce "The Tram Engine Panel has been repaired!"
		trigger vobj accum6on // for the spawn at tram station
	}
}

vobj
{	
	trigger accum6on // engine repaired for first time
	{
		trigger spawnstation_wobj stationtakenover

	}
}

spawnstation_wobj
{
	spawn
	{
		wait 150
		setstate spawnstation_wobj invisible
		setstate spawnstation invisible
		//wm_announce "^2spawnstation_wobj invisible"
	}

	trigger stationtakenover
	{
		wm_objective_status 1 0 2
		wm_objective_status 1 1 1
		wm_announce "Allies have taken over the Tram Station!"

		wait 50
		setstate spawnstation_wobj default
		setstate spawnstation default

		setautospawn "Tram Station" 1

		wait 50
		trigger spawnroad_wobj off
	}
}

So as Errol said, the trick is to have the wobj default_allies and the spawns startactive, but all of them invisible, and set them default when you need them. That s truly the most simple approach. All the alertentity stuff is just screwed and badly programmed imo.


(S14Y3R) #8

Hi, I’m working on a script where spawns are changed twice after obj’s are destroyed. Set all team_wolf_obj’s (blob’s) to their default team you want there. Only Your starting spawns need to “startactive”, leave the other ones off and use alertentity to “wake” them. I’ve had no trouble with this, each side starts with one spawn. after first obj is destroyed each team spawns at next location, after second obj another spawn is active, removing the previous spawns smoothly.

my func_constructable death calls master_spawn_control end_stage1

master_spawn_control //target_script_trigger in map, target key "pseudo name" TST needs a target.
{
	spawn //blue/red_2nd is spawns, 2nd_wobj is t_w_o...
	{
		wait 250

		setstate blue_2nd_wobj invisible
		setstate red_2nd_wobj invisible
		setstate blue_3rd_wobj invisible
		setstate red_3rd_wobj invisible
	}

	trigger end_stage_1 //1st obj destroyed-start second stage
	{
		setstate blue_2nd_wobj default
		alertentity blue_2nd //"switch_on"
		wait 25
		setstate red_2nd_wobj default
		alertentity red_2nd
		wait 50
		setstate blue_1st_wobj invisible
		setstate blue_first invisible
		wait 50
		setstate red_1st_wobj invisible
		setstate red_1st invisible
		wait 125
		trigger obj1_toi remove
		wait 100
		trigger game_manager obj1_destroyed
	}
                                         
}

I figure it’s safer to activate the next spawn before removing the first, that way there’s no chance of “can’t find spawn” errors for new joiners. :slight_smile:
I don’t know if that’ll help, but I’ve had no trouble switching spawns around. Even with 1 second respawn, if I dynomite myself to peices i’ll spawn right away at the next one everytime.

p.s. Sorry McNite, I still believe in alertentity :chef:


(eRRoLfLyNN) #9

So alertentity will work if you have set a spawn point as default_allies but not active at the start of the map, and it won’t make it an Axis spawn, it will only “wake it up”? I was goin to try alertentity but kept reading it acted as a toggle in the case of spawns.

The way I have done it works, but I wonder which is the “right” way to do it, if there is such a thing! :stuck_out_tongue:


(]UBC[ McNite) #10

Errol, the right way is WHEN IT WORKS. :smiley:

When i used altertentity as a toggle I even found that allies spawned at a spawn that only has red spawnboxes :eek: and on another occasion it removed all spawnflags on the command map but u still spawned at a removed location :eek2: so I prefer a simple setstate invisible/default way to get things working, and it works well Apart for the capturable flag.

The altertentity stuff is also the reason for the radar spawnbug: go right for command post, spawn there after having built it, then capture the flag. When axis destroy the command post you ll spawn back at the villa even when the flag has been secured. U won’t get that with a good setstate default/invisible scripting and setautospawns.

I was very close to build a capturable flag myself with 2 trigger_multiple and 2 different flags that indicate who owns it. That would also make the “first touch” by the flagowners at mapstart unnecessary because u start with the right teamflag right away.