Jump to content

chaoticgood

Member
  • Content Count

    37
  • Joined

  • Last visited

  • Medals

Community Reputation

11 Good

About chaoticgood

  • Rank
    Private First Class
  1. Have you tried addMPEventHandler instead of addEventHandler?
  2. chaoticgood

    money script?

    I recommend reading focker's arma 3 scripting guide, it's on armaholic and covers setVariable.
  3. Both these appear to do exactly the same thing, except 1 was added in arma 2, and the other in arma 3.
  4. chaoticgood

    lower Bandwidth usage Script

    There is a module in the editor that disables the simulation for all vehicles out of range of any player. Although, it's not very customizable. For further server optimisations, I recommend taking a look at BIS_fnc_GC, you can pass an array to it, and then it will delete everything in that array if no one is within 1Km of the object being deleted.
  5. Oh wow, that's so much simpler than what I had in mind. When I first started, I tried to plan out my vehicle tow script to be as efficient as possible, I thought about adding an addAction to every vehicle on the server. I thought "that seems unnecessary", how about if I add it to only the vehicle that the player is near. Then you come in and do it 1 line of code :] EDIT: I tried your code and I can't get it to work >.< Using your last line, I click tow object while looking at a vehicle and nothing happens.
  6. Thanks Kylania, but it still gives the same error with the amendment you suggested.
  7. Hello, my script is throwing out an error and I don't know why: playerTow = { while{true}do { sleep 3; _vehArray = nearestObjects[_this,["Car","Tank"],6]; hint format ["Vehicle Array: %1",_vehArray]; _vehCount = count _vehArray; if(_vehCount >=1)then{ _vehSelected = (_vehArray select 0); sleep 6; hint format ["Vehicle selected: %1",_vehSelected]; if(isNil "_ID")then { _ID = _vehSelected addAction ["Tow Object",{handle2 = [_vehSelected] spawn towObject;}]; waitUntil{ sleep 3; (_this distance _vehSelected) >= 6;}; _vehSelected removeAction _ID; }; }; }; }; Ok, so what this script does: Firstly, it constantly checks every 3 seconds for a vehicle of the given type and counts what it has found. Secondly, once it finds a vehicle or if multiple vehicles, it will use the closest vehicle to the player. Thirdly, if an addAction is not already applied to the selected vehicle, it adds one. If the player leaves the area, it removes the addAction. The hints are for dubugging purposes. Now for the error: handle2 = [|#|_vehSelected] spawn towObject; Error undefined variable in expression: _vehSelected I just don't get why it's saying this, I know that it's saying the variable needs defining, but at this point in the script, it looks like to me that it is defined.
  8. chaoticgood

    Two while loops at the same time.

    Thanks, that does exactly what I need.
  9. while{true}do { stuff1 }; while{true}do { stuff2 }; In the example code I have given, only stuff1 is done. Is there a way to run stuff1 and stuff2 simultaneously?
  10. chaoticgood

    BIS_fnc_GC working in arma 3?

    The goal of "gCount" is to see what the total number of things in _garbage is, as this is done on a dedicated server. So if I hint it, I won't be able to see it. So I then send the variable to all clients for debugging purposes and will be removed once I get the code working. I assume I should call the function on the server and not the client? As for checking if something is already is in the queue, I have no idea how to do that because I don't think you can actually check what's in the queue, correct me if I'm wrong.
  11. chaoticgood

    BIS_fnc_GC working in arma 3?

    Thanks for the info, would this work then?: while{true}do { sleep 5; _garbage = allDead; gCount = count _garbage; publicVariable "gCount"; }; [_garbage] call BIS_fnc_GC;
  12. Is this function working in Arma 3? I'm not exactly sure how to use it properly. I've read the wiki page http://community.bistudio.com/wiki/BIS_fnc_GC but I still can't figure out how it works. I've tried: while{true}do { sleep 5; _garbage = allDead; gCount = count _garbage; publicVariable "gCount"; if(_gCount >= 1)then{ [_garbage] spawn BIS_fnc_GC; }; }; This is done on a dedicated server and it sends the dead back to my client to see how many there are. I then spawn in some AI, kill them, the dead body count goes up, then I fly away in a helicopter to about 2km from the dead bodies, then I fly back and they are still there.
  13. chaoticgood

    General Discussion (dev branch)

    That's exactly what I mean, all vehicles should have this on by default when they are idle to save on performance. If someone gets in the vehicle or the vehicle gets hit or bumped, then it should come out of the idle state.
  14. chaoticgood

    General Discussion (dev branch)

    I've noticed that having too many vehicles in the editor will bog down the fps in multiplayer games, even when they are idle and not rendered on screen. Could we get some sort of vehicle idle state to help with network performance, perhaps something like the current physics model as I understand it, where if the vehicle is idle, the physics go idle? This would be a huge help with the current fps problems in scripted multiplayer games where you need a large amount of vehicles spawned in.
  15. It looks like you are not syncing markers/objectives with players that join after the game has started. This generally needs to be done by the server, and should be done automatically but for some reason, isn't. So, to get the server to sync the markers/objectives to the players who join in progress I put this in a script that is run only on the server onPlayerConnected {execVM "JIP.sqf";}; and in the JIP.sqf: _markerList = ["m1","m2"]; {_markerColor = getMarkerColor _x; _x setMarkerColor _markerColor; }foreach _markerList; this will sync 2 markers colors, "m1" and "m2", every time someone joins the game. So this is just an example. There is probably a more efficient way to sync everything but I'm a noob at scripting. Maybe someone will post a better way to sync everything. :)
×