Jump to content
Sign in to follow this  
Von Quest

Backpacks - Parachute and Scuba Qs?

Recommended Posts

Hmm, attachto works in the freefall animation, but not standing on the ground, odd. Neat script.

Share this post


Link to post
Share on other sites

i was able to attachto while on the ground, this seemed to give a rough appearance of still being on the chest:

_pack attachTo [_unit,[0,0,-0.01],"pelvis"];
_pack setVectorDirAndUp [[-0.3,-0.7,0.2],[0,0.1,0.9]];

but almost any movement ruins the effect. couldn't figure out how to attach to the torso or chest so it moves with the body.

and there definitely is something funny about dropping a pack if its not done by action ["dropbag",...], maybe a dev has some insight? fsm?

someone needs to make a physx rope addon, you attach one end to a object, and the other end to another object, and let pseudo-newton do his thing. maybe second attachment point could be positionable on the length of the rope, with the tail hanging free below the load. could be useful for many things; thinking: clearly halo, helicopter logistic transpo, special forces insertion, indiana-jones style swinging, etc. way beyond me.

oh, and word-up to this guy:

[attachto & setvectordirandup tutorial]http://killzonekid.com/arma-scripting-tutorials-attachto-and-setvectordirandup/

tho i still barely get it!

Share this post


Link to post
Share on other sites

Oh man, that pic looks awesome. Good luck with the scripting. :)

Share this post


Link to post
Share on other sites

I've tried the script by dr_strangepete and it works for me, perfectly. once on the ground the backpacks spawns at my feet, in a natural position, and I can use the action to pick it up. the stuff is in there too.

The only 2 things that have to be added to the script are:

-once the parachute is deployed, the backpack is no where to be seen. it doesnt show up until your on the ground the backpack should be still in the same position.

-the script should allow you to start playing from the ground, activate the script, load up in a helo/ plain, go in the air and parachute. so far for me it only works when spawned as halo-ing in the editor.

and would there be a way to add this script to certain units through config by default? I'd be interested in that

Up6ASjAl.jpg

Share this post


Link to post
Share on other sites

thats a bad-ass photo right there

i believe the invisible backpack while parachuting is a bug, or a technicality with that animation; could have to create a temporary backpack just for that sequence.

the script will run wherever you call it, so if haloing from a helo you could just use addaction that would eject you and run the script...and since attachTo looks terrible when walking on ground, don't see trying to get that to work, atleast via the current method. (maybe someone could import the backpack models for use as vests, would follow body animation and look much better anywhere....plus easier to script & access from within vehicles). as for initializing while on the ground, youd need some way to detect when you've ejected, does the eventhandler GetOut work with ejects?

i was able to init this on a couple units in singleplayer, and local-only server if thats what you mean?

also, so far ive had no MP luck with the script, but im probably not doing it right anyways

Edited by dr_strangepete

Share this post


Link to post
Share on other sites

Looks fantastic - good work

cheers

Share this post


Link to post
Share on other sites

and another thing I found.. when you land in the water, the backpack stays on your belly (wich is good) but on exit of the water the backpacks drops but still on a part with water above it >> so you cant pick it up

& it looks kind of weird that when you deploy your parachute that the backpacks stays on the position where you deployed until your on the ground. :P maybe an idea to temporary move the backpack to the corner of the map?

Share this post


Link to post
Share on other sites

Found the same thing in testing. It can still work if you play around a bit.

Jump into 1st person view and get your gun pointed to it as close as you

can (feet on ground), and it should eventually give you the option to grab it.

---------- Post added at 13:00 ---------- Previous post was at 12:48 ----------

@ItsThomas

Just went back and saw your picture on pg3. Very nice!

I no longer have server space to upload and show you

mine. Who do you use?

My guy was in Black Jumpsuit, Black Mask, HALO Helmet,

Black Re-breather, Black Carryall underneath, etc. Cool.

How'd you get the O2 hoses working for the re-breather

while still in the air? Thats freaking awesome!

:thumb:

Edited by Goblin

Share this post


Link to post
Share on other sites

I changed a part of the config. it'll be in my NSW Units & Gear mod wich I'll release this weekend. :)

..

My guy was in Black Jumpsuit, Black Mask, HALO Helmet,

Black Re-breather, Black Carryall underneath, etc. Cool.

..

Black carryall definitelly looks better.

dFWQBWVl.jpg

Edited by ltsThomas

Share this post


Link to post
Share on other sites

Looks like you're gonna beat me to it. That's super bad-ass!

I was using the Heli Helmet: H_CrewHelmetHeli_B

Then I had the Pack jammed with gear and camo

uniform, boonie hat, etc. Excited to see what you've

done in your mod this weekend. Will be watching!

btw: love the profile pic. HUGE David Duchovny fan. :cool:

Share this post


Link to post
Share on other sites

this should work better, can initialize from the ground, will wait till in the air and not in a vehicle (falling); pack is hidden on parachute deploy. couldn't get it to reattach for that animation for some reason, just stayed in the sky...; pack stays attached when landing in water until hitting the shore where the unit can standup, then pack floats and in my testing was easily able to be taken.;

again, this is just a dirty work-around that happens to look decent while flying. i still really think the solution is a vest class that looks like a backpack (can this be done with only configs? itsThomas, would you know?), then the pack will move and flex with the players chest

attachbackpack.sqf:

//HALO help
//

if (isDedicated) exitWith {};
_unit = _this select 0;
_parachute = _this select 1;
_pack = unitBackpack _unit;

if(_parachute == "") then {
_unit addBackpack "B_Parachute";
} else {
_unit addBackpack format ["%1",_parachute];
};

_pack setPos [(getPos _unit) select 0,(getPos _unit) select 1,-50]; //bury

waitUntil {(getPosATL _unit) select 2 > 20 && vehicle _unit == _unit}; //20 ATL and not in a vehicle == falling

//freefall:
_pack attachTo [_unit,[0,-0.13,0],"Pelvis"];
_pack setVectorDirAndUp [[0,0,1],[0,1,0]];

//standing:
//_pack attachTo [_unit,[0,0,-0.01],"pelvis"];
//_pack setVectorDirAndUp [[-0.3,-0.7,0.2],[0,0.1,0.9]];

_nil = [_unit,_pack] spawn {
_unit = _this select 0;
_pack = _this select 1;

waitUntil {animationState _unit == "para_pilot"}; //wait for parachute open
//animation still weird, can't seem to attach while in parachute animation...so bury temporarily 
_pack setPos [(getPos _unit) select 0,(getPos _unit) select 1,-50]; //bury nearby...

waitUntil {isTouchingGround _unit || (getPosASL _unit) select 2 < 0.1};//wait for landing
if(surfaceIsWater [getPos _unit select 0,getPos _unit select 1]) then {
	waitUntil {isTouchingGround _unit}; //will trigger offshore, bag will float then
	detach _pack;
	_pack setPosASL [getposASL _unit select 0, getposASL _unit select 1,-0.31];
} else {
	detach _pack;
	_pack setPosATL [getposATL _unit select 0,getposATL _unit select 1,-0.13];
};

_pack setVectorDirAndUp [[0,0,-1],[0,-1,0]];


_pack addAction [localize "STR_A3_CfgActions_TakeItem0",{(_this select 1) action ["TakeBag",_this select 0];},"",6,true,true,"","true"];
};

Edited by dr_strangepete

Share this post


Link to post
Share on other sites

Awesome!

I implemented it in a mp mission I'm making:

code on flag / building / whatever you want

this addAction ["HALO Insertion","attachbackpack.sqf"];

attachbackpack.sqf

haloed = true;
hintSilent "Click on the map where you'd like to HALO.";
onMapSingleClick "player setPos [(_pos select 0), (_pos select 1), 3000]; haloed = false;hint 'Close the map and dont forget to open your chute!'";
waitUntil{!haloed};
onMapSingleClick "";

if (isDedicated) exitWith {};

_pack = unitBackpack player;

player addBackpack "B_Parachute";

//freefall:
_pack attachTo [player,[0,-0.13,0],"Pelvis"];
_pack setVectorDirAndUp [[0,0,1],[0,1,0]];

_nil = [player,_pack] spawn {
_unit = _this select 0;
_pack = _this select 1;

waitUntil {animationState _unit == "para_pilot"}; //wait for parachute open
//animation still weird, can't seem to attach while in parachute animation...so bury temporarily 
_pack setPos [(getPos _unit) select 0,(getPos _unit) select 1,-50]; //bury nearby...

waitUntil {isTouchingGround _unit || (getPosASL _unit) select 2 < 0.1};//wait for landing
if(surfaceIsWater [getPos _unit select 0,getPos _unit select 1]) then {
	waitUntil {isTouchingGround _unit}; //will trigger offshore, bag will float then
	detach _pack;
	_pack setPosASL [getposASL _unit select 0, getposASL _unit select 1,-0.28];
} else {
	detach _pack;
	_pack setPosATL [getposATL _unit select 0,getposATL _unit select 1,-0.13];
};

_pack setVectorDirAndUp [[0,0,-1],[0,-1,0]];


_pack addAction ["Take Bag",{(_this select 1) action ["TakeBag",_this select 0];},"",6,true,true,"","true"];
};

Tested it and it works.

Should work in MP too.

Thanks for the script, dr_strangepete. :D

Share this post


Link to post
Share on other sites
SCUBA:

OK, I think I have the SCUBA issue worked out. I was over-thinking it I guess. I just needed a bigger pack to haul the extra gear and uniform (or it was an update issue). Should be good now.

Can i ask how you solved this problem, i would also like to use this method. Cant see a way of doing it, with the need for a re breather on insertion.

Share this post


Link to post
Share on other sites

(unitBackpack this) additemCargo ["NAME_of_Uniform _Here",1];

Recommend you use the Carry-All Backpack (large):

B_Carryall_blk (or whatever color/type you want)

Share this post


Link to post
Share on other sites

OK, update and some testing yesterday.

(always play on Home LAN if that makes a difference?)

Works good in SP, but had issues in MP:

@dr_strangepete - in MP the Backpack would disappear/sink into ground.

@ItsThomas - in MP worked (mostly) but always the 2nd player (client?)

would lose most of the custom stuff I packed for him. This has been an

issue in general though. Also we ended up with 2 Parachutes with yours.

One on the back, then extra one on the stomach area. hehe Odd.

For MP have to go back and use the 'ol crate-at-a-distance trick. :icon_neutral:

Share this post


Link to post
Share on other sites

Replace anywhere it says player with _unit, was causing the script to trip-up when other units were calling it. that should also fix the disappearing bags. Im updating the code above right now

OK, update and some testing yesterday.

(always play on Home LAN if that makes a difference?)

Works good in SP, but had issues in MP:

@dr_strangepete - in MP the Backpack would disappear/sink into ground.

@ItsThomas - in MP worked (mostly) but always the 2nd player (client?)

would lose most of the custom stuff I packed for him. This has been an

issue in general though. Also we ended up with 2 Parachutes with yours.

One on the back, then extra one on the stomach area. hehe Odd.

For MP have to go back and use the 'ol crate-at-a-distance trick. :icon_neutral:

Share this post


Link to post
Share on other sites

Replaced all player with _unit (4 of them). Bunch of errors. Breaks script. Splat. :dead:

Share this post


Link to post
Share on other sites
Replaced all player with _unit (4 of them). Bunch of errors. Breaks script. Splat. :dead:

...and the errors are,

?

the code, as-typed by me above, works fine on my end with no errors. copy and paste the code you're using and the errors that are coming up please

---edit:

on second thought, if you're using itsThomas's code, you'll need to add "_unit = _this select 1;" to the very top. that element is the object (unit) that called the addaction

Edited by dr_strangepete

Share this post


Link to post
Share on other sites

@dr_strangepete

Did a little more testing for the little time I had last night.

Sorry, I was mixing the different scripts. :o Re-tried yours

and again, worked great in SP (did not try water landing)

but in MP same issue. Backpack gets swallowed up in the

gofer-holes.

Notes: All my landings were on hillsides. And on one jump,

I could see a Pack sticking slightly out but it was too

buried to grab it. hmm...

BTW, Thank you so much for your time with this. This part

of design is over my head. You rock, man. :cool:

Share this post


Link to post
Share on other sites

i've noticed a couple weird reactions so far testing with mp....times where setVector didn't transfer, nor backpacks (seem to be local only?).

starting to get the feeling that the mp friendly way of doing this is to store the contents of the backpack and create a new one for the jump & landing; repopulating after landing of-course (not trying to find any more bugs today)

---edit: never noticed this before:

http://forums.bistudio.com/showthread.php?157793-ATM-Airdrop-A3-Beta

Edited by dr_strangepete

Share this post


Link to post
Share on other sites

