#arma3_scripting
1 messages ยท Page 769 of 1
If the documentation for handleDamage is correct about only the last EH in the chain having its return value counted, then this will probably break MGI anyway and you should do the same thing (spawn + sleep) except with the hit EH.
[] spawn {
sleep 2;
if (lifestate player == "INCAPACITATED" ) then {
hint "You lost 5 Campaign points!";
[]execVM "points.sqf";
sleep 3;
};
};
nil;
}];```
this seems to be working with MGI
I suspect the docs are wrong and it's the last EH that returns a value that's counted, not strictly the last EH.
EHs are executed in the order they are added
Don't forget to set a variable so that if the player repeatedly takes damage while incapacitated the score doesn't drop
maybe a waitUntil that just runs within the spawned code to reset that variable?
another installment of 'useless sqf' by dread, a command that guarantees a player closes the game eventually:
(allControls findDisplay 0) apply { _x ctrlEnable false; };
That's just evil man
Lol
They probably end up sending a ticket to the devs
Then devs will come frying you here
would love to see that in the FT "couldn't click on anything on main menu" hahah
LOL
Can you delete the controls?
Or you could just change everything in the menu to the kajmain map icon
I have to try it now and see what it looks like
Making the player freak out and do integrity check
Yeah icon is in the config
I presume you already know
you can't use ctrlDelete but you can do _x ctrlShow false and it breaks the game way faster and funnier haha
You could also be extremely evil and give someone an epileptic seizure by changing the colors constantly
Why would you use the Kajman icon when you could use "\A3\Characters_F\Heads\Data\m_Miller_co.paa"
Oh dear god how did I forget
If somebody ever makes an arma 3 horror scenario for some reason, this is a very good jump scare
unfortunately you can't change control style with sqf commands so the picture wouldn't show
Well can you change color?
yeah you can change all kinds of colors, but when you pause or leave a game then it's stuck on that color
Damn
Thought I can give someone an epileptic seizure
Well can you move the control location?
It would be funny to flip the whole UI
Playing arma in Australia
Yeah I started looking into all this just to help somebody on the forum but unfortunately I couldn't figure out how to extend the sqf running past pausing the game or going back to menu
I'm still confused as to why some commands are required to run on the main menu
Like how will I run them on the main menu
haha yeah you could randomize the position and height/width
But can't change position?
Sad
No you can
It would be funny to flip the UI then
as long as there isn't a script that changes it back when the dialog opens, but there probably isn't
reason I mention that is because the pause menu enables all controls when you open it, so even if you disable one then it is re-enalbed when you open the menu again
Yeah expected
It would be pretty unpleasant if missionside scripting could cause permanent damage to your game outside that mission
That's why we need to handicap them from ever resetting it
There is many scripts that do that
Unfortunately
hoho boy, then let me tell you about profileNamespace
Lol
one guy bluescreened me one time
and caused my user file to corrupt
^ profileNamespace fuckery
I hope that is banned on pub zeus
I hope
well its not because that's where he has done it
I think you'd have a hard time arguing that you need profileNamespace ability in public zeus lol
maybe they should disable it?
yep
I know certain guys who use it to crash people
it'd be pretty ahrd to believe that someone is going to paste in an entire mission into the debug lol
well
thing is
pub zeus you can execute commands using compositions
on some public zeus servers
is debug console still available in pub zeus? i haven't been able to access it lately even with the parameter enabled
oh dear
ROLF
i'm dying
hahah
lol
public zeus has a lot of restrictions
but profilenamespace seems to not be one of them
if they let you run raw sqf, you can also just save code to your profileNamespace then call it whenever you want
call (profileNamespace getVariable ["MyMalScript", {hint "where''d it go?"}];
inb4 a pub admin uses it to make a blacklist that auto kicks
well you can save your own code in a composition
instead of an sqf file
i don't think you can run sqf files
still gonna need my steam64 id ๐
i mean
getPlayerUID doesnt work on pub zeus?
use allplayers and getPlayerUID
it does
no I mean you'll need my steam id beforehand otherwise I have to join your server before you can create an auto-kick
well thing is
you can create a composition to drop on a player and append their id to the list
zeus servers restart when there is 0 players
so as soon as everyone leaves
the EH will get deleted
along with all code executed
bohemia devs, campaignNamespace when
I personally
would just turn everyone I hate into a dog
_objplayer = _this;
private _pos=[_objplayer, 1, 50, 12, 0, 20, 0] call BIS_fnc_findSafePos;
if (_pos isEqualTo []) exitWith {systemChat "FAILED TO START DOG"};
private _dog = createAgent ["Fin_random_F", _pos, [], 0, "NONE"];
_dog setVariable ["BIS_fnc_animalBehaviour_disable", true];
selectPlayer _dog;
private _show = "camera" camCreate [(getPos _dog) select 0, ((getPos _dog) select 1) -1, ((getPos _dog) select 2) + 1.4];
_show attachTo [_dog, [0.227, -0.15, 0.14], 'head', true];
_show switchCamera "INTERNAL";
lol
i had some dude be all condescending and rude to people because they weren't up to speed on his military roleplay stuff and he was super serious
that very day i made a composition to make the nearest player start dancing and grooving
lol
so next time someone gets too serious they bust a move
ok if I ever make an awesome mission and have servers for it, I'm going to put a timebomb in it. On 4/1 when you join it spams rickrolls in your browser every time you try to do anything
well
what will you use to open the link
I thought you had an involuntary way
or you can make a popular composition and update it to spawn an scp-173 esque entity in the distance
actually i have said too much
I thought it was involuntary? idk it's been a long time since I've seen that control
I'm not sure either never used it tbh
well I do have a popular composition
make it randomly pop up that miller thing occasionally
you know that big stone head model?
nope
my personal favourite placeable items are a Jaw Statue that always looks at the nearest player, and a traffic cone that physics yeets anyone who comes near it. Oh, and the "do not press" button that kills you, launches you, and tells everyone you pressed it
the moai head thing from tanoa
i made an "arsenal" that sets off a car alarm when you touch it
lol
yeah
I know it
i think it has an easter egg in apex campaign too
emits a weird sound when you get close to it
mine is a flying submarine
I use it to horrify players
Eh, you don't need a composition for that. Just spam spawn Proteus a few times and you'll get plenty of flying subs
I wonder if there's any interest in a driveable(boat...able?) Freedom
i attach it to a drone
well its easy to do
isn't it?
I don't know how easy, but certainly do-able with sqf
put an AI in a boat and attach the freedom to it, remoteControl whenever a player wants to sail the thing?
Oh no, that's half ass, I intend to whole ass my implementation
you will run into a problem where any object on the carrier will get yeeted
or blown
The only thing I'm unsure of is what happens if I teleport a player inside the model, I had an idea of making the inside of Freedom somewhat walkable if possible
and if you know the classname you can just...spawn it with createVehicle, dlc or no...I should buy jets
so the freedom is basically dissected into parts
i think as long as you keep your stuff in a single part it will be walkable
I'm just not what the games current "inside a wall" physics will do. Reversed controls is really weird and usually I end up stuck way further in rocks n stuff before I remember how to get out
i tried once walking inside the freedom and it worked
until I hit a wall of the next part
Interesting, maybe weird collision areas?
I'm sure it would be way easier to actually add Freedom with proper configs/etc as a mod, but then you'd have to install it and that's just not what I'm about
Freedom is cut up like that because it's larger than the largest single object the game can handle
No its dissected for the reason above
Into like 12 parts
But every part is large enough anyways for a compartment
it's pretty funny when you delete a part while someone's standing on it
Yep lol
Or when a jet wants to fly
You just delete the catapult
is it possible to add an action to an terrain object via it's ID?
_nObject = [0,0,0] nearestObject anyID;
_nObject addAction ["a useless action that does nothing", {}];
unfortunately it does not add the action, any way to get it work?
i'm pretty sure terrain is simple objects
https://community.bistudio.com/wiki/createSimpleObject
a possible workaround is to createVehicle something else and add the action to that
_nObject = [0,0,0] nearestObject anyID; ```
If this is the actual code you're using, keep in mind that `nearestObject` has a hard limit of 50 metres range - range from position [0,0,0] in this case. So if you're more than 50m away from [0,0,0] it won't even find the object. And `anyID` has to actually refer to a valid ID, obviously.
Another workaround you can do is to hide the original object with the Hide Terrain Objects module and replace it with an Editor-placed equivalent, which you can do stuff to more easily.
That's what I actually do, but because there are so many objects, I get fps drops
what are these actions doing?
you need to simplify it somehow so theres less
perhaps consider "reversing" the action; add action to the player and only show it when player looks at some object
player addAction ["action", {}, nil, false, true, "", "typeOf cursorTarget == SOMECLASS"];
Ah yeah I remember that being a problem, some terrain models don't actually have classnames. In that case you should still be able to do str cursorObject and maybe parse the text to get the p3d file
name
you can just use getModelInfo
the downside is that you must look EXACTLY at the object
iirc its GEOM lod 
not 100% which lod cursorObject uses
or maybe FIRE
ah thanks nice with that command
True you have to be alittle more strict with wher eyou are looking, but with all the gained performance you could even use a combination of nearestObjects and getRelDir to make some kind of faux FOV or vision threshold
just tried it and it worked via getModelInfo the object is very big
would i gain any performance if i hide or if possible delete all terrain objects outside the a mission area? the map is huge but the mission will only play on a certain area.
less rendering so maybe
Yes
Thank you, I didn't think about that. It seems that the script runs multipile times indeed. Deducting too many points.
Using this code now but it runs too many times it seems:
[] spawn {
sleep 2;
if (lifestate player == "INCAPACITATED" ) then {
hint "You lost 5 Campaign points!";
[]execVM "points.sqf";
waitUntil { sleep 1; lifestate player == "HEALTHY" };
sleep 20;
};
};
nil;
}];```
set this flag in global namespace and reduce points by detecting swap "HEALTHY" -> "INCAPACITATED"
and remove spawn and sleeps, you dont need it)
Sorry, not an expert in scripting. How would I do this pls?
Not sure how to flag in global namespace?
if now - "INCAPACITATED", but last was "HEALTHY"
then reduce points
i am not sure about is HandleDamage working when you heal, if not, add HandleHeal handler to set this flag to Healthy back
just name your variable without _
How would i check this in an IF clause?
Is there a command to format a number to string with leading zeros. I want to use getDir and always display all three digits but fill up with zeros if getDir < 100
https://cbateam.github.io/CBA_A3/docs/files/strings/fnc_formatNumber-sqf.html CBA can do it if you have it
but theres no command for specifically that
you can't delete terrain objects
so no, no performance gain
even if you could, you still wouldn't get any performance gain
the game automatically streams terrain objects
I remember doing that once
It doesn't help those with high shadow distance??
High shadow distance is still not all that far. Only like 400m IIRC
Does anyone know what is wrong with the syntax?
player addEventHandler ["HandleDamage", {
if (_hold == "false") then
{
setVariable [_hold, true];
[] spawn {
sleep 2;
if (lifestate player == "INCAPACITATED" ) then {
hint "You lost 5 Campaign points!";
waitUntil{!(isNil"dmpCVP")};
waitUntil {lifestate player == "HEALTHY" };
dmpCVP = dmpCVP - 5;
sleep 5;
hint "Test!";
setVariable [_hold, false];
};
};
};
nil;
}];
Although deleting trees in Stratis did help my performance a lot
Trees have transparency and motion, there's usually a lot of them in one place, and they add plenty of AI complexity, so they can be a performance drain (cough Livonia cough). But removing objects will only affect performance if you do it close in. Removing objects a long way away, that are never seen or are always obstructed, won't help much because the game is already not rendering or thinking about them (occlusion culling/view distance/dynamic simulation)
Well tbh he is not going to need the houses
So does not hurt to remove them
Might add 1 fps
Lol
you can't delete terrain objects so I have no idea where you got that performance gain from 
maybe you hid them
setVariable can't be used like that
it's a binary command
you need to specify what you want to set the variable on
also, you should put the variable name as string
and no need to set the value to as bool (true/false)
save the script handle directly, and check that to prevent spawning new codes
is it possible to make a unit not be able to stand? i did this and he can still stand and walk,
unit setHitPointDamage ["hitLegs", 1];
how would i make him prone only?
setUnitPos
would this work on players too?
nope
you would need some animation event handler and check the stance to force it down
Yku can hide them
I suppose hidden objects would not be included in draw calls to the GPU, so there should be a performance difference
what's not in the "AO" (view distance) is already not being rendered
Can someone tell me why this code is wrong?
_group addEventHandler ["LeaderChanged", {
[] spawn {
sleep 2;
if (lifestate player == "INCAPACITATED" ) then {
hint "You lost 5 Campaign points!";
waitUntil{!(isNil"dmpCVP")};
waitUntil {lifestate player == "HEALTHY" };
dmpCVP = dmpCVP - 5;
sleep 5;
hint "Test!";
};
};
nil;
}];```
has someone created a function for measuring angular velocity
am in need of something like this
yes no command, as i ask if anyone has created a function for it
so you have to use an eachFrame loop or something... ๐ฌ
can't be done without a loop
also it'll have a 1 frame delay
not worried about the loop, just the calculation
calculation is not difficult, but not efficient either
ah welp
no command for matrix inverse 
:\
i am fiddling with the addTorque command but its not very useful without measuring angular velocity
I suppose there's no need for matrix 
just calculate each ang velo component and sum
velocity of each component is, for example:
_s = acos(_vx2 vectorCos _vx1) / diag_deltaTime;
_v = _vx1 vectorCrossProduct _vx2
ah deltatime, i have missed this command entirel
functions for it I believe
didn't find any 
That event handler is not added to the game yet
ah sorry, must have mixed it with
matrixMultiply
matrixTranspose
eventually
BIS_fnc_multiplySquareMatrixByVector
etc
oh, i see
hmm, i'm stuck
not sure which eventhandler to use when player becomes INCAPACITATED
Damage triggers too many times
there is no native event handler for that
handleDamage is your best bet
or maybe hit
that ofc is still not ideal, because it's assumed you were incapacitated by damage
which is not always the case. it's a scripted behavior
e.g. you can do player setUnconscious true
what you were doing before was on the right track
only the code itself was wrong
not the idea
i tried so many versions that i don't know anymore which one was on the right track ๐
player addEventHandler ["HandleDamage", {
params ["_unit"];
private _oldHandle = _unit getVariable ["my_incap_script", scriptNull];
if (scriptDone _oldHandle) then
{
private _handle = [_unit] spawn {
params ["_unit"];
sleep 2;
if (lifestate _unit == "INCAPACITATED" ) then {
hint "You lost 5 Campaign points!";
waitUntil{!(isNil"dmpCVP")};
waitUntil {lifestate _unit == "HEALTHY" };
dmpCVP = dmpCVP - 5;
sleep 5;
hint "Test!";
};
};
_unit setVariable ["my_incap_script", _handle];
};
nil;
}];
that fixes your "too many times" problem
the script itself has other problems
but I'll let you figure it out for yourself
.
afaik no. it's not possible in A3, let alone A2 
but a2 is much better...
speaking of that ... anyone noticed issues with "cursorObject"? some years ago it would have a return all the time, now it seems to behave more like "cursorTarget" where the object needs to be in player presence/reveal for some time before detection ...
works fine for me
i spawn in an object and cursorobject == null object for a few seconds
ok, i am going to override incomingMissile event on server side to send locked vehicle to unit then
good idea
just go in editor, add the oneachframe {hintsilent str cursorobject}; and plonk down an object (in my case a helicopter) about 40m away
reports objnull for a little while
i will spawn some object and check it with cursor target, if target is not this object then target is locked
hmm, "incomingmissile" event handler is not the place to be using cursortarget
but i can override it using dll
override what
event behaviour
ahh, in that case do as you will xD
something like missile is null if vehicle is just locked
unfortunately even in A3, the projectile/missile is not passed as argument in "IncomingMissile" cough @still forum cough
lol what? he meant his own issue ๐คฃ
yes, i read wrong, but i got idea because of him xD
Passed array: [unit, ammo, whoFired]
lol, it gets the missile as argument, and then only passes on its classname and the shooter, but not the missile itself
wtf
Both these things could've been retrieved from the missile itself in script! wtf
its been a pesky thing for years to work around ๐
Y u no tell me then?!
:poutcat:
but u dont need rocket itself, only some sign that rocket is present
Fixed in 2.10 :stamp:
I just tested and it worked for me
legend
I'm working on one, don't be annoying ๐ข
private _projectile = nearestObject [_shooter,_ammo]; but sometimes it can produce unexpected behaviour)
speaking of being annoying, whatever happened to objectCreated EH?! ๐

