#arma3_scripting
1 messages ยท Page 774 of 1
the more logical way is moving it every frame
"ammo_Missile_Cruise_01"
Thats a big payload you know
but anyway you can't prevent projectiles from exploding. you can use a mod to make a dummy rocket tho
damn
2.10 projectile event handlers can't handle that?
no they don't have override iirc
idk. the problem is if you don't make a rocket explode how will it delete then? so if that's the case I guess it'll be denied
but you can still make a ticket 
If I have a function that runs on init and getin event handlers will it trigger either one if a player JIP directly into a vehicle during a mission?
at init? functions only have preInit and postInit 
Sorry vehicle init
it should trigger yes
but I have never tested it myself so take it with a grain of salt
Hehe what Arma should do and does can be two completely different things sometimes ๐
well I'm about 99% sure in this case. because the vehicle must exist before the player for player to be able to move into it so its init must've run already
Thank you
hmm, so the shell isn't holding an EH
that triggers an explosion once it collides?
i thought it did it that way?
I have a throwable EMP script that puts an EH on an IR_GRENADE and that works if u wanna disect it.
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
player addEventHandler ["Fired",
{
if (_this select 5 == "B_IR_Grenade")
then {
_this spawn {
_bullet = _this select 6;
_newpos = getPosATL _bullet;
while {(_newpos select 2) > .1}
do {
_newpos = getPos _bullet;
sleep 0.1;
};
[_bullet] execVM "scripts\emp.sqf";
};
};
}];
Hi. I created a function to spawn roadblock using LARs 3den composition spawn system. It spawn a composition well but i want to give the player possibility to remove the composition by simple blew it up. Therefore i use an eventhandler on one of the composition object which is an flag. This shoul...
maybe the last comment here
Is it actually necessary that the rocket is the means of locomotion? You could make a dummy simple object of a rocket, attach a fake engine flame (particle emitter), and actually move the assembly using setVelocityTransformation, keyframe animation, or addForce
*or by attaching it to an invisible UAV
I already suggested it
but looks like people are too afraid of per frame EHs ๐
well
its basically me eject the pilot and then bringing him back to base strapped on a rocket
so I'm not sure how I can use setVelocityTransformation for that
and keyframe animation is not useful
also this is in multiplayer if that matters
thanks a lot
this is simply checking the altitude of the projectile, hmm not much else
Using a UAV (invisible or otherwise) would be my call. They're (marginally) smarter than cruise missiles and less eager to explode. Or simply fade to black, teleport the player and say it was done with a rocket
its multiplayer I can't fade sadly
You totally can
So cover it up with some smoke and explosion particle effects
how will the uav help tho?
it will take a long time to reach the base
flies (mostly) where you tell it, does not explode
so the reason why I'm afraid of exploding is
is that he might eject towards a mountain for example
Doesn't have to be a Darter, you could use one of the bigger ones. Or just an actual jet even
in this case UAV won't help
because it will be sent into a mountain?
or even if he ejects towards a tree
this is Takistan map I'm speaking about btw
A non-exploding cruise missile would also not help in those circumstances, and it won't be any better at recovering and returning to flight
It seems likely that this is not possible with an actual cruise missile so I am trying to offer you workable alternatives
If you also don't want the alternatives, there is nothing I can say
yeah the only one which bypasses these problems is fade
sadly
can't I use intersect commands to figure it out?
see if there is a terrain object close to the player and basically not spawn a cruise missile?
I don't think there's a way to not spawn the cruise missile but you can have it delete after firing
can you summarize what your goal is?
what do you want the cruise missile to do exactly? Do you want it to follow its entire path and not explode?
no. empty vehicles can't fire
nope, I just want it so that when the pilot ejects and there is an object close to him than can cause the cruise missile to explode, I would just no spawn a cruise missile in that condition
for example if he rolls the plane and ejects in such a way that the ejection seat hits a house, then we won't spawn a cruise missile
or if his ejection seat is really close to a house, then we won't spawn a cruise missile
i suppose you can do it that way
you can use something like nearestBuilding, don't know how efficient that is
and check if the vehicle is rolled
or do what Leopard said
maybe both
Can someone tell me why this produces an error?
player addEventHandler ["OpticsModeChanged", {
params ["_unit", "_opticsClass", "_newMode", "_oldMode", "_isADS"];
hint "changed";
}];```
it is 2.10, not current stable
so dev branch only
Well another question
How do I know if the object is above the player?
in what circumstances would a building be above the player?
getPosASL Z / eyePos comparison?
well you know, if he ejects towards a building, it will be on top of him relatively
i have another script with a .hpp that is apparently overriding it..?
then check if the vehicle is rolled?
Would anyone have an idea why this is overiding the base game bis_fnc_showNotification? https://www.toptal.com/developers/hastebin/tuxamaxoge.yaml
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
but he may eject in the air too
what are you guys even talking about?!
Sorry sir
lineIntersectsSurfaces
exactly
problem solved
yes exactly
.
as for the "up" you can use player modelToWorldWorld [0, 0, dist]
yeah thought of that too
@little raptor same issue as last night but now i found a cause, any idea on the fix...?
remove all those?
those are already defined by the game
this is a custom script
that thing is just overriding and breaking them
you can't rename it
it's being used by bis_fnc_showNotification
you can compare it with vanilla to figure out what's wrong
it has the same name as base game classes
then it should be fine to change it so my custom script uses this format and the base game uses base format
do whatever you want 
so more to this
can I check if the building is in the "upper dome" of the player's vicinity ?
so everything below his lateral body median should be ignored basically
Is there a way to assign a target to the AI in my squad just by aiming at it as a player?
So basically assigning the target to the AI while staying in ADS.
I'm sure you can use the F-key command menus while aiming down sights
class UPM_RscStructuredText: Life_RscStructuredText
What are the 2 structured texts?
what purpose do they serve
I think the first is the name of the control and 2nd is the type..?
Sorry, what is "F-key command menus"? To access the normal command menus the player has to exit ADS.
These are altis life ones I think
One inherits from the other
There are 2 because they decided to make 2 I guess. They probably look different.
The way they wrote these made the custom one overwrite the built in "RscNotification"
so now im just renaming them
is Arma Dialog Creator the best tool to help make dialogs?
WOOOO FIXED!!
thanks guys
I personally don't use it
what do you use
In game gui editor
you can, but what's the point?
plus how are you gonna get the object's geometry bounds?
how do I add and and condition to a while loop pls?
while {TargetLoop} do {```
Well its because the jet (when player ejects) is underneath him
And so he may also have other objects underneath him that we don't want to be the cause of the cruise missile not spawning
The cruise missile spawns on his back directly
while { cond1 && cond2 } do {
I have a global string variable called status
status ="red"
status="green"
while {TargetLoop && status="red"} do {```
gives an error
So
You need ==
= means you are assigning a value to a variable
== means you are comparing a value
Ok
I changed it
Now it says undefined variable
Although i define the variable via an addon which i created
The variable is global
So other scripts should be able to read the variable, no?
TargetLoop and status need to be defined before the loop starts working
Yes
is "else if" not a thing in arma..?
if ((nearestObject [_pos,"Land_Dome_Big_F"]) == _building || (nearestObject [_pos,_vaultHouse]) == _building) then {
[[1,2],"STR_ISTR_Bolt_AlertFed",true,[]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
//Kavala Bank Robbery
} else if (_building == _kavBank) then {
[] call life_fnc_kavBank_Rob;
} else {
[0,"STR_ISTR_Bolt_AlertHouse",true,[profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
};
16:55:01 Error else: Type if, expected code
correct, it doesn't exist
how can I have multiple conditions and a default then?
or do I need to use a switch
could use switch, or put another if inside the else and nest it
if a then
b
else if c then
d
else
e
is same as
if a then
b
else {
if c then
d
else
e
}
if ((nearestObject [_pos,"Land_Dome_Big_F"]) == _building || (nearestObject [_pos,_vaultHouse]) == _building) then {
[[1,2],"STR_ISTR_Bolt_AlertFed",true,[]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
//Kavala Bank Robbery
} else {
if(_building == _kavBank) then {
[] call life_fnc_kavBank_Rob;
}
} else {
[0,"STR_ISTR_Bolt_AlertHouse",true,[profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
};
so then this should work
oh of course
What's the best command for the AI to forget its target?
forgetTarget
can you recommend the best way? I'm kinda going deeper and deeper into details without backtracking
aren't you just creating an ejection seat?
alright First I would like to state I'm really sorry for being so vague with my explanation
- Pilot ejects
- 1.5 seconds later his ejection seat gets replaced by an ejection seat that is attached to a cruise missile
I know I mean what's the whole intention of the script?
3.cruise missile pitches down gradually until 0 pitch
4.cruise missile goes to the air base, carrying the player along with it
basically instead of letting the player eject and get left in the wilderness
- cruise missile explodes halfway to the base?! ๐คฃ
I came up with a vary bizarre way of returning him back to base
lol, it doesn't have a timer
if you meant a timed fuze
are you sure?
yes
I'm pretty sure all missiles in the game have timers 
it does:
so its that
anyways in the code
the speed is 800m/s
thats 2 mach nearly, i think thats more than enough to make him reach the base
in zeus i transport people with cruise missiles across altis too
I have a deep admiration for cruise missiles, anyways lets go back to the main topic lol
can you recommend me a way?
I'm kinda lost
_Roll = ((objectParent _caller) call BIS_fnc_getPitchBank)#1;
_Height = (getPosATL (objectParent _caller) )#2;
_cond1 = (_Height >= 40);
_cond2 = ( (_Roll < 120) && (_Roll > -120));
_cond3 = (objectParent player) isKindof "Plane";
_CanEject = (_cond1 || _cond2) && _cond3;
its true I do have preventive measures already, like checking the plane roll, checking the height etc
still things can go wrong, so I'm trying to make so that even if these fails, I don't spawn a cruise when the player is too close to a building
because takistan has some weird hills
:(
nothing, but how do I use it to check the entire surrounding of the player?
like a sphere of lines
because an object can be anywhere
you don't need the "entire surrounding"
_Missile setPos (_caller modelToWorldVisual [0,-2,0]);
when you eject you can predict where your player flies to
alright just the back
or is it because of the missile?
don't use setPos
it's buggy
no
damn x2
modelToWorldVisualWorld
why?
why what?
yes
ok cool
so the missile spawns at the callers back
how do I scan his backside?
well there's really no reliable solution
if you use lineIntersectsSurfaces, you're just checking lines and you might miss surfaces
if you use something like nearestObjects, you have to pick a relatively large radius, because that command only considers object centers, so the search radius has to be at least ~MaxObjRadius + intendedSearchRadius
e.g. if you simply want to check 2 meters around him, you should really check +52 m
yeah 52m why not
MaxObjRadius in Arma is ~70m. so it should by 72...
not much. I think Dedmen improved it
but the slow part is that you'll have to iterate over those objects
Lines extending from player to the object?
object?
no I meant the lineIntersectsSurfaces command
yeah,
begPosASL, endPosASL
from player to building?
no. the whole point of line intersection is not to search for objects
let the command take care of it
yes but how do I do the lines is what I'm asking
like after nearestObjects, how do I use lineIntersectsSurfaces
cool, where do these lines start and where do they end?
in your script you're just throwing the missile "upwards" (in model space)
so you can just do:
count (lineIntersectsSurfaces [_spawnPos, _spawnPos vectorAdd (_plane vectorModelToWorld [0,0,50]), _plane, objNull, true, 1, "FIRE", "GEOM"]) == 0
is that checking if there is an object above the missile?
yeah like this:
oh dear
well
I'm trying to check if the missile will clip through an object
so that's why I'm checking the player's back
you mean only when it spawns?
yes
you don't care what happens later?
sorry sir for the trouble
also I got to appreciate the cool plane here, nice drawing
How can I turn a local variable into a global variable?
by assigning it to a global variable
but how?
I think leopard got a better method than be but I use this
https://community.bistudio.com/wiki/setVariable
#define InRange(x) (_mPos#x >= _c1#x - _size && _mPos#x <= _c2#x + _size)
_size = ...;
_isClear = true;
{
boundingBoxReal _x params ["_c1", "_c2"];
private _mpos = _x WorldToModel ASLtoAGL _spawnPosASL;
if (InRange(0) && {InRange(1) && {InRange(2)}}) exitWith {_isClear = false};
} forEach (nearestObjects [....] - [_caller, _plane])
@drifting portal ^ something like that
oh dear god
well I never bothered to learn # commands
what does define do here?
it defines what?
you can't. you just have to assign it to a global var like TROALINISM said
globVar = _localVar
does this work?
_target setVariable ["GlobalTarget"];```
I just wrote that to make the script shorter:
if you expand the macro this is what you get:
if (
_mPos#0 >= _c1#0 && _mPos#0 <= _c2#0 && {
_mPos#1 >= _c1#1 && _mPos#1 <= _c2#1 && {
_mPos#2 >= _c1#2 && _mPos#2 <= _c2#2
}})
ah
no
you are missing the second param in the array
varspace setVariable [name, value];
you are missing value
do I need to feed into this anything other than _spawnPosASL, _caller ,_plane and nearestObjects param?
no the script should be correct
maybe also private _mpos...
oh I forgot another thing
well the script isn't 100% accurate
because it doesn't take the missile's bounds into account
Its lineintersects
added _size
it will be a bit overestimated but the script will work properly at least
_size should be the missile's bounding radius
boundingBoxReal _missile#2
Oh alright
This is getting more complex by the minute lol
That's why people warned me again checking clipping
Thanks a lot
if i wanted to ban just Thermal NVG's from being used how would i goa bout it?
cause i still want thermals for launchers and such but not nvgs
don't give them thermal nvg's?
anyhow here's a handy new event handler
personal arsenal makes that annoying XD
i have an idea for you so you dont have to blacklist
give me a minute
player addEventHandler ["VisionModeChanged", {
params ["_person", "_visionMode", "_TIindex", "_visionModePrev", "_TIindexPrev", "_vehicle", "_turret"];
if (_visionMode != 2) exitWith {};
if (!isNull _vehicle) exitWith {};
_person action ["nvGogglesOff", _person];
}];
``` @open flume if you apply this eventHandler to a player it will disable thermal vision in the goggles
i'll have to check if launchers still work. it might disable it there too
no it works because the nvgoggles action doesn't affect the launchers
the only bug I found is that nvgoggles are turned off when you enter thermals in a launcher
(you can call it an immersion feature)
systemchat "Attention dear player, you are now entering immersion, please hold tight";
works perfectly!! ty so much for the help
yw, let me know if there's an issue. This will only work if the night vision mode comes before thermals, I don't think I've encountered any exceptions to that
all the mods we use rn do that so itll be gooood. will let u know if so tho
regardless they can just use different goggles anyway
yea, we have alternatives that are the exact same visually so its hard to tell since we use virtual arsenals for player customization
The only issue is that you don't have a gaint RscText telling them they entered immersion mode
oh dear, i forgot that part
i originally used a script that when ppl used thermals it was a black screen saying "cheater cheater"
yeah i like mine better than that lol
but it was EVERY thermal
tbf my method only works for version 2.08 onward
works fine for me XD
Honestly if I was you
I would just loop createVehicleLocal to spam submarine on their location
Nobody would ever just thermals in that case
ruin their gaming experience
Its not gaming if I'm doing the sqf
How can I execute a script for all players WITH suspending?
it told me im not allowed to suspend in remoteexeccall..
delete call
done
remoteExec
deadass? LOL
remoteExecCall is specifically for running code unscheduled which does not allow suspending
gotcha thanks
remoteExec is the regular command
Current situation
Player A needs to run a script on player B and return a value back to player A, that possible?
Not trivially.
if !(["license_civ_pot"] call life_fnc_levelCheck) exitWith {"This player does not have a pot license!" remoteExec ["hint", _cop]};
Usually you're better off with player A firing off a script on the server which knows everything.
like, player A goes up and clicks a button in an interaction menu to call a script on player b
I know what you mean, but if you run into that sort of problem you generally want to redesign.
if all you need is the hint you can write a function to return the value in the form of a hint
via remoteExec
//your_fnc_levelCheck_checkPlayer
params ["_caller","_levelType"];
_level = [_levelType] call life_fnc_levelCheck;
_message = format [["This player does not have %1","This player has %1"] select _level, _levelType];
_message remoteExec ["hint",_caller];
``` something like this?
[_cop,"license_civ_pot"] remoteExec ["your_fnc_levelCheck_checkPlayer",_testedPlayer];
of course I don't know what life_fnc_levelCheck does but I assume it returns bool and is run locally
you can use an array or hashmap or whatever to replace "license_civ_pot" with the text you want
Thanks for that... im doing basically that and its just not doing anything
params [
["_unit",objNull,[objNull]]
];
if (isNull _unit) exitWith {};
if !(["license_civ_pot"] call life_fnc_levelCheck) exitWith {"This player does not have a pot license!" remoteExec ["hint", _unit]};
_Btn9 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_checkPotAction; closeDialog 0;";
That should call that on the player
is life_pInact_curTarget the target player or the player clicking the button?
The target player
you're showing the hint to the target player?
.....oh.
heh
params [
["_target",objNull,[objNull]],
["_cop",objNull,[objNull]]
];
if (isNull _cop || isNull _target) exitWith {};
if !(["license_civ_pot"] call life_fnc_levelCheck) exitWith {"This player does not have a pot license!" remoteExec ["hint", _cop]};
_Btn9 buttonSetAction "[life_pInact_curTarget, player] spawn life_fnc_checkPotAction; closeDialog 0;";
think this will work then?
what will work?
the scripts i just posted above
If I run a remoteExec on RCLIENT with a 30 minute sleep, will the code still run if players disconnect?
oh my bad i didnt realize you posted another block
and no I don't think that code will work
you haven't really explained what life_fnc_levelCheck does though
_Btn9 buttonSetAction "[life_pInact_curTarget, player] spawn life_fnc_checkPotAction; closeDialog 0;"; I've never worked with gui, but isn't this code executed locally for whoever clicked the button?
you're passing the target to the code and not using it
as it stands, if I'm assuming correctly about what life_fnc_levelCheck is, it's checking a value on _cop and not the target
["_cop",objNull,[objNull]] _cop is not going to be defined because you're passing player as if it's an array
I'm assuming life_pInact_curTarget returns an array which is why you had that syntax originally
do you understand the difference between spawn and remoteExec?
the life_fnc_levelcheck just checks if the local player has a license
returns true or false
returns a player
then what's with the objNull stuff?
I need to run the check code on the target player and return the value to the caller
thats how the framework had it
so im just rolling with it.
ok so does it return a player or an array with the player in it
frankly, this is why it's not working at all. I'll be back later to help you
ok heres one that does work:
_Btn6 buttonSetAction "[life_pInact_curTarget] call life_fnc_arrestAction; closeDialog 0;";
#include "..\..\script_macros.hpp"
/*
File: fn_arrestAction.sqf
Author:
Description:
Arrests the targeted person.
*/
private ["_unit","_id"];
_unit = param [0,objNull,[objNull]];
if (isNull _unit) exitWith {}; //Not valid
if (isNil "_unit") exitWith {}; //Not Valid
if (!(_unit isKindOf "CAManBase")) exitWith {}; //Not a unit
if (!isPlayer _unit) exitWith {}; //Not a human
if (!(_unit getVariable "restrained")) exitWith {}; //He's not restrained.
if (!((side _unit) in [civilian,independent])) exitWith {}; //Not a civ
if (life_HC_isActive) then {
[getPlayerUID _unit,_unit,player,false] remoteExecCall ["HC_fnc_wantedBounty",HC_Life];
} else {
[getPlayerUID _unit,_unit,player,false] remoteExecCall ["life_fnc_wantedBounty",RSERV];
};
if (isNull _unit) exitWith {}; //Not valid
detach _unit;
[_unit,false] remoteExecCall ["life_fnc_jail",_unit];
[0,"STR_NOTF_Arrested_1",true, [_unit getVariable ["realname",name _unit], profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
if (LIFE_SETTINGS(getNumber,"player_advancedLog") isEqualTo 1) then {
if (LIFE_SETTINGS(getNumber,"battlEye_friendlyLogging") isEqualTo 1) then {
advanced_log = format [localize "STR_DL_AL_Arrested_BEF",_unit getVariable ["realname",name _unit]];
} else {
advanced_log = format [localize "STR_DL_AL_Arrested",profileName,(getPlayerUID player),_unit getVariable ["realname",name _unit]];
};
publicVariableServer "advanced_log";
};
https://community.bistudio.com/wiki/Multiplayer_Scripting here's info on scripting for multiplayer
param and params are two different commands
you're copying random code and making a weird frankenfunction
I'll be back in 30 minutes or so
Check the link I think it explains the purpose of remoteexec
somewhat
its just weird trying to run that script on another player and return the value.
i don't see why you need to do this
you can just remoteExec hint back to the caller
_Btn9 buttonSetAction "[player] remoteExec [""art_fnc_life_checkPotAction"",life_pInact_curTarget]; closeDialog 0;";
//art_fnc_life_checkPotAction
//you should define functions with your own prefix if you wrote them, life is the mod's prefix, art is my prefix
params ["_caller"];
if !(["license_civ_pot"] call life_fnc_levelCheck) exitWith {"This player does not have a pot license!" remoteExec ["hint", _caller]};
so this originates on the machine of the player clicking the button. the first remoteExec sends a message to the target's machine that says "hey, run art_fnc_life_checkPotAction". The target client then decides if ["license_civ_pot"] call life_fnc_levelCheck returns false and, if so, sends a message back to the machine of the player who clicked the button that says "hey, show this text on the screen"
I don't see why this needs to be complicated. So long as you have this functioned defined on every client (like in description.ext) there shouldn't be an issue
quick caveat buttonSetAction has a quirk where it takes SQS syntax instead of SQF. I can't guarantee that what I wrote is correct SQS syntax but im about 80% sure it will work.
_Btn9 buttonSetAction "[player] remoteExecCall [""life_fnc_checkPotAction"", life_pInact_curTarget]; closeDialog 0;";
yeah I have the first part
so ur example matches what I tried last
yes
#include "..\..\script_macros.hpp"
/*
File: fn_checkPotAction.sqf
Author: ?Nitro
Description:
Checks for a pot license
*/
private ["_cop","_target"];
_cop = param [0,objNull,[objNull]];
if (isNull _cop) exitWith {}; //Bad entry
if !(["license_civ_pot"] call life_fnc_levelCheck) exitWith {
"This player does not have a pot license!" remoteExec ["hint", _cop];
};
basically the same as the long one I sent earlier
you wrote it completely wrong so, no it does not match
?
wait hold on, this is different
is this before or after you changed it to spawn?
I never changed it to spawn
???????????
the one I just sent is current
ok, so after
where are you defining this
Functions.hpp
and you really should use a different prefix from the mod
cant
then where are you putting Functions.hpp?
you can do that?
says who?
ever played altis life?
every core script uses it and every addon script uses it.
I forgot to add the function to my CfgRemoteExecute..
that might do it.
literally no
if you put ```sqf
isNil "life_fnc_checkPotAction"
class CfgFunctions {
#include "Functions.hpp"
};
OH
man you had me confused, I looked at the source code
Functions.hpp is just a header file included in Description.ext
no I see why they did it this way
it just didnt make sense out of context lol unless that's standard practice for complex mission files that i'm not aware of
its hard to get support on this stuff cause its pretty nonstandard lmao
still not working.. omfg
@warm venture what happens if you do this
in a debug console or something?
yeah
"type bool expected string"
ok but can you do exactly what I wrote
hint isNil "life_fnc_checkPotAction"?
It wont give me an output if I dont put the hint
your debug console doesn't give you a return?
wait is that a CBA thing?
hint str (isNil "life_fnc_checkPotAction") in that case
then your function is defined
right
try [player] call life_fnc_checkPotAction;
[player] remoteExecCall [""life_fnc_checkPotAction"", life_pInact_curTarget];
the target?
did you do this local or server exec
local
it should have run locally for yourself and then remoteExec'd a hint to yourself
try adding a systemChat line at the start of the function
ok so
private ["_cop","_target"];
_cop = param [0,objNull,[objNull]];
if (isNull _cop) exitWith {}; //Bad entry
if !(["license_civ_pot"] call life_fnc_levelCheck) exitWith {
"This player does not have a pot license!" remoteExec ["hint", _cop];
};
that's the funcftion
I dont think _target is even needed
it's not
params ["_cop"];
if !(["license_civ_pot"] call life_fnc_levelCheck) exitWith {
"This player does not have a pot license!" remoteExec ["hint", _cop];
};
this is your function without all the junk
alright, so the levelcheck works to tell me that I dont have the license, which is correct
so I know that part works
you're making sure the functions recompile right?
so my full function call would be...
[player] remoteExecCall [""life_fnc_checkPotAction""];
it's just simply saving the sqf file and making the mission a .pbo
No.
no manual compiling needed
that will run the function on every client
oh wait
I mean when you're testing.
I don't see what the issue is
try ```sqf
[player] call {params ["_cop"];
if !(["license_civ_pot"] call life_fnc_levelCheck) exitWith {
"This player does not have a pot license!" remoteExec ["hint", _cop];
};}
I can tell you I just ran this (replacing the levelCheck call with false) and it's working fine for me
So why do some people use params and some use private?
they're different commands
params defines variables and private declares them
params takes the arguments you passed (in this case the player object) and defines them locally for use within the function
so you dont need to also define them in private[] if they are in params
correct
my brain is melting
this is only half true though
the syntax you were referring to declares local variables
but nowadays (post-altis life development) you can define variables like private _myVar = value
I can try the other thing you had above..
please for the love of all that is holy tell me that's a player
and not an ai
right
[player] call {params ["_cop"];
if !(["license_civ_pot"] call life_fnc_levelCheck) exitWith {
"This player does not have a pot license!" remoteExec ["hint", _cop];
};};
try this you said?
yeah see if that checks your own license
REEEE
[player] call {params ["_cop"];
if !(["license_civ_pot"] call life_fnc_levelCheck) exitWith {
"This player does not have a pot license!" remoteExec ["hint", player];
};};
Running this locally does absolutely nothing
to use the same variable name for consistency
but changing it to just player doesnt work either
edited above.
yes but were remote executing it
wait
yep
not in my CfgRemoteExecute.
it needs to be
in order to remoteexec
is hint client or server? client right?
you have to whitelist commands?
"alkwfjoawjfiawjfojawofaw" remoteExec ["hint", player]; this doesnt do anything even on its own so its def not liking the remoteexec on this
client i guess
for future reference if you write systemChat or diag_log in a commands in a function it will write to the chat and the log respectively
which is why i said this
that will help you diagnose your code
I tried it, told me there was a missing ] or something
then you got the syntax wrong
after adding it to my CfgRemoteExecute...
it now KINDA works, it sends the message to the wrong person tho 
i think ik why
IT WORKSSSSSS
THANKSSS
Can someone please remind me how I select a AI unit from my squad in sqf (eg. unit 2 of the squad)?
The unit is part of the player's squad
_unitList = units player will give the list of the units in the players group
https://community.bistudio.com/wiki/units
Thank you. Do you also know if there is a command which returns the units which are currently selected (via F2, F3, F4.....) so that I could store them in a variable?
To be more clear, I have the code below:
{
_x doTarget _target;
GlobalTarget=_target;
}forEach units group player;```
Instead of running this script for the whole group, I only wanted to run it for the 4th unit in the group (selected by F4 ingame).
i'm not sure, but seems like this might be the command you are looking for https://community.bistudio.com/wiki/groupSelectedUnits
Yea, found this before too. Still not sure how to make it work though
I've never used that command but if it does what you're looking for you need to use select to get a unit out of the array
so, if you always want, the 4th unit in that group your command will be: (units player) select 3
If you want to select the unit yourself with the F4 and then execute some sort of script, you can add a waituntil F4 key is pressed and then do your stuff.
{
_target = CursorTarget;
(units player) select 3 doTarget _target;
GlobalTarget=_target;
};```
trying this
somehow this does not work it seems
Because is not executed?
yea, it does not get executed
your code works just fine, just tested it
seems like your trigger isn't doing its part
Hmm, weird. I will try again.
I added a hint to it and it does not get executed
Iโll look into it
when executing in the debug console, i'm getting the target in the GlobalTarget variable
how are you calling the script then?
// the inside of it won't be called, unless you put any commands like call, forEach, etc, etc
}```
i thought he putted that just to demonstrate it as a code
But that's what I assumed
_handleTarget = { _target = CursorTarget; (units player) select 3 doTarget _target; GlobalTarget=_target; };
Then call it with 0 spawn _handleTarget; just to give you an example how to make it work
here are some ressources to this: https://community.bistudio.com/wiki/Category:Arma_3:_Functions
no i did not
sorry
that's where i am struggling
what would i need to add to make my code work pls?
ok,so basic question, when exactly should your script trigger then?
how does that code looks like?
Itโs from addiction. Init field of the unit
can you post the addAction code and your sqf file then?
Yes, will do. Back in 20 minutes to paste the code.
Is it possible to get a bunch of helicopters to fly to a point. Hold position and fire from there?
have you tried the "move" and "destroy" waypoints?
hold waypoint?
Same thing
Managed to solve it
Thanks for your help eveyone
Is there a command to return the unit's current target?
To use it in forgetTarget
_x forgetTarget assignedTarget _x;
maybe this works
assignedTarget, getAttackTarget โ that one?
player setVariable ["Array",[objnull,nil,objnull]];
if this was placed in an object init, it should be executed locally on every joining player, right?
Yes. Be careful; if the variable is supposed to change mid-mission, players joining after that might see this initial value rather than whatever it got changed to.
No it will not change during the session
But it seems like when I run client server (eden editor MP preview) i don't have the variable defined on me
Why is that?
so when on debug I locally execute:
player getvariable 'array'
it returns nothing
also
https://community.bistudio.com/wiki/BIS_fnc_fire
is not firing in MP? (fires normally in SP)
first of all naming your variable after a data type is a bad idea, I wouldn't recommend it. Having one of your array elements be nil is also probably not super smart, I wouldn't bet on that working properly.
If you want to do something like this, it would also be best to use init.sqf or initPlayerLocal.sqf rather than an object init.
I'm not aware of BIS_fnc_fire having trouble in MP, other than the note on the wiki page that it's a global function so it shouldn't be executed from init fields.
I changed the actual variable name to array just for the sake of giving an example
And nil works normally?
For me Bis_fnc_fire doesn't seem to work when called from MouseButtonUP Eventhandler in MP
Is there a better homologous to that function that I can try?
Depends what exactly you're using it for.
There's fire, fireAtTarget and forceWeaponFire that do slightly different things.
why not use initPlayerLocal.sqf for client init?
player is not necessarily defined in object init
just fire
no targeting
making an eden composition
makes sense
you need scripting for that? ๐ค
yes its a box with an action
that runs a script
that's what I intend on doing
ok ๐
hey anyone have any good script options for building stuff? ideally something that doesn't require ACE. I want to have there be a list of buildings you can build, and then you have to actually 'build' it by doing an action that locks you in an animation while it builds
does this exist?
@drifting portal true but thats not exactly what i meant
I was thinking something where you have to like, build it with an animation for a bit
hmm... ill think about it more
did you check the videos in the steam page?
it also has point system
thats good but I meant like... you know that one addon that does trenches for ACE?
where you take the tool out and dig
i was hoping something like that where you have to actually do an action to build it
๐คทโโ๏ธ not sure though
this one uses the repair action for vehicle
https://sqfbin.com/ficoculavijexelazudi
why is bis_fnc_fire not working in MP in this script?
huh. I'm surprised that works in SP.
well it works perfectly in SP
in MP it doesn't seem to fire
oh I see. That's pretty funny stuff.
Ain't funny to me tho :(
Hey, does anyone know the hitpoints for vehicles when they blow up, as i want to make it so when a vehicle 'blows up' it just doesnt do the blowup animation as it causes FPS drops
I think you better use handledamage for such thing
Ok, this really is quite weird. Apparently BIS_fnc_fire uses a remoteExec for the actual forceWeaponFire call, which executes after the SPG is deleted in MP.
Seems like it's a frame order timing difference between SP and MP
deleteVehicle is typically a next-frame thing, not immediate.
you can workaround it with a spawn + short sleep.
@tacit tartan There's second version of setDamage that has a toggle to skip destruction effects, although I seem to remember that this is... partial.
@drifting portal Direct use of forceWeaponFire might work too, but I only tested delaying the unit delete.
testarray2 = [];
cfg = configfile >> "CfgMagazineWells" >> "HunterShotgun_01_12GA";
if (configproperties [cfgarray] isNotEqualTo []) then
{
{cfgentryarray = getarray (_x);
if (cfgentryarray isNotEqualTo []) then
{ testarray2 pushBackUnique _x;
}foreach cfgentryarray; ############################## ERROR HERE: type number, expected code
}foreach configproperties [cfg];
};
can anyone tell my why this is throwing an error?
sleep is good enough for me, thanks
@grim cliff The then statement is lacking code brackets.
(โฏยฐโกยฐ๏ผโฏ๏ธต โปโโป
5th time ive done that specific mistake and spent 3 hours debugging it
I am also disturbed by your lack of local variables :P
my man is very compact with his lines you know
Yeah i used that on the vehicle but still seems to not blow up with out the animation even when i set the setDammage animation to false
me?
i was constructing this in arma 3 debug console. the script uses _ before each variable name if thats what you mean
"Introduced in Arma 3 0.50" says yes, but I wouldn't count on it working well or in MP
Looking at its source code
made me confused
what parameters does this function take?
ยฏ_(ใ)_/ยฏ
something in arma working well? 
its source code:
https://sqfbin.com/tonicabifovoluhohoqa
you're not supposed to read FSM. you should open it with an FSM viewer
Hello. In my missions I use Respawn, the game is in multiplayer between players. I need to make 2 game slots (units) without respawning. I am using ACE spectator and tickets. I need that when dying, playing as one of the two units, this player does not respawn, but can only observe, and all the other 25 players continue to respawn as usual.
I have an issue that totally has me stumped
_MagsArray = [];
{
_magwell = _x;
diag_log "current magwell itteration:";
diag_log _magwell;
_cfg = configfile >> "CfgMagazineWells" >> _magwell;
_cfgArray = configProperties [_cfg];
if (_cfgArray isNotEqualTo []) then
{
diag_log "check passed, array has entries";
{
_cfgentryarray = getarray (_x);
if (_cfgentryarray isNotEqualTo []) then
{
{
diag_log "pushing this value to array:";
diag_log _x;
_MagsArray pushBackUnique _x;
} foreach _cfgentryarray;
};
}foreach _cfgArray;
};
} foreach _MagWells;
diag_log "setting Undermuzzle array alias:";
diag_log _MagsArray;
_UndermuzzleMags = _MagsArray;
diag_log _UndermuzzleMags;
}
else
{
diag_log "magwells array empty, using default magazines";
_UndermuzzleMags = getarray(_loot >> _Undermuzzle >> "magazines");
diag_log _UndermuzzleMags;
};
/*error*/_UndermuzzleMags = _UndermuzzleMags - LOOT_bannedItems;
_mags = selectrandom _UndermuzzleMags;
_holder addMagazineCargoGlobal [_mags, _count2];
};
at the bottom here i keep getting an error in the .RPT file saying this:
18:58:38 "setting Undermuzzle array alias:"
18:58:38 ["1Rnd_HE_Grenade_shell","UGL_FlareWhite_F","UGL_FlareGreen_F","UGL_FlareRed_F","UGL_FlareYellow_F","UGL_FlareCIR_F","1Rnd_Smoke_Grenade_shell","1Rnd_SmokeRed_Grenade_shell","1Rnd_SmokeGreen_Grenade_shell","1Rnd_SmokeYellow_Grenade_shell","1Rnd_SmokePurple_Grenade_shell","1Rnd_SmokeBlue_Grenade_shell","1Rnd_SmokeOrange_Grenade_shell"]
18:58:38 ["1Rnd_HE_Grenade_shell","UGL_FlareWhite_F","UGL_FlareGreen_F","UGL_FlareRed_F","UGL_FlareYellow_F","UGL_FlareCIR_F","1Rnd_Smoke_Grenade_shell","1Rnd_SmokeRed_Grenade_shell","1Rnd_SmokeGreen_Grenade_shell","1Rnd_SmokeYellow_Grenade_shell","1Rnd_SmokePurple_Grenade_shell","1Rnd_SmokeBlue_Grenade_shell","1Rnd_SmokeOrange_Grenade_shell"]
18:58:38 Error in expression <UndermuzzleMags;
};
_UndermuzzleMags = _UndermuzzleMags - LOOT_bannedItems;
_ma>
18:58:38 Error position: <_UndermuzzleMags - LOOT_bannedItems;
_ma>
18:58:38 Error Undefined variable in expression: _undermuzzlemags
18:58:38 File LOOT\Functions\fn_chooseLoot.sqf..., line 258
so i know that _MagsArray is receiving the pushback, and that _UndermuzzleMags is populated, so why is it telling me that the variable is undefined!?
I see these errors in your code when I throw it in a linter:
also you might want to work on your indentation skills... 
If you're writing anything more than a few lines long in the debug console, write it in a proper editor first.
Anyone know any consistent ways to apply velocity to an AI that'll throw them in a direction - I've got it working about 50% of the time with this, but the other 50% they just ragdoll on the spot:
[]spawn{
_Launch = "RoadCone_L_F" createVehicle [0,0,0];
_Launch attachTo [player,[0,0,0],"leftHand",true];
_Launch enableRopeAttach true;
[player, "Katarn_Punch"] remoteExec ["playActionNow", 0];
_Targt = "RoadCone_L_F" createVehicle [0,0,0];
_Targt attachTo [u1,[0,0,0],"pelvis", true];
_Targt enableRopeAttach true;
_length = _Launch distance _Targt;
_rope = ropeCreate[_Targt, [0, 0, 0], _Launch, [0, 0, 0],_length +2];
_vel = velocity _Targt;
_dir = _Targt getDir _Launch;
_speed = 110;
u1 setVelocity [
(_vel select 0) + (sin _dir * _speed),
(_vel select 1) + (cos _dir * _speed) + 5,
(_vel select 2)
];
ropeUnwind [_rope, 35, (_length * -1), true];
};
use syntax highlighting
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
Fixed.
Maybe if you hit them a bit up as well as along. Otherwise they might just catch on nearby terrain.
Haven't tried it though.
They are thrown up a touch.
_vel select 1 is up.
Goes x, y, z.
I'm telling you from FLAT number testing, (0,10,0), that second value, y, is throwing the target up.
I'm aware it's not meant to be doing that - but it is.
i had to cut it down otherwise discord wont let me send it
use sqfbin then
@long bloom I literally checked the same thing in debug console just to check I wasn't going mad, and Z is clearly up.
where do i find that?
well idk where you're testing but your object is probably getting thrown off something into the air
VR Map.
No objects placed.
well yeah it's definitely not defined:
because it's defined in the if's scope
not outside it
So how do I get it of the scope
you can use private
either declare them or even better, also initialize them with default values
private ["_count2", "_blabla"];
if (_Bla) then {
_count2 = ...;
_blabla = ...;
};
or:
private _count2 = 0;
if ...
directly pasting the code in the debug gives this?
tried putting the macro at the line 1, same error
probably something I'm missing
yeah I forgot you can't use # in macros
that's sad
#define InRange(x) ((_mPos select x) >= (_c1 select x) - _size && (_mPos select x) <= (_c2 select x) + _size)
use that instead
nearestObjects [ASLtoAGL _spawnPosASL ,["TREE", "SMALL TREE", "BUSH", "BUILDING", "HOUSE",
"CHURCH", "CHAPEL", "CROSS", "BUNKER", "FORTRESS", "FOU
that's nonsense
just leave the types array empty
also those stuff you put there are terrain obj classes
not obj classes
I want to avoid terrain but object is good too so yeah I will do that
alright its working perfectly
great job
all of this just to launch someone safely in a cruise missile
many thanks, here have a Lou certificate 
I don't think you understood what I meant. read this:
https://community.bistudio.com/wiki/Arma_3:_Named_Properties#class
nearestObjects doesn't use LOD classes
what you put there are only used by nearestTerrainObjects
true that's where i got it from
before I have done that silly array I had ran nearestobjects with []
and it brought up rocks and stuff
so I thought it can be filtered the same way
I'm just afraid of something
there is butterflies in the map
which caused me to do this
would they affect the launch?
the game doesn't spawn "butterflies" when you're in the air
but when you are in the eject seat?
you're still in the air
so there is no altitude that determines if you are going to have butterflies or not
because eject seat can still be like 3 meters from the the terrain you know
3 meters in air
I'm pretty sure the game doesn't spawn any insects when you're in a vehicle
but I'll test
it does... 
insects are not agents
dammit
so this here
should return true if _x is butterfly or false
false
if (isClass (configFile >> "CfgNonAIVehicles" >> typeOf _x) then {continue};
I will go ahead with this then
missing a bracket
those damn brackets
alright looking good hopefully
Thanks yet again
Well I'm planning on make a MP mission that involves "extensive" cutscenes
is there any advice on how to sync camera sequences for all players involved? (4 max)
I plan on using remoteExec spawn
there will be a long cutscene (like 3 minutes I know its a lot lol)
That's what is worrying me honestly not anything else "simpler"
Make all the camera stuff local. Put it in a CfgFunctions function. RemoteExec the function.
that's really sound
I'm wondering, is it better to section the cutscene?
so like 1 function for every 30s
3 minutes = 6 functions?
Not really. That just means you have to worry about timing the changeover properly. And of course, 30 seconds of mostly static camera is not equivalent to 30 seconds of action camera with rapid cuts.
it will be all rapid mostly
You could have separate functions for the camerawork and for the things that happen for the camera to watch. That would make it easier to keep track of things. But it's not ultimately necessary.
well here comes the tricky question and I do hate trickery by the way
say somebody disconnects mid cutscene then rejoins, is there a possible way to actually sync him?
and not start the cut scene from the very start for him?
That would be where multiple functions (or, more likely, multiple calls of different parameters in the same function) would be helpful. However, the player would still be cutsceneless for however long it takes for the next section to start (up to 30 seconds in your example).
yeah its the cutsceneless part I'm afraid of
he just joins to stare into any empty desert
lol
for like 30 seconds
There aren't too many good solutions to that. Players disconnecting is always a trip-up point and there's only so much you can do to mitigate it.
if there is only a way to remove the abort button from pause menu
well obviously there is but I don't know the control name
wait I forgot I'm using userdisableinput 
they can't reach pause menu anyways lol
Disconnects : resembles the dark parts of human mind
I guess I will have them staring at a rotating submarine
until the next 30s hits
_car = _this select 0;
private ["_songlist","_songsel"];
_songlist = ["song1", "song2", "song3"];
_songsel = _songlist select floor random count _songlist;
playSound [format["%1",_songsel],false];
_car remoteExec ["removeAllActions"];
[] spawn
{
_sound = ASLToAGL [0,0,0] nearestObject "#soundonvehicle";
waitUntil {vehicle player == player};
sleep 1;
[_car,["Speaker Radio On","Speaker.sqf",[],1,false,true,"","",3,false,"",""]] remoteExec ["addAction",2];
[_car,["Headphone Radio On","Headphone.sqf",[],1,false,true,"","",3,false,"",""]] remoteExec ["addAction",2];
deleteVehicle _sound;
};
How do I get the addAction to target individual vehicles automatically, so I don't have to manually copy, paste and rewrite this 6 times?
A foreach loop?
your code doesn't make much sense especially without context
Basically its an outside speaker radio for a car
The car has ab addAction Speaker On
I have a song list of 3 it randomly plays 1
Then it removes the addAction from the car.
It defines the playSound _sound and if you get out of the vehicle the music cuts.
My problem is how do I add a new addAction for difreant cars since it will work for one if I replace the _car at the bottom with a variable name like A_car but then if I run the script on a difreant car it will not give its addaction back.
How can I make it so the script always applies the addaction back to the one that is running the script
How do i do that?
Yep just realised I shouldn't be trying to put it into the [] spawn
now it works with _car
Anyone know how to make it so your friends can see the vehicles you spawn in DCON Multiplayer Vehicle Spawner or Virtual Garage? If you do DM me or Ping me.
@eternal frost do not crosspost your question - stick to one channel, thank you
it would be here I think, as it involves scripting and functions
Oh ok thank you sorry for that I just didnโt know where to put it.
Wonโt happen again sir.
hey thanks, and no worry ๐ (sorry I don't know the answer)
Itโs alright.
quick question ive heard many people call sqf other things but what does it stand for?
could just be a case of searching through the code (if its a script) then changing createvehiclelocal to createvehicle
Hold on
its a mod i cant help ya sorry but check out www.zamarma.com download ezm then follow steps they have essentially that loaded into a zeus module
why are you doing remoteExec to the server for addAction?
you can use spawn if you need to, you just have to pass local variables to it
I'll try out spawn
why
I said you can if you need to but why do you need to
your code doesn't make much sense to me ngl I don't understand why you're adding an action and playing a sound in the same script, and you want to loop it for multiple objects??
are these multiple script files thrown into one code block?
how would i test if the zeus UI Overlay is hidden for the zeus?
Trying to time "hideobject" with it
an alternative would be to check which object the zeus has selected currently
guess that should work
curatorSelected is probably local to the curator. IIRC it doesn't even persist if the curator selects something and then closes the interface.
local to the zeus player rather than the curator object.
thats alright, the selected object is a local object to the zeus too
so it should work
can someone give a hint on what im doing wrong?
_anchor spawns, but is not added to me as zeus.
addCurator..Obj is server execution tho according to biki, thats why im remotely calling it on server
//LOCAL CODE TO ZEUS
//spawn anchor object
_anchor = createVehicle ["Sign_Pointer_Blue_F",_pos]; //anchor is global object, but local to zeus
_anchor hideObjectGlobal true;
_anchor setPosASL _pos;
{
[_x,[[_anchor], true]] remoteExec ["addCuratorEditableObjects",2,false];
} forEach allCurators;
was a bug.
Calling "JIP true" but targetting the server just makes the command fail.
20:19:30 Trying to target client #2 during JIP when calling RemoteExec(Call) 'addcuratoreditableobjects'. Target must be 0 for JIP
Well yes, if the server joins the mission after it starts you've done something weird to the fabric of space-time :P
Remove false from JIP
Why do you think that would make any difference?
Idk about you man but I have server on my steam friendlist
Well the version I use doesn't have the JIP parameter
And works normally
JIP false and no JIP parameter are exactly the same; the default is false.
The problem was caused by JIP true. They edited the message after discovering this to correct it.
Alright I came late then
anyone know the path to arma tower markers (tower 1, tower 2, etc etc)
yeah its not there
try
going to these directories manually
and searching every folder
that's if
what you are looking for is a map icon
try #arma3_gui
- Because your question doesn't make sense
- Over an hour of no response is normal, especially it is a midnight in Europe
- If you have a question, describe it like everyone can understand
Well im trying to import my custom control classes with arma dialog creator and its not finding them with the description.ext.
Its not finding them, what does it mean
there is an "import" button and its supposed to read a description.ext file which would have #include "file.hpp" and pull the dialogs from it but its not working.
Its not working, at what context? You can't load Dialogs you made? Did you do Ctrl+S?
It is supposed to find dialogs inside the file and put them into a grid type thing for you to see "look at the ones it found" its finding nothing.
did that. even browsed icons with a script in debug console. Maybe they are custom .paa, but I'd have sworn I'd seen them reference at bi forums.
for reference this is what i am referring to:
tbh I have never seen this
where did you find these icons?
seen them on koth servers.
right on
save your time and go try to check KOTH framework
thanks. ill conjure something up
looking for these
probably github idk
Is it open source?
there's a koth discord and the dev is in this server (probably EU time) if you want to ask about it directly
I'm going to hazard a guess that the icons are made specifically for the gamemode and are not otherwise distributed
my precious 64x64 icons
@warm venture I tried using Arma dialog creator when I started making gui and I ran into a plethora of problems that all stemmed from the program itself. I would reccomend just using the one built into arma
to be honest it was more of the dev having fun making the program than actually making it
I think he left it unpatched for 2 years?
he got no time for it sadly
the arma dialog editor is the single worse thing ive ever seen
Ya it isnt super user friendly, but it works ๐คทโโ๏ธ
I have yet to see a good 3rd party GUI editor lol
it so sad because there is so many classes both In game editor and Arma dialog editor doesn't include
perhaps
use screenshot command
gonna add labels to all the buttons
hmmmm smort
always try to minimise with GUI
any idea why my phone background image wont load ingame but the rest do? If I convert it to a paa instead of a png it loads but its ghostly looking, transparent
could use the background to make a ied detonater if you add an insurgent faction (im assuming this is altis life)
it is yes
but im confused about the phone background thing lmao
use the same template to make an ied trigger
idk why my image is transparent though
wouldnt be too hard either simply setting somethings damage on button press
is it possible to check if the action menu is opened ?
...nvm i figured it out :p
hi all, I'm looking for some help with something that I am blocked on. In my mission, I would like to have the AI copilot drive the heli back to base if the player pilot is KIA. I've been playing around with 'assignAsDriver', 'addVehicle', and '_coPilot action ["TakeVehicleControl", vehicle player]' to no avail.
Eventually I'd like the AI to land, extract and heal the player pilot if incapacitated, but wanted to start with a simple KIA situation - this way at least the asset can be reused by another player.
I am running these experiments from within onPlayerKilled btw
Can anyone offer some advice on how I can get an AI copilot (who is not in the player's group), to wave off on player KIA, and have them land safely at a designated location?
if !(isNull objectParent player) then {
systemChat "player died while in vehicle";
_vic = vehicle player;
if (currentPilot _vic == driver _vic) then {
systemChat "The dead player was the pilot";
private _fnc_getCoPilots = {
private _copilotTurrets = allTurrets _this select { getNumber ([_this, _x] call BIS_fnc_turretConfig >> "isCopilot") > 0 };
private _copilots = _copilotTurrets apply { _this turretUnit _x };
_copilots;
};
// thank you KK!
_cp = (_vic call _fnc_getCoPilots);
_coPilot = _cp select 0;
_coPilot assignAsDriver _vic;
_cpGrp = group _coPilot;
_cpGrp addVehicle _vic;
_coPilot action ["TakeVehicleControl", vehicle player];
_cpGrp move [10482.9,6510.67,0];
// [_cpGrp, [10482.9,6510.67,0], _vic] spawn BIS_fnc_wpLand;
};
};
This is as far as I could get - if the heli is on the ground and the player is killed, the AI cp will get out, get into the drivers seat and fly to that point (but not land).
If the heli is in-flight, it crashes sadly
Can an AI copilot take control, go somewhere and land without having to change into the driver seat (in this case managed within onPlayerKilled)?
How can I tell a reliable moment to start adding title displays with cutRsc?
Alright I know exactly why that is
Right I'm doing unscheduled each frame waiting for findDisplay 46 and first PreloadFinished and sometimes cutRsc doesn't appear.
https://community.bistudio.com/wiki/ImageToPAA
Important note: All input textures must have resolution 2^x / 2^y (e.g. 16 / 16, 32 / 32, 64 / 64, 256 /256). The largest texture size commonly supported by graphics cards and RV engine is 4096x4096
What?
if(isNull findDisplay 46) exitWith {};
if(isNil"client_preloadFinished") exitWith {};
```With cllient_preloadFinished getting defined with
```sqf
onPreloadFinished "client_preloadFinished = true; onPreloadFinished """";";
You are referring if you can't add it while they are in the zeus interface/respawn menu?
Because you can
No, I'm talking about client initialisation.
Well if you do remoteExec with JIP enabled it will work normally
But yeah I think you better add it when display 46 is not null, in case you don't want to remoteExec
You don't get my question at all.
Sorry