OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: Spyder001 on 12 Jul 2010, 05:33:50

Title: AToW "Advance" - Help Needed
Post by: Spyder001 on 12 Jul 2010, 05:33:50
Hello, I am looking for some help with the next campaign over at ArmA ToW. Our current staff is is bogged down with the scripts from other parts of the campaign (resources, UN menu, forward spawning, etc.) as well as ACE development and real life.

Below is what is required to capture a sector in the mission. The code of a sector should be able to be copy and pasted so that someone with very limited scripting expirence can copy and paste, changing variable names (alpha_01, alpha_02, bravo_01, etc) to save time for the scripters.

I tried keeping this as short as possible.
_________________________

(http://i17.photobucket.com/albums/b77/Spyder001/assault.jpg)

I. Sectors

A. Takistan is separated into a pre-determined number of sectors.
B. Sector code should be able to be copy + pasted to cut down on the work of the scripter

II. Zones

A. Each sector is split in half creating 2 zones.
B. Each zone contains one COP and battle position for each team.
C. A "invisible" line is drawn across the width of the zone. This comes into play later on.

III. COP (Combat Outpost)

A. Placement


B. Capturing


C. Assets


IV. Battle Position

A. Creation


B. Destruction


C. Assets


V. Win Conditions

A. To win a zone, a team must destroy the enemy's battle position and secure the enemy's COP.
B. To win a sector, a team must secure both zones.

* Axis of advance is used for distance to stop teams from passing each other's battle positions and pushing to the other side of the zone (shown on image as green line).

** If a vehicles is destroyed, another cannot be spawned for 5 minutes

Below image describes the system more in depth.

(http://i17.photobucket.com/albums/b77/Spyder001/AoA.jpg)
Title: Re: AToW "Advance" - Help Needed
Post by: Ironman on 12 Jul 2010, 23:20:36
generally on these forums people will not write a large piece of script for someone. You will have to show an honest effort of your own script that will probably not work. Then people will help you out using the material you already gave.
Title: Re: AToW "Advance" - Help Needed
Post by: Spyder001 on 12 Jul 2010, 23:56:49
Yeah I was told a lot of code is involved lol. So it was suggested I break the mission into smaller parts. The main part i need is the axis of advance.

So how would I create this? I think that inside the COP there is a flag. From the flag a marker is placed that spans out far enough to cover that sector. This marker is used to get distance from where we will place the battle position.

Title: Re: AToW "Advance" - Help Needed
Post by: Ironman on 13 Jul 2010, 02:28:57
name the flag then get positions of named flag.
then create marker at the named flag position.

I am not sure how to do math with [x,y,z] coords.... maybe there is a getDistance command?

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

http://www.ofpec.com/COMREF/index.php?action=details&id=107&game=All
Title: Re: AToW "Advance" - Help Needed
Post by: Spyder001 on 13 Jul 2010, 05:46:07
Thanks Ironman I'll look into that. Another part I am working on requires this. Unfortunately it isn't working.

Code: [Select]
if (crate_zone01_sectorAlpha damage == 1)

then {

crate_zone01_sectorAlpha removeAction 2;
deleteVehicle object01_zone01_sectorAlpha;
deleteVehicle object02_zone01_sectorAlpha;
deleteVehicle object03_zone01_sectorAlpha;
deleteVehicle object04_zone01_sectorAlpha;

}
Title: Re: AToW "Advance" - Help Needed
Post by: Mandoble on 13 Jul 2010, 21:13:44
Attached
Title: Re: AToW "Advance" - Help Needed
Post by: Spyder001 on 14 Jul 2010, 04:31:42
Thanks Mando, I appreciate all the help! I am going to attach the mission that has everything mando created and I created put together. Here is what it does so far and what I am trying to get it to do. I think the what I need it to do part will require a re-write some my scripts lol.

There is a lot of stuff I need help with now. I will add the proper question tomorrow.
Title: Re: AToW "Advance" - Help Needed
Post by: Mandoble on 14 Jul 2010, 22:15:22
Attached
Title: Re: AToW "Advance" - Help Needed
Post by: Spyder001 on 15 Jul 2010, 01:05:19
Thanks again mando!

I'm going to attach my current state of my mission. I am trying to use the newCrate.sqf to move a game logic (which is where the frontline of your team is, advance.sqf). When I execute newCrate.sqf is moves the frontline to the position of the ammocrate. However, I had to define the game logic by name, not by using a variable so it works with the other game logics for different teams/zones. Here is what I thought it should when not defining the game logic by name, but no luck.

Code: [Select]
init.sqf

newCrate = w_bp_z01 addAction ["newCrate", "newCrate.sqf", _ammo];

Code: [Select]
newCrate.sqf

_this = _this select 0; // No idea, this seems redundant
_ammo = _this select 1; //ammo is actually the game logic i believe, used to be an ammo crate
_ammo setpos (getPos _this); //_ammo should point to the game logic, it's not!!
Title: Re: AToW "Advance" - Help Needed
Post by: Mandoble on 15 Jul 2010, 01:15:08
To refer to names for variables you may try

call compile format["my_global_var%1 = %2;", 1, 2];

which would be equivalent to execute
my_global_var1 = 2;

Not sure if this is what you were looking for.
Title: Re: AToW "Advance" - Help Needed
Post by: Spyder001 on 15 Jul 2010, 01:45:20
No luck, I changed

_ammo = _this select 1;

to

call compile format["_ammo%1 = %2;", 1, 2]; and
_ammo = 2;

neither worked
Title: Re: AToW "Advance" - Help Needed
Post by: Mandoble on 15 Jul 2010, 21:19:00
See attachment
Title: Re: AToW "Advance" - Help Needed
Post by: Spyder001 on 16 Jul 2010, 08:13:41
Works great thanks mando.

Updated 1st page