Jump to content

militarypolice

Member
  • Content Count

    26
  • Joined

  • Last visited

  • Medals

Everything posted by militarypolice

  1. Hello! I have 2 questions. One is a request of the sorts and another is help with a function. 1. I would like to create a script that will keep a popup target up until 2 hits are achieved. I know it would require "Hit" event handlers. But I do not know how to work with Event Handlers yet. I've done it once before, but was a long while ago. Any direction on that, would be great. I'm sure I can figure it out, I just need some help with a foundation! 2. I'm using BIS_animateMoveSmooth to create a smooth movement of popup targets. In single player it works just fine and is smooth. But, in multiplayer it does not work at all, well the animation doesn't play. I click the button to move a target closer and it's like it plays the animation on the server, but not to the clients. Once it seems like the animation is done on the server it then teleports the target to the right place for everyone, including the person who selected the button. I wonder if I need to execute it via a remoteexec? Below is the block of code I am using: call{this addAction ["Move 0m", "[l3t, [l330m, l30m]] spawn BIS_animateMoveSmooth;"]; this addAction ["Move 35m", "[l3t, [l330m, l320m]] spawn BIS_animateMoveSmooth;"]; this addAction ["Move 30m", "[l3t, [l30m, l330m]] spawn BIS_animateMoveSmooth;"];} Name of the target is "l3t" and it then moves to a rail that is named "l330m" or "l320m" etc. Any help on this would be greatly appreciated as well!
  2. Sorry about that! Its been a long week... But, thank you all for your help! For now this is fine and working! I've learned a lot and will try to implement things I've learned and continue to learn in the future!
  3. If you'd like to take a look at the mission file: http://www.575th.com/public/(U)_S3_Missions_PopUp_Target_Test.VR.rar Also, in the remoteexec call, using [0,-2] works the best. It goes half way down, but then comes back up waiting for the second shot. But in single player, it doesnt go down until after the 2nd shot. Do you think this is a MP issue?
  4. I did not. But I just added the first block of code on that page. Ill test it in a second and let you know!
  5. So, I tried it with _x: _types = ["TargetP_Inf4_F"]; for [{_i=0},{_i < (count _types)},{_i=_i+1}] do { _targets = getMarkerPos "target" nearObjects [_types select _i, 30000]; if (count _targets < 1) exitWith { systemChat "No Enemy were found."; //exit if no targets have been found }; {[_x, "scripts\apply_EH.sqf"] remoteExec ["execVM", _x];} forEach _targets; }; and it did not work and went back to as if it was "2".
  6. I will try that! Quick question, so the Event handler doesn't stick if the "Enable Damage Button" in specials properties is checked. I was running through a program in single player and over time, the popup target was destroyed because of how many rounds was being used. I have a bunch of people who will be using these popup targets. To combat this, what we've done, is to just have Simulation on and have Damage off for popup targets. Is there a way to get the script to run while damage is off? I will try the _x option right now and let you know!! Also, seriously, thank you for your help! this is awesome!
  7. Okay, the code for the hits works! But it still doesnt work in Dedicated Servers. I tried with just "2" and I tried with "[0, -2] select isDedicated,true". With "[0, -2] select isDedicated,true" the target would start to pop down and then half way through come back up for the second hit and once the second hit it would stay down. Also, it was very hit or miss, like it wouldnt do it for all targets. Just randomly some. But with just "2" it would not work at all. This is the code I am using to put the remoteexec on every target needed (This is ran in the init.sqf file): _types = ["TargetP_Inf4_F"]; for [{_i=0},{_i < (count _types)},{_i=_i+1}] do { _targets = getMarkerPos "target" nearObjects [_types select _i, 30000]; if (count _targets < 1) exitWith { systemChat "No Enemy were found."; //exit if no targets have been found }; {[_x, "scripts\apply_EH.sqf"] remoteExec ["execVM", [0, -2] select isDedicated,true];} forEach _targets; }; I think we are getting closer!
  8. Okay, so everything works in SP and Hosted Multiplayer. But it doesn't work with Dedicated Servers. Do you know how I could fix that? This is how I am getting it to all of the Pop-up targets that need it: _types = ["TargetP_Inf4_F"]; for [{_i=0},{_i < (count _types)},{_i=_i+1}] do { _targets = getMarkerPos "target" nearObjects [_types select _i, 15000]; if (count _targets < 1) exitWith { systemChat "No Targets were found."; //exit if no targets have been found }; {if !(local _x) exitWith {}; _x addEventHandler ["Hit", { private _hit_num = 2; private _down_time = 0.1; params ["_unit"]; private _phase = _unit animationPhase "Terc"; if ( _phase isNotEqualTo 0 ) exitWith { }; private ["_dummy"]; private _hit_already = _unit getVariable ["saro_hit_num", 0]; if ( _hit_already < _hit_num - 1) exitWith { _unit setVariable ["saro_hit_num", (_hit_already + 1) ]; _dummy = _unit spawn { sleep diag_deltaTime; _this animateSource ["Terc", 0]; }; }; _dummy = [_unit, _down_time] spawn { params [ "_unit", "_down_time" ]; private ["_phase"]; private _down_start = 0; sleep diag_deltaTime; waitUntil { _phase = _unit animationPhase "Terc"; if ( _phase isEqualTo 1 && _down_start isEqualTo 0 ) then { _down_start = diag_tickTime }; _unit animateSource ["Terc", 1]; _down_start > 0 and (diag_tickTime - _down_start) > _down_time }; _unit setVariable ["saro_hit_num", 0]; }; }];} forEach _targets; }; This is placed in the init.sqf file. Any ideas?
  9. Okay! I've gotten it figured out! I tried spawn, execVM and call and compile file routes. I do admit, I'm not 100% understanding of the variables. I'm a PowerSheller and understand variables and scoping very well. But, when it comes to arma, I guess I second guess myself.. But, what I've done, is created a foreach loop in the init file with your script: _types = ["TargetP_Inf4_F","Land_TargetEpopup"]; for [{_i=0},{_i < (count _types)},{_i=_i+1}] do { _targets = getMarkerPos "target" nearObjects [_types select _i, 500]; if (count _targets < 1) exitWith { systemChat "No Enemy were found."; //exit if no targets have been found }; {if (isServer) then { _x addEventHandler ["Hit", { private _hit_num = 2; private _down_time = 0.1; params ["_unit"]; private _phase = _unit animationPhase "Terc"; if ( _phase isNotEqualTo 0 ) exitWith { }; private ["_dummy"]; private _hit_already = _unit getVariable ["saro_hit_num", 0]; if ( _hit_already < _hit_num - 1) exitWith { _unit setVariable ["saro_hit_num", (_hit_already + 1) ]; _dummy = _unit spawn { sleep diag_deltaTime; _this animateSource ["Terc", 0]; }; }; _dummy = [_unit, _down_time] spawn { params [ "_unit", "_down_time" ]; private ["_phase"]; private _down_start = 0; sleep diag_deltaTime; waitUntil { _phase = _unit animationPhase "Terc"; if ( _phase isEqualTo 1 && _down_start isEqualTo 0 ) then { _down_start = diag_tickTime }; _unit animateSource ["Terc", 1]; _down_start > 0 and (diag_tickTime - _down_start) > _down_time }; _unit setVariable ["saro_hit_num", 0]; }; }];};} forEach _targets; }; this way, I can control which targets are need to be hit multiple times and which ones do not. This route also doesnt touch the SQM file size either! Let me know if you approve of this method? or if there is a better method?
  10. Okay, so I did some playing around! I removed: _unit animateSource ["Terc", 0]; from the script and now the program works and when they pop back up and it takes 2 shots to put the target back down!! So, the only thing now, is to make something where the it can be executed via spawn or execVM with a oneliner as I will likely have hundreds of popup targets that will use this in my Training Map! That will make administration easy and will cut down on the SQM size!
  11. So this did work! Thank you very much for your time and interest!! But, I'm seeing that if I want to create a shooting drill program, for targets to popup, it loses the hit event handler when they popup again. So I have a program to select random targets and pop them up. The init.sqf file has nopop = true; within it. I removed: _dummy = [_unit, _down_time] spawn { params [ "_unit", "_down_time" ]; private ["_phase"]; private _down_start = 0; sleep diag_deltaTime; waitUntil { _phase = _unit animationPhase "Terc"; if ( _phase isEqualTo 1 && _down_start isEqualTo 0 ) then { _down_start = diag_tickTime }; _unit animateSource ["Terc", 1]; _down_start > 0 and (diag_tickTime - _down_start) > _down_time }; _unit animateSource ["Terc", 0]; _unit setVariable ["saro_hit_num", 0]; }; }]; from your script as it seemed to be popping up the target regardless of having nopop=true; within the init.sqf. The script I created for the shooting drill is this: sleep 1; _target = selectRandom [t1,t2,t3,t4,t5,t6,t7]; _target animate["terc", 0]; _target = selectRandom [t1,t2,t3,t4,t5,t6,t7]; _target animate["terc", 0]; sleep 4; execVM "alldown.sqf"; (alldown.sqf just pops all targets down) That just runs when someone selects it from a computer via addaction. Add and take away when you want more then one target to popup. So, before running the program, multiple hits work and the targets do not go down unless the 2 hits are achieved. But once I run the program, it goes back to one hit. Any ideas?
  12. Any help would be greatly appreciated! I found some scripts throughout Google, but I assume something has changed in the backend as those scripts do not work anymore... I am kinda desperate as I've been reading and reading and testing and testing and am just failing lol... I've been looking for something that can accomplish multiple hits on a popup target for a very long time! A tutorial on how to create Hit MPEventHandlers or something would help too! I'm totally not trying to have someone do this for me. I would much rather learn, I just need to be pointed in the right direction! Thanks!
  13. Hello, I'm making a shoothouse and need the targets to pop down after 2 hits. I found a script on https://www.ofpec.com/forum/index.php?topic=32607.0;all and it does work in SP and on a Client Hosted Server. But, it does not work on a dedicated server. The script needs "nopop" to eq true. So, in the init.sqf of the mission nd initserver.sqf I put "nopop = true". Though nopop is a global variable it seems that this script thinks that nopop is false? Can someone take a look and let me know? Or teach me how to create a global variable? Or is it possible to create a version of this for MP use? I modified the script to be two round hits before the target goes down. This is in the init of each popup target: if (!isDedicated) then {this addEventHandler ["Hit", {[_this, 2, true] execVM "AdvancedPopUpTarget.sqf"}];}; I added the If statement. Originally, it does not have an If statement. Original this addEventHandler ["Hit", {[_this, 2, true] execVM "AdvancedPopUpTarget.sqf"}]; Here is the script (Credit should go to Worldeater): #define ERROR_NOPOP hint str(__FILE__ + "\n\nERROR:\nThis script requires the global variable nopop to be true") if isNil("nopop") exitWith { ERROR_NOPOP }; if not nopop exitWith { ERROR_NOPOP }; _eventInfo = _this select 0; _requiredHits = _this select 1; _stayDown = _this select 2; _target = _eventInfo select 0; if (_target animationPhase "terc" > 0) exitWith {}; _hitCount = _target getVariable "HitCounter"; if isNil "_hitCount" then { _hitCount = 0 }; _hitCount = _hitCount + 1; _keepUp = true; if (_hitCount == _requiredHits) then { _hitCount = 0; _target animate ["terc", 1]; sleep 3; _keepUp = not _stayDown; }; if _keepUp then { _target animate ["terc", 0]; }; _target setVariable ["HitCounter", _hitCount]; Again, i do not take credit of the script, just wanted to give anyone willing to help an idea of what I am trying to do. If we can create a completely new script, I am all game for that as well! Thanks for the help!
  14. militarypolice

    No entry 'bin\config.bin/CfgWeapons.Single'.

    I confirm this works as well. My unit has been doing this since Arma 3 came out and using mods. You get used to it after a while.
  15. So, I'm just wondering before I give up on it, why do you guys think the mission can no longer find the objects? Nothing has changed in the environment. Only the 1.62 update. I now get No entry 'bin\config.bin/CfgWorlds.j198_ftb' but the .exe hasn't changed (for mod parameters) and it worked before. I was getting a lot of Land_wgl_ issues saying that wgl objects doesn't exist, so I removed all of wgl objects (29 Palms Map). I fix it up and put it back on the server and now I get No entry 'bin\config.bin/CfgWorlds.j198_ftb' as the only issue as to why it wont run. I get on the server and I can get to player slot selection. Server loads the map then No entry 'bin\config.bin/CfgWorlds.j198_ftb' kicks right back to player slot selection. This is ONLY on dedicated servers. I can run a client hosting session, and it all works fine, as well as in Single Player. But when I go to dedicated it starts to break. I'm running the latest version of CBA on both client and server same for CUP_Terrains as well. I'm lost now. I just need suggestions from some who maybe more knowledgeable then me. Thanks.
  16. I know how to set up a Server. Thats not what I'm asking; I know the community is tired of the question. So the question... My Server was up and running all was fine on Monday (20140623) as well as Tuesday (20140624) But Wednesday its down, Now its down. I think the router changed the IP so I check that, ipconfig, yes it did change the IP No problem right? Nope, wrong..... I go into the router and the Ports are no longer there, So I re-add them with the new IP, 2300 - 2305 UDP 8766 UDP (So you know I did try 2302 to 2305 like it is recommended in the dedicated server thread). When Gamespy was up I didn't have to open ports and what not so I didn't (A2CO and A3), works just fine. Gamespy goes away, Open ports, works just fine. IP Changes, Life ends. I have restarted the Router and nothing. I have Downloaded the Arma 3 Server tool from steam, No Joy. I have done the SteamCMD way, No Joy. Does all the information I have given seem correct? Any input on this would be greatly appreciated. Thanks.
  17. Never Mind I resolved the problem. Thanks for the help tho.....
  18. Alright my Question is, is there a way to set a box full of ammo with set ammo capacity? I understand the code for setammo but that is for a currently loaded magazine I need it to be a box people can go in and grab a half empty magazine and what not. any help on this matter would be very appreciated. Thanks.
  19. militarypolice

    setammo Script need help!

    Thank you so much, thought no one was going to reply to it ill test it. Thanks. ---------- Post added at 08:58 PM ---------- Previous post was at 08:35 PM ---------- Alright I ran in to a problem how do I call the script?
  20. I really want my Unit to use this system it will greatly help with My Forward Observer guys (FO) I have for the unit. If you would can you tell me how to adjust the range manually (Or am I doing it the right way anyway) until you fix it permanently if you fix it that would be nice. Thanks, R. Bruce, USA Major 42nd Air Assault Regiment Executive Officer
  21. Has anyone got this working with TFAR yet? Or how do I get it to work with TFAR I did the script thing "dtaRadioTypes = ["ItemRadio","tf_rt1523g","tf_mr3000","tf_anprc155"] to try to get it to work am I doing something wrong or does it just not work with TFAR?
  22. militarypolice

    XLib - by X39

    I don't if I'm doing something wrong. When I have a description.ext in the mission it seems to not work. but when i have not scripts and its just the module and the player it seems to work fine. Am I doing something wrong or have you not implemented Multi player yet? ---------- Post added at 08:03 PM ---------- Previous post was at 07:52 PM ---------- Nevermind it was just lagging on my client it works. Good To go and thanks for the Module!
  23. militarypolice

    XLib - by X39

    Alright, yea I think that was it I wasn't Running Dev Build. My Unit will switch to the most up to date version once it is release. But thanks for the Hard work and quick reply. Thanks, R. Bruce, USA Major 42nd Air Assault Regiment Executive Officer
  24. militarypolice

    XLib - by X39

    Alright So I want to get my Unit to test this but something is going on with the insurgency module. I can get the Opfor Units to despawn on load up but when i get in the distance to make them spawn they do not. Am I suppose to Sync the units to the Module or the module to the units or does it not matter and does it work with maps in A3MP? or do I have to stick with Arma 3 Maps. Im not using All in Arma as well, just the A3MP also, does it work with Addon Units or do I have to use the Default units that came with the game. As well I am using Single Player to test at the moment I don't have anything in Headless client section what am I suppose to put there? Your Wiki didn't give much information about this I did everything step by step from the wiki and the Info given by the module and it seams to not work. I really want my Unit to start using this so any awsner on how to fix this would be most appreciated and good system by the way. Thanks
×