What do I need to change to make this work?

What do I need to change to make this work?

« posted: Sep 08, 2015, 02:18 AM »
http://pastebin.com/GNB2f0LK

Code: [Select]
//    @file Version: 1.0
//    @file Name: mission_Outpost.sqf
//    @file Author: [404] Deadbeat, [404] Costlyy
//    @file Created: 08/12/2012 03:25
//    @file Args:
#include "setup.sqf"
#include "mainMissionDefines.sqf";

if(!isServer) exitwith {};
private ["_obj", "_rep1", "_rep2", "_rep3", "_rep4", "_result","_missionMarkerName","_missionType","_startTime","_returnData","_randomPos","_randomIndex","_badWeather", "_origFog", "_origRain", "_origOvercast", "_hint","_currTime","_playerPresent","_unitsAlive"];

//Mission Initialization.
_result = 0;
_missionMarkerName = "MadScience_Marker";
_missionType = "Defeat Mad Scientist";
#ifdef __A2NET__
_startTime = floor(netTime);
#else
_startTime = floor(time);
#endif


//Get Mission Location
_returnData = call createMissionLocation;
_randomPos = _returnData select 0;
_randomIndex = _returnData select 1;

diag_log format["WASTELAND SERVER - Main Mission Waiting to run: %1",_missionType];
[mainMissionDelayTime] call createWaitCondition;
diag_log format["WASTELAND SERVER - Main Mission Resumed: %1",_missionType];

[_missionMarkerName,_randomPos,_missionType] call createClientMarker;

_hint = parseText format ["<t align='center' color='%2' shadow='2' size='1.75'>Main Objective</t><br/><t align='center' color='%2'>------------------------------</t><br/><t align='center' color='%3' size='1.25'>%1</t><br/><t align='center' color='%3'>Recent weather trends may be artificially created!  Investigate!</t>", _missionType,  mainMissionColor, subTextColor];
[nil,nil,rHINT,_hint] call RE;

_origFog = fog;
_origOvercast = overcast;
_origRain = rain;

_obj = createVehicle ["Satelit",_randomPos,[], 0,"None"];
_obj setVariable ["faction", "WORLD", true];

_rep1 = createVehicle ["Suitcase", [_randomPos select 0, (_randomPos select 1) + 5],[], 0,"None"];
_rep1 setVariable ["faction", "WORLD", true];

rep2 = createVehicle ["Suitcase", [(_randomPos select 0) +5, _randomPos select 1],[], 0,"None"];
_rep2 setVariable ["faction", "WORLD", true];

rep3 = createVehicle ["Suitcase", [(_randomPos select 0) -5, _randomPos select 1],[], 0,"None"];
_rep3 setVariable ["faction", "WORLD", true];

rep4 = createVehicle ["Suitcase", [_randomPos select 0, (_randomPos select 1) -5],[], 0,"None"];
_rep4 setVariable ["faction", "WORLD", true];



_obj setVehicleInit "0 setOverCast .95; 0 setFog .95; 0 setRain .95;";
processInitCommands;


CivGrpM = createGroup civilian;
[CivGrpM,_randomPos] spawn createScienceGroup;

diag_log format["WASTELAND SERVER - Main Mission Waiting to be Finished: %1",_missionType];
#ifdef __A2NET__
_startTime = floor(netTime);
#else
_startTime = floor(time);
#endif
waitUntil
{
    sleep 1;
    _playerPresent = false;
    #ifdef __A2NET__
    _currTime = floor(netTime);
    #else
    _currTime = floor(time);
    #endif
    if(_currTime - _startTime >= mainMissionTimeout) then {_result = 1;};
    _unitsAlive = ({alive _x} count units CivGrpM);
    (_result == 1) OR (_unitsAlive < 1)
};

if(_result == 1) then
{
    //Mission Failed.
    {deleteVehicle _x;}forEach units CivGrpM;
    deleteGroup CivGrpM;
    deleteVehicle _obj;
   
    _rep1 setVehicleInit "0 setOverCast .5; 0 setFog .15; 0 setRain 0;";
    processInitCommands;

    deleteVehicle _rep1;
    deleteVehicle _rep2;
    deleteVehicle _rep3;
    deleteVehicle _rep4;
     
    _hint = parseText format ["<t align='center' color='%3' shadow='2' size='1.75'>Objective Failed</t><br/><t align='center' color='%3'>------------------------------</t><br/><t align='center' color='%4' size='1.25'>%1</t><br/><t align='center' color='%4'>Objective failed, better luck next time</t>", _missionType, _vehicleName, failMissionColor, subTextColor];
    [nil,nil,rHINT,_hint] call RE;
    diag_log format["WASTELAND SERVER - Main Mission Failed: %1",_missionType];
} else {
    //Mission Complete.
    deleteGroup CivGrpM;
    _rep1 setVehicleInit "0 setOverCast .15; 0 setFog .15; 0 setRain 0;";
     processInitCommands;
   
    _hint = parseText format ["<t align='center' color='%3' shadow='2' size='1.75'>Objective Complete</t><br/><t align='center' color='%3'>------------------------------</t><br/><t align='center' color='%4' size='1.25'>%1</t><br/><t align='center' color='%4'>The mad scientist has been stopped.  Enjoy the weather!</t>", _missionType, _vehicleName, successMissionColor, subTextColor];
    [nil,nil,rHINT,_hint] call RE;
    diag_log format["WASTELAND SERVER - Main Mission Success: %1",_missionType];
};

//Reset Mission Spot.
MissionSpawnMarkers select _randomIndex set[1, false];
[_missionMarkerName] call deleteClientMarker;

Re: What do I need to change to make this work?

« Reply #1 posted: Sep 08, 2015, 08:55 AM »
This is just a wild guess but have you compiled "createScienceGroup" in server/functions/serverCompile.sqf?

Re: What do I need to change to make this work?

« Reply #2 posted: Sep 08, 2015, 09:44 AM »
This is just a wild guess but have you compiled "createScienceGroup" in server/functions/serverCompile.sqf?

Well, this is an Arma 2 404 Wasteland mission. That is why I ask. I want to use it in A3wasteland. I assume things have been changed between 404 and A3W.
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2582

Re: What do I need to change to make this work?

« Reply #3 posted: Sep 08, 2015, 11:55 PM »
For starters, "RE", "setVehicleInit", and "processInitCommands" are not even available in Arma 3, "createWaitCondition" and anything related needs to be removed, markers need to be handled differently, etc.

Anyway this mission won't even work because the dynamic weather script overrides any attempt to change the weather after a couple seconds.

Re: What do I need to change to make this work?

« Reply #4 posted: Sep 09, 2015, 01:02 AM »
For starters, "RE", "setVehicleInit", and "processInitCommands" are not even available in Arma 3, "createWaitCondition" and anything related needs to be removed, markers need to be handled differently, etc.

Anyway this mission won't even work because the dynamic weather script overrides any attempt to change the weather after a couple seconds.

Well, I have a whole folder full of cool arma 2 wasteland missions that I would like to port over but need to know what needs to be changed.

Ill edit this post with the link to the missions.

**********************************EDIT**************************************


Here is the link to the missions folder: I will also attach it to the post. It contains all the missions and files used. Please help me port what ever missions in there I can. Show me what needs to be changed so I can learn to do it myself in the future.

https://drive.google.com/file/d/0BzluFv21TL3baWVoWFpPMTU4MlE/view?usp=sharing

Re: What do I need to change to make this work?

« Reply #5 posted: Sep 11, 2015, 12:43 AM »
How about this mission?

Code: [Select]
//    @file Version: 1.0
//    @file Name: mission_FarmerRiot.sqf
//    @file Author: [404] Deadbeat, [404] Costlyy
//    @file Created: 08/12/2012 15:19
//    @file Args:
#include "setup.sqf"
#include "worldMissionDefines.sqf";

if(!isServer) exitwith {};

private [ "_obj", "_obj2", "_objPos", "_soldier10","_soldier9","_soldier8","_soldier7","_soldier6","_soldier5","_soldier4","_soldier3","_soldier2","_soldier", "_randomLoc", "_leader", "_pilot", "_pilot2","_tanker", "_tanker2", "_result","_missionMarkerName","_missionType","_startTime","_randomPos","_randomIndex","_vehicle2", "_vehicle3", "_vehicle4", "_vehicle","_hint","_currTime","_playerPresent","_unitsAlive"];

//Mission Initialization.
_result = 0;
_missionMarkerName = "Invasion!";
_missionType = "Invasion";
#ifdef __A2NET__
_startTime = floor(netTime);
#else
_startTime = floor(time);
#endif

diag_log format["WASTELAND SERVER - World Mission Started: %1",_missionType];

//Get Mission Location

_randomLoc = cityList call BIS_fnc_selectRandom;

diag_log format["Invasion at: %1", _randomLoc];

_randomPos = getMarkerPos (_randomLoc select 0);
_randomPos = [_randomPos,1,100,0,0,0,0] call BIS_fnc_findSafePos;

diag_log format["WASTELAND SERVER - World Mission Waiting to run: %1",_missionType];
[worldMissionDelayTime] call createWaitCondition;
diag_log format["WASTELAND SERVER - World Mission Resumed: %1",_missionType];

