capturable objectives


(.Chris.) #1

ive being trying to get some objectives that can be capturable in my map and so far i can pick them up and capture them but it doesnt win the map, the objectives go staright to a plane which is surrounded by the trigger_flagonly_multiple.

heres the script i came up with after reading the LDR and looking at goldrush and radar scripts.

game_manager
{
	spawn
	{
		// Game rules
		wm_axis_respawntime	20
		wm_allied_respawntime	10
		wm_number_of_objectives 5
		wm_set_round_timelimit	30

		wm_set_main_objective		1	0
		wm_set_main_objective		1	1

		wm_objective_status 1 1 0
		wm_objective_status 1 0 0
		wm_objective_status 2 1 0
		wm_objective_status 2 0 0


		wm_set_defending_team	1
		wm_setwinner	1
        }


trigger stolen_objective
	{
		accum 1 inc 1				
		trigger game_manager checkgame		
	}

trigger checkgame
	{
		accum 1 abort_if_not_equal 2
		wm_setwinner 0
		wait 1500
		wm_endround
	}

}

fuel_can
{
	spawn
	{
	}

	trigger stolen
	{
		
		

	}

	trigger dropped
	{
	}

	trigger returned
	{
		
		
		
	}

	trigger captured
	{
      		wm_objective_status 1 1 2
		wm_objective_status 1 0 1
                trigger game_manager stolen_objective
	}
}

documents
{
	spawn
	{
	}

	trigger stolen
	{
		
		
	}

	trigger dropped
	{
	}

	trigger returned
	{
	
	

	}

	trigger captured
	{

      		wm_objective_status 2 1 2
		wm_objective_status 2 0 1
                trigger game_manager stolen_objective
	}
}

in console it says: G_scripting trigger has unkown name: game_manager

any help is welcome


(nUllSkillZ) #2

You should add the following to game_manager spawn scriptblock:


accum 1 set 0

May be thats the mistake.

Ifurita has written a tutorial:
http://planetwolfenstein.com/4newbies/objective.htm


(.Chris.) #3

yeah thanks for that, but saddly thats only half of the mistake it would seem. after adding that i still got the G_scripting trigger has unkown name: game_manager error

the i tried removing the ‘game_manager’ from the ‘trigger game_manager stolen_objective’
and it caused my map to crash, i got the following error this time:

G_scripting: trigger must have a name and identifier: stolen_objective

remember that from using a slightly different script than last one posted:

game_manager
{
	spawn
	{
		// Game rules
		wm_axis_respawntime	20
		wm_allied_respawntime	10
		wm_number_of_objectives 5
		wm_set_round_timelimit	30

		wm_set_main_objective		1	0
		wm_set_main_objective		1	1

		wm_objective_status 1 1 0
		wm_objective_status 1 0 0
		wm_objective_status 2 1 0
		wm_objective_status 2 0 0


		wm_set_defending_team	1
		wm_setwinner	1
        }


trigger stolen_objective
	{
		accum 1 inc 1				
		trigger checkgame		
	}

trigger checkgame
	{
		accum 1 abort_if_not_equal 2
		wm_setwinner 0
		wait 1500
		wm_endround
	}

}

fuel_can
{
	spawn
	{
	}

	trigger stolen
	{
		
		

	}

	trigger dropped
	{
	}

	trigger returned
	{
		
		
		
	}

	trigger captured
	{
      		wm_objective_status 1 1 2
		wm_objective_status 1 0 1
                trigger  stolen_objective
	}
}

documents
{
	spawn
	{
	}

	trigger stolen
	{
		
		
	}

	trigger dropped
	{
	}

	trigger returned
	{
	
	

	}

	trigger captured
	{

      		wm_objective_status 2 1 2
		wm_objective_status 2 0 1
                trigger stolen_objective
	}
}

sorry for being a pain in the ass :smiley:


(nUllSkillZ) #4

Do you have a script_multiplayer entity in your map (with key: scriptname / value: game_manager) ?


(Ifurita) #5

yes, you need that. Your capturable drop point should also trigger the gamecheck sequence during the death sequence (see last couple of lines)


//Gold 
gold
{ 
	spawn 
	{ 
		wait 200 
		setstate goldbox_captured invisible 
		setstate goldbox_red invisible
		setstate gold_toi invisible
		setstate gold_cm_marker invisible
		setstate gold_cap_cm_marker invisible
		setstate gold_cap_toi invisible
		setstate allied_objective invisible
	} 

	trigger stolen 
	{ 
		wm_announce "The Allies have stolen the gold" 
		setstate gold_cm_marker invisible 

		wm_objective_status 3 0 2
		wm_objective_status 3 1 1
	} 


	trigger returned 
	{ 
		wm_announce "The Axis have returned the gold" 
		setstate gold_cm_marker default 

		wm_objective_status 3 0 1
		wm_objective_status 3 1 2
	} 

	trigger captured 
	{ 
		wm_announce "The Allies have secured the gold" 
		setstate goldbox_red invisible 
		setstate goldbox_captured default 
	} 
} 


allied_objective //enter this as the scriptname value for the single trigger_flagonly_multiples entity 
{ 
	death 
	{ 
		wm_objective_status 4 0 2
		wm_objective_status 4 1 1

		trigger game_manager alliedobjectivecounter

		// *----------------------------------- vo ----*
		wm_teamvoiceannounce 0 "axis_obj_captured"
		wm_teamvoiceannounce 1 "allied_obj_secured"
		// *----------------------------------- vo ----*
	} 
} 


(.Chris.) #6

ah forgot to add that script multiplayer and ill add that extra stuff right now thanks very much for such quick responses, shouldnt be long till get a beta version of map out now :smiley:

thanks again


(Ifurita) #7

don’t rush the beta - use the alpha - first playable - beta - final model. There is nothing wrong with getting some serious (limited and private) play on an alpha version to work out high level issues with gameflow, timing, and connectivity


(.Chris.) #8

yeah i intend to do summat similar but with private beta testing before a public beta release got a few clans who intrested in testing map and gunna give out to few others maybe.

EDIT: i owe you guys alot thanks very much apart from few things like missing model for one of objectives everything else works like a dream, thanks, ill finish rest of map now :smiley: