kaleb c0d3
Member-
Content Count
27 -
Joined
-
Last visited
-
Medals
Community Reputation
8 NeutralAbout kaleb c0d3
-
Rank
Private First Class
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
kaleb c0d3 started following SOLVED: Serialize/unserialize map markers, including Polylines
-
SOLVED: Serialize/unserialize map markers, including Polylines
kaleb c0d3 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sup all! I've made a modification of BIS_fnc_markerToString and BIS_fnc_stringToMarker to allow Polylines (map drawings) to be serialized/unserialized, because native scripted functions does not allows it. I'm currently using this because my players sometimes participate in a pre-mission recon and this allows them to save important map intel data, that will be re-renderized on their maps on the official mission day. Use/modify them as you see fit. Enjoy! GLMRK_fnc_markerToString: GLMRK_fnc_stringToMarker: -
Clientside OnPlayerDisconnected Event Handler
kaleb c0d3 replied to kaleb c0d3's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you @sarogahtyp & @mrcurry. I already have the 'autosave' mechanic, with a configurable frequency (1 per minute atm). I have 2 different scenarios for wich I need a disconnect EH on the client-side: 1. Player lost connection: I have the last autosave data, <= 1 minute of the last save. No major problem here... it is obvious that the client went on a critical state and any data (updated or not) is better than nothing. 2. Player quits (via menu or alt+f4): I want to take that 'last update before leaving', so when the player comes back, will be in the exact same state. I think the 'save on pause menu' is a good approach; not the best, but a very good one. Extra: performance wise, I've made the persistence engine this way: Client request save to server >>> Server saves data via API to a webservice >>> Client gets operation status Doing this, the server only have to kick the api with the data, and all the database stuff is made on another hardware. Very low performance impact so far. The webservice is running in a Debian 11: Laravel APP, MySQL, Apache, running smoothly.- 4 replies
-
- event handler
- client
-
(and 1 more)
Tagged with:
-
Clientside OnPlayerDisconnected Event Handler
kaleb c0d3 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sup all! Do you know if there's a event handler that fires from the client side when the player disconnects? I'm working on a survival mod wich persists player info into a database, and need to force an update when the client disconnects. If I use the serverside events (HandleDisconnect, onPlayerDisconnected, and so on), some player data is not available because the client is no more online, and cannot query for it. Thanks in advance.- 4 replies
-
- event handler
- client
-
(and 1 more)
Tagged with:
-
Save players' map markers on MP
kaleb c0d3 replied to kaleb c0d3's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you very much @alpha993!!! Will try that and update any result. -
Sup all. I've have another question, this time, related to map markers. I'm running missions that slipts into two events: one day for recon, and the other for the mission itself. On recon day, a small group of players inserts into the map and makes a survelliance run, gathering the intel for the second day, that is, "the mission" itself. I want to save all the players markers on recon event (wich I can do via scripting), and then export them to the "mission map". The thing is that on single player, I can grab the map markers array data and export it as a string using "copyToClipboard", but according to Bohemia wiki, it's a server side only function. On a dedicated server, I'm running into problems to get that data from a client. What I achieved so far: Server side script: grab all the players markers into an array, then "send" that data to a zeus enabled player (client). On client side, I've got the markers data. Missing: how can I do to "export" that data. Any ideas? Thanks in advance.
-
SOLVED: "Dirty" vehicle seat after using moveInCargo and variants
kaleb c0d3 replied to kaleb c0d3's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you very much @fn_Quiksilver, you nailed it! Managed to patch it using an event handler like this (works in SP & MP): // Add this at initPlayerLocal.sqf or function with preInit/postInit to fix the 'dirty seat' behaviour. player addEventHandler ["GetOutMan", { params ["_unit", "_role", "_vehicle", "_turret"]; if !(isNull assignedVehicle _unit) then { unassignVehicle _unit; }; }]; The "if !(isNull assignedVehicle _unit)" is used to made the fix stacked event handler friendly, just in case of another mod doing magic with the "GetOutMan" EH. Thanks again, man.- 2 replies
-
- 1
-
- moveincargo
- teleport
-
(and 2 more)
Tagged with:
-
SOLVED: "Dirty" vehicle seat after using moveInCargo and variants
kaleb c0d3 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sup all. I'm asking for advice on a strange AI behaviour using moveInCargo. Scenario: I'm making a teleport module that allows a player to teleport to other player (a quality of life mod to help zeus with players disconnections). The first release of this mod was simple: a custom dialog that let the player pick a teleport location using the others players positions. The problem was when the "target player" was inside a moving vehicle... the teleported player was usually killed by a car accident 😛 In the second release, I want to improve the mod: if the "target player" is inside a vehicle, and the vehicle has free seats, teleport the player to one of these seats. Implementation: If the "target player" is on foot, its a normal teleport (player setPosASL _target_player). If the "target player" inside a vehicle, check for available seats (using "fullCrew"), and then using "moveInXXXXX" (cargo, commander, gunner, etc), "assignAsXXXXX" (cargo, commander, gunner, etc), I was able to teleport the player to one of the free seats on that vehicle. If no seats are available, just a "normal" teleport near the vehicle (TODO: air vehicles?). The problem: When I used one of the "moveInXXXX" functions against a player and a vehicle, the vehicle seat gets 'dirty': no AI can get into that seat anymore. Initially I tought it was some arma-3-wichcraft, a conflicting mod or an error with my code, but taking things to the basic, I was able to reproduce this strange AI behaviour on a fresh & clean mission, without any code. You can reproduce this weird thing like this: Create a new mission. Place a vehicle with only a unit as driver, and set it to "player unit". Place the zeus (curator) module. Start the mission. Get out from the vehicle. Enter zeus, spawn an allied squad (4+ units), and order them to get into the vehicle. You will see that the AI won't occupy the 'dirty' player seat. Try switching player seat in the editor and try again, and you will see how the 'dirty seat' changes. Why is that? Inspecting things a little, and exporting the mission to SQF code, you can see that the Arma 3 engine moves the player unit into a vehicle using "moveInDriver", just like I did it on the teleport code. Another thing is that the problem is consistent using other "base" mods, for example ACE3: if you want to load a prisioner/wounded AI unit into a 'dirty seat', that seat is not usable anymore. Final toughts: I think that the scripted versions of moving a player into a seat does not clear/set certain flags on the vehicle, rendering that position unusable for the AI. Sorry for the long post. Thanks in advance. Solution #1 (edited post @ 05/02/2022): Thanks to @fn_Quicksilver, this is one way to fix this: // Add this at initPlayerLocal.sqf or function with preInit/postInit to fix the 'dirty seat' behaviour. player addEventHandler ["GetOutMan", { params ["_unit", "_role", "_vehicle", "_turret"]; if !(isNull assignedVehicle _unit) then { unassignVehicle _unit; }; }];- 2 replies
-
- moveincargo
- teleport
-
(and 2 more)
Tagged with:
-
Spin-Off Release: Simple Conversation System
kaleb c0d3 replied to IndeedPete's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@IndeedPete first let me thank you for this awesome conversation system. About one of the limitations: "For full conversations, both participants NEED a variable name. (It's necessary for a workaround to make the MC work.)" I think this will do the trick with the player unit. Tested in SP (should work in MP) with a player controlled unit without variable name and worked. Add this in "initPlayerLocal.sqf". // Create a fancy player global var name. Not checking against duplicates... maybe use SteamID value? private _playerVar = format ["player_%1", [name player] call BIS_fnc_filterString]; // Create the var missionNamespace setVariable [_playerVar, player, true]; (missionNamespace getVariable _playerVar) setVehicleVarName _playerVar; Cheers 🙂 -
Need fast reload advice
kaleb c0d3 replied to kaleb c0d3's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you very much, @alpha993 Will post updates as soon as I can type some code. -
Need fast reload advice
kaleb c0d3 replied to kaleb c0d3's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks @alpha993, will try that. In an early reply, you've mentioned something about other gestures, and/or modifying existing ones (via config, i suppouse). Do you have an example or link to something like that? Thanks! -
Need fast reload advice
kaleb c0d3 replied to kaleb c0d3's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Yep, already went to that obscure corners... setSkill only affects AI, and setAnimSpeedCoef works for movement-like animations. Thanks anyway, @johnnyboy -
Sup everyone. I'm working with a code snippet for fast reload (an old idea that never finished). The concept is to reload the current weapon, dropping the magazine to the ground and cutting the required time to reload to half (I'm a IPSC shooter IRL, so grabbed the concept from there). So far, i've achieve this: 1. Get magazine type and ammo count for current weapon. 2. Remove the magazine from current weapon. 3. Create a magazine of the same type and ammo count on the floor. 4. Insert a magazine from inventory to current weapon. Extra: using ACE, binded the action to double R key tap. The thing is that I cannot control the animation speed. I mean, I want to start the reload animation but at a faster speed; in fact, i need any animation to replace the standar one. Any advice is welcome. Thanks in advance!
-
script Random ennemy placement
kaleb c0d3 replied to Marin Lorre's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I think he wants to move a group of them, not just one. -
script Random ennemy placement
kaleb c0d3 replied to Marin Lorre's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Please, use and modify it as you see fit! I'm glad to help you 🙂 When you define parameters that way, you are declaring with a type and a default value, like this: params [ ["_p", "no value", ["", 0]] ]; // _p : parameter name // "no value" : default value for _p, if not specified at fuction call (an "optional" parameter) // ["", 0] : array of data types accepted for _p, in this case, a string ("") or an integer (0) For more info, take a look at this. And about your code, take a look at this piece (not tested tho...) private _possibleLocation = [trig01, trig02, trig03] private _hostagePos = selectRandom _possibleLocation; { private _unitsInArea = allUnits inArea _x; { deleteVehicle _x } forEach _unitsInArea; } forEach (_possibleLocation - [_hostagePos]); If you try my fn_randomPlacement function, let me know how it worked, just to have feedback 😄 -
script Random ennemy placement
kaleb c0d3 replied to Marin Lorre's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Sup @Marin Lorre. I've made a script that do the same, but with a different approach. Take this example: I've got a VIP, wich need random placement. I've got several possible spots for placement (different buildings inside a town). The VIP has bodyguards; these units are different, depending on the selected placement. The script does this: the VIP is synchronized against multiple empty logics. Each logic position is a possible location (latitude, longitude and height matters). Then, i've got several AIs synchronized to each logic (the bodyguards at each location). When mission starts, the init code from the VIP gets fired and selects a random location (a randon logic), then places the VIP into that position (with an optional random radius). After that, it takes all the non-selected logics and delete the "orphans" bodyguards. Take a look at this function (fn_randomPlacement.sqf): params [ ["_target", objNull, [objNull]], ["_randRadius", 0, [0]] ]; // Get only synchronized "Logics" private _syncLogics = (synchronizedObjects _target) select { typeOf _x == "Logic" }; private _selectedLogic = selectRandom _syncLogics; // Set target position _target setVehiclePosition [_selectedLogic, [], _randRadius, "CAN_COLLIDE"]; // Delete all objects associated with the non-selected Logic { // get attached objects (exclude the _target itself) private _attachedObjects = (synchronizedObjects _x) - [_target]; { deleteVehicle _x; } forEach _attachedObjects; } forEach (_syncLogics - [_selectedLogic]); Then, in the VIP init field (this code is fixed for MP missions): if (local this) then { [this, 3] call GLMFW_fnc_randomPlacement; }; In the editor, I've got this: /--BODYGUARD1 /-------------LOCIG1---BODYGUARD2 / \--BODYGUARD3 / / /--BODYGUARD4 VIP----------------LOGIC2 \ \--BODYGUARD5 \ \ \------------LOGIC3---BODYGUARD6 If LOGIC1 is selected at random, you keep BG 1, 2 and 3 (4, 5 and 6 are deleted). If LOGIC2 is selected at random, you keep BG 4 and 5 (1, 2, 3, 6 are deleted). If LOGIC3 is selected at random, you keep BG 6 (1, 2, 3, 4, 5 are deleted). In your example, you can place one "main" hostage as vip, place different logics as possible locations, and synch more hostages into each location. Good luck and happy coding! -EDIT- When using this script, I've synchronize other objects at each "LOGIC" position, such as cars, boxes, intel, etcétera, to make the selected spot more "immersive friendly" (i mean, you are not tied to AI units at each possible location).