Jump to content
Sign in to follow this  
metallicafan33

Dedicating starting locations in warfare

Recommended Posts

Hello,

I am creating a 3 sided warfare mission.

Now I have set 3 starting locations which are working, but I also want to assign them to a side.

So for example StartingLocation1 will be where East starts.

Can anybody help me with doing this?

Share this post


Link to post
Share on other sites

Review the Server_PlaceSides.sqf in Warfare. The notes at the beginning of the script provide a basic summary of how the different side placement values work.

You'll have three locations placed in editor, identified as 0, 1 and 2.

You'll be using this in your custom init:

BIS_WF_Common SetVariable ["sidePlacement",[false,1,2]];

"False" to disregard SRL locations of the map and use only those placed in editor;

East will be assigned location 1;

Resistance will be assigned location 2;

West will get assigned location 0 since it's the only remaining location.

Share this post


Link to post
Share on other sites

thx, I will try it out in a minute. But can you explain me why East will be assigned to location 1 and 2 to Resistance?

I also thought that if I put the units on the preferred location in the editor and disable random starting locations it might possibly work too?

Share this post


Link to post
Share on other sites
can you explain me why East will be assigned to location 1 and 2 to Resistance?

It's how the Server_PlaceSides.sqf handles side placement based upon the number of starting locations. East and Resistance each have numbers assigned, West gets the remainder. East uses certain numbers, Resistance uses certain numbers, and West gets whatever falls below the range if any or assigned where placed in editor if none. Any side with a number outside the available range is placed where it resides in editor. So if there were 3 locations total, East had variable "1" and Resistance had variable "3", West would place at 0, East would place at 1 or 2, and Resistance would place where they were located in editor since the number 3 is outside the available range.

I also thought that if I put the units on the preferred location in the editor and disable random starting locations it might possibly work too?

True. Using "false" with no starting locations placed in editor, the sides will start out where placed in editor.

Using "false" with numbered locations assigned is useful when choosing to place multiple random start locations in editor and you intend to restrict the sides to certain sectors of the map.

Here's a writeup I did as my own personal notes when trying to decipher the side placement rules a while back. I cannot attest to it's absolute accuracy, because when I wrote it I was just starting to learn how to use Warfare's external scripting capabilities, and haven't reviewed it since then.

SIDE PLACEMENT:

--------------

Default setting:

BIS_WF_Common SetVariable ["sidePlacement",[true,-1,-1]];

Core file called:

Warfare\scripts\server\functions\Server_PlaceSides.sqf

Example modified setting:

BIS_WF_Common SetVariable ["sidePlacement",[false,3,1000]];

"SidePlacement" is an array that affects the initial placement of units synched to the Warfare module and their bases. The default setting of [true,-1,-1] will set all sides to use all possible start locations on the map (SRL and custom) and randomly place each side at one.

The core script actually has six variables used in the side placement array, but the default setting only requires the first three. The others are optional, and one can effect or be affected by a mission param setting.

The Side Placement variables are:

	Variable:			Values:				Index Number:
_useDefaults			true/false			(select 0)
_eastMin			number (count -1 and up)	(select 1)
_resistanceMin			number (count -1 and up)	(select 2)
_startingDistance		number (meters)			(select 3)
_mineBaseFromTownRange		number (meters)			(select 4)
_forcePlacement			true/false			(select 5)

The variable descriptions are as follows:

_useDefaults:

- If TRUE, then Strategic Reference Layer (SRL) start locations built into the map are used, and any custom start locations in the editor are included.

