Search the Community
Showing results for tags 'passing'.
Found 3 results
-
Arma 3 scripting tutorials from gokitty1199/IM SORRY BUFFALO(both me)
gokitty1199 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Last content update: 6/13/2018 showing how to use the radius for addAction, using params instead of select, adding to arrays with various commands, altering arrays with various commands, get/setUnitLoadout Last content update: 6/10/2018 going through config files and getting details to sort what you want, using radius with addAction, params, and altering arrays with resize, pushBack, pushBackUnique, set, and append and going over to assist with resize count. Last content update: 5/27/2018 added GUI tutorial for how to make a weapon selector using cfgWeapon Last content update: 5/24/2018 added sector control tutorial Last content update: 5/21/2018 This is my arma 3 scripting tutorial series which is aimed to help both people getting into making their own scripts with fairly detailed simple tutorials as well as for the intermediate person looking to create their own features for their missions. The plans for this series is to almost fully cover everything behind the arma 3 missions that people play on a daily basis and have enough content provided in the videos where people can go off and make their own vision for their mission with the knowledge gained. Most of these videos are made on the fly at 1AM-4AM without any pretesting which should give someone the idea of what goes into finding syntax errors and narrowing down a bug that's causing your feature to not function properly. It is also an excuse for you to cut me some slack if you see mistakes :) . A lot of these tutorials are made with multiplayer in mind since I think most people want to play their missions online with their friends(which is why publicVariable has been utilized so much so new people can get a good grasp on the power those commands have). New videos are added to the playlist almost every day so if your stuck with something, maybe it has been covered in a video. If you have any requests on what you would like to see made then please suggest it here. topics covered so far Scripting tutorial playlist Database tutorials with INIDBI2 playlist GUI/Dialog tutorials playlist- 23 replies
-
- 19
-
addaction [SOLVED] Troubles Passing Variables to addAction
TexasRussian posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello awesome BI community! This is the first time I'm posting an issue here so any help would be much appreciated, and thank you in advance for the use of your time. 🙂 END GOAL: helicopter spawns (via triggers listening to boolean variable in game) helicopter goes to object (defined in script) helicopter goes to player (defined in script) helicopter returns to base helicopter disappears (via triggers listening to boolean variable in game) and: the addAction has an initial menu that just states "SUPPORTS" then upon selecting deletes that action and adds a subset of supports for the player to use. INTENTION: What I'm trying to do is have ONE .sqf script and pass variables to that script via execVM from a trigger in game. I have created this script using 3 .sqf script files using public and predefined variables in game, and it works. But I want this to work more like a function than a script. So this is my first script which uses private variables. I would like this to remain as ONE .sqf so I can copy this to a new mission and create/define the objects/groups in the game, then pass those using execVM. PROBLEM: Everything works, except addAction transfers the code to a scheduled task and the private variables are undefined there, at least that's how I understand it. CODE THAT WORKS WITH PUBLIC VARIABLES: CODE IM TRYING TO GET WORKING WITH PRIVATE VARIABELS: HOW I'M CALLING THE CODE: *EDIT In the game it errors at: slingloadmain = _player addAction [ "SUPPORTS", { _player removeaction slingloadmain; _activate = false; Is this even possible? -
hinting passed variable, displaying <no shape>
gokitty1199 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
im passing the triggers name from a trigger to a script and then passing the same variable from that script using publicVariableServer. this was working earlier today before i started to rewrite how the triggers spawn but the file that is getting the variable passed to it was not changed which makes no sense to me as to why it is throwing the error. here is the function that creates the trigger and passes the name into register.sqf. you can see r1Trigger is getting passed into register.sqf, now if i pass the name as a string it works just fine such as "cash1 = player addAction ['register 1', {['r1Trigger'] execVM 'server\loot\register.sqf';}];" but even if i use call compile to turn it back into the name of the object in the script, it still throws <no shape> when i hint the name. _area = [0.462, 0.637, 10.650, true, 1]; makeTrig1Fnc = { _pos = [3119, 6303.5, 0.312]; r1Trigger = createTrigger ["EmptyDetector", [_pos select 0, _pos select 1, _pos select 2]]; r1Trigger setTriggerArea [_area select 0, _area select 1, _area select 2, _area select 3, _area select 4]; r1Trigger setTriggerActivation ["GUER", "PRESENT", true]; r1Trigger setTriggerStatements ["this && player in thisList", "cash1 = player addAction ['register 1', {[r1Trigger] execVM 'server\loot\register.sqf';}];", "player removeAction cash1;"]; }; here is the register.sqf _register = _this select 0; _h = [_register]spawn { _register = (_this select 0); hint str _register;//THIS IS WHERE IM TRYING TO PRINT THE HINT FOR TESTING REASONS _register1 = r1Trigger; _register2 = r2Trigger; _register3 = r3Trigger; _register4 = r4Trigger; _moneyAmount = selectRandom [50, 100, 150, 175, 200, 250, 275, 400, 325, 2000]; switch (_register) do { case _register1: { registerUsed = [_register]; publicVariableServer "registerUsed"; player removeAction cash1; award = award + _moneyAmount; //hint format ["You found %1 dollars. Amount Stolen: $%2", _moneyAmount, award]; [r1SoundPos, ["cashRegister", 125, 1]] remoteExec ["say3d", 0, true]; _register setPos [0, 0, 0]; }; }; }; the other strange thing is that it works inside the switch statement and it runs for _register1 and _register2(the rest not included to keep the post size down) but long story short, it just works. but when i try to pass it to the server with publicVariableServer, that is where i run into the problems. when it was hinting the name properly, thats when it was working fine and i was able to work on the registerUsed eventHandler, why is it printing out <no slot>, ive restarted my game and everything and it just makes no sense to me as to why its doing this.