Arma 3
CasioFin 21 Thg02, 2017 @ 12:03am
addAction and createVehicle
this addAction ["Bagfence","createVehicle.................]; Does anyone have information on how the two work together? The aim would be that the engineer would be able to build or dismantle the barrier. Or does this build somewhere Init.sqf files.

https://community.bistudio.com/wiki/addAction
and
https://community.bistudio.com/wiki/createVehicle
Lần sửa cuối bởi CasioFin; 21 Thg02, 2017 @ 12:08am
< >
Đang hiển thị 1-14 trong 14 bình luận
thedubl 21 Thg02, 2017 @ 1:28pm 
Not tested, but something like this in the units init for example. This would only to drop one, but what about moving them or multiple objects...? I personally would make it a function or script.

this addaction ["Bag Fence" , {"Land_BagFence_Long_F" createVehicle position _target}];
is this what you want? this gives the player a addaction to spawn a barrier and be able to move it around, then another action to place the barrier. we need more details.

run this anywhere, in a seperate file and call it from the init would be best.
placeBarrier = { grabBA = player addAction ["Grab Barrier", { _barrier = "Land_HBarrier_3_F" createVehicle position player; _barrier attachTo [player,[0, 5, 0]]; player removeAction grabBA; call dropBarrier; }]; }; dropBarrier = { dropBA = player addAction ["Place Barrier", { detach _barrier; player removeAction dropBA; }]; }; call placeBarrier;
CasioFin 22 Thg02, 2017 @ 5:40am 
Thank you thedubl that almost had a working script, but the _target had to change the player.
CasioFin 22 Thg02, 2017 @ 5:58am 
[Sec8]goKitty199 Just like this I'm looking for, but brought was a bit of an unfinished script.
For more information on this what I'm trying to look for.
  • spawn and destroy (delete object).
  • choose from the list what to build.
  • turn the object 45 degrees in any direction.
  • and only Engineer class can build that.
if these would be possible.
Lần sửa cuối bởi CasioFin; 22 Thg02, 2017 @ 6:10am
IM SORRY BUFFALO 22 Thg02, 2017 @ 11:23am 
Nguyên văn bởi CasioFin91:
[Sec8]goKitty199 Just like this I'm looking for, but brought was a bit of an unfinished script.
For more information on this what I'm trying to look for.
  • spawn and destroy (delete object).
  • choose from the list what to build.
  • turn the object 45 degrees in any direction.
  • and only Engineer class can build that.
if these would be possible.
i dont know how to do that for just an engineer, but you can take my script that i was working on a few months ago and change it to use what you want, its pretty much the same thing

spawnramps.sqf rampDirection = 180; objectHeight = 0; rampSteepness = 0; rampsMain = { removeAllActions player; hint "Make sure to only make the ramp steeper when your directly behind it, such as if you were jumping it!"; player addAction ["Open Menu", openedMenu]; call deleteObjectAction; }; openedMenu = { removeAllActions player; player addAction ["Ramps", rampSelection]; //make a new addaction for set ramps such as tabletops, tripples and such and exec from another .sqf file, have the tabletop and jumps attatchTo the first ramp, not the player. player addAction ["Premade sections", "spawnPreMadeSections.sqf"]; player addAction ["Vehicles", "spawnVehicles.sqf"]; player addAction ["Close Menu", {call rampsMain}]; call deleteObjectAction; }; rampSelection = { removeallActions player; player addAction ["Tall Concrete Ramp", { removeAllActions player; ramp = "Land_RampConcreteHigh_F" createVehicle position player; ramp attachTo [player, [0, 10, objectHeight]]; ramp setDir 180; call rampActions; }]; player addAction ["Short Concrete Ramp", { removeAllActions player; ramp = "Land_RampConcrete_F" createVehicle position player; ramp attachTo [player, [0, 10, 0]]; ramp setDir 180; call rampActions; }]; player addAction ["Back", {call openedMenu}]; call deleteObjectAction; }; rampActions = { //do switch with variable player addAction ["rotate", rotateOr]; player addAction ["steeper", rotateOsteep]; player addAction ["raise", raiseObject]; player addAction ["lower", lowerObject]; player addAction ["drop", dropO]; }; dropO = { rampDirection = 180; objectHeight = 0; rampSteepness = 0; detach ramp; detach secondRamp; detach thirdRamp; detach forthRamp; call openedMenu; }; rotateOr = { rampDirection = rampDirection + 20; ramp setDir rampDirection; }; rotateOsteep = { rampSteepness = rampSteepness - 0.1; ramp setVectorUp [0,rampSteepness,1]; }; raiseObject = { objectHeight = objectHeight + 1; ramp attachTo [player, [0, 10, objectHeight]]; }; lowerObject = { objectHeight = objectHeight - 2; ramp attachTo [player, [0, 10, objectHeight]]; }; deleteObjectAction = { player addAction ["Delete", {deleteVehicle cursorTarget}]; }; call rampsMain;
CasioFin 22 Thg02, 2017 @ 11:39am 
I'm trying to use this information to continue as far as possible. Thank you for this information.
Mountain 9 Thg09, 2017 @ 1:04pm 
Nguyên văn bởi Sec8gokitty199:
is this what you want? this gives the player a addaction to spawn a barrier and be able to move it around, then another action to place the barrier. we need more details.

run this anywhere, in a seperate file and call it from the init would be best.
placeBarrier = { grabBA = player addAction ["Grab Barrier", { _barrier = "Land_HBarrier_3_F" createVehicle position player; _barrier attachTo [player,[0, 5, 0]]; player removeAction grabBA; call dropBarrier; }]; }; dropBarrier = { dropBA = player addAction ["Place Barrier", { detach _barrier; player removeAction dropBA; }]; }; call placeBarrier;
Yo first off this is awesome thanks I managed to get the Radio Antenna spawned. When I click place barrier though it gives me an error about detach _barrier; Any ideas?
Mountain 9 Thg09, 2017 @ 1:06pm 
"player removeAction dropBA;...' Error undefined variable in expression: _barrier ??
Lần sửa cuối bởi Mountain; 9 Thg09, 2017 @ 1:07pm
Nguyên văn bởi Chaka:
"player removeAction dropBA;...' Error undefined variable in expression: _barrier ??
this was a long time ago. anyways thats because _barrier is defined in the placeBarrier function and it is local to that function. for now just make it global so change it from _barrier to barrier
Mountain 9 Thg09, 2017 @ 2:48pm 
Omg thank you man works like a charm! One other question how would I set it so only when the player is near an object or in a trigger this action pops up?
Lần sửa cuối bởi Mountain; 9 Thg09, 2017 @ 2:48pm
Nguyên văn bởi Chaka:
Omg thank you man works like a charm! One other question how would I set it so only when the player is near an object or in a trigger this action pops up?
on the object that you want the addaction on, double click on it and give it a variable name(ill use objectAction as an example). change player addAction/removeAction, change the word player to objectAction and it will have the action on the object with the variable name objectAction.
Nguyên văn bởi IM SORRY BUFFALO:
i dont know how to do that for just an engineer

something like that i think:

if ((typeOf player == "engineer_uniform_class1") or (typeOf player == "engineer_uniform_class2") or etc...) then { ur script; };
Nguyên văn bởi Warcat06:
Nguyên văn bởi IM SORRY BUFFALO:
i dont know how to do that for just an engineer

something like that i think:

if ((typeOf player == "engineer_uniform_class1") or (typeOf player == "engineer_uniform_class2") or etc...) then { ur script; };
strong bump lol this was awhile ago.
better way
if ((player getUnitTrait "engineer")) then { //derherpaderp };
Chariothe 15 Thg03, 2022 @ 7:51am 
Nguyên văn bởi IM SORRY BUFFALO:
is this what you want? this gives the player a addaction to spawn a barrier and be able to move it around, then another action to place the barrier. we need more details.

run this anywhere, in a seperate file and call it from the init would be best.
placeBarrier = { grabBA = player addAction ["Grab Barrier", { _barrier = "Land_HBarrier_3_F" createVehicle position player; _barrier attachTo [player,[0, 5, 0]]; player removeAction grabBA; call dropBarrier; }]; }; dropBarrier = { dropBA = player addAction ["Place Barrier", { detach _barrier; player removeAction dropBA; }]; }; call placeBarrier;

How do i delete barrier after i walk away from it? I tried adding this to the last line, waitUntil { sleep 10; (player distance barrier > 50);}; deleteVehicle barrier; but it didn't work.
< >
Đang hiển thị 1-14 trong 14 bình luận
Mỗi trang: 1530 50

Ngày đăng: 21 Thg02, 2017 @ 12:03am
Bài viết: 14