#arma3_scripting
1 messages · Page 167 of 1
Well maybe not this time. I still get the errors. Maybe it's the function isn't compatible with the variable?
How can I debug your code without reading your code?
The function:
params ["_convo", "_speakers"];
{
_x setVariable ["foxclub_var_isTalking",true];
} forEach _speakers;
private _conversationData = foxclub_var_conversations get _convo;
{
_x params ["_speakerIndex","_text","_sound", ["_delayAfter", 0], ["_customCode", {}]];
private _speaker = _speakers select _speakerIndex;
if (isNull _speaker) then { _speakers spawn _customCode; sleep _delayAfter; continue };
if !(alive _speaker) then { break };
_speakers spawn _customCode;
private _sound = _speaker say3D _sound;
_speaker customChat [FOX_DialogueChannel, _text];
_speaker setRandomLip true;
waitUntil {isNull _sound};
_speaker setRandomLip false;
sleep _delayAfter;
} forEach _conversationData;
{
_x setVariable ["foxclub_var_isTalking",false];
} forEach _speakers;
And what error
_x is undefined variable
I think it's because of the scope, _selectedUnit is inside of that scope (if condition) and when you try to call it out of it, it gives you undefined variable
In where
_x doesn't seem to be a related issue
You sure _sound is an object here? Debug log it like systemChat
this might be the "last" error, so it masks the origin
and also, _selectedUnit is undefined here
SelectedUnit = selectRandom _unitsInArea; Is that correctly written?
if it's a global, no problem, but if it's a local variable, it's valid for just that scope { }
It's still only defined to that scope
Just add a private ["_selectedUnit"]; before the if
you need to create it in the parent scope
private ["_someVar"]; // initalizes variable with no value
if (...) then {
_someVar = 1;
};
_someVar; // 1
Question to the great minds of Arma community. Can we play ambient music in the Arma 3 lobby (The role selection screen) ???
Tyvm! @tulip ridge @thin fox @warm hedge This fixed it. I tried reading the biki on scope and it's above my head. Is there like a eplain like im 5 version of it?
Each time you do {} is a new scope.
You can't access variables from a lower scope, but you can initialize them and then give them a value later
I really understand this not by reading but by failing many times actually, had a lot of this similar errors before and I've learned
Does lower scope mean {} inside other {}?
// initPlayerLocal.sqf
playSound "SomeSound"; // Sound defined in CfgSounds
Thanks will give it a try
Yes
// fnc_someFunction.sqf
scopeName "main"; // main scope of the function
private _mainVar = 1; // defined in main scope
if (true) then {
scopeName "if"; // if check within the function's scope
private _ifVar = 2;
_mainVar; // 1, _mainVar is defined
[] call {
scopeName "if_call"; // new scope
private _callVar = 3;
_ifVar = 4;
};
_callVar; // nil, _callVar is undefined
_ifVar; // 4, value was updated in the call
};
_ifVar; // nil, _ifVar is undefined
I would recommend checking your scripts in the Console from the Advanced Developer Tools mod. Here you can see that _callVar and _ifVar are underlined here because they are undefined
Oh nevermind, you can use playMusic. I thought it played the music for all players, but it's actually local
I had no idea a could resize the window with ADT...🤦
Yep, you can drag the sides
So cool it underlines the variables. Great tip. tyvm
Definitely helps when first learning
hello Dart
@tulip ridge i'm still having lots and lots of fun with my chopper Script that you helped me with
Nice
thx you so much
Lou helped me today with my clean up script and now that works great too WooHoo
love you guys
i learned so much from you guys thx to all you guys

im brain farting so hard right now
FNC_Barnicle_Attack =
{
systemChat "Debug: Trigger has detected an object";
params ["_unit"];
private _Barnicle = _unit;
private _BRNTRG = _Barnicle getVariable "BarnicleTRG";
_TrigArea = triggerArea _BRNTRG;
{
systemChat "Debug: human detected in area"; //do i even need to do this "_x" in brackets then for each at the end? i dont remember ;A;
_x attachTo [_Barnicle, [0,0,-1.5], "tentacle_tip"];
_Barnicle setVariable ["BarnicleActive", false, true];
_Barnicle setVariable ["BarnicleCaptive", _x, true];
_Barnicle animateSource ["tentacle_slide_source",1];
} //I dont remember what goes here to target the object that fired off the trigger
}; //end of attack function
- What it does mean by _x in brackets
forEachto iterate with multiple elements
Where do you run this fnc and how?
As for the trigger question, triggers are activated by more than 1 entity so you need an array, which is either thisList or list _trigger (depending on where/how you run the fnc)
oka
i got timed out when posting the context...
the message i tried to send >
questions in notes
context
im calling a function from a trigger created in another function, and in this function im trying to say
pick up the *silly lad who fired off the trigger
MAR_Barnicle_FNC =
{
systemChat "Debug: initializing barnicle";
params ["_unit"];
private _Barnicle = _unit;
private _BarnTrg = createTrigger ["EmptyDetector", getPos _Barnicle];
_BarnTrg attachTo [_Barnicle,[0,0,0],"tentacle_tip"];
_BarnTrg setTriggerArea [1, 1, 1, false];
_BarnTrg setTriggerActivation ["ANY", "PRESENT", true];
_BarnTrg setTriggerStatements ["this",
"systemChat 'object detected attempting function call';
private _Barnicle = attachedTo thisTrigger;
[_Barnicle] call FNC_Barnicle_Attack;
systemChat'succesfully called function';",
"hint 'safu';"
];
_BarnTrg setTriggerInterval 1.5;
_Barnicle setVariable["BarnicleTRG",_BarnTrg,true];
_Barnicle setVariable ["BarnicleActive", true, true];
systemChat "Debug: Trigger Created succesfully and barnicle set to active";
};
and here's the function that creates the trigger, and its params
so i had it working before, i think with
foreach (units inArea _TrigArea);
or something similar
but i dont remember what i had there
1 the usual {_x setDamage 1;}forEach (Something) inArea thisTrigger
2 yee for each but i dont remember what comes after that
i keep getting like "missing ; #inArea" errors unless i put forEach allUnits inArea _TrigArea
could i just do forEach thisList triggerName?
do i need to specify? ; w;
my brain is farting so hard rn that i can barely even ask
basically remember yesterday in #enfusion_animation
im trying to do this again
but obv throwing the work to a function
thisList works if its in the activation section but
how would i do this externally?
forEach inList _triggerArea?
o wait thats a function
oh wait
haha
ty everyone ; w;
i think i need to rest
FNC_Barnicle_Attack =
{
systemChat "Debug: Trigger has detected an object";
params ["_unit"];
private _Barnicle = _unit;
private _BRNTRG = _Barnicle getVariable "BarnicleTRG";
_TrigList = list _BRNTRG;
{
systemChat "Debug: human detected in area";
_x attachTo [_Barnicle, [0,0,-1.5], "tentacle_tip"];
_Barnicle setVariable ["BarnicleActive", false, true];
_Barnicle setVariable ["BarnicleCaptive", _x, true];
_Barnicle animateSource ["tentacle_slide_source",1];
}forEach _TrigList;
};
this do indeed work
i just completely forgor my trials and tribulations from yesterday 
Hello, again got this to work. So the problem now is that the holdaction stays in place even MP. I mean that if one person interacts with the object, the action is still there for other people. I know there is a "BIS_fnc_holdActionRemove" script, but im not really sure where to add it.
This idea here is if possible, the object can only be interacted with once. Then the action will be deleted for the server.
You would run it in your statement
isnt it a bool in the params for BIS_fncholdActionAdd?
Only removes it locally it looks like
oh yea you right
At least that's the behavior they describe
Anyway just add this to your statement:
params ["_target", "", "_actionId"];
[_target, _actionId] remoteExecCall ["BIS_fnc_holdActionRemove", 0];
If you want a full example, here's the wiki's "hack" action:
[
_myLaptop, "Hack Laptop",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 3",
"_caller distance _target < 3", {}, {}, {
params ["_target", "", "_actionId"];
[_target, _actionId] remoteExecCall ["BIS_fnc_holdActionRemove", 0];
_this call MY_fnc_hackingCompleted
}, {}, [], 12, 0,
false // Globally removed anyway, no need to remove it locally
] remoteExecCall ["BIS_fnc_holdActionAdd", 0, _myLaptop];
Thanks! wil check this out
Any ideas how to prevent AI chopper from landing when trying to fast rope AI group? I assume the group leader tells the chopper to come down so he can regroup with his group members. Though, the chopper is not even grouped with them. DisableAI for the pilot didn't do much. I tried unassignvehicle for the whole group as soon as leader gets out. No luck.
is it possible to put some texture on unit to show which side the unit belongs to? like armband or something. i was thinking of maybe creating mod but idk whats the best way to do this so that all units both vanilla and mods can have that armband (or whatever texture)
Half life? hahaha
If I have a player attached to an object, is there anyway to change just their torso orientation, while keeping their feet still
To allow them to “look”/aim at things while keeping their feet planted downwards
As currently setVectorDirAndUp moves the whole body including the feet
Yea XD my friend wants it for their op, and I figured it'd be a fun weekend project
hey! i noticed the Portable flagpole object has a object specific variable that allows you to set whatever flag you want to it. how would i change this value through scripting?
setflagtexture
didnt even realise that was a function lol. thank you!
apologies for the ping, but i also found the function setFlagAnimationPhase and i was going to use that to set the flag to the top of the pole. only problem is that it doesnt seem to work properly, adding the correct flag type works fine, but the animation phase doesnt. any thoughts?
params ["_sectorName","_sectorPosition","_sectorRotation","_sectorScaleA","_sectorScaleB","_flagClassname","_flagPosition","_fogOfWar"];
_sectorScale = [_sectorScaleA,_sectorScaleB];
_sectorMarker = format ["|%1|%2|%3|%4|%5|%6|%7|%8|%9|%10",
_sectorName,
_sectorPosition,
"Empty",
"ELLIPSE",
_sectorScale,
_sectorRotation,
"SolidBorder",
"ColorOPFOR",
1,
""
];
_thisSector = _sectorMarker call BIS_fnc_stringToMarker;
private _sectorFlag = objNull;
if (_flagPosition inArea _sectorName) then {
_sectorFlag = _flagClassname createVehicle _flagPosition;
} else {
_sectorFlag = _flagClassname createVehicle _sectorPosition;
};
_sectorFlag setflagtexture opforFlagPath;
_sectorFlag setFlagAnimationPhase 1;
heres the code currently. this is being ran as a function (SPD_fnc_initSector)
ive never played with the ahimation phase thing, doesnt it normally animate with the wind?
setFlagAnimationPhase is apparently used to set how far up or down the flagpole the flag position is, with 0 being the bottom and 1 being the top
or atleast, thats what the wiki says
ah ok
maybe theres something weird with the pole because I tested setFlagAnimationPhase with editor placed flag and it worked
huh thats strange
was it the normal flagpole or the portable flagpole that you used?
because i was using the portable flagpole object just because i personally prefer how it looks
ugh this one: Flag_AltisColonial_F
right- welp, guess i better get to some testing and debugging lol
The portable flagpole is configured differently to the other ones.
setFlagAnimationPhase is meant to work with objects of type "FlagCarrier", which the other flags inherit from - but the portable one comes directly from "FlagCarrierCore", not via "FlagCarrier", which I suspect may be the problem.
However, it does have a normal animation source for the flag, which the other poles don't have. You should be able to manipulate that with ordinary animation commands like animateSource.
ah got it, do you know if theres a seperate function i can use for the portable flagpole? or should i just use the other flagpole types?
oh just read your second message, il try using animateSource
The source name is "Flag_source"
works, much appreciated o7
Hey there, i used exportJIPMessages to give inspect the JIP queue but i don't know what every "Type_XX" means. Does anyone know how to interpret the types or have a list to decode them?
They change with each version and BI aren't telling for security reasons. You can figure most of them out by experimentation.
That's a pitty, we have some logs with Server can't keep up, too many incoming network messages. Remaining in queue: 6802 - and i just want to know what the heck is flooding the queue 😄
Sanity checking because I rarely use remoteExec, but I had someone ask me:
[_target, ["HitHull", 1, false]] remoteExec ["setHitPointDamage", _target];
Is the correct format for setHitPointDamage, correct?
They were having issues with it but I suspect it was something else in their script
Yes, that's correct
That's what I assumed, thanks
Where's the .pbo? 🤒
wait, what did I do? I'm innocent 😄
play COOP
There's been large changes to JIP recently (async)- I'd check to see how many variables you are broadcasting and how frequently they are being set. Ideally if you can crunch those down it might help but not sure what your mission looks like and/or if it could be from other stuff like global objects.
is there a setting in game settings to turn off friendly fire
No
so i must script this ?
so how would i go about turning off friendly fire
or is it not posible
i kinda remember seeing a setting to turn off friendly fire or was that way back in Arma 2
oh shoot that was in that other game i play called -- (Vietcong 1)
It wouldn't be easy,
Probably painful scripting if it is even possible
You would have to intercept the damage handler,
Track the source of projectiles <<<<<<<<<<<<<<<<<------------------- Not even certain if this is possible with the way the engine works
Check if the vehicle is on the same team (both infantry and proper vehicles are vehicles in the code)
Pass damage to any other damage handler that is present if it's not on the same team, preferably passing it into any modded damage handlers present, so that ACE or other modded medical still works
And it breaks some of the normal gameplay of Arma, which might be acceptable depending on the purpose
Arma is not well suited to turning off friendly fire
oh my
i use no mods and i only make 10 player missions
so that would be p1 p2 p3 p4 p5 p6 p7 p8 p9 and p10
You want to just disable FF from players?
yeah
yes from players only
so mayb a EH would do the trick
hmmm my brain is thinking
lol
Handle damage eh
Check if the unit side is the same as the instigator.
Or if all players are on the same side,
Add handle damage on the player and just check if the instigator is the player.
ah yes
yes sweet
yes i think i can do it
thx for the input mate
ill see what i can come up with
i may need some more help
but ill let you guys know ok
if (!local this) exitWith {};
this addEventHandler ["HandleDamage", {
params ["_unit", "", "_damage", "", "", "", "_instigator"];
if ((side group _unit) isEqualTo (side group _instigator)) then {
_damage;
} else {
nil;
};
}];
It's very easy, what do you mean?
@pallid palm this should work for you
Glad it works for you
Hello helpful people of the Discord, I have a fun scenario idea for my small unit, where a handful of players would be assigned as traitors without the others' knowledge. However, my skills as a script writer are ... lackluster. I honestly don't know where to begin.
Could anyone give me some pointers on how to:
- Select three random players
- Assign certain tasks or map markers only visible to them
If you help me, you will never stub your toe again. Thanks!
lol
Hey everybody, I am interested in integrating a role select system into my server, which is invade and annex, and I am having difficulty with it
Would someone be willing to help me out,
I would also love to hear recommendations for other role select scripts that people know of
I was initially searching for quicksilver's role selection system but I couldnt find it online
yay ok
Did the commands for increasing uniforms' max load break/change behavior after 2.18? Our script that handles items in uniforms has stopped giving all the items we list via an array in an SQF file.
does anyone have a simple script for a trigger that'll send a hint to the pilot of a helicopter when they enter a trigger?
@mortal pelican https://community.bistudio.com/wiki/remoteExec
How is the trigger set up?
pretty much just gonna be smthn that activates whenever a blufor unit enters the area
so you just want to show a hint or do you want the trigger to command the pilot to do something
I want it to show a hint only to the (player) pilot of the helicopter
ahhh nice
there's only gonna be one blufor helicopter so i won't need to differentiate it or anything
literally just has to be "send a hint to the pilot only"
yeah look in that link i send its all in there
i should say: i am not a coder in any way
i have no idea how to put this together, im only really asking here because googling hasnt yielded me anything
So, if a heli pilot enters a trigger area, the pilot will receive a hint?
yes
I don't wanna just use hint because afaik that'll broadcast it to everyone, which isn't ideal because this is a mixed force (infantry w/ a support helo) op
is this for DED server
so i need to be able to give that to just the pilot
Hi ! Quick question does the onPlayerDisconnected take into account people who alt+f4 ? my first guess was that it doesn’t take it into account (because of a kill process by windows) but I wanted to be sure.
But because it’s a server command maybe it’s detected when the play is not on the server anymore ?
_pilots = ((thisList select {
(_x isKindOf "Helicopter_Base_F") and { !(unitIsUAV _x) }
}) apply { currentPilot _x }) select { !(isNull _x) };
if ((count _pilots) > 0) then {
"Hint" remoteExec ["hint", _pilots];
};
ah there we go awsome Schatten
Alt+F4 should exit the app "normally" so yes. But you can try it by launching two Arma
Awesome thanks, I’ll try this when I get back from work.
Even if the app has crashed, disconnect itself will happen too
tysmmmm
Updated the script.
that would go in the Activation em i correct ?
Yes, in "On activation" field.
ahh ok i got 1 more thing correct thats makes 2 things i got right lol
i'll need to give it a proper test on a server at some point, but it definitely at least gives me a hint when im going solo flying in!
im back so soon! how would I set it up so when a hold action is completed, it activates a waypoint?
You can't activate a waypoint, but you can either https://community.bistudio.com/wiki/addWaypoint or https://community.bistudio.com/wiki/setCurrentWaypoint.
and i assume I could also have it activate a module then?
Don't know.
the scripting woes continue. this, by all rights, should delete those two triggers when OPFOR is no longer present in the trigger. so the question is, why doesn't it
Because variables are unavailable.
And how does one fix such an issue?
I would sync triggers and then delete them using https://community.bistudio.com/wiki/synchronizedObjects.
so that'd just be deleteVehicle _synchronizedObjects instead?
If you introduce _synchronizedObjects variable, then yes.
please explain like i'm five, i have no clue what im doing lmao
There is a variable in your code line. If you assign a value to this var, then your code will work, otherwise it won't.
that should be covered by giving the two triggers a variable name though, right?
Guys Im writing in Snake_Case and my scripts are running slow.
2 Questions:
1.: Is camelCase better?
2. How to do a performance check with each command?
afaik camelCase and Snake_Case are just visual preferences?
Thats why Im asking
they're just text defining things, it shouldn't slow the script down any, though feel free to correct me if i'm wrong
I dont know haha.
- Context please. But usually it does not even matter
- Debug Console has performance test field
Im doing a script and everthing is delayed hahaha
Yes, but why introduce new variables if you don't have to?
the problem isn't how neat and tidy the variables and stuff is
“I'm doing a script” does not tell anything. What you've done is what I ask
the problem is that something that should work, doesnt
I wrote the reason and provided the solution.
I'm not asking for a video either. I'm asking for your code, to be exact
In summary:
//Positionen Intro Fahrzeuge
_position_aa_shot1 = [3383.646, 1872.071, 0];
_aa_shot1 = "O_APC_Tracked_02_AA_F" createVehicle _position_aa_shot1;
_aa_shot1 setDir 106.364;
//Spawnen Intro Einheiten
call Intro_BrennenderHMMW_1_fnc_Intro_BrennenderHMMW_1;
call Intro_Gruppe_I_1_fnc_Intro_Gruppe_I_T1_4_1;
call Intro_Gruppe_I_2_fnc_Intro_Gruppe_I_T2_6_1;
call Intro_Gruppe_O_1_fnc_Intro_Gruppe_O_T1_4_1;
it takes 8 secs to run
And what are Intro_BrennenderHMMW_1_fnc_Intro_BrennenderHMMW_1 etc
How do you run this, and how do you get 8 seconds
you really haven't though? no offense but
i have defined the two things that need to get deleted (deathTrigger and warningTrigger) by naming two triggers those things
therefore, when the third trigger activates due to opfor not being present in it, it should delete the triggers named deathTrigger and warningTrigger
saying that i need to define the variables doesn't help
I run this threw call Intro_BrennenderHMMW_1_fnc_Intro_BrennenderHMMW_1;
Is spawn better?
How you can be sure you took 8 seconds to run the entire
How you named your triggers? deathTrigger and warningTrigger? If so, then why you wrote
deleteVehicle _warningTrigger;
deleteVehicle _deathTrigger;
?
You've provided undefined variables and want that it to work?
In second 9 the intro started. Not in second zero:
waitUntil {time > 0 };
Are you trying to say your intro is not running for 9 seconds?
because those are the variable names given to those two triggers and therefore should be defined???
deathTrigger and _deathTrigger are not the same
You can't name editor entities using local variables.
It starts after 9 seconds
okay, thank you for actually explaining
So... where is your entire code for the intro
What is curr_time
This is a line i havent entered. Ill check on wiki 🫡
BIKI does not explain it
hmmmm. but its something in combination with isNil. I need to check what isNil does
But shouldnt the units spawn instant because theyre on top of the script?
Maybe. I'm not sure how you are sure they are not spawned
You saw the video?
Yes
Is this your init.sqf or something
Thats what
"call Intro_Gruppe_I_1_fnc_Intro_Gruppe_I_T1_4_1;
call Intro_Gruppe_I_2_fnc_Intro_Gruppe_I_T2_6_1;
call Intro_Gruppe_O_1_fnc_Intro_Gruppe_O_T1_4_1;"
does
this is intro.sqf Ive created in extra path
And what is calling intro.sqf
uhmm (embarrassing)
I'm not asking you to be embrassed, I'm asking what is calling intro.sqf
Ive used predefined script called AL_Intro
Im looking 4 it
Ive found it
This is init.sqf from them
if ((!isServer) && (player != player)) then {waitUntil {player == player};};
//EOS SYSTEM
//execVM "eos\OpenMe.sqf";
//[] execVM "respawnmkr.sqf";
enableSentences false;
sleep 2; this one makes the problem, could it?
/*
nul = [JIP] execVM "intro.sqf";
JIP 10 number, time in seconds doesent this delay something too?
- if negative the intro will be played for all JIP players regardless the time they join
- if is bigger than 0, players joining after the amount of seconds specified will not see the intro
Examples
INTRO will be played for all JIP players regardless of joining time
nul = [-1] execVM "AL_intro\intro.sqf";
INTRO will be played for all JIP players if they join in the first 10 seconds after mission start
nul = [10] execVM "AL_intro\intro.sqf";
*/
nul = [-1] execVM "AL_intro\intro.sqf";
//nul = [60] execVM "AL_intro\intro.sqf";
ive added the pre script
I try to understand. But there are many new things for me.
Im so sorry if I waste you time because the anwser is just that simple
Im just kinda confused because in normal case the intro starts instant...
many new things for me
This is a part of the issue. Don't introduce multiple new things once
I'd suggest:
- What it does do without
sleep 2; - What it does do without
waitUntil {!isNil "curr_time"};
Ive found out that JIP is Join in Progress. So if players loading the mission, this is only in multiplayer and dont effect it at all right now, right?
Copy commander 🫡 Im into
I'm not even sure what time_srv.sqf supposed to do. I cannot tell what the author tries to achieve there
Do I not have to delete this all beacuse if cause?
waitUntil {!isNil "curr_time"};
if (!hasInterface) exitWith {};
if ((!curr_time) or (_jip_enable<0)) then { //line28
cutText ["", "BLACK IN", 10];
I think that this sticks together cause after runnung Ive got issues from line 28
Or is it enough to just delete the or cause?
Runned this: (doesent work)
if (!hasInterface) exitWith {};
if (_jip_enable<0) then {
cutText ["", "BLACK IN", 10];
I seriously don't know. I cannot emulate how it is working
I only put my wild suggestion/assumption
Ok no problem. I also thought to throw all away and beginn from 0 (not at all cause knowlegde and templates)
But then I need a way to bring in this camera fly. Do you know a way?
Just a wild guess: replace this in intro.sqf: ```sqf
// by ALIAS
// nul = [JIP] execVM "AL_intro\intro.sqf";
waitUntil {time > 0};
_jip_enable = _this select 0;
[[_jip_enable],"AL_intro\time_srv.sqf"] remoteExec ["execVM"];
waitUntil {!isNil "curr_time"};
if (!hasInterface) exitWith {};
if ((!curr_time) or (_jip_enable<0)) then {
cutText ["", "BLACK IN", 10];
playsound "intro";
with this: ```sqf
// by ALIAS
// nul = [JIP] execVM "AL_intro\intro.sqf";
waitUntil {time > 0};
_jip_enable = _this select 0;
[[_jip_enable],"AL_intro\time_srv.sqf"] remoteExec ["execVM"];
waitUntil {!isNil "curr_time"};
if (!hasInterface) exitWith {};
if ((!curr_time) or (_jip_enable<0)) then {
// cutText ["", "BLACK IN", 10];
playsound "intro";
Just //cutText is diffrence or?
Correct. Only that line
Running half. Ill show
https://youtu.be/BLALJyXF0yc (uploading)
Unturend jetzt schon die 2. Folge mit:
JuliManu: https://www.youtube.com/channel/UCM7Ow4ZVLFZEFg0c5trMz8A
Flora: Hat leider keinen Kanal.
Das Spiel:http://store.steampowered.com/app/304930/?l=german
Not really...
And units didnt spawned in before 10 sec
I gues this could be the best solution. Is there an easy way to bring in the camera flight by scripting it manually?
Oh geez, I was looking at the wrong file lol (the example one and not the one you have edited)
Dont understand.. (language barrier)
"(the example one and not the one you have edited)"
So you looked on my version. Not on the .rar ive send?
But it has to be something with the thing youve edited. I mean it started for 1 sec. And then it ended. Like you saw in the vid.
@warm hedge @tender fossil
Is there a other way to bring in camera shots at the missions start?
gosh i have been trying to use checkVisibility to make a unit that stops moving when looked at and I am getting absolutely no-where, the wiki for checkvisibility is not much help
Post your code
I guess just have to debug then. Replace with this code: ```sqf
if ((!curr_time) or (_jip_enable<0)) then {
cutText ["", "BLACK IN", 10];
systemChat "Phase 1";
playsound "intro";
/* ----- how to use camera script -----------------------------------------------------------------------
_camera_shot = [position_1_name, position_2_name, target_name, duration, zoom_level1, zoom_level_2, attached, x_rel_coord, y_rel_coord, z_rel_coord,last_shot] execVM "camera_work.sqf";
Where
_camera_shot - string, is the name/number of the camera shot, you can have as many as you want see examples from down bellow
position_1_name - string, where camera is created, replace it with the name of the object you want camera to start from
position_2_name - string, the object where you want camera to move, if you don't want to move from initial position put the same name as for position_1_name
target_name - string, name of the object you want the camera to look at
duration - seconds, how long you want the camera to function on current shot
zoom_level_1 - takes values from 0.01 to 2, FOV (field of view) value for initial position
zoom_level_2 - takes values from 0.01 to 2, FOV value for second position, if you don't to change you can give the same value as you did for zoom_level_1
attached - boolean, if you want to attach camera to an moving object its value has to be true, otherwise must be false
in this case position_1_name must have the same value as position_2_name
x_rel_coord - meters, relative position to the attached object on x coordinate
y_rel_coord - meters, relative position to the attached object on y coordinate
z_rel_coord - meters, relative position to the attached object on z coordinate
last_shot - boolean, true if is the last shot in your movie, false otherwise
-----------------------------------------------------------------------------------------------------------*/
// - do not edit or delete the lines downbelow, this line must be before first camera shot
loopdone = false;
while {!loopdone} do {
//^^^^^^^^^^^^^^^^^^^^^^ DO NOT EDIT OR DELETE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// EXAMPLES------ insert your lines for camera shots starting from here
systemChat "Phase 2";
_txt_2 = ["Der goldene EBER präsentiert:",10,"center_bottom","1","#FFFFFF"] execVM "AL_intro\txt_display.sqf";
// -------------------------------------
systemChat "Phase 3";
_firstshot = [cam1, cam2, cam1_2_fokus, 5, 0.7, 1.8, false, 0, 0, 0,FALSE] execVM "AL_intro\camera_work.sqf";
systemChat "Phase 4";
intro_explo1 setDamage 100;
sleep 0.4;
intro_explo2 setDamage 100;
//Zerstörung Intro Fahrzeuge Szene1
_aa_shot1 setDamage 100;
systemChat "Phase 5";
waitUntil {scriptdone _firstshot};
systemChat "Phase 6";
Try without ANY extra codes but only the codes to spawn camera etc
Ok. I will need help. Never did anything with a camera before. Thats the only reason Ive used a pre code.
But first I will discusse with Ezcoo and study his writing
Post a video when you get the mission running with that code
So my script now starts with
if ((!curr_time) or (_jip_enable<0)) then {
cutText ["", "BLACK IN", 10];
systemChat "Phase 1";
playsound "intro";
Theres nothing to see. Just an error Ill send from .rpt
Add this to the start (don't delete the code before my edits) ```sqf
//Positionen Intro Fahrzeuge
_position_aa_shot1 = [3383.646, 1872.071, 0];
_aa_shot1 = "O_APC_Tracked_02_AA_F" createVehicle _position_aa_shot1;
_aa_shot1 setDir 106.364;
//Spawnen Intro Einheiten
call Intro_BrennenderHMMW_1_fnc_Intro_BrennenderHMMW_1;
call Intro_Gruppe_I_1_fnc_Intro_Gruppe_I_T1_4_1;
call Intro_Gruppe_I_2_fnc_Intro_Gruppe_I_T2_6_1;
call Intro_Gruppe_O_1_fnc_Intro_Gruppe_O_T1_4_1;
waitUntil {time > 0 };
_jip_enable = _this select 0;
[[_jip_enable],"AL_intro\time_srv.sqf"] remoteExec ["execVM"];
waitUntil {!isNil "curr_time"};
if (!hasInterface) exitWith {};```
You can try with that one, let's see what happens
Now Ill do a vid. Its still delayed. But works. Btw all phases at same time
Here it is:
https://youtu.be/ZoRWjAcJAUc @tender fossil
Here the Video without Viewer perspective
Unturend jetzt schon die 2. Folge mit:
JuliManu: https://www.youtube.com/channel/UCM7Ow4ZVLFZEFg0c5trMz8A
Flora: Hat leider keinen Kanal.
Das Spiel:http://store.steampowered.com/app/304930/?l=german
Unturend jetzt schon die 2. Folge mit:
JuliManu: https://www.youtube.com/channel/UCM7Ow4ZVLFZEFg0c5trMz8A
Flora: Hat leider keinen Kanal.
Das Spiel:http://store.steampowered.com/app/304930/?l=german
anomaly1 disableAI "MOVE";
anomaly1 disableAI "ANIM";
};```
where i'm currently at
And what is anomaly1
the variable name of the unit i want to freeze on sight
Is that a human unit?
It's an AI soldier
And how do you run this code
it's in the init block for the AI, which now that i'm writing that down seems incorrect
Because of it
init = initialization, it will fire on mission start
yeah, i realised that as i typed it. it's been a long day hmmm
@warm hedge @tender fossil:
I gues its time to beginn from 0
I knew why Ive done for all my work a template 😄
But I took learnings about our conversation. Im very thankfull to both of you ❤️
https://community.bistudio.com/wiki/Camera_Tutorial
As I understood its not that hard to create my own camera shots.
Hey guys I have a question about VS Code for any of you who might be using it to script. I installed an sqf extension that adds autocompletion for functions, commands, etc. but now it's not auto completing variables. Is this something i have to setup in VS Code options? Im still getting used to vscode.
example of autocompletion
Healing bullets 
lol
We have medicine bullets in Jenna's unit
TAKE YOUR PILL I SAID *pew pew*
That's vehicle handle damage
For units it should return how much damage they will take, not how much damage they have taken
huh?
I think at least
yeah no
it's "what the current selection should have as damage"
not added damage, current, total damage
if you set it to 0, if someone is hurt at e.g 0.5 and get hit he will heal back to 0
I couldn't find where it talked about the return on the handle damage section
I know what page it's on, I meant I didn't see where it said that the return should be the current damage for the selection.
I found it now while re-reading it though
OK! 🍻 just to be clear about who knows what
as I am in charge of documentation, I will try to make this section more visible
So I had the right idea, but not enough experience with implementing scripts
anyone know why my code isn't working?
{
if (vehicle _x in thisList) then {
_vehicle = vehicle _x;
if (_vehicle isKindOf "LandVehicle") then {
_vehicle setDamage 0;
_vehicle setFuel 1;
{_vehicle setVehicleAmmoCargo _x} forEach [1];
};
};
} forEach thisList;
Says "Missing ;"
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
{
if (vehicle _x in thisList) then {
_vehicle = vehicle _x;
if (_vehicle isKindOf "LandVehicle") then {
_vehicle setDamage 0;
_vehicle setFuel 1;
{_vehicle setVehicleAmmoCargo _x} forEach [1];
};
};
} forEach thisList;
Anyone see an issue?
I am not sure that sqf forEach [1];
Is a thing...
it's weird, but it works! 😄
setVehicleAmmoCargo is… not a thing - see the code highlight giving up
ahhh dang it, now i see, thanks 🤣
**Works perfectly now haha ! **
{
if (vehicle _x in thisList) then {
_vehicle = vehicle _x;
if (_vehicle isKindOf "LandVehicle") then {
_vehicle setDamage 0;
_vehicle setFuel 1;
_vehicle setVehicleAmmo 1;
};
};
} forEach thisList;
from my experience, that setVehicleAmmo is a meh command for actually fully rearm vehicles
+Def, iirc!
I am using ```sqf
player setPosASL (_targetPosASL vectorAdd [0,-0.5,0.5]);
for my custom enhanced movement script.
The problem is that depending on the angle I approach the building from sometimes leaves the player on the edge
I need a command that does the same but in relation from the player to the building so the added vector is always correct
_targetPosASL is located at the top of the building right on the edge
Good evening.
Is there a major bug I dont see:
if scriptdone then _shot1;
vectorModelToWorld and/or vectorFromTo may be useful
There's one definite problem and one potential problem.
Definite: scriptDone doesn't work like that. You need to give it a reference to a specific script to check if it's done. (https://community.bistudio.com/wiki/scriptDone)
Potential: depends on what's in _shot1. You have to give if a { code type } to execute if its condition returns true. If _shot1 contains a piece of code, then that's fine, otherwise not.
@hallow mortar I felt so dumb after checking that theres no if cause entered
Could you maybe make me an example with this:
//Kamera Erstellung
_kameraErstellung1 = call kameraErstellung1_fnc_kameraErstellung1;
//Kamera Start
_shot1 = call shot1_fnc_shot1;
//Bedingung
if {_kameraErstellung1} scriptdone then {_shot1;}; //Ive read the if page and scriptDone on wiki allready)
What do you actually want this to do?
Do you want it to wait for kameraErstellung1_fnc_kameraErstellung1 to finish, and then run shot1_fnc_shot1?
Yes
Kamera Erstellung (ger)=(eng) Camera creation
So I want to be sure that the camera is created before moved. I dont know if ive done the cam movement right too...
Then you don't need any of this. call runs the called code in-line, as if it was typed out in full in this script. The script will already wait for kameraErstellung1_fnc_kameraErstellung1 to finish before it does anything else.
hmmm
call kameraErstellung1_fnc_kameraErstellung1;
call shot1_fnc_shot1;```
this is all you need
I will shoot myself if this works (in rp)
What you wrote wouldn't work anyway.
call does not return a Script Handle you can use with scriptDone. It just returns the last value returned by the called code.
if just checks once at the current time; if the script hadn't already finished, it would just exit and not check again. You would need to use waitUntil.
IF you had used spawn rather than call (you don't need to, this is just an example), you would write it like this:
private _camCreateHandle = spawn kameraErstellung1_fnc_kameraErstellung1;
waitUntil {scriptDone _camCreateHandle};
call shot1_fnc_shot1;```
It works as before. So I had to do something wrong in this: (call shot1_fnc_shot1;)
_Intro_Kamera_1 camPrepareRelPos [3202.032, 2331.350, 185.862];
_Intro_Kamera_1 camCommitPrepared 5;
That appears to be technically valid according to the required syntax. But I don't know enough about those commands to know whether it would do what you actually want.
I dont even know what the exact command to move the camera is. Its so confusing that there are multiple commands for more or less the same action.
https://community.bistudio.com/wiki/Category:Command_Group:_Camera_Control
Is here anyone experienced with Camera Control who maybe could help me?
Simplified from one of my missions:
_camera = "camera" camCreate [2318.24, 1561.69, 7.20];
_camera cameraEffect ["Internal", "BACK"];
_camera camPrepareTarget [-85277.57, 49800.42, 19.27];
_camera camPreparePos [2318.24, 1561.69, 7.20];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0;
waitUntil {camCommitted _camera};
_camera camPrepareTarget [-95663.16, -18230.07, -39.22];
_camera camPreparePos [2339.20, 1657.94, 18.60];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 30;
/* Some more waitUntil / camPrepare* / camCommitPrepared blocks here ... */
waitUntil {camCommitted _camera};
_camera cameraEffect ["Terminate", "BACK"];
camDestroy _camera;
Does the camera start from creation point or from first camPos point?
They are the same 😛
Ouch
Not sure why I kept doing camPrepareFOV though, maybe once is enough 🤷♂️
That mission is a huge trip down memory lane, it's the first time I heavily scripted things 
Ive did this now: the camera dont moves
´´´sqf
_Intro_Kamera_1 = "camera" camCreate [4400.661, 1705.345, 83.043];
_Intro_Kamera_1 cameraEffect ["Internal", "Bottom"];
//Erster Shot
_Intro_Kamera_1 camPrepareTarget [3371.254, 1862.981, 0];
_Intro_Kamera_1 camPreparePos [4400.661, 1705.345, 83.043];
_Intro_Kamera_1 camPrepareFOV 0.700;
_Intro_Kamera_1 camCommitPrepared 0;
waitUntil {camCommitted _Intro_Kamera_1};
_Intro_Kamera_1 camPrepareTarget [3371.254, 1862.981, 0];
_Intro_Kamera_1 camPreparePos [3202.032, 2331.350, 185.862];
_Intro_Kamera_1 camPrepareFOV 0.700;
_Intro_Kamera_1 camCommitPrepared 30;
´´´
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
Is there anything ive to do as well? Ive used your code 1:1 with my vars
How did you execute that code?
´ is the wrong character for code formatting. You need to use `, exactly as it is in the bot example. You can copy it from the bot's message if you're having trouble finding it.
Ive did a function and entered to init.sqf
still thinking why don't we have event handlers for camera
Did you try with cameraEffect ["Internal", "BACK"]?
Ive turned this:
_camera = "camera" camCreate [2318.24, 1561.69, 7.20];
_camera cameraEffect ["Internal", "BACK"];
_camera camPrepareTarget [-85277.57, 49800.42, 19.27];
_camera camPreparePos [2318.24, 1561.69, 7.20];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0;
waitUntil {camCommitted _camera};
_camera camPrepareTarget [-95663.16, -18230.07, -39.22];
_camera camPreparePos [2339.20, 1657.94, 18.60];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 30;
/* Some more waitUntil / camPrepare* / camCommitPrepared blocks here ... */
waitUntil {camCommitted _camera};
_camera cameraEffect ["Terminate", "BACK"];
camDestroy _camera;
===========================================================
Into this:
_Intro_Kamera_1 = "camera" camCreate [4400.661, 1705.345, 83.043];
_Intro_Kamera_1 cameraEffect ["Internal", "FRONT"];
//Erster Shot
_Intro_Kamera_1 camPrepareTarget [3371.254, 1862.981, 0];
_Intro_Kamera_1 camPreparePos [4400.661, 1705.345, 83.043];
_Intro_Kamera_1 camPrepareFOV 0.700;
_Intro_Kamera_1 camCommitPrepared 0;
waitUntil {camCommitted _Intro_Kamera_1};
_Intro_Kamera_1 camPrepareTarget [3371.254, 1862.981, 0];
_Intro_Kamera_1 camPreparePos [3202.032, 2331.350, 185.862];
_Intro_Kamera_1 camPrepareFOV 0.700;
_Intro_Kamera_1 camCommitPrepared 30;
waitUntil {camCommitted _Intro_Kamera_1};
_Intro_Kamera_1 cameraEffect ["Terminate", "BACK"];
camDestroy _Intro_Kamera_1;
But the camera is still static and wont move to the second position
Yes, camera was inverted
pleaseeee release meeee (meanwhile us)
Im into this since 4 days now
is there a list for the "playMove" command for all aviable animations?
Animation viewer in editor, I think
oh i see, thx
If I use ur code the cam stay still too
Is there something ive to do infront? Like a preperation
try to teleport yourself to the second coords
like player setPos [3371.254, 1862.981, 0]
maybe the [x,y,z] coords are wrong?
So you basically have [] call MY_fnc_camera in init.sqf?
@broken pivot
try to change camPrepareTarget to camSetTarget and camPreparePos to camSetPos and camCommitPrepared to camCommit. I don't think it's different but doesn't hurt trying
It worked, thx. Do you know by any chance if that also works for pub zeus comps or just eden editor?
I don't know, maybe zeus enhanced has some module
ok, thx
Copy confirm commander 🫡
.
This is in init:
call Intro_fnc_Intro;
This is in description.ext
class CfgFunctions
{
class Intro
{
class Scripts
{
file = "Scripts\Intro";
class Intro {};
};
};
};
This is the result:
_Intro_Kamera_1 = "camera" camCreate [4400.661, 1705.345, 83.043];
_Intro_Kamera_1 cameraEffect ["Internal", "FRONT"];
//Erster Shot
_Intro_Kamera_1 camSetTarget [3371.254, 1862.981, 0];
_Intro_Kamera_1 camSetPos [4400.661, 1705.345, 83.043];
_Intro_Kamera_1 camSetFOV 0.700;
_Intro_Kamera_1 camCommit 0;
waitUntil {camCommitted _Intro_Kamera_1};
_Intro_Kamera_1 camSetTarget [3371.254, 1862.981, 0];
_Intro_Kamera_1 camSetPos [3202.032, 2331.350, 185.862];
_Intro_Kamera_1 camSetFOV 0.700;
_Intro_Kamera_1 camCommit 30;
waitUntil {camCommitted _Intro_Kamera_1};
_Intro_Kamera_1 cameraEffect ["Terminate", "BACK"];
camDestroy _Intro_Kamera_1;
try it out
Nothing changed
can you change the coords for objects?
Ive tried already
//Positionen
//Kamera Positionen (erstellung)
_Intro_Kamera_Position_1 = [4400.661, 1705.345, 83.043];
//Kamera Fokus Ziele
_Intro_Kamera_Fokus_1 = [3371.254, 1862.981, 0];
//Kamera Ziel Positionen
_Intro_Kamera_Ziel_1 = [3202.032, 2331.350, 185.862];
try those helpers objects, and hide those under attributes
ok, try to teleport yourself to those coords
So you mean I place an invisible helipad and give it a var?
Also tried
So spawn survivor, play as him and go to debug with goTo [4400.661, 1705.345, 83.043];?
Or whats the tp cmd?
enter scenario, open debug, player setPos [3202.032, 2331.350, 185.862]
Into it 😄
Worked. I moved my position to the point I want to end the camera drive/shot (idk whats correct english)
also, see if the first waitUntilis firing... put like this
waitUntil {
sleep 0.1;
systemChat "first waitUntil loop";
camCommitted _Intro_Kamera_1};
also
you can't call this function, because you are using schedule commands
you have to spawn
0 spawn Intro_fnc_Intro;
if this is the solution... imma jump the window
This isnt part of my script
Where you want to add it from me?
In the end? Cause camComitted
And this into init.sqf
the first waitUntil, replace it
yes, replace it²
This is code now:
//Erstellung Kameras
_Intro_Kamera_1 = "camera" camCreate [4400.661, 1705.345, 83.043];
_Intro_Kamera_1 cameraEffect ["Internal", "FRONT"];
//Erster Shot
_Intro_Kamera_1 camPrepareTarget [3371.254, 1862.981, 0];
_Intro_Kamera_1 camPreparePos [4400.661, 1705.345, 83.043];
_Intro_Kamera_1 camPrepareFOV 0.700;
_Intro_Kamera_1 camCommitPrepared 0;
waitUntil {
sleep 0.1;
systemChat "first waitUntil loop";
camCommitted _Intro_Kamera_1};
_Intro_Kamera_1 camPrepareTarget [3371.254, 1862.981, 0];
_Intro_Kamera_1 camPreparePos [3202.032, 2331.350, 185.862];
_Intro_Kamera_1 camPrepareFOV 0.700;
_Intro_Kamera_1 camCommitPrepared 30;
waitUntil {camCommitted _camera};
_camera cameraEffect ["Terminate", "BACK"];
camDestroy _camera;
Ill try now
9 hours!!!
It moves now but only with an error
@broken pivot please, use the sqf syntax highlight here
Teach me
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
just copy the example
thanks
So this is my error:
_camera is nil in the second waitUntil
you forgot to change that
Like this:
waitUntil {camCommitted _camera is nil};
_camera cameraEffect ["Terminate", "BACK"];
camDestroy _camera is nil;
sorry for these simple questions. Im now 10 hours in
My brains done
no dude, the variable _camera is nil, it doesn't exist
you need to change it to _Intro_Kamera_1
waitUntil {camCommitted _Intro_Kamera_1};
_Intro_Kamera_1 cameraEffect ["Terminate", "BACK"];
camDestroy _Intro_Kamera_1;
Ive did it sooo... for my learning...
Why is this required: sqf```
waitUntil {
sleep 0.1;
systemChat "first waitUntil loop";
camCommitted _Intro_Kamera_1};
So why it doesent worked without
read carefully...
you need to learn to check your own script errors, get the screenshot, see what it saying
OH MY GOD vine - VinesEG
Be sure to like the video and subscribe to me.
I hoped you guys liked this video, it took alot of time and effort to make it.THANKS.
---------------------------------------------------------------------------
My twitter : https://twitter.com/VinesEG
OH MY GOD vine - VinesEG
My Google + : https://plus.google.com/u/0.....
replace the last lines
waitUntil {camCommitted _Intro_Kamera_1};
_Intro_Kamera_1 cameraEffect ["Terminate", "BACK"];
camDestroy _Intro_Kamera_1;
init.sqf is scheduled, so that should be fine.
So far my best guess is that the game might not be ready to mess with the camera when init.sqf runs (and using spawn delays the execution of the camera script just enough for the game to get ready), but I can't test that anytime soon 🤷♂️
init is scheduled, but he's calling the function
that has schedule commands
call in scheduled context is scheduled
what?
call in scheduled context is scheduled
Yeah
wait
Call uses whatever environment it's used in
When in doubt, always https://community.bistudio.com/wiki/Scheduler
@broken pivot try to call your function again and see if it's moving
Everything 4 you
change the spawn for call
Im into my player character. No intro´s there
So spawn is required. So I also need to learn why. Lets go to wiki. WOOO
yeah, change the code and restart it
Ive did. init was:
call Intro_fnc_Intro;
is this?
Yes
I've always read that but never related it
Noted too
@broken pivot Can you start the preview, get to the point where you can freely move and look around and then execVM your camera script from the debug console?
Of corse. You want a vid from it?
If you want to record one 🤷♂️
Ah sweet 👍
I wouldve given you something. But unfortunately Im not rich (yet)
@willow hound @thin fox and @hallow mortar for the learnings. The help. The nerves. The time. just everything. Your just good people. Im not used to experience this kind of humanity. Maybe Ive grown up the wrogn way. But yeah. Thanks thanks thanks ❤️ ❤️ ❤️
In the end shout out to my m8 @wide egret who supported me mentaly in the TeamSpeak. ❤️
who da faq are you, and what did I do???
küsschen aufs nüsschen
❤️
boys, we just basically saved @broken pivot ´s life. He already had some suicidal thoughts, after fkin coding this sht with me for 10 hours straight. Appreciate the help!
Especially @thin fox, you really invested A LOT of time to help us with our coding problem(s). Thank you to @hallow mortar and @willow hound aswell! Thanks a lot. I can´t mention it often enough 🫡
🫡
Hello! me again, need an extra pair of eyes, can't seem to locate where the missing " **) **" is....
{
if (alive _x) then {
if (_x side == civilian) then {
_x setSide opfor;
};
};
} forEach thisList;
_x side is the wrong way around
Also most times you want to check the side of a unit's group
I.e. side group _x
SetSide also doesn't take a unit as an argument
You'll want:
[_x] joinSilent createGroup EAST;
As shown on https://community.bistudio.com/wiki/setSide
(Or make a single group and move all units to that)
so, if I call a script in this situation, and the code stops by using waitUntil or sleep or whatever, it will actually wait to finish to continue the thread?
private _group = createGroup EAST;
private _units = thisList select {
alive _x and side group _x == civilian;
};
_units joinGroup _group;
oh! makes more sense, thank you very much.
No problem 👍
Sorry for getting back to you late. Thanks for the invitation, do you have a link to the repo you mentioned?
I would love to be able to sit down at some point to learn how it works if that’s okay? I’m Australian and work full time so timings might be a bit shit
Yes, play around with something like this:
[] spawn {
systemChat "1";
private _value = 5 call {
sleep _this;
systemChat "2";
3
};
systemChat str _value;
};
```This is sometimes necessary, for instance with https://community.bistudio.com/wiki/BIS_fnc_guiMessage (see Example 2).
oh that's interesting and explains a lot, I will try it out
thank you
Itll be a minute before I can test this.
When a object is created mid mission, is the object's init code only ran locally on the client that created it, or is it ran on every client?
Is there a command to equip an already created backpack object?
For context, I am trying to automatically equip a backpack from a disassembled turret.
Could use the disassembled event handler
thats where the code is, in the disassembled event handler
But i need to move the backpack object onto the player.
I suspect thats not possible as i have scoured the backpack/inventory commands.
You can copy the internals of the backpack container, make a new container on the player, then add the internals to that container. But no direct way IIRC
Help, so down below from the wiki it says i can white list by type. What im trying to do limit a specific arsenal based on weapon, or back, or vest, ect. So that arsenal has only that specific item type without having to add for say all the vests manually. ```Syntax (shared by all mentioned functions):
[target, classes, isGlobal, doAddAction] call BIS_fnc_addVirtualWeaponCargo;
target: Object or Namespace - ammo box to which classes will be added. When missionNamespace is used, they will be available across all boxes.
classes: Boolean or Array of Strings - whitelisted classes. Alternatiovely, use true to whitelist everything of the given type
isGlobal: Boolean - (Optional, default false) true to add classes globally
doAddAction: Boolean - (Optional, default true) true to add "Arsenal" action which players can access the Arsenal
Returned value: Array of Arrays: All virtual items within the target's space in format [<items>, <weapons>, <magazines>, <backpacks>]
Example:
[myBox, ["arifle_MX_F", "arifle_MX_SW_F", "arifle_MXC_F"], true] call BIS_fnc_addVirtualWeaponCargo;
To add everything, use:
[myBox, true, true] call BIS_fnc_addVirtualWeaponCargo;
// or the equivalent:
[myBox, ["%ALL"], true] call BIS_fnc_addVirtualWeaponCargo; // note that %ALL is ALL CAPITAL LETTERS```
sooo whats your question? what have you done so far
Has anyone written/knows-of a function that completely transfers the cargo from one object to another?
Community Antistasi has a couple of those.
You need different code for transferring from corpse/unit vs transferring from container.
lootToCrate and lootFromContainer.
If you want loot-from-unit specifically then there's also a cute one in surrenderAction.
Good luck transferring nested containers
Yeah not even sure if we support that. Maybe for container->container.
@fair drum John Jordan helped me out. Im good to go.
Better inventory mod helps
Thanks for the recommendation. Im talking vehicle to vehicle total cargo transfer.
Ive gone off to night shift, but when i left, i had nested containers almost solved.
But for some reason, the forEach that would handle recursive calls into nested containers would still run when the array for the nested containers was empty. And i use the forEachIndex which results in a zero divisor error.
My keyboard was left in pieces 🙃
Yes, because {} forEach [[]] is valid. Just continue if the array is empty
{
if (_x isEqualTo []) then { continue };
// ...
} forEach (...);
I didnt have time to investigate that before i had to leave. You are probably right. I am for eaching (everyContainer _rootContainer)
how can you detect if object is a light source? there doesnt seem to be common base class for these objects
Standardized loadouts where medical and misc items are stored in the uniform + backpacks also have limited capacity in some cases.
copy that Sky
hello friends i have a small ?
if i have a chopper script that uses _heli as the name
or var name for the chopper
How would i get the it to be removed it if gets damaged and !canmove
it seems to not be there, after i Rerun the chopper script
witch creats a New Chopper called _heli
Arma 3 DED server Ofcorse
I believe you are mixing a couple of things
a vehicle cannot (or should not be able to) be named with an underscored name (local variable)
well its named in the script
like _heli = createVehicle (…)?
then yes, the variable itself dies at the end of the script's scope
yes
hmmm ok
so you think if i use just helo2 in the script it would work better
then i would be able to remove it
then it becomes a global variable (on the machine it was created)
the issue would be that if you run the script a second time, only the second chopper is referenced here
that's a script design matter
i see yes i think i will name the chopper helo2 then ill be able to remove it befor i run the script again
is that correct
i will see if i can name the chopper helo2 and see if it works
i do better with global variables
yes i want to have control of the deleting of the chopper
and the pilot ofcorse
you could do e.g ```sqf
private _heliToDelete = 42 call SCOT_fnc_helicopterFunction;
sleep 30;
deleteVehicleCrew _heliToDelete;
deleteVehicle _heliToDelete;
no public variables, everything good 😎
it is usually recommended not to "spam" the global var space, or at least use it at minimum possible (of course sometimes it is not possible to do otherwise)
but if e.g it is a "helicopter attack" script, it would be a shame to only be limited to one at a time 🙂
well yes thats what i want 1 at a time
(and it could collide with another script, sooo inb4 MyHeli_4211Finalv2 var :D)
well in the event you want to expand it, at least your're good
local variables are good for code neatness, sanity, performance and polar bears
awsome thx againe Lou as always you awsome as well
man i love you guys
i think it will all work as i want now
any love for this?
checking if it's a "#lightpoint" maybe?
isKindOf?
yeah, I was thinking that
ah nope
Create a light source and return its type using typeOf.
you mean like placing Land_LampShabby_F in editor?
Run in console:
_lightSource = "#lightpoint" createVehicleLocal [0, 0];
typeOf _lightSource
umm whats the point of this test? im trying to detect what object is lamp and what isnt
Understood. I thought you wanted to detect such light sources.
oh
AFAIR, lamps have special hit selection/point name.
hmm
Good evening 😄
Can somebody tell me how I can set a variable to a unit ive created?
So I can change direction after spawning like this:
GIVEN_VAR setDir 103.482;
This is my code right now:
_ausrichtung = 103.482;
_opfer_spawnpunkt = [4683.395, 4220.803, 4.987];
_opfer = createGroup independent;
_opfer createUnit ["I_Survivor_F", _opfer_spawnpunkt, [], 0.5, "NONE"];
_opfer = _OpferVar; //since here its just try and error
_opferVar setDir _ausrichtung;
_opferVar switchMove "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon";
_isLamp = (((getAllHitPointsDamage _object) select 1) findIf { _x == "something" }) >= 0;
you could try selectionNames for the lamp post
_ausrichtung = 103.482;
_opfer_spawnpunkt = [4683.395, 4220.803, 4.987];
_opfer = createGroup independent;
private _opferVar = _opfer createUnit ["I_Survivor_F", _opfer_spawnpunkt, [], 0.5, "NONE"];
_opferVar setDir _ausrichtung;
_opferVar switchMove "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon";
Ive tried it with setVariable like this:
_opfer setVariable ["OpferName", OpferVar, false"];
I just told you how
The createUnit function returns the unit
So just assign that return to the variable like I did above
Thanks m8. This is quite simple. Ive tried stuff like this without success maybe now.
I want to learn setVariable as well
thx, getAllHitPointsDamage returned [["#light_1_hitpoint"],["light_1_hitpoint"],[0]] so maybe I can work something out from that
Read this to get class names and hit selection names:
https://community.bistudio.com/wiki/switchLight
setVariable is unrelated to your current question. I misunderstood what you meant
Not really the usecase of setVariable, but you could set some variables if you wanted for example setting them as a medic etc
but for PortableHelipadLight_01_green_F return is empty array 😦
Copy ^^ Im silence now and try out so Im not spamming the others away
yea doesnt seem to work with PortableHelipadLight_01_green_F
I could ignore that light type though if all other lights have Lamps_base_F as base class but idk yet if they do
This game is insane trolling xD xD xD
What could the source of this issue be?
Code:
_ausrichtung = 103.482;
_opfer_spawnpunkt = [4683.395, 4220.803, 4.987];
_opfer = createGroup independent;
private _opferVar = _opfer createUnit ["I_Survivor_F", _opfer_spawnpunkt, [], 0.5, "NONE"];
_opfer = _OpferVar;
//_opferVar switchMove "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon";
_opferVar setDir _ausrichtung;
You don't explain what your issue is
Oh... the vid is not playing. Its just hillarious Give me a sec Ill show
It does play, there's just nothing obviously wrong
He turns after setDir was done back on spring position
Yeah, AI will respond like normal when you spawn them
So how to handle this? I want him to get executed. So I dont know if freezing the unit is an option
why do you have a comment in the code there? //
Take a look at https://community.bistudio.com/wiki/disableAI
I thougt it does the issue. I still want him to surrender
I will take a loot
Thanks guys it worked like this:
_ausrichtung = 103.482;
_opfer_spawnpunkt = [4683.395, 4220.803, 4.987];
_opfer = createGroup independent;
private _opferVar = _opfer createUnit ["I_Survivor_F", _opfer_spawnpunkt, [], 0.5, "NONE"];
_opfer = _OpferVar;
_OpferVar disableAI "ALL";
_opferVar switchMove "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon";
_opferVar setDir _ausrichtung;
A question about unintended namespace switching, I have a function that runs via remoteExec and creates a dialog using with statements like so: sqf with uiNamespace do { createDialog "RscDisplayEmpty"; private _display = findDisplay -1; ... QS_vehSpawnGUI_refreshStatus = { with missionNamespace do { _cooldown = [_category, _vehicle] call QS_fnc_vehSpawnCatalogCooldown; }; }; ... _ctrl ctrlAddEventHandler ["LBSelChanged", {with uiNamespace do { call QS_vehSpawnGUI_refreshStatus; ... }}]; _display spawn {with uiNamespace do { while {!isNull _this} do { call QS_vehSpawnGUI_refreshStatus; uiSleep 1; }; }}; };
The inner QS_vehSpawnGUI_refreshStatus function gets called by a control event handler + a spawned update loop, and that function calls QS_fnc_vehSpawnCatalogCooldown which expects to be running in the mission namespace.
From how I understood the wiki, there's a risk of namespace switching if the script is allowed to suspend, but not if the script was spawned in a parent script which has already entered the UI namespace. Is my implemention prone to this issue? Mainly asking this out of curiosity because I have yet to encounter any undefined variables myself, nor receive bug reports from others. Maybe it's only fine because QS_fnc_vehSpawnCatalogCooldown doesn't sleep itself, and I'm not typically exceeding the scheduler's 3ms total time frame?
(sidenote, there's a separate issue where my vehicle spawner omits some vehicle categories seemingly at random, but I don't suspect it's related to namespaces and don't really mind it)
(and apologies for the long message!)
Quick question. I am writing a script and trying to get item mass like this:
private _itemMass = getNumber (configFile >> "CfgWeapons" >> (_x select 0) >> "ItemInfo" >> "mass");
I noticed however that in some mod the item is defined in CfgVehicles as it is an "intel item" therfor there was no way for me to get its mass.
I was able to figure out that its mass is 0.1 so I was wondering if this value is some kind of default fall back for Arma 3 if an item does not have a defined mass or something?
If a mass isn't defined, then it will use the defined value of its parent
CfgVehicle stuff can't be stored in the inventory, though?
acex_intelitems_notepad from ACE
It can become an inventory item
they are seperate classes
i'd assume it'll use the mass of similarly named entry in CfgMagazines
They should be connected in the class, I cant remeber whether its apart of itemInfo or not, but its in there. You can check it to see the class name of the actual inventory item
it's ACE. With picking the thing up through the ACE function 🤔
Can't seem to find it but then again I am not well versed in how ACE works.
getNumber (configFile >> "CfgWeapons" >> "acex_intelitems_notepad" >> "ItemInfo" >> "mass");
This would return 0.
All though it is the classname of the item which can be used to add it.
Sorry if I interrupt your talk but Im guessing that theres something missing:
_opfer = createGroup independent;
private _opferVar = _opfer createUnit ["I_Survivor_F", _opfer_spawnpunkt, [], 0.5, "NONE"];
_OpferVar disableAI "ALL";
_opferVar switchMove "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon";
_opferVar setDir _ausrichtung_opfer;
sleep 1;
_schuetze = createGroup east;
private _schuetzeVar = _schuetze createUnit ["I_Survivor_F", _schuetze_spawnpunkt, [], 0.5, "NONE"];
_schuetzeVar disableAI "MOVE";
_schuetzeVar setUnitLoadout [[],[],["hgun_Rook40_F","","","",["16Rnd_9x21_Mag",16],[],""],["U_O_ParadeUniform_01_CSAT_decorated_F",[["ACE_EarPlugs",1],["16Rnd_9x21_Mag",3,17]]],[],[],"H_Beret_CSAT_01_F","",[],["","","","","",""]];
_schuetzeVar switchMove "AmovPercMstpSnonWnonDnon_AmovPercMstpSrasWpstDnon_end";
_schuetzeVar setDir _ausrichtung_opfer;
_schuetzeVar setBehaviour "CARELESS";
_schuetzeVar doTarget _opferVar;
sleep 5;
_schuetzeVar doFire _opferVar;
He is Targeting. But not firing...
configfile >> "CfgVehicles" >> "acex_intelitems_notepad" >> "ace_intelitems_magazine" = "acex_intelitems_notepad";
configfile >> "CfgMagazines" >> "acex_intelitems_notepad" >> "mass" = 0.1
Is this a scheduled environment?
Currently making a mission that involves an M3 scout car being paradropped by a script. So far I have managed to get the entire script to work apart from one part. The vehicles are clipping into the ground and are exploding when the parachute is deleted.
This is the code I'm using, which theoretically should work, but I can't figure out where I'm going wrong:
_spawnPos = [595, 3953, 500];
_vehicle = createVehicle [_vehicleType, _spawnPos, [], 0, "FLY"];
_parachute = createVehicle ["B_Parachute_02_F", _spawnPos, [], 0, "NONE"];
_vehicle attachTo [_parachute, [0, 0, 0]];
waitUntil {getPosATL _vehicle select 2 < 5};
_vehicle detachFrom _parachute;
deleteVehicle _parachute;```
uhm... I dont know...
Its in a function
Ok, I just noticed the first sleep, so it should be. How are you calling the function?
Well problem 1 is probably that detachFrom is not a command
Try this instead: https://community.bistudio.com/wiki/detach
In testphase via execVM and normal its in a call
Gotcha
Trying this now
Ok, its possible wherever you are calling it from is scheduled then, allowing the sleep to work. I suggest looking into unscheduled vs scheduled environments. Try removing the _schuetzeVar setBehaviour "CARELESS"; line, that could be causing it to ignore the doFire order
Same problem. It says there needs to be a ; between _vehicle and detach but there shouldn't be?
are you writing it like detach _vehicle?
^
This seems to work, thank you. So I guess it isn't a "default fall back value" or something.
For some reason I wasn't able to find the className in CfgMagazines on my end.
_vehicle detach _parachute;
Nope dont work
no, just what I wrote, you didnt look at the wiki
I never look at the wiki that place is far too hurt on the brain
... you wont get very far with scripting then
Even if I execute this in debug, he wont shoot
I got this far didn't I?
I mean.. yes, I assume you used chatgpt for what you sent above though no?
Hm the wiki for doFire states it wont work if the unit is set to careless... that should have been it. You tried it from scratch again right? Like deleted the units and ran it again?
Microsoft Co-Pilot, which has been surprisingly accurate for the majority of the scripting I've needed to use, but does like to imagine up some random command that doesn't work. And as I cannot make head or tail of the wiki because of how poorly formatted it is for people who don't live and breathe arma 3 scripting, that's the point I ask the more experienced peeps lmfao
Ok. The proper usecase of detach is detach _vehicle;. You dont need to put the vehicle its detaching from
Gotcha
Yeah Ive started with an empty .sqf
And than went to eden editor and run the script in debug with.
But ther is no "Careless" anymore
Now you see if I had gone to the wiki to try and find detachFrom I would've found nothing helpful and brainrot takes over 😅
Naturally because detachFrom doesn't exist
are you running it in the editor or during gameplay? It wont work in the editor
Like this:
Searching on the wiki will be painful, yes. I just google what I want, ex: "Arma 3, how to detach attachedTo object" which will give you the proper page. The attachTo page also had the detach command listed in its additional info section as well as the notes.
Intel items are magazines when picked up, not weapons
private _mass = getNumber (configFile >> "CfgMagazines" >> _intelItem >> "mass");
Yeah but at the same time, I tend to only use very simple scripts, so 9 times outta 10 co-pilot can make the whole script
Try putting a systemChat or a hint after the sleep5 and see if the code gets to that point
It is there:
_ausrichtung_opfer = 102.612;
_opfer_spawnpunkt = [4682.859, 4220.837, 4.987];
_schuetze_spawnpunkt = [4681.366, 4221.550, 4.987];
//=========================================================================================
_opfer = createGroup independent;
private _opferVar = _opfer createUnit ["I_Survivor_F", _opfer_spawnpunkt, [], 0.5, "NONE"];
_OpferVar disableAI "MOVE";
_opferVar switchMove "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon";
_opferVar setDir _ausrichtung_opfer;
sleep 1;
_schuetze = createGroup east;
private _schuetzeVar = _schuetze createUnit ["I_Survivor_F", _schuetze_spawnpunkt, [], 0.5, "NONE"];
_schuetzeVar disableAI "MOVE";
_schuetzeVar setUnitLoadout [[],[],["hgun_Rook40_F","","","",["16Rnd_9x21_Mag",16],[],""],["U_O_ParadeUniform_01_CSAT_decorated_F",[["ACE_EarPlugs",1],["16Rnd_9x21_Mag",3,17]]],[],[],"H_Beret_CSAT_01_F","",[],["","","","","",""]];
_schuetzeVar switchMove "AmovPercMstpSnonWnonDnon_AmovPercMstpSrasWpstDnon_end";
_schuetzeVar setDir _ausrichtung_opfer;
_schuetzeVar doTarget _opferVar;
sleep 5;
_schuetzeVar doFire _opferVar;
AI isn't replacing people juuust yet
What is where?
ouu shit your right. I mean it was there
So, with some tweaks, this is what I currently have:
_spawnPos = [626, 3951, 300];
_vehicle = createVehicle [_vehicleType, _spawnPos, [], 0, "FLY"];
_parachute = createVehicle ["B_Parachute_02_F", _spawnPos, [], 0, "NONE"];
_vehicle attachTo [_parachute, [0, 0, 0]];
waitUntil {getPosATL _vehicle select 2 < 5};
detach _vehicle;
deleteVehicle _parachute;```
This is still erroring out, any other issues?
Whats the error?
It wants another ; slapped in the middle somewhere
Specifically it wants it after the deleteVehicle
Or is that because parachutes delete themselves..?
Hm, I dont think they do, but you could try just removing that line
I mean the code otherwise appears to work the way I needed it to
If it is getting to that line then you could try removing the switchMove line, its possible its getting stuck in that animation
And the parachute dissapears?
As soon as the vehicle detaches it deletes itself
Great, then you're done
Let's hope so
Nothing changes
Its just unlogic for me
//=========================================================================================
_opfer = createGroup independent;
private _opferVar = _opfer createUnit ["I_Soldier_F", _opfer_spawnpunkt, [], 0.5, "NONE"];
_OpferVar disableAI "MOVE";
_opferVar switchMove "AmovPercMstpSnonWnonDnon_AmovPercMstpSsurWnonDnon";
_opferVar setDir _ausrichtung_opfer;
sleep 1;
_schuetze = createGroup east;
private _schuetzeVar = _schuetze createUnit ["I_Survivor_F", _schuetze_spawnpunkt, [], 0.5, "NONE"];
_schuetzeVar disableAI "MOVE";
_schuetzeVar setUnitLoadout [[],[],["hgun_Rook40_F","","","",["16Rnd_9x21_Mag",16],[],""],["U_O_ParadeUniform_01_CSAT_decorated_F",[["ACE_EarPlugs",1],["16Rnd_9x21_Mag",3,17]]],[],[],"H_Beret_CSAT_01_F","",[],["","","","","",""]];
//_schuetzeVar switchMove "AmovPercMstpSnonWnonDnon_AmovPercMstpSrasWpstDnon_end";
_schuetzeVar setDir _ausrichtung_opfer;
_schuetzeVar doTarget _opferVar;
sleep 5;
_schuetzeVar doFire _opferVar;
hint "fire!";
Does the hint appear?
Yes
Im slightly getting angry about this. Does it make sence or is it unlogic and buggy?
Are the east and independent factions hostile towards one another in your mission?
Same thoughts
try replacing your doFire line with _schuetzeVar fireAtTarget [_opferVar, currentWeapon _schuetzeVar];
And if that doesnt work, try _schuetzeVar forceWeaponFire [currentWeapon _schuetzeVar, "Single"];
Added pakinson
Im going to try this locally on my computer, in the middle of compiling something but once its done I will
Now he fired. But theyre spawning inside and he got a cramp attack
yoinks
ArmA crashed

Classic like Bethoven...
Why are the spawning inside each other if theyve diffrent spawn conditions
_opfer_spawnpunkt = [4682.859, 4220.837, 4.987];
_schuetze_spawnpunkt = [4681.366, 4221.550, 4.987];
the game may think there is something in the way, look at the optional paramaters for createvehicle
I havent used createVehicle shouldnt "CAN COLLIDE" fix it?
private _schuetzeVar = _schuetze createUnit ["I_Survivor_F", _schuetze_spawnpunkt, ["CAN_COLLIDE"], 0.5, "NONE"];
setPosATL right after to be precise
Like this:
private _schuetzeVar = _schuetze createUnit ["I_Survivor_F", _schuetze_spawnpunkt, ["CAN_COLLIDE"], 0.5, "NONE"];
_schuetzeVar setPosATL _schuetze_spawnpunkt;
yes
also it's not ["CAN_COLLIDE"], it's "CAN_COLLIDE"
wait, not even that
group createUnit [type, position, markers, placement, special]
so _schuetze createUnit ["I_Survivor_F", _schuetze_spawnpunkt, [], 0, "CAN_COLLIDE"];
0.5 = random 0.5 radius 😬
Huuuh? I thought its the skill...
Is there I give an Stance input? So he stops crouching?
SetStance isnt a command
setUnitPos
please read the documentation then 😄
https://community.bistudio.com/wiki/createUnit
Looked at wrong syntax...
ah yes! you mixed both
I gues I where never that happy that an AI is getting shot multiple times xD
Im trying your code locally Monster and for some reason both of your units are spawning in as independent for me, which is likely why they arent shooting eachother
Cause of classname
Youve set the group?
im trying to fix it
I will delete all. Begin from 0 with your knowlegde.
But first: Let me roll a cig
Turn the second "I_Survivor_F" to -> "O_Survivor_F"
Is it possible to let the gunner aim at the victims head?
that did it, weird though that being created in a group of a different side wouldnt overwrite it
Lets get to work
One of my mission makers just told me about you adding this, really appreciate it!
Try out the launch and throw features lol
The flash bang detection I'm still working on. Might need to throw a PR in for ACE to detect it globally.
Does anyone have an idea on how to detect walls for the purpose of placing something on said wall?
Attempting to wrap my head around a propaganda script to make my players go around and remove propaganda from areas
lineIntersectsSurfaces
At work on phone so I can't give you an example, but this can return the position where the "beam" hits a surface
Is there a way for the preprocessor to detect if a mod or file is loaded?
My goal: Process a config if a mod is loaded, process a different config if a mod is not loaded.
Specifically, UserActions and ACE_Actions.
there is skipWhenMissingDependencies to skip loading an addon if another isn't loaded
https://community.bistudio.com/wiki/CfgPatches
Only works one way. But.... I was rereadiong preprocessor... and it has a __has_include_
So nevermind. It literally has an ace example actually 😁
Can I have a code to put in the init of a helicopter to enable ACE3 fries?
Just read their documentation
https://ace3.acemod.org/wiki/framework/fastroping-framework
hey guys, this script here should make all Ai drop with one hit, but doesn't seem to be working, also, no error message show up
[] spawn {
while {true} do {
_x setVariable ["HAF_spawned", true];
_x addEventHandler ["HandleDamage", { [_this#2, 1] select (_this#6 == player) }];
forEach (allUnits select {isNil {_x getVariable "HAF_spawned"} && side _x == WEST && !isPlayer _x});
uiSleep 2;
};
};
Why using while to add EHs?
And that HandleDamage _this#6 is not an unit but projectile
the point is to make only the local player be able to do such damage to bots
What point do you mean
So wasn't an answer to my question I see
just a compilation of help people gave me here
But you're the one who trying to fix it no?
I am looking for a server
yup, or at least understand it enough to do so
Then answer these I think
i guess it's to create a loop, so every new spawned ai will take this effect
EntityCreated Mission EH can do this. Also this loop add EHs over and over again to units with EHs already
i see, the code was not something i made neither that i fully understand, but i see your point
i will try to search a bit
that line doesn't mean it's the projectile by local player only?
_this#6 == player means the projectile is the player. Of course it always is false
so if i would keep the code as similar to this current as possible, i need to change it to the proper units?
{ [_this#3, 1] select (_this#7 == player) }
like this?
Sorry I slightly stand correct, _this#6 is not a projectile. But indeed _this#7 is instigator. Also _this#2 is the damage
Go to find a game or unit
so the correct way would be { [_this#2, 1] select (_this#7 == player) }
Try it
How to get all dead players ?
Tried these solutions and it doesn't work
call BIS_fnc_listPlayers select {!alive _x}
allDeadMen select {isPlayer _x}
allPlayers select {!alive _x}?
doesn't return dead players
Strange.
Returns a list of all units controlled by connected clients. This includes:
Normal human players (including dead players)
Could they be respawning before you check potentially?
Running 2 different stable clients. One is alive. The second one is now in the spectator. At the same moment I am trying to execute the script code to search for dead players without success
That's expected. If a player respawns then they're not controlling the corpse anymore
What's your use-case?
Are you trying to get the bodies that players were just controlling (i.e. true for their corpse but false after they respawn), or anything that was once a player?
anything that was once a player i guess
As far as I am aware, the best solution would be to adding a public variable to all player objects, or using them if they already exist.
If the object is dead, and the player is no longer controlling it, it isn't considered a player, nor is there any other way to detemine if it was a player.
Yeah
You'll want a respawn event handler that sets a variable on the new unit
// run on server
addMissionEventHandler ["EntityRespawned", {
params ["_newEntity", "_oldEntity"];
if !(_newEntity isKindOf "CAManBase") exitWith {};
_newEntity setVariable ["TAG_isPlayer", true, true];
}];
And then you could just check isPlayer _unit or _unit getVariable ["TAG_isPlayer", false]
Possible solution but what if player played on unit and then exit from server ? Object is still exist and has player variable in it
Yeah, but the unit was a player, which is what you said you were looking for
Also if you're using ACE (or some other mod that does the same thing), the body will be deleted anyway
If you don't want disconnected players' bodies to count, then just use a HandleDisconnect event handler to set the variable to false
GC is disabled.
Anyway if player was killed and then exit from server his body will stay. In my case i need bodies that are still own by players (means that players are in spectator e.g.)
nice idea!
Note that HandleDisconnect does have some different behavior based on what is returned
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#HandleDisconnect
Probably not relevant to your use case, but something to know
Could set TAG_isPlayer to a playerID and check if its in server versus the HandleDisconnect
_players = createHashMapFromArray (allPlayers apply {[getPlayerUID _x, _x]};
allDeadMen select {isPlayer _x || (_x getVariable ["TAG_isPlayer", ""]) in _players}
Either will work, both have different drawbacks
allDeadMen select {isPlayer _x}
``` doesn't work at all. As you said above, if the object is dead - its never will be recognized as player by engine
I would like to be able to get an array of online dead players without using external variables
Thats why you have the || (_x getVariable ["TAG_isPlayer", ""]) in _players to determine if the game sees it as a player OR if you manually defined it in the setVariable AND they are still in the server
If you wanna do it through HandleDisconnect, it works just as well like Dart explained
All right. I realized that I didn't quite spell out exactly what I needed. I need to know not that the unit was under control of the player, but that the player who controlled the unit (dead body) is still on the server
That will work in both scripts that Dart linked as well as I did afaik
Again. Both of your scripts checks if corpse was a player but i need to check if there is player on the server that controlling this corpse
Thats.... Exactly what it means....
Oh. I am so sorry. You are completely right. It does what i need from it. Looks like its time to bed:)
Thanks you boys
no change
that was the whole code
running on a initplayerlocal
and being called by the init file using [] vm execute
[] spawn {
while {true} do {
_x setVariable ["HAF_spawned", true];
_x addEventHandler ["HandleDamage", { [_this#2, 1] select (_this#7 == player) }];
forEach (allUnits select {isNil {_x getVariable "HAF_spawned"} && side _x == WEST && !isPlayer _x});
uiSleep 2;
};
};
[] execVM "HelpMe\InitplayerLocal.sqf";
this last one is the only thing i have in my mission init file
And what is "mission init file"
init.sqf file that goes inside my arma 3 mission folder
What about this
Do you do any debug output like systemChat
no, cause i don't have practice with coding it, all i have is from people here that helped me
Then learn your first practice
whats the best way to execute code right after (same/next frame) you closed the console? (when the "game" simulation is halted in SP while the pause menu is open)
preferably to work in all situations (SP/2d/3d editor - they have different pause menu idds)
Cba_waitUntil?
I guess add Unload EH to the console?
[missionNamespace, "OnGameInterrupt", {
params ["_disp"];
_disp displayAddEventHandler ["Unload", {}];
}] call BIS_fnc_addScriptedEventHandler;
actually this tracks when the pause display is closed but in vanilla it also means console is closed (if it was open 😅 )
I wish we had scripted event handlers for BIS_fnc_initDisplay 🥺
I thought we did?
"OnDisplayRegistered" and "OnDisplayUnrgistered"?
Unless I'm misunderstanding
oh 
yeah. didn't see it in in game fnc viewer because the code was hidden behind an include 😅 (CBA did that)
well it doesn't help because vanilla debug console doesn't call it 
thanks! doesnt work for the intended purpose:
even one frame after it engine does some other prep work apparently
(allDisplays#((count allDisplays) - 2)) closeDisplay 0; diag_captureFrame 1;
not sure if its reliable tho - allDisplays in Eden:
[Display #0,Display #2,Display #46,Display #49,Display #12]
12 = RscDisplayMainMap
RscDisplay\w*Interrupt all have idd 49 - except RscDisplayInterruptRevert has 144
ok that one can be ignored - its a submenu to interrupt (savgame loading selection)
actually its:
one frame = trigger unloaded EH
two frames = do scene preloading
three frames = normal mission simulation
(findDisplay 49) closeDisplay 0; diag_captureFrame 3;
Can somebody tell me how to shorten this value?
Code:
// Erstellung der entsprechenden Gruppe-
_modulGruppe = createGroup sideLogic;
_spawnHMMW = [3371.994, 1939.459, 0];
//Autowrack spawnen
_HMMW_Wrack = "Land_Wreck_HMMWV_F" createVehicle _spawnHMMW;
// Definierung der entsprechenden Module
_FeuerHMMWBrand = _modulGruppe createUnit ["ModuleEffectsFire_F", _spawnHMMW, [], 0,"CAN_COLLIDE"];
_RauchHMMWBrand = _modulGruppe createUnit ["ModuleEffectsSmoke_F", _spawnHMMW, [], 0, "CAN_COLLIDE"];
//Zufallsgenerierte Ausrichtung
_ZufaelligeAusrichtung = random 360;
_HMMW_Wrack setDir _ZufaelligeAusrichtung;
// Konfiguration Feuer
_FeuerHMMWBrand setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];
_FeuerHMMWBrand setVariable ["effectSize", 5, true];
_FeuerHMMWBrand setVariable ["ParticleDensity",50];
_FeuerHMMWBrand setVariable ["ParticleLifting",1.5];
_FeuerHMMWBrand setVariable ["ParticleLifeTime",100];
_FeuerHMMWBrand setVariable ["Expansion",1];
// Konfiguration Rauch
_RauchHMMWBrand setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];
_RauchHMMWBrand setVariable ["effectSize", 5, true];
_RauchHMMWBrand setVariable ["ParticleDensity",50];
_RauchHMMWBrand setVariable ["ParticleLifting",1.5];
_RauchHMMWBrand setVariable ["ParticleLifeTime",100];
_RauchHMMWBrand setVariable ["Expansion",1];
//Explosionen hinzufügen
_counter = 0;
while {_counter < 3} do{
_HMMW_Explosion = "GrenadeHand" createVehicle _spawnHMMW, [], 0, "CAN_COLLIDE";
_HMMW_Explosion setDamage 100;
_counter = _counter +1;
sleep 3;
};
//Löschung
sleep 15;
{deleteVehicle _x} forEach units _modulGruppe;
{deleteVehicle _x} forEach units _FeuerHMMWBrand;
{deleteVehicle _x} forEach units _RauchHMMWBrand;
{deleteVehicle _x} forEach units _HMMW_Wrack;
there are a bunch of commands in BIKI
I know
How do they help me?
You want to shorten it, like make the code shorter and more compact.
or you want to make it run faster?
you profiling your code in debug console doesn't make sense, as that is a scheduled script
uhh isnt it that high because you have 18s worth of sleep?
its 18ms, not seconds.
It spams errors for not being allowed to suspend
It has to run faster. All scripts need to run faster
ah whoops misread
Why?
If you want it to run faster, why did you put a 15 second sleep into it?
I tried to delete via main script. But this caused into errors. So I wanted to delete them after the cam went away
Everything is delayed in intro scene. Sometimes it loades 6 Seconds
Do you have CBA mod?
Yes
reading about the commands and testing them usually works
This is all placed together. "fn_Intro.sqf" is main script that gets launched via "init.sqf"
I appreciate that you want to help but this doesent really help me with my problem
"Everything" ?
Even the spawning of the vehicle at start, or only the explosions?
The mission starts and usually your getting in intro after 5 seconds. But the spawning stuff, that I launch via call function, delays everything so that the intro scene starts after 12 Seconds. The main part of things happening is done then. I will show.
So... The code you sent isn't even the problem then
because the problem is that it is started too late. Not that the code itself is too slow.
Even Phase1 of the intro is too late?
Or only Phase2?
All you say #holyDedmen
Uhm... I cant show nomore cause theres now a new error. An Ace error and it ends the mission
"Extension not found" I havent changed anything. I really dont understand anything of the things happening
That is because you have BattlEye enabled, its blocking ACE currently
Ah I found your problem
fn_Intro.sqf line 9
call means run this function AND WAIT until its done.
But your function contains 15 seconds of sleeping, so it will take 15 seconds till its done.
if you replace it with spawn that would mean run this function and do not wait for it to finish. That is what you want.
Replace your call's with spawn's
I also thought about but I dont understand spawn at all because this strange 0 infront and the link to magic var _this
one sec discord being bad
Take all you need.
just replace call for spawn
Though this rewrite to use CBA, would also make it work with call
Instead of sleeping, it instead schedules code to be executed in the future.
the 0 infront.
spawn needs some argument, what the argument is doesn't matter.
[] spawn
or
0 spawn
or
_this spawn
doesn't really matter if you don't need any arguments
Allright so Im gonna use some random ass local vars I never ever gonna use haha. I think I got it 😄
I dont knewed that CBA enters new commands. Things to learn
They are not commands, they are functions.
Just like your own functions that you are calling there
Saved the link. This is gold.
Btw what is this ace error? It just spawned. The thing I dont understand is that I havent changed a single letter.
.
Im confused because it allways was
BattlEye sometimes blocks stuff randomly
So game restart fix it. Copy
No, disabling BattlEye will fix it, or waiting a few hours
This is so bad that it makes me smile.
Im into changing code now. I will give intel soon
I prefer AMD
I changed call now into spawn like this:
_aa spawn IntroGruppe1_I_fnc_Gruppe_I_T2_6_1;
_ab spawn IntroGruppe2_I_fnc_Gruppe_I_T2_6_2;
_ac spawn IntroGruppe3_I_fnc_Gruppe_I_T2_6_3;
_ad spawn IntroGruppe1_O_fnc_Gruppe_O_T2_6_5;
_ae spawn IntroGruppe2_O_fnc_Gruppe_O_T3_8_1;
The people spawning not in time.
Ive got a heart attack from .rpt ...
You cannot just use a undefined variable like _aa
I am looking for a way to execute a script on specific list of vehicles when they get spawned by zeus for example. I assume I would need to use an eventhandler?
Essentially to execute an addaction, but of specific vehicles (As an example: all SUVs as they get spawned)
(somebody needs help)
I cant help you. But I can bring traffic to your message. #PeaceLoveHarmony #MakeArmANotWar
Yeah CuratorObjectPlaced EH should do what you want
Or you could check out the https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#EntityCreated if you don't want it bound to Zeus
CBA XEH can do it, per class name
I guess I will do if then function. But how do I make the list? if (_entity = "list?") then....
You have some specific type or pre-defined list.
If (_entity in Yourpredefinedlist) ...
Or
private _type = typeOf _entity;
if (_type in YourPreDefinedTypesList)...
ye but how do I white the list correctly?
Yourpredefinedlist = ["stuff1","stuff2"];?
Yeah pretty much.
u think that should be in init or initplayerlocal
Depends where do you use it
InitLocal = only on clients
Init = clients && server
InitServer = only on server
init also has funky operation time depending on single player vs multi player
Well, that's rather unhelpful comment, if I may say so. Problem has nothing to do with SP vs MP. It's a scripting problem, for which, I assume, this channel is meant for.
You might want to try https://community.bistudio.com/wiki/BIS_fnc_UnitCapture - AI pilots are pretty flaky when it comes to getting them to do anything predictable.
That's not really what I'm after. AI chopper works fine for human players or even human group leader with AI group members. There's some kind of command link (which should be disabled or avoided) between AI group and AI chopper which is used to command the pilot when the group is partly inside and partly outside the vehicle.
Guys I need some help with scripting!
So I have this script:
this addAction ["Generator ON", {lamp1 switchLight "ON"; lamp2 switchLight "ON"; lamp3 switchLight "ON"; lamp4 switchLight "ON"; while {true} do
{
playSound3D ["generator", gen1, false, getPosASL gen1, 1, 1, 250, 0, false, 123];
sleep 19;
};
}];```
In short, a "Generator" has a addAction thing, which allows it to turn the lights on and off, as well as add or delete a corresponding diesel generator sound. I tried it with "say3D" at first but then I found out that it's impossible to turn "say3D" sounds off. My problem is, that with the "playSound3D" script the sound doesn't go on at all.
Any ideas/suggestions?
say3D sounds can be stopped by deleting the sound source created by the command.
playSound3D isn't working for you because:
- the command requires a file path, not a CfgSounds classname
- You're providing an extra element in its array of parameters. The sound ID is a return value, not something you can specify.
Stopping sounds requires special handling in multiplayer, for either case, because the sound ID, or the source proxy object forsay3D, will be different on each client.
I tried it with "say3D" at first but then I found out that it's impossible to turn "say3D" sounds off
Read carefully: https://community.bistudio.com/wiki/say3D
When I tried to delete it, my generator box just poofed out of the existence XD
You probably tried to delete the object you used the command on, instead of the source proxy returned by the command.
Have a look at example 3 on the say3D wiki page. It shows how to save the sound source and then delete it (approximately - you'll need to use a global variable rather than local, since you want to refer to it in another script)
So I'm coming into this as a professional software dev, is it worth putting the legwork into getting SQF down or should I just wait until reforger / arma 4 is more stable? I saw that the new engine does not use SQF on the wiki somewhere
It's true the new engine uses a new language and not SQF.
Whether you want to get into A3 or Reforger is really up to your preference. There's a lot of life and modding activity left in A3, but Reforger/Enfusion is more modern and will be the basis for the most cutting-edge stuff in the next few years.
Yeah that's fair, I do have 1.3k hours in Arma 3 fwiw as well
Are the languages / concepts patterns fairly similar?
So how can I stop a sound in multiplayer then? Should I just write stopSound and it should do?
You'll need special handling for multiplayer. say3D is a local effect command, meaning you'll have to execute it on every machine, not just the one that activated the action. remoteExec is useful for this.
But, it gets more complex than that, because you need to save and use the returned source object...locally on each machine, because they all have their own different local one. This means you'll need a function (https://community.bistudio.com/wiki/Arma_3:_Functions_Library) as a way of telling other machines to do multiple things locally.
// your_fnc_startSound
params ["_object", "_soundClass"];
private _source = _object say3D _sound;
_object setVariable ["filardan_var_generatorSound", _source];
// your_fnc_stopSound
params ["_object"];
private _source = _object getVariable ["filardan_var_generatorSound", objNull];
deleteVehicle _source;
// ====
[_object, "someClass"] remoteExec ["your_fnc_startSound", 0, true];
[_object] remoteExec ["your_fnc_stopSound", 0, true];```
Same principle applies to `playSound3D`, though you'd set `playSound3D` to local-only mode, and use `stopSound` rather than `deleteVehicle`.
Sometimes.
The new Enforce script is much deeper and closer to the game code. In a way, SQF commands are to the A3 game code, what SQF functions are to SQF commands; Enforce is much more like an actual programming language rather than a function library.
Damn, it's more complex than I thought, but I'll try this out since my arma 3 scripting knowledge is somewhere deep and I just try to do something special for my peeps
I'd say, why not both 😄
Guys hi
Is there a way to disable systemChat all together?
I tried enableSentences and no go.
This systemChat on image is generated by Firewill's mod.
HandleChat mission eventhandler should be able to
Hi guys,
I'm working on an autopilot system and have got it working well with fixed values but would prefer to calculate the values I need from the planes flight model config. The main thing I need to calculate is when the wings are banked say 70 degrees how much rudder force is needed to counteract the force of gravity and make the plane not lose altitude in the turn.
I assume I want to be looking at the envelope property of the plane as it says its the property that determines lift. Does anyone know if the values are checkpoint e.g you take the 0% value until you pass 12.5% of the max speed of the aircraft. Or if your at say 6% speed will it find the value between the 0% value and 12.5% value?
%of max speed 0, 12.5, 25, 37.5, 50,62.5, 75, 87.5,100, 112.5,125
envelope[] = { 0.1, 0.1, 0.9, 2.8, 3.5, 3.7, 3.8, 3.8, 3.6, 3.3, 2.7 };
Any help on how I can convert these valus from what they are into a value I can use in the addforce function for an aircraft to get the Z speed of the aircraft to be 0 in any type of turn would be greatly appreciated. As you can see below currently im using a fix value that works well ish but not perfect.
This is an extract of code for the rudder there is code for pitch and bank I havent posted its a lot.
(targetBank is based on how many degrees the nose direction is from the targetPos)
pitchUpBankAngleStart = 70;
pitchForce = (targetVelocityAngle - velocityAngle) * 5;
rudderForce = 0;
if (velocity MyVeh select 2 < 0) then {
if (targetBank > pitchUpBankAngleStart) then {
rudderForce = (velocity MyVeh select 2) * 10;
};
if (targetBank < -pitchUpBankAngleStart) then {
rudderForce = - ((velocity MyVeh select 2) * 10);
};
MyVeh addForce [MyVeh vectorModelToWorld [rudderForce,0,pitchForce],[0,500,0]];
Is it supposed to be here? Can't find it..
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers
Thanks guys, I'll look into it. Much appriciated
I am attempting to damage trees in an area and right now im just setting damage to nearest trees so they fall.
The issue is it looks kind of ridiculous because they all fall in the same direction.
Is it possible to have them fall in a random direction?
Try using https://community.bistudio.com/wiki/setDir.
setDamage's instigator parameter eventually
I think it may not work with terrain objects, but… who knows
Doesnt seem to work with map objects
Code?
yes
Still wondering that someone writes "doesn't work" but doesn't provide the code.
Uhhh hasnt even been 15 minutes Im literally in the game trying different codes sorry I dont have discord notifications wired to a loudspeaker
{
_x setDamage 0.5;
_x setDir 20;
} forEach _terrain;
What about this: #arma3_scripting message ?
Im about to give that a shot, I just was trying this setdir and messing around I noticed that when you set damage to a tree, and then set the damage back to 0 and then do it again, it falls in slow motion lol
I wrote the following script to spawn a mortar, fire at a target and despawn the mortar (for choreographing indirect fires in 3den and not having to stress out in Zeus). It works exactly as expected on local MP, but works slightly janky on a dedicated server:
- The units don't always fire the expected number of rounds; a podnos on local fires 2 rounds in 10 seconds, but on dedi, they fire 0-2, seemingly at random.
- The units can't seem to fire anything besides HE on a dedicated server, but they can in local MP.
Am I missing something obvious? There weren't any headless client slots on the test mission, so the HC shouldn't be fucking it up.
["_shootFrom", objNull], //object to spawn shooting unit near
["_target", objNull], //object to shoot at
["_time", 10], //total time to keep firing
["_ammoIx", 0], //ammo index to use, 0 is HE for most units
["_dispersion", 0], //max dispersion around target in meters
["_unit", "rhsgref_ins_2b14"], //unit to spawn. Spawns an indfor podnos by default.
["_side", WEST] //side of unit crew.
];
if (!isServer) exitWith {};
_dir = [_shootFrom, _target] call BIS_fnc_dirTo;
_spawnPos = getPosATL _shootFrom;
_group1 = createGroup _side;
_unit1 = createVehicle [_unit, (position _shootFrom), [], 1, "NONE"];
_group1 createVehicleCrew _unit1;
_unit1 disableAI "PATH";
_unit1 setDir _dir;
_ammo = getArtilleryAmmo [_unit1] select _ammoIx; //for the default unit, Podnos, 0 is HE, 1 is flare, 2 is smoke
_currentTime = 0;
while {_currentTime = _currentTime + 5; _currentTime <= _time} do {
sleep 5;
// random radius from https://community.bistudio.com/wiki/Example_Code:_Random_Area_Distribution
private _angle = random 360; // angle definition (0..360)
private _distance = random _dispersion; // distance from the center definition (0..radius)
private _position = _center getPos [_distance, _angle];
_unit1 doArtilleryFire[_position, _ammo, 1];
};
waitUntil {sleep 10; _currentTime >= _time};
sleep 5;
{deleteVehicle _x} forEach (units _group1);
deleteGroup _group1;
deleteVehicle _unit1;```
Trying to set different spawn points.
Getting an error code around this line of code.
respawn = "test_spawn_1","test_spawn_2","test_spawn_3","test_spawn_4","test_spawn_5","test_spawn_6";
Placed It In the description file.
Never really played around with creating mortar fire this way myself so can't really say what is causing it. But if you just want some mortar strikes and don't really care about the mortar crews you could use https://community.bistudio.com/wiki/BIS_fnc_fireSupportVirtual instead.
I just seen this In writing and testing. Can not get the AI to pick other spawn points @pallid palm
I entered respawn_east
Not sure If the warlords module may change this. I have yet to see the AI use the spawn truck.
Shame... I was hoping there was something built In telling the AI to select the closes spawn point.
copy that i only know how the game works
altho i have made some awsome scripts with the help of others
Cheers. Is there a list of allowed ammo types somewhere?
i wish i knew
theres much better guys on here so ill just zip it for now
umm i think you can look in cfg configs to see ammo typs allowed
🤔 Good question never tested anything other than artillery ammo but guess you can just try it
i try and try and fail and fail then i ask some one on here lol
like my fav guy on here is Dart hes a pro sqf scripter
if your on here enough you will find out all the really great guys to help you
i wish i knew enough to help everyone buy im just a dumb mission maker he he
my friend uses ChatGPT but i hate that crap
no Ai is going to help me as good as Dart can
w8 a minuet mayb Dart is an Ai lol no lol
hes better then Ai
sorry but i cant say enough about Dart hes a Super pro
as a matter of fact i think i love him he he
enough said back to the editer see u mates
So this is being dropped over a location to create fire as part of a larger script.
The object in this case would be _csfirespread right?
...
private _csfirespread = "#particlesource" createVehicle position _cssmokespread;
_csfirespread setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal.p3d",16,10,32,1],"","Billboard",1,0.8,[0,0,0],[0,0,0.7],0,0.045,0.04,0.05,[0.65,0.05],[[1,1,1,-1]],[0.5,1],0,0,"","","",0,false,0,[[0,0,0,0]],[0,1,0]];
_csfirespread setParticleRandom [0.15,[5,5,0.1],[0.05,0.05,0.15],10,0.03,[0.1,0.1,0.1,0],0,0,0.1,0];
_csfirespread setParticleCircle [1,[0,0,0]];
_csfirespread setParticleFire [1.25,1,0.1];
_csfirespread setDropInterval 0.025;
_fireEmitters pushBack _csfirespread;
...```
this is the current method I am using, and I am adding all the dropped emitters to an array, and then getting their positions after the fact and then running this code below to drop the trees after 100 seconds.
```sqf
...
{
private _terrain = nearestTerrainObjects [_x, ["Tree", "Bush"], 15];
{_x setDamage 1;} forEach _terrain;
} forEach _positions;
...```
This works, but my issue is that I do not want the players location. And when I get the position of the emitter it tells me its an undefined variable because its spawned in a different block.
```sqf
...
private _terrain = nearestTerrainObjects [player, ["Tree", "Bush"], 15];
{
_x setDamage [1, true, player];
} forEach _terrain;
...```
I was attempting to place the code into the block where it spawns the fire in the area, but I cant figure out how to properly classify the object for the instigator.
Has anyone ever looked into a CUDA extension?
I think if I spawn a dummy object in place of the particle emitter it may work
For what?
Im a little bit confused and maybe someone can shine a light into this dark tunnel
When a player respawns using a respawn point, when does the creation/movement of the unit happens?
Is the player object temporarily null just like when the mission begins or is there something additional happening behind the scenes?
Asking due to an issue im having ONLY on startup with events that are supposed to execute upon respawn, im using OnPlayerRespawn eventscript for those
the order of the initial respawn when using a respawn point (respawn menu position) is:
null -> alive -> alive & visibleMap ---- playerRespawnTime becomes -1 when they hit respawn ---> (object in debug land) wonkey simulation disabled -> everything enabled
thanks Hypoxic, thats exactly what I needed to know
if you want to see more of a scheduled timing instead of using framehandlers, look at the first mission of the APEX campaign. their init goes through these steps to sync clients
side bit: forcing a respawn time of -1 will force the engine to spawn the player (but it will be a very wonky disabled player in debug land), you can use this to create your own respawn menus and scenes (using your own timers). Just be sure to change the camera to look at something else while they twiddle with the menu. then force the player to a new position on your "spawn"
yeah, its actually what im doing but kinda hijacking the respawn module stuff, however it seems to fail 3/10 times or something like that and make the unit spawn in no mans land for whatever reason instead of the position we are.moving it to. The inconveniences of having custom gathering points in the middle of ducking nowhere i guess haha
Got it sorted, had to rewrite basically the entire script but here is the fixed code relative to my original question
{
private _dummy = "Land_Axe_F" createVehicle _x;
hideObject _dummy;
_dummies pushBack _dummy;
private _terrain = nearestTerrainObjects [_x, ["Tree", "Bush"], 15];
{
_x setDamage [1, true, _dummy, _dummy];
} forEach _terrain;
} forEach _dummylocations;```
Works exactly as I intended 🙏
So this post is way out of date (it's from 2017) but it seems to still work partially. I can't get the hint to show up though. (I'm using the second set of code, the one put into an area trigger instead of a .sqf file)
I can paste in my version of the script if needed, but it's pretty long so I didn't want to obliterate the discord chat with it. I just have two questions:
-~~ How do I fix the hint not showing up?~~
- I'm using the ACE medical system and this script applies damage using the vanilla damage system, is there a way to make it ACE-compatible? Like have it harm random parts of the body?
Radiation_Zone.sqf Spoiler //Spawns over Kavala in Altis. To move it just change the grid numbers to wear you want [3753.826, 12999.547,0]. _Rad_Zone_1 = createTrigger [EmptyDetector, [3753.826, 12999.547,0]]; _Rad_Zone_1 setTriggerArea [1100, 1100, 0, false]; // this is the area the radiation wi...
Okay after testing I have a third question. If a player dies in the area and respawns, it seems the visual effects stay on their screen. Is there a way to just reset a player's screen colors to default when they enter an area?
I think there’s some potential there
Addendum: The post I copied from had the wrong quotation marks, I got the hint to show up after fixing them
_dummy = "Land_Axe_F" createVehicle [0, 0];
hideObjectGlobal _dummy;
{
_terrainObjects = nearestTerrainObjects [_x, ["Tree", "Bush"], 15];
{
_dummy setPosATL (_x getPos [1, random 360]);
_x setDamage [1, true, _dummy];
} forEach _terrainObjects;
} forEach _dummylocations;
deleteVehicle _dummy;
Thanks
does anyone know how to change the CHVD max view and max object settings? can only do 3500m on my wasteland server and its just simply not enough for people using helicopters or jets
Anyone got any ideas on this? Probably a question for a BI dev that might know how the game engine deal with it. And how the values can be converted.
is 3500m the max view settings ?
yeah max in the CHVD is 3500 for view and object
ive seen servers have the same menu at 12k
CH View Distance v1.13 Download from Dropbox Subscribe on Steam Workshop Download on Armaholic Download on withSIX Description: This little addon allows you to flexibly adjust your view distance and terrain quality based on actual ingame situation. Its neatly packed with features: - adjust view d...
i did find something in the init.sqf for that CHVD and changed it to 12k max but it then set it to 12k or nothing which is not ideal for people with lower end pc's
awesome i will give that a go, that looks like a newer version of the menu im using
btw Schatten is a super pro also at sqf
haha thats great. im probably walking on thin ice most the time between success and destroying my server lol
i resemble that 🙂
only one way to learn haha
yup thats it my friend
I have a vanilla menu for changing view distance/object view distance here:
it works like this (20s)
anybody knows how can i make a player (not AI) always in combat stance ? means when he walk he keep his weapon up ?
if ( weaponlowered player) then { player setdammage 1}
/s
this is more of a question for ACE discord in general, since the actual system is intended for vanilla use.
if the postprocessing effect handle exist, you can terminate them with the appropriate commands for pp stuff
you can detect when the weapon is lowered, https://community.bistudio.com/wiki/weaponLowered
but if is sprinting, you need to check the animation...
the problem is that im not sure how to make the player put the weapon up again... maybe with action?
i guess you can use animchange eventhandler to check that the animation the player is having is with weapon up... but you will need to find a way to force it
https://community.bistudio.com/wiki/Arma_3:_Actions at least here I don't see how
For some reason it always detect false
I tried that and tried to check action and it always gave me the same value for some reason
and then i ended up here 
My goal was to change the stances only. In each time player would respawn...
why you want to do this? maybe is other way