#arma3_scripting

1 messages · Page 491 of 1

tough abyss
#

@drowsy axle player does not work on the server

#

also i suggest using waitUntil rather than sleep

drowsy axle
#

@tough abyss under what context can I wait 5 seconds?

#

nvm

#

thought about it

tough abyss
#
_memeTimer = time + [amount of time to wait]
waitUntil { time > _memeTimer};```
#

i find it more reliable

drowsy axle
#

cool

#
[[],{
    _currentTime = daytime;
    _wantedTime = 24 - _currentTime;
    skiptime _wantedTime;
}] remoteExec [ "spawn", 2 ];``` I done this for a SkipTime script. I needed.
#

Could someone be kind and review my coded attempt at functions / parameters? ```sqf
private param ["_actionObject","_actionMarkerWheel","_actionMarkerTrack"];

private _infostand = "Land_InfoStand_V1_F" createVehicle (getMarkerPos (str _actionObject));
missionNamespace setVariable ["_actionObject", _infostand];

_actionObject addAction ["<t color='#0097e6'>Spawn: <t color='#718093'>ACE Track", {
private _pos = getPos _actionMarkerTrack;
private _item = "ACE_Track" createVehicle [0,0,5];
_item setPos _pos;
},nil,1.5,true,false,"","true",5,false,"",""];

_actionObject addAction ["<t color='#0097e6'>Spawn: <t color='#718093'>ACE Wheel", {
private _pos = getPos _actionMarkerWheel;
private _item = "ACE_Wheel" createVehicle [0,0,5];
_item setPos _pos;
},nil,1.5,true,false,"","true",5,false,"",""];```

still forum
#

private param makes no sense

#

remove that private

#

missionNamespace setVariable ["_actionObject", _infostand]; are you sure you want to do what you are doing there?

#

MissionNamespace variable usually don't have underscores at the start

frigid raven
#

It is possible to render an own GUI instead of the map/briefing isn't it?

#

is it kinda trivial?

tough abyss
#

Trivial? Nothing about Arma GUI is trivial

frigid raven
#

Fuck sorry I said the forbidden

frigid raven
#

Christ I have a showDialog Script that runs at the very beginning when a player joins. I hooked it to the PlayerConnected event. Sadly the Dialog is not able to open right on time when testing on the deticated server... Even my script to spawn at a specific spot right after joining the mission fails some times.

Is there an event that triggers exactly when the player asset is being spawned on the map? Because that is the exact time I need to run it. Respawn does not work for the initial Player spawn.

earnest ore
#

If you don't mind waiting for the player to get control, you can opt to poll for their display with

waitUntil { !(isNull(findDisplay 46)) }
frigid raven
#

am actually doing this waitUntil {!isNull findDisplay 1101};

#

ah well wait a sec

#

what is display 46 again?

#

The options menu?

#

polling for the clientState "Briefing_read" now

#

works fine

frigid raven
#

ffs why doesn the friggin dialog appear on the dedicated machine !!!!

#

This is the script in my initPlayerLocal.sqf:

[] spawn {
    waitUntil { getClientState == "BRIEFING READ" };
    call X11_fnc_spawnInLobby;
    [] spawn X11_fnc_showLoginDialog;
};

It just does not render the friggin dialog. I gonna try @earnest ore approach... GAH!

tender fossil
#

Was there any way to execute code remotely in Arma 2 (OA)?

#

I'm confused because I thought there was

#

But can't find any reference to it

winter rose
#

@tender fossil call RE iirc

tough abyss
#

Hey can someone help me with a JIP compatible set face?

#

Basically what I need is for the script not to be called until the player is loaded in

#

As in on the ground

tender fossil
#

Ah, thanks @winter rose

winter rose
#

👍
@tough abyss could you say more please? I am not sure to get what you mean

tough abyss
#

Basically I'm making an African mission and I want them to be black

#

I am trying to script them black, but the script cannot be triggered until they load in or else they will not be able to load in

meager heart
#

🤔

tough abyss
#

it's so annoying

meager heart
#

setFace has local effect...

tough abyss
#

Yes I'm aware of that

#

The issue is making the script not fire until they've loaded into the mission

#

I think I figured it out though

#

i'm not sure if i asked here, but is there an eventhandler or something similar that returns true when the player can see the world?

#

nevermind, i rtfm

frigid raven
#

@tough abyss does this work for you? Because I try something similar. Having the player spawned on a specific location when in game and a dialog should show up. All works fine in preview but not on the dedicated. I'm running all this in initPlayerLoca.sqf and tried to hook on the PreloadFinished event, the ClientState "Briefing Read" and so many other phases... it never worked yet

#

some times the player spawned properly (without any equipped at all) but almost always there is no Dialog showing up. Today gonna try the solution with

waitUntil { !(isNull(findDisplay 46)) }

But it feels like a hack to me

mortal forge
#

I'm not too familiar with scripting but I installed a recruitment bot to recruit team ai and for some reason no matter where I am on the map, I can still recruit AI.

marble basalt
#

anyone know the function to check if a entity has been hit/shot?

#

trying to get a hint to show up on a object being shot

marble basalt
#

thanks

unborn ether
#

@marble basalt I rather still use HandleDamage as Hit has some issues, what's the purpose exactly?

marble basalt
#

trying to get a message to pop up when a player is shot

meager heart
#

I rather still use HandleDamage as Hit has some issues
HandleDamage has even more issues 😃

marble basalt
#

so how would i use it to display a hint?

unborn ether
#

@meager heart Well at least it triggers everytime, not like when it wants to. 😄

tough abyss
#

Does anyone know how to make a setFace script that is JIP and custom face compatible?

iron osprey
#

Hi all, when iterating on code that I test on a dedicated server, my workflow is this:

  • Make the code change
  • Open Eden Editor
  • Export -> Multiplayer
  • Copy .pib file from {game-path}/mpmissions to {server-path}/mpmissions
  • start up dedicated server
  • join dedicated server, test features

All in all, it takes around 3 minutes to test a new iteration, not including time spent coding.

Is there a quicker workflow with a faster turnaround time?

cheers 😃

dusky pier
#

Is possible to check if addon pbo is enabled?

#

i find this method, but idk if is right

#
isClass(configFile >> "CfgPatches" >> "A3_plants_f"
digital hollow
#

@iron osprey if you put the part of the mission you're testing into script, you can test it in the debug console on-server.

iron osprey
#

@digital hollow woa!

#

@digital hollow, I think you just replied to my thread on reddit, too

digital hollow
#

=p

iron osprey
#

Haha thanks for all of the help. I do web dev in my day job, do you also program outside of ArmA?

digital hollow
#

I dabble.

dusky pier
#
{
    if !(isClass(configFile >> "CfgPatches" >> _x)) exitWith {
        hint "У вас нехватает аддонов.";
        endMission "END1";
    };
} forEach [
    "A3_plants_f",
    "A3_structures_f",
    "A3_functions_f"
];
#

This works^^

thorn saffron
#

Is there a way to draw an line in the world, but in such way the line behaves like the 3D icon, ie, it stays the same size no matter the distance its drawn at.

drowsy axle
#

Is it possible to delete map locations?

#

Through scripting of course.

still forum
#

ones you created yourself sure.
Ones hardcoded into the terrain data, probably not. But I never tried

thorn saffron
#

Is there any command that returns the position of the currentWeapon muzzle position on the model? In a way so it works with pylon weapons

austere hawk
#

read config for what the muzzle selection points are and then get the position of that selection

#

thats for normal weapons. For pylons... hm. Not sure if theres an easy way - not sure if selections in proxies can be accessed via the selection position command

thorn saffron
#

Ok, seems that just getting the plane pos is enough to get my custom CCIP to work. Now I want to draw a line that goes from the impact point to the center of the screen. I think I may need to use the worldToScreen and then draw a line between the screen pos of the impact point to the center.

meager granite
#

drawLine3D is actual line in the world with objects drawing in front of it, if that's what you need

#

Otherwise use RscLine

thorn saffron
#

@meager granite And how do I do that? I want to draw a line between the screen position of the impact point to the center of the screen.

#

I got the impact point world position

tropic orbit
#

please can someone send me a working link to a place where i can get all the start files for my arma server including a random misson maker?

meager granite
#

Well if you want drawLine3d then draw it between your impact point and positionCameraToWorld [0,0,1]

thorn saffron
#

The problem is it would need to be drawn close to the screen otherwise it will be going toward the impact point. I want it to look like the line on the MFD HUD. However from what I read in the rscLine I would need to create a whole dialog system just for that, with is something I don't feel like tackling.

#

Alteratibly i could draw 3d line like this: _impactScreenPos = _impactPos worldToScreen > ???? > drawLine3D [_ImpactDrawPos, (positionCameraToWorld [0,0,1])]

#

The question in such case is: how do I get _ImpactDrawPos so its close to the screen.

meager granite
#

Not really, just ctrlCreate it on findDisplay 46

#

(Make sure to delete it afterwards)

brave jungle
#

am I doing something wrong here:
Clearly, otherwise I wouldn't be here, I should say what am I doing wrong here: waitUntil {(("Primary_Capture_Pep" call bis_fnc_taskState) == "SUCCEEDED") and (("Primary_Capture_Kraft" call bis_fnc_taskState) == "SUCCEEDED")};

#

I am trying to wait until both tasks are completed

ruby breach
#

Is it not delaying, or is it delaying infinitely? Is the function this is being called in scheduled or unscheduled? (Also, making your waitUntil condition a single boolean instead of two might be preferable)

neon snow
#

How could I create simple , invisible vehicle?

winter rose
#

@neon snow hideObject?

neon snow
#

Hmm, wont there be any issues with this on MP? Also what would be the simplest vehicle with one crew to fire a weapon?

winter rose
#

there is hideObjectGlobal, too

#

what exactly are you trying to do?

neon snow
#

Hmm actually nothing now ;d I wanted to bypass the thing that I cant assign a target to player but turns out I can so I am idiot

nocturne basalt
#

hi guys. Can I pass my action id to the script Im running in the action?

actionId = _player addAction ["Jump", {
    _this execVM "\WHobjects\air\jumppacks\scripts\jump.sqf";
};
#

I'd like to be able to delete the same action inside the jump.sqf script

winter rose
#

@nocturne basalt if you check addAction's biki page, you can find some parameters passed to the script; _this select 2 being the action's id 😉

nocturne basalt
#

ahhh sweet

#

thanks

winter rose
#

:+1:

brave jungle
#

@ruby breach unscheduled environment, error is generic error in expression

ruby breach
#

https://community.bistudio.com/wiki/waitUntil If the very first execution of the code returns true the command will exit immediately, therefore it will not produce any "Suspending not allowed in this context" error when used inside non-scheduled script. For all other uses it must be executed in environment that allows suspension (canSuspend), such as spawned or execVMed code.

ruby breach
glass zinc
#

does anyone know of any good Dev scripts that they use from the console to diagnose loops on the server? we are having memory leak issues with our server over about 6-8hr game spans. we think some of our scipts are just running cont or not ending properly. we need to find out which ones and its been pretty difficult to tell what is causing this.

drowsy axle
#

Is the use of params correct in this instance of carrying info over. ```sqf
param [_actionObjectLoadout,_actionObjectItem];

// Ranks

private _private = _actionObjectLoadout addAction ["<t color='#273c75'>Rank: <t color='#44bd32'>Private",{
        [] call CAP_fnc_private;
    },nil,1.5,true,false,"","true",5,false,"",""];
_actionObjectLoadout setUserActionText [_private , "Private", "<img size='2' image='\a3\ui_f\data\GUI\Cfg\Ranks\private_pr.paa'/>"];

private _corporal = _actionObjectLoadout addAction ["<t color='#273c75'>Rank: <t color='#44bd32'>Corporal",{
        [] call CAP_fnc_corporal;
    },nil,1.5,true,false,"","true",5,false,"",""];
_actionObjectLoadout setUserActionText [_corporal , "Corporal", "<img size='2' image='\a3\ui_f\data\GUI\Cfg\Ranks\corporal_pr.paa'/>"];

//
private _sergeant = _actionObjectLoadout addAction ["<t color='#273c75'>Rank: <t color='#44bd32'>Sergeant",{ 
        [] call CAP_fnc_sergeant;
    },nil,1.5,true,false,"","true",5,false,"",""];
_actionObjectLoadout setUserActionText [_sergeant , "Sergeant", "<img size='2' image='\a3\ui_f\data\GUI\Cfg\Ranks\sergeant_pr.paa'/>"];

//
private _staffSergeant = _actionObjectLoadout addAction ["<t color='#273c75'>Rank: <t color='#44bd32'>Staff Sergeant",{
        [] call CAP_fnc_staff_sergeant;
    },nil,1.5,true,false,"","true",5,false,"",""];
_actionObjectLoadout setUserActionText [_staffSergeant , "Staff Sergeant", "<img size='2' image='\a3\ui_f\data\GUI\Cfg\Ranks\sergeant_pr.paa'/>"];
#

@glass zinc you could put an iteration counter.

ruby breach
#

is _actionObjectLoadout an index and _actionObjectItem a default value?

drowsy axle
#

@glass zinc ```sqf
_number = CAP_stand_i + 1;
private _var = infostand + _number;
CAP_stand_i = _number;

// for your thing Apollo
diag_log format ["Iteration: %1, Time: %2", CAP_stand_i, time]; sqf
init.sqf:

CAP_stand_i = 0;```

ruby breach
#

I recommend you read that and understand what param does

drowsy axle
#

They aren't.. I forgot about that.

#
param [_actionObjectLoadout,nil,_actionObjectItem,nil];``` Would that work?
ruby breach
#

no

#

Read the wiki, look at the examples

#

also, param isn't params

#

You're using it like it's params

drowsy axle
#
private _val = param [0];```It would fetch `_actionObjectLoadout`
#

oh nvm

#

I get it. I meant params. My bad... ffs I now have to change 100 files.. 😦

ruby breach
#

You also have to convert all of your local variables into strings.

#

params ["_var"] not params [_var]

drowsy axle
#

I done that. It threw an error saying that addAction required an object... because it was a string.. Would I have to "unstring" it?

ruby breach
#
[1,"1"] call {
    params ["_var1","_var2"];
    typename _var1; //SCALAR
    typename _var2; //STRING
};
drowsy axle
#

oh wait. I was using param and not params, so using params shouldn't throw that error.

#

Thanks for that.

#

Yay! all my shit works... one fucking s

drowsy axle
#

@ruby breach ```sqf
if (debug) then { hq globalChat "fn_teleportBase"; };

params ["_actionObject","_teleportObject","_terminal","_teleportName"];

/*

Example:
[c_freedom_tel,c_liberty_obj,freedomTerm,"Teleport: USS Liberty"] call CAP_fnc_teleportBase;

*/

_actionObject addAction [_teleportName, {

params ["_actionObject","_teleportObject","_terminal","_teleportName"];

hq sideChat format["%1, please await for transportation..",name player];
_sound = selectRandom ["Orange_Choice_FadeIn_01","Orange_Choice_FadeIn_02","Orange_Choice_FadeIn_03","Orange_Choice_FadeIn_04","Orange_Choice_FadeIn_05"];
playSound _sound;
private _pos = getPos _teleportObject;
player setPos _pos;

}];``` _teleportObject isn't passed through/saved/changed when I come to do the addAction.

queen cargo
#

scoping @drowsy axle

#

addAction does not knows what was in the scope you added it to

drowsy axle
#

of course two times

queen cargo
#

your callstack for the ```sqf
{

hq sideChat format["%1, please await for transportation..",name player];
_sound = selectRandom ["Orange_Choice_FadeIn_01","Orange_Choice_FadeIn_02","Orange_Choice_FadeIn_03","Orange_Choice_FadeIn_04","Orange_Choice_FadeIn_05"];
playSound _sound;
private _pos = getPos _teleportObject;
player setPos _pos;

}``` part is literally:

Root
\- AddAction-Code

and not as you expect

Root
\- Script-File
 \- AddAction```
drowsy axle
#

ah right. how can I change that?

queen cargo
#

you cant

drowsy axle
#

Okay

#

makes sense.

queen cargo
#

addAction is not executed from within your scope

drowsy axle
#

I get that

#

postInit

queen cargo
#

but rather at some point the user decides

#

does not matters when 😉

drowsy axle
#

Okay

queen cargo
#

the engine calls your action at some point

#

not your script

drowsy axle
#

Right..

#

One second.

queen cargo
#

essentially, what is not executed immediate always will not have access to upper variables

#

you could use a global variable though

drowsy axle
#

I've done it here correctly: ```sqf
// [loadoutStand_0,itemStand_0] call CAP_fnc_controlLoadout;
params ["_actionObjectLoadout","_actionObjectItem"];

// Ranks

private _private = _actionObjectLoadout addAction ["<t color='#273c75'>Rank: <t color='#44bd32'>Private",{
        [] call CAP_fnc_private;
    },nil,1.5,true,false,"","true",5,false,"",""];
_actionObjectLoadout setUserActionText [_private , "Private", "<img size='2' image='\a3\ui_f\data\GUI\Cfg\Ranks\private_pr.paa'/>"];```
#

Before a came here.

#
// [] call CAP_fnc_private;
[] call CAP_fnc_removeAllGear;

player forceAddUniform "VSM_M81_Crye_tan_shirt_Camo";
for "_i" from 1 to 19 do {player addItemToUniform "ACE_fieldDressing";};
for "_i" from 1 to 2 do {player addItemToUniform "ACE_EarPlugs";};
for "_i" from 1 to 5 do {player addItemToUniform "ACE_CableTie";};
player addItemToUniform "ACE_Flashlight_XL50";
player addItemToUniform "ACE_MapTools";
for "_i" from 1 to 4 do {player addItemToUniform "ACE_morphine";};
... etc```
#

ooo quick question @queen cargo

#

Would it be more efficient to do: ```sqf
// [loadoutStand_0,itemStand_0] call CAP_fnc_controlLoadout;
params ["_actionObjectLoadout","_actionObjectItem"];

// Ranks

private _private = _actionObjectLoadout addAction ["<t color='#273c75'>Rank: <t color='#44bd32'>Private",{
   [] call CAP_fnc_removeAllGear;
        [] call CAP_fnc_private;
    },nil,1.5,true,false,"","true",5,false,"",""];
_actionObjectLoadout setUserActionText [_private , "Private", "<img size='2' image='\a3\ui_f\data\GUI\Cfg\Ranks\private_pr.paa'/>"];``` OR the above way with the function inside a function?
#

Would this work? ```sqf
params ["_actionObject","_teleportObject","_terminal","_teleportName"];

CAP_terminal = _terminal;
CAP_teleportObject = _teleportObject;

_actionObject addAction [_teleportName, {

hq sideChat format["%1, please await for transportation..",name player];

[CAP_terminal,3] call BIS_fnc_dataTerminalAnimate;
[CAP_terminal,0] call BIS_fnc_dataTerminalAnimate;

private _pos = getPos CAP_teleportObject;
player setPos _pos;

}];

CAP_terminal = nil;
CAP_teleportObject = nil;```

meager heart
#

😃

drowsy axle
#

👋

meager heart
#

duh harro

drowsy axle
#

What you smiling for dumbo?

meager heart
#

idk why you don't like wiki so much... 😃

drowsy axle
#

I do. It's just not straight forward for me to understand and learn from

#

I do use it. Believe it or not.

drowsy axle
#
_terminal isEqualTo CAP_terminal;
_teleportObject isEqualTo CAP_teleportObject;``` How are `CAP_terminal/CAP_teleportObject` undefined?
#

fuck this bullshit man. How the fuck can I pass from a local variable to a global variable?

#

= doesn't work == doesn't work isEqualTo doesn't work... hmm

meager heart
#
CAP_terminal = _terminal;
CAP_teleportObject = _teleportObject;
//--- bla bla
CAP_terminal = nil;
CAP_teleportObject = nil;
```🤔
#

How are CAP_terminal/CAP_teleportObject undefined?
that's really strange.........

iron osprey
#

In the init.sqf file on a dedicated server, shouldn't this give every player (even JIPs) an action?

player addAction ["test", "hint 'test'"];

#

I'm at a total loss right now, the only way I'm able to attach an action to a player on a dedicated server is this:

player addMPEventHandler ["MPRespawn", {
  _player = _this select 0;
  _player addAction ["test", "hint 'test'"]; 
}];
glass zinc
#

@drowsy axle thanks for you help!

iron osprey
#

Not even this works:

AttachAction = {
    player addAction ["test", "hint 'test'"];
};

remoteExec ["AttachAction", -2, true];
#

neither does this:

[[player, ["Test: BIS_fnc_MP", "hint 'test'"]], "addAction", true, true] call BIS_fnc_MP;
[player, ["Test: remoteExec", "hint 'woo'"]] remoteExec ["addAction", 0, true];
#

All I am trying to do is to add an action to every player in a dedicated server. I must have a major misunderstanding at the moment

iron osprey
#

this ended up being the solution. I put this at the beginning of my file:
waitUntil {time > 15};
Is there a more elegant way? Not even remoteExec or BIS_fnc_MP worked when allowing for JIP

drowsy axle
#

Was that sarcasm @meager heart ?

meager heart
#

noooo /s

still forum
#

@drowsy axle you are setting the variables to nil and wonder why they are nil....

#

The addAction code is executed once the player uses the action

#

which might be hours or days after your script finished running and has set the variables to nil

#

Not like I told you that a dozen times already

meager granite
#

@iron osprey Make sure your remoteExec functions are defined on all clients

#

Since you're dealing with JIP they need to be defined very early on

still forum
#

deployWeaponAuto I guess

finite jackal
#

Is there a script that I can global on every client that forces a players "Shift Click on map" waypoint to a specific position?

meager heart
#

🤔

thorn saffron
#

how do you add 2D vector arrays? like [x, y] + [w, z]

still forum
#

BIS_fnc_vectorAdd apparently supports 2D and 3D

thorn saffron
#

yeah, but vectorAdd does not, only 3 values, but its allright I figured it out

still forum
#

BI Forum needs more scripters to help out the people who don't want to get into Discord.. And also to push out the idiots who give bad advice.
"My script is lagging when I run it locally while I'm hosting a local MP server"

First guys answer: Use !isServer to not run the script on the server.
Yeah.. Not running the script at all will fix it lagging.. sure.
Second guy: Try replacing your execVM by call compileFinal "<script code here>"
Yeah genius.. As if replacing execVM by multiple other commands that will produce equivalent results will help anything.

Then I take a look at the script.

//--- Separate letters
_textArrayLines = [];
for "_i" from 0 to (count _textArrayUnicode - 1) do {
    _line = _textArrayUnicode select _i;
    _textArrayTemp = [];
    {_textArrayTemp = _textArrayTemp + [tostring [_x]]} foreach _line;
    _textArrayLines set [_i,_textArrayTemp];
};

//--- Merge arrays
_textArray = [];
_emptyArray = [];
_nArrayTemp = [];
_n = 0;
{
    _line = _x;
    _textArray = _textArray + _line + ["\n"];
    {
        _emptyArray = _emptyArray + [" "]; //--- Space
        _nArrayTemp = _nArrayTemp + [_n];
        _n = _n + 1;
    } foreach _x;
    _n = _n + 1;
    _emptyArray = _emptyArray + ["\n"];
} foreach _textArrayLines;
_finalArray = _emptyArray;

Yeah gee.. I wonder why that might be lagging a bit
It's apparently copied from a BIS function. Something infoText

meager heart
still forum
#

Okey yeah.. Really a straight copy-paste.. Ugh.. Why doesn't BI just let the community fix their crap scripts

#

Is that the intro text at bottom right when you start a mission? I still remember it horribly lagging back from DayZ mod times 😄

cosmic lichen
#

Why doesn't BI just let the community fix their crap scripts Because that would be too easy, wouldn't it?

queen cargo
#

that part of the script should even run in sqfvm 🤔

tough abyss
#

What’s wrong with infoText?

still forum
#

The code is.

tough abyss
#

Yeah, bout that

#

What’s wrong with the code?

still forum
#

It's from early Arma2 and has never been updated with the new script commands

#

and thus it's lagging AF

tough abyss
#

Well you can update pushback append and all that

still forum
#

exactly.

tough abyss
#

But I don’t think you can avoid toString toArray

still forum
#

Nope you can't. Atleast I didn't try to get rid of that in the optimizations I recommended

#

But in that code. Every ARRAY + ARRAY is a complete copy of both arrays. Which.. If you do that for every single char in a piece of text.. Get's quite extreme.

astral tendon
#

those effects are global? the task apears to every player in the server?

meager heart
#

better option bis_fnc_setTask

astral tendon
#

I had troubles with that one, JIP players create and get notificated of a task that was already done.

meager heart
#

bis_fnc_setTask has param for that ^

astral tendon
#

isGlobal?

meager heart
#

and

#

showNotification (Optional): Boolean - true to show notification (default), false to disable it

astral tendon
#

well, I want the player to get notificated of the task, is just anoying to JIP that join in my persistent mission and get flooded by the task notification.

meager heart
#

never had those issues

#

also you can make local tasks and just check states before...

#

(i mean...to fix any possible troubles with jip'ed players)

brave jungle
#

bis_fnc_playVideo is stopping itself about 2-3 seconds in. Not sure what the cause is, I use this code: ["Curious's Framework\media\intro_video.ogv"] call BIS_fnc_playVideo;

still forum
#

stops aka just goes black/disappears and the sound stops?

#

does the video play fine in VLC Player?

brave jungle
#

Disappears and sound stops

#

Yes

#

In the eden editor, if I place it in the debug console, it runs fine there too, it's at a weird aspect ratio, I think 4:3 but it runs

still forum
#

Maybe some other script running that kills it

brave jungle
#
    private _dur = 3;
    private _end = time + _dur;

    // Smoothly fade out the fake black screen
    while {time <= _end} do {
        BIS_fakeAlpha = (_end - time) / _dur;
        sleep 0.01;
    };

    // Remove the fake black screen entirely
    if (!(isNil {BIS_fakeBlackScreen})) then {removeMissionEventHandler ["Draw3D", BIS_fakeBlackScreen]};
    (uiNamespace getVariable "BIS_layerBlackScreen") cutText ["", "PLAIN"];

above is a sleep for how long the video is, it will disppear and no sound, wait the remianing time, then this happens

#

*note: I'm using a modifed version of bis_fnc_m01_intro

still forum
brave jungle
#

oh

still forum
#

Also your "dur" is 3? 3 seconds?

#

And the symptom you are seeing is the video ending after 3 seconds? These times match up.

brave jungle
#

Didn't spot that one

#

ha

#

then after it clears rscs

#

perhaps thats why

#

i'll give it a look

brave jungle
bronze comet
#

An example would be helpful since the wiki doesn't have any.

still forum
#

[] spawn {["Curious's Framework\media\intro_video.ogv"] call BIS_fnc_playVideo;}; wtf is that

#

either spawn or call.. don't try to jumble both together

iron osprey
#

@meager granite Thank you for the response :)

All functions are globally defined (ex: CreatePlayzone = { //... };) and are imported in the very beginning of init.sqf.

_scripts = [
  execVM "Util.sqf",
  execVM "Playzone.sqf",
  execVM "Base.sqf",
  execVM "Inventory.sqf",
  execVM "FoodSupply.sqf",
  execVM "WeaponSupply.sqf",
  execVM "ServerLoops.sqf"
];

{waitUntil {scriptDone _x;}} forEach _scripts;

Does that make the functions-to-be-remoteExec'ed available? Cheers!

tough abyss
#

Would using CBA_fnc_addPerFrameHandler make any difference in the following snippet?

params ["_display"];

private _control = _display displayCtrl IDC_aiCounterText;

[_control] spawn {
    waitUntil {(_this select 0) ctrlSetText format ["AI %1", str count (allUnits - allPlayers)]; false};
};
iron osprey
#

@meager granite, also, do I need to define every function (even nested funtions) that are remoteExec'ed in definitions.ext?

meager granite
#

Can't recall exactly, but I think JIP RE function execution happens BEFORE init.sqf

iron osprey
#

: O

#

holy guacamole!

#

also good morning!

meager granite
#

Yeah you need to define RE functions in CfgRemoteExec

#

Yeah init.sqf is pretty much the last thing that executes

#

So you either need to have your function in CfgFunctions on init your functions in scripts from some object init field

iron osprey
#

on init your functions in scripts from some object init field
What does that mean?

tough abyss
#

@iron osprey Why not make functions that return true when they've executed rather than constantly compiling normal scripts?

iron osprey
#

@tough abyss are you saying to have the last line of each .sqf file be true, and then amend the init.sqf file to be:

_scripts = [
  execVM "Util.sqf",
  execVM "Playzone.sqf",
  execVM "Base.sqf",
  execVM "Inventory.sqf",
  execVM "FoodSupply.sqf",
  execVM "WeaponSupply.sqf",
  execVM "ServerLoops.sqf"
];

{waitUntil {_x == true;}} forEach _scripts;
tough abyss
#

No

#

Functionalize all of those files

#

call them

#

and then return true

iron osprey
#

Functionalize all of those files
What does that mean?

Currently, all of the files are structured like this:

// Util.sqf
HintPlayer = { //...};
AddLiteAction = { //...};
//...etc
#

to clarify, the files are only composed of functions. The only file to include code outside of a function is init.sqf

#

is that what you mean?

still forum
#

Sounds like you should be using CfgFunctions instead

iron osprey
#

oooo

#

god damn I have a work meeting in 15 minutes that I should be preparing for but this is too exciting

#

@tough abyss, is this what you mean?

_scripts = [
  "Util.sqf",
  "Playzone.sqf",
  "Base.sqf",
  "Inventory.sqf",
  "FoodSupply.sqf",
  "WeaponSupply.sqf",
  "ServerLoops.sqf"
];

{
  _func = compile PreProcessFileLineNumbers _x;
  [] spawn func;
} forEach _scripts;
tough abyss
#

Have you never made a function before?

iron osprey
#

excuse me?

tough abyss
iron osprey
#

thanks for trying to help, but I'll ask others

tough abyss
#

I literally just gave you the biki article that has everything you need in it. Why would anyone waste time explaining everything to you when it's already written? If you have questions about things within that article that's when you come here to ask.

In short: RTFM

iron osprey
#

you know, I hope that when you are running in to issues after ~8 hours of debugging, that someone shows you more patience

tough abyss
#

Don't write buggy code in the first place

#

Problem solved

neon snow
#

So I tried from the wiki and it doesnt work, anyone could help?

vehicle player setWeaponReloadingTime [gunner (vehicle player), currentMuzzle (gunner (vehicle player)), 0];```
tough abyss
#

How you tried? Should be called after each shot

neon snow
#

With eventhandler Fired

#

Maybe I mess something up, will try again

tough abyss
#

What vehicle?

neon snow
#

Heli with missile launcher added with addWeapon

tough abyss
#

Which heli

neon snow
#

Mh6

tough abyss
#

There is gunner turret in it?

neon snow
#

Nevermind, the order was incorrect. Thank you, but it shouldnt require turrect,correct?

tough abyss
#

Who knows what gunner command will return

#

Ghosthawk has 2 guns but gunner returns a single unit, go figure

neon snow
#

lol ;d

runic surge
#

is it possible to get the position of terrain vertices?

unborn ether
#

@tough abyss @neon snow If you want to dig deep use fullCrew. The gunner of a vehicle might not be an actual gunner of a specific turret of the same vehicle. Simple example is Hummingbird, where pilot is a driver and also a gunner, but actually occupies exactly a driver role and the turret is controlled remotely.

#

Oh it might be Pawnee not Hummingbird.

young current
#

@runic surge if you know the cell size you can just create a grid with getposASL

runic surge
#

I actually don't necessarily need to get the positions of terrain vertices but I could to get an evenly spaced grid of positions around a certain point

#

that's what I was thinking actually

#

how do you create a grid?

young current
#

move even spaces in x, y directions

#

0,1 0,2 0,3 etc

#

best way to get help would be just coming out with what you are trying to do

runic surge
#

Right now I am trying to select positions based on 'steepness'

#

I already have that part mostly figured out I think, but for some reason I got stuck on the simple part lol

astral tendon
#

Is there a was to check words in a string? like ("String" in "Its a string") // true

winter rose
#

find works too! case-sensitive though 😉

cosmic root
#

You can toLower both sides if needed

winter rose
#

yep, even with 2× toLower I think it is faster than the inString function

astral tendon
#

Nice, thanks.

tough abyss
#

@winter rose have you seen the source for it? It is basically that

drowsy axle
#
params [_actionObjectTeleport,_teleportObject,_terminal,_teleportName];

/*

Example:
[c_freedom_tel,c_liberty_obj,freedomTerm,"Teleport: USS Freedom"] call CAP_fnc_teleportBase;

*/

_actionObjectTeleport addAction [_teleportName, {
    
    hq sideChat format["%1, please await for transportation..",name player];

    [(_this select 3 select 0),3] call BIS_fnc_dataTerminalAnimate;
    sleep 5;
    [(_this select 3 select 0),0] call BIS_fnc_dataTerminalAnimate;
    sleep 2.5;
    private _pos = getPosATL (_this select 3 select 1);
    player setPosATL _pos;

},[_terminal,_teleportObject],2,true,false,"","true",5,false,"",""];``` How is `_actionObjectTeleport` undefined?
radiant egret
#

Params ["_var1", ...]

ruby breach
#

I told him that yesterday

meager heart
#

wiki is "not straight forward for him to understand and learn from" © 🤷

tough abyss
#

@drowsy axle parameters need to be strings, much like how Skullfox pointed out.

drowsy axle
#

But the addAction has an error with saying it's a string that is being passed through.

#

How do I remove the _actionObjectTeleport from a string to a normal variable? Because was it's returning is "c_freedom_tel" when c_freedom_tel is an object. Which is what the addAction needs.

meager heart
iron osprey
#

Hi all, is it possible to run a .sqf file on a dedicated server via the debug console? the following command is not working:
[] execVM "C:\Users\{user name}\Documents\Arma 3\missions\{mission name}\init.sqf"

#

I am trying to do quick iteration of testing a .sqf file without having to restart the dedicated server

#

Note: dedicated server is at C:\Arma3, and ini file is at a completely different path. This means that a relative path to the dedicated server is incapable of reaching my main Arma 3 directory

digital jacinth
#

pretty sure you cannot execVM scripts outside your current missions folder. On top of that the paths needs to be relative from mission root. If you want to rapidly test your scripts I suggest using the debug console to overwrite your functions

iron osprey
#

Thanks for the response @digital jacinth. I tried placing the scripts in the mission folder on the dedicated server folder and in the client folder to no avail. Cheers

compact maple
#

@iron osprey why dont you just use call ?

iron osprey
#

@compact maple, thanks for the response. I don't understand, can you please post an example? Cheers 😃

cosmic kettle
iron osprey
#

@compact maple, can you explain the context of your statement "why dont you just use call ?"? I use call to invoke a function, but I do not see the correlation of how it can invoke a script file

#

@cosmic kettle thank you for the link, I am reading it now

compact maple
#

Well, afaik, and what I read here before is : you should use execVM on the client side if you're going to use the script only once.
But if you're going to use that script often you must use call or spawn.
functions are script, all of your script are defined in your functions.hpp, right ?

iron osprey
#

Nice, thanks for the elaboration!

#

all of your script are defined in your functions.hpp, right ?
All of my scripts are written in separated .sqf files and then are "execVM"ed in the beginning of init to make all functions available. This is before I learned about functions.hpp earlier today 😃

#

The goal is to rapidly iterate on code in a dedicated server without having to do these steps:

  1. edit the code
  2. open up eden editor
  3. export for multiplayer
  4. copy the pbo file to my dedicated server folder
  5. restart server

I am wondering if there is a process to edit the sqf file and load it without restarting the dedicated server

compact maple
#

well in the description.ext, you can write

class CfgFunctions {
    #include "Functions.hpp"
};

then create your functions.hpp file which look like that :

class Core
{
    tag = "mytag";

    class Master
    {
        file = "core";
        class initPlayer {};
    };
};
iron osprey
#

From my understanding, that makes the function "initPlayer" available to be used with "remoteExec", correct?

compact maple
#

no

iron osprey
#

ooooo

compact maple
#

with that functions.hpp you can do
call mytag_initPlayer;

iron osprey
#

call mytag_initPlayer in init.sqf?

compact maple
#

Where ever you want to call the script

#

depend on what the script is doing

iron osprey
#

Mhmm, and if I updated the contents of initPlayer, can I do call mytag_initPlayer in the debug menu to get the new contents of without restarting the server?

compact maple
#

No you have to restart your server

iron osprey
#

I see, thank you! That is what I was asking. I appreciate your time and effort

compact maple
#

But can't you work in 3den editor directly to debug your code instead to work on your server

#

so you just have to reload your mission

iron osprey
#

From my understanding, some code behaves differently in a dedicated server environment compared to the eden editor

#

I am running into tons of bugs due to it being my first time coding for a dedicated server, so I have been in a debugging process spanning multiple days and many hours 😃

#

and am looking to quicken my iterative process

compact maple
#

What kind of server are you running ?

#

more what kind of mission style ?

#

and about the remoteExec, if you want to be able to remoteExec a file you must allow it in CfgRemoteExec.hpp

iron osprey
#

I might not be understanding your question, I am running a server that runs a custom mission that I am writing

#

and about the remoteExec, if you want to be able to remoteExec a file you must allow it in CfgRemoteExec.hpp
cheers mate, thank you

compact maple
#

Oh okay, I was wondering if it was Exile, or Life, etc...

iron osprey
#

nope 😃

#

just custom scripts

#

hand written and freshly baked

cosmic kettle
#

@iron osprey, run it locally and fill missing data using local variables... If not, you're losing precious time each restart.

compact maple
#

^thats a good idea

#

I did this with DB script

iron osprey
#

run it locally
This means in the eden editor?

fill missing data using local variables
What does this mean?

If not, you're losing precious time each restart.
Damn right 😎

compact maple
#

well if you have something like

_myNumber = _this select 0;

you can just do

_myNumber = 0;
#

for debugging

cosmic kettle
#

Also, are you actually dedi hosting or launching host through A3? the latter can also be an option that allows for quick and easy manipulation of code.

iron osprey
#

@cosmic kettle Dedi hosting. This is because I noticed that other clients that connect to the server experience bugs that the server host does not (ex: actions are correctly assigned to server host, but not to clients)

#

and I needed to be able to trouble shoot their issues without taking up their time for helping test

cosmic kettle
#

Well, you can also do that using your A3 game installation. Requires some router setup etc for others to be able to connect, but way faster.

iron osprey
#

Cheers @cosmic kettle, I appreciate your help and time 😃

cosmic kettle
#

No problem, try starting with a blank mission and host it on your dev. environment using the integrated dedi (MP) game hosting in A3.

#

From there, you should be able to figure it out. Good luck!

iron osprey
#

the integrated dedi (MP) game hosting in A3.
I am not aware of an integrated dedicated MP game host. I am only aware of the separate server file that is downloaded outside of the Arma game client

#

As far as hosting a MP game that is integrated in the ArmA client, I am not aware of any dedicated options

compact maple
#

you can just go in 3den and click "play as multiplayer" or something like this, or in the multiplayer tab you have a host option

iron osprey
#

holy gaucamole

#

are you FOR REAL?

#

OMG

cosmic kettle
#

Enjoy your free time for actual life

iron osprey
#

LOL

#

dude, thank you

compact maple
#

lmao

iron osprey
#

alright, thank you @compact maple and @cosmic kettle, I'm gonna hit the hay, take care

still forum
#

you might need to have a pbo with a file at same path tho. So that the game knows it exists

dreamy mortar
#

Hi guys, I have a little question about the "setPlateNumber" commands, When i use it on a modded plate (we added the SPZ on the plate) it display the text like if it was transluscent. Do you have any idea of how i can fix it ?

here a link to a screen of the car
https://i.imgur.com/7XfBWWx.jpg

still forum
#

Did you ask the "author" of that car if he knows why?

dreamy mortar
#

hi dedmen, it seem that my "polite first "hi"" didn't worked. To answer to your question this model is in free use

still forum
#

That doesn't answer my question in any way

#

Did you ask the guy who "ported" that totally legit car model into Arma, if he knows why the number is transparent

dreamy mortar
#

Ho , i see my bad. i thought you wanted to ask if it was a totally legit car. My apologies. So to answer correctly this time yesn i asked him and he said "this command was pretty new and he didn't knew" it for him i came here because he said you are very good with arma 3.

#

it seem there are some parameters it can be added to the command like

classe PlateInfos {
name = "spz" ;
couleur [] = { 0 , 0 , 0 , 0,75 }; };

so if it work it will fix my problem.

still forum
#

These are config entries. Not script command stuff

dim terrace
#

pretty sure it's not "couleur " 😄

neon snow
#

I am trying to create script which will return the object I am looking at now, I made one but I want to give it some margin error so I can detect it when I am not looking directly at it?

removeAllmissioneventhandlers "Draw3d";
eh = addmissioneventhandler ["Draw3d", 
{
private _maxLockDistance=2000; 
_obj=lineIntersectsWith [eyePos player, (eyePos player) vectorAdd(positionCameraToWorld [0,0,_maxLockDistance] vectorDiff positionCameraToWorld [0,0,0]), objNull, objNull, true];
hint str (_obj select 0);
}];
still forum
#

positionCameraToWorld [0,0, Just do multiple lineIntersects but with non 0 in there

#

like.. 1 left and 1 up. And 1 right and 1 down

meager heart
#

also maybe BIS_fnc_inAngleSector 🤔

neon snow
#

@meager heart I think it will only work in 2d

compact maple
#

what about cursotObject ?

neon snow
#

It works but like one above, it only detects when I am looking directly at it

#

Also doesnt work in freelook

buoyant rune
#

This is going to sound stupid, and I feel stupid for asking it...but can someone ELI5 how the getPlayerScores function works? I'm working on a small TvT league in arma and I'm wanting to track those scores for stats

drowsy axle
#

@meager heart / @still forum Would this pass the stuff? ```sqf
_this select 0 = _actionObjectTeleport;
_this select 1 = _teleportObject;
_this select 2 = _terminal;
_this select 3 = _teleportName;

/*

Example:
[c_freedom_tel,c_liberty_obj,freedomTerm,"Teleport: USS Freedom"] call CAP_fnc_teleportBase;

*/

_actionObjectTeleport addAction [_teleportName, {

hq sideChat format["%1, please await for transportation..",name player];

[(_this select 3 select 0),3] call BIS_fnc_dataTerminalAnimate;
sleep 5;
[(_this select 3 select 0),0] call BIS_fnc_dataTerminalAnimate;
sleep 2.5;
private _pos = getPosATL (_this select 3 select 1);
player setPosATL _pos;

},[_terminal,_teleportObject],2,true,false,"","true",5,false,"",""];```

still forum
#

[_this select 0,_this select 1,_this select 2,_this select 3,] params ["_actionObjectTeleport","_teleportObject","_terminal","_teleportName"]; wtf?

#

for one it wouldn't work because you have a syntax error in there

#

second.. WTF are you trying to do there?

#

I can't see anything like that on

meager heart
#

@neon snow think about it like... a "cone shape object" with the center at first position points at the second position
also it will return true even if there some objects on the way...

radiant egret
#

Someone can link him a sqf starter guide ?

drowsy axle
#

Updated. ^

#

Would that work?

neon snow
#

@meager heart thats exactly what I am trying to do. However it needs to work with freelook and I would like it to be fast so many lineintersects might be problematic and I cant really create a shape like that(or I dont know how to)

ruby breach
#

Ded, he can't figure out how to properly use params

#

Even though like... 3 of us have told him how, linked him the wiki page, and even taken screenshots with big red circles (well, rectangles really, but still)

neon snow
#

I will try with positionCameraToWorld as the func work only in 2d

ornate quail
#

Hola, I'm currently struggeling with ropes, maybe someone could help me?
So, I made a model, it's a structure, now I want to attach a rope from one memory point to another within the structure. Didn't work.
So I placed 2 of those and tried to attach a rope between them. Didn't work with memory points nor coordinates.
Then I tried making it a car, instead of a structure, just to see if that makes a difference (inheritted from Car_F instead of House_f).... nothing.
That's the code I'm using: myRope = ropeCreate [x2, [0, 0, 0], x1, [0, 0, 0], 10];
x1 = Structure 1, x2 = Structure2.
Any idea?

still forum
#

wtf dude

#

@drowsy axle literally just choose one of the examples

#

@ruby breach 3 of us have told him how you forget about the dozens of other times days/weeks back where we already did

ornate quail
#

Can someone add to the ropes wiki that the model needs a Geo Phys LOD?
Can't register rn for whatever reason

#

(Also fixed my issue 👆 )

ornate quail
#

Well, somewhat fixed my issue, still not working as it is supposed to.
myRope = ropeCreate [pump, "rope_main_high", pump, "rope_main_low", 10];
(Attaching a rope from one mem point to another) = Doesn't work.

myRope = ropeCreate [x1, [0,0,0], pump, "rope_main_high", 10];
(attaching x1 to pump works) (x1 is a Quadbike)

myRope = ropeCreate [pump, "rope_main_high", x1, [0,0,0], 10];
(attaching pump to x1 doesn't work)

Conclusion, my structure can't be fromObject it only works when it is toObject but why?
Syntax ropeCreate [fromObject, fromPoint, toObject, toPoint, segments, length]

still forum
#

because simulation probably

ornate quail
#

Nope fixed it, fromObject can only be a Car, not a Structure

young current
#

possibly it needs to be a physx simulated object

still forum
#

Nope, I solved it by using a simulated object instead of a non simulated.
Why nope? That's exactly what I said

ornate quail
#

Lol, may have read it wrong.
It is jumping in the air now. And attach coordinate to coordinate works but when attaching mem point to mem point, game crashes

still forum
#

game crash :U lul 😄

#

mempoints on same object?

ornate quail
#

yep

still forum
#

as big as the rope segments are. I think it was never intended to connect between the same object.
Game crash should go to #arma3_feedback_tracker so that BI can fix it in 5 years

ornate quail
#

Yea...

unborn ether
#

If you use BIS_fnc_addStackedEventHandler over the same handler name will it override it removing previous stack, or just overwrite the name?

still forum
#

it should overwrite the name and maybe remove the old handler

ornate quail
#

Apparently attaching 2 mem points within the same object works for the quad bike, but not my structure...

#

I'll just quit Arma modding

#

I gave up

queen cargo
#

good @ornate quail

#

now you can start working on sqfvm

drowsy axle
#

@still forum I've done it the hard way, because I couldn't get my head around the params, even though I was, at first, doing it correctly. ```sqf
// USS Freedom to: X

c_freedom_tel addAction ["Teleport: USS Liberty", {

hq sideChat format["%1, please await for transportation..",name player];

[freedomTerm,3] call BIS_fnc_dataTerminalAnimate;
sleep 5;
[freedomTerm,0] call BIS_fnc_dataTerminalAnimate;
sleep 2.5;
private _pos = getPosATL c_liberty_obj;
player setPosATL _pos;

},nil,2,true,false,"","true",5,false,"",""];
c_freedom_tel addAction ["Teleport: Outpost Charlie", {

hq sideChat format["%1, please await for transportation..",name player];

[freedomTerm,3] call BIS_fnc_dataTerminalAnimate;
sleep 5;
[freedomTerm,0] call BIS_fnc_dataTerminalAnimate;
sleep 2.5;
private _pos = getPosATL c_outpost_obj;
player setPosATL _pos;

},nil,2,true,false,"","true",5,false,"",""];
c_freedom_tel addAction ["Teleport: Airfield", {

hq sideChat format["%1, please await for transportation..",name player];

[freedomTerm,3] call BIS_fnc_dataTerminalAnimate;
sleep 5;
[freedomTerm,0] call BIS_fnc_dataTerminalAnimate;
sleep 2.5;
private _pos = getPosATL c_fob_obj;
player setPosATL _pos;

},nil,2,true,false,"","true",5,false,"",""];

still forum
#

You were doing it correctly and then changed over to wrong?

#

your code itself was correct

#

just the params was wrong

ornate quail
#

@queen cargo nah I'm good. Maybe I'll start on Minecraft modding or something

drowsy axle
#

I couldn't un-string the first variable.

#

Because addAction needed an object, what it was, before being put into the function.

still forum
#

well according to your params' your first variable was always nil

ruby breach
#

even though I was, at first, doing it correctly. Considering you started off with param [_var1,_var2];, not really

still forum
#

you can't "unstring" a nil.

#

you can use getVariable to get an object from a variable

#

expecting that your string is the variable name of an object

drowsy axle
#

I don;t mean the fucking var = nil bullshit. I knew that it made it nil/not working

still forum
#

but then.. Why do you pass the variable name of the object as string? instead of passing the variable

drowsy axle
#

What do you mean? instead of passing the variable

#

I was passing the variable.

#
[c_freedom_tel,c_liberty_obj,freedomTerm,"Teleport: USS Liberty"] call CAP_fnc_teleportBase;```
#

c_freedom_tel is a variable / object.

#

All are apart from the actual string.

still forum
#

I don't see how you got a string then

drowsy axle
#

Because I was told. To put "" around _actionObjectshittyfuckingbulshitarsehole in the param

still forum
#

yeah.. That's correct

#

doesn't make the variable a string though

drowsy axle
#

it does for the addAction, for some fucking reason.

ruby breach
#

Mind the language, lest FM yell at you later

drowsy axle
#

It's not pointed at anyone.

#

just my fourth day of "tackling" this issue.

still forum
#

next time. If you have a problem please say what the problem is and post the error message if possible

drowsy axle
#

but tbh it works the "hard" way. Yes, it's not perfect or efficient. but I cannot be arsed waiting to figure it out.

ruby breach
still forum
drowsy axle
#

Yes, because it was throwing that error.

#

But it was later down to the fact that _actionObject was being a string, for some reason.

#

I didn't change anything, I fixed the param to params and then it said the above error.

still forum
#

Only possibility is that you did.

#

But just removing the quotes from the params and breaking it doesn't change that

ruby breach
drowsy axle
#
init.sqf:
[loadoutStand_0,itemStand_0] call CAP_fnc_controlLoadout; // _0 Loadouts and Items on Maintenance
[loadoutStand_1,itemStand_1] call CAP_fnc_controlLoadout; // _1 Loadouts and Items on USS Liberty
[loadoutStand_2,itemStand_2] call CAP_fnc_controlLoadout; // _2 Loadouts and Items on Breifing``` ```sqf
params ["_actionObjectLoadout","_actionObjectItem"];

// Ranks

    private _private = _actionObjectLoadout addAction ["<t color='#273c75'>Rank: <t color='#44bd32'>Private",{
            [] call CAP_fnc_private;
        },nil,1.5,true,false,"","true",5,false,"",""];
    _actionObjectLoadout setUserActionText [_private , "Private", "<img size='2' image='\a3\ui_f\data\GUI\Cfg\Ranks\private_pr.paa'/>"];``` This works.
#

@ruby breach I got around that, supposedly through },nil,1.5,true,false,"","true",5,false,"",""]; to },[_var1,_var2],1.5,true,false,"","true",5,false,"",""];.

still forum
#

https://discordapp.com/channels/105462288051380224/105462984087728128/499359000455020604

params ["_actionObjectTeleport", "_teleportObject", "_terminal", "_teleportName"];

/*
Example:
[c_freedom_tel,c_liberty_obj,freedomTerm,"Teleport: USS Freedom"] call CAP_fnc_teleportBase;
*/

_actionObjectTeleport addAction [_teleportName, {
    (_this select 3) params ["_terminal", "_teleportObject"];
    hq sideChat format["%1, please await for transportation..",name player];

    [_terminal,3] call BIS_fnc_dataTerminalAnimate;
    sleep 5;
    [_terminal,0] call BIS_fnc_dataTerminalAnimate;
    sleep 2.5;
    private _pos = getPosATL _teleportObject;
    player setPosATL _pos;

},[_terminal,_teleportObject],2,true,false,"","true",5];
drowsy axle
#

huh?

still forum
#

This is how you use params

drowsy axle
#

ohhhhh

#

fuck that xD

#

I thought it was because I already defined the params

#

I needed to do it again..

#

lol

still forum
#

I just don't see how a variable would magically turn into a string in there

drowsy axle
#

me neither

ruby breach
#

Reproduce now, post exact error

drowsy axle
#

Let me try one more time. With your edit of the params inside the dowha

still forum
#

And there again the.. Post your actual error message. Are you 100% sure that _actionObjectTeleport turned string? Or did maybe addAction complain about some other argument being string

drowsy axle
#

Okay. I'll let you guys know.

#
init.sqf
// USS Freedom to: X
[c_freedom_tel,c_liberty_obj,freedomTerm,"Teleport: USS Liberty"] call CAP_fnc_teleportBase;
[c_freedom_tel,c_outpost_obj,freedomTerm,"Teleport: Outpost Charlie"] call CAP_fnc_teleportBase;
[c_freedom_tel,c_fob_obj,freedomTerm,"Teleport: Airfield"] call CAP_fnc_teleportBase;

// USS Liberty to: X
[c_liberty_tel,c_freedom_obj,libertyTerm,"Teleport: USS Freedom"] call CAP_fnc_teleportBase;
[c_liberty_tel,c_outpost_obj,libertyTerm,"Teleport: Outpost Charlie"] call CAP_fnc_teleportBase;
[c_liberty_tel,c_fob_obj,libertyTerm,"Teleport: Airfield"] call CAP_fnc_teleportBase;

// Airfield to: X
[c_fob_tel,c_liberty_obj,fobTerm,"Teleport: USS Liberty"] call CAP_fnc_teleportBase;
[c_fob_tel,c_freedom_obj,fobTerm,"Teleport: USS Freedom"] call CAP_fnc_teleportBase;
[c_fob_tel,c_outpost_obj,fobTerm,"Teleport: Outpost Charlie"] call CAP_fnc_teleportBase;

// Outpost Charlie to: X
[c_outpost_tel,c_liberty_obj,outpostTerm,"Teleport: USS Liberty"] call CAP_fnc_teleportBase;
[c_outpost_tel,c_freedom_obj,outpostTerm,"Teleport: USS Freedom"] call CAP_fnc_teleportBase;
[c_outpost_tel,c_fob_obj,outpostTerm,"Teleport: Airfield"] call CAP_fnc_teleportBase;``` Just booting arma.
#
fn_teleportBase.sqf
params ["_actionObjectTeleport", "_teleportObject", "_terminal", "_teleportName"];

/*
Example:
[c_freedom_tel,c_liberty_obj,freedomTerm,"Teleport: USS Freedom"] call CAP_fnc_teleportBase;
*/

_actionObjectTeleport addAction [_teleportName, {
    (_this select 3) params ["_terminal", "_teleportObject"];
    hq sideChat format["%1, please await for transportation..",name player];

    [_terminal,3] call BIS_fnc_dataTerminalAnimate;
    sleep 5;
    [_terminal,0] call BIS_fnc_dataTerminalAnimate;
    sleep 2.5;
    private _pos = getPosATL _teleportObject;
    player setPosATL _pos;

},[_terminal,_teleportObject],2,true,false,"","true",5];```
still forum
#

I guess these are variable names assigned via the edit box when you doubleclick a object in editor?

drowsy axle
#

Yes.

#

wtf

#

It works...

#

😢 Thanks @still forum & @ruby breach

#

I was on the right track with [_this select 3, etc] params ["_terminal", "_teleportObject"]; just needs to be inside the addAction and ()'s.

still forum
#

you previous _this select 3 select 0 code was just fine and should've worked. It was just ugly so I changed it

drowsy axle
#

I should keep in mind that arguments are ()

#

It should of

#

so idk

#

y

still forum
#

arguments aren't ()

drowsy axle
#

oh

still forum
#

that's just to make it more readable and group them together

#

Like in simple math equations when you use ()

#

1+5*3 = 16
but (1+5)*3 = 18

drowsy axle
#

yup

#

Makes calcs work that way

still forum
#

with the params it's the same

drowsy axle
#

Okay

still forum
#

(_this select 3) params ["_terminal", "_teleportObject"]; is what you want to do. First _this select 3, and then the params.
If you leave the () away and don't group the _this select. Arma will try to do the grouping. And Arma might try to do
_this select (3 params ["_terminal", "_teleportObject"]);
which would be wrong.

#

Arma can't read your mind. So you gotta tell it exactly what you want

drowsy axle
#
init.sqf
[itemsACEStand_0,itemsACEStandPad_0,itemsACEWheel_0,itemsACETrack_0] call CAP_fnc_itemsACE;
[itemsACEStand_1,itemsACEStandPad_1,itemsACEWheel_1,itemsACETrack_1] call CAP_fnc_itemsACE;``` ```sqf
fn_itemsACE.sqf
params ["_actionObjectACE","_ObjectPad","_itemsACETrack","_itemsACEWheel"];

_actionObjectACE = createVehicle ["Land_InfoStand_V1_F", (getPosATL _ObjectPad), [], 0, "CAN_COLLIDE"];
_dir = getDir _ObjectPad;
_actionObjectACE setDir _dir;

_actionObjectACE addAction ["<t color='#0097e6'>Spawn: <t color='#718093'>ACE Track", {
    (_this select 3) params ["_itemsACETrack"];
    private _pos = getPosATL _itemsACETrack;
    private _item = "ACE_Track" createVehicle [0,0,5];
    _item setPosATL _pos;
},[_itemsACETrack],1.5,true,false,"","true",5,false,"",""];

_actionObjectACE addAction ["<t color='#0097e6'>Spawn: <t color='#718093'>ACE Wheel", {
    (_this select 3) params ["_itemsACEWheel"];
    private _pos = getPosATL _itemsACEWheel;
    private _item = "ACE_Wheel" createVehicle [0,0,5];
    _item setPosATL _pos;
},[_itemsACEWheel],1.5,true,false,"","true",5,false,"",""];```
#

Boom.

#

This makes sense now..

#

omg

still forum
#

wait a second...

drowsy axle
#

Wut?

still forum
#

private _pos = getPosATL _itemsACETrack; that won't work.
_itemsACETrack is "itemsACEWheel_0" a string

#

getPosATL doesn't take a string I think?

drowsy axle
#

oh wait. I needed to delete the ""'s in init.sqf my bad

#

Sorted

#
AxeriusNetwork
[EC:master] 1 new commit
a640cd6 Finally fixed it all. Everything works. - AxeriusNetwork```
#

I shall put you and @ruby breach in the credits.

#
/*
CREDIT to:

@Dedmen and @Gnashes on the ArmA 3 Discord for helping me fix and figure out params, addAction and passing it through. Making it all work.
*/```
still forum
#

helping me fix*
addAction*

drowsy axle
#

ffs xD

#

Happy now 😛

#

I love github.. so helpful.

iron osprey
#

@still forum, thanks for the message with -filePatching. Would I put that in the target parameter for both my dedicated server and the client? Cheers

still forum
#

only the thing that wants to load that file

#

I guess your server

iron osprey
#

Thanks

#

@drowsy axle I read over your trials and tribulations this morning. Congrats on making it to the other side. If you have questions on understanding some of the basics (params, assigning variables), shoot me a DM

drowsy axle
#

Thanks

#

Atleast I can pass stuff through functions. Never used functions, so I haven't gone through the trials with them like most things.

iron osprey
#

Hell yeah dude good job

nocturne basalt
#

is it possible making a man immune to fall damage?

sturdy cape
#

hey there.ive got a problem with a plugin ive created.i´m having apluginaction with condition _cursor in vehicles inside of the config.cpp,call a function with [_cursor] call fuctionname blabla (the usual stuff) but i get undefined variable in expression _cursor errors.what could that be?

#

_cursor is defined as cursorobject from a pluginmanager the system provides

still forum
#

"what could that be?" I'm guessing something in your script is making that variable be undefined

#

cursorObject is not always defined.

sturdy cape
#

the system i am using is apms and razer told me the pluginmanager of this system defines _cursor as cursorobject to start with

#

i can call the functions without param no problem

tough abyss
#

Could trigger EH when free fall animation plays and allowDamage false @nocturne basalt

#

Or check Anim in HandleDamage and cancel the damage maybe

sturdy cape
#

will give an example: ```sqf

class CfgPluginActions {
class Vehicles {
text = "Unlock";
Condition = "(_cursor in vehicles)";

    class Actions {
        class ResetLock {
            text = "Claim Vehicle";
            condition = "(_cursor getVariable ['oOwner',''] == '')";
            action = "createDialog 'DS_Padlock';[_cursor] call PVE_fnc_initReset;";
        };
        class Lock {
            text = "Lock Vehicle";
            condition = "(locked _cursor == 1) && (_cursor distance player < 5)";
            action = "createDialog 'DS_Padlock'; [_cursor] call PVE_fnc_initLock;";
        };
        class Unlock {
            text = "Unlock Vehicle";
            condition = "(locked _cursor == 2) && (_cursor distance player < 5)";
            action = "createDialog 'DS_Padlock'; [_cursor] call PVE_fnc_initUnlock;";
        };
        class Unclaim {
            text = "Give up Vehicle";
            condition = "!(_cursor getVariable ['apms_unlockcode', []] isEqualto []) && (locked _cursor < 2) && ((_player getVariable ['pUUID','do not']) isEqualTo (_cursor getVariable ['oOwner','']))";                
            action = "createDialog 'DS_Padlock';[_cursor] call PVE_fnc_initUnclaim;";
        };
    };
};

};
thats where i call the init of the script

#
_cursor  = _this select 0;

disableSerialization;
_display = findDisplay 4003;

_ctrl = _display displayCtrl 2400;
_ctrl buttonSetAction "[_cursor ]call PVE_fnc_unlockVehicle";
_ctrl ctrlSetText "Unlock";```thats the init
still forum
#

Yeah... Well

sturdy cape
#

inside of the script that comes after that i grab the param with _this select 0; again

still forum
#

It is undefined in the button action

#

The variable is defined in your script yes. But you are not executing the button action code

#

that button action code might be executed arbitrary time later when the _cursor variable is looong gone

nocturne basalt
#

@tough abyss yeah I can try to make a fancy script that uses allowdamage when in the air, or right before impact

still forum
#

What you can do is setVariable onto the control. And you can probably get it back inside the button action code with getVariable

sturdy cape
#

so sqf _ctrl setvariable ["param_sent",true,false];

#

or how?

tough abyss
#

Falling animation starts with afal...

neon snow
#

I have a script that deletes projectile in Fired eventhandler, fires next one using fireattarget command, and returns one missile to the vehicle so it looks like it fired once. The issue I have is with weapons which magazine has 1 ammo :/

vehicle player setVariable ["MissileFired", false, true];  
vehicle player addEventHandler ["Fired", {  
 params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];  
 private _ammoName = getText(configFile >> "CfgMagazines" >>_magazine>> "ammo"); 
 private _OneMissileException = getNumber(configFile >> "CfgMagazines" >>_magazine>> "count"); 
 private _airLock = getNumber(configFile >> "CfgAmmo" >> _ammoName >> "airLock"); 
 private _ir = getNumber(configfile >> "CfgAmmo" >> _ammoName >> "Components" >> "SensorsManagerComponent" >> "Components" >> "IRSensorComponent" >> "AirTarget" >> "minRange"); 
 if(_airLock==2&&_ir>100)then{ 
  vehicle player setWeaponReloadingTime [player, _muzzle, 0];  
  if(vehicle player getVariable "MissileFired")then  
  {  
   vehicle player setVariable ["MissileFired", false, true]; 
  }else{  
   deleteVehicle _projectile;  
   vehicle player setVariable ["MissileFired", true, true];  
   vehicle player setAmmo [_weapon,(vehicle player ammo _weapon)+1];  
   if(_OneMissileException==1) then{ 
   vehicle player addMagazine _magazine;  
  }; 
   vehicle player fireAtTarget [h1, _muzzle];  
  }; 
 }; 
}];
still forum
#

@sturdy cape yeah... like that..

#

the false at the end is useless tho

tough abyss
#

You can only use setVar with public arg on missionNamespace vars, never on control

sturdy cape
#

so not false but nothing?

still forum
#

yes

sturdy cape
#

alright will test this

tough abyss
#

Fire normal, delete missile, create another one, set dir and velocity from original

young current
#

you can just setpos set dir on the fired missile

neon snow
#

Yes however I need it to react to flares and movement of vehicle

#

So I wanted it to be engine handled

#

So maybe there is a way to either detect which pylon missile was fired of or somehow block missile from firing at all?

sturdy cape
#

turns out _Cursor being undefined inside the config.despite me having a line in there that says "_cursor = cursorobject;"

still forum
#

I think you might not be understanding local variables and scopes

young current
#

@neon snow you mean like it was locked?

sturdy cape
#

well yeah i guess i got something wrong there

neon snow
#

@young current I just want one missile to disappear but not decrease ammo this time, and fire another and decrease ammo this time

young current
#

yes but fire it as it was locked on to something? or just fly dumb?

#

and why fire another when you can just alter anything on the one just fired?

neon snow
#

Yeah I want to lock this missle to a jet for example

#

however I didnt find any command to do that

young current
#

I dont think there is a command like that

neon snow
#

fireatTarget handled everything for me

young current
#

oh ok so it fires as if thing was locked?

#

good to know

#

so you want to alter what is locked?

neon snow
#

Yep

young current
#

soo like extend AA lock range and stuff like that?

neon snow
#

I am creating something like JHMCS from F18, that you lock something you look at, no key presses or anything

young current
#

intersting

#

ok then you likely need to do it as you were

neon snow
#

Everything was good until I fired a missile that has ammo count of 1 ;d

#

it instantly changes to other pylon and setAmmo doesnt work

drowsy axle
#

How do I make an interactive static object (an object that doesn't fall if in the air)?

still forum
#

setMass 0 maaaaybe? Will never be perfect though I guess

tough abyss
#

EnableSimulation false

drowsy axle
#

I still want to have an addAction on it @tough abyss

#

I could make it cursorObject.

#

Based around a trigger thisList

still forum
#

I don't know if actions still work if you attachTo

#

That might be an option too

tough abyss
#

AddAction works

#

On enableSimulation false PhysX object

drowsy axle
#

Oh right

#

They never have for me.

tough abyss
#

Not surprised tbh

drowsy axle
#

Why?

tough abyss
#

You tell me

sturdy cape
#

@still forum i think my problem is sqf action = "createDialog 'DS_Padlock'; call PVE_fnc_initUnlock;"; i am not able to call the function with param in an action it seems.any hint on how i can get the param to the next file?

#
action = "createDialog 'DS_Padlock';`[_cursor] call PVE_fnc_initUnlock;";```wont work,the condition seems to be able to get _cursor but i cant send it to the next script
#

that are the moments where i see my abilities are limited as F

meager granite
#

What is _cursor in condition?

sturdy cape
#

@meager granite _cursor is defined as cursorobject by a pluginmanager.will have a look how it passes this to the config.

#
        _text = getText(_action >> "text");
        _condition = "[player,vehicle player,cursorObject] call {params['_player','_vehiclePlayer','_cursor'];" + getText(_action >> "condition") + "};";
        _aCode = getText(_action >> "action");
#

tbh i got no clue where _cursor comes from but its used in the condition that works to make a cursorobject the object thats lockable when looking at it

#

condition = (_cursor in vehicles); is the condition which makes them all happen

queen cargo
#

What horrible thing are you using where that Code is used @sturdy cape

iron osprey
#

Just got Cuisine Royale ready for multiplayer

  • 3 teams equidistant to a central helicopter landing
  • helicopter lands every 90 seconds in center to drop off 15 food
  • player can steal a special ingredient from an enemy player's fridge
  • winning condition is 30 food + 1 stolen special ingredient
  • retrieving food from helicopter gets you a husband
  • husband can heal and rearm you by showing him basic affection
  • the husband can be turned in to an armed Helicopter Husband and escort you for 60 seconds before leaving
  • You can use 15 food to call in a jeep escort. Be ware! If the driver is killed, the jeep will explode.
tough abyss
#

Sounds exactly like milsim everyone wants to play

iron osprey
#

thanks @tough abyss. Is anyone down to try it out? Its a 3 person FFA

#

I can host

unborn ether
#

@iron osprey Im struggling to understand is that a The Sims or Arma 3 mod description?

tough abyss
#

At least he's creative?

iron osprey
#

😄

tough abyss
#

is there an engine command or function to close a canopy and raise gear?

runic surge
tough abyss
#

Impressive.

runic surge
#

If you actually saw the code you would probably think differently lol

#

thanks though

iron osprey
#

@runic surge is it open source by chance? 😃

runic surge
#

No but I plan on releasing it as a part of my own set of functions that I use eventually

#

it needs a lot of work right now though

iron osprey
#

bad ass

#

good luck

meager heart
#

@tough abyss

#

maybe just animateDoor/animate for the canopy 🤔

sturdy cape
#

@queen cargo i have written some Plugins for APMS.its the arms plugin management system the DesolationRedux mod uses

compact maple
#

hello

still forum
#

@iron osprey #rules no crossposting.

#

yeah. You can definitely animate the canopy or maaaaaybe animateSource

compact maple
#

When you shoot a weapon in game, does the fired bullets flying in the air are objects ? can they be moved or teleported while flying ?

tough abyss
#

If fired EH returns object for projectile, they are objects

compact maple
#

basically with the FiredMan EH I could teleport the bullet some where else, right ?
but do I need to set the velocity afterward ?

still forum
#

Velocity won't change if you teleport the bullet

tough abyss
#

SetPos sets velocity to 0,0,0

compact maple
#

good to know, ty

#

could do some funny aimbot against bot lol

tough abyss
#

Or is it SetDir I can’t remember

compact maple
#

setDir will change the object heading, but dedmen said velocity dont change after teleporting something so thats all good

still forum
#

Atleast I don't know why it would.. Wouldn't really make sense I guess?

compact maple
#

I'll give it a test

still forum
#

position, velocity and direction are 3 different entries. I wouldn't set velocity to 0 everytime I move the object

tough abyss
#

Do this bullet setPos (bullet getRelPos [2, 180] vectorAdd [0,0,1.6]); if you die then velocity stays

compact maple
#

lmao

#

good way to know

#

what's that vectorAdd ?

tough abyss
#

Getrelpos z is 0

#

You need to lift bullet up chest level

compact maple
#

oh alright

#

This will work only with me, imagine if I want to that with a bot, which has a different azimut than me

still forum
#

Unit velocity is set to 0 when teleported.
But projectiles really shouldn't

compact maple
#

I hope so, anyway I could save the past velocity and apply it ?

still forum
#

sure

compact maple
#
bullet setPos (bot1 getRealPos [1, ((getDir bot1) - 180)] vectorAdd [0,0,1.6])
#

hm but what if the bot is aiming at 10 azimut

meager heart
#
player addEventHandler ["Fired", {
    private _projectile = param [6]; 
    private _cock = "Cock_random_F" createVehicle [0, 0, 0]; 
    _cock attachTo [_projectile, [0, 0, 0]];
    _projectile setVelocity (eyeDirection player vectorMultiply 20);
}];
```into the console ^ @compact maple
compact maple
#

lol will I see chicken fly

#

I dont get this : _projectile setVelocity (eyeDirection player vectorMultiply 20);

meager heart
#

why ? 😃

compact maple
#

what does it do exactly ?

meager heart
#

sets the velocity ?

compact maple
#

but as the cock is attached to the bullet

#

do we need to set the velocity?

#

uh

#

you're setting the velocity to the projectile

#

also I dont get this vectorMultiply 20, why would you change that position

still forum
#

because you want a velocity not a direction

#

direction would be 1 length

#

or 1m/s velocity

#

so if you multiply by 20. You get 20m/s velocity

meager heart
#

aka slowdown it ^, also when you will fire, look around and fire

compact maple
#

I think I got it, but need to try, thanks for the explanations

proven crystal
#

i have a stupid glitch that i cant explain. can someone help me with this?

#

_side = civilian;
        if ((random 100) <= 50) then {_side = east;} else {_side = west;}; 
        theside = _side;
        thefaction = selectrandom (FEZ_OPS_usedfactions select {([_x] call FEZ_Ops_fnc_FactGetSide) == theside }); 
        diag_log format ["FEZ INIT Setup filling  with %1 - %2", theside,thefaction];
#

crap... how do i get the syntax highlight again?

#

anyhow... the code is part of a script that i launch from the init box in editor on an object

compact maple
#

why are you setting your _side to civilian at the beginning ?

proven crystal
#

there are a few other stupidities in this

still forum
#

crap... how do i get the syntax highlight again? remove the newline before your sqf

#

if ((random 100) <= 50) then {_side = east;} else {_side = west;}; you want a 50-50 chance?
private _side = selectRandom [east, west]

#

Why are you putting it into a global variable when you could just use the local one?

proven crystal
#

i want to set the chance different. th eproblem is: why do i set the local variable global

#

theside = _side;
thefaction = selectrandom (FEZ_OPS_usedfactions select

#

this i usually wouldnt do, but for some reason the dieag log returns me always WEST when i stay on the local variable

#

when i do it as i do itthere, it works

#

but it doesnt make sense

compact maple
#

it doesnt at all, you must have did something wrong

still forum
#

wat?

#
        private _side = if ((random 100) <= 50) then {east} else {west}; 
        private _faction= selectRandom (FEZ_OPS_usedfactions select {([_x] call FEZ_Ops_fnc_FactGetSide) == _side }); 
        diag_log format ["FEZ INIT Setup filling  with %1 - %2", _side ,_faction];
proven crystal
#

thats pretty much what i had before and it fucked around

#

_side would always return me WEST

still forum
#

bad luck maybe?

meager heart
#

😃

proven crystal
#

i dont know... this is strangeness. have tried all evening yesterday. saw no reason why it would fuck around. will try again

#

this is what i had

#
_side = civilian;
        if ((random 100) <= 50) then {_side = east;} else {_side = west;}; 
        
        _faction = selectrandom (FEZ_OPS_usedfactions select {([_x] call FEZ_Ops_fnc_FactGetSide) == _side }); 
        diag_log format ["FEZ INIT Setup filling  with %1 - %2", _side,_faction];```
tough abyss
#

It is not getREALpos it is getRELpos, where REL stands for RELATIVE, so you don’t have to do additional calculations based on current direction of the unit

proven crystal
#

btw why do people use the 'private' before local variables?

compact maple
#

ye mb its getRelPos

#

but if I want the bullet to go straight to the bot

#

I still want to do some calculations ?

#

I mean, i'm firing.
teleporting the bullet
adjusting his direction
let it go

tough abyss
#

No, just put it behind like I showed you

compact maple
#

bullet setPos (bot1 getRelPos [2, 180] vectorAdd [0,0,1.6]);

#

fuck I got it

#

my brain's shaking

still forum
#

private makes sure the variable is created in your local scope. That you are not accidentally overwriting the variable in a higher scope

#

And it also increases performance as Arma doesn't need to search that far to find your variable

proven crystal
#

hmmm ok. guess ill have to do some cleaning work in my scripts at one point

compact maple
#

@still forum & you said once that people should never use that

private ["_bla","_lol"];
but use
private _blah = something;
private _lol = somthing;
still forum
#

yes

#

no

#

the second is wrong

#

private is a modifier for the = operator

#

without = you try to call private ARRAY/STRING with a nil variable

proven crystal
#

happening again....

compact maple
#

ye ofc

proven crystal
#

im using your code now

#

"FEZ INIT Setup filling with WEST - LOP_ISTS_OPF"

#

this is what it returns

#

so the _side there always is west in 250 cases

#

the faction changes

#

makes no sense

#

if i do it woth global vars it works

still forum
#

Well I can't see that in your code. unless random 100 is doing something really weird that I don't know about

proven crystal
#

well as i said, with global vars it does work. so the functions themselves are ok. i use them in similar ways elsewhere

compact maple
#

do this before _faction =...

diag_log format [" %1 ", _side];
#

so we can see whats going on before

still forum
#

Does FEZ_Ops_fnc_FactGetSide have a _side variable inside it?

#

without private... ?

meager heart
#

also maybe change that if then else to [] select bool 🤔

proven crystal
#

very possible @still forum

#

let me have a look

still forum
#

Would be a prime example as to why you should use private everywhere

proven crystal
#

that would be interesting learning.

#

yes it returns _side

compact maple
#

lol

proven crystal
#

it receives factions and returns a side for it

#

the return variable in the function is _side

#

so that fucks me up?

still forum
#

yes. It overwrites the _side in the higher scope

#

if you don't have private on it

proven crystal
#

hmmm

#

yea i see now that the variable changes after i call that function

#

holy crap thats going to be a lot of cleaning work

#

i mean thats the first time i get an error from this stuff. but ill probably go through all y stuff again

#

i can do that with an array in the beginning of the file with all the local vars in it, right?

still forum
#

you could

#

but that variant is not free

#

the private keyword is free though. It's resolved at compiletime

proven crystal
#

hm alright. so a private in front of every local var at the point where i create it ...

#

fine

#

thanks for the lesson

still forum
#

Also adds to readability because you can immediately see where a new variables comes into play

proven crystal
#

it works flawless now. thanks again!

#

that little fucker has cost me a few hours sleep yesterday

outer fjord
#

Is it possible to make the AI Co-pilot take controls?

winter rose
#

maybe with action, I don't know for sure

tough abyss
#

Depends on what mood AI pilot is in

#

@meager heart Thanks!

meager heart
#

iirc there was actions for "Co-pilot" take/release controls...

#

@outer fjord 🙄

outer fjord
#

Didn't even know that page existed.

#

Thank you.

silent bough
#

Hey, I need an advice, how can I prevent a script called in the "init" field to run on all client ?

still forum
#

I told you that yesterday

silent bough
#

I tried this at the begining of my init field :
if !(local this) exitWith {};
But it seems not to work on dedicated

still forum
#

that does it do instead?

silent bough
#

Nothing, like if the !(local this) condition was false.

#

But once again, it works on my test server.

tough abyss
#

If this is local to dedicated then it should work

silent bough
#

I try something else.

buoyant rune
#

Shouldn't the ! be inside the parenthesis?

still forum
#

no

#

It doesn't matter. if doesn't need parenthesis

#

but if you put the ! inside you can sometimes get precedence problems. So you would have to (!(condition)) and as if doesn't need parenthesis you can just remove the outer parens

buoyant rune
#

gotcha.

#

I had inquired about this yesterday but it was swept up by a multitude of people telling another person (apparently repeatedly) how to do a couple queries....so I'll ask again in kind. Could I get an ELI5 of how the getPlayerScores function works or tracks?

still forum
buoyant rune
#

As I mentioned I"m wanting to track the info for a league and so far it looks like I'll just be pulling it from the log....so if I put...

#

grumbles at discord for not letting him type code

#
_playerUID = getPlayerUID _player;
_score = getPlayerScores _player;

if (isServer) then {diag_log format ["UID: %1 - %2, _playerUID,_score];};```
#

that should work right? except it would output the whole PlayerScores table?

still forum
#

```sqf

```

#

yes.. I guess that should work

buoyant rune
#

I have that in an onPlayerKilled.sqf file

#

if I wanted to track for the entire game though, I would put that in what...onPlayerDisconnect?

still forum
#

onPlayerDisconnect should already be too late I think

#

You could just periodically print all players scores

buoyant rune
#

yeah...could do it with a sleep 120

#

thanks @still forum

meager heart
#

btw onPlayerKilled.sqf runs on the clients, not on the server...

#

also params 😃

buoyant rune
#

well that will cause a problem then

#

So, if that runs on the clients what would I need to add to pass it to the server so the server can log it?

meager heart
#

hmm... remoteExec ?

buoyant rune
#

thanks, i'll look into that

proven crystal
#

so people say its better to spawn groups via creatunit/createvehicle? why is that?

#

i use bis spawngroups now. works fine for flying stuff, ground units, uavs and vehicles

#

if i do the other route id have to write me a function to do that tight. is it worth the effort?

#

i do realise it takes a good while for units to spawn with bis function. faster would be better in some ways

digital jacinth
#

Anyone here with good knowledge of ACRE, I would ask dedmen, buuuuut, you know.
Thing is. I have a playable unit which does not support any kind of inventory (it is based on dog_base_f) and long story short I want dogs to use radios when they talk while not even having a radio anywhere.

#

That and also be able to receive radio calls

still forum
#

Are you sure that dogs don't support inventory?

digital jacinth
#

pretty sure

still forum
#

any object you can control should.

#

Or if you have config access you could add inventory

#

Yeah. Dogs definitely have inventory

digital jacinth
#

i don't sadly

still forum
#

Just remembered. Last time I used a dog I could put a gun into it's paw

#

but I think not really shoot.

digital jacinth
#

dunno, mabye the controll is not there, pressing the inventory button does nothing

still forum
#

@warped thicket we need ur help here. U know the acre stuff. Add radio to a controllable object that doesn't have inventory. Without config.

#

Ah yeah. That's true.

#

But the addWeapon/addItem commands might work

digital jacinth
#

hm i did that, but obviously after not being able to open the inventory i thought it had none

still forum
#

Maybe you need to add a uniform first 😄

#

Although no. Not for assigned items

digital jacinth
#

it is fine for the """radio""" to just send to one frequency, I already dabbled into how custom signal works and such.

#

acre does flag the radio slot with "acre_radio_flagged" or so

#

it just takes a look into the inventory if an acre radio item is in it

still forum
#

Oh wait

#

Duh.. Would work for TFAR but not for ACRE. As the ACRE Radios are not in the radio slot

digital jacinth
#

^

still forum
#

they need a inventory container like uniform/vest/backpack

digital jacinth
#

yep

still forum
#

I mean.. you could try adding a uniform to a dog. But I can understand quite well that, that wouldn't work

digital jacinth
#

I will also take a look after work at the cba events, i know there is one for pushing the radio button, but maybe there is one for ust simple speaking. Maybe I can hook into that.

still forum
#

What do you mean with simple speaking? Speaking is handled on the Teamspeak side I think. But there might be a even that tells you when you have started/stopped to speak

digital jacinth
#

yes that is what i meant

#

ace is definitely using something like that, as the "bars" on top of their heads are moving when people talk.

#

it is kinda funny how i always default back to looking into ace code to fix my problems

still forum
digital jacinth
#

oh man, does that mean I need an pfeh for this which always checks if you are speaking?

digital jacinth
#

i it writes a function and it will be called in the draw3d function so far

still forum
#

["acre_startedSpeaking", [acre_player, _onRadio, _radioId]] call CBA_fnc_localEvent;

digital jacinth
#

ah!

#

nice

still forum
#

but what are you gonna use that for? Someone fake a radio when player starts speaking?

digital jacinth
#

that is what i am trying to do. knowing how signal calucation works in acre is pretty much "send frequency, sender radio, receiver radio, power, pos" along the way. I can just hook into that and go

if frequency = 1337 && player iskindof dog 
    return [0,0]
#

the array is basically if you can hear them and what the distortion is

#

normally it asks the player unit first if they have a radio

#

buuut I can skip that for dogs

still forum
#

Ah reimplement acre internals to just remove the "hasRadio" check then?

digital jacinth
#

ye

still forum
#

That's complicated 😄

digital jacinth
#

i am already doing that how ever :v

#

I made some scripts in order to boost or jam acre signals, hence why I know the receiving end part already, just the sending part is unkonw to me

#

but yeah, having the is speaking eh is a nice start, just gotta find out how to force a radio transmission with it with fake radio ids

#

but i will do that after I drive home from work

warped thicket
#

@still forum I can't follow the chat here

#

if someone wants ACRE help, get on ACRE Slack

neon snow
#

Any way to play sound in loop in vehicle first person view that wont be so quiet?

radiant egret
#

From cfgMusic or cfgSounds ?

neon snow
#

@radiant egret cfgSounds , I can do whatever I just want to play a sound in loop which I can stop aswell

astral tendon
neon snow
#

@astral tendon did you try to set default material?

astral tendon
#

No, was trying to use it raw in a Apex monitor, it works on local playing as the hoster, but inside of a deticated server this command does nothing if is called by a player

#

In one of my older missions to get around that I remoteexec the setObjectTexture

digital jacinth
#

is it possible to slow down bullet projectiles witohut editing configs? So far I tried setVelocityModelSpace and it only does something if you set it to straight [0,0,0]

#

i am completely fine that they lose all their velocity

radiant egret
#

@neon snow I'm working on a 3d sound car radio and faced the same problem, the only solution was to define the music twice. Theres also a bug with say3d if u using 3person in the vehicle.

neon snow
#

@radiant egret but if you change the camera to 3rd view, the sound will be much louder right?

radiant egret
#

Yep

#

Wiki:For some unknown reason if at the moment of command execution the player is in first person view and is inside a vehicle, the sound created is greatly attenuated

neon snow
#

Damn :/

radiant egret
#

Without redefining u won't hear it, I used volume 30 for the music

#

But ppl outside will start crying turn it off x)

neon snow
#

yeah exactly ;d

radiant egret
#

I used a remote execute loop

#

To create the source locally

neon snow
#

playSound3D works kinda nice, but I havent found a way to actually stop the loop and audio instantly

radiant egret
#

Create a dummy object and delete it to stop the music

neon snow
#

Yeah tried it, it doesnt work with that command

#

Even teleporting sound source doesnt help

radiant egret
#

I used say3d

neon snow
#

Yeah I use that too, I was just testing now every command and it seem that none is good enough

radiant egret
#

So far I know playsound3d don't follow the object

#

Isn't rly usable for vehicles

neon snow
#

Oh , another thing to note then

ruby breach
#

@astral tendon setObjectTextureGlobal works if executed by a player, yes

#

Some weirdness with local (e.g mission) texture filepathing, however

astral tendon
#

Im using a mod filepathing

trail grove
#

Hi, i just though about creating an scripted controls setting interface and got these questions:
Is there way to change control buttons assignments by in game script?,If no then how .Arma3Profile assignment codes are generated?(ex.: keyAdjustUp[]={957546513}; ;)
;, would appreciate any help with finding the answers.

still forum
#

how .Arma3Profile assignment codes are generated engine does that

#

can't do that via script

#

Is there way to change control buttons assignments by in game script not really. There is always some hacky weird way to do things. But for this I don't think so. You cannot emulate real button presses with sqf

neon snow
#

My head hurts, how could I run function once in Draw3d eventhandler? And if condition changes run it again?

still forum
#

Just remove your eventhandler at the end of the Draw3D script

#

your Draw3D handler get's the eventhandler ID as arugment

trail grove
#

@still forum You cannot emulate real button presses with sqf its more about just changing the game controls by script

still forum
#

yeah.

#

That's what I'm talking about

#

The key config dialog is engine side. And the engine tells you "press a button now"

#

But you can't press a button now with SQF

#

even if you could press all the other buttons in the control. You cannot choose a button

neon snow
#

Yeah thats something what I wanted earlier too, to for example emulate activate radar button but no luck there and there is no script for that either(but you can detect it with inputAction)

still forum
#

you can detect it with inputAction as long as the key doesn't use too many modifiers

#

modifiers use by setting bits in the internal 32bit int.. But.. You can only use floats in sqf

#

Some keys are just impossible to detect because float cannot store the value

neon snow
#

Exactly that

trail grove
#

@still forum Got it, thanks

#

@still forum Oh, and about how .Arma3Profile assignment codes are generated engine does that [11:11 PM] Dedmen: can't do that via script, i meant does anyone know the algorithm for i could write external app which'll modify the .Arma3Profile file directly, without the game running?

still forum
#

DIK key codes

#

plus modifiers

#

it's just binary AND

#

There is a header file in the Arma pbo's with all the dik codes

shadow sapphire
#

Where can I see the selection order for artillery ammunition?

Like select 0 = 32Rnd_155mm_Mo_shells, select 1 = 32Rnd_155mm_Mo_smoke, etc.

sturdy cape
#

i am going nuts abou this plugin.is there no possibility to send params from a condition inside of a config to a function?

astral tendon
#

I think I discorver why

grizzled spindle
#

Hello Guys I have a question regarding getUnitLoadout.

Basically if i store a backpack inside of a backpack it adds it to the items array with the syntax: ["B_AssaultPack_khk", true]
My question is, does anyone know what the true is for/stands for?

Thanks

astral tendon
iron osprey
#

Ladies, Gentlemen, and every beautiful individual in between:

After many hours, I have finally perfected the script to make a helicopter land, perform an action, and then leave. Even. Under. Fire.

// _helipad is the variable name of a helipad I have placed in the map
// "heli_drop" is the variable name of a marker where I want the
// helicopter to land

_position = _helipad getPos [600, random 360];
_veh = createVehicle [
  "C_Heli_Light_01_civil_F",
  _position, [], random 360, "FLY"
];

createVehicleCrew _veh;
_group = group ((crew _veh) select 0);
_group setBehaviour "CARELESS";

_veh move (getMarkerPos "heli_drop");
sleep 3;

while { ( (alive _veh) && !(unitReady _veh) ) } do {
       sleep 1;
};

if (alive _veh) then {
  _veh land "LAND";
};

while {
  _alive = alive _veh;
  _vector = velocity _veh;
  _alive &&
  abs (_vector select 0) > 0.01 &&
  abs (_vector select 1) > 0.01 &&
  abs (_vector select 2) > 0.01
} do {
       sleep 1;
};

// Helicopter has now landed. Do what you please
compact maple
#

hey guys, how would I go about selecting selectRandom in allUnits, but I dont want the player ?

iron osprey
#

hmm

compact maple
#

I mean I cant do _aRandomUnit = allUnits - player;

iron osprey
#
_arr = [1,2,3];
_arr deleteAt (_arr find 0)
#

maybe this?

_units = allUnits;
_units deleteAt (_units find player);
_unit = selectRandom _units;
#

worked for me in my debug console

compact maple
#

It work, ty

iron osprey
#

hooray

#

does anyone know how to have a player's initial spawn be instant and not abide by the respawn timer?

compact maple
#

Idk

#

I've been working a bit with the thing we talk this morning.

player allowDamage false;
player addEventHandler ["Fired", { 
 _units = allUnits; 
 _units deleteAt (_units find player); 
  
 private _unit = selectRandom _units; 
 private _projectile = param [6]; 
 private _vel = velocity _projectile; 
 _projectile setPos (_unit getRelPos [0.01, ((getDir _unit) - 180)] vectorAdd [0,0,1.6]); 
 _projectile setVelocity _vel; 
}];

Actually it works only if I fire on the same direction that the bots are looking, @tough abyss @still forum, Im a bit stuck

meager heart
compact maple
#

thankyou

meager heart
#

what are you trying to do there ?

#

scripted aimbot kinda thing ?

tough abyss
#
if (_jetUnit inArea jetTrigger) then {
    _jetUnit enableSimulation false;
    systemChat "JUST";
};```

i am having an autism fit and i can't figure out why this doesn't eval.
#

if i replace _jetUnit with a global variable it works?

meager heart
#

_jetUnit undefined variable ? 😃

tough abyss
#

it's defined

meager heart
#

how ?

tough abyss
#

sec

#
[] spawn { _unitCaptureData = [UNITCAPTUREDATA];
_jetUnit = "B_Plane_Fighter_01_Stealth_F" createVehicleLocal [0,0,500];
_jetUnit setPosASL [0,0,500];

_jetUnit engineOn true;

[_jetUnit, _unitCaptureData] spawn BIS_fnc_unitPlay;
_jetUnit action ["LandGearUp", _jetUnit];

_memeTimer = time + 1;
waitUntil {time > _memeTimer};

_cameraOne = "camera" camCreate (getPos front);

    _cameraOne cameraEffect ["internal", "BACK"];
    _cameraOne camCommand "inertia off";
    _cameraOne camPrepareTarget _jetUnit;
    _cameraOne camPrepareFOV 0.85;
    _cameraOne camCommitPrepared 5;

    _cameraOne camPrepareFOV 0.75;
    _cameraOne camCommitPrepared 5;
    
    _cameraOne camPrepareTarget _jetUnit;
    _cameraOne camPrepareFOV 1;
    _cameraOne camCommitPrepared 15;
    
if (_jetUnit inArea jetTrigger) then {
    _jetUnit enableSimulation false;
    systemChat "JUST";
};
};```
fringe yoke
#

Is there a way to set an AI's team from the server using assignTeam?

compact maple
#

@meager heart ye exactly xD

#

but that relative direction give me trouble

tough abyss
#

AssignTeam is global

fringe yoke
#

It ain't working for me, from the server I am doing assignTeam and nothing is happening as a result

tough abyss
#

There is no parallel execution in Arma, even network shit is all sequential. Bad things happen when you put global commands in init, but that "solution” example makes no sense. Should be if (local this) then {.... and note made that this is A3 example as for A2 putting it in init as is is valid

#

OH

#

@fringe yoke how you do it from server

#

wait

#

no nevermind

#

i wouldn't need to pass the variable

#

hnghnhhh

queen cargo
#

@tough abyss Race conditions can also happen in non parallel languages
In this case, the units Team might not be Set yet when the command gets executed

#

Meaning your change gets overriden by the "default"

meager heart
#
private _bulletSpeed = getNumber (configfile >> "CfgWeapons" >> _weapon >> "initSpeed");
private _vectorFromTo = eyePos _unit vectorFromTo eyePos _target;
_projectile setVelocity (_vectorFromTo vectorMultiply _bulletSpeed);
```headshot ^ @compact maple
drowsy axle
#

is there a command to check what pbo's are loaded on a client? (in-game)

tough abyss
#

@queen cargo Re reading the conditions, it is a bit more clear that delay is needed so that player is fully initialised, but this doesn’t change the fact that sticking it in init is bad idea, I would go as far as saying do not put it in init period, or even use in postInit only.

#

@drowsy axle activatedAddons maybe?

drowsy axle
#

Would that be the pbo name?

tough abyss
#

Print it out and see

drowsy axle
#

ok