#arma3_scripting

1 messages · Page 167 of 1

blissful current
#

Ahhh scope. It definitely still confuses me. I'll take it away and see what happens!

#

Well maybe not this time. I still get the errors. Maybe it's the function isn't compatible with the variable?

warm hedge
#

How can I debug your code without reading your code?

blissful current
#

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;
warm hedge
#

And what error

blissful current
#

_x is undefined variable

thin fox
warm hedge
blissful current
warm hedge
#

_x doesn't seem to be a related issue

#

You sure _sound is an object here? Debug log it like systemChat

thin fox
#

and try to find the first error that you got

thin fox
#

and also, _selectedUnit is undefined here

blissful current
#

SelectedUnit = selectRandom _unitsInArea; Is that correctly written?

thin fox
tulip ridge
#

It's still only defined to that scope

Just add a private ["_selectedUnit"]; before the if

thin fox
#

you need to create it in the parent scope

tulip ridge
#
private ["_someVar"]; // initalizes variable with no value

if (...) then {
    _someVar = 1;
};

_someVar; // 1
unborn rivet
#

Question to the great minds of Arma community. Can we play ambient music in the Arma 3 lobby (The role selection screen) ???

tulip ridge
#

Could do playSound in an onPlayerJoin

#

Or whatever the event script is

blissful current
tulip ridge
#

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

thin fox
blissful current
tulip ridge
tulip ridge
# blissful current Does lower scope mean {} inside other {}?

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

tulip ridge
blissful current
#

I had no idea a could resize the window with ADT...🤦

tulip ridge
#

Yep, you can drag the sides

blissful current
#

So cool it underlines the variables. Great tip. tyvm

tulip ridge
#

Definitely helps when first learning

pallid palm
#

hello Dart

#

@tulip ridge i'm still having lots and lots of fun with my chopper Script that you helped me with

tulip ridge
#

Nice

pallid palm
#

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

rancid lance
#

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
warm hedge
#
  1. What it does mean by _x in brackets
  2. forEach to iterate with multiple elements
little raptor
#

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)

rancid lance
#

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

rancid lance
#

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 SilvervaleWolfShy

obsidian hornet
#

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.

tulip ridge
rancid lance
#

isnt it a bool in the params for BIS_fncholdActionAdd?

tulip ridge
#

Only removes it locally it looks like

rancid lance
#

oh yea you right

tulip ridge
#

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];
obsidian hornet
#

Thanks! wil check this out

maiden raven
#

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.

proven charm
#

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)

flint topaz
#

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

rancid lance
junior moat
#

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?

junior moat
#

didnt even realise that was a function lol. thank you!

ancient kayak
junior moat
# proven charm setflagtexture

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)

proven charm
#

ive never played with the ahimation phase thing, doesnt it normally animate with the wind?

junior moat
#

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

proven charm
#

ah ok

#

maybe theres something weird with the pole because I tested setFlagAnimationPhase with editor placed flag and it worked

junior moat
#

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

proven charm
#

ugh this one: Flag_AltisColonial_F

junior moat
#

right- welp, guess i better get to some testing and debugging lol

hallow mortar
#

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.

junior moat
#

oh just read your second message, il try using animateSource

hallow mortar
#

The source name is "Flag_source"

junior moat
viral basin
#

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?

granite sky
#

They change with each version and BI aren't telling for security reasons. You can figure most of them out by experimentation.

viral basin
#

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 😄

tulip ridge
#

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

hallow mortar
#

Yes, that's correct

tulip ridge
#

That's what I assumed, thanks

winter rose
#

wait, what did I do? I'm innocent 😄

tough abyss
#

play COOP

old owl
pallid palm
#

is there a setting in game settings to turn off friendly fire

tulip ridge
#

No

pallid palm
#

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)

dusty steppe
# pallid palm so how would i go about turning off friendly fire

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

pallid palm
#

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

stable dune
#

You want to just disable FF from players?

pallid palm
#

yeah

#

yes from players only

#

so mayb a EH would do the trick

#

hmmm my brain is thinking

#

lol

stable dune
#

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.

pallid palm
#

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

tulip ridge
#
if (!local this) exitWith {};

this addEventHandler ["HandleDamage", {
    params ["_unit", "", "_damage", "", "", "", "_instigator"];

    if ((side group _unit) isEqualTo (side group _instigator)) then {
        _damage;
    } else {
        nil;
    };
}];
tulip ridge
tulip ridge
pallid palm
#

cool thx m8

#

your awsome Dart

#

wow thats awsome

tulip ridge
#

Glad it works for you

pallid palm
#

dam your good

#

i wish i was as good as you

#

mayb some day when im 88 lol

leaden needle
#

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!

pallid palm
#

lol

tall barn
#

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

leaden needle
#

yay ok

teal drum
#

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.

pallid palm
#

increasing uniforms' max load ?

#

why we have back packs for that

mortal pelican
#

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?

pallid palm
mortal pelican
pallid palm
#

so you just want to show a hint or do you want the trigger to command the pilot to do something

mortal pelican
#

I want it to show a hint only to the (player) pilot of the helicopter

pallid palm
#

ahhh nice

mortal pelican
#

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"

pallid palm
#

yeah look in that link i send its all in there

mortal pelican
#

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

warm hedge
#

So, if a heli pilot enters a trigger area, the pilot will receive a hint?

mortal pelican
#

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

pallid palm
#

is this for DED server

mortal pelican
#

so i need to be able to give that to just the pilot

warm hedge
#

vehicle player == theHeli and thiswhere theHeli is your helicopter

#

Not tested

charred monolith
#

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 ?

faint burrow
pallid palm
#

ah there we go awsome Schatten

warm hedge
#

Alt+F4 should exit the app "normally" so yes. But you can try it by launching two Arma

charred monolith
warm hedge
#

Even if the app has crashed, disconnect itself will happen too

faint burrow
pallid palm
#

that would go in the Activation em i correct ?

faint burrow
#

Yes, in "On activation" field.

pallid palm
#

ahh ok i got 1 more thing correct thats makes 2 things i got right lol

mortal pelican
#

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!

mortal pelican
#

im back so soon! how would I set it up so when a hold action is completed, it activates a waypoint?

faint burrow
mortal pelican
#

and i assume I could also have it activate a module then?

faint burrow
#

Don't know.

mortal pelican
#

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

faint burrow
#

Because variables are unavailable.

mortal pelican
#

And how does one fix such an issue?

faint burrow
mortal pelican
#

so that'd just be deleteVehicle _synchronizedObjects instead?

faint burrow
#

If you introduce _synchronizedObjects variable, then yes.

mortal pelican
#

please explain like i'm five, i have no clue what im doing lmao

faint burrow
#

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.

mortal pelican
#

that should be covered by giving the two triggers a variable name though, right?

broken pivot
#

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?

mortal pelican
broken pivot
#

Thats why Im asking

mortal pelican
#

they're just text defining things, it shouldn't slow the script down any, though feel free to correct me if i'm wrong

broken pivot
#

I dont know haha.

warm hedge
broken pivot
#

Im doing a script and everthing is delayed hahaha

faint burrow
mortal pelican
warm hedge
mortal pelican
#

the problem is that something that should work, doesnt

faint burrow
#

I wrote the reason and provided the solution.

broken pivot
#

My capture programm wont film

#

1 sec delay like my script

warm hedge
#

I'm not asking for a video either. I'm asking for your code, to be exact

broken pivot
#

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

warm hedge
#

And what are Intro_BrennenderHMMW_1_fnc_Intro_BrennenderHMMW_1 etc

broken pivot
warm hedge
#

How do you run this, and how do you get 8 seconds

mortal pelican
# faint burrow I wrote the reason and provided the solution.

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

broken pivot
#

I run this threw call Intro_BrennenderHMMW_1_fnc_Intro_BrennenderHMMW_1;

#

Is spawn better?

warm hedge
#

How you can be sure you took 8 seconds to run the entire

broken pivot
#

I started mission

#

Theres something told better show then tell

#

You now know why

faint burrow
broken pivot
#

In second 9 the intro started. Not in second zero:

waitUntil {time > 0 };

warm hedge
#

Are you trying to say your intro is not running for 9 seconds?

mortal pelican
warm hedge
#

deathTrigger and _deathTrigger are not the same

faint burrow
mortal pelican
warm hedge
broken pivot
#

Ive used a pre script and build on top

warm hedge
#

What is curr_time

broken pivot
#

This is a line i havent entered. Ill check on wiki 🫡

warm hedge
#

BIKI does not explain it

broken pivot
#

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?

warm hedge
#

Maybe. I'm not sure how you are sure they are not spawned

broken pivot
warm hedge
#

I am not sure what to see

#

Do you mean these OPFOR and Independent units

broken pivot
#

Yes

warm hedge
broken pivot
#

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

warm hedge
#

And what is calling intro.sqf

broken pivot
#

uhmm (embarrassing)

warm hedge
#

I'm not asking you to be embrassed, I'm asking what is calling intro.sqf

broken pivot
#

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...

warm hedge
#

many new things for me
This is a part of the issue. Don't introduce multiple new things once

#

I'd suggest:

  1. What it does do without sleep 2;
  2. What it does do without waitUntil {!isNil "curr_time"};
broken pivot
#

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?

broken pivot
warm hedge
#

I'm not even sure what time_srv.sqf supposed to do. I cannot tell what the author tries to achieve there

broken pivot
#

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];

warm hedge
#

I seriously don't know. I cannot emulate how it is working

#

I only put my wild suggestion/assumption

broken pivot
#

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?

tender fossil
# broken pivot Copy commander 🫡 Im into

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";
broken pivot
#

Just //cutText is diffrence or?

tender fossil
#

Correct. Only that line

broken pivot
#

Not really...

#

And units didnt spawned in before 10 sec

broken pivot
tender fossil
#

Oh geez, I was looking at the wrong file lol (the example one and not the one you have edited)

broken pivot
#

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?

inland flame
#

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

tender fossil
# broken pivot Dont understand.. (language barrier) "(the example one and not the one you have...

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";

warm hedge
broken pivot
#

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

tender fossil
broken pivot
#

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

tender fossil
# broken pivot So my script now starts with if ((!curr_time) or (_jip_enable<0)) then { cutTe...

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 {};```

broken pivot
tender fossil
#

You can try with that one, let's see what happens

broken pivot
#

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

https://youtu.be/7_c8I093zas

inland flame
#

where i'm currently at

warm hedge
#

And what is anomaly1

inland flame
#

the variable name of the unit i want to freeze on sight

warm hedge
#

Is that a human unit?

inland flame
#

It's an AI soldier

warm hedge
#

And how do you run this code

inland flame
#

it's in the init block for the AI, which now that i'm writing that down seems incorrect

warm hedge
#

Because of it

thin fox
#

init = initialization, it will fire on mission start

inland flame
#

yeah, i realised that as i typed it. it's been a long day hmmm

broken pivot
#

@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.

quaint ivy
#

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.

pallid palm
#

lol

sullen sigil
#

We have medicine bullets in Jenna's unit

winter rose
#

TAKE YOUR PILL I SAID *pew pew*

tulip ridge
tulip ridge
#

I think at least

winter rose
#

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

tulip ridge
#

I couldn't find where it talked about the return on the handle damage section

tulip ridge
#

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

winter rose
#

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

dusty steppe
fast igloo
#

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 ;"

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
fast igloo
#

{
    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?

wind hedge
#

Is a thing...

winter rose
#

it's weird, but it works! 😄

winter rose
fast igloo
#

**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;

thin fox
winter rose
#

+Def, iirc!

thin fox
#

yeah

#
_vehicle setVehicleAmmo 1;
_vehicle setVehicleAmmoDef 1;
wind hedge
#

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

broken pivot
hallow mortar
hallow mortar
# broken pivot Good evening. Is there a major bug I dont see: if scriptdone then _shot1; htt...

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.

broken pivot
#

@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)

hallow mortar
#

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?

broken pivot
#

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...

hallow mortar
#

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.

broken pivot
#

hmmm

hallow mortar
#
call kameraErstellung1_fnc_kameraErstellung1;
call shot1_fnc_shot1;```
this is all you need
broken pivot
#

I will shoot myself if this works (in rp)

hallow mortar
#

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;```
broken pivot
#

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;

hallow mortar
#

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.

broken pivot
#

Is here anyone experienced with Camera Control who maybe could help me?

willow hound
#

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;
broken pivot
#

Does the camera start from creation point or from first camPos point?

willow hound
#

They are the same 😛

broken pivot
#

Ouch

willow hound
#

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 meowawww

broken pivot
#

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;

´´´

hallow mortar
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
broken pivot
willow hound
#

How did you execute that code?

hallow mortar
#

´ 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.

broken pivot
thin fox
willow hound
#

Did you try with cameraEffect ["Internal", "BACK"]?

broken pivot
#

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

broken pivot
#

pleaseeee release meeee (meanwhile us)

Im into this since 4 days now

bold rivet
#

is there a list for the "playMove" command for all aviable animations?

thin fox
bold rivet
#

oh i see, thx

broken pivot
thin fox
#

like player setPos [3371.254, 1862.981, 0]

#

maybe the [x,y,z] coords are wrong?

broken pivot
#

The cam doesent move at all

#

No single centimeter

willow hound
thin fox
#

@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

bold rivet
thin fox
bold rivet
#

ok, thx

broken pivot
broken pivot
broken pivot
# thin fox <@390890728185659395> try to change `camPrepareTarget` to `camSetTarget` and `c...

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;

broken pivot
#

Nothing changed

thin fox
broken pivot
#

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];

thin fox
#

try those helpers objects, and hide those under attributes

thin fox
broken pivot
#

So you mean I place an invisible helipad and give it a var?

Also tried

broken pivot
thin fox
broken pivot
#

Into it 😄
Worked. I moved my position to the point I want to end the camera drive/shot (idk whats correct english)

thin fox
#

also

#

you can't call this function, because you are using schedule commands

#

you have to spawn

#

0 spawn Intro_fnc_Intro;

broken pivot
#

if this is the solution... imma jump the window

broken pivot
broken pivot
thin fox
broken pivot
#

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

thin fox
#

@broken pivot please, use the sqf syntax highlight here

broken pivot
#

Teach me

thin fox
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```

// your code here
hint "good!";
thin fox
#

just copy the example

broken pivot
#

thanks

thin fox
#

got it

#

so

#

yeah, It did move right

broken pivot
#

So this is my error:

thin fox
#

you forgot to change that

broken pivot
#

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

thin fox
#

you need to change it to _Intro_Kamera_1

#
waitUntil {camCommitted _Intro_Kamera_1};
_Intro_Kamera_1 cameraEffect ["Terminate", "BACK"];
camDestroy _Intro_Kamera_1;
broken pivot
#

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
thin fox
#

you need to learn to check your own script errors, get the screenshot, see what it saying

broken pivot
thin fox
#

replace the last lines

#
waitUntil {camCommitted _Intro_Kamera_1};
_Intro_Kamera_1 cameraEffect ["Terminate", "BACK"];
camDestroy _Intro_Kamera_1;
willow hound
thin fox
#

that has schedule commands

willow hound
#

call in scheduled context is scheduled

thin fox
#

what?

willow hound
#

call in scheduled context is scheduled

tulip ridge
#

Yeah

thin fox
#

wait

tulip ridge
#

Call uses whatever environment it's used in

thin fox
#

interesting

#

😮

#

noted

willow hound
thin fox
#

@broken pivot try to call your function again and see if it's moving

broken pivot
#

Everything 4 you

thin fox
broken pivot
#

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

thin fox
broken pivot
#

Ive did. init was:

call Intro_fnc_Intro;
willow hound
#

Yes

thin fox
#

I've always read that but never related it

broken pivot
willow hound
#

@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?

broken pivot
#

Of corse. You want a vid from it?

willow hound
#

If you want to record one 🤷‍♂️

broken pivot
willow hound
#

Ah sweet 👍

broken pivot
#

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. ❤️

wide egret
#

küsschen aufs nüsschen

broken pivot
#

❤️

wide egret
#

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 🫡 salute 🫡

fast igloo
#

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;
tulip ridge
#

_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

#

(Or make a single group and move all units to that)

thin fox
# willow hound Yes

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?

tulip ridge
fast igloo
tulip ridge
#

No problem 👍

gleaming forge
#

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

willow hound
thin fox
#

thank you

vapid scarab
#

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?

vapid scarab
#

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.

fair drum
vapid scarab
#

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.

fair drum
#

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

vapid scarab
#

Thats where im at now 🙃

#

Thanks for the response!

sudden yacht
#

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```

fair drum
vapid scarab
#

Has anyone written/knows-of a function that completely transfers the cargo from one object to another?

granite sky
#

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.

hallow mortar
#

Good luck transferring nested containers

granite sky
#

Yeah not even sure if we support that. Maybe for container->container.

sudden yacht
#

@fair drum John Jordan helped me out. Im good to go.

vapid scarab
#

Thanks for the recommendation. Im talking vehicle to vehicle total cargo transfer.

vapid scarab
# hallow mortar Good luck transferring nested containers

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 🙃

tulip ridge
vapid scarab
#

I didnt have time to investigate that before i had to leave. You are probably right. I am for eaching (everyContainer _rootContainer)

proven charm
#

how can you detect if object is a light source? there doesnt seem to be common base class for these objects

teal drum
pallid palm
#

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

winter rose
pallid palm
#

well its named in the script

winter rose
#

like _heli = createVehicle (…)?
then yes, the variable itself dies at the end of the script's scope

pallid palm
#

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

winter rose
#

then it becomes a global variable (on the machine it was created)

pallid palm
#

yes nice

#

so that would be on the server

winter rose
#

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

pallid palm
#

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

winter rose
#

well yeah, that's your code 😄

#

depends on how and what you want to do really

pallid palm
#

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

winter rose
#

you could do e.g ```sqf
private _heliToDelete = 42 call SCOT_fnc_helicopterFunction;
sleep 30;
deleteVehicleCrew _heliToDelete;
deleteVehicle _heliToDelete;

#

no public variables, everything good 😎

pallid palm
#

ahhh nice thxs you Lou

#

wow thats cool

winter rose
#

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 🙂

pallid palm
#

well yes thats what i want 1 at a time

winter rose
#

(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

pallid palm
#

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

thin fox
#

checking if it's a "#lightpoint" maybe?

proven charm
#

how do you check that?

#

with str?

faint burrow
#

isKindOf?

thin fox
#

yeah, I was thinking that

proven charm
faint burrow
#

Create a light source and return its type using typeOf.

proven charm
#

you mean like placing Land_LampShabby_F in editor?

faint burrow
#

Run in console:

_lightSource = "#lightpoint" createVehicleLocal [0, 0];

typeOf _lightSource
proven charm
#

umm whats the point of this test? im trying to detect what object is lamp and what isnt

faint burrow
#

Understood. I thought you wanted to detect such light sources.

proven charm
#

oh

faint burrow
#

AFAIR, lamps have special hit selection/point name.

proven charm
#

hmm

broken pivot
#

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";
faint burrow
# proven charm hmm
_isLamp = (((getAllHitPointsDamage _object) select 1) findIf { _x == "something" }) >= 0;
thin fox
#

you could try selectionNames for the lamp post

flint topaz
broken pivot
#

Ive tried it with setVariable like this:

_opfer setVariable ["OpferName", OpferVar, false"];

flint topaz
#

I just told you how

#

The createUnit function returns the unit

#

So just assign that return to the variable like I did above

broken pivot
#

Thanks m8. This is quite simple. Ive tried stuff like this without success maybe now.

I want to learn setVariable as well

proven charm
faint burrow
tulip ridge
flint topaz
#

Not really the usecase of setVariable, but you could set some variables if you wanted for example setting them as a medic etc

proven charm
#

but for PortableHelipadLight_01_green_F return is empty array 😦

broken pivot
proven charm
#

I could ignore that light type though if all other lights have Lamps_base_F as base class but idk yet if they do

broken pivot
#

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;
tulip ridge
broken pivot
#

Oh... the vid is not playing. Its just hillarious Give me a sec Ill show

tulip ridge
#

It does play, there's just nothing obviously wrong

broken pivot
#

He turns after setDir was done back on spring position

tulip ridge
#

Yeah, AI will respond like normal when you spawn them

broken pivot
#

So how to handle this? I want him to get executed. So I dont know if freezing the unit is an option

thin fox
broken pivot
#

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;
errant iron
#

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!)

versed belfry
#

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?

opal zephyr
#

If a mass isn't defined, then it will use the defined value of its parent

south swan
#

CfgVehicle stuff can't be stored in the inventory, though?

versed belfry
#

It can become an inventory item

opal zephyr
#

they are seperate classes

south swan
#

i'd assume it'll use the mass of similarly named entry in CfgMagazines

opal zephyr
#

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

south swan
#

it's ACE. With picking the thing up through the ACE function 🤔

versed belfry
#
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.

broken pivot
#

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...

south swan
#

configfile >> "CfgVehicles" >> "acex_intelitems_notepad" >> "ace_intelitems_magazine" = "acex_intelitems_notepad";
configfile >> "CfgMagazines" >> "acex_intelitems_notepad" >> "mass" = 0.1

opal zephyr
crisp sonnet
#

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;```
broken pivot
opal zephyr
hallow mortar
broken pivot
#

In testphase via execVM and normal its in a call

opal zephyr
# broken pivot In testphase via execVM and normal its in a call

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

crisp sonnet
opal zephyr
versed belfry
crisp sonnet
#

_vehicle detach _parachute;

opal zephyr
crisp sonnet
#

I never look at the wiki that place is far too hurt on the brain

