bizzaro scripting error


(damocles) #1

I have a…complicated script in my new map. It was working perfectly, but for some bizarre reason, it has decided that it no longer wants to call a certain function over and over.

The objectives for my map are to overload a power generator and it takes time to overload, so I use a function that waits 1 second, activates the necessary cooling/overloading functions and then calls itself again.

This was working perfectly, but now without having changed a thing, it has decided it no longer wishes to call itself anymore. Nor can anything else call it anymore. It will call once at the start as it should, but then after that it’s as if the function disappears off the face of the planet. No error messages or anything, it simply fails to fire the function. I know this to be the case as I have spent the last three days identifying exactly where the problem lies.

So why the hell has it suddenly decided to stop working? My first thoughts were soime kind of BSP related problem, but it occurred to me that the error occurred without a change in the BSP. One minute it worked, the next it didn’t.

If you’re interested (and pateitn enough) here’s the offending script section (all plavced in the game_maanger section):


trigger coolant_on
	{
	accum 5 abort_if_not_bitset 1
	accum 5 abort_if_not_bitset 2
	accum 6 set 0
	wm_set_objective_status 2 0 // cooling so axis ui sign
	wm_announce "Cooling systems at 100 percent efficiency."
	// tbd: pa announcer about overload avoided
	}

trigger coolant_off
	{
	accum 5 abort_if_bitset 1
	accum 5 abort_if_bitset 2
	accum 6 set 2
	wm_set_objective_status 2 1 // overloading so allied ui sign
	wm_announce "Coolant failure!  Overload in progress!"
	// tbd: pa announcer about overload happening
	}

trigger overload
	{
	wm_announce "x1"
	accum 6 abort_if_not_equal 2
	wm_announce "x2"
	accum 7 inc -1
	wm_announce "overload in progress"
	trigger game_manager warning90
	trigger game_manager warning60
	trigger game_manager warning30
	trigger game_manager warning10
	}

trigger warning90
	{
	accum 7 abort_if_not_equal 90
	wm_announce "Generator will overload in 90 seconds!"
	// start first grey smoke
	alertentity greysmoke1
	}

trigger warning60
	{
	accum 7 abort_if_not_equal 60
	wm_announce "Generator will overload in 60 seconds!"
	// start second grey smoke
	alertentity greysmoke2
	alertentity gen_creak1
	// tbd: announcement over pa
	}

trigger warning30
	{
	accum 7 abort_if_not_equal 30
	wm_announce "Generator will overload in 30 seconds!"
	// start black smoke
	alertentity gen_creak2
	alertentity blacksmoke
	// tbd: announcement over pa
	}

trigger warning10
	{
	accum 7 abort_if_not_equal 10
	wm_announce "Overload in 10 seconds!"
	trigger game_manager tenseconds
	//tbd: start a shaking system
	// tbd: announcement over pa
	}

trigger cooling30
	{
	accum 7 abort_if_not_equal 30
	// turn off black smoke
	alertentity blacksmoke
	}

trigger cooling60
	{
	accum 7 abort_if_not_equal 60
	// turn off first grey smoke
	alertentity greysmoke2
	}

trigger cooling90
	{
	accum 7 abort_if_not_equal 90
	// turn off second grey smoke
	alertentity greysmoke1
	}

trigger safemessage
	{
	accum 7 abort_if_not_equal 120
	wm_announce "Generator is now running at optimal efficiency"
	wait 2500
	wm_setwinner 0  // 0 = axis
	// tbd: announcement on pa
	}

trigger coolant
	{
	accum 6 abort_if_not_equal 0
	accum 7 abort_if_greater_than 119
	accum 7 inc 1
	wm_announce "cooling in progress"
	trigger game_manager safety
	trigger game_manager cooling30
	trigger game_manager cooling60
	trigger game_manager cooling90
	trigger game_manager safemessage
	}

trigger coolantloop
	{
	trigger game_manager coolant
	trigger game_manager overload
	wait 1000
	trigger game_manager coolantloop
	}

trigger safety
	{
	accum 7 abort_if_not_equal 120
	wm_setwinner 0
	wm_set_objective_status 1 0
	}

