Mapscript


(tjimboo) #1

hi,

There is a few maps that i would like to make the flag not re-capturable once it has ben taken.
For example battery would be such map. Any one know how to do this?


(acQu) #2

Yop, knows. But, difficult, depends if you are happy with result. Simple solution is to remove the entity whenever the desired team touches the flag. Then it is gone, however :slight_smile:

For basic understanding, i think you know very well what to do from there: in battery, check “westbunker_flag” and in there “trigger allied_capture”. At the end of this block you type either “remove” or “setstate westbunker_flag invisible”. That is just out of my head, but should work.

If you want to keep the flag visually there once the desired team touches the flag, then you have to do some other stuff, possibly even tricks, didn’t check out. But the simple solution should work.


(Micha) #3

Easiest way would be:
battery:


	trigger westbunker_flagblue
	{
		// Some kind of UI pop-up to alert players
		wm_announce	"Allies capture the Forward Bunker!"

		wm_objective_status	3 1 1
		wm_objective_status	3 0 2

wait 200
setstate westbunker_flag invisible
	}

This code should work but I’m to lazy to test :stuck_out_tongue:


(acQu) #4

[QUOTE=Micha;468170]Easiest way would be:
battery:


	trigger westbunker_flagblue
	{
		// Some kind of UI pop-up to alert players
		wm_announce	"Allies capture the Forward Bunker!"

		wm_objective_status	3 1 1
		wm_objective_status	3 0 2

wait 200
setstate westbunker_flag invisible
	}

This code should work but I’m to lazy to test :P[/QUOTE]

Yes, what i said pretty much :stuck_out_tongue:

Although, he could also just disable the whole block once the allied team has touched the flag. This way, the flag stays visual, but no spawnpoints are switched. Can be slightly annoying though, since players don’t get feedback that touching the flag is actually not recapturable


(Mateos) #5

And people screaming at the flag “Get out of the way!” x) Better make it invisible if non-capturable! Like on Oasis when the wall is blown up.


(acQu) #6

True. Maybe they can read wm_announce messages :stuck_out_tongue: I don’t have high hopes on that :smiley: But personallyi like this much more, if the flag stays visually there.

Below is a modified script which leaves the flag visually there, but disables spawn swapping. I placed messages in this script whereever was needed to inform players that spawning is disabled. Just replace the script block with the one in the original battery script.

westbunker_flag
{
	spawn
	{
		accum 0 set 0	// Who has the flag: 0-Axis, 1-Allied
        accum 1 set 0   // Was the flag already captured by Allies?
	}

	trigger allied_capture
	{
		accum 0 abort_if_equal 1 // do Allies own flag?
        accum 1 trigger_if_equal 1 westbunker_flag al_recap_disabled // Allies already captured the flag, reroute
        accum 1 abort_if_equal 1

		trigger game_manager westbunker_flagblue

		setstate westbunker_spawns default
		setstate westbunker_wobj default

		trigger westbunker_flag setallies

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "battery_axis_controls_defend"
		wm_addteamvoiceannounce 0 "battery_axis_bunker_capture"

		wm_addteamvoiceannounce 1 "battery_allies_controls_destroy"

		wm_teamvoiceannounce 0 "battery_axis_bunker_lost"
		wm_teamvoiceannounce 0 "battery_axis_controls_defend"

		wm_teamvoiceannounce 1 "battery_allies_bunker_captured"
		wm_teamvoiceannounce 1 "battery_allies_controls_destroy"

		wm_removeteamvoiceannounce 0 "battery_axis_bunker_defend"

		wm_removeteamvoiceannounce 1 "battery_allies_bunker_capture"
		// *---------------------------------------------------------------------------------*
        
        accum 1 set 1
        wm_announce	"Allies entered the bunker complex! Forward spawn ^1disabled for Axis^7!"
	}

	trigger setallies
	{
		accum 0 abort_if_equal 1
		accum 0 set 1

		alertentity westbunker_wobj
		alertentity westbunker_spawns

		setautospawn "Axis Main Bunker" 0
	}

    trigger al_recap_disabled
    {
        // wm_announce	"Allies recapture the Forward Bunker, but with ^1no effect!^3"
    }

	trigger axis_capture
	{
		accum 0 abort_if_equal 0 // do Axis own flag?
        accum 1 trigger_if_equal 1 westbunker_flag ax_recap_disabled // Allies already captured the flag, reroute
        accum 1 abort_if_equal 1

		trigger game_manager westbunker_flagred

		setstate westbunker_spawns default
		setstate westbunker_wobj default

		trigger westbunker_flag setaxis

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "battery_axis_bunker_defend"

		wm_addteamvoiceannounce 1 "battery_allies_bunker_capture"

		wm_teamvoiceannounce 0 "battery_axis_bunker_captured"

		wm_teamvoiceannounce 1 "battery_allies_bunker_lost"

		wm_removeteamvoiceannounce 0 "battery_axis_bunker_capture"

		wm_removeteamvoiceannounce 1 "battery_allies_controls_destroy"
		// *---------------------------------------------------------------------------------*
	}

	trigger setaxis
	{
		accum 0 abort_if_equal 0
		accum 0 set 0

		alertentity westbunker_wobj
		alertentity westbunker_spawns
	}

    trigger ax_recap_disabled
    {
        wm_announce	"Axis recapture the Forward Bunker, but with ^1no effect^3!"
    }
}

(tjimboo) #7

many thanks… ill give it a try and see if i get it.


(RayBan) #8

Just Remove…thats all…


(RayBan) #9

Just remove everything… btw… it’s easy to do, you can figure that out… right?


(Mateos) #10

There’s as well an edit button to avoid double-posting :slight_smile:


(RayBan) #11

lol… how did i do that… oh wait… it was friday, payday… 33 degree’s out with a humidex of 84%, and an ice cold case of bud after work… might explain something’s… doesn’t explain why i put lipstick on the cat though… and when i walked past her this morning to goto work, she gave me a look like i owed her an explanation… anyways,.
morning all =)


(RayBan) #12

I didn’t really put lipstick on that cat though… just a joke… =P


(acQu) #13


:confused:

:smiley:


(acQu) #14


(RayBan) #15

Serioulsy… she likes to slut it up… she’s been spaded and tattoo’d in the ear… the city know’s she’s mine… but that does not stop her from bring a cat whore… look at this poor dude…

http://s101.photobucket.com/user/Shadder_2006/media/horny_cat2.jpg.html?sort=3&o=76

found him on my roof looking for my lipstick covered cat… I told him she was spaded, then he really gave me the sad eyes… sorry dude…


(RayBan) #16

ok, way off topic… just trigger remove… =P


(tjimboo) #17

[QUOTE=acQu;468376]True. Maybe they can read wm_announce messages :stuck_out_tongue: I don’t have high hopes on that :smiley: But personallyi like this much more, if the flag stays visually there.

Below is a modified script which leaves the flag visually there, but disables spawn swapping. I placed messages in this script whereever was needed to inform players that spawning is disabled. Just replace the script block with the one in the original battery script.

westbunker_flag
{
	spawn
	{
		accum 0 set 0	// Who has the flag: 0-Axis, 1-Allied
        accum 1 set 0   // Was the flag already captured by Allies?
	}

	trigger allied_capture
	{
		accum 0 abort_if_equal 1 // do Allies own flag?
        accum 1 trigger_if_equal 1 westbunker_flag al_recap_disabled // Allies already captured the flag, reroute
        accum 1 abort_if_equal 1

		trigger game_manager westbunker_flagblue

		setstate westbunker_spawns default
		setstate westbunker_wobj default

		trigger westbunker_flag setallies

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "battery_axis_controls_defend"
		wm_addteamvoiceannounce 0 "battery_axis_bunker_capture"

		wm_addteamvoiceannounce 1 "battery_allies_controls_destroy"

		wm_teamvoiceannounce 0 "battery_axis_bunker_lost"
		wm_teamvoiceannounce 0 "battery_axis_controls_defend"

		wm_teamvoiceannounce 1 "battery_allies_bunker_captured"
		wm_teamvoiceannounce 1 "battery_allies_controls_destroy"

		wm_removeteamvoiceannounce 0 "battery_axis_bunker_defend"

		wm_removeteamvoiceannounce 1 "battery_allies_bunker_capture"
		// *---------------------------------------------------------------------------------*
        
        accum 1 set 1
        wm_announce	"Allies entered the bunker complex! Forward spawn ^1disabled for Axis^7!"
	}

	trigger setallies
	{
		accum 0 abort_if_equal 1
		accum 0 set 1

		alertentity westbunker_wobj
		alertentity westbunker_spawns

		setautospawn "Axis Main Bunker" 0
	}

    trigger al_recap_disabled
    {
        // wm_announce	"Allies recapture the Forward Bunker, but with ^1no effect!^3"
    }

	trigger axis_capture
	{
		accum 0 abort_if_equal 0 // do Axis own flag?
        accum 1 trigger_if_equal 1 westbunker_flag ax_recap_disabled // Allies already captured the flag, reroute
        accum 1 abort_if_equal 1

		trigger game_manager westbunker_flagred

		setstate westbunker_spawns default
		setstate westbunker_wobj default

		trigger westbunker_flag setaxis

		// *----------------------------------- vo ------------------------------------------*
		wm_addteamvoiceannounce 0 "battery_axis_bunker_defend"

		wm_addteamvoiceannounce 1 "battery_allies_bunker_capture"

		wm_teamvoiceannounce 0 "battery_axis_bunker_captured"

		wm_teamvoiceannounce 1 "battery_allies_bunker_lost"

		wm_removeteamvoiceannounce 0 "battery_axis_bunker_capture"

		wm_removeteamvoiceannounce 1 "battery_allies_controls_destroy"
		// *---------------------------------------------------------------------------------*
	}

	trigger setaxis
	{
		accum 0 abort_if_equal 0
		accum 0 set 0

		alertentity westbunker_wobj
		alertentity westbunker_spawns
	}

    trigger ax_recap_disabled
    {
        wm_announce	"Axis recapture the Forward Bunker, but with ^1no effect^3!"
    }
}

[/QUOTE]

Works like a charm expectp for spawnpoint once flag is caputered. Funny to see axis still but all focus to caputure the flag with no use.
So tnx for that help.


(YourFather_CZ) #18

[QUOTE=Micha;468170]Easiest way would be:
battery:


	trigger westbunker_flagblue
	{
		// Some kind of UI pop-up to alert players
		wm_announce	"Allies capture the Forward Bunker!"

		wm_objective_status	3 1 1
		wm_objective_status	3 0 2

wait 200
setstate westbunker_flag invisible
	}

This code should work but I’m to lazy to test :P[/QUOTE]
Your script does this:

  1. it changes owner of spawn
  2. it waits for 200+ ms
  3. it makes invisible spawn flag - so nobody can recapture it anymore

So if some player try to recapture spawn immediately fater or during step 1, he will recapture flag successfully and then it will become invisible.

This situation may occur at Würzbug Radar and Siwa Oasis while using default map scripts. If Axis recapture spawn at specific moment (right after main gate or wall is blown up) it will change its owner to Axis and make Allies unable to capture spawn again (due to invisible spawn flag).

It’s safer to make entity invisible first. And then change its owner.