Jump to content
Sign in to follow this  
ToxicMuffin

quick question about a script

Recommended Posts

Hello everyone, I'm currently trying to port over a life mission (RPP:R, credit to unforgiven for writing it) that we were using on Arma 2 to Arma 3 but running into a problem, i understand that arma 3 has gotten rid of setVehicleInit but its causing problems with a couple of the scripts and i'm not exactly sure how to rewrite it or even if its possible so i was hoping someone here could help :) (If you need anything else just let me know)

private ["_class", "_position", "_registration", "_vcl", "_text", "_name", "_trunk", "_siren", "_hasSiren"];    _class = _this select 0;
   _position = _this select 1;
       _registration = [] call RPP_fnc_generateRegistration;
       if (count _this >= 4) then
       {
           _registration = (_this select 3);
       };
       _vcl = objNull;
       _name = _class call RPP_fnc_itemGetName;
       _trunk = [];
       _text = format["<t size='0.6' color='#4876FF'>%2</t><br/><t size='0.35' color='#4876FF'>%1</t><br/><t size='0.45'>(Press F to lock/unlock)</t><br/><t size='0.45'>(Press T for Menu)<br/></t><t size='0.45'>(Press B to Pullout)<br/></t><t size='0.45'>(Press U to Unflip)</t>", _registration, _name];
       _damage = 0;
       _fuel = 1;
       _siren = _class call RPP_fnc_itemGetSiren;
       _hasSiren = false;

       if (count _siren >= 2) then
       {
           _hasSiren = _siren select 0;
       }
       else
       {
           _hasSiren = false;
       };


       if (count _this >= 3) then
       {
           _trunk = (_this select 2);
       };

       if (count _this >= 5) then
       {
           _fuel = (_this select 4) select 0;
           _damage = (_this select 4) select 1;
       };

   call compile format
       ['
   _vcl = "%1" createVehicle %2;
  [color=#ff0000] [b]_vcl setVehicleInit "this setVehicleVarName ""%3"";[/b][/color]

       [this, ""%4""] spawn
       {
           if (isNil ""RPP_fnc_create3DText"") then
           {
               _script = [] execVM ""core\text3D.sqf"";
               waitUntil {scriptDone _script};
           };


           [[] call RPP_fnc_generateID, (_this select 1), (_this select 0), 0.8, 5, true] spawn RPP_fnc_create3DText;
       };
       _vcl = this;
       _vcl addEventHandler [""GetIn"", {_this spawn RPP_fnc_event_onVehicleEnter;}];
       _vcl addEventHandler [""GetOut"", {_this spawn RPP_fnc_event_onVehicleExit;}];
       _vcl addEventHandler [""Engine"", {_this spawn RPP_fnc_event_onVehicleEngine;}];
       _vcl setVariable [""hasActions"", true, false];

   ";
   player reveal _vcl;


   _vcl setFuelCargo 0;
       _vcl call RPP_fnc_addVehicleToServer;
       _vcl call RPP_fnc_addToKeychain;

       _vcl setVariable ["locked", false, true];
       _vcl setVariable ["trunk",  %5, true];
       _vcl setVariable ["maxSize", "%1" call RPP_fnc_itemGetTrunkSize, true];
       _vcl setVariable ["isPublic", true, true];
       _vcl setVariable ["RPP_siren_mounted", %8, true];
       _vcl setVariable ["RPP_siren_state", 0, true];


       [{ ClearWeaponCargo (_this select 0); ClearMagazineCargo (_this select 0);}, [_vcl]] call RPP_fnet_execPublic;


       _vcl setFuel %7;
       _vcl setDamage %6;

   [color=#ff0000][b]processInitCommands; [/b][/color]
   ', _class, _position, _registration, _text, _trunk, _damage, _fuel, _hasSiren];

thanks in advance!

~Toxic

Edited by ToxicMuffin

Share this post


Link to post
Share on other sites
Hello everyone, I'm currently trying to port over a life mission (RPP:R, credit to unforgiven for writing it) that we were using on Arma 2 to Arma 3 but running into a problem, i understand that arma 3 has gotten rid of setVehicleInit but its causing problems with a couple of the scripts and i'm not exactly sure how to rewrite it or even if its possible so i was hoping someone here could help :) (If you need anything else just let me know)

private ["_class", "_position", "_registration", "_vcl", "_text", "_name", "_trunk", "_siren", "_hasSiren"];    _class = _this select 0;
   _position = _this select 1;
       _registration = [] call RPP_fnc_generateRegistration;
       if (count _this >= 4) then
       {
           _registration = (_this select 3);
       };
       _vcl = objNull;
       _name = _class call RPP_fnc_itemGetName;
       _trunk = [];
       _text = format["<t size='0.6' color='#4876FF'>%2</t><br/><t size='0.35' color='#4876FF'>%1</t><br/><t size='0.45'>(Press F to lock/unlock)</t><br/><t size='0.45'>(Press T for Menu)<br/></t><t size='0.45'>(Press B to Pullout)<br/></t><t size='0.45'>(Press U to Unflip)</t>", _registration, _name];
       _damage = 0;
       _fuel = 1;
       _siren = _class call RPP_fnc_itemGetSiren;
       _hasSiren = false;

       if (count _siren >= 2) then
       {
           _hasSiren = _siren select 0;
       }
       else
       {
           _hasSiren = false;
       };


       if (count _this >= 3) then
       {
           _trunk = (_this select 2);
       };

       if (count _this >= 5) then
       {
           _fuel = (_this select 4) select 0;
           _damage = (_this select 4) select 1;
       };

   call compile format
       ['
   _vcl = "%1" createVehicle %2;
  [color=#ff0000] [b]_vcl setVehicleInit "this setVehicleVarName ""%3"";[/b][/color]

       [this, ""%4""] spawn
       {
           if (isNil ""RPP_fnc_create3DText"") then
           {
               _script = [] execVM ""core\text3D.sqf"";
               waitUntil {scriptDone _script};
           };


           [[] call RPP_fnc_generateID, (_this select 1), (_this select 0), 0.8, 5, true] spawn RPP_fnc_create3DText;
       };
       _vcl = this;
       _vcl addEventHandler [""GetIn"", {_this spawn RPP_fnc_event_onVehicleEnter;}];
       _vcl addEventHandler [""GetOut"", {_this spawn RPP_fnc_event_onVehicleExit;}];
       _vcl addEventHandler [""Engine"", {_this spawn RPP_fnc_event_onVehicleEngine;}];
       _vcl setVariable [""hasActions"", true, false];

   ";
   player reveal _vcl;


   _vcl setFuelCargo 0;
       _vcl call RPP_fnc_addVehicleToServer;
       _vcl call RPP_fnc_addToKeychain;

       _vcl setVariable ["locked", false, true];
       _vcl setVariable ["trunk",  %5, true];
       _vcl setVariable ["maxSize", "%1" call RPP_fnc_itemGetTrunkSize, true];
       _vcl setVariable ["isPublic", true, true];
       _vcl setVariable ["RPP_siren_mounted", %8, true];
       _vcl setVariable ["RPP_siren_state", 0, true];


       [{ ClearWeaponCargo (_this select 0); ClearMagazineCargo (_this select 0);}, [_vcl]] call RPP_fnet_execPublic;


       _vcl setFuel %7;
       _vcl setDamage %6;

   [color=#ff0000][b]processInitCommands; [/b][/color]
   ', _class, _position, _registration, _text, _trunk, _damage, _fuel, _hasSiren];

thanks in advance!

~Toxic

"_vcl setVehicleInit "this setVehicleVarName ""&3"";" You can just use setVehicleVarName without the setVehicleInit.

Also get rid of the processInitcommand code. If you have some stuff you want to put in the vehicleInit. Just make a file called

myFunctions.sqf. Here is one example of by passing the setVehicleinit command. Just make functions that can be used over and over again by

different objects. Below is a example using the disableAI "MOVE" command without using the setVehicleInit.

/*
* myFunctions.sqf
*/

fnc_notMove = 
{
    private["_unit"];
    _unit = _this select 0;
    _unit disableAI "MOVE";
    /*
     * [[_this], "fnc_notMove"] spawn BIS_fnc_MP;
    */
};

I'm not 100% sure what this code is doing can you explain further what this line is doing?

_vcl setVehicleInit "this setVehicleVarName ""%3"";

Edited by Johnson11B2P
for not

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  

×