#arma3_scripting
1 messages ยท Page 128 of 1
publicVariable "ionProfiles"; or publicVariableServer "ionProfiles"; to only send it to server
Its a bad idea to let players see all profiles of all players
Better approach would be sending each player only their own profile
So I am using a slightly modified script from a youtube video to do a paradrop, that your supposed to put in the activation of a move waypoint, It worked a week ago but now it has stopped working, could anyone help me determine what the problem is?
hercD sideChat "GREEN LIGHT, GO, GO, GO!";
null = [] spawn {
{
if(((assignedVehicleRole _x)select 0) =="Cargo") then {
[_x] ordergetin false;
[_x] allowGetIn false;
unassignvehicle _x;
moveout _x;
sleep 0.3;
};
} forEach(crew herc);
};
this is all the code in the waypoint, originally by OnlineCombatBN
the modifications whre removing the remove backpack and add parachute lines from the original script, this is because I want it to eject the players with their existing backpack (as the players will already have parachutes)
appreciate it, missed the first ping!
Thank you, what happens when 2 clients broadcast the variable, though, each with its own entry? Would I just get the variable with only the last broadcasted entry on the server?
Yes
If both broadcast at the same time you'll end up with one value missing
All in all, this is a bad design, make each client operate only their own profile
Alright, thanks, I'm trying to change it. So far I've added this and I see both entries:
"ionProfile" addPublicVariableEventHandler {
_UID = (_this select 1) select 0;
_ionProfile = (_this select 1) select 1;
ionProfiles set [_UID, _ionProfile];
publicVariable "ionProfiles";
};
so I did some testing my most recent update was today and I still cant get it to work, I've removed the null = and that hasnt changed anything
I am using profiling ^^
Removing the null = won't have fixed it - like I said, it's not the problem, it's just something that isn't necessary any more due to changes since the script was published.
Profiling branch is the most likely culprit, because of the recent problem with crew-related checks. These things can happen as it's a semi-experimental branch. You can wait for future prof updates, or switch to stable and try it there.
and if it works on stable, it should work on my server when I post it there?
Provided the server and other clients are also on stable branch. I don't see any issues with the code itself, and if it worked before it will work again, as there have been no changes to stable branch in several months.
* technically it should only matter which branch the machine that executes the code is on, but I don't know exactly how you're executing it so it could be any or all of them
copy Ill do some quick server testing and it if works there than It should be fine
I have an unarmed unit joining another group. Problem is that it keeps crouching and I can't change its pos with setUnitPos and setUnitPosWeak. How can I make that unit move "UP" without forcing whole group to do so with waypoint attributes?
if I set two waypoints (in editor) and one makes them all go UP and then second one to AUTO, the "AUTO" pos for the unarmed guy is crouching anyway
Noob question but how do I add large amounts of magazines (like RHS launchers, mortar ammo etc) on a supply box without being limited by the cargo size?
addItemCargo?
not working i only have few of the things not all
what you mean not working? what do you have so far written?
nvm, sometimes it works sometimes it doesn't, I guess it's something with FSMs and I can't disable them
is it possible to store the scrip handle for a remoreExecuted script?
I know this doesnt work, but lets say lets say _handle = [somefnc] remoteExec ["call", 0];
_thisScript might exist in remoteExec'd functions. Not sure.
Otherwise I guess you could run a spawn from there and then you'll have a script handle, if you really need one.
This runs unscheduled anyway
the reason i ask is because i want to find out when a remoteExecuted say3D is finished playing the sound, so i can play a new one
well knowing the handle won't solve your problem then
it's defined on another machine
so you can't know if the script is done without remoteExecing a function that remoteExecs the result back to you
which is not instant
Yeah fair i can see that.
Hey! I'm trying to use (on 2.14):
[_vehicle] call BIS_fnc_unflipVehicle;
unflip actually happens, but I get an error in the report file:
22:01:14 Error in expression <(getDir cameraon);
_vehicle setPosWorld _adjusted;
_vehicle setVectorUp (_ins # >
22:01:14 Error position: <_adjusted;
_vehicle setVectorUp (_ins # >
22:01:14 Error Undefined variable in expression: _adjusted
22:01:14 File /temp/bin/A3/Functions_F/Vehicles/fn_unflipVehicle.sqf..., line 44
22:01:14 "position above sea level: -0.915052"
Anyone with an idea on what am I doing wrong?
well the function had some issues. I think KK fixed it recently but you need to use the dev branch
Will do thanks!
how do i fix this
It's not a scripting problem. Your client has different mods loaded to your server, and one of your mods is missing another mod it depends on. You need to read the error message and load/unload mods on the client/server until you have matching configurations with the correct mods.
Client is loading obsolete ACE compat mods in this case, which is the wrong thing to do 99.99% of the time.
Trying to get this line of code to work In Vehicle Init...
veh = [this, 30, 120, 0, FALSE, FALSE] execVM "vehicle.sqf"
tried init; but did not respawn the vec
issue is in your script then
Working on a small script that swaps the position of caller and gunner in vehicle when the gunner is unconscious:
/*
Swaps the position of the gunner and the caller
*/
_object = (_this select 0);
_caller = (_this select 1);
// _playerPosition = _object getCargoIndex _caller;
// hint format ["%1", _playerPosition];
_gunner = gunner _object;
moveOut _gunner;
moveOut _caller;
_caller moveInGunner _object;
_gunner moveInAny _object;
for some reason the gunner is being moved back into the gunner seat and caller is left outside of the vehicle. Anyone have a potential workaround?
One thing I want to make sure is, is moveInGunner the correct command to move into the seat you want?
Maybe you need unanssing from vehicle, anssing to gunner your unit
https://community.bistudio.com/wiki/unassignVehicle
https://community.bistudio.com/wiki/assignAsGunner
moveInGunner and moveInCommander both work
will try this
I imagine moveInGunner is failed because when it was executed the seat is not empty yet at the frame, not 100% sure though
Yeah, seems to be pre empted by moveInAny
Probably use setPos instead to force leave the vehicle
gunner still seems to be in the seat when moveInGunner is called, will try adding some waitUntil
This is more complicated than it might seem when you get locality and dead units involved
Related ticket: https://feedback.bistudio.com/T170480
For dead units though, but being able to swap sweats with unconscious units sound great too
So both are players? Then probably locality is the issue as Sa-Matra said
ah, local executes first is what you are saying?
vehicle is local to commander or driver? or maybe caller?
I mean, moveOut or such can be transmitted into the local player other than you, and it can make a bit of lag until it happens
what if the command is being executed by remoteExec?
No point I guess, moveOut is already GE
Yeah you need to wait until remote player gets out, it might not happen instantly
Not sure if there is a delay when moving into remote turrets the same way as when you move into remote vehicle's driven seat, but you'd need to account for that
Ok, two questions
How do I determine who the vehicle is local to?
Would remoteExec solve this issue?
remoteExec or such is not a concern, you just need to wait and confirm until the changing seat is done
- Move out remote player\unit
- Wait until seat is empty
- Move in yourself
- Wait until you're in
- Move remote player\unit into your old seat
In Arma there are 3 types of seats in the vehicle: Driver, Turret, Cargo, to make your function universal you'll need to account for them all
gunner and commander are turrets, just config/engine-defined default turret positions for these vague roles, so you'll need turretUnit/unitTurret/moveInTurret commands to cover all possible turret cases
You can check locality with local and turretLocal but you don't really need it because you have to wait for actual unit movement in and out of seats which can depend on network latency, clients/server lagging, being frozen, etc.
_gunner = gunner _this;
player setPos getPos _this;
_gunner setPos getPos _this;
waitUntil {_gunner in (crew _this) == false && player in (crew _this) == false};
player moveInGunner _this;
waitUntil {player in (crew _this)};
_gunner moveInAny _this;
same issue as before. Will try changing how the command is called as I am currently developing/debugging in the exec box of the vehicle I am working on
_gunner in (crew _this) == false && player in (crew _this) == false```
`_bool == false` -style checks are redundant (you already have a boolean, you don't need to use another command to check if it's true or false, it does that itself). You can simplify this:
```sqf
!(_gunner in _this) && !(player in _this)```
(Even though it is legit syntax)
Is there still no getter for the 'time remaining' on things deriving from "TimeBombCore" like "SatchelCharge_Remote_Ammo"?
I'm referring ofc to the time set by the "Set timer (+40 seconds)" action
Ah nvm, just found https://community.bistudio.com/wiki/getShotInfo
Just gotta wait for 2.18 ๐ฆ
For the
unit forceWeaponFire [muzzle, firemode]
I need a 'muzzle'. And I noticed that for some vehicles "weaponsTurret" does return value that can be used, but for some - don't. For example for gunner inside the marshall the weapon is "autocannon_40mm_CTWS", but the muzzle is "HE" (found out with 'currentMuzzle' command via console)
How do I get this 'muzzle' thing?
does currentWeapon not give you what you need?
https://community.bistudio.com/wiki/currentMuzzle
or weaponState
can get it from config look up too
I don't need current, I need all the weapons of this 'turret' of the vehicle
Yeah, I guess more config lookup is the way to go. Thanks
does anyone know how to make a completely solid, none transparent background for a map cover? I want to create an ao and then just completely blackout the rest of the map so the players only see within the AO
using like "ColorBlack" is still transparent
https://community.bistudio.com/wiki/setMarkerBrush use SolidFull, the default Solid will always be semi-transparent
someone tryed make rivers "flow" ?
something like if you start swiming the current will drag you, same with boats
i just noticed that setspeed dont work in water :/
oh shit thanks, didn't manage to find that
@sullen sigil I bet you tried to achieve something like that
i did not

its probably pretty easily doable tho
i was thinking in a polyline to define the "river flow" but i cant fin a way to move the player
i mean, you can use a setpos... but its quite inneficient
then yeah setposasl
setpos on each frame on multiplayer
sounds dangerus, maybe if its done on server side?
on vehicles, setvelocity seems to work, ill try to do it then, sounds fun to do
Is there a way to change a units "Display name" to something else.
Example: changing from "Autorifleman" into "Bob" when you hover your crosshair to the unit?
no
either make a new unit through faction config (needs to be a mod) or completely remove/force disable that nametags thing and write your own like ACE mod does
does waitUntil need an existing variable to return true or false for it? I'm creating the variable through a trigger that starts later than a script with the suspension, I thought waitUntil {sleep 1; !isNil myVariable}; would work but instead I get an error that the command returned nil.
isNil requires the variable name to be given as a string
Hey, does anyone know how to force combat stance on an object not AI but multiplayer Object
Thanks
This is what ended up working and going with:
_object = (_this select 0);
_caller = (_this select 1);
private _gunner = gunner _object;
private _unitturret = _object unitTurret _caller;
private _FFVTurrets = allTurrets [_object, true] - allTurrets [_object, false];
private _cargoindex = _object getCargoIndex _caller;
moveOut _caller;
moveOut _gunner;
if (_unitturret in _FFVTurrets) then {
[_caller, _object] remoteExec ["moveInGunner"];
[_gunner, [_object, _unitturret]] remoteExec ["moveInTurret"];
} else {
[_caller, _object] remoteExec ["moveInGunner"];
[_gunner, _object, _cargoindex] remoteExec ["moveInCargo"];
};
Was unable to get the waitUntil to work properly so I resorted to two calls in remoteExec
kind of worked in testing but still needs some work
Either waitUntil checking position is empty or execVM'ing the move commands and waitUntil scriptDone script handle
objects do not have combat stances because they are objects, not sure what do you want to achieve exactly
So I have a mod called Experimental Drugs. Works just fine. Im creating a config patch for a starwars unit. I pop my original release pbo into the new addon folder. I create a new pbo, and I only added stuff to rewrite display names and similar details, all string variables that are used for display and nothing else. Its purely a config patch. The pastebin below contains the config for the pbos and a sample of the first item.
bax_drugs.pbo (drug mod)
sfa_boosts.pbo (config patch)
https://pastebin.com/gyFYVr2J
When I pair the config patch pbo with the original mod, I start getting errors.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
As for the error referencing different classes, the recovaMax error occurs when it imports the configs because recovaMax is the first one listed, and chronoClot occurs because its the first when in alphabetic order.
It's a config problem.
ChronoClot has the almost exact same config as RecovaMax in the sample, with the literal difference being the names.
And it's because you're not inheriting.
Well, i assumed it was an inheritance issue. But i havent been able to figure out how to fix it. Could you explain to fix it please?
from your patch mod.
class CfgWeapons {
class ACE_ItemCore;
class BAX_RecovaMax_item: ACE_ItemCore {
displayName = "Energized Kolto Stim";
};
};
AHHHHH! I think i know how i screwed myself up.
Thank ya
Ill double check this when i get home
TLDR: Even though im smart, im also sometimes stupid ๐ ๐
doesnt setName does exactly that?
No, displayName cannot be update on the fly
yeah, but the term used is obviously not the correct one, he wants to change the name that shows upon being aimed
That's pretty much exactly what displayName means
setName changes the name in squad bar and on KIA list in debriefing section, that green on hover thing is something completely different
if ACE is used it will display name given through setName/cfgIdentities because it removes the vanilla feature.
ah, that might be why I remember using it in the past
question for you find lads, im useing this mod https://steamcommunity.com/sharedfiles/filedetails/?id=752850965 just moved to my server, i have a trigger for activation looks like this
0 = execVM "scoring\airesp.sqf";
0 = execVM "scoring\btToolbox.sqf";
0 = execVM "scoring\init.sqf" ;
0 = execVM "scoring\initPlayerLocal.sqf";
0 = execVM "scoring\misc.sqf";
0 = execVM "scoring\ModifiedBISFnc.sqf";
0 = execVM "scoring\PrykHitPart.sqf";```
Works fine, what i am trying to do is have another trigger that will stop it. the deletevehicle for the trigger worked but i just want to turn it off so when somone is useing it it will work for them.
That very heavily depends on what's actually in those files - how the mod's scripts work and whether any provision has been made to turn it off. It may even be impossible to fully turn it off, depending on what exactly it does.
You might find someone willing to go through and investigate, and/or modify the scripts so they can be stopped, but it'd be a fair bit of work.
I have an action that is attached to players but the conditional is proving to be detrimental in some cases in order to hide it.
Is there a way to make it happen less often?
Or should I approach the problem from other side and instead remove/readd the action upon the conditionals being achieved?
(for info: you don't need 0 = now)
You can't directly change the check rate of the condition, it's always per frame.
You could try your option of removing and adding. Another alternative would be to have a separate check system that updates less frequently and records its state in a variable, then have the condition just check the variable.
dammit. well ty
thanks i hope somone will see this bc im lost in the Sause rn
Good afternoon, does anyone know of an extension that allows you to download image files?
I have an AI transport helicopter that is supposed to be escorted by another AI chopper. How to make the other folow the transport one? Grouping them is not the way because when transport heli gets a transport unload waypoint, the other will land too despite having no passengers. Placing a follow waypoint on the transport heli with a returning false condition does not really work because escort changes the destination very slowly and by the time it starts moving, the transport heli is already done with its waypoints
managed to get it somehow working with a while + move loop but perhaps there is a proper function or a better way to do that (the helicopter jiggle between each repetition of the loop is kinda visible)
Don't know if this only works on landvehicles
https://community.bistudio.com/wiki/setConvoySeparation
I assume it doesn't work on helis
convoy separation requires both vehicles to be in a single group and I can't do that because when transport helicopter lands, the escorting one must stay in air
Spamming limitSpeed based on distance to convoy lead works well for land vehicles. Not sure if it applies to air vehicles or not though.
as in speed value equal to the distance between two vehicles?
No, maths is involved.
Principle is that you set limitSpeed higher than the convoy speed (or lead speed, I guess) when the separation is too high and lower when it's too low.
btw what is the cause of jitter when using unitCapture/Play? I recorded movement with 30 FPS set in the command but the rubberbanding is kinda visible, especially when the movements are little, is turning it up to 60 worth it?
I'm doing this on the south-eastern side of Altis so perhaps the floating point is the cause and I just should not be bothered
Check if it's any better around [0,0], I guess.
visible jitter at 20km doesn't seem super-likely to me unless you have your face right up against an object.
Does anyone have experience with the VSM mods? I can't find the uniforms in cfg and they don't show up in the editor, but they're there on the characters, it's weird.
uniform player
I get a class from that, but I can't find it in cfg and it's not available to place down in the editor. I dropped it from a character in Zeus and I just got a generic dummy container model instead of a uniform. This happens for all the uniforms in that mod, but I see them on characters. Also, if I try sqf getText (configfile >> "CfgVehicles" >> "Item_U_BG_Guerrilla_6_1" >> "vehicleClass"); I get ItemsUniforms, but if I try with any of the VSM items, I get nothing, even though I can get the class name for the worn uniform
maybe it's assigned as a unit body, not a uniform? But this would probably require you to look into the actual config instead of using the viewer I guess
or reach out to the VSM team, I think Jakerod is one of the devs
Uniforms are in CfgWeapons, not CfgVehicles.
CfgVehicles has some stuff that's various equipment items on the ground.
I have a question, I added M2 to the vehicle using the 'Attributes' section, and I also modified the vehicle to have more resistance. My question is, what should I do to export the vehicle to my missions?
What do you mean by export?
Yes, I don't know how to refer to that, but I want the vehicle to appear in my cooperative missions. I added the turret in Virtual Reality with the help of Eden Editor, but I don't know what I have to do to use it in my missions.
Eden Editor can change a vehicle's appearance, if that's what you mean
Look, in these images, it shows how the turret looks in the Eden editor, and the second one is when I start the mission. What I want is to be able to use the vehicle with the added turret in my missions (they are usually dynamic), but I don't know what I have to do.:(
...You mean you attachTo'd that HMG?
yes
I tried to do it with the Zeus menu during a mission, but it was impossible. That's why I want to know how to 'export' the vehicle with the attached turret.
So the goal is to attach the HMG that is useable from vehicle? That's not possible, or rather, very hard
No, the goal is to be able to use the vehicle in multiplayer because I play Dynamic Recon missions with my friends, and I want to be able to use it in those missions.
Then you probably want a Mod to expand Zeus' fnctionality. I don't know which it could be but injecting a code is not a impossible task
Zeus Enhanced is commonly used for lots of things but also includes a way to โexecute codeโ as a module this could be used to do pretty much anything including spawning/creating a vehicle like what he wants
Okay, I will try that. I also forgot to mention that the vehicle only appears in the Eden Editor; it seems to be locked for Zeus as it doesn't appear in the menu.
If you have the attachTo and stuff working properly and the gun is usable when you test it, then select both objects in the Editor, rightclick and create custom composition.
They will then be available, together, in the compositions > custom tab of the Zeus menu, provided the server or mission is set to allow composition init code to run (https://community.bistudio.com/wiki/Description.ext#zeusCompositionScriptLevel).
Note that if the init field code you used relies on the objects' Editor variable names, you'll need to rework it, because those won't reliably exist when placing multiple copies via Zeus. You could try only having the vehicle in the composition, and having its init code use createVehicle to dynamically generate a turret per vehicle.
Hello, how can I differentiate between a backpack and a vest/uniform when getting them from a container with something like the everyContainer function? I'm trying to save them and recreate them for persistency, and I want all bags to persist, but backpacks are created with a different function from uniforms and vests.
getNumber(configFile >> "CfgWeapons" >> _class >> "ItemInfo" >> "type")
for uniforms and vests
check the class that command returns, not class of the container (it will be dummy holder class)
backpacks can be checked with
getNumber(configOf _container >> "isbackpack") == 1
You can get type numbers from description here https://community.bistudio.com/wiki/getSlotItemName
Right, thanks! I don't need to check each of them. It's enough if the container isn't a backpack, I can differentiate on that. This helped a lot! ๐
Btw is sqf binarization still a thing or forgotten project, also, under what cases does it help with speed of the execution?
https://community.bistudio.com/wiki/SQF_Bytecode You mean this?
As far as I understand it mostly speeds up loading times
Yeah, obfuscation is also a thing
So it only speeds up eg mission load time due to no need to compile functions
Or example obsolete execVm
yes
- Use pastebin
- You can't
exitWithfrom top most scope inside event handlers that expect return value - By returning
0you will repair the vehicle
How to make this script that vehicles don't receive any damage from the environment/terrain? Shouldn't it be the if (isNull _source) exitWith {0}; ? That script is atm running on the server and doesn't seem to work.
(please do not post big chunks of code)
_vehicle addEventHandler ["HandleDamage", {
if(true) exitWith {0}; // Won't work, event handler didn't return anything, top scope was aborted
}];
_vehicle addEventHandler ["HandleDamage", {
call {
if(true) exitWith {0}; // Will work because last statement was call that returned 0
};
}];
instead of 0 you need to return previous damage value, you can calculate it with:
if(_hitIndex < 0) then {damage _vehicle} else {_vehicle getHitIndex _hitIndex}
returning 0 will mean environment damage will actually repair the vehicle
Apparently, Zeus has the necessary permissions within the mission, but it doesn't allow the custom configuration to appear. I also encountered another issue. I used 'this attachTo [Variable1, [-0.06, -0.28, 1.16]];' But when I try to use the vehicle name (without using a variable name), the weapon no longer changes position. The vehicle's name is BlackMamba'14_(Sedena23). How should I write it?
I tried in the following ways, but none of them worked. ['BlackMamba''''14_(Sedena23)', [-0.03, 0.45, 1.3]]; ['BlackMamba''14_(Sedena23)', [-0.03, 0.45, 1.3]];
What do you mean by the vehicle's name that's not a variable name?
The thing is, before, I was using a variable name to place it in the code. Now that I try to use the original vehicle name, it's not working.
https://community.bistudio.com/wiki/attachTo
As described in the Parameters information, attachTo only accepts Object references - a specific data type used internally by the game. When you use a variable name, you're giving it something containing an Object reference.
What you're doing by adding in these things enclosed with ' is giving the command String data types. Strings are plain text data and don't directly refer to an object. An object's classname, the internal name for all objects of that type, is usually represented as a String. For example, the Hunter's classname is "B_MRAP_01_F". Is that what you're trying to use? You can't do that, firstly because attachTo doesn't accept Strings, and secondly because a classname describes all objects of that type, not a specific one.
Where are you finding the "original vehicle name"? I am almost completely certain you're trying to use either its classname or display name, neither of which are specific to an individual instance of an object.
About making the composition available in Zeus:
You need to verify that either the server's config, or the mission's description.ext file, has the line zeusCompositionScriptLevel = 2; in it. Note that if both are defined, the description.ext takes priority.
The composition's overall availability isn't mission-specific and doesn't rely on this setting. Even if this setting is set to 0, the composition should still be available (assuming Zeus doesn't have any budget limits), it just won't work properly.
Because custom compositions are part of your profile, not part of a mission, you'll need to send people the composition if you want others to be able to deploy it themselves.
Thanks, with this code (after the _hitIndex select in the previous code I sent):
_prevDamage = if(_hitIndex < 0) then {damage _vehicle} else {_vehicle getHitIndex _hitIndex};
diag_log _source;
diag_log side _source;
call {
if (isNull _source || side _source == sideEmpty) exitWith {
diag_log _prevDamage;
_prevDamage};
};
_damage
when hitting some pipes and the vehicle being on top of them, log prints:
19:24:24 <NULL-object>
19:24:24 UNKNOWN
19:24:24 f16 Overflow
Due to the f16 overflow, it just gets stuck there.
How would you go about on modifying this script to make so that vehicles can't receive any damage from the objects they really should not be destroyed from (such as trees, which happens quite often)?
https://community.bistudio.com/wiki/Side With this documentation it says that it should be "empty" side, however in the log it's Unknown for some reason, and I'm quite worried that adding this instead of it being empty can cause other major issues.
Your exitWith does nothing becuase the last statement of the EH returns _damage
Its empty only for 3DEN stuff, I don't know about it much
I think checking for null source should be enough
ah, there's that, right. I'll try to modify it a bit.
call {
if (isNull _source || side _source == sideEmpty) exitWith {
diag_log _prevDamage;
_prevDamage;
};
_damage
};
Yeah I was just wondering why in the log it's null but it never ends up in the exitWith
Alternative to all this, without any calls and making sure this is the last statement in the EH:
if (isNull _source || side _source == sideEmpty) then {
diag_log _prevDamage;
_prevDamage;
} else {
_damage
};
but you could end up with nested ifs mess if you decide to add more conditions
Also how to deal with the "f16 OverFlow"?
No idea what you mean, I don't see a diag_log with it
if its some engine config warning, I can't help you
Yeah it's some engine error, probably can be disregarded, I tried again and the vehicle didn't get stuck there.
https://pastebin.com/YbxTJgRR
This is the code that it's using now, however, when still crashing to a car wreck the tank explodes while ending up in the if statement (confirmed by the log). Same was with a littlebird when my main rotor hits a a tree, it prints the log but damage still received would exclude air vehicles later, but the main priority is to get the tanks working now that they don't randomly explode with the current state of Arma 3 physics + some of our mod vehicles like CWR M1. Since the log is not clearly printed every frame, is there a chance that Arma doesn't run the EH on every frame, and it could be the cause of why the code isn't working properly?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
You get _unit from arguments but operate _vehicle
oh right so:
_prevDamage = if(_hitIndex < 0) then {damage _unit} else {_unit getHitIndex _hitIndex}; should work?
Even after this change, it seems to take damage which causes the tank to blow up, which is really odd, although it logs it a bit more frequently. I guess I need a bit better logging where the killing blow damage really comes from, and if in the end the source isn't really null... It also seems that the appears on the helicopter the blades hitting the tree still deals damage and I confirmed that this was null for sure.
But I'll continue later. Thanks for the help with the event handlers!
yo, just a quicky, I have briefing, can I do (IF getPlayerUID) == number from player to make separate briefing for players? Or will it catastrophically fail?
Just with that line? No.
You need to make a function that keeps in mind the locality of the commands, then you either run that function on that client or you remoteexec that function to the client from the server
from initPlayerLocal.sqf I call sqf that has:
if (!hasInterface) exitWith {};
waitUntil {!isNull player};
player createDiaryRecord ["Diary",["example","This works"]];
if I use it as:
(IF getPlayerUID) == number one
player createDiaryRecord ["Diary",["example","This?"]];
(IF getPlayerUID) == number two
player createDiaryRecord ["Diary",["example","will it?"]];
Yeah, you can use a switch case in that instance and it will work
thx
Guys, any idea why:
_potentialNpcs = agents select {_x getVariable ["isNpcAgent",objNull]};
Would give a "Error GIAS pre stack violation" error?
Doesn't happen on all matches just some
If the agent doesn't have the variable at all, then the select condition will return objNull. Since that isn't a bool or nil, select doesn't know what to do with it.
You should probably use false as the default variable value instead.
Thanks, what about ```sqf
_potentialNpcs = agents select {!(isNil {agent _x getVariable "isNpcAgent"})};
That would add them to _potentialNpcs if they have the variable at all, regardless of whether it's true or false. So technically functional, I think, but it depends what you want to do with it.
I just want to know if it has the variable, not if it is true or false. There are other agents which have "isInfected" and "isK9"
Then just use getVariable with some default value that will never be set.
Indeed, thanks, the second solution worked: ```sqf
_potentialNpcs = agents select {!(isNil {agent _x getVariable "isNpcAgent"})};
I am sorry, but does anyone know how to make AA actually work? I assumed a reveal script could help. If anyone has a reveal script that they can give to me I would appreciate it
what AA? vehicles and AA units work pretty well on their own if target is within distance. SAM system needs a radar
and reveal syntax is pretty straightforward https://community.bistudio.com/wiki/reveal
(except for the locality)
@old thorn @jade acorn I'm assuming skittles is running into the issue where radar AA stays in passive radar mode to start until it gets a signature, then lights up. it does that for protection. typically, the AA won't switch active unless it physically sees the aircraft, recieves info from another active aa, or gets pinged with aircraft radar. you can force it to always be on using enableVehicleSensor
I didn't assume anything because my mind-reading orb is out of service 
but this could be the case
Are you sure you meant enableVehicleSensor? Seems like setVehicleRadar is the better fit
I'm trying to set up a user action so that hitting the same key toggles a display on/off. Can this be done in CfgUserActions, or will it need a function? If a function, it seems that when the display is open that the key down is ignored. How to capture that?
class CfgUserActions
{
class BSF_OpenAM
{
displayName = "Asset Management";
tooltip = "Open the BSF Asset Management UI";
onActivate = "createDialog 'BSF_AssetManagement_Dialog'";
onDeactivate = "";
onAnalog = "";
analogChangeThreshold = 1;
};
};
class UserActionGroups
{
class BSF_controls_group
{
name = "BSF";
isAddon = 1;
group[] = {"BSF_OpenAM"};
};
};
class CfgDefaultKeysPresets
{
class Arma2
{
class Mappings
{
BSF_OpenAM[] = { 0x25 }; // k
};
};
};
In the dialog I can set an onKeyUp EH that fires a function, but when I've done that in the past I've pre-defined the key code. What mechanism is used in a function to recognize a keybind?
onActivate there just execute written SQF. So no, like, you can just write hint "it's working" and call it a day
how to check if object have inventory space ? ( e.g. you can put items to it, no need to check there is a space left )
Checking whether maxLoad is more than 0 would probably do it
This is for checking if there's enough space remaining to fit a particular item. It's not useful for checking whether an object is an inventory container at all, because something that is a container but is simply full would return false. Avocato specifically wanted to check if it is a container, disregarding whether there's empty space.
little developer overhead
backward compatibility was always shit
live in the past = you are fucked :white_check_mark:
lil OT btw.
writing OOS makes fun ^^
only thing i miss now is some IDE
Is there a way to either populate a variable with the player's key-bind setting or reference the key-bind class (BSF_OpenAM) in scripts?
I think actionKeys and related commands should do it. That's how vanilla keybinds can be got, and it shouldโข work for mod keybinds too
@grizzled cliff "eh fuck it, backward compat is easy enough" <-- This is going to bite you in the ass one of these days... ;)
Hi, im having an issue with the "Fired" event handler.
The fired event handler calls this code:
if (!(_unit getVariable "alerted")) then {
_unit setVariable ['alerted', true, true];
systemChat "Unit set to alert";
{
private _leader = leader _x;
if (isPlayer _leader) then {
_leader createDiaryRecord ["Diary", ["Artillery Alert", _message]];
_message remoteExec ["hint", owner _leader, true];
systemChat "Message sent to";
};
} forEach allPlayers;
};
I want to send the hint only to group leaders of a squad. But the remoteExec seems to be failing. Any ideas?
Everything else works fine
you can remove the "owner" part.
looping allPlayers and then checking if unit is player?
Checking if their group leader is a player.
_message remoteExec ["hint", allPlayers select {leader group _x == _x, true];
No loop required
Does getVariable return false if that is not set.
I mean does !(_unit getVariable "alerted") work or should it be
_unit getVariable ["alerted",false]
getVariable is fine yeah
This looks like it
_message
Where is message coming from?
its a private variable at the top, thats fine too
In the EH?
This will only trigger for players
Yeah, thats intended
ok
I dont think AI need to know about arty
The Eh is attached to player unit?
to enemy artillery AI, the script is meant to trigger on fired,
on EH fired
everything in the script runs fine, my issue was sending the data to the actual group leader
what IDE are you using ? plugin/theme ?
does disableAI improve performance in mission? If yes, which features to disable ?
yeah probably I use enableSimulationGlobal got good results with that and static guns
disabling FSMs would probably reduce the unit's impact on game to an agent. You could disable all, it depends solely on the actual case
with simulation disabled the FSMs are still executed iirc, as in a non-simulated unit still collects info about targets, will go into aware state if detected combat nearby etc
any EH, beside HandleDamage, you may not call the function in the EH directly?
_x addEventHandler ["XXX",FUNCTION]; (vs _x addEventHandler ["XXX",{_this call FUNCTION}];)
Either's fine for any event handler, surely?
I'm experimenting to create a server authorative hashmap so i dont need to constantly update the hashmap over remoteExec/JIP/publicVariable queue
How can i pull my hashmap from the server as a client?
remoteExec + publicVariableClient.
well i was trying to do a script that give rivers a "flow" so you cant cross them easily, but if found some dificulties:
Units
when you are in the water, there is some kind of "swiming state" where:
- addforce insta kill you ( you cant ragdoll in water)
- setvelocity dont work
- setpos on eachframe, works, but you are in a standing position like walking
on vehicles you can use setvelocity, so maybe a well crafted script might work, but if infantery can cross easily there is no point
any ideas?
oh cool, thanks john
I'm wading into CfgUserActions and actionKeys and have a couple of questions. Ultimately, I'm trying to capture and filter keys when a dialog is open just so users can kit the same key to open and close a dialog. In the dialog I have an EH:
onKeyDown = "_this call BSF_Keybind_AM";
If the action is bound to an unmodified key, such as "K", the function is handed [Display #25301,37,false,false,false] and if I log (actionKeys "BSF_OpenAM") I get "37". This is great and useful, but if the action is bound to a modified key such as "Alt-K" the script is handed [Display #25301,37,false,false,true] but logging (actionKeys "BSF_OpenAM") hands me an exponent value "9.39524e+008". Alt+anykey logs the same exponent value. Is there a way to get the keybind in a format that can be used in an IF or SWITCH statement? I was thinking that I might have to take the values of what is sent to the function - [Display #25301,37,false,false,false] - and concat it into something that can be compared to the result of (actionKeys "BSF_OpenAM") Is this plausible?
Learned something new today, yeah i havent been able to move the character at all unless they are setPosASL first. The animation seems to completely stop any setVelocity.
You might find that setPosWorld behaves differently to setPos.
If not, I guess you can force the animation with switchMove, but that might be super-glitchy.
setposworld also resets the animation
yea, the idea is that you should be able to swim too lol
It wouldnt be a current drifting them away. But you could set animation coefficient lower to simulate the water being more difficult to traverse.
I doubt what you want is really possible
HD breaks - for some reason the return value is not passed back properly
keyDown i am not sure
If I have a function that spawns a group _grp1 then I create a trigger in the same function how do I reference that group?
I'm basically creating ambushes on the fly and want the trigger to reveal players to the ambush group and change the ambush group's behavior etc
But I'm pretty sure when the trigger fires, {_grp1 reveal _x} foreach allPlayers; it's not going to know what _grp1 is will it?
well idk much about triggers but if you make the group a global variable then you can refer to it from anywhere
you can just use setVariable
_grp = ...;
_trigger = ...;
_trigger setVariable ["mygroup", _grp ];
_trigger setTriggerStatements [... toString {
_grp = thisTrigger getVariable ["mygroup", grpNull];
},...];
So pretty much I'm lost because I am not a math guy and looking for a correct solution. Basically I'm looking for a way to convert vectorDir Up Side into Euler, as in, model.cfg rotation XYZs. The goal is to align a model rotation into an object's rotation. As you already know Gimbal Lock is a thing, so assuming using Quartenion is the correct way, but actually I'm clueless
... vectors -> Quartenion -> rotation, is this actually a correct way?
Myb this can help:https://forums.bohemia.net/forums/topic/221791-quaternion-rotation-functions-release/
Here are a handful of functions I wrote a while back that I figure might help some folks out. MRU_V3_QRotation is the big one. Rotate a 3D vector around any axis in 3D space by any number of degrees. Useful in both world space and model space. [Feel free to use these in any way you see fit. If yo...
You don't need a quaternion or Euler angles if you have dir,up,side vectors
But I didn't completely understand your question. What do you mean by aligning a model rotation with object rotation?
Let's say you have a turret, that is basically rotates in X and Y. I have an arrow object. Rotate the arrow in Eden, the X and Y will change and turret will look where the arrow looks. Photo is the concept, but in XYZ
but you don't know the rotation axes do you?
or how an animation would affect the turret
you can find them out by animating the object ofc, but that information is not immediately accessible
Forgot to mention but I have my object and the script is supposed to control it. It has basically every possible translation/rotation animation
I'm not 100% sure how the game does the rotation animations, but if it uses Euler angles, given a certain orientation in model coords, you can find the Euler angles and anim values as follows:
- if it does X Y Z rotations, the rotation matrix will look like this:
[ cos(b)*cos(c), -cos(b)*sin(c), sin(b)]
[ cos(a)*sin(c) + cos(c)*sin(a)*sin(b), cos(a)*cos(c) - sin(a)*sin(b)*sin(c), -cos(b)*sin(a)]
[ sin(a)*sin(c) - cos(a)*cos(c)*sin(b), cos(c)*sin(a) + cos(a)*sin(b)*sin(c), cos(a)*cos(b)]
(a, b, c are euler angles)
2. that matrix will correspond to this (in SQF code):
matrixTranspose [_side, _dir, _up]; // side dir up are in model coords
so you can solve for a, b, c
3. you map those angles to animation controller values based on your animation min/max angles
this is the way you solve for the angles btw
that example is for Eden rotation stuff but the equations do apply here too (tho rotations in A3 are left handed, not sure if I accounted for that in the equations back then)
since you already know how your model animates, first use angles to get the orientation in model coords, then do it backwards using the equations I posted to get the angles again, and see if they match
or instead of doing it backwards, remember that the columns of that matrix in 1. are [_side, _dir, _up]. so get the actual vectors, then compute them using those equations, and see if they match
Let's see if I can understand you ๐
Hello!
I'm wondering, when i use attachTo script to attach an object to another, is there a script to release it and therefore drop on the ground for example? I know i can delete it or play around with that, but is there specifically a way to detach the attached object and make it independent again? Thank you.
You just use the detach command
Oh right i can see it now! Thank you, i must have skipped it.
If you haven't done a public release i would consider breaking the api now.
Once its public you can maintain backwards compatiable imo
Maybe do a major version change if you need to break the api later on
Hey peeps, I'm currently working on an intro cutscene for a mp mission, I've used
[cam1, "INTERNAL"] remoteExec ["switchCamera"];
to move all players cameras into cam1, now the problem is how do I switch them back to each players respective unit?
Is there a simple way to get everyones local player so I can just remoteExec again?
I tried using
[player, "INTERNAL"] remoteExec ["switchCamera"];
which works in singleplayer, but in mp that doesnt work since its not for the individual players afaik? (if it exists at all in mp)
[{player switchCamera "INTERNAL"}] remoteExec ["call"]

You are my personal hero of the day โค๏ธ โญ
the reason your code didn't work is that it was evaluating player on whatever PC that runs the remoteExec
Oooohh
Yeah that was no good then, and I assume via the call it does it on the individual players PC?
via call you send whatever's in {} and ask each PC to execute it themselves
and when that code executes on another computer, the player on that computer is passed to the switchCamera
another way was to define a function on each computer and do [] remoteExec ["PI_fnc_switchCamera"]
// PI_fnc_switchCamera
params [["_cam", player]];
_cam switchCamera "INTERNAL";
I'd definitely suggest doing all your camera stuff in locally-operating functions since all the camera commands are LA/LE. Just a lot easier to handle it all locally rather than remoteExecing everywhere and dealing with local-only objects from remote machines.

True, I initially just wanted to do a 'quick intro cutscene' and keep it inside the modules though ๐
and then it took a few hours after all
exitWith issues maybe? if (true) exitWith {0}; will work with the call version but not the direct function.
@granite sky yep see: #arma3_feedback_tracker message
This one really aggravates me but I guess we're stuck with it.
Like exitWith {0} behaves identically within SQF but somehow not for commands that call SQF.
I'm re-asking this, hoping time of day helps...
I'm wading into CfgUserActions and actionKeys and have a couple of questions. Ultimately, I'm trying to capture and filter keys when a dialog is open just so users can kit the same key to open and close a dialog. In the dialog I have an EH:
onKeyDown = "_this call BSF_Keybind_AM";
If the action is bound to an unmodified key, such as "K", the function is handed [Display #25301,37,false,false,false] and if I log (actionKeys "BSF_OpenAM") I get "37". This is great and useful, but if the action is bound to a modified key such as "Alt-K" the script is handed [Display #25301,37,false,false,true] but logging (actionKeys "BSF_OpenAM") hands me an exponent value "9.39524e+008". Alt+anykey logs the same exponent value. Is there a way to get the keybind in a format that can be used in an IF or SWITCH statement? I was thinking that I might have to take the values of what is sent to the function - [Display #25301,37,false,false,false] - and concat it into something that can be compared to the result of (actionKeys "BSF_OpenAM") Is this plausible?
i'm not sure if this is the same thing of what you already have, but you could use https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onKeyDown to control which key inputs to pass through (at least its a good read)
Yes, that's what I'm using. thanks. The main issue as I see it is that (actionKeys "BSF_OpenAM") passes a value that I can't seem to do anything with.
See notes at the bottom of https://community.bistudio.com/wiki/actionKeys
I'm curious about why exactly you need to compare the values. There might be another way to achieve what you want without directly comparing the key codes.
That pretty much confirms what I found. I'd rather find another way but haven't landed on it yet. We have various displays that open when the player hits whatever keybind that they've assigned. I'm wanting to close the dialog by hitting the same key combo. I have it working fine if I pre-define the a single key but the goal here is to let the players choose.
You don't need to compare any key codes for that. Just have the keybind detect whether the display is open, and either open or close it depending on the answer
Such as an IF statement in the onActivate = "" field?
if (isNull (findDisplay _yourIDD)) then {
call troy_fnc_openDisplay
} else {
call troy_fnc_closeDisplay
};```
OK, thanks, I'll give it a shot. I was under the impression that the open display blocked the passing of keys outside of the display.
I had been testing something similar originally.
Well, test it.
If that is the case, then you have a display of a type where Esc will always close it anyway so you might not need to worry about this
anyone knows if this command will work as intended when running from the server on a dedicated server:
if (((getPos _vehicle) getEnvSoundController "houses") >= 0.7) then {
_vehicle limitSpeed 20; // In cities reduce speed limit a little bit.
};
_vehicle is also local to the server with an Ai unit on the server driving it
haha thats what i mean, i want to implement the API in a way that when a new version of the main library is released you dont have to recompile a plugin unless its absolutely needed.
i was thinking "i could pass all the sqf functions to client plugins as a struct..."
but then i thought if that struct changes because sqf functions get added/removed
then older client libraries would break
so instead i dynamically get teh pointers from the library
that way if a new version is released the older plugins will still just be calling the dynamic allocated functions they know exist
What version of detours this use?
Thanks for that โค๏ธ
anyone know how i get say this this addaction ["Enter Bunker",{(_this select 1) setpos [markerPos "Entrance_1" select 0, markerPos "Entrance_1" select 1, 0]}]; to run a script when used?
or have a trigger run a script?
idk what im doing XD
What are you trying to get the action to do?
trying to get it to tp and run a script to spawn loot
XD
Using dmd, the one he linked?
ye
Well from looking at it, Try replacing (_this select 1) setpos [markerPos "Entrance_1" select 0, markerPos "Entrance_1" select 1, 0] with [] execVM "DMD_LootSpawn\lootHandler_server.sqf";
Keep in mind that just calls the script itself, You'll need to handle the spawn locations seperatly
[] execVM "DMD_LootSpawn\lootHandler_server.sqf"; ik that part but i wanna have the action do both if possible
yeee
(_this select 1) setpos [markerPos "Entrance_1" select 0, markerPos "Entrance_1" select 1, 0]; [] execVM "DMD_LootSpawn\lootHandler_server.sqf"
Plop that between the {}
Be careful with that though, It might be better to add the loothandler script into the init.sqf instead of this
gotcha how come?
From what i'm seeing everytime that script is called it doesnt stop, it forces itself onto a loop
Calling it everytime someone goes in that bunker would cause it to run the loot spawning multiple times
ah what if i add sleep 120; to the sqf?
Depending on where you put it, it would just delay the loop from repeating
ok gotcha
Also, does anyone know if it's possible to entirely disable the AI system while still having them respond to move commands/fire commands
so dose dmd spawn loot all over the map or do i have to place a marker with a init if so what is it vscode is no help XD
I have no clue, that you'll prob have to ask tenured about
it uses v3 verox
if you cant get it to compile check the cmake file in the loader for the paths
sometimes the installer puts them in different places
ima rework that later
Detours won't compile for some reason, need to find out why
I think WinSDK isn't installed
uhrm ... just some stupid idea @grizzled cliff
why not simply an array?
Is it possible to create a teleport script that goes of steam id? For example one person witht he correct steam id gets teleported but anyone else dosnt?
yes
You can create addaction to an object and add a condition to check the player's UID .
And if he has correct uid, the addaction shows up for him.
https://community.bistudio.com/wiki/getPlayerUID
https://community.bistudio.com/wiki/addAction
offsets would change, i mean it could be an array of op entries, but honestly i already have the infrastructure to call and get a pointer via a name/arg signature
so i might as well just use that
also i have to do it manually
because im assigning static pointers
for speed
Sweet thanks will look into it
so it'll be lines and lines of this...
__sqf::unary_random_scalar_raw = (unary_function)functions.get_unary_function_typed("random", "SCALAR");
but its easy enough to autogenerate that
then im just wrapping those pointers in nice function calls
so in the end it'd be rv::random(100.0);
why you'd wanna call the SQF random function, I don't know
its just an example
:P
any luck with heavy loadouts and enableStamina in v1.54 ? it doesn't seem to work or maybe there's something else i have to do ?
enableStamina = false + standard loadout -> i can sprint forever as intended
enableStamina = false + heavy loadout -> i can only walk
I am kinda trying to do an orbital drop pod script. Issue I have is that it doesn't check if it hits the ground fast enough, meaning by pod will bounce. I need to either prevent bouncing or check it faster. I wanted to use WaitUntil initially, but read somewhere that it doesnt work great in MP
[]spawn
{
detach mfpodbase1;
sleep 2;
addCamShake [10, 5, 25];
mfpodbase1 setVelocity [0, 0, -500];
playSound3D ["A3\Sounds_F\ambient\thunder\thunder_01.wss", mfpodbase1, false, getPosASL mfpodbase1, 5, 1.5, 2000];
while { (getPosATL mfpodbase1) select 2 > 1 } do {
sleep 2;
addCamShake [10, 5, 25];
mfpodbase1 setVelocity [0, 0, -500];
};
player allowdamage false;
addCamShake [10, 1, 25];
mfpodbase1 setVelocity [0, 0, 0];
mfpodbaseloc1 = getPosATL mfpodbase1;
mfpodexp1 = "SatchelCharge_Remote_Ammo_Scripted" createVehicle mfpodbaseloc1;
mfpodexp1 setDamage 1;
mfpodbase1 setVelocity [0, 0, 0];
deleteVehicle mfpoddoor1;
sleep 3;
player allowdamage true;
};
How to remove the marker Minefield on a map in Zeus?
does it have a variable name?
no
EachFrame event handler allows to run code fast
I am not super familiar with eachframe event handler, will it run on a loop if I write if then else inside of it?
the code you give it runs every frame so yes in sense a loop
and than I assume it I need to add code to kill the eventhandler under else
you can kill it with this (inside the EH code): removeMissionEventHandler ["EachFrame",_thisEventHandler];
[]spawn
{
detach mfpodbase1;
sleep 2;
addCamShake [10, 5, 25];
mfpodbase1 setVelocity [0, 0, -500];
playSound3D ["A3\Sounds_F\ambient\thunder\thunder_01.wss", mfpodbase1, false, getPosASL mfpodbase1, 5, 1, 2000];
addMissionEventHandler ["EachFrame", {
if (getPosATL mfpodbase1) select 2 > 0.1)
then
{
sleep 2;
addCamShake [10, 5, 25];
mfpodbase1 setVelocity [0, 0, -500];
}
else
{
player allowdamage false;
addCamShake [10, 1, 25];
mfpodbase1 setVelocity [0, 0, 0];
mfpodbaseloc1 = getPosATL mfpodbase1;
mfpodexp1 = "SatchelCharge_Remote_Ammo_Scripted" createVehicle mfpodbaseloc1;
mfpodexp1 setDamage 1;
deleteVehicle mfpoddoor1;
sleep 3;
player allowdamage true;
removeMissionEventHandler ["EachFrame",_thisEventHandler];
};
}];
};
Something like that I assume?
yea something like that
That's not gonna end well for you lol
sleep wont work inside the EH though
you should keep the sleep required code in the original loop you have and time critical code in the EH
I changed the code a bit, but however now I am getting missing ; error somewhere around if statement
[]spawn
{
detach mfpodbase1;
sleep 2;
addCamShake [10, 5, 25];
mfpodbase1 setVelocity [0, 0, -500];
playSound3D ["A3\Sounds_F\ambient\thunder\thunder_01.wss", mfpodbase1, false, getPosASL mfpodbase1, 5, 1, 2000];
addMissionEventHandler ["EachFrame", {
if (getPosATL mfpodbase1) select 2 > 0.1)
then
{
addCamShake [10, 5, 25];
mfpodbase1 setVelocity [0, 0, -500];
}
else
{
player allowdamage false;
addCamShake [10, 1, 25];
mfpodbase1 setVelocity [0, 0, 0];
mfpodbaseloc1 = getPosATL mfpodbase1;
mfpodexp1 = "SatchelCharge_Remote_Ammo_Scripted" createVehicle mfpodbaseloc1;
mfpodexp1 setDamage 1;
deleteVehicle mfpoddoor1;
removeMissionEventHandler ["EachFrame",_thisEventHandler];
};
}];
sleep 5;
player allowdamage true;
};
right under the addMissionEventHandler you are missing (
((getPosATL mfpodbase1) select 2 > 0.1)
ohhhh
gotcha
works perfectly other than it still bouncing a tiny bit, but I am sure I can fix it, maybe setvelocity is not correct command, I will see. But probably the explosion is causing it thx
Don't use turtle like loadouts, ?
yep that's what i'll do but the people playing my mission are already complaining
tell them to git gud
Is it reasonable to use nearestObjects to find a list of all entities with 8,000 meters of a point and run an EMP script on all of them? The script only affects vehicles and disables them for 10 seconds each (already working, will not be changing it), but I'm worried that it might cause too much lag. The radius is pretty big because the eventhandler is attached to a "nuke" ammo that's configged to be a really big bomb but buildings and rocks tend to be ample cover to avoid its effects, despite its ~4km theoretical blast radius.
Somebody knows?
@abstract bay If it's entities then use nearEntities.
Oh yeah meant to say nearestEntites not nearestObjects whoops
How can I make the script parameter _radius usable inside the Explode eventhandler?
setVariable it onto the projectile object.
Like this?
Yes, but you then need to read it within the EH.
_a = _this select 0;
_b = _this select 1;
_object setVariable ["data",[_a,_b]];
_object addEventHandler ["Fired", {
_a = ((_this select 0) getVariable "data") select 0;
_b = ((_this select 0) getVariable "data") select 1;
hint format["%1 and %2",_a ,_b];
}];``` example from BI Forums
Here's my current setup, I just finished adding the variable reader when I saw that
Hmm that didn't seem to work. Hint did not appear. I'm a dumbass and forgot to save the script before re-packing, it worked perfectly!
Would the forEach command be appropriate to use when I want code to execute for each element in their own scheduled space? The code I want to execute contains some sleep commands, and I'm wondering if this would apply to each element at the same time, or sequentially as forEach iterates through each member of the array.
forEach runs for each element sequentially, yes
There's even a forEachReversed now.
Even SQF code that runs in a separate context is guaranteed not to run concurrently.
What could I do to execute each pseudo-simultaneously? I don't need timing to be perfect but do need to give off the impression that each entity is being affected at the same time. I have some vehicle configs with an EH that runs on its own timer for each unit, so I know there has to be some way to do it.
Offload to a separate sqf?
Not 100% sure what you're talking about, but probably spawn
Ah, that might be it, I was thinking call... executeVM... but I don't know the differences between all the different commands that can be used to execute code.
execVM is a bit like spawn + compile.
I doubt the lag between each loop in forEach would be noticeable without running some dev debug tools, unless you're running hundreds of scripts and/or playing in 1fps at the same time
The thing is that the code I want to execute is basically "disable vehicle components for 10 seconds" with some sleep commands forcing those 10 seconds, so I can't have it go sequentially.
well if you run 500 spawns/execVMs at once, instead you'll introduce a 5 second lag if not worse I guess
You'd need to give a specific example.
and that loop lag would be probably a matter of 1/1000ms?
Of the code that would be put inside the spawn? It's not pretty (nor is it configured to work inside a spawn yet) but here it is:
If it's an EMP, and every vehicle is affected for the same time, why not:
{
//disable stuff
} forEach _vehicles;
sleep 10:
{
//enable stuff
} forEach _vehicles;
Now if each vehicle is affected differently then you'd have a better argument for firing off 100 spawns.
Not that it's necessarily the best way to do that, but it can certainly be convenient.
Yeah, each is different (above) since I designed one code that should work with every reasonable vehicle type.
Confirmed that it works, and simultaneously on at least two objects. Code structure below in case anyone happens to stumble across this in the future.. Should have been three objects I tested it on but the plane I used to launch the nuke may ahve been caught in the blast.
please note that it also creates one thread per entity
(and you can remove all checks but _isMan)
{
if (_x isKindOf "CAManBase") then { continue; };
_hitEntity allowCrewInImmobile true;
_hitEntity setVehicleRadar 2;
// (...)
_hitEntity allowCrewInImmobile false;
_hitEntity setVehicleRadar 0;
} forEach _nearbyEntities;
Well I'm actually in the process of implementing the isMan part so I can do things like swap out NVGs for versions with my defunct modelOptics texture versions as well as swap out weapon lights/lasers/some optics.
And since my scripts change slightly depending on the type of unit being affected, I still run some if statements using those checks.
apparently "spine3" used to be among the non lethal hit points and now it's not
for reasons
messes up revive systems that don't rely on the player actually dying
0 spawn {
tank doWatch (getPosATL target);
sleep 3;
tank fire ((weapons tank) select 0);
};```
Having some issues with IFA and Spearhead DLC Tanks firing. Vanilla tanks and RHS tanks work fine using this simple script. I tried to do ``ForceWeaponFire`` with tanks from both the mod and the CDLC, and that did not work either. ``ForceWeaponFire`` also works with Vanilla/RHS tanks. As far as the CDLC and IFA tanks go, they fire their MG just fine if I change the ``select 0`` to ``select 1``, just their main cannon is having issues.
I execute disableMapIndicators on initPlayerLocal. Does it need to be executed also after respawn / JIP ?
Hey want a piece of information? THEY CHANGED NEARLY ALL OF THEM
they also changed vest and helmets armor values.
aww
:tears: for you guys
luckily we all rely on HandleDamage
ohh no wait
not all of us
The most used ones do huehuehuehuehue
im trying to loop a sound but somehow it doesn't loop any idea why it doesn't work?
[] spawn
{
while {someVar};
private _source = playSound ["sound1", 2, 0];
waitUntil {isNull _source};
};
nvm
just saw the error while {} do {}
silly me XD
does my framerate affect the accuracy of unitCapture/unitPlay? I was wondering what to expect if I record unit in 60 fps (settings-wise) and suddenly I dip into a map area that lowers my FPS by half. Not sure if I should lower settings to minimum when recording and do that as early as possible, as in before plopping stuff and scripts into the mission
it does, but unitPlay uses interpolation so you might not notice it
Does scriptDone return true after the code in spawn has been executed or when it has all been added to the scheduler?
when the code is no longer running
Hey guys! Im currently trying to figure out how to make an certain object only visible to certain players within in the same faction (Blufor).
Is there anyway to even make this possible?
https://community.bistudio.com/wiki/createVehicleLocal that creates objects locally
Thank you very much
Does something like that also exist for general objects besides vehicles?
General objects are vehicles
You can also use hideObject if you might need it to become visible to other players at some point
Thats very interesting haha
Outside of a couple of special object types (lights, cameras, sound sources) anything that doesn't have some kind of brain is "a vehicle". Even units are technically vehicles, although if you try to create one as a vehicle it won't have its brain.
Here's a snippet from a modding sample readme I found
Welcome to Arma 3 where:
- Your helmet is a weapon
- Your vest is a weapon
- You are a vehicle
- Your uniform is someone's else skin
- Your backpack is a vehicle loaded into you
- Your hands are attached to your weapon, and not the weapon to your hands
- Handguns don't exist
- Your IR pointer points backwards
- Dammage and dissassembleInfo
Arma has its many quirks
Where do I need to execute createVehicleLocal?
Where you want the object to appear
When do you want to the object to be created?
right before it appears!
I so wish to pin that
Immediately, on mission start? Then probably initPlayerLocal.sqf. At some other time? A trigger may be what you need. There are other options depending on when you want it to happen.
Thank you I will try around a bit and report back
My rough idea is that on mission start it gets determined who sees the object and who doenst therfore I suppose initPlayerLocal.sqf is the way to go
Using initPlayerLocal.sqf means you don't have to check everyone, just the local player. Thus:
waitUntil {!isNull player};
if (side group player == west) then {
// createVehicleLocal
};```
@bold comet player allowSprint true;
Hello, I'm attempting to mute the player's voice in a config rather than a mission script, so that it applies to any mission. I'm using player setSpeaker "NoVoice" to do this, but I don't really have a good understanding of scripting at all. So from what I understand, I need a preinit file executed from the config to work? I think got it to execute at least.
Here's what I'm putting in my preinit.sqf:
player setSpeaker "NoVoice"
} forEach allPlayers;```
Doesn't seem like this is working though
You have a few issues:
playeralways refers to the local player of the current machine. So by doing thatforEach allPlayers, you're just setting the voice of the local player, times the number of players currently connected.preInit.sqfis not a recognised file, so it won't be automatically run. You should make a function with its preinit flag set, if you want to run something at preinit. (https://community.bistudio.com/wiki/Arma_3:_Functions_Library)- doing this at preinit may not be a good idea, because it has to work on the player object. The player object may not exist at the preinit stage. Using postinit may be more sensible.
I'll settle for singleplayer use only then, would just using setSpeaker by itself be fine?
Should be.
Doing MP as well should be possible. I think you would need a bit of remoteExec and a Respawn event handler.
You got me curious about MP. So I'm setting it up like this:
[_unit, "NoVoice"] remoteExec ["setSpeaker"];
this addEventHandler ["Respawn", {
params ["_unit", "_corpse"];
_unit setSpeaker "NoVoice"
}];```
I'm looking at the wiki, but I'm still not really understanding how to apply this to any player. _unit is a placeholder
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
If all players will definitely have the mod, then use player as the target unit and remoteExec the setSpeaker commands. Each machine will detect its own local player, and instruct all other machines to setSpeaker for that unit.
If the mod is optional (some players might not have it) then it becomes more complicated, because each machine then has to detect and handle all the other players, rather than just worrying about their own. While allPlayers can do some of what you need to do that, the big issue is that players can join and leave an ongoing game, so just checking that once doesn't cover the whole mission.
Thanks so much!
how to center an image with BIS_fnc_dynamicText? the x y points seem to be taken from top left of the text rather than its center. It's a 1920x1080px image, I managed to center it with
["<img size='20.0' shadow='0' image='images\image.paa' />",[-0.5,2],-0.35,10,1,0,789] spawn BIS_fnc_dynamicText;``` but I'd like to have it more universal and working on other aspect ratios.
anyone tested the new BIS_fnc_lerp yet?
what is it doing?
i dunno, that's why i wondered if anyone here had tested it, i'm not at my main PC
So, I think I've found out that model.cfg animation order is Y-X-Z (but not X-Y-Z) and it solves some part of it. I still don't know the concept is any good ๐
Hey guys, I'm experimenting with the SOG onslaught modules and would like to use them with Global Mobilisation units to simulate a soviet mass assault. Is there a resource online with the Units XML tags in a spreadsheet or something?
What do you mean by Units XML tags? Do you mean classNames?
Yes I was about to edit and ask if that was even the right terminology. Knowing they're called class names makes the Google much easier.
One easy way is to place multiple units you want to get, select them, right click, Log, Class
Hey thank you so much! That was painless!
<t align='center'></t>
```?
nope
Don't know if it is intentional, but I can't seem to set PVs on the server via the Debug Console in 1.54
Question, can the Keys and Userconfig folders be in an addon folder?
if not, then why am I constantly seeing these folders included in the @folder and not along side it?
They can, the emplacement doesn't matter as long as it's in the game root folder
thanks
is that true for the userconfig folder too? If I dont have the userconfig folder in my arma3 root, i get a not found error for included files
Better use RscPicture or RscPictureKeepAspect
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
how i can add cooldown for addaction, i took ombra halo jump script and modified it to my needs p1 initsqf this addAction["<t color='#37A9E7'>Call Paratroopers</t>","[player] execVM 'para.sqf';"]; then para.sqf _unit = this select 0; then para.sqf ```sqf
_unit = this select 0;
openMap true;
mapclick = false;
onMapSingleClick "clickpos = _pos; mapclick = true; onMapSingleClick """"; true;";
waituntil {mapclick};
_parapos = clickpos;
_target = para1 setPos _parapos;
openMap false;
sleep 30;
_unit addAction["<t color='#37A9E7'>Call Paratroopers</t>","[player] execVM 'para.sqf';"];
trg1 setVariable ["trigger", 1];
to add cooldown you could have ```sqf
lastHalo = -100000; // Init this variable somewhere
lastHalo = time; // Set this in the para.sqf script (for example)
((time - lastHalo) > 30) // put this in the condition of the addAction for 30 sec cooldown
i wonder why you have two addActions there, when one should be enough...
Userconfigs might need to go in the right folder.
[2015-12-01 15:25:15,431] - INFO - {Z:\intercept\src\client\example_dll\client_dll.cpp:17}t:44652- SQF Random Call: 9.84707
[2015-12-01 15:25:15,441] - INFO - {Z:\intercept\src\client\example_dll\client_dll.cpp:17}t:44652- SQF Random Call: 83.0076
[2015-12-01 15:25:15,451] - INFO - {Z:\intercept\src\client\example_dll\client_dll.cpp:17}t:44652- SQF Random Call: 23.5357
nice
void __cdecl intercept::on_frame() {
float rand_val = intercept::sqf::random(100.0f);
LOG(INFO) << "SQF Random Call: " << rand_val;
}
can I use ctrlMapScale in editor? And if so, how? ctrlMapScale ((findDisplay 12) displayCtrl 51) in Eden returns a static number that does not change no matter how zoomed in or out I am

You could reverse engineer the scale value int he status bar
you mean the 4th value?
yep
_dis = format [localize "STR_3DEN_Display3DEN_StatusBar_ValueRes",(worldsize * (ctrlmapscale _ctrlMap)) / (getresolution select 2)];
hmm
They use ctrlMapScale for that
@jade acorn ctrlMapScale works for me
ctrlMapScale ((findDisplay 12) displayCtrl 51)
You need to use findDisplay 313
Why isn't Arma 3 pilot AI working properly?
Yes, although it works well for air combat, why doesn't it attack with appropriate ammunition for ground targets (such as shooting with cannons and then falling while there are laser ammunition suitable for tanks) or at the appropriate angle?
I made various attempts to throw bombs on the editor. Like this code that will run when Waypoint activates: this forceWeaponFire ["Bomb_03_Plane_CAS_02_F", "LoalAltitude"];
I first got this code from this topic: https://forums.bohemia.net/forums/topic/234853-fire-weapon-on-waypoint-problem-finding-classname/
and I placed the same bombs on the same plane. However, strangely enough, while most helicopters and ground vehicles managed by AI in Arma work properly (in my opinion), the planes do not work properly in the AI part. There is no action similar to a bomb or rocket launch.
What can I do regarding this issue?
I tried this code on default aircraft using the ammunition classnames below, but still no result:
https://community.bistudio.com/wiki/Arma_3:_CfgWeapons_Vehicle_Weapons
โ
hello internet, i wonder how i find classnames of mod vehicles - in this particular case im trying to make an AI plane drop a Bomb at a waypoint this forceWeaponFire [Bomb_03_Plane_CAS_02_F, LoalAltitude]; i used this in vanilla planes and a c.u.p. planes and it worked fine, as long as i used FAB...
yeah this works, thanks
if (_saveVehiclesMode > 0) then {
private _allVehicles = vehicles select {!(_x isKindOf "Static") && !((_x isKindOf "ThingX") && (([configfile >> "CfgVehicles" >> typeOf _x,"maximumLoad",0] call BIS_fnc_returnConfigEntry) > 0))};
private _varNames = GVAR(allFoundVarNames) select 1;
if (_saveVehiclesMode in [1,3]) then {
{_x setVariable [QGVAR(isEditorObject),true]} forEach _allVehicles;
};
if (_saveVehiclesMode in [1,2]) then {
_allVehicles call _fnc_saveVarNames;
};
};
``` for vehicle position or Inv?
hi
how are those special objects like "#particlesource" called?
Can you setVariable on them? I try to attach some data to them, but getVariable does not seem to return any value at all.
Not sure what is going on here.
setVariable may not be allowed on them as they are local and quite simple objects
oof
i was hoping to store some values on them instead of making an array. welp, array, it is.
is there any... name or sth on them so i can research on those?
nope
only thing i can find. no clue what those are though
#lightpoint, #soundsource, #reflector (iirc)
that's all I know
it's simple, just create a lightpoint, try to setVariable then getVariable: if it does not work, it's not working on them ๐ ๐
you can also use allVariables to read all set variables on them
tried that, didnt return anything, not even [] so i guess thats simply the case i have to accept. at least im not getting crazy cause the code looks fine ^^
Thanks!
tested, confirmed, does not work ๐
apprechiated
testing more & adding to the wiki doc for clarity
added! thanks for the intel ๐
Any idea why this script is throwing a Generic Error in Expression?
if (combatBehaviour (effectiveCommander _hitEntity == "COMBAT")) then {_hitEntity allowCrewInImmobile true;};
Full error message in picture
hold up I may be a dumbass...
please use #arma3_scripting for such questions ^^ thanks
(and yes it's a parentheses issue)
umm this is #arma3_scripting
Yep just fixed my parentheses and about to test
if (combatBehaviour effectiveCommander _hitEntity == "COMBAT")
Working great now, thx.
@tidal idol sorry about that, I was switching between here and #community_wiki and was persuaded you posted there ๐ mb
when getting the relative positions for 3den entities, is it better to do modelToWorld or modelToWorldVisual?
nvm, i'm an idiot, i was referencing the same model instead of changing it with forEachIndex
i hate how it takes posting it elsewhere before your brain goes, OH HEY!
just as i noticed that right now ...
so ... we keep a WHOLE fucking shit in SQF for backward compatibility but local --> private which makes WAY less sense and breaks like 30% of all scripts available right now is a good to go?
seriously who the fuck is doing those stupid decisions! i got the fucking feeling you guys just hired the managers of the company i work at
In software engineering, rubber duck debugging (or rubberducking) is a method of debugging code by articulating a problem in spoken or written natural language. The name is a reference to a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck and debug their code by forcing themselves to explain it, l...
It's better to switch it now than later where it would have an even bigger impact
ehhh ... ye
totally forgot tha most scripts still ahve to be written
as arma 3 just got released
[
[2bb164a0100# 163978: sign_arrow_large_f.p3d,"Debug_Helper"],
[00007FF7AB13E630,"...",1],
[00007FF7AB13E630,"...",1]
]
I somehow ended up with this...
The first nested array has an object refernce as we usually know it, the 2, and 3, index though seem to be broken? I cant even use select # 0 on it?
The alternative syntax was "found" 3-4 weeks ago
You would need to explain the "somehow"
Basically im creating a particle source
_spawner = createVehicleLocal ["#particlesource", [0,0,0]];
and store that as part of a nested array in a global variable for later use.
CVO_Storm_Local_PE_Spawner_array pushback [_spawner,_spawnerName, _intensityTarget ];
The array you see above is said CVO_Storm_Local_PE_Spawner_array
Because it would be an even bigger mess later, and local wasn't making much sense.
ok
tell me
enlighten (better: entertain) me
why did local made less sense then private
This part looks incorrect at least:
CVO_Storm_Local_PE_Spawner_array = CVO_Storm_Local_PE_Spawner_array - [_spawner];
deleteVehicle _spawner;
Consistency across the board ?
ahm, that shouldnt be triggered at that point i think? lemme look
Also this one:
{ _x attachTo [_player, _relPosArray]; } forEach CVO_Storm_Local_PE_Spawner_array;
You seem to have a lot of code that treats that array as a simple array of objects when that's not what's in it.
yea. it was before, then i came to the conclusion that i cant setVar on "particlesource" objects, so im switching over to a nested array with the obj and the data i wanted to store with setVar
but i dont think that caused my initial issue... i think at least
private was used to declare variables local to your scope
local means "is object X local to my computer"
eg.
To private ?
is <ME> owner of <VEH>
Private now has the alternative syntax instead of local
those two commands have NOTHING in common
well, i get normal objects now - still some stuff broke but hey, progress.
Thanks a lot!
[[13b1d6bcb80# 163989: sign_arrow_large_f.p3d,"Debug_Helper"],[163990: <no shape>,"cvo_storm_particle_cvo_pe_leafes_particlesource",1],[163991: <no shape>,"cvo_storm_particle_cvo_pe_dust_high_particlesource",1]]
dude ... i know that frking command
the thing is it simply does not makes more frking sense there
it makes less
It's possible that you found an Arma bug there but you'd need a less complex replication :P
the object is not private to computer X
it is LOCAL to computer X
and available on ALL other computers too
But.... it's the same fucking use......
i just want particles man
the alternative syntax of local had the same use as private ....
ill see if i can reproduce my horrible code
it is like i am talking to a wall
just like my wall does not responses stupid shit ...
question for you all why dose this not work?
if (_totaleBurst == 1) then {
player setVariable ["lastburst", time, true];
player setVariable ["totaleBurst", _totaleBurst + 1, true];
};
if ((abs(_lastburst - time)) > _cooldown) then {
player setVariable ["lastburst", 0, true];
player setVariable ["totaleBurst", 0, true]
};
if (inputAction "TurnRight" == 1 && ((abs(_lastburst - time)) > _cooldown)) then {
_vel = [
(_vel select 0) + (sin (_dir + 90) * _burstspeed),
(_vel select 1) + (cos (_dir + 90) * _burstspeed),
(_vel select 2) // horizontal only
];
player setVariable ["totaleBurst", _totaleBurst + 1, true];
};
im trying to only have the bell update once per x amount of time with out suspending it as its all in a perframe handler but it keeps setting it to 0 even after the burst goes up past 1
Previous alternative syntax of local: Privatize a var
New alternative syntax of private: Privatize a Var
Private first use: Privatize vars
Local first use: Check if something is local.
"it does not work"
do you have an error message or anything?
it just keeps setting it to both vars to 0
tip #1, do not broadcast a variable every frame ๐
https://feedback.bistudio.com/T179654 its a bit messy but in case you care.
and when you come to the point which simply is retarded?
renaming its core functionality?
but hey
why not changing the whole terminology of something from IsLocalToClient to IsPrivateToClient
i mean XD its not like private has a totally different meaning then local
or that all people used local for ages for EXACTLY THAT PURPOSE
And we come back to my first point, consistency
it would have been consistent to remove the alternative syntax and leave the locallity check
this move now is garbage that destroys scripts
I'm not sure if you're serious or trolling at this point
Anyone know if it's possible to change a vehicle's turnCoef via script?
Or in some other way impact the turning radius of a vehicle
I'm not even sure if that's possible through config.
You're talking about a ground vehicle?
if(local _veh) then {diag_log "i make sense as _veh is local to my computer and remote on others";};
if(private _veh) then {diag_log "i am garbage as _veh private would mean that other computers would not have access to it";};
more happy now?
........ You need to read what private and local do .... seriously
quote:
Check if given unit is local on the computer in Multiplayer games (see Locality in Multiplayer for general concepts).
This can be used when some activation fields or scripts need to be performed only on one computer. In Single player all objects are local.
BUT THE ALTERNATIVE SYNTAX WASN'T THAT, THAT'S WHY IT WAS MOVED
so instead of removing the nonsense on that command we put the whole command as "private" to make THAT command inconsistent then again?
ohh ye
GREAT IDEA
whilst we are on it
createVehicle could use more functionality
why not merging it with createUnit?
would be consistent to have just one command wouldnt it?
you have to use deleteVehicle for both too
........................... Okay I give up, you're trolling.
this now? yes THAT was fucking trolling or more showing the obvious via the help of trolling
it is complete BS to rename the WHOLE command just to remove one inconsistent shit
then the fucking changelog is missleading and you could have saved your time by just telling me
{private "_var"; _var = 1;} == {private _var = 1;}
and befor the private keyword was local and that get changed
It's not like I was pointing out that only the alternative syntax was changed but hey
you argued against "the change from local to private is BS as local objects are not private objects" with the alternative syntax being the reason whilst the changelog states that the whole command got changed aka removed ...
Does anyone know why the fuck for some reason I respawn instantly in stuff I'm working on. I use player setDamage 1 and got "Killed" EH... but in that Killed EH I'm already alive again
I can put setplayerRespawnTime 10e10 at the start of the killed EH.... still instant respawn
It switches between actually respecting setPlayerRespawnTime and the other one being instant no matter what I do
There's only one "Killed" EH added to player and setPlayerRespawnTime is only used within that EH
are there any "task" event handlers? or are they planned ?
you're 6 years late to the feature request party buddy
not sure what exactly you want but you can make custom event handlers with what you already have in game (oneachframe etc) or with CBA XEH
or make a request/suggestion ticket and hope that BI will hire someone for a part-time job once again to add some new stuff, but we'll probably die of old age before that
having this error on this mission (modset in zip file), problem is...there is no such expression that looks like that in that mission file so, any ideas? (send help i am going insane)
this is the functions folder if you dont wanna download the whole thing, it is likely that the error came from here
also the script runs fine, to trigger this error its in radio command, no.3
TLAM Strike
the whole thing runs fine, and as intended yet...yeah it spits out that error
is there a way to add more seats to a vehicle?
By script no
you could use attachTo command to put more passengers to a vehicle, like ride on top of a tank for example
some function is provided with wrong arguments then
right...i dont know exactly how to fix it here, sadly
i reckon...it came from this file, because well...its the only one that uses doTarget, if someone can look it over, i don't know where this goes wrong
shouldn't that be ```sqf
[_vic,t3] remoteExec ["doTarget",_vic];
alright, i'll give it a shot
yuuuup that was it, thank you!
one last thing im struggling with, is i have this trigger which would activate a script, now...if i were to terminate this script, how would i write it?
[] spawn {
{
sleep (random 5);
[_x] remoteExec ["TNRGN_fnc_wr_vic_shoot2",_x];
} forEach [aa1g,aa2g,aa3g,aa4g,deuce1,deuce2,deuce3];
};```
cuz i tried... "terminate TNRGN_fnc_wr_vic_shoot2;" didnt work
like ```sqf
scriptHandle = [] spawn {...
terminate scriptHandle;
ohhhhhh so thats what the...ok right, thank you!
right...so i gave it a shot, sadly it didnt work, here's what i put in
airfieldflak = [] spawn {
{
sleep (random 5);
[_x] remoteExec ["TNRGN_fnc_wr_vic_shoot2",_x];
} forEach [aa1g,aa2g,aa3g,aa4g,deuce1,deuce2,deuce3];
};```
and
```sqf
terminate airfieldflak;```
what happen?
it won't stop a function from remote-executing, it will only prevent any future call
righttttt how would i terminate that function then? i've seen...execVM?
airfieldflak = [aa1g,aa2g,aa3g,aa4g,deuce1,deuce2,deuce3] execVM "TNRGN_fnc_wr_vic_shoot2";```
i wrote this, maybe it'll work?
damn
you can only terminate a script where it is running
sorry, im not sure i quite catch that?
private _airfieldFlaks = _allTheAA apply { _x spawn FuncName };
sleep 2;
{ terminate _x } forEach _airfieldFlaks;
BUT
if the function cannot be run server-side, you have to do something else
so to give context, the above script is for an airfield attack, where at a certain point the AAA open up and start shooting, then at a certain point, the guns stop which is where the script terminate
the part where the guns stop is activated by a trigger, with the timer counting down after one of the units in the airfield is destroyed which signifies the end of the strike
soโฆwhere do i put this in?
on Mars!
rightโฆsorry
i'm confused what script you want to stop from running ?
Would be better to stop the gun from shooting by removing its ammo or not? That would stop it immediately
yeah thats my back up plan, but i initially figured this was easier
apparently not XD
this one #arma3_scripting message
which i then tried making it an execVM and writing this instead #arma3_scripting message
well i dont see why terminate wouldnt work on spawn-ed script as long as its on the same PC
i'll test it again, but what if it doesnt work?
then idk :/
but that spawned script does end on its own, after the loop with sleeps
so im not sure what you want to do here
im gonna try lou's version
at your own risk ๐
So I have a respawn module syched to 16 single seat bacta tanks. The problem I'm having is if a player is already in one and another player selects that spawn then the player starts parachuting. Ia there a way to disable that spawn while a player is in it or even like a auto get out script? Any ideas
[] spawn
{
{ _x setVehicleAmmo 0;
} forEach [aa1g,aa2g,aa3g,aa4g,deuce1,deuce2,deuce3];
};```
right so, i gave up, and just tried setting the vehicles' ammo to zero instead, didnt throw any errors but didnt work either
alright so to cap this off i just destroyed them instead, which works, unsurprisingly
ok, so: are the vehicle targets AI only (and will remain so)?
if so, you don't need to remote exec, as they are local to the server.
also dont need of terminate, just use the while condition
nudge nudge 0 spawn is slightly quicker
how can I remove the date that's displayed on record creation with createDiaryRecord?
I don't see anything relevant but I don't think something like that would be hardcoded
I beleve its hardcoded somewhere for diary record to always show date. But what you could do is just delete that and create your new subject and it wont show the record something like this:
player removeDiarySubject "Diary";
player createDiarySubject ["Briefing","My Briefing Page"];
player createDiaryRecord ["Briefing",["Intel", "Enemy base is on grid <marker name='enemyBase'>161170</marker>"], taskNull, "", false];
Is mission file only limited to use scripts within it's directory?
I made a supply system for my unit, they can search crates, find supplies and bring them to base. Bringing supplies results in updating global variable holding the supply count.
For now for each mission file we have to manually update the values before putting it on the server. To solve this I was thinking whether it's possible to create an singular ini file or DB on the server that all mission files would use use to get current supply count AND update as mission progress? I know of inidb2 and extDB3 systems but after going through documentation I can't tell if it's possible to use common file by multiple missions files so perhaps someone can tell me if it's even possible for mission file to reach outside of it's directory?
yeah you need extension to write files outside of mission dir
and in sqf you cant write files
You could save the relevant information to a variable in the server's profileNamespace, using setVariable
Okay so I could define a variable in missionProfileNamespace, then bind missions by missionGroup?
Do you know if this method is suitable in case when variable is updated often? In this particular case one of variables is updated each time player reloads an empty or almost empty magazine so I'd say quite alot when there is a lot of players
What kind of extension?
I wouldn't recommend using saveMissionProfileNamespace that often. However, I think it would be reasonably safe to update the "live" variable that often (using setVariable) and just do the commit-to-disk save operation less frequently.
inidb2 for example, that's the only one I have used
Ah okay, didn't understood you were refering to those
I see, cheers for giving me the idea. I will experiment with it ;)
question, can I give a variable to addmissioneventhandler ["eachframe..... so I can kill it at later point?
it already returns an id?
It does? I wasnt aware of that, how do I check it?
one way ```sqf
addMissionEventHandler ["EachFrame",
{
removeMissionEventHandler ["EachFrame",_thisEventHandler];
}];
addMissionEventHandler โ returns Number
(other way)
So I can just do:
myeh1 = addmissioneventhandler ["eachframe.....
and than
removeMissionEventHandler ["EachFrame",myeh1];
}];?
IDs are made for that yeah
Note that EH IDs are specific to each client - they can be the same on different clients, but aren't guaranteed to be - so saving and retrieving them should be done locally
ahh I see than you
are variables remembered inside of "forEach" loops?
_defender_number = 0
{
(_grpdefenders select 0) moveInTurret _x
_defender_number = _defender_number+1
} forEach _base_turrets;
```sqf
use this for example
That will work, except for the missing ; after moveInTurret _x
i forgot several semicolons lol
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
hey thats nifty
No. Like with any scope, when the scope ends all variables in that scope go away.
But your variable is not inside the loop. Its outside of it. So it will survive
so it will indeed step the variable up each time, instead of re-pulling the "=0"
If you don't write the assignment to zero, then it won't do that.
You do it once above the loop, the loop doesn't even know that code exists, it won't run it.
And it also won't create code inside the loop, that you didn't write there
It just does what you tell it to
What function would I use to refer to the specific spawned unit once it's been created by a script?
for instance, if i run
_nextobject = _nextclass createVehicle _nextpos;
and then do
_base_turrets pushBack _nextobject;
it's not putting the thing I just spawned into the array, its putting its classname or whatever into that array, so later on when I do the "moveInTurret" function I'm telling the unit to get into a hypothetical turret of that classname, not specifically the one thats directly next to him
The code you posted puts the object into the array
unless the spawning failed, then it will put a null object
hmm, both the object and the unit are spawned but its not putting the unit in the turret
your moveInTurret is wrong
it takes an array on the right
you gave it an object
it needs the vehicle AND the turret path (which seat in the vehicle)
ahh, into the config view i go, i suppose?
you can also sit a unit in
And run this
https://community.bistudio.com/wiki/fullCrew
And check what turretPath it returns for the unit you put in
Or https://community.bistudio.com/wiki/allTurrets could list all options
i was doing several things wrong
I was trying to get far too fancy
first off I discovered that its isKindOf "static weapon" not "turret"
second, i just did "createVehiclecrew", idk why i thought i had to use moveInTurret
Any help on why this condition is not skipping the shielded vehicle's forEach iteration?
The code shown correctly reads the variable since the hint shows up, but the rest of the forEach iteration still plays (since the crew hops out of the vehicle)
The quick fix I'm thinking of doing is just putting the rest of the block in an else statement but I don't want to do that if I can get the continue working.
Because its in a spawn
The forEach is already ran through completely and has ended. Before that if executes
Hmm I'll probably just add an else condition that does the code then actually I'll check for a not equal to IsShielded and just encase in a single if statement
How many of you use respawnVehicle command?
Script for a function called by a module:
Why is this isNil condition returning an error? To my understanding, isNil is used to check if an array is defined but has nothing inside, and IIRC I've used it on arrays before. I don't understand why it doesn't want to accept an array as a parameter.
https://community.bistudio.com/wiki/isNil
isNil is not used for that.
Hmm, I've used it in this context before. Looks like I should've put the variable name in quotes anyway.
That wouldn't throw an error but it wouldn't do anything useful either. synchronizedObjects always returns an array, not nil.
Hmm is count _syncTargets == 0 the next best way to check if it's empty then?
If you want to check whether the array is empty then _array isEqualTo [] and count _array == 0 are the options.
Fixed that, thx.
One more error is coming up though on my forEach line but I think it's because I used curly braces instead of paren
The forEach {_syncTargets}? Yes.
You don't need either there but parentheses won't hurt.
respawn mode perhaps?
please don't replace any old behaviour? ๐
I have a respawn module synced to 16 different vehicles to repsawn onto custom psotion. Problem im having is there one seater so if another player spawns in it it juse kicks them out. Can any point me in the right direction were i could either have them auto get out once respawned or make that respawn position disabled until the player gets out were it would them become available again? Any help would be appreciated.
Why are you using vehicles as the spawn point?
I'm in a star sim and when on the ship its normly up in the sky most of the time so spawning when spawning normaly you get the parachut animation which ends up killing people.
Put the respawn on the ground below the ship and have a trigger to teleport them up
Yea that could work. cheers ill look into it
Itโs what I do ye
the new system has ability to update vehiclecrespawn params in respawn queue. so you can cancel respawn all together if you want. the problem is while you can read how many respawns left, it gets confusing when it reaches zero. zero means no respawns left but 0 also currently unlimited respawns. i'd rather have -1 as unlimited.
if you had- veh respawVehicle[ delay] for unlimited respawns you are fine. if you had- veh respawnVehicle [delay, limit] for limited respawns you are fine. if you had- veh respawnVehicle [delay, 0] for unlimited respawns, this could be a problem
considering 3 people in the world used it in any meaningful way the risk to benefit ratio is small
So I am trying to make a connect players API, I have the API fully done and written in JavaScript which pulls from our roster. Now I am trying to load an extension which is the only part im stuck on how to do? The extension I am trying to load is this http://killzonekid.com/arma-extension-url_fetch-dll/ ?
This will also be going on our server so after I am done how would I convert this to a server mod? This is like my second day of SQF scripting I looked at the arma docs on how to load extensions and it didn't make much sense on how to load them(probably cause I'm spoiled on nicer looking documentation)
I understood how to call the extenstion, but not where to place files
I understood how to call the extenstion, but not where to place files
Thanks, ill try that when I am home, I'm pretty sure thats the only place I didn't try.
so I have this code inside my init.sqf file
url_fetch = {
//url SPAWN url_fetch;
private "_result";
waitUntil {
if ("url_fetch" callExtension format [
"%1",
_this
] == "OK") exitWith {true}
};
waitUntil {
_result = "url_fetch" callExtension "OK";
if (_result != "WAIT") exitWith {true}
};
if (_result == "ERROR") exitWith {
//deal with error here
hint format [
">>> [url_fetch] >>> ERROR: %1; ARGUMENTS: %2",
"url_fetch" callExtension "ERROR",
_this
];
};
//deal with result here
hint format [
">>> [url_fetch] >>> RESULT: %1",
_result
];
};
"http://killzonekid.com/hello.php?name=KK" spawn url_fetch;
And I am receiving this error, Now I am pretty sure its the where it says exitWith {true} as there is no check to to exitWith {false}
Just incase I am loading the extension wrong I also have a picture of my root arma directory
But that also means I am probably not loading the extension
That means _result was nil.. but.. callExtension doesn't return nil
I don't see the purpose of that exitWith
I just copied the code from his blogpost to try it out, looking at the documentation it should return CallExtension 'url_fetch' could not be found or something like that
sorry written into an RPT file
url_fetch_x64.dll is in your @mod folder?
Ah yeah its not, because there is no x64 version of it
you'll need to find a x64 version somewhere
I also have a http extension
https://github.com/dedmen/DAA_Mod/blob/main/main/XEH_postInit.sqf#L8
https://steamcommunity.com/sharedfiles/filedetails/?id=2622792308
that has post, put, get
and x64 version is available. But its not really meant as a standalone HTTP tool, but you can use it for that
There are probably others out there that are easier or more feature rich. Surely someone made a http fetching mod
All i am trying to do is just send a GET Request
"daa" callExtension ["get", ["someHandle", "https://stuff.de/api/v1/server"]];
addMissionEventHandler ["ExtensionCallback", {
params ["_name", "_function", "_data"];
if (_name != "DAA") exitWith {};
if (_function == "someHandle") exitWith {
//_data has your reply data here
};
}];
Getting replies is a bit more complex with mine as it uses callbacks for it
ah well thanks for the help I will be giving it a try right now
IT WORKED THANK YOU, the _data didn't have a response but thats fine for now I'll figure that out down the road thank you again
(probably something i did)
I assume the use of a callback is to give it time without having it hang until it gets a response
yes
KK's one does it too, but by polling in a loop until it returns != "WAIT". still won't hang but less efficient
Nice I may look into that for one of my projects at some point
Seems a nice system
This is something you may know actually whatโs the data input/output limit to/from a dll using callExtension
input no limit *Except the maximum string limit which is 9mb I think?, its written on the String wiki page)
output limit for callExtension command I think is 16k, is written on callExtension wiki page.
ExtensionCallback, I think about 3gb, but it won't like that much
I think youโve got bigger problems if you are transferring 3GB of data ye
Thanks
Dam after reading the wiki again Iโve considered redoing the dll Iโve made to support callbacks thanks for this
i need to write an extension for my capital ships project but fuck that
pain in the balls for arma normally
unless youre patient enough for c++
I did mine is C++ ye
Capital ships project mind explaining a bit curious is all
i need 2.18 for the mod
angular velocity stuffs
and because no geo lods on a lot of modded capital ships/large objects have to be in parts and attached so lose collisions it means i have to make a new physics engine
sqf is too slow for that but its a later down the line thing
just need angular velocity commands out first
the nuget packages for dll export for c# are 50/50
and for .net core stuff it has to be AOT compiled
So is the idea to have ships move around and be able to collide with and be walked around in or what exactly is your end goal with the ships
Okay thatโs cool I thought of the theory but ye never really tried it yet
collisions is just a nice thing to have
would require effectively remaking a geo lod in 3den for the coords tho 
How do you handle desync of players?
i think i have a few clips i can dm you later
Doesn't .NET core support C++ /CLI?
teleport them to an interior that isnt moving
Ahh a mimic nice okay
beyond my knowledge level
So you canโt really have them actually be on the ship while itโs moving then without desync correct?
ya only problem is some ships have openings etc they can see out of so theres a clear "desync" there
yeah -- if they even stick to it that is
stuff with geo lods -- i.e base game submarine -- just slides out from under your feet
and no WMO doesnt rectify that
Add a roadway LOD under your feet
Yeah cause I thought about using theory of Walkable Moving Objects but desync is a large concern for that theory
I love this, im using it from now onwards
yeah itd be desynced no matter what you do
easiest way is static interior
means you can also have very complex interiors
ive got clips i just have to dig for them and cant post them here either
And you just move it along โstaggeredโ or just have it in a corner of the map
Yeah makes sense
So ships with windows I assume itโs just an unfortunate result that it wonโt show them moving
i have done picture in picture windows
however
those only really work for small windows
Yeah they must lag if large
for things like entire flight decks or whatever yeah theres no viable solution afaik
not even the lag
its just unconvincing
eventually you're going to wake up in the morning and realise you've basically just made your own entire game engine
pm'd you a clip of picture in picture windows for the bridge of the ship
Thanks
im a physics student so i can get away with using it for my final year project apparently
there is http://killzonekid.com/downloads/
2016 though, gimmie a break
Couldn't find link in the url_fetch and url_fetch v2 posts
Probably havent updated, probably havent updated A LOT OF things 
Nah Lou, outsource it!
Would anyone know how I would prevent fire particles from doing damage to nearby players without doing something wacky like disabling player damage entirely?
When it comes to Vehicle in Vehicle Cargo, is there a way for the first item loaded to be automatically rotated 90 degrees? I am having this issue where the first crate loads straight and then the second crate will rotate 90 degrees which makes a 'T".
I want all the crates the rotate 90 degrees so I could fit three crates.
I am unfamiliar with vehicle cargo commands as I haven't really messed around with them so take this with a grain of salt. Would you not be able to just set the direction of the object before it is loaded into the vehicle using something like setVectorDirAndUp or setDir?
maybe you can detect the fire damage in https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
That is actually a great idea. I imagine I could probably just use the source param to make sure it is only disabled for that specific object too instead of all fires as well. Thank you so much for your help ๐
probably not the right channel, sorry if it isnt, but im looking to see if someone can write me a script to automatically assign zeus placed AI units to a headless client. Im trying to learn SQF but i simply dont have the time and ive been trying to do this for a while.
any tip on how the get a position 200 meters of a unit from its left side?
_unit getPos [200, -90]
actually never mind, that's compass direction.
Use getRelPos instead, otherwise identical.
Yeah, that is the way.
player setpos (player getRelPos [200, 270]);
This is another work around I did to get from the direction from a enemy unit to the caller
private _Place = "Land_HelipadEmpty_F" createVehicle (getposATL _Target);
private _dir = [_Place, _Caller] call BIS_fnc_dirTo;
_Place setDir _dir;
private _pos = _Place getRelPos [200, 270];
deleteVehicle _Place;
That looks substantially more complicated than it needs to be
private _dirToCaller = _target getRelDir _caller;
private _positionBehind = _target getRelPos [200, _dirToCaller + 270];```
by any chance, does configName does not work with the cfgSounds entries?
nvm, i found whats happening
@queen cargo I have to ask, why do you offend people and just have a toxic attitude? Have a civilized conversation ffs.
sqf is serious business bro
Is there anyone out here who uses Intercept Minimal Dev + Arma Debug Engine for debugging? Does breakpoints work for you or only 'halt' command?
Breakpoints require correct path mapping in the VS Code project config
there is a "CargoLoaded" event handler, you can use this to set specific rotations for objects when loaded onto certain vehicles
With the new functions coming in 2.18 for syncing units anim states, is there already a way to sync a vehicle like this?
Mainly interested in turret direction/gun elevation.
I would go with animSourcePhase, but those afaik are not present on vehicles mostly and the naming scheme is not standardized.
is there an hashmap equivalent of objNull?
trying to limit the datatypes for a params command
Thank you
||I feel stupid||
There isn't. I think you'd probably just do it the same as for e.g. an array - provide an empty one. Use createHashmap in place, or create a single empty hashmap early on that you can reference in all your later scripts.
how do you make officer to sit on right direction? ```sqf
[_off,"SIT"] call BIS_fnc_ambientAnim;
_off attachTo [_chair, [0, 0, 0]];
_off setdir (getdir _chair);
Once an object is attached to an object, direction-setting commands become relative to the parent object. So if you do setDir 90, the resulting direction will be 90 degrees to the right relative to where the chair is facing.
Note that for some objects, relative zero is not in line with where you might think the "front" of the object is, because the object is sideways or backwards in its own model space.
ah i see, works now. thx ๐
did _off setdir 180;
createHashMap is the same as objNull ctrlNull and []
It creates a empty value (hashmap, object, control, array)
objNull is just a "empty" object variable.
createHashMap is a "empty" HashMap variable.
I see (not really but let's pretend)
I wasn't sure if there was a difference between referencing a permanently-allocated "empty" and creating a new one every time
objNull is not a permanently-allocated value
every time you call it, a new one is created
That sounds awful
yeah could probably use some tweaking
We recently changed true/false to be permanently-allocated. Could do that with the nulls too
deleteVehicle doesn't work for terrain objects, does it?
Nevermind. Biki description mentiones it.
Hey guys, quick question. Maybe someone does know what function would be responsible for disabling the ACE interaction menu on a vehicle?
It does(nt!), but some of these maps don't have any config class names for the objects so it's a pain to filter by model instead.
Wait, it does? I thought you had to hide them instead.
I have just tried it and none of the objects were deleted.
Oh duh I'm not thinking, yes hiding it. My bad.
https://github.com/acemod/ACE3/blob/master/addons/interact_menu/functions/fnc_removeActionFromObject.sqf
You can remove it with that: And i dont know but if you put this in init of a vehicle it should work.
[this,0,["ACE_MainActions"]] call ace_interact_menu_fnc_removeActionFromObject;
{
private ["_grenadePos","_grenadeObj"];
_grenadeObj = (_this select 0);
waitUntil { (getPosATL _grenadeObj select 2) < 0.1 };
_grenadePos = getPosATL _grenadeObj;
"mrkName" setMarkerPos _grenadePos;
hint str getMarkerPos "mrkName";
};
Can someone help me figure out why "mrkName" is returning [0,0,0]?
I checked _grenadeObj and it does indeed return the correct position, but when I feed that pos to a marker it seems to not stick
Thank you very much for the answer! I just did manage to fix it via this function : [this, this] call ace_common_fnc_claim;
Work's like a charm for me. But i really appreciate the help ๐ซก
Can a Dialog/Display be created using cutRsc?
I have a couple of dialogs that are intended to be shown on screen during an undetermined time since the info on them update constantly but as we know, createDialog and createDisplay partially block inputs. Would using cutRsc be the correct approach? Do cutRsc requires another type of declaration or the same dialog/display can be used with that command?

