Script problem


(AKE) #1

If i start my map im getting the error : GScripting : Trigger has unkknown
name Gold_crate.

I know what it means and i have checked it.
Everything seems to be all right but allways the same error.

Anyone got a suggestion what this could be?

The trigger :

	// ========================================
	// ========================================

	trigger add_goldbar
	{
		accum 0 inc 1

		trigger gold_full_0 show
		trigger gold_trans_0 hide
		trigger gold_crate secured

		accum 0 abort_if_less_than 2
		trigger gold_...

and here the Script:


gold_crate
{
	spawn
	{
		accum 0 set 0 // gold counter
	}

	trigger stolen
	{
		accum 0 inc 1
		accum 0 trigger_if_equal 1 gold_crate stolen1
		accum 0 trigger_if_equal 2 gold_crate stolen2
	}

	trigger secured
	{
		accum 0 trigger_if_equal 1 gold_crate secured1
		accum 0 trigger_if_equal 2 gold_crate secured2
	}

	trigger ...


can anyone help?


(Drakir) #2

Seems like u have a problem with the “gold_crate” entity. As when the script is to call upon it spawning it´s not there! Maybe add some “wait” before spawning so that the entity gets time to load in the map.

Add some “wait” time in your “game_manger” part before starting executing all the entity spawning.


(AKE) #3

Hi,

thx for the answer, im a complete noob in scripting , i understand what it does but thats it.
Where will i have to set the wait? (the srcipt is copied 1:1 from goldrush)
Becaus the error comes at the end of the game when it allready should be there (?) :???:

[edit] i’ve just seen there isnt any entitie called like that in the map, but in
goldrush its missing as well *confused
[/edit]

help !!!


(sock) #4

The first time a map loads not all of the entities are correctly setup and if you have functions (spawn) which reference other entities then it can be a problem. To over come this issue you need to add wait statements to the functions (spawn) which reference other entities. But with this amount of script you have supplied here its hard to tell exactly what is going on. There does not seem to be any syntax errors.

Enable “g_scriptdebug 1” first before you load your map and see where the script is failing first. Also post all of the relevant parts of the script, especially all of the first trigger entity.

Sock
:moo:


(AKE) #5

Sorry, thought because of the length.

It aborts the first time with :

here the Script: http://mitglied.lycos.de/reality74/editing/error/StarGate_1945F.txt


(sock) #6

ummm, I checked your script and it seems ok. Cant really tell anymore with seeing the map. Most of the script seems like it is goldrush so I’m assuming you have not changed much.

Does the entity “gold_crate” exist in the map? In the map goldrush its the red blob on the desk in the bank where you collect the goldbars from. There is a strange bug where “team_CTF_redflag” entities cannot have “targetname” keys, double check its exactly like the one in goldrush. (except for the model key, I remember seeing in the latest beta of the stargate map you where using the radar parts instead)

FYI: http://www.splashdamage.com/forums/viewtopic.php?t=2862&highlight=teamctfredflag

Sock
:moo: