Jump to content
johnnyboy

JBOY Longboat [Release]

Recommended Posts

Behold:  JBOY Longboat.   The first of many scripts to be released as the mission series Last Tango In Tanoa progresses.

 

This script converts an assault boat into a Tanoan civvie long boat.  Great for fishermen, pirates and insurgents.  You can see this boat in action in my new mission Last Tango In Tanoa - Episode 1.  Please try that mission and rate and comment on steam.  Your comments and ratings motivate me to finish the next episodes and create more scripts.

 

How to use this script:

  • Place an empty assault boat object
  • Place a call to this script in the object's init line.  Here's some sample calls:
// Converts assault boat to an empty longboat
_d = [this,""] execvm "Scripts\JBOY_LongBoat.sqf";   // Creates an empty longboat, with no mounted weapon
_d = [this,"B_HMG_01_F"] execvm "Scripts\JBOY_LongBoat.sqf";  // Creates an empty longboat, with a mounted weapon on the front

// Converts assault boat to a longboat with crew already on board:
_d = [this,"B_T_Static_AT_F", units group player] execvm "Scripts\JBOY_LongBoat.sqf";
_d = [this,"B_T_Static_AT_F", [unit1, unit2, unit3, unit4]] execvm "Scripts\JBOY_LongBoat.sqf";

Download demonstration mission:   https://www.dropbox.com/s/qn8jsuxmkj3u59b/JBOY_Longboat.Tanoa.zip?dl=0

 

Crew Size:

  • If longboat has a mounted weapon, then maximum crew size is 4 (driver, 2 passengers, gunner).
  • If longboat does not have a mounted weapon, then maximum crew size is 3 (driver, 2 passengers)

 

Types of Mounted Weapons supported: 

  • B_HMG_01_F
  • B_GMG_01_F
  • B_T_Static_AT_F
  • B_T_Static_AA_F

 

Script:

 

 

// JBOY_LongBoat.sqf
/*
How to use:
1. Place an empty assault boat in the editor.
2. Place a call to this script in the assault boat's init box.

Examples calls to po put in init box:

_d = [this,""] execvm "Scripts\JBOY_LongBoat.sqf";  // Creates empty long boat without a mounted weapon.
_d = [this,"B_HMG_01_F"] execvm "Scripts\JBOY_LongBoat.sqf";   // Creates empty longboat with a moutned weapon
_d = [this,"B_GMG_01_F"] execvm "Scripts\JBOY_LongBoat.sqf";

_d = [this,"B_T_Static_AT_F", units group player] execvm "Scripts\JBOY_LongBoat.sqf"; // create longboat with crew
_d = [this,"B_T_Static_AT_F", [unit1, unit2, unit3, unit4]] execvm "Scripts\JBOY_LongBoat.sqf"; // create longboat with crew.

If longboat has a mounted weapon, then maximum crew size is 4 (driver, 2 passengers, gunner).
If longboat does not have a mounted weapon, then maximum crew size is 3 (driver, 2 passengers)

Types of static weapons you can attach to long boat:  B_HMG_01_F,  B_GMG_01_F, B_T_Static_AT_F, B_T_Static_AA_F

*/
params["_zodiac","_mountedWeaponType","_crew"];
_longboat = createVehicle ["Land_Boat_02_abandoned_F", [0,0,0], [], 0, "NONE"];
_zodiac  lockCargo [0, true];
_zodiac  lockCargo [1, true];
detach _longboat;
_longboat attachto [_zodiac,[.05,1.6,-.8]];
_longboat setdir 180;  
_zodiac setObjectTexture [0,""];
_weapon = objNull;
_attachPos = [];
// Attach an MG in the bow
if (_mountedWeaponType != "") then
{
    if (_mountedWeaponType find "Static" >= 0) then
    {
        _attachPos = [0.11,3.5,.25];
    } else
    {
       _attachPos = [0.11,3.9,.5];
    };
    _weapon = createVehicle [_mountedWeaponType, [0,0,0], [], 0, "NONE"];
    _weapon attachto [_zodiac, _attachPos];
    _box = createVehicle ["Box_Syndicate_Ammo_F", [0,0,0], [], 0, "NONE"];
    //_box enableCollisionWith _zodiac;
    _box enableCollisionWith _longboat;
    _box attachto [_zodiac,[0,3.7,-.95]];
    
    //_shade1 = createVehicle ["Land_Sunshade_F", [0,0,0], [], 0, "NONE"];
    //_shade1 attachto [_zodiac,[.3,-2,0]];
};
//
sleep 4;

