Mover script tweaking


(DAbell) #1

Hi. Everybody

Well my map St Nazaire is still on the go the final version will be released shortly i just want to tweak a few things to make it right in my eyes. (it may never be right)

In my map i have a dry dock gate which can be operated from the Axis side via a switch, the supposed controls for these gates are one of the objectives that the allieds have to destroy.

What i was hoping to do was make it so that once the north winding equipment has been blown the gate is no longer operational no matter what position its in.

Can this be done in some manner to achieve some result which is close to what i want.

My script for the entire map is as follows.

game_manager
{
	spawn
	{
		remapshaderflush
		
		// Game rules
		wm_axis_respawntime	20	
		wm_allied_respawntime	20
		wm_number_of_objectives	6	
		wm_set_round_timelimit	30

		// Objectives
		//1 Blow up Harbour Wall
		//2 Blow up South Winding House Door
		//3 Blow up South Winding Mechanism
		//4 Claim forward spawn point
		//5 Blow up North Winding Mechanism
		//6 Stop Axis from building North barricade
		
		// Current main objectives for each team (0=Axis, 1=Allies)
		wm_objective_status 1 0 0
		wm_objective_status 1 1 0
		wm_objective_status 2 0 0
		wm_objective_status 2 1 0
		wm_objective_status 3 0 0
		wm_objective_status 3 1 0
		wm_objective_status 4 0 0
		wm_objective_status 4 1 0
		wm_objective_status 5 0 0
		wm_objective_status 5 1 0
		wm_objective_status 6 0 0
		wm_objective_status 6 1 0


		//Accum values
		accum 1 set 0 //Overall Allied status
		accum 2 set 2 //set 2 = null value

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

		// Winner on expiration of round timer (0=Axis, 1=Allies, -1=no winner at expiration)
		wm_setwinner	0 //Assumes axis defending

		wait 2000
	}

	trigger objective_counter //Counts Allied objectives completed
	{
	accum 1 inc 1
	trigger game_manager checkgame
	}

	trigger checkgame
	{
	accum 1 abort_if_not_equal 2
	wm_setwinner 1
	wait 4000

	wm_endround
	}

}

// WAREHOUSE SPAWN FLAG STUFF

oldcityflag
{
	spawn
	{
		accum 0 set 0	// Who has the flag: 0-Axis, 1-Allied
	}

	trigger axis_capture	// Flag has been touched by an Axis player
	{
		accum 0 abort_if_equal 0 // do Axis own flag?

		accum 0 set 0 // Axis own the pole
		wm_announce	"Axis reclaim the Warehouse!"

		wm_objective_status 		4 0 1
		wm_objective_status 		4 1 2

		alertentity old_city_wobj
	}

	trigger allied_capture	// Flag has been touched by an allied player
	{
		accum 0 abort_if_equal 1 // do Allies own flag?

		accum 0 set 1 // Allied own the flag
		wm_announce	"Allies capture the Warehouse!"

		wm_objective_status 		4 0 2
		wm_objective_status 		4 1 1

		alertentity old_city_wobj
	}

	trigger check_obj
	{
		accum 0 abort_if_equal 1 // Do Allied own the flag?

		wm_objective_status 		4 0 2
		wm_objective_status 		4 1 1

	}

	trigger force_allied
	{
		accum 0 abort_if_equal 1 // Do Allied own the flag?

		alertentity old_city_wobj
		alertentity oldcityspawns
	}

	trigger kill
	{
		remove
	}
}

// HARBOUR WALL STUFF

harbourwall
{
	spawn
	{
		wait 200
		constructible_class 3
	}
	death
	{
		wm_announce "Allies have blown up the Harbour Wall"

		wm_objective_status 1 0 2
		wm_objective_status 1 1 1
	}
}

// SOUTH WINDING HOUSE DOOR STUFF

southwinddoor
{
	spawn
	{
		wait 200
		constructible_class 3
	}
	death
	{
		wm_announce "Allies have blown up the South Winding House Door"

		wm_objective_status 2 0 2
		wm_objective_status 2 1 1
	}
}

// SOUTH WINDING MECHANISM STUFF

windmechsouth
{
	spawn
	{
		wait 200
		constructible_class 3
	}
	death
	{
		wm_announce "Allies have destroyed the South Winding Mechanism"

		wm_objective_status 3 0 2
		wm_objective_status 3 1 1

		trigger game_manager objective_counter
	}
}

// NORTH WINDING MECHANISM STUFF

windmechnorth
{
	spawn
	{
		wait 200
		constructible_class 3
	}
	death
	{
		wm_announce "Allies have blown up the North Winding Mechanism"

		wm_objective_status 5 0 2
		wm_objective_status 5 1 1

		trigger game_manager objective_counter
	}
}

// NORTH BARRICADE STUFF

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

   	buildstart final 
   	{ 
   	} 

   	built final 
   	{ 
      	setstate construction_materials invisible 

      	// Some kind of UI pop-up to alert players 
      	wm_announce   "Axis team has built the barricade!"

		wm_objective_status 6 0 1
		wm_objective_status 6 1 2
   	} 

   	decayed final 
   	{ 
      	trigger self startup 
   	} 

   	death 
   	{ 
      	trigger self startup 
      	// Some kind of UI pop-up to alert players 
      	wm_announce   "Allied team has destroyed the barricade!"

		wm_objective_status 6 0 2
		wm_objective_status 6 1 1
   	} 

   	trigger startup 
   	{ 
      	setstate construction_materials default 
   	} 
} 

// COMMAND POST STUFF

allied_compost_built
{
	spawn
	{
		wait 400
		trigger allied_compost_built setup

		constructible_class 2
	}

	trigger setup
	{
		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1
		sethqstatus 1 0
	}

	buildstart final
	{
		setstate allied_compost_built_model underconstruction
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible
	}

	built final
	{
		setstate allied_compost_built_model default
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible

		trigger allied_compost_built_model enable_allied_features

		enablespeaker allies_compost_sound
	}

	decayed final
	{
		setstate allied_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default
	}

	death
	{
		setstate allied_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default

		trigger allied_compost_built_model disable_allied_features

		disablespeaker allies_compost_sound
	}
}

allied_compost_built_model
{
	spawn
	{
		wait 400
		setstate allied_compost_built_model invisible
	}

	trigger enable_allied_features
	{
		setchargetimefactor 1 soldier 0.75
		setchargetimefactor 1 lieutenant 0.75
		setchargetimefactor 1 medic 0.75
		setchargetimefactor 1 engineer 0.75
		setchargetimefactor 1 covertops 0.75
		sethqstatus 1 1

		wm_announce	"Allied Command Post constructed. Charge speed increased!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed_allies"

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed"

		wm_removeteamvoiceannounce 1 "allies_hq_compost_construct"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 4 0 2
		wm_objective_status 4 1 1
	}

	trigger disable_allied_features
	{
		setchargetimefactor 1 soldier 1
		setchargetimefactor 1 lieutenant 1
		setchargetimefactor 1 medic 1
		setchargetimefactor 1 engineer 1
		setchargetimefactor 1 covertops 1
		sethqstatus 1 0

		wm_announce	"Axis team has destroyed the Allied Command Post!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

		wm_teamvoiceannounce 0 "axis_hq_compost_construct"

		wm_teamvoiceannounce 1 "allies_hq_compost_damaged"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 4 0 0
		wm_objective_status 4 1 0
	}
}

axis_compost_built
{
	spawn
	{
		wait 400
		trigger axis_compost_built setup

		constructible_class 2
	}

	trigger setup
	{
		setchargetimefactor 0 soldier 1
		setchargetimefactor 0 lieutenant 1
		setchargetimefactor 0 medic 1
		setchargetimefactor 0 engineer 1
		setchargetimefactor 0 covertops 1
		sethqstatus 0 0
	}

	buildstart final
	{
		setstate axis_compost_built_model underconstruction
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible
	}

	built final
	{
		setstate axis_compost_built_model default
		setstate neutral_compost_closed_clip invisible
		setstate neutral_compost_closed_model invisible

		trigger axis_compost_built_model enable_axis_features

		enablespeaker axis_compost_sound
	}

	decayed final
	{
		setstate axis_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default
	}

	death
	{
		setstate axis_compost_built_model invisible
		setstate neutral_compost_closed_clip default
		setstate neutral_compost_closed_model default

		trigger axis_compost_built_model disable_axis_features

		disablespeaker axis_compost_sound
	}
}

axis_compost_built_model
{
	spawn
	{
		wait 400
		setstate axis_compost_built_model invisible
	}

	trigger enable_axis_features
	{
		setchargetimefactor 0 soldier 0.75
		setchargetimefactor 0 lieutenant 0.75
		setchargetimefactor 0 medic 0.75
		setchargetimefactor 0 engineer 0.75
		setchargetimefactor 0 covertops 0.75
		sethqstatus 0 1

		wm_announce	"Axis Command Post constructed. Charge speed increased!"

		// *----------------------------------- vo ------------------------------------------*
		wm_teamvoiceannounce 0 "axis_hq_compost_constructed"

		wm_teamvoiceannounce 1 "allies_hq_compost_constructed_axis"

		wm_removeteamvoiceannounce 0 "axis_hq_compost_construct"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 4 0 1
		wm_objective_status 4 1 2
	}

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

		wm_announce	"Allied team has destroyed the Axis Command Post!"

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "axis_hq_compost_construct"

		wm_addteamvoiceannounce 1 "allies_hq_compost_construct"

		wm_teamvoiceannounce 0 "axis_hq_compost_damaged"

		wm_teamvoiceannounce 1 "allies_hq_compost_construct"
		// *---------------------------------------------------------------------------------*

		wm_objective_status 4 0 0
		wm_objective_status 4 1 0
	}
}

// BRIDGE MOVER STUFF

bridge_trigger1
{
	spawn
	{
		accum 6 set 1
	}

 trigger lever1up
	{
		accum 6 abort_if_not_equal 1
		trigger lever1 down
		accum 6 set 0
		wait 9000
		trigger bridge_trigger2 setaccum0
	}

		trigger setaccum1
	{
		accum 6 set 1
	}
}

bridge_trigger2
{
	spawn
	{
		accum 7 set 1
	}

	trigger lever1down
	{
		accum 7 abort_if_not_equal 0
		trigger lever1 up
		accum 7 set 1
		wait 9000
		trigger bridge_trigger1 setaccum1
	}

	trigger setaccum0
	{
		accum 7 set 0
	}

}

lever1
{
	spawn
	{
	}

	trigger down
	{
		gotomarker bridge_lever1_downpos 16  //speed of movement
		trigger bridge1 open
	}

	trigger up
	{
		gotomarker bridge_lever1_uppos 16
		trigger bridge1 close
	}
}

bridge1
{
	spawn
	{
	}

	trigger open
	{
		wait 500
		gotomarker bridge_up 32
	}

	trigger close
	{
		wait 500
		gotomarker bridge_down 32
	}
}

Thanks in advance of any advice and help given. :moo:


(Ifurita) #2

I don’t think you can stop midway between two gotomarkers, but, if you created a chain of them, then you could use an accum for when your winding mechanism is destroyed, then make moving to the next gotomarker contingent on the accum being 0, e.g.,

globalaccum * abort_if_equal 1


(carnage) #3

you can, use the comand halt and it will stop dead in its tracks

have a vairaiable to say wether your gate is oparationable or not, when the winding materail is destroyed

{
halt
wait 100
goto closed position
}

if your gate is alreay closed then it wont move and it it is onpening or opeing it will stop and go back down

then you need to but a logic cheack on the trigger that opens the gate to work out if the winding machine is broken or not


(DAbell) #4

Right so if i put a “accum 8 set 1” or something like it in the death sequence of the north winding equipment part of the script, then i need to put “globalaccum 8 abort_if_equal 1” in a part of the bridge mover script whereabouts would i put it in the


