#arma3_scripting
1 messages · Page 703 of 1
hm-hmm… commented code
where do you put that?
if it's in object init it's already locally executed
and one ";" too many
no need for remoteExec
not an error
Init field, but I seem to remember that was a big no no if you remoteExec from init field :d
So I should put it somewhere else then
yyyyyyes.
you can put actions in init field
if you intend it to be there for the whole lifetime of the object
but without remoteExec
I run it through Zeus code executor, as global & jip. Still no luck. We see the addAction but only the one who presses the action sees the smoke..
Run it as local through the same code executor and no luck.
I can't wrap my head around this..
Could it be because the addAction is remoteExec'ed, that it doesn't remoteExec the CBRN_fnc_spawnMist?
Because if I run the fnc_spawnMist through the code executor, my friend does see the smoke.
obviously you have to remote exec the function inside the addAction
not the addAction itself
altho it depends what that function does
but according to your description I'm gonna guess it does need it
Any tips on that? Very overwhelming for a beginner. I understand the concept, but getting everything together seems like a great hassle.
see the pinned messages
Cheers mate. Probably got it working now. Put the remoteExec of fnc_spawnMist part on a seperate .sqf, and remoteExec'd a addAction that launches the said .sqf.
instead of doing this:```sqf
_var1 = "a";
_var2 = "a";
_var3 = "a";
_var4 = "a";
```sqf
{
_x = "a";
} forEach [_var1, _var2, _var3, _var4];
```?
wait what
I mean instead of creating many variables, just use a single array
and use the array elements
okay
another question: if im not using any AI in my mission, will it still screw things up to change setFriend during the mission?
¯_(ツ)_/¯
guess i'll find out
_a _a _a _a stayin' alive, stayin' alive
Can I pester someone for some help?
["a", "a", "a", "a"] params ["_var1", "_var2", "_var3", "var4"];
// or
private ["_var1", "_var2", "_var3", "_var4"];
for "_i" from 1 to 4 do
{
call compile format ["_var%1 = 'a'", _i];
};
both genuinely horrible solutions, as @little raptor's reaction will be proving 😁
no, but you can ask for assistance ^^
well if you want to do that, why not just:
_vars = [[], []];
for "_i" from 1 to 20 do {
_vars#1 pushBack format ["_var%1", _i];
_vars#0 pushBack "a";
};
_vars#0 params _vars#1;
i'll just do it the old fashioned way
let's see who can get the dirtiest code 😂
you forgot to put it inside an if ( true )
that's implied, of course
no that would be cheating
When I run this script I get an error saying missing ) on line 52. This is the line but I don't see the issue with it: sqf if (_Spawntarget distance _x ˃ _Deletedistance) then { deleteVehicle _x; };
try above
post the other lines
at least line 51
I guess you have a missing ;
{
_EditGroup = _x;
for "_i" from count waypoints _EditGroup - 1 to 0 step -1 do { deleteWaypoint [_EditGroup, _i];};
_NewGroupWayPoint = _EditGroup addWaypoint [position _Spawntarget, 0];
_NewGroupWayPoint setWaypointType "MOVE";
{
if (_Spawntarget distance _x ˃ _Deletedistance) then { deleteVehicle _x; };
} forEach units _EditGroup;
} foreach (allGroups select {side _x == _Spawnside && (_x getVariable ["spawned",true])});
sleep (random [_Spawnmindelay,_Spawnavgdelay,_Spawnmaxdelay]);
};
That the segment.
your > character seems weird:
it doesn't show in the game
therefore not the actual > character
yep
it's char 707
definitely not ASCII
ASCII for > is 62
Ah thanks that fixed the issue. I couldn't work it out for the life of me.
copy pasting from the web can be misleading sometimes unfortunately (“ quotes ” included)
also using non-English language when typing can lead to these issues
not all non-English languages... 
if (_jeSuisFrançais) then
{
hint "Ça marche, biches !";
};
``` (was just testing the syntax highlighting)
no
iirc, in C# one can name their variable ☺ = 33;
need a ticket? 😛
I guess this'll work
that's actually great
no more “ ” either nor > (707) I assume!
well the 707 one cannot be displayed at all 
“ ”
this was correct tho
I was using \w+ in regex
changed it to [_a-zA-Z0-9]
noice
so how'd I trigger a mission failure if the player leaves the AO? using a trigger?
there might be a built-in module or function in eden that I haven't discovered yet
if the player is not present you mean…? 😉
while I could make a simple approach using triggers, I'm debating if I should make a script that constantly swarms the player with missiles from random directions
mhm. that would definitely work
oh, there is a BIS script that instakills if needed
maybe playing the missile warning sound before exploding? hmmmm that could work
for infantry it uses a mine, for vehicles a rocket, for anything else setDamage 1 ^^
ooo very nice. you know its name?
BIS_fnc_neutralizeUnit
https://community.bistudio.com/wiki/BIS_fnc_neutralizeUnit
aaaaaaaaah.
"neutralize" >literally obliterates
I was using ctrl+f with "kill" or "destroy" but naah euphemism
well, he's "neutralised"
I went with "disable", but I browsed the whole functions list twice to find it
disabled is the very best outcome
now I just need to find the missile beeping sound
just spawn a missile instead, ez fix
that's my original idea
pretty sure i had a script somewhere for it 🤔
it would be cool but I'm not really sure how to implement it
params [
["_target", objNull, [objNull]],
["_minMissiles", 1, [0]],
["_maxMissiles", 6, [0]],
["_minDistance", 1000, [0]],
["_maxDistance", 6000, [0]],
["_missileTypes", ["ammo_Missile_s750"], [[]]]
];
if (isNull _target || {!(_target isKindOf "Air") || {_missileTypes isEqualTo []}}) exitWith {false};
private _cfgAmmo = configFile >> "cfgAmmo";
private _targetPosition = getPosASL _target;
for "_i" from 1 min _minMissiles to _minMissiles + round random (_maxMissiles - _minMissiles) do {
private _type = selectRandom _missileTypes;
private _missile = createVehicle [_type, [0, 0, 0], [], 0, "CAN_COLLIDE"];
private _missilePosition = AGLToASL (_target getPos [_minDistance + random (_maxDistance - _minDistance), random 360]) vectorAdd [0, 0, _targetPosition # 2 + random 500];
_missile setPosASL _missilePosition;
private _vectorDir = _missilePosition vectorFromTo _targetPosition;
_missile setVectorDir _vectorDir;
_missile setVelocity (_vectorDir vectorMultiply getNumber (_cfgAmmo >> _type >> "maxSpeed"));
_missile setMissileTarget _target;
};
but they obviously can flare the missile, if in the plane 😄
spawn them until player is not alive xd
replacing that "for" with "while"
wrap the spawning part into isNil { } then
that's a function, right? how do I make those work in my mission? I read you need to mess with a file on mission root
freshly rewritten!\®
true, it was like 3years old
bis_fnc_neutralizeunit works in a very similar way apparently, but far less customiseable
it was mostly mixing up function definition and function declaration! ^^ haaa, I feel lighter after that really 😃
ohhh, i see 😄 
I'll take a look at this
it's a lot better now actually
also, question. does trigger performance degrades with its size?
thanks! that was the hoped result 😄
writing a function has been split to https://community.bistudio.com/wiki/Arma_3:_Writing_a_Function
i'd imagine it doesn't, but not sure how exactly it's done
it does by its list, in a way
yea, but you could have many objects in a small trigger area, and it would basically mean the same as a big area with small amount of objects
yep yep
just worth mentioning that "any object" triggers waste perfs :p
anyway
don't use triggers
problem solved 😄
I'm trying my best to avoid them. so, how do I make a rectangular AO that the player is not allowed to leave?
a trigger without any conditions / a map marker + inArea 🙂
thanos-back_to_me.wav
I wonder if the zeus "hide map" module would work with inArea
hmm... vehicle crew bails out of the vehicle when it has critical damage despite the vehicle being locked. is there a way to stop this?
yes
you're welcome.
https://community.bistudio.com/wiki/allowCrewInImmobile 😜 @undone flower
super epic
nah, Steam only 😉
{
(vehicle _x) allowCrewInImmobile true;
} forEach {allUnits};
will this work?
no
1/ forEach takes an array, not code (forEach allUnits
2/ only for units already in a vehicle at the time
3/ a bit redundent, try using vehicles
@undone flower ↑
{
_x allowCrewInImmobile true;
} forEach (vehicles);
like this?
Anyone know a way to make both units in a two-seater plane eject on mission init? I've tried putting [this] spawn BIS_fnc_PlaneEjection; in the init of one of SOG's F-4s, and only the front seater would eject. Today, I tried it with Firewill's F-15D, and the front seater was ejected, but not with the seat, and the back seater went down with the ship like in the F-4.
Multiplayer compatible method preferred
yeah don't put stuff in init fields for MP
initServer.sqf
and use the SOG VN_fnc ejection method
actually, I'm trying not to have sog as a dependency, I just used the F-4 to test cause it's a two seater
I guess I'll just make sure no one tries to unpack the mission .pbo files I've made for my group...
I say that for you, not the Script Police
the vanilla ejection seat function does not work for two seaters
as you discovered. SOG:PF has a special function for it, maybe Firewill's plane too?
I might try digging around in the configs again but Im not very experienced in that so it wont be fun. Ive also tried using a simple pilotname action eject (with proper syntax im on mobile rn) but to no avail.
If i cant figure something out ill just start the players on the ground
could I declare variables from an if exitWith statement, like this:
_var = if ( condition ) exitWith { "value" };
also, is the exitWith code executed in the same scope as the rest of the script?
yes you can but you would do something like this:
private _flavor = call {
if (condition) exitWith {
"apple"
};
if (condition) exitWith {
"pear"
};
};
so that the exitWith only exits that scope and not your whole script
that wouldn't make sense. since the exitWith exits your script, so you cannot get to your variable again
im doing it in a function, which I call
setting local variable from higher scope?
His method won't exit your function, like yours did
its actually faster than using a switch as well, but its a lot more writing.
_result = call {
if (false) exitWith {};
if (false) exitWith {};
if (true) exitWith {};
if (false) exitWith {};
if (false) exitWith {};
}; // 0.0032 ms
_result = switch (true) do {
case (false): {};
case (false): {};
case (true) : {};
case (false): {};
case (false): {};
}; // 0.0047 ms
yeah, the thing is my "apple"s and "pear"s are actually huge arrays
Like maybe you actually want
if ( condition ) exitWith { _var = "value" };
do I need to terminate my single run scripts? or they're automatically unloaded?
when they end, they are gone
ahh good
#define switch(x) private __switch__ = x; call
#define case(x) if (x == __switch__) exitWith
switch(_var) {
case(bla) {
};
case(blabla) {
};
};
```
still forgot to wrap it in an if (true)
put this in your init.sqf
if (isServer) then {
[] spawn {
waitUntil {time > 0};
crew plane1 apply {
if (alive _x) then {
_x action ["getOut", _x];
};
};
};
};
you can try "eject" as the action but I find its buggy sometimes, I just use getOut. make sure your units have parachutes if you want
put this in your init.sqf
if (isServer) then {
initServer.sqf be like 🙄
yeah, but this guy asking the question is super super new. made it as plug and play as possible for him
Hello everybody, i got a problem with a script of mine. I want to spawn a Praticel effect after a player interacts with a object. In the Editor on my test mission it just works fine but when i put it on my Server it dose not work anymore. Dose someone know why?
This is the code i use to spawn the effect:
_smoke = "#particlesource" createVehicleLocal _pos;
_smoke setParticleParams [
["\A3\Data_F\ParticleEffects\Universal\Universal", 16, 7, 16, 1], "", "Billboard",
1, 8, [0, 0, 0], [0, 0, 2.5], 0, 10, 7.9, 0.066, [2, 6, 12],
[[0, 0, 0, 0], [0.05, 0.05, 0.05, 1], [0.05, 0.05, 0.05, 1], [0.05, 0.05, 0.05, 1], [0.1, 0.1, 0.1, 0.5], [0.125, 0.125, 0.125, 0]],
[0.25], 1, 0, "", "", _smoke];
_smoke setParticleRandom [0, [0.25, 0.25, 0], [0.2, 0.2, 0], 0, 0.25, [0, 0, 0, 0.1], 0, 0];
_smoke setDropInterval 0.1;
createVehicleLocal
local means on the current machine
keep it local though as a particle effect. just turn it into a function and call it on the machines you want it to
note sure if it works with particle effects
even if it does, setParticleRandom has local effect
this would be better
thank you guys, but i want that all players can see it. Is that possible if i make a local function?
all players can see it if you create it locally on every machine
does that make sense?
it dose xD. Thank you so much ❤️
all players can see it
just not exactly the same thing
not different enough for you to care about it for your application though
in years of using remoteExec for the Nimitz catapult smoke, noone ever complained about not seeing the exact same smoke. Hope I didn't jinx it now
you create the particle source locally right?
yes
doesn't seem to work. Also, I'm not super new, it's just a pain figuring out the syntax and this is one of the few things I can't find a solution for on google. I think I'll just spawn the units in the air in a parachute but thanks anyway
you want them to be ejected at the start of the game?
Yeah
this is the main code for the Unsung F-4 two seater, derived from the F-18F two seater: https://sqfbin.com/idudayedajolubopesis not sure if you have an ejection seat et al in the mission available for all planes?
the whole function is here: https://tetet.de/arma/arma3/Download/unsung/fn_ejection_twoseater.sqf
Ok I am in need of of help again
taskState task3 == Succeeded
I cant get this simple as condition to work
Yes
["task3"] call BIS_fnc_taskState == "SUCCEEDED"
thank you bro
like I just switched the condotion to the bis one but I got the variable wrong xd
anyways thanks a lot
New problem, I have set another script to activate when task 3 is completed but it activates when task1 is completed
the task1 completion trigger doesnt have anything in the activation so idk what causes that
it does it sometimes, sometime it doesnt
pretty weird
If I'm making code in initPlayerLocal.sqf can I use player to reference the current client in MP? Like if I wanted to give that one person an addAction I could do
player addAction ["Play Intro", {[] execVM "introLocal.sqf";}];
and it would only execVM "introLocal.sqf" for that client?
yes, because player is only local to that machine
Another noob question from me - is it possible to specify some commands to be executed when a script is terminated?
I know it's better etiquite to use exitWith, but I've got a 5-minute sleep timer running for a spawn protection script, as I don't want "x minutes since mission start" flooding the chat. I'd love to be able to allow damage upon the script terminating, rather than having a second script or putting it all in a trigger on-activation field.
and then in introLocal.sqf if I did
cutText ["", "BLACK OUT", 0];
it would only make their screen black? Because it's only running for them?
yes, plenty of ways. post your script on sqfbin.com and paste it here, its probably easier than you are making it out to be.
Will do, thanks
depends where you are calling "introLocal.sqf"
if you accidentally call it on a dedicated server, nothing happens with your cutText
_pis = true;
{_x allowDamage false} forEach ((getMissionLayerEntities "Spawn") select 0);
{_x enableSimulationGlobal false} forEach ((getMissionLayerEntities "Enemies") select 0);
{doStop _x} forEach ((getMissionLayerEntities "DoStop") select 0);
while {_pis == true} do {
chief sideChat "Weapons are cold, AI disabled -- Waiting for all players to leave spawn";
sleep 540;
};
//The trigger activation:
//terminate sp;
Ideally, I just want to toggle simulation for the spawned enemies and damage for players upon termination.
So I would have to [player] execVM "introLocal.sqf"; and take the param into introLocal.sqf and then remoteExec for that client? Like...
introLocal.sqf
_player = (_this select 0);
{ cutText ["", "BLACK OUT", 0]; } remoteExec ["call",_player];
@still forum lmao is it that bad?
is bed time
walks away quickly
It's just sitting in my mission folder, called in my init.
also, I can definitely wait. Help wagons first, 'cause he seems like he has more of an idea what he's doing.
i have to be somewhere in 15 min for a few hours but if someone doesn't get to you before I get back, i'll continue it depending how long you are staying up
no. I would just use initPlayerLocal.sqf and write the script in a spawned scope within that (if you have other local stuff to do). and write it as normal since that initPlayerLocal.sqf will only fire on local machines
Much appreciated. Would you mind pointing out what exactly makes my code so atrocious so I can do some independent study in the meantime? I'd assume it's the sleep command.
its the whole loop plus i wouldn't use getMissionLayerEntities I'd do something like make a trigger area and use that area for doing things with the units inside. You also don't need to do doStop to disable ai, just hide them and disable their simulation
Alright. Going to be a very crammed initPlayerLocal.sqf
it just needs to go back to the drawing board first organization wise, but that will come with more understanding.
Thanks!
Note!! Arma 2: CO
Why does this https://sqfbin.com/mojojicebiralojasiyi print
this stuff in globalChat: civ31 was spotted near Location NameCity at 10314, 2159!
Even the coordinates make no sense 😄
_wantedCiv is grabbing the civilian variable, not the name of the unit
Ah, I see
Oh yeah, that was intentional (just for testing)
and then just making sure if I do cutText ["", "BLACK OUT", 0]; in initPlayerLocal.sqf will it only make that player's screen black or will I need to remoteExec it? (In MP)
But that Location NameCity at 10314, 2159! still puzzles me
why are the coordinates wrong?
10km east and 2km north from map corner
looks viable to me
only make that players screen black, you are correct
It should print "Elektrozavodsk" though?
think theres a command to get the name of a location
Sweet! Thanks for the help!
NameCity is the type of the location
name can do locations I believe
When argument is Location, the location's name is returned
@tender fossil use name before the location variable on the formats for your global chats as well
Rgr, trying it now
Unfortunately it doesn't work, it prints an empty string then
To return the textual value of a location use text command instead. try that
If the argument is location, returns location's text value (see Alt Syntax).
I see, trying it now
In my Description.ext I've set
respawnDelay = 0;
respawnOnStart = 1;
and the player does have a respawn (module) but they spawn in debug at the start of the mission for some reason.
It works! Thanks 🙂
can someone please give me an example of what the waypoint index would be used for as a parameter in addWaypoint?
https://community.bistudio.com/wiki/addWaypoint
to add waypoints between existing ones
eg the group already has 2 waypoints to move to a location but at some point they encounter enemies and now you can insert a SnD waypoint between the two move waypoints
the new behaviour is: Move > SnD > Move
If I spawn a missile with BIS_fnc_exp_camp_guidedProjectile can I force a flight profile? Specifically Cruse.
did anyone have the answer for this?#arma3_scripting message
okay, so I can assign a waypoint any number I want, and they will be followed in order of ascending value
most likely the case, though I am not sure what happens if you give them an index of 100 or similar
ok
if (side player == west) then {
_subtitles = [
[ "System", "Loading, please wait. This may take some time...", 0],
[ "System", "Almost done, final touches...", 10],
[ "System", "Loading complete, transmitting data...", 20]
];
_subtitles spawn BIS_fnc_EXP_camp_playSubtitles;
sleep 30;
0 fadeMusic 0;
sleep 0.1;
titlecut ["","BLACK IN",7];
playMusic "EventTrack01a_F_Tacops";
6 fadeMusic 1;
_camera = "camera" camCreate [12031.02,4828.08,0.92];
_camera cameraEffect ["internal", "back"];
_camera = "camera" cameraEffect ["terminate", "back"];
camDestroy _cam;
sleep 30;
};
``` trying to get a camera to work
it works fine, but it wont leave the camera at the end
any idea why?
Yes
Wrong usage of cameraEffect @tight cloak
plus, you create and destroy the camera immediately
Dang. Got the darn thing to work 😄 https://sqfbin.com/muhunomanabusomicawi
Me gusta
Except that it does this, and I don't have the slightest clue why https://i.imgur.com/S3mEmCR.png 😄
any help? i looked at the wiki and had a stroke trying to figure it out
ive added a sleep between creation and termination
look at both your usages of it
the two syntaxes are different (the 2nd is wrong)
if (side player == west) then {
_subtitles = [
[ "System", "Loading, please wait. This may take some time...", 0],
[ "System", "Almost done, final touches...", 10],
[ "System", "Loading complete, transmitting data...", 20]
];
_subtitles spawn BIS_fnc_EXP_camp_playSubtitles;
sleep 30;
0 fadeMusic 0;
sleep 0.1;
titlecut ["","BLACK IN",7];
playMusic "EventTrack01a_F_Tacops";
6 fadeMusic 1;
_camera = "camera" camCreate [12031.02,4828.08,0.92];
_camera cameraEffect ["internal", "back"];
sleep 30;
_camera cameraEffect ["terminate", "back"];
camDestroy _cam;
sleep 30;
};
would this work then?
most likely yes.
@winter rose Wanna save me once again?
nope 😄
🥲
getting more general errors in expression
you throw in 200 lines of code and say "this doesn't work", soooooo hmyeah ? 😬 ^^
and its playing the subtitles before the cam / cam not at all
It does work, it just prints an extra line 😛
the error seems to be with sleep
Two extra lines, no?
getting invalid number in expression now
if (side player == west) then {
_subtitles = [
[ "System", "Loading, please wait. This may take some time...", 0],
[ "System", "Almost done, final touches...", 10],
[ "System", "Loading complete, transmitting data...", 20]
];
_subtitles spawn BIS_fnc_EXP_camp_playSubtitles;
sleep 30;
0 fadeMusic 0;
sleep 0.1;
titlecut ["","BLACK IN",7];
playMusic "EventTrack01a_F_Tacops";
6 fadeMusic 1;
_camera = "camera" camCreate [12031.02,4828.08,0.92];
_camera cameraEffect ["internal", "back"];
sleep 30;
_camera cameraEffect ["terminate", "back"];
camDestroy;
};
I don't care what, I care where
now you camDestroy nothing
Please read the wiki
i have 😦 im just slow
also look for https://community.bistudio.com/wiki/Camera_Tutorial
I mean the
was seen in 0x1713844!
line
I see it thrice
Yes, it's just because of the loop
ok
so you get two outputs each time, ok
Yes
I think it's the broadcast?
Here's the code
ISSE_pub_varCount = _this select 0;
ISSE_pub_varNum = _this select 1;
ISSE_pub_varName = format["ISSE_pub_Pstr_%1", ISSE_pub_varNum];
for [{_i=0}, {_i <= (ISSE_pub_varCount)}, {_i=_i+1}] do
{
_varName = format["ISSE_pub_Pstr_%1", _i];
call compile format['%1 = " ";', _varName];
_varName addPublicVariableEventHandler {call compile (_this select 1);};
};
broadcast =
{
if ((TypeName _this) == "STRING") then
{
call compile format['%1 = ''%2'';', ISSE_pub_varName, _this];
publicVariable ISSE_pub_varName;
call compile _this;
//player groupchat str _this;
}
else
{
hint "Public Error: expecting String.";
};
};
ISSE_pub_execStr =
{
if ((TypeName _this) == "STRING") then {call compile _this;} else {hint "Public Error: expecting String.";};
};
This is like 10-15 years old code 😄
oaky i cant figure out cam stuff.... so
i just blended two of my broken scripts together
the one that keeps you stuck in the cam
and the one that blips you in and out
its....
horrific behind the scenes. but looks good
it serves its purpose
You just leveled up and gained the skill of understanding how most of the world's IT works!
so i use
if (side player == west) then {
_subtitles = [
[ "System", "Loading, please wait. This may take some time...", 0],
[ "System", "Almost done, final touches...", 10],
[ "System", "Loading complete, transmitting data...", 20]
];
_subtitles spawn BIS_fnc_EXP_camp_playSubtitles;
sleep 30;
0 fadeMusic 0;
sleep 0.1;
titlecut ["","BLACK IN",7];
playMusic "EventTrack01a_F_Tacops";
6 fadeMusic 1;
_camera = "camera" camCreate [12031.02,4828.08,0.92];
_camera cameraEffect ["internal", "back"];
};
_camera cameraEffect ["terminate", "back"];
camDestroy camera;
to start it
then
if (side player == west) then {
_subtitles = [
[ "System", "Loading, please wait. This may take some time...", 0],
[ "System", "Almost done, final touches...", 10],
[ "System", "Loading complete, transmitting data...", 20]
];
_subtitles spawn BIS_fnc_EXP_camp_playSubtitles;
sleep 30;
0 fadeMusic 0;
sleep 0.1;
titlecut ["","BLACK IN",7];
playMusic "EventTrack01a_F_Tacops";
6 fadeMusic 1;
_camera = "camera" camCreate [12031.02,4828.08,0.92];
_camera cameraEffect ["internal", "back"];
sleep 30;
_camera cameraEffect ["terminate", "back"];
camDestroy camera;
};
to get out of it
XD
but im gonna change some stuff such as the lines of text
and add a cut music line
how come my code only works when it wants to 
sometimes it works fully. sometimes only partially. sometimes it just doesn't
what is your code? @undone flower
{
(objectParent _x) setVehicleCargo objNull;
} forEach (thisList);
This runs in a "move" waypoint and goes in the "on activated" field. it paradrops the vehicles inside another vehicle. "thisList" returns the array of both pilots
as far as I can tell that should work
not sure why it would only work sometimes
(im sure someone else will know why)
if I execute the same script on the debug menu it works
ahhh, I see now. setVehicleCargo objNull only works if the vehicle CAN eject the vehicle inside. if the conditions are unsafe, it won't work
What exactly would cause a 'safepositionanchor/' is not a class ['type' accessed] Nothing in the RPT
Is there a script to make a Vehicle drive along a road?
Is there any way to log every chat message sent in side/global channel to log file?
then maybe also set behaviour to careless
i'm back, let me look over it again
Thanks for the offer, I ended up just using triggers for now. Surprisingly, despite being held together with popsicle sticks and glitter glue, it functions.
here's mine. just make a single trigger area and name it and edit its name in the script. script has to be executed in scheduled environment (execVM). Execute it only on server.
https://sqfbin.com/exotixuhevirogosodig
hello im having some trouble
hopefully someone will be able to help me
so i have this script here
if ((side _x) == east) then { pc1 doFollow (side _unit);
};
(x) and (unit) need to be defined
but i do not want them defined with a unit name
I want them basically defined as any OPFOR
hopefully that makes sense
Hi!
I'm trying to add death markers when anyone dies. It works with the first death and guess I have to add a counter to the marker name.
Can someone please help me with that?
_x addEventHandler ["Killed", {
_marker = createMarker ["Death", getPosATL (_this select 0)];
_marker setMarkerShape "ICON";
_marker setMarkerType "KIA";
"Death" setMarkerColor "ColorWhite";}];
} forEach allUnits;```
}``` would this work?
No...?
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
@brittle harness @verbal geyser
Marker names have to be unique
I would suggest something like this for singleplayer:
_x addEventHandler ["Killed", {
private _marker = createMarker [format ["Death %1", PPR_markerID], getPosATL (_this select 0)];
PPR_markerID = PPR_markerID + 1;
_marker setMarkerShape "ICON";
_marker setMarkerType "KIA";
_marker setMarkerColor "ColorWhite";
}];
```Put `PPR_markerID = 0;` into an init script that runs at the beginning of the mission.
That does make sense, but we need to know more about the surrounding code and the context in order to help you 🙂
@willow houndThe original code worked, but only for first death. Edited code doesn't work at all. Or maybe I'm just too stupid 😋
Do you still have this mission? Would like to see how you made the setup 🙂
Huh i can look but probably not
I have a video of it but thats probably not helpful
heres a download link, it has a pretty big mod setup so you might not be able to start it, the shooting range is at IRON/Schiessbahn. Theres some REALLY bad code in that mission so dont judge me 😄
I changed it a bit, I made a mistake in there 🙂
Awesome man! I will try, thank s :)
Thanks everyone who helped me! I finally gave birth to this script with your help. Makes me a proud dad 🙂 https://sqfbin.com/pagosukojevonemumiyi
Oh, and @fallow quarry edited it too
@willow houndSeems to be working. Will test it live soon. Thank you very much. 👍
so you want something to apply to all units that belong to opfor?
if (local this && isPlayer _this) then {
[true] call ACE_spectator_fnc_setSpectator;
};
doesn't work
local _this = me want object not array
local this = no me want defined variable
this is called via onPlayerRespawn.sqf
is this one of those rumbly cases where I have to go for _x?
Even tho its not a loop
wat?
look at the BIKI
The player is always local to the client where onPlayerRespawn.sqf runs and the player is also always a player.
So as far as I can tell you should be able to call ACE_spectator_fnc_setSpectator without that if-statement.
I did thanks
ty
@willow hound is there a way in ZEUS to execute code for a spicific player? never did that before
not sure where this goes, just kinda guessed it was here because its maybe scriptable - how would I change an existing vehicle to allow shooting from the passenger seats?
not scriptable
yeah
look at this mod:
https://steamcommunity.com/sharedfiles/filedetails/?id=2562088211
@willow hound Do you know if that execute field is local to the client?
Or will it fire [true] call ACE_spectator_fnc_setSpectator; on all cleints like when someone puts it in an objects init field?
Would _this call ACE_spectator_fnc_setSpectator; be better?
while {true} do {
if ((date select 3) == 4 && (date select 4) == 0) then {
waitUntil {alive ifvD && alive ifvG};
[player,"AmovPercMstpSnonWnonDnon_exercisePushup"] remoteExec ["playMove"];
[player,"AmovPercMstpSnonWnonDnon_exercisePushup"] remoteExec ["playMove"];
{
_x disableAI "all";
_x action ["Eject", vehicle _x];
_x switchMove "Acts_Dance_02";
_x switchMove "Acts_Dance_02";
_x enableAI "all";
}forEach units west;
};
};
I'm trying to make it so that when its 4:00 in game the players start doing push ups while the enemy soldiers dance (its a joke), but when it hits 12:00 the code is executed but then it keeps looping the same code even when it is supposed to end because its not 4:00 anymore, what is the problem?
Eh, not a fan of while loops
I'm wondering if there's an event handler of some sort you can use
while {true} do {
if ((date select 3) == 4 && (date select 4) == 0) then {
wat?
plus your while loop has no sleep
edited it lol
sorry
how does that affect?
also what delay do I need to add?
you mean the code is being executed multiple times when it hits 4:00? oh ok lol
sound
Yeah it doesn't make much sense. But I'm more concerned about the while loop. Not a fan
well the code is executed in an instance so I guess the microseconds it takes for the simulation to switch from 4:00 to 4:01 makes the code repeat itself like 17 times before the condition switches to false
Yeah, just feel there's a better way
I wanted it to verify the if statement every frame, so I used while, I'm not sure if there is a better way
while can execute many times every frame
I know that I just wanted to simplify the idea lol, but thanks
holy moley
I do not know that, but perhaps the people in #zeus_discussion do.
Hey its me again, i got a question about the sleep command. Dose it stop the execution of all scripts or just the one its in?
Works but the cam doesn't move or change view direction.
params ["_pipTarget", "_source"];
_cam = "camera" camCreate [0,0,0];
_cam cameraEffect ["External", "Back", _pipTarget];
/* make it zoom in a little */
_cam camSetFov 0.7;
/* attach _cam to _source cam position */
_cam attachTo [_source, [0,0,0], "PiP0_pos", true];
/* switch _cam to NVG */
_pipTarget setPiPEffect [0];
/* adjust uavcam orientation */
addMissionEventHandler ["Draw3D", {
_dir =
(_source selectionPosition "PiP0_pos")
vectorFromTo
(_source selectionPosition "PiP0_dir");
_cam setVectorDirAndUp [
_dir,
_dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
];
}];
_source is not defined
It's defined in the editor when calling the script.
I'm talking about the draw3D EH
neither is _cam
I feel kinda dumb now.
I went to college for this.
I can't believe I forgot about that.
How would I pass that into the draw3d form the rest of the script?
using its arguments
also only create 1 such EH, and do many things in it (if that's what you want to do, e.g. handling multiple cameras)
for performance reasons
I still have the issue of the camera not attaching to the drone correctly.
It gets moved to the drone's location on init, but doesn't move with the drone.
afaik you can't attach cameras
not sure
but I think I couldn't do it the last time
I have it working in another script.
The issue with the other script is that it won't create multiple cams.
But it works exactly how I want it to otherwise.
Works but will only ever do one cam even with the variables being different.
Cam from first will display on device from second.
V1```sqf
/* create render surface */
tv setObjectTextureGlobal [0, "#(argb,512,1024,1)r2t(uavrtt,0.5)"];
uav lockCameraTo [tgt, [0]];
/* create camera and stream to render surface */
uavcam = "camera" camCreate [0,0,0];
uavcam cameraEffect ["External", "Back", "uavrtt"];
/* attach uavcam to gunner uavcam position */
uavcam attachTo [uav, [0,0,0], "PiP0_pos"];
/* make it zoom in a little */
uavcam camSetFov 0.05;
/* switch uavcam to NVG */
"uavrtt" setPiPEffect [0];
/* adjust uavcam orientation */
addMissionEventHandler ["Draw3D", {
_dir =
(uav selectionPosition "laserstart")
vectorFromTo
(uav selectionPosition "commanderview");
uavcam setVectorDirAndUp [
_dir,
_dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
];
}];
V2```sqf
/* create render surface */
tv1 setObjectTextureGlobal [1, "#(argb,512,512,1)r2t(uavrtt1,1)"];
uav1 lockCameraTo [tgt1, [0]];
/* create camera and stream to render surface */
cam1 = "camera" camCreate [0,0,0];
cam1 cameraEffect ["External", "Back", "uavrtt1"];
/* attach cam to gunner cam position */
cam1 attachTo [uav1, [0,0,0], "PiP0_pos"];
/* make it zoom in a little */
cam1 camSetFov 0.1;
/* switch cam to NVG */
"uavrtt1" setPiPEffect [0];
/* adjust cam orientation */
addMissionEventHandler ["Draw3D", {
_dir1 =
(uav1 selectionPosition "PiP0_pos")
vectorFromTo
(uav1 selectionPosition "PiP0_dir");
cam1 setVectorDirAndUp [
_dir1,
_dir1 vectorCrossProduct [-(_dir1 select 1), _dir1 select 0, 0]
];
}];
You can get sqf highlight with
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
wdym v1 and v2?
they're both the same code
just different r2t and objects
Correct.
These scripts run alongside eachother.
ok, so what's the problem?
Evening gents!
(Apologies for the format on mobile👀)
params ["_unit", "_killer", "_instigator", "_useEffects"];
hint ( (str _unit) + " just died!");
}] call CBA_fnc_addClassEventHandler;
How performance hogging would this EH be if
We used it remoteExec ["diag_log", 0]; to record hits/kills so my friends bot can record some form of after action reports?
I'm concerned this could.. kinda run down the server with the amount of times it would be fired if that makes sense?
afaik it's a local event
not sure
it shouldn't have much impact
but why do you remote exec that to every body?
just remoteExec it to your friend
@craggy temple you getting this?
So how do you target a player with remoteExec? Steam user id?
Oh i know, it's because his bot reads the servers RPT file thats why the 0
Then wouldn't it be -2 for server
We use the server log though (the rpt thats on the server) I dont always play the ops so can we get it to server only then?
1 mo
Its 2 yea
The "tv" from the first script is black. The "tv1" from the second script will almost always display the cam from "uav" from the first script, even though, according to the scripts, there seems to be no reason for this.
there is
duplicate r2t names
and not deleting the old r2t
yes, but I mean if you do that for more than these two (or execute the code more than once) this'll happen
also what on earth is this?
"#(argb,512,1024,1)r2t(uavrtt,0.5)"
it must always be 1
not 0.5
or any other number for that matter
Hey, it worked this way, at the chosen resolution.
Even when it is 1 and not 0.5 it changes nothing.
are both uavs the same?
No, one is a Greyhawk and the other is a Darter.
Greyhawk doesn't have PiP0_pos
or PiP0_dir
why do you just copy paste stuff?
check them first
uavcam attachTo [uav, [0,0,0], "PiP0_pos"];
cam1 attachTo [uav1, [0,0,0], "PiP0_pos"];
¯_(ツ)_/¯
It attaches fine and follows the Greyhawk.
then maybe it was the darter that didn't have it
I don't remember which one was which
The Darter also works fine.
you just said one of them doesn't....
if they both work fine then what's the problem?
It just won't render both cams to their separate devices.
it works fine… and shouldn't! tis SQF we are talking about
did you try toying with your PiP video settings?
well for one thing you're setting the textures first
before even creating the r2ts
not sure if it affects anything, but it certainly isn't right
also afaik you shouldn't use setObjectTextureGlobal for r2ts
they're local afaik
Everything I saw online of people getting this working, were using setObjectTextureGlobal.
And it does set it for me.
I didn't say it doesn't set it
anyway, just close the game and start it again
r2t can be buggy in Arma sometimes
if you use an incorrect r2t name even once, the game breaks
change this to 1 too
Overview of issues:
Currently these 3 scripts work.
First script cam doesn't attach or follow its parent.
Second and third attach and follow, but only cam form 2 renders to device from 3.
Rebooted with the suggested changes, zero difference.
Is this code executed together?
If so, put a 1 second sleep between them, it gets fixed
They are executed in the inits of the uavs.
then together
So put 1 sec sleep in one script?
spawn it too
the delay should be at least 1 frame tho. not 1 second
so even sleep 0.001 should work
it means at least 1 frame
Okay, sleep 1; in one of the scripts fixed script two and three.
Script one is still busted.
Not always according to my experience.
time cannot advance if frameNo doesn't advance
so yes, always.
make it both spawn, do one 10 seconds later or something to make sure. I assume everything in script is right of course.(I blame mission initialization)
Script one is executed when interacting with the device through addAction
Just some advice:
You can use an "array apply" + sorting to shorten your spotting main by a lot. And the second function could benefit a lot from a "switch case"
did you even fix the variables?
The issue is still the fact that it does not attach with attachTo.
check your variables then
put a systemChat in your code
systemChat str [_cam, _pipTarget, _source];
you can also try removing the followBone parameter from attachTo
If I do "name _vehicle" but _vehicle is null, what will happen? Will it crash or simply return null as well?
name can't be null
it'll return an empty string
I did try that before, it made no difference.
actually, it returns "Error: No vehicle"
just tested
name _vehicle,
_vehicle call BIS_fnc_objectType,
typeOf _vehicle,
roleDescription _vehicle,
getPos _vehicle,
groupId (group _vehicle),
Will any of those crash or just return some default values?
By god you are quick
Great, thanks for your help 😁
After running systemChat str [_cam, _pipTarget, _source];
Before Draw3d:
[164426<no shape>,"firefly1cam1",firefly1D]
what is fireFly?
is it a simple object?
What object is the tv1?
yep, Greyhawk doesn't have PiP0_pos as I said
tested in the game
Both those scripts work fine currently.
The only script left that doesn't is this one.
params ["_pipTarget", "_source"];
_cam = "camera" camCreate [0,0,0];
_cam cameraEffect ["External", "Back", _pipTarget];
/* make it zoom in a little */
_cam camSetFov 0.7;
/* attach _cam to _source cam position */
_cam attachTo [_source, [0,0,0], "PiP0_pos", true];
/* switch _cam to NVG */
_pipTarget setPiPEffect [0];
systemChat str [_cam, _pipTarget, _source];
/* adjust uavcam orientation */
addMissionEventHandler ["Draw3D", {
_dir =
(_source selectionPosition "PiP0_pos")
vectorFromTo
(_source selectionPosition "PiP0_dir");
_cam setVectorDirAndUp [
_dir,
_dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
];
}];
wait it does 
This script is to a Darter.
Is this another one from first 2? >.>
I posted it before the other 2, you may have missed it.
_source is not defined in draw3d
Yes, yes I did :P
Okay, so how would one pass those as an arg to the draw?
Can I see an example?
https://community.bistudio.com/wiki/addMissionEventHandler
You can pass it using this freshly upgraded version with parameter called "arguments"
Is this the way to do that then?```sqf
addMissionEventHandler ["Draw3D", {
_dir =
(_source selectionPosition "PiP0_pos")
vectorFromTo
(_source selectionPosition "PiP0_dir");
_cam setVectorDirAndUp [
_dir,
_dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
];
},[_cam,_source]];
Read the parameter's description
So I am missing "[thisArgs, _cam]" and "[thisArgs, _source]"?
They are not _cam and _source anymore
they are inside the array called _thisArgs
you need to fetch them from there
addMissionEventHandler ["Draw3D", {
_dir =
(_thisArgs select 1 selectionPosition "PiP0_pos")
vectorFromTo
(_thisArgs select 1 selectionPosition "PiP0_dir");
_thisArgs select 0 setVectorDirAndUp [
_dir,
_dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
];
},[_cam,_source]];
If this is correct, it still does not work.
Is it possible to segregate weapon types via their type with a config classname grabbing code? (I'm sorry I forget the proper name of the function)
For example, I understand pistols / main weapons / rockets are in a category of their own, but is there sub classes like assault rifles, snipers, shotguns?
And if so, would it be possible to grab say, "snipers" specifically?
[164426<no shape>,"firefly1cam1",firefly1D] about this, I believe you set the vehicle's name to firefly1 right?
if so, firefly1D is not the vehicle but the "D"river of the firefly1
So how would I fix that?
This is the addAction
this addAction ["<t color='#00FF00'>View Firefly Feed</t>", { ["firefly1cam1", ((units Firefly) select 0)]
To select the first Drone in the Firefly Unit.
But the source has to be the vehicle itself, not the unit that is driving it?
in your other 2 scripts, when you used variable names called uav, uav1
did you assume they re drivers of uav?
I can't believe that flew over my head as a possibility for being the issue.
I knew uav and uav1 were the drone themselves. Just didn't think about the possibility that the selection method wasn't grabbing the drone and was instead grabbing an imaginary pilot.
You mean selectionPosition command?
Running a final test now.
That imaginary pilot is still an AI but does not have a body. When you connect to a uav, you are basically remote controlling it.
It is what allows you to connect to UAVs basically, also decides to which side an UAV/UGV belongs.
Yee. It makes perfect sense after you pointed it out, just didn't think of it myself at first.
It's shakey as all hell, but that's the fault of the drone not having amazing flight stabilization.
It does work.
Well, next step is making an independent camera instead of fixed to camera of drone then. Jokes aside, yeah it is a bad issue but it doesnt do it that much if it is stationary to my experience.
no, it's because of using attachTo
I mean, yes, but it wouldn't be shaky if the drone was stationary.
attachTo also has its effect but the significant part is drone's movement management.
simulation cycles play a role too
So it is partially the drone too.
If you know what you're doing you can make a perfectly stable camera
simulation cycle of vehicles is enough to not feel that
I ve already done that, staying far away from attachTo of course
only their position. their rotation is not updated in visual scope
but in simulation scope
actually so is their position
But the shake he is talking about is not caused "Mainly" by attachTo is what Im saying
Well, I'm not interested in it working amazing currently, just that it works.
Seeing as I am new to the editor and all.
hi new, I'm dad!
it is not about simulation, it is about the drone AI that keeps speeding up and slowing down
that causes the shake.
Thats what he is talking about
fight! 😄
Final question for now, how would I set up an action that deletes/undoes everything this action did when it executed the script?
If it is simple enough to do at least.
Check script parameter, check actionId parameter of it
now use this
https://community.bistudio.com/wiki/removeAction
BUT
now that I remember , there is an additional parameter to actually self delete so you may not need it
(unless it is MP ofc which 80% wont handle itself then due your needs)
hideOnUse parameter if it is SP mission.
nope
deletes/undoes everything this action did
Oh, I see what you are talking about.
Not what I am looking for though.
hideOnUse is only "hide the action menu on action usage"
no such thing. you have to do it manually
I'm talking like, delete the camera and turn the screen back off.
hi lazy, I'm dad!
hi dad
So there is no way to make this action togglable?
there is
Wasnt there a self delete parameter for addAction?
but you have to do it manually
Am I confusing it with something else?
yes, BIS_fnc_holdActionAdd 😉
holdAction
Oh well
other than that you can removeAction _actionId still
thats what I said
but for some reason Leo is not happy with it and I didnt get the reason :P
because it is not undoing the action, it is removing the action ^^
@hexed crown is asking for a "revert code" thingy 🙂
well thats what I thought he asked at first :(
(At some point, he ll need it too though)
Okay, so I would need to delete them in the editor, or I could make a second action that runs a script to delete them?
just change the texture of tv and live happily
ignore rest
I can already see a negative emote coming from Leo
But it is so massively inefficient to leave those cameras there if they are not needed.
Ah, another leo
then store them somewhere, and remove them on end
Is there a way to delete things using a script? If so I can do this, just need to find their IDs.
you can store their IDs in a setVariable for example
True. I infer since you said that, that their is a way to delete using a script?
ooor ignore lou and use benefit of global variables that you used already , delete these vehicles using deleteVehicle (dont forget to finalize cameraEffect too)
oh I forgot about draw3ds tho
which he probably meant
y u bulli mi
(just delete all mission event handlers with type "draw3d" it is ur mission anyway[so I can still say lou's way is unnecessarily complicated])
_bla addAction ["blabla", {
params ["_bla", "", "_id"];
_cam = ...;
_bla removeAction _id;
_bla addAction ["remove blabla", {
params ["_bla", "", "_id", "_args"];
_args params ["_cam", "_r2d"];
_cam cameraEffect ["terminate", "back", _r2t];
camDestroy _cam;
_bla removeAction _id;
}, [_cam, _r2d]];
}];
Giving codes to people dont teach em anything😤
I got bored 🥱
where are removal of draw3ds?
Giving absent codes to people dont teach em anything and confuse them!
Actually, I learn quite well by sent other people's code. Before college it was how I learned most of what I knew.
If I can see it in action, I can usually figure out what is doing.
The point is, you learn more by suffering
You're not entirely wrong.
says the gagged avatar 🤭
Success doesnt bring experience
"either you win or you learn", right?

Honestly, my mistakes regarding modding has not only given me experience but new ideas as well but I doubt that applies to all :P
In this context, yes 
if you always fail what do you gain then?! 😛
then you learn that you are not the type to do these stuff and move on with your life 
success and failure both bring experience
I wish it were that simple with some of my former classmates.
Welp, that's all for now.
Thanks for the assistance y'all.
Alright so, I got problems, again. I tried to look smth up but couldn't find anything but yeah.
Basically cancelAction didn't work for the Salute action for my AI officer and switchMove is janky looking.
People wiser than me here know smth that'd work for that?
Did you try playMoveNow?
target playMoveNow "";
I believe will return target to it's base animation and end the current one.
Lemme try
Didn't work
the dude keeps saluting
so
officer playActionNow;
You need the ""
on the target?
officer playActionNow "";
Ooh
Lemme try
Nooope.
I think the problem is that the salute action is playing an animation
Well, from what I understand on a player, salute is an infinitely looped animation until the player moves.
officer1 action ["Salute", officer1];
If that doesn't work, I'd try using playAction instead of action.
officer1 action ["", officer1];
This is what you used?
yes
Weird.
Old game in an old engine doing old game things.
¯_(ツ)_/¯
Oh, yeah that's what I meant by using playAction instead of action.
Using action might be causing unexpected issues with what you are trying to accomplish.
playAction still kidnaps my officer for an forever salute
After using playAction to start it, try using playActionNow to end it.
officer1 playAction ["Salute", officer1];
officer1 playActionNow ["", officer1];
Well, yeah. I inferred they knew that already.
Just showing what I meant.
That doesn't work
I just get an error message
Imma just go back on using the switchmove
@cold cloak Not mine. But it might help you figure your thing out. ```
Trigger 1:
Con: manm distance player < 10;
( If player is 10m or closer do: )
Act: manm playMove "AmovPercMstpSlowWrflDnon_SaluteIn"; manm disableAI "anim"; hint "Sir!"
( ..."Amove....." = do salute, disable animation in salut so that soldier holds the salute pose. Soldier says "Sir!" )
Trigger 2:
Radio Alpha (In the "Text" box write "At ease" (not the "" )
Act: manm enableAI "anim"; hintsilent "At ease soldier.)
( Re enable animation so solder goes back to default. Salute goes down. Say text "At ease soldier." )
If you are having trouble understanding it, I am retyping it now.
/* Trigger to salute happens: */
officer1 playMove "AmovPercMstpSlowWrflDnon_SaluteIn";
officer1 disableAI "anim";
/* ..."Amove....." = do salute, disable animation in salute so that soldier holds the salute pose. */
/* Trigger to stap salute happens: */
officer1 enableAI "anim";
/* Reenable animation so solder goes back to default. Salute goes down. */
Because you do not use cancelAction for that (it says actions in progress)
Execute "salute" action again , to turn it off
ie.
officer1 action ["salute", officer1];
both to salute and to stop salute
Ahh. a toggle style command.
My goodness, what an idea. Why didn't I think of that in the first place?
Anyways thanks man I'll switch the SwitchMove when I get on to edit the mission next time xd
correct- not specific to one unit but all units that belong to opfor
basically i have a trigger attached to a unit, if any (not a specific) opfor unit passes him I want him to follow that opfor unit he initally saw
};``` so ive got this, but i need side _x defined, it wants a unit name, but i need to give it something that represents opfor or any enemy (being that any enemy will be opfor)
but obviously this isnt working because my variables are not defined
Hello, may I ask where CAN I find information about using myself to create a new PBO to translate others' mods without changing others? What about the mod itself? Or who has an example of this kind of PBO?
Make English into Chinese
A pbo isn't what changes it's language and you can't repackage other mods unless they specify you can
What's the quickest way to check if a unit is freefalling?
check velocity?
it doesn't make sense to make a unit follow a "side"
Ended up being animationState _unit select [0,12] isEqualTo "halofreefall".
don't make stuff up
....
Don't blame the engine when you just make stuff up
But but... blaming is easier. 
because of you
Assuming your activation is OPFOR present, you can just use pc1 doFollow (thisList # 0); as On Activation expression (because of the activation setting (OPFOR present), the trigger's thisList will only contain units belonging to side east).
Unfortunately, while this approach is formally correct, it probably will not work. According to https://community.bistudio.com/wiki/doFollow, doFollow works only within the same group.
doFollow only works within a squad, does not apply for any units outside that unit's squad. It is used for formation. That code has to be rewritten from start.
because of you
Does my message suggest otherwise? 
but why do you start your message with this?! 😅
you can just use
pc1 doFollow (thisList # 0);
you can just use part confuses this message a lot :(
when he can clearly not use it
Blame engine, the easiest!
or blame whoever named that command, for misleading
doReturnFormation etc. would be more clear :P
You are both wiki editors and not stating that explicitly, so I blame both of you 

I'm a wiki contributor too.. please can it be my fault as well?
no!
just so everyone is frustrated 😄
No you cant, you didnt contribute to this page at all
*logs in
I never touched that page.
what, you actually log out?
hehe
Just 34 times
I actually toyed with my cookies so I don't get delogged every 2 or 4h whatever it is 😄
hah! made you look
I had looked before to whether or not blame Tankbuster 
no u
Still no fix 
Finally, about time... Years of misunderstanding, countless people suffered during this period. 
and you didn't do a thing. how disgusting.
I was never given the chance. 
stop finding excuses!
This is literally what the wiki implied that should do.
Im using the FiredMan event to log to the rpt. This works fine when testing on multiplayer in the editor, but on a dedicated server, the event fires 5 times for every time I pull the trigger, any way to fix this?
And I was asking what if that was what they used, and was correct.
(where plz? https://community.bistudio.com/wiki/playMoveNow)
switchMove (what they were using): Use _unit switchMove ""; to reset animation. For a smooth transition use playMove.
playMove: The difference between playMove and playMoveNow is that playMove adds another move to the move queue, while playMoveNow replaces the whole move queue with new move
These taken together imply that it could be used to force a smooth transition back to idle.
oh, implied.
I know switchMove does yes
(if you see wiki errors please do tell us in #community_wiki!)
Give me a second.
I miss hit enter.
I am not pressing you, I am just stating "if you see mistakes" ^^ no issue here 🙂
msg fixed.
Also, tbf, I never said it does do that, just said I believe it did.
Which is what I understood it to do after reading the wiki. I now know that it does not do that, so issue resolved.
I believe will return
indeed 🙂 @little raptor
I hope we are all up to date now 😉
lol
I don't really find issue with it, as I am new here and the people that have been around longer haven't gotten a good taste of the way I go about things yet.
So getting misunderstood/misinterpreted, is to be expected.
We are also using remoteExec target 2 for this iirc
Old game in an old engine doing old game things.
Then why did you lay the blame on the game when it didn't work?
That was specifically in response to their statement about saying their plan got ARMAd.
The reason it works with switchMove is that it first resets the soldier's animation state, then moves to the first frame of the animation you provide. you could even do: _unit switchMove "blabla" and it would still work, even tho there is no such anim at all.
playMoveNow/playMove never reset the animation state, just add to the queue
changed the BIKI explanation to avoid confusion:
https://community.bistudio.com/wiki/switchMove
is there a built-in way to call/run code without the need of making a script or function from scratch? for example, I want to call bis_fnc_endmission after a task is complete and a certain time has elapsed
after a task is complete
yes
a certain time has elapsed
not that I know of
don't want the mission to instantly end after the task is complete
Anyone know the code in ACE3 Medical for forcing a character to have a broken limb?
then a bit of scripting is needed
fiiiiiineeeee
Would using sleep before doing the end mission not work in the task complete?
it would. that's why I said a bit of scripting
So @undone flower would just need to add a sleep with the amount of time they want to wait right before calling the end mission function. No actual script needed.
Just 2 lines.
it's so tiny I wanted to avoid it. guess theres no other way
I'll add other lines just for the sake of it. a special effect or two
All I know is that the fractures are stored in variable ACE_MEDICAL_fractures:
_fractures = _unit getVariable ["ACE_MEDICAL_fractures", [0,0,0,0,0,0]]
_fractures#4 and _fractures#5 values refer to leg fractures
@hollow thistle Documented ACE Medical API when? 😦
When someone will write the documentation 🙂
this open to anyone? I'd write some guides on various functions that I've had to just search through github and figure out on my own
contributions welcome ❤️
just add some .md files to say... the wiki framework folder?
Do you know of that array is booleans? So a broken limb is 1
probably, it's based on jekyll, it should be straightforward.
not booleans, but yes
set it to 1 and it'll be broken
you might need to use the function Hypoxic linked
I'm not sure if tinkering in the internal arrays is the best idea.
because you need to update the state machine
Nice one, I'll run some testing and see if works, of not I'll go on hypoxics method
my method is not "guarenteed" to cause a fracture but it is one of the only public functions for it. it applies the damage to the limb based on the damage or "projectile type". I'd make the damage something super severe but it still is going to be based on your "fracture chance" setting. But this is the function I used to cause say a scene of injured civilians that people had to triage and transport.
keep in mind, you have to disable AI auto healing or they will heal it all up (even without medical items)
Right, thanks Hyp
let me find the specific variable. its a variable that makes it so the unit is always in medical danger and doesn't go into the healing state
_unit setVariable ["ACE_MEDICAL_fractures", [0,0,0,0,1,1], true];
[_unit] call ace_medical_engine_fnc_updateDamageEffects
maybe this'll work
_unit setVariable ["ace_medical_ai_lastFired", 9999999]; //Disable AI to self healing
this is how you disable the auto heal for AI
Works a treat - however without a would also inflicted to the same body part it doesn't hinder the unit's movement or precision.
Calling damage on the limb works and make the wound more believable, so I'll add that in too.
Thanks for all the help guys
did you use the updated version?
I changed the function
is there a way to preview sounds? like the music utils?
dang lots of these documents haven't been changed in 2+ years. a lot has been changed in 2 years.
Yeah that fixed it without calling the extra damage - cheers!
_playTrack = "Track_R_17"
while {alive player} do {
playMusic _playtrack;
waitUntil {isNull _playtrack};
};
Will this "waitUntil" work?
no
and no
damn. why?
because a string cannot be null
for a command to work you must at least use compatible data types
_playTrack is a string
now look at BIKI
does isNull take strings?
no
so what you wrote is a generic error
oh yeah just found it. guess it goes in a script
added some stuff. hopefully I did it right. first time contributing.
is there a way to get the length of a music/sound track? I guess the event handlers will conflict with some other scripts where the music is forced to stop, while the eh will keep the music playing
configFile >> "CfgMusic" >> "AmbientTrack01_F" >> "duration"
you want to use getNumber
and it only works if that value actually exists (depends on mod maker. base game has duration on all of them)
I'm using the ost. that'll do. thanks
you can also grab the class names of stuff that has a musicClass such as "stealth"
can I use a variable on the path? such as:
_playTrack = "Track_R_17"
_trackDuration = getNumber (configFile >> "CfgMusic" >> _playTrack >> "duration");
yup
excellent
Hey guys, i have a problem with my mission
I'm making a OPFOR camp
if i put everyone in the same group, if we kill 1 one them, even at 40000m from them, with a silencor, they will going to COMBAT mod
So i made different group
But if i fire the group 1
the group 2 doesnt fire, even at 20m from their OPFOR friends
how can i do ?
i tried
" if U1 is in combat mod, then U2 is going to combat mod"
it works but if i kill U1 by shooting the chest, U2 is in combat mod also
by default, enemies are only reported within groups not between them.
So what is your suggestion to make a good infiltration mission
OR
if i kill someone secretly, they notice
OR if an enemy is shooting at me, the others dont care
i'm having some trouble understanding what you want though. you want it so that if you kill one guy, it doesn't alert the other guys?
I see. You can use knowsAbout to check to see if a group knows about a specific target and do a comparison there
if one guy just gets off'd silently, it probably won't raise it much
what is that
the best way, is to probably have each unit in their individual groups, then use LambsDanger.fsm mod to have them communicate between groups. this would have the least scripting
So
Group1 knowsabout Group2
If i kill group2
then group1 doesnt know
but if group2 is fighting
then group1 know ?
it would be more like... make all the enemies in individual groups, then you would do a constant check to see if the side itself knows about the player, and if it does, set all the units to combat mode and if you want reveal the player to the side
is this single player or MP
so the steps:
1. Make all the enemy units in individual groups
2. Make a loop check that checks allPlayers vs the enemy side's knowsAbout value
3. If knowsAbout is larger than what you want, set all enemy units to combat mode
Well i think it doesnt help for my problem, otherwise i dont understand the way it will
Is there not something like
" If U1 is shooting, then U2 join U1 " ?
yes you can do that too
i'm on the wiki but i dont know what i have to search
FiredMan event handler
i tried " shooting " or " fire " but its not this
behaviour
the behavious is not perfect bc if i kill the enemy by shooting in the chest
the 1st second will turn him in combat mod and it will attract the others, even if the guy didnt shoot
Can you tell me more about what it does?
it's an event handler. the code executes as soon as something happens.
in this case, it executes when the unit fires
this addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
}];
means the instant a unit fires that the handler is attached to, you can execute code, AKA make the other groups in combat mode
SO i write this in the trigger
and i attached the unit
If one unit fires, it activate " set behaviour " ?
sorry i'm new to this
im confuse about the " params " part of this
the params are variables that are sent from the engine when the event fires. its stuff to use
so _unit is the unit that fired
_weapon is his weapon
etc etc
its not blank, its what the engine is GIVING you to use, you can choose not to use it
Okay... so I am kinda clueless why this doesn't work.
This is supposed to go into the init field of a playable unit:
[this] spawn {
if (local _this && not isServer && hasInterface) then { //!isHC, !isServer, !isDedicated
waitUntil { player == player };
[true] call ACE_spectator_fnc_setSpectator;
};
};```
Would this work out locally to each client if copy pasted into various slots?
in the trigger
this addEventHandler ["Fired", {
params ["THE UNIT I WANT", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
}];
When activation : set behavious things
right ?
remove the brackets around [this] since you only have one argument so that _this is correct
@fair drum Okay, is it true that player == player waits until the player is actually spawned?
waitUntil {alive player}
yes, but there is a lot to go over. you are missing fundamental scripting stuff before we can even hit your issue at hand
I saw some many examples with player == player what does that do then if alive does check player spawn.
its just silly. alive will return false if the player isn't initialized or alive so its better to use that
Well... damn. Thanks a lot Hypo!
that's stupid
when player is not alive yet player is objNull and objNull == objNull
so it never works anyway
Yeah nice, thats written in one of the comments in the biki tho xD
I'll delete it
@fair drum somehow this works in EditorMP but not on dedicated
this spawn {
if (local _this && isPlayer _this && hasInterface) then {
waitUntil { alive player };
sleep 1;
[true] call ACE_spectator_fnc_setSpectator;
};
};```
because player is null on a dedicated server
you did not mention that you wanted it for MP
Thats true. In that case it would be alive _this right?
correct
there was another comment that was newer and correct tho
anyway, deleted that stupid comment
@little raptor Cool stuff, thanks 🙂
just tested, objNull == objNull returns false.
wat
yeah...
still that's stupid. also objNull isEqualTo objNull
Still won't execute on the server
this spawn {
if (local _this && isPlayer _this && hasInterface) then {
waitUntil { alive _this };
sleep 1;
[true,true,true] call ACE_spectator_fnc_setSpectator;
};
};```
What fucking heresy is going on right now
because isPlayer is false
Hey, how would I check to see if a player has access to Zeus interface?
check its synchronizedObjects
Hmmm okay
What if I have a Zeus module whose owner is #adminLogged?
Basically I want to execute a local-to-remote script that will only fire if the player can access Zeus
@little raptor But isPlayer asks for a unit to read
getAssignedCuratorLogic player
Sweeeet, thanks
put it after the waitUntil
also local will return false too
first you have to put the waitUntil
then the other conditions
this spawn {
waitUntil { alive _this };
if (local _this && isPlayer _this && hasInterface) then {
sleep 1;
[true,true,true] call ACE_spectator_fnc_setSpectator;
};
};```
why will local return false if its within a units init field?
it was just a guess
because it's not occupied by a player yet maybe (so locality is not changed yet)
¯_(ツ)_/¯
oh boi, okay, will test now
Can I even spawn code within a players init field?
anyone knows a script that will bring me an array with all vehicles of a given side?
yes
units (side)
For some reason it still wont do anything. I am not sure why. Might be the if condition no idea
_vehs = units _side apply {vehicle _x};
_vehs = _vehs arrayIntersect _vehs;
^
that will bring me all units, including soldiers
Ah okay gotcha