map script problem


(jobe314) #1

hi,
i try to make a simple destructible objective.
i want to do a door which can be destroyed by all weapons not only by TNT.

so i test one time with constructible_class 3 in my script and all run well (only destroy by TNT). i test with constructible_class 1, but when i destroy my door with a current weapon nothing happens, this doesn’t end the game as same as with no constructible_class in my script.

someone can help me plz?


(codejockey13) #2

Is the door supposed to open and close? If not just make it a simple func_explosive with a health key and value. You should be able to shoot it or anything else to make it blow up. If it is supposed to open and close well that will take a bit more looking into.

Also, wrap a trigger_objective_info around it and point that to the door so it appears on the command map. Be sure to put all the needed items for the TOI.

btw you don’t need a script for a simple func_explosive.


(nUllSkillZ) #3

func_explosives can’t be constructed.
Not sure if they could be re-spawned (or something similar).


(jobe314) #4

it’s not a door with func_door_rotating, it can’t be opened or closed: i’s just a brush with a door texture.
well i see my objectives, i can destroy them but the game doesnt’t end.
What i must put in my game_manager to end the game with the good winner when my objective is destroyed.
And if i wanna put more objectives and end when all are destroyed?


(jobe314) #5

what are all needed items for TOI?
i put:
check axis_objective
target: door

that’s all? how ask the game to end and set winner when my door is destroyed (if i dont do a script)?


(FireFly) #6

The problem is that a func_explosive can’t have a "death’’-event in the script…

see also: http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=12701 ]UBC[ McNite had the same problem.

Use a script_mover instead and give it the key/values like in the image below. You also need a script_multiplayer in your map. This example asumes that the axis needs to destroy the door to win the game…

here’s the script part:

game_manager
{
	spawn
	{
		// Game rules
		wm_axis_respawntime	1
		wm_allied_respawntime	1
		wm_number_of_objectives 1
		wm_set_round_timelimit	20

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

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

	}


	trigger door_destroyed
	{
		

		// Set the round winner:  0 == AXIS, 1 == ALLIED
		wm_setwinner 0
		wait 1500
		// End the round
		wm_endround
	}
}
	

door
{
	spawn
	{
		
	}

	death
	{
		trigger game_manager door_destroyed	
					
	}

}

(jobe314) #7

thank you so much.