@dr_strangepete

Tried a few more runs again with your latest script. All I had to do was change the setPosATL. You had last number as -0.13 (straps below ground). I changed it to 0.3 in MP:

SP = _pack setPosATL [getposATL _unit select 0,getposATL _unit select 1,-0.13];

MP = _pack setPosATL [getposATL _unit select 0,getposATL _unit select 1,0.3];

Looks like I need two different ones? Timing issue?

In MP the pack was straps UP, in SP straps DOWN.

For water-landings, not sure if I liked the sunk pack or the floating one. I'll play around with it... So as yours is right now, with the 0.3 fix, it seems to work almost perfect in MP. Very very close. No matter what I try I always end up back to the original problem. I'm guessing this is game or MP specific problem, and not the script? When we spawn in (both with & without your HALO Script), the #2 player always loses a bunch of his loadout. This is madding. Utterly madding!

Way back in ArmA Alpha, before the chutes were added, we would just 'simulate' the HALO Jump in. Same issue. Same custom loadout setup in both Units init field. We both spawn-in but player #2 (client) would lose half his stuff. Odd. So as a work-around, we would have to spawn a crate in nearby filled with the stuff we wanted. We would just pretend it was air-dropped ahead of us and we would go find it.

Now with things moving along in Beta, we can actually HALO Jump for real, in the game (thanks to you :)), which is totally frickin awesome! ...BUT, back to original problem. I have ALL my loadout after jump. My combat-buddy lands nearby, grabs the Backpack off the ground and its only half full of his stuff. (Must have forgot to zip-it up) Weird that when in MP the 'puter says ok, you can have this and that, but I'm going to delete that and this. Maybe will have to start a Thread for 'Missing Inventory Items'.

Have you tried that ATM Airdrop setup yet? May have to look into that...

Edited by Goblin
going insane

Share this post


Link to post
Share on other sites

With reference to the below post, I don't understand how to implement it. I have custom load out for each unit, how would I implement this as well?

Awesome!

I implemented it in a mp mission I'm making:

code on flag / building / whatever you want

this addAction ["HALO Insertion","attachbackpack.sqf"];

attachbackpack.sqf

haloed = true;
hintSilent "Click on the map where you'd like to HALO.";
onMapSingleClick "player setPos [(_pos select 0), (_pos select 1), 3000]; haloed = false;hint 'Close the map and dont forget to open your chute!'";
waitUntil{!haloed};
onMapSingleClick "";

if (isDedicated) exitWith {};

_pack = unitBackpack player;

player addBackpack "B_Parachute";

//freefall:
_pack attachTo [player,[0,-0.13,0],"Pelvis"];
_pack setVectorDirAndUp [[0,0,1],[0,1,0]];

_nil = [player,_pack] spawn {
_unit = _this select 0;
_pack = _this select 1;

waitUntil {animationState _unit == "para_pilot"}; //wait for parachute open
//animation still weird, can't seem to attach while in parachute animation...so bury temporarily 
_pack setPos [(getPos _unit) select 0,(getPos _unit) select 1,-50]; //bury nearby...

waitUntil {isTouchingGround _unit || (getPosASL _unit) select 2 < 0.1};//wait for landing
if(surfaceIsWater [getPos _unit select 0,getPos _unit select 1]) then {
	waitUntil {isTouchingGround _unit}; //will trigger offshore, bag will float then
	detach _pack;
	_pack setPosASL [getposASL _unit select 0, getposASL _unit select 1,-0.28];
} else {
	detach _pack;
	_pack setPosATL [getposATL _unit select 0,getposATL _unit select 1,-0.13];
};

_pack setVectorDirAndUp [[0,0,-1],[0,-1,0]];


_pack addAction ["Take Bag",{(_this select 1) action ["TakeBag",_this select 0];},"",6,true,true,"","true"];
};

Tested it and it works.

Should work in MP too.

Thanks for the script, dr_strangepete. :D

Any help truly appreciated

Toni (IR)

Share this post


Link to post
Share on other sites

@dr_strangepete

Fixed original problem. User error. :o had wrong syntax in the loadout part for multi-player. Gesh.

Can't believe I missed it the whole time. Wow.

@Ice_Rhino

That setup looks a lot like the ATM Airdrop system. There is more detailed instructions on how

to set that up in the download I believe. I'm doing something a bit different. Just create a SQF

