Jump to content

Alex116

Member
  • Content Count

    31
  • Joined

  • Last visited

  • Medals

Community Reputation

1 Neutral

About Alex116

  • Rank
    Private First Class
  1. As usual, works like a charm. Thank you for your time, you've taught me well. Merry Christmas!
  2. Mhmm, I've managed to get it to work. But not exactly how I would like. I currently have the following scripts; Object init(Secret Documents) gatherintell = sdocs addAction ["<t color='#ffffff' size='1'>Gather Intelligence</t>","sdocs.sqf", [], 6, true, true, "",""]; sdocs.sqf waitUntil { !(isNil "SHK_Taskmaster_initDone") && { SHK_Taskmaster_initDone } }; _obj = (_this select 0); _obj setVariable ["RscAttributeDiaryRecord_texture","a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa", true]; [_obj,"RscAttributeDiaryRecord",["Top Secret Docs","These Docs outline the enemies defenses",""]] call bis_fnc_setServerVariable; _obj setVariable ["recipients", west, true]; ["Task2","Extraction","Get to teh choppa!"] call SHK_Taskmaster_add; ["Task1","succeeded","Task2"] call SHK_Taskmaster_upd; [_obj,"init"] spawn bis_fnc_initIntelObject; Now when I aproach the object it has two actions on it. Understandable since the secret document object has one of its own and I added one to it. Now if I select the original "Pickup Intell" action, it gives me the INTELL ADDED notification that pops up, though it's empty since sdocs.sqf was not run yet, so the variables were not set to create such DiaryRecords. I get this so far. Now if I select my own added Gather Intelligence action, sdocs.sqf runs flawlessly. No errors. It sets the variables on the DiaryRecords. Because when I select the original "Pickup Intell" action after I select my own added Gather Intelligence action I get the intell added notification, only this time with the variables set. So I currently have two actions, that both do different things. Now I would like to have a single action, my own added action to the object. That does both. Now the easiest way to accomplish this is find a way that when sdocs.sqf executes, I get the fancy intell added notification with the set variables from sdocs.sqf. Is this possible? Is there a way to run the intell added pop up? EDIT: I've gotten a bit closer by changing the object from Intell -> Secret Documents (Other (Interactive)) to Objects (small) -> File (Top Secret). This way the object is not interactive and will not have an "Take Intel" action on it. But only my own "Gather Intellligence" action. Now upon selecting my own action, it executes sdocs.sqf. And because of this line; [_obj,"init"] spawn bis_fnc_initIntelObject; It creates a new "Take Intel" action and when selected this creates the fancy "Intel added" pop up. Still cant figure out how to get this pop up in my own action though. EDIT: I have tried the following; [_obj,"init"] call bis_fnc_initIntelObject; Changing "spawn" to "call", hoping it would directly execute, simulating the action was selected, but still no luck.
  3. Which is exactly what I have in my init.sqf. call compile preprocessfilelinenumbers "shk_taskmaster.sqf"; And it works, whenever I call the variable from a trigger inside the editor like this; if (isServer) then { ["Task2","Extraction","Exfiltrate out of the AO."] call SHK_Taskmaster_add; ["Task1","succeeded","Task2"] call SHK_Taskmaster_upd; }; However, when I try this; Place object. (Intel -> Secret documents) INIT: if (isServer) then { [this] execVM "sdocs.sqf"; }; sdocs.sqf; _obj = (_this select 0); _obj setVariable ["RscAttributeDiaryRecord_texture","a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa", true]; [_obj,"RscAttributeDiaryRecord",["Top Secret Docs","These Docs outline the enemies defenses",""]] call bis_fnc_setServerVariable; _obj setVariable ["recipients", west, true]; ["Task2","Extraction","Get to teh choppa!"] call SHK_Taskmaster_add; ["Task1","succeeded","Task2"] call SHK_Taskmaster_upd; It cannot reach the taskmaster variables because it tells me they are undefined.
  4. I did found a use for it though. I now have it set up that when the player is not present in a trigger area he gets the comms menu option. And when he enters the trigger area it's removed from him again. This works great! One more thing, if I may. I have a function, which is stored in a SQF file. The function consists out of inline functions. (At least, I believe thats how it's called.) How would I run a certain inline function, from another SQF file? I use call SHK_Taskmaster_add; to call for this function, though gives me the error; "Error in undefined variable in expression" Now how would I define this variable?
  5. Aha! What I did is, copy; //For testing player addAction ["comms", { player setVariable [ "quaddrop", [ player, "Quad" ] call BIS_fnc_addCommMenuItem ]; }]; into my trigger's init box. Hence the error. After your hint, I edited it and made it; player setVariable [ "quaddrop", [ player, "Quad" ] call BIS_fnc_addCommMenuItem ]; And all works fine, once the trigger is activated I get the comms menu. With submenu and upon selecting option 1 the vehicle spawns fine. Now if I'd like to remove the option from a player I would simply put this in a trigger?; [ player, player getVariable "quaddrop" ] call BIS_fnc_removeCommMenuItem; ___________________________
  6. Thanks a bunch for the code provided and your explenation, it starts to make sense. It does work now but with the error; "[bIS_fnc_removeCommMenuItem] Item -1 not found in the comm menu".
  7. Still gives me the error; "undefined variable in expression _caller". Line 12. ////////////////////////////////////////////////////////////////// // Function file for Armed Assault // Created by: TODO: Author Name ////////////////////////////////////////////////////////////////// _caller = _this select 0; _pos = _this select 1; _target = _this select 2; _is3D = _this select 3; _id = _this select 4; _data = [_caller, _id]; if (isMultiplayer) then { [ _data, "BIS_fnc_removeCommMenuItem", true, false ] spawn BIS_fnc_MP; }; _startPos = [ _pos select 0, _pos select 1, (_pos select 2) + 300 ]; _apc= "B_APC_Wheeled_01_cannon_F" createVehicle _startPos; _apc setPos [ _startPos select 0, _startPos select 1, _startPos select 2 ]; sleep 0.5; _para= "B_Parachute_02_F"; _chute= _para createVehicle (getPos _apc); _chute setPos [ getPos _apc select 0, getPos _apc select 1, getPos _apc select 2 ]; _chute attachTo [_apc, [0,0,0]]; sleep 2; detach _chute; _apc attachTo [_chute, [0,0,0]]; if (surfaceIsWater (getPos _apc)) then { waitUntil { ((getPosASL _apc) select 2) < 3 }; detach _apc; sleep 2; _apc setVectorUp [0,0,1]; } else { waitUntil { ((getPos _apc) select 2) < 3 }; detach _apc; waitUntil {isTouchingGround _apc}; sleep 2; _apc setVectorUp [0,0,1]; }; Which is strange because even though it gives me this error, the script still fires and spawn a vehicle where I point. So I don't think theres a problem with the expressions. Also the _data is only used in this piece of the script. _data = [_caller, _id]; if (isMultiplayer) then { [ _data, "BIS_fnc_removeCommMenuItem", true, false ] spawn BIS_fnc_MP; }; Is this piece really needed to ensure MP compability? Seems a strange piece of code to me. ---------- Post added at 05:56 ---------- Previous post was at 05:03 ---------- Also, regarding the other piece of code. If I use DreadedEntity's code above it tells me call SHK_Taskmaster_add; is an undefined variable in expression. I've tried using this variable from an objects initialization field and that does the trick. Though theres got to be away to define this variable. Now the problem I have with defining this, is that its part of a function. It's an inline function located in another SQF. How does one define that in another SQF?
  8. Mhmm. Which makes it this: QUADsub = [ ["REQUEST AIRDROP",true], ["AIRDROP OPTIONS", [0],"",-2,[["expression", ""]], "1", "1"], // header text ["ATV" ,[2],"",-5,[["expression","[_caller,_pos,_target,_is3D,_ID] execVM comms.sqf"]],"1","1"], ["ATV" ,[3],"",-5,[["expression","[_caller,_pos,_target,_is3D,_ID] execVM comms.sqf"]],"1","1"] ]; And gives me an "Error missing;".
  9. I see, so by selecting either 0/1/2/3 you select an array, the value of that array. Well, I've basicly created a custom radio channel, with another sub-menu. Now when you select option 1 or 2, it will execute comm.sqf. Though the sub-menu script requests the following expression arguments ; Arma 3 Communication Menu So to define caller, I would have to define the player that selected the option. How does one do that?
  10. It's not. That's the entire script. Same goes for "_pos", "_target","_is3D" and "_ID". So these all need to be defined, correct? So how does one do that? Trough the "_caller = (_this select 0);" line? How do I know if it's select 0/1/2/3?
  11. QUADsub = [ ["REQUEST AIRDROP",true], ["AIRDROP OPTIONS", [0],"",-2,[["expression", ""]], "1", "1"], // header text ["ATV" ,[2],"",-5,[["expression","[_caller,_pos,_target,_is3D,_ID] execVM 'comm.sqf'"]],"1","1"], ["ATV" ,[3],"",-5,[["expression","[_caller,_pos,_target,_is3D,_ID] execVM 'comm.sqf'"]],"1","1"] ]; Is it like tangled up in the above code of array's that it cant find it?
  12. Thanks, I slowly start to understand. Once again, thank you guy's for helping out. I still cant seem to get rid of the other error though. Since _caller is defined.
  13. Also, one more related question. Let's say I have an object (intell documents) that runs a script when picked up. Object init: if (isServer) then { execVM "sdocs.sqf" }; sdocs.sqf: if (isServer) then { this setVariable ["RscAttributeDiaryRecord_texture","a3\structures_f_epc\Items\Documents\Data\document_secret_01_co.paa", true]; [this,"RscAttributeDiaryRecord",["Top Secret Docs","These Docs outline the enemies defenses",""]] call bis_fnc_setServerVariable; this setVariable ["recipients", west, true]; ["Task2","Extraction","Get to teh choppa!"] call SHK_Taskmaster_add; ["Task1","succeeded","Task2"] call SHK_Taskmaster_upd; }; It gives me an error saying that"this" is an undefined variable. How do I use variables to define an object so it is recognised by the script. I've read the wiki page about this and more, though it doesnt get trough to me. When I use the debug console to getvariable on the object it returns me the following: [[Control #1],0] What does this mean?
  14. Thanks a lot. I cant believe I oversaw that. It works now. Though I still get an error message. In line 14 of comms.sqf (undefined variable in expression: _caller) Caller is defined right? Just at the beginning.
  15. Still, all it copies is: "[]". And im definitely pointing at the ground. What I find strange is that it does work when not being fired from out of a submenu.While it does work when fired from the expression line in the CfgCommunicationsMenu. It appears to me that it cant reach the element array (the position your looking at) because its tangled up or got lost in the menu.sqf Isn't there a way for the comm.sqf script to look for that element himself? Or have it made a global variable inside menu.sqf?
×