which one did you think I mean :U
i saw a good instrument for arma 3, called intercept

the one I said above was LockedMissile....
๐ช
give me arma 2 on arma3's engine so i will play it)))
install CUP
cup is b*****t
you get A2
isnt A2 on the same engine as A3 ?
how long was it since you last used them?
no
no, a3 has more scripting commands
and broken physics
and balance
and poor color scheme)
thats just a hot take, but ok
ill bug you tomorrow @still forum , ther are two more event handlers with that sort of inconsisency
for now tho, its 1am here and work 2moro
so Zzzz
Looking for some help with trigger conditions....
Want to set a trigger condition to be that the condition be both the color of the zone and that bluefor be present but when i set the condition as
markerColor "zone_Sjoa" == "ColorRed"
and set the trigger activation as blufor present....the trigger still starts as soon as the mission begins
it should be this && {markerColor ...}
In a trigger condition field, this refers to the condition selected in the attributes
thank you tested and works.. appreciate it
Random ask because I'm in the middle of a longass test of my mission, can someone pass me the item name for the yellow deck crew vest?
V_DeckCrew_yellow_F
Thanks, for some reason I couldn't pull it up on any search and didn't want to restart x_x
I'm having a problem with mission directory
I have a folder called APS that contains a folder called Circle, the Circle folder contains a paa folder which contains the paa images,
I'm doing
hint parseText "<img image='APS\Circle\paa\1.paa'>";
but its not showing the image
why is that?
image size is 256x256
You need either /> or ></img> at the end
that nice but,
cursorobject setobjecttexture [0,"APS\Circle\paa\1.paa"];
does nothing when done on a tablet
if I place the image outside these 3 folders so that:
cursorobject setobjecttexture [0,"1.paa"];
it works for some reason
I hope I'm not confusing you
Does it work with e.g. 2 levels of folders, or only when it's in the base mission folder?
If it's the latter, try adding a leading \ to the path
wait one
lovely
reloading the game made this work
still I can't see it in hint
hint parseText "<img image='APS\Circle\paa\1.paa'></img>";
doing this will say it doesn't exist
hint parseText "<img image='\APS\Circle\paa\1.paa'></img>";
better not do it then
hmmm
cutText ["<img image='APS\Circle\paa\1.paa'></img>", "PLAIN", -1, true, true];
shows the image
its only the damn hint that is not showing the image
Have you tried it with other images (particularly smaller ones)?
nope
I will see
It might be worth trying adding a bit of dummy text in there as well. It's plausible that trying to display only an image might confuse it.
thats true
in my original example
I had additional text
but now I have redone it with more text and it works
I'm still confused tho
as to why it didn't work the first time
hmm
hint parseText (format ["<img size = '5' image='APS\Circle\paa\%1.paa'></img>", 1]);
this is not displaying
Well, you had 3 potential overlapping layers of failure:
- game reload required to make it available
- problem with
imgtag - hint requires text as well(?)
In every previous instance, at least one of those was in effect.
ignore that
i forgot to add dummy text
its the first and the last
1/ you l8 m8
2/ not related to scripting ๐
I'm facing this problem now
images displayed in hint
look like they are behind it?
Is there no editor in reforger?
as if they are behind the hint layer?
ingame no, not really(well the zeus kinda thing i guess, but that's realtime only afaik?), you need to use the tools. should be pretty straight forward i think, once the docs come out.
how much sqf is going to be different in A4 from past games? I just read the action menu is gone in reforger, likely meaning it will be similarly gone in A4
sqf and enscript are uncompareable really
but muh actions
i mean it's pretty much the same thing but better
you interact with things by looking at them, not sure how exactly to add them, but docs will show ๐
yeah but I use a lot of self-actions for development + you can "flip" actions if you are affecting performance
can always make a custom ui to be arma3 action menu like ๐ not sure why you would want to do that as the scroll menu is annoying as hell (imo)
after nearly a decade of arma the action menu doesn't bother me these days, though I do vaguely remember it being frustrating at first
anyone know how to restart the server automatically?
when the session end, actually he just close
based scroll menu enjoyer
yeah I'm a gigachad
serverCommand with #restartserver
@copper raven #restartserveraftermission :p
that works too yeah
I was very astonished to see the scroll menu system when I first played arma
far better than many games I have played
arma 3's is a lot better, much smoother. Arma 2's menu wasn't as good
is it possible to put an image on top of the other using structured text?
do you mean where 1 picture blocks the 1 underneath or just verically?
on on top of the other
for example a tank icon with a circle around it
yep
I want to keep the thing as a hint
but what I'm asking for is only possible by GUI
which is not what I'm seeking
it doesn't matter anyways
do you know where we can found the dev tools for arma reforger ? ๐
i didnt find them on steam, neither on the arma reforger directory
If you own the game, you can change your Steam library settings from "games" to "tools" in the top left and Reforger Tools will be in the list. But this isn't really a #arma3_scripting question :U
thank you for your answer
why not create the icon yourself, in Paint 3D and then you can display it via cutRsc
well because
I'm dynamically displaying the icon of the tank
depending on the tank the player is sitting in
if he sits in rhino its a rhino icon, if he sits in slammer its a slammer icon
{"Welcome" remoteExec ["systemChat", _x];} foreach crew _Vehicle;
this will show welcome to everyone boarding the vehicle correct?
Only to people who are in the vehicle at the time that it's sent
If you want to greet everyone who boards, at the time that they board, you should use one of these: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#GetIn
yep thats what I want
my use case is not this but thanks
when I run it and there is an AI unit in the vehicle (I'm a client host) it says welcome two times, I think thats normal because the AI unit is local to me correct?
yes
Actually you can skip the forEach and just use crew _vehicle as the remoteExec target parameter
I should have checked the wiki
If you're going to make every message a Reply to me, could I ask you to turn off the ping when you do it, please?
ah alright sorry
Hi, what is the best way to check the value of a global variable regularly during a mission? Looking for a solution with limited performance impact.
depends what you mean by best way and how frequent the variable can change
ideally you should never check variables to begin with, because all solutions need a loop
and loops are well known performance eaters
The variable should be checked every 2 minutes or so
It stores victory points. Once the variable is above a certain threshold by completing missions it should trigger the end of the mission
for that a scheduled loop is more than enough
are you the one changing it?
it's changes autoomatically. triggered by a mod
Drongo's map population
The variable is the one which stores the campaign victory points
And it get's updated once the player finishes a task
if that mod doesn't have an event handler system then you have to loop
tasks don't have an event handler either... 
if you were changing it yourself, for example:
myPoints = myPoints - 1;
you didn't have to loop
you could make a function to handle the changes in that variable:
[-1] call my_fnc_addPoints
params ["_added"];
myPoints = myPoints + _added;
if (myPoints == 0) then { //0 points
//...
};
I am changing the points manually when they get reduced
Dying reduces the points
So I guess your solution is a good one to end the mission if points drop to 0
well if the mod has its own system for ending the mission (handles the points reaching 0 itself) then yeah
you can add your own system on top
I will try this
I guess I have to create this function first? How would I do this?
functions library is probably the best way
or you can just drop something like this in init.sqf
my_fnc_addPoints = {
params ["_added"];
myPoints = myPoints + _added;
if (myPoints == 0) then { //0 points
//...
};
};
Could I also add this to the description.ext of the mission?
via function library yes
but that code itself no
got it. thank you Leopard
np
What's the best way to use an intel object to create a diary entry of an image that's based on a variable?
I want to create a piece of intel that shows a diary entry of a photo. What photo that is depends on a variable that is set by a script.
switch statement with the strings for the images?
The variable will already be defined elsewhere. The image will be assigned to "_intel1", but I didn't know if I could put that variable in the init of the intel object in the editor because someone said that variables set outside the editor can't carry over.
?
if (isServer) then {
// Diary picture:
this setVariable [
"RscAttributeDiaryRecord_texture",
"_intel1", // Picture variable
true
];
Like, will this work if I put it in the object init?
why do you have a local variable inside a string?
Is that a variable referenced within another string?
show what you did with the intel as well
Feel like this is gonna raise more questions than answers but here we go:
// Establish possible hostage locations
private _zoneA = [9106.35,10533.7,3.51721];
private _zoneB = [651.07,18364.3,0.439438];
private _zoneC = [24860.3,21067.2,3.11268];
// Establish shifts based on time of day
private _morning = (dayTime >= 12 && dayTime < 15);
private _afternoon = (dayTime >= 15 && dayTime < 18);
private _evening = (dayTime >= 18);
// Randomize zones into site schedule
private _shuffled = [_zoneA,_zoneB,_zoneC] call BIS_fnc_arrayShuffle;
_shuffled params ["_siteMorning","_siteAfternoon","_siteEvening"];
// Establish schedule based on time of day
switch (_schedule) do
{
case (_morning): {_siteMorning};
case (_afternoon): {_siteAfternoon};
case (_evening): {_siteEvening};
};
hostage setPosATL _schedule;
// Define intel photos needed for mission
// Zone A
private _zoneAMorning = image "zoneAMorning.jpg";
private _zoneAAfternoon = image "zoneAAfternoon.jpg";
private _zoneAEvening = image "zoneAEvening.jpg";
// Zone B
private _zoneBMorning = image "zoneBMorning.jpg";
private _zoneBAfternoon = image "zoneBAfternoon.jpg";
private _zoneBEvening = image "zoneBEvening.jpg";
// Zone C
private _zoneCMorning = image "zoneCMorning.jpg";
private _zoneCAfternoon = image "zoneCAfternoon.jpg";
private _zoneCEvening = image "zoneCEvening.jpg";
// Assign correct intel photos based on schedule
switch (_morningIntel) do
{
case (_siteMorning = _zoneA): (_zoneAMorning)
case (_siteMorning = _zoneB): (_zoneBMorning)
case (_siteMorning = _zoneC): (_zoneCMorning)
{
switch (_afternoonIntel) do
{
case (_siteAfternoon = _zoneA): (_zoneAAfternoon)
case (_siteAfternoon = _zoneB): (_zoneBAfternoon)
case (_siteAfternoon = _zoneC): (_zoneCAfternoon)
{
switch (_eveningIntel) do
{
case (_siteEvening = _zoneA): (_zoneAEvening)
case (_siteEvening = _zoneB): (_zoneBEvening)
case (_siteEvening = _zoneC): (_zoneCEvening)
{
// Randomize site intel
private _shuffled = [_morningIntel, _afternoonIntel, _eveningIntel] call BIS_fnc_arrayShuffle;
_shuffled params ["_seaportIntel","_compoundIntel","_airportIntel"];
["init", [seaportLeaflet,"_intel1"]] call BIS_fnc_initLeaflet;
["init", [compoundLeaflet,"_intel2"]] call BIS_fnc_initLeaflet;
["init", [airportLeaflet,"_intel3"]] call BIS_fnc_initLeaflet;
["init", [ambushLeaflet,"ambush.jpg"]] call BIS_fnc_initLeaflet;
The last section is for leaflets. I'd like to replace the leaflets with intel objects because I can't figure out how to get leaflets to create diary entries.
For your leaflet --> diary entry problem: could you use BIS_fnc_holdActionAdd on your object, have it execute BIS_fnc_initLeaflet in the scripting part, along with createDiaryRecord?
Maybe? I dunno how the hold action would interact with the examine action leaflets already have. I tried asking about a leaflet adding a diary entry yesterday but didn't get any bites.
If I can get that to work that'd be the best case scenario as I think leaflets are more visually interesting.
But there's also some formatting stuff with them I would need to figure out. They don't want to seem to display landscape images on the physical leaflet itself, though that's a miner issue.
Come on mate, "tried asking" implies we internet strangers here are somehow responsible for getting this to work for you =].
I got a solution, using the above suggestions...
Have two objects for this. A "myLeafletDummy" object that players don't see in the level, and a "myLeaflet" that they can interact with:
[myLeafletdummy, "#(argb,8,8,3)color(1,0,1,1)", "This is some Magic Pink"] call BIS_fnc_initInspectable;
[
myLeaflet,
"Look at intel(tm)",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_search_ca.paa",
"_this distance _target < 3",
"_caller distance _target < 3",
{},
{},
{
[myLeafletdummy, true] call BIS_fnc_initInspectable;
player createDiaryRecord ["Diary", "Information gathered.<br /><img image='\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_thumbsup_ca.paa' />"]
},
{},
[],
3,
0,
false,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0, myLeaflet];
No, it implies that I tried getting the answer to the question because I exhausted all my independent attempts to figure it out, no one answered, so I moved on to finding a different solution. No one owes me an answer. I just asked and wasn't given one. I was literally stating a fact. Thank you for giving this a crack. I'll see if I can get those to work.
we got renamed boys
How do i make addaction on cursorTarget that is "landVehicle" ?
That doesn't make sense, can you explain what you're trying to achieve with that?
Im trying to make unflip script and i need the addAction to activate when im looking at the vehicle
Is there a problem with just adding the action to the vehicle?
If the action needs to be added to the player then you can use isKindOf to check class inheritance for objects such as "LandVehicle"
cursorTarget isKindOf "LandVehicle"
I'd recommend doing this with an action added to the vehicle however, until you run into an issue with that; because that will give you an unambiguous reference to the actual vehicle vs cursorTarget
i guess you can add the action to the player, and do the check above as condition, or add the action to the vehicles you want, i think the latter is better 
I'm having some issues trying to get a condition to work that checks if targets have been eliminated. The targets can either be individuals or groups. Whenever the condition is checked I get this Error: Error alive: Type Group, expected Object
Here is my condition: ```sqf
// Check the success limit
if ({ !alive _x } count _targets >= _limitSuccess) exitWith {
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
// End the mission if it was enabled
if (_endSuccess) then {
[QEGVAR(end_mission,callMission), ["MissionSuccess", true, playerSide]] call CFUNC(serverEvent);
};
};
alive doesn't work with groups
What would you actually want it to do with a group?
I think dead units stay part of the group for something like 20-30 seconds until the squad leader realizes they are dead, then they are removed. So I would check both count units _group == 0 and also check alive looping through any groups that do have units
it's not really a 1-line kinda thing...I mean it could be of course, but that'd be a line from hell
So how would I create a condition for that?
loop through units of groups instead of just groups
yeah
ah i thought there was a command like accumulate, #server_admins message but it never got implemented 
Any advice on having unit change stance?
I was searching the wiki, but the only stance-related command I could find was "stance"
Which only returns current stance
I basically need to go from stance "A" to stance "B" upon a certain condition.
all you need to do is playMove to the stance you want
Tally_Fnc_stanceDown = {
params ["_man"];
_man disableAI "FSM";
switch (stance _man) do
{
case "STAND" : { _man setUnitPos "MIDDLE" };
case "CROUCH": { _man setUnitPos "DOWN" };
case "PRONE" : { /*_man setUnitPos "MIDDLE"*/ hint "I need to roll" };
};
};
I ended up with this one
is there a way to know what container the player dragged the item from before putting it into another?
for example player drags 9mm mag from player's vest and puts it into a box, how would I know he dragged it from his vest?
Syntax:
time setFog fog
Parameters:
time: Number - transition time to the new value
fog: Number - fog density. Range 0..1
Return Value:
Nothing
Is time in seconds or minutes here?
Should be seconds
yep, thanks
does placing many ShowHideModules affect performance?
it shouldn't. that module should only execute its function once
but since modules are objects maybe that could affect the performance a bit
you can delete the modules after some time
e.g. put this in their init:
this spawn {
sleep 1;
deleteVehicle _this;
};
or alternatively, you can put them all in a specific layer and delete all objects in that layer
init.sqf
[] spawn {
sleep 1;
{
deleteVehicle _x;
} forEach (getMissionLayerEntities "myModulesLayer" select 0)
};
I'm not sure if that affects JIP. depends how the function works ๐ค
and the objects remain hidden i suppose
ofc. the module probably just uses hideObject/hideObjectGlobal
I've never used that module tho so I could be wrong...
Anyone know where the uav gunner camera ui configuration settings are located?
I need a door to close behind the player after they walk through it; i have a trigger that reduces the fog so the inside is more clear, then restores fog as they step outside, but obviously having an open door kinda plays hell with muh immersions.
The building in question is one baked into the map, if that helps.
it doesn't matter. use the animate/animateSource commands
Hrn, thought I tried that, maybe I tried animateDoors. The getter would be animationNames, yeah?
You can use worldToModel to get an offset representing the door itself and check distance to it, but it'll probably have to be hardcoded per door per building
Can someone pls help? I want to use getRelDir to know how much a vehicle is looking away from a target. I am now looking at a way to convert the 0 to 360 output to a -180 to 180 output where 0 is looking straight at the target. I already tried a linear conversion but than -180 is straight ahead.
well you can simply do:
_angle = [_angle, _angle - 360] select (_angle > 180)
```or:
```sqf
if (_angle > 180) then {_angle = _angle - 360};
I already tried a linear conversion
it's not a continuous range, so it's not linear
Ah goddamn wrong channel, sorry ^^
this channel is for Arma 3
Hello, I am in need of help. I am trying to make a trigger in Eden that applies ACE damage (to the legs specifically) whenever a Player or AI walks through it, but I am rather inept when it comes to Arma's scripting and the wiki has been less than helpful to me.
You can use this https://github.com/acemod/ACE3/blob/master/addons/medical/functions/fnc_addDamageToUnit.sqf to add ace medical damage to a unit. [player, 0.8, "rightleg", "bullet"] call ace_medical_fnc_addDamageToUnit this code for example adds 0.8 "bullet damage" to the right leg of the player that executes the code. Now you need to find a way for the trigger to be executed only by the player who enters it not by someone standing besides it.
Maybe someone ne else knows how to setup the trigger for that
Thanks, I was able to get that far at least, but the problem I am running into is that I can't get it to trigger on only the player/AI that walks into it, and whenever an AI walks into it the damage does not get applied to the AI, but only the player.
well, if you have player in the call...
The thisList variable within trigger statements gives you all the units that matched the trigger conditions.
If you only wanted the damage to apply once per unit, or once each time they enter the trigger area, you'd probably want to setVariable on a unit to mark that.
Ideally i'd want to the damage to apply once the player/ai enters the trigger at first, and then trigger again if they stay inside it for x amount of seconds.
but for now i'm just trying to get the basic applying damage to work
In that case you could store the current time value in a setVariable on the unit.
Or the time at which they're eligible for damage again. Doesn't change much.
But then you need a whole script that runs because a trigger only triggers once if someone enters or exits the area
For what should i swap out player if i want it to trigger when an AI walks into it (As well as when a player walks into it), because alternatives i have tried such as Units Person and Units Object make it so that it just doesn't work at all.
Something like this I guess:
{
if (_x getVariable ["lastDamageTimeout", -1] > time) then { continue };
[_x, 0.8, "rightleg", "bullet"] call ace_medical_fnc_addDamageToUnit;
_x setVariable ["lastDamageTimeout", time+10];
} forEach thisList;
Caveats:
- Doesn't reapply damage if you stay in the trigger beyond the timeout, as Nitro Nic said.
- That ACE function may need to be run locally to the unit.
I guess what you're trying to do isn't really appropriate for a trigger alone anyway, because only the first unit(s) that enter will trigger, until everyone exits.
What you'd need to do is use the trigger to activate and deactivate a spawned script with a loop that checks units in the radius.
So for my rather quick fuckabout this does seem to do what i need it to do. The problem is now that I have no clue what any of this stuff means or does.
or rather, i know what some of these things do, but i have no clue why thisList works, or what getVariable does here.
thisList is a magic variable that exists inside trigger statements (and some other places). In trigger statements it contains the list of all units that activated the trigger:
https://community.bistudio.com/wiki/Magic_Variables#thisList
setVariable and getVariable are used to create arbitrary variables (name + value) on objects (and some other types).
So here, thisList hopefully contains an array of units near the trigger, and then we can set variables on them to remember when they last took the damage.
I see, i assume that ["lastDamageTimeout", time+10]; means that the unit that triggered it won't get the damage applied when it activates the trigger again within 10 seconds?
anyone know how to use this function?
https://community.bistudio.com/wiki/BIS_fnc_moduleCuratorSetCostsVehicleClass
@meager zinc It's just creating a variable called "lastDamageTimeout" with a value of current time+10. The getVariable part above checks whether this value has been exceeded before applying damage.
I'm afraid you've lost me...
It gets the current time, adds 10 seconds, and saves that as a variable. The next time the thing runs, it checks that variable to see whether the new current time is later than the saved time - i.e. whether 10 seconds has passed since that time was saved. If it isn't later - 10 seconds hasn't passed - it does nothing.
tl;dr: your first assessment was correct
I see, good to know I'm not a completely lost cause when it comes to scripting. ๐
Now onto the next part, making it trigger again when someone is already inside the trigger area...
I have some posters and images in my MP mission, and use 'setObjectTextureGlobal' as the command to get them into the game. Sometimes they only show when you walk close to them .. is this normal? Do I need to do anything else to prevent this from happening (i.e. always show)? Cheers
Make sure they are in .paa format (can be converted using one of the tools in the Arma 3 Tools package). .jpeg or other formats can cause odd behaviour.
Ahh awesome Iโll try that out .. thank you
How could I remove unit 5 from the player's group via script?
Unit 5 being?
joinSilent
The 5 unit in the player's groupt where unit 1 = player
If unit 5 has a unique handle, then it's just
unit5handle joinSilent grpnull;
otherwise you'll need some way of pointing at him, which can get tricky.
Thanks both. I will try this
OK upon my death. I have a trigger to selectplayer to a different person. But whenever this guy dies. The end screen doesn't pop up. And I'm stuck in the game
Even a end game scenario via a Alive trigger doesn't work
maybe you have some undefined variable somewhere?
Don't think so I'd get a error or something?
in unsched you don't get errors for undefined variables, it just silently fails
Is there a way to define a variable based on the outcome of a switch do statement?
I already showed you:
#arma3_scripting message
Ah okay I ended up using something slightly different for that problem and this one is a little different but I still think that'll work. Thanks!
@little raptor is there a way to use that switch to assign the variable in the event that two variables match? Something like this:
private _morningIntel = switch (true) do
{
case (_siteMorning = _zoneA): {_zoneAMorning};
case (_siteMorning = _zoneB): {_zoneBMorning};
case (_siteMorning = _zoneC): {_zoneCMorning};
};
should be == then it will work
Tried that but it freaked out and said it expected a boolean.
what did it say the input type was
brb I'll run it again and get the exact error
private _morningIntel = switch (_siteMorning) do
{
case (_zoneA): {_zoneAMorning};
case (_zoneB): {_zoneBMorning};
case (_zoneC): {_zoneCMorning};
};```
hah oops yeah that is way better
If _siteMorning has a chance to not equal zoneA through C then maybe add a Default{} case
Has no chance.
Can agents drive vehicles well?
can agents drive vehicles at all?
oof
switch on _siteMorning instead of true?
Is there a channel for hiring scripters?
Is there a way to change what is shown within the Steam rich presence or is it hardcoded to the missionnamesource once the player loads in?
Thank you!
Anyone came across the problem where you use a trigger for Alive and then upon your death ya get it to select another player. But when he dies you just stuck in the dead body and can't do anything?
did that not work?
Are you trying to use selectPlayer on a multiplayer mission? It has... issues.
Na sp
Could be the mission is 'ended' upon player death, but your attempt to circumvent it by moving the players controls is messing with it?
any ideas why this doesnt seem to work. it cant find the other sound ive added
Copsogg?
fixed that. still dont work
class CfgSounds
{
class EASZombie2
{
name = "EASZombie2";
sound[] = { "sounds\EASZombie2.ogg", 1, 1 };
titles[] = {};
};
class Othersound
{
name = "cops";
sound[] = { "sounds\cops.ogg", 1, 1 };
titles[] = {};
};
};
this should work, if it doesn't then something else is wrong with your description.ext
then your cops sound is wrong/corrupted/whatever
cfg sounds needs to be played with say or say3D
it plays and is named correctly
playSound uses absolute path
no
both are in the sounds folder in the Mission
playSound3D does
try both say "Othersound" and say "cops"
best is to make class and name the same
just keeps saying cant find sound
reload mission
description is parsed on load/save so you need to load or save after you make changes
good to remember that since there's so much customization that happens in it
ive tried that allready
wrong file edited?
then your sound doesn't exist 
nope correct file. played it, works fine correct name
name the other```cpp
class EASZombie2___lololololololol
{
name = "EASZombie2";
sound[] = { "sounds\EASZombie2.ogg", 1, 1 };
titles[] = {};
};
and try to play "EASZombie2"
if it works, you're editing the wrong mission file/dir
if the first sound works then the mission config is good, but you say:
โข mission has been reloaded
โข sound exists in folder
1 of the above is not true
might have the wrong mission loaded as Lou says
its the correct file. the working sound didnt work
then you're screwed, reinstall Windows
I'm confused first you say the first one works then you say the working one didn't work
ignoring how that is already a contradiction, you contradicted again
Because I changed the name of it as suggested by Lou to check if it was the right flie
cops.ogg.wav
since he changed the class name, load the mission again, then you can go in the config editor and look at missionConfig to see if the classname updated, that will tell you that you are indeed editing the description.ext that you think you are
ive only got the one description in the mission folder. so its the correct one
well the next step for me is going to be "post a github link" so I can go look at the mission
how about you show your cfgSound maybe they can notice something wrong
no his mission config is good because he already has 1 working sound
not a good evidence
try to break the first sound then
?
try to change the first sound (display name, sound file, etc) to make sure you are editing the proper file
i already did
how about you replace the name of that working sound file with the one that does not work inside cfgSound
and then try playing it

like ive only 1 mission folder by this name.
i renamed the working file and it didnt work


what is your code? I mean, SQF
class CfgSounds
{
class EASZO
{
name = "EASZO";
sound[] = { "sounds\EASZO.ogg", 1, 1 };
titles[] = {};
};
class Othersound
{
name = "cops";
sound[] = { "sounds\cops.ogg.", 1, 1 };
titles[] = {};
};
};
you have a stray . in the config
sound[] = { "sounds\cops.ogg.", 1, 1 };
^
remove then use say "Othersound" and it works
...
lou howd you do that? it won't let me post picture here 
need to be veteran
oof how do I get that??
reload mission
still not working. 
i'll zip and dm you back the mission, I promise it works
use say "EASZO", say "Othersound"
just as you said that i was like.. ill try Othersound. as i didnt think it worked like that
playSound "Cops"
""""""cops""""""
yes
hence why I asked for your SQF code
i had it down like that
like how
but seeing how playSound "Othersound"; it now works fully
I have no idea why you don't continue the conversation and drop to something else
what? you asked
playSound "cops"; didnt work
};
class Othersound
{
no one spotted this?
EVERYBODY spotted this, come on!!1!
mentioned HERE for instance
yeah config is annoying tbh
justโฆ keep going, ok? yeah, nobody told you that. alright
here's the first time I mentioned it, I brought it up a few times
- you had the period thing
Yea I didn't know what you where on about with that. It was your 2nd post about it that made it click
I can never remember either if you use class name or name, but now that I know (for now) that it's class name, I'm not even sure what name is for
Thanks for the help dread
np I always love discovering the ancient dark magicks within sqf
hopefully enfusion doesn't have as many secrets
I reanmed the otherspund to cops in the folder. That's why it didn't work that time ๐
take this:
#define SOUND(NAME,PATH) class NAME { name = #NAME; sound[] = {PATH,1,1}; titles[] = {}; };
that's what I use for sounds that don't have title text, so my CfgSounds looks like this:
SOUND(helloENG, "sounds\helloENG.ogg")
SOUND(helloGER, "sounds\helloGER.ogg")
SOUND(hey, "sounds\hey.ogg")
SOUND(song1, "sounds\space_battle.ogg")
SOUND(player1, "sounds\player1.ogg")
SOUND(man1, "sounds\man1.ogg")
SOUND(man2, "sounds\man2.ogg")
SOUND(man3, "sounds\man3.ogg")
SOUND(man4, "sounds\man4.ogg")
I use a lot of preprocessor because I'm extra
How do I find and install the ACE Medical script? Looking to build my own field training hospital.
If youre looking for just getting some experience, there is the Ace Advanced Medical Training scenario already available on the workshop.
I may have to go that route. My goal was to set up a site where four different types of casualties (slight, moderate, heavy, severe) on four different matts inside a research dome, spawned by clicking on a spot. The medic can spawn as many patients as he wishes.
Honestly, thatd be kinda overkill. The difference between a heavy wound and light wound would just be number of times you click 'Packing bandage' within a shorter timeframe :p
Does anyone know how I'd maybe hide B_Parachute and replace it with a cargo or other nonsteerable vanilla parachute in this script?
Null = [] spawn {{
if (((assignedVehicleRole _x) select 0) =="Cargo") then {
_x addBackpack "B_Parachute";
[_x] ordergetin false;
[_x] allowGetIn false;
unassignvehicle _x;
moveout _x;
sleep 0.2;
};
} forEach (crew ATDV);
};
What are you trying to achieve?
I'm trying to build a static line parachute script without mods.
It's working as intended so far in singleplayer testing with AI, but I want to hide or replace the steerable parachutes with the cargo parachute model, and force the cute to open for players as they exit, if easily doable.
i want to display the face of the player using this:
hintSilent parseText format ["Player Face:<br/><img image='%1' size='7'/>", getText (configFile >> 'CfgFaces' >> face player >> 'picture')];
but unfortunately it does not show, any help?
Old but maybe workable?
Holy donkey! Great Google-Fu! I'll investigate this.
there's no such entry
also faces do not have "pictures"
they're textures, mapped to the head mesh
is it possible at all?
you can show the texture, but it looks fugly
yes please tell me xD
try this:
hintSilent parseText format ["Player Face:<br/><img image='%1' size='7'/>", getText (configFile >> 'CfgFaces' >> "Man_A3" >> face player >> 'texture')];
What, and I'm realizing this is the question that often gets better results, are you trying to accomplish?
I wanted to display a character's face
Apparently it is "possible" to do this (https://community.bistudio.com/wiki/CT_OBJECT) but it's not known (or at least not documented) how to get the face texture onto the model, even though the game can do it somehow
You might have to settle for taking pictures of all the possible faces and matching those. Make sure the pictures are appropriately small to save on file size.
You could also try giving the player a temporary look through a camera pointed at their face
Or, if you're sure what the character is question is going to look like, make an image of their face and present that as a straight up .jpg
Any math guys in here able to tell me why when I added velocity to this script it went from working, but bland, to working and crazy?
Null = [] spawn {{
if (((assignedVehicleRole _x) select 0) =="Cargo") then {
_speed = 0.8 * (speed ATDV);
_vel = velocity ATDV;
_dir = direction ATDV;
[_x] ordergetin false;
[_x] allowGetIn false;
unassignvehicle _x;
moveout _x;
sleep 0.1;
_chute = CreateVehicle ["B_Parachute_02_F", (getPos _x), [], 0, "NONE"];
_chute setVelocity [
(_vel select 0) + (sin _dir * _speed),
(_vel select 1) + (cos _dir * _speed),
(_vel select 2)
];
_x attachTo [_chute, [0, 0, 1.2]];
_x switchMove "para_pilot";
sleep 0.2;
};
} forEach (crew ATDV);
};```
speed is km/h and velocity is m/s? Not a math guy, just guessing.
I'm not entirely sure it's a math problem, anyway. Thanks for the input! It started spawning my chutes in front of the plane, so I think they are getting accelerated too early somehow.
Can anyone tell me how i can change the Animation for a Character?
playMove or switchMove depending on context, and you have to figure out which it is via trial and error.
switchMove "" does the trick usually.
@shadow sapphire Not sure why you're adding the velocity to the speed there. What did you actually want on top of _chute setVelocity _vel?
Isn't that a Reforger character? You won't find a working method for that in this channel. Arma 3 and Reforger use completely different scripting languages.
Oh shit i choose the false channel ๐ Sorry guys
I'm trying to follow the example here: https://community.bistudio.com/wiki/setVelocity
But I've been playing with the values and simplified it for myself now. It's still acting crazy whenever I change velocity at all.
Yeah but why do you want to add speed here at all?
Shouldn't the chute have the same velocity (or maybe a bit less) than the launch vehicle?
is
addMissionEventHandler
requiring a handler to work?
Should it be added to server/host since its only local?
Or can it be added independently to each client in order to do something different for each player according to the event added?
Kind of a dumb question, IK, just wondering why im getting an error when the code inside the handler has been confirmed to work several times.
When the chute is created, it has zero velocity at all, so I have to add some to make it look like it did have the same velocity as the mothership.
but that's just _chute setVelocity _vel here, right?
AH! Yes, it is.
requiring a handler to work?
Well...you have to choose what kind of mission EH you want to add, if that's what you mean.
Should it be added to server/host since its only local?
Depends entirely on which EH type and what you want to do with it. Some EHs/purposes work best server-only, some work best on all clients.
addMissionEventHandler ["entityKilled",
{
do something;
}];
I would believe, that, for example in the case of entityKilled it would be better to add it to the server and the remoteExec everything from there into players. Asking since Im gonna have a handler check all the entities in the mission in order to handle score myself.
And of course, if I can unload this kind of constant check to server it would be even better :p.
The question about the handler arises since IDK how are mission event handlers supposed to be added, since normal event handlers actually ask for an object to be added to.
mission event handlers are added to the mission itself, not to a specific object. That's the key difference between mission EH and normal EH.
As for why you're getting an error, it would help to know what the error is and what the code is.
yes, thats the doubt. Are they supposed to be added, idk, in init or initServer for example? Or can you add them from a player and they will be done in that machine since they are local?
dw, i dont have the error at hand right now
You can add them wherever. If you add them in an init file, they will be added during the briefing phase (assuming no sleeps beforehand); if you add them in a script they will be added whenever that script is executed. A mission EH is attached to the whole mission, not a specific object (e.g. entityKilled detecting when any entity in the mission is killed, unlike the killed EH which detects the object it's added to), and it is added only on the machine(s) executing the script that adds it. If you want to only add it on the server, use initServer.sqf. If you want to add it to all clients *and the server, use init.sqf.
Some mission EHs are only triggered on the server (eg HandleDisconnect), some are triggered on local actions (eg MapSingleClick) while others are triggered on global events (eg entityKilled). It's not always well documented.
How would I insert _x switchMove "HubWoundedProne_idle1"; into my static line script:
Null = [] spawn {{
if (((assignedVehicleRole _x) select 0) =="Cargo") then {
[_x] ordergetin false;
[_x] allowGetIn false;
unassignvehicle _x;
moveout _x;
sleep 0.3;
_chute = CreateVehicle ["B_Parachute_02_F", (getPos _x), [], 0, "NONE"];
_chute setDir (180 + (getDir ATDV));
_chute setVelocity [0.3 * (speed ATDV), 0, -8];
_x attachTo [_chute, [0, 0, 1]];
_x switchMove "para_pilot";
};
} forEach (crew ATDV);
};```
To switch to that animation when the `_chute` hits the ground without interrupting the rest of the jumps?
Bonus, anyone know how to get the speed transition from the chute creation to velocity setting to the opening to be more gradual? It's like Arma is just slamming it from one velocity to the next.
Whats the output of attachedObjects?
i can't open a3 atm
is it [object,object,object] ?
Or does it include more
It says it's a list.
yes i know
So I think it's just "[object,object,object]."
if the first parameter is an object
will it just set the speed mode of the object's group
or for the object itself?
If unit is passed as param, unit's group is used.
๐ค
my bad
If I'm on a dedicated server, what is the easiest way to see which machine owns a named group? I have debug console enabled.
server exec groupOwner yourGroupNameHere
Where do I see its output?
It should appear in the one-line field directly below the debug console exec buttons. It will be a number. Make sure you clicked server exec, not global or local.
I'm clicking server exec. I can grab you a screenshot. It's the green one. It's showing me nothing.
u need to local exec to see that yourself.
You can't local exec it because it's a server exec command
thought only the setter is, whoops.
In that case, [format ["%1",str groupOwner yourGroupNameHere]] remoteExec ["systemChat"];
(server exec)
Hmm... It wasn't popping up, but I did get empty quotes "" in the green... feedback(?) bar.
I presume you are replacing yourGroupNameHere with the actual name of the group
[Format ["%1", str groupOwner BA11]] remoteExec ["HintSilent"];
I tried it like this, too, thinking maybe something was hiding the systemChat.
I have replaced it, yes.
And the group currently exists (i.e. hasn't been deleted because all the units died, has been created yet)?
And BA11 is the variable name of the group, not its groupID (callsign)?
It does exist and it's variable name is BA11. It was spawned (maybe) by a headless client. That's what I'm trying to check.
publicVariable it then try it
I'm not sure I understand how to publicVariable the group.
When you create it, you do something like BA11 = createGroup ..., right?
Immediately afterwards, publicVariable "BA11"
Ah, gotcha.
Otherwise that variable only exists on the machine that created it, so other machines have no idea what you're talking about when you give them a reference to it
Ugh! Okay, can do. This would be easier if I could get the HCs on my wife's PC to join her server.
Would it be easier to check the owner of an object in the group? Group leader? Assigned vehicle?
Not particularly. You'd still need to get a reference to the group, a reference the server can understand, in order to determine who is the leader or assigned vehicle.
Hmm.... Well, the fact that it's not correctly adding the groups to high command anymore may be telling me what I need to know about the situation.
I hope posting video is allowed here
https://www.youtube.com/watch?v=034JSbWuppI
When I ordered the AI to move using
domove it seems to be stuck trying to rotate the steering wheel, (the 3d icon in the video is the spot where the AI is supposed to drive to)
Is there any way to fix this?
This only occurs sometimes not always for some reason too
It's very buggy. Sometimes you can move the vehicle slightly and then that kicks the driving AI into doing something.
Nothing special about doMove as far as I can tell, waypoints have the same problems.
well
is there a goto in sqf?
so I can restart the spawning of the vehicle in case its position doesn't change for 4 seconds?
There's breakTo
so
if I place a scopename behind the createvehicle and all that
then breakeTO when this happens
it will recreate a vehicle correct?
no I just want it to redo the creation
not fix the bug
In that case you'd need to delete the vehicle etc.
yeah of course
i'd just have 1 script that loops over all vehicles and checks their position
my problem with breakTo
is I'm spawning a civilian vehicle per player
so using foreach
wouldn't breakTo basically get out of the foreach entirely ?
or would it not if I put the scopename inside its code?
I don't think moving it slightly would fix it, I gave the man a submarine and he didn't even bother to move 1 cm
well, if you told him to move somewhere on land in a submarine...
Militidas is an old pal, he will do silly things such as these
I guess I will have to just delete the vehicle then as breakTo doesn't serve me well
may I offer an alternative, moveOut moveInDriver
i've found when my ai squad gets stuck driving, having them dismount and remount usually fixes it
oh alright I will try that
offer as much alternatives as you can
lol
well I have noticed civilians become this frozen every 1 in 5 restarts in SP
i don't do a lot with ai, i'm much better with finding syntax problems tbh
yes
you pretty much summed %90 of arma 3 scripters lol
tbf it's not a secret that the ai is kinda janky
will triggers still work if the type/activation is set to none?
sadly not working
they do walk to the move position
but not drive
I guess altis have not got enough driving courses
this is real bad, chronic even.
it seems in multiplayer these keeps happening for some reason
so after removing a mod this error has been popping up, does anyone know how I can remove this?https://cdn.discordapp.com/attachments/735132698603159562/977503422163079208/unknown.png
i can add damage to a players overall damage using this:
player setDamage (damage player + 0.1);
how would i add damage to the legs only?
player setHitPointDamage (player getHitPointDamage ["hitLegs", + 0.1]); // does not work
Anyone know what the rendering limit of drawLasers is? I tried to render 100 lasers but only maybe 2/3 can show at a time. Just curious on the exact number.
okay got it working like this.
_damageLegs = player getHit "Legs";
player setHit ["legs",(_damageLegs + 0.1)];
Try this, just some syntax rearranging
player setHitPointDamage ["hitLegs", (player getHitPointDamage "hitLegs" + 0.1)];
that's also wrong
+ has higher precedence
player setHitPointDamage ["hitLegs", (player getHitPointDamage "hitLegs") + 0.1];
Forgot binary operators have lower precedence ๐
Aight this has been some real bamboo skewers under my fingernails.
When typing out a command, it'll have a little popup with the syntax, and that's super useful - but I can't figure out under what conditions it appears, and what makes it disappear, because I'd love it to stick around more often.
Debug console? You can click on the command and it does bring back the syntax at least. Maybe that's CBA-specific though.
That works like... a third of the time? Most the time it will bring up the autocomplete prompt, not the syntax :c
hi just wondering... can i repeat this code alot more times if i use othersound1 and soo on?
Thank you very much. { pets head, good doggie }
Any clue why some markers, placed by server, would be transparent even though I'm explicitly setting alpha to 1 on each one. I'm doing this in a loop and setting a considerable amount of markers so I think it may be a race condition. ๐ค
are they created via script?
correct, they are created using createMarker in a loop
Just to confirm, you are sure they all have unique string for name right?
When you say transparent then I have to assume you have already checked that they do actually exist
are you on the same channel as the marker channel?
Yea I'm using hashValue _name to make a unique marker name and I'm sure they do exist, seems like they are skipping the _marker setAlpha 1 line completely but then again, if I don't add the latter I still get the same results.
is there a way to explicitly set the channel via script?
the command itself has an arg iirc
`createMarker [name, position, channel, creator]`
that sounds about right because different channels show up transparent as such ๐ฎ
well instead of setting the marker channel just change your own channel
open chat and use the up/down keys to set the channel
iirc , (<) and . (>) can be used too
switched to global channel and it works!!!!!
Adding setCurrentChannel 0 to my player's init is the fix, thanks @tranquil jasper @little raptor Cheers!
i know, i asked that before but trying to make the progress of an holdAction resume where it stopped, but i can't figure it out, could someone pls help?
here is an example:
private _generator = getPosATL player nearestObject "Land_PowerGenerator_F";
[
_generator,
"",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_requestLeadership_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_requestLeadership_ca.paa",
"_this distance _target < 2",
"_this distance _target < 2",
{},
{hint "...repairing generator..."},
{hint "Generator repaired!"},
{hint "Repairing aborted!"},
[],
100,
nil,
true,
false
] call BIS_fnc_holdActionAdd;
@drowsy geyser
any idea on how to spawn boats at all docks? Should I just look for dock classnames nearby and spawn boats there or something? basically is there an existing script for ambient civilian boats spawning in docks
I guess this is what you should do:
_newDuration = (_this#20 * (1 - _progress/_maxProgress)) max 0;
_this#3 set [20, _newDuration]
max progress is 24
you can save the progress in the progress code:
params ["_target", "_caller", "_actionId", "_arguments", "_progress", "_maxProgress"];
_this#0 setVariable ["my_actionProgress" + str (_this#2), _progress];
and get it in the abort code:
_progress = _this#0 getVariable ["my_actionProgress" + str (_this#2), 0];
try this
private _generator = getPosATL player nearestObject "Land_PowerGenerator_F";
[
_generator,
"",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_requestLeadership_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_requestLeadership_ca.paa",
"_this distance _target < 2",
"_this distance _target < 2",
{},
{
params ["_target", "_caller", "_actionId", "_arguments", "_progress", "_maxProgress"];
_target setVariable ["my_actionProgress" + str (_actionId), _progress];
hint "...repairing generator..."
},
{hint "Generator repaired!"},
{
_progress = _this#0 getVariable ["my_actionProgress" + str (_this#2), 0];
_newDuration = (_this#3#20 * (1 - _progress/24)) max 0;
_this#3 set [20, _newDuration];
hint "Repairing aborted!"
},
[],
100,
nil,
true,
false
] call BIS_fnc_holdActionAdd;
I doubt it
ok
is it _newDuration = (_this#20 * (1 - _progress/24)) max 0;
or _newDuration = (_this#2 * (1 - _progress/24)) max 0;?
i just tested this but if i stop and then try again the progress gets much faster than before
that's the idea
wait much faster? 
yes its like a cheat
you should expect the progress to go much faster because last progress time has been removed from the total length...
yes but if you spam the space button then you can finish the holdaction in 1 second
I wish I could help more, I think the hold actions are really ๐ค๐ค๐ค and I've been meaning to look at the code and figure out how to hack it; but BIS code generally makes me ๐คฎ
so it still doesn't work?
did you try the code again?
yes just did. thank you for the effort, is it possible to save the amount of ticks too so the next time the ticks start where you aborted? for now they start at zero every time.
I don't think so
I didn't see anything the last time I tried
every var was local
ah okay, thank you anyway ๐
just a question is it possible to achieve the same above with this command?
https://community.bistudio.com/wiki/BIS_fnc_keyHold
I'm pretty sure that gets used under the hood in the hold action
I'm trying to hide everything but the wing of an aircraft, but I'm not sure how I should use https://community.bistudio.com/wiki/hideSelection
selectionnames isn't making much sense to me, some categories are not hiding anything, while others are hiding only certain parts
for example even if it set hideselection to false for every selection that has "rudder" in it, the rudder still gets hidden?
Hey guys i found this script that worked a little too well. I want it to not affect opfor units
How would i go about doing that?
0 = [] spawn {
while{true} do {
{
if(_x distance (getMarkerPos "mrk_safe_zone") < 500) then {_x allowDamage false} else {_x allowDamage true};
} forEach allUnits + vehicles;
sleep 1;
};
};
allUnits
Is the culprit; you're going to have to modify that part.
FunctionVariable = { sleep 20; systemchat "20 seconds"; };
{ call FunctionVariable; } foreach allplayers;
if there were 3 players, would this display the "20 seconds" to the one who executed it locally 3 times after 20 seconds? or will it display each one after 20 seconds from the last?
The latter, because it's a call.
Is there anything like a soft terrain or mod script or mod that actively effects vehicles like war thunder?
a spawn will do the former?
Guess what, I fixed it by creating another vehicle, moveing out the AI from the first and making him drive the second
It seems like they don't like their first vehicle for some reason lol
is there a way to arm mines that i've placed in Eden or do i just need to use a minfield module and hope it places them right?
Use units west instead of allUnits.
i'm trying to require cba as an addon in my CfgPathes file and in the menu i just get a black bar.
class CfgPatches
{
class DarkbelgSpeedControl
{
name = "Darkbelgs speed control";
author = "Darkbelg";
requiredVersion = 2.06;
requiredAddons[] = {"cba_common", "cba_events","cba_settings"};
units[] = {};
weapons[] = {};
};
};
What could be wrong with this code ?
A black bar in the center off the screen.
I want to have asymetric respawn settings (west can respawn by tickets and wave, guer don't get to respawn.) My description.ext currently looks like this with regards to respawns
respawnDelay = 120; //Default respawn delay
respawnTemplatesWest[] = {"Base", "Tickets", "Wave", "Spectator"};
respawnTemplatesGuer[] = {"Spectator"};```
I've even tried ensuring that `guer` doesn't have tickets in different ways. Either by script, Module, or multiplayer settings via the editor. I feel like I'm just mission a small detail or overlooking something. Is there any other ways of getting the desired effect above?
```sqf
/* your code */
hint "good!";
/* your code */
hint "good!";
Message #arma3_scripting
{
class flybye
{
name = "EASZombie2";
sound[] = {"sounds\flybye.ogg", 1,1};
titles[] = {0,""};
};
class Othersound
{
name = "...";
sound[] = {"sounds\CBRN1.ogg", 1,1};
titles[] = {0,""};
};
class Othersound1
{
name = "...";
sound[] = {"sounds\fallback.ogg", 1,1};
titles[] = {0,""};
};
};
yay?
ok.. dont do this while drinking.. spotted the issue
giving both of them the same name is probably not a great idea
?
The ```sqf part needs to be on its own line with nothing else afterwards. This will fix the syntax highlighting on Discord.
You have two sounds named "...", this will probably not end well
Othersound and othersound1
You know what? Never mind. Have fun.
thanks for explaining
ahh i see what u mean, thanks
class CfgSounds
{
class flybye
{
name = "flyby";
sound[] = {"sounds\flyby.ogg", 1,1};
titles[] = {0,""};
};
class othersound
{
name = "CBRN1";
sound[] = {"sounds\CBRN1.ogg", 1,1};
titles[] = {0,""};
};
class othersound1
{
name = "fallback";
sound[] = {"sounds\fallback.ogg", 1,1};
titles[] = {0,""};
};
};
```sqf
that's a config
configs are not sqf
use cpp
i fixed it i think?
fix what?
that
wait..

If I have a headless client spawn AI groups, why don't they seem to belong to that HC by default?
If (!isNil "HC1") then {RemoteExec ["ASG_FNC_LCEBA", HC1];} else {[] Spawn ASG_FNC_LCEBA;};```
How would I build around this with something like maybe a setGroupOwner command that the HC can use to make the server give the units back?
are you sure HC1 is not nil? and how do you check the owner?
I'm sure HC1 is not nil. I know the transfer is being made.
I check owner with this line:
[Format ["BA11 is on machine %1.", groupOwner BA11]] remoteExec ["HintSilent", 0];```
From within the script that spawns the groups.
There always remains the chance I missed something in the chain. I'll build in some extra hints for myself.
Why is it telling me they are owned by "scalar"?
group owner needs server exec
you're executing it locally
because BA11 is most likely not defined
Do I need to declare BA11 public to check its locality?
I'm executing groupOwner on the server.
I mean the groupOwner command
no, you can just broadcast the arg together with the remoteExec
tho some delay might be needed
Hmm... how? I am not a coder, so much of this is straight up over my head and all help is appreciated.
Yeah, I noticed that delay helped earlier, it was taking some time to transfer the groups when I was using a different technique.
I was spawning the elements on the server and then using setGroupOwner and checking their ownership, and it took a while for it to update that way.
Now I've gone from that back to my original method of just using my if/then catches to have the HCs spawn the units. I think it's working correctly, but I think that the same reason I can't check their ownership with that technique is the reason they aren't being added to my high command groups.
well in this case since you need callback:
[BA11, {[Format ["BA11 is on machine %1.", groupOwner _this]] remoteExec ["HintSilent", remoteExecutedOwner]}] remoteExec ["call", 2];
I'm executing groupOwner on the server.
you just said
From within the script that spawns the groups.
that wasn't the server
Sorry, that was because I was using two different techniques to understand what was happening with the script. When I was spawning the units on the server, and then using setGroupOwner, the script would tell me the owner at the end, but it was telling me the server was the owner for several seconds before I manually executed it again to get an updated report.
Now I am just using the debug console to check.
This makes sense to me, but I'm unsure how to fix that, or if it even needs to be fixed or if I should approach this in a different way. The group being created needs to be added to high command, and it must be JIP compatible and repeatable.
as you said it yourself, you can publicVariable it
I mean to use the groupOwner command on the server