[_missionMarkerName,_randomPos,_missionType] call createClientMarker;

_hint = parseText format ["<t align='center' color='#FF1717' shadow='2' size='1.75'>UN INVASION!!!!!!</t><br/><t align='center' color='%4'>------------------------------</t><br/><t align='center' color='%5'>A UN Invasion Force has been spotted!!!  Avoid the area unless well prepared!</t>", _missionType, _picture, _vehicleName, worldMissionColor, subTextColor];
[nil,nil,rHINT,_hint] call RE;

// soften target

sleep 1;

for "_bomb" from 1 to 10 do {
    "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) + random 100, ( _randomPos select 1) + random 100, 0];
    "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) - random 100, ( _randomPos select 1) - random 100, 0];
    "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) - random 100, ( _randomPos select 1) + random 100, 0];
    "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) + random 100, ( _randomPos select 1) - random 100, 0];
        sleep 1;   
};

sleep 10;
// end soften target

//Vehicle Class, Posistion, Fuel, Ammo, Damage, State
_vehicle = ["MH60S",_randomPos ,1,1,0,"FLY"] call createMissionVehicle;
_vehicle setPos [_randomPos select 0, _randomPos select 1, 66];
_vehicle flyInHeight 66;
_vehicle setspeedmode "normal";
_vehicle action["autoHover", _vehicle];



InvGroup = creategroup civilian;

_pilot = InvGroup createunit ["UN_CDF_Soldier_Pilot_EP1",_randomPos,[],0,"FORM"];
_pilot2 = InvGroup createunit ["UN_CDF_Soldier_Pilot_EP1",_randomPos,[],0,"FORM"];

_pilot moveindriver _vehicle;
_pilot assignAsDriver _vehicle;
_pilot2 moveingunner _vehicle;
_pilot2 assignAsgunner _vehicle;

_vehicle2 = ["M113_UN_EP1",_randomPos ,1,1,0,"NONE"] call createMissionVehicle;

_tanker = InvGroup createunit ["UN_CDF_Soldier_SL_EP1",[_randomPos select 0, (_randomPos select 1) +3, 0],[],0,"FORM"];
_tanker2 = InvGroup createunit ["UN_CDF_Soldier_Officer_EP1",[_randomPos select 0, (_randomPos select 1) +5, 0],[],0,"FORM"];

_tanker moveindriver _vehicle2;
_tanker assignAsDriver _vehicle2;
_tanker2 moveingunner _vehicle2;
_tanker2 assignAsgunner _vehicle2;

_soldier = InvGroup createunit ["UN_CDF_Soldier_AT_EP1",[_randomPos select 0, (_randomPos select 1) +5, 0],[],50,"FORM"];
_soldier2 = InvGroup createunit ["UN_CDF_Soldier_AT_EP1",[(_randomPos select 0) +5, _randomPos select 1, 0],[],50,"FORM"];
_soldier3 = InvGroup createunit ["UN_CDF_Soldier_MG_EP1",[(_randomPos select 0) -5, _randomPos select 1, 0],[],50,"FORM"];
_soldier4 = InvGroup createunit ["UN_CDF_Soldier_MG_EP1",[_randomPos select 0, (_randomPos select 1) -5, 0],[],50,"FORM"];

_soldier5 = InvGroup createunit ["UN_CDF_Soldier_Guard_EP1",[(_randomPos select 0)+10, _randomPos select 1, 0],[],50,"FORM"];
_soldier6 = InvGroup createunit ["UN_CDF_Soldier_Guard_EP1",[_randomPos select 0, (_randomPos select 1) +10, 0],[],50,"FORM"];


_soldier7 = InvGroup createunit ["UN_CDF_Soldier_SL_EP1",[(_randomPos select 0) -10, _randomPos select 1, 0],[],50,"FORM"];

_vehicle4 = ["HMMWV_Armored",_randomPos ,1,1,0,"NONE"] call createMissionVehicle;

_vehicle4 addWeaponCargoGlobal ["Binocular_Vector", 1];

_soldier8 = InvGroup createunit ["UN_CDF_Soldier_Light_EP1",[_randomPos select 0, (_randomPos select 1) -10, 0],[],50,"FORM"];
_soldier9 = InvGroup createunit ["UN_CDF_Soldier_Light_EP1",[(_randomPos select 0) +5, (_randomPos select 1) -5, 0],[],50,"FORM"];

_soldier8 moveindriver _vehicle4;
_soldier9 assignAsDriver _vehicle4;
_soldier8 moveingunner _vehicle4;
_soldier9 assignAsgunner _vehicle4;


