Jump to content

gokitty1199

Member
  • Content Count

    311
  • Joined

  • Last visited

  • Medals

Posts posted by gokitty1199


  1. 16 hours ago, GingerAsianBond said:

    Hi guys, thanks for the prompt reply. Appreciate the feedback. @Moon_chilD

     

    @phronk I am using the Dynamic Civilian spawner from Bohemia, would there be a workaround for this that would affect all spawned units? Perhaps a trigger?

     

    @gokitty1199 You're a legend, mate. Would this be placed in my init.sqf?

     

     

    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)


  2. 13 hours ago, HumaineNZ said:

    Hey gokitty1199,

     

    Sorry mate, not sure how to add this to the activation of the trigger, as its coming up with an expression error.

     

    Is this script added in to the activation section or somewhere else?

     

    Thanks for any Help.

    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

     

    • Like 2

  3. 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)});

     

    • Like 1

  4. 51 minutes ago, fawlty said:

    I'm trying to delete all Blufor ground forces via the area inside a trigger zone.

    I could do this in zeus but using a radio to activate in this situation works better.

    I found this but it deletes opfor and civilians as well but it's on the right track. 

     

    cleanUp = (allUnits + vehicles) inAreaArray Trig1;
    {if ((_x isKindOf "man") || (getNumber (configFile >> "CfgVehicles" >> (typeOf _x) >> "side"))  == 0)then 
    {deleteVehicle _x;};}forEach cleanUp;

     

    Any suggestions

    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

    • Like 2

  5. 3 hours ago, HumaineNZ said:

    Hi, I'm looking at creating a mission where the players start as civilians but if they cross into an area, bluefor forces will shoot them.

    This is the first time I've tried scripting so forgive my lack of knowledge on this.

     

    I found the simple way to do this is to change the player to Opfor on a trigger when that happens, with something that does this:

    player joinAsSilent [createGroup east, 5];

     

    but, once one player switches, then every other player switches as well, no matter where they are. ( which isn't ideal)

    Also when the player dies, he can't respawn using the civi point, as he remains Opfor.

     

    A messy way around this was to created an opfor respawn at the start point, and another trigger to switch them back to Civi

    player joinAsSilent [createGroup civilian, 5];

     

    This works, but again every player changes as well... and i'm sure I read somewhere that every time you do something like this, it creates a new group, and that there is a limit to how many new groups can be created.

     

    Is there another way i could do this? how about on death the player switches back to civi?  Not sure how to script that.

     

    Thanks for any help, if you can.

     

    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.

    • Like 2

  6. 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


  7. 1 hour ago, Cherkasov said:

    Hello all, I wanted to rework one of my old projects now with blender 2.8. However when trying to import I only ever get the first LOD in my collections of whatever p3d I try to import. I receive this error: 

      Hide contents

    5ffb8f1127c65beff2410dd739fac2e8.png

    I/O error: 'Scene' object has no attribute 'update' <traceback object at 0x000001E9C462FDC8> - I/O error: Exception while reading

     

    I am running on blender version 2.80.75 and the latest git-hub version of the Toolbox. The O2Script.exe path is also given. I have also tried other p3d's, including some from the ArmA3 Samples. I have asked earlier today in the A3 Discord but the suggestions there unfortunately did not solve my issue.

    Hope anyone can suggest some solution, sadly I do not know how to troubleshoot this..

    did you make sure to uninstall any old versions of the toolbox when installing 3.0.3?


  8. 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.

    collision-issue.png

    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


  9. 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


  10. 11 hours ago, RoF said:

    There is a Blender plugin that exports as .p3d, you can set mass and everything in that. You can stay away from object builder then (some of the time)

     

    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


  11. 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.


  12. 3 hours ago, sabot10.5mm said:

    A scheduled script has an execution time limit of 3 ms before being suspended to the benefit of another script until its turn comes back. here 

    maybe to avoid suspension use a non-schedule? just an idea.

    
    _Timer SetVariable ["TimerTime", (time + 5)];
    
    [...] call {
    _timer = _this select 0;
    _true = true;
    while {_true} do {
    	if (time > (_timer getVariable ["TimerTime", -1])) then {//misc stuff that doesnt run until timer is finished
        _true = false;
        };
    };
    };

     

    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!


  13. 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;
    };

     


  14. 14 hours ago, Grumpy Old Man said:

    Try using an MPHit EH (with addMPEventhandler command) and use animateSource instead animate and ditch the remoteExec.

    From a quick glance at your snippet this might solve the issue.

     

    Cheers

    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


  15. 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;
    			};
    		}];

     


  16. 7 hours ago, Grenadier ITF said:

    Hello everyone and congratulations for the work done.
    I am recently using this database mod.
    I have a problem with jip.
    If a player enters the mission after the start, the repositioning of the player does not work. Notice that I performed the tutorial on youtube step by step. Thanks in advance for your reply.

    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.

    • Like 1

  17. 21 hours ago, HazJ said:

    Not really the best place imo.

    There are no facts in people's opinions. You worded that in a way that you want people to side with you or at least that's how it comes across - "correct type of people's". If you have to ask then maybe don't make the comment? Not much to say really. Not sure what you expect from this topic exactly.

     

    Merry Christmas. Have some dancing bananas.

    :yay::yay::yay:

    "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 :)

    • Like 3
    • Thanks 1

  18. 13 hours ago, ClickGamingNZ said:

    Ok I'm just trying to put my head around what @Grumpy Old Man said in regards to @gokitty1199 wrote and I'm trying to put those recommended changes into code as I've not delved into the depths of addAction commands with putting a radius on them and haven't even looked at the MP side of scripting yet.

    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


  19. 1 hour ago, Grumpy Old Man said:

     

    No need to individually set variables if you simply want to return a default value:


     

    
    cursorTarget getVariable ['isFound', nil] isEqualTo false

    This will not work since you can't compare nil to bool

     

    However when first setting the following:

    
    box1 setVariable ["isFound", false, true];

    will make the isEqualTo false check unnecessary and most likely confusing when you can simply check for this:

    
    cursorTarget getVariable ['isFound', false] isEqualTo false

    Again, no need to set any variable when you can simply check for a default value.

    You can also remove the distance check in the addAction condition and handle it from the addAction radius parameter #10.

    On top of that it always pays off to save variables on objects, in this case the player (boxesFound), so you'll have an easier time porting this to MP if needed.

     

    Depending on how you want to detect the interaction you can do this with addAction or, as @Larrow suggested, via ContainerOpened EH.

     

    Cheers

    that i didnt think about, nice response

    • Like 1

  20. if im understanding you right then this may be what you want

     

    it adds an addaction to the player that only shows up if the player is looking at a box, if he looks away or gets further away than 4 meters the the option disappear until the player goes back and looks at it. when the player clicks Found Box, it tallys up 1 box found for that player and no other player on the server can get the option to find that box

    boxesFound = 0;
    
    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"];

    result from clicking on 2 boxes(it sucks trying to make a gif with gyazo -_-)

    https://gyazo.com/3908068544e5239e0467dd41ecafae05

    https://gyazo.com/49d73c9644a30874991b74e74407a960

    • Thanks 1
×