file (attachbackpack.sqf) and copy & paste that code into it. Save that file in your mission Folder.

The top part that's labeled code on flag / building / whatever you want, put that line into some object's

initialization field . When near you'll get an Action Menu option "HALO Insertion", to activate it.

NOTE: not sure why, but everyone seems to always refer to ANY jump as HALO. Technically this

is incorrect. The first part of HALO is High Altitude. You need to be around 30,000ft +

(O2 needed over 22,000?). Extreme altitude is preferred for stealth insertion. Too high to see or hear

the aircraft (and avoid SAMs).

Until aircraft (Gnat?) is added like the C-130, I just start my units up in the air. You can skip the

code on flag / building / whatever you want part in the object. If you can be more specific I can try

and help further.

Edited by Goblin
clarify

Share this post


Link to post
Share on other sites

Thank you Goblin for taking the time and trouble to respond to me. I do have one question about your post, well one for now. Where you say ' Just create a SQF

file (attachbackpack.sqf) and copy & paste that code into it.' To which code are you referring I paste???

Thank you again

Toni(IR)

Share this post


Link to post
Share on other sites

In a Editor Create a NEW file. Name it attachbackpack.sqf

Copy & Paste

haloed = true;
hintSilent "Click on the map where you'd like to HALO.";
onMapSingleClick "player setPos [(_pos select 0), (_pos select 1), 3000]; haloed = false;hint 'Close the map and dont forget to open your chute!'";
waitUntil{!haloed};
onMapSingleClick "";

if (isDedicated) exitWith {};

_pack = unitBackpack player;

player addBackpack "B_Parachute";

//freefall:
_pack attachTo [player,[0,-0.13,0],"Pelvis"];
_pack setVectorDirAndUp [[0,0,1],[0,1,0]];

_nil = [player,_pack] spawn {
_unit = _this select 0;
_pack = _this select 1;

waitUntil {animationState _unit == "para_pilot"}; //wait for parachute open
//animation still weird, can't seem to attach while in parachute animation...so bury temporarily 
_pack setPos [(getPos _unit) select 0,(getPos _unit) select 1,-50]; //bury nearby...

waitUntil {isTouchingGround _unit || (getPosASL _unit) select 2 < 0.1};//wait for landing
if(surfaceIsWater [getPos _unit select 0,getPos _unit select 1]) then {
	waitUntil {isTouchingGround _unit}; //will trigger offshore, bag will float then
	detach _pack;
	_pack setPosASL [getposASL _unit select 0, getposASL _unit select 1,-0.28];
} else {
	detach _pack;
	_pack setPosATL [getposATL _unit select 0,getposATL _unit select 1,-0.13];
};

_pack setVectorDirAndUp [[0,0,-1],[0,-1,0]];


_pack addAction ["Take Bag",{(_this select 1) action ["TakeBag",_this select 0];},"",6,true,true,"","true"];
};

Make sure this File is now in your Mission Folder. You can find that mission that your are making in your:

Documents >> Arma 3 - Other Profiles >> YourProfileName >> missions >> MissionFolderName.Stratis

Just put that SQF file INSIDE the Mission Folder, where you see the mission.sqm File.

This is ONLY to get the HALO/JUMP part of the script to be available. To use start IN THE AIR, by setting the Altitude

of each unit at 11111m (in altitude box), or you can place:

this addAction ["HALO Insertion","attachbackpack.sqf"];

into the initialization field box in any object to activate from the ground. I believe this specific example you

have to START from the ground to work as-is. (?) As I stated, mine is based off dr_strangepete's if you read the

entire thread. I start in the AIR at over 36,000ft in full HALO Gear System + Full Combat Gear screaming toward the

earth at 120mph and -60 below zero. Hooyah!

For the Custom Loadout, you will need to ALSO put ALL of YOUR GEAR Code into the initialization field box of

each of your soldier units. For Custom Loadout Gear, do a search on the Forums or YouTube for the correct syntax.

I setup txt files on my Desktop for different senarios/missions. Then I just have to Copy & Paste as the situation

dictates off the plain txt files.

Recommend you try the ATM Airdrop - Click Here system. Comes with instructions plus you can activate a Chemlight on your

shoulder when parachuting in for a cool effect.

Edited by Goblin
Trying to teach while still learning myself =)

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  

×