#arma3_scripting

1 messages ยท Page 506 of 1

still forum
#

what other colors?

tough abyss
#

change values

#

color[]={red,green,blue,alpha}

astral tendon
#

thanks.

still forum
#

top 6 with CBA loaded

48978    A3\functions_f\initFunctions.sqf:458
217320    A3\functions_f\initFunctions.sqf:394
510840    x\cba\addons\xeh\fnc_compileFunction.sqf:30
1346355    a3\functions_f\GUI\fn_initDisplay.sqf:55
4868001    A3\functions_f\initFunctions.sqf:487
4875300    A3\functions_f\initFunctions.sqf:130

Size in bytes. To be expected.

#

For anyone who wants to try. Intercept based. No Battleye. Requires CBA.
Starts collecting stats from game start on. You can dump using the script command ade_dumpCompileStats which returns a string

unreal leaf
#

Do you know how it checks if the code is already in cache? function name, size?

still forum
#

content of the string passed to compile

#

hashtable

delicate lotus
#

I just read that with call compile

#

good thing I actually never use that lol

unreal leaf
#

Well its only a problem if you have big strings you want to compile and they are different all the time.

#

Where there is one big security problem with this so i guess BI need to think of a way to fix it anyway

delicate lotus
#

security problem?

unreal leaf
#

If its cached it will not compile again

#

so if you compile it before some one...

#

I talked about a way to do this with Dedmen, thats how he found the caching

still forum
#

who is dedman

unreal leaf
#

your a dead man!

#

Could you make a proper ticket on this incl the security problem?

still forum
#

you already have the security ticket.

unreal leaf
#

Or are you writing a fix for them your self XD

#

Yes oke then i will update it with the new info we have

still forum
#

Any fix to my problem will fix your security problem too

unreal leaf
#

I reported this a month ago, didn't hear a thing so far

tough abyss
#

so if you compile it before some one... then waht?

unreal leaf
#

then it will not recompile until you restart the game. But its a big security problem so wont go into more detail

#

Does it really need a cache? is compile so slow that it would benefit from it?

still forum
#

Don't remember being it as slow.. But all the latest profilings were skewed by the cache. so dunno.. Maybe they made it slower?

molten folio
#

hey is there a way of vertically centering the structured text, the valign = "middle" isnt working

tropic dawn
#

hey could someone please help me, i get this error config: some input after EndOfFile

tough abyss
#

action = {"closeDialog 0"}; this

#

what is this supposed to be a string? an array?

molten folio
#

use onbuttonClick = "";

tropic dawn
#

oh didnt see that

#

meant to just have "closeDialog 0";

ember verge
#

Is there a way to host a local arma 3 server with a server.cfg

#

cars dont save to garage in altis life :/

tough abyss
#

you can run local dedi

#

on your pc

earnest ore
#

Queue life containme- discord server link in 5...

calm bloom
#

Hello there. Have anyone got an idea how can i get displayeventhandlers returned id inside its code?

#

the best i can imagine is to create a dummy handler, remove it instantly and plus one to its id

languid tundra
#

Just set and get the ID with setVariable and getVariable. You could use the display as the variable space.

calm bloom
#

Good advice thank you

#

Can you explain how can i use display as variable space?

languid tundra
#

Just do something like

private _id = _display displayAddEventHandler [_eventName, {params ["_display"]; private _id = _display getVariable ["myEhId", -1]}];
_display setVariable ["myEhId", _id];
calm bloom
#

thank you, got it

languid tundra
#

You probably also need disableSerialization

tropic dawn
#

hey i posted this on general before hey does anyone know why you cant switch seats if you have an ai in your helicopter?

#

im just adding an ai to my heli through a script i did _moved = player moveInAny _veh; and then _unit moveInDriver _veh; [_unit] orderGetIn true; [_unit] allowGetIn true; it only happens when i run this script from the pilot seat if im in the co-pilot or even the gunner seat then its fine but this also happens with just using the editor, if you place in the Blackfish VTOL and place a pilot in there and then place the player as a gunner, then it won't let you switch to any of the other seats welp, it's happening with all the helicopters. without any ai you can just swap between all the seats. but if you add an ai to the pilot seat then it wont let you

#

does anyone know why this is happening?

tough abyss
#

who is the group leader when it doesnt work?

tropic dawn
#

tried as group leader as well

#

it never lets me switch seats when i add in an ai to the pilot seat

slim oyster
#

Is it possible to detect overlaps of area arrays? I am generating area arrays for checking if players are in them, but I want to detect if area arrays are connected in which case I can add them to a group array.

languid tundra
#

arrayIntersect

slim oyster
#

On the wiki page it says that command Intersects array1 with array2 returning array of unique common elements which if I am not mistaken would return equal/alike elements, but not an inclusive check in 2D position

languid tundra
#

So what do you mean with area arrays?

#

Are these polygon vertices?

slim oyster
#

triggerArea style array

languid tundra
#

hmm, let me see

#

I can add them to a group array

#

not sure what you mean

slim oyster
#

I want to check if a player is in a least one of those connected area arrays through a count or select on an array comprised of those triggerArea style arrays as elements

#

(({(vehicle player) inArea _x} count (missionNamespace getvariable [_arrayname,nil])) > 0)

#

_arrayname is being defined as an array comprised of triggerArea array elements, like this:

     private _AOLimitArray = _x;
    if (({_logic inArea _x} count _AOLimitArray) > 0) exitwith {
         _AOLimitArray pushBackUnique _area;
        _run = false;
        breakOut "AOLimitMainSpawn";
    };
 } foreach UO_FW_AOLimit_Arrays;```
#

{_logic inArea _x} can only return true if that logic object is actually within that area array, not if the radius of that logic's generated array area overlaps with another

languid tundra
#

What's the problem with the line you already have except that you should use findIf instead of count?

still forum
#

getvariable [_arrayname,nil] nil as default value is nonsense

languid tundra
#

Oh, yeah ๐Ÿค”

slim oyster
#

Is there a function for comparing 2d/3d areas with one another and seeing if there is overlap?

languid tundra
#

Don't know of a command/function. What's the shape of the areas?

slim oyster
#

Either ellipses or rectangles, can be set by the mission maker

languid tundra
#

That's gonna be fun to determine^^

slim oyster
#

defined in the area array just like a triggerArea

languid tundra
#

For what purpose do you need to know whether they overlap?

still forum
#

inArea can do 3D.

slim oyster
#

area limiter that can keep players in mission maker defined areas, if the markers overlap I want those areas to be grouped in an array so I can run the player inArea checks on all those areas

#

For example two rectangular shapes that are offset or perpendicular.

astral dawn
#

You can just create a giant marker the size of allowed area, then run inArea on that, or do you want more complex areas?

languid tundra
#

It sounds like he wants to have any shape a user could want to. Can thus be quite complicated shapes.

#

If only you could place polygons ๐Ÿ˜„

slim oyster
#

worst case I can tell mission makers they are asking for too much, but this seems like something that should be entirely possible, I am probably just missing something obvious

astral dawn
languid tundra
#

Or sync the triggers that you want to group to a logic.

#

I have the feeling that with a few changes in your specification, you could avoid math.

languid tundra
#

Btw. is it a mod you are working on?

slim oyster
#

yes, 3den editor extension that acts as a mission framework with some basic functionality

languid tundra
#

Good, then why not create a module that a player has to sync triggers to specify the area that belongs to it?

#

BI also does this approach with the with their modules.

slim oyster
#

I've got them as modules with setting attributes for the AO limitations, and just using size/position/direction from the actual logic object to generate the area. Syncing with trigger areas is a lot less intuitive for novices i think, and it doesn't confirm whether there is a contact point between those areas, I would be relying on the mission maker to connect those markers and sync them which is questionable.

languid tundra
#

Why do they have to be connected? Could be a town with an island like Lijnhaven.

#

I mean if you want to do the math, just go for it. I just proposed an alternative approach that has been done by others.

slim oyster
#

If it was a module for capture zones or sectors I would agree, but for a module with a function of limiting players to that defined area it makes much more sense to have them connected, with additional modules/markers/trigger areas being extensions of that zone rather than instances

#

I think I am going to go with a really rudimentary distance check based off of the logic size and azimuth. I don't expect mission makers to put area limitation markers within their radius distance if they don't mean to have them connected so hopefully that will suffice. Thank you for your suggestions

languid tundra
#

Well, that would mean if a user fails to do that, parts of his limited AO are not accessible. Well, you can decide between making the check or let the user figure it out. Why do a check that is not reliable instead of no check at all? The behaviour would be more consistent.

radiant needle
#

Why is this waitUntil only firing on the !alive and not the distance2D

waitUntil {((!alive ParaJumpVic) || (!isNull ParaJumpVic) || ((ParaJumpVic distance2D End01) <= 100))};
still forum
#

the isNull check is nonsense

#

alive returns false if it was null

radiant needle
#

Okay so I'll pull that out

still forum
#

the distance thing.. Dunno.. looks good? unless there's something wrong with End01

radiant needle
#

Can waitUntil not handle multiple conditions?

#

Because I just noticed I had !isNull

#

which means it should have been firing instantly

still forum
#

waitUntil only handles a single condition

#

And you also only have a single one in your code

#

waitUntil just checks the value that you return

radiant needle
#

Yeah looks like the only condition being evaluated is the !alive

languid tundra
#

Nope, what Dedmen just told you is that whatever ((!alive ParaJumpVic) || (!isNull ParaJumpVic) || ((ParaJumpVic distance2D End01) <= 100)) returns is checked by waitUnil.

radiant needle
#

I cut out the isNull and just have this

waitUntil {((!alive ParaJumpVic) || ((ParaJumpVic distance2D End01) <= 100))};
#

So code proceeds if I delete the vic

#

but if vic reaches 100m of End01 code does not proceed

languid tundra
#

How about logging?

waitUntil
{
    sleep 0.5;
    systemChat str [!alive ParaJumpVic, (ParaJumpVic distance2D End01) <= 100];
    ((!alive ParaJumpVic) || ((ParaJumpVic distance2D End01) <= 100))
};
radiant needle
#

nothing until I delete the vic, and then it gives [true,false]

languid tundra
#

Where do you execute the code?

#

What does systemChat str canSuspend display?

still forum
#

just log the distance

#

not whether distance <= 100

radiant needle
#

So the distance thing definitely seems to be the problem

#

Because I tried just getting rid of the alive and just have

waitUntil{(ParaJumpVic distance2D End01) <= 100};
SystemChat "DistanceMet";
still forum
#

just log the distance and see what's going on

radiant needle
#

So it's getting down to 11

still forum
#

๐Ÿค” wat

languid tundra
#

nothing until I delete the vic, and then it gives [true,false]
That still sounds strange to me... He should have seen the logging until it gets deleted.

radiant needle
#

I ended up just having a loop prior to the waitUntil that fed out the distance every .25 seconds

#

and it was definitely getting below 100

still forum
#

any errors in RPT maybe?

radiant needle
#

Huh so that's weird

for "_i" from 0 to 120 step 1 do {
systemChat str(ParaJumpVic distance2D End01);
Sleep 0.25;
};
waitUntil{(((ParaJumpVic distance2D End01) <= 100) OR (!alive ParaJumpVic))};
systemChat "Test";
#

So this is what I had to debug

#

but for some reason I'm not getting the systemChat distance until after the plane is deleted

#

And then it's just printing 1e+010

languid tundra
#

How about

[] spawn
{
    waitUntil
    {
        sleep 0.5;
        systemChat str [!alive ParaJumpVic, ParaJumpVic distance2D End01];
        ((!alive ParaJumpVic) || ((ParaJumpVic distance2D End01) <= 100))
    };
};
radiant needle
#

I deleted the plane and ran the same script again and now it works

#

I wonder if there is something weird with the public variable

languid tundra
#

Unlikely, it's way more likely you are doing something strange^^

radiant needle
#

Is there a way to delete a variable?

still forum
#

set it to nil

radiant needle
#

Like just Var = nil or setVariable

still forum
#

both are the same

radiant needle
#

So Kex I tried your thing, and it is printing out [false,distance]

#

but when it's below 100 it's not doing anything

#

When I delete the aircraft though it will continue

languid tundra
#

So even if it's <100, you still get the values printed?

radiant needle
#

yes

rain mulch
#

Hello, I'm trying to get a gate to open only when a pilot enters a trigger, in order to allow vehicular access to the flightline on our FOB. I've got the gate opening actions in the "On Act/Deact" fields, I just am stuck on the Condition. All the pilots are "B_Pilot_F" classnames since I thought it might be easier, unless it makes more sense to give them variable names. Would appreciate any help, thank you.

tough abyss
#

try this && { thisList findIf {typeOf _x == "B_Pilot_F" } > -1}

rain mulch
#

@tough abyss yes it works, thank you!

#

Now is there a way to remove the actions associated with the gate? Because now I'm realizing that the trigger may not open the gate but they could just walk up to the gate and open it via scroll wheel

rain mulch
#

So I'm trying to implement the Dynamic Groups function which works fine in the mission, but it always give the groups random insignia and I'd like to be able to assign each group its own insignia. I was referring to the BIKI Dynamics Group page and it said you can register your own groups. This is what I have in my "initPlayerLocal.sqf"

if (isServer) then
{
   private ["_group", "_leader", "_data"];
   _group  = reaper_1;
   _leader = reaper_1_sl;
   _data   = ["TFAegis", "Reaper 1", true]; // [<Insignia>, <Group Name>, <Private>]
 
   ["RegisterGroup", [_group, _leader, _data]] call BIS_fnc_dynamicGroups;
};```

Is this what it's supposed to look like?
ruby breach
#

Looks right, assuming reaper_1 and reaper_1_sl refers to the group and the groups' leader. You could skip a few steps there and just use ```sqf
["RegisterGroup", [reaper_1, reaper_1_sl, _data]] call BIS_fnc_dynamicGroups;

rain mulch
#

Ah okay. So would this replace the ["InitializePlayer" portion?

#

I'm just curious if shorten it like you're saying, where do I specify the _data to tell it what Insignia and Name to use?

ruby breach
#
["InitializePlayer", [true]] call BIS_fnc_dynamicGroups;
if (isServer) then {
   private _data = ["TFAegis", "Reaper 1", true]; // [<Insignia>, <Group Name>, <Private>]
   ["RegisterGroup", [reaper_1, reaper_1_sl, _data]] call BIS_fnc_dynamicGroups;
};
``` Like that
rain mulch
#

Oooh okay. And then I just do that for each group and group leader?

ruby breach
#

If you already have global variables for each of them, yes

rain mulch
#

I do. And formatting that would look like this?

if (isServer) then {
   private _data = ["TFAegis", "Reaper 1", true]; // [<Insignia>, <Group Name>, <Private>]
   ["RegisterGroup", [reaper_1, reaper_1_sl, _data]] call BIS_fnc_dynamicGroups;

  private _data = ["NextInsignia", "Other Squad", true]; //[<Insignia>, <Group Name>, <Private>]
   ["RegisterGroup", [_group, _leader , _data]] call BIS_fnc_dynamicGroups;
};```
And so on?
delicate lotus
#

Hey, if the BIKI does not state whether a function is global or local, so no locality given, is it then always local? Or is there no simple rule and I would need to ask / do experiments to find it out?

tough abyss
#

No there is no rule

ember verge
#

Are we able to change the main menu load screen like in exile ?

tough abyss
#

If (Exile did it) then {we are able}

ember verge
#

allright so how should i continue ?

#

like with what should i start

tough abyss
ember verge
#

allright thanks

delicate lotus
#

@tough abyss well thats kinda bad. Considering there are functions like addGroupIcon with no given locality...

tough abyss
#

That would be UI, UI functionality is local

#

However with Arma it is dangerous to assume things

#

The rule of thumb, if in doubt - test it

still forum
#

Most things you can infer by just thinking logically.

tropic dawn
#

hey please could someone tell me why my picture is transparent in the dialog

#

class rsc_Background: RscPicture { idc = 1200; //text = "#(argb,8,8,3)color(1,1,1,1)"; text = "custom\images\tablet.paa"; x = 0 * safezoneW + safezoneX; y = 0 * safezoneH + safezoneY; w = 1 * safezoneW; h = 1 * safezoneH; colorText[] = {1,1,1,1}; colorBackground[] = {1,1,1,1}; colorActive[] = {1,1,1,1}; };

still forum
#

width and height both multiples of two?

tropic dawn
#

yeah

still forum
#

you are missing the _co suffix

tropic dawn
#

in the file name?

still forum
#

yeah

#

before you convert to paa

tropic dawn
#

do i still save it as dxt5 thing?

#

thank you, it works now

rain mulch
#

So I have this in a trigger's condition field to detect whether the player is a pilot or not and if they are, the gate will open. But it appears it doesn't work if the pilot is in a vehicle. this && { thisList findIf {typeOf _x == "B_Pilot_F" } > -1};

#

Any way to get it to look at the player when they're in a vehicle?

tropic dawn
#

can you get the vehicle driver

#

and check if it is equal to the player

rain mulch
#

Tbh I'm very new to scripting so I'm sure there is a way, I just need to find it and then figure out how it works

tropic dawn
#

yeah me too lol, but you can do
_veh = vehicle player; if (driver _veh isEqualTo player) then { //whatever here};

#

don't know about triggers and stuff but thats how i check if my player is the pilot

high marsh
#

The problem with the above example is that the target check will always be the player and not MP compatible, plus the initial question included magic variables like thisList to include the pilots in the trigger area.

ruby breach
#

Does the pilot have to be the driver, or do you want the trigger to fire if they're in any seat?

rain mulch
#

Any seat would be fine

#

Basically it's a gate that pilots can drive quad bikes or MRZRs through to drive out onto the flight line and keep non pilots from messing around too much on the flight line

#

So more than likely, they'll be the driver anyways but if it just checks any seat, that works too

ruby breach
#

So you'll need to loop through every unit if it's not a vehicle, and through the crew if it is

tropic dawn
#

anyone know what moveOnEdges is for the RscMap?

cunning crown
#

When you put your mouse at the edges of the map, it moves? Just a guess tho.

tropic dawn
#

oh wow lol, i trying all sort of stuff but didnt try that

#

do you know a way to make it so you can move the map into the black areas

#

can't*

cunning crown
#

Idk, didn't really played with the map yet ^^

tough abyss
#

anyone know what moveOnEdges is for the RscMap? not used in Arma 3

tropic dawn
#

would anyone be willing to help me test out a script?

astral dawn
#

a = b doesn't return nil but... nothing?
Credit goes to this guy again: @unreal leaf

_a = call {_c=1;};
isNil "a"
// Result: generic error at expression (points at _a = call ...)
_a = call {};
isNil "a"
// Result: returns true, gives no errors
ruby breach
#

Aside from the fact that isNil "a" isn't the same as isNil "_a", that behavior is pretty much what I would expect

leaden summit
#

Is there an easy way to remove the AA turrets etc from the list of UAV's?
I still want the missile launchers to be autonomous, I just don't want them player controller or to appear on the list

obtuse orbit
#

anyone familiar with getting making custom main menu backgrounds. (playing a mission etc)

astral dawn
#

@ruby breach Yes I meant isNil "_a".
It says on wiki: a = b : Return value: Nothing. Later at the page for 'Nothing' it says that it can be checked with isNil command. Which turns out to be not the case here, because it returns not nil but something different ๐Ÿ˜„

west venture
#

@leaden summit Yes, it involves listing the UAV that the player isn't allowed to connect to in the player's init.

I don't remember the specific command though.

leaden summit
#

oooooo now that would be good, off to find this mysterious command

ruby breach
#

@astral dawn This is known though

#
    Posted on November 9, 2016 - 00:29 (UTC)
Dedmen
    This operator actually does not return a Nil. It really returns pure Nothing. Not Nil Nothing.
    This can cause problems. For example:
    _var1 = call {
        _var2 = "";
    };
    The return value of the "call" is the return value of the "=" operator.
    If it were a nil then of cause "_var = nil;" would work just fine.
    But in reality this causes a "Generic Error in expression" because you can't assign pure Nothing to anything.
``` <https://community.bistudio.com/wiki/a_%3D_b>
leaden summit
#

Ok so by searching for the exact same thing I searched for last time I got much better results
Bang this in the ol' init.sqf and change sam_1, sam_2... to whatever you named your sam sites and you're good to go

[] spawn {
    if (!hasInterface) exitWith {};
    while {true} do {
        // Check if the player has an AV terminal
        if ("B_UavTerminal" in assignedItems player) then {
            // This code must be run each time the player gets a new AV terminal
            {player disableUAVConnectability [_x,true];} forEach [sam_1,sam_2,sam_3,sam_4,sam_5,sam_6,sam_7,sam_8];
            while {("B_UavTerminal" in assignedItems player)} do {sleep 3;};
        };
        sleep 3;
    };
};```
ruby breach
#

Any particular reason for using a second while-do loop and not just using waitUntil with a sleep in it?

leaden summit
#

That's just what I found on the forums

#

And it seems to work so far

unreal leaf
#

@ruby breach What's the differents?

ruby breach
#

Nil does not equal Nothing (Someone who does actual programming feel free to explain this one in a manner that makes sense)

unreal leaf
#

I mean to use waitUntil

ruby breach
#

Functionally? They'll do the same thing. I've just never seen someone use while (bool) do {sleep} instead of waitUntil {sleep; bool};

unreal leaf
#

Well it indeed looks better

[] spawn {
    while {true} do {
        
        waitUntil{sleep 1; ("B_UavTerminal" in assignedItems player)};
        
        {player disableUAVConnectability [_x,true];} forEach [sam_1,sam_2,sam_3,sam_4,sam_5,sam_6,sam_7,sam_8];
        
        waitUntil{sleep 1; !("B_UavTerminal" in assignedItems player)};

    };
};```
#

Still silly that you cant disable it on the object it self or not

rain mulch
#

@ruby breach do you know what command I could look up for it to loop through the crew in the vehicle?

ruby breach
#

crew will get you an array of a vehicle's occupants, and according to a note on the wiki If used on a unit (man, module, etc.) it will return an array containing that unit.

rain mulch
#

So something like player in (crew _car) && { thisList findIf {typeOf _x == "B_Pilot_F" } > -1};

#

?

ruby breach
#

I'm half asleep, so the following could be complete potato (and I've never tried a findIf in a findIf before), but ```sqf
(thisList findIf {crew _x findIf {alive _x && typeOf _x isEqualTo "B_Pilot_F"} > -1} > -1); //search the crew of each vehicle/man object within trigger for an alive pilot and return true if any pilot exists

#

Even if that doesn't work, you get the idea. Scan the crew of each vehicle within the trigger for a pilot.

rain mulch
#

Okay thank you I'll try that. Worst case, I'll just put the vehicles outside the gate and they have to just walk out the gate

short trout
#

Hi. Maybe someone has a link for gui tree list tutorial? Would you kindly share it to me? =)

delicate lotus
#

Dumb question, but an UAV Terminal can be connected to more than one UAV, right?
Then why would getConnectedUAV only return a single value?

#

Or am I just confused and the terminal can connect to only one UAV?

short trout
#

I've used 2 uavs, so you right

#

Maybe currently controlled is meant?

tough abyss
#

@delicate lotus probably overlooked in implementation

delicate lotus
#

Yeah they could have overlooked it...

astral tendon
#

But how to order a unit to heal another?

ruby turtle
#

does anyone knows a really simple snow script (light snow no blizzards or something) Alias script is way to overloaded for my intensions and the tf weather script is to laggy. I just want a really simple light snow falling for a post christmas mission ^^

tropic dawn
#

anyone know why the ai only uses flares once when they get fired on by rockets?

#

is there any way i can make them continue to use flares?

#

i got
_group setBehaviour "AWARE"; _group setCombatMode "BLUE";

copper raven
tropic dawn
#

is it better to use fired or IncomingMissile?

delicate lotus
#

fired if you want to detect a flare launch

#

incomingMissile if you want to check if some god damn boi shot some missile at it

#

incomingMissile also triggers for unguided missiles...

#

atleast thats what its description says

tropic dawn
#

well i want the ai to keep firing flares for a few seconds after a rocket gets launched, is there a performance impact?
like if i check everytime if the "fired" weapon is a flare or something

delicate lotus
#

I think you are going to maybe create an endless loop with that

#

since you fire the event basically again

#

not sure if it is triggered by fire though

tropic dawn
#

this is going to be a pain to figure out

delicate lotus
#

not really

#

use fired, detect flare launch, setvariable to "avoid" additional flare launches until your way of launching them is done.

#

like:
If Flare Launch then:
Lock;
Launch Flares;
Sleep;
Launch Flares;
Sleep;
Launch Flares;
Sleep;
Unlock;

#

I hope you understand that

tropic dawn
#

yeah

#

thanks

#

btw do event handlers run in scheduled or unscheduled ?

#

nvm

delicate lotus
#

so you gotta spawn your code

still forum
#

@astral dawn https://discordapp.com/channels/105462288051380224/105462984087728128/526919931577761842 yes. Known for years.
The only known SQF bug.
@astral dawn It says on wiki: a = b : Return value: Nothing It REALLY helps if you actually read.
https://s.sqf.ovh/firefox_2018-12-25_14-30-27.png
Is that not big enough for you? Do I need to make it bigger? I know reading can be REALLY hard some times.
So yeah. All credit to @unreal leaf for being able to read the wiki. A skill that obviously few people here possess

tropic dawn
#

call from a function running in scheduled environment runs in a scheduled environment right?
so if i have something like _myretvalue = [] call chaos_fnc_getmyretvalue;

#

does my original function wait for chaos_fnc_getmyretvalue to return the value?

still forum
#

yes

#

call keeps the scheduled-ness

tropic dawn
#

ty

#

is it possible to addWaypoint but with ASL instead of AGL location?

still forum
#

you can use ASLtoAGL to just convert

queen cargo
#

@still forum think you are a lil bit salty today

astral dawn
#

Yes i agree that programming at night doesnt contrbute to my attention :/
Was funny to discover it on our own though

astral tendon
still forum
#

throws salt at @queen cargo

#

@astral tendon I guess you just give him a waypoint

astral tendon
#

Well, nothing about it tough

#

Were can I find the default files for those command in the game folder?

#

Or atleat make the unit call for medic?

drowsy axle
#

@still forum Did you get coal today?

still forum
#

no

astral tendon
#

Because there is one particular problem with AI not asking for healing or the leader not ordering to heal

delicate lotus
#

What would I use as a condition for both configProperties and configClasses if the condition is that the config class needs to start with 3 specific characters U_B (BLUFOR Uniforms)?

still forum
#

configName _x select [0,3] == "U_B"

#

might need some more parenthesis

delicate lotus
#

oh

#

I did not know there is something like configName...

#

well that certainly helps I guess

#

On the BIKI I can find Item Entries for CfgWeapons. Can I just do configFile >> CfgWeapons >> Items or do I need to iterate through all items and check if they inherit from the Item class or something?

still forum
#

inheritance is handled automatically

#

what are "Item Entries" though?

delicate lotus
#

ItemMap, ItemGPS, LaserDesignator, FirstAidKit

still forum
#

Ah yes

#

configFile >> "CfgWeapons" >> "ItemMap"

delicate lotus
#

And then all things like that would be the result?

still forum
#

And values that ItemMap inherits. You will see in there

delicate lotus
#

oh nice

still forum
#

Don't know what you mean? what are you trying to do?

delicate lotus
#

ehh

#

Like I want to get all Items, Vests and BLUFOR Uniforms...

still forum
#

oof

delicate lotus
#

Which I guess is quite complicated XD

still forum
#

need to check the itemType

delicate lotus
#

I can work with that. Thanks ^^

tough abyss
still forum
#

Posted on November 9, 2016

tough abyss
#

Huh?

ruby breach
#

The note saying that the returned value doesn't equal nil has existed for over 2 years

#

I added the giant exclamation mark last night to tl;dr proof it

astral dawn
#

Oh so you made it ๐Ÿ˜„ I thought, did I really want to sleep so much that didn't notice it

still forum
#

It's also VERY easy to fix. Fixing that bug is literally a one liner

#

But BI like: ยฏ_(ใƒ„)_/ยฏ

#

Not like fixing the only SQF language bug in existence would cause any problems... Everything that does that stuff will break. So not like anyone is depending on it

astral dawn
#

I spent an hour trying to find why my framework for executing functions failed. Turned out it was because I had a _nul = isNil {..code..}; in the whole function...

still forum
#

In C or almost all other languages the = operator also returns the the value that was assigned. So you can do things like A = B = 3
But SQF? Noo! We can't be normal ๐Ÿ˜„

astral tendon
#

So how to make a AI ask for medic when hut? every time a unit gets hurt twice it does not call for medic and also the leader does not order to heal again

astral dawn
tough abyss
#

Turned out it was because I had a _nul = isNil {..code..}; what is wrong with it?

#

this is legit use

#

isNil returns boolean

astral tendon
#

those actions either telerport the unit next to the other or it does some long range healing.

astral dawn
#

@astral tendon Don't know, sorry, hopefully someone can clarify.

#

@tough abyss Whole function was like:

myFnc = {
_nul = isNil {
};
};

So it was returning the result of assignment _nul=bool; which is nothing but not nil

tough abyss
#

well nothing is wrong with it either, until you try to assign function return to something

astral dawn
#

yes my framework was supposed to store the function's returned value somewhere to be later retrieved by something else, forgot to say that... if you are still interested

ruby breach
#

@rain mulch Did the bit I gave you last night work by the way? Actually tested nested findIfs this morning and it seemed like it should work

quasi rover
#

What does this mean? ["aaa", bbb] call (missionNamespace getVariable ["BARN_fnc_camera",{}]);
where, BARN_fnc_camera is a sqf file defined in cfgFunctions.
Any difference from ["aaa", bbb] call BARN_fnc_camera; ?

ruby breach
#

No difference

#

The first would just prevent errors assuming the function isn't defined for whatever reason

tough abyss
#

@quasi rover thereisa difference, one will work executed from any namespace, the other one will only work executed from mission namespace

quasi rover
#

thx guys.

tropic dawn
#

hey

#

finally managed to get my autopilot script to work the way i wanted

teal valley
#

How to give choper pilot targeting camera pod ?

delicate lotus
#

um... what?

#

AFAIK you can not just give vehicles or their drives a "targeting camera pod"

#

Thats more of an addon thing

ruby breach
languid tundra
#

@astral tendon
As Sparker proposed, you can use one of the heal actions. You will have to make the medic walk to the injured unit yourself. There is no command that will do everything automatically for you.

rain mulch
#

@ruby breach Ah yes, sorry I forgot to get back to you. Yes that bit worked perfectly, thank you!

teal valley
#

@ruby breach nice , but wasnt looking for a darter sticking to the choper to Achieve this funtion.

ruby breach
#

In which case, specificity is also your friend

peak plover
#

Anyone ever made hitmarkers like this?

peak plover
#

some sort of draw3d?

queen cargo
#

@peak plover more likely images

peak plover
#

so basically an image for every direction_

#

?

#

but I'm laaaazy

#

Are there any ways around?

verbal saddle
#

It also allows you to set the centre of rotation

peak plover
#

ooh, didn't know about this thanks

unborn ether
#

Any ideas if you can grab your current unit camera object, if its an object at all?

tough abyss
#

Not sure what youโ€™re asking

unborn ether
#

Well when you select/play a unit you watch through some camera, right? It also switches to INTERNAL, GUNNER, etc. That camera might be/should be an object.
How to grab it, is it an object?

tough abyss
#

Donโ€™t think there is an object you can grab, but you can get position and direction

unborn ether
#

pity.

tough abyss
#

Why?

#

You would probably end up getting pos and dir anyway from the object if you had one

unborn ether
#

Not the purpose. I was thinking about camera commands application.

young current
#

Cam commands are for the cameras created with them

wary vine
#

Should onMouseEnter work with RscText ?

tough abyss
#

How do you add Event Handler?

winter rose
tough abyss
#

Thanks but I was replying to the question above

winter rose
#

my bad x) I plead post-Christmas dizziness!

cedar heart
#

why short .ogg files playing twice when i use say; say3d?

tough abyss
#

one for say one for say3d?

#

But jokes aside, if you double execute, these commands will play second sample when first stopped playing

#

so if you for "_i" from 1 to 10 do {dasdasd say "asdsadas"}; this will execute instantly but queue sound and keep on playing until all 10 instances are played

earnest ore
#

... So I unpacked that Tarkov based mission to poke around and maybe get some work done on it.

Oh boy.

#
    deleteVehicle crate1; deleteVehicle crate2; deleteVehicle crate3; deleteVehicle crate4; deleteVehicle crate5;
    deleteVehicle crate6; deleteVehicle crate7; deleteVehicle crate8; deleteVehicle crate9; deleteVehicle crate10;
    deleteVehicle crate11; deleteVehicle crate12; deleteVehicle crate13; deleteVehicle crate14; deleteVehicle crate15;
    deleteVehicle crate16; deleteVehicle crate17; deleteVehicle crate18; deleteVehicle crate19; deleteVehicle crate20;
    deleteVehicle crate21; deleteVehicle crate22; deleteVehicle crate23; deleteVehicle crate24; deleteVehicle crate25;
    deleteVehicle crate26; deleteVehicle crate27; deleteVehicle crate28; deleteVehicle crate29; deleteVehicle crate30;
    deleteVehicle crate31; deleteVehicle crate32; deleteVehicle crate33; deleteVehicle crate34; deleteVehicle crate35;
    deleteVehicle crate36; deleteVehicle crate37; deleteVehicle crate38; deleteVehicle crate39; deleteVehicle crate40;
    deleteVehicle crate41; deleteVehicle crate42; deleteVehicle crate43; deleteVehicle crate44; deleteVehicle crate45;
    deleteVehicle crate46; deleteVehicle crate47; deleteVehicle crate48; deleteVehicle crate49; deleteVehicle crate50;
    deleteVehicle crate51; deleteVehicle crate52; deleteVehicle crate53; deleteVehicle crate54; deleteVehicle crate55;
    deleteVehicle crate56; deleteVehicle crate57; deleteVehicle crate58; deleteVehicle crate95; deleteVehicle crate60;
    deleteVehicle crate61; deleteVehicle crate62; deleteVehicle crate63; deleteVehicle crate64; deleteVehicle crate65;
    deleteVehicle crate66; deleteVehicle crate67; deleteVehicle crate68; deleteVehicle crate69; deleteVehicle crate70;
    deleteVehicle crate71; deleteVehicle crate72; deleteVehicle crate73; deleteVehicle crate74; deleteVehicle crate75;
    deleteVehicle crate76; deleteVehicle crate77; deleteVehicle crate78; deleteVehicle crate79; deleteVehicle crate80;
    deleteVehicle crate81; deleteVehicle crate82; deleteVehicle...```
tough abyss
#

When you get paid by the line of code ๐Ÿ˜‚

earnest ore
#

The random item generator for the crates is a switch using the variable that does the math, rather than accessing an array with select...

cedar heart
#

@tough abyss nope, just one execute but playing twice. i render this ogg file little bit longer in 1 sec and profit ๐Ÿค” . this file was less then 1 sec (~0.80) and it playing twise some kind of restriction maybe?

#

maybe it fixing at description.ext or idk

still forum
#

@earnest ore These are the people that either don't come here. or get offended when you tell them their code is shit ๐Ÿ˜„

astral dawn
#

I can only imagine if it was produced by some misused code generator.

lofty nymph
#

anyone here got any experience with RscColorPicker

#

?

winter rose
#

@cedar heart do you make a Logic say it? Or a soldier / human?

tough abyss
#

@still forum ur code is shit

#

im big boi life dev

still forum
#

k

#

you a little foggy

#

u cloud

tough abyss
#

๐Ÿ˜ญ

earnest ore
#

... We still don't have a simple and easy addWeaponCargo alt syntax that accepts the format output by weaponsItems?

cedar heart
#

@winter rose soldier

cedar heart
#

in my script.sqf which i run:
myUnit say "mysound";
myUnit - just a soldier. as i said .ogg files longer 1 sec playing well. but sound what less 1 sec unit saying twice
with playSound "mysound" sound playing once

winter rose
#

Huh, funnyโ€ฆ would have to try.
In the meantime, maybe use .wss for this one?

still forum
#

@earnest ore correct. We have something like that coming. But it doesn't use the same syntax. Different ordering of that array. I think same as in getUnitLoadout syntax

cedar heart
#

i using 2 mods, could it be for their reason?

winter rose
#

@cedar heart usually, try vanilla before reporting a bug ๐Ÿ˜‰
But it may not be due to them.

cedar heart
#

@winter rose just tried vanilla now same thing

young current
#

Add little silence after the sound so it's longer than 1sec

proud carbon
#

Hey guys. i am working on a script which will provide a parachute to a tank and slow it down once teleported behind a plane.

#

_dropVic = _this select 0;
_para = "B_Parachute_02_O";
_DropPos1 = getpos _dropVic;

    _Chute1 = createVehicle [_para, _DropPos1, [], 0, "NONE"];

_chute1 attachTo [_dropVic, [0, 0, 1]];
playSound3D [
"a3\sounds_f\weapons\Flare_Gun\flaregun_1_shoot.wss", _dropVic ];
_dropVic setvelocity [0,0,3];
_dropVicpos = getpos _dropVic;
_attitude1 = _dropVicpos select 3;
while {(alive _dropVic) && (_attitude1 > 2)} do
_dropVicpos = getpos _dropVic;
_attitude1 = _dropVicpos select 3;
sleep 1;
If (_attitude1 > 2) Then {_dropVic setvelocity [0,0,0];};

#

this is what i have.

spice axle
#

@proud carbon you can do it quiet more easy

proud carbon
#

yeah I know. its the not know how though

spice axle
#

params ["_plane", "_tank"];
_tank setPos (getPos _plane);

#

if you experience some explosions you have to either stop allowing damage for these objects or add a space between tank and plane

proud carbon
#

i already have the drop system working. it just the parachuting

#

if (isServer) then {
Sleep 1.3;
tankPos1 = getpos TankThrower;
Sleep 0.2;
tank1 hideObjectGlobal false;
tank1 setPos [(tankPos1 select 0),(tankPos1 select 1),145];
[tank1] execvm "Killchute.sqf";
Sleep 3;
tankPos2 = getpos TankThrower;
Sleep 0.2;
tank2 hideObjectGlobal false;
tank2 setPos [(tankPos2 select 0),(tankPos2 select 1),145];
[tank2] execvm "Killchute.sqf";
Sleep 4.2;
tankPos3 = getpos TankThrower;
Sleep 0.2;
tank3 hideObjectGlobal false;
tank3 setPos [(tankPos3 select 0),(tankPos3 select 1),145];
[tank3] execvm "Killchute.sqf";
};

still forum
#

```sqf
<code>
```
for proper highlight

proud carbon
#

this works fine its the Killchute.sqf aka the code i posted earlier that I'm having an issue.

still forum
#

What is the issue you have with that. you didn't tell us that yet

#

Can't fix something when we don't know what's wrong

proud carbon
#

oh yeah that would help lol.

#

well the problem is it keeps telling me _attitude1 |*|= (getpos _dropVic) select 3;

still forum
#

position array only has 3 elements

proud carbon
#

Got this time haha

still forum
#

you are trying to retrieve the 4th

#

no you didn't

#

you are missing the sqf part

spice axle
#
_attitude1 |*|= (getpos _dropVic) select 2; 
#

do it like this

still forum
#

Also you didn't give us the error message

#

that's the position of the error. But not the error

proud carbon
#

so like sqf kAJFNBkjasnbh = what ?

still forum
#

No. Exactly like I posted

spice axle
#

๐Ÿ˜„

proud carbon
#

so the code goes into the <>?

still forum
#

No

proud carbon
#

so confused right now.

still forum
proud carbon
#
if (isServer) then { 
Sleep 1.3;
tankPos1 = getpos TankThrower;
Sleep 0.2;
tank1 hideObjectGlobal false; 
tank1 setPos [(tankPos1 select 0),(tankPos1 select 1),145];
[tank1] execvm "Killchute.sqf";
Sleep 3;
tankPos2 = getpos TankThrower;
Sleep 0.2;
tank2 hideObjectGlobal false; 
tank2 setPos [(tankPos2 select 0),(tankPos2 select 1),145];
[tank2] execvm "Killchute.sqf";
Sleep 4.2;
tankPos3 = getpos TankThrower;
Sleep 0.2;
tank3 hideObjectGlobal false; 
tank3 setPos [(tankPos3 select 0),(tankPos3 select 1),145];
[tank3] execvm "Killchute.sqf";
};
hollow thistle
#

๐Ÿคฆ

still forum
#

๐Ÿคฆ

#

wow

proud carbon
#

Im new to this lol

still forum
#

It's not really that hard

spice axle
#

it is not that heavy

still forum
#

Just literally do it exactly as I did ๐Ÿ˜„

#

I told you to do
```sqf
<code>
```

And you did
```
sqf
<code>
```

See the difference?

proud carbon
#

yeah i got it now.

#

no space for the sqf

spice axle
#

now you can ask again and tell us your problem and write the full error

still forum
#

Well we already solved the last problem

#

So what's the next ^^

proud carbon
#
if (isServer) then { 
Sleep 1.3;
tankPos1 = getpos TankThrower;
Sleep 0.2;
tank1 hideObjectGlobal false; 
tank1 setPos [(tankPos1 select 0),(tankPos1 select 1),145];
[tank1] execvm "Killchute.sqf";
Sleep 3;
tankPos2 = getpos TankThrower;
Sleep 0.2;
tank2 hideObjectGlobal false; 
tank2 setPos [(tankPos2 select 0),(tankPos2 select 1),145];
[tank2] execvm "Killchute.sqf";
Sleep 4.2;
tankPos3 = getpos TankThrower;
Sleep 0.2;
tank3 hideObjectGlobal false; 
tank3 setPos [(tankPos3 select 0),(tankPos3 select 1),145];
[tank3] execvm "Killchute.sqf";
};
``` This works 
```sqf
_dropVic = _this select 0;
_para = "B_Parachute_02_O";
        _DropPos1 = getpos _dropVic;

        _Chute1 = createVehicle [_para, _DropPos1, [], 0, "NONE"];

_chute1 attachTo [_dropVic, [0, 0, 1]];
            playSound3D [ 
                "a3\sounds_f\weapons\Flare_Gun\flaregun_1_shoot.wss", _dropVic ];
_dropVic setvelocity [0,0,3];

while {(alive _dropVic) && (getpos _dropVic select 2 > 2)} do 
_dropVicpos = getpos _dropVic;
_attitude1 = _dropVicpos select 2;
hint format ["%1", _attitude1];
sleep 1; 
If (_attitude1 > 2) Then {_dropVic setvelocity [0,0,0];};
``` this isn't.
it says line 13 is the issue. now
still forum
#

what issue

#

what's the error message?

#

while {(alive _dropVic) && (getpos _dropVic select 2 > 2)} do

#

uh

#

okey there is the problem

#

what are you trying to do with that

#

you are trying to do nothing while condition?

proud carbon
#

_dropVic = _this select 0;
_para = "B_Parachute_02_O";
        _DropPos1 = getpos _dropVic;

        _Chute1 = createVehicle [_para, _DropPos1, [], 0, "NONE"];

_chute1 attachTo [_dropVic, [0, 0, 1]];
            playSound3D [ 
                "a3\sounds_f\weapons\Flare_Gun\flaregun_1_shoot.wss", _dropVic ];
_dropVic setvelocity [0,0,3];

while {(alive _dropVic) && (getpos _dropVic select 2 > 2)} do 
_dropVicpos |*|= getpos _dropVic;
_attitude1 = _dropVicpos select 2;
hint format ["%1", _attitude1];
sleep 1; 
If (_attitude1 > 2) Then {_dropVic setvelocity [0,0,0];};
spice axle
#

๐Ÿ™‡

still forum
#

Don't need to repost that

#

I told you what the error is

#

Hint: It's not where the error message says it is

proud carbon
#

oh didn't see the part while typing.

spice axle
#
while {(alive _dropVic) && (getpos _dropVic select 2 > 2)} do {
_dropVicpos |*|= getpos _dropVic;
_attitude1 = _dropVicpos select 2;
hint format ["%1", _attitude1];
sleep 1;
};

Would be right

still forum
#

that code doesn't make sense tho

#

it does nothing besides logging

spice axle
#

but would fix his issue

still forum
#

And he only added the logging after he got the problem

#

That would make the error go away

#

not fix the issue properly

#

Also your code will still error out

#

syntax error

#

The question is. What @proud carbon wants to do with that while loop there

proud carbon
#

i just want it to check if the _dropVIc is above 2 metres in air and kill the parachutes when it's below that

#

and setvelocity [0,0,0]

still forum
#

So you want to do nothing while that condition

proud carbon
#

can one of you fellas explain what setvelocity does?

still forum
#

If (_attitude1 > 2) Then {_dropVic setvelocity [0,0,0];}; That code doesn't make sense then. If you wait till it's below 2 then the check if it's above 2 will never be true

#

setVelocity set's the velocity of the object...

proud carbon
#

no i want to check the attitudeof the vic

#

what?

#

oh wait i see what you mean now

still forum
#
params ["_dropVic"];
_DropPos1 = getpos _dropVic;
_Chute1 = createVehicle ["B_Parachute_02_O", _DropPos1, [], 0, "NONE"];

_Chute1 attachTo [_dropVic, [0, 0, 1]];
playSound3D [ "a3\sounds_f\weapons\Flare_Gun\flaregun_1_shoot.wss", _dropVic ];
_dropVic setvelocity [0,0,3];

waitUntil {!(alive _dropVic) || (getpos _dropVic select 2 < 2)};
_dropVic setvelocity [0,0,0];
#

Btw you should choose whether to start variables with uppercase or lowercase letter or whether you write the command names correctly or all lowercase..
Don't mix and match

proud carbon
#

ok that works but doesn't slow the vic's downward speed.

still forum
#

Once it's below 2 meters it stops it.

proud carbon
#

Yeah that's a bad habit on my part.

still forum
#

but that's scheduled code

spice axle
#

if the waitUntil exit with the event that _dropVic isn't alive anymore, is setting the velocity of a "dead" object a error too?

still forum
#

the waitUntil might only be evaluated every couple seconds or even minutes

#

So if you find out "hey! it's below 2 meters" 20 seconds after it happened... It has already slammed into the ground

#

No. setVelocity on a dead object is valid

#

moves the wreck then

spice axle
#

ah ok

proud carbon
#

it mostly works. It just doesn't spawn in a parachute though.

#

No error message is great though. ๐Ÿ˜ƒ

still forum
#

Well the createVehicle code is there

#

ยฏ_(ใƒ„)_/ยฏ

#

Also you attach the parachute to the vehicle

#

You probably want to attach the vehicle to the parachute instead

proud carbon
#

so that would be swapping Chute1 into _dropVic position?

still forum
#

swapping the attachTo around

proud carbon
#

so this _dropVic attachTo [_Chute1, [0, 0, 1]];

#

every time i call it on my tank but it doesn't work.

#

does it have to be a newly spawned vic?

still forum
#

does it have to be a newly spawned vic?

#

no

#

that code is almost 5 years old now.. And quite crusty compared to todays standards

proud carbon
#

oh ok

still forum
#

But

proud carbon
#

its a cool looking effect though.

still forum
#

you have B_Parachute_02_O And the code on that page says B_Parachute_02_F

#

Where did you get that B_Parachute_02_O from? 0 results on google

proud carbon
#

friend sent me it.

still forum
#

Punch that friend

#

it's wrong

proud carbon
#

Now the parachutes show up.

#

it works so fucking good now. Thanks guys

mint kraken
#

So I am overriding some escape menu buttons, and on of them I want it to open a link but I can find any command to do it, I am pretty sure its possible in the dialog class. Any ideas?

still forum
#

you can make a structured text with a link that will be opened when clicked on

mint kraken
#

Oh yeah! Thanks

mint kraken
#

I am getting this, but I am not sure why? I have seen this code work a few times on other stuff.

2:34:09 Suspending not allowed in this context
 2:34:09 Error in expression <vpknlmstpsnonwnondnon";
};


waitUntil {!isNil "Test_result"};


private >
 2:34:09   Error position: <!isNil "Test_result"};


private >
 2:34:09   Error Generic error in expression
 2:34:09 File core\utility\fn_test.sqf [Test_fnc_test], line 40
still forum
#

Suspending not allowed in this context

#

you cannot suspend in unscheduled

#

unscheduled scripts freeze the game and everything else until they are done

#

so sleeping or waiting on there doesn't make sense.

mint kraken
#

Not sure how to fix this... Should I do spawn instead of call?

still forum
#

ye

silent pewter
#

Does anyone here know how to create tables? Possibly also work on framework?

still forum
#

@silent pewter re-read #rules please. And then you might wanna fix that violation. Maybe.

mortal nacelle
#
_counter = 10;
_randomSerialSelect = selectrandom["A","B","C","D",1,2,3];
_CountedSerial = _randomSerialSelect;

while {_counter > 1} do {
    _counter = _counter - 1;
    sleep 1;
};
hint format ["Counter: %1",_counter];
#

Why does this not like the sleep command

#

Nevermind, I know now.

#

I didn't spawn it

still forum
#

Maybe same as the last issue we talked about in here ๐Ÿ˜„

#

also use private keyword instead of the array variant

mortal nacelle
#

Yeah i'm trying to get it so that it selects 7 random letters/integers and then hints them as a serial number e.g. 123AS21

#

Just uh, clueless ๐Ÿค”

tough abyss
#

["","","","","","",""] apply {selectRandom ["A","B","C","D","1","2","3"]} joinString ""

#

no need for spawning or sleeping, why on earth you want to use sleep?

mortal nacelle
#

I was trying to make a countdown timer, i'm new..

#

Lol

#

Thanks for that by the way. I wish I knew how to do it that fast ๐Ÿ˜‚

tough abyss
#

Countdown to 7 letter serial number?

mortal nacelle
#

I'm retarded..

#

In all seriousness, I'm copy and pasting into the debug console.

#

Not actually running it as a script (whole)

unreal leaf
#

How do you make an ai shoot a civ/captive that is standing still? I dont want to use setcaptive false or addrating -999, because that would break the rest of the mission.

ai doTarget player;
ai dofire player;

With the code above the ai is aiming in the right direction but not exactly(after a few secs they start rotation in circles non stop). The ai only shoot if you start moving a little bit(might be because ai doesn't care about you because you are on a friendly side). I also tried forceFire but for that i need to make some more complicated checks so it wont spree all over the place. I want to use this in some undercover script.
i just need some simple code which is reliable to work(I know that might be impossible).

west venture
#

JoinSilent?

tough abyss
#

what about ai reveal [player,4]; ai lookAt unitAimPosition player; ai doTarget player;

rigid idol
#

hey all, I'm trying to setup something to create the unit of the same type that just died in a different location using a trigger, though I'm incredibly new at this to the point that I'm still going through most of the wiki for information.

#

and is repeatable

#

any ideas?

fickle quiver
#

hello

#

how can i align a text on a dialog?

#

align centre i mean

tough abyss
fickle quiver
#

i know, thank you

#

but where should i set it?

#

i mean, how

tough abyss
#

I don't understand

fickle quiver
#

i mean, 4 example

#

class textolistavehiculos: RscText
{
idc = -1;
text = "Lista de Vehiculos:";
x = 0.324687 * safezoneW + safezoneX;
y = 0.291 * safezoneH + safezoneY;
w = 0.226875 * safezoneW;
h = 0.033 * safezoneH;
};

#

where should i set it

tough abyss
#

style = 2;

fickle quiver
#

thank you so much dude!

tough abyss
#

@rigid idol you dont need trigger for that. Use event handler "EntityKilled"
addMissionEventHandler ["EntityKilled", {group (_this select 0) createUnit [typeOf (_this select 0), NEWPOSITION, [], 0, "NONE"]}];

rigid idol
#

okay, I'll give that a quick try once I get back in a few.

rigid idol
#

@tough abyss sorry to ask, but like I said I'm fairly new and I'm not sure how to even add an eventhandler

static helm
#

Hi all, Im trying to use the BIS_fnc_EXP_camp_IFF function in a multiplayer scenario. Problem is, I call the function in the init.sqf but it doesn't work for players that JIP, or when the unit respawns. Im pretty new to scripting, so I dont know what to do to get it to work past the init.sqf. Any help would be appreciated!

trail hinge
#

hey

#

can y'all help me figure out how to change a player's score and side (-2000 and opfor respectively) when they pull a weapon out? best would be if i could make it work if players pull a handgun from being hidden with the ACE 3 holster function. tryna make some responsive cop units in a round-robin assassination game

#

@ me please

still forum
#

CBA has a weapon changed eventhandler

devout stag
#

@trail hinge

round scroll
#

anyone aware of changes in the support provider/requester framework? The code in Unsung stopped working, it's basically this:

#
center = createCenter sideLogic;
logicGroup = createGroup center;
requester = logicGroup createUnit ['SupportRequester', getpos player, [], 0, 'FORM'];
systemChat str requester;

pos = player getPos [2000, floor (random 360)];
provider = logicGroup createUnit ["SupportProvider_Virtual_Transport", pos, [], 0, 'FORM'];
systemChat str provider;

[requester, 'Drop', 1] call BIS_fnc_limitSupport;
[requester, 'CAS_Bombing', 1] call BIS_fnc_limitSupport;
[requester, 'CAS_Heli', 1] call BIS_fnc_limitSupport;
[requester, 'Transport', 1] call BIS_fnc_limitSupport;

[player, requester, provider] call BIS_fnc_addSupportLink;
#

somehow requester does not seem to work

ruby breach
#

Also, untagged global variables are a bad practice.

round scroll
#

it's for the debugger, the code, the real code uses private variables

vapid drift
#

Ok, new question... is it possible to spawn in a hide terrain module and have the same effect as placing one down in the editor?

astral dawn
#

@vapid drift hideObjectGlobal cursorObject; ??

#

So you mean hiding objects at mission run time, right? Then use the above code ^ but you will also have to find objects close to a certain point with commands like nearObjects, not sure which one you need exactly

vapid drift
#

Yeah I guess I'm trying to cheat a little

#

I have random mission start points that center around a crashed blackhawk

#

I load in a custom composition at the spawn points... when I can place down the hide terrain objects module, I can easily make a nice "flight path" for the blackhawk

#

I was hoping there was an easy way to replicate that

astral dawn
#

What do you mean 'flight path'?

ruby breach
vapid drift
#

where the blackhawk would have crashed through trees and what not

#

@ruby breach oh ok, thanks. With the function name I should be able to figure out if it has any parameters or not

#

I suppose for that matter, if I have to, I can just reverse engineer the module itself

tough abyss
#

Wouldnโ€™t a helicopter just spin down rather that create a โ€œfly pathโ€?

astral dawn
#

I would setDammage on trees to 1 to make them fall down TBH and hide all stones and other indestructable things

#

I think a heli would autorotate, and when you autorotate you have some horizontal velocity until the end when you 'pull up' the collective and lose your horizontal V to 'hover' a bit

vapid drift
#

@tough abyss when a helo goes down it doesn't lose all forward momentum

astral dawn
#

Therefore if you crashland a heli and everyone survives, it must have had some horizontal velocity ๐Ÿ˜„

peak plover
#

@unreal leaf

#


                private _pad = _unit getVariable ['unit_suppress_pad',objNull];
                if (isNull _pad) then {
                    _pad = 'Land_HelipadEmpty_F' createVehicleLocal [0,0,0];
                    _unit setVariable ['unit_suppress_pad',_pad];
                };
                _pad setposATL _pos;
                _unit doTarget _pad;

and then a per frame handler with


                private _weaponState = weaponState _unit;

                _unit forceWeaponFire [_weaponState # 1,  _weaponState # 2];
#

_unit is the unit that shoots the gun

#

_pos is the position of the unit

astral dawn
#

So I've spent some time writing a reentrant(recursive) mutex for SQF. Is it a valid one or it still has a chance to fail?

// Creates a new mutex
#define MUTEX_NEW() [scriptNull, 0]

// Locks the mutex
#define MUTEX_LOCK(mutex) waitUntil { \
    isNil { \
        private _s = (mutex select 0); \
        if( (_s isEqualTo _thisScript) || (_s isEqualTo scriptNull) ) then { \
            mutex set [0, _thisScript]; \
            mutex set [1, (mutex select 1) + 1]; \
            nil \
        } else { \
            0 \
        }; \
    }; \
};

// Unlocks the mutex
#define MUTEX_UNLOCK(mutex) isNil { \
    mutex params ["_hScript", "_lockCount"]; \
    if (_hScript isEqualTo _thisScript) then { \
        if (_lockCount == 1) then { \
            mutex set [0, scriptNull]; \
            mutex set [1, 0]; \
        } else { \
            mutex set [1, (mutex select 1) - 1]; \
        }; \
    } else { \
        diag_log format ["ERROR: error unlocking mutex %1", mutex]; \
    }; \
};
peak plover
#

What is this for?

#

Also this will only work in a scheduled script

peak plover
#

CBA already does this 'tho

#

Well kind of

nocturne basalt
#

hi guys. are there functions for getting the rpm on a landvehicle?

#

I can only find them for aircraft

#

Id like to avoid animating something using rpm animationSource and extracting its anim value if possible

fickle quiver
#

private _cuantoCuesta = parseNumber (ctrlText _precioveh);

#

is it correct?

still forum
#

Well it doesn't look wrong

#

but cannot say if it's correct without the rest of the code

astral dawn
#

@peak plover Yes, it would make one scheduled script wait until the other one unlocks mutex for some common shared resource. Then recursive mutex, unlike a simple mutex, allows a thread to lock it multiple times to avoid deadlocks.
Should be working, i've tested it. Just wanted to make sure i didn't screw up somewhere.

peak plover
#

@fickle quiver variable names should

#

be in english

fickle quiver
#

thanks you all

peak plover
#

No problem

velvet merlin
#

can one do bitwise shift operations in arma by some custom functions setup?

still forum
#

numbers are floats

#

so that wouldn't make much sense

#

There are shift functions from BI.. No idea what they really do though

#

Maybe convert to array of numbers as "binary" and then use deleteAt to shift around or smth

velvet merlin
#

BI only has:
p:\a3\functions_f\bitwise\fn_bitwiseand.sqf
p:\a3\functions_f\bitwise\fn_bitwisenot.sqf
p:\a3\functions_f\bitwise\fn_bitwiseor.sqf
p:\a3\functions_f\bitwise\fn_bitwisexor.sqf

still forum
#

yeah. These are the ones I meant. I'll take a look

#

Eww.... ugly

velvet merlin
#

trying to re-implement BI randomGen used for clutter..

still forum
#

what shifts do you need?

#

left is easier than right

#

Split the number into array of 32 elements. Each one is either 0 or 1. might use booleans for that.
Then for shiftL just deleteAt index 0 as many bits as you wanna shift.
Then when converting back use for index loop with param on the array. And use false as default value for param.
And put the number back together using that

#

Though not sure if you can replicate it accurately. BI probably uses 32bit integers. You only have floats

#

Do the random sqf commands not work?

#

They use the same backend

#

Don't you use a extension for that mod yet?

velvet merlin
#

yeah i am considering it but lets see

tough abyss
#

@nocturne basalt try sound controllers

#

BI probably uses 32bit integers Or even 24bit

still forum
#

nope

#

32bit

nocturne basalt
#

@tough abyss wow thanks. Would never have thought a method called soundController could give me rpm ๐Ÿ˜„

queen cargo
#

@still forum should be possible to replicate even with using floats
though ... not recommended as getting whatever number into binary format in SQF is potentially horrible extremly damn fucking slow

#
2 = 2 %/ 2 => (0, 1)
1 = 1 %/ 1 => (1, 0)

1 0 1```
#

is the basic math

#
params ["_value"];
private _arr = [];
while { _value != 0 } do {
    private _tmp = _value mod 2;
    _arr pushBack _tmp;
    _value = floor (_value / 2);
};
reverse _arr;
_arr
#

method works

#

tested using SQF-VM ๐Ÿ˜›

#
@SQF [10] call fnc_getBits
SQFBOTToday at 7:53 PM
[WORK]    <ARRAY>    [1,0,1,0]
[WORK]    <NOTHING>    nil```
#

the rest should be simple ๐Ÿคท

still forum
#

You just said what I already said before. Still. We only have floats

#

You cannot get full int32 range represented in a float

queen cargo
#

true ๐Ÿคท

#

one could provide a big int implementation ๐Ÿค”

nocturne basalt
#

@tough abyss it worked but I cant use it it seems. Im trying to detect if my vehicle is giving full throttle but standing still (like when you are driving into some obstacle that blocks your path while standing on the pedal). its only showing me the rpm once I gain some speed

queen cargo
nocturne basalt
#

@tough abyss any suggestion how I can detect that?

still forum
#

@queen cargo so what? 2147483647 cannot be stored in a float

queen cargo
#

should have read the part fully ๐Ÿ™„ anyways, thing is: bigint would still be an option

#

((the actual info i wanted to communicate with that is: there ya go with maximum value of float, not compare it to int32 directly ... but did not read that it states the 32bit int size too there))

tropic dawn
#

does anyone know how to get the flare count in planes and helicopters?

tough abyss
#

@nocturne basalt probably a bug, same happens with RPM gauge on the Prowler, it doesn't move if you are not moving. You can try "thrust" that changes from 0 to 1 when you rev the engine even if you are not moving

#

flares per magazine x number of magazines @tropic dawn

tropic dawn
#

i mean i can get the total amount from here magazinesAllTurrets but is it possible to check if the vehicle has flares first

#

otherwise i need to compare the magazine class name to all the flare classes

tough abyss
#

Check if it has"CMFlareLauncher"

tropic dawn
#

doesn't it change if you switch the mode though?

#

like single, burst and whatever the other one is

tough abyss
#

what change?

tropic dawn
#

the class

tough abyss
#

it is a weapon it doesnt change unless you remove it

nocturne basalt
#

@tough abyss thanks^^ thrust gives me exactly what Im looking for

#

@tough abyss one thing. when Im standing still its gives me values like these:
3.11409e-038

#

shouldnt it be lower than 1 when engine is idle?

tough abyss
#

thats basically 0

nocturne basalt
#

ohh I c now.

#

(pi/100000) toFixed 10; //"0.0000314159" - no scientific notation

tough abyss
#

it is something like 0.00000000000000000000000000000000311409

nocturne basalt
#

but when testing on that value, I need to format it first right?

tough abyss
#

testing ?

nocturne basalt
#

I have a script that will check if the speed is 0 and thrust is more than zero

#

so in order to have an if test on the thrust value, will it understand 3.11409e-038 to be lower than 0?

tough abyss
#

no it is > 0 but by very little, it is extremely small value just above 0

#

you can round to your desired precision or compare it against threshold like 0.00001

#

if it is >= it is not zero

#

otherwise could well be zero

nocturne basalt
#

I c. bigger than 0.1 is ok

#

thanks for your help

delicate lotus
#

Is it possible to use doSuppressiveFire to make the AI just aim at a specific pos?
Possible with Combat Mode BLUE since that forces hold fire?

frigid raven
#

Hey Buds,

I am using https://cbateam.github.io/CBA_A3/docs/files/xeh/fnc_addClassEventHandler-sqf.html to listen to an event when a Man NPC is killed.

["CAManBase", "killed", {
      call coopr_fnc_onKilled;
 }] call CBA_fnc_addClassEventHandler;

This event is registered on my server side. When I am on my dedicated server and spawn an enemy via zeus and eliminate it this event is not triggered. I kind of thought the death of an npcs will be broadcasted globally? Is the problem here maybe that the NPC unit was not spawned by the server but by me through zeus?
If yes - can anybody tell me how to actually get this to work also with spawned hostiles from the clientside? Because I have to test stuff out adhoc and zeus is kinda perfect for that.

PS: All worked in preview

astral tendon
#

this is local or public?

peak plover
#

unit spawned with zeus is local to the player which spawned him @frigid raven

#

maybe killed EH only runs where the unit is local

frigid raven
#

Yea ur right

tropic dawn
#

@tough abyss i tried what you said about the flares

#

but different vehicles have the different flare launchers

tough abyss
#

@astral tendon it calls BIS_fnc_setTask which is global by default

#

For example? @tropic dawn

tropic dawn
#

dw, i just did _flares = ("CMFlareLauncher" in _PilotWeapons) || ("CMFlareLauncher_Singles" in _PilotWeapons) || ("CMFlareLauncher_Triples" in _PilotWeapons);

#

can't be bothered to find anything better

tough abyss
#

@tropic dawn those are still the same flare launcher class CMFlareLauncher_Singles: CMFlareLauncher {...

#

use isKindOf "CMFlareLauncher"

tropic dawn
#

yeah but im going have to go through the array returned by _PilotWeapons = vehicle player weaponsTurret [-1];

#

don't know which one is better for performance since im doing this inside a loop

tough abyss
#

I'd do it like this _hasFlareLauncher = _PilotWeapons findIf {_x isKindOf ["CMFlareLauncher", configFile >> "CfgWeapons"]} > -1; but if you have all known vehicles you can just hardcode it

tropic dawn
#

wow thanks, didnt know there was a findIf

delicate totem
#

I can't find it, but I could swear there is a command to add items to a unit that doesn't respect weight limits, any ideas? addItem will fail when the unit doesn't have space for an item. I'm looking to guarantee the unit gets the item even if they're already at capacity.

still forum
#

try the cargo commands on the container directly

delicate totem
#

Legend, (backpackContainer player) addItemCargoGlobal ["ACE_bloodIV", 30]; worked great. Thanks.

drowsy oak
#

I'm having problems getting an agent to look in the right direction. When I try it in simulator and test with local execute or server execute, everything is fine. However when i run the server, the agent is always looking the wrong way. The only difference on the server is that I'm passing the agent to a headless client after spawning him. Anyone have experience with this?

winter rose
#

@drowsy oak try remoteExec with the agent as locality parametre, this should do

tropic dawn
#

anyone know what the base class for 60Rnd_CMFlareMagazine and 60Rnd_CMFlare_Chaff_Magazine

#

?

astral dawn
#

What am I doing wrong? East soldiers can do the code below with civilians but nor with WEST which are captive? It doesn't even work with captive civilians.
The unit doesn't target at the unit and doesn't fire at him.

_unit = sol1;
_unit reveal [player, 4];
_unit doTarget player;

_unit doFire player;
tough abyss
#

@tropic dawn type utils 2 in debug console, exec. Type magazine type, uncheck classes only, it should show what class it is derived from

tropic dawn
#

ok thank you

drowsy oak
#

@winter rose remotexecute from server to HC on setdir?

drowsy oak
#

@winter rose As I thought about why that would work, I came up with another solution. I put in a 5 seconds pause before moving the agent to the HC. Apparently that gives it enough time for setDir and everything on the server to take effect before the agent is moved to the HC.

spring vigil
#

I saw this in the ip channel

if (isClass(configFile>>"CfgPatches">>"mod i want to block"))then{
endMission "END2";}; ```

could i block multiple mods using this 

if (isClass(configFile>>"CfgPatches">>"mod1","mod2","mod3"))then{
endMission "END2";};```

still forum
#

no

#

you can't just plug commas somewhere and expect it to work ^^

spring vigil
#

so basically in if statement per mod correct?

still forum
#

ye

#

or &&

spring vigil
#

ok that's easy so "mod1"&&"mod2" ect

still forum
#

no...

#

&& takes booleans

#

not strings

#

the whole condition

spring vigil
#

I understand how to use booleans to create a loop that count and exit, but in this context im lost. is this the right concept ?sqf if ((isClass(configFile>>"CfgPatches">>"mod i want to block") &&(isClass(configFile>>"CfgPatches">>"mod i want to block2"))then{ endMission "END2";};

still forum
#

yep

spring vigil
#

whats the or operator again

still forum
#

or

#

but || is preferred

spring vigil
#

thanks thats what i was looking for

languid tundra
ruby breach
#
(["mod1",",mod2","mod3"] apply {isClass(configFile>>"CfgPatches">>_x)} findIf {_x} > -1) // returns true if any mods listed in array are found
``` @spring vigil
spring vigil
#

making an array was going to be a later question thanks .

#

is there a way to see what mods the clients have loaded ?

lean slate
#

Can anyone give me a hand, I'm trying to make a custom warlords mission, I'm building the description.ext file but when I push into test, I get this error.

`
ยด...tFinal = 0;
_cnt = 0;

while {_funds >= I#I_cost && _cnt < (4 - count units _this)]...ยด
Error Not identified Variable in Expression: _cost
`
Anyone able to help?

vapid drift
#

Is it possible to have objects match the terrain slope when using setPosATL?

still forum
#

is there a way to see what mods the clients have loaded configClasses command. Combined with the knowledge where all mods have to make a config entry. Which you already have

frozen knoll
#

@vapid drift you can use setVectorDirAndUp after you setPosATL

languid tundra
#

and surfaceNormal

vapid drift
#

@frozen knoll Ok, that'll get me started

frozen knoll
#

yeh certainly many ways to go about it just depends what information you have first to work with

round scroll
#

@languid tundra thanks, that was it

vapid drift
#

@frozen knoll is there a way to get the vector of the terrain at a given location or are we talking about more work than it's really worth

#

well I see BIS_fnc_terrainGradAngle... I guess that would do it

languid tundra
#

@vapid drift
surfaceNormal was meant for you ๐Ÿ˜„

vapid drift
#

lol my bad

#

@frozen knoll @languid tundra Thanks guys, much appreciated

wary vine
#

seems to be ctrlTextHeight handles numbers / letters differently.

#

any idea if this is the case ? through some testing, i came up with some sort of work around, but not ideal

tough abyss
#

@ruby breach you can do without apply tbh

nimble echo
#

how do you give all AI unit unlimited magzines or ammo? in a particular zone m trying to create a trigger so if any AI group is in that trigger zone they will have unlimited ammo or magazine
m playing some ai vs ai battle siege and defenders loose all ammos and they cant go re arm and they are garrisoned
so i created a trigger but i dont know what script should i use to trigger this change

peak plover
#

inarea

#

time

#

setvariable

#

sth sth

#

@nimble echo

tough abyss
solemn aspen
#

@spring vigil I don't think there is a way to see what mods the clients have loaded but generally we use the keys or we can whitelist things server side that are allowed.

#

@astral dawn 2 things I have learned in here that will get you helped quicker than anything else:

  1. What is the entire code you are using?
  2. What is the context of what you are attempting to achieve with your question?

With that said I am going to add a third question in; what game mode are you doing this in?

ruby breach
#

@tough abyss Shhh, itโ€™s no fun if you give away all the answers. Besides, findIf {_x} looks hilarious (and should be its own hint that thereโ€™s a slightly better way to write whatever itโ€™s in)

still forum
#

findIf {_x} ๐Ÿค” find true ?

#

or just replace the apply by findIf?

waxen tendon
#

i want to specify the target of a seek and destroy wp by command

#

i could not find any setWaypoint... command for it, how do i do it?

young current
#

seek and destroy means the AI just goes hunting around

#

unless the target can be synced to it for example

devout stag
#

If anyone here is familiar with ACRE here I am in need to some assistance.

#
11:31:31 [ACRE] (api) WARNING: Vehicle accVic is not initialised. Rack is not being added. idi\acre\addons\api\fnc_addRackToVehicle.sqf:56
11:31:31 [ACRE] (api) WARNING: Vehicle accVic is not initialised. Rack is not being added. idi\acre\addons\api\fnc_addRackToVehicle.sqf:56
#

Sample mission is the acre_addrack code implemented into an actual mission

#

I'm not sure how to solve this issue as the vehicle should have the radio's initialized by the fnc_AddRackToVehicle command according to the ACRE documentation

#
//acre2/addons/api/fnc_addRackToVehicle.sqf
#include "script_component.hpp"
/*
 * Author: ACRE2Team
 * Initialises all racks in the vehicle. Must be executed in the server. If no condition is specified,
 * the radio will be configured to match the vehicle preset defined using acre_api_fnc_setVehicleRacksPreset
 * or the preset of the first player that matches the given condition if the vehicle preset is not defined.
 *
 * Continued...
#

But if I set my calls to force initialization, ```SQF
//...

  • ...
  • 2: Force initialisation <BOOL> (default: false)
    //...
#

I get these errors:

#
11:43:03 [ACRE] (api) WARNING: No unit found for condition {} defaulting to first player idi\acre\addons\api\fnc_initVehicleRacks.sqf:56
11:43:03 [ACRE] (api) WARNING: Vehicle accVic is already initialised but function forces it to initialise again idi\acre\addons\api\fnc_addRackToVehicle.sqf:64
11:43:03 [ACRE] (api) WARNING: Vehicle accVic is already initialised but function forces it to initialise again idi\acre\addons\api\fnc_addRackToVehicle.sqf:64
11:43:03 [ACRE] (api) WARNING: Vehicle accVic is already initialised but function forces it to initialise again idi\acre\addons\api\fnc_addRackToVehicle.sqf:64
11:43:03 [ACRE] (api) WARNING: Vehicle accVic is already initialised but function forces it to initialise again idi\acre\addons\api\fnc_addRackToVehicle.sqf:64
11:43:03 [ACRE] (api) WARNING: Vehicle accVic is already initialised but function forces it to initialise again idi\acre\addons\api\fnc_addRackToVehicle.sqf:64
11:43:03 [ACRE] (api) WARNING: Vehicle accVic is already initialised but function forces it to initialise again idi\acre\addons\api\fnc_addRackToVehicle.sqf:64
11:43:03 [ACRE] (api) WARNING: No unit found for condition {} defaulting to first player idi\acre\addons\api\fnc_addRackToVehicle.sqf:124
velvet merlin
#

possible to create clutter models with createSimpleObject?

#

say a3\plants_f\clutter\c_grass_brushhigh_green.p3d

devout stag
#

Directly from a raw model to a simple object?

#

I believe it should be possible

#

(With textures of course)

velvet merlin
#

yep. it seems to create it but its not visible

devout stag
#

Locality issue?

velvet merlin
#

seems just a height offset problem

#

needs z + 5

tough abyss
#

depends on what position format, with posWorld you only need +0.5

#

quite nice piece of grass actually

#

_clutter attachto [player, [0,0,0], "head"] lol

frigid raven
#

I have a hard time to get extDB3 to run. The extension is loaded fine but my mysql connection does not work.
This is my MySQL setup via XAMPP (phpMyAdmin):

Username: coopr
Password: coopr
Host: 127.0.0.1
All Privileges
GRANT: yes

And this here is the content of extdb3-conf.ini:

[Database]
IP = 127.0.0.1
Port = 3306
Username = coopr
Password = coopr
Database = coopr_local

I am executing the following SQL snippet to test the db-connection (source: https://bitbucket.org/torndeco/extdb3/src/f1a08ecf20c7de0d1b043b600da9eb3c3d0b0f9a/sqf_examples/sqf/init_sql_example.sqf?at=default&fileviewer=file-view-default):

 // extDB3 Version Check
    private _result = "extDB3" callExtension "9:VERSION";
    diag_log format ["extDB3: Version: %1", _result];
    if (_result == "") exitWith {diag_log "extDB3: Failed to Load Extension"; false};
    if ((parseNumber _result) < 1.026) exitWith {diag_log "Error: extDB3 version 1.026 or Higher Required";};

    // extDB3 Load Protocol
    private _database = "coopr_local"; // This is case sensitive

    // extDB3 Connect to Database
    _result = call compile ("extDB3" callExtension format["9:ADD_DATABASE:%1", _database]);
    if (_result select 0 isEqualTo 0) exitWith {diag_log format ["extDB3: Error Failed to Connect to Database: %1", _result]; false};
    diag_log "extDB3: Connected to Database";

RPT Log tells me gently to get lost:

22:48:42 "extDB3: Version: 1.031"
22:48:42 "extDB3: Error Failed to Connect to Database: [0,""Database Config Error""]"

And the extDB3 Logfiles tell me the following:


extDB3: Found extdb3-conf.ini
extDB3: Detected 20 Cores, Setting up 6 Worker Threads
extDB3: ...
extDB3: ...
extDB3: ...
extDB3: ...
extDB3: ...
extDB3: ...


[22:48:42:546584 +01:00] [Thread 2504] extDB3: Config Error: coopr_local: No such node (coopr_local.IP)

#

@upbeat island and wtf to your statement

still forum
#

You have Database->IP in your config.
it expects coopr_local->IP

#

@frigid raven

frigid raven
#

Where exactly can you read Database->IP

shy wharf
#

@frigid raven extdb3-config.ini should be:

IP = 127.0.0.1```

Instead of:
```[Database]
IP = 127.0.0.1```
high marsh
#

19. how-to-formatting in Discord chat https://support.discordapp.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-

shy wharf
#

thank you

#

eh screw it

frigid raven
#

@shy wharf
what really? That's odd.. what is the Database = coopr_local field there for then ?

shy wharf
#

thats the name of your actual database

frigid raven
#

...wh...what

#

whats the difference between these two database namings

shy wharf
#

the [Database] section in the ini tells extdb3 where to look for your ip, port, u/p and the database on your sql server.

#

but since you have extdb3 looking for a section named coopr_local for your sql details its unhappy

frigid raven
#

ahhhh

#
  // extDB3 Load Protocol
    private _database = "coopr_local"; // This is case sensitive

this is the name for the [Database] thing

#

right?

#

I thought this [Database] config key (or whatever) is hardcoded in extDB3's source code

#

and not configurable

#

I always thought this variable is referred to the Database = coopr_local field

shy wharf
#

yea if I remember correctly the only place you define the database name is in the ini file

frigid raven
#

weird that it's called database as well

#

and the system command is ADD_DATABASE

#

I kinda assumed it's called config or something like that

shy wharf
#

yea it would be awesome if extdb3 was documented a little better

frigid raven
#

ah!

#

cool nice thank u

#

thought there is no other doc

#

it works @shy wharf thanks a heap!

shy wharf
#

np, have fun!

frigid raven
#

impossible but thx!

sly gorge
#

anyone have a script for ingame voice that plays a radio click/static thing after you transmit?

ember verge
#

Is there a way i can spawn this https://prnt.sc/m15rz1 and edit the text like Insert marker ? createDialog "RscDisplayChat"; maybe a code like this ?

high marsh
#

@ember verge RscEdit

ember verge
#

@high marsh thanks but i get an bin error when i create it

#

No entry "Bin\config.bin/RscEdit.idd".

still forum
#

because it's a control, not a display

ember verge
#

im so dumb ๐Ÿ˜ฆ thanks

tough abyss
#

@ember verge createDialog "RscDisplayInsertMarker";

ember verge
#

@tough abyss that could work too ๐Ÿ˜›

radiant needle
#

What's the easiest way to square a vector?

tropic dawn
#

does anyone know how to get the current target of the AI?

astral dawn
#

@tropic dawn I don't know the answer but in the neighbour #arma3_ai thread @tough abyss said this:

we still are not able to return what an AI unit is shooting at
๐Ÿคท

#

so I guess, if you are looking at any ai-related function in arma, there is 50% chance that you are going to have a bad luck

tropic dawn
#

damn

astral dawn
#

@solemn aspen
Thanks.

  1. What is the entire code you are using?
    This is the entire code:
    sol1 is a CSAT guy. Player is either civilian or WEST soldier set as captive, standing 10 meters away from each other.
_unit = sol1;
_unit reveal [player, 4];
_unit doTarget player;
_unit doFire player;
  1. What is the context of what you are attempting to achieve with your question?
    I am attempting to make a military soldier doTarget a player. He doesn't target captives, but can target civilians, although (side player) isEqualTo civilian returns true for a captive WEST player.

  2. With that said I am going to add a third question in; what game mode are you doing this in?
    This is just a test scenario where there is only player and sol1, a CSAT rifleman.
    Hope this helps.

So far we've solved it by a code similar to what @peak plover suggested , that is, by attaching a helipad to a player and making the AI target the helipad, but instead of a helipad I use another object which actually has a physical shape, then I hide it with hideObject. The problem with helipad is that AI looks at it once but can't track it if it moves (while attached to player), probably because the helipad has no model.

tough abyss
#

@radiant needle what do you mean square?

#

_vector vectorDotProduct _vector?

radiant needle
#

If I have [x1,y1,z1] I want to square it to be [x1^2,y1^2,z1^2]

#

Or just multiply in general

#

DotProduct multiplies but then adds each indice together

astral dawn
#

I think the easiest way to square each element of vector is _array apply {_x*_x};

languid tundra
#

AI can also target game logics, you don't necessarily need objects with a physical shape.

astral dawn
#

Are you totally sure of that? I think I've tried it with a game logic and it still didn't work properly.

languid tundra
#

Target logics for the suppressive fire module in Achilles is an example.

#

I do have to use a couple of lookAt, doWatch and doTarget before...

astral dawn
#

That's interesting. Probably I didn't create the logic properly. I will try it with the logic soon.
Do I create the logic like this? (from Larrow's script at arma forum):

_logicCenter = createCenter sideLogic;
_logicGroup = createGroup _logicCenter;
_myLogicObject = _logicGroup createUnit ["Logic", [0,0,0], [], 0, "NONE"];
languid tundra
#

Nope, the logic is created by Zeus. I think it's a child of Module_f though.

#

I think we used createUnit to spawn Module_f in earlier version and attached it to the actual target module to prevent locality issues.

#

As a client side mod, other clients without Achilles have no idea about the actual target module, since the config is missing.

astral dawn
#

Do you mean that you used a custom logic module added through addon? I don't get it, why would clients have this module missing if it's in the base game otherwise.

languid tundra
#

Exactly, it's a custom one.

#

Let me check the history. I'm pretty sure I used Module_f as a target.

astral dawn
#

Allright, thanks!

languid tundra
#

Yeah, I remembered right:

#

Also you might have to place the logic a bit in front of your victim such that it is visible for the gunner. Not sure if it's really needed though.

astral dawn
languid tundra
#

I dunno really the differences between logic and Module_f. I just know that Module_f worked back then.

astral dawn
#

well it looks like that Module_f inherits from Logic ๐Ÿคท

languid tundra
#

Yeah, it does

unreal leaf
#

looks like you are updating every time with doTarget and use forceWeaponFire

#

The way we do it now it also works with doFire

#

Im working together with Sparker btw

astral dawn
#

No it doesn't say in the code that he is constantly making them doTarget in a loop, or am I missing it?

languid tundra
#

Apparently, we did back then. But you have to consider that we made a lot of changes. The doTarget is no longer in the loop in the latest code.

astral dawn
#

Well I still have the same problem with Logic. He looks at it once but fails to track it when it's moving around. This is probably allright for a suppressive fire module.

unreal leaf
#

Yes if you update it now and then like he does.

#

But for close range you need many updates or it looks strange, but i think the other object we used did the trick. Or was there some problems with this sparker?

astral dawn
#

No we don't.
We try to use "FireSectorTarget" createVehicle (getpos player); as fake target.
Also if I do it with logic and doTarget the logic in each frame, the AI still fails to track it if I move

tough abyss
#

wanna see something funny? l = createGroup east createUnit ["Logic", position bob vectoradd [0,0,2], [], 0, "can_collide"]; bob dotarget l;

astral dawn
#

Creating logic in a west group changes nothing ๐Ÿ˜ฆ

unreal leaf
#

If anyone know how to make an enemy walk back while still aiming at a target I would like to know. Currently i tried playActionNow "Walkb" Ai walks back but cant track player, after animation is done he snaps back to aiming at target. :p AI doClickButton "Key_S"

lost iris
#

how can i set a server to 24/7 day?

winter rose
#
  • tests
  • QA
    ๐Ÿ˜‰
#

Yet I know, frustrating.

astral dawn
#

If it's a simple getter function, should be easy, I think

languid tundra
#

Yeah, you are right. The unit fails to follow the logic. It only works when you unset the target and give it gain, which is undesired.

#

Alternative question. Is it necessary for the player to be captive?

#

I mean the captive mode.

astral dawn
#

Yeah we are making an undercover script, so it's critical

languid tundra
#

There are alternative ways for undercover like make AI blind or change side relations or their group's side.

astral dawn
#

Both are messy ways TBH.

change side relations or their group's side
do you mean side setFriend [side2, 1]; ?

#

setCaptive is great, apart from the doTarget problem, which seems to be solved hacked around as usual ๐Ÿ˜„

languid tundra
#

Nvm, you get the same problems with all the suggestions, except the make them blind one I guess.

unreal leaf
#

Well we tried target camo value, its even worse

languid tundra
#

I remember now why I do not like working with AI. It takes tons of tests and tweaks to get them do what you want them to do ๐Ÿ˜„

astral dawn
#

Yeah it's annoying that there are no proper commands for low level AI access.

languid tundra
#

At least you can get rid of the combat part when you disable auto-combat.

#

I guess the danger part is what makes it so impossible to force them to run to a position ๐Ÿ˜„

#

How so?

#

I meant you can address this with some disableAI options, but those arent suitable for dynamic use

#

Yeah, animations would probably the only way to make them run once they were engaged. Even if you disable targeting, auto-combat and whatever else, they are reluctant.

#

Funny thing is that AI is a bit less reluctant when each unit is in a separate group. I guess there are group related handlings that make tweaking AI behaviour even more complicated.

fleet hazel
#

I have script:

life_fnc_test = {
_return = profileNamespace getVariable "contacts";
_return;
};

I run this script:

_contactsArray = [] remoteExecCall ["life_fnc_test",_player];

And it doesn't work for another player.
I'm trying to get another player's array through a remote call.

astral dawn
#

remoteExecCall doesn't return the value which was returned by the other function on the remote machine.

fleet hazel
#

@astral dawn And how do I get the result back from the player.

astral dawn
#

It's not straightforward. You would have to suspend your script until the other machine remoteExec's something on your machine and sends the value to your machine.

#

Or you could split your original script in two parts. Call the second part from the remote machine while passing it needed values.

fleet hazel
#

@astral dawn Understood. I'll try to do that.

lost copper
#

@fleet hazel you can create "contact" variable in player Namespace and write this value from profile to player nameSpace with life_fnc_test. After them you can get it.

#

player nameSpace setVariable ["contact", (profileNameSpace getVariable "contact"), true];

fleet hazel
#

@lost copper Thanks. I hope everything works out for me.

#

@lost copper the element distribution across the network isn't working?

#

at the very end true

lost copper
#

@fleet hazel i add 3d parameter

#

true for making this variable public

fleet hazel
#

as far as I know playernameSpace dont work 3d param

lost copper
#

Hmm

#

So, my advice not work)

#

Let's try @astral dawn variant

astral dawn
#

you can make both machines agree on the variable which will be set on the original machine by another machine. The first machine executes code on the second one and waits until the agreed variable is not nil any more.

#

of course then there are all kinds of problems, like what happens if the other machine disconnects at this moment, your whole scheduled script will freeze, so it's generally good to add a timeout in this case

lost copper
#

In missionNamespace for example?

astral dawn
#

yes, I meant missionNamespace, this is where you generally store variables

#

Splitting code in two pieces might be easier if you need to do this exchange with many other machines at the same time, because otherwise you will have to somehow generate a new agreed variable name

lost copper
#

You mean, that we should using variables with unique names?

#

For each player?

astral dawn
#

I mean, well, it all depends on what exactly you need to do and for how many other machines at the same time

lost copper
#

Ok

#

@fleet hazel about restrictions of making public variable in player nameSpace. I didn't find info about that.

velvet merlin
#

getting no all clutter models to show up with createSimpleObject using model path (and have to use +5/5.5 offset for height)

#

is createSimpleObject ignoring model center or why is the offset needed?

delicate lotus
#

@tough abyss would disabling the AI's "FSM" help with that?

#

With making them move more rapidly from cover to cover I mean.

tough abyss
#

@fleet hazel you can setVariable with public flag on an object like player

thorn saffron
#

Just got a random idea: would it be possible to script AI copilot taking the controls if the main pilot gets killed? It would make copilots not completely useless. I know player as a gunner/copilot can take the controls, but can AI use something like that?

tough abyss
#

You could potentially use a event listener for death to check the vehicle for a copilot and if there is one move them to the main seat. It would be pretty funny as the main pilot would probably drop out but potentially you could swap him too if there was a third place to go or perhaps you just remove the body completely. Should be doable.

#

I am wondering if there is a way to tell how well a unit is current lit up. I am looking through the scripting commands and while I see a bunch of setup of lights I don't see an obvious way to determine if a unit is hit by lights and to what extent. Right now I am thinking street lights (which I could proxy with distance to the object) but there is a wider question of just lit up or not.

still forum
#

ACE has that to determine the light on map screen

tough abyss
#

That it does, I'll see how they do it.

still forum
#

Basically find nearby lights using nearestObjects, Then find in their config what color and how bright they are and then interpolate with distance

young current
#

@velvet merlin createSimpleObject work in ATL or ASL?

still forum
#

positionWorld

#

so ASL

young current
#

0,0,0 would the drop it on sea-level?

still forum
#

ye

velvet merlin
#

well a good chunk is visible at height 5-5.5

#

most arent visible at all though

velvet merlin
#

stupid mistake.. forgot one toLower ๐Ÿ˜

velvet merlin
#

what was again a way to scale models (as hack/not as gameplay objects)?

#

via 3d dialog is the only way, or is there another?

void ivy
#

Getting a script not found error, but only when I pack using addon builder and not when using pbo manager

#

Seems like something is not configured right in addon builder...

still forum
#

sounds like pbo prefix

#

Though I'm not aware of pbo manager supporting that

#

I'm not aware of pbo manager supporting anything really ๐Ÿ˜„

void ivy
#

Lol, well apparently I found a case it does!

still forum
#

or addon builder has a prefix defined but you actually don't want one

void ivy
#

Confirmed addon prefix field is empty

#

wasn't using the P drive. Could that do it?

still forum
#

no

still forum
#

Don't know right now how many r2t's were supported. But I think atleast 2, so that should be fine

#

you move into the first cam?

young current
#

what is the purpose of the set up?

young current
#

that probably should work

young current
#

do those cameras of yours work separately?

tough abyss
#

Can you see dialog over bg camera if you only have 1 camera? @hard kelp

static ore
#

Anyone available to lend a hand?

still forum
#

๐Ÿ– here take this one

static ore
#

lol. For real though can you help?

spice axle
#

Can you just tell us the question you got? @static ore

static ore
#

So I'm in the middle of following a simple guide to getting a basic exile server setup.
I need to open my config.cpp file and include a line of code.
Trouble being I can't find my config.cpp file. I'm renting a box from GtxGaming

still forum
#

a config.cpp is inside a mod's pbo

spice axle
#

What Dedmen said

static ore
#

Okay I'll try find something like htat.

#

I'm lost.

#

I'm willing to pay anyone who can help setup and run an exile server.
Unsure if this is the right place to be posting it.

spice axle
#

not it's not: look into #creators_recruiting or think a second time about: Am I able to host and setup and run a exile server. If you have no idea about mods or missions then how you wanna be able to host a server there you need both?

young current
#

Best place to ask would be the Exile Discord.

static ore
#

That's the issue Katalam I want a server of my own but without the troubles of coding. I deemed paying somebody is the most reasonable outcome.

#

Thanks.

nimble echo
#

need help with plane event handlers so i can use it script what should happen to a plane once its landed and stops on the taxi way, like teleport it to a proper parking spot

astral dawn
#

It's better to speed <vehicle> < 0.01 instead of speed <vehicle> == 0

tough abyss
calm bloom
#

Hello guys! Can you help me? I dont get why this is not blocking the middle mouse button

["KKA3fix", format['noreloadingactiontest'], ["No reloading action test", "Prevent reloading action with transmit test"], {true},{false}, [242,[false,false,false]],false,0,true] call CBA_fnc_addKeybind;
delicate lotus
#

What is the best way to convert a string into an condition that is going to be checked in a while - loop?

#

Like addAction does

#

just compile the string and call it each check and check if it evaluates true / false?

mint kraken
#

So I am trying to use currentWeapon _source isKindOf ["Handgun", configFile >> "CfgWeapons"]} in handle damage event with a if statement and it doesnt seem to work...
my source variable = private _source = _this select 3;