Returnable objective scripting help needed


(SteelRat) #1

I have made this map with and returnable objective (docs) and I am having problem with the script.

Allies can take the objective but when you walk into the TRIGGER_FLAGONLY_MULTIPLE the green exclamation mark just disappears and the match does not end.
I know there must be a problem in the script but I don’t know where and I was hoping that someone here might be able to help. I have desperately been trying to find a good tutorial for returnable objectives with scripting but I have not found any.
I believe the objective script works for the docs and my guess is that the problem I have is in the trigger checkchame section.

Here is the script if someone could have a look at this (I have not added the TOI’s yet though).

game_manager
{
spawn
{
// Game rules
wm_number_of_objectives 3
wm_set_round_timelimit 15
wm_set_objective_status 1 0 1 // Obj1, Axis in control of Docs.
wm_set_objective_status 1 1 0 // Obj1, Allies, not in control of Docs.
wm_set_objective_status 2 0 1 // Obj2, Axis have prevented Allies from transmitting docs.
wm_set_objective_status 2 1 0 // Obj2, Allies have not transmitted docs.
wm_set_defending_team 0 // Axis is defending team
wm_set_winner 0 // Axis will be winners when time runs out
accum 1 set 0 // Will be set to 1 if Allies have transmitted documents

}

}
trigger checkgame
{
accum 1 abort_if_not_equal 1
wm_set_winner 1
wait 1500
wm_endround
}
}
trigger objective1
{
wm_set_objective_status 2 1 1 // Allies have transmitted the docs
wm_set_objective_status 2 0 0 // Axis have not prevented Allies from transmitting
accum 1 set 1
wm_announce “Allied team has transmitted the documents!”
trigger game_manager checkgame
}
trigger axis_object_stolen
{
wm_set_objective_status 1 1 1 // Allies have stolen the docs
wm_set_objective_status 1 0 0 // Axis have lost the docs
}
trigger axis_object_returned
{
wm_set_objective_status 1 0 1 // Axis have returned the docs
wm_set_objective_status 1 1 0 // Allies have lost the docs
}

transmitter_obj
{
spawn
{
}
death
{
trigger game_manager objective1
}
}
radiodoor
{
spawn
{
wait 200
trigger radio_door setup
constructible_class 3
}

trigger setup
{
	setstate radio_door_materials default
	setstate radio_door_materials_clip default
	setstate radio_door_flag default
}
buildstart final
{
	setstate radio_door_materials default
	setstate radio_door_materials_clip default
	setstate radio_door_flag default
}
built final
{
	setstate radio_door_materials invisible
	setstate radio_door_materials_clip invisible
	setstate radio_door_flag invisible
	wm_announce "The Radio Bunker Door has been constructed!"
}
decayed final
{
	setstate radio_door_materials default
	setstate radio_door_materials_clip default
	setstate radio_door_flag default
}
death
{
	setstate radio_door_materials default
	setstate radio_door_materials_clip default
	setstate radio_door_flag default
	wm_announce "The Radio Bunker Door has been destroyed!"
}
trigger remove
{
	setstate radio_door_toi invisible
	setstate radio_door_materials invisible
	setstate radio_door_materials_clip invisible
	setstate radio_door_flag invisible
	remove
}

}
}


(CptnTriscuit) #2

please use the [ code] tag next time you post a script.

The trigger objective1 block is not within the game_manager block (and neither is your trigger checkgame), and both of them need to be. Your game_manager should look like:


game_manager 
{ 
	spawn 
	{ 
		// Game rules 
		wm_number_of_objectives 3 
		wm_set_round_timelimit	15 
		wm_set_objective_status 1 0 1 // Obj1, Axis in control of Docs. 
		wm_set_objective_status 1 1 0	// Obj1, Allies, not in control of Docs. 
		wm_set_objective_status 2 0 1 // Obj2, Axis have prevented Allies from transmitting docs. 
		wm_set_objective_status 2 1 0 // Obj2, Allies have not transmitted docs. 
		wm_set_defending_team	0	// Axis is defending team 
		wm_set_winner	0	// Axis will be winners when time runs out 
		accum 1 set 0	// Will be set to 1 if Allies have transmitted documents 
	} 
	
	trigger checkgame 
	{ 
		accum 1 abort_if_not_equal 1 
		wm_set_winner 1 
		wait 1500 
		wm_endround 
	} 


	trigger objective1 
	{ 
		wm_set_objective_status 2 1 1	// Allies have transmitted the docs 
		wm_set_objective_status 2 0 0	// Axis have not prevented Allies from transmitting 
		accum 1 set 1 
		wm_announce "Allied team has transmitted the documents!" 
		trigger game_manager checkgame 
	}	
}


(SteelRat) #3

Thanks for that!
I knew it was simple since I have got it to work before.