if (count _crew > 0) then
{
//hint format ["GUNNER=%1",_crew select 3];

    _crew select 0 assignAsDriver _zodiac;          _crew select 0 moveInDriver _zodiac;
    _crew select 1 assignAsCargoIndex [_zodiac, 2]; _crew select 1 moveInCargo [_zodiac, 2];
    _crew select 2 assignAsCargoIndex [_zodiac, 3]; _crew select 2 moveInCargo [_zodiac, 3];
 

    if (_mountedWeaponType != "" ) then
    {
        //hint format ["gunner=%1, _weapon=%2",(_crew select 3),typeOf _weapon];
        (_crew select 3) assignAsGunner vehicle _weapon;
        _crew select 3 moveInGunner vehicle _weapon;
    };

};

 

  • Like 18
  • Thanks 1

Share this post


Link to post
Share on other sites

Creative indeed. Very nice work! @johnnyboy

  • Like 1

Share this post


Link to post
Share on other sites

Great script!

 

When developing, did you happen to try this on other static vanilla game boats (and/or wrecks)?  If so, any success?  Hoping to apply this idea in some WW2 missions (in non-tropical settings).  Those poor Russians & Germans could use some boat transport over water (like US forces have).

 

 

Share this post


Link to post
Share on other sites

I used this technique to make the Trawler move, but boat is hidden inside trawler object, so not good for player or passenger shooters (only good for an ambient moving ai driven trawler with waypoints).  Since zodiac is invisible, you can attach any object to it.  But for drive and passenger seats to look good, you need a small boat object that is close to size of zodiac (which is why it works well for the Tanoan longboats).  Pick another boat/wreck object you like and see if works for you.

  • Like 1

Share this post


Link to post
Share on other sites

Roger all that.  So I got it working nicely with "Land_RowBoat_V1_F".  It's suppose to be a "row" boat (no engine etc), but it looks & plays great for WW2 missions imo.

 

Had to rotate 90 degrees left, then rotate around forward axis by 19 degrees to get it perfectly aligned (as this object is listing to side by default).

 

Using attachment point [-0.075, 0, -.8] and it looks very good.  Still tweaking to minimize horizontal boards clipping with extra crew, etc.  Also, it's possible to use all 5 crew positions if you use your imagination a bit for two the guys laying down.  (Considering attaching some boxes underneath those two guys to get it looking perfect.)  Thanks so much for the idea & script!

 

Share this post


Link to post
Share on other sites
1 hour ago, madrussian said:

Still tweaking to minimize horizontal boards clipping with extra crew, etc.  Also, it's possible to use all 5 crew positions if you use your imagination a bit for two the guys laying down.

Cool, that's exactly how to do it.  You can attach extra stuff to dress it up.  Fuel Cans, Backpacks, whatever.  Too bad there isn't a static outboard motor object to attach to the back.  Maybe someone knows of one.  Post a screenshot and your modified script to share!

 

Edit:  One other thing you can do is attach more units who are using sitting passenger animations.  You can really fill up your boats that way.  But these units will not be able to shoot.  Good for civilians, troop transport, prisoners, etc.

  • Like 2

Share this post


Link to post
Share on other sites

Awesome, here's a quick screenshot:

 

Russian-Transport-4.jpg

 

This quick boat mod requires some of my vector rotation functions, which I posted here.

 

Here's your code with my mods (each indicated via "MRU Mod -"):

Spoiler

 


// JBOY_LongBoat.sqf
/*
How to use:
1. Place an empty assault boat in the editor.
2. Place a call to this script in the assault boat's init box.

Examples calls to po put in init box:

_d = [this,""] execvm "Scripts\JBOY_LongBoat.sqf";  // Creates empty long boat without a mounted weapon.
_d = [this,"B_HMG_01_F"] execvm "Scripts\JBOY_LongBoat.sqf";   // Creates empty longboat with a moutned weapon
_d = [this,"B_GMG_01_F"] execvm "Scripts\JBOY_LongBoat.sqf";

_d = [this,"B_T_Static_AT_F", units group player] execvm "Scripts\JBOY_LongBoat.sqf"; // create longboat with crew
_d = [this,"B_T_Static_AT_F", [unit1, unit2, unit3, unit4]] execvm "Scripts\JBOY_LongBoat.sqf"; // create longboat with crew.

If longboat has a mounted weapon, then maximum crew size is 4 (driver, 2 passengers, gunner).
If longboat does not have a mounted weapon, then maximum crew size is 3 (driver, 2 passengers)

Types of static weapons you can attach to long boat:  B_HMG_01_F,  B_GMG_01_F, B_T_Static_AT_F, B_T_Static_AA_F

*/
params["_zodiac","_mountedWeaponType","_crew"];


// MRU Mod - Make "row" boat instead of longboat
//_longboat = createVehicle ["Land_Boat_02_abandoned_F", [0,0,0], [], 0, "NONE"];
_longboat = createVehicle ["Land_RowBoat_V1_F", [0,0,0], [], 0, "NONE"];


// MRU Mod - All 5 cargo positions available
//_zodiac lockCargo [0, true];
//_zodiac lockCargo [1, true];


detach _longboat;


// MRU Mod - Different attach pos
//_longboat attachto [_zodiac,[.05,1.6,-.8]];
_longboat attachto [_zodiac, [-0.075,0,-.8]];


// MRU Mod - Specific orientation
//_longboat setdir 180;
_dirM = [0,1,0];
_upM = [0,0,1];
_sideM = [1,0,0];
_dir1 = [_dirM, _upM, 90] call MRU_V3_QRotation;
_up1 = _upM;
_dir2 = [_dir1, _dirM, 19] call MRU_V3_QRotation;
_up2 = [_up1, _dirM, 19] call MRU_V3_QRotation;
// Played with pitching boat slightly forward, to avoid front guy's gun slightly clipping through boat.  Liked it a bit better the first way (without this additional rotation).
// If anyone can improve this (even slightly), please post on JBOY Longboat thread, thanks!
//_dir3 = [_dir2, _sideM, -2.25] call MRU_V3_QRotation;
//_up3 = [_up2, _sideM, -2.25] call MRU_V3_QRotation;
_dir3 = _dir2;
_up3 = _up2;
_longboat setVectorDirAndUp [_dir3, _up3];


_zodiac setObjectTexture [0,""];


