Please someone help, with scripting...?


(Sniper) #1

Can somebody please help me with this script? There’s an error somewhere in the game manager, I didn’t add all the objectives yet either as it’s no point continuing on something that doesn’t work yet, is there?

The fault obviously is somewhere in the game manager because as soon as I take that part out it works and dont try mentioning "you forgot to add the amount of objectives’ cus that didn’t matter… And also can someobody please explain me in normal language what good the main_objective thingy is for?


//=== GAME MANAGER ===
game_manager
{
	spawn
	{
		accum 1 set 0

		wm_axis_respawntime 1
		wm_allied_respawntime 1
		wm_set_round_timelimit 20

		//1: Capture forward bunker
		//2: Repair/Destroy Radio post
		//3: Destroy first blastdoor
		//4: Destroy second blastdoor
		//5: Steal documents
		//6: Escape with the documents

		wm_set_mainobjective 1 0
		wm_set_mainobjective 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_objective_status 3 1 0
		wm_objective_status 3 0 0
		wm_objective_status 4 1 0
		wm_objective_status 4 0 0
		wm_objective_status 5 1 0
		wm_objective_status 5 0 0
		wm_objective_status 6 1 0
		wm_objective_status 6 0 0

		wm_set_defending_team 0

		wm_setwinner 0

		wait 150

		setautospawn "Forward bunker" 0
		setautospawn "Forward bunker" 1
	}


        trigger stolen_maps
	{
		accum 1 inc 1				
		trigger game_manager checkgame
	}

        trigger checkgame
	{
		accum 1 abort_if_not_equal 1
		wm_setwinner 1
		wait 400
		wm_endround
	}

}

maps
{
	spawn
	{        
	}

	trigger stolen
	{
		wm_objective_status 5 0 2
		wm_objective_status 5 1 1

		wm_set_main_objective 6 0
		wm_set_main_objective 6 1	
	}

	trigger returned
	{
		wm_objective_status 5 0 1
		wm_objective_status 5 1 0

		wm_set_main_objective 5 0
		wm_set_main_objective 5 1

	}

	trigger captured
	{
	}
}

escape_point
{
	{
		trigger	game_manager stolen_maps
	}
}
		


//=== SPAWNING CONTROL ===

forwardspawn
{
	spawn
	{
		accum 0 set 0
	}

	trigger axis_capture
	{
		accum 0 abort_if_equal 0

		accum 0 set 0 
		wm_announce	"Axis reclaim the forward bunker!"

		wm_addteamvoiceannounce 0 "oasis_axis_city_defend"

		wm_addteamvoiceannounce 1 "oasis_allies_city_capture"

		wm_teamvoiceannounce 0 "oasis_axis_city_captured"

		wm_teamvoiceannounce 1 "oasis_allies_city_lost"

		wm_removeteamvoiceannounce 0 "oasis_axis_wall_defend"

		wm_removeteamvoiceannounce 1 "oasis_allies_wall_destroy"

		wm_objective_status 		1 0 1
		wm_objective_status 		1 1 2

		wm_set_main_objective 1 0
		wm_set_main_objective 1 1

		alertentity forwardbunker
	}

	trigger allied_capture	
	{
		accum 0 abort_if_equal 1 

		accum 0 set 1 
		wm_announce	"Allies capture the forward bunker!"


		wm_addteamvoiceannounce 0 "oasis_axis_wall_defend"

		wm_addteamvoiceannounce 1 "oasis_allies_wall_destroy"

		wm_teamvoiceannounce 0 "oasis_axis_city_lost"

		wm_teamvoiceannounce 0 "oasis_axis_wall_defend"

		wm_teamvoiceannounce 1 "oasis_allies_city_captured"

		wm_teamvoiceannounce 1 "oasis_allies_wall_destroy"

		wm_removeteamvoiceannounce 0 "oasis_axis_city_defend"

		wm_removeteamvoiceannounce 1 "oasis_allies_city_capture"

		wm_objective_status 		1 0 2
		wm_objective_status 		1 1 1

		wm_set_main_objective 1 0
		wm_set_main_objective 3 1

		alertentity forwardbunker
	}

	trigger check_obj
	{
		accum 0 abort_if_equal 1 
		wm_objective_status 		1 0 2
		wm_objective_status 		1 1 1

	}

	trigger force_allied
	{
		accum 0 abort_if_equal 1 

		alertentity forwardbunker
	}

	trigger force_axis
	{
		accum 0 abort_if_equal 0 

		alertentity forwardbunker
	}
}


//=== CONSTRUCTION STUFF ===

//--- GARDEN MG42 NEST ---

construction_script1
{
	spawn
	{
	   wait 200
	   constructible_class 2
	   trigger self startup
	}

	buildstart final
	{
	   setstate construction_extra1 underconstruction
	   setstate construction_mg421 underconstruction
	   setstate construction_materials1 default
	   setstate construction_area1 default
	}

	built final
	{
	   setstate construction_extra1 default
	   setstate construction_mg421 default
	   setstate construction_materials1 invisible
	   setstate construction_area1 invisible

	   wm_announce "The Krauts have constructed the Garden MG nest!"
	}

	decayed final
	{
	   trigger self startup
	}

	death
	{
	   trigger self startup
	   wm_announce "The Yankees destroyed the Garden MG nest"
	}

	trigger startup
	{
	   setstate construction_extra1 invisible
	   setstate construction_mg421 invisible
	   setstate construction_materials1 default
	   repairmg42 construction_mg421
	   setstate construction_area1 default
	}
}

//--- VENTILATION SHAFT PROTECTION FENCE ---

