Command Post Spawn


(kennie) #1

Hi

How can you make a command post what if they construct it that they there can spawn?

Greetzz Kennie


(Loffy) #2

When the command post is created, the script will run a specific order. You can make that order what ever you want. So, you can make the order: “Activate spawn!”
For example: You can have two spawn areas. One for axis and one for allies. Then you can have a forward spawn (in the middle of the map). whenever the command map is created, the team that did build it WILL HAVE FORWARD SPAWN.
And when the command post is destroyed, the forward spawn will go away.

Hint: You active and de-active the forward spawn area via the script. (The script for the command post.)

// Loffy


(kennie) #3

This is my script for my command post what must i add then

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 2 0 2
		wm_objective_status 2 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 2 0 0
		wm_objective_status 2 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 3 0 1
		wm_objective_status 3 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 3 0 0
		wm_objective_status 3 1 0
	}

}

(kennie) #4

And maybe then you understand better i want to have it like on Suply Depot there you can to spawn on your cp


(Siemnov) #5

That system is done in radar too. Maybe you should check that script.


(kennie) #6

yeah i found it tnx but what must i add al in the .map?


(Loffy) #7

Hi again!

It is rather complicated but it is possible.

First, make sure you have a working neutral command post. Compile the map, and see if it works.

For this to work, you must add:
a) you need to add “globalaccum 2 set 1” to your game_manager script (the spawn section). Globalaccum 2 is a counter, for “who has the toggle, for forward spawn?”. (0 = axis, 1 = allies.)

b) you must also add this script, to your game_manager script (the spawn section):
wait 50
// Set spawn areas via these setautospawn commands.
setautospawn “Forward spawn” 1 // A team_WOLF_objective entity.
setautospawn “Axis spawn” 0 // A team_WOLF_objective entity.

Then you add entities to your map and you add script to your command post script.

  1. First, add a forward spawn in you map. This forward spawn area has spawnboxes, the blue and red boxes. I call them forwardspawn_allies and forwardspawn_axis. And a yellow box (blob), the so called team_wolf_objective. I call it forwardspawnblob.

  2. Secondly, insert the following into the command post script. The overall idea is: When the commandpost is destroyed, no-one should be able to spawn at forward spawn.
    wait 50
    // Make sure that no-one may spawn at the forward spawn.
    setstate forwardspawnblob invisible // The yellow box. Script-/targetname = forwardspawnblob
    wait 50
    setstate forwardspawn_axis invisible // The red axis spawn boxes, “redspawn”
    wait 50
    setstate forwardspawn_allies invisible // The blue allied spawn boxes.

    wait 100
    setautospawn “Allied spawn” 1 // This is the first spawn for allies.
    wait 100
    setautospawn “Axis spawn” 0 // First spawn for axis.

Insert the above script in the command post script, when the command post is destroyed. For example, in the “trigger disable_allied_features” script.

In the trigger disable_axis_features, you write:
wait 50
// Make sure that no-one may spawn at the forward spawn.
setstate forwardspawnblob invisible
wait 50
setstate forwardspawn_axis invisible
wait 50
setstate forwardspawn_allies invisible

wait 100
setautospawn	"Allied spawn" 1
wait 100
setautospawn	"Axis spawn" 0

Now, when someone builds the command post, they get forward spawn. Here is an example of what you can write for the allies:
// Make sure that the forward spawn area is functional.
wait 50
setstate forwardspawnblob default
wait 50
setstate forwardspawn_axis default
wait 50
setstate forwardspawn_allies default
wait 100
setautospawn “Forward spawn” 1 // This is the forward spawn. Now allies will have it. (1 = allies, 0 = axis.)
wait 100
setautospawn “Axis spawn” 0 // Axis spawn at first spawn area.

	// You can use a toggle, to switch the forward spawn.
	//Checking if allies already "own" the toggle.
	//If they do, then there is no reason to toggle these entities.
	globalaccum 2 abort_if_equal 1 // Globalaccum 2 is a counter.
	globalaccum 2 set 1 
	wait 100
	alertentity forwardspawn_allies
	wait 100
	alertentity forwardspawn_axis
	wait 100
	alertentity forwardspawnblob

You can insert this script (above) in the “trigger enable_allied_features” script.
For the axis, you write this:
// Make sure that the forward spawn area is functional.
wait 50
setstate forwardspawnblob default
wait 50
setstate forwardspawn_axis default
wait 50
setstate forwardspawn_allies default
wait 100
setautospawn “Forward spawn” 0
wait 100
setautospawn “Allied spawn” 1

	//Checking if axis already "own" the toggle.
	//If they do, then there is no reason to toggle these entities.
	globalaccum 2 abort_if_equal 0
	globalaccum 2 set 0
	wait 100
	alertentity forwardspawn_allies
	wait 100
	alertentity forwardspawn_axis
	wait 100
	alertentity forwardspawnblob

And you insert it to the “trigger enable_axis_features”.

In sum: You have two spawn areas. One for allies, one for axis. And there is one forward spawn area, in the middle. Then, whoever has the commandpost will automatically have the forward spawn. In other words: The forward spawn area is toggled. It toggles from allied to axis control

You will have to try and try and try, until it works. It will take time, and it is complex. But eventually it will work.

// Loffy