#arma3_scripting

1 messages · Page 327 of 1

little eagle
#

I don't think that would not explain why it works manually
But it would explain why it doesn't either perfectly, which is what is happening from my understanding.

peak plover
#

I would blame ```sqf
waitUntil {currentWeapon player == ""};
player playMove "Stand";

#

Maybe it recoqnises no weapon and playMove "Stand" stops weapon from going away?

little eagle
#

Animations can't change the selected weapon and currentWeapon should report "" if the weapon was put on back successfully.

ivory vector
#

didnt work

peak plover
#

Hm...

ivory vector
#

it works fine in game.

#

but not where i want it 😦

#

im calling it from the core/init.sqf

#

ill take a ss of what its doing

little eagle
#

mission start?

ivory vector
#

yeah

peak plover
#
    player switchMove "FXStandDip";
    0 cutFadeOut 5;
    [] spawn {
        sleep 2;
        player action ["SwitchWeapon", player, player, 100];
    };
    waitUntil {currentWeapon player == ""};
    player playMove "Stand";
little eagle
#

maybe player is null when your script runs

#

briefing

ivory vector
#

I tested that, thats not the issue.

remote flame
#

private _missionDone = false;

while {!(_missionDone)} do {

if ((_x distance art) < 10) then {
  
 cash=cash+2500;
 (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash];
 hint "Award for your efforts 2500$";
 
    _missionDone = true;

}foreach playableUnits;

sleep 0.5;
}

ivory vector
#

its called just before the init for that specific side

remote flame
#

is it good?

#

"private _missionDone = false;

while {!(_missionDone)} do {

if ((_x distance art) < 10) then {
  
 cash=cash+2500;
 (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash];
 hint "Award for your efforts 2500$";
 
    _missionDone = true;

}foreach playableUnits;

sleep 0.5;
};"

#

Type"private _missionDone = false;

while {!(_missionDone)} do {

if ((_x distance art) < 10) then {
  
 cash=cash+2500;
 (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash];
 hint "Award for your efforts 2500$";
 
    _missionDone = true;

}foreach playableUnits;

sleep 0.5;
};"

peak plover
#

nah it's three times `

#

< of 1. the "tilde"

ivory vector
#

Yeah

#

balls

peak plover
#

tildeX3 sqf // starts with sqf syntax
tildeX3 // ends code

ivory vector
#

Yeah

remote flame
#

//private _missionDone = false;

while {!(_missionDone)} do {

if ((_x distance art) < 10) then {
  
 cash=cash+2500;
 (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash];
 hint "Award for your efforts 2500$";
 
    _missionDone = true;

}foreach playableUnits;

sleep 0.5;
};//

ivory vector
#

and after the first 3 ` put sqf

#

Kappa

little eagle
#

```sqf
blah
```

simple solstice
#

@peak plover try adding waitUntil {getClientStateNumber > 9};

#

at the beginning of the script

remote flame
#

while {!(_missionDone)} do {


    if ((_x distance art) < 10) then {
      
     cash=cash+2500;
     (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash];
     hint "Award for your efforts 2500$";
     
        _missionDone = true;
        
}foreach playableUnits;

sleep 0.5;
};```
little eagle
#

It looks pretty fucked tbqh

peak plover
#

`sqf

remote flame
#

Well show me some version of it which is not Fucked

simple solstice
#
private _missionDone = false;

while {!(_missionDone)} do {


    if ((_x distance art) < 10) then {
      
     cash=cash+2500;
     (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash];
     hint "Award for your efforts 2500$";
     
        _missionDone = true;
        
}foreach playableUnits;

sleep 0.5;
};
peak plover
#

while (triggered)

#

(((((((while)))))))

little eagle
#

That forEach is just wrong

remote flame
#

@simple solstice There is not difference in scripts?

#

Well tell me how to fix it or show me a better script

little eagle
#

I'm pointing out the errors. And that syntax is broken.

remote flame
#

Pointing out errors well tell me how to fix them

peak plover
#

Takes time, you have to concentrate

remote flame
#

Ok

little eagle
#

Idk. It's impossible to tell what should happen, because it's so badly written.

remote flame
#

Well I want a player on an dedicated server to be 10 m from an crashed heli and there for get money to that player near the geli

#

heli*

peak plover
#
waitUntil{
    if ((_x distance art) < 10) exitWith {
        {
            cash=cash+2500;
            (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash];
            hint "Award for your efforts 2500$";
            _missionDone = true;
        }foreach playableUnits;
    };
    (_missionDone == true)
};
#

@little eagle Is this in any way better?

ivory vector
#

This on a life server ?

#

you cant add cash to players from the server.

peak plover
#

Probobly better to add as PFH or something as this mission will most likely have more than 1 loops

remote flame
#

No not life server more like an wasteland server more in that way

#

it is from an randomly generated mission script

peak plover
#

Also I've never used uiNameSpace for money

little eagle
#

It's just a control

peak plover
#

I'd save in profilename space with a key generated by a server to see if it should reset. Also save the value on the server and if it's out of sync then reset it

little eagle
#

This is not really a SQF question. Should ask the wasteland devs on how to add money in their mission.

peak plover
#

I assume ART is artifact, not an expensive piece of artworks

#

Sounds really cool

little eagle
#

The forEach loop still makes no sense. This is not how you use forEach

ivory vector
#
//Mehh

private _missionDone = false;
while{true}do{
    _nearPeople = nearestObjects[(getpos art),["MAN"],10];//Finding all the players near the object.
    waitUntil{(count _nearPeople) > 0};
    //Should only add the cash if players are near and the mission has not been done.
    if(!_missionDone)then{
            (uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",cash];
            hint "Award for your efforts 2500$";
            _missionDone = true;    
            {cash = cash + 2500}forEach _nearPeople;
    };
};
peak plover
#

True

#

If you have money in your mission

#

Create functions for adding/removing money

ivory vector
#

but yeah, you might need to create a mini function on the client to remoteExec from the server to add the cash

little eagle
#

Kappa should read up on how global variables work.

#
{cash = cash + 2500}forEach _nearPeople;

I don't think this works as intended.

ivory vector
#

look just below that Commy

#

I dont know how wasteland handles monies

remote flame
#

So @ivory vector this script is not "fucked" as @little eagle said mine was?

peak plover
#

Why uiNameSpace? Just use player setVariable ["cashmoneydolladollabillyall",100,true];

little eagle
#

Ask the devs.

ivory vector
#

What do you mean @remote flame

#

its borked

remote flame
#

Well my script was bad so I am wondering if yours is going to work?

#

Or is going to be better then mine atleast

ivory vector
#

Prob not, i dont know what its trying to do and whether its server or client

little eagle
#
{cash = cash + 2500}forEach _nearPeople;

^ this is still just wrong

ivory vector
#

how does wasteland handle money ?

peak plover
#

While {true}do{} <<< never this

#

I'd always leave a way to leave the loop

#

While loops are harsh

little eagle
#

I don't think this script can be fixed. It would have to be rewritten completely. And you'd need insight on how the wasteland mission handles money.

ivory vector
#

thats why I have the waitUntil, so it only runs if people are here.

remote flame
#

Well I have made my own money system that is the thing with (uiNameSpace getVariable "myUI_DollarTitle")

peak plover
#

why not waitUntil {blabla;(false)} instead? Because when people are there it will be running the while loop more than once every frame

#

Ok check this out

#

Also

#

waitUntil{(count _nearPeople) > 0};

#

This means it will never check again to update _NearPeople

jade abyss
#

While {true}do{} <<< never this
I'd always leave a way to leave the loop
Of course you can do it. Simple exitWith -> Done.

peak plover
#

If I don't need to check or do something more than once a frame I don't use while

#

If I need something to run more than once a frame I use while, but this is rare

jade abyss
#

There is barely a reason, to check anything each Frame, unless it's UI / draw3D stuff oO

remote flame
#

Can someone just show me a script that works, I am confussed by all the new codes and commads

jade abyss
#

I doubt you know the old ones, tbh

#

because -> They are pretty old commands oO

peak plover
#

Yeah the new stuff is rarely used

remote flame
#

Well I mean that they are new to me

#

maybe not new new

jade abyss
#

+Read the examples.

remote flame
#

I have done that

#

@ivory vector So your script was good?

peak plover
#
private _missionDone = false;
waitUntil{
    // check for people near art
    _nearPeople = nearestObjects[(getpos art),["MAN"],10];//Finding all the players near the object.
    // If there are people near the point give them money
    if(!_missionDone && ((count _nearPeople) > 0))exitWith{
        {
            2500 remoteExec ["nig_fnc_addMoney",_x];
        }forEach _nearPeople;
        _missionDone = true;
    };
    (_missionDone)
};```
#

I'd do something like this

remote flame
#

And this script adds money to players that are there so not alll players or only admin or server get cash?

#

Thanks everyone for help ❤

peak plover
#

It remotely executes the function nig_fnc_addMoney on clients where a member of _nearPeople is local. This will most likely be the first man within 10 distance from art

#

There are issues with this

#

Because why would you even check for multiple people if it will fire as soon as 1 guy is in there

#

You could check for people in 5 distance range and then give money to everyone in 25 distance range

#

Also you must make a function which you should call fern_fnc_addMoney

remote flame
#

Alright, can you tell me the issues so I can work around them?

#

alright

#

fnc got i t

peak plover
#

Scripting is a lot of fun, you should experiment a lot

#

Also like 90% of things you think of have already been made

remote flame
#

ik, but I want to get results aswell as experimenting

#

but I cant find things that I need on google.se but you have been to big help 😃

peak plover
#

I find examples of literally everything I think of. It's hard to be original. But this is good, because it's easy to learn. But this is bad, because you can learn something that's not the best

#

Just google [my scripting idea] arma 3. For ex. Car unfilp script arma 3