opal zephyr
broken pivot
#

Even if I execute this in debug, he wont shoot

crisp sonnet
opal zephyr
opal zephyr
crisp sonnet
# opal zephyr I mean.. yes, I assume you used chatgpt for what you sent above though no?

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

opal zephyr
crisp sonnet
#

Gotcha

opal zephyr
#

shoot, sorry I put it backwards in mine haha

#

I corrected it

#

Thanks artemoz

broken pivot
crisp sonnet
#

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

opal zephyr
broken pivot
#

Like this:

opal zephyr
tulip ridge
#
private _mass = getNumber (configFile >> "CfgMagazines" >> _intelItem >> "mass");
crisp sonnet
opal zephyr
broken pivot
#

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;
crisp sonnet
#

AI isn't replacing people juuust yet

broken pivot
#

ouu shit your right. I mean it was there

crisp sonnet
#

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?
opal zephyr
#

Whats the error?

crisp sonnet
#

It wants another ; slapped in the middle somewhere

#

Specifically it wants it after the deleteVehicle

#

Or is that because parachutes delete themselves..?

opal zephyr
#

Hm, I dont think they do, but you could try just removing that line

crisp sonnet
#

I mean the code otherwise appears to work the way I needed it to

opal zephyr
opal zephyr
crisp sonnet
opal zephyr
#

Great, then you're done

crisp sonnet
#

Let's hope so

broken pivot
#

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!";
opal zephyr
#

Does the hint appear?

broken pivot
#

Yes

#

Im slightly getting angry about this. Does it make sence or is it unlogic and buggy?

opal zephyr
#

Are the east and independent factions hostile towards one another in your mission?

broken pivot
#

Same thoughts

opal zephyr
#

try replacing your doFire line with _schuetzeVar fireAtTarget [_opferVar, currentWeapon _schuetzeVar];

#

And if that doesnt work, try _schuetzeVar forceWeaponFire [currentWeapon _schuetzeVar, "Single"];

broken pivot
opal zephyr
#

Im going to try this locally on my computer, in the middle of compiling something but once its done I will

broken pivot
opal zephyr
#

yoinks

broken pivot
#

ArmA crashed

opal zephyr
broken pivot
#

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];

opal zephyr
#

the game may think there is something in the way, look at the optional paramaters for createvehicle

broken pivot
#

I havent used createVehicle shouldnt "CAN COLLIDE" fix it?

private _schuetzeVar = _schuetze createUnit ["I_Survivor_F", _schuetze_spawnpunkt, ["CAN_COLLIDE"], 0.5, "NONE"];

winter rose
#

setPosATL right after to be precise

broken pivot
#

Like this:

private _schuetzeVar = _schuetze createUnit ["I_Survivor_F", _schuetze_spawnpunkt, ["CAN_COLLIDE"], 0.5, "NONE"];
_schuetzeVar setPosATL _schuetze_spawnpunkt;

winter rose
#

yes

broken pivot
#

trying now

#

Now were talking

winter rose
#

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 😬

broken pivot
#

Huuuh? I thought its the skill...

#

Is there I give an Stance input? So he stops crouching?

#

SetStance isnt a command

winter rose
#

setUnitPos

winter rose
broken pivot
#

Looked at wrong syntax...

winter rose
#

ah yes! you mixed both

broken pivot
#

I gues I where never that happy that an AI is getting shot multiple times xD

opal zephyr
#

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

broken pivot
#

Cause of classname
Youve set the group?

opal zephyr
#

im trying to fix it

broken pivot
#

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?

opal zephyr
#

that did it, weird though that being created in a group of a different side wouldnt overwrite it

broken pivot
#

Lets get to work

dry cradle
#

One of my mission makers just told me about you adding this, really appreciate it!

fair drum
#

The flash bang detection I'm still working on. Might need to throw a PR in for ACE to detect it globally.

velvet knoll
#

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

fair drum
#

At work on phone so I can't give you an example, but this can return the position where the "beam" hits a surface

vapid scarab
#

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.

south swan
vapid scarab
#

Only works one way. But.... I was rereadiong preprocessor... and it has a __has_include_
So nevermind. It literally has an ace example actually 😁

wicked pine
#

Can I have a code to put in the init of a helicopter to enable ACE3 fries?

tulip ridge
buoyant cairn
#

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;
};

};

warm hedge
#

Why using while to add EHs?

#

And that HandleDamage _this#6 is not an unit but projectile

buoyant cairn
#

the point is to make only the local player be able to do such damage to bots

warm hedge
#

What point do you mean

buoyant cairn
#

of the script

#

the script was not made by me

warm hedge
#

So wasn't an answer to my question I see

buoyant cairn
#

just a compilation of help people gave me here

warm hedge
#

But you're the one who trying to fix it no?

dusk parrot
#

I am looking for a server

buoyant cairn
warm hedge
buoyant cairn
warm hedge
#

EntityCreated Mission EH can do this. Also this loop add EHs over and over again to units with EHs already

buoyant cairn
#

i will try to search a bit

buoyant cairn
warm hedge
#

_this#6 == player means the projectile is the player. Of course it always is false

buoyant cairn
#

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?

warm hedge
#

Sorry I slightly stand correct, _this#6 is not a projectile. But indeed _this#7 is instigator. Also _this#2 is the damage

wicked pine
buoyant cairn
warm hedge
#

Try it

small gyro
#

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}
dusk gust
small gyro
dusk gust
#

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?

small gyro
tulip ridge
tulip ridge
small gyro
dusk gust
# small gyro 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.

tulip ridge
#

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]

small gyro
tulip ridge
#

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

small gyro
#

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.)

tulip ridge
#

Probably not relevant to your use case, but something to know

dusk gust
#

Either will work, both have different drawbacks

small gyro
#

I would like to be able to get an array of online dead players without using external variables

dusk gust
small gyro
#

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

dusk gust
small gyro
dusk gust
#

Thats.... Exactly what it means....

small gyro
#

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

buoyant cairn
warm hedge
#

What code you have right now

#

And are you even sure the EH is running at all

buoyant cairn
#

that was the whole code

#

running on a initplayerlocal

#

and being called by the init file using [] vm execute

warm hedge
#

Your answer specifies nothing

#

Post your code

buoyant cairn
#

[] 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

warm hedge
#

And what is "mission init file"

buoyant cairn
#

init.sqf file that goes inside my arma 3 mission folder

warm hedge
#

Do you do any debug output like systemChat

buoyant cairn
#

no, cause i don't have practice with coding it, all i have is from people here that helped me

warm hedge
#

Then learn your first practice

velvet merlin
#

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)

cosmic lichen
#

Cba_waitUntil?

little raptor
#
[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 🥺

dusk gust
little raptor
#

oh meowsweats
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 meowsweats

velvet merlin
#

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)

velvet merlin
#

(findDisplay 49) closeDisplay 0; diag_captureFrame 3;

broken pivot
#

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;
thin fox
broken pivot
#

I know

How do they help me?

still forum
#

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

ivory lake
#

uhh isnt it that high because you have 18s worth of sleep?

still forum
#

its 18ms, not seconds.
It spams errors for not being allowed to suspend

broken pivot
#

It has to run faster. All scripts need to run faster

ivory lake
#

ah whoops misread

still forum
#

If you want it to run faster, why did you put a 15 second sleep into it?

broken pivot
#

I tried to delete via main script. But this caused into errors. So I wanted to delete them after the cam went away

broken pivot
still forum
#

Do you have CBA mod?

broken pivot
#

Yes

thin fox
broken pivot
broken pivot
still forum
broken pivot
#

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.

still forum
#

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?

broken pivot
broken pivot
#

"Extension not found" I havent changed anything. I really dont understand anything of the things happening

still forum
#

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

broken pivot
#

I also thought about but I dont understand spawn at all because this strange 0 infront and the link to magic var _this

still forum
#

one sec discord being bad

broken pivot
#

Take all you need.

still forum
#

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.

still forum
broken pivot
#

Allright so Im gonna use some random ass local vars I never ever gonna use haha. I think I got it 😄

broken pivot
# still forum

I dont knewed that CBA enters new commands. Things to learn

still forum
#

They are not commands, they are functions.
Just like your own functions that you are calling there

broken pivot
#

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.

broken pivot
still forum
#

BattlEye sometimes blocks stuff randomly

broken pivot
#

So game restart fix it. Copy

still forum
#

No, disabling BattlEye will fix it, or waiting a few hours

broken pivot
#

This is so bad that it makes me smile.
Im into changing code now. I will give intel soon

still forum
#

I prefer AMD

broken pivot
#

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 ...

still forum
#

You cannot just use a undefined variable like _aa

broken pivot
#

Thats a point Ive fixed

#

Now Im studying your script to learn new stuff

