#arma3_scripting
1 messages Ā· Page 115 of 1
your object is not a terrain object. look at the path in the config viewer. or it is not "HIDE" but rather "BUILDING".
https://community.bistudio.com/wiki/nearestTerrainObjects
(we don't know whether your nearestTerrainObjects call or your config viewer screenshot is the "correct" object type. They mismatch)
well, I don't know about "we", but I do think source types are mis-aligned.
The earlier nearestTerrainObjects example didn't even have the same model as the later one.
ah I see could be could be...
nearestTerrainObjects [player, ["BUILDING"], 10, false]
No yea you right this is the model but same problem here is correct screenshot:
https://imgur.com/sthlPbt
So when i run this it just gives me this:
private _HideObJ = nearestTerrainObjects [[worldSize / 2, worldSize / 2], ["HIDE"], worldSize, false];
private _testArray = _HideObJ select {_x isKindOf "CUP_A2_powlines_wood1"};
copyToClipboard str _testArray;
//result:
[]
You know even if that classname uses the same model, the one on the map doesn't necessarily have a classname?
No i didnt know that that is good to know. Ok so how can i remove the models i tried with this:
getModelInfo cursorTarget
result:
["","",false,[0,0,0]] No matter where i look at model.
["powlines_wood1.p3d","ca\structures\misc_powerlines\powlines_wood1.p3d",false,[0,0,-3.50319]] This is the result how would i take this and remove all models from map ?
filter by one of the first two elements, I guess
_array select { (getModelInfo _x # 0) == "powlines_wood1.p3d" }
Not sure if the first element is ambiguous in Arma but it probably doesn't matter for your use case.
what are you actually trying to do, and what is your starting point?
Yep that would do it thank you very much.
I was trying to remove objects from the map but the object that is on the map is not a object it is just a model. They are 2 diffrent things i learn more today. And To remove the model i need to get the 3pd. name and remove it.
It is an object but not all objects have classnames.
(terrain objects are special though)
call BLU_F_fnc_findPlayer does this code work correctly?
like I said, nothing that esoteric about power lines, it is a "Building" according to your config viewer screen shot. so selecting nearest "BUILDING" should do it. what you do with the objects after identifying is up to you. deleting vehicles, whatever.
No yea the first screenshot is from a diffrent object that is a type building that was my bad.
ah okay I see what you mean
If you have a function called BLU_F_fnc_findPlayer, which requires no arguments, then probably yes. However, there's no such function in the normal game.
All the code does is run a function with that name. If there is one, it'll work (assuming the function isn't broken). If there isn't, nothing will happen.
I am dubious that you have such a function. The name is odd and most functions require some arguments.
so we're talking models, LODs, etc
Yea as Jordan Said simple objects objects that dont have a class name
https://community.bistudio.com/wiki/createSimpleObject
I've been trying for 2 hours but I couldn't find a solution
It looks like rhsusf_fnc_findPlayer is a function included in the RHSUSF mod. The rhsusf_ in the function name doesn't refer to a faction, and you can't simply replace it with another faction name like BLU_F. It's just to indicate which mod it's from.
I don't know exactly what rhsusf_fnc_findPlayer does. I suggest replacing _p = (call rhsusf_fnc_findPlayer); with _p = player;, but I don't know for sure that that will work, because rhsusf_fnc_findPlayer could do something weird but essential.
Player didn't work unfortunately :d
It looks a lot like this script is meant for internal use inside RHS's special attachment stuff. It's also quite complex. If you don't understand it, it may be better to leave it alone.
Is there a way to make an ai raise their weapon as if they were gonna shoot?
hey could someone help me with this?: how could i get color corrections to automatically apply to every player that joins? this is what i have:
// test theme 1
"colorCorrections" ppEffectEnable true;
"colorCorrections" ppEffectAdjust [0.9, 1.1, 0.0, [0.0, 0.0, 0.0, 0.0], [1.0, 0.7, 0.6, 0.7], [0.200, 0.700, 0.100, 0.0]];
"colorCorrections" ppEffectCommit 0;
if you put it in init.sqf or initPlayerLocal.sqf it will apply to every player that joins
Hey! Quick Question, I want to check if my script will run for all players, meaning , I known that the sound will play for all players , but will the object hidden, object shown will be seen by all the players, or just by the players who clicked the action?
this is the script:
[SelfD1Mic, ["sD1Sound", 250, 1]] remoteExec ["say3d", 0, true];
sleep 12;
D1hidden hideObject false;
D1 hideObject true;
You can look at a command's page on the wiki to see its network locality information. hideObject is Local Effect, which means it only takes effect on the machine where it's executed. addAction code is only executed on the machine that did the action, so you'll need to remoteExec it.
I notice you have the JIP parameter set to true for your say3D remoteExec. This means that clients which join-in-progress will receive and execute the command when they join - even much later than when the command was sent. This is desirable for hideObject because you want them to receive the current hide state, but you might not want it for say3D, because if they join well after the event that caused the sound, they'll hear the sound out of context as soon as they join, which could be irritating or confusing.
Ok, thank you very much , didn't even knew I had my JIP for the say3D on , thx !!!!
so I'm under the impression file patching allows you to recompile scripts without having to restart the game; I have the unpacked files in Arma 3/x/mod/addons/mod_name and when I go into the functions view and recompile, it's not updating the file. I also have $PBOPREFIX$ with just x/mod/addons/mod_name inside
i probably have a fundamental misunderstanding of how file patching works, so could anyone help me out with understanding it?
First confirm that it does use the updated version of the function when you restart Arma.
(without repacking the mod)
What are you using to pack your mod?
just pbomanager
Have you checked the prefix in PBO manager?
In PBO manager there's a cog wheel at the top.
Should work then, assuming you didn't screw up subfolders.
does it have anything to do with me using CfgFunctions?
Like if you have files in functions inside your PBO, the same files should be in x\server\addons\framework\functions in your Arma 3 program folder.
correct
Then filepatching will work.
hmm
well, that did something. now it says i'm missing the files haha
does the path in cfgfunctions need to include x/server/addons/framework ?
Yes.
perfect, it's working now. Thank you!
Question why is this always returning same value ?
private _text = "10";
private _num = parseNumber (_text);
private _rand = floor (random _num);
systemChat format ["%1",_rand];
working fine for me
It bothers me that you're bothering with format instead of just str but otherwise nothing looks wrong with it. No reason it wouldn't randomise properly.
How many times did you try it? It is possible, albeit somewhat unlikely, that several tries in a row could generate values leading to the same floor result.
Is there a way to get access to ai pathing nodes either on terrain or in buildings?
I wonder if there is a way to simulate physics hit effects somehow? Main thing I want is to have collision sound, but creating particles would be nice too. Is my only way to manually play the sound and create the particles?
Looks like I'll need to do everything myself
Can anybody tell me what this means?
Error Type Number,Not a Number, expected Number```
_surface = (lineIntersectsSurfaces [_from, _to, objNull, objNull, true, 1, "VIEW", "FIRE"]);
and what are _from and _to?
Has anyone sorted out logic to calculate elevation firing angle for things like grenade launchers and rocket launchers? I've got a method, but it requires a lot of manual experimentation for each magazine type.
is there a good way to directly return data from server in a function call via remoteExec, or is the only way to set variable on player
ie. client does remoteExec and server actually returns data
Client->Server-Client through two functions
Client:
"dataineed" remoteExecCall ["server_requestData", 2];
Server:
server_requestData = {
switch(_this) do {
case "dataineed": {
someServerData remoteExecCall ["client_returnSomeServerData", remoteExecutedOwner];
};
};
};
Client:
client_returnSomeServerData = {
systemChat format ["Got the data from server: %1", _this];
};
Hey all. Currently running a KP Liberation campaign. In KP Liberation, players have access to mobile respawns in the form of vehicles.
I'd like for the enemy AI to target these vehicles when spotted, even if the vehicles have no passengers or a driver inside. That way, the mobile respawns would always at risk if left carelessly parked in the open.
I know that B_TargetSoldier exists but how would one attach it to a vehicle? Also, if this is in the wrong channel, let me know.
@cunning sequoia Attach invisible objects, based on it, from the both side of the vehicle (using attachTo), and save it to a vehicle variable, to remove objects once vehicle destroyed/on GetIn event.
I assume the enemy AI would see these invisible objects, right?
Yes, so you need to adjust it to to be visible from the both sides and not collide into the vehicle's body.
Sounds good. Thank you so much!
Ballistic motion launch angle and optionally speed https://gist.github.com/ampersand38/fc035f95749bf9f907dab715af106ea9
air friction and rocket engine would make maths way way worse, though 
Pretend it's negligible, and wait to run after motor burnout š
I have a routine that does it, but it uses an assumption that the air friction direction is constant and then throws in a fudge factor.
It's not really analytically solvable.
and then Dedmen gets into funny mood and programs air density into in-game ballistics š
Well, you would also need to take account of ACE ballistics if you're using those.
dumb bruteforce way would be to place agent in VR world, make him shoot at different angles and measure how far the projectile actually went 
Well, we do know exactly how Arma's engine works there.
So you can just run the simulation, adjust, re-run.
bit slow in SQF but maybe workable. Depends what it's for.
Ok, "exactly" is a stretch.
i suppose programming the agent to do funny stuff would be faster than re-creating ballistics in sqf or any other language
If you know what weapons you're dealing with you can just make tables for them :P
hell, you could probably steal some ACE code to do that.
well, one example that popped up today was making an adjustable iron sight for RPG-like launcher. With rockets apparently not being auto-zeroed by engine
I guess ACE firing table generation won't deal with rockets.
Does it already do grenade launchers?
on the other hand don't planes have CCIP for rocket pods? 
Any weapon can, see ws gun drone
is there workaround for string size limitation in a1.54? trying to dump config somehow...
foobar = foobar + "foo"
there is your workaround
if you need larger strings then you have to write your own extensions as ~4GB are the max. a 32bit application can allocate
Hey, not sure if this is the right channel, but I will give it a try:
So I have recently been trying to make my own online multiplayer server (CQC), but I have ran into a problem. When people do join they can see everyone's Hex, even though we have removed gps from everyone's inventory.
I have tried to add this:
["Initialize"] call BIS_fnc_dynamicGroups;
Into init.sqf, however without any luck. Any tips?
I think the hexes are the groupIndicators difficulty param
The dynamicGroups init is correct as long as you run it on the server.
Sorry bare with me here, I am not quite sure what you mean?
you see the hex on the other person (in top left)
I am trying to remove it, by putting a code into the mission file
You can't. It's a difficulty setting and has to be changed on the server.
The dynamicGroups line enables an interface that allows players to switch between and create groups. It's kinda related because groupIndicators only applies if you're in the same group, but not really.
(maybe one day... https://feedback.bistudio.com/T170976)
I wonder then, why they introduced that '999999 (sometimes 1000000) characters ' limit
Hey there folks, is anyone here familiar with scripting relating to pop-up UIs and could perhaps help me work out an idea I'm trying to do? (The explanation for the idea is a bit long so so if anyone would like to help and DM me about it I would appreciate the help!)
Haven't messed around with these things before, but I was wondering how do I use a script in order to change the progress bar value on an object (in this case a rugged communications hub).
I assume https://community.bistudio.com/wiki/progressSetPosition would be used to change the value, but I don't know how or where to get the control id, as I haven't messed around with UI stuff at all really.
It's not. progressSetPosition is for actual game UI stuff. The progress bar on the rugged terminal props isn't a real UI element, it's just an animated part of the object, just like the open/closed state.
Ah, fair enough. As I said, I have no knowledge in Arma UI stuff.
There is a function that's used by the object when you configure it with the Editor attributes, BIS_fnc_linkTerminal_Animations. It's not documented on the wiki (yet?) but there's some discussion about it here #arma3_scripting message, and you can find it in the in-game Function Viewer to see how it works.
Thanks, I also just now figured out really how the config viewer works, something I really could've used a day ago when I went to check a VTOL jet's cargo door names in the addon files.
Since this may help other people as well in the future, here's the script to change the progress bar value for a rugged communications hub:
commHub animateSource ["Progress_source", _value, false];
Just change commHub to be whatever the name of the object is (or to _this in the init) and _value to be whatever value you want it to show (0-100).
Link?
lol
It's step-iterated. Gravity is obvious. Air friction is acc = airfric * v^2 with the air friction constant coming from this:
private _airFric = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction");
if (_airFric > 0) then { _airFric = _airFric * 0.002 } else { _airFric = _airFric * -1 };
What I'm not sure about is what step size it uses and whether that's frame-rate dependent.
but it's not difficult to get very close anyway.
Q: how do I know the number of rounds magazines have in an object inventory? getMagazineCargo does not seem to do it...
that'd do it, thanks...
What about rocket motor acceleration?
Is there a way to define custom colors for markers?
Define CfgMarkerColors
so no way to do a random color then
Ammo configs have thrustTime (in seconds) and thrust (in m/s/s IIRC).
Does anybody know what kind of performance impact minefields have on a multiplayer server?
that is, how much does total number of mines in the whole world matter much for performance? and how much does the total number of mines in a small region matter?
Large numbers of anything will reduce performance eventually. Mines aren't super high-drag, though. They don't have physics, AI, or movement, so the impact isn't that huge. You can have many hundreds of mines without any trouble, at least assuming you haven't already spent a lot of performance on something else.
You might run into some problems if a lot of them go off at once, though.
ehrm ... @dim terrace ... 1000000 characters equal ~1GB dude
its most likely no limit but more a limitation
could use kk's makefile.dll @dim terrace http://killzonekid.com/arma-extension-make_file-dll-v1-0/
Hello!
Iām very new to arma 3 scripting and was hoping somebody could make a simple init for me for a mission focusing on sustained combat
I need to add a script to my Init.sqf in the mission file which will activate on a specific class of vehicle (as defined in the init) with the functions to āsetdamage 1ā (which means destroy) the vehicle when it has been empty of a pilot for 50 seconds or more.
Iāve been working with arma 3 event handlers via CBA to no avail, can anybody with advanced scripting knowledge make this up for me to use?
And maybe share with recognition of them
How many vehicles are you tracking? Where do they come from?
Any vehicle with the specified class name from the mission start to any of the same class name that are spawned via module or Zeus editor, basically any of a particular vehicle class present in my mission at mission launch or added during
Still looking for help if anyone might be able to š
The problem I have is I am using a mod which virtualises units and vehicles and they I also have a resupply mod which respawns them, unfortunately on both occasions adding an init to the vehicle init box alone doesnāt stick, it removes itself, so I need a way to add it into the init.sqf instead so It automatically applies to any of a class type, in my case, an attack helicopter class
Asking to ask the question goes unresponded, make a post with your issue even if its big.
arent mines some kind of trigger/eval tho?
Oh it's not an issue per se, it's just something I'm working on and would like some help with
in the early days (2013-2014) we used to disable artillery cluster mines, since even one salvo would desync a server catastrophically
It is related to scripting, in particular with UI related things, but if you think it's the wrong channel I'll send a message there
ah, roger
but here we answer questions, if you want someone to "team up" with see perhaps #creators_recruiting (for free)
that's how we roll ^^
Gotcha, thank you for the pointer!
Added GetIn, GetOut and SeatSwitched to a remote vehicle for a test
Remote unit does: Passenger->Driver switch: SeatSwitched triggers
Remote unit does: Driver->Passenger switch: GetOut and GetIn trigger one after another

SeatSwitched for both actions for local units
Thought about it, task isn't really trivial to be made somewhat reliable
was locality change involved in any of those?
No, vehicle was remote
fun stuff
Pretty sure you've seen how remote players fall out of the vehicle for few frames when switching seats, probably consequence of that
In other words, EHs report properly, net code is fucked
Been like this as long as I play MP so probably won't be fixed
probably some scar tissue from the days when players would "bounce" outside the vehicle
Good guess but since I know why that bounce happened exactly its not
do i want to know why the units bounce?
Probably the logic is:
- Move unit out
- Wait until locality change happened
- Move unit in
Top secret
Gonna boast that it was me who finally made a repro for it though: https://www.youtube.com/watch?v=V4EeBxSjCIo
Affected both OA and A3 at the same time, got fixed in both (units didn't bounce in OA but just floated in place)
yea i think 5 years ago i would have been interested to know why
now ... meh
lol
it was annoying tho. endless complaints of "wtf i was in a full health tank and got killed by a katiba... ADMIN?!?!?"
or with heli, bouncing player bouncing into the rotors and damaging the heli
It still happens for other reasons though, on vanilla mortars for instance
vanilla mortar still have animation issue
yeah
seat keeps occupied though, so you can't stack 10 players into same gunner seat
havent bothered to spam an animation once the player is in the mortar
I did tests with it, nothing helped
darn
animationState returns proper animation, none of playAction/switchMove fuckery did anything to fix it
sad noises
In what way? Surely itās just adding an init to a specific class name?
What did you have in init field for this kind of cleanup after 50 seconds anyway?
I had this
this addEventHandler ["GetIn", {
_this = _this select 0;
_vehicle = _this select 0;
sleep 30;
if (count crew _vehicle == 0) then {
_vehicle setDamage 1;
}
}];
I applied this to all init boxes of a vehicle class, Unfortunately It doesnāt work when they eventually crash and respawn
!code
```sqf
// your code here
hint "good!";
```
ā
// your code here
hint "good!";
deja vu
So do you want having 0 crew in vehicle for it to explode or no pilot as in your original post?
Also you can't sleep right inside the event handler
"do what i say, not what i code" 
No pilot now, this Wes something I experimented with earlier
As you can see Iām not great I just started, I know basic python for my job and thatās it
So if no pilot is in the pilot seat a countdown begins of 50 to destroy the vehicle
The countdown doesnāt have to reset if the pilot gets back in, just once a pilot is out and the vehicle is empty a countdown begins
regardless of if they get back in or not
you cant just use a getout event, as im sure you also want this to occur when a unit has been killed in the heli but their body remains in the heli
in which case the heli isnt empty
Yea that was the problem I had
Yeah, dead pilot is the hardest part here
If a pilot dies in the heli doesnāt it count as the heli being empty anyway?
In Zeus if a pilot dies at the controls the vehicle goes into the yellow empty state
i would just use a monitor script, iterate thru an array of entities and check for alive crew
inb4 an external loop that checks if target vehicles have a driver once every 30 seconds and then destroys whatever failed twice in a row
Thought about it too, but what if a pilot jumps in and out while script checks another vehicle?
Unless you want do to all vehicles each frame
That doesnāt matter because these are just AI so theyāll disembark from a disabled vehicle and it will explode
You could flag the vehicle for cleanup in the getout event handler ^^
once empty add a tick variable or setvariable with servertime, once not empty, reset
So the loop just checks for dead units ^^
Itās basically made for disabled vehicles so they donāt stick around, ai always disembark disabled vehicles so a countdown to destruction is all I really need for it
with no players there the EH setup can probably be shrunk down to like "GetOutMan"+"Killed" on driver š¤
i would just add a decay variable to empty assets, and if the asset isnt empty, reset the decay...
and run it FSM-style, checking one vehicle per frame? š
just a while with a sleep
The problem I have is this is all basically Latin to me, it took me 3 frustrating hours to make that first script and there are things you guys are saying that I couldnāt even comprehend inputting to an sqf file
yea you are trying to do an intermediate task with beginner experience, thats all
This game is pretty hardcore when it comes to the learning gap lol
someone will post something fancy for you to look at soon im sure
I love it but itās like a toxic relationship
Lol
Iām happy to learn and this all sounds promising but I just need a bit of guidance on how to set it up in the init.sqf
I'm afraid of adding and removing event handlers. Big number scary.
Also Killed is local to the unit, so unless its added everywhere, won't work as easy with server-side only script.
// init.sqf
0 spawn {
if (!isServer) exitWith {};
scary_while_loop = TRUE;
private _v = objNull;
while {scary_while_loop} do {
{
_v = _x;
if (((crew _v) findIf {(alive _x)}) isEqualTo -1) then {
// vehicle is empty
};
sleep 0.1;
} forEach vehicles;
};
};```
afraid of the index rising
?
Yeah. Doubt it affects performance but I still try not to add\remove EHs too much
what value is persistent, a global or entity level?
EH indexes?
500 added EHs that don't fire are likely to have less performance impact than 1 extra spawned thread :3
i think hes saying that when you add + remove an EH, the index remains and always increments higher, for the life of the entity
like addAction
im not afraid of these incrementing numbers š
per-entity per-handler numbering isn't likely to run out when engine is good up to what? 1e6-ish or something?
How do I put sqf inside a little neat box on here
!code
```sqf
// your code here
hint "good!";
```
ā
// your code here
hint "good!";
I have something that might be better to work from
deja vu
Running in the 90s
I've just prompted this bot before? Higher on the thread?
It probably will need to iterate through deleted indexes though.
Muh CPU tacts
muh 8 bytes of memory per
Fudge didnāt work
Speaking of Killed, how come there is no remote Killed or at least one for server similar to EntityKilled but added to specific entities?
I really am useles
``` backticks. The ones to the left of the 1 key
[_vehicleClass, "init", {
_this spawn {
params ["_vehicle"];
// Wait for player to enter
waitUntil {
sleep 1;
(crew _vehicle select {isPlayer _x}) isNotEqualTo [] ||
!alive _vehicle
};
private _time = time;
while {sleep 1; alive _vehicle} do {
// If player in vehicle, reset timer
if (crew _vehicle select {isPlayer _x} isNotEqualTo []) then {
_time = time;
} else {
// All players not in vehicle and timeout
if (time >= _time + 30) then { _vehicle setDamage 1 };
};
};
}
}, true, [], true] call CBA_fnc_addClassEventHandler
Pretty sure remote entities also die and there is a way to run EH from there
It's `
Oh
Repurpose MPKilled to also work with addEventHandler but without code broadcasting crap
that first attempt looked a lot like autoformatted start/end quotes
I sure hope you're not writing SQF in Word
no, it's AltGr+ĆØ!
@tough geode AI units exclusively (or at least mostly) though 
Mhh? I just reposted his code as code nothing to do whit it š
F
More like 1M - missing 3 zeroes for the G.
But looking at it you should add a check if at least one of the crew is still alive. Or else your vehicle with a dead crew still won't get deleted
Oh lord it just keeps on going
So I need to add one check for every seat for the vehicle I am using
It doesn't need to be one check per seat.
if (({alive _x} count (crew _vehicle)) < 1) then { ... };```
It was a mess, this is from somebody who knows far more than me on how to properly set up the init, mine was a monkey bashing a type writer in hopes to one day write all the playwrites of Shakespeare
too sad Shakespeare didn't write valid SQF 
On a long enough timescale of monkey bashing typewriter, it eventually will
Lol
_whereFore findIf {name _x == "ROMEO"};```
Iām getting on arma now so Iāll do some extensive testing of the info here, thanks for the help with this youāve all provided it means really means a lot
For sure Iām going to use it to not be as dogsh*t at basic sqf
Likely it's just an arbitrary value to keep usage - and memory fragmentation - reasonable.
0 spawn { // Separate thread
if(!isServer) exitwith {}; // Run only on server side
while {sleep 1; true} do { // Forever loop with a small delay between iterations
{
// This vehicle wasn't assigned a cleanup thread yet
if(isNil{_x getVariable "my_cleanup_thread"}) then {
// Assign it and save into variable
_x setVariable ["my_cleanup_thread", _x spawn {
// Forever loop while vehicle is alive
while{alive _this} do {
// Waiting until vehicle no longer has alive pilot
waitUntil {sleep 1; !alive currentPilot _this};
// Start a timer and wait until either timer runs out or there is an alive pilot
private _timer = diag_tickTime + 50;
waitUntil {sleep 1; diag_tickTime > _timer || alive currentPilot _this};
// If condition ended and timer ran out, break the while loop with vehicle destruction
if(diag_tickTime > _timer) exitwith {
_this setDamage 1;
};
};
}];
}
} forEach (entities "Car" + entities "Tank"); // Keep checking all vehicles until new one is found
};
};
```Here is what I wrote
Has my mentioned downside that you might get into driver for less than 1 second and timer will keep ticking
Change alive currentPilot _this to crew _this findIf {alive _x} >= 0 to check for anyone in the crew being alive instead of just pilot
crikey
@pulsar bluff how can you lads bash that out in under an hour
No life all SQF gang
samatra and i have been doing it awhile lol
it's incredible
Does remoteControlled work with zeus controlled units?
yes
Thanks
tbh i just use ChatGPT for scripts now š
custom version, trained the GPT on all @meager granite scripts
I hope you asked them before doing that
that only matters for commercial use
I'm thinking about the ethics more than the legality
Following on, the page on remote controlling states that its all handled locally. Does this mean that if player A is controlling an AI then player B would not get a result from calling remoteControlled on it?
If that is the case how would I go about getting that information when executing from player B
I'll give them both a try
i turned to chatgpt but it just read errors for me idk why
yea i was kinda joking, gpt is trash for sqf scripts now..
i hear 4.0 might be better
its not good for anything it seems, i used it for an assignment and it really does just pull things out of the blue and relay them in an academic writing style
it was good from december 2022 to march 2023, since then imo its trash
then when you tell it its wrong it'll say "oh right my bad, heres another made up thing i pulled from the crevises of my starfish
openai must be feeding it tranquilizers lol
pretty new to this stuff but i saw someone run up to a box and ace interact and hit randomize shoothouse, how do you even go about setting a script up for something like that
is there a space to define class type
entities "Car" + entities "Tank" is sum of all Car and Tank vehicles, replace that with whatever class you need
entities returns all vehicles of provided class and its child classes
aah thanks
Yeah
private _controller = remoteControlled _target;
systemChat (str _controller);
Is logging obj null when another player is zeus controlling the _target
In this instance _target was a unit spawned by me taken over by player B
And that code was run on my client
local _target
must return true, for remoteControlled to work
So its not possible for me to use remoteControlled to see if any zeuses are controlling a unit unless that unit is local to me?
it needs to be ran where unit is local.
you could remoteExec it to there
@meager granite hello chaps, both tested, both have the desired effect! thankyou so much for your patience and cooperation, i have been stuck on this for a fair bit of time so to see two distinguished gentlemen crack out a solution in less than an hour is nothing short of extraordinary
i'll be sure to read over these scripts and learn a bit more about how i should properly set out sqf so i can be of a bit more help on this discussion board
thanks again to you all and have a wonderful day ā¤ļø
Would you have a vague idea on how to do that as to my knowledge when you remoteExec you cant return anything from it?
you can remoteExec back to remoteExecutedOwner
Like this?
Main script:
_target remoteExecCall ["DSS_fnc_checkIsControlled", _target];
Defined function:
params ["_unitToCheck"];
private _isRemoteControlled = !(isNull (remoteControlled _unitToCheck));
_isRemoteControlled remoteExecCall ["DSS_fnc_returnIsControlled", remoteExecutedOwner];
Defined function:
params ["_isControlled"];
DSS_Unit_Is_Controlled = _isControlled;
systemChat "Returned from local";
Q: about container (i.e. uniform, vest, or backpack) mass versus capacity.
mass, in relation to the container container. i.e. how does the container thingy stack in its host vehicle.
versus capacity, what the container can actually sustain in terms of load.
is there a difference? do we sum the mass of the container cargo? or is there a cost/benefit translation that can be realized?
let's see it in some numbers to be clearer...
// backpack, let's say, holds 10 things averaging 100 mass each
_thing_mass = count _things * 100; // 1000 mass, overall mass of the things
// could transliterate to things like backpack weight, let's say
// ...the backpack is actually 1000 mass units worth of weighty (whatever that may convert to in kg)
// backpack stored in vehicle, indicates 600 mass units
_backpack_mass = 600; // i.e. it 'just is' 600 mass units, whatever that is
// perhaps also a function of its load, fully loaded 600 mass units, forgiving for partially loaded container
_backpack_mass_actual = _backpack_mass * (load _backpack);
along these lines.
or am I giving ARMA too much credit here?
how do you even go about setting a script up for something along the lines of randomize a killhouse after ace interacting on a object
saw it on youtube video, i will send a video if you need it to understand what im talking about
Are you asking if item weight counts weight of stuff inside it?
No idea about vehicles, give it a test
Put lots of targets in a building, hide random ones to randomize it
How do i make it to where when I ace interact a object it randomizes it? Im new to this stuff so im just trying to learn everything I can
Probably an addaction and then just 50/50 if it renders or not in a foreach
yes and no. I am asking if there is a cost/benefit, i.e. does a container (backpack, etc) mask the full mass from its host container?
i.e. there's a reason why we like backpacks (or vests, or uniforms), because it makes things easier to carry...
ARMA mechanics-wise, mass
to clarify, I know I can sum the cargo mass of a backpack, that's not really the question.
but whether the vehicle may see the backpack fully loaded as 600 mass? whereas the contents are 1000 mass worth of items.
my question is whether that is a thing, or too much credit given ARMA on my part.
yea, ill just look for a youtube video lmao, I dont really understand much of scripting at all lol
I can relate to this question, since this is kinda confusing, as mass does mean multiple things for containers in arma:
The capacity of items possible to carry =/= the carry capacity in mass units for a container to carry.
The mass of the objects units =/= as their actual weight ingame.
A container has a weight, size AND mass limit it can carry at once.
I don't know, do a quick test in the game
I read this to mean mass is the effort to homogenize the question? i.e. is the same for the container contents as to the host object?
well, of course I would, I'm here to gain some insight and make an informed decision whether what to do about that next.
saw the edited version.
To what I have experienced, mass is not masked, no.
And it can be the opposite to what you actually described. The size, amount and weight limit of the items in the container can be reached even before the mass storage limit is.
The size, amount and weight limit of the items in the container can be reached even before the mass storage limit is.
I'm not sure I understand... it's not just about mass, sum total compared/contrasted with its container?
or rather mass of the container (backpack) times loading, 50% of 600 let's say...
would contribute ~300 mass to its container...
that would make sense.
but that mass is the same budget for backpack contents as for gauging backpack host container loading.
no, each container has a maximum amount of items they can store in them, lets put a number on it:
100 x-items
Lets assume each item is 2 mass units each, so 200 mass withing those 100. The container can carry up to 600 mass units.
Even if you dont reach the max in mass, you cant keep loading because your item cap is already topped.
The same happens with weight
what makes it troublesome is that there is 2 different properties called mass within arma, the actual mass in grams, which is assigned to the model, and the mass unit which is assigned in config to occupy container space. Imo it would be cleared it it was called volume instead, for example
well, those masses aren't frequently met in the same context. Model/physx mass is barely present outside of, well, physx, config/inventory mass is barely present outside of inventories 
Iām not entirely sure where to ask this. Is there a way through a script or a mod, etc to add a suffix after a playerās name in the lobby, such as āCypher [Pvt]ā ? I donāt want players to have to go edit their profile names. I want to just be able to do it behind the scenes with code.
ah okay so there is a count involved. critical to know this as well. is that in config somewhere?
wait what, is it actually a mass in g, we know that for certain?
to clarify, I think of mass as not being weight, per se. seems to be the common confusion about the mass unit. mass being as much a reflection of wieldiness as it is weight.
weight a minute
š¤£
bonus joke: how do you weigh influencers? in insta grams :p
Lou has jokes...
my goal is to manage a container inventory apart from having to visit adding cargo or cargo global every time, or refresh from the same.
manage it in one view, then apply once.
so I need comprehension of container, masses, capacities, apparently also counts, etc.
mass ingame seems to be best compared to density
would prefer if mass and bulk were seperate things but it is what it is
afaik, in Arma 3 "mass" counts as mass and space; some kind of density ^ yes
sounds awfully close to "let me rewrite the engine cargo system in SQF"
until we can add fake mass to the inventory we cannot do better š¤·
i would if gui stuff was easier to do š
only one measurement for Arma 3, volume + mass in Reforger
understood, understood, it's not a criticism. working with what we got here.
(no criticism ever taken, aware of limitations ^^)
thank baby jesus for this
so back to the container maximum count. that is reflected in config at all?
or is that a function of content masses?
the one in model its a fact, THOUGH, I dont remember if its grams or kilos
maximumLoad considers the mass units of the items.
The other ones are called transportMaxSomething
class CfgVehicles
{
class ReammoBox;
class Bag_Base : ReammoBox
{
scope = 1;
class TransportMagazines {};
class TransportWeapons{};
isbackpack = 1;
reversed = 1;
mapSize = 2;
vehicleClass = Backpacks;
allowedSlots[] = {901};
model = "\A3\weapons_f\Ammoboxes\bags\Backpack_Small";
displayName = "Bag";
picture = "\A3\Weapons_F\Ammoboxes\Bags\data\ui\backpack_CA.paa";
icon = "iconBackpack";
transportMaxWeapons = 1;
transportMaxMagazines = 20;
class DestructionEffects {};
hiddenSelections[] = { "Camo" };
hiddenSelectionsTextures[] = { "\A3\weapons_f\ammoboxes\bags\data\backpack_small_co.paa" };
maximumLoad = 0;
side = 3;
};
};
not quite, but I do gain the comprehension... the end game of my goals with this is to persist inventory profiles, in much the same way virtual arsenal does player loadouts. so that players call up vehicle inventory in much the same way.
I see I see...
transportMaxWeapons, transportMaxMagazines, of any sort, I take it?
then there's the whole allowedSlots kerfuffle, sort of filter on types allowed.
It makes more sense to append a file via extension than to use the clipboard for huge file sizes.
yup, + knowing if the item itself can be stored in an specific type of container and so on.
You can even config bags that take bags inside for example. There is very few of those
does ARMA even watch transportMaxWeapons and so on?
testing in game, I have a backpack, claims 1, but I just put two pistols in there...
allowedSlots seems like a harder constraint, though.
so allowedSlots is declarative in nature, these are the containers that can hold me
allowedSlots is less a concern today in the first beta draft, but I had considered possibly a tree like view in which players could also manage sub-containers, the backpacks and such. then it would be more of a concern.
would anyone recommend a place to learn the basics of scripting?
looking to make a project further down the line of making scripts to randomize a killhouse after ace interacting a prop.
sure! here is https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting š
thanks a lot! I know like nothing lmao but got some big projects I wanna do
Any idea on why I'm getting a missing ";" on this. It's on a trigger set to make a task successful
!alive TK1 and !alive TK2 and !alive TK3 !alive TK4 and !alive TK5 and !alive TK6 !alive TK7 and !alive TK8 and !alive TK9 !alive TK10 and !alive TK11 and !alive TK12 !alive TK13 and !alive TK14 !alive TK15 and !alive TK16 !alive TK17 and !alive TK18 !alive TK19 and !alive TK20 !alive TK21
ye youre right @gray bramble ... i was still drunk when i wrote that :)
@vocal mantle thats correct! however, it is also a kinda large overhead to create an extension and most people are not capable of doing so
[TK1, TK2, TK3, TK4, TK5, TK6, TK7, TK8, TK9, TK10, TK11, TK12, TK13, TK14, TK15, TK16, TK17, TK18, TK19, TK20, TK21] findIf { alive _x } == -1
```š
I would like to make an Megaphone mod and given that i want it to be compatible with TFAR and i'm not an expert at Teamspeak API, i decided to code it in c# with DirectX. In order to do this i made a voice recorder and a voice modifier. But, in order for other players to receive the voice data, i made a kind of daemon in charge of receiving and playing the voice on the receiving computer. I know Arma 3 throws a warning when a dll takes too much time to execute but would it be better for that daemon to be in the dll or in a separated executable file ?
I would also like to know if it's ok for a dll to call a another system dll (which has propably not been whitelisted by Battleye) ?
#arma3_tools might be better for this, here is about in-gamr SQF scripting š
I think it is OK, to be confirmed though
Understood.
Thanks for your answer š
Is there any "solo tank" script that works good on MP ? I used the module from MGI but it causes issues with vehicles that have multiple gunner positions
You can just spawn AI crew for the vehicle with createVehicleCrew. If you don't want them to shoot/move, you should be able to just disable those abilities
will anyone be so kind to guiding me to make a script to making ai passive until shot at
trying to walk around like right next to them and not get shot at
I have no experience scripting either so please bear with this stupid quesiton
I have a function that recursively finds the CONFIG property by _targetName starting from a _cfgRoot. recursively drills through nested classes to find the property(ies) aligned with the name.
I am after the maximumLoad, or the mass, depending on what a container class may be, uniform, vest, backpack ... actually, my results sort of address the question I had earlier, capacity (what a container may carry) versus bulk (may the container be carried by another container) ... at least for backpacks it may. not so much uniforms or vests, as demonstrated here:
_ucfg, _uclass, etc, are the CONFIG and class name (STRING) for the thing in question, _u..., _v..., _b..., uniform, vest, etc, you get the idea.
// [_cfgRoot, _targetName, _first]
[_ucfg, ['mass', 'maximumload'], false] call MY_fnc_findConfig apply {[_uclass, configname _x, getnumber _x]};
[_vcfg, ['mass', 'maximumload'], false] call MY_fnc_findConfig apply {[_vclass, configname _x, getnumber _x]};
[_bcfg, ['mass', 'maximumload'], false] call MY_fnc_findConfig apply {[_bclass, configname _x, getnumber _x]};
// // results:
// [["rhs_uniform_FROG01_d","mass",40]]
// [["rhsusf_spc_marksman","mass",80]]
// [["B_Carryall_cbr","maximumLoad",320],["B_Carryall_cbr","mass",60]]
for total mass purposes, do we count the mass of the container in addition to its contents?
but moreover, maxLoad _uobj and maxLoad _vobj are both reporting 40 and 60, respectively.
so are we to take it, these containers' mass is also capacity?
obviously, the numbers suggest, yes, question is, is there any other choice?
question also on backpacks, does mass mask the maximumLoad capacity when storing in another container?
Walk you through it when I get home from work later today if you are still up
bet
Did anybody find the magic Formular for setDriveOnPath to make a unit drive to the exact spot?
Like, I need it to be exact to half a meter to make units park during a checkpoint mission and they are always stopping like 5-10 meters in front of the actual spot
Or how to reliably detect when the path has finished being driven?
http://killzonekid.com/arma-scripting-tutorials-one-man-tank-operation/
His one is working good so far as basic
Can you not just use PathCalculated event and then have a script to check the end value and the unit's relative position? I may be misunderstanding what you want though
Edit: In theory you could add a waypoint on the exact point you want for the group and use WaypointComplete event to check as well
I guess allUnits inAreaArray [position, radius, radius] is the best way to search for units nowadays?
position nearEntities ["Man", radius] is faster but doesn't include units in vehicles
Hey, does anybody know how can I obfuscate a .SQF file?
in 2023 theres little reason to bother. its not 2015 anymore
still i want too, how can I?
how do I select an individual in eventhandler fired? I mean, I want a code to be executed on to any specific player that fires his weapons within the proximity of an object. I just dont know how to define if shot is fired, effect only the guy who fired it
Fired fires in 100% cases where unit is local OR on server client
hello is there a way to dump the names of the animations of a plane
I want to fix pook's incoming.sqf file
"true" configClasses (configFile >> "CfgVehicles" >> "class" >> "AnimationSources") apply {configName _x}
Depending on what you want to do, added the EH, then simply check the distance between the unit (_this select 0) and your object
I put this in the entity in eden?
and it copies it to clipboard
?
No, run this script in debug console but replace "class" with your vehicle's classname
If you want this code for init field and copy to clipboard, do:
copyToClipboard str ("true" configClasses (configFile >> "CfgVehicles" >> typeOf this >> "AnimationSources") apply {configName _x});
roger that
he has such nice code but half of it isn't declared
found the error that has been plaguing people that use pook soviet airforce pack with a lua error
a missing }
if (_pP select 2 > _pM select 2) then {
_highlow = "Low";
} else {
_highlow = "High";
};```
Is this block of code correct
typesqf editor says expecting semicolon
on the first line
Check the line(s) before that as well. Missing semicolons (or other things that can cause that error, like wrong command names) aren't always detected at the place where it's actually missing
player addEventHandler ["fired", {
if ( (_this select 0) distance2D safespawnmfv1 < 20 )
then
{
_safespawnentity = getPosATL (_this select 0);
_safespawnentity set [2, 1000];
(_this select 0) setPosATL _safespawnentity;
hint parseText "<t size='2.0'>Working</t>";
}
else
{
hint parseText "<t size='2.0'>Failed</t>";
};
}];
Any idea where I made a mistake? It suppose to teleport a player who fired a weapon into the sky, I aint getting any errors, it just does nothing
Is safespawnmfv1 a) a variable that actually exists and b) a variable that contains an Object or Position (not a Marker or anything else)?
"safespawnmfv1" is a helper sphere, that exist and is named
When I was writing the script I executed it and it would only give me errors when I was within 20m from that sphere, so game does recognise it
Have you respawned between adding the EH and testing it? I'm not sure whether fired persists between respawns or if it would stay with the old player unit
I did the removeeventhandler command, I will try to respawn or restart the mission all together
And when you say it does nothing, does that include not showing the hints? Both for inside and outside the radius
Where do execute this?
If its on mission start, player might not be yet available
Global in Zeus Enhanced, "execute module"
No idea what this is, check if this field executes code at all
Do something like hint "test"; or something
Also player is local player, you're not expecting this to work on another player, correct?
If its global code execution, it should be fine
Execute Code module is a Zeus module that gives you something like the debug console when you place it, you put in your code and you can choose to server exec, global, local, global+JIP
I'd be very surprised if the Zeus Enhanced one simply didn't work at all. It's a popular and maintained mod and I'm pretty sure someone would've noticed.
I will test it in a bit
@candid sun - thanks, guess I will have to use it
I got this error
private["_highlow","_pP","_pM"];
/** missile HEIGHT check - is it "high" or "low" ***************************************************************/
if (_pP select 2 > _pM select 2) then {
_highlow = "Low";
} else {
_highlow = "High";
};```
How / where do you call current code?
it's from pook's incoming.sqf
When Ai is shot with a missile it does a calculation
I'll post the whole sqf in sqfbin
I try to fix the sqf so it works properly cause it has lots of potential
with jamming and such
At line 145/146, try moving the private definition before the while line
I think the relevant variables are being made private to the scope of the while loop and therefore don't exist outside it
I see
I'll inform you
I did the thing with putting all the private variables from within while out of it
I may have put the }; at a wrong spot I'll do a check
*sqf
yea that
Working on some custom vehicle compositions in editor with attachTo
Does anyone have a script that outlines module hitboxes for vehicles?
With selectBestPlaces , the "hills" parameter doesn't seem to work. Is that normal?
What were you expecting it to do?
hills 0..1 how much is the place "hilly" (160 ASL -> 0, 400 ASL -> 1)
score for a place is always 0 with "hills" parameter.
Which map?
altis
oh wait... 160 is zero???
so it doesn't catch any hills at all until you get into extreme hill territory?
KK makefile is nice
hey would theses 3 work in a single trigger?
be setDamage 1;
boo setDamage 1;
bill setDamage 1;
pop setDamage 1;
Is there a command for colorSelectBackground[]? I looked through all ctrl commands and lb commands for it and haven't found it.
I'm trying to change the color dynamically in a mission
Hi, i have a question ? When you use the command "remoteControl" is it possible to be able to command the troops too like in the zeus ? Because when i switch to a unit, i'm able to control it but i'm not able to see who is in his group.
Yes
oh ok how ? I'm realizing that in the zeus i have a mod and it's maybe that mod that does that in particular, maybe not
sorry my explanation was bad, atm i don't want to know how to remote control someone but how to be able to command a squad when you got the control of the squad leader š
The example 1 pretty tell you how it works and I don't know how else to explain
but the first example explain you how to remote control a unit but when you run that, it's working but if the unit you are controlling has 5 units in his group, you won't be able to control them, that is what i mean š
Wait so you want to remotecontrol a group leader and control your squaddies as well?
exactly š
wait no
"his squaddies"
because atm i can control mine but i don't want, i want to control his squaddies exactly like if i was him š
I do not think there is. Even Zeus doesn't let you to do so
yeah but i have a mod that does, i thought it was the zeus but i don't think, i'm checking, if i have the solution i will tell you
ok i found, it's not "remoteControl" but this mod has a function to switch to a player and that function use "selectPlayer" so it seems to be that
btw thank you for your answer š
hi guys, quick question that might turn into a whole lotta questions. when a unit joins the player's group... who is the actual owner? as i read it, it would be the group leader?
to clarify, the unit is local to the group leader?
im just driving myself nutz with a hostage with a joinsilent addaction, a handleDamage EV that adds a holdaction... and EV fires many times... and there is more.
correct.
all works "well" if i joinsilent and join grpNull in sequence after the unit is created. but "well" is not tested with other players.
Players stay local to their own client regardless of group leader, if you were asking that.
no, that i know. but local argument commands get tricky now. like allowDamage i.e.
also the EV is firing multiple time. and so much more.
AIs & group switch to the group leader locality, although I'm not sure if there's a different rule if there are non-leader players in the group.
If you create a new group and join an AI unit to it, the group switches to the unit's locality rather than vice versa.
I think it should be local to the server itself unless you pass the locality of the group to some client, like HC
i do owner _unit, returns server. i joinsilent the _unit, owner _unit returns 4 (which i was sure it should be 3 but anyway.
by server i meant 2
its quite a lot of lines to post here. but maybe the EV alone will give you an idea.
{HostageUnit addEventHandler ["HandleDamage",
{
HostageUnit = _this select 0;
private _damage = _this select 2;
if (_damage >= 0.7) then {
H_RexecTarget = owner HostageUnit;
publicVariable "H_RexecTarget";
{HostageUnit allowDamage false; HostageUnit setUnconscious true;} remoteExec ["call", H_RexecTarget];
{HostageUnit removeAction 1; HostageUnit removeAction 1;} remoteExec ["call", 0, true];
[west, "Hsave", ["The Hostage has been Shot! Hurry!!", "REVIVE HOSTAGE"], [HostageUnit, true], "ASSIGNED", -1, true, "heal"] call BIS_fnc_taskCreate;
[] spawn RPR_HostageCountDown; //this is countdown with stuff.. does work regardless of EV.
[HostageUnit,
"Revive hostage",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa",
"_target distance _this < 2",
"_caller distance _target < 2",
{_caller playMove "AinvPknlMstpSnonWrflDr_medic1";},
{},
{
{HostageUnit allowDamage true; HostageUnit setUnconscious false; HostageUnit setdamage 0;
HostageUnit PlayMove "UnconsciousOutProne"; HostageUnit enableAI 'anim';} remoteExec ["call", 0];
HostageUnit spawn GF_Missions_addaction_Join_Disband_Hostage;
},
{_caller switchMove "Acts_Accessing_Computer_out_short"},
[],
5,
100,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0, HostageUnit];
};
}
];
} remoteExec ["call", 0];
well, that's horrible :P
oh yeah... it was worse.
- probably make a function and remoteExec that rather than transmitting a whole lot of code inside
call - remoteExec accepts objects as the locality target, so if you need to remoteExec to where the unit is, just provide the unit. You don't need to find the owner, the game will do it
Also, handleDamage EH can indeed fire many times. Every time any part of the unit is damaged, which can be several times per hit as different body parts take damage. If you want it to only do something once, you'll need to add a safety, like setting a variable true the first time it happens and having an if to skip the code if that variable is true
i was running the EV like this "[HostageUnit, ["HandleDamage", {_this call RRP_HuEH}]] remoteExec ["addEventHandler", 0, true];" then had to scrap to better look at the code. im going nutz already lol
those are good pointers @hallow mortar thanks
so, for the remoteExecs it'd be something like "[_unit, true] remoteExec ["allowDamage", _unit];" ??
Yes.
If you have a bunch of commands to process on a unit, some of which are local, you should group them into a function rather than spamming remoteExecs though.
you mean like full function with class in description.ext?
Ideally.
If you're writing dirty stuff then you can broadcast functions with publicVariable :P
ok, im using a lot of {} remoteExe ["call"]. is this a bad thing?
Yes.
Make a function, remoteExec that instead.
Also I'm not absolutely sure that your HandleDamage is returning nil. Always check that. Breaks things badly otherwise.
A non-CfgFunctions function (defined by variable in a script run everywhere or by publicVariable) will have the same benefit in this case - reducing the number and size of remoteExecs, saving network traffic - but CfgFunctions functions have other benefits too, such as performance and security.
Sometimes I do use remoteExec ["call"] when the function's very short, but generally it's something to avoid.
yeah.. testing all that in dedi would take me ages. so many restarts every time i mess up.. wich is a lot. tried filepatch.. still wont let me edit and save.
Yeah, filepatching isn't great on a server atm.
im just writing it and pasting in the console until it works.
When you remoteExec code using call or spawn, all that code is transmitted over the network as text. When you use functions, only the function name is transmitted and the clients refer to their local copy of the code, making the network message much smaller and faster.
another great pointer.
i was hoping not having to learn how to make functions and declare them on ext until later on when i was sure shit was working right.
You could do the publicVariable global functions thing for now. At least you can write your functions and event handlers in different ADT windows then :P
Any way to Attach two objects together using Memory Points, I want to attach 2 walls via a scrip using a memory point on each of the models.
attachTo is the command
for objects that you dont need to animate, you could try larrows compostion spawner. you just make it all in the editor, save compostion, and well, read larrows instructions.
for some reason, at least i can not animate composition objects spawned with his script.
also, you need to give buildings with doors a variable name and make it publicVariable. or clients wont be able to open them. that's my workaround anyway.
I know about the AttachTO Command but when using it, it attaches based on 1 memory point alone, not both of the memory points
There is no way to do. I've no clue what exactly is your expection though
Say I have a custom wall model, on the edge of each wall is a memory point I want to have a script which attaches one of the walls to the other but have them connect at the memory points so to speak
didn't kllzone_kid make a function for something like that?
No idea what does "connect" mean
he basically wants "snap" points on the wall edges, i guess?
Essentially
[_obk1, _memory 1] attatchTo [obj2, _memory 1] just made that up to express the idea. is this the intention?
You can probably base the attachTo offset on the modelspace position of the attached object's memory point.....with a lot of vector maths
(selectionPosition)
@wise frigate you should really check larrow's compo spawner.
just google that.
although, learning how to do the attatch thing is way better.
Gotch Iāll look into it
ok, the EV triggers many times IF the unit is local to the server. once it joins my group once it all works.
even if it leaves the group
anybody ever experienced a crash with setDriveOnVehicle? 
ahh
just was a 2 minute freeze
How long was the path? :P
40 nodes
yeah .-.
setDriveOnPath does not play nicely with damage at all
thats bad ... need a convoy that refuses to follow a path ... and have it stop once any of em takes damage
bloody AI ... why is creating convoys this embarresingly bad š¦
may i have some help? Would anyone be willing to point me to the correct sources to build a script that randomizes preset shoothouses i made (only happen when player run to a object and ace interacts)
very new to scripting, this will be my first project, would love to learn anything anyone has that will help in my journey of scripting š
I would have thought the easy way to do that is teleport the player(s) to a different place on the map.
Making a randomized killhouse is very hard from my perspective. You need to take almost everything into count, like the size of the house, target pos, anything into the script and make it into one thing and randomize everything is very hard
I'd suggest what John said
Or, probably randomize show/hide the predetermined/placed target and call it a day
so have different shoothouses made spread across the map and the interact would tp them?
That exactly is the suggestion
hm interesting
im just thinking of how i could use that, obv this is for a milsim im in the midst of making so just seeing what i can do
You certainly can spawn a predefined collection of objects in a particular formation as an alternative, but that's a few extra steps.
Also likely to look weird unless you have a very flat surface to place it on.
yea it would be in a big building that is all the same terrain level
sorry i dont mean this smart assy at all but basically what i said above?
?
again im very new and just trying to learn
The tricky part there is turning the objects into data in the first place.
Once you have them it's just setPosWorld + setVectorDirAndUp.
I do not think turn things into data is a big concern, you can just show/hide a layer that is defined in Eden
yea i was experimenting, i am working on the box they run up to in order to randomize it
ah yeah that's probably easy. I can't remember the command for it.
i only plan to go as far as the interaction that says randomize shoothouse (only as far as ik)
so just looking to learn from someone or be pointed in the correct direction
One thing you definitely should to determine is how and what should be randomized
The interaction part is just addAction. In this case you'd probably add it in the script box for an object.
would it help if i sent a video representation of what im wanting?
Definitely and why not
sorry just dont wanna be a hassle to yall!
Just upload it here. Not my DM
it just gets deleted instantly sadly
Oh wait you're very new Discord user to post one
We've made this restriction to prevent spam
ah yea i had made a new discord recently
yea it is a youtube video, i can drop link rn if need
I am asking because posting a recorded video is very unreasonable and I really cannot tell what is the need you want from this clip
Been working on this for a bit, still need to make animations though
i should clearify only the first 10 seconds of the video is actually what im wanting
sorry about that
Okay if you mean you want to layout the room, walls, targets, maybe doors randomly, it is not a script that can be done within hours
yea im fully aware that it wont be an easy task
Always start from a very small step, especially if you're very new to the entire script syntax
This is pretty much what John and me told
alright, how do you recommend i take baby steps on this? the teleport player to a shoothouse?
And the easiest is (script wise), make multiple killhouses, teleport the player into one of them
thank you!
what is the difference of using VS (script writing thingy) compared to using a init box of a object?
I don't know what is VS
visual studios code
VSCode and Init box are not comparable. Different software
If you mean SQF script file vs Init box, my very wild guess, essentially nothing is different. But SQF file is better to reuse, maintain and anything
so basically i can copy sqf's from one mission to another with the code saved instead of copying and pasting the code into an init box again if used in a different mission?
Init boxes are normally something you want to avoid unless you're just adding a small amount of mission-specific script to a mission.
alright thank you, i was just curious. Not sure how all this works yet
Hi
I need help with this code here. why i am getting player position near [0,0,0]
NOTE: player position was near molos.
player selectionPosition "head";
[0.0888845,0.110778,1.50533]
it nearly to [0,0,0]
I am trying to get blue2 head position to try to make nametag above their head. but i always keep getting somewhere near [0,0,0] which it lead to getting the Draw3D in wrong position.
selectionPosition's base is object, not world
Pole addAction ["Teleport To Shoothouse",
_pos = getPosATL pad;
player setPosATL [_pos select 0, _pos select 1 , _pos select 2];
teleporting me to random coords and not the pad coordinates [pad is object i wanna teleport to]
```sqf
// your code here
hint "good!";
```
ā
// your code here
hint "good!";
Post the entire code precisely
_pos = getPosATL pad;
player setPosATL [_pos select 0, _pos select 1 , _pos select 2];```
Pole addAction ["Teleport To Shoothouse",
_pos = getPosATL pad;
player setPosATL [_pos select 0, _pos select 1 , _pos select 2];```Is this the entire script?
yea it is
Are you sure? Because it is not even going to process, but fail and throw an error in the first place
_pos = getPosATL pad;
player setPosATL [_pos select 0, _pos select 1 , _pos select 2];
}, [], 6, false, true, "", "_target distance _this < 2"];```
Thanks I have used modelToWorldVisual and it worked
i mean thats all i have in the script
the bottom part from my understanding is how far the interaction pops up from the player
im not getting an error, the interaction is running just putting me in a random spot?
so im not sure
- You need to wrap the brackets. addAction takes a code to run and a code needs {} bracket. You have no {
- Make sure pad is there, where you want to refer
- (Suggestion) setPosATL getPosATL ... is enough
{ is in the bottom part, first character in bottom
}, [], 6, false, true, "", "_target distance _this < 2"];
yea i typed the wrong bracket
in the code above it is there
}, [], 6, false, true, "", "_target distance _this < 2"];
the first character is the wrap bracket
Pardon?
Are you sure the code you've just posted, is is the actual code?
I'm asking because it is impossible to run, or at least having no error log
yea im sure lol, it the only thing i have opened/made
is the } from the bottom part of the code not the wrapped bracket you are reffering to?
.
You MUST have both start and end bracket
This should happen if you try to run your code. The code is not going to be recognized properly by the game
Pole addAction ["Teleport To Shoothouse",{
player setPosATL getPosATL pad;
}];```It can be altered and simplified into this
im sorry man, i dont mean to make you mad or annoyed, im just trying to learn. What i sent was the full thing so im not sure what was going on
i appreciate you simplifing it for me also
I'm not really angry or mad. I'm simply confused because you cannot run it despite you say you've ran it
yea again as i said im not sure
If you don't tick "show script errors" in the launcher then everything fails silently.
however im still running into the same issue with this simplified version, it is putting me in a random spot of the map
You cannot avoid to see the error in Eden Editor and its preview
it is weird though because it is putting me in the same spot as the last code
Possibilities:
- You're not running it but something else
- You have a faulty Mod or script in your mission
- You're modifying an old mission or file
what is pad exactly?
getPosATL pad will return [0,0,0] if it doesn't exist or isn't an object.
If pad is not an object it will return an error and not going to run
pretty sure it gives [0,0,0] for objNull at least.
invisible heli pad that i named pad
Are you sure pad does exist when you execute the code?
test in smaller pieces anyway. Run getPosATL pad in the debug console.
Or simply pad
copy will do that right now and come back
okay im not sure what it was but refreshing my game fixed my issue, it is spawning me right on pad
i appreciate the help greatly, means tons to me
private _logic = createAgent ["Logic", getPos player, [], 0, ""];
[teamMember _logic, isNull teamMember _logic, teamMember player, isNull teamMember player];
```=>`[Agent 0x1b854080,true,<NULL - team member>,true]`

a ! may be missing somewhere in the engine š
Guess nobody ever used isNull TEAM_MEMBER since 2009 or something?
Unless it means something else in context of team members
team_member is not exactly used afaik? introduced in A2 but left aside
Looking at CfgTasks its used for animals? Or was used.
Its so Arma to develop some complex feature and then just ditch it
Guess nobody ever used isNull TEAM_MEMBER since 2009 or something?
Actually something changed not so far ago (2.* versions, firstly noticed in April this year) - EHs which worked well before, started to get team members or so instead of units, with messed/wrong parameters set (like string instead of object).
This was one just of perf builds
Howdy ho, Quick question for yall maybe you could help.
Basically what im trying to do is a log system similar to Liberation where it saves kills, rounds fired, ect over multiple missions using ALiVE. So once a certain kill count is met over those multiple missions it does the BIS_fnc_endMission function. I dunno if thats possible lol so just asking cheers
Hi,
So i run a Arma unit and iām trying to figure out how this works. https://community.bistudio.com/wiki/radioChannelCreate
Is there maybe a way to create a squad in the editor and give the squad the variable AlphaSquad for example, then i call the variable and everybody that is in that variable will have access to āAlpha Channelā and same with Bravo and Charlie.
If anybody could help me out with how this would work in scripting and where i put this code, it would be so much appreciated.
Can't they just use Group channel?
Ofcourse, but is there a way to like maybe change the name?
You create a channel, then add units to that channel to get the effect you want. I'll give an example when I'm home
@wispy venture https://sqfbin.com/adehigozubuxizekesen
Hello there!
You know how in Spectator Mode, when you're spectating a player (not on free camera), the camera mode automatically toggles between 1st and 3rd person as the player remotely do so?
Does someone know how it does that?
Does it use the UserAction event handler as in "addUserActionEventHandler ['personView', 'Activate', {}]" to broadcast the player's view mode changes? Or is there another way like monitoring a variable?
And this does what exactly?
I think its done automatically, view mode is sent over the network and applied when you switch camera to a player unit.
That creates custom radio channel. And assings the player to that channel. so player can see it. And reassings the channel to unit after he respawns.
So this is for every player to join that channel. It's just to give you an idea. To do what you want you'll have to do some additional condition checks to add to channels.
you use event handlers + saving variables to the profilenamespace
Quick Question is there a better way of doing this code then this:
params ["_unit"];
if(isNil {_unit getVariable "LEG_Is_BlackAndWhiteEffect_Active";}) then {
_unit setVariable ["LEG_Is_BlackAndWhiteEffect_Active",true,false];
};
if(_unit getVariable "LEG_Is_BlackAndWhiteEffect_Active") then {
systemChat format ["Effect is Active"];
_unit setVariable ["LEG_Is_BlackAndWhiteEffect_Active",false,false];
//effect Active
effectHandle = ppEffectCreate ["ColorCorrections", 1500];
effectHandle ppEffectEnable true;
effectHandle ppEffectAdjust [1, 0.4, 0, [0, 0, 0, 0], [1, 1, 1, 0], [1, 1, 1, 0]];
effectHandle ppEffectCommit 0;
}else {
systemChat format ["Effect is Not Active"];
_unit setVariable ["LEG_Is_BlackAndWhiteEffect_Active",true,false];
//Effect Deactivated
effectHandle ppEffectEnable false;
ppEffectDestroy effectHandle;
};
Legion - just note that you can set a default value when you use getVariable so you do not need the first three lines.
The second if() could be written as
if (_unit getVariable["LEG_Is_BlackAndWhiteEffectActive",false]) then { ...
It's also a local (network) effect, so saving the status to _unit doesn't really do anything for you since your only probably going to want one effect per client. Also you can check if the effect is enabled using ppEffectEnabled. Since you're already using a (network local) global variable, so you could get away with doing something like this:
if (isNil "LEG_Is_BlackAndWhiteEffect_effectHandle") then {
LEG_Is_BlackAndWhiteEffect_effectHandle = ppEffectCreate ["ColorCorrections", 1500];
LEG_Is_BlackAndWhiteEffect_effectHandle ppEffectAdjust [1, 0.4, 0, [0, 0, 0, 0], [1, 1, 1, 0], [1, 1, 1, 0]];
LEG_Is_BlackAndWhiteEffect_effectHandle ppEffectEnable false;
LEG_Is_BlackAndWhiteEffect_effectHandle ppEffectCommit 0;
};
private _isEnabled = ppEffectEnabled LEG_Is_BlackAndWhiteEffect_effectHandle;
LEG_Is_BlackAndWhiteEffect_effectHandle ppEffectEnable !_isEnabled;```
This approach gets rid of your `systemChat` calls, but I'm unsure if you want those in the final version. In addition, the above code doesn't address the fact if you create an effect with the same priority (in your case 1500) as another effect, it will fail to create an effect and `ppEffectCreate` will return -1. You can see a few examples on the Post Process Effect wiki page about how to handle that though (https://community.bistudio.com/wiki/Post_Process_Effects)
But a better question is what are you trying to do? There may be a better way to approach it or other considerations
Is there anyway to detect when a players stance has changed?
Hello !
I'm doing a mission where a BLUFOR talks to you when you get close with a trigger.
It works very well, the problem is that I'd like it to have several sentences available, and that each time you move away from it then move back towards it, it would choose the next sentence available, and so on, to add realism and not repeat himself constantly.
Can anyone help me on this ?
could you enjoy a random between multiple sentences instead?
Yes of course !:D
That was my main idea but I thought it would be too difficult to do
[theGuy, selectRandom ["sentence1", "sentence2", "sentence3"]] remoteExec ["say"];
having issues with htmlLoad when the html file is within a folder, not in the root directory of the mission
forward slash / doesn't do anything.
backward slash \ crashes the game
yep
ok
\\ ^^
ty lol
@winter rose not working still unfortunately
VScode relative path: client\spawnmenu\infoTitle.html
your code?
_ctrlHTML htmlLoad "client\spawnmenu\infoTitle.html";
didnt copy correctly my b
_ctrlHTML htmlLoad "client\\spawnmenu\\infoTitle.html";
hmm, ok
can you try
_ctrlHTML htmlLoad getMissionPath "client\spawnMenu\infoTitle.html";
```?
Thank you very much for your fast help ! But since I'm a newbie, where should I put this code on my .bkip file ? This is the code I have in it : https://code.empreintesduweb.com/14965.html
wait, I thought you had your system ready* š
then bug
pinging @still forum no bug
mood
What do you mean ? š„ŗ
ready*
Well, my system is ready, I mean my computer is on
Sorry sometimes I struggle with english
(I wrote "read" at first, I edited the message)
I wondered how you made your soldier speak?
Comment fais-tu parler ton soldat,
kbTell?
https://github.com/SGTGunner/WARSIM.Altis/blob/a03fb2632ed5f2ce1cb50fcad3e4935f75905ac8/ui/roles/init.sqf#L30
@winter rose searching Github, this shows \ is correct.
Yesterday, I was doing \ and it would crash my game.
I'll try again now
and it worked this time!
no crashes today 
@winter rose I basically used the exact same template as this guy in this video : https://youtu.be/-uqyg1FA8As?si=OTXYFjVD82tLtA97&t=130
Had a lot of requests for this, NPC voice chat with spoken text on screen. It's a real pain to set up, I hope you're not confused by this information.
Download the mission file here:
https://drive.google.com/file/d/16u0-sA4TYDBzWdL451od-ENRBZM8o8Vh/view?usp=sharing
It's in zip format, so extract it, move it into your missions folder in Arma 3...
stop crashing games and it will be fine š
(glad to hear it works! ^^)
aaaaaah, using the https://community.bistudio.com/wiki/Conversations system š¬
@winter rose Am I stuck with this ? š¢
I mean the system don't allow me to do that ?
ah you cannot write "bad words" so the "mf" in it is blocked yes
but I saw it
Oh ok forget about the MF ahah
I still don't understand how to do the random sentence thing š
using BIS_fnc_kbTell is tricky, I would have to think
better to only use kbTell alone for this
(also, you are missing a ; after your text = "")
Damn I really do try to understand coding but it's such an alien language for me š„ŗ
I don't understand, but it's normal
sorry, I can't help rn
but I wrote the Conversations page and it should provide everything you need
Don't worry I understand, you're not my employee hehe 
I will try to understand the conversation page
I like to help, but BIS_fnc_kbTell is really for conversations and not one-time chats, or you would have to duplicate things etc and I don't exactly remember how it works
so kbTell or say are safer, simpler bets
But with kbtell only I can't show the text on the bottom of the screen, no ? @winter rose
you can have the radio subtitle yes
Hmmm, and let say I do like 3 triggers at the same location with 3 different .bkib et description.txt code (so 3 different sentences) , can I manage to activate one of the triggers randomly ? Trying to think outside the box (lel)
but if you duplicate bikb, you can selectRandom a topic
Let's stay with 1 sentence then. Very last question @winter rose (sorry), but the sound of my ogg file is very low in game when I activate the trigger... But when I listen it on my windows media player it sounds totalluy normal / loud, is tehre something wrong ?
you may have speech audio settings low? or perhaps a wrongly converted ogg file, try using Arma Tools for wav ā ogg conversion
Yeah I'll try converting ogg file with arma tools directly you're right, I did .lip with Arma 3 tools but didn't thought about converting th file directly on it
I tried something for the random sentences : https://code.empreintesduweb.com/14968.html
Is it horse sh*t ?
Godamn š¢
need a repro, if its a vanilla mission just the mission folder/pbo?
Maybe I phrase it poorly. I meant to say I know it's automatic and it's sent over the network while I'm on BIS's Spectator Mode.
The thing is, I'm making a functionality that basically makes a custom camera follow a remote player, quite like the spectator mode but for a different purpose.
I'd like to know how could I go about to monitor this remote player's camera view mode, as in the LA command "cameraView", so I can get closer to my intended final result.
All I know is that it can be done, since BIS's Spectator Mode does it.
Unless we're talking about different things, this camera switch is done by the engine when you switchCamera onto remote unit. Not sure if you can get remote unit's camera view though, probably switch to and then get your current camera view with cameraView?
Wait so if I simply _remotePlayer swithCamera "INTERNAL" into a remote player it will automatically keep up with it's remote's camera view changes?
Hold on I have to test it!
I think it works like this, yes
Yes! It just works!
You just spared me from a world of pain broadcasting changes through Event Handlers and some timesome variables monitoring...
Thanks very much for the tip!
Looks like changing locality of a unit when they're in ragdoll state makes them never leave the ragdoll state anymore
Forever stuck like this lol
Armanormal activity
Hi, my situation: in a combat vehicle a player is a commander or gunner, and the driver is AI. Goal: how to nerf somehow the ability of the crew to react to player given navigation commands like FORWARD, RIGHT, LEFT? Now it's not worth to have a player instead of AI I want to balance that using scripts
This locality change and stuck ragdoll mess everything up, seems to be no way to script fix it either
(isAwake for units returns false when in ragdoll state btw)
testz awake false; testz setUnconscious false; does nothing
Well, the lesson is: Never switch unit locality if
!isAwake _unit || {animationState _unit == "unconscious"}
```is true or it will get stuck in being a ragdoll forever
!isAwake _unit check wasn't enough, thankfully there is an animation that sets during ragdoll
if you're interested, i did my own testing with the conversation system a few days ago which you can find here
https://github.com/thegamecracks/Soup-Conversation
it basically just used BIS_fnc_kbTell, except that i slightly tweaked their functions to support textPlain in description.ext CfgSentences to give the subtitle effects sqf private _config = [_mission, _topic] call BIS_fnc_kbTopicConfig; if (isNil "_config") exitWith {}; // private _text = getText (configFile >> "CfgSentences" >> _mission >> _topic >> "Sentences" >> _sentence >> "textPlain"); private _text = getText (_config >> "Sentences" >> _sentence >> "textPlain"); if (_text != "") then {[_from getvariable ["bis_fnc_kbTellLocal_name",name _from], _text] call BIS_fnc_showSubtitle;};
yes, I mean why does this function not check description.ext š©
but like lou said, say should work pretty well for one-off sentences, for example your trigger activation might look like: sqf // Pick a random voice line from CfgSounds + subtitle _sentences = [["Sentence01", "Hello there!"], ...]; selectRandom _sentences params ["_sound", "_subtitle"]; [name mySpeaker, _subtitle] spawn BIS_fnc_showSubtitle; mySpeaker say _sound; though it gets a bit more complicated if you want it to be synced in multiplayer
There are a few stance getting commands, but no stance detectors. You'll have to write one yourself using the stance getters.
You could probably use the animChanged event handler and compare the current animation of the player though.
how would i get kbWasSaid to return true without using kbAddTopic+kbTell? i would have assumed kbReact or kbAddTopic+kbReact would work but it appears not
source code: https://github.com/thegamecracks/Soup-Conversation/blob/main/Soup.VR/Functions/kb/fn_kbTellX.sqf
found how to do it https://www.reddit.com/r/arma/comments/17l3kup/comment/k7po2oa/
Is there any command to play a sound for one player only? Ie ensuring others dont hear it?
playSound is a local effect
kbTell requires the speaker to be local, but on a dedicated server it triggers kbWasSaid without waiting for the sentence, so im rewriting it with say3D so it can at least work on non-local units
i'd prefer the function still be compatible with kbWasSaid, but if there's no fix for that i guess i'd have to use my own function to check
Note that playSound is 2D only.
If you need 3D, say3D is local effect, and playSound3D can be local effect with the use of one of its optional parameters.
The issue is fixed for me now, also itās heavily modded so
Does the T-100X Futura have a workaround to be usable in dedicated MP? I can't fire it's main gun more than once no matter what I do...
Is there a way to locally disable the sun? i know you cant change the time of day locally
It should work on DS, provided you have ammo. There was a period where it was broken, but they fixed it. I have fired it more than once on DS myself since then.
You might need to check your CfgRemoteExec settings; an overly restrictive CfgRemoteExec could block essential commands. I feel like that would block it entirely though, rather than allowing it to fire only once.
you cannot disable the sun full stop as far as i am aware
all terrains must have the sun
Are macro's recommended to use as much as possible?
or is it more a luxury addition for if you need to repeat the same thing multiple times?
depends
if you are working on a mod which has a lot of components/modules, yes. saves you having to remember everything
if youre just working on a single mod at a time which only has one prefix and wont benefit from more then it is unlikely
Macros are a convenience for you when you write the code or config. They have no impact on performance or how the code works. It's up to you whether you want to use them.
ok, thank you
yeah theyre purely a self aid and do nothing for the game itself
can you change the lighting parameters/rendering parameters in-game? Like the sun rays
Maybe it's just my mission (which was created before the fix) then... got my CfgRemoteExec all restrictless and still nothing
The fix shouldn't require any mission updates. It would all be in the vehicle config and BIS functions, which aren't saved in the mission.
Does anyone know of or how to make a script for low laying yellow fog/smoke in a 1km radius?
whats wrong with white fog?
I need it for a flood infection zone/contaminated zone
Unfortunately it's not possible to control the colour of standard fog (maybe(?) in the map's config, but that's no good for missions). Using particle effects is...possible, but not ideal for large areas. You could use particles for smaller drifts of dense fog/spores.
You might try using standard fog in combination with a post-process effect: https://community.bistudio.com/wiki/Post_Process_Effects#ColorCorrections
Everything in the scene will be affected, not just the fog, but it may be the best you can get.
Okay thank you
IKR? Regardless, doesn't work š«
Seems like I'm refactoring all of it for the next week...
Remembered this and realised why Arma shooting feels so sluggish in multiplayer on a 100 player server, with all other messages clogging queue, no wonder people die like after 2-3 seconds after hit even though latency is less than 100ms.
Q: do compatibleMagazines and compatibleItems also support binoculars?
A: Try it!
ah okay, that shouldnt be too hard
What's the best way to prevent use of the Commanding Menu in a PVP mission? I noticed showHUD can hide the UI which covers most of the bases, but I think players can still activate the command menu items if they memorized the keybinds (e.g. ``-5-5` to request status and find out who is dead).
is there a way to reduce the range an object with an addAction can be activated from? I'm able to scroll wheel activate them from about 50 feet away
https://community.bistudio.com/wiki/addAction
radius: Number - (Optional, default 50)
https://community.bistudio.com/wiki/addAction
Example 5 shows all
thank you, I missed that.
Is there a way to make AI run towards explosions/shots not in their immediate vicinity? Trying to make a scenario where a patrol is walking around, an explosion happens in a populated area, and the patrol runs to check it out
If you know where the explosion is going to be, you can just give them a waypoint to that position at the same time as you cause it
If you know roughly where but you're not causing it yourself, you could try an Explosion EH on something that's likely to be damaged by the blast, which would then give the patrol a waypoint (https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Explosion)
That last one is a great tip for more natural responses
why does my area marker keeps getting deleted mid game?
Because some code is running that deletes it?
Does anyone know if there would be a way to make a code which checks for ai with skill under a certain level, and if it finds it, locks them in an animation for the duration of the animation then resets their skill level? I'm looking to make a scripting solution that's compatible with ACE3 to produce a similar flashbang effect to the RHSUSAF mod without having to have the entire RHSUSAF mod loaded
its there a way to self mute ppl via scripting? https://i.gyazo.com/b2be6b8562b02db2885e7e2b7c29f28a.png
There is a command to set VON volume
any idea how to fix this issue
https://gyazo.com/2a4fe94444980fe9a3de0ad493ff4339
Would it be deleted content causing the issue?
also a main issue i've been having is with the header
https://gyazo.com/2b780ca0d394957b8e0d2c07c9702d76
but its not to do with the header from what I know bc according to the discord its the mod issue or conflicting
You have a missing addon/Mod to play
yeah figured trying to figure it out but was wondering primarily
no shot it cant be something within the mission file?
The mission file uses an addon that includes "jbad_opxbuildings2". You don't currently have it installed and loaded, which is giving you the error and not letting you join. The only way to fix it is to install and load the mod if you are the only one having the issue. If anyone else is, then you should tell the mission creator.
@dusk gust
We already fixed that though now I got a new issue lemme send it, it's becuase a mod is broken i think rn
just frustrating
How can you make the runway shorter for a Dynamic Airport? The default one for "AirportBase" is a bit too long for my tastes https://community.bistudio.com/wiki/Arma_3:_Dynamic_Airport_Configuration
Probably more of an #arma3_config question, but it looks like it's controlled by the positions of the ends of the taxiways
hey guys. im still trying to figure out handleDamage EV. how do you make it NOT fire for each hit part?
You don't.
aka "only fire once".
You just suffer it, like most things in Arma.
No, it's worse than that.
come on dude, im drving myself nutz here.
Some of the handleDamage EH calls aren't even for real damage on the hitpoints. They just threw some other garbage in there.
oh, that reminds me
so there is no way to make this only show 1 message on systemchat?
HostageUnit = _this select 0;
private _damage = _this select 2;
private _hitSelect = _this select 1;
if (_damage >= 1) then {[format ["fired"]] remoteExec ["systemChat", -2]; 0.7};}]] remoteExec ["addEventHandler", HostageUnit];
That's bad code anyway. You need to explicitly return nil if you're not adjusting the damage.
damage gets set to 0.7 in this example. as bad as it may be.
wait
Are you intending it to show a maximum of 1 message per hit, or one message forever?
what i want is the EV to run code in it only once. the example is a test to try and figure out htf to.
In that case just remove the event handler when the case is triggered.
You can remove the event handler from inside the event handler.
yeah i've tried that. then the unit is vulnerable while on the ground incapacitated.
You want to ignore the whole triggering hit but only fire the message once?
i guess i could live with that. but man this is full of it. there is too many welcome to arma moments here lol
This reminds me
@meager granite You managed to generate cases where the target-local handledamage calls were spread over multiple client frames, right?
ok lets get to the intent here. i want a unit to be set incapcitated when hit, remain invulnerable, add a holdaction to "revive" it, and have it all happen again if hit.
Ah right, you'll be wanting the answer to the question above too then :P
i did manage to do this.. but the unit also has an addaction to join group... then it gets so much interesting.
If you want the unit to be invulnerable then allowDamage false probably works.
IF i make the unit join then leave, "everyhing" is golden, swtiching locality messes it all up.
Although I can't guarantee that this works mid-frame.
its the code i show you the other day, im just trying to make it less bad.
if i can get the EV to not fire for every hitpart i'd be half way done. or maybe not. i don't even know anymore.
you can't do that.
from what i remember testing, if you remove the EV before the rest of the code, then the rest of the code doesn't run. if i do it after, the code is run for every hit part.
Nah.
It'll complete the current EH code block.
Second part I'm not sure about.
Worst case you can do an explicit timed lockout.
Check at the top of the EH whether the target is under lockout.
No, target was remote and frozen. After it being unfrozen, a long queue of damage packets got split and ended up arriving in two frames.
hmm
I guess the question is equivalent to whether Arma determines the selection hits on the shooter side or the target side.
Although I guess it could forward the list of selection/damage results in one lump.
in the example i've made, it fires for basically every hit point, or at least i get about that amount of systemchats. i just can't belive there isn't a way to make it fire for "overal damage". i did try _selection "" in some checks but i don't know if im using it wrong or wtf is going on.
feeling like getting a punching bag right now.
_selection == "" will fire twice for each hit. One target-local and one shooter-local. They are not easy to distinguish.
Knowing how client and singleplayer centric Arma is, bet its all done on shooter side and then just sent to target
Wish we had that shooter-side HandleDamage or at least an event handler without modifications
is it the only EV that can keep a unit from dying? i.e allowdamage false. ?
I have a non-replicable issue with players going from live -> dead with a single bullet (despite a two-frame lockout) and I had the dumb idea that this might be because the handleDamage calls are getting separated by the networking under pressure.
or can hit and dammage do the job? if so, idk how.
I think Hit occurs after HandleDamage? Not sure though.
It specifies that it won't trigger on a kill, which would suggest that.
actually god knows how that spaghetti works...
(By "in two frames" I meant some events fired on a one frame, and the rest on a next frame)
If you only care to know IF something was damaged, then run your code if _hitIndex < 0
It won't have any data about which hit parts got the damage though, you need some kind of accumulator for that
But even _hitIndex < 0 is not ideal because there two shooter local events for bleeding and something else
is there a way to convert a unit to an agent? A friend has a mission with 36 ambience AI standing around that don't need to fight. I believe that making them agents will save some resources, but without a way to convert the Eden defined unit to an agent it's a bit moot
It's possible, but tricky, and I'm not sure it gains you anything beyond disableAI "ALL".
New to scripting, trying to parse it out from a search here. My goal is to (1) disable thermals on goggles/helmets and (2) disable them on vehicles in Antistasi - meaning I can't just do the ini code in a vehicle in editor as they spawn as the game progresses.
The former I achieved with #arma3_scripting message this code here. However, it does not work on a Ifrit GL. I have to use vehicle player disableTIEquipment true; which does work - but only for the vehicle I am in. If I spawn another ifrit, get in it, then thermals come back.
I'm flying blind given ignorance of scripting, but I've tried replacing _person action with _turret or _vehicle and no luck.
im probably not being clear.
HostageUnit = _this select 0;
private _damage = _this select 2;
private _Selection = _this select 1;
if (_damage >= 1) then {[format ["%1", _Selection]] remoteExec ["systemChat", -2]; 0.7}}]] remoteExec ["addEventHandler", HostageUnit];
detecting that unit was hit is not the issue. the problem is that i get 1 system chat for each body part hit. this is for testing. but if i call a function or whatever in there, it gets called for each body part.
What are you trying to do anyway?
You can add EntityCreated event handler on server so it runs disableTIEquipment on all vehicles of needed classes
keep a hostage setUnconscious, give holdAction to revive. basically.
I'll give that a look into, thanks Sa-Matra. It won't be stressful scripting, I'd hope? Ideally this will only impact players, I don't care about the AI having thermals
Not sure if disableTIEquipment has any effect on AI
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
if(_entity isKindOf "AllVehicles") then {
_entity disableTIEquipment true;
};
}];
```Something like this
run this on server side
If you don't want to kill the unit then you need that condition for every selection. Do you want to do something if unit was about to be killed but wasn't?
no, just keep it from dying, allowdamage fasle, setunconscious false, add holdaction. to make it short.
I still don't get it. Make unit unconscious if they are about to die?
i was thinking about using the EV _damage param to keep it alive but idk, it stops firing if you add pretty much anything when using that method. the syntax inside the EV is a mystery to me... yet the stupid amount of bad code i've put in it does work.
HandleDamage is simple, it fires for every engine-driven damage on every hit part for every damage event.
that i know
if i put code in it, it runs it for every hit part for every damage. that i dont want.
Arguments are info about the damage, result of the function is what damage will be set to the entity. If result is invalid (nil, wrong type, etc.) engine sets its original intended damage instead of result of your code.
Its the only event handler that somewhat reliably tracks every incoming damage to the entity
ok, let me show.. get ready to cringe... and please dont yell at me.
RRP_HuEH =
{
HostageUnit = _this select 0;
private _damage = _this select 2;
if (_damage >= 1) then {
{HostageUnit allowDamage false; HostageUnit setUnconscious true; HostageUnit removeAction 1;} remoteExec ["call", HostageUnit];
[west, "Hsave", ["The Hostage has been Shot! Hurry!!", "SAVE HOSTAGE"],
HostageUnit, "ASSIGNED", -1, true, "heal"] call BIS_fnc_taskCreate;
[] spawn RPR_HostageCountDown; //this is a countdown with stuff.. does work regardless of EV.
[HostageUnit,
"Revive hostage",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_revive_ca.paa",
"_target distance _this < 2",
"_caller distance _target < 2",
{_caller playMove "AinvPknlMstpSnonWrflDr_medic1";},
{},
{
{HostageUnit allowDamage true; HostageUnit setUnconscious false; HostageUnit setdamage 0;
HostageUnit PlayMove "UnconsciousOutProne"; HostageUnit enableAI 'anim';} remoteExec ["call", HostageUnit];
},
{_caller switchMove "Acts_Accessing_Computer_out_short"},
[],
5,
100,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", -2, HostageUnit];
};
};
publicVariable "RRP_HuEH";
[HostageUnit, ["HandleDamage", {_this call RRP_HuEH}]] remoteExec ["addEventHandler", 0, true];
i know, i've already been told thats bad code..
now how do i get my bad code to NOT fire for every hitbox that gets damage.
Where are you executing this from?
Script file? Some debug menu that makes server run the code during gameplay?
its a task. with a hostage. if enemy spots you hostage gets shot and you have 5 minuts to get to it and revive it. whole task script is run on server. that bunch of crapy code works. i still have to figure out some locality issues (the units joins player group and everything gets weirder). but none of that matters if i can't make the code only fire once.
Script context matters a lot and figuring out why and where to use remoteExecs will help you solve the locality issues
Where do you intend to run this script in the end?
server
get this fricky part. if i make the unit join group... the thing just works.
but probably cos i get ownership. but im willing to bet other players get the issue then. at least ones that are not in my squad.
i get that. but i can't even get the systemchat message to only display once. so all that code, run by server, me, god... and all the code that i can move to functions or whatever else... it will get run for each hitbox damage on the unit.
the last thing i've tried.. and it only makes the whole thing more noob code like, is to _pickone = selectRandom _selection then {all that code} forEach _pickone. it did not like it.
Have this in init.sqf:
HostageUnit addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit"];
// If new damage is about to be big enough AND unit is not unconscious yet, means its time to make them unconscious
if(_damage >= 0.7 && {lifeState _unit != "INCAPACITATED"}) then {
_unit setUnconscious true;
["Hostage is down!"] remoteExec ["systemChat", 0];
};
_damage min 0.7; // Never exceed 0.7 damage for any hit parts
}];
init.sqf will add this code on all clients including new ones that join later
HandleDamage calls where unit is local so this will make sure your code will run regardless of hostage locality
EH return of _damage min 0.7 means unit will never really die, damage will never go above 0.7 no matter what
lifeState _unit != "INCAPACITATED" prevents your setUnconscious from running several times
Also changed remoteExec's -2 to 0 because server might be a player too
This setUnconscious code bit will run where HostageUnit is local at that time thus you need remoteExec there to do your chat message on all clients
missing a semicolon.
