Scripting problem: Setautospawn


(Donpedro) #1

Hi
I got g_scripting: setautospawn: couldnt find target
im angry i wasted a lot of time on this error, couldnt figure it out. :x
Here is the script:


game_manager
{
spawn
{
	wm_axis_respawntime 1 //Until developing end...
	wm_allied_respawntime 1 //Until developing end...
	wm_set_round_timelimit 99999 //Until developing end...
	wm_set_defending_team 0 //Axis is the defending team
	wm_setwinner 0 //Axis is the default winner
	setautospawn "b" 0 //Axis spawns @ depotyard @ start
	setautospawn "c" 1 //Allies spawns @ barrack @ start
}
}
maindoor
{
spawn
{
wait 200
constructible_class 3
}
}
flag_depotyard
{
spawn
{
}
	trigger axis_capture
	{
	wm_announce "Axis reclaimed the Depot Yard!"
	accum 0 set 0 //Axis own the flag
	}
	trigger allied_capture
	{
	wm_announce "Allies captured the Depot Yard!"
	accum 0 set 1 //Allies own the flag
	}
}

maindoor
{
spawn
{
}
death
{
wait 200
wm_announce "Allies captured the Groundfloor Spawn and fixed the Depot Yard!"
trigger self depotcheck
setautospawn "a" 1 
//need axis here
alertentity wobj_groundfloor //Changes the groundfloor commandmapmarker
setstate flag_depotyard invisible
}
	trigger depotcheck
	{
	accum 0 abort_if_equal 1 //Don't need to change the cm icon, if allies own the flag
	alertentity wobj_depotyard
	}
}

the descriptions of the wolf entities are correct!
I set g_scriptdebug 1, and then started the map, after setautospawn “b” 0 , i get the error. If i delete the first setautospawn, i get the error after second setautospawn(so, all of the setautospawns are incorrect, i meant). Strange. Can anybody help me? :?


(nUllSkillZ) #2

b and c have to be the description keys of the team_WOLF_objective entities.
Not their script- or targetname.

Edit:

You can always have a quick look at goldrush.map.


(DerSaidin) #3

And you’d want to use descriptions like “Forward Flag” or “Allied CP” instead of “b” and “c”.


(Donpedro) #4

a b and c are the descriptions of the wobjs. Before they had 'normal" names, but after the error i gave more simple names


(nUllSkillZ) #5

Could you please also post the key/value pairs of the involved entities?


(Donpedro) #6

yes, here:


(murka) #7

i bet its the simple problem,
ET doesnt load the names of entities so fast, place some wait in the spawn, that might fix it


(Donpedro) #8

half success, now ET load the map, and after 2 seconds the same error (maybe this is the wait what i inserted?)
Here is the changed parts of the script:


...
game_manager
{
spawn
{
	wait 1000
	wm_axis_respawntime 1 //Until developing end...
	wm_allied_respawntime 1 //Until developing end...
	wm_set_round_timelimit 99999 //Until developing end...
	wm_set_defending_team 0 //Axis is the defending team
	wm_setwinner 0 //Axis is the default winner
	wait 1000
	setautospawn "b" 0 //Axis spawns @ depotyard @ start
	wait 1000
	setautospawn "c" 1 //Allies spawns @ barrack @ start
...
wait 1000
setautospawn "a" 1 
...



(nUllSkillZ) #9

The only difference I can see that your entities don’t have a scriptname in comparison to the goldrush team_WOLF_objectives.


(mortis) #10

wait 1000 is too long.

You need to wait 150, set autospawns, then wait 350. Autospawns must be set after the entities are placed, but before the players spawn (at 350ms IIRC…not sure, but I think that is what reyalp said long ago…)

Here is my fixed code from Supplydepot, for example:


		// Set starting spawns
		// The wait command after is VERY IMPORTANT for correct spawns!
		wait 150
		setautospawn	"Forward Bunker Spawn"	0
		setautospawn	"Allied Start"	1
		wait 350


(Donpedro) #11

...
	wait 150
	setautospawn "b" 0 //Axis spawns @ depotyard @ start
	setautospawn "c" 1 //Allies spawns @ barrack @ start
	wait 350
...
wait 150
setautospawn "a" 1
wait 350 
...

Same error :frowning:


(mortis) #12

did you also remove those long wait states from the beginning of your script?


(nUllSkillZ) #13

Do you have spawn points (team_CTF_blue/redspawns) nearby the team_WOLF_objective entities?


(Donpedro) #14

mortis: yes
Nullskillz: yes


(Donpedro) #15

SOLVED!
The solution: I updated the entities during the mapmaking, just needed to place again the wobjs.


(pokeybit) #16

hi, just like to post, i had the same initial problem, i added a wait 150 just before setautospawn and it worked, thanks m8 :slight_smile: (worked for me! , was really annoying after reading about 500 threads)