cobalt path
#

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)

broken pivot
#

(somebody needs help)
I cant help you. But I can bring traffic to your message. #PeaceLoveHarmony #MakeArmANotWar

still forum
cobalt path
stable dune
cobalt path
#

Yourpredefinedlist = ["stuff1","stuff2"];?

tough geode
cobalt path
#

u think that should be in init or initplayerlocal

stable dune
exotic gyro
#

init also has funky operation time depending on single player vs multi player

maiden raven
#

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.

tribal crane
maiden raven
#

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.

prime perch
#

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?
hallow mortar
#

say3D sounds can be stopped by deleting the sound source created by the command.
playSound3D isn't working for you because:

  1. the command requires a file path, not a CfgSounds classname
  2. 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 for say3D, will be different on each client.
faint burrow
prime perch
hallow mortar
#

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)

valid dew
#

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

hallow mortar
valid dew
#

Yeah that's fair, I do have 1.3k hours in Arma 3 fwiw as well

#

Are the languages / concepts patterns fairly similar?

prime perch
hallow mortar
#

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`.
hallow mortar
prime perch
pale glacier
#

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.

still forum
#

HandleChat mission eventhandler should be able to

royal quartz
#

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]];
pale glacier
#

Thanks guys, I'll look into it. Much appriciated

silent cargo
#

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?

faint burrow
winter rose
#

setDamage's instigator parameter eventually

winter rose
silent cargo
#

Doesnt seem to work with map objects

faint burrow
#

Code?

winter rose
#

yes

faint burrow
#

Still wondering that someone writes "doesn't work" but doesn't provide the code.

silent cargo
#
 
{ 
    _x setDamage 0.5; 
    _x setDir 20; 
} forEach _terrain; 
faint burrow
silent cargo
#

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

dire island
#

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;```
neon plaza
#

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.

tough geode
pallid palm
#

no test respawn its west_respawn

#

west_respawn_1 and so on

neon plaza
#

I just seen this In writing and testing. Can not get the AI to pick other spawn points @pallid palm

#

I entered respawn_east

pallid palm
#

if you have many west_respawn points it will random select them

#

or yes respawn_east

neon plaza
#

Not sure If the warlords module may change this. I have yet to see the AI use the spawn truck.

pallid palm
#

ai cant do much

#

thay need orders

neon plaza
#

Shame... I was hoping there was something built In telling the AI to select the closes spawn point.

pallid palm
#

you can make it that way if you script it

#

but im not very good at scripting sqf

neon plaza
#

Me and you both.

#

I will figure something out.

pallid palm
#

copy that i only know how the game works

#

altho i have made some awsome scripts with the help of others

dire island
pallid palm
#

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

tough geode
pallid palm
#

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

silent cargo
# winter rose `setDamage`'s `instigator` parameter eventually

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.
lyric pasture
#

Has anyone ever looked into a CUDA extension?

silent cargo
little raptor
kindred zephyr
#

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

fair drum
#

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

kindred zephyr
#

thanks Hypoxic, thats exactly what I needed to know

fair drum
#

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"

kindred zephyr
#

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

silent cargo
# faint burrow What about this: https://discord.com/channels/105462288051380224/105462984087728...

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 🙏
merry shard
#

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?
#
#

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?

lyric pasture
merry shard
faint burrow
odd kite
#

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

royal quartz
#

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.

#arma3_scripting message

pallid palm
#

is 3500m the max view settings ?

odd kite
#

yeah max in the CHVD is 3500 for view and object

#

ive seen servers have the same menu at 12k

pallid palm
#

hmmm

#

i did not know that

faint burrow
# odd kite does anyone know how to change the CHVD max view and max object settings? can on...
odd kite
#

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

pallid palm
#

copy

#

wow thats awsome

odd kite
pallid palm
#

btw Schatten is a super pro also at sqf

odd kite
#

haha thats great. im probably walking on thin ice most the time between success and destroying my server lol

pallid palm
#

i resemble that 🙂

odd kite
#

only one way to learn haha

pallid palm
#

yup thats it my friend

thin fox
empty pilot
#

anybody knows how can i make a player (not AI) always in combat stance ? means when he walk he keep his weapon up ?

open hollow
#

if ( weaponlowered player) then { player setdammage 1}
/s

kindred zephyr
kindred zephyr
open hollow
#

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

thin fox
empty pilot
#

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 sadCowboyHours

#

My goal was to change the stances only. In each time player would respawn...

open hollow