Jump to content

TexasRussian

Member
  • Content Count

    12
  • Joined

  • Last visited

  • Medals

Everything posted by TexasRussian

  1. Authors Note*: Man, this was quite the process. Over 100 hours went into this mission. If you like high action, intensity, and a requirement of using technical skills, this is the mission for you. After playing this with my friends, I am feeling confident that anyone can enjoy this scenario. SITUATION: Chinese and American forces have occupied the southern area of the main island of Tanoa for too long. It's high time that we take it back. This scenario includes: Singleplayer 16 Player Co-Op Task Progression Supports Arsenals Equipment saving and loading Full time of day settings Full weather settings Fatigue Option Respawn unlocks Auto Saves Roughly 1 Hour 45 Minutes of Gameplay FUN! CHALLENGE: I bet you can't beat this mission within an hour and a half. 🙂 (NO MODS REQUIRED) [Co-Op/SP] Operation Treefrog Watch the Feature Trailer! Check out my other scenarios!
  2. 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?
  3. [SOLVED] Special thanks to Larrow for all his help, very descriptive and helpful information. So thank you Larrow for everything, I don't think I would have solved this if it weren't for you. At least I wouldn't have solved it any time soon. Working code with private variables: How to call the code: null = [_player,_slingLoadHelo,_slingLoadGroup,_trashLoc,_slingLoadHeloRTB,_vehicleSupplyLoc,_supplyLoc,_cargonetLoc,_technicalLoc,_truckLoc,_repairLoc] execVM "1slingload1.sqf"; Sample file
  4. I tried what you said and I got an error Image You are correct, the three variables for _actvate _show _hide are global variables. I am passing them to private variables as I don't want to use the same variables for showing and hiding the helicopter. I did it this way for optimization reasons. And so I could also have multiple helicopters if I wish, and have those sling loading helicopters be on different teams if need be. That way they can be shown and hidden separately. But using the same code. I also am passing _player as player 1, because I don't want every player having access to these supports, only team leaders. and yes, the rest are names set in Eden. So for example, this is my setup: I have a hellcat and the pilot's init field I have slingloadhelogroup = group this; There are two show/hide modules with triggers. Those triggers are associated with the boolean variables _show and _hide. These will obviously show and hide the helicopter when needed. the _activate variable was used (I may delete the need for this later) for the boolean activation of the _show trigger (set on repeat). In the .sqf you'll see I did have it set to once you select a support you want, it would cycle off the boolean variable so it can be reactivated, I later removed in the code for _activate = false; as I instead just ran the execVM again with the private variables. Weird way of doing it I suppose? As for compiling it and using it as an actual function, I will probably end up doing it that way, but working with it this way, lets me edit and change things on the fly and figure out any bugs. But eventually that is where it will end up. So my process here will be. Create the script with the global variables Create the script with private variables (for re-useability) Compile and use as a function rather than calling with execVM. I hope this is useful, I will be testing the script you sent me later today, and I'll report any findings to you later. Larrow, you have been amazing. Loving the effort, and really makes me love this community so much more. So thank you for all you do. And hopefully soon I'll have a few extra bucks to buy you that beer.
  5. Wow, very helpful Larrow. I really do appreciate it, I love how much effort you're putting into this. Really means a lot. I would use someone elses, but I do need the practice in creating scripts start to finish. I do like that script you sent. However the goal of my script is that it's only one file, that functions more like a function(hehe punny :D). That way its easier to move around into other missions. Thank you for suggesting that I get rid of the _this select #. That does make it easier. And I noticed that you properly capitalized my variables 🙂 it is a nice touch I didn't work on yet, but makes the code look way better. everything would work I suspect if I wasn't getting an annoying error. When I run the code I'm still getting a "Undefined Variable _show" at line '20'. Here's the code I have so far: And here's how I'm calling the code: I'm obviously defining all the variables as there's 13 variables there defined. I don't understand why it's saying _show is undefined when it's clearly defined as heloslingloadtakeoff. Line 20 is: _myVariables = [_activate,_show,_hide,_player,_slingLoadGroup,_trashLoc,_slingLoadHeloRTB,_vehicleSupplyLoc,_supplyLoc,_cargoNetLoc,_technicalLoc,_truckLoc,_repairLoc]; EDIT: It is also saying that there is an "Invalad Number in Expression" at line 20. Pointing to _show...? Any idea why that is?
  6. OMG thank you guys so much. This is really getting somewhere. Okay, so I now understand what is supposed to be in the third option for the addAction, which is an array of the base variables initially passed to the script. Now, I've tested it and the SUPPORTS addAction works, and shows the sub addActions for the menu I'm making. Now, I have gotten it to work with the submenus without any errors popping up, however, when I click my ...BACK option it runs the code with the rightly defined variables, however it will not pop back up the SUPPORTS option to get back into the menu. I am currently using a trigger in the game that is listening to the _activate variable and if it's true, then it runs the execVM command again. However when I click the ...BACK option it doesn't seem to reactivate even though I have the trigger enabled to repeat. So is there a better way of doing this? Or am I still doing something wrong? Here's the code I have so far:
  7. I was mainly trying to use the publicVariableServer command to broadcast the variables just in case that was the issue. I realize now it didn't need to be there. But I am confused about what you are saying. Or at least it's not working. are you saying that this code: params ["_target","_caller","_actionId","_myPassedVariables"]; myPassedVariables params [_activate,_show,_hide,_player,_slingloadgroup,_trashloc,_slingloadhelortb,_vehiclesupplyloc,_supplyloc,_cargonetloc,_technicalloc,_truckloc,_repairloc]; Needs to go in the third option for the addAction? in which case it would look like: //variable define for schedule task _myVariables = [_activate,_show,_hide,_player,_slingloadgroup,_trashloc,_slingloadhelortb,_vehiclesupplyloc,_supplyloc,_cargonetloc,_technicalloc,_truckloc,_repairloc]; //start action menu _activate = false; slingloadmain = _player addAction [ "SUPPORTS", { _player removeaction slingloadmain; _activate = false; //Loads of other addactions that I'll work on after I get the main menu working properly... }, [ params ["_target","_caller","_actionId","_myPassedVariables"]; myPassedVariables params [_activate,_show,_hide,_player,_slingloadgroup,_trashloc,_slingloadhelortb,_vehiclesupplyloc,_supplyloc,_cargonetloc,_technicalloc,_truckloc,_repairloc]; ], 10, false, true, "", "true", // _target, _this, _originalTarget 3, false, "", "" ]; The game keeps saying _show is a undefined variable. When it isn't. I have defined it in the calling code. Am I still doing something wrong? And I'm still confused because you said to place multiple strings into the arguments field (third option of the addAction menu.) which is on the wiki a array of arguments to pass. For example: this addAction [ "<title>", { params ["_target", "_caller", "_actionId", "_arguments"]; }, [],//As I understand brackets mean an array of options like [_this,_that,_and_the_other] Not strings of code. 1.5, true, true, "", "true",// _target, _this, _originalTarget 50, false, "", "" ];
  8. Okay, I think I'm understanding what is going on here. I have updated the script, but now when I run it. it is stating that there is an undefined variable _show... Am I still doing something wrong here? Here is the script. I have not updated the interior sub addActions as that code isn't even being ran yet, it's the SUPPORTS code that is being ran. I'm confused as I have defined the variable _show in the passing of the variables with execVM: (There are 13 variables in need of definition. 0-12. I have defined those variables.
  9. Perhaps I'm still confused. I removed the " from the _myVariables. I'm trying to understand what you mean Crazy_Man. So I have some questions. What is the purpose of the _caller variable? what does the _caller variable mean? And how is it helpful? My problem is that the variables(objects in the game) are not being passed to the sub addActions. Thus they don't have the definitions defined in the .sqf script. If someone could explain to me how the _caller/_player variables somehow pass the definitions onto the scheduled tasks scope that would be helpful. I think I'm just missing something in my knowledge about how this works. More Specifically: //variable define for schedule task _myVariables = ["_activate","_show","_hide","_player","_slingloadgroup","_trashloc","_slingloadhelortb","_vehiclesupplyloc","_supplyloc","_cargonetloc","_technicalloc","_truckloc","_repairloc"]; //How does this... //start action menu _activate = false; slingloadmain = _player addAction [ "SUPPORTS", { params ["_target", "_caller", "_actionId", "_myPassedVariables"];//..Move over here in a different scope? The previous definitions are in a different scope, does this just move the definitions into the next scope? Doesn't this code already not have a reference in the new scope as it hasn't yet been run until the player selects "SUPPORTS"? _myPassedVariables params ["_activate","_show","_hide","_player","_slingloadgroup","_trashloc","_slingloadhelortb","_vehiclesupplyloc","_supplyloc","_cargonetloc","_technicalloc","_truckloc","_repairloc"];//And what does this do exactly? _player removeaction slingloadmain; _activate = false; slingloadback = _player addAction [ ... .. . I have tried: -However it is stating "Undefined variable _myVariables" or -"Undefined variable _myPassedVariables" I have just read the params Wiki and I see what you guys are saying. However, it misses the point of the script as I understand it. By defining new params inside an addAction, it is not transferring the definitions I'm giving it in the editor via: nul = [slingloadactivate,heloslingloadtakeoff,supplyhelolanded,player1,slingloadhelogroup,trashloc,slingloadhelortb,vehiclesupplyloc,supplyloc,cargonetloc,technicalloc,truckloc,repairloc] execVM "1slingload1.sqf"; Those parameters are passing to the .sqf, however they are not passing through to the addAction. Am I misunderstanding something?
  10. Thank you for helping me out. Could you be more specific Crazy_Man? I'm not sure what your instructions are.
  11. Thank you for the tip about the spoiler code. 🙂 Does that addAction parameters pass the variables in the .sqf on to the addAction? Like does it pass those variables to the addAction scope? the variables defined in the .sqf to the addAction scope? Update: It didn't work, perhaps i did it wrong? it is saying undefined variable _player after i select "SUPPORTS" which indicates it seems to have done nothing? here's the lines affected: //variable define for schedule task _myVariables = ["_activate","_show","_hide","_player","_slingloadgroup","_trashloc","_slingloadhelortb","_vehiclesupplyloc","_supplyloc","_cargonetloc","_technicalloc","_truckloc","_repairloc"]; //start action menu _activate = false; slingloadmain = _player addAction [ "SUPPORTS", { params ["_target", "_caller", "_actionId", "_myPassedVariables"]; _myPassedVariables params ["_activate","_show","_hide","_player","_slingloadgroup","_trashloc","_slingloadhelortb","_vehiclesupplyloc","_supplyloc","_cargonetloc","_technicalloc","_truckloc","_repairloc"]; _player removeaction slingloadmain; _activate = false; slingloadback = _player addAction [ ... .. .
  12. TexasRussian

    [Co-Op(16)/SP] Operation Treefrog

    Thanks Johnny! I've been making missions for years now. For some reason I've never posted my missions here. 🙂 Would love some feedback whenever is convenient ^_^
×