#arma3_scripting
1 messages Β· Page 76 of 1
I can appreciate the clever approach with using hashmap as an object with ctor, dctor and methods (even ToString is present). It just seems like you want to invent OOP inside of scripting language for some reason that I am trying to comprehend. Okay, if there were requests for that and you think it should be done - we'll see how good it will prove its own right to exist. I will definitely try it out when it'll go live on prod... just need to think of a proper scenario 
I think it just needs to complete.
Ive never had to return anything
You'd have to ask the people that tried to implement OOP over the last decades, about why they want it
But I did already, ain't I? 
Oh yeah, and thank you for answering.
Weird stuff: If statment is just a simple code - it works fine. If inside of a statement I call '[] spawn {}' it breaks the pilot behaviour
Try _nul = [] spawn {}
Mayhaps handle does things to it?
Or do you do some wierd stuff to pilot inside that script?
Not to pilot, to group it carries.
Something here breaks the pilot logic, I just need to find what exactly
The only thing that has anything to do with vic moveOut and unassign
And leaveVehicle
Also whats the waypoint type? Move?
Yes
What if you tried using scripted waypoint? Or maybe try returning true
Only if you change its text color
Yeah, it's 'moveOut'. Also weird flex: without 'moveOut' this forces the heli to land and let em' disembark. I think the issue is somewhere around this. Guess I'll have to rework it somehow, maybe erase previous waypoints and create a new one.
Perhaps try action eject
Also leaveVehicle also unassigns it
So mayhaps ```_x action ["eject", _vic];
unassignVehicle _x
so im running into an issue with ui (i havent used ui code in a while and can't remember too much about it) for some reason im running into the issue of no ; found at ```sqf
_RscButton_1601 = (call _display) ctrlCreate ["RscButton", 1601];
_display is defined as
```sqf
_display = (findDisplay 46) createDisplay 'RscDisplayEmpty';
full script
https://pastebin.com/uFQmk4nG
full code for button with issue
_RscButton_1601 = (call _display) ctrlCreate ["RscButton", 1601];
_RscButton_1601 ctrlSetText "Play song";
_RscButton_1601 ctrlSetPosition [0.5 * safezoneW + safezoneX, 0.612 * safezoneH + safezoneY, 0.137921 * safezoneW, 0.098 * safezoneH];
_RscButton_1601 ctrlCommit 0;
_RscButton_1601 ctrlAddEventHandler["ButtonClick",{
params ["_control"];
_display = ctrlParent _control;
_listBox = _display displayCtrl 1500;
_index = lbCurSel _listBox;
vehicle player vehicleChat ['Song is: %1',_listBox lbText _index];
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 can't call a display
ah ok so what would be the correct way to go about adding a button or other gui element to the screen?
Remove the call 
changed it to ```sqf
_RscButton_1601 = _display ctrlCreate ["RscButton", 1601];
weirdly
Tried everything, including 'setPosASL', 'disableAI', 'forgetTarget', you name it
It really seems like secondary group in the heli somehow is connected to pilots and when pilots loose their passengers they loose their sheit along with it, completely forgetting their duties. They just hover there doing nothing. I can only imagine they enjoy the view of parachutes deploying. Maybe just being worried for their comrades to land safely.
did a little more debugging it seems that changing it to ```sqf
_RscButton_1601 = _display ctrlCreate ["RscButton", 1601];
Umm. There are modules in ZeusEnhanced that do paradrops, or was it ACE? Perhaps check how they do it on their github, no point in reinventing the wheel, or rather paradrop.
When i did it for my mission, granted it was players not ai, and it was plane not heli, i used eject action.
All right, Thank you.
Did you fix all the (call _display) expressions or just the one for _RscButton_1601?
all of them
which confuses me
shame it only tells me missing ; and no more details
cant see anything wrong with syntax
Line 23, missing ;
you may have add waitUntil display is avaible
0 spawn {
_display = (findDisplay 46) createDisplay 'RscDisplayEmpty';
waitUntil {!isNull _display};
//rest of your code
};
thank's ill try that in a bit
I have the half-power grenade throwing mostly figured out. Just have to bind it to a hotkey now (eg. shift-g). Or perhaps several hotkeys for various power throws. Code is simple, thanks to suggestion by @hallow mortar :
player addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
if (_weapon == "Throw") then
{
_vel = velocity _projectile;
_dir = direction _projectile;
_factor = 0.5;
_projectile setVelocity [
(_vel select 0) * _factor,
(_vel select 1) * _factor,
(_vel select 2) * _factor
];
player removeEventHandler [_thisEvent, _thisEventHandler];
};
}];
[player, currentThrowable player select 1] call BIS_fnc_fire;
Any comments on that?
Quite happy with this as it is compatible with all grenades and is a very simple way of throwing more controlled. While not totally going full ACE-style with trajectories, priming, etc.
(Obviously needs some further checking if player has a throwable and can actually throw).
Bloody hell. For whoever will search for this problem as I did (pilots ignoring following waypoints on cargo units paradrop) - only the following kostyl worked:
//Fix pilots stucking in one place
_group leaveVehicle _vehicle;
{
_x disableCollisionWith _vehicle;
_x moveOut _vehicle;
//_x enableSimulationGlobal false;
//_x hideObjectGlobal true;//Not necessary
} forEach (units _group);
_group addVehicle _vehicle;
{
_x moveInAny _vehicle;
//_x enableSimulationGlobal true;
//_x hideObjectGlobal false;//Not necessary
} forEach (units _group);
How might I call something only when an object is added/removed from a curator's editable objects?
Checked event handlers?
Yea, pretty sure I'd need to make something myself...
Not called when editable object is added. Ie, right click and click add editable objects
hmmm
why does my scripts in the triggers not work when in MP should I tick the server only box?
could be locality issue, some commands only work on server and some on clients
what fix can i do to resolve that?
check your commands from the wiki
What kind of server are u using? Hosting via Arma 3 or dedicated server? Some commands work on local host but not on dedicated, others are singleplayer only. Check the wiki:D
We're using arma hosts
so uh- looks like the thing I want might be doable by replacing with simple objects
If anyone is interested - i'm making some kind of online config browser which you can try :)
http://arma3.ru/cfgbrowser/155.133137/CfgWeapons_index.html
Currently I'm tweaking some config parse methods. When it will be done - more addons will be added.
its this tho if youd mind taking a look
call{((nearestobjects [d1,["Land_Cargo_House_V1_F"], 8]) select 0) setVariable ['bis_disabled_Door_1',0,true];}
Tried it on dedi but nothing worked. Local host works fine. But setting up tanks in a formation moving forward is a pain..no way around UnitCapture?
BTW does anyone knows, where can I get DLC resources such as Marksman DLC's weapons pictures?
Erm, you mean something like this: https://community.bistudio.com/wiki/Arma_3_CfgVehicles_EMPTY
?
either working with the ai but to my knowledge that is the best method
what is it supposed to be doing
Yes, but it will support mods like RHS, ACE, RDS and others, including various versions of ARMA
Also there is no full config classes and parameters list in BIS wiki
Ok, so i made my own simple replace With Simple Object function, b/c why not. However... I put 2 compositions down of a cave.
What do you mean with "full config classes"?
[_oldObj,_copyMatTex] spawn {
params["_oObj","_copyMatTex"];
private _position = getPosWorld _oObj; // Testing something
private _sObj = createSimpleObject [(typeOf _oObj), [0,0,0]]; // createSimple Object
ratchet_replacedSimpleObjects pushBack _sObj; // Peace of mind
_sObj setPosASL (getPosASL _oObj);// Set Pos
_sObj setVectorDirAndUp [vectorDir _oObj, vectorUp _oObj]; // Set Directions
if(_copyMatTex)then{
{
_sObj setObjectMaterialGlobal [_forEachIndex,_x];
}forEach getObjectMaterials _oObj;
{
_sObj setObjectTextureGlobal [_forEachIndex,_x];
}forEach getObjectTextures _oObj;
};
deleteVehicle _oObj; // Remove old
};
From what i see, find nearest house from d1. And lock door 1
Idk if it works tho
ah, kk
I've needed this since Six Config Browser died. Nice work.
Sometimes it helps to ask, makes you find solution yourself faster π
You can get rid of _dir because you're not using that. And you can simplify ...
_projectile setVelocity [
(_vel select 0) * _factor,
(_vel select 1) * _factor,
(_vel select 2) * _factor
];
```... to `_projectile setVelocity (_vel vectorMultiply _factor)` π
Cheers!
It is not fully done yet but I plan to finish this in a week.
Thats is a nice config viewer, Blender.
Like a million times faster than the shitty one in game or the one six had.
Also, holy shit the one on the BI wiki
Thanks for letting me know that all these buildings are side civilian and faction default
Making proper hotkeys is kind of awkward unless you're making a mod. If you're making a mod, https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding
Here's a suggestion: have your event handler on permanently. Modify it so that _factor is acquired from a variable saved on the player. Have an action (or keybinding if you are a mod) that changes that variable.
e.g.
// NOT full code
// action
player addAction ["Set grenade mode: short",{_caller setVariable ["Magiel_var_grenadeFactor",0.5]}];
player addAction ["Set grenade mode: default",{_caller setVariable ["Magiel_var_grenadeFactor",-1]}];
// EH
private _factor = _unit getVariable ["Magiel_var_grenadeFactor",-1];
if (_factor == -1) exitWith {};
// rest of code```
Thanks for the thoughts @hallow mortar but I indeed want to create a mod that provides (CBA) keybinds. I'm not a fan of the player having to set a grenade mode, especially via the action menu. It tends to be hard to do in combat π
The script is almost done now, thanks for the suggestions! I'll add some keybinds soon and fine-tune the slow factors for actual combat usage π
params ["_slow_factor"];
player setVariable ["magiel_throw_slow_factor", _slow_factor];
_throwable = currentThrowable player;
if (count _throwable == 3) then
{
_event_handler = player getVariable ["magiel_throw_slow_event_handler", -1];
if (_event_handler >= 0) then
{
player removeEventHandler ["Fired", _event_handler];
};
_event_handler = player addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
if (_weapon == "Throw") then
{
_fire_time = player getVariable ["magiel_throw_slow_fire_time", 0];
if (time - _fire_time < 3) then {
_slow_factor = player getVariable "magiel_throw_slow_factor";
_slow_factor = 0.0 max _slow_factor;
_slow_factor = 1.0 min _slow_factor;
_vel = velocity _projectile;
_projectile setVelocity (_vel vectorMultiply _slow_factor);
};
player removeEventHandler [_thisEvent, _thisEventHandler];
};
}];
player setVariable ["magiel_throw_slow_event_handler", _event_handler];
_muzzle = (_throwable select 1);
player forceWeaponFire [_muzzle, _muzzle];
player setVariable ["magiel_throw_slow_fire_time", time];
};
how can I wrap multiple controls into a single one in config file?
currently I have the following classes:
class WTK_RecordButtonPath: RscButton {};
class WTK_TextBoxPath: RscEdit {};
class WTK_NoticeLabelPath: RscStructuredText {};
class WTK_Checkbox: RscCheckbox {};
can I put all of them in just one to avoid individually creating all the controls in my script
seems to be it, i'll check it out
use FiredMan EH not Fired
is it possible to "override" a mods function via script in a mission file?
Hello, does anyone have a more adjustable command/script I could use to set a smoke trail behind a flying (crash-landing) plane?
call {
{
private _smoke = "#particlesource" createVehicleLocal [0,0,0];
_smoke setParticleClass "ObjectDestructionSmoke1_2Smallx";
_smoke attachTo [Lifeboat, [0,0.5,1]];
} remoteExec ["call", 0, true];
};```
it works but I would like to adjust the smoke's effect which seems very limited
Im looking it up on google but a lot of the results I get are mixed to say the least, often about specific outcomes
hmm, I was thinking of attaching the smoke module to the plane, but no luck
Have you looked these
https://community.bistudio.com/wiki/Particles_Tutorial#Burning_Vehicle_Fire_Look-Alike
uhhh
hmm
why did it start doing that
too little Y?
it's supposed to look like that
when i position it at the top of the screen it completely disappears
(it wasn't doing that when it was not in a controlgroup)
so there's no point to look into the positioning
it simply cuts away the closer it gets to the top of the screen
And you need remoteexec your say3d , if you are doing on MP.
Did you get work your jukebox?
Thanks, but why? Difference is to shooting from vehicles, right? Can you throw stuff from vehicles too?
uhh is it the background big enough if you are using one?
Oh, people are still on here. Hey all!
make the controls group large enough to contain the child controls. the child control coordinates are different inside the CG and start from zero x,y
how do i make the controls group cover the whole screen?
instead of just the safezone or whatever
w = 1;
h = 1;
x = safeZoneX;
y = safeZoneY;
w = safeZoneW;
h = safeZoneH;
i'm using the GUI_grid
well both work
cant seem to get it to work
because you provide [] 0 elements - read the command's wiki page
alright
this still doesn't take up all the space
switching to a control frame is pretty annoying
i wish i knew those existed before i started working on the gui
yes, why not
to be fair it wouldn't be the first time there's been a "not" for no conceivable "why" in Arma
well you can throw stuff from FFV seats. that's the why π
controls group children coords are relative to their parents
and your ctrl group must be large enough to be able to show its children
if not they get cropped
depends what kind of function. most mods make their functions final so no
it does
you're doing something wrong
or you're using multiple monitors
// fn_init.sqf
diag_log "Initializing SAR mission...";
#include "client\SAR\fn_onPlayerRespawn.sqf"
#include "client\fnc\fn_setRespawnPosition.sqf"
// Call the SRG_fnc_setRespawnPosition function to set the respawn position to the SAR operations point marker
["SAR_opPoint_marker", false] call SRG_fnc_setRespawnPosition;
respawnOnStart = 0;
// Find all SAR Medics within 1 meters of the SAR_opPoint_marker marker
_sar_medics = nearestObjects [getMarkerPos "SAR_opPoint_marker", ["CAManBase"], 1];
_sar_medics = _sar_medics select {_x getVariable ["roleDescription", ""] == "SAR Medic"};
// Find all SAR Pilots within 1 meter of the SAR_opPoint_marker marker
_sar_pilots = nearestObjects [getMarkerPos "SAR_opPoint_marker", ["CAManBase"], 1];
_sar_pilots = _sar_pilots select {_x getVariable ["roleDescription", ""] == "SAR Pilot"};
// Find all SAR Copilots within 1 meters of the SAR_opPoint_marker marker
_sar_copilots = nearestObjects [getMarkerPos "SAR_opPoint_marker", ["CAManBase"], 1];
_sar_copilots = _sar_copilots select {_x getVariable ["roleDescription", ""] == "SAR Copilot"};
``` im trying to get a role specific spawn point setup for area of my unit. Ive ran into no errors but it isnt doing what im looking for it to do. would i need to #include this file into my acutal init.sqf for it to work?
okay, anyone got any other suggestions for how to set smoke and/or fire particles attached to an object that moves via rich curve?
Last thing I tried it just vanished when set to the vehicle in questions. Making me think it wants to be static
well how come that it's cropped if the controlgroup takes up all the space?
how do i position a control group at the top-middle of the screen
this is confusing me
im not entirely sure, but from look at his source code he might not compile final? atleast I dont see any of that but I dont know 100% what to look for. Mind Checking?
https://github.com/FreestyleBuild/freestylesNuclearBlast
his init just spawns his functions defined in cfgFunctions
hmm. I wonder what takes precedence if you have the same function defined in both base and mission CfgFunctions.
would it not just throw an error about an existing function being defined twice?
I honestly doubt it :P
hmm, I just want to override his damage function a bit cause I dont think it would take a few minutes to die when a nuke explodes in your face
and I wanna make vehicles get some instant velocity in the opposite direction
That is relative to distance and terrain in real world though, you don't die instantly because of the radioactivity, heat and shockwaves unless you are at ground zero, since these are kinetic waves and they travel much more slower than light but faster than sound, however they lose speed exponentially.
A 1MTon equivalent bomb at 6km from the ground zero would have wind speeds to up to 260km/h, so it would in fact take 1 minute and 20seconds or so to feel the wind pressure at that distance.
Offtopic, I know, but the lower the yield of the explosive the longer the waves and wind pressure takes to reach point B from point A. Its not an incorrect effect but perhaps exaggerated according to the script creator.
Visible light is a tiny part of the electromagnetic spectrum, and it all travels at the speed of light. There's plenty of other radiation (mostly thermal but a lot of xray & gamma) in a nuclear blast to kill instantly at close distances.
1MT at 6km is probably instant 3rd degree burns at best.
Thanks for the lead! I found a better suited one in the end "UnregisteredFromWorld3DEN"
100kt bomb, explodes ON the player, takes a minute or two to die. IMO should be instant
Sorry didnt mean to ping
Never knew this π With FiredMan this works fine, indeed. "Controlled Throwing" mod is coming up. User can configure hotkeys to throw at 10% - 100% (10% increments) range throws. I find that 60% is a good medium throw, 40% is an over-the-fence-style-throw, 20% an around the corner drop and/or suicide π
are the ctrlGroup elements positioned relative to the ctrl gorup?
you are correct, at 1MT the heatwaves travel up to 12km with 8km being the distance in which the heat start to ceil and exponentially decrease temperatures of the wave, at that distance you will receive 3rd degree burn and beyond 12km first degree burns. There is this popular video of the early nuclear test were you can see paint and non metallic based materials being basically vaporized when the weather is clear and heat can propagate efficiently through air molecules.
yeah, pretty much seems like creative liberty has been taken :p
yeah looking at his script he's only damaging the chest slightly with thermal burns iirc every few minutes. Should be an easy change, ill just apply it to the entire body with more intensity, probably also check distance and apply an instant death. This is using ACE medical btw
How does Killed EH work? When entity is killed does it fire on killers side, killed entity side?
server usually, local to the unit, on the player pc if the unit is a player
how would i make it so the y starts at 0 at the top and ends at 1 at the end of the ctrlgroup
and so that x starts at 0 (left of ctrlgroup) and ends at 1 (right of ctrlgroup)
i'd like to position my ctrlgroup at the top middle, how do i do that
entity was on dedicated server, i killed it via zeus kill button so remote
killed = "if (local (_this select 0)) then {[_this select 0] remoteExec ['MST_FNC_monster_delete', 0];};";
This did not trigger
No throwing animation though with forceWeaponFire from a vehicle position, that's too bad. Perhaps bis_fnc_fire?
x = safeZoneX + safeZoneW / 2 (which is always 0.5)
y = 0
ofc if you want it to be centered, you must subtract half the width of the ctrlGorup from x too
then how do you expect it to work?!
did the zeus spawn the enemy?
If so the monster is local to the zeus, if not that why you are not triggering.
you might want to use MPKilled instead for remote kill detection, its cleaner, only once declared and everyone can access it
no. it was local to server.
well, then thats why, it will never be local to the zeus
Nope, no animations. Too bad.
you must use gestures
idk what anim you're talking about tho
the game already does have throwing gesture
It does if you are not in a vehicle
you can throw stuff from vehicles just fine
you're probably using the anim
not the gesture
I know, with the normal throwing hotkey. But with forceWeaponFire the grenade just pops out without a throw animation. On foot the throw animnation works fine with forceWeaponFire.
cause its using animation and not gesture
you probs wanna check if player is in vehicle, then forceWeaponFire and do the gesture
did you try using fire?
and also why even use those? just use the vanilla throwing
"fire" doesn't throw grenades at all, not even on foot.
action "throw" perhaps
Because my mod applies a reduced speed throw if you use a custom hotkey
Ah, wasn't aware that existed, assumed I had to use fire some muzzle.
it indeed does not exist
UseWeapon comes close but not sure
because i wanted to position the control group at the top middle first, before tweaking all the sizes and positions i have in my gui
UseMagazine?
nah, you need some id etc
well what I said will position the ctrl group at the top middle
but you won't see it at the top middle unless you fix the child ctrl positions
yes i did see, one moment
encountered yet another issue
valign is broken?
afaik yes
aeugh
I'll play a gesture or animation if the player is in vehicle
It's very flaky... forceWeaponFire works once or twice from within a vehicle, then it stops. Also if you switch grenade types. Normal throwing works fine.
so
that's the code i have right now
class WTK_Main: RscControlsGroup
{
x = 0.5;
y = 0;
w = 0.5;
h = 0.5;
class controls
{
class test: RscStructuredText {
style = "0x00";
colorText[] = {1,1,1,1};
class Attributes
{
font = "RobotoCondensed";
color = "#ffffff";
colorLink = "#D09B43";
align = "center";
shadow = 1;
};
text = "test string";
x = 0;
y = 0;
w = 1;
h = 0.1;
shadow = 2;
}
};
};
why does it create a scrollbar if the coordinates are relative?
w: 1 should fill the entire container right
also the ctrlgroup is seemingly not aligned and y = 0 isn't exactly at the top of the screen
see the issue^
Its all french to me...
im dong a tvt at night and want to limit the usage of the gamma as expoit
any ideas on how i can "read" and modify this value?
okay, I have now tinkerd more with this
Is there any way of making it follow an object in rich curve?
like bezier?
Is BIS_fnc_ModuleRemoteControl_owner deprecated or something?
You can get it with getVideoOptions. You can't set it; acceptable values would depend on the player's hardware configuration and eyesight anyway.
You can use tricks like setApertureNew and local lightpoints to help make nighttime more comfortable for people regardless of gamma.
Useless!
People can just use Nvidia Control panel or the equivalent from AMD and change their settings there.
1.2 or 1.3 can be because your sceen, but 2.3 is a explot so... at least try to handle that
damn
quick way, but minus the rich curve, you can just attachTo
or rather just attach it in particle array
There is no way in arma to stop gamma cheesing as far i can tell, i tried hours even had working filter only to realise it's not working windowed mode π
you wot?
Well, the game can't prevent that even if it did let you set the game gamma. There is literally no way BI could stop that from happening. Messing with people's graphics drivers would be.....rude.
DayZ standalone has a decent solution, if i remember right even changing the GPU control pannel settings didn't help.
just detect it, and show a hint asking you to lower the value
put a very dark rscTitle over their screen if they "cheat"
AntiGammaHack = ppEffectCreate ["ColorCorrections", 1500];
AntiGammaHack ppEffectEnable true;
AntiGammaHack ppEffectAdjust [1, 1, -0.04, [0, 0, 0, 0], [1, 1, 0, 0.85], [0.299, 0.587, 0.114, 0]];
AntiGammaHack ppEffectCommit 0;
//disable again
ppEffectDestroy AntiGammaHack
what do you mean by this?
how do you create your particle with drop or "#particlesource" createVehicleLocal?
no
w and h behave the same way as non-ctrl-group ctrls
I said the coordinates are relative not sizes
private _posATL = Lifeboat modelToWorld [0,10,0];
private _ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 7, 16, 1], "", "Billboard",
1, 8, [0, 0, 0], [0, 0, 4.5], 0, 10, 7.9, 0.5, [4, 12, 20],
[[0.2, 0.2, 0.2, 0], [0.2, 0.2, 0.2, 0.3], [0.2, 0.2, 0.2, 0.3], [0.35, 0.35, 0.35, 0.2], [0.5, 0.5, 0.5, 0]],
[0.25], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [0.4, 0.4, 0], [0.4, 0.4, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0];
_ps1 setDropInterval 0.2;
private _ps2 = "#particlesource" createVehicleLocal _posATL;
_ps2 setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 9, 16, 0], "", "Billboard",
1, 8, [0, 0, 0], [0, 0, 4.5], 0, 10, 7.9, 0.5, [4, 12, 20],
[[0.33, 0.33, 0.33, 0], [0.33, 0.33, 0.33, 0.8], [0.33, 0.33, 0.33, 0.8], [0.66, 0.66, 0.66, 0.4], [1, 1, 1, 0]],
[0.25], 1, 0, "", "", _ps2];
_ps2 setParticleRandom [0, [0.4, 0.4, 0], [0.4, 0.4, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0];
_ps2 setDropInterval 0.2;```
u see _ps1 and _ps2 in that array?
uhhh yeah?
thats the object particles are attached to
you may have to use drop for different vehicle than particlesource but try just changing those for now
iirc your ctrl must be multiline, otherwise it gets vertically placed at center
and the reason x is not centered is because of what I said earlier. if you want it to get centered, subtract w/2 from x
or you can attach whole shebang to a vehicle, like _ps1 attachTo [veh, [0,0,0]];
alright I may try that
omg...
works perfectly
I spent hours on this
and this solution just fixed it
I dont suppose anyone knows why this would print "-" still? The target is valid as I take over the unit fine
that var is only defined if you use the remoteControl module
which you're not
ah
Do you happen to know of any way to detect if/who is remote controlling a unit?
mentioned on wiki
Im not realy fussed who I just need to know if it is being controlled
Yeah I tried the wiki suggested solution but I was getting a null return with their messy one
I assume its this you're referring to
yes
ill mess about with it some more but it didn't seem to be working for me, thanks in the meantime
Yup
Well not much to be seen. Small gray square. You can get in via script. You cant drive it tho. So car part is a dirty lie
And paper too for that matter
well that doesn't matter anyway
I just wondered if it exists at all
or if it was for old Armas
meh, when i first found it i imagined a 2d paper car cutout, but was bitterly dissapointed.
Also on remote controlling note. Is there a way to completely disable remote control in zeus or using unit as player in editor
you can remove the remote control module from Zeus
and remove editor control as well :D?
you can detect it via EH and undo it 
lets just go with no then...
So with the following code im still just getting back "<NULL-object>"
I cant see if its a bad implementation on my end or not
maybe the dirty hack doesnt work no more...
Things cant just be easy can they
x and y are relative, w and h are not. Your w of 1 is larger than the control group's 0.5.
Last time I checked that dirty hack worked
Ticket relating to lack of the command https://feedback.bistudio.com/T171207
This is more generic program question and am asking because I only have experience with SQF (and a bit of Lua and python)
:
What exactly is OOP and how SQF isn't? Pros/cons? What makes me to use OOP solution on SQF?
Hey, for scripting a music trigger to play on everyone's machines simultaneously, is this correct?
["Music_Russian_Theme","playmusic",true,false] call BIS_fnc_MP;```
or should this be rewritten for ExecVM or similar?
I'd use personally
["Music_Russian_Theme"] remoteExec ["playMusic", 0];
You can read up further here https://community.bistudio.com/wiki/remoteExec
Okay, thanks.
BIS_fnc_MP is a legacy way to synchronize a script - remoteExec/Call is more advanced and reliable
OOP is short "Object-Oriented Programming", it's a way of writing a program that heavily relies on classes.
Say you were building a program that lets people log in to some website.
Instead of a user's account just being some text file, perhaps like a json, there is an UserAccount class instead.
You did mention experience with Python, which often does use OOP style programming, so I'll give some (very basic) examples. I'm not sure how familiar you are with it though so it may or may not be helpful.
Here's a mock-up of that login program:
The first version is made with an Object-Oriented process in mind, where a user's account information is stored within an object
class UserAccount:
def __init__(username: str, password: str):
# This would be for when someone is making a new account
self.username = username
self.password = password
def change_username(new_username: str):
self.username = new_username
...
# Etc. etc.
# Create new user
new_user = UserAccount("DartRuffian", "Password123")
Where a non-Object-Oriented programming approach would instead just treat each account like that data that it is.
Instead of a UserAccount class that stores all of the information, it might instead just be a dictionary with "username" and "password" as keys that you can grab.
new_user = {}
new_user.update({"username": "DartRuffian", "password": "Password123"})
I don't exactly know what you mean by this though
"What makes me to use OOP solution on SQF?"
Regarded to your Q, AFAIK an OOP solution on SQF has been introduced recently
There are pros and cons to each, OOP can sometimes start to fall apart once the scale of a project reaches a certain point and also may use more memory due the larger amount of objects that need to be kept track of.
Oh that sounds interesting, I can see that would be useful for a lot larger and "heavier" mods
I just want my increment and decrement operators
I'm waiting to use the best form of incrementing
i-=-1
Perfectly balanced, as all things should be
I have no idea what that is and I am scared
Ohh It just looks hella cursed
I saw it in like a single post a couple years ago
Yep
Just for the purpose of making it symmetrical lol
I do have an actual scripting question though:
Is there a way to easily get what addon a given object is from via scripting?
This gives me the PBO it's from, you can just change the CfgVehicles to what you need
configSourceAddonList (configFile >> "CfgVehicles" >> typeOf cursorObject)
Tested it on one of my own units and it gave me the PBO name as a Array of Strings ["FF_Units"] in my case
Been dealing with this lately and a word of warning, if you need it to check for DLC restrictions, you can't because it might return DLC addons for non-DLC vehicles.
getAssetDLCInfo is the way to reliably check DLC restrictions
Gotcha, I'm currently trying to find an object that may be causing an issue within the mission
More specifically, one mod that my unit has in it's modlist has a nasty habit of modifying some of the base assets that it uses
On another note, is there a way to write output to a file? Not really something I had ever checked
Only to RPT with diag_log, otherwise you need extension
Eh, that'll work
Sorry, Just a small addition if anyone needed it
_pboName = (configSourceAddonList (configFile >> "CfgVehicles" >> typeOf cursorObject));
getText (configFile >> "CfgPatches" >> (_pboName select 0) >> "name");
Using this game me the Name field inside the CfgPatches again in my case it returned "Fluffy's Units"
Sorry for late, so an no-OOP language is "hey Mr POLPOX you have the database, you will be anything I want" while OOP is "hey Mr POLPOX.classX you are only A not anything else" which means I can store A, B, C into classX, Y, Z of me?
Essentially yeah
OOP tends to fall apart after initially created and needed to make a tweak to a parent class, causing everything that inherits from that class to also need to be changed
I think I get the idea, cheers!
DayZ uses film grain afaik. At normal lighting it's barely noticable. But against dark background it's very fuzzy when upping gamma
@native hemlock Thanks for the input - yeah, i generally only use publicvariableclient from the server anyhow, as it's easier to just remoteExec send something to another client instead of asking the server for the clients id and then sending it.
Adding the ownerid to the client via setVariable would work, but you're right, is it worth the getvariable ect
Prob not
....Why is this not giving me a proper returned message??
while {_time > 0} do {
_tformat = [_time, "MM:SS"] call BIS_fnc_timeToString;
hintSilent format["Jamming Time Left: %1", _tformat];
_time = _time - 1;
sleep 1;};```
Is _time initialized anywhere?
"MM:SS" isn't a valid choice I don't think
_time = 120;
while {_time > 0} do {
_jamLeft = format ["%1:%2", floor (_time/60), _time%60];
hintSilent format ["Jamming Time Left: %1", _jamLeft];
_time = _time - 1;
sleep 1;
};
hintSilent "Time Out!";
try this for size
Probs want them leading zeros so it wont 0:5 on him
especially when timeToString expects daytime in hours-as-float format (i.e. 16.5 for 16:30), if i believe the doc
BIS_fnc_secondToString ties it up Nicely
_time = 90;
while {_time > 0} do {
_jamLeft = [_time, "MM:SS"] call BIS_fnc_secondsToString;
hintSilent format ["Jamming Time Left: %1", _jamLeft];
_time = _time - 1;
sleep 1;
};
hintSilent "Time Out!";
yes
the full method as it was was ```sqf
params ["_time","_objArray","_speaker"];
_time = _this select 0;
_objArray = _this select 1;
_speaker = _this select 2;
private _tformat = 0;
while {_time > 0} do {
_tformat = [_time, "MM:SS"] call BIS_fnc_timeToString;
hintSilent format["Jamming Time Left: %1", _tformat];
_time = _time - 1;
sleep 1;
};
hintSilent "Jamming Time Left: 00:00";```
and then some other stuff below
the Other Stuff is verified to work dine
lemme try SecondsToString
yeah ok secondstostring is perfect
working 100%
Also u can do while {_time>-1}
And skip last line
...is that allowed???
Why not xD?
Yeah it will give you that last Hint without needing to have that line there
I feel like that's somehow illegal, not in a way that the system won't accept, but in the way like I'm going to get arrested for practicing black magic
(I'm doing it)
Oi oi, you'ave a loicense to compare to negative numbah mate?
Yeah yeah c'mere it's right next to my butterknife license, come closer
*arrests Ashudene for practicing SQF magic without a license*
Simple difference of OOP vs functional
functional
_data call My_fnc_ObjectA_DoOneThing
_data call My_fnc_ObjectA_DoSecondThing
_data call My_fnc_ObjectA_DoThirdThing
organizing your functions will get quite messy over time. And if you then make the mistake of
_data call My_fnc_ObjectB_DoSecondThing
calling a function that should take a datablock of format "ObjectB" but pass it a datablock of format "ObjectA" then.. poof.
OOP would be
_data call ["DoOneThing"]
You no longer need to specify which function you want to call, as the data itself now stores its own functions and knows what type it is.
ofc in functional you can also write
My_fnc_DoOneThing = {
if (_this.type == "ObjectA") then {_this call My_fnc_ObjectA_DoOneThing};
if (_this.type == "ObjectB") then {_this call My_fnc_ObjectB_DoOneThing};
} ``` That is one of the ways that previously people tried to create "OOP" inside SQF. it works, but its more effort to write (which ends up with many OOP projects giving you macro hell) and less efficient to execute.
But yeah in sqf it aint an issue.
Somewhere where you could define _time as unsigned and then accidentaly compare it to negative value, you could create infinite loop.
Also cpus/mcus like to compare to zero. Makes for less cycles
None of these matter for sqf anyhow
You'll never take me alive 
Cheeky bugger
exactly
"Taser, taser, taser!" 3 shots in the back
How'd I display a picture (.paa / .png) in the RscDisplayEmpty? Example /samplepictures/somepicture.jpg
testobj = createVehicle ["UserTexture_1x2_F", player modelToWorld [-1.1, 2.5, 1.1], [], 0, "CAN_COLLIDE"];
testobj setDir (player getDir testobj);
testobj enableSimulation false;
testobjtexture = "obj" + (diag_frameno toFixed 0);
testobj setObjectTexture [0, format["#(rgb,1024,2048,1)ui('RscDisplayEmpty','%1')", testobjtexture]];```
Get the display, ctrlCreate a RscPicture, ctrlSetText your image in it
Can you even display .png? Think ot has to be paa or jpg
Corrected - but the idea is the same.
testobj = createVehicle ["UserTexture_1x2_F", player modelToWorld [-1.1, 2.5, 1.1], [], 0, "CAN_COLLIDE"];
testobj setDir (player getDir testobj);
testobj enableSimulation false;
testdisplay = findDisplay 46 ctrlCreate ["RscPicture", -1];
testdisplay ctrlSetText "/somewhere/something.jpg";``` so something like this
wait, wait, wait.
what is your original goal - display a texture on a UserTexture object?
oh yea im dumbfounded as well
The man just wants to display a picture
display a picture on testobj instead of the map
Double click on it to open it 
Seriously though, you need to use ui2texture display
β¦setObjectTexture is enough
if you just want to display a picture (on a texture object), you don't need UI at all
If you want your picture inside ui2texture, you need to wait until your display is initialized (it can take some time or never if you never look at the texture for it to appear), then create a control there
testobjtexture spawn {
waitUntil {!isNull findDisplay _this};
private _display = findDisplay _this;
private _picture = _display ctrlCreate ["RscPicture", -1];
_picture ctrlSetText "/somewhere/something.jpg";
};
Probably also want ctrlSetPosition and ctrlCommit to place your picture where you want it
I'm trying to achieve something like this along with map texture https://twitter.com/dedmenmiller/status/1644014181044088833/video/1
so if I sum it up properly, your goal is:
"I want to display the map on multiple floating textures"
?
(My snippet should be after this code btw)
I got the map part done - now just the image part im looking it
you know, it helps knowing what you have and what you are trying to achieve in order to help you accurately!
(please use https://sqfbin.com/)
https://sqfbin.com/joyoyoqonizijenubuto
this is the map - works fine. Now I wanted to bring in the effect of the same but in a floating window with just a picture attached. Think of it like a billboard (as seen in Dedmen's video) β @finite bone
didn't know the code was big until i pasted it sorry
I can get the same output in an object texture (floating window ref. in the video) [Entire code copied/referenced from @meager granite 's Feedback ticket.] Now if I want to use the above code to display a map on a billboard while also subsequently displaying an image in the floating window how'd I go on about that
Assign exactly the same texture to another object
If you want it on other objects too
So sqf mapboardtexture = "map" + (diag_frameno toFixed 0); mapboard setObjectTexture [0, format["#(rgb,2048,2048,1)ui('RscDisplayEmpty','%1')", mapboardtexture]]; becomes sqf mapboardtexture = "/something/somewhere.jpg"; mapboard setObjectTexture [0, format["#(rgb,2048,2048,1)ui('RscPicture','%1')", mapboardtexture]];?

mapboardtexture is nothing but a string name to get the display with findDisplay command
If you're updating this code, your displays are in mapdisplay array
OH WAIT
thats it
sorry i was dumb to focus on the wrong area
private _map = _x ctrlCreate ["RscMapControl", -1];
_map ctrlMapSetPosition [0.2, 0.2, 0.6, 0.6];
_map ctrlMapAnimAdd [0, 0.1, mapcenter];
ctrlMapAnimCommit _map;
_x setVariable ["map", _map];``` this is where i should be focusing on right?
so instead of RscMapControl it should be RscPicture with relevant stuff
Yes, _x is a display
Oh yea got it
This should do it? sqf imgobj = createVehicle ["UserTexture_1x2_F", player modelToWorld [-1.1, 2.5, 1.1], [], 0, "CAN_COLLIDE"]; imgobj setDir (player getDir imgobj); imgobj enableSimulation false; imgobjtexture = "obj" + (diag_frameno toFixed 0); private _img = findDisplay imgobjtexture ctrlCreate ["RscPicture", -1]; _img ctrlSetText "/somewhere/something.jpg"; displayUpdate imgobjtexture;
no, you don't get it at all
Instead of randomly pasting code, try to understand what it does line by line
Can diag_frameNo even return float?
no
So why toFixed 0?
because copypaste, i suppose
Ref: https://sqfbin.com/joyoyoqonizijenubuto
From reading your code, you are finding the displays and adding it to yhe globalvariable to be used inside your forEach statement. However, since in my case I only require one display to do my required activity, I replaced the private _map = _x ctrlCreate ["RscMapControl", -1]; with direct statement of finding display and creating control at the RscPicture and then ctrlSetText with the image path.
As for the imgobjtexture = "obj" + (diag_frameno toFixed 0); I do not understand as to why you included this in your original code and wiki does not elaborate on the functionality so I didn't touch it to ensure it works with minimal changes first.
Last part by my guess is just to create unique name.
"obj1345" for example.
Good/Bad/WTF - sqf imgobj = createVehicle ["UserTexture_1x2_F", player modelToWorld [-1.1, 2.5, 1.1], [], 0, "CAN_COLLIDE"]; imgobj setDir (player getDir imgobj); imgobj enableSimulation false; private _img = imgobj ctrlCreate ["RscPicture", -1]; _img ctrlSetText "/somewhere/something.jpg"; displayUpdate _img;
imgobj ctrlCreate = WTF
how do I force an aspect ratio for checkboxes?
i tried giving it the ST_KEEP_ASPECT_RATIO style but it doesn't work
class WTK_ExcludeGroundCheckboxPath: RscCheckbox
{
style = "0x00 + 0x800";
checked = 0;
x = "0.5 - 0.375 / 2 - 0.007";
y = "safeZoneY + 0.0425 * 3.75";
w = "0.025 * safezoneW";
h = "0.04 * safezoneH";
};
Ok what should I do now π’
Don't randomly paste code, learn the language, figure what each line does
that's for images
any workaround?
stretched checkboxes do not look good
i get it now
those are numbers from the wiki example
i just added a * 0.7 to scale it down
well in any case just use GUI_GRID
the wonders of arma gui
https://sqfbin.com/uzewusodebesevowupus should be pretty minimal and commented as far as examples go 
bruv im trying my best here - i know so far what each line did in your previous code but i dont know where im going wrong in getting it to work on what i wanted to achieve... (especially with no wiki on these functions)
From the wiki and earlier conversation I know that ctrlCreate with RscPicture and ctrlSetText will be the key functions to utilize in finishing my task. I took note on how you did it and drew comparisons to this one here.
Its not a stab at you since you have been of tremendous with your code helping in establishing the overall baseline of the vision, its just that im slightly frustrated and loss at direction to proceed with.
Thanks a lot!
why are my macros not being preprocessed?
description.ext
#define GUI_GRID_WAbs (safezoneW / safezoneH) min 1.2
#define GUI_GRID_HAbs GUI_GRID_WAbs / 1.2
#define GUI_GRID_W GUI_GRID_WAbs / 40
#define GUI_GRID_H GUI_GRID_HAbs / 25
#define GUI_GRID_X safezoneX
#define GUI_GRID_Y safezoneY + safezoneH - GUI_GRID_HAbs
do you have other includes that can define same things? If you're checking in 3DEN - have you reopened the mission after changing the description.ext? Are the defines above the place they're used at?
- no any other include or define in the file
- no
- yes
you have to reload the mission?
didn't know
it still doesn't
as you can see:
you have to close the mission then reopen it
i just did
have you wrapped your h in "" yourself?
then how do you expect it to get preprocessed?
i thought macros worked everywhere?
no
they do work in single quotes tho
but you don't need any quotes in config (unless when you want to span multiple lines I guess, or if you have ; in your string thing, or when dealing with arrays)
in any config?
even outside description.ext
yes. the config parser converts what it doesn't recognize to string
" vs ' isn't really common sense. Or intuitive. Or even documented at https://community.bistudio.com/wiki/PreProcessor_Commands
@little raptor perfect, thanks
is the description definition in cfgFunctions actually anywhere used/show or just like an internal description within configs?
CfgFunctions has descriptions?
Is there a way to get parent function call history/"stack"?
when there is error yes
saves the current execution order in the Array _fnc_scriptMap.
https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Debug_Modes
non related, but did you managed to correctly get the kill function to work for your zeus thingy?
Hello folks, I hope this is the right place to ask. Can someone help me with a script to temporarily disable fall damage? My group is using Ace 3, and we are trying to get a jetpack script to work for a special event, but we always take fall damage on landing.
Ye. Removed local check and just remote exec the thing. Then check inside the function if it already ran, so it didnt do twice.
I went with kill in the end cause you can define it in cfg class EventHandlers
yeah, better alternative indeed. You doing a custom monster then?
Brains are mostly done. Just effects are ... lacking. Ill see if i ever finish it.
This will work for cfg functions. But as it seems i have a mod that fires init EH multiple times. So im trying to zero in on it, without needing to restart server/client multiple times cause it only happens on DS.
how can I make a control group not blocking clicks on other buttons?
i have a ctrl grp that is intentionally slightly larger than its content, and i'd like to limit the "clickzone" to its content only
when a ctrlgrp takes up all the screen, all the other buttons on the display become unclickable
so basically i'd like to find a solution to shift the "zindex" of the ctrlgrp to something lower than any other button
I'd assume functions viewer
Diag_dumpCallstack or call trace or smth, check wiki it's there
There is some that returns array of thing
diag_stacktrace but that only goes up to the start of the function
Ah diag_dumpCalltraceToLog is it
But one tiny issue
Only available in Diagnostic branch(es)
And im not aware of linux server diag branch
maybe it needs -debug parameter to fully work, idk
wrapping CT_Edits inside controlgroups are glitching the borders
sometimes they are grey and sometimes white, no idea why
focus color probably
Cant see it there - also not in the scripted part. However BI uses at least for the campaign function also the description parameter
rscedit
nope
it only happens when you wrap it in a ctrlgroup
arma UI in a nutshell ig
can you show pic?
it's subtle but it's annoying
and it sometimes happens on other edges
at different resolutions
oh yeah I think that's "normal" the line drawing isnt very accurate
illusion π€
Well... you could always make your own border, with blackjack and white lines?
its also like two pixels instead of one. must be anti aliasing thing
Nope. Works as described on wiki only up to function start. Even with -debug
not sure what u mean then...
Difficult to describe...
One of mods is causing event handler init and delete defined in cfgVehicles, class EventHandlers to run multiple times on server.
Example
Spawn unit.
EH Init code runs on client
EH Init code runs on server
EH Init code runs on server (again)
Delete unit
EH Delete runs on client
EH Delete runs on server
EH Delete runs on server again
Im trying to finger out the mod causing that.
yeah EHs called from the engine don't have much of an call stack
is there even a way of turning a button/control unclickable?
Yeah. Figured as much. But how does one cause eventHandler to fire, if it aint the script.
disable it
thanks
it conflicted with my text box because i added a fake place holder text when nothing is written in the textbox
i'm bad at explaining stuff but you get the point
Is there any issue adding EHs to projectiles insofar as causing problems later on when lots of EHs have been created for them (even if deleted?)
no
but if multiple EHs trigger at once you may notice a performance drop
a button doesn't have children 
i'm doing it on a controlgroup
do it on the child ctrls then
i can't
because it's the ctrlGroup itself that's causing the issue
it blocks me from clicking any other button
because the ctrl grp is over everything else
why did you even make a ctrl group?
(it takes up all the screen)
it shouldn't
Make it smaller?
to group controls..?
why?
well make it small enough to fit its items
fired eh -> hitpart eh local to each player which then sets damage to an object which doesn't take any sounds like a bad idea but i cant think of any better methods of "adding" damage 
your question was: does adding EHs to projectiles cause a problem later on
to which the answer is no (unless there's a bug in the game, which should be reported and fixed)
idk if there's a better way to do what you want but sometimes you gotta do what you gotta do
if you only have a few specific objects you can place "helper" objects there that have hitpoints to detect damage
more than a few specific objects & i've not got any helper objects to use π
im trying to make an object take damage until its eventual destruction from being shot by players
doesn't hitpart work on the object?
yes but object and shooter have to be local
so?
works fine in sp but for mp would be dreadful
add the EH everywhere
remoteExec
but i dont want to use remoteexec 
what are you working on?
spamming player with remoteexec versus just having each player have a local fired -> hitpart eh
mod or mission?
mod
just make an init/post init function then
init function for remoteexec or the local fired -> hitpart business 
no fired
just a hitpart on the object itself
why add fired and projectile EHs if you only want to damage specific objects?
PostInit Function to add Eventhandler locally
or add event handler directly in cfgVehicles
i'll have to modify the initialisation function and make a cba event or something for in-progress spawning and push it back into an extra array and just add the eh for each in the array on postinit
i think
that makes no sense
what exactly are you trying to do?
cba event for each time an object is created that adds the hitpart eh then just postinit function that iterates through all the current objects and adds ehs to them all
add health to objects that cannot be damaged π
you can add the HitPart EH via CBA too
iirc it does have JIP? 
...let me look
That seems to be the case, that solves a lot for me then π€
just a matter of passing the object through to the global event then doing eh bits there, nice
How can I navigate through items in ctrlgroups without altering their IDC?
navigate?
access*
i messed up my phrasing
ah, i found this
controlsGroupCtrl
but are IDCs inside a ctrlGroup reserved to the group or global?
"global" as in "display-wide" or something, i suppose?
if you access them via the command you said its specific to the ctrlsGroup
if you access them via displayCtrl they're global
yes
so I still gotta make sure that I don't use a reserved IDC?
those
the game just fetches the first matching IDC
if you add your thing after all main display ctrls it won't matter
and only IDCs of the display you're working with matter. You can have a button with IDC=1 (and most likely do) in 15 different displays and they don't affect each other 
sweet
What do you mean. They both do the same, one outputs to script the other just dumps to log, but they both dump the same data
It doesn't
(_textBoxControlGroup controlsGroupCtrl 11) ctrlAddEventHandler ["onEditChanged", {
params ["_control", "_newText"];
systemChat _newText;
}];
what am I doing wrong?
the event doesn't fire
(controlsGroupCtrl 11 returns a CT_EDIT, it says Control # 11)
ah. Why not use same example on wiki then xD, i got confused.
Anyhow it doesnt help me anyways, It doesnt go deep enough
remove the "on"
check the exclamation on bottom of the page π
arma version 2.14 though, hmmmm

but it still doesn't work
greeeat
i should be on the latest one tho
how do i get an add action from a unit to trigger a trigger
The latest version is 2.12. 2.14 is the next update; elements of it are currently on dev branch.
damn
how long will we have to wait for 2.14 to release?
maybe use "onChar" or something else in meanwhile
The reported plan is for "late summer", but these things are not confirmed until they're about to happen.
Ah found the mod that was causing Init event handler to fire twice multiple times... it was RHSAFRF...
I wonder if it does something with "O_Soldier_VR_F" which i use as base π
But of all the mods this was one of the least expected...
Remember you can always check the current game version by looking in the bottom right of the main menu, of the Editor UI, or of the screen when the pause menu is open. Or at the bottom of the Options menu in the launcher if you don't want to open the game.
how could I not realize that this was there for years lmao
I'll keep an eye out for version numbers next time now that i know that we're in 2.12 
one another thing
when a display gets deleted, every event connections to its children are deleted right?
we don't have to disconnect the events manually
what are the alternatives to passing arguments to a ctrlAddEventHandler ?
with a addMissionEventHandler you would do
addMissionEventHandler ["smth", {
}, [...]];
I'd like to pass controls to the event handler because I haven't figured a way to do it with globals (since UIs don't support serialization)
setVariable
isn't setvariable used on objects?
the control itself is already accessible tho
i need another control
haven't figured a way to do it with globals (since UIs don't support serialization)
wiki already explains it. use[]
read the wiki page on setVariable
link to the wiki page?
any help on how I can make an invisible wall around an object with no collision physics? pretty much just need a sphere that's an invisible wall.
that's what i'm already using to store controls in private variables
I linked it for []
but when i switch them to global, it says that it can't be serialized in the missionNamespace or something along these lines
just read the page. okthnkxbai
Anyone know how to make a vehicle trigger a trigger
works with blufor infantry but not when they are in a vehicle
specific vehicle or any vehicle?
If vehicle is occupied by blufor
and trigger activation is set Blufor, type Present then it should trigger
Any vehicle is fine. Itβs only triggering on blufor infsntry atm
damage only goes up to 1
also for a test, try putting ```sqf
hint "Activated!";
ied setDamage 1;
Into On Activation field, this will pop up a hint when trigger is activated
This is so jank lol
My recording software is not working
is this intended for players or any blufor unit?
any blufor units including players
ive just tried it and it worked.
this worked in any case, me driving, alone or with ai. just ai driving, or any on foot
is your area big enough to accept whole vehicle?
i think its just this specific vehicle im using
i just tried with a pickup truck and it went off
which vic from what mod?
RHS MATV
darn. I dont have RHS loaded atm, so i cant try on my end. Im too lazy to restart
maybe the counter IED shit on the vehicle is blocking the trigger
but its a trigger
so why would that be the case
it shouldnt. Try one without RHINO
did that...nothing
tried with a Humvee tho and it worked
i hate arma so much
thanks man. You are the bomb for trying to help
np... also i've just noticed, if u have further questions about editor related stuff #arma3_editor is perhaps better choice
alright thanks
Hey how can I modify a function at runtime
From a mod
That I already have the source code
you cant
cfgfunctions are protected from being overwritten aside from by ither mods
#creators_recruiting is the correct channel for finding creators
Thank you!
Set allowFunctionsRecompile = 1; in description.ext of a mission.
Then you can redefine any function, during the mission, even ones from mods. Best used with CfgFunctions and preInit
if that doesn't go deep enough, nothing else will.
I guess you have a spawn in there
when you do a spawn, the newly spawned code doesn't know where it came from
Nah it was EH. I found out whats going on using... less scientific methods
I was trying to figure out why event handler that should only occur once, happend multiple times.
Does WeaponAssembled Fire for Drones?
@torn hemlock, thanks for the excellent tool, which is need for every mod developer
Yes, anything done with "Assemble" action
Anybody looked into mines performance impact?? Thinking about having mines in my mission, wondering how much the affect the performance. Didn't do any tests myself but wonder if anybody can share their experience.
they lag a lot
Very laggy with large amouts. I suggest using triggers to dynamically spawn/remove them if players get close to minefields
you also dont need to populate all minefields with mines too; if your players are smart oftentimes they'll just go around the fields
π€
of course, if your players are stupid...
remember to put "Mines" sign
Hello, I made a script to generate crash barriers along the roads on my map. The problem is with the curvature on the road this makes the position inaccurate.Do you have any ideas to patch this problem?
the script ```sqf
{
private _info = getRoadInfo _x;
if (_info select 3 == "VA_Island\data\roads\route_principale.paa") then {
private _pos = _x modelToWorld [9.5,-3.18286,0];
private _obj = create3DENEntity ["Object", "xcam_Crash_barrier_F", _pos];
private _dir = ([_x, (roadsConnectedTo _x) select 0] call BIS_fnc_dirTo) + 90;
_obj set3DENAttribute ["rotation", [0, 0, _dir]];
};
} forEach ([3710.33,7191.15,0.00144267] nearRoads 50);```
Easy way is to not place it on curvy roads
Yes but the map will lose beauty
use maths⦠or a library of relative positions
Okay thanks i look that x)
Do these road segments have a classname? If so, depending on how many there are you could predefine positions for each class
and then just use these positions to create the barriers
No but I will try to find a coefficient which depends on the direction of the road and then apply it to the position
Quick question, how would you make a trigger activate only if a player inside of it has a specific item? I've tried "O_UavTerminal" in (assigneditems player + items Player); but obviously that activates when any player has the item, regardless of whether or not they are in the trigger area. Adding "this &&" doesn't seem to help either. I'm guessing it's something really obvious that I'm missing here.
I know " if ("O_UavTerminal" in (assigneditems player + items player) && player in thislist) then {" would work, but would that not trigger if at least one person is in the trigger, and another has the object, even if it isn't the same player?
Maybe I'm over thinking it. I'll go try it out in a bit.
@spice kayak , do you want to check this item in inventory of all units (player and AI) or only players?
If only players then if ("O_UavTerminal" in (assigneditems player + items player) && player in thislist should work. You can send notification to other players via publicVariable when such event occured.
Alright, thanks. I'll give it another shot. My thought process for that statement was 'If a player has this and another player is in this trigger, then it'll activate' which isn't what I wanted.
Guess I was just over thinking it haha.
it's not a good practice to directly put the code like that
use { this call TAG_fnc_something }
depending on what you want to do, yes and no
access to controls globally because i can't pass private variables to ctrlEventHandlers
alr alr
isn't it _this?
most likely ^^
what is your original goal?
edit a different control when clicking a button (meaning that i can't just use the first argument)
not sure if it makes sense
you⦠don't have to store all that
you can have one script adding an event handler to one dialog's control
you mean that i can store just the control that matters globally and the rest locally?
disableSerialization;
private _myDisplay = findDisplay 46 createDisplay "MySuperDisplay";
private _myButton = /* whatever method to find by idc */;
private _myTextbox = /* whatever method to find by idc */;
_myButton setVariable ["TAG_theTextbox", _myTextbox];
_myButton ctrlAddEventHandler /* click stuff using getVariable TAG_theTextbox */;
this is what i described didn't I
what
i didn't think of setting the variables directly on the controls
mb I've said button, it's not a click event but a KeyDown event instead
Leo told you
too time/memory/text-consuming
got rid of all the uiNamespace getVariable
you wrote ArmA
you lost customer support
lmao
but why is it written Arma and not ArmA
like Armed Assault

The correct name is Arma 3. See: https://www.bohemia.net/blog/arma-2-the-name-tale
As we're quickly approaching the release ofΒ ARMA 2 , the third installment in Bohemia Interactive's award winning series of military PC simulations, it's a good time to clarify some things about the name and also explain why using Armed Assault 2 is wrong or why Arma is not a cheesy weird name as some English-centric souls may believe!
super simple question im struggling with, how would I make a script activate on an object if players entered a Trigger Area?
activate⦠as in what?
I have a script on a vehicle that will spawn units out of it, the goal is for that script to run only while players are present in the are of the trigger
Are you intending on spawning a lot of enemies at once or in waves
the hope would be for it to be in waves so for example players would enter the trigger area, cause the script to run on the object that is spawning the enemies, I then had intended to have it rest for 2 minutes or so before then looping and repeating the process until the object is destroyed
the scenario is a star wars operation using essentially a drop pod to spawn battle droids to add some context
Which IDE do you use for scripting that also have snippets?
Does visual studio have plug-in for sqf files and also code snippets?
Currently I am using typesqf ide and I found it really bad
VSCode has SQF plugins, see https://community.bistudio.com/wiki/Category:Community_Tools#Code_Edition π
so Arma is originally a latin word, not an acronym
the news will be hard to digest
even wiki uses ArmA π
https://community.bistudio.com/wiki/ArmA:_Armed_Assault:_Manual
Set up a trigger area, set it to activate on player presence, set it to repeatable
Add
thisTrigger setriggerInterval 600; this
in condition
yes, because ArmA was Armed Assault's short name - for the first one π
so technically this would be arm3
with a capital A no
Yeah cant wait for Arm4
do I just sync it to the object with the script once I do?
Ah, it is best you run the script to spawn the people in the vehicle and then have them get out in the onactivation part of the trigger
Problem is its not a vehicle that can be crewed the object that's spawning them is technically a car with no seats that the script I have for it currently triggers its spawn animation, I just need to know how to make that script run when a player enters a trigger area
hmm, so vehicle is present, youd just like to make it a spawnpoint IF any player is within trigger area, if i understood correctly?
and have it on cooldown later?
If you just need to run a script, call/spawn it in OnActivation field of a trigger
the script I have in the vehicle already handles the spawning of enemy units i just need the script that I have in it currently to only fire a limited amount of times before entering a sleep/cooldown
Okay and how does that script work? you can put mayhaps a global variable that would be set by the trigger and then reset
Example
inside trigger on activation
MY_respawn_counter = 10;
then inside your script
if (MY_respawn_counter == 0) exitWith {};
//your spawn script
MY_respawn_counter = MY_ respawn_counter - 1;
I honestly cant even describe how it dose im very new to scripting so I only understand the basics but I can post it if that would help
well without knowing how your script spawns, im just firing into the dark here
I took the pre existing script in the functions menu for the object and have just been trying to get it working, thats all I really know? Im not sure what you would be wanting to know specifically about it
Oh god damn it. My issue wasn't with the trigger's condition. It was simply because it wasn't moving to where it needed to be.
well unless i know how it spawns players i cant really tell you how to start stop it
it isnt a module you can just sync to trigger and have it turn on/off
fixed that page :p
this is what's saved into an SQF file in my mission folder, what it should be doing is triggering an animation, sound, spawning and then reversing the animation with another sound effect
This doesnt spawn player at all π
This spawns a droid
@supple tusk plz use https://sqfbin.com thanks π
yes? I said that earlier
but im guessing you want to make it look the same, except for players
i guess i missunderstood
no I want the script to activate if a player is next to it
apologize trying my best to explain it all
okay, so you wanna spawn N amount of droids when player gets close ye?
yeah exactly
yeah put that script into sqfbin and gib link
also do you know how long the animation on the script lasts?
I dont have the exact times on them but there were enough rests in the script to prevent it from wigging out
at least it did when i tested it
there is nothing in it to prevent spawning 100 of them in one second. but i figure it aint gonna look nice
oh I see how that could be an issue
So do you want trigger to be repeatable? So every time someone enters it spawns drones or is it just gonna be 1 time event
the end goal for me is a repeatable trigger that goes on cooldown after spawning say X number of droids
I had hoped this would be easier since the spawn droids functon is actually on the Dispencer's interaction menu but have only discovered that it dose not make it easier XD
no, it sure isnt easy if you never did it before
also is this in cfgFunctions already?
I was thinking while active it would only be a couple of seconds between the droids spawned when a play enters before then going dormient for about 2 minutes or so
im not sure if its in CFGfunctions I pulled the script I sent from the function viewer
then its in there allright
unsure if thats the same thing
you know its name? it should be listed on very top
Okay so lets first tackle spawning and cooldown later, its gonna be something like this.
in OnActivation field of the trigger:
thisTrigger setVariable ["cooldown", time + 2];
[spawnerObject] spawn
{
params["_spawner"];
private _grp = createGroup east;
for "_i" from 1 to <amount of drones you want> do //Execute code below N amount of times
{
private _spawnpoint = selectRandom [1,2,3]; //Select random spawn position as there appear to be 3 from your code snipped
_spawner setVariable ["location", _spawnpoint]; //Save it
[_spawner, _grp] spawn DISPENSER_fnc_spawnUnit; //Call the function
sleep <amount of time between two spawns>; //Wait until next drone spawn
};
};
Set trigger to server only and repeatable. And replace spawnerObject with the variable of the object that acts as spawner, <amount of drones you want> with number and <amount of time between two spawns> with number.
Awesome! I'll try it out right away
Oh wait
There
if there is sleep inside the function, one must use spawn instead of call
I did have a question about the random spawn section though, the script is essentially set so that a "door" open and a droid pops out at the corresponding door with the shape of the object being like a triangle, if there spawn position is random dose that mean "Door1" will open but they'll spawn in position 3?
no the function you've sent seems to put them where they should be
thats all the stuff inside switch(_location), we just tell it here to chose location 1, 2 or 3 at random. So they dont always spawn at door 1
Oh gotcha, so dose this mean that the trigger is also spawning them? Or is it only keeping track of how many have spawned?
No <amount of drones you want> <-- replace that with number, which is the amount you wanna spawn
Eg: for "_i" from 1 to 6 do will spawn 6 droids
so is that going to be spawning them all at once?
Umm <amount of drones you want> with <amount of time between two spawns>
if you set <amount of time between two spawns> to 0 all will spawn at the same time
if you put it to lets say 10, 1 droid will spawn, 10 seconds later another, then 10 s later 3rd and so on
is there a way that instead of the trigger determining this I can tell the trigger to run the spawning script I already have on the object for a set period of time before deactivating and going into a cooldown?
like deactivate interaction?
Im not sure what that means?
what do you mean by
script I already have on the object
Okay im gonna pull a few screen shots to show what the object dose with the script on it currently
1st one shows the dispenser, when the script is activated currently through an "addaction" prompt it opens its hatch while playing some audio. a battle droid then spawns beside where the hatch opened and finally the hatch closes, pressing the button again will then prompt it to preform the same series of actions just from a different hatch and so on and so forth.
this is essentially what the script that I sent you dose currently my problem is I want a trigger linked to it that tells it to preform that script thats in the Dispenser we'll say 6 times before then entering a cooldown if players enter the trigger radius
By interaction i meant scrolly scrolly action menu thingy.
Okay post your addaction script
sorry I might also be misunderstanding, so the script I sent as far as im aware is if you want to brute force this thing into spawning stuff, there is also a scrolly scrolly menu option that spawns stuff if you remote control it in the zeus
amm... i dont think this will work the way you think it will...
the addaction was nothing I wanted to keep on it and was just a place holder to make sure the script actually works
okay...
then im confused
Do you want players to spawn droids by action, or do you want droids to pop out when they get inside the trigger...?
thats totally fine I'm sorry for not understanding I'm still so new I'm just trying to learn in general XD
or what exactly...
okay Im gonna try to start from the begining and be happy with whatever is recommended
so "Arma human player" walks into the trigger zone, that then activates this droid spawner which creates X amount of droids before going onto a cooldown for X amount of seconds
Thats exactly what our trigger above would do (doesnt have cooldown part yet)
- Player walks in
- Droids spawn
currently ive been trying to make it spawn said droids by using the CFG file in the function menu by putting it into a script that the goal was to have the trigger run that script to spawn the droids then go on cooldown, but if its easier to do something like tell the trigger to use the interaction menu prompt that totally works to
okay, so is the one that you had posted essentially using its spawn function from the scroll menu or is it still relying on the sqf file?
its using its spawn function DISPENSER_fnc_spawnUnit the one you gave me
and its not relying on sqf file
it will have no actions, it will just spawn stuff
okay that makes much more sense I was confused because I thought the trigger script you gave me was activating my sqf which is also the spawning script while also activating it again from its own function
that's absolutely perfect and exactly what I was hoping for
no, unless you gave me wrong function
Okay lets do it like this: Edit those 3 variables in the script above, setup your trigger and try it.
if it does what you want, we will add cooldown
no thats the one I was using in the sqf file, I was just mixed up thinking it was doing the DISPENSER_fnc_spawnUnit process twice. Once being from the trigger and once from it activating the sqf file its a mistake on my end in understanding sorry
it is doing DISPENSER_fnc_spawnUnit
and DISPENSER_fnc_spawnUnit is this script -> https://sqfbin.com/ujenoqowakudozedekug right?
yes it is
so it works?
im getting an error that its missing a "}" on line 2
did you edit the variables?
I did might have deleted it by accident 1 sec
post here what you are putting in there
fixed the first issue now its saying invalid value
{
params["_spawner"];
for "_i" from 1 to 6 do //Execute code below N amount of times
{
private _spawnpoint = selectRandom [1,2,3]; //Select random spawn position as there appear to be 3 from your code snipped
_spawner setVariable ["location", _spawnpoint]; //Save it
[_spawner] spawn DISPENSER_fnc_spawnUnit; //Call the function
sleep 4; //Wait until next drone spawn
};
};```
did you put a valid object variable here -> spawnerObject
no
its saying its causing an invalid number in expression
and marking just to the left of the forward slashes on that line
oh, delete all the comments
everything after // including slashes themselves
tbf i didnt test it
ah then DISPENSER_fnc_spawnUnit isnt the script that you posted in the sqfbin
no that is the spawn unit script
butbutbut ^
thats the one I posted right?
check yourself
okay, it is the one i posted and its the same as the FNC_spawnunit script in the function tool
no im an idiot
I didnt copy the last 2 lines
ffs
there is the actual one, sorry again
this function makes no sense _dispenser isnt declared anywhere it just pulls it out if its posterior. Or is something else missing
this time I can promise that I didnt cut anything out
when I had run the code through Chat GPT to try and help me it had said the same thing if that helps
like i see whats wrong with it, whoever wrote it forgot to replace _dispenser with _spawner
BUT, it should still create droid despite the error
does it?
Replace a semicolon with a Greek question mark (;) in your friend's script and watch them pull their hair out over the error
yeah, lsd_cis_b1_standard
is probs wrong class for the droid
or what does error say
specifically its calling out right before the _dispenser as an undefined variable
so still the same error I posted the screen shot of just the line changes depending on what hatch trys to spawn a droid
no its not
okay lets take a step back, what do you have inside droidspawn.sqf
just for the reference
currently I have exactly what I sent you but I removed it from the spawners int. field
or rather removed my add action that triggered it
Oh wait a second.. code changed again... _group = createGroup sideLogic; is missing...
oh and becuase _group isint defined its not able to create them?
The first one you posted https://sqfbin.com/ujenoqowakudozedekug
And the second one you posted https://sqfbin.com/yulosoyanefufecavuna
Dont differentiate in just two last lines...
and who wrote that code, was it you or you copied it from somewhere
the 2nd was copied from arma 3
I thought I did the same for the first I must have accidently sent the one I was fiddling with
Okay. and that is 100% no question about it, no change and nothing added or removed from what it shows in functions* viewer as function DISPENSER_fnc_spawnUnit and you swear by it??
it is the code from arma 3 itself, the only thing I didnt put in was the 9 lines of creators notes which took up lines 1-9 that I can add if it would help
it was just a bunch of * and a note saying please dont use the mod assets without permission
Side note its not from arma3 its probs from starwars mod. Ill edit the snippet above to include group.
it contains an error. But nothing we can do about that, the dispenser thing in the last line.
What side do you want bots to spawn opfor blufor indie?
sorry I meant coipied from the arma 3 application not that bohimeia made it lol
opfor
try above now. _dispenser error will still popup
sorry im trying this one or a different one?
That one. I edited it, with createGroup
works perfectly, the error still pops up but everything spawns as it should
Ok now cooldown, ill edit again above script again BUT replace Condition in trigger with this this && time > (thisTrigger getVariable ["cooldown", 0])
In above example cooldown is set to 2 seconds
so change it to fit your needs, but for testing purposes set it to something like 30, so you can see if bots spawn every 30 seconds
looks like it works mostly, the only thing im noticing is the trigger isint going off again if I remain in the zone
I have it set to repeatable to I have to add something to the deactivation field?
that is how its supposed to work. Do you want it to only do it if you leave the zone and come back?
I was wanting to have it go off again if you remain in the zone
Don't use a trigger. Just have a nice spawned checking loop.
and it does.
it's not currently, if I remain in the zone without leaving it activates once and doesn't activate again even if I remove the cooldown
In on activation code did you change it to thisTrigger setVariable ["cooldown", time + 30];?
or did you perhaps change condition code by accident
condition should stay like this
I thought triggers had no built-in repeat-fire capability. Like you always have to move out and then in again.
nope
well they do but im changing condition code to constantly false-> true if he stays inside within the period
Are you sure that works?
100%
that was the problem I only copied the new condition code and didnt update the activation
this && time > (thisTrigger getVariable ["cooldown", 20])
thisTrigger setVariable ["cooldown", time + 2];
[disp3] spawn
{
params["_spawner"];
private _grp = createGroup east;
for "_i" from 1 to 3 do
{
private _spawnpoint = selectRandom [1,2,3];
_spawner setVariable ["location", _spawnpoint];
[_spawner, _grp] spawn DISPENSER_fnc_spawnUnit;
sleep 4;
};
};
this is what I have currently
yep, now it will go off every 2 seconds
that is time + 2, if you want it to go off every 1 minute do time + 60
etc, you get theidea
oh gotcha, yup defenitley working just watched 6 battle droids spawn all at once
ye
I thought time + 2 would be 2 plus the cooldown so I'll fix that quick
not here cooldown period should be longer than Amount of drones * Time between the drone spawns
in your case 3*4 = 12 so at least 12 seconds
because spawning script is executing for 12 s well actually 16 but last 4 s is just idling
perfect! its working perfectly on the loop
cool, there are also ways to fix that internal _dispenser error, but only server will see it anyways, so i dont think its worth fixing it.
its absolutley perfect thank you so much Marko for all your amazing help and dealing with me struggling to understand this lol
np, you did make me hate arma3 starwars even more tho.
if I wanted to try and fix the error is it going to be a super complicated thing?
I don't blame you lmao at the very least this is a great thing to know how to do for anything in Arma
well i aint gonna stop you, but im going to sleep
lol fair enough thanks again for all the help!
OH. and remember to have trigger set to server only. otherwise you will end up with droid battalion, depending on amount of players during the op
perfect sounds good!
Hey everybody, I'm very new to the Eden editor as well as scripting and I'm trying to learn as I build my first scenario. atm I am trying to play a video so the multiplayer version of the scenario can see the SP intro as well. I have setup a trigger and placed it so when players spawn they can watch the intro. Issue is, I can't seem to get the pathing right and tbh I am super lost because the forums and BI wiki don't really explain this obscure process well. Attached are some screenshots of my issue. Any help would be appreciated!
getMissionPath "intro.ogv"
and set your trigger to server only
Does anyone see why this isn't working? In an older version of my mission, I swore it worked, but now, nothing. http://hastebin.com/uwinolaxaz.rsl
Thank you so much man!!!
You folks are damn wizards!
@spice kayak you should attach to object, not string :)
That's the issue though, I'm trying to attach it to a specific marker, which is randomly decided at the top of the script.
So there are marker objects all on the map, "Extraction_0" through to 5, and I'm trying to attach it to one of them, but it doesn't seem to want to attach to the value of a variable, if that makes any sense.
Because you should attach to object, not string
If there is an object with name Extraction_2 then you should compile your STRING to its name
If tExtraction = "Extraction_" + "0", giving me "Extraction_0", which is an object in game, would it not work?
Because "Extraction_0" is a STRING
Right, sorry. I should have said scripting is rather new to me haha.
If you have some objects named like Extraction_0, Extraction_1 etc... then you have to call compile your string. ex: _object = call compile "Extraction_1"; then use this variable
so, if I went '_extractionLocation = call compile tExtraction;' would that give me the result I'm looking for? Then use 'attachTo _extractionLocation'? Or am I reading what you're saying wrong?
ok first of all please read attachTo description on BIKI:
https://community.bistudio.com/wiki/attachTo
It says that we can attach one OBJECT to another OBJECT
BIS_fnc_kbTell does not seem to automatically determine the distance of a player before deciding if it should play the sentence direct or through radio. Anyone else experience this?
not location/marker etc