remote flame
#

alright

#

but thx for your time

remote flame
#

@peak plover Fern_fnc_addMoney = {cash=cash}; will that work as an good fnc?

peak plover
#

no 😄

remote flame
#

What would?

peak plover
#
//inside fn_addMoney.sqf
params ["_money"];
(uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",(cash + _money)];

Something like this

remote flame
#

Alright thanks

peak plover
#

You can just look at some other peoples missions to see how functions work

#

It's pretty much spending more time to get started, but it's a lot cleaner and better

#

On big projects it can really save time

#

Pretty much if you have to use something more than once, make it into a function

#

repeating code is usually useless

remote flame
#

Ohh ok

#

2500 remoteExec ["Fern_fnc_addMoney",_x]; will that really work?

#

with 2500 in front?

peak plover
#

Ok, I will show you how to answer questions instead of answering this one

#

Type in google "arma 3 remoteExec"

#

And on the first link you can find anything about the command remoteExec

#

https://community.bistudio.com/wiki/remoteExec

jade abyss
#

quoting myself:

Dscha - Today at 12:38 AM
Fav this page:
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3

+Read the examples

OpFern - Today at 12:39 AM
I have  done that```
Clearly not...
peak plover
#

Read everyhing on that page and rewrite it in a textbook to memorize it. Then have your "friends"(mom) quiz you on them every day. Then re-write all of them from head into another textbook, later check it and take a shot for every mistake you make.

cinder gyro
#

Hey, do you guys have any ideas on how to make 3rd person only available in vehicles? I've been looking for a script but I can only really find 2. One of wich doesnt work and the other just works under or over certain speeds...

tough abyss
#

is there a way to check if a player has killed another unit of the east side?

tough abyss
#

EH's @tough abyss

dry robin
#

Does anybody know which of the ALIVE functions will load up the tablet? Basically I want to add a map object to the game with an addaction to bring up the tablet

#

from looking in the function viewer this kinda works.... but not really

[["openMapFull"],"ALIVE_fnc_displayMenu",player,false,false] spawn BIS_fnc_MP; 
dry robin
tough abyss
#

How do I check if a stacked EH exist?

indigo snow
#

theyre saved to missionnamespace

#

(missionNamespace getVariable ["BIS_stackedEventHandlers_XXX",[]])

tough abyss
#

So waitUntil {isNull missionNamespace getVariable ["BIS_stackedEventHandlers_XXX",[]]?

#

"BIS_stackedEventHandlers_XXX" being the EH's key?

indigo snow
#

null has nothing to do with this

#

or are empty arrays null nowadays?

peak plover
tough abyss
#

@indigo snow nah I tried and I throws an error.

#

I might post the whole thing here since trying to halt the script is getting ridiculous...

#

I can't figure out what's wrong with this, please help ```SQF
hint "Click on 2 points on the map to create an AO. Said points will act as the corners of the AO."; // Notify user
openMap true; // Open map
GVAR(mapClicksNum) = 1; // Var for checking how many times the user has click on the map
_ehDone = false; // Local var for checking if below EH is done

// Add a map click EH
[QGVAR(aoPointsEH), "onMapSingleClick", {
switch (GVAR(mapClicksNum)) do {
case 1: {
GVAR(aoPoint1) = _pos; // Assign 1st click pos to var
INC(GVAR(mapClicksNum)); // +1 var to case 2 is ran
};

    case 2: {
        GVAR(aoPoint2) = _pos; // Assign 2nd click pos to var
        _ehDone = true; // Mark EH as done

        // Remove our EH to allow compatablity with custom waypoint in nev_a3_overrides
        [QGVAR(aoPointsEH), "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
    };
};

}] call BIS_fnc_addStackedEventHandler;

waitUntil {_ehDone};

// Calculate stuff with points

#

It refuses to halt on waitUntil 😕

halcyon crypt
#

you're going too deep with the CBA macros 😛

#

a simple + 1 will suffice

peak plover
#

waitUntil {diag_log (diag_tickTime + " ehDebug");_ehDone};

#

Also you are using macros but instead of lazy evaluation you use switch case?

#

Just use 2 if's it's faster

#

Also _ehDone is not in the same scope as your cases

#

You can't use a local variable

tough abyss
#

@peak plover can you please explain "lazy evaluation"?

peak plover
#
if (a) then {};
if (b) then {};

or

call {
   if (a) exitWith {};
   if (b) exitWith {};
};
tough abyss
#

Ok I changed it to an if.

peak plover
#

You can use systemChat isntead of diag_log when debugging to get real time feedback

tough abyss
#

I already used a bunch of diag_logs.

#

All it really show me is that the script is not stopping on waitUntil.

peak plover
#

If you change the variable from local to normal it should work

tough abyss
#

I'll try it and will let you know.

#

Related question: I remember reading somewhere that a bunch of ifs are faster because a switch will check all cases after it finds a matching one, is this true?

#

Fuck ```
12:58:17 Suspending not allowed in this context

peak plover
#

Ahh there you go 😄

tough abyss
#

Yep.

#

Gotta spawn it 😐

#

It's always that error I swear on me mom.

peak plover
#

Where is this script located?

#

It's a function, right?

tough abyss
#

Yes.

peak plover
#

Maybe waituntil is not the best thing, if you want to calcualate stuff with points make it into a function and call it from the eventhandeler

#

This way you keep it cleaner/faster with more things event driven. Waituntil is not really neccisary as you already have an eventhandeler

tough abyss
#

It's not that complex of a calculation, just simple geometry.

#
// Get X and Y of 1st point
_X1 = GVAR(aoPoint1) select 0;
_Y1 = GVAR(aoPoint1) select 1;

// Get x and Y of 2nd point
_X2 = GVAR(aoPoint2) select 0;
_Y2 = GVAR(aoPoint2) select 1;

// Calculate middle
_Xm = (_X1 + _X2) / 2;
_Ym = (_Y1 + _Y2) / 2;
peak plover
#

I'd always use functions

/*=============================================================================\\
|respawn_fnc_wave_setup;                                                        |
|    USAGE:                                                                        |
|        call respawn_fnc_wave_setup;                                            |
|    USED IN:                                                                    |
|        respawn_fnc_postInit; type selection                                    |
|    PARAMS:                                                                        |
|        NONE                                                                    |
|    RETURNS:                                                                    |
|        NOTHING                                                                    |
|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|    DESCRIPTION:                                                                |
|        Sets up the instant respawn script aka. "mission_respawn_type"            |
|        Runs the respawn_fnc_wave_serverTimer                                    |
|    NOTES:                                                                        |
|        Run only on the server                                                    |
\\=============================================================================*/
"respawn_fnc_wave_setup" spawn debug_fnc_log;

if !(isServer) exitWith {};
// Code begins
// Set wave respawn script as the respawn script
missionNamespace setVariable ["mission_respawn_type","respawn_fnc_wave_onRespawn",true];
call respawn_fnc_wave_serverTimer;
#

Only because I might need to use this more than once maybe

#

never know

#

I've spent more time documenting lately than writing anything useful. But it's fun

#

Saves a lot of trouble later on when things may get complicated

tough abyss
#

Dat comment art.

peak plover
#

It works on my machine™

fallen grotto
#

anyone know of a script that would just spawn waves of enimes

peak plover
#

Yes

#

Plenty

tough abyss
#

On a side note, Poseidon tools should really make that suspention error more obvious in the RPTs.

fallen grotto
#

@peak plover was looking for a more human element

#

google isnt a new tool to me ha

#

just a tad overwhelming

#

when all the links go back like 10 years

cinder gyro
#

@peak plover I tried that one it didnt work :/

tough abyss
peak plover
#

I've used this one

#

you have to edit it a bit because you don't have the parameters set up

simple solstice
#

Is _type going to act as a wanted string, and if it isnt preset set _type as ADD?

params [["_type", "ADD", [""]], ["_value", 0, [0]]];
cinder gyro
#

Thanks will give this a go then

simple solstice
#

for objects there is objNull but idk if there is such a thing for strings other than ""

remote flame
#

@peak plover _money is an undefined variable...

peak plover
#

Oohh yea liek you pointed out [2500]

#

It says so on the wiki

remote flame
#

alright

cinder gyro
#

@peak plover Maybe a noob question but this would go into the postinit.sqf in the mission?

peak plover
#

No

#

@fallen grotto

// 
//

// Variables
_spawnPos = nig_location_1;
_targetPos = nig_location_2;
_aiCount = 100;
_spawnMin = 1000;
_spawnMax = 1500;
_offensive = true;
private _unitList = [
    "LOP_TKA_Infantry_Officer",
    "LOP_TKA_Infantry_AT",
    "LOP_TKA_Infantry_Marksman",
    "LOP_TKA_Infantry_MG",
    "LOP_TKA_Infantry_TL",
    "LOP_TKA_Infantry_AT",
    "LOP_TKA_Infantry_Corpsman",
    "LOP_TKA_Infantry_Rifleman_2",
    "LOP_TKA_Infantry_TL",
    "LOP_TKA_Infantry_AT",
    "LOP_TKA_Infantry_MG",
    "LOP_TKA_Infantry_Rifleman_2"
];

// spawn a group of dudes
_gName = createGroup east;
for "_i" from 0 to _aiCount do {
    _pos = [(_pos),_spawnMin, _spawnMax, 1, 0, 20, 0] call BIS_fnc_findSafePos;
    _unit = _gName createUnit [(selectRandom _unitList), _pos, [], 20, "FORM"];
    // fast attacker ai
    if (_offensive) then {
        _unit disableAI "AUTOCOMBAT";
    };    
};

// give waypoint to group
_wp = _gName addWaypoint [(position _targetPos), 69];
_wp setWaypointBehaviour "AWARE";
_wp setWaypointType "SAD";
_wp setWaypointSpeed "NORMAL";
_wp setWaypointFormation "LINE";
_gName setBehaviour "AWARE";

// Fast attacker ai
if (_offensive) then {
    _gName enableAttack false;
};

// Add to the list of waves
_groups = missionNamespace getVariable ["nig_wave_groups",[]];
_groups pushBack _gName;
missionNamespace setVariable ["nig_wave_groups",_groups];

try this

peak plover
#

updated

cinder gyro
#

Got it to work perfectly 😃 Thanks @peak plover

peak plover
#

Great like I said previously

#

Is great examples of how to set up functions

#

Description.ext > f\common\functions.hpp > function

remote flame
#

@peak plover Thank you for your help I made the Fnc add money and all that it works. Now I need to test it later with a friend to see if it adds money for him and not me.

limpid pewter
#

hey i asked a similar question yesterday,but im still having issues with display control serialization. I have this in my initPlayerLocal.sqf ```sqf
call {
_capProgDisplay = (uiNamespace getVariable "captureProgress");
ctrlTitle = _capProgDisplay displayCtrl 1100;
ctrlCapPoint = _capProgDisplay displayCtrl 1101;
ctrlBar = _capProgDisplay displayCtrl 4020;
};

remote flame
#

Sorry dude I am not the guy for this question... xD

limpid pewter
#

all g, i shall wait 😃

peak plover
#

Why do you have that in your initPlayerLocal

#

What are you trtying to do?

#

Are you trying to grab a value or change it?

#

Or something else

limpid pewter
#

hey @peak plover, so im simply trying to store a ctrl in a var, so that i can use things like setStructuredText, setText, etc.. I have tried using this ```sqf
_capProgDisplay = (uiNamespace getVariable "captureProgress");
ctrlTitle = _capProgDisplay displayCtrl 1100;
ctrlCapPoint = _capProgDisplay displayCtrl 1101;
ctrlBar = _capProgDisplay displayCtrl 4020;

while {_pPos inArea _trigName} do {

_pPos = getPos player;
_capCt = (abs captureCounter)/40;

if (isNil "captureProgLayer") then {
    captureProgLayer = "capProg" cutRsc ["captureProgress","PLAIN"];
};

if (side player == east) then {

    if (capBool == 2) then {
    ctrlBar ctrlSetTextColor [0.078,0.392,0.898,1];
    ctrlTitle ctrlSetTextColor [0.078,0.392,0.898,1];
    ctrlTitle ctrlSetStructuredText parseText "<t align = 'center' size ='1.8'>CAPTURED BY CSAT</t>";
    _strTextStar = "<t color = '#1464E5'  size ='3'> |G| </t>";
    _strTextMid = _strTextStar splitString "|";
    _strTextMid set [1, nil];
    _strTextMid set [1,_flag];
    _strTextFin = _strTextMid joinString "";
    ctrlCapPoint ctrlSetStructuredText (parseText _strTextFin);
};

};``` in my function, yet i still get the serialization error. This is in a function that is spawned every 0.5 seconds, but the ctrls are only defined once while the loop is running, (you may not be able to set it above, but it works that way).

peak plover
#
(findDisplay 42069 displayCtrl 421) ctrlSetText (toUpper (name _target));
#

_nameDisplay = (findDisplay 42069 displayCtrl 421)

limpid pewter
#

ok, so its an RscTitle btw

#

not a dialog

#

findDisplay number doesn;'t work

peak plover
#

That's how you are supposed to use it, that's an exmple that worked

remote flame
#

nvm it dident work

peak plover
#

You would have to go to your dialog

limpid pewter
#

nah its a HUD, not a menu

#

im using RscTitles

peak plover
#

Yeah, in there grab your idd

limpid pewter
#

yeah, ok will try, but i swear that it didn't work last time i tried -_-

peak plover
#

and the idc of your text

limpid pewter
#

yeah i will try that in a sec thanks

peak plover
#

@remote flame doesn't work in mp or does not work period?

remote flame
#

Does not work

#

I dosent add money

peak plover
#

Show the function

remote flame
#
cash=cash+2500;
(uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",(cash)];
};```
peak plover
#

no...no...

#

this is all wrong...

#

What does your description.ext look like?

remote flame
#
{ 
       class DollarTitle 
       { 
           idd = 1; 
           duration = 999999; 
           onLoad = "uiNameSpace setVariable ['myUI_DollarTitle', (_this select 0) displayCtrl 101];";
           class controls 
           { 
                   class DollarControl 
                   { 
                           idc = 101; 
                           type = 0; 
                           style = 2; 
                           x =  safeZoneX + safeZoneW - 0.4 * 3 / 4; 
                           y = safeZoneY + safeZoneH - 0.2; 
                           w = 0.2; 
                           h = 0.2 * 3 / 4; 
                           font = "PuristaMedium"; 
                           sizeEX = 0.04; 
                           colorBackground[] = {0,0,0,0}; 
                           colorText[] = {0,1,0,1}; 
                           text = "$$$$"; 
                       }; 
               }; 
       }; ```
#

};

iron stream
#

ok so classes exist in SQF

remote flame
#

I dont know what you mean

peak plover
#

change dollartitle idd to soemthing else

#

wait nvm

#

This is how you add functions

#

It's a bunch of reading but it's VEERY important

#

And in a long run functions are EXTREMLY useful

remote flame
#

So adding my functions I do in describtion.exe_

#

?*

#
cash=cash+2500;
(uiNameSpace getVariable "myUI_DollarTitle") ctrlSetText format ["Money: %1",(cash)];
};```
#

that should be in describtion.exe?

peak plover
#

no

limpid pewter
#

under cfgFunctions

peak plover
#

in cfgFunctions you define where the functions are

remote flame
#

So I have to make an function to add money

#

isent there an easier way

limpid pewter
#

that is an easy way, keeps everything organised and neat, plus it allows you to not have to worry about defining the functions, as long as the function is named correctly

#

it also runs better

remote flame
#

Well I dont know how to do it since my first langugae is not english and every place is english and all the words used are advanced to me. it is more diffucult

limpid pewter
#

ahh ok

#

i shall attempt to explain in about 5 mins

remote flame
#

Ok

#

I am ready to learn xD

limpid pewter
#

so, functions are basically the same a scripts, butt they're allow for a better way to organise everything. They also are precompiled so they are executed faster, or are less demanding on the engine

remote flame
#

Ok, I understand

#

How do I make one?

limpid pewter
#

soooo

#

you should try to organise all your functions in seperate folders in you missions directory, naming them with relavent names. Each function is the same as any of your scripts would be, except for the fact that you NEED to name the with the start of fn_myFunctionName.sqf

remote flame
#

So I make functions in sqfs? not describtion.exe?

limpid pewter
#

so for a script that finds the distance from the player to an object, you would name it something like fn_playerDistanceFromObject.sqf

#

yes, all functions and scripts should be a .sqf or .sqs (sqs) is outdated, use sqf

remote flame
#

Ok, Do I put all my diffrent functions in one sqf or do I make sepeart sqfs?

limpid pewter
#

what nigel and others were saying about the description.ext before was that you need to "define" your functions from your description.ext so that the engine knows where your functions are

#

i would put them in separate sqfs

remote flame
#

ok, could you maybe make an example describtion.exe and example sqf function? So i can see it

limpid pewter
#

yes

#

sorry, was just msging someone else. So in your description.ext file in your mission directory, you need reference all of your functions in the cfgFunctions class (this is a predefined class in arma). He is an example ```sqf
class cfgFunctions {
class mld {
tag = "mld";
class myFunctions {
file = "functions\myFunctions";
class mySpecialFunction {};
};
};
};

remote flame
#

So that Defines the fnc?

#

not makes it

limpid pewter
#

cfgFunctions uses inheritances, so class mld is the parent clas for class myFunctions. You could have many child classes under the class myFunctiosn class, all using different file pathnames

#

yeah sorta

remote flame
#

ok, I am learning alot off this.

limpid pewter
#

So you would make a function, place it in your functions folder, then you MUST reference it in your csfFuncions class. This is so that the engine knows where to find the function when you try to call it

remote flame
#

Ok, and when I want to call it I juse call fnc_bla

#

?

limpid pewter
#

where did you get bla from?

remote flame
#

nowhere it was an example

limpid pewter
#

ahh k

#

no

#

so when using cfgFunctions. You would call your functions using ```sqf
call mld_fnc_myFunctions;

remote flame
#

call fnc_mld that is right?

limpid pewter
#

haha almost 😃

remote flame
#

so tag first then "fnc" then the category?

limpid pewter
#

so the tag is first, then fnc, then the function name

little eagle
limpid pewter
#

^ yeah probably should have said that XD

#

@little eagle "Well I dont know how to do it since my first langugae is not english and every place is english and all the words used are advanced to me. it is more diffucult"

covert inlet
#

Can anyone give me some info on adding a UAV terminal to the seat of a vehicle

limpid pewter
#

thanks what opFern said above so the wiki may not be so helpful that's alll

little eagle
#

Step one is learning English then. More important than playing games any day.

limpid pewter
#

harsh

little eagle
#

But true.

limpid pewter
#

but is suppose it is neccesary

remote flame
#

I know the language english. I just dont know all the words that are used in the wiki

little eagle
#

Use google or a dictionary.

remote flame
#

yes, but there is alot of words that needs to be translated

little eagle
#

I learned English also by doing "programming" for games.

vapid frigate
#

you really only need the examples

limpid pewter
#

@little eagle Are you suggeting that we shouldn't be spamming this chat for this topic? if so opfern, you want to voip chat for a sec?

covert inlet
#

Im trying to create a vehicle patch, that would add a UAV terminal and the jets dlc radar w/data link to a vehicle seat, essentially creating a sort of JTAC command vehicle

little eagle
#

I'm saying that the wiki is pretty good and that it's better than anyone at explaining it than this chat.

#

And this chat also is English so I don't get the complaint.

remote flame
#

@limpid pewter I am better using chat then talking english...

little eagle
#

than*

remote flame
#

so private chat maybe @remote flame ?

#

@limpid pewter

#

jesus @little eagle

limpid pewter
#

@covert inlet which vehicle

covert inlet
#

any ground vehicle, i haven't really decided what vehicle im going to add it to

#

commanders seat of any old MRAP

little eagle
#

You would have to equip the unit in the vehicle slot with a UAV terminal and also remove it again when the slot is changed.

#

And probably also handle the player dropping the terminal with the inventory menu to prevent cloning it.

covert inlet
#

ahh yea i was kinda worried that it would be something like that

little eagle
#

It will be, because all that UAV terminal stuff is hard coded to the item in that slot.

covert inlet
#

so you would have to remove and store the classname of the ctab when the player gets in (cause i use ctab) add a uav terminal then swap it back over when the player gets out?

little eagle
#

this is for a mission?

covert inlet
#

Yea for my group's repo we wanted some kind of JTAC command vehicle, that had jets DLC radar and datalink so the JTAC can monitor all the aircraft and radar reports ect, and i thought i UAV terminal would be cool as well

little eagle
#

here is what I'd do

#
  1. add getIn / seatSwitched eventhandlers to the vehicle that hand out the UAV terminals and store the previous GPS slot item in a variable on the player unit
#
  1. the script also adds a loop that checks like every second if you're still in that vehicle and in that slot
#
  1. if not, then remove the UAV terminal and give back the old item
#

and end the loop

#

Dunno about how to handle dropping the terminal by using the inventory menu when inside...

#

But if it's for a private group, no one will abuse it, right?!

covert inlet
#

yea

#

Ill probably release if i get it working well

#

thanks for that commy

ionic aurora
#

Greetings gentleman , have i got the syntax right ?

player     setCustomAimCoef     0.2;
player     enableFatigue         false;

player     addEventHandler     [ 
                            "respawn",         {
                                            player setCustomAimCoef 0.2;
                                            player enableFatigue false;
                                            }
                            ];
                            
player addEventHandler        [
                            "TeamSwitch",     {
                                            player setCustomAimCoef 0.2;
                                            player enableFatigue false;
                                            }
                            ];
little eagle
#

TeamSwitch is not an object eventhandler

ionic aurora
#
player     setCustomAimCoef     0.2;
player     enableFatigue         false;

player     addEventHandler     [ 
                            "respawn",         {
                                            player setCustomAimCoef 0.2;
                                            player enableFatigue false;
                                            }
                            ];

how about now ?

little eagle
#

Well, TeamSwitch is still not an object eventhandler, but now your code at least has no lines that do nothing.

#

But whats up with the spaces?

peak plover
#

Yeah, I just threw up... in my pants...

covert inlet
#

@little eagle lol

ionic aurora
little eagle
#

Must be something with the SQF plugin.

#

Syntax is 👌

ionic aurora
#

@little eagle brilliant , thank you sir 😄

dusk sage
#

is that the runescape editor?

little eagle
#

It says "Atom", but I am not familiar with that gui.

warm gorge
#

Yeah thats Atom, looks very different to mine though. Whats the issue with it exactly?

little eagle
#

The red squiggly lines are interpreted as syntax errors by us, but the syntax is fine.

warm gorge
long hatch
#

@warm gorge are your shure, that Atom really use SQF-Syntax for this file?

warm gorge
#

What do you mean?

long hatch
#

that's how your Code look at my Atom installation

#

i use Atom 1.18.0 and the same Package for Syntax as you

fallen grotto
#

any scripters here able to help me change the way ai look?

subtle ore
#

@fallen grotto "look" ?

fallen grotto
#

yeah uniforms and such

#

i dont want the random ai

#

to look like police like they currently do

#

@subtle ore

subtle ore
#

@fallen grotto please give some context.

fallen grotto
#

So i have the occupation mod

#

and it spawns random ai in to hunt you down

#

and at the moment they look like police

#

I want to change them to look like banits

subtle ore
fallen grotto
#

yeah thats it

#

how do i change their clothes

subtle ore
#

Why don't you read it a bit before anything else

fallen grotto
#

okay thank you.

iron stream
#

how can I init a player (in multiplayer) to a side?

little eagle
#

That sentence is ill constructed.

#

I guess you're asking "How can I create a playable unit on a specific side".

#

But I'm not sure. It could mean something else.

#

Not worth answering when the question isn't clear.

#

That could only create more confusion.

iron stream
#

Sorry ^^

#

I meant

#

How do I set the side of a player when launching the mission

indigo snow
#

you place a unit, which belongs to a side, and set it to playable. any player can then choose to play as that unit?

iron stream
#

i wanted two players to spawn in a dlc plane each (same plane) so I had to place them in the same team

#

but change the side of one of them while being inside the plane

jagged halo
#

Hey guys, I've got a probably pretty basic question: I want to whitelist these (https://pastebin.com/jTCZTsbc) classnames on an arsenal box. How would i do this?

little eagle
#

@iron stream I guess what you want is to change the side of one player during the mission.

#

The way to do this is to let the unit join a group of the new side.

jagged halo
#

Thanks @little eagle will this just add either weapons or items or ect? or can i get it to add everything?

little eagle
#

One function adds the weapons, one adds the items, one adds the magazines and one adds the backpacks.

#

It's silly but I didn't make it.

remote flame
#

Is there like an easy script command for: All players. When scripting for dedicated servers?

little eagle
#

?

remote flame
#

Does it work in dedicated servers or just multiplayer in general?

little eagle
#

It works everywhere, but in SP it obviously only reports an array with a single item.

jagged halo
#

ok so i would have to seperate it into those types and then add it

#

the stuff thats like uniforms would go in items?

little eagle
#

You have to use the "weapon" version for whitelisting a weapon etc. Yes.

jagged halo
#

yeah

little eagle
#

the stuff thats like uniforms would go in items?
I think so, yes

jagged halo
#

kk

#

thats retarded

#

lol

#

but ok

little eagle
#

thats retarded

#

Exactly!

#

Well spoken.

jagged halo
#

rofl thanks for the help

little eagle
#

np yw

hollow lantern
#

can I somehow enable the debug console on my server while the mission is ongoing?

little eagle
#

No

hollow lantern
#

not even via linux serverside console access? lol ok

plucky beacon
#

_Bluforplayers = allPlayers select {side group _x == west}; Isn't this supposed to return all blufor players?

#

it's returning an empty array

little eagle
#

that particular expression reports nothing to be exact.

#

Maybe there are no players on west

plucky beacon
#

Does setcaptive make them civ even to the side return value?

little eagle
#

Yes, but side group should fix that.

plucky beacon
#

alright, I'm going to mess with allPlayers and see what it returns

little eagle
#

MP?

plucky beacon
#

yes

little eagle
#

Actual connected players beside you?

plucky beacon
#

0 :P

little eagle
#

This works on playable AI

plucky beacon
#

even if AI Disabled?

little eagle
#

No.

plucky beacon
#

okay

little eagle
#

If AI is disabled, then the units temporarily don't exist

#

And cannot be reported by either command.

plucky beacon
#

ahuh

#

oh pfft, god dammit. I still have this stupid problem where when I export to MP from Eden it doesn't overwrite the old file

#

so I need to close the game, delete the old one, relaunch it and rexport

little eagle
#

I blame windows.

peak plover
#

Rename with every version

remote flame
#

Can someone explain what _this select 0/1/2 means?

peak plover
#
[0,1,2,3,4] call {
   _array = _this;// _this is the array given as parameters
   _first = _this select 0; // _first will be equal  to the value of the element in the location 0 in the array
   _second = _this select 1;
   systemChat str _second; // returns 1 
};
```sqf
#

