real scripting trouble


(error 404) #1

i made a map with destroyable barricade and 2 bridges and ive got real scripting trouble. im not good in it so i dont understand why do i have an error: “unknown event bridge1”

here is my script, thanks for all answers


Game_manager
{
spawn
{
}
trigger objective_counter //Counts allied objectives completed
{
accum 1 inc 1
trigger game_manager checkgame
}
trigger checkgame
{
accum 1 abort_if_not_equal 2
wm_setwinner 0
wait 1500
wm_endround
}
}
//barricade
barricade_script
{
spawn
{
wait 200
constructible_class 3
}
death
{
wm_announce "Axis are in the city!"
setstate barricade invisible
trigger game_manager objective_counter
}


//bridge1
bridge1_script
{
spawn
{
wait 200
constructible_class 3
}
death
{
wm_announce "Bridge no. 1 destroyed!
setstate bridge1 invisible
trigger game_manager objective_counter
}	

//bridge2
bridge2_script
{
spawn
{
wait 200
constructible_class 3
}
death
{
wm_announce "Bridge no. 2 destroyed!
setstate bridge2 invisible
trigger game_manager objective_counter
}
}
}

(Loffy) #2

Hi!
I cannot answer your question because I cannot find the error.
However, you need to:

  1. give accum number 1 the value of 0, in the spawn-section:

Game_manager
{
spawn
{
accum 1 set 0 // This will give accum number 1 the value of 0.
}
...

  1. and you also need to put “wm_setwinner 1” somewhere in the spawn-section.
    If the game goes on until the time is over, then team 1 will win. (1 = allies, 0 = axis).
    Try this:

...
spawn
{
accum 1 set 0 // This will give accum number 1 the value of 0.
wm_setwinner 1 // Team 1 (allies) will win, when time is over.
}
...

//Loffy


(error 404) #3

hmm ok i will test it
thank you


(error 404) #4

OK now im testing my script. it works, but the bridges doesnt set into invisible when should be!
here is my script

Game_manager
{
spawn
{
}
trigger objective_counter //Counts allied objectives completed
{
accum 1 inc 1
trigger game_manager checkgame
}
trigger checkgame
{
accum 1 abort_if_not_equal 2
wm_setwinner 0
wait 1500
wm_endround
}
}

//Bridge 1
bridgea_script
{
spawn
{
wait 200
constructible_class 3
}
death
{
wm_announce "Axis has destroyed first bridge!"
trigger game_manager objective_counter
setstate bridgea invisible
}
}

//Bridge 2
bridgeb_script
{
spawn
{
wait 200
constructible_class 3
}
death
{
wm_announce "Axis has destroyed second bridge!"
trigger game_manager objective_counter
setstate bridgeb invisible
}
}

//Barricade
barricade_script
{
spawn
{
wait 200
constructible_class 3
}
death
{
wm_announce "Axis are now in the city!!"
setstate barricade invisible
}
}
}

(Loffy) #5

Hi again!
What entities do you have in your map, for example script_mover, func_constructible ?
//L.

PS. I think you will find a tutorial for dynamite objectives (like bridges) on Marko’s web page: http://markoweb.free.fr/
But Marko’s page is down, at the moment. You have to go the later.


(error 404) #6

yes ive got func_explosive for brides


(error 404) #7

and trigger_objective_info of course


(viktwaar) #8

hey guys…

i’m making a map for wolfenstein ET, where the Allies have to blow up a radiopost to win the game.
but when i blew up the radiopost the game doesn’t end. when i bring up the console in ET i get this error:

‘‘G_scripting: trigger has unknown name: game_manager’’

here’s my script:

game_manager
{
spawn
{
wm_axis_respawntime 10
wm_allied_respawntime 10
wm_set_round_timelimit 30

	// Stopwatch mode defending team (0=Axis, 1=Allies)
	wm_set_defending_team	0

	// Winner on expiration of round timer (0=Axis, 1=Allies, -1=Nobody)
	wm_setwinner 0

	wait 300

	setautospawn "Axis Spawn" 0
	setautospawn "Allied Spawn" 1
}

trigger allies_win 
{   
	wm_announce "The Allies win the War"
	wm_setwinner 1

	wait 3000

	wm_endround

}

}
// =================================================
wall
{
spawn
{
wait 300
constructible_class 3 // 2=satchel 3=dyna
}

death
{
	alertentity wall_bits
	trigger wall_toi remove

	wm_announce "The Allies have destroyed the wall!"
}

}

wall_toi
{
trigger remove
{
remove
}
}
// =================================================
main_door
{
spawn
{
wait 300
constructible_class 3 // 2=satchel 3=dyna
}

death
{
	alertentity main_door_bits
	trigger main_door_toi remove

	wm_announce "The Allies have destroyed the main door! Destroy the Radiopost!"
}

}

main_door_toi
{
trigger remove
{
remove
}
}
// =================================================
radiopost
{
spawn
{
wait 300
constructible_class 3 // 2=satchel 3=dyna
}

death
{
	alertentity radiopost_bits
	trigger radiopost_toi remove

	wm_announce "The Allies have destroyed the Radiopost! We've lost our contact with Germany!"

	trigger game_manager allies_win
	
}

}

radiopost_toi
{
trigger remove
{
remove
}
}