Jump to content

Dj Rolnik

Member
  • Content Count

    143
  • Joined

  • Last visited

  • Medals

Everything posted by Dj Rolnik

  1. Wow, this looks exactly like what I need! I will check this out today, thanks! Confirmed - works like a charm!
  2. Hey all, Apologies if this has been answered already, but I cannot seem to find it anywhere. I am curious to know if there is any possibility to allow players to place objects on the ground mid-mission. The reason for that is that I am planning to make a checkpoint control mission and was thinking of potentially giving players an option to place bar gates by themselves, similar to bunkers or some sandbags. That would simulate them building a few elements of the checkpoint and placing the objects in the way they want it. Potentially done by an addAction maybe? I appreciate if the effort is not worth it - I am just curious to know if that's even possible by any means that would provide a nice and relatively fluent experience without having to tweak the object for 10 minutes. Thanks all :) Adam
  3. Hey guys, I am having some trouble with and IF command. What I want to do is make a script behave differently depending on several conditions. If one specific action takes place -> follow the script bit that is only under this IF If the other action takes place -> follow the other route etc, etc... I managed to get something like this to work but am struggling with one thing (my suspicion is that I placed the waitUntil command in a wrong place but can't quite tell). Basically the second condition triggers properly and it nicely ignores the hints that I placed in the first route but it does not seem to be ignoring the sleep commands that are placed in between the hints. The second IF command triggers after the sleeps from the first command have fired even though I have not triggered the first IF. It looks something like this: case "enter": { OutputText = InputText; waitUntil { if (((OutputText isEqualTo "361") && (name z == name z))) then {hint "Logging into the system"}; closeDialog 0; InputText = ""; sleep 1; true }; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Logging into the system."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Logging into the system.."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Logging into the system..."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Shutting down."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Shutting down.."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Shutting down..."}; sleep 1.5; [terminal1,0] call BIS_fnc_dataTerminalAnimate; deleteVehicle box1; if !(OutputText isEqualTo "361") then {hint "bad2."}; closeDialog 0; InputText = ""; sleep 2; Thanks a lot for any help - been trying to get this to work for a few days now and still cannot find a solution :( Adam
  4. Problem solved. Managed to get some help from @Larrow who kindly agreed to do a bit of scripting for me - gotta learn that myself sooner rather than later. Thanks everyone for posting suggestions - means a lot to me as even though I'm not fluent in scripting, I feel I want to learn in a bit more now :) Thanks again! Adam
  5. Hey all, I haven't gotten to it for a while as I was pretty busy, but got some time today and tried to work something out with the solution provided by @Grumpy Old Man. Unfortunately I failed. I seem to be unable to figure out how to implement this code into the script I have. When I use the code the keypad dialog seems to break completely. I know I am asking for a lot but I feel that there is no way I can do it myself so maybe some kind soul would be able to take a look at the attached mission I am planning to make - maybe you can figure out how to incorporate the many ifs into the dialog script. I genuinely appreciate any help but will understand if noone wants to do it by himself - that's fine, I know I am asking for a lot. So just a recap on what I need: (There is a bit of code that was included with the dialog script I downloaded. I only tried to add the many ifs into the script) (The hacking of the terminal is supposed to fail irrespectively of whether the code is correct or not but only with slightly different results - it's a "decoy" terminal) - I need to allow the hacking option to appear only for one player, the hacker - in this case called "z") (SEEMS DONE) - I need the terminal to have the "Hack" action (DONE) - I then need it to prompt with the "Open Keypad" action (DONE) - I need it to launch the first scenario if the code input after pressing "Enter" equals "361". [hacking begins and progresses until a given percentage, and then shuts down] (SOMEWHAT DONE) - I need it to launch the second scenario if the code input after pressing "Enter" does not equal "361". [hacking fails immediately and shuts down] (NOT DONE) - I need it to launch the third scenario (basically waiting for the first or the second scenario to take place) if the code input after pressing "Enter" equals nothing (no input on the keypad, just pressing "Enter"). (NOT DONE) - I need the Terminal to lose all actions after either the first or the second scenario have taken place (NOT DONE) Preferably, I would like to keep the hint structure that I have in the AF_KP_fncs file. I know there are better ways to write the script and display the hints but what is there right now seems to work just as I need it to without too many complications. So again, all comes down to putting the correct "IF" functions in the correct places within the script which I seem to be incapable of doing... https://www.dropbox.com/s/yd6j1f6d3hp90jt/dialog.Altis.zip?dl=0 Thanks again for all the help, Adam
  6. Wow, that's comprehensive. I was slightly worried that it was going to end up being much more complicated than I originally assumed. Will try it nevertheless. Hope that it works with the dialog keypad without problems. Will get back here with the results. Cheers! Adam
  7. Hey, Thanks for both of your suggestions. I will try them out as soon as I can when I get back home. A preemptive question tho. If those work, how can I add several actions as part of one result? For instance, if we take the solution provided by @Grumpy Old Man, and use this as an example: if (parsenumber _outputOrWhatever isEqualTo 361) exitWith {hintsilent "Good."}; Can I add separate lines for subsequent hints separated by sleep, so that, in this case, the hints would signify the progress happening when hacking the terminal? Rough guess: if (parsenumber _outputOrWhatever isEqualTo 361) exitWith {hintsilent "Good."}; sleep 1; {hintsilent "Good1"}; sleep 1; {hintsilent "Good2"}; etc? I am worried that if the script is written like this, the sleep commands will still be picked up even if I do not trigger that particular IF. Cheers, Adam
  8. Let's simplify the hints a bit for the sake of this thread: If the code used by the hacker equals 361 then the script should show the hint "GOOD" If the code does not equal 361 but also does not equal nothing ("") then the script should throw hint "BAD" and close the terminal If the code equals nothing ("") then the script would have to wait until either of the two above happens.
  9. Hey, I am a novice at scripting, I agree - that is why I am asking for any help. Hard to learn having to tear bits of knowledge from people on various forums and youtube videos. I do realise that there are flaws with the script so if that is possible I would really appreciate someone who could suggest a better solution or at least help me understand how to improve this. By the way, these are not the same hints - these are written as to simulate a progress happening (the dots at the end). The true at the end of waitUntil is there due to Killzone's suggestion: https://community.bistudio.com/wiki/waitUntil Cheers, Adam
  10. Dj Rolnik

    AirFell's Keypad

    Hey, Coming back to this thread with the hope of finally finding an answer :) I am making a mission in which a hacker is supposed to hack a data terminal and has two (actually three) outcomes. I managed to modify that bit of code from the keypad as I needed a few options the script would go. Basically, depending on whether a hacker input a proper code, an improper code or no code at all, and pressed "enter", the script would either: continue with the first If argument and succeed, fail immediately and shut down the terminal triggering an alarm, or do nothing when there's no code input and wait for either the first or second scenario to occur. Stumbled upon another issue (because why not..?) For some reason the if command does not seem to be ignoring sleep. This is the script: case "enter": { OutputText = InputText; waitUntil { if (((OutputText isEqualTo "361") && (name z == name z))) then {hint "Logging into the system"}; closeDialog 0; InputText = ""; sleep 1; true }; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Logging into the system."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Logging into the system.."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Logging into the system..."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Shutting down."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Shutting down.."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Shutting down..."}; sleep 1.5; [terminal1,0] call BIS_fnc_dataTerminalAnimate; deleteVehicle box1; if !(OutputText isEqualTo "361") then {hint "bad2."}; closeDialog 0; InputText = ""; sleep 2; Please ignore all the other issues with it for now. What is bugging me is why does the second ifcondition perfectly omits the hints and the other "subifs" when triggered but includes the sleep commands in between them? This results in the second if appearing after the sleeps from the first condition have passed even though I have not triggered the first if. Effectively if I put sleep 50 only in the first if, then the second if would appear 50 seconds later as well no matter which of those two I trigger.. Thanks, Adam
  11. Feels kind like I'm writing to myself, but hoping someone notices and helps me with it. Stumbled upon another issue (because why not..?) For some reason the if command does not seem to be ignoring sleep. This is the script: case "enter": { OutputText = InputText; waitUntil { if (((OutputText isEqualTo "361") && (name z == name z))) then {hint "Logging into the system"}; closeDialog 0; InputText = ""; sleep 1; true }; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Logging into the system."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Logging into the system.."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Logging into the system..."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Shutting down."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Shutting down.."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Shutting down..."}; sleep 1.5; [terminal1,0] call BIS_fnc_dataTerminalAnimate; deleteVehicle box1; if !(OutputText isEqualTo "361") then {hint "bad2."}; closeDialog 0; InputText = ""; sleep 2; Please ignore all the other issues with it for now. What is bugging me is why does the second if condition perfectly omit the hints and the other "subifs" when triggered but includes the sleep commands in between them? This results in the second if appearing after the sleeps from the first condition have passed even though I have not triggered the first if. Effectively if I put sleep 50 only in the first if, then the second if would appear 50 seconds later as well no matter which of those two I trigger.. Thanks, Adam
  12. Okay! I managed to get it to work almost entirely. I have written this (shortened hint version just to get the example): switch (_this select 0) do { case "number": { InputText = InputText + format["%1", _this select 1]; ctrlSetText[1000, InputText]; }; case "clear": { InputText = ""; ctrlSetText[1000, ClearText]; }; case "enter": { OutputText = InputText; if (OutputText isEqualTo "361") then {hint "logging in..."}; closeDialog 0; InputText = ""; sleep 1; if (name z == name z) then {hint "Logging into the system."}; sleep 1; [terminal1,0] call BIS_fnc_dataTerminalAnimate; deleteVehicle box1; if !(OutputText isEqualTo "361") then {hint "login failed"}; closeDialog 0; InputText = ""; sleep 1; if (name z == name z) then {hint "Unauthorized login detected..."}; sleep 1; [terminal1,0] call BIS_fnc_dataTerminalAnimate; deleteVehicle box1; }; }; And it looks like it's working just as I needed it to. The only problem left that I see is that the script continues to show hints even if the player has not input the code in. I figured I need to use the waitUntil command but don't know where to place it. Could anyone advise on this please? I would be very grateful. Thanks a lot, Adam
  13. Hey, I still have not found a working solution although I think I know how this can be done. This is the script of the keypad: //This checks the variables passed in the execVM statments("number","enter" or "clear") switch (_this select 0) do { case "number": { InputText = InputText + format["%1", _this select 1]; ctrlSetText[1000, InputText]; }; case "clear": { InputText = ""; ctrlSetText[1000, ClearText]; }; case "enter": { OutputText = InputText; hint format["Keycode is %1", OutputText]; closeDialog 0; InputText = ""; }; }; If I could insert a criteria checking the number input by the hacker with the use of isEqualTo or maybe switch do it would allow me to branch out the scenario into two results - fail and pass. I would then continue the script (the logging in hints, hacking progress hints + the eventual closure of the terminal) in the keypad script. I tried to add the exemplary line if (_arr1 isEqualTo _arr2) then {hint "Arrays match!"} after the case "enter" from above but it does not seem to be working. Do you think this is achievable using this method? Any assistance will be very helpful. Cheers, Adam
  14. Hey guys, Thanks for your replies. I have tried a couple of those things, one of them was the keypad (nice find @Josef_!) - it seems to be working just as I needed to so I would like to stick to this solution. I have a laptop/tablet which shows the code when interacted with - awesome. Now I have added this to the terminal script: _object = _this select 0; _caller = _this select 1; _id = _this select 2; _object removeaction _id; [_object,3] call BIS_fnc_dataTerminalAnimate; sleep 3; _object addAction["Open Keypad",{createDialog "AF_Keypad";}]; Quite neatly the second addaction appears and the keypad does as well. At this point I will need a couple of modifications: - if the hacker inputs the appropriate code, then the script proceeds to the "Logging into the system" part and then as previously, continues until failing and triggering an alarm. - if the hacker inputs the improper code, the terminal shuts down with the hint "Unauthorized login detected..." and triggers an alarm. I should point out that I would like the hacker to perform a few simple mathematical calculations outside of the game which in simple terms means that in order to log into the terminal he has to input a code different than the one found on the tablet - The one from the tablet is a point of departure for the calculations. Obviously, the final code to be placed in the keypad would be fixed and set by me somewhere in the script, so basically the script would have to compare whether the code input by the hacker is correct - if yes - proceed; if not - shut down. @Grumpy Old Man I found this script somewhere and oddly enough it seems to work. I was actually thinking that it may be wrong but I was surprised. If I'm wrong, would you be so kind to describe what are the variables that are checked by that string, i,e, what are the X and Y values supposed to be? I understand that this string checks if the player X equals player Y but then what should I put in the X field? if (x == y) then {hint "Logging into the system..."}; Also, I presume that the hintsilent function basically shows the hint only to whoever triggers it, am I correct? Thanks again! Adam
  15. Dj Rolnik

    AirFell's Keypad

    Oh God... I had to download a separate tool for handling pbo files. At first I was unaware that you can do that even which is why I misunderstood the instructions. Cheers for clarifying that.
  16. Dj Rolnik

    AirFell's Keypad

    Yes I have and I see no obvious information stating the location of the folder. There is only the pbo. Am I missing something?
  17. Dj Rolnik

    AirFell's Keypad

    Hey all, Sorry if I'm being stupid or what but where is the "folder" that we are supposed to put in the mission directory? I cannot seem to find the download either on armaholic, nor here, nor on steam. It just downloads a .pbo and that's it. On steam workshop it downloads something but I cannot find it anywhere... Any help? Cheers, Adam
  18. Dj Rolnik

    Drag Dead Body Script

    Hey, I have noticed a small issue with the script. It appears that everything works fine up to the point where a player uses a virtual arsenal. I have created a scenario, assigned a virtual arsenal script to one of the boxes, applied the script and launched. After launching the mission I can drag bodies normally but if I enter the Virtual Arsenal and quit it, the option to drag bodies disappears. Not sure if this thread is dead or not, but worth a shot! Cheers, Adam
×