Author: shk
Author Website:

Requirements: No addons required

Version: 1.1

Short description: This script picks randomly a position based on preplaced markers and moves units there.

Date: 2010-11-10 08:26


Comments: (0)
Rating:



 







SHK_startingPositionRandomizer

by
Shuko


Description:
This script picks randomly a position based on preplaced markers and moves units there. Places are defined for each side, there can be different number of them for each. A start marker is created at the position, only shown for players on the specific side.
It moves vehicles, tents etc as well, remembering all the relative positions.


Usage:
The positions of all units and objects to be moved are based on their relative position to the first marker (for example startpos_east_1). What this means is that you should place your objects around/on top of the first marker.
For example, the randomizer decides that the starting position is startpos_east_2 instead of startpos_east_1. All the objects will be moved and placed to same direction and distance from the position 2 marker that they were from position marker 1.

Marker naming:
All markers need to start with "startpos", following an underscore, side or faction. After
those are an underscore and an incremental integer. First number is 1.

Examples:
startpos_east_1
startpos_west_1
startpos_usmc_3
startpos_guer_2

Valid sides and factions:
Sides:
"civ"
"east"
"guer"
"west"

Factions:
"civ_ru" (the normal civ faction is named civ, which is same as the civilian side)
"cdf"
"gue"
"ins"
"ru"
"usmc"

Syntax for all sides having same amount of possible location:
[number] call compile preprocessfile "SHK_startingPositionRandomizer.sqf";

Example:
[3] call compile preprocessfile "SHK_startingPositionRandomizer.sqf";

Parameters for sides having different amount of possible location:
[[side or faction,number],[side or faction,number]]

Example:
[["east",2],["west",3]]
[["usmc",2],["cdf",3],["east",5]]
If the values given contain both faction and side to which a unit belongs to, the one which is given first is used.

Example:
[["usmc",2],["west",3]]
In this example the unit will be moved to the usmc location instead of the west.

Parameters to move more objects than just players, for example empty vehicles or ammo crates:
Valid ways to pass objects:
- Listing their names
- Name them similarly and give the name "tag" and count of them

[side or faction,number,[objName1,objName2,[objNameTag,count of objects]]]

Example:
[["east",2,[uaz,truck,["eastobject",2]]],["west",3,[hmmvee,aav,["weststuff",3]]]]
In this example objects which will be moved are:
uaz, truck, hmmvee, aav and eastobject_1, eastobject_2, weststuff_1, weststuff_2 and weststuff_3


Media:
- Example video made for members of Kyllikki:
http://derfel.org/arma2/scripts/SHK_randstapos.swf


Forum topic:
- BI forums




Enable javascript to be able to download from Armaholic please!



Tags: Random