The elements in the array given as parameters can be anything, they can even be arrays

#

If you are using this in a function you would use params ["_first","_second"]; instead

#

Because with these you can set default values

#

Also faster and also makes the variables private

remote flame
#

Ok, I think I understand thx

#

What is the difference in a public and local variable?

jovial nebula
#

A global variable is defined on the whole machine

peak plover
#

local variable > _first this is pretty much only available in the script at hand.

jovial nebula
#

A local variable gets deleted when the script ends

peak plover
#

publicVariable is something that is transferred across the network to all clients

remote flame
#

So an local is just for me, and a public is for every player_

#

What is "Error Zero Divisor"?

vivid quartz
#
_arr= [0,1,2];
_elm=_arr select 3;//zero divisor
remote flame
#

ohhhhhhhh

vivid quartz
#

basically, trying to select something in array that doesnt exist

remote flame
#

aha ok thnaks

#

thanks*

#

@vivid quartz Do you know if spawning an object is the same as spawning an vehicle?

#

in script way

vivid quartz
#

in what way? createVehicle returns object

#

doesnt matter if you createVehicle a house or a heli, return will be object

remote flame
#

I am trying to create and script that drops supply drops at markers

#

so ofc I need to spawn an box

#

that has the loo

#

t

#

Ohh ok I see

vivid quartz
#

i have one on my main pc, but iam not there atm

remote flame
#

Ok, I want to have an heli drop it but that is very hard I think. So I am considering if I should just spawn an box already at the ground

plucky beacon
#
waituntil { count allPlayers select {side group _x == west} == count allPlayers select {!alive _x}};

If I have zeus and blufor players, and I want to waituntil all the blufor players are dead, would I be doing this right?

#

man that's a lot of red

remote flame
#

I am new to this but I think that "==" after "west}" is wrong

indigo snow
#

youll probably need some brackets in there, yea

#

also no that wouldnt do what youd want it to do

plucky beacon
#

:P damn

indigo snow
#