// MRU Mod - For now, disable handling of _mountedWeaponType and _crew
/*
_weapon = objNull;
_attachPos = [];
// Attach an MG in the bow
if (_mountedWeaponType != "") then
{
    if (_mountedWeaponType find "Static" >= 0) then
    {
        _attachPos = [0.11,3.5,.25];
    } else
    {
       _attachPos = [0.11,3.9,.5];
    };
    _weapon = createVehicle [_mountedWeaponType, [0,0,0], [], 0, "NONE"];
    _weapon attachto [_zodiac, _attachPos];
    _box = createVehicle ["Box_Syndicate_Ammo_F", [0,0,0], [], 0, "NONE"];
    //_box enableCollisionWith _zodiac;
    _box enableCollisionWith _longboat;
    _box attachto [_zodiac,[0,3.7,-.95]];
    
    //_shade1 = createVehicle ["Land_Sunshade_F", [0,0,0], [], 0, "NONE"];
    //_shade1 attachto [_zodiac,[.3,-2,0]];
};
//
sleep 4;

if (count _crew > 0) then
{
//hint format ["GUNNER=%1",_crew select 3];

    _crew select 0 assignAsDriver _zodiac;          _crew select 0 moveInDriver _zodiac;
    _crew select 1 assignAsCargoIndex [_zodiac, 2]; _crew select 1 moveInCargo [_zodiac, 2];
    _crew select 2 assignAsCargoIndex [_zodiac, 3]; _crew select 2 moveInCargo [_zodiac, 3];
 

    if (_mountedWeaponType != "" ) then
    {
        //hint format ["gunner=%1, _weapon=%2",(_crew select 3),typeOf _weapon];
        (_crew select 3) assignAsGunner vehicle _weapon;
        _crew select 3 moveInGunner vehicle _weapon;
    };

};

 

 

Boat mod crew positioning is surprisingly good, but could definitely use some minor improvement (inc front guy's gun poking through hull slightly, etc).  Please someone improve away and post here, thanks! :z:

 

Totally agree about having a simple static outboard motor object, that would be perfect.

  • Like 3

Share this post


Link to post
Share on other sites
11 minutes ago, madrussian said:

here's a quick screenshot:

Looks great!

  • Like 1

Share this post


Link to post
Share on other sites

Hi @johnnyboy,

 

I have a question for you, if you don't mine. 

 

I am creating a marine interdiction mission, and am using EOS by banga bob to spawn the boats. Working great so far, BUT I would love to use your longboat script. That would really set the appetite for destruction. 

I've been trying to use your long boat script to change the assault boats. There is no mechanism to use custom code in EOS, that I've found. 

 

Any ideas? Is it possible?

 

I am using trying these lines since EOS spawns with crews. I just can't figure out how to reference the units. Any help would be appreciated it. 

// Converts assault boat to a longboat with crew already on board:

_d = [this,"B_T_Static_AT_F", units group player] execvm "Scripts\JBOY_LongBoat.sqf";

_d = [this,"B_T_Static_AT_F", [unit1, unit2, unit3, unit4]] execvm "Scripts\JBOY_LongBoat.sqf";

 

Share this post


Link to post
Share on other sites
3 minutes ago, Blackheart_Six said:

I am creating a marine interdiction mission, and am using EOS by banga bob to spawn the boats. Working great so far, BUT I would love to use your longboat script.

Hey Blackheart.  I'm pretty sure you can make it work.  You just need to detect the spawned boats,  and then run my script on them.  I am not familiar with EOS so I don't know how to find his boats.

Share this post


Link to post
Share on other sites

Thanks for the quick reply...... I'll keep chipping away. I am a hardware guy, not a software guy, steep learning curve. 🙂

  • Like 1

Share this post


Link to post
Share on other sites
21 hours ago, Blackheart_Six said:

I am using trying these lines since EOS spawns with crews. I just can't figure out how to reference the units. Any help would be appreciated it. 


// Converts assault boat to a longboat with crew already on board:

_d = [this,"B_T_Static_AT_F", units group player] execvm "Scripts\JBOY_LongBoat.sqf";

_d = [this,"B_T_Static_AT_F", [unit1, unit2, unit3, unit4]] execvm "Scripts\JBOY_LongBoat.sqf";

Hey @Blackheart_Six. After thinking about this a bit more, once you have found an EOS spawned assault boat, you could do something like this (where "spawnedBoat" is an EOS spawned boat object that has a spawned crew):

_units = crew spawnedBoat;
{_x leaveVehicle vehicle _x;} foreach _units;
_d = [spawnedBoat,"B_T_Static_AT_F", _units] execvm "Scripts\JBOY_LongBoat.sqf";

You need the units to exit the vehicle, so my script can assign them to the allowed slots in the Longboat (because some of the assault boat positions are locked in LongBoat because the positions do not look right in Longboat.).   I can imagine two potential problems though: 

 

1) Spawned boat has more crew than is allowed in Longboat.  You might have to modify my script or the above snippet to delete a few crew members.  Maximum is 3 units for longboat without a mounted weapon.  Or 4 units for longboat with a mounted weapon.

2) Does EOS also give spawned boat crew move waypoints?  Will those still work after we force units out of boat and back in?  Hopefully their waypoints still work after they are remounted in the hidden assault boat.

  • Thanks 1

Share this post


Link to post
Share on other sites

Hi @johnnyboy

 

Thanks for the follow up. I'll check it out. 

 

I did find SPL_Spawn which allows for custom code. I messed around a little bit with it, but would have to redo everything with the scenario. 

 

Once again, appreciate it. 

  • 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

×