#arma3_scripting
1 messages Β· Page 748 of 1
you can also add another check, e.g. to make sure the heli has landed in a specific area, you can use inArea
you can then add another check for the extraction area, and disembark those civvies
Okay dokey, I give it a shot and hope I dont break it haha
thank you very much though
Anyone know how to make a vehicle a simple object cause it resets everytime I restart the mission
are you ticking the "Simple Object" checkbox in Eden Editor?
Yes
But after testing it then going back to eden it resets it
try without mods, to see?
Not all objects can be simple.
Well the thing is it's a milsim op I'm making and we are using VME PLA mod and the boats just cause frame rate issues
It also happens with vanilla vehicles
Not all objects are simple.
How are you making them simple?
3DEN Scripts?
No I'm using the item attributes to change it
iirc you can only disable the simulation of vehicles but I might be wrong
CUP Vehicles?
No VME PLA
Arghahahaha!
Modern day Chinese military
You're on your own.
I haven't used this mod.
Good luck.
If not I'll just figure out a place holder for the port
is there a way to paste in a toxic zone using zues? I have the script for a toxic zone from the workshop but I need something I can place on the fly. Like a 20mx20m cone with the toxic zone script and possibly a yellow smoke attached to it permanently
Also the script is too large to paste soo not sure if there is a site i can use to share it
Which mod is it?
Depends on the mod.
Is it setup for Zeus?
EDIT: Are there Zeus Modules?
its a script from a composition from the workshop https://steamcommunity.com/sharedfiles/filedetails/?id=2711516635&searchtext=toxic+zone
if youre talking to me
I am talking to you. π€£
okay just making sure
Woah. You can have scripts in Workshop compositions now?
I don't want to download the composition, but you should be able to use the script ( if any ) from it.
Ok. Curiosity got to me and I checked out the composition with scripts in triggers.
First scan, it's only for single player.
And it looks like it'll be heavy on performance.
Not tested.
Sorry.
To answer your question...
Using this composition and scripting inside, it's not possible feasible.
Does anyone know how to boot with weapons in Altis Life? I place them, I determine their function but when I enter the game they appear without the weapons. π
Hooo, ok, sorry
I mean, it would be better to get help around e.g their discord server, as this is a framework that is specific to them π
thou shalt be spanked!!
how to get rid of the screen that comes when there is no player object in singleplayer? I want to end the mission but that screen prevents it
getting splendid camera / No GPS screen...
I have to press ESC to get rid of it but would like to do that via script
use the endmission cheat?
cheat?
oh
you can close the camera via cam functions
cam functions, not cam commands
["Exit"] call BIS_fnc_camera;
will exit splendid cam
It doesn't seem to do anything
Well I solved the problem by creating the player via script if the player is null π
Is there a way to force a particle effect to always spawn in a given orientation?
I tried setParticleRandom to set it all to zero, I have randomDirectionPeriod and randomDirectionIntensity on 0, rotationVelocity also 0. But the particles still spawn with different orientations.
I basically want a circle emanating from a unit, growing, as a particle effect - \A3\data_f\Training_Ring_30 seems perfect in that regard, but only if I can fix its orientation
Show the code please
Is the function that allows you to change the size of the vehicle inventory ready?
Thanks
im trying to make a carry/drag script, where do i start lol
been looking for a scripter for weeks now for my prospectice CDLC, to no avail, so now need to get it done myself
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting read this, given to me by Revo (#arma3_scripting message)
read the utilites > script commands
Well you have to add the action to the targeted object > attach the object to the player / make player do anim > add action to stop carrying > un-attach the object and remove the anim. Thatβs what I would do off the top of my head
Only works for alive players in Mp tho, cant drag corpses of dead players.
when switching units and become squad leader, the vehicle seat switch menu disappears. it reappears if i get out and back into the vehicle. is this fixable by code?
It awesome you are making this a script (for people who don't want the hassle of loading ACE3), but-
Coding this reliably requires some fiddling with animations and multiplayer scripting. Other people have done it before. Here's some inspiration from a popular persistent scenario still running on servers right now:
https://github.com/auQuiksilver/Apex-Framework/blob/master/Apex_framework.terrain/code/functions/fn_clientInteractCarry.sqf
@opal sandmaybe those things can help in some drag related way, https://steamcommunity.com/sharedfiles/filedetails/?id=1893300731 and https://steamcommunity.com/sharedfiles/filedetails/?id=2561708057
I need help, I'd like to make a mod but not sure how to start. I have an idea for a stacking up mod, where players can "link" to the man in front of them in a stack. The idea would be that the point man would move the linked players as he moved. Any linked players would be basically locked into 1st person and as if they were in a vehicle, able to aim around but not control their movements until they break away. This seems possible in my mind but not sure where to begin. Anyone bored wanna collaborate ?
Evening gents - did the ACE slideshow module got an update recently ? I'm having issues getting the controller to work and manually select the next slide. I simply don't have any interaction on the object. Automated rotation of the slides works fine but manual switch just doesn't exist anymore. Any idea why ?
can anyone help me figure this out?
{
this addEventHandler ["Fired", {
params ["", "", "", "", "", "", "_projectile"];
;
_dir = random 360;
_range = random 1000;
bomb="Bo_GBU12_LGB" createVehicle [(getPos hpad2) + (sin _dir) * _range, (hpad2 select 1) + (cos _dir) * _range, 0];
}];
}; ```
completly breaks my script HOWEVER if i do
```if (isServer) then
{
this addEventHandler ["Fired", {
params ["", "", "", "", "", "", "_projectile"];
;
_centerpos = (getmarkerpos "hpad1");
_dir = random 360;
_range = random 1000;
bomb="Bo_GBU12_LGB" createVehicle [(_centerPos select 0) + (sin _dir) * _range, (_centerPos select 1) + (cos _dir) * _range, 0];
}];
};```
it works just perfectly fine main diffrence between these two is that the first one is a object and the second one is a marker
and im honestly just confused
getPos hpad2
vs
getMarkerPos "hpad1"
you're trying to add a number to an array (getPos hpad2) + (sin _dir) * _range
just do hpad2 getPos [random 1000, random 360] instead of all that extra stuff
have i just gone like 20 extra steps for something that could be much simpler?
yes
fml
Experience is a hard teacher because she gives the test first, the lesson afterwards.
π
Sorry for the late reply.
My test-bed code is:
private _pos = getPosATL _this;
_pos = _pos vectorAdd [0, 0, 2.7];
_pos = _pos vectorAdd ((eyeDirection _this) vectorMultiply 0.1);
private _object_orb = "Sign_Sphere10cm_F" createVehiclelocal _pos;
_object_orb setObjectMaterialGlobal [0, "\a3\data_f\default.rvmat"];
_object_orb setObjectTextureGlobal [0, "#(argb,8,8,3)color(1,1,1,0.5,ca)"];
_object_orb setPosATL _pos;
private _eye = eyeDirection _this;
private _dir = vectorDir _this;
private _rel = [0,0,0];
_rel = _rel vectorAdd (_dir vectorMultiply -0.1);
_rel = _rel vectorAdd ([0,0,1] vectorMultiply 1.1);
_object_orb attachTo [_this, _rel, "head"];
_ele = "#particlesource" createVehicleLocal (getPosATL _object_orb);
_ele setParticleCircle [0, [0, 0, 0]];
_ele setParticleRandom [0, [0, 0, 0], [0, 0, 0], 0, 0, [0, 0, 0, 0], 0, 0];
comment " lifeTime, position moveVelo rotVel weight volume rubbing size color animSpeed rndPir,rndInt";
_ele setParticleParams [["\A3\data_f\Training_Ring_30", 1, 0, 1], "", "SpaceObject", 1, 0.15, [0, 0, 0], [0, 0, 0], 0.0, 0.0, 1.0, 0.075, [0.003, 0.03, 0.05], [[0.1, 0.1, 0.1, 0.5], [0.25, 0.25, 0.25, 0.5], [0.5, 0.5, 0.5, 0]], [0.0], 0, 0, "", "", _object_orb];
_ele setDropInterval 0.1;
_ele setParticleRandom [0, [0, 0, 0], [0, 0, 0], 0, 0, [0, 0, 0, 0], 0, 0, 0, 0];
_ele attachTo [_this, _rel, "head"];
hideObject _object_orb;
This generates a sphere (not relevant here, but used as the reference object), with the rings in its place.
I would love to have the rings only spawn with the axis through their centers being the Z axis.
try using this β for syntactic colouration π
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
Thanks and done!
since you are using SpaceObject, have you tried using the vectorDir parameter?
see https://community.bistudio.com/wiki/setParticleParams, the last one
Thanks, that is exactly what I was looking for, I don't know how I did not see that myself, I feel stupid.
But, as a side note: For me, a vectorDir of [0, 0 , 1] would be perfect, bu it does not work (no error, but effect is not visible). [0.001, 0.001, 1] works, however. Weird.
ah well, I call Armagic on that one π
it's not that well visible tbh, this page could have a refactor
this page https://community.bistudio.com/wiki/ParticleArray is the mother of it all
Oh, that page even has the explanations for some of the more exotic parameters, nice
If the current vectorUp is parallel to the vectorDir you provide, the new vectorUp cannot be calculated, and the new orientation is unsolvable
You must use setVectorDirAndUp instead
that's for particles though
- Is there a way to modify parameters of units icons, showed at the screen bottom - like alpha/background, with scripts?
- I try to change hc group parameters with
_grp setGroupIconParams [[0.9,0,0, 1], "No contact", 1, true];
It turns red for a second, and then returns to green (basic). Why it resets?
this addEventHandler ["ContainerOpened", {
params ["_container"];
if (random 100 < 5 && !(_container getVariable ["ROM_searched", false]) then
{
// spawn grenade
getPosATL _container createVehicle "GrenadeHand";
};
_container setVariable ["ROM_searched", true, true]; // tells all machines
_container removeEventHandler _thisEventHandler;
}];
```MP-compatible @foggy lodge
if you want it on all your enemies:
{
_x addEventHandler ["ContainerOpened", {
params ["_container"];
if (random 100 < 5 && !(_container getVariable ["ROM_searched", false]) then
{
// spawn grenade
getPosATL _container createVehicle "GrenadeHand";
};
_container setVariable ["ROM_searched", true, true]; // tells all machines
_container removeEventHandler _thisEventHandler;
}];
} forEach units opfor; // if your enemy is opfor
and place this in initPlayerLocal.sqf
Okay, so do I have to name anything in the mission _container or _x?
nothing at all
Oh thank you!
these are local variables, for the current code only
That's amazing. Will this tear into performance in any way?
nope, at all
perfect!
it could be perfected about MP messages, but it should work well nonetheless
{
_x addEventHandler ["ContainerOpened", {
params ["_container"];
private _hasBeenSearched = _container getVariable ["ROM_searched", false];
if (!_hasBeenSearched && random 100 < 5) then
{
getPosATL _container createVehicle "GrenadeHand";
};
if (!_hasBeenSearched) then
{
_container setVariable ["ROM_searched", true, true];
};
_container removeEventHandler _thisEventHandler;
}];
} forEach units opfor;
```that's the ideal code I believe
I will use that then, I don't speak computer so I trust your judgement
Might be good to have a hint or something like that, that a grenade was dropped?
Thinking from a player perspective i'd be quite confused if I looted a guy and just sorta exploded
my unit will figure it out. I'm probably replacing it with a minigrenade, but they like to learn things the hard way and that will give it some mystery.
I like when players come to their own conclusions
or play a sound
I think the grenade will make a sound by hitting the ground
but it's true that it can be frustrating if that's not the case / not noticed
Hm yeah true
private _classes = "getNumber (_x >> 'scope') == 2 && {configName _x isKindOf 'Tank'}"
configClasses (configFile >> "CfgVehicles");
private _names = _classes apply { configName _x };
_names;```
This script parse tanks from current user modset
how to parse uniforms?
private _classes = "getNumber (_x >> 'scope') == 2"
configClasses (configFile >> "CfgWeapons");
private _names = _classes apply { configName _x };
_names;
how do i spawn a couple of vehicles randomized? i have used some safe spot combinations, and also forbid dmg. in a lot spawns, some of them blow up anyways. :>
private _classes = "getNumber (_x >> 'scope') == 2"
configClasses (configFile >> "CfgWeapons");
private _names = _classes apply { configName _x ;
_names;```
How to particulary extract only Vest's from CFG Weapons?
private _uniforms = "( ( configName _x ) isKindOf ['Uniform_Base', configFile >> 'CfgWeapons'] )" configClasses (configFile >> "CfgWeapons") apply { configName _x };
how to parse only vest's?
try Vest_base
nothing, doesn't working
"getNumber (_x >> 'scope') == 2 && {getNumber (_x >> 'itemInfo' >> 'type') == 701}" configClasses (configFile >> "cfgWeapons")
Hi, I'm making a mission in which all players should start thirsty and hungry (ACE Field rations framework) i think I should use this, but I'm not sure how:
3.3 Adding a status modifier
ace_field_rations_fnc_addStatusModifier
- Adds a status modifier. Should be called on all machines.
- Code must return a NUMBER which will be applied additively with other status changes.
- Arguments:
- 0: Status to modify (0 - Thirst, 1 - Hunger, 2 - Both) <NUMBER>
- 1: Code (is passed the unit <OBJECT>) <CODE>
- Return Value:
- None
- Example:
- [0, {random 1}] call ace_field_rations_fnc_addStatusModifier
[2, {0}] call stuff?
2nd one needs to be code
it is?
like you never pulled that one on me π
found it, its
player setVariable ["acex_field_rations_hunger", 80];
player setVariable ["acex_field_rations_thirst", 80];
how do i do: _pos2 = getpos _pos1 + 1 meter to the right of it;
1/ don't use getPos
2/ obj1 setPosATL (getPosATL obj1 vectorAdd [0,0,1]);
@winter rose that goes far over my understanding. https://pastebin.com/KxbMMxQn
getPos is banned here you must know π
well, I set this as an example
// your code
_pos2 = getpos _pos1 // (+1m plz)
// solution
private _pos2 = _pos1 vectorAdd [0,0,1];
thx!
but given you are using a marker position, it seemsβ¦weird
also that you want to spawn a Merkava on top of a repair truck, too π
on top?
it should be one meter right of it :>
right now i watch the vehicles explode until somthing works.
oh poop, I made it 1m on top of it π
vectorAdd [0, 1, 0];
```but "just" 1m may not be enough
yes, works now. thx π
Hey all! I want to add an action that will execute a script from a mod made by the Project Hatchet team for their H-60. Essentially, the idea is to addAction and then call upon their send message script to send the message. Then, it will give a hint to the player letting them know it has been sent. I am lost so far π¦
this addAction ["Request Reinsert", { call VTX_fnc_attemptSendMessage ["Reinsert Requested", "USR SYSTEM", ALL, 0, "Reinsert has been requested, please RTB for pickup." ] } ];
I would still need to add the hint part in there, but I want to get this working first, and its telling me there should be semi-colons and brackets everywhere. Any help is appreciated!
P.S., im new to any sort of scripting or coding in general, and I do realize that I might need to format it correctly as far as breaks and brackets, but i have no clue on how.
see below for colour syntaxing π
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
this addAction ["Request Reinsert", {
call VTX_fnc_attemptSendMessage ["Reinsert Requested", "USR SYSTEM", ALL, 0, "Reinsert has been requested, please RTB for pickup."];
}];
```so
this is wrong because you do `call <function> <arguments>`
where it is `<arguments> call <function>`
also, what is `ALL`? if it is supposed to be a string, use `"ALL"` π
Hello a3 hive mind.
A quick doubt:
levelAI = "AILevelHigh";
would affect the custom skill setting for each unit in the mission while on a server?
Hello a3 hive mind.
make us whole again
ALL is their way of identifying who is supposed to read the message, as it sends to every tablet anyways. So in the case of me swapping the arguments and function, do I state the
["Reinsert Requested", "USR SYSTEM", "ALL", 0, "Reinsert has been requested, please RTB for pickup."];
before this?
call VTX_fnc_attemptSendMessage
Because at the moment, I've swapped them and its telling me
VTX_fnc_attemptSendMessage
Is an undefined variable. Do i need to provide a file path? I've tried adding .sqf and it gives me the same error.
did you configure cfg functions properly?
I haven't configured anything, so that leads me to say no. I just have to add a new Cfg Functions and define its class?
I'll follow the wiki for that, but that would make sense π
guys quick question , why setdir function move object slightly , i am trying to setdir for static gun and its moving while dir changing
because not all the objects are trully centered to the bounding box, if by move you mean that when you rotate a turret/gun over your position change relative to the direction
yes is there solution for that ?
how can I set everything on blufor as captive at mission start (I have a solution for JIPs, so dont worry about that in your answer)
units west apply {
_x setCaptive true;
};
does that work in MP environment? in the init.sqf I'm guessing?
yes. you might want to use a isServer if putting it in init.sqf
or just use initServer.sqf
Great. Can I use it the same way in a trigger?
Or do I need to add a remoteExec in trigger?
same way. you know how to check locality for commands right?
yeah some stuff I read said I needed remoteExec though so I got confused
if you check the wiki page for a command, at the top of it there will either... LE, GE, LA, GA
for:
local execution
global execution
local argument
global argument
so tell me, what does setCaptive say?
LA GE
so that means?
local argument global execution
so it means that the argument, the unit, needs to be local to that machine, and the command itself, effects everyone in the game
and AI when not using a headless client is typically local to the server
isnt zeus spawned ai local to the zeus
you're not doing that. you are using an init
I'm aware. I'm talking about generally.
this addAction ["Request Reinsert", {["Reinsert Requested", "USR SYSTEM", ALL, 0, "Reinsert has been requested, please RTB for pickup."] call VTX_fnc_attemptSendMessage;};];
maybe
setFriend needs server exec
i am attempting to do it thusly:
[west, Independent, 0] remoteExec ["SetFriend", 2];
[Independent, West, 0] remoteExec ["SetFriend", 2];
it does not work
ah ofcourse, SetFriend is a binary operator, so i needed to give it two operands
which happened like so:
[west, [Independent, 0]] remoteExec ["SetFriend", 2];
thank you all
you're welcome!
but glad you found out π
hello everyone, is there a way to change a customChatcolor? its only popping up in purple for me but ive seen pictures of it in red
the title of the chat channel, yes. but not the text
ive found what im looking for: its defined within radioChannelCreate
correct
thats what i was looking for, ty
Does anyone have documentation on how to get custom inventories to work
Currently arma 3 just ignores it
Made a custom mod to rewrite it and instead of moving things around it just makes the inventory darker for some reason
How can i get all groups in cargo of a vehicle? I want to have it so they briefly leave the vehicle until the vehicle turns of its engine. ```
this addEventHandler ["TurnIn", {
params ["_vehicle", "_unit", "_turret"];
thegroup leaveVehicle _vehicle;
}];
this addEventHandler ["Engine", {
params ["_vehicle", "_engineState"];
thegroup addVehicle _vehicle;
}];
private _allGroups = fullCrew [_veh, ""] apply {group (_x#0)};
_allGroups = (_allGroups arrayIntersect _allGroups) - [grpNull]; //unique and non-null groups
@little raptor Thanks i will give it a try.
fixed an error btw
should've been group (_x#0) not group _x
@little raptor i must be doing something wrong. No luck on my end.
code?
this addEventHandler ["Engine", {
params ["_vehicle", "_engineState"];
private _allGroups = fullCrew [_vehicle, ""] apply {group (_x#0)};
_allGroups = (_allGroups arrayIntersect _allGroups) - [grpNull];
_allGroups leaveVehicle _vehicle;
}];```
the syntax is wrong
um forgive me im dumb. I dont see it.
it's GROUP leaveVehicle OBJECT not ARRAY leaveVehicle OBJECT
So um how would i go about that.
Hi, I sync two objects and one needs to be the master in this synchronization later on. I get the synced object with https://community.bistudio.com/wiki/BIS_fnc_allSynchronizedObjects Is there a way to determine an order between objects or so, so I can determine who's going to be the master in the sync? Or is there a way to see who's the parent in the synchronization?
background is the placement of anchors to put a rope in between
@little raptor I think i got it.
or maybe I just use getPos and sum the array elements for a somewhat unique number, If those would be equal the system cannot work anyway?
ah, no summing is not good, compare element by element must be done
I have no idea what you're talking about 
I just use getPos
you should never use getPos
I sync two objects in Eden with synchronizeTo. I need one of them being the master, the other being passive. How do I determine the master? That's the basic question.
I was talking about the "getPos...sum..." part
there's no way to have a "master object" with Eden sync to
ok, the getPos or getPosATL or getPosASL would be giving me three numbers I can compare for greater or smaller and then just say that the one object with greater number is the master.
you might as well just randomly select one as the master
how does the non master know about the master?
they're synced aren't they? when one is the master the other one isn't
once you've picked the master you can use setVariable on both objects to let each one know who's the master
giving me three numbers I can compare for greater or smaller and then just say that the one object with greater number is the master.
objects move and their positions change
something like that should work then? ```sqf
private _syncedAnchor = _syncedAnchors # 0;
// arbitrarily select one based on greater comparison
if (_syncedAnchor getVariable ["ttt_wires_isMaster", false]) exitWith {
systemChat "The other anchor is master";
};
_anchor setVariable ["ttt_wires_isMaster", true];
systemChat "Setting up rope";
it works but if you're constantly getting the master for either object just set the master directly to avoid wasting performance:
_anchor setVariable ["ttt_wires_master", _anchor];
_syncedAnchor setVariable ["ttt_wires_master", _anchor];
bummer, seems my understanding of 'synchronizing to' is off - I cannot sync two objects of the same class it seems
BIS_fnc_allSynchronizedObjects just returns the object itself, not the synced to π¦
iirc syncing doesn't work for all objects
Yeah, looks like it. I used it in the past with modules though, maybe that's a work around
perhaps using modules would be better
Anyone know a good video guide on how to set up the Sfq files ect
how can I force player to look/turn at certain direction? lookAt works only with AI.
not possible
for turning you can use setDir
it's not possible to set the aim either
would making a custom animation solve that or will the player's head still look at the previous position?
iirc yeah, it kinda solves it
remoteControlArgs = [_oldPlayer, _isDamageAllowed];
// Wait until pause menu is shown, then do stuff
[missionNamespace, "OnGameInterrupt", {
params ["_args"];
_args params ["_interruptDisplay"];
[_interruptDisplay, _thisScriptedEventHandler] spawn {
params ["_interruptDisplay", "_EHID"];
waitUntil {!isNull _interruptDisplay};
[missionNamespace, "OnGameInterrupt", _EHID] call BIS_fnc_removeScriptedEventHandler;
remoteControlArgs params ["_oldPlayer", "_isDamageAllowed"];
// Do stuff with args
};
}] call BIS_fnc_addScriptedEventHandler;
Sorry to ping you @little raptor
What I want to do is to pass the contents of remoteControlArgs within the EH.
Since I don't use BIS_fnc_callScriptedEventHandler, I can't pass them through that. From what I can tell you can't pass arguments through BIS_fnc_addScriptedEventHandler - or can you?
I don't think so
basically all scripted event handlers are called by BIS_fnc_callScriptedEventHandler
since that event (OnGameInterrupt) is called by the game itself, it also passes the args itself
also your args are not really correct. params ["_interruptDisplay"]; is enough
Is there a quick way to convert int to bool? Like a str but for bool
Or do I need a ifjust for that
My brain moment
I meant "Number"
this is the fastest way:
_num == 0 //or !=
well if you're gonna write it like that you might as well do select, which is faster than if for something like that:
[false, true] select (_value == 1)
but that's redundant
More like that's overcomplicated
I needed parseNumber anyway for the other way around. So thanks both π
it is can work together?
enableDebugConsole = 1;
enableDebugConsole[] = {"765611980********", "765611980********", "765611980********"};
no
If I read this correctly: https://community.bistudio.com/wiki/Description.ext#enableDebugConsole Then your second line will override the first. This-
enableDebugConsole = 1;
Is for Admins defined in server.cfg.
Is there no script that forces the AI to just drop it's bombs untill its empty?
this forceWeaponFire["sab_fl_bomb_48rnd_ptab_mag", "LoalAltitude"]; im trying to get a modded plane drop its bombs but im a total newbi with the weapons config
Force an AI to fire? There are .. a lot. You can start with this: https://community.bistudio.com/wiki/fire
Trying to make a capture point out of a Trigger Area using a custom condition:
count (allPlayers inAreaArray thisTrigger) > count ((east countSide inAreaArray thisTrigger) select { lifeState _x == "HEALTHY"; } )
Activates when allPlayers is greater than "healthy" OPFOR AI.
However I'm getting a syntax error when placing this in the condition box of the trigger.
Image showing syntax error message:
https://imgur.com/a/wldy8R5
What am I doing wrong here? Can someone point me in the right direction?
east countSide inAreaArray thisTrigger
this is wrong
inAreaArray needs an array of objects to its left
yet you're providing none
the correct way is:
units east inAreaArray thisTrigger
I'll give this one a try and report back. Thanks for now
Flawless, thanks again
Hi. Is there a way to use associative arrays?
I found this topic, https://forums.bohemia.net/forums/topic/202434-bis-associative-array-functions-recommended/
is it recommanded to do it this way?
No.
Use HashMaps which were introduced with 2.02 update:
https://community.bistudio.com/wiki/HashMap
Thank you ! π
Hey, not sure if this is the right channel or not, but
Does anyone have a ballpark guess on how soon 2.10 is coming?
We're planning on using https://community.bistudio.com/wiki/setUnitFreefallHeight for a project we're working on
But we need to wait for it to be actually out before we finalize π
I know it'll likely be a while but I figured I'd ask
I'm using inGameUISetEventHandler to add an extra event when a player uses a standard action. I've noticed it only executes when it returns TRUE. Right now the code is structured as:
" if ( ... ) then {hint 'You are not allowed to do this'; true}
"];```
And it works, probably because *hint* returns nothing. However, almost every other command returns something, which disables the entire Event Handler. Is there a way of controlling the return value of a command (such as a script handle for *execVM*) or otherwise running code within the *inGameUISetEventHandler* ?
I definitely thought so. Nosiree; the RPT gives Error position: <inGameUISetEventHandler ["action", ... Error ingameuiseteventhandler: Type String, expected Array
When you use commands like execVM, createVehicle et cetera. Which is odd, because the syntax of inGameUISetEventHandler requires wrapping code in quotes. Again, only having TRUE in the brackets, or using hint commands before the TRUE statement, works.
4+ months at least
I'd say 6
In order to run code and get it to return TRUE, I've tried something exotic from BIKI:
...then {_handle = 0 spawn {}; scriptDone _handle; true}
But this just an "Error Invalid number in expression" error. Perhaps because the syntax trick dates from Arma 2.
wat?
See above: #arma3_scripting message Trying to run code when a player does a standard action.
My wat is more like who the hell writes something like that?
User Bn880 (can't help but put on a TR0N voice when reading it): https://community.bistudio.com/wiki/scriptDone
What does it even have to do with your question?
Stop spamming
Well, I wrote it and linked it above. I'm trying to get code to run within inGameUISetEventHandler
He already told you to stop spamming and now you spam again and even tag him.
That's how you won't get any help....
Just return true/false at the end of the code, like veteran told you
Also what you say here is impossible. Codes don't have "special modes". They run the same everywhere. Your error is due to something else
Pls hep me

I wanna ask is someone else having an issue with achillite beta?
If you have trouble writing the code as string, write it as normal code, and use the toString command to convert it to string:
toString {}
I will try that. Thank you π
This fixed my problem! Thanks again... Is there a post or guide anywhere to writing code as string?
No
Also you didn't happen to put comments in your string code before, did you?
No. In fact I copy+pasted the syntax into toString {}
well the toString code is already preprocessed
The string isn't
You probably had a bad string, for whatever reason
OK. I will read up on preprocessor. Thanks for the feedback.
Great to see the little trick I've shared being used and useful already 
Hello
anyone know of any eventhandler that would be triggered when a vehicle reloads from a crate or ammo truck?
no such thing, you can only catch normal weapon reloads.
How to parse every backpack from modset?
"getNumber (_x >> 'scope') == 2 && {getNumber (_x >> 'itemInfo' >> 'type') == 701}" configClasses (configFile >> "cfgWeapons")
== 901 gives nothing
backpacks are in cfgVehicles
and you want to look for isBackpack iirc, number 1 or 0
I want to make a hold action that once the player completes it a respawn point is enabled
Is there (preferably easy way) to set the condition of the Respawn to true instead of false or some other way to enable it?
Thank you for the straightforward (non-developer bashing) question :)! Do you want the AI to switch to combat mode at all? In that case you could set the group on "Careless".
It's safe mode, you can't set careless via Zeus unless you use mod, like ZEN
And safe auto switches to combat when enemies are known.
disableAI "AUTOCOMBAT"
https://community.bistudio.com/wiki/disableAI
https://community.bistudio.com/wiki/enableAttack
so i got a problem with my remoteExec funtion. Somehow my object (house) is not passed trough. what could be the cause for this?
https://community.bistudio.com/wiki/Multiplayer_Scripting#General_information_about_locality
terrain objects (buildings, vegetation, roads etc.) are local everywhere (
local nearestBuilding playerreturns true on every client)
Hey there, does any1 know how to convert a [vectorDir, vectorUp] array to the 3DEN "rotation" attribute format? Or is there any BIS_FNC that does it?
Around july/august or later
i see but that dose not really help me in my case
i get the house through CoursorObject and pass it through the remoteExec to the server but the server receives only an ObjectNull
why is that so
the other tow strings i pass with it get recived adn work just fine
im am so confused
publicVariable "_x";
can i do that in a for each?
publicVariable format ["%1", _x];
``` IG that could work if the former doesnt
STR could also work i reckon
you can't publicvariable a local variable
yh but say it was part of a forEach on a series of global vars?
would that still not work?
no, with
publicVariable "_x";
``` you are telling arma to broadcast _x
the second option would also not work reliably, eg with objects
{
publicVariable format ["%1", _x];
} forEach [player];
``` would broadcast something like `B Alpha:1 (Terra)`
ok cheers
Hi. Is there something I'm missing to make an object smaller for all players on a server.
I am currently doing within the objects Init:```sqf
this setObjectScale 1.7;
but when on a dedicated server the players see it at the normal 1.0 scale
[cursorObject] remoteExec ["...", 2];
```Like this?
It should be _this instead of this?
(unsure)
There is a script command called "triggerAmmo" that supposedly triggers munition as if it did hit something... I tried on G_20mm_he, and it doesn't make the grenade explode. It does work with the MAAWS ammunition, though... So, is this limited to certain ammo simulations, like shotRocket ?
that command only works in multiplayer if it's a simple object or attached to another object
my workaround has been to script the object to be replaced by a simple object with the same model
if the object isn't centered on the model you'll have to do some adjustments to make it fit the same space
Is there a way to add an AI unit spawned via createUnit to the list of units a Spectator slot can spectate?
is there a way to detonate a grenade with scripts, triggerAmmo doesnt seem to work
Hi guys, could you guys tell me how I could export data from sqf to Json?
Like what? You excute an sqf, will get a json?
So, I want, for example, to make a script that registers the kills that the players are making, if they have died, complete missions, to give you an example and then parse to JSON file.
- A3 has no native json support
- You can use
copyToClipboardto copy formatted text but it is restricted on clients in MP
no
read the command description
it's only intended for simple and attached objects
and it should only be executed where the object is local
In search of the previous solution, I had come across this CBA_fnc_encodeJSON and CBA_fnc_parseJSON but I couldn't find a way to export the data to a JSON file.
u.u that sad
π
Technically could use a logging extension like A3Log, then just log the JSON to the file you pre-define, but that does require extra extensions
you might as well just write your own extension for reading/writing to file
ok, I'll check it that then
If he wanted to write his own extension, I don't think he'd be here π
there are existing extensions that can do that
you've point π
which one. for example?
I'll check it right now, Thanks you two guys. @dusk gust
may I have some assistance
null = [] spawn {
soviet1 doWatch getpos doorwatch2;
soviet1 doTarget doorwatch2;
sleep 3;
for "_i" from 0 to 3 do {
soviet1 forceWeaponFire [currentMuzzle soviet1, "Single"];
sleep 0.2;
};
};
when the trigger is activated the unit shoots toward game logic entity doorwatch2
but it's seemingly random whether he actually turns and targets it before shooting
I guess I should ask a question
How do I get the unit to consistently shoot at the target?
http://forum.aimgame.ru/index.php?/topic/316-skript-arma3-poluchenie-spiska-klassov-vsei-tekhniki/
Found good article how to parse classnames of current mod set(dont foget to change Β» to >>)
Parse weapons (Other item types https://community.bistudio.com/wiki/BIS_fnc_itemType
Select 0 = category:Weapon, use
Select 1 for subtypes:Rifle" ")
_configs = "getNumber (_x >> 'scope') >= 2 AND getText ( _x >> 'simulation' ) isEqualTo 'Weapon'" configClasses (configFile >> "CfgWeapons");
_classNames = _configs apply {configName _x};
_names = [];
{
_isUni = (_x call BIS_fnc_itemType) select 0;
if (_isUni == "Weapon") then
{
_names pushBack _x;
};
} forEach _classNames;
copyToClipBoard str _names;
hint str _names;_names```
there's no reason to do it like this. you could just extract the weapons using that configClasses code directly:
toString {
getNumber (_x >> "scope") == 2 && {
getNumber (_x >> "type") == 1 //primary weapon
}
} configClasses (configFile >> "CfgWeapons");
other weapon types are 2 for pistol and 4 for launchers
if you wanted all weapons: getNumber (_x >> "type") in [1,2,4]
hello everyone, trying to get a way for radiochannelcreate to work in multiplayer but im super stumped
what do you try?
if (isServer) then { customRadioChannel = radioChannelCreate [[1.0, 0.1, 0.1, 0.7], "Ground Forces", "%UNIT_NAME", []]; customRadioChannel enableChannel false; };
ive tried that
and this
if (isServer) then { private _channelName = "Ground Forces"; private _channelID = radioChannelCreate [[1.0, 0.1, 0.1, 0.7], _channelName, "%UNIT_NAME", []]; if (_channelID == 0) exitWith {diag_log format ["Custom channel '%1' creation failed!", _channelName]}; [_channelID, {_this radioChannelAdd [player]}] remoteExec ["call", [0, -2] select isDedicated, _channelName]; };
from what i can tell its just not creating the channel
where do you execute it?
in-mission via zeus module - ive ofound it works in singleplayer but not in mp
im using the global setting for said module
well first of all, the command should be executed on the server itself
you should either make it into a function and remoteExec the function (the preferred option), or remoteExec the code if you can't or don't want to create the function for some reason:
[{
private _channelName = "Ground Forces";
private _channelID = radioChannelCreate [[1.0, 0.1, 0.1, 0.7], _channelName, "%UNIT_NAME", []];
if (_channelID == 0) exitWith {diag_log format ["Custom channel '%1' creation failed!", _channelName]};
[_channelID, {_this radioChannelAdd [player]}] remoteExec ["call", [0, -2] select isDedicated, _channelName];
}] remoteExec ["call", 2]; //server exec
I don't remember what I was gonna say for "second of all"... 
second of all, have fun!
maybe π
doesnt work but im going to chalk it up to user error
0:10:29 "Custom channel 'Ground Forces' creation failed!"
this is what my
console spits out
console? you mean rpt?
yea yea
not exactly sure what im doing wrong, though im not really sure what im doing in the first place
i am running it on the server level now
I have no idea why it fails. Maybe you have too many channels?
that verywell may be the issue, but if my issue stems from channels not being created then it doesnt make sense for my customChat's to not show up when called
i will restart and report back
so you tried customChat will all channel IDs?
yep, 3-4-5-6 etc etc
im going to restart and see if im just doing something dumb
okay, its not longer spitting back the error
i think the issue is the way im calling customChat
Good day. Where can I see the insides of 'setVehiclePosition' command? I'm particularly interested in how it detects collision with other game objects, could not find it in functions viewer tool.
no can do, engine code
Pity. Thanks for answering.
command != function indeed π
true (=
how do you call it?
player customChat [3, "CP, this is Zoya 2. We're under attack by an enemy force, over."]; i am once again doing this via global, and ive tried server
why 3? just use the channel ID from that command
3 is what its always started out for me in testing
better just save the channel ID into a var and use that var instead
if i knew how to do that
i probably would
this is totally out of my realm
thanks for the help, ill probably try this again at a later time
but it is currently 3am
never code when tired - saves you 3Γ the spent time π
query, use EH such as FiredMan or onFlare.sqs for detecting flares being used
and does FiredMan detect grenades
onFlare.sqs
wut?
does FiredMan detect grenades
yes. you could test it in literally 10 seconds in debug console instead of asking here
Operation Flashpoint: Resistance
I suspect added for a very specific mission where Troska has to grab an illegal weapon delivery on the coastline from the USA π
maybe i just enjoy your company
thanks for the help
my point was that it would save you time. how long did it take for someone to reply? 1.5 hours? yet the whole process of launching Arma, placing a player in 3den, writing a simple code like player addEventHandler ["FiredMan", {systemChat str _this}];, and executing it in debug console would take 1.5 minutes at most
Is there a way to set the RHS Ch47/Chinook (named ch47 for this) to be invincible except for its tail rotor?
Is
if (_tableName == "" || { _updateFields isEqualTo [] }) exitWith {""};
better than
if (_tableName == "" || _updateFields isEqualTo []) exitWith {""};
or it is just a myth ?
its a little bit better as the second statement will not be evaluated if the first is already true. this comes in handy when you have a simple statement and a performance heavy statement, eg
if (_tableName == "" || {count (player nearObjects worldSize) > 1000}) then {...
``` or if the second statement would throw an error:
```sqf
if (!isNil "_tableName" && {count _tableName > 0}) then {...
I got it thanks! π
Am I correct that if func have global effect and global context, it must be called only under if (isServer) { ... };?
it is safer indeed, yes
Or any other single run
Because I made radio via playSound3D and forgot about that and I have 17 simultaneous sounds, heh
OR, in the function you could havesqf if (!isServer) exitWith { ["This function must be called on the server"] call BIS_fnc_error };
no
this
it all depends on what you have in your function really
"just" a call from the client is possible if everything is global, but it can be seen a good practice to remoteExec on the server
it will be needed if you have server-only commands though
"ln.sqf" remoteExec ["execVM"]
I have this as a hold action on a laptop
I added it by 3den enhanced mod
if I put a hint "new markers added" in the ln.sqf
will it show for all the players, or just the played who did the push action
it will execute on all clients and server
actually connected*
forget about those lobby trolls π
thanks!
just as I wanted it to
hello guys, how does one upgrade a script to a function :
I have that line sqf pInf addAction ["GV","loads\ce\gv.sqf",[],1.5,true,true,"","",5]; calling this gv.sqf (used to swap loadouts quickly) ```sqf
private _unit = player;
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
_unit addWeapon "rhs_weap_hk416d145";
_unit addPrimaryWeaponItem "rhsusf_acc_g33_xps3";
_unit addPrimaryWeaponItem "rhs_mag_30Rnd_556x45_M855A1_Stanag";
_unit addWeapon "rhsusf_weap_glock17g4";
_unit addHandgunItem "rhsusf_mag_17Rnd_9x19_JHP";
_unit forceAddUniform "unif_SWEAT_ce_impact";
_unit addVest "6094_HEAVY_od";
_unit addBackpack "KIT_BAG_od";
for "_i" from 1 to 10 do {_unit addItemToUniform "ACE_elasticBandage";};
_unit addItemToUniform "ACE_EarPlugs";
for "_i" from 1 to 4 do {_unit addItemToUniform "ACE_tourniquet";};
for "_i" from 1 to 4 do {_unit addItemToUniform "ACE_CableTie";};
for "_i" from 1 to 10 do {_unit addItemToVest "rhs_mag_30Rnd_556x45_M855A1_Stanag";};
for "_i" from 1 to 3 do {_unit addItemToUniform "rhsusf_mag_17Rnd_9x19_JHP";};
for "_i" from 1 to 3 do {_unit addItemToVest "rhs_mag_m67";};
for "_i" from 1 to 5 do {_unit addItemToVest "SmokeShell";};
for "_i" from 1 to 4 do {_unit addItemToBackpack "ACE_plasmaIV_500";};
for "_i" from 1 to 6 do {_unit addItemToBackpack "ACE_splint";};
for "_i" from 1 to 5 do {_unit addItemToBackpack "ACE_epinephrine";};
for "_i" from 1 to 5 do {_unit addItemToBackpack "ACE_morphine";};
for "_i" from 1 to 20 do {_unit addItemToBackpack "ACE_packingBandage";};
_unit addHeadgear "Mohawk_Core_S_OD";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit linkItem "ItemWatch";
_unit linkItem "TFAR_anprc152";```
to which I'd like to add a call BIS_fnc_setUnitInsignia; but from what i understand from the wiki, i cant just add the call into the the gv.sqf and that's where i'm lost !
i cant just add the call into the the gv.sqf
you can
ain't addactions remote executed ?
no
oh ok thanks
So it's working on it's own but it doesn't work when there's a onPlayerRespawn.sqf with [] execVM "scripts\equip.sqf"; calling the lodaouts at respawn given selected role. equip.sqf is a switch looking like that ```sqf
private _unit = player;
if (!isNil("ce")) then {
switch (str(_unit)) do {
case "god";
case "god1": {_unit execVM "loads\ce\zeus.sqf"}; //god
case "grCdg";
case "sgCdg": {_unit execVM "loads\ce\cdg.sqf"}; //Cdg
case "grMed";
case "sgMed": {_unit execVM "loads\ce\medecin.sqf"}; //Med
case "sgBlCde";
case "sgGrCde";
case "grBlCde";
case "grGrCde": {_unit execVM "loads\ce\cde.sqf"}; //Cde
case "sgGvIng";
case "sgBlGv1";
case "sgBlGv2";
case "sgGrGv1";
case "sgGrGv2";
case "grGvIng";
case "grBlGv1";
case "grBlGv2";
case "grGrGv1";
case "grGrGv2": {_unit execVM "loads\ce\gv.sqf"}; //Gv```
Is execVM remote executed ?
Is execVM remote executed ?
no
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
nothing really is "remote-executed"; though if you check the command page (here https://community.bistudio.com/wiki/execVM) you will see these two icons
they mean here:
- Global Argument
- Local Effect β this is what you are looking for
in the example of e.g setDamage, executing it on one location has the effect broadcast to other machines (Global Effect)
I'm not sure that i got it : Local effect = remotely executed ?
β¦no.
I just said that execVM was not
see this section π
https://community.bistudio.com/wiki/Multiplayer_Scripting#Locality
@wild prairie you were right too! π
So remoteExec ain't remote executed because the code is locally executed on each client ?
β¦you are mixing things up, wait one
using remoteExec on a command with a local effect will make it run locally on each machine yes
depends on the target parameter
but tbh, the wiki page explains it well.
Just read it a few times
one PC executing normally a local effect command = "I'm doing this on my own, nobody shall know"
one PC remote-executing local effect command = "HEY Y'ALL! run this on your PC"
one PC executing normally a global effect command = "HEY Y'ALL! I'm running this command, and the engine will propagate it for me"
one PC remote-executing a global effect command = "HEY Y'ALL! I am running this command, it will be propagated by the engine, and you will run it too and the engine will propagate it again, multiplied by the amount of players!"
So executing normally only runs the script once (and transfer the RESULTS if the effect is global) while remote executing transfer the script first and let each pc gotta execute it by itself ?
I'm sorry i only kind of understand π
you've pretty much got it
I mean yes the concept is correct yes π
I just nitpicked in my head as "yeah it's not really transferring the script but telling the other to execute such command/function with passed arguments" π sorry, I am a bit "Friday-like" right now
ok
is there any way to make lightpoints visible during the day? i wanted to make custom tracers
the flare may have been fixed in a recent patch I am not sure
i tried, but you can only see the ambience during the day
was hoping maybe there was some weird way to get around it
negative, but maybe next patch π
would be cool to see
here is the ticket⦠@still forum wasn't it merged?
https://feedback.bistudio.com/T152896
3rd june, that will be in
have you used setLightFlareMaxDistance?
literally unplayable until then
yea i did, unfortunately no luck
I think he meant "was done on 2021-06-03 so should be in game already"
i will test some more real quick
lou knows how programmers talk
https://imgur.com/a/NO15If0 heres the same light at day and night, flare size and max distance are both 10
ok so i think i got this part. #arma3_scripting message up there equip.sqf (called by onPlayerRespawn.sqf) is remotely executed because I'm using execVM which has local effect but all players see me with the right loadout when i respawn. But given that onPlayerRespawn exetute locally execVM which has local effect, how come teammates dont see me naked when respawning ?
aren't you at more than 10m ?
set max distance to e.g 100
because what are you using in equip.sqf? global effect commands π
still nothing. setLightDayLight is also true
ah welp
blame
then π
mylight = "#lightpoint" createVehicle (player modelToWorld [0,2,1.5]);
mylight setLightColor [1,0,0];
mylight setLightAmbient [1,0,0];
mylight setLightDayLight true;
mylight setLightIntensity 100;
mylight setLightUseFlare true;
mylight setLightFlareMaxDistance 100;
mylight setLightFlareSize 10;
flare is completely invisible during the day π
private _unit = player;
if (!isNil("ce")) then {
switch (str(_unit)) do {
case "god";
case "god1": {_unit execVM "loads\ce\zeus.sqf"}; //god
case "grCdg";
case "sgCdg": {_unit execVM "loads\ce\cdg.sqf"}; //Cdg
case "grMed";
case "sgMed": {_unit execVM "loads\ce\medecin.sqf"}; //Med
case "sgBlCde";
case "sgGrCde";
case "grBlCde";
case "grGrCde": {_unit execVM "loads\ce\cde.sqf"}; //Cde
case "sgGvIng";
case "sgBlGv1";
case "sgBlGv2";
case "sgGrGv1";
case "sgGrGv2";
case "grGvIng";
case "grBlGv1";
case "grBlGv2";
case "grGrGv1";
case "grGrGv2": {_unit execVM "loads\ce\gv.sqf"}; //Gv
```
the switch do has global effect ?
is there no way to disable terrain grass without lowering terrain resolution?
TAW_VD as mission script, works wonders
need ticket with repro, or someone to revive the old ticket and get me to fix it.. basically do something so that I don't forget about it
sorry can you elaborate?
is that a mod?
It's a script that allows to change settings in missions (works in mp with or without ace) there sa script version to add in missions folder but it also come as a mod (if my memory serves me right
Eden enhanced
eden enhanced has an integrated version of that?
Yea
where?
thanks anyway
may i rexplain the problem from the start I think i got lost ?
just re-read the conversation? π
mhm it doesn't seem to work I get a weird error
y
execVM β calls another execVM β etc β which scripting commands are used, in the end?
afaik no
my lightpoint flare bug report https://feedback.bistudio.com/T163387, hope to see it fixed soon
it can be merged with mine actually
also i was playing around with bullet velocities, and multiplying a bullets velocity by a large amount, (say around 10), will send the round in a seemingly random direction. Why does it do this? I wanted to have a near hitscan round, but they dont go straight at all
code?
either you're multiplying it wrong, or your velocity exceeds the newly implemented max velocity limit
I don't remember what it was tho. maybe 5k?
player addEventHandler ["Fired",{
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
systemChat str vectorNormalized velocity _projectile;
_projectile setVelocity ((velocity _projectile) vectorMultiply 10);
systemChat str vectorNormalized velocity _projectile;
}]
the normalized velocity vectors are different with a multiplied velocity of 10
then yeah, you're exceeding the limit
@still forum do you remember what you set the max velocity to?
I'm not sure what it was.
It should be added to the wiki 
i can test it, where do i find the velocity of the projectile in the cfg? the weapon or the ammo?
neither
mag
but you can just do vectorMagnitude velocity _projectile in the EH
@night sundial #perf_prof_branch message
yeah, it's 5k
oh well. i did notice that while setting the bullet speeds very high that you can shoot an mx through an h-barrier, which i thought was interesting
just cap it to 5000 and you'll be good
well i was hoping for a bit faster but that might be alright
_speed = 5000 min (10 * vectorMagnitude _velocity);
_newVel = vectorNormalized _velocity vectorMultiply _speed
also 5km/s isn't low
it's + mach 10 (roughly Mach 15)
i wanted to point my maaws at a jet and blow it out of the sky without leading it
also i will have to update the speed very often because of drag
then just put the projectile right next to it
lineIntersectsWith has a max distance of 1km so i cant really put the round exactly where i'm looking
lineIntersectsSurfaces is what you should use
and its limit is 5km
also these limits are per single intersection check
you can break the distance down and check multiple intersections
will keep that in mind
terrainIntersectAtASL works past 5k, but obv is useless for trying to hit an aircraft.
the primary reason I suggested lineIntersectsSurfaces is because you can specify the lod
all other intersect commands don't have a lod parameter
afaik they only check the VIEW lod
my fix for my tracer issue is to attach a cmflare to the round. While very smokey, it actually looks very badass
player addEventHandler ["Fired",{
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
private _flare = "#lightpoint" createVehicle getPos _projectile;
_flare attachTo [_projectile];
_flare setLightColor [1,0,0];
_flare setLightUseFlare true;
_flare setLightIntensity 40;
_flare setLightFlareMaxDistance 3000;
_flare setLightFlareSize 1;
[_projectile,_flare] spawn {waitUntil {isNull (_this#0)}; deleteVehicle (_this#1);};
}];
i was testing this at night since i can actually see the flares. I attach a light to the projectile, but the light disappears almost immediately? like when the round gets about 200m away, you lose sight of the flare
Hi, I'm creating modules for some Zeus utilities. It's great all the things you can do with modules, but I have hit a roadblock. For some modules, I need the associated function to run some code only on the client that placed it via Zeus (i.e. neither global nor server-only). Is there a way to do this, either in the module config or the SQF function?
Sample module config:
class my_modules_selectPlayer: Module_F {
scopeCurator=2;
curatorCanAttach=1;
category = "my_modules";
displayName = "Select Player";
function = "my_modules_fnc_selectPlayer";
};
Sample module function:
params ["_logic", "_units", "_isActivated"];
if (not _isActivated) exitWith { false };
// TODO: Exit if not client that placed the module! Also, can't just
// check if player is curator because there may be multiple curators.
private _selectedUnit = _logic getvariable [
"bis_fnc_curatorAttachObject_object",
objNull
];
selectPlayer _selectedUnit;
deleteVehicle _logic;
true;
Is there a way to set a helicopter with the variable name of Heli1 to be invincible except for its tail rotor?
HandleDamage EH maybe?
It returns the selection that was hit so if you figure out the name of the rotor selection, you can discard damage to anywhere else
Okay
Iirc, modules have an isGlobal attribute (0/1) for this purpose.
At worst case, slap a if (local _module)... at the start of your code to achieve it.
(In case you dont know, in zeus, who places an object becomes the owner of it thus the entity created becomes local to them)
well deleteVehicle will be global anyway, you can't delete vehicles locally, unless they were created with createVehicleLocal
how would I go about detonating the ATMine via script? Trying to recreate the bridge engineer scene from BF3 except im gonna use an addaction on a little computer
in zeus, who places an object becomes the owner of it
Great, this should do the trick. If that's true, then I should be able to make the module isGlobal = 1, then in the function check if _logic is local, which should achieve the desired effect of only continuing if on the Zeus client that placed it. Thanks!
createVehicleLocal would be useful too, but there's no way to do this via Zeus, right?
Should be just atMineName setdammage 1
maybe triggerAmmo will also work as that is its intended purpose i think
anyone got a idea why my music wont play? when i use sounds from a diffrent mission i made previously it works perfectly fine im just so confused
its in the right format and everything
we may need more details about this
one sec
{
sounds[]={OststurmFinal,tension};
class OststurmFinal
{
name = "OststurmFinal";
sound[] = {\music\OststurmFinal.ogg, +10db, 1.0};
};
class tension
{
name = "tension";
sound[] = {\music\tension.ogg, +2db, 1.0};
};
};```
this is what i have in the description.ext file and both the music files in the music folder within the mission when i listen to the oststurmfinal.ogg file it works perfectly fine but when i go into arma and try to get it to run with a trigger just silence
i tried messing with the audio volume on both the audio and description file
but nothing
the tension.ogg works perfectly fine
so i have no idea
only thing i could think of is use a diffrent programm to convert it to ogg instead of audacity
What command are you using to play these sounds?
playMusic "OststurmFinal";
Double check the paths.
Are they / Can they playing from the debug console?
doesnt work with playMusic nor with debug
only thing i can think of is maybe redo the audio incase it like bugged or something
#arma3_audio message
Make sure it is as mentioned above. It usually is the problem when nothing comes to mind.
ill try it once i figure out how to do it in audacity
Hello! Can somebody help me please? I made a script, that is supposed to lock/unlock a vehicle when the vehicle owner gives it an order to do so, and it is supposed to prevent other players from entering the vehicle and driving away with it, when tested on my own, it all works fine, even on a dedicated server, i spawn the vehicle, i can lock it, unlock it, and it pretty much does its job. But the problems comes, when there are actually more players. For my my car still works fine. But even if i lock the vehicle anyone else can still enter the seemingly locked vehicle, as well as drive it or steal inventory items, and they can even use the locking/unlocking functions. And of course i can enter their locked cars and operate the system. So this script just seems to work fine but in reality it totally failing in its job. Can someone help me fix that please? Thank you. ```sqf
_vehicle setvariable["fw_owner",player,true];
_vehicle lock true;
_vehicle lockInventory true;
_vehicle addAction ["UNLOCK", {
params ["_target", "_caller", "_actionId"];
private _owner = _target getVariable["fw_owner",""];
if (_owner==player) then {
_target lock false;
_target lockInventory false;
playSound3D [getMissionPath "sound\lock.ogg", _target];
};
}];
_vehicle addAction ["LOCK", {
params ["_target2", "_caller2", "_actionId2"];
private _owner = _target2 getVariable["fw_owner",""];
if (_owner==player) then {
_target2 lock true;
_target2 lockInventory true;
playSound3D [getMissionPath "sound\lock.ogg", _target2];
};
}];
Is it possible delete a particle source on a vehicle that is spawned?
say from an exaust of a vehicle?
Ask in #arma3_audio.
I doubt it is because the OGG conversion went wrong though.
Is your music volume turned down in Arma?
Have you added the working OGG's to your description.ext to test them?
@warm coral if recall correctly the format must 48000 hz, and in mono in order to work.
If its not you will have to re-record and or change it to 48000hz, and mono.
Also are the sounds in the correct location?
this worked thank you very much
41000hz and 16 bit
thats how i got it to work
why are you using player? whats the locality of this script? where are you putting it?
it is written in editor in the init field of an noticeboard, using player to identify the one who is triggering the action at that moment to check if he is the owner of the vehicle or not```sqf
this addAction ["Pickup", {
private _vehicle = createVehicle ["CUP_C_Pickup_unarmed_CIV", [3648,304]];
[_vehicle, true] remoteExec ["enableDynamicSimulation", 0];
_vehicle setvariable["fw_owner",player,true];
_vehicle lock true;
_vehicle lockInventory true;
_vehicle addItemCargoGlobal ["kka3_ace_extension_roadcone_l_f", 3];
_vehicle addItemCargoGlobal ["CUP_V_B_LHDVest_Yellow", 4];
_vehicle addItemCargoGlobal ["ACE_tourniquet", 4];
_vehicle addItemCargoGlobal ["ACE_elasticBandage", 5];
_vehicle addItemCargoGlobal ["ACE_fieldDressing", 5];
_vehicle addItemCargoGlobal ["ACE_packingBandage", 5];
_vehicle addAction ["UNLOCK", {
params ["_target", "_caller", "_actionId"];
private _owner = _target getVariable["fw_owner",""];
if (_owner==player) then {
_target lock false;
_target lockInventory false;
playSound3D [getMissionPath "sound\lock.ogg", _target];
};
}];
_vehicle addAction ["LOCK", {
params ["_target2", "_caller2", "_actionId2"];
private _owner = _target2 getVariable["fw_owner",""];
if (_owner==player) then {
_target2 lock true;
_target2 lockInventory true;
playSound3D [getMissionPath "sound\lock.ogg", _target2];
};
}];
}];
use _caller
really that simple? just rewrite player everywhere with _caller ?
can you elaborate a bit more please? i'm not catching up yet
hold on so is there any mistake with the set variable line?
its just not how I do it. you just have conflicting data types between the set variable and the get variable default later
but it shouldn't matter
well i wouldn't be doing this all in a init box for one lol, id be splitting this up
and yes, but ""==_caller and objNull==_caller is going to be false either way
well.... to be honest.... i actually did this for about 200 vehicles
why are you not just creating simpler functions instead?
and then you don't have to lol
i tried to learn it from wiki and i failed so i just did it the way i know since this way it also works... i just don't want to bother with questions that i can somehow solve on my own, still i think i ask too much
so the first thing I would try is changing player to _caller and the default for the getVariable from "" to objNull
understood, it seems like another busy afternoon with a repetitive activity
anyways that you very much for your help and your ideas
hopefully it will work this time because each test costs me money
if you did this and it worked for 199 other vehicles, what did you do differently for this one?
costs money?
it's doing the same for all vehicles
the script is identical for all 200 vehicle, they have just different classnames, spawn coordinates and these tiny details
whats this cost money ordeal?
i created this script, tested it in editor and it worked so i placed it into a dedicated server and launched it on my computer to see if it works and it worked but i couldn't test it any further so i assumed it works and did this for all the vehicles, and today i purchased a server rent at a hosting company to be able to actually invite my friend to the game to be able to test it in two people and what a surprise when we realised it doesn't ... so yeah every time i need a second player to test something, i have to pay for a server rent, otherwise we can not join to the same game
@hollow thistle negative sir, i don't have public IP address, my internet provider doesn't allow me to host any multiplayer session in any game
And how that blocks you from starting multiple clients on YOUR pc? 
overload, the computer wouldn't handle it, also i think that steam doesn't let you run 2 steam games at the same time
it does, I was literally testing with 3+ clients on my PC at times.
you can't launch from steam though, you gotta go by the .exe
is how i get around it auto shutting off with multiples
i never really thought about this possibility, on the other hand the server costs me about 9KΔ per day (+ - 0.37β¬ per day) so that's not a problem that i'm dealing with
so for next time, i would seriously consider how well your code scales up. right now, having to manually go through all 200 vehicle init boxes and change stuff is a problem with ease of scale, when you could store the classnames and positions together in either a variable or hashmap, make your functions with args and params, and send the vehicle through a function chain
It actually doesnt work for some people according to what I heard, weird thing.
I mean the "click again and again" part
thanks for your help, once i learn how to do that, i'll do it
just make a snip of code, and ask here how well it will scales up. we can help you with that before you time sink yourself
thank you
setDamage 1 didnt work, thanks tho
ill give that one a shot
what are you using to create the mine?
minefield module
give me a sec and ill look at it
basically tried
{
_x setDamage 1;
} forEach nearestObjects [getpos player,["ATMine"],15000];
but so far, with your help here i think i was able to create a great thing, because since i first dipped my nose into scripting for the very first time until now i was and still i am working on the very same arma mission, now it's been 2 years and the mission file has grown into a really big and very nice gaming experience, thanks to you @fair drum and some other people
also no bueno, thanks for the suggestion
testing something different
alright
here you go
allMines select {_x distance2D player < 500} apply {
_x setDamage 1;
};
is allMines a built-in method?
yes its an array of all the mines lol
Yes. It's a command.
ahhh gotcha, sweet thats convenient
runs faster than nearestObjects as well
How many times faster? π€£
awesome it worked, it was beautiful lol
let me put my character back together first
hey another question, is there a method to turn a vehicle unit into an IED? and how would I go about having said unit rush through whatever towards its target rather than the current ai I spawn in zues and turn into a vbied that likes to use traffic laws
in a bare editor field with mines placed and nearestObjects changed to accept all objects since its not going to pick up at mines anyways the way he was doing it...
Execution Time: 1.4280 ms | Cycles: 701/10000 | Total Time: 1001 ms
vs
Execution Time: 0.0911 ms | Cycles: 10000/10000 | Total Time: 911 ms
so... a lot of times
counts fingers
Aye. A lot.
It's amazing though.
There is always a faster way.
theres several ways, you could use unticapture to record the driving path and if you want you can use eventhandlers for if it gets destroyed that it explodes and that the driver has a holdaction to make it explode
any specific way you want?
Ah Hypoxic sent me a link to pretty much the same question I asked but elsewhere, where he answered and provided a script. I'm working on making that work now
Is there a way to loop an animation x amount of times guys
hello everyone , im a newbie, does anyone of you know, where are the textures for Land_Cargo40 containers ?
i found the .p3d but in the data i dont understand or cant find the skins
_animName = "Blablabla";
_repeat = 4;
_unit setVariable ["anim_loop_params", [_animName, _repeat]];
_unit addEventHandler ["AnimDone", {
params ["_unit", "_finishedAnim"];
private _animParams = _unit getVariable ["anim_loop_params", []];
_animParams params ["_anim", "_repeat"];
if (_finishedAnim == _anim) then {
_repeat = _repeat - 1;
_unit playMoveNow _anim;
if (_repeat <= 0) then {
_unit removeEventHandler ["AnimDone", _thisEventHandler];
} else {
_animParams set [1, _repeat];
}
};
}];
_unit switchMove _animName;
_unit playMoveNow _animName;
what textures?
lets say i want ot change from Land_Cargo40_grey_F the texture to Land_Cargo40_light_blue_F texture
shouldnt i find a paa of both of them somewhere ?
the textures are baked into the p3d
you can't change an object textures unless it has hiddenSelectionsTextures
these objects don't have one
it says _unit is undifined
define it then
uhhh im new to scripting .. sorry
_unit referrers to the unit you want to loop the animation on
It seems like task description and title cannot be properly localized when using the Task Framework ? (BIS_fnc_taskCreate)
my server is started in english, and it looks like all french players are seeing english strings in tasks created by the server
yes.
Translation happens where it's executed and is then send over to the client.
At least I think so. Would need to check the function.
isn't that inefficient and unconvenient ?
Anyone know if theres an event handler for opening the ace medical menu
Or a work around for it
https://github.com/acemod/ACE3/blob/master/addons/medical_gui/functions/fnc_openMenu.sqf
it doesn't seem they do 
actually nvm
Ah sweet
So its
ace_medicalMenuOpened
Thanks
Another question
Never really worked with CBA before but
player addEventHandler ["["ace_interact_medical_menu" ace_medicalMenuOpened] CBA_fnc_addEventHandler", {
_typeVeh = getText (configfile >> "CfgVehicles" >> typeOf vehicle player >> "vehicleClass");
if (_typeVeh == "men" || _typeVeh == "MenSupport") then {
[] spawn A3NV_fnc_ACEMenu;
};
}];
Would that work at all
no
Figured
even the syntax is wrong. how's it supposed to work?
idk tbh
First time writing a lot of this script
Worked for my inventory script
But that was a base game event handler
Never really worked with CBA before but
_medical = ["ace_medical_opened", ace_medicalMenuOpened] call CBA_fnc_addEventHandler;
player addEventHandler ["_medical", {
_typeVeh = getText (configfile >> "CfgVehicles" >> typeOf vehicle player >> "vehicleClass");
if (_typeVeh == "men" || _typeVeh == "MenSupport") then {
[] spawn A3NV_fnc_ACEMenu;
};
}];
Would that?
if you simply use syntax highlighting (Notepad++ or vscode with SQF syntax highlighting) you'll see why:
player addEventHandler ["["ace_interact_medical_menu" ace_medicalMenuOpened] CBA_fnc_addEventHandler", {
_typeVeh = getText (configfile >> "CfgVehicles" >> typeOf vehicle player >> "vehicleClass");
if (_typeVeh == "men" || _typeVeh == "MenSupport") then {
[] spawn A3NV_fnc_ACEMenu;
};
}];
Pretty much
["ace_medicalMenuOpened", {
_typeVeh = getText (configfile >> "CfgVehicles" >> typeOf vehicle player >> "vehicleClass");
if (_typeVeh == "men" || _typeVeh == "MenSupport") then {
[] spawn A3NV_fnc_ACEMenu;
};
}] call CBA_fnc_addEventHandler;
Ah I see
Thanks man
my brain was half thinking that would be it but first time branching into this shit I got no clue what I am doing half the time lmao
Is there a script for that defending AI doesn't move but with status custom buttons that you can "set them free"
Achilles has a garrison module if you set to 0 will make them stay and it has an un garrison module which lets them move again
OkΓ© thanks for the reply
Is there anyway I can do displayCtrl with and idc of -1
you already can
How
There are multiple -1's
then you have to filter them to get the one you want
class controlsBackground
{
class Title: RscText
{
idc=1200;
x="((1) * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2))";
y="((0) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))";
w="((38) * (((safezoneW / safezoneH) min 1.2) / 40))";
h="((1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))";
colorBackground[]=
{
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])",
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])",
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])",
"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"
};
moving=1;
};
class Center: RscText
{
idc=-1;
x="((1) * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2))";
y="((1.1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))";
w="((38) * (((safezoneW / safezoneH) min 1.2) / 40))";
h="((16) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))";
colorBackground[]={0,0,0,0.69999999};
};
class Bottom: Center
{
y="((17.6) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))";
h="((9) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))";
};
};
or if you created the display don't set the idc to -1
Trying to edit the ace dialog to be custom
And a lot of their stuff has idc's of -1
what are you making? mod or mission?
Mod
then just modify the class properties
change the idc
no
just modify the idc
read this if you don't know what I'm talking about:
https://community.bistudio.com/wiki/Class_Inheritance
Gotcha
how does one make a mod?
This is how you make a mod (An empty one, if you dont put anything else)
https://community.bistudio.com/wiki/CfgPatches
thanks
I've seen some music/sound placement mods for Zeus around, but I'm wondering if those are good templates for adding custom stuff of my own, or if there's an easier way to do it by hand.
Music/Sound mods are very , maybe the easiest type of mods among all config wise. (Of course not the sound creating or music creating part, just the config)
Well, that's encouraging. I already got a custom animation in without the game exploding, so maybe this will be easier 
Is there a method of detecting vehicle damage due to water? And using that to reverse it?
When using the Dammaged event handler, like so:
_vehicle addEventHandler ["Dammaged",
{
params ["_unit", "_selection", "_damage", "_hitIndex", "_hitPoint", "_shooter", "_projectile"];
hint format ["Shooter: %1", _this select 5];
}];
It gives <NULL-object> . This makes sense. But I can't seem to detect it using:
if ( _shooter == "<NULL-object>") then {...};
Anyone have experience with this?
objNull
isNull _shooter
and that would also filter collision/fall damage
Cheers! I feel a bit stupid; had simultaneously jus read this on the BIKI myself. Thank you for responding quickly. Will improve my Google-fu before asking a question next time.
no worries, at least you tried, that's the most important part π
hello, im trying to learn scripting and was wondering about this event handler
`{
_x addEventHandler ["Fired",{ _this spawn{
params ["_firer"];
{
_x setBehaviour "COMBAT";
sleep random [1.8,2.2,3.5];
} forEach (allUnits select {_x distance2D _firer < 200});
_firer removeEventHandler ["Fired", 0];
};
}];
}forEach allUnits;`
the script works about how does it know what "_firer" is?
Weird question here
But im noticing stuff like this
x="((7.5) * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2))";
but when I do safezones in GUI editor I get lines like this
x = 0.442735 * safezoneW + safezoneX;
Just wondering what the diff is
if any at all
@bronze temple #arma3_gui
_firer is the first param that is given to the "fired" event handler. the full params are this:
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
he just happened to change _unit to _firer
when the fired event handler goes off, it stores all of the above info in an array to the event handler which you can access by using params
Those equations are for "Grid" coordinate system. See the wiki
Also that code has been generated using macros. No one actually writes it like that
"<NULL-object>" is a string. _shooter is an object. obviously they're never equal (also == can't compare between different types)
is there a scripting command to make a preplaced ar-2 darter not be able to be packed back up?
enableWeaponDisassembly
tried, doesnt work
it does hide the "Disassemble Darter" or whatever action. I'm not sure what you mean by "doesn't work".
If you mean disassembling them via scripts, yes, it doesn't work for that
clarification: itdoes hide the disassembly prompt on foot, but getting into a vehicle close enough to it the disassembly is useable from the vehicle
it's a bug. report it on feedback tracker
Hello all
Im trying to make other factions spawn using the SPAWN AI module.
trying to use code in the init field of the spawn ai module
this setVariable[ "side", "resistance", true ];
this setVariable[ "faction", "IND_C_F", true ];```
but this is not working and says its not valid
could i also give these groups waypoints instead of using the sectors?
How to parse "hidden" vehicles in mod set?
_configs = "getNumber (_x >> 'scope') >= 2" configClasses (configFile >> "CfgVehicles");
_classNames = _configs apply {configName _x};
copyToClipBoard str _classNames;
hint str _classNames; _classNames```
i can play mission with "rhs_btr_80_vdv", but i can't parse it
Cut from parse list 14553 lines
...
rhs_bmp3mera_msv
rhs_brm1k_tv
rhs_brm1k_tv_b
rhs_brm1k_tv_g
rhs_btr60
rhs_btr60_b
rhs_btr60_g
rhs_btr70
rhs_btr70_b
rhs_btr70_g
rhs_btr80
rhs_btr80_b
rhs_btr80_g
rhs_btr80a
rhs_btr80a_b
rhs_btr80a_g
rhs_casing_105mm_m14b1
...
the "list" you get from the config is not necessarily sorted tho
are you sure it's not there? how did you check?
got answer - just use 1 instead of 2 in (_x >> 'scope') >= 2
I'm kinda lost
with 'lineIntersectsSurfaces' command, which LOD should I use? Where can I find what's the difference?
depends what you want to do. see:
https://community.bistudio.com/wiki/LOD
if you want to check visibility -> view
if you want to check object collision -> geom
if you want to check projectile collision -> fire
I think you'll understand the diff with an example:
you (and AI) can look through a window (no VIEW intersect), but you can't pass through it (GEOM intersect). and a bullet may pass through/damage a window (FIRE intersect)
because side can only be one of "West", "East" and "Indep"
Thanks a lot.
i play with unit switch a lot. i like the previous unit to keep its watch direction where i left it, but it feels like that doesn't work. _directionwatch = unitAimPosition _previousUnit; _previousUnit doWatch _directionwatch;
they react to sights, thats fine. but i like them to return to their watch dir
Hey I've got a quick question: Since everyone but the dedicated server is supposed to execute initPlayerLocal.sqf, what exactly happens when I put a scripting command (such as addCuratorEditableObjects) with Server Execution in there? Will it still be passed to the dedicated server or is it simply being ignored?
ignored
the command will say "oh, I should run that! am I the server? nope, so none of my business"
(otherwise it would be run X times, the number of players)
there is initServer.sqf, if you want - works for both dedi and hosted servers
Jup, thanks. Just wasn't sure where to put it. An additional question: Say we want to add a newly created player object via addCuratorEditableObjects, how do I add it in initServer.sqf, since I can't use the variable player in there, such as in initPlayerLocal.sqf
I do not understand the question
Sorry, maybe I was unclear. I've got curators in my mission and I want to add player objects of newly connected players to the Zeus Interface with the command addCuratorEditableObjects. How to I get the newly created player object? I cannot find an Event Handler that returns such a player object.
you can use onplayerconnected mission EH perhaps, and wait until the player disconnects or has a "player" unit
Thanks, I'll try that out!
Hey there!
I have a mission I'm currently making where I'd like to have 3 smaller tasks complete one task when they're all completed
What do I do in order to do such? I assume it is a trigger synced to the three smaller tasks, but I dont know what to put in that trigger to do what I want it to do
I tried to have a trigger that complete the final task by having all the smaller task triggers be named trigger1-3 and having this on my finall trigger, but it did not work:
triggeractived trigger1;
triggeractived trigger2;
triggeractived trigger3;
Missing semicolon somewhere? Idk I dont script very often
you mean triggerActivated
Hi all, I'm having issues with getting fog to work in a dedicated server. In the mission's intel tab, I have the fog set to 90% with a forecast of 50%, and in a trigger I have 0 setFog [0.9, 0, 0];1800 setFog [0.5, 0, 0];
Both the weather settings and the trigger script work in singleplayer and in listen servers, but on a dedicated server there is no fog at all. Are there any rules I'm not aware of but should be? Like, does decay=0 not work on DS? What's the epsilon value for decay - AKA how low can it go before the engine considers it the same as 0? I need fog to be practically the same at all altitudes
just use 0 setFog 0.9 then
since setFog should be run on server, make the trigger server-side, not player-linked
or last hope, use remoteExec
Wait, really? I assumed setFog would only change the density value. Let me try that..
I did it with the stackable EH "PlayerConnected", works just fine! Thanks a lot @winter rose
So I tried this but it did not seem to trigger the trigger after I triggered the other three triggers
Β―_(γ)_/Β―
I cry
Thanks though
I did it!
I made it so a trigger would detect if a task is completed, and if it did it would change a global variable
Then the final trigger would detect if all three variables were true
So i got a problem:
I'm trying to set up a trigger, which triggers a pop-up-target, when you walk through it:
Got this from online
this animate ["terc", 1]; in the target
and
TargetSofa setDamage 0; TargetSofa animate ["terc", 0]; this in the trigger, with all configurations and the correct variable name in the target.
The Target even goes down, but the trigger wont do anything. I've even tried having it play a sound without results.
dont need a condition if its just about a player walking through, right?
is it set to "anything - present"?
it does not automagically know it should trigger on player's presence
well yeah
what's the trigger condition?
do i need one in that case?
just asking what it is. is it this?
and yes, you always need a condition
this
it's this by default... 
I mean unless you changed it ofc
So I got a question about making an addon, I have a FSM file I would like to make into a WorkShop Item as a addon / module to be placed on the map. However I got no idea on how to proceed.
Currently I got a couple of scripts ready for testings sake (just to learn the process).
/*init.sqf*/
waitUntil{time > 5};
systemChat "hello [P]";
[] spawn Tally_Fnc_chatSpammer;
``````c
/*Description.ext*/
class CfgFunctions
{
class Tally
{
class testFunctions
{
class chatSpammer {};
};
};
};``````sqf
/*Fn_ChatSpammer.sqf*/
while {sleep 10; true} do {
systemChat "this is a test";
};
This will send a hello message, and then send a message every 10 seconds with the content "this is a test"
How would I go about turning this into a mod?
https://community.bistudio.com/wiki/CfgPatches
No more description.ext but config.cpp of course.
And your init.sqf would need to be a separate function defined in cfgFunctions with preInit = 1 to automatically start working upon start of each mission.
Ok i'll write that (and then probably come back with more questions)
I'm working on making a mind control script and I'm running into an issue with the AI that takes over the player. For some reason the AI around the victim (they are looking away) spot and start shooting at the victim first. I'd like for the victim to immediately start shooting the units around them but I'm hitting a wall with figuring out how to do so.
_victim = player;
_cfsSide = east;
if!(local _victim)exitWith{};
if(isPlayer _victim)then{
_grp = createGroup (side group _victim);
_dummyUnit = _grp createUnit [ (typeOf _victim), [0,0], [], 0, "CAN_COLLIDE"];
_dummyUnit enableSimulationGlobal false; //Creating dummy unit to place under players control
_dummyUnit allowDamage false;
_dummyUnit hideObjectGlobal true;
_dummyUnit setPosATL [0,0,1000];
_victim setVariable ["DummyUnit",_dummyUnit];
selectPlayer _dummyUnit; //Removing players control over their unit
switchCamera _victim; //Player camera goes back to body to simulate being in their body with no control
_victim addEventHandler ["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
_dummyUnit = _unit getVariable ["DummyUnit",objNull];
selectPlayer _dummyUnit;
[_unit] joinSilent group _dummyUnit;
_dummyUnit setDamage 1;
deleteVehicle _dummyUnit;
_unit removeEventHandler ["FiredNear", _thisEventHandler];
}];
};
sleep 1;
_grp = createGroup _cfsSide;
[_victim] joinSilent _grp; //Changing side to make hostile
Use setCaptive for the process. This will make all AIs ignore this unit.
Group change process may take a while, and since the AI update of 1.68 (iirc), they sometimes require an additional order to update "relations". That might be the reason that it is not attacking "instantly", simply issue an order. (Such as addWaypoint, which I know it works or used to work at least) My experience with this was on changing side diplomacy but maybe it affects change of group the same way for units so I am not sure if it is the same reason.
Ty for the help it works perfectly!
I guess Chernarus (Summer) just doesn't allow any fog of any type, because all the commands and even Zeus modules I tried were instantly reverted to 0 fog by.. something. Thanks for trying to help, though π
You probably have a mod on that is overriding the fog settings
So I got it set up now, however upon starting a mission, nothing happens.
/*config.cpp*/
class CfgPatches
{
class MyAddon
{
// Meta information for editor
name = "Test Addon";
author = "Tally";
requiredVersion = 1.60;
requiredAddons[] = { };
units[] = {};
weapons[] = {};
};
};
#include "cfgFunctions.hpp"
``````c
/*cfgFunctions.hpp*/
class Tally
{
class testFunctions
{
class chatSpammer {};
class MissionInit {postInit = 1;};
};
};```
```sqf
/*Fn_MissionInit.sqf*/
systemChat "hello [P]";
"hINT SIIIR GO TO WORK" remoteExec["hint", 0];
[] spawn Tally_Fnc_chatSpammer;
``````sqf
/*Fn_chatSpammer*/
while {sleep 10; true} do {
systemChat "this is a test";
};
I did export it using the addon-builder and publisher from A3 tools
First of all, do you see your addon loaded at bottom?
no
Should I look into the RPT file?
I do see it loaded tho when launching the game
no , it means u couldnt load the mod. Btw you dont need publisher or something... Are you sure u didnt forget to load the mod in a3 launcher?
However no messages are displayed on mission-start
yeah I subscribed to it from workshop
then selected it from the list of available mods
no u shouldnt do it like that...
Oh?
Ok just did it
ok does it return any error upon loading it into launcher?
or is it green light?
if it is green light, then check in game on main menu, if you see a Puzzle icon with your mod's name on it
Is CfgDisabledCommands enforced by each client, if so does that mean its vulnerable to exploit?
you can choose where its disabled
I know you can choose whether the client, server, or HC can use the command. I was just curious what the actual mechanism was to prevent the command from being used
i believe it disables the execution of the command after the preinit phase
If it doesnt work as expected then, simply put systemChats around , see if they work. Check if all functions are read by checking the functions viewer. for example in comment u simply wrote fn_chatspammer and not fn_chatspammer.sqf
Does anyone have any experience with having OPFOR Spawn and paradrop out of a vehicle
Yes?
Is there a script that forces an AI driver go straight to a waypoint
setDriveOnPath
With a ; at the end?
What
Thats a script?
https://community.bistudio.com/wiki/setDriveOnPath
It is a command indeed
Blah it doesn't work on boats
you can delete the waypoint? what is the use case here
A landing craft to go straight to a waypoint. Without turning and blocking the paths of others
Use domove
YourVehicle doMove position
And take a look at disableAI
Set it to careless
BIS_fnc_recompile
you can set (atm) allowFunctionsRecompile = 1; in description.ext, and recompile in Functions Viewer from the pause menu
you can make it recompile a specific function
[mode] call BIS_fnc_recompileParameters:
mode (Optional, default 0):String - **name of the function to be recompiled**
name
next patch (or in dev branch) you don't need it
quick question: how do i increase a mission file's ambient temp?
cuz the thermals arent working properly and everythings too dang dark
temperature depends on the terrain, and time of year
frick
found this on the biki https://community.bistudio.com/wiki/ambientTemperature
what can i do with this?
nothing. it's a getter. not setter.
how do i make a group join another group?
join and joinSilent
[ai1] join player; ai1 enableAI "move"; ai1 setCaptive false;``` works but only for 1 person, doesnt work for tje whole group
ignore other stuff, its just so they dont move
oh, how do i make it a group?
group [ai1] or [group ai1]?
or group ai1?
units ai1 join group player
okay, thanks
what about the other two commands? do i also add the "units" to it or leave it as it is?
you need loop
huh?
see forEach
i'm not really good at coding, can i just get the command/alternative?
{
_x enableAI "move";
_x setCaptive false;
} forEach units group ai1;
units group ai1 join player;
thank you very much
joining should be done after, no?
yeah maybe. i only did it in the order i read it
it works now, thanks
Hey, I'm having some problems trying to iterate through a list of config classes. Say I wanted to collect a variable from a list of classes in the config files and I know where they are, I just need to go through each of them and collect the same variable in each.
I've found I can't just navigate to the place in which the classes are and use that as a parameter in a forEach loop. It gives an error and says it expects arrays and not configs so how else would I go about it?
Thanks in advance!
can you show your code?
Yeah here it is:
private _supplyDropsConfig = (missionConfigFile >> "gamemode" >> "supplydrops");
private _crateTypeArray = [];
{
private _crateType = getText (_supplyDropsConfig >> _x >> "className");
_crateTypeArray pushBack _crateType;
} forEach _supplyDropsConfig;
Trying to make a save system in Mike Force and it technically already works. I just wanna make it work with potential expansions to MF in the future as well.
you can't iterate over configs using forEach.
use configClasses or configProperties
private _supplyDropsConfig = (missionConfigFile >> "gamemode" >> "supplydrops");
private _crateTypeArray = "true" configClasses _supplyDropsConfig apply {
getText (_x >> "className");
};
Ah alright I'll give it a try thanks a ton!
how do i make a trigger that activates when the group (ai0_1) is in a specific vehicle?
units ai0_1 findIf {!(_x in my_vehicle)} < 0
my_vehicle stands for variable name of the car i want to check?
also, < 0 means more than 0, but i want the whole group to be in a car. so it would look like that?
units ai0_1 findIf {!(_x in my_vehicle)} == units ai0_1```
isn't that obvious enough already?
yeah, sorry
< 0 means more than 0
wat...?
< 0 means less than 0
i want the whole group to be in a car
what I wrote already does that
god, im terrible at coding
what that code does is it finds if any unit is not in the vehicle, and returns its index, which is 0 or greater if found.
if not it's less than 0
so less than 0 means all units are in the vehicle
So that domove. Where do I apply it?
To the driver or a waypoint?
Does anyone know how I can add quests to my Altis Life RP map made by tonic? I want to give some action over there
when i put armed boot on mada with their functions they appear without weapons, unequipped
I have set up a Blufor Present trigger in my mission and connected it to both a Set Task State and Create Task to cancel previous task and start new one.
In testing when a blufor unit enters the area nothing happens
Why is this?
the same is happening to me
I've been trying for weeks, I don't see an explanation for this. I imagine that in the script if we are talking about the same map made by Tonic, that there is a block in the script, I've looked everywhere but I don't think
You mean Cytech?
Dave Tronic is one of the devs
Really need some help with this if anyone can
type="mil_arrow2"; colorName="ColorBlue";
What is regular expression to find every type marker classname in mission.sqm
using regex:
notepad++ or visual studio code?
Something like this? But i can't write correct syntax
type="(.|\n)+?"; \n
colorName="(.|\n)+?"
if i just find
type="
there will be thousands of
non-marker type objects
Dmitriy, would you happen to know a script that detects changes in a turrets ammo count?
I am completely lost without the presence trigger working
@south gale
vehicle player addEventHandler ["Fired",{
_this spawn {
if (
_this select 5 == "rhs_mag_M829A3" or
_this select 5 == "mkk_125mm_SABOT_MAG" or
_this select 5 == "mkk_1Rnd_KE_shells" or
_this select 5 == "mkk_mag_bm25_2_1" or
_this select 5 == "mkk_1Rnd_85mmHEAT_D5" or
_this select 5 == "mkk_1Rnd_105mm_HEAT_MP_T_Green")
then {
private _sound = selectRandom ["wolf1", "wolf2", "wolf3"];
playSound _sound;
playSound _sound;
sleep 6;
vehicle player addMagazineTurret ["rhs_mag_M829A3",[0]];
vehicle player addMagazineTurret ["mkk_125mm_SABOT_MAG",[0]];
vehicle player addMagazineTurret ["mkk_1Rnd_KE_shells",[0]];
vehicle player addMagazineTurret ["mkk_mag_bm25_2_1",[0]];
vehicle player addMagazineTurret ["mkk_1Rnd_85mmHEAT_D5",[0]];
vehicle player addMagazineTurret ["mkk_1Rnd_105mm_HEAT_MP_T_Green",[0]];
reload vehicle player;
reload player;
}; };}];```
this is example if abrams tank fired a shot, after 6 second gun will reload
@south gale what exactly your problem?
Just that the presence trigger isnt working on a single player mission I'm working on
Its necessary in order to finish the mission
@south gale https://youtu.be/RWHh9z6cCwo?t=601