bridge1 
{ 
   spawn 
   { 
   } 

   trigger open 
   { 
      wait 500
      *globalaccum 8 abort_if_equal 1*
      gotomarker bridge_up 32 
   } 

   trigger close 
   { 
      wait 500 
      *globalaccum 8 abort_if_equal 1*
      gotomarker bridge_down 32 
   } 
} 

section or not i get what you mean i think the best i can do without too much fannying about is too disable the bridge once the north equipment is blown.

Thanks for your help.

David


(carnage) #5

ok if you want the gate to be closed whne the winding gear is blow you dont need a golobal accum test in the trigger close

then set up the winding gear a dynomitabel object or constructable if you want it rebuilding and in the death part you want to make the global accum set to not low the gate to open, also trigger “trigger bridge1 tigger close” and the gate will close when the equiptment is destryed

(to make it so the bridge will open again set the gear a func_constructable and set the globalaccum back to alow the gate to open with its constructed


(Loffy) #6

Hi!

Oh, destroying stuff that moves! Like gates or moving bridges. Brr, can be a difficult task.

I have a moving laboratory door in my old map for ET: goldeneye_bunker1.
http://www.acc.umu.se/~loffy/goldeneye_bunker1_fast.htm
The door is called “the Flag Door” in the map. Technically it is a script_mover, but you can dynamite it. The tric I did was to make an invisible (caulk) frame and I turned it into a func_explosive. When it explodes, the door is setstate invisible. THE PROBLEM though was this: suppose the attackers dynamite the door while it is in motion?

Phew. Not an easy task for us mappers. I never managed to fix it to the point of perfection. In the end I had to settle for the simple solution: If door is in motion (it was the kind of door that goes from the roof and down) when the dynamite goes ka-blam, it will continue to its end position (either up or down depending on its current movement) before it vanishes. Really ugly.

But sometimes I think it is only we as mappers that see these little things as chatastrophies. Eh, or however it is spelled. Players don’t care.

After some time I began to think: What if that door would NOT be setstated invisible? It would ruin the map totally! (Thankfully, it seems to work.) If I would remake goldeneye_bunker1 today I would make it so that a pice of the surrounding walls would vanish. I would make it so that even if the door remained after the blast (annoying!), players could pass on either side of it.

In my current uber-project “Mayhem” there is this tank that goes thru a wall. (Actually there are two tanks in the map - one for each team.) The idea is to let the attackers use the tank to create a passage. When the tank hits the wall there is a small “bang” and a hole in the wall appears. After just another 1 second, there is a louder “BANG” and a much bigger hole appears when a script_mover is setstate invisible. In other words, there are two script_movers involved.

The tank continues a large distance past the wall. It is not in the way for the players who passes the wall.

(Why TWO holes?? Well, I thought I’d look cool. If they appear in sequence. There are also func_explosives and stuff.)

Learning from goldeneye_bunker1 I’ve done this: I have made the smaller wall-hole big enough for a player to walk thru. JUST IN CASE that second script_mover isn’t setstate invisble.

Holding out for St Nazaire. It will be a killer map!

//Loffy


(carnage) #7

realy if your just goint ot make holes why bother with script_movers just use func_explosive and set to be invincibel then alertentity from the script

for your lab door, when the dyno went of you needed to triger another comand in the script_mover

trigger when dyno goes off
{
halt //this will stop your door in mid motion and stop any current scripts running on it
set the door to be invisible
use the comand that makes a script_mover apear at a marker instantly so its out of the way
}

that would make your door invisble and move instantly


(Loffy) #8

Thanks for the ideas. Will try them when the problem arises in any new project.


(DAbell) #9

Right i’m a little more confused now right i’ll simplify my request a bit more to get the answer i need.

The north equipment is a blow once objective, not to be re-built.

Once its blown the gate does not want to open or close just stay where it is prior to equipment being blown.

I’m pretty sure what i said about the accum values is sort of right i just need someone to clarify it for me before i go and mess my script up.

I might just go and have a little fiddle hehehehehehe

Could all end in tears, wish me luck.