youre basically asking if the amount of blufor alive is equal to the amount of dead players

tough abyss
#

Hey Everyone, Im trying to make a script which well get the nearest groundweapon holder and then return the class names of all the items contained inside of the weaponholder. So far i have had no luck. This is 1 of the things i have tried to make

_cargo = nearestObjects [player,["weaponholder", "groundWeaponHolder", "WeaponHolderSimulated"],3];
{
hint format["Cargo: %1 / ArrayPos: %2", typeOf _x,_forEachIndex];
{
hint format["Iten: %1 / ArrayPos: %2", typeOf _x, _forEachIndex];
} forEach _x;
} forEach _cargo;

plucky beacon
#

well if the only other players are zeus and can't die that shouldn't be an issue?

vivid quartz
#

yeah, use createVehicle,

_myLootBox= createVehicle [classname, getMarkerPos "my_marker", [],0"none"]; _weps=["arifle_katiba_f", "arifle_ak12_f"]; 
{
_mags=getarray (configFile >> "cfgWeapons" >> _x >> "magazines");
_myLootBox addWeaponCargoGlobal [_x,1]; _myLootBox addMagazineCargoGlobal [selectRandom _mags, floor(random 4)+1];
}forEach _weps;

opfern, idk something like this, replace class name with name of box

remote flame
#

omg You are the best @vivid quartz 😘

vivid quartz
#

iam on phone cant type plus cant test

remote flame
#

Alright I understand

indigo snow
#

floor(random 4)+1 > ceil random 4

vivid quartz
#

yeah, that might be better

remote flame
#

What does that do? floor(random 4)+1 > ceil random 4

vivid quartz
#

random number from 1to 4

indigo snow
#

floor : round down, ceil : round up

#

minor nitpick that saves doing a +1

tough abyss
#

Anyone who has an idea regarding the weapongroundholder?

indigo snow
#

what errors are you getting?

#

for one, youre trying to iterate an object at ... } forEach _x;

#

you cant do that

tough abyss
#

_clear = nearestObjects [player,["weaponholder"],3];
_clear = _clear + nearestObjects [player,["groundWeaponHolder"],3];

{
_gunclass = typeOf _x;
hint format ["%1", _gunclass];
} forEach _clear;

#

Tried this and it returned "Groundweaponholder"

indigo snow
#

yea that looks about right

tough abyss
#

The thing im having trouble with is how i return the items inside the groundweaponholder

indigo snow
#

the XCargo family of commands

tough abyss
#

yeah i tried getItemCargo but with no luck

indigo snow
#

weaponCargo, magazineCargo, etc

#

ah theres that command too, yea

vivid quartz
#

@plucky beacon

waitUntil {{alive _x && side _x == west} count allPlayers == 0 };

? Maybe?

#

i think only 1 = is needed on side

#

@tough abyss why would you need to return whats inside the holder?

#

unless you arent creating holders by yourself

tough abyss
#

I want to first delete the weaponholder - I know how to do that
Then i want the content, the weapons and magazines what ever is on the ground to then be added into a crate

vivid quartz
#

yeah, how about setvariable loot on holder?

remote flame
#

@vivid quartz I found something with the script

#

it spawns crates NON-STOP

tough abyss
#

@vivid quartz setvariable loot? What would that do?

vivid quartz
#

what do you mean non stop?

#

@botker save an array into holder, and access it later with nearest objects

remote flame
#

well it spawns crate after crate after crate

#

after crate

#

after crate

indigo snow
#

thats on you

remote flame
#

It never stops spawning crates

indigo snow
#

script only creates one

vivid quartz
#

@remote flame from where are you calling the code?

tough abyss
#

I still dont see how that would solve my problem though, maybe im just stupid.

remote flame
#

init.sqf

#

Maybe I can fix it with sleep 60;?

vivid quartz
#

is it only you?

#

or is it MP ?

remote flame
#

MP

vivid quartz
#

so you have multiple people?

remote flame
#

yes it is for an dedicated server

vivid quartz
#

then run it on server only

remote flame
#

is that done with if (isdedicated) then {};

vivid quartz
#

yeah

remote flame
#

will try

vivid quartz
#

initServer.sqf works aswell

remote flame
#

is that a init file that only executes on the server?

vivid quartz
#

yeah

remote flame
#

well what is the differnce between runing on clients and servers?

tough abyss
#

If you run that script on server it will only run once, which is when the server starts.

#

if you use initServer.sqf

remote flame
#

It is still shiting out cargo boxes

vivid quartz
#

you cant addWeapon to server, thatd why you run addWeapon client side

#

or remoteExec it from server to client

#

and player on dedi is always null

#
"Hello iam server and i send this message to everyone" remoteExec ["systemChat", 0];
remote flame
#

I think it is spawning them half in the ground. a fix for that ?

vivid quartz
#

@OpFern idk how can it still spawn that many try
if !(isServer) exitWith {}; //client doesnt read

#

put it above crate spawning code

remote flame
#

No, I got it to stop spawning 1 million off them

#

But I think the box spawns in the ground

vivid quartz
#

it cant spawn in ground , marker doesnt have Z

remote flame
#

I am using an "empty marker" under "systems in the editor" that is correct?

vivid quartz
#

yeah marker types dont matter

remote flame
#

Still nothing

#

nothing spawns

vivid quartz
#

make sure that marker name is string

remote flame
#

so the marker name has to be "string"?

vivid quartz
#

y

subtle ore
#

String: "My super cool string" Not string: My super cool NOT string

vivid quartz
#

getMarkerPos ”mkr”;

remote flame
#

it is a string

#

look here:

#
fn_arudysupplydrop = {
_myLootBox= createVehicle ["B_supplyCrate_F", getMarkerPos "supplyEvent1"]; [; _weps = ["arifle_katiba_f", "arifle_ak12_f"]; 
{
_mags=getarray (configFile >> "cfgWeapons" >> _x >> "magazines");
_myLootBox addWeaponCargoGlobal [_x,1]; _myLootBox addMagazineCargoGlobal [selectRandom _mags, floor(random 4)+1>ceil random 4];
}forEach _weps;

};```
#

I cant find any errors

#

and I am not getting any

vivid quartz
#

your createvehicle is missing must be
_myLootBox= createVehicle [”B_supplycrate_F”, getMarkerpos ”supplyEvent1”,[],0,”none”];

remote flame
#

What is this [],0,"none"];

subtle ore
#

@remote flame did you not even read the parameters for createVehicle ?

remote flame
#

I did

subtle ore
#

markers: Array

#

placement: Number

#

special: String

#

Alternate syntax

vivid quartz
#

you can use

_myLootBox = type createVehicle getMarkerPos "mkr";

but i never use it

subtle ore
#

where as type would be your classname, and getMarkerPos 'mkr' would return your marker position

#

(x,y.z) format

#

Z will always be zero btw

remote flame
#

ok

#

@vivid quartz Why you never use it?

subtle ore
#

I'm not sure why you wouldn't. I believe getMarkerPos is the only getter command for marker positions afaik

vivid quartz
#

iam just not used to it, you can do alot more with alt syntax, like spawn jets in air with "fly" state

subtle ore
#

@vivid quartz I believe you meant to say the createVehicle command, as you had initially said you did not use getMarkerPos. I would have to agree with you however that the createVehicle alt syntax is more useful

remote flame
#

ok

#

@vivid quartz So I made it work it spawns and everything

#

BUT

#

It spawns with stuff in it and the stuff that you added

#

is there away to empty the box and then add what you want?

subtle ore
#

@remote flame removeWeaponCargo , removeItemCargo, removeBackpackCargo,removeMagazineCargo . If you are in MP then use the global variants of these commands

remote flame
#

Which is?

#

wait is it like removeWeaponglobalcargo?

subtle ore
#

removeWeaponCargoGlobal

remote flame
#

aha

#

thx

#

@subtle ore When I googled RemoveWeaponCargoGlobal

#

only came up "clearWeaponCargo"

#

is that the same?

subtle ore
#

Ah yes, totally my bad.

#

they are al clear instead of remove

remote flame
#

ok

#

Thanks 😃

subtle ore
#

Yep.

#

Does anybody know if you can nest if statements in the case condition for switch do ?

#

nevermind

remote flame
#

So I have this script ```private ["_eh1","_inArea","_pos","_unit","_zone1","_zone2","_dis"];
_unit = (_this select 0);

_zone1 = getMarkerPos "zone1"; // marker name for the areas you want to protect
_zone2 = getMarkerPos "zone2";
_dis = 15; // distance from area safe zone starts

if ((_zone1 distance _unit > _dis) or (_zone2 distance _unit > _dis)) then { //check if unit is in zone when script starts
_inArea = false;
}else{
_inArea = true;
_eh1 = _unit addEventHandler ["fired", {deleteVehicle (_this select 6);}];
};

while {true} do {

if (((_zone1 distance _unit < _dis) or (_zone2 distance _unit < _dis)) && (!_inArea)) then { // check if unit enters

  _eh1 = _unit addEventHandler ["fired", {deleteVehicle (_this select 6);}];
  _inArea = true;
  hint "Safe zone";
  _unit allowDamage false;

};

if (((_zone1 distance _unit > _dis) or (_zone2 distance _unit > _dis)) && (_inArea)) then { // check if unit exits

  _unit removeEventHandler ["fired", _eh1];
  _inArea = false;
  hint "You just left the safe zone";
  _unit allowDamage true;

};

sleep 1;

};```

#

But it dosent work...

tardy wagon
#

What does it actually do? What do you expect it to do

remote flame
#

I want it to make an "No fire zone" for players so that you cant fire weapons or throw fratgs

#

frags*

tardy wagon
#

one sec, reading code

remote flame
#

alright

tardy wagon
#

Are the zones circular?

remote flame
#

yes

tardy wagon
#

does whatever scripting language that this is require these braces around the not statement?

(!_inArea))

Normally I would just write this as ! _inArea

#

Also when you do the check to see if they have left the area. Couldn't you just do

if(_inArea) instead of having to re-write the massive if statement?

remote flame
#

Ok

tardy wagon
#

nvm, you need that

#

Do each of these scripts run on their own thread? if not you might be locking things up with the while {true}

mortal bobcat
#

does the script set in the "file" attribute of params run locally for every player who joins?

remote flame
#

Dont know @mortal bobcat

#

@tardy wagon That is a good point actullay

tardy wagon
#

Yeah I can't imagine arma spinning up a whole new thread for each script

#

way too many threads

#

other than that the logic looks correct

subtle ore
#

Scheduled vs Unscheduled

tardy wagon
#

Is that how arma handles syncing the update of these scripts?

subtle ore
#

Well, event scripts like initServer.sqf and init.sqf is all scheduled. Anything executed from that is supposed un scheduled afaik

tardy wagon
#

Yeah it sounds like scheduled is what he is looking for and he should figure out how to hook into the regular update sequence and run the check logic in whatever update function arma uses instead of running in an infinite loop

subtle ore
#

Yeah generally I like to do it on a need-to-know basis and exit whenever possible.

tardy wagon
#

I wish Arma supported C# or C++

subtle ore
#

Someday

tough abyss
#

Sqf feels like a mash sorta

vapid frigate
#

if that was running unscheduled the game would just freeze i think

subtle ore
#

supposed to

vapid frigate
#

easy enough to check if that is the problem though.. just add _this spawn { current code };

subtle ore
#

Hey Lecks, so I've basically riddled my code down to the following two lines:

_player addBackpack "tf_rt1523g_green";```.
Still no backpack, I don't see why the globalVariant wouldwork differently but yes I have tried that as well.
#

And uhh...nothing.

vapid frigate
#

i guess 2 reasons it'd do nothing are a typo in the backpack class or _player being null

subtle ore
#

oh, forgot the most important part. Executed in initPlayerLocal player does return the correct player and the backpack class is correct I triple checked it in the config viewer and checked the tfar github. Tried it all

#

I'm so fucking stumped.

tough abyss
#

initPlayerLocal if its already in their, why pass a param for player?

subtle ore
#

I already used player, and I was just endlessly checking for whatever worked

#

it still returns the player that player returns.

#

Seeing as how SQF sometimes doesn't even want to tell me when I'm missing a semicolon 🙄

vapid frigate
#

so u've diag_logged the _player in there?

subtle ore
#

Heh, yep.

#

You know what, I'm so done with this shit. _player returns the same player as player. I freaking switch it to player. AND you know what?

#

It worked.

tough abyss
#

thought so 😛

subtle ore
#

But, I don't understand.

#

Why oh why

tough abyss
#

try

#

instead of _player

#

_this addBackpack

#

see if that works

subtle ore
#

Well yes player works. _player also worked in other situations since it was passed by params. doesn't initPlayerLocal pass more than one parameter?

#

_this would be an array instead of an object in that case

vapid frigate
#

never used initplayerlocal tbh.. don't know if it has any quirks

#

i pretty much always use preinit or postinit (or init event handlers in objects)

subtle ore
#

Yeah I do as well, except this time I'm just going with: "Does it work first?"

#

So I'm going to guess player can't be used in switch do statements? : switch((getArray(configFile >> "CfgWeapons" >> typeOf player >> "displayName"))) do {case "Squad Leader" : {player addBackpack "tf_rt1523g_green";};};

peak plover
#

Why not if?

vapid frigate
#

don't see why plaer couldn't be used in a switch

subtle ore
#

@peak plover Doing multiple cases, just can't get the one to freaking work. Doing each for types of soldiers like engineer, rifleman, but specifically one for each backpack type. Ground versus Command etc

vapid frigate
#

but i think the issue there might just be getArray

#

should be getText

subtle ore
#

Oh are you serious did I do a typo?

#

shiieeet.. thanks @vapid frigate

vapid frigate
#

np

subtle ore
#

🤦 I seriously can't I believe I missed that

queen cargo
#

@tardy wagon both is supported via extension

subtle ore
#

Wow @queen cargo read that far up huh?

queen cargo
#

Watched Netflix the last few hours and wanted to respond since it was posted

#

SQF works like a charm as soon as one understands the concept behind it

#

It is less a script language and more like bash

#

A set of specific tools that can be used to create whatever one desire to

#

Following a fairly simple rule set

#

And now days debugging sqf is more simple than ever before

subtle ore
#

Well sort of. If SQF can't pickup on a missing semi colon or a bracket it's hard to find in a ton of one line shit

queen cargo
#

Use a good code editing tool

subtle ore
#

Like what...?

queen cargo
#

You also can grasp on ArmA.Studio for actual proper debugging

#

Notepad++ just has highlighting
Atom, sublime and visual studio code have linting

#

In addition

subtle ore
#

ArmA.studio sounds promising - built around a3

queen cargo
#

Early stages still

subtle ore
#

I'll try it anyways

queen cargo
#

But usable

#

Sublime or visual studio code can be more useful for plain linting right now due to the linter available is checking more stuff

ArmA.Studio only starts getting useful later in development

#

Or when you want to debug code

subtle ore
#

I've tried sublime before and didn't like it correcting my mistakes much. I like to be able to go back and add something manually. up until this point I've been using notepad.

tardy wagon
#

I'm sure you can call C++ or C# code. But there isn't really any API support for those languages is there?

queen cargo
#

Intercept adds an api you can use for c++

tardy wagon
#

whats that?

queen cargo
#

Addon

tardy wagon
#

link?

queen cargo
#

In case you just miss debugging code

#

Arma.studio will sure deliver

tardy wagon
#

looks cool. I should get into developing shit for arma. I've been doing game and graphics engineering for 10+ years

#

Do you know if intercept provides any methods for acquiring the D3D11 device?

queen cargo
#

Probably not

subtle ore
#

@queen cargo Where am I supposed to select my workstation at here? I selected my .atlis mission but to no avail

queen cargo
#

Check out the wiki @subtle ore

#

@tardy wagon what would you want it for?

subtle ore
#

Wow, I didn't see the wik on the github for some reason

tardy wagon
#

you could do all kinds of things with it

queen cargo
#

Just local

tardy wagon
#

yup

queen cargo
#

There have been people doing it though

#

You might better be of using sqf though

#

And all other stuff

#

Most shit already is possible using Ingame script commands and Config editing

tardy wagon
#

what kind of graphics API is there?

queen cargo
#

Script commands

#

All depends on what you want to do

tardy wagon
#

I want low level access to the D3D11 device and immediate context

dusk sage
#

Not via SQF, sorry 😃

tardy wagon
#

Is there any known way to access these?

dusk sage
#

Not that I could tell you sorry. You may have better luck with @still forum though

queen cargo
#

@tardy wagon what for

tardy wagon
#

Any cool ideas that I might come up with that would involve access to those, as I specialize in graphics and low level engineering

rotund cypress
#

Does anyone here know what the default marker font for markers in default map is?

#

@queen cargo There is a sqf linter for VSC btw?

vivid quartz
queen cargo
#

@rotund cypress yes

remote flame
#

Is there away to make the "cutText" command so it displays for all players?

vivid quartz
#

@remote flame use

remoteExec
#
[0, ["My awesome text!","PLAIN"]] remoteExec ["cutText", 0];
remote flame
#

So "My Awesome text!" will show to every player?

#

@vivid quartz

vivid quartz
#

yeah

remote flame
#

alright thx

cinder gyro
#

Just to confirm, can I use execVM outside of the init.sqf?

dusk sage
#

yes

boreal edge
#

Has someone an idea how to get the map-position of the spot where my cursor is hovering over a map control?

late gull
#

guys, a command to make chopper have engine on, full rpm and ready to fly?
i have engineOn but not rpm

little eagle
#

There is no command to change the rpm.

late gull
#

well i saw some mission there when u just join the chopper and switch on the engine, the rpm go to the max and u get ready to fly

#

don't know if is a good explain

little eagle
#

Idk, but I do know that there is no command to set the RPM.

boreal edge
#

If you want to do that on mission start: I think if you place the chopper in the air it is on full rpm. you could setpos it down on the ground again

late gull
#

there must be another way, i saw it with chopper on the ground and with engines off

boreal edge
#

Was it a mod? Some mod choppers are buggy and instantly go to full rpm

late gull
#

yes maybe was a mod

subtle ore
#

10 meters sounds too high, may break the gears or the skids

boreal edge
#

i think full rpm is only above 50-100m. set it very high and script it down again, gravity wouldnt be the best idea in my view

polar folio
#

did anyone find a way to detect the weapon switcing animations? or weapon switching in terms of when the new weapon is ready to shoot and stuff?

i thought it's all handled like gestures but seems like they did a totally seperate engine solution without adding hooks for people to work with it. i hope i'm jsut missing something

remote flame
#

So I got this script, I want it to spawn an crate the randomly between to markers I have placed but it only spawns one then stops.

simple solstice
#

Can you edit this and add SQF after 3 `?

remote flame
#

Doesent work

jade abyss
#

It does

#

``` sqf
NewLineWithCode
```

simple solstice
#
hint "it works!";
remote flame
#

nope

little eagle
#

dude

#
_missionType1 = [_this, 0, ""] call BIS_fnc_param; fn_goissesupplydrop = {

_myLootBox = createVehicle ["B_supplycrate_F", getMarkerpos "supplyEvent2",[],0,"none"]; clearWeaponCargoGlobal _myLootBox; clearItemCargoGlobal _myLootBox;
_weps = ["FirstAidKit","H_HelmetB_desert","arifle_MX_GL_F","hgun_Rook40_F","Rangefinder","arifle_MX_SW_F","U_B_CombatUniform_mcam","hgun_Pistol_heavy_02_F"];
{
_mags=getarray (configFile >> "cfgWeapons" >> _x >> "magazines");
_myLootBox addWeaponCargoGlobal [_x,1]; _myLootBox addMagazineCargoGlobal [selectRandom _mags, floor(random 4)+1>ceil random 4];
}forEach _weps;

    _Supplymarker2 = createMarker ["Supply Drop", getMarkerpos "supplyEvent2"];
    _Supplymarker2 setMarkerType "mil_objective";
    _Supplymarker2 setMarkerColor "ColorRed";
    _Supplymarker2 setMarkerText "Supply Drop";
    _Supplymarker2 setMarkerSize [1,1];

    _myHint ="Supply crate have been dropped!";
    GlobalHint = _myHint;
    publicVariable "GlobalHint";
    hintsilent parseText _myHint;
    
waitUntil {
    
    _nearPeople = nearestObjects[(getMarkerpos "supplyEvent2"),["MAN"],5];
   
    if((count _nearPeople) > 0) exitWith {deleteMarker _Supplymarker2};
    
};
 
    _mySChat ="A player have reached the supply crate!";
    GlobalSCHat = _mySChat;
    publicVariable "GlobalSCHat";
    player sideChat _mySChat;
    
sleep 3;
hint "";
      };     


_missionDetails1 = switch (_missionType1) do {
    case "arudy": {call fn_arudysupplydrop;};
    case "goisse": {call fn_goissesupplydrop;};
    
    //case "Corton": {call ;};
};

nul = [] execVM "scripts\supply\supplydropfinder.sqf";
#

It works just fine.

remote flame
#

Well how did you do it?

little eagle
#

```sqf
whatever
```

remote flame
#

I did that

#

nothing happend

little eagle
#

No you didn't

remote flame
#

yes I did

tough abyss
#

Please delete your other walls of texts too lol

#

No space between ` and sqf

remote flame
#

Done

#

Ok

#

Well there is the code

#

@simple solstice

tough abyss
#

Well. Goissupplydrop is defined, the other one isnt.

indigo snow
#

floor(random 4)+1>ceil random 4 oh dear

little eagle
#
floor(random 4)+1>ceil random 4

This looks... interesting.

#

ninja'd

indigo snow
#

bam

#

i think the best tip is gonna be to learn how to debug your own code tbh

tough abyss
#

Learn by doing. It's the best way.

indigo snow
#

copy pasting other peoples code is only gonna get you so far

tough abyss
#

I can't 👍 that, so here it is :+1:

indigo snow
#

strip it down bare bones, build it back up piece by piece

#

youll lose an afternoon or so but youll understand

little eagle
#

That weird line is a syntax error.

#

The expression reports a boolean, but addMagazineCargoGlobal expects a number.

indigo snow
#

its the result of a copy paste. i meant to say he should replace the first part with the second part as a nitpick on the one who originally wrote it

#

you can search back for most lines in that script in this channel over the last day or two

little eagle
#

ctrl + a
shift + del

vivid quartz
#
    _mySChat ="A player have reached the supply crate!";
    GlobalSCHat = _mySChat;
    publicVariable "GlobalSCHat";
    player sideChat _mySChat;

🤔

little eagle
#

Yup. It should be "has" because it's using the third person singular.

vivid quartz
#

na, not that, i dont get the point of this code

little eagle
#

I was kidding.

indigo snow
#

well its writing something to chat, of course

little eagle
#
"A player has reached the supply crate!" remoteExec ["systemChat"];
waxen jacinth
#

Can someone help me out on a little script?```player playMove "AinvPknlMstpSnonWnonDr_medic3";
sleep 0.2;
waitUntil { ((animationState player) != "AinvPknlMstpSnonWnonDr_medic3") };
_crate = cursorTarget;
_marker = "test_EmptyObjectForFireBig" createVehicle getPosATL _crate;
_marker setPosATL (getPosATL _crate);
_marker attachTo [_crate,[0,0,0]];
sleep 5;
_marker call fnc_deleteTestObj;
deletevehicle cursorTarget;
["Stash Burned!"] spawn ExileClient_gui_baguette_show;

vivid quartz
#

how are you calling this code?

waxen jacinth
#

@vivid quartz execVM 'SCRIPTS\burn.sqf';";

#

so far i just tried it only locally/server sided thru debug - so far, i just don't understand why the whole script is fired in once even tho waituntil and sleep is involved.

vivid quartz
#

i dont see any problems in this, how is sleep not working

lean tiger
#

Is there any generic command I can call to solicit string input from a player?

#

like
_input = ["What is your name?"] call bis_fnc_input;

waxen jacinth
#

as soon as i exectue the script: animation starts, fire is placed, object is deleted (but fire not) and ExileClient_gui_baguette_show is spawned - this happens within 1 sec. So i was curious what would be the right way

lean tiger
#

I made a UI fella last year, not eager to get my noggin into that again 😦

tame portal
#

@little eagle ```sqf
this doesnt work

#

awww it doesnt highlight this

#
_this```
little eagle
#

?

#

Did you just suffer a stroke?

tame portal
#

Yes

#

How come you think that

subtle ore
#

ruuude

rotund cypress
rancid ruin
#

etelka narrow I think

#

you can look through cfgFontFamilies to find it yourself in future @rotund cypress

#

good name for a font, very descriptive. font name adjective adjective adjective adjective adjective adjective (professional)

rotund cypress
#

@rancid ruin thanks mate, I was looking through the configs like crazy, but couldn't find it. Never thought of looking through that specific config however, looked through all the map controls.

rancid ruin
#

not specifically an Arma 3 question, but could just as well be:
what would be a good method to find adjacent polygons? e.g polygons representing district borders.

warm gorge
#
params [
    ["_amount", 0, [0]],
    ["_origin", [], [[]]],
    ["_radius", 0, [0]]
];

private _positions = [];

for "_a" from 0 to 360 step (360 / (_amount - 1)) do {
    _positions pushBack (_origin getPos [_radius,_a]);
};

_positions

I've got this script (can't remember who helped me with it on here), for generating x positions around a circle. For some reason it's returning the right amount of positions, however the first one in the returned array is the same as the last. Can't figure out whats been done wrong to cause this.

vivid quartz
#
params [
    ["_amount", 0, [0]],
    ["_origin", [], [[]]],
    ["_radius", 0, [0]]
];

private _positions = [];

for "_a" from 0 to 359 step (360 / _amount) do {
    _positions pushBack (_origin getPos [_radius,_a]);
};

_positions

?

#

@warm gorge

warm gorge
#

@vivid quartz Cheers, that works 😃

vivid quartz
#

yw ^^

tough abyss
#

did there something change regarding how to pass a object into a function such as the shooter in a fired EH that needs to be passed into a function call?

#

i get a syntax error [B Bravo missing ] where the error pointer is inbetween B and Bravo (out of memeory.. not on my pc currently)

#

the EH is defined in a cfgWeapons class like Fired = "[_this select 0, _this select 1, _this select 2] call MY_fnc_Bla";

#

this started to appear after i updated to yesterdays devbranch update

modern sigil
#

Is it possible to overwrite the fuelConsumptionRate or fuelCapacity config values of a vehicle via scripting?

vivid quartz
#
params["_pos"];
_vehicles= nearestObjects [_pos, ["Car","Truck"],20];
if (str(_vehicles) == "[]") exitWith {};
{
    _cur= _x;
    _dist= _cur distance _pos;
    _class= typeOf _cur;
    _name= getText (configFile >> "cfgVehicles" >> _class >> "displayName");
    _pic= getText (configFile >> "cfgVehicles" >> _class >> "picture");
    lbAdd [72003, format ["%1 (%2m)",_name,_dist]];
    lbSetPicture [72003,_forEachIndex,_pic];
    lbSetData [72003,_forEachIndex, str(_x)];
}forEach _vehicles;
#define LGD(IDC) lbData [IDC,lbCurSel IDC]
_data=LGD(72003);
_ddata= call compile _data; 
deleteVehicle _ddata;

any way to lbData an object as string? unstring it? cant get it to work, number is returned

dusky citrus
#

netId

#

objectFromNetId

vivid quartz
#

@dusky citrus thats exactly what i need, thank you

austere granite
#

Is there some magical thing going on with initDisplay and UI_F config overrides? I'm trying to use a different script for RscDisplayDebriefing, set up tthe configs, however somehow it's still loading the old script

#
class RscMissionEnd {
  idd = -1;
  duration = "11+2";
  fadeIn = 0.2;
  scriptName = "RscDisplayDebriefing";
  scriptPath = "FRL_MainUI";
  onLoad = "[""onLoad"",_this,""RscDisplayDebriefing"",'FRL_MainUI'] call     (uinamespace getvariable 'BIS_fnc_initDisplay')";
  onUnload = "[""onUnload"",_this,""RscDisplayDebriefing"",'FRL_MainUI'] call     (uinamespace getvariable 'BIS_fnc_initDisplay')";
};
little eagle
#

@tough abyss No.
@modern sigil No.
@austere granite No, but instead you should maybe add a dummy control, invisible RscText with onLoad script to not break what's supposed to be executed. This framework is not really meant for mods as it uses hardcoded folder paths.

austere granite
#

was just trying to add parameters for things like title and subtitle, so i dont need to make 50 templates

tough abyss
#

@little eagle any idea what my issue is then? :S

austere granite
#

but yea ended up with a workaround, still weird because initDisplay doesn't have any reference. Must be some hidden magic somewhere. The config entries change just fine when checking them, but it still loads the old stuff in somehow

little eagle
#

It's not hidden... It's a normal function with some hard coded paths.

austere granite
#

the paths in the function aren't hardcoded though

#

they read the config entries

little eagle
#

The file names are read by config, but the folder path is hard coded.

austere granite
#
        {
            if (getNumber (_x >> "scriptIsInternal") isEqualTo 0) then //--- Ignore internal scripts, they're recompiled first time they're opened
            { 
                _scriptName = getText (_x >> "scriptName");
                _scriptPath = getText (_x >> "scriptPath");
                
                if (_scriptName isEqualTo "" || _scriptPath isEqualTo "") exitWith 
                {
                    [
                        'Undefined param(s) [scriptPath: "%2", scriptName: "%3"] while trying to init display "%1"', 
                        configName _x, 
                        _scriptPath, 
                        _scriptName
                    ] 
                    call BIS_fnc_logFormat;
                };
                
                _script = _scriptName + "_script";
                
                if (uiNamespace getVariable [_script, 0] isEqualType {}) exitWith {}; //--- already compiled
                
                uiNamespace setVariable 
                [
                    _script,
                    compileFinal 
                    (
                        format ["scriptName '%1'; _fnc_scriptName = '%1'; ", _scriptName]
                        + 
                        preprocessFileLineNumbers format ["%1%2.sqf", getText (configFile >> "CfgScriptPaths" >> _scriptPath), _scriptName]
                    )
                ];
            };
        } 
        forEach ("isText (_x >> 'scriptPath')" configClasses _x);
#

reads scriptPath entry in the config class, then checks cfgScriptPaths for the path for that

little eagle
#
Fired = "[_this select 0, _this select 1, _this select 2] call MY_fnc_Bla";
#

I see nothing wrong with this.

#

It's a bit pointless though. Might as well just write:

#
Fired = "_this call MY_fnc_Bla";
#

Is that cfgScriptPaths a recent thing?

austere granite
#

no, it's been around for quite some time

little eagle
#

Karel Moricky, improved by Killzone_Kid

#

Probably was changed at some point.

austere granite
#

yea, it used to be initDisplay.sqf (and initDisplays.sqf) in UI_f, but now it's in functions_f

#

scriptpaths was already in the old version too though

#

I use it for my loading screen and it works fine there, but not this one somehow

#

anyway workaraound is good so w/e, still weird though

little eagle
#

Isn't this more of a #arma3_config question though? Or does this work with descrition.ext?

austere granite
#
class RscDisplayLoading {
    idd=102;
  scriptName="RscDisplayLoading";
    scriptPath="FRL_Interface";
    onLoad="[""onLoad"",_this,""RscDisplayLoading"",'FRL_Interface'] call     (uinamespace getvariable 'BIS_fnc_initDisplay')";
    onUnload="[""onUnload"",_this,""RscDisplayLoading"",'FRL_Interface'] call     (uinamespace getvariable 'BIS_fnc_initDisplay')";
};
#

config is fine, it's some hidden magic somehow

#

maybe anticheat stuff, because i remember that's how some did it in the past

little eagle
#
class RscDisplayLoading {
    class Script_Dummy: RscText {
        onLoad = "call whatever";
    };
};
#

This looks more reasonable tbqh

austere granite
#

well in loading case i wanted to get rid completely off the old one, and that one actually works perfectly fine, but RscMissionEnd doesn't somehow

#

anyway it's gutgut

#

moving on

little eagle
#

But it's not hidden magic.

austere granite
#
if (_this isEqualTo []) exitWith
{
    {
        {
            if (getNumber (_x >> "scriptIsInternal") isEqualTo 0) then
            {
                _scriptName = getText (_x >> "scriptName");
                _scriptPath = getText (_x >> "scriptPath");


                if (_scriptName isEqualTo "" || _scriptPath isEqualTo "") exitWith
                {
                    [
                        'Undefined param(s) [scriptPath: "%2", scriptName: "%3"] while trying to init display "%1"',
                        configName _x,
                        _scriptPath,
                        _scriptName
                    ]
                    call BIS_fnc_logFormat;
                };

                _script = _scriptName + "_script";
                if (configName _x == "RscMissionEnd") then {
                hidden_magicvar = [_scriptName, _scriptPath, format ["%1%2.sqf", getText (configFile >> "CfgScriptPaths" >> _scriptPath), _scriptName]];
                };
            };
        }
        forEach ("isText (_x >> 'scriptPath')" configClasses _x);
    }
    forEach
    [
        configFile,
        configFile >> "RscTitles",
        configFile >> "RscInGameUI",
        configFile >> "Cfg3DEN" >> "Attributes"
    ];

    nil
};
#

@little eagle dunno

#

seems magical tbh

little eagle
#

Well everything written in SQF is 'magical' in a way.

austere granite
#

okay it's not magic. there's another config entry which already compiles it final and then the one of rscmissionend gets disregarded

#

Magic

#

👌🏼

little eagle
#

Or... How about that. You're missing something.

austere granite
#

😄

chrome nebula
#

Looking for someone to do a task force radio script for me? Willing to pay

tough abyss
#

@little eagle i will try ```sqf
Fired = "_this call MY_fnc_Bla";

in the evening but i don't see this being any diffrent
rancid ruin
#

it saves you having to select each argument like you were before..

tough abyss
#

that's true but i don't see it solving the issue of the syntax error i get for passing the shooter into the function

#

it was added last year iirc

#

never made it into the wiki

#

Needs updated then 🤔

#
Added: A new "Fired" Even Handler for muzzle config (example: CfgWeapons/Default/EventHandlers/init = "hint str _this")```
https://dev.arma3.com/post/spotrep-00062
#

The EH fires, thats not the issue, bus since the last devbranch update i get a syntax error. I will have a close look at the function again, perhaps i fucked something up

#

If it isn't a big function, feel free to post here.

#

i'm in the office right now so no access to it 😛

#

Alrighty 😃

rotund cypress
#

Hey guys, Is it possible somehow to make a player able to walk while having a display open?

#

Never mind

little eagle
#

Yes, see the inventory display for example.

#

Or the ACE interaction menu

tough abyss
#

alright i've made some tests and i don't get the error if i have the function in the mission and recompile = 1; in cfgFunctions
the function is 1:1 a copy of the one used in cfgFunctions

the exact error i get is:

19:33:41 Error in expression <[B Alpha 1-1:1 (Lappihuan),"ww_weap_K98k_by>
19:33:41   Error position: <Alpha 1-1:1 (Lappihuan),"ww_weap_K98k_by>
19:33:41   Error Missing ]```
little eagle
#

file?

tough abyss
#

that confuses me aswell, it does not show any file nor any line number as it usualy does

#

or did you ment to see the script?

little eagle
#

hmm, maybe post full rpt?

#

It confuses me that it says "B Alpha 1-1:1 (Lappihuan)"

tough abyss
#

pastebin seems to be under heavy load, do you know a alternative?

little eagle
#

Which is how objects are displayed,

tough abyss
#

it is a object

little eagle
#

But not how you would write code

#

Yes, but it shouldn't appear as code

#

Because it's not correct SQF

tough abyss
#

hmm

little eagle
#

alternative

#

gist

#

If you have an Github account.

tough abyss
#

no i havent

little eagle
#

Ahh, it's really nice

tough abyss
little eagle
#

Two observations:

#
  • no filename, which suggests this code is written in a init box in the editor
#
  • B Alpha 1-1:1 (Lappihuan) which is a syntax error
tough abyss
#

what would be the correct syntax for that?

little eagle
#

[player, ...

#

[this, ...

#

etc.

tough abyss
#

ooh i tought since the muzzle is interpreted aswell that the object is interpreted too

little eagle
#

No, it's just copy pasting code around the error into the RPT

#

What does the line look like anyway?

tough abyss
#

i just found out that i probably search to early, one second

little eagle
#

I mean you did write this line? No?

#
[B Alpha 1-1:1 (Lappihuan),"ww_weap_K98k_by ...
#

^ this one

tough abyss
#

no

#

i only use variables

little eagle
#

Well what did you write? Or is it unknown where the error comes from?

tough abyss
#

checking right now if i search in the wrong place 😛

little eagle
#

No file suggest that you either used preprocessFile without FileLineNumber or it's an editor init box based script

tough abyss
#

maybe even BIS_fnc_addStackedEventHandler?

little eagle
#

Or loadFile I guess

#

Maybe.

#

There can't be that many lines with "ww_weap_K98k_by

tough abyss
#

thats the content of a variable aswell

#

i found the line:```sqf
}, (_this + [0,_playAction,time+300])] call BIS_fnc_addStackedEventHandler;

little eagle
#

I guess you could try commenting it out to see if that removes the error

#

BIS_fnc_addStackedEventHandler is pretty cancer

#

But it could very well be this script

tough abyss
#

i got a bit rusty with sqf but could be the array + array is fucking up

#

or yea maybe the BIS_fnc_addStackedEventHandler

#

is there any alternative to it? :S

little eagle
#

EachFrame mission eventhandler I guess

#

I'm not convinced the error is in here.

#

Looks like something else.

#

Should comment out and see if it disappears.

tough abyss
#

the problem is i need to comment out half of the script if i want to get rid of that line 😛

little eagle
#

/*

#

*/

#

???

tough abyss
#

sure but it could be anywhere in that part aswell

#

but yea gonna do that quickly

little eagle
#

That would be the best though. Then you'd know it's in there.

queen cargo
#

@tough abyss try ArmA.Studio
should give you better insight etc.

#

as you can pause the script execution to check the script properly

tough abyss
#

i still need to find time to install and set it up but yea i would really like to use it once i get back to scripting a bit more

queen cargo
#

"time to install" ... takes a brief moment

tough abyss
#

@little eagle error is gone when i comment it out

#

i fear BI changed something with the BIS_fnc_addStackedEventHandler function in the last update :S

little eagle
#

Nah.

#

I'm thinking...

#

replace

#
(_this + [0,_playAction,time+300])
#

with