-
Content Count
155 -
Joined
-
Last visited
-
Medals
Everything posted by _foley
-
[Release] Collapsed Pattern Generator
_foley replied to mrcurry's topic in ARMA 3 - MISSION EDITING & SCRIPTING
A randomly generated compound or even a town would be cool.- 4 replies
-
- fortifications
- generator
-
(and 5 more)
Tagged with:
-
[Release] Collapsed Pattern Generator
_foley replied to mrcurry's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Wow, impressive! I love procedurally generated stuff- 4 replies
-
- 2
-
- fortifications
- generator
-
(and 5 more)
Tagged with:
-
Weather Forecast and Time of Changes slider.
_foley replied to EO's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I think managing fog in a script is the way to go considering you want to have both a long term fog forecast and an option to dynamically override it. A minimal example (server-side): initialFogIntensity = 0.1; finalFogIntensity = 0.7; finalFogTime = 24 * 3600; // 24 hours overrideFogIntensity = nil; // you can set this in trigger to temporarily overwrite fog intensity, set to nil to use the long-term forecast again 0 setFog initialFogIntensity; [] spawn { while {true} do { private _fogIntensity = linearConversion [0, finalFogTime, time, initialFogIntensity, finalFogIntensity, true]; if (!isNil "overrideFogIntensity") then { _fogIntensity = overrideFogIntensity; }; 60 setFog _fogIntensity; sleep 60; }; }; This example assumes you don't change time multiplier or skipTime. If that's the case, you can use a combination of dateToNumber and missionStart instead of plain time to calculate _fogIntensity. It also assumes you only need to change fog intensity. If you want to control [fogValue, fogDecay, fogBase], then you can use linearConversion three times (once for each value in the array). -
Force the AI driver to crash into the target
_foley replied to qevhytpl's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If you use setDriveOnPath, AI ignores obstacles -
AI won't spawn with main weapon
_foley replied to elroacho94's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's a wild guess but I think what's happening is that when you call getUnitLoadout in onPlayerKilled.sqf, the player is already missing their main weapon (it drops at the moment of death). I'm sure there was a topic on this, maybe someone can link? -
How to get update when marker color changes
_foley replied to Northup's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The trouble is that "_canRearm" is a local variable and it's only evaluated once, at the beginning of the script. Try this, first define a function that checks if player can rearm: fnc_canRearm = { _mrkr = "TowerPost1"; _mrkrcolor = getMarkerColor _mrkr; _color = switch (side player) do { case west: { "ColorBlufor" }; case east: { "ColorOpfor" }; case independent: { "ColorIndependent" }; default { "ColorGrey" }; }; (_color == _mrkrcolor) } then in the addAction set the condition to "call fnc_canRearm" instead of "_canRearm". Keep in mind that this condition will be checked on every frame. It's fine in this case but if the function were more complex then it could affect performance. -
How to get update when marker color changes
_foley replied to Northup's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Did you consider using the "condition" parameter of addAction to check if player can rearm? You can't really update an action, you'd have to delete it and create again when needed but I think using the condition is cleaner. -
hashmap [SOLVED] Can I read specific variable name (not its content) between two files?
_foley replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
It sounds to me like you want to store a "preset" of some group types. If that's the case then you wanna use a hashmap: _presets = createHashMapFromArray [ ["sniper_team", ["classname_unit_1", "classname_unit_2"]], ["scout_team", ["classname_unit_1", "classname_unit_2"]], ["fireteam", ["classname_unit_3", "classname_unit_4", "classname_unit_4", "classname_unit_4"]] ]; Then if you want to do something with each preset then you can use forEach: { private _teamType = _x; private _unitClassnames = _y; systemChat format ["Team %1 is made of %2", _teamType, _unitClassnames]; } forEach _presets; This lets you differentiate between "sniper_team" and "scout_team" even though they are made of the same unit types. But again, I'm guessing here. Share some context 🙂 -
Looping say3D in multiplayer
_foley replied to Jay_On_Arma's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If you run it straight from init and the problem was just alarmToggle then your original version should work fine. In this case remoteExec will do more harm than good. -
Looping say3D in multiplayer
_foley replied to Jay_On_Arma's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If that loop runs on server only, then you're almost there. You need to replace: ship1 say3d ["shipAlarm", 500, 1]; with: [ship1, ["shipAlarm", 500, 1]] remoteExec ["say3d", 0, false]; -
[MP]How to delete dead AI bodies but keep dead player bodies in a while loop?
_foley replied to Corleone Vito's topic in ARMA 3 - MISSION EDITING & SCRIPTING
_x != player isn't gonna work, try this instead: !isPlayer [_x] -
Execute a script each time a player plants an explosive
_foley replied to Jonssonsson's topic in ARMA 3 - MISSION EDITING & SCRIPTING
ACE has this cool event you can hook into: [ "ace_explosives_place", { params ["_explosive", "_dir", "_pitch", "_unit"]; hint str _this; } ] call CBA_fnc_addEventHandler; Can't remember whether it fires on each machine or just for player placing the explosive. -
Make Rhino MGS wheels tougher
_foley replied to Tankbuster's topic in ARMA 3 - MISSION EDITING & SCRIPTING
It's ugly cause you put it all in one line 😄 I think HandleDamage is the best way to handle this. -
How to avoid "naked" players loadout bug in MP
_foley replied to twistking's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If these loadouts are for player slots only, you want to run your script from init.sqf (or initPlayerLocal.sqf). You need to make sure the code runs only for players and awaits until the player object is available. Simple example goes like this: // init.sqf if (hasInterface) then { waitUntil { !isNull player }; [player] execVM "scripts\loadout_a.sqf"; } Here's a battle-tested example with different loadouts for different unit types. https://github.com/foley-dev/arma3-close-quarters/blob/master/init.sqf#L25 https://github.com/foley-dev/arma3-close-quarters/blob/master/scripts/player/loadout.sqf I used setUnitLoadout here but your approach with addItem/removeItem is perfectly valid too. -
Character switch on trigger
_foley replied to TOWexpert's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Have you tried selectPlayer in trigger activation? -
minefields [Release] Ethics Minefields
_foley replied to thy_'s topic in ARMA 3 - MISSION EDITING & SCRIPTING
Love the latest additions, smoking craters especially. Your script could easily become a basis for an EOD mission. -
Configuration to improve tanoa fps
_foley replied to Satojomov's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I suggest a little sanity check before you spend a lot of time on optimization. Make a blank mission on Tanoa with only a couple of vehicles for the players and drive the same route. That's as good as it gets, so if that doesn't give you desired framerate, then you should consider using a less busy part of Tanoa or a different map entirely. Otherwise, it means there is room for improvement and a good place to start are pages linked by @pierremgi -
It doesn't work because whatever you put in trigger condition needs to return true or false, whereas forEach doesn't return anything. You're looking for this: {alive _x} count [target2,target3,target4,target5,target6,target7] == 0
-
Flooding with setTerrainHeight
_foley replied to _foley's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Not really because it runs during briefing (before the game) and if it isn't finished by the time you go ingame, it will show everyone a loading screen. That said, on the first attempt I tried running the whole thing in unscheduled context which crashed the server catastrophically 😅 -
Hey I've been experimenting with setTerrainHeight to move areas of the map under the sea level in order to create a flood. Here's the script and a few screenshots from the mission playthrough. https://github.com/foley-dev/arma3-frogmen/blob/master/scripts/server/flood.sqf https://github.com/foley-dev/arma3-frogmen Tested on dedicated server, seems to work pretty well except for some minor misalignment of terrain objects.
-
qustion Passing variables to event handlers
_foley replied to AmBush03's topic in ARMA 3 - MISSION EDITING & SCRIPTING
You'd need an addon, I don't think you can change this config in mission. Hooking into the AnimDone event seems like the natural way to do this in Arma. If you're looking to have some ambient animations, take a look at BIS_fnc_ambientAnim. You can open it in Functions viewer to find out how Bohemia devs tackled this problem. -
qustion Passing variables to event handlers
_foley replied to AmBush03's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I think what you're looking for is closures but sadly this concept doesn't exist in SQF. One workaround is to set the variable in unit's namespace: _unit setVariable ["loopedAnim", _loopedAnim]; and then retrieve it inside the event handler: _loopedAnim = _unit getVariable "loopedAnim"; Works fine as long as you don't run multiple handlers simultaneously on the same unit. -
Fixing broken animation transition (InterpolateTo & ConnectTo)
_foley replied to madrussian's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I've no clue about CfgMoves but I'm thinking maybe you wanna use a gesture (as in playAction) as opposed to the "full body" animation as in "AmovPercMstpSrasWrflDnon_gear". From my experience they blend okay into different stances. Also, this mod features door opening animations though funnily enough the door animation part has been broken for a few month now 😄 Maybe you can reverse-engineer something useful from it. -
Lovely solution, elegant code 👍
-
AI causing MP slots to not appear on server
_foley replied to Captinlarry's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The lobby screen is empty when the mission has a dependency on an addon that the server doesn't have installed (3Den Enhanced perhaps). Check the server log for errors related to missing addons for confirmation.