chaoticgood
Member-
Content Count
37 -
Joined
-
Last visited
-
Medals
Everything posted by chaoticgood
-
player's addEventHandler not firing on dedicated server
chaoticgood replied to kamikaz333's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Have you tried addMPEventHandler instead of addEventHandler? -
I recommend reading focker's arma 3 scripting guide, it's on armaholic and covers setVariable.
-
What is the difference between "allMissionObjects" and "Entities" ?
chaoticgood posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Both these appear to do exactly the same thing, except 1 was added in arma 2, and the other in arma 3. -
lower Bandwidth usage Script
chaoticgood replied to lappihuan's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Undefined variable in vehicle tow script
chaoticgood posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Undefined variable in vehicle tow script
chaoticgood replied to chaoticgood's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
Undefined variable in vehicle tow script
chaoticgood replied to chaoticgood's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks Kylania, but it still gives the same error with the amendment you suggested. -
Two while loops at the same time.
chaoticgood posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
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? -
Two while loops at the same time.
chaoticgood replied to chaoticgood's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks, that does exactly what I need. -
BIS_fnc_GC working in arma 3?
chaoticgood replied to chaoticgood's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. -
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.
-
BIS_fnc_GC working in arma 3?
chaoticgood replied to chaoticgood's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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; -
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.
-
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.
-
Mission invisible on Multiplayers
chaoticgood replied to phil671's topic in ARMA 3 - MISSION EDITING & SCRIPTING
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. :) -
Area Capture Script not working for JIP
chaoticgood replied to chaoticgood's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks you very much Larrow, it works perfectly now! -
Area Capture Script not working for JIP
chaoticgood posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello my script doesn't work for people who JIP. It works for people who join the game at the start. In the editor, I have a trigger set to activate by anyone and fire only once. In the trigger's activation field I have sp1 = [trigger1,"marker1"] spawn triggerLogic1; This is accompanied by a marker to show where the capture area is. Here is the init file if(isDedicated or isServer)then { execVM "captureFunctions.sqf"; }; captureFunctions.sqf: triggerLogic1 = { hint "triggerLogic1 spawned"; sleep 3; _trigger = _this select 0; //The trigger in the editor _marker = _this select 1; //The Marker in the editor _timerWest = 0; //Starts the timer at 0 _timerEast = 0; _timerResistance = 0; _timerLimit = 30; //Amount of time needed to capture the area _currentOwner = "civ";//The default owner while{true}do { sleep 1; _unitArray = list _trigger; //Get a list of all players in the trigger area then split them according to their side _westCount = west countSide _unitArray; _eastCount = east countSide _unitArray; _resistanceCount = resistance countSide _unitArray; waitUntil{(_westCount >=1 && !(_currentOwner == "west")) || (_eastCount >=1 && !(_currentOwner == "east")) || (_resistanceCount >=1 && !(_currentOwner == "resistance")) };//Pauses the loop until someone who can capture the area has entered i.e not someone who currently owns it if(_currentOwner != "west")then{ if(_westCount > _eastCount && _westCount > _resistanceCount)then{_timerWest = _timerWest + 1;}; //Check which side has the most players in the area and increase their capture progress }; if(_currentOwner != "east")then{ if(_eastCount > _westCount && _eastCount > _resistanceCount)then{_timerEast = _timerEast + 1;}; }; if(_currentOwner != "resistance")then{ if(_resistanceCount > _westCount && _resistanceCount > _eastCount)then{_timerResistance = _timerResistance + 1;}; }; if(_timerWest == _timerLimit)then{_marker setMarkerColor "ColorBlue";_timerWest = 0;_timerEast = 0;_timerResistance = 0;_currentOwner = "west";};//Once the capture progress reaches the limit, the area now becomes theirs. if(_timerEast == _timerLimit)then{_marker setMarkerColor "ColorRed";_timerWest = 0;_timerEast = 0;_timerResistance = 0;_currentOwner = "east";}; if(_timerResistance == _timerLimit)then{_marker setMarkerColor "ColorGreen";_timerWest = 0;_timerEast = 0;_timerResistance = 0;_currentOwner = "resistance";}; hint format ["West Count:%1 East Count: %2 Resistance Count: %3 \nWest Timer: %4 East Timer: %5 Resistance Timer: %6 \nCurrent Owner: %7",_westCount,_eastCount,_resistanceCount,_timerWest,_timerEast,_timerResistance,_currentOwner]; }; }; -
Area Capture Script not working for JIP
chaoticgood replied to chaoticgood's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Ok, I think I've found the problem. I have an idea but I need someone to tell me how to broadcast those hint messages in my script to the clients, as of now they run on the server, which isn't very useful as I can't see them. Any idea how? Thanks -
Hello, I am in the process of making a vehicle rearm script that is going to be used in a dedicated server. Now, my question is what should do the rearming/fuel/ammo, the server or the client? The vehicle that this will happen to has player inside of it.
-
Help Needed With Simple Script
chaoticgood replied to Katash's topic in ARMA 3 - MISSION EDITING & SCRIPTING
player addAction["Convoy wait",{commandStop(AI that you want to stop goes here)};]; I suggest putting in an AI that has a rank above the rest, that way he'll tell his group to do the same thing. To carry on again: player addAction["Convoy move",{(AI that you want to move goes here) commandMove (position where you want them to go goes here)};]; -
End detected state with trigger
chaoticgood replied to anthonyfromtheuk's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Try looking here http://community.bistudio.com/wiki/Category:Command_Group:_Waypoints -
End detected state with trigger
chaoticgood replied to anthonyfromtheuk's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You could try putting: player setCaptive true, in the activation field. When the trigger is fired, you will become neutral to the enemies. -
Can't get createVehicle to work properly.
chaoticgood replied to chaoticgood's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks for the help guys, it works. -
Can't get createVehicle to work properly.
chaoticgood posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello can anyone tell me why this does not work? commandFunc = { _this addAction["Build HQ",{ hint "Building HQ"; sleep 3; blueHQ = "Land_BagBunker_Large_F" createVehicle (|#|position _this); }]; }; I get: Error position: Type Array, expected object, location. "_this" is the player -
Respawn System - JIP + Repsawn at spectator
chaoticgood replied to Providence932's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Try using: player addMPEventHandler["MPRespawn",{code here is executed on respawn.}];