(Note: Almost all BIS maps have SRL start locations in the map, but many custom maps don't have them. Where no SRL exists in the map, custom start locations must be placed in editor or units will start at their locations placed in the editor.)

- If FALSE, only custom mission start locations placed in the editor are used.

(The mission designer places Game Logics that are named using a progressing index number, i.e: "StartingLocation0", "StartingLocation1", "StartingLocation2", "StartingLocation3", etc.)

_eastMin:

The number given defines the index in the start locations for placing EAST forces; which will also affect the placement of WEST forces. -1 means both sides random; 0 means East randomly uses all custom start locations; and any number greater or equal to the number of custom start locations means East uses none, and is fixed at the editor location.

Any no., Not -1 : All SRL locations are excluded, and custom start locations must be placed in the mission editor.

-------------------------------------

-1 : Both East and West will randomly pick from all available locations (SRL and custom).

-------------------------------------

0: East will randomly pick any start location, and West will be fixed at its location in the mission editor.

-------------------------------------

Number of Location > 0 : East will place randomly at any location from number- to max-, and West will place randomly at the others (location 0 if the number given is "1"). The number references to the index numbers in the names of the location logics placed in editor. If there are 8 possible locations and _eastMin = 4, then East will pick randomly from logics indexed 4 thru 7 (StartingLocation4 - 7) and West will pick from the remaining four (StartingLocation0 - 3).

-------------------------------------

Greater or Equal count : East will be fixed at its location in the mission editor, and West will randomly pick any start location.

_resistanceMin:

Defines the index for Resistance starting locations; similar to _eastMin, it references the index used in starting locations. If _resistanceMin is set to 0 (random using all locations), both East and West will be fixed at their locations in the editor.

If there are 9 possible locations, _eastMin = 6 and _resistanceMin = 3; then East will pick randomly from start locations 6 thru 8, Resistance will pick randomly from 3 thru 5, and West will pick randomly from 0 thru 2.

To set all sides to their fixed position in the editor, remove all start location logics from editor and set _useDefaults to "false", so that SRL locations aren't used. With no start locations in editor and SRL excluded, the sides are forced to use their editor positions. If the 4th, 5th and 6th values in the array aren't being used, the single value [false] is sufficient; but if the 4th, 5th or 6th values are being set, then any number can be used for _eastMin and _resistanceMin, i.e.: [false,0,0,3000,50,false]. The 2nd and 3rd values become irrelevant when _useDefaults is "false" and there are no start location logics.

Examples of Placement Settings:

EAST	WEST	RESISTANCE	ARRAY SETTINGS
Fixed	Fixed	Fixed	[false] (no logics set)
Fixed	Fixed	Random	[true/false,any,0]
Fixed	Random	Random	[true/false,1000,-1]
Random	Random	Random	(All) [true/false,-1,-1]
Random	Random	Random	(Targeted) [true/false,any,any]
Random	Random	Fixed	[true/false,>0,1000]
Random	Fixed	Fixed	[true/false,0,1000]
Fixed	Random	Fixed	[true/false,1000,1000]
Random	Fixed	Random	[true/false,0,-1]

_startingDistance:

Sets the minimum starting distance in meters between opposing forces. Core uses a default of 2000. The number set here will replace the default. This will become the default setting for a "min start distance" parameter, if set up.

_mineBaseFromTownRange:

Sets the Minimum distance in meters from a town that a start location must be in order to be used. Core uses a default of 300. The number set here will replace the default.

_forcePlacement

If TRUE, it forces all sides to be placed even if placed already. The default is FALSE. This should generally be set false when creating the array. An example when it might be used is if _startingdistance is set far apart and params are not used, so eligible start locations for a side might not be found. It will force sides to place, overriding the set start distance.

Example of a full Side Placement array:

BIS_WF_Common SetVariable ["sidePlacement",[false,3,1000,2000,150,true]];

In this example, only custom start locations are used; EAST will use locations 3 and higher, and WEST will use location 0 thru 2; RESISTANCE will fix at their editor location; EAST and WEST will only use locations at least 2km apart; only locations at least 150m from a town will be used; and forced placement will be called in the event a side has no eligible start location.

(Actually, looking at this now, I might have the numbers in post# 2 backwards, should be [false,2,1] maybe?)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×