ducdragger99
Member-
Content Count
18 -
Joined
-
Last visited
-
Medals
Community Reputation
0 NeutralAbout ducdragger99
-
Rank
Private First Class
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Making a script for multiple objects
ducdragger99 replied to ducdragger99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Alright, I have all my addActions figured out and working well. How would I put in a if/then/else for the "take" and "Fly" options? i.e. Take Flag= If (the flag has already been taken) Then hint "THE FLAG IS ALREADY TAKEN" Else Perform the action Fly Flag = If (you didn't take the flag, set by assignment of flagOwner) then hint "you don't have the flag" Else Perform Action this is my addActions currently //Take Flag USFlag addAction [ "Take Flag", { [USFlag,0.0,false] remoteExec ["BIS_fnc_animateFlag",0,true]; sleep 10; [USFlag,""] remoteExec ["SetFlagTexture",0,true]; player action ["TakeFlag",USFlag]; USFlag setFlagOwner player; } ]; //Replace Flag USFlag addAction [ "Fly Flag", { USFlag setFlagOwner objNull; [USFlag,0.0] remoteExec ["setFlagAnimationPhase",0,true]; sleep 1.0; [USFlag,"\A3\Data_F\Flags\flag_us_CO.paa"] remoteExec ["SetFlagTexture",0,true]; [USFlag,1.0,false] remoteExec ["BIS_fnc_animateFlag",0,true]; } ]; -
Making a script for multiple objects
ducdragger99 replied to ducdragger99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm guessing i'm missing something that will change the value of the current animation phase when it is changed. So by setting the initial flag height to 1.0 It is always thinking of the flag that way, hence i'm only seeing the actions performed when the height is less than 1. How do you get the variable to update the current position? -
Making a script for multiple objects
ducdragger99 replied to ducdragger99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Got it. well, kinda. I am able to execute my "HalfStaff" and "lower" functions, but I cannot get the "Raise or Take" to even appear? (It did before I added the remoteExec to it though). On a side note, is it an issue to run the script from the missions' init? //Define Player "operator" _operator = Player; //Define parameters for flag _USFlag1 = USFlag1; params ["_USFlag1","_CurrentFlagHeight","_FlagCarrier"]; //Define starting flag _USFlag1 setFlagTexture "\A3\Data_F\Flags\flag_us_CO.paa"; [_USFlag1, 1.0, true] call BIS_fnc_animateFlag; _USFlag1 setflagOwner objNull; _CurrentFlagHeight = flagAnimationPhase _USFlag1; _FlagCarrier = flagOwner _USFlag1; //flag positions //Raise flag if(_CurrentFlagHeight < 0.9) then {_USFlag addAction ["Raise Flag",{[USFlag1,1.0,false] remoteExec ["BIS_fnc_animateFlag",0,true];}];}; //Half Staff flag if(_CurrentFlagHeight > 0.0) then {_USFlag1 addAction ["Half Staff",{[USFlag1,0.5,false] remoteExec ["BIS_fnc_animateFlag",0,true];}];}; //Lower flag if(_CurrentFlagHeight > 0.2) then {_USFlag1 addAction ["Lower Flag",{[USFlag1,0.1,false] remoteExec ["BIS_fnc_animateFlag",0,true];}];}; //Take flag if(_CurrentFlagHeight < 0.3) then {_USFlag1 addAction ["Take Flag",{[USFlag1,""] remoteExec ["setFlagTexture",0,true];}];}; //Return flag if(_CurrentFlagHeight == 0.0) then {_USFlag1 addAction ["Return Flag",{[USFlag,"\A3\Data_F\Flags\flag_us_CO.paa"] remoteExec ["setFlagTexture",0,true];}];}; Also, If a player didn't take the flag down, I do not want him to be able to "Return" it. I was thinking I could do this: //Return flag if(_CurrentFlagHeight == 0.0) then{ if (_Operator == _flagCarrier) then {_USFlag1 addAction ["Return Flag","Functions\dUc_fnc_ReturnFlag.sqf"]} else {hint "YOU DON'T HAVE THE FLAG";} else {hint "The Flag is still flying";}; }; -
Making a script for multiple objects
ducdragger99 replied to ducdragger99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
ok, so if I am understanding this correctly, let's say the faction the flag belongs to does not matter. If i were wanting flag height to dictate which action was displayed, I could use something along the lines of: Flagpoles' init: nul = [this, true] execVM "script.sqf"; in script.sqf: params ["_Flag","_CurrentFlagHeight"]; but I need to define "_CurrentFlagHeight"? so would I write _CurrentFlagHeight = _Flag getVariable flagAnimationPhase; -
Making a script for multiple objects
ducdragger99 replied to ducdragger99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@dwringer ok, couldn't get that to work at all, so I started from scratch. I put an execVM into my init file in my mission folder. (seems to work, it's referencing my script file) I placed an empty flag pole in the VR editor and named it Pole_1 In my script.sqf I put the following: _Flag = Pole_1; Pole_1 = _this; _Flag setFlagTexture "\A3\Data_F\Flags\flag_us_CO.paa"; //set initial flag texture [_Flag,1.0,true] call BIS_fnc_animateFlag; //set initial flag height ^^^^^^^^ the above worked great, I spawned in and saw an American Flag high atop the flag pole.^^^^^^^^^^^^^ the next step was to put the actions on the flag, this is where i'm having extreme difficulties. I've read the wikis and watched some vids, and still even after copying the wiki line for line, am getting errors. [ //flag positions //Raise flag _Flag addAction [ "Raise Flag", //Action Name {_this,1.0}, //Script to send to fnc nil, //Argument 1, //Priority true, //showWindow true, //hideonuse "", //shortcut "", //condition 10, //Radius false, //unconscious "", //selection "" //memoryPoints ] call BIS_fnc_animateFlag]; //Half Staff flag _Flag addAction [ "Half Staff", //Action Name {_this,0.5}, //Script to send to fnc nil, //Argument 2, //Priority true, //showWindow true, //hideonuse "", //shortcut "", //condition 10, //Radius false, //unconscious "", //selection "" //memoryPoints ] call BIS_fnc_animateFlag]; //Lower flag _Flag addAction [ "Lower Flag", //Action Name {_this,0.1}, //Script to send to fnc nil, //Argument 3, //Priority true, //showWindow true, //hideonuse "", //shortcut "", //condition 10, //Radius false, //unconscious "", //selection "" //memoryPoints ] call BIS_fnc_animateFlag]; ]; Once again i'm lost. Any help would be appreciated. -
Making a script for multiple objects
ducdragger99 replied to ducdragger99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
dwringer, thank you for the explanation. It is most helpful. That really sheds some light on things. -
Making a script for multiple objects
ducdragger99 replied to ducdragger99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
ok, so I'm trying to start from the most basic point I can. I put down a flagpole and a player in VR. I named the flag pole "USFlag1" I put in USFlag1 init: this execVM "savetheflag.sqf" I made a file called savetheflag.sqf in the sqf i put the following: [ _USFlag = ["USFlag1"]; _USFlag setFlagTexture "\A3\Data_F\Flags\flag_us_CO.paa"; _USFlag setFlagAnimationPhase 1.0; ]; Nothing happens and I get an error missing ] What's wrong with what I wrote? -
Making a script for multiple objects
ducdragger99 replied to ducdragger99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have looked at those pages for hours, I have watched countless videos on scripting. Perhaps I just don't grasp the concept of this foreign language. I've been trying to make my missions more stream lined and less Zeus dependent. I give up, I just don't understand. -
Making a script for multiple objects
ducdragger99 replied to ducdragger99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
ok, i've tried and tried to get this to work with very minimal success. so far, i am able to Raise, Lower, Half Staff, Take and Fly my flag. When the selection of TAKE FLAG is selected I would like to put a folded flag in the player that took its' uniform, remove the action to take the flag (since there is only one flag pole) and allow only that player to put it back or "FLY FLAG" i'm putting this into the objects (USFlag1) init because i obviously do not know how to write a script for this. Any help or input is appreciated. USFlag1 setFlagOwner USFlag1 ["AmmoboxInit",[this,true]] call BIS_fnc_arsenal; call{this setFlagAnimationPhase 1.0;}; this addAction["Raise Flag",{[USFlag1, 1.0] remoteExec ["setflaganimationPhase",0,true];}]; this addAction["Lower Flag",{[USFlag1,0.1] remoteExec ["setflaganimationPhase",0,true];}]; this addAction["Half Staff",{[USFlag1,0.5] remoteExec ["setflaganimationPhase",0,true];}]; this addAction["Take Flag",{[USFlag1,""] remoteExec ["setFlagTexture",0,true];}]; this addAction["Fly Flag",{[USFlag1,"Flag_US_F"] remoteExec ["setFlagTexture",0,ture];}] if ("Take Flag" == true) then { this RemoveAction["Take Flag",this,true]; USFlag1 setFlagOwner _Player; _Player addItemtoUniform "FoldedFlag_US_01_F"; }; if ("Fly Flag" == true) then { USFlag1 setFlagOwner USFlag1; _Player removeitemfromUniform "FoldedFlag_US_01_F"; this addAction["Take Flag",this,true]; }; -
ducdragger99 started following Making a script for multiple objects
-
Making a script for multiple objects
ducdragger99 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am making a mission for a dedicated server andI am wanting to make a script that will add the same actions to certain objects so I don't have to put everything in each individual init. I'm still new to scripting so please forgive any errors, but I have reached a bit of a speedbump. here's what i've tried so far: _Flags = ["USFlag1","NFFlag1","RCFlag1","RangeFlag1","RangeFlag2","RangeFlag3",]; USFlag = _Flags select 0; Nato = _Flags select 1; RedCross = _Flags select 2; Range = _Flags select 3,4,5; [ forEach _Flag do ["AmmoboxInit",[_this,true]] call BIS_fnc_arsenal; call setFlagAnimationPhase 0.1;}; addAction["Raise Flag",{[_this, 1.0] remoteExec ["setflaganimationPhase",0,true];}]; addAction{"Lower Flag",{[_this, 0.1] remoteExec ["setflaganimationPhase",0,true];}]; addAction["Half Staff",{[_this, 0.5] remoteExec ["setFlagAnimationPhase",0,true];}]; ]; //NOTE: the only reason I have call outs to specific flags is because I want to add other scroll wheel functions to them in the future. Am I on the right track? What am I missing? When I try to run it in MP I get a "generic error in expression on my _Flags line -
ducdragger99 started following Harzach
-
Beginner question about addAction
ducdragger99 replied to ducdragger99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ok cool. Thanks for the example. I'm very new to this and I have a reading comprehension problem, so the visual aid REALLY helps. You guys are great, I appreciate the time and effort. I will give this a go, and hopefully it works. Thanks again, I will post with an update -
Beginner question about addAction
ducdragger99 replied to ducdragger99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ok, so i've tired many different combinations, but I still come up with the same results. The ability is there to move the flag up and down, and it works. However, the remoteExec is not working. *Player 1 raises flag *Player 2 still sees flag at low position. Here is the code I used. It is not returning any errors. ["AmmoboxInit",[this,true]] call BIS_fnc_arsenal; //Add arsenal call{this setFlagAnimationPhase 0.1;}; //Set Flag height to low on start this addAction["Raise Flag",{RangeFlag1 setFlagAnimationPhase 1.0;}] //Raise Flag (works on client side) remoteExec [{"RangeFlag1 setFlagAnimationPhase",0}]; //raise flag on all clients (does not work) this addAction["Lower Flag",{RangeFlag1 setFlagAnimationPhase 0.1;}] //Lower Flag (works on client side) remoteExec [{"RangeFlag1 setFlagAnimationPhase",0}]; //lower flag on all clients (does not work) -
Mine training range
ducdragger99 replied to ducdragger99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
pierremgi, thanks, but i'm admitting defeat as I think i'm in way over my head, Time to give up and start smaller. -
Beginner question about addAction
ducdragger99 replied to ducdragger99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
_foley, I inserted the following and i am still getting the [ error. My vision isn't the greatest, but I do not see where I am missing a bracket. ["AmmoboxInit",[this,true]] call BIS_fnc_arsenal; call{this setFlagAnimationPhase 0.1;}; this addAction[["Raise Flag",] remoteExec [RangeFlag3, 1.0] remoteExec ["setFlagAnimationPhase"]]; this addAction[["Lower Flag",] remoteExec [RangeFlag3, 0.1] remoteExec ["setFlagAnimationPhase"]]; -
Beginner question about addAction
ducdragger99 replied to ducdragger99's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I have been trying to get remoteExec to function, but it seems i'm not understanding something. ["AmmoboxInit",[this,true]] call BIS_fnc_arsenal; call{this setFlagAnimationPhase 0.1;}; this addAction[["Raise Flag",] remoteExec {RangeFlag3 setFlagAnimationPhase 1.0;}]; this addAction[["Lower Flag",] remoteExec {RangeFlag3 setFlagAnimationPhase 0.1;}]; i'm getting an error of Init missing:[