Jump to content
Sign in to follow this  
scottb613

SCO SP Transport Enhancement (Simplex Support Modules)

Recommended Posts

Hi Folks,

 

I use the fantastic Simplex Support Services in almost every mission - nice easy to use support modules. 

 

That said - the Transport Module left me needing a bit more. I often found myself charging headlong into places that I knew were bad but had no way to stop quickly to disembark. I needed a simple script to make the speed of the vehicle I'm traveling in a bit more manageable and readily accessible.

 

I created a script to enhance your Simplex controlled Transport Module - or - any other vehicle you are riding in - to add a bit more control.

 

  • Speed of vehicle is controlled by addAction menu when in the respective vehicle.
  • It has options for (Stop, Limited Speed, Cruise Speed, Full Speed, Resume).
  • Resume is used after a Stop to continue on to the previously picked Waypoint without having to choose a new one.

 

This gives you a chance to rapidly stop and disembark troops if the path ahead looks sketchy - instead of fumbling with the Ace Menu to pick a new Waypoint.  

 

 

 

Add-Action.jpg

 

 

 

This seems to work quite well for me.

 

Regards,
Scott

Share this post


Link to post
Share on other sites

Hi Folks,

 

Updated this and added more features:

 

Requires creating the two following files and one init code entry in the respective Simplex Transport Module - as posted below.

 

  • Simplex Transport Module - Custom Init Code entry ===>>> [_this] execVM "initTransA.sqf";
  • initTransA.sqf goes in mission root folder.
  • SCOsetSpeed.sqf goes in a "Scripts" directory inside the mission root folder.

 

If the Simplex Transport Module spawns a replacement vehicle - these same settings will be applied to the new vehicle.

 

 

 

initTransA.sqf

//==========================//
// Simplex Transport Speed  //
//==========================//

// Author: scottb613
// File: initTransA.sqf

// Requires: Simplex Support Modules addon.
// Requires: "initTransA.sqf" in root of mission folder.
// Requires: "Scripts\SCOsetSpeed.sqf" in root of mission folder.
// Requires: Simplex Transport Module - Custom Init Code entry ===>>> [_this] execVM "initTrans.sqf";

// Note: Only tested in single player.

// Given: For use with the Transport Module of Simplex Support Services.
// Given: Provides speed control and the ability to stop on demand.
// Given: Creates AddAction menu items to control speed of respective vehicle.
// Given: After a "ts---Stop" - when player leaves vehicle - vehicle will resume last ordered waypoint automatically.
// Given: After a "ts---Stop" - when player remains in vehicle - is "ts---Resume" must be ordered to resume travel.
// Given: Camera switches to "External" when player enters a vehicle.

// Given: Sets initial max speed to 45.

//=====================================================================================================================//
//=====================================================================================================================//

_vehicle = _this select 0;

// Disable Lambs Danger
_vehicle setVariable ["dangerAIEnabled", false];

// Add Action to menu to control speed of vehicle
_vehicle addAction ["<t color='#00FFFF'>   ts---Stop</t>", "Scripts\SCOsetSpeed.sqf", 0, 1, true, true, "", "", 3];
_vehicle addAction ["<t color='#00FFFF'>   ts---Limited</t>", "Scripts\SCOsetSpeed.sqf", 1, 1, true, true, "", "", 3];
_vehicle addAction ["<t color='#00FFFF'>   ts---Cruise</t>", "Scripts\SCOsetSpeed.sqf", 2, 1, true, true, "", "", 3];
_vehicle addAction ["<t color='#00FFFF'>   ts---Full</t>", "Scripts\SCOsetSpeed.sqf", 3, 1, true, true, "", "", 3];
_vehicle addAction ["<t color='#00FFFF'>   ts---Resume</t>", "Scripts\SCOsetSpeed.sqf", 4, 1, true, true, "", "", 3];

// Add event handler to check for all non-crew members exiting the vehicle
_vehicle addEventHandler ["GetOut", {
    params ["_veh", "_role", "_unit"];
    if (!(_unit in crew _veh) && {_unit == player}) then {
        [_veh, nil, nil, 5] execVM "Scripts\SCOsetSpeed.sqf";
    };
}];

// Add event handler to switch to external camera view when the player gets in the vehicle
_vehicle addEventHandler ["GetIn", {
    params ["_veh", "_role", "_unit"];
    if (_unit == player) then {
        player switchCamera "EXTERNAL";
    };
}];

// Set slower initial speed
_vehicle limitSpeed 45;

 

 

SCOsetSpeed.sqf

//==========================//
// Simplex Transport Speed  //
//==========================//

// Author: scottb613
// File: SCOsetSpeed.sqf

// Requires: Simplex Support Modules addon.
// Requires: "initTransA.sqf" in root of mission folder.
// Requires: "Scripts\SCOsetSpeed.sqf" in root of mission folder.
// Requires: Simplex Transport Module - Custom Init Code entry ===>>> [_this] execVM "initTrans.sqf";

// Note: Only tested in single player.

// Given: For use with the Transport Module of Simplex Support Services.
// Given: Provides speed control and the ability to stop on demand.
// Given: Creates AddAction menu items to control speed of respective vehicle.
// Given: After a "ts---Stop" - when player leaves vehicle - vehicle will resume last ordered waypoint automatically.
// Given: After a "ts---Stop" - when player remains in vehicle - is "ts---Resume" must be ordered to resume travel.
// Given: Camera switches to "External" when player enters a vehicle.

// Given: Sets initial max speed to 45.

//=====================================================================================================================//
//=====================================================================================================================//
_vehicle = _this select 0;
_speedMode = _this select 3;

switch (_speedMode) do {
    case 0: {
        _vehicle limitSpeed 20;
        sleep 2;
        _vehicle forceSpeed 0;
    }; // Stop
    case 1: {_vehicle limitSpeed 20}; // Limited
    case 2: {_vehicle limitSpeed 45}; // Cruise
    case 3: {_vehicle limitSpeed 100}; // Full
    case 4: { 
        _vehicle forceSpeed -1;
        _vehicle limitSpeed 20; 
        _group = group _vehicle;
        _waypoint = currentWaypoint _group;
        _wpPos = waypointPosition [_group, _waypoint];
        _vehicle move _wpPos;
    }; // Resume
    case 5: { 
        hint "Transport Release";
        sleep 10;
        _vehicle forceSpeed -1;
        _vehicle limitSpeed 45; 
        _group = group _vehicle;
        _waypoint = currentWaypoint _group;
        _wpPos = waypointPosition [_group, _waypoint];
        _vehicle move _wpPos;
    }; // Release
};

 

Regards,
Scott

  • Like 1

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  

×