_soldier10 = InvGroup createunit ["UN_CDF_Soldier_Officer_EP1",[(_randomPos select 0) -5, (_randomPos select 1) +5, 0],[],50,"FORM"];



[_pilot, _pilot2, _tanker, _tanker2, _soldier, _soldier2, _soldier3, _soldier4, _soldier5, _soldier6, _soldier7, _soldier8, _soldier9, _soldier10] join InvGroup;
_tanker = leader InvGroup;

_tanker setSkill ["Commanding", .9 ];
_tanker setSkill ["spotDistance",1];
_tanker setSkill ["spotTime",1];
_tanker setSkill ["aimingSpeed",1];

InvGroup setBehaviour "STEALTH";
InvGroup setCombatMode "RED";


diag_log format["WASTELAND SERVER - World Mission Waiting to be Finished: %1",_missionType];
#ifdef __A2NET__
_startTime = floor(netTime);
#else
_startTime = floor(time);
#endif
waitUntil
{
    sleep 1;
    _playerPresent = false;
    #ifdef __A2NET__
    _currTime = floor(netTime);
    #else
    _currTime = floor(time);
    #endif
    if(_currTime - _startTime >= worldMissionTimeout) then {_result = 1;};
    _unitsAlive = ({alive _x} count units InvGroup);
    (_result == 1) OR (_unitsAlive < 1)
};

_vehicle setVehicleLock "UNLOCKED";
_vehicle setVariable ["R3F_LOG_disabled", false, true];
_vehicle setVariable["original",1,true];
_vehicle2 setVehicleLock "UNLOCKED";
_vehicle2 setVariable ["R3F_LOG_disabled", false, true];
_vehicle2 setVariable["original",1,true];

if(_result == 1) then
{
//Mission Failed.
    deleteVehicle _vehicle;
    deleteVehicle _vehicle2;
    deleteVehicle _vehicle4;
   
    {deleteVehicle _x;}forEach units InvGroup;
    deleteGroup InvGroup;
    _hint = parseText format ["<t align='center' color='%4' shadow='2' size='1.75'>Invasion Not Stopped!</t><br/><t align='center' color='%4'>------------------------------</t><br/><t align='center' color='%5'>Objective failed, better luck next time</t>", _missionType, _picture, _vehicleName, failMissionColor, subTextColor];
    [nil,nil,rHINT,_hint] call RE;
    diag_log format["WASTELAND SERVER - World Mission Failed: %1",_missionType];
   
   
    for "_bomb" from 1 to 10 do {
        "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) + random 100, ( _randomPos select 1) + random 100, 0];
        "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) - random 100, ( _randomPos select 1) - random 100, 0];
        "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) - random 100, ( _randomPos select 1) + random 100, 0];
        "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) + random 100, ( _randomPos select 1) - random 100, 0];
        sleep 1;   
};
   
} else {
    //Mission Complete.
   
    deleteGroup InvGroup;
   
    ["ParachuteMediumWest",[_randomPos select 0, _randomPos select 1, 500] ,"RUVehicleBox"] call createCargoItem;
    sleep 5;
    ["ParachuteMediumWest",[_randomPos select 0, _randomPos select 1, 500] ,"USVehicleBox"] call createCargoItem;
    sleep 10;

    ["ParachuteMediumWest",[_randomPos select 0, _randomPos select 1, 500] ,"M113Ambul_UN_EP1"] call createCargoItem;


   
           
    _hint = parseText format ["<t align='center' color='%4' shadow='2' size='1.75'>Invasion Defeated!</t><br/><t align='center' color='%4'>------------------------------</t><br/><t align='center' color='%5'>The invasion has been repelled.</t>", _missionType, _picture, _vehicleName, successMissionColor, subTextColor];
    [nil,nil,rHINT,_hint] call RE;
    diag_log format["WASTELAND SERVER - World Mission Success: %1",_missionType];
};

//Reset Mission Spot.

[_missionMarkerName] call deleteClientMarker;
  • Offline LouD
  • Silent but deadly ;)
  • Moderator
  • Veteran
  • ******
  • Posts: 1415

Re: What do I need to change to make this work?

« Reply #6 posted: Sep 11, 2015, 10:03 AM »
Ducky, not be an ass or anything and we're always wanting to help here. But have you even tried yourself first?

Most of us have learned by trying ourselves and using google and learned from our own mistakes. We have tried and tried countless times before we came seeking for help.
It seems like all you do on the forum is ask for help and don't try yourself first. If you look at all the posts you made all you do is ask for help, want people to do your work for you and don't help out yourself.

Try starting with some coding basics and tutorials.
https://forums.bistudio.com/topic/145056-arma-3-scripting-tutorial-for-noobs/
http://killzonekid.com/category/arma-scripting/

If at first you don't succeed, then try again.

Re: What do I need to change to make this work?

« Reply #7 posted: Sep 11, 2015, 10:08 AM »
Well. I do try myself. I know there are things that don't belong in the script like A2Net and the class names have to be changed. But if you notice, most of the time when I ask for help it is so that I can do it myself in the future. If I know what to look for in a script, I can fix it. I gave up doing actual programming a few years ago.

Re: What do I need to change to make this work?

« Reply #8 posted: Sep 11, 2015, 10:13 AM »
If someone highlights a section of code and tells me that it should look like something else, then I can figure things out when I see similar code. But, when I see completely undocumented code, I'm lost. I always document my code. I got out of programming because of coming across and debugging undocumented code.
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2582

Re: What do I need to change to make this work?

« Reply #9 posted: Sep 11, 2015, 01:25 PM »
404 Wasteland had zero documentation whatsoever. See what I turned it into?

Re: What do I need to change to make this work?

« Reply #10 posted: Sep 11, 2015, 02:57 PM »
I got out of programming because of coming across and debugging undocumented code.

Seems to me that you're still in it somewhat.

To pick up on LouD's point, maybe take the time to post some of the ideas you've had or explain the way you might already have approached the problem.  I ask for lots of help on these forums too but I always try to give some context around what I've tried and to pinpoint what it is I still don't understand.

Re: What do I need to change to make this work?

« Reply #11 posted: Sep 11, 2015, 05:35 PM »
Seems to me that you're still in it somewhat.

To pick up on LouD's point, maybe take the time to post some of the ideas you've had or explain the way you might already have approached the problem.  I ask for lots of help on these forums too but I always try to give some context around what I've tried and to pinpoint what it is I still don't understand.

Well, Speedweasel, I am still in it somewhat because I am a network/system admin during the week and I write a lot of Linux BASH scripts. But I got out of VB and Python programming awhile ago.
I document all my Linux scripts. In school for Network/System Administration, if we did not document each line of code we failed. Same went with CISCO school.

Ill give you an example of a Linux BASH script that would get an A+.

Code: [Select]
#!/bin/bash
##Defined the type of script
## This command requests admin access and updates the apt-get repos
sudo apt-get update
## This command installs any system level program updates and accepts the updates automatically
sudo apt-get upgrade -y
## This command installs distribution level system updates including Kernel patches and versions.
sudo apt-get dist-upgrade -y
## This command checks for obsolete programs and packages and removes them
sudo apt-get autoremove -y
## This command displays the current CPU info and outputs it into a file
cat /proc/cpuinfo > systeminfo.txt
## This command displays the current memory info and appends it to a file
cat /proc/meminfo >> systeminfo.txt
## This command returns who the user is
whoami >> systeminfo.txt
## This command displays the current working directory
pwd >> systeminfo.txt

And AgentRev, yes you have made it legible quite a bit. And I thank you for that. I just have a hard time determining what to replace things with. If they need replacing at all. Like for example on missions that have a patrol route. in A3Wasteland there is an array of coords that I don't know how to make but so far no one has told me how to make them. Is there some script I run in the editor that outputs a set of coords to a file?

In Networking school, it was less about writing your own program. It was more about editing existing scripts and files to make them do what you want. You would open the file and swap out code sections or change config commands.

Can I use the MCC Mod to make  missions? I have searched the forums and google for tutorials on how to make missions (for Wasteland) but have not found anything on that.

Alright, here is what I have done with this mission to try and make it work but have not run it yet because there are some parts I removed that I think are missing something.

I will highlight the parts I removed but think are there for a reason but not sure what to replace them with if anything. As well as any comments I have made to indicate what I think needs to be changed.
[spoiler]
//    @file Version: 1.0
//    @file Name: mission_FarmerRiot.sqf
//    @file Author: [404] Deadbeat, [404] Costlyy
//    @file Created: 08/12/2012 15:19
//    @file Args:
#include "setup.sqf"
#include "worldMissionDefines.sqf";

if(!isServer) exitwith {};

private [ "_obj", "_obj2", "_objPos", "_soldier10","_soldier9","_soldier8","_soldier7","_soldier6","_soldier5","_soldier4","_soldier3","_soldier2","_soldier", "_randomLoc", "_leader", "_pilot", "_pilot2","_tanker", "_tanker2", "_result","_missionMarkerName","_missionType","_startTime","_randomPos","_randomIndex","_vehicle2", "_vehicle3", "_vehicle4", "_vehicle","_hint","_currTime","_playerPresent","_unitsAlive"];

//Mission Initialization.
_result = 0;
_missionMarkerName = "Invasion!";
_missionType = "Invasion";
#ifdef __A2NET__
_startTime = floor(netTime);
#else
_startTime = floor(time);
#endif


diag_log format["WASTELAND SERVER - World Mission Started: %1",_missionType];

//Get Mission Location

_randomLoc = cityList call BIS_fnc_selectRandom; // change cityList to /MapConfig/towns in the WorldMissionsDefines script.

diag_log format["Invasion at: %1", _randomLoc];

_randomPos = getMarkerPos (_randomLoc select 0);
_randomPos = [_randomPos,1,100,0,0,0,0] call BIS_fnc_findSafePos;

diag_log format["WASTELAND SERVER - World Mission Waiting to run: %1",_missionType];
[worldMissionDelayTime] call createWaitCondition;
diag_log format["WASTELAND SERVER - World Mission Resumed: %1",_missionType];

[_missionMarkerName,_randomPos,_missionType] call createClientMarker;

_hint = parseText format ["<t align='center' color='#FF1717' shadow='2' size='1.75'>UN INVASION!!!!!!</t><br/><t align='center' color='%4'>------------------------------</t><br/><t align='center' color='%5'>A UN Invasion Force has been spotted!!!  Avoid the area unless well prepared!</t>", _missionType, _picture, _vehicleName, worldMissionColor, subTextColor];
[nil,nil,rHINT,_hint] call RE;

// soften target

sleep 1;
// change Bomb type to whatever the Arma 3 variant is
for "_bomb" from 1 to 10 do {
    "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) + random 100, ( _randomPos select 1) + random 100, 0];
    "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) - random 100, ( _randomPos select 1) - random 100, 0];
    "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) - random 100, ( _randomPos select 1) + random 100, 0];
    "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) + random 100, ( _randomPos select 1) - random 100, 0];
        sleep 1;   
};

sleep 10;
// end soften target
// Change unit classes appropriately throughout the rest of the mission script
//Vehicle Class, Posistion, Fuel, Ammo, Damage, State
_vehicle = ["MH60S",_randomPos ,1,1,0,"FLY"] call createMissionVehicle;
_vehicle setPos [_randomPos select 0, _randomPos select 1, 66];
_vehicle flyInHeight 66;
_vehicle setspeedmode "normal";
_vehicle action["autoHover", _vehicle];



InvGroup = creategroup civilian;

_pilot = InvGroup createunit ["UN_CDF_Soldier_Pilot_EP1",_randomPos,[],0,"FORM"];
_pilot2 = InvGroup createunit ["UN_CDF_Soldier_Pilot_EP1",_randomPos,[],0,"FORM"];

_pilot moveindriver _vehicle;
_pilot assignAsDriver _vehicle;
_pilot2 moveingunner _vehicle;
_pilot2 assignAsgunner _vehicle;

_vehicle2 = ["M113_UN_EP1",_randomPos ,1,1,0,"NONE"] call createMissionVehicle;

_tanker = InvGroup createunit ["UN_CDF_Soldier_SL_EP1",[_randomPos select 0, (_randomPos select 1) +3, 0],[],0,"FORM"];
_tanker2 = InvGroup createunit ["UN_CDF_Soldier_Officer_EP1",[_randomPos select 0, (_randomPos select 1) +5, 0],[],0,"FORM"];

_tanker moveindriver _vehicle2;
_tanker assignAsDriver _vehicle2;
_tanker2 moveingunner _vehicle2;
_tanker2 assignAsgunner _vehicle2;

_soldier = InvGroup createunit ["UN_CDF_Soldier_AT_EP1",[_randomPos select 0, (_randomPos select 1) +5, 0],[],50,"FORM"];
_soldier2 = InvGroup createunit ["UN_CDF_Soldier_AT_EP1",[(_randomPos select 0) +5, _randomPos select 1, 0],[],50,"FORM"];
_soldier3 = InvGroup createunit ["UN_CDF_Soldier_MG_EP1",[(_randomPos select 0) -5, _randomPos select 1, 0],[],50,"FORM"];
_soldier4 = InvGroup createunit ["UN_CDF_Soldier_MG_EP1",[_randomPos select 0, (_randomPos select 1) -5, 0],[],50,"FORM"];

_soldier5 = InvGroup createunit ["UN_CDF_Soldier_Guard_EP1",[(_randomPos select 0)+10, _randomPos select 1, 0],[],50,"FORM"];
_soldier6 = InvGroup createunit ["UN_CDF_Soldier_Guard_EP1",[_randomPos select 0, (_randomPos select 1) +10, 0],[],50,"FORM"];


_soldier7 = InvGroup createunit ["UN_CDF_Soldier_SL_EP1",[(_randomPos select 0) -10, _randomPos select 1, 0],[],50,"FORM"];

_vehicle4 = ["HMMWV_Armored",_randomPos ,1,1,0,"NONE"] call createMissionVehicle;

_vehicle4 addWeaponCargoGlobal ["Binocular_Vector", 1];

_soldier8 = InvGroup createunit ["UN_CDF_Soldier_Light_EP1",[_randomPos select 0, (_randomPos select 1) -10, 0],[],50,"FORM"];
_soldier9 = InvGroup createunit ["UN_CDF_Soldier_Light_EP1",[(_randomPos select 0) +5, (_randomPos select 1) -5, 0],[],50,"FORM"];

_soldier8 moveindriver _vehicle4;
_soldier9 assignAsDriver _vehicle4;
_soldier8 moveingunner _vehicle4;
_soldier9 assignAsgunner _vehicle4;


_soldier10 = InvGroup createunit ["UN_CDF_Soldier_Officer_EP1",[(_randomPos select 0) -5, (_randomPos select 1) +5, 0],[],50,"FORM"];



[_pilot, _pilot2, _tanker, _tanker2, _soldier, _soldier2, _soldier3, _soldier4, _soldier5, _soldier6, _soldier7, _soldier8, _soldier9, _soldier10] join InvGroup;
_tanker = leader InvGroup;

_tanker setSkill ["Commanding", .9 ];
_tanker setSkill ["spotDistance",1];
_tanker setSkill ["spotTime",1];
_tanker setSkill ["aimingSpeed",1];

InvGroup setBehaviour "STEALTH";
InvGroup setCombatMode "RED";


diag_log format["WASTELAND SERVER - World Mission Waiting to be Finished: %1",_missionType];
// No clue here. Pretty sure it gets removed but what to replace this with since it seems to server an important purpose.
#ifdef __A2NET__
_startTime = floor(netTime);
#else
_startTime = floor(time);
#endif
waitUntil
{
    sleep 1;
    _playerPresent = false;
    #ifdef __A2NET__
    _currTime = floor(netTime);
    #else
    _currTime = floor(time);
    #endif
    if(_currTime - _startTime >= worldMissionTimeout) then {_result = 1;};
    _unitsAlive = ({alive _x} count units InvGroup);
    (_result == 1) OR (_unitsAlive < 1)
};


_vehicle setVehicleLock "UNLOCKED";
_vehicle setVariable ["R3F_LOG_disabled", false, true];
_vehicle setVariable["original",1,true];
_vehicle2 setVehicleLock "UNLOCKED";
_vehicle2 setVariable ["R3F_LOG_disabled", false, true];
_vehicle2 setVariable["original",1,true];

if(_result == 1) then
{
//Mission Failed.
    deleteVehicle _vehicle;
    deleteVehicle _vehicle2;
    deleteVehicle _vehicle4;
   
    {deleteVehicle _x;}forEach units InvGroup;
    deleteGroup InvGroup;
    _hint = parseText format ["<t align='center' color='%4' shadow='2' size='1.75'>Invasion Not Stopped!</t><br/><t align='center' color='%4'>------------------------------</t><br/><t align='center' color='%5'>Objective failed, better luck next time</t>", _missionType, _picture, _vehicleName, failMissionColor, subTextColor];
    [nil,nil,rHINT,_hint] call RE;
    diag_log format["WASTELAND SERVER - World Mission Failed: %1",_missionType];
   
   
    for "_bomb" from 1 to 10 do {
        "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) + random 100, ( _randomPos select 1) + random 100, 0];
        "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) - random 100, ( _randomPos select 1) - random 100, 0];
        "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) - random 100, ( _randomPos select 1) + random 100, 0];
        "Bo_GBU12_LGB" createVehicle[(_randomPos select 0 ) + random 100, ( _randomPos select 1) - random 100, 0];
        sleep 1;   
};
   
} else {
    //Mission Complete.
   
    deleteGroup InvGroup;
   
    ["ParachuteMediumWest",[_randomPos select 0, _randomPos select 1, 500] ,"RUVehicleBox"] call createCargoItem;
    sleep 5;
    ["ParachuteMediumWest",[_randomPos select 0, _randomPos select 1, 500] ,"USVehicleBox"] call createCargoItem;
    sleep 10;

    ["ParachuteMediumWest",[_randomPos select 0, _randomPos select 1, 500] ,"M113Ambul_UN_EP1"] call createCargoItem;


   
           
    _hint = parseText format ["<t align='center' color='%4' shadow='2' size='1.75'>Invasion Defeated!</t><br/><t align='center' color='%4'>------------------------------</t><br/><t align='center' color='%5'>The invasion has been repelled.</t>", _missionType, _picture, _vehicleName, successMissionColor, subTextColor];
    [nil,nil,rHINT,_hint] call RE;
    diag_log format["WASTELAND SERVER - World Mission Success: %1",_missionType];
};

//Reset Mission Spot.

[_missionMarkerName] call deleteClientMarker;[/spoiler]
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2582

Re: What do I need to change to make this work?

« Reply #12 posted: Sep 11, 2015, 06:41 PM »
The problem with that mission is that it's quite badly-coded even in it's original state. It uses an obsolete form of createVehicle, all those randomPos arrays are square-shaped rather than circle, most timing ands marker-related stuff has to be removed, public vars need to be made private, all the vehicles need to be placed in a _vehicles array so the mission processor can keep track of them, the formatting is horrendous, etc.

Sure I could have done all of that by myself in the time it took me to write this post, but I won't, since no good deed goes unpunished.

Even if I explained you how to write missions in the new format, you wouldn't succeed, because you don't seem to fully grasp which part does what in your current script. If you want to try, I suggest that you first compare old vs new missions, you can find old ones in the 404 WL TPG repo on my GitHub, which were ported to the new format in A3W.

In regards to the coding guidelines you learned in school, commenting each line of code is generally frowned upon because real programmers don't need to be explained every bit of code unless they are learning the basics. When I implement third-party stuff in A3W, I actually remove about 2/3rd of comments because they are trivial and act as mere screen clutter. What needs to be commented are abstract code blocks, e.g. "Convert all data entries to XML structure", or "Extract data from HTTP response", and complex conditions that would be hard to understand.

I rarely ever write comments for A3W, because I'm my own boss and I decided I would spend time writing more code instead of comments. I only write comments if I am under obligation to do so, e.g. on the job, or if I know I will have issues understanding my own code in the future.

Re: What do I need to change to make this work?

« Reply #13 posted: Sep 11, 2015, 06:50 PM »
The problem with that mission is that it's quite badly-coded even in it's original state. It uses an obsolete form of createVehicle, all those randomPos arrays are square-shaped rather than circle, most timing ands marker-related stuff has to be removed, public vars need to be made private, all the vehicles need to be placed in a _vehicles array so the mission processor can keep track of them, the formatting is horrendous, etc.

Sure I could have done all of that by myself in the time it took me to write this post, but I won't, since no good deed goes unpunished.

Even if I explained you how to write missions in the new format, you wouldn't succeed, because you don't seem to fully grasp which part does what in your current script. If you want to try, I suggest that you first compare old vs new missions, you can find old ones in the 404 WL TPG repo on my GitHub, which were ported to the new format in A3W.

In regards to the coding guidelines you learned in school, commenting each line of code is generally frowned upon because real programmers don't need to be explained every bit of code unless they are learning the basics. When I implement third-party stuff in A3W, I actually remove about 2/3rd of comments because they are trivial and act as mere screen clutter. What needs to be commented are abstract code blocks, e.g. "Convert all data entries to XML structure", or "Extract data from HTTP response", and complex conditions that would be hard to understand.

I rarely ever write comments for A3W, because I'm my own boss and I decided I would spend time writing more code instead of comments. I only write comments if I am under obligation to do so, e.g. on the job, or if I know I will have issues understanding my own code in the future.

Thank you for that explanation.
Well then, can you point be to a guide on how to write my own missions for Wasteland? Can I use MCC? Or how do I create the arrays of coordinates used in the convoy missions? Those arrays are the only thing holding me up from releasing the Lingor ACE3 A3Wasteland version. I have placed all the markers and stores and units etc and edited all my files and such except for these mission sections because they call on these arrays of coordinates. If I knew how to make the new arrays ( I assume you make the mission in the editor and export to clipboard?) but how to do that.

Im not looking for someone to hold my hand. And when I create my own missions for Wasteland I will post them here for all to use if they choose to. Im all about OpenSource and giving code back to the community. In fact, I have posted the Lingor mission to Github and have linked it in one of my Lingor threads.
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2582

Re: What do I need to change to make this work?

« Reply #14 posted: Sep 11, 2015, 07:07 PM »
MCC will not help you build A3W missions, its purpose is to make "unmanaged" scenarios from scratch, e.g. sorta like Zeus. It's not integrated with the A3W mission controller.

I cannot provide you a guide because there is none yet.

To make new convoy paths, I would suggest going in the editor and use onMapSingleClick and createMarker in conjunction with a pvar array of marker positions, then you can copyToClipboard str pvar