trigger kaboom
	{
	wait 50
	wm_announce "The generator has overloaded!!"
	wait 1500
	wm_setwinner 1
	wm_endround
	alertentity explo3
	wait 200
	alertentity explo5
	wait 650
	alertentity explo1
	wait 300
	alertentity explo2
	wait 200
	alertentity explo3
	wait 50
	alertentity platfall
	wait 1000
	alertentity plateffects
	wait 500
	alertentity explo4
	wait 600
	alertentity explo5
	wait 50
	alertentity explo6
	}

trigger cooling1_on
	{
	wm_set_objective_status 2 -1
	accum 5 bitset 1
	trigger game_manager halfway1
	trigger game_manager halfway2
	accum 5 abort_if_not_bitset 2
	trigger game_manager coolant_on
	}

trigger cooling1_off
	{
	wm_set_objective_status 2 -1
	accum 5 bitreset 1
	trigger game_manager halfway1
	trigger game_manager halfway2
	accum 5 abort_if_bitset 2
	trigger game_manager coolant_off
	}

trigger cooling2_on
	{
	wm_set_objective_status 2 -1
	accum 5 bitset 2
	trigger game_manager halfway1
	trigger game_manager halfway2
	accum 5 abort_if_not_bitset 1
	trigger game_manager coolant_on
	}

trigger cooling2_off
	{
	wm_set_objective_status 2 -1
	accum 5 bitreset 2
	trigger game_manager halfway1
	trigger game_manager halfway2
	accum 5 abort_if_bitset 1
	trigger game_manager coolant_off
	}

trigger halfway1
	{
	accum 5 abort_if_not_bitset 1
	accum 5 abort_if_bitset 2
	trigger game_manager goingdown
	trigger game_manager goingup
	accum 6 set 1
	}

trigger goingdown
	{
	accum 6 abort_if_equal 0
	wm_announce "Generator has stabilised.  Overload prevented."
	}

trigger goingup
	{
	accum 6 abort_if_equal 2
	wm_announce "Generator coolant systems are losing integrity!"
	}

trigger halfway2
	{
	accum 5 abort_if_not_bitset 2
	accum 5 abort_if_bitset 1
	trigger game_manager goingdown
	trigger game_manager goingup
	accum 6 set 1
	}

trigger tenseconds
	{
	// tbd: replace with announcer sounds
	wait 1000
	accum 6 abort_if_not_equal 2
	wm_announce "9"
	alertentity rumble1
	wait 1000
	accum 6 abort_if_not_equal 2
	wm_announce "8"
	//alertentity rumble1
	wait 1000
	accum 6 abort_if_not_equal 2
	wm_announce "7"
	alertentity rumble2
	wait 1000
	accum 6 abort_if_not_equal 2
	wm_announce "6"
	//alertentity rumble2
	wait 1000
	accum 6 abort_if_not_equal 2
	wm_announce "5"
	alertentity rumble3
	wait 1000
	accum 6 abort_if_not_equal 2
	wm_announce "4"
	//alertentity rumble3
	wait 1000
	accum 6 abort_if_not_equal 2
	wm_announce "3"
	alertentity rumble4
	wait 1000
	accum 6 abort_if_not_equal 2
	wm_announce "2"
	//alertentity rumble4
	wait 1000
	accum 6 abort_if_not_equal 2
	wm_announce "1"
	alertentity rumble5
	wait 1000
	accum 6 abort_if_not_equal 2
	trigger game_manager kaboom
	}

The first call to coolantloop is made form the spawn section of the game_manager code (with a 2 second delay before calling)

The strange wm_announces like wm_announce “x1” are just leftovers from where I was trying to identify the source of the error.

As you can see, the coolantloop function should happily call itself over and over every second. This did work perfectly, and has done throughout the development of the map. Now though (naturally, seeing as I am less than a week away from release) the script has decided it ca’t be arsed to work anymore. :bash:

I even tried redirecting the call through another entity. The coolantllop fiunction called a fuction in a completely seperate entity, which then waited a second before calling the coolantloop function. this also failed to work. It’s as if it’s developed an aversion to that function.

So close to release… now if I can’t get this script to work I may never be able to release :frowning: