Jump to content

gokitty1199

Member
  • Content Count

    311
  • Joined

  • Last visited

  • Medals

Everything posted by gokitty1199

  1. gokitty1199

    Door Locks on Buildings in MP

    i had that issue a week or so ago as well, after testing it seemed that when you set the door in the editor, it is not done globally (for example, door SetVariable ["bis_Disabled_Door_1", 1, false] is what its doing locally where as it needs to do door SetVariable ["bis_Disabled_Door_1", 1, true]). so what you can do is in the init of the building NumberOfDoors = GetNumber(ConfigFile >> "CfgVehicles" >> (typeOf this) >> "numberOfDoors"); if(NumberOfDoors <= 0) exitWith {}; for "_i" from 1 to NumberOfDoors do { this SetVariable[Format["bis_disabled_Door_%1",_i], 1, true]; }; edit sorry didnt see the above post, was tabbed out for a bit before writing
  2. gokitty1199

    Switch sides on Trigger

    thats strange, i would like to step get an exact explanation on what you want from it as well as watch it/try stuff live to figure out where something wrong is happening if you dont mind. discord: [GH] Cody#9273
  3. it would go in your initserver so that way the script never has to touch the client so the server is doing all the work and simply telling the clients with a message when a civilian is killed (i try to keep everything off of the client unless its necessary or crucial to performance)
  4. gokitty1199

    Delete Blufor via trigger

    did you remove the comments before pasting it into the trigger in the editor? you cant have //comments in the trigger
  5. gokitty1199

    Switch sides on Trigger

    im sorry i never got a notification that you replied. this gets added to the activation of the trigger (wasnt tested before so ill try it on my end and fix it) EDIT: the errors were because of the comments //comment being used inside of the trigger and apparently JoinAsSilent does not work on civilian units, so i changed up the script to use JoinSilent instead. this goes in the activation of the trigger { _Grp = CreateGroup [east, true]; _Arry = [_x]; _Arry joinSilent _Grp;//because joinSilent takes in an array instead of individual units hint str (Side _x);//remove this, but this shows you the side of the unit(test it yourself) after changing sides, will be EAST _x AddEventHandler ["Killed", { params ["_unit", "_killer", "_instigator", "_useEffects"]; _Grp = CreateGroup [civilian, true]; _Arry = [_unit]; _Arry joinSilent _Grp; hint str (Side _unit);//remove this, but this shows you the side of the unit(test it yourself) after dying, will be CIV }]; } ForEach (thislist Select {IsPlayer _x && Side _x != EAST});//for all units that are players and civilians
  6. about the cleanest way i could think of that is also universal. if you have more civilian AI spawning later in the mission that you want the message to be displayed when they are killed, you can simply run this script again and it will add it to the new civilian units without adding a second killed event handler to the civilian AI that already have one. ONLY run this on the server, there is no point in this running on the client so put it in initServer.sqf or call it from the server only { _Unit = _x; //if the unit has an event handler ID already assigned to them then _EHID will NOT be -1. _EHID = _Unit GetVariable ["KilledEHID", -1];//-1 is the default value if the variable KilledEHID is not found if (_EHID == -1 ) then {//if the unit does not have the event handler _EHID = _Unit AddEventHandler ["Killed",//add a killed event handler to the unit { params ["_Unit", "_Killer", "_Instigator", "_UseEffects"]; //when the unit is killed, RemoteExec(execute a hint on all players including the server) [Format["Player %1 killed a civilian", Name _Killer]] RemoteExec ["Hint", 0, true]; //output would be(with your name) Player GingerAsianBond killed a civilian }]; //since the unit now has an event handler, lets set KilledEHID to equal the ID of the event handler - //so it does not get added twice to the same unit incase you need to run this command again in a loop - //or for newly spawned civilians. _Unit SetVariable ["KilledEHID", _EHID, false]; }; // only loop through the units who are civilian and not players } ForEach (AllUnits Select {Side _x == Civilian && !(IsPlayer _x)});
  7. gokitty1199

    Delete Blufor via trigger

    should be able to, if your doing it in the trigger itself, consider using thislist instead of inareaarray
  8. gokitty1199

    Delete Blufor via trigger

    Deletes blufor units and blufor vehicles inside of Trig1 _BluforInTrig = (AllUnits + Vehicles) InAreaArray Trig1;//gets all units and vehicles inside of Trig1 { if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _x) >> "side")) == 1) then//gets side of _x(unit or vehicle) { DeleteVehicle _x;//if the side is West(1 is equal to West/blufor in this case) then delete it }; } ForEach _BluforInTrig; heres the number equivalent for sides https://community.bistudio.com/wiki/CfgVehicles_Config_Reference#side
  9. I have noticed (for me anyways) that creating a while loop on the server and increment a variable(time) does not seem to be accurate when sleeping for very short durations such as UiSleep 0.008; I have a series of 5-7 timers around the map that a client can activate at his choosing. The time is a simple while loop that uses UiSleep to increment a variable that I have to keep track of how long the timer has been running for. While testing with just myself I noticed that having a while loop with a UiSleep of 0.008 and increment a variable by 0.008 is slower by different amounts each time. If i start a timer on my phone at the same time I start the timer in the game, when my phone reaches 60 seconds the timer can be either at 45 seconds or 58 seconds or anywhere in between. its just very inconsistent. In the COF challenges, how did BIS do their timers? Is there a way I can view the missions scripts to see how they did theirs? I just need my timers to be accurate. Here how my timer is running. while {!_StageFinished && !_StageDone} do { _TargetsDone = _Timer GetVariable "TargetsDone"; _TargetCount = _Timer GetVariable "TargetCount"; _StageDone = _Timer GetVariable "StageDone"; _ShooterName = str (_Timer GetVariable "CurrentShooter"); if (_TargetsDone < _TargetCount) then { _Time = _Time + 0.008; _Timer SetVariable ["TimerTime", _Time]; } else { //misc stuff that doesnt run until timer is finished }; UiSleep 0.008; };
  10. gokitty1199

    Switch sides on Trigger

    What im assuming is happening (correct me if im wrong), you made a trigger, when a civ player is detected it runs a script thats in your activation. If thats the case then player joinAsSilent [createGroup east, 5]; is running on every players machine which is forcing all players to become opfor. What you can do in the triggers activation, you can go through all the players that are inside of the trigger and use thislist(a list of everything inside the triggers activation) to make only the players that are in the trigger opfor. Now as for switching back to Civi when you die (im not 100% sure if this will work since you will be dead) is add an event handler "killed" to the player so when the player dies he is (hopefully) set back as a civ. so in the triggers activation put this. _x is the selected thing in thislist. think of thislist as an ice cube tray(an array) where each slot of the tray holds a unit or object ect. ForEach goes through that tray one slot at a time. Think of _x as the unit/object inside of the tray(like the ice cube). so if we have a tray(array) of players, then when we run ForEach on the array, the first time it runs _x is equal to the first ice cube(player) in that tray(array), then the second time it runs its on the second ice cube(player) in the tray(array). its like a loop for all filled slots in the tray. { if (IsPlayer _x) then //if the unit is a player { if (Side _x != east) then //if their side is not already opfor/east { _x joinAsSilent [createGroup east, true]; //then create an opfor group and join it _x AddEventHandler ["Killed", //then add an event handler to run when the player is killed { params ["_unit", "_killer", "_instigator", "_useEffects"]; _unit joinAsSilent [createGroup Civilian, true]; //that will create a civ group and join it }]; } }; } ForEach thislist; //run for everything inside the trigger if the respawning switch to Civilian doesnt work, post back and ill explain another method for you to try.
  11. I have a ipsc target that ive made in blender with AZone/CZone/DZone/BZone/AZoneHead for the areas of the target that I want a bullet to hit. For example, if I put a HitPart event handler on the object and a player shoots the DZone, then I want the selection array of areas hit to return DZone. So far the AZone/BZone/AZoneHead are working without issue and the HitPart event handler returns the array with the zone name correctly, however those are basic square/rectangle shapes. The CZone/DZone are where im really struggling, I have cut them up into pieces to avoid making them non convex shapes (they still might be), but the issue remains of me not being able to hit those zones in game(no collision). .blend: https://www.dropbox.com/s/8efbn8efzl5ry04/untitledNEW.blend?dl=0
  12. did you make sure to uninstall any old versions of the toolbox when installing 3.0.3?
  13. gokitty1199

    Setting Objects Mass?

    For testing Ive made a small square plate in blender, exported as FBX, imported to Object Builder, exported as p3d, setup the configs and such and got it in the game. Now im trying to understand collisions, from reading it seems I need a geometry mesh that I add mass to. I simply duplicated my mesh in blender and named it geometry, selected them both and exported as FBX and repeated the steps to load it into Object Builder. The problem is I cannot figure out how to set the geometry's mass. I press Alt + M to bring up the little mass window, but everything is greyed out so I cannot set a value for the geometry mesh. Im starting from square 1, never created(i know how to model) and imported a mesh for arma before so any misc tips would be great. Thank you.
  14. Im slowly starting to figure things out, however one thing I have been stuck on for about 2 hours is hit points. Can someone tell me their steps for making hit points? For example right now I have a single rectangle that is separated into 2 vertex groups (top/bottom), im trying to make it so when i shoot the top of the rectangle it hits the hit point Top and when i shoot the bottom of the rectangle it hits the hit point Bottom. next question (easier probably). I have a mesh that Im trying to set a few zones on to hit, the problem is only 2 of the 5 zones are actually detecting hits and the rest are not for some reason (as shown by the bullet holes in the image below) and I cannot figure this out for the life of me. UPDATE: fixed some of the zones after someone told me about not having non convex shapes however im still having the same issue, heres the new .blend https://www.dropbox.com/s/8efbn8efzl5ry04/untitledNEW.blend?dl=0
  15. First time using this exporter (along with modeling for arma), for testing Im just using the default cube in blender(2.80 with 3.0.3). I spawned the cube, set its LOD Type as Geometry, set its mass to 12kg and exported/brought it into the game. The mesh had collisions, but was not visible. Then i spawned another cube, set its LOD Type as View Geometry, selected both cubes and exported them again, brought them into arma and had the same result with no visible mesh but had collision. Im assuming from the name that View Geometry is the mesh that we would see correct? Edit: I changed the View Geometry to Custom, now in the game I can see the mesh, but I can walk right through it. Edit2: Figured it out, I needed to select Create Geometry Components for the geometry mesh and it is now working
  16. gokitty1199

    Setting Objects Mass?

    that looks very handy thank you! I have a question, i keep getting errors when exporting or trying to use misc features of the toolbox(2.80) in relation to an unknown file location. I set my 02Script path to C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\ObjectBuilder\O2Scripts is that correct? Heres my error for example when simply setting mass https://gyazo.com/e1f6963e3b8f0514975a219be9f6fbb1
  17. gokitty1199

    Inconsistent loop timer

    wont be able to sleep in an unscheduled environment. you can use RemoteExecCall to run a function in an unscheduled environment though
  18. gokitty1199

    Inconsistent loop timer

    you just made me realize how big of an idiot i am. i completely forgot about Time. anyways fixed it, simply created a variable to get the starting time _StartingTime = Time; _TimerTime = 0; then whenever i wanted to get the current time of the timer and assign it to _TimerTime just simply _TImerTime = (Time - _StartingTime); and you end up with the correct time. now i can remove the loop entirely and have a function get called when needed to handle everything. thanks again!
  19. gokitty1199

    animate not working globally

    this did not change anything. as a test (using mpeventhandler) i set it up so that the animatesource code would run on all clients (it prints out a hint on the clients where the animatesource line is so it is running) and it still only gets animated on the server. no matter what i do the target will not drop in multiplayer for some reason. edit: found the problem, it was actually related to the target itself TargetBootcampHumanSimple_F. i was using these because they did not fold down when shot by default, but they could still be animated. when animating these targets via animate/animateSource, they are not animated globally, but when i switched the target for one that is suppose to fold down and come back up when shot, it worked perfectly and animateSource was working as intended. edit: WELL APPARENTLY IT WONT ANIMATE FOR OTHER CLIENTS IF YOU HAVE ENABLED SIMULATION UNCHECKED
  20. to sum it up, i have literally 99% of the code running on the server only as the clients just trigger events for the server to handle. i have a hit event handler that gets applied to a target, when the target is hit twice, i use _Target animate ["terc", 1]; to drop the target. this is only going to run on the server, but animate is global. when i shoot the target(as the server) the target drops for me but nobody else, when a client shoots the target twice, it drops for me (the server) but nobody else and not even the client. i tried remoteexec it like so [_Target, ["terc", 1]] RemoteExec ["animate", 0, true]; just to see if that would solve my issue without any luck. any ideas? i just want the target to drop for all the clients _x AddEventHandler["Hit", { params ["_Target", "_Weapon", "_Damage", "_Shooter"]; _SetShooter = _Target GetVariable "Shooter"; _Active = _Target GetVariable "Active"; _IsTargetDone = _Target GetVariable "Done"; _Stage = _Target GetVariable "Stage"; _Timer = _Target GetVariable "Timer"; if (_Active && !_IsTargetDone && _SetShooter == _Shooter) then { _HitCount = _Target GetVariable "HitCount"; _HitCount = _HitCount + 1; _Target SetVariable ["HitCount", _HitCount]; if (_HitCount >= 2) then { [_Target, ["terc", 1]] RemoteExec ["animate", 0, true]; //_Target animate ["terc", 1]; _Target SetVariable ["Done", true]; _TargetsDone = _Timer GetVariable "TargetsDone"; _TargetsDone = _TargetsDone + 1; _Timer SetVariable ["TargetsDone", _TargetsDone]; }; }; _IsTargetDone = _Target GetVariable "Done"; if (_IsTargetDone && _Active) then { _Target SetVariable ["Active", false]; _TargetsDone = _Timer GetVariable "TargetsDone"; _TargetCount = _Timer GetVariable "TargetCount"; [format["%1 Eliminated %2/%3 Targets", name _SetShooter, _TargetsDone, _TargetCount]] call HintToEveryone; }; }];
  21. gokitty1199

    animate not working globally

    will give that a try in a few hours, thanks for the suggestion!
  22. its been a very long time since ive touched arma 3, but try adding a delay for the JIP player, so after maybe a second or so have it run the script to load the necessary info for the player.
  23. Am I way off here or correct? I know this is posted in the wrong section, but I figured this would be the place to get the correct type of people's opinions. Keep in mind, this is for the most basic safezone script which literally has less than 20 lines of script going into it. link to video : first comment or screenshot of comments:
  24. "correct type of people's" was referring to people who what and how to write scripts or work in the editor even if its at a early beginner level. thank you for the bananas and a Merry Christmas to you to :)
  25. gokitty1199

    Counting when interacted with

    i think he means something along the lines of box1 setVariable ["isFound", false, true]; box2 setVariable ["isFound", false, true]; //do more of these for each box player addAction ["Found Box", { cursorTarget setVariable ["isFound", true, true]; boxesFound = boxesFound + 1; }, [], 6, true, true, "", "cursorTarget getVariable ['isFound', nil] isEqualTo false AND player distance cursorTarget < 4"]; //cursorTarget getVariable ['isFound', nil] isEqualTo false this line should not get the default value of nil. i didnt think to much of it but with getVariable you have a default value(in this case its set to nil), and its going by the cursor target(whats in your cursor). so its reading whats in your cursor, getting the variable isFound, if the object does not have the variable isFound then it returns the default value(in this case nil) for comparison. hopefully @Grumpy Old Man will correct and explain the comment in the script above better so it makes more sense to you
×