construction_script2
{
	spawn
	{
	   wait 200
	   constructible_class 2
	   trigger self startup
	}

	buildstart final
	{
	   setstate construction_extra2 underconstruction
	   setstate construction_materials2 default
	   setstate construction_area2 default
	}

	built final
	{
	   setstate construction_extra2 default
	   setstate construction_materials2 invisible
	   setstate construction_area2 invisible

	   wm_announce "The Krauts have constructed the ventilation shaft protection fence!"
	}

	decayed final
	{
	   trigger self restart
	}

	death
	{
	   trigger self restart
	   wm_announce "The Yankees destroyed the ventilation shaft protection fence!"
	}

	trigger startup
	{
	   setstate construction_extra2 default
	   setstate construction_materials2 invisible
	   setstate construction_area2 invisible
	}

	trigger restart
	{
	   setstate construction_extra2 invisible
	   setstate construction_materials2 default
	   setstate construction_area2 default
	}
}

//--- VENTILATION POWER GENERATOR ---

construction_script3
{
	spawn
	{
	   wait 200
	   constructible_class 2
	   trigger self startup
	}

	buildstart final
	{
	   setstate construction_extra3 underconstruction
	   setstate construction_materials3 default
	   setstate construction_area3 default
	}

	built final
	{
	   setstate construction_extra3 default
	   setstate construction_materials3 invisible
	   setstate construction_area3 invisible
	   trigger ventfan1 rebuilt
	   trigger ventfan2 rebuilt
	   alertentity fan_hurt

	   wm_announce "The Krauts have constructed the ventilation power generator!"
	}

	decayed final
	{
	   trigger self restart
	}

	death
	{
	   alertentity fan_hurt
	   trigger self restart
	   wm_announce "The Yankees destroyed the ventilation power generator!"
	}

	trigger startup
	{
	   setstate construction_area3 invisible
	   setstate construction_extra3 default
	   setstate construction_materials3 invisible
	   trigger ventfan1 rebuilt
	   trigger ventfan2 rebuilt
	}

	trigger restart
	{
	   setstate construction_extra3 invisible
	   setstate construction_materials3 default
	   setstate construction_area3 default
	   trigger ventfan1 wrecked
	   trigger ventfan2 wrecked
	}
}

//=== DESTRUCTIBLE STUFF ===

//--- FIRST BLAST DOOR ---

blastdoor1
{
	spawn
	{
		wait 50
		constructible_class 3
	}

	death
	{
	   setstate destruction_firstblastdoor invisible
	}
}

//--- SECOND BLAST DOOR ---

blastdoor2
{
	spawn
	{
		wait 50
		constructible_class 3
	}

	death
	{
	   setstate destruction_secondblastdoor invisible
	}
}

//--- RADIO SOUNDS ---

secondradio
{
	spawn
	{
	   constructible_class 1
	   enablespeaker radio2
	}

	death
	{
	   disablespeaker radio2
	}
}

//=== FANS ===

//--- VENT FAN 1 ---

ventfan1
{
	spawn
	{
		wait 100
	}

	trigger wrecked
	{
		setrotation	0 0 0
	}

	trigger rebuilt
	{
		setrotation	0 0 500
	}

}

//--- VENT FAN 2 ---

ventfan2
{
	spawn
	{
		wait 100
	}

	trigger wrecked
	{
		setrotation	0 0 0
	}

	trigger rebuilt
	{
			setrotation	0 0 500
	}
}

//=== COMMAND POSTS ===

//--- AXIS COMMAND POST--- (ANTENNAE+RADIO)

construction_script4
{
	spawn
	{
	   wait 200
	   constructible_class 2
	   trigger self startup
	}

	buildstart final
	{
	   setstate construction_extra4 underconstruction
	   setstate construction_materials4 default
	   setstate construction_area4 default
	}

	built final
	{
	   setstate construction_extra4 default
	   setstate construction_materials4 invisible
	   setstate construction_area4 invisible
	   trigger self enable_axis_features

	   wm_announce "The Krauts have constructed the radio device!"
	}

	decayed final
	{
	   trigger self startup
	}

	death
	{
	   trigger self startup
	   wm_announce "The Yankees destroyed the radio device!"
	}

	trigger startup
	{
	   setstate construction_area4 default
	   setstate construction_extra4 invisible
	   setstate construction_materials4 default
	   trigger self disable_axis_features
	}

	trigger enable_axis_features
	{
		setchargetimefactor 0 soldier 0.8
		setchargetimefactor 0 lieutenant 0.75
		setchargetimefactor 0 medic 0.7
		setchargetimefactor 0 engineer 0.75
		setchargetimefactor 0 covertops 0.75
	}

	trigger disable_axis_features
	{
		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1
	}
}



(Ifurita) #2

Ummm … exactly what error message do you get or what is the game not doing? Do you have a script_multiplayer entity in your map with scriptname = game_manager?


(Sniper) #3

Is that required then? LOL

EDIT

G_Script_Scriptparse (), Error (line 520: ‘}’ expected, end of script found.

That line is this one I know from experience :stuck_out_tongue:

“setrechargetimefactor 0 engineer 0.75”


(Ifurita) #4

yes, the script_multiplayer is required. It’s the entity that calls your game_manager scriptblock.

The other error means that one of your bracket pairs is missing either an opening { or a closing }. Scrub thru your script to make sure each bracket has a pair.


(Sniper) #5

The entire point is, there is a multiplayer_script thingy now, and there are no missing brackets!!! :frowning: I am desperate… sniff…


(Ifurita) #6

If you’re still getting:

G_Script_Scriptparse (), Error (line 520: ‘}’ expected, end of script found

then the game thinks there is.


(Sniper) #7

I already got the error, in the Routine part “Escape_point” there was a subroutine called “Death” missing… lol


(Sniper) #8

Thx for the quick help though btw, didn’t know why the game manager didnt work at first, now I do , thx