#arma3_scripting

1 messages ยท Page 528 of 1

surreal peak
#

This is my 4th attempt. Most of it was made during an english class so yeah...

#

I dont put the _handle in the _args of CBA_fnc_addPerFrameHandler; do I?

still forum
#

no

#

CBA gives you that

surreal peak
#

cool, just making sure

#

thanks

dusky pier
#

is possible to move cursor down in mutiline rscEdit with script?

#

when i start new line - cursor is not moving to new text line

tough abyss
#

can you move cursor at all?

dusky pier
#

yes, when press enter - move cursor at the new line

tough abyss
#

so press enter

dusky pier
#

like text editors ๐Ÿ˜„

tough abyss
#

in short no you cant move it by script, in long yes you can move it by script if you use extension and send enter keystroke to arma

dusky pier
#

ah, understand

quartz coyote
#

is it ctrlAddEventHandler or drawIcon that isn't JIP ?
For some reason it's working for clients on mission start but not for JIP clients

still forum
#

๐Ÿค”

#

neither is

quartz coyote
#

then how come drawIcon3D is ?

still forum
#

what?

#

it isn't

#

That command isn't doing anything related to JIP

quartz coyote
#

sorry I most be explaining the wrong way round

still forum
#

There is no synced state or anything

quartz coyote
#

What I mean is

#

My JIP clients can see displayed things created via drawIcon3D but not with drawIcon
Is it normal ? Is there a way for them to see the drawIcon effect ?

craggy adder
#

Looking for advice on best approach to moving a static object with easing. Want to change the Z coordinate on an object to make it look like it's landing. (Imagine a giant arrow falling form the sky and pointing at the ground) Is the easiest way to just use a loop and decrease the Z position by like .001 a thousand times or something?

#

Or is there some object animation function I should be looking at

still forum
#

@quartz coyote is your script that contains the drawIcon even being executed?

quartz coyote
#

client that join at mission start are working fine

still forum
#

@craggy adder yes a loop is what you would do. There is probably already a BIS function that does that for you, don't know of a name though

quartz coyote
#

only JIP clients not getting it

craggy adder
still forum
#

Doesn't answer my question @quartz coyote

quartz coyote
#

Other things happening in the same script like drawIcon3D are correctly displaying for JIP clients. so yes

still forum
#

do the lines before/after the drawIcon3D execute?

#

did you try actually adding logging?

#

is the position/object that you give to it correct? does it exist? did you add logging to check that?

quartz coyote
#

No I didn't, don't even know what to log ...

#

giving it to allUnits

still forum
#

just log everything if you don't know what specifically to log

quartz coyote
#

uh ...

#

how can I do that ?

craggy adder
#

A whole bunch of diag_log

still forum
#

you look at a line of code, gather all variables that are used in there.
then add a
diag_log [variable1, variable2, variable3] just above that line. with all the variables

#

And do that on every line that you want to make sure that it executes correctly

quartz coyote
#

I see

#

thx

digital hollow
#

@craggy adder how about BIS_fnc_UnitCapture

craggy adder
#

@digital hollow That seems to capture the movement an object makes. I'm looking to actually move the object in an automatic way.

#

I'll play with just looping a Z-axis decrement. I'm afraid of it not being smooth due to frame rate/loop speed difference but we'll see how it goes.

digital hollow
#

Yes, then you play it back with BIS_fnc_UnitPlay

still forum
#

I'm afraid of it not being smooth due to frame rate/loop speed difference but we'll see how it goes. Well you can only update once per frame
If that is still laggy for people then everything else is laggy too so whatever

quartz coyote
craggy adder
#

Right so 30-60 fps will limit the amount of vertical space I can animate through smoothly

#

We'll see how it goes tonight

still forum
#

you can use diag_fps and adjust your stepping based on fps

#

or diag_tickTime to get deltaT

craggy adder
#

I'll keep that in mind, thanks

stuck lodge
#

I've been trying to get a .ogg file to loop on an object (a little melody that loops on a radio), but I'm confused on how to use CfgSFX or if I should use something else like say3D or playSound3D and make a script that loops it (which I also don't know how to do). Any ideas?

craggy adder
#

I have some looping sounds in a mission file. I'll paste the code in here when I get home if no one has answered.

#

but yeah I think I just used a loop and set a 'wait' for the duration of the sound

fluid wolf
#

the wait thing is really ineffective

stuck lodge
#

that's the route I'm going down now, I'm trying to use sleep 40; but for some reason it isn't working

fluid wolf
#

but I dont know of a better way. Supposedly Jukebox allows you to do this stuff by determining when it ends but... I haven't gotten that to work

stuck lodge
#

says that jukebox is A2OA only

fluid wolf
#

Ah, that might be why

craggy adder
#

@stuck lodge Here is the code from my old mission. It was just a simple SP mission though.

// Turn on generator sounds
_root = parsingNamespace getVariable "MISSION_ROOT";
while {gen1_on} do {
    playSound3D [_root + "sounds\generator_running_short.ogg", cut_power_gen1];
    sleep 4;
};
while {gen2_on} do {
    playSound3D [_root + "sounds\generator_running_short.ogg", cut_power_gen2];
    sleep 4;
};
#

The track was trimmed to 4s so it matched up with the loop

stuck lodge
#

Yeah I just got it working on my end, I hadn't realized that trying to test the script in the debug console wasn't very smart but eh.

craggy adder
#

Don't feel bad I still forget the then on my if statements about 30% of the time

#

....and I'm a developer by trade

stuck lodge
#

Well so far I've got it to work, but I want two objects to be playing sound at the same time, is it possible to combine these together?

`_soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
_AmbientRadio = _soundPath + "Radio.ogg";
_LongRange = _soundPath + "Static.ogg";

while {true} do
{

playSound3D [_AmbientRadio, FM_Radio, false, getPosASL FM_Radio, 15, 1, 5];
sleep 148;

};

while (true) do
{

playSound3D [_LongRange, Longrange_FOB, false, getPosASL Longrange_FOB, 10, 1, 5];
sleep 34;

};`

Because currently like this it only plays the first one "FM_Radio"

craggy adder
#

Anyone have a quick syntax example of using remoteExec to addAction?

#

@stuck lodge Put them each in their own sqf file and use execVM to play them?

robust hollow
#

[unit,[the action params]] remoteexec ["addaction",unit] probably

craggy adder
#

Got it figured out actually

    [
        _object_to_attach_action_to, 
        [
            "Collect Powerup", 
            {[_this select 0, _this select 1] execVM "scripts\powerup_collect.sqf"}, 
            [], 
            1, 
            true, 
            true, 
            "", 
            "true", 
            3        
        ]
    ] remoteExec ["addAction", 0, false];
drowsy axle
#

Hey guys, how can I use the eden debug console to set the camera position on a xyz position? What's the object reference for the editor?

whole badge
#

hmm.. what's this new forcedInitialOrientationDir that I'm hearing about

still forum
#

never heard about that till now

fluid wolf
#

Can you queue up spawns in a loop? For instance _localthing = createvehicle "thisthing" [here, here, and here]; spawned say 20 times in one line?

#

hopefully in an array?

tough abyss
#

Is it possible to remove the "Light fire" option on campfires and burning barrels

still forum
#

@fluid wolf you can use a forEach

fluid wolf
#

I need to run it off a single activation though, a foreach would only run it once per activation.

whole badge
#

hmm... explain..... more?.. particularly if it has to do with tank cannons

tough abyss
#

@whole badge 3D particles spawn with random dir, with this param in particle array you can remove this randomness

quartz coyote
#

Anyone messed around with ctrlAddEventHandler ["Draw" and drawIcon in MP before ?

astral dawn
#

@quartz coyote I did ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", ... to the map control... why would MP worry you? This stuff is local

quartz coyote
#

@astral dawn my JIP clients don't get the effect... It's perfectly working for players joined form mission start.

astral dawn
#

hmm... how do your JIP clients run the ctrlAddEventHandler? They probably can't run it in the JIP queue because at this moment the controls don't exist yet?

quartz coyote
#

a function in initPlayerLocal

astral dawn
#

I do the initialization like this:

0 spawn {
    waitUntil {! isNull (findDisplay 12)}; // Wait until we have the map!

    // Add a Draw event handler to draw markers
    // It will call onDraw of every MapMarker object
    ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {call MapMarker_EH_Draw}];

And MapMarker_EH_Draw iterates through all objects it has to draw

#

maybe waitUntil needs even another check like 'if !isNull (finddisplay ... displayctrl ...)' to make sure the control is already here?

quartz coyote
#

I didn't even put a waitUntil !

#

i'll try that

dusky pier
#

try this: ```sqf
waitUntil {sleep 0.5; !isNull (findDisplay 12)};

quartz coyote
#

yeah nice thx !

#

i'll test that now

dusky pier
#

i have a question ๐Ÿ˜„

#

how RscStructuredText size depends from HUD size settings?

#

^^ that on big hud

#

but on small hud - is have a normal size

astral dawn
#

The bigger the settings, the bigger the text IIRC

#

Did you use safezoneW and safezoneH for the size of the control items?

#

If you did so, then the items' size is the same % of the screen size, but the text size varies according to UI scale

quartz coyote
#

@astral dawn @dusky pier waitUntil {sleep 0.5; !isNull (findDisplay 12)}; did not change anything

#

so here is how I did mine :

high marsh
#

initPlayerLocal is already scheduled

quartz coyote
#

@high marsh what do you mean ?

robust hollow
#

you would use the waituntil before adding the event

quartz coyote
#

oh

#

true

robust hollow
#

itl do no good in the event because it wont fire if the ctrl is null

#

also the event is unscheduled so waituntil shouldnt work anyway

quartz coyote
#

what do you suggest ?

robust hollow
#

move that waituntil to before the event is added

quartz coyote
#

ah

#

right

dusky pier
#

@astral dawn ty, but is possible to get hud size from profile? I think is saving to profile, but can't find that

#

i use safeZone coordinates

quartz coyote
#

@robust hollow @dusky pier now working ! thanks !

dusky pier
#

๐Ÿ˜ƒ

astral dawn
#

@quartz coyote I don't know what you were adding the event to, I was adding it to map display (IDD 12) and map control (IDC 51), you must use IDD and IDC of your display and control for reliability

dusky pier
#

as i understand size text = size* sizeEx

still forum
#

Wow Flash-Ranger.. So it was what I thought at first, the code isn't even executed and it's not drawIcon's fault. Adding logging would've showed you that ๐Ÿคฆ

tough abyss
#

@dusky pier You can get user UI from getResolution

dusky pier
#

@tough abyss ty, i used that ```cs
#define TR_H_coord(Hs) h = Hs; sizeEx = Hs * 0.8

#

is works

#

80% of H

fleet hazel
#

guys. Made a script call for the button.

#
    while {true} do {
    if ((inputAction "User15")  > 0) then {
            [] call life_fnc_start;
        };
    };
    sleep 0.1;
};    
#

life_fnc_start:
In file added such.
if !(isNull (findDisplay 4500)) exitWith {closeDialog 0;};

still forum
#

Ok!. What now?

fleet hazel
#

When you click the my button, the dialog menu opens. If I press again, it does not close.

#
disableSerialization;

if (isNull (findDisplay 4500)) then {
    createDialog "list_building";
};

private _display    =    ((findDisplay 4500) displayCtrl 4502);

{
    _display lbAdd (getText(_x >> "displayName"));
    _display lbSetData[_forEachIndex,getText (_x >> "classModel")];
} forEach ("true" configClasses (missionConfigFile >> "CfgItemBuild"));```
#

@still forum What did I do wrong?

still forum
#

for one.. your sleep is useless

#

it would maybe make sense inside the loop

slim oyster
#

Has anyone made a vectordiff calculate function for determining if an AI is properly aimed at a target? For use with the various force fire commands

#

I can calculate vector deviation just fine, but it does not account for elevation/trajectory of rounds. Very noticeable on AGS/MK19

tough abyss
#

You can get vectorCos

slim oyster
#

Yes I am using vectorCos along with vectorDiff to check deviation, but I want to adjust the vector for the appropriate weapondirection aim for distance

#

_deviationlimit + (_modifier * _distance)

#

Obviously the modifier for the trajectory is going to be vastly different for different weapon systems, any way to get this data or to piggy back off the vanilla AI aiming to see if it is correctly accounted for distance?

hollow fable
#

How to make the searchlight or AI that mount it. to rotate randomly "search mode" like scan horizon. I can't seem to find any commands for it.
I have tried this:

null=[this] spawn { while {alive (_this select 0)} do {sleep random (2)+3;(_this select 0) setformdir random 360};};

But this did not work.
any1 know command for this?

young current
#

lookAt command could work

winter rose
#

maybe doTarget with different surrounding positions

ninja'd!

astral dawn
#

@slim oyster if I understand correctly you need to ignore vertical misalignment between gun's vector and vector to enemy? You can ignore the Z components of vectors then
Just to clarify, do you do it like this? Take vector where gun's pointed at, and take vector to the enemy, run vectorCos to get cosine of angle between them, then you can do acos of this angle to get the angle?

slim oyster
#

Yes

#

Of course there are a ton of ways to calculate the deviation/errors of those vectors, but what I would like is a way to account for specific ammunition/weapon trajectory so I can tell if the weapondirection deviation is actually going to land a hit or not

#

I know the AI does this with their AIMINGERROR behavior, don't know how to piggy back off that system to adjust muzzle vector

fluid wolf
#

agh I hate the missing ; error

#

I can never find it

#

is there a utility that helps that besides notepad ++?

still forum
#

missing ; is not always missing ;

#

VSCode with SQF Lint

fluid wolf
#

Yea I know

#

problem is I still cant find why that error is there

#

VScode is the program?

#

ah yes, got it

#

thanks

astral dawn
#

There is also SQF-VM which can compile your code just like arma compiles your code

fluid wolf
#

Oh, sweet

#

_affected = nearestobjects [(this), ['Soldier'], 5];
0 elements provided, 3 expected
That's... how that works though right?????

cosmic lichen
#

Are you sure that this is defined?

fluid wolf
#

Yes its in a trigger

#

so it should be an object

#

...actually no sorry thats the object the trigger is ON.

cosmic lichen
#

try position this

fluid wolf
#

not the trigger itself

#

same error with position this

astral dawn
#

just diag_log this?

#

or just do ade_dumpcallstack but wait you are not subscribed to arma debug engine do you?

still forum
#

position thisTrigger

fluid wolf
#

gave this a local variable and still the same error

astral dawn
fluid wolf
#

so now it cant be related to just a "this" error

#

Alright let me try that

cosmic lichen
#

So you have that code in the onActivation field of the trigger?

fluid wolf
#

Position thisTrigger works, but position object does not... ok.

cosmic lichen
#

If that's the case then this does not refer to the trigger, instead use thisTrigger like @still forum suggested.

fluid wolf
#

they're in the same spot so I guess that doesn't really matter but its still weird

#

I stand corrected. it stopped erroring but it doesn't return anything

quartz coyote
#

Hello !
Would this work ?

diag_log waitUntil {(west countSide allPlayers) > 0 || (east countSide allPlayers) > 0};```
#

is that how you use diag_log ?

still forum
#

no that's not how you use diag_log

#

waitUntil returns "nothing" once it's done. so... you are logging exactly nothing

quartz coyote
#

okay so how would I log this particular line ? because my mission randomly blocks at that point sometimes

#

maybe this ?

waitUntil {diag_log (west countSide allPlayers) > 0 || diag_log (east countSide allPlayers) > 0};```
still forum
#

no diag_log returns nil, so now you are breaking the waitUntil

#

You want to see when it blocks? or why?

#
waitUntil {
    diag_log [west countSide allPlayers, east countSide allPlayers];
    (west countSide allPlayers) > 0 || (east countSide allPlayers) > 0
};
#

this will log both values on each iteration of the waitUntil

quartz coyote
#

ah okay

#

thx

cosmic lichen
#

What the best way to break out of the while loop? Does exitWith work? The wiki has examples for onEachFrame and waitUntil but not for while

quartz coyote
#

@cosmic lichen yes it works

#

@still forum okay so I logged the line as you showed me.
it appease that when my scenario gets blocked altho i'm slotted and I passed briefing, the waitUntil loop still get [0,0].
Why would the game not see me slotted in blufor or opfor ?
In order for it to work, I simple reassign the mission, reslot, launch and that time, it works

#

There was no issue before I added this line. it has to be that very one line

surreal peak
#

So i just want to check: isNil returns true if the variable has been defined and isNull returns true if an object is defined

#

because if it does then it means I'm a bit silly

still forum
#

no and no

#

isNil checks if a variable is nil

#

isNull checks if something is null, object, control, config and so on, many different things that can be null

digital jacinth
#

anyone worked with "vurtual's Car Seat & Stretcher " mod before? I want to spawn a seat locally via script and then hide it. Issue is, I cannot use hideObject as it would also hide the unit sitting in it. hideselection only works with simple object and the seat model has no hidden selections. Yet, the seat can be made invisible via eden

dusky pier
#

what better enableDynamicSimulation or enableSimulation false;?

astral dawn
#

these are totally different things

#

enableSimulation just manipulates simulation of an object

dusky pier
#

i use that for buildings

astral dawn
still forum
#

"i use that for buildings" buildings aren't really simulated at all

#

disabling simulation on buildings doesn't really make sense

dusky pier
#

as tested - enableSimulation false - brings add 5 - 10 fps

still forum
#

wat

dusky pier
#

all buildings use enableSimulation true;

still forum
#

what kind of "building" do you have there?

dusky pier
#

terrain object

#

basic map building

astral dawn
#

how many did you disable?

dusky pier
#

all

still forum
#

vanilla? or modded buildings?

dusky pier
#

vanilla

astral dawn
#

anyway, I think if you disable building simulation, you might not be able to break its windows, which your players can notice...

dusky pier
#

when i use simulationEnabled cursorObject when near building - getting true

astral dawn
#

but it means that it's still being simulated

dusky pier
#

windows working nornal

#

no problems with doors too

cosmic lichen
#

If I want to access a variable from a group's namespace from a different machine, does this variable need to be public _group setVariable ["Var",true,true]; or can the group's namespace be accessed from everywhere?

astral dawn
#

most likely general rules of setVariable apply

#

so it sets the variable locally

#

must set it to public to let other machines access it

#

or use some sort of remoteExec to set this variable only on needed machines

still forum
#

no variables anywhere are accessable from everywhere

#

"or use some sort of remoteExec to set this variable only on needed machines" setVariable also takes a target parameter

astral dawn
#

what ๐Ÿ˜ฎ

cosmic lichen
#

Yes it does

#

Alright, public it is then.

astral dawn
#

oh really, since what version? ๐Ÿ˜„

still forum
#

ever

astral dawn
#

damn how did I miss that ๐Ÿ˜„

cosmic lichen
#
if (!is3DEN && !(_value == '')) then
{
    [_this,_value] spawn
    {
        params ['_group','_value'];
        private _leader = leader _group;
        private _marker = createMarker
        [
            format ['Enh_GroupMarker_%1',str floor random 10e5],
            _leader
        ];
        _marker setMarkerType _value;
        _marker setMarkerText groupId _group;
        _marker setMarkerColor ([side _group,true] call BIS_fnc_sideColor);
        _group setVariable ['Enh_GroupMarker_Pause,false,true];
        while {true} do
        {
            if (count units _group == 0) exitWith {deleteMarker _marker};
            if !(_group getVariable ['Enh_GroupMarker_Pause',false]) then 
            {
                _marker setMarkerPos position leader _group;
                _marker setMarkerText format ['%1 (%2)',groupId _group, count units _group];
            };
            sleep 1;
        };
    };
};
#

Any suggestions regarding performance or so? It's en Eden Editor attribute

still forum
#

count units _group == 0 group might delete itself and become grpNull. No idea what units does with that

#

!(_value == '') != ?

cosmic lichen
#

the unit count goes 0 first, then the unit gets deleted and becomes null, if that's what you mean

#

_value is the value selected in the attribute window. I see what you mean now. sorry

still forum
#

it's scheduled

#

there is no "first" and "then"

#

your while loop may suspend for an hour and continue long after the group is gone

cosmic lichen
#

I see. What do you suggest?

still forum
#

checking for isNull

#

but only need it units does something weird on grpnull

#

also count == 0 is slower than isEqualTo []

#

but in scheduled that diff is so low that it doesn't matter

cosmic lichen
#

The problem with the check of isNull is, that the group exists long after the group is empty which causes the marker to get set to position [0,0,0].

#

So I would need to check if the group is null first, then check if it's empty.

stuck lodge
#

I have some SQFs I want to execute, I put them in a initPlayerServer.sqf like this,

[] execVM "scripts\DEVDAN_Static.sqf"; [] execVM "scripts\DEVDAN_Ambient_Radio.sqf"; [] execVM "scripts\DEVDAN_Lighting.sqf";

But they don't execute on my dedicated server, I don't know what I'd need to do in order to have them execute.

harsh sphinx
#

What's in the files? You can't use local functions

cosmic lichen
#

units grpNull //[] So nothing weird.

queen cargo
#

Seriously... Where do they still advocate execvm?

tough abyss
#

@stuck lodge what the scripts do?

queen cargo
#

Can we please burn that place down and burry it?

cosmic lichen
#

Biki...

queen cargo
#

No

#

Nooooo

#

Noooooooooooooooo

stuck lodge
#

it's just a playSound3D loop

tough abyss
#

@dusky pier if everything works then you didnโ€™t disable simulation

dusky pier
#

simulation disabled ๐Ÿ˜„

#

as i understand is enabling when i use house

harsh sphinx
#

@stuck lodge maybe your server doesn't know what the soundSource is?

tough abyss
#

So you have player joining dedicated server and you want to execute playSound3d on the server when it happens? @stuck lodge

stuck lodge
#

I've tested it on locally hosted server, I'm trying it to run the script on mission start up

harsh sphinx
#

What's the source of the sound though?

stuck lodge
#

It's an ogg, that is in the mission directory.

harsh sphinx
#

playSound3D ["A3\Sounds_F\sfx\blip1.wav", player]

#

the second parameter?

tough abyss
#

1 playSound3d is not JIP compatible so you need players already be loaded to hear it. 2 initPlayerServer only executed upon player joining server

stuck lodge
#

the second parameter is the object variable name,

tough abyss
#

And it may be prohibited by cfgremoteexec rules

stuck lodge
#

Outpost_Radio

#

gotcha

tough abyss
#

There is no command in arma to make sound pick up for JIP players, even with playMusic where you can start it from offset you canโ€™t because you canโ€™t play it on the server in order to give JIP current play time

#

The whole thing is a disaster

cobalt trench
#

"wHo STiLl uSeS X anYmOre"
Doesnt provide working solution.
nice. ๐Ÿ‘

stuck lodge
#

Well would the script execute on JIP clients , because it's just a looping sound that doesn't really need to be synced around the board for players?

tough abyss
#

Then use local playSound or say3d

stuck lodge
#

alrighty,

tough abyss
#

If it is looping you might want to createsoundsource

stuck lodge
#

I was looking into that, but it said that the audio file needed to be an addon or something, I stopped heading that direction though

tough abyss
#

When did you look into it? You can use mission sounds as well as addon sounds now

stuck lodge
#

just this week, I was just looking at the wiki

tough abyss
#

Well it says it there in black and white

stuck lodge
#

It was under CfgSFX, again I didn't look into it very much mostly skimming, and I was seeing more people use playSound3D, ยฏ_(ใƒ„)_/ยฏ

quartz coyote
#

in which situation would I use uiSleep instead of sleep ?

winter rose
#

if you set accTime to zero for example, but you want the game to wait 1 real-life second to go back to accTime 1

#

or simply if you don't want to have to do sleep accTime * _wait

still forum
#

every scheduling script would be F-ed beyond repair at that point

#

everything would just be frozen basically

#

So I'd consider that game breaking

queen cargo
#

Not fucked beynd repair but unprecise as fuck

still forum
#

no

#

At one hour delay you are basically dead

#

assuming minimum 1fps that means 3600 scheduled scripts that each take full 3ms.

#

CTRL+ALT+DEL and kill arma

tough abyss
#

Dedmen is right, you can completely clog the scheduler to the point that it never recovers so the game runs, unscheduled scripts on events run, but all scheduled scripts are stuck. Because sorting of the queued scripts takes so long it has no time left to run scheduled scripts.

wispy cave
#

Anybody know why?

tough abyss
#

What have you passed for 2d/3d param in neatestObjects, not visible on screenshot @wispy cave

wispy cave
#

true is the argument after 1000

#

it does yes ๐Ÿ˜ƒ

cosmic lichen
#

Would have been nice if they added an easier way to detect missiles together with the new missile commands.

wispy cave
#

yea, i want to make it compatible with players so incomingmissile event isn't something I can use

cosmic lichen
#

Problem with incomingmissile is, that it does not return the actual missile which is a bummer.

cosmic lichen
#

Yes, I had exactly the same idea. There was a scripted mod a while ago with an active anti missile system. Quite neat, but too much scripted workarounds to get the missiles for my taste.

austere hawk
#

or add the projectile with a fired EH to the vehicle local variables and retrieve it from there with incomingmissile EH...? "lastprojectile" memory so to speak

quartz coyote
#

Would anyone know of a well made tutorial on how to create an ingame ctrl (ctrlSetStructuredText, ctrlSetPosition, ctrlCommit, etc ...)

#

to me right now it's SIFI. and honestly i'm really bad at understanding the biki

#

I'd simply like to create three text displayed above the heads of 3 winning players in a camera scene

tough abyss
#

trying it now, doesnt seem to work
maybe missile is already beyond 50m

astral dawn
#

typically you apply your settings (position, text, color, whatever) and in the end do ctrlCommit 0;

#

ctrlCommit can gradually commit changes so I think you can move it? but I might be wrong

#

just do ctrlCommit 0 for instant change

quartz coyote
#

Thanks, although it doesn't help me understand how to create it myself

#

oh wait no it's all good. I can figur it out myself

astral dawn
#

so... you add controls to display, allright? like game display or map display or your custom display
you do ctrlCreate, it returns a control handle
then you do ctrlSet*** to set properties and do ctrlCommit to apply the changes ๐Ÿค” that's all really

quartz coyote
#

yes, thanks man

#

uiNameSpace setVariable ["displayRestartPanel", _display];
can displayRestartPanel be what ever varname I want ?

astral dawn
cosmic lichen
#

Is it just me or is the engine based tv search functionality quite slow?

astral dawn
#

but you must really understand how safezone coordinates and viewport coordinates work, otherwise you will get issues with people using different UI size and text clipping, or your controls not being where they should be (outside of screen)

cosmic lichen
#

Use the GUI Editor and set everything to safezone. That works in 99% of all cases.

astral dawn
#

hmm wait, he said he wants to put the controls above people's heads ingame

cosmic lichen
#

In camera scene

astral dawn
velvet merlin
#

how does one emulate a click on a class List: RscTree ?

#

want to make it possible to switch between units and locations in the observer mode by hitting tab

#

i can trigger the update, but the leaves the tab state untouched

cosmic lichen
#

So a bit like Eden Editor does that?

tough abyss
#

@velvet merlin try tvExpand/tvCollapse

cosmic lichen
#

Don't think that works. He wants to switch the tab to a whole new tvTree control if I understood him correctly.

tough abyss
#

the tree view does not exist in other tabs, it is redrawn depending on which tab is selected, so not sure I understand what you mean either

#

unless there are multiple trees each on separate control that is hidden then revealed, but don't think this is how it works

wispy cave
#

Right so now I'm using this:

_x addEventHandler ["FiredMan", {
    params ["", "", "", "", "", "", "_projectile"];
    {
        systemChat "fired";
        if (_projectile isKindOf _x) exitWith {
            targetArray = targetArray + [_projectile];
            systemChat "Added";
        };
    } forEach ["RocketCore", "MissileCore", "BombCore", "ShellCore"];
}];```
To get all the projectiles.  However this eventhanlder doesn't fire every time my VLS fires.  Anybody have a clue why?
#

(I'm firing my VLS with:

while {VLS ammo "weapon_vls_01" > 10} do {
    sleep 2;
    systemChat "Cruise missile inc";
    east ReportRemoteTarget [player, 3600];
    player confirmSensorTarget [west, true];
    VLS fireAtTarget [player, "weapon_vls_01"];
};```)
astral mortar
#

anyone knows how do I set a camera feed into a screen in game? I've been googling for half an hour and found nothing useful

#

I want to feed a static camera position, not a unit or anything like that

still forum
#

setObjectTexture onto the screen

velvet merlin
#

@tough abyss @cosmic lichen sorry just back now - you guys are familiar with the native A3 observer mode?

#

based on clicking on "entities" or "locations", it updates the listbox below

astral mortar
#

@still forum

this setObjectTexture [0, "["Paste",["Altis",[14765.7,16840,3.66647],355.165,0.75,[-37.4651,0],0,0,367,0.398854,0,1,0,1]] call bis_fnc_camera;"];

like this?

velvet merlin
#

that said i mixed them up:
class Tabs: RscToolbox is the selection above
class List: RscTree is the list below

still forum
#

no not like that

astral mortar
#

_objectname setObjectTexture [1, "\pboname\texture2.paa"];

still forum
#

no

dim kernel
#

Hi, how can i disable tfr range limit?
can anyone help?

still forum
#

@dim kernel have fun with your ban ๐Ÿ‘‹

dim kernel
#

?

astral mortar
#

lol

dim kernel
#

what did i do?

still forum
#

You just got banned from TFAR Discord for not reading the #rules there ^^

astral mortar
#

#(argb,512,512,1)r2t(surface,aspect)

this line basiclly converts the camera feed into a picture?

dim kernel
#

yikes

drowsy axle
#

Hello. Could someone tell me this is an effective way to go about optimising asyetuntitled framework for life? ```sqf
// shopFunctions.sqf
params ["_object","_type","_vehspawn"];

EC_fnc_objectFunctions = {
params ["_object"];
_object enableSimulation false;
_object allowDamage false;
];
switch (_type) do {
case "atm" :
{
[_object] call EC_fnc_objectFunctions;
_object addAction[localize"STR_NOTF_ATM",life_fnc_atmMenu,"",0,false,false,"",' isNull objectParent player && player distance _target < 4 '];
};
case "truck_s" :
{
[_object] call EC_fnc_objectFunctions;
_object addAction[localize"STR_MAR_Truck_Shop",life_fnc_vehicleShopMenu,
[
"civ_truck",
civilian,
[
_vehspawn
],
"civ",
localize"STR_MAR_Truck_Shop"
],
1.5,true,true,"","true",5];
};
};``` the original code was inside the init. field of the unit.

still forum
#

optimising asyetuntitled framework for life

Delete it. And rewrite from scratch

drowsy axle
#

haha thanks

still forum
#

I don't see anything worth optimizing in that script

astral mortar
#
this setObjectTextureglobal  [0, ["#(argb,256,256,1)r2t(1,1.0)"]];

@still forum
how do I insert the camera position into that line?

still forum
#

you don't

#

you specify which camera to use

drowsy axle
#

Would having it in the init. field make the mission size more?

cosmic lichen
#

@velvet merlin I guess you have to reload RscTree when the selection of RscToolbox changes.

still forum
#

surface - The name that will later be used as reference in the camera script

astral mortar
#

I need to make a reference to certain camera?

still forum
#

@drowsy axle yes. It would make the mission bigger if you put scripts into the mission.

drowsy axle
#

Do scripts count (less) towards the number of MB on receiving mission file?

velvet merlin
#

@cosmic lichen this is all handled by BI functions already

#

the question was how to activate the tab (like hit a button)

#

ToolBoxSelChanged is the displayEH

astral mortar
#

the camCreate line :

_cam = "camera" camCreate (ASLToAGL eyePos player);

I put on init.sqf or inside an object init line?

velvet merlin
#

lbSetCurSel changes the focus

still forum
#

Do scripts count (less) towards the number of MB on receiving mission file? no

#

But if you look at the size of a average script file.. it's not that big

drowsy axle
#

Okay. Thanks for your insight.

#

Appreciated, as always.

still forum
#

I'd probably use an array with find,
But I assume that script runs only a few times at mission start, so it doesn't matter

drowsy axle
#

Yeah

#

array as in all the pieces broken up?sqf shopsArray = [ ["actionName","Function",["_vehspawn",side,"side condition","menuName"]], ["actionName","Function",["_vehspawn",side,"side condition","menuName"]] ];

tough abyss
#

side is unary command it gets evaluated when you put it in array

#

without argument it is an error

drowsy axle
#

Actual code: this addAction[localize"STR_MAR_Boat_Shop",life_fnc_vehicleShopMenu,["civ_ship",civilian,"civ_ship_2","civ","Billy's Boat Rentals & Ownership"],1.5,true,true,"","true",5];

#

I took out the second spawn "civ_ship_2"

still forum
#

no putting the code pieces in an array and then using select <index> to find the matching one

#

essentially replace the switch

tough abyss
#

so why are you asking about broken code then?

still forum
#

but as I said, not worth it

drowsy axle
#

ahh okay

#

I'll stick with the switch

#

Once it's done, it's done. I shouldn't need to touch it.

astral mortar
#

So if a make a camera using those lines:

_cam01 = "camera" camCreate (0,0,0);
_cam01 setPos [];

inside the setPos, what part of the next line should I put inside the brackets? ?

["Paste",["Altis",[14765.7,16840,3.66647],355.165,0.75,[-39.056,0],0,0,367,0.398854,0,1,0,1]] call bis_fnc_camera;
quartz coyote
#

controlName ctrlSetPosition [x, y, w, h]
How are w and h calculated ?

proven crystal
#

hello, how has everyone been?

#

had a bit of a break, but now im looking at my arma again

still forum
#

w and h are width and height

quartz coyote
#

yes i'd understood that

still forum
#

percentage of screen size afaik

proven crystal
#

so heres my issue

quartz coyote
#

ah thx

proven crystal
#
class CfgPatches {
  class FEZOPS {
    units[] = {};
    weapons[] = {};
    requiredVersion = 1.83;
    requiredAddons[] = {
      "ace_medical"
      ,"cba_common"
      ,"ace_common"
      
    };
    author[] = {"Fetzen"};
    authorUrl = "";
    version = "1.0";
    versionStr = "1.0";
    license = "https://www.bohemia.net/community/licenses/arma-public-license-share-alike";
  };
};


class Extended_PreInit_EventHandlers {
  class FEZOPS {
    serverinit = "call compile preprocessFileLineNumbers 'FEZOPS\Fezops_Init.sqf'";
  };
};
#

i have this in the config CPP

#

but it says that it cant find this file FEZOPS\Fezops_Init.sqf

#

which is there

#

i have the same structure in another mod which works fine

#

and the file is there as far as im concerned

astral dawn
#

percentage of screen size afaik
size of the view port (the one which has 4:3 dimensions)

astral mortar
#

Anyone knows a good guide or tutorial about making static cameras? i've been trying few things and nothing seems to work

still forum
#

@proven crystal pboprefix?

proven crystal
#

the pbo is called fezops.pbo

still forum
#

maybe leading \ in your path

proven crystal
#

hmm i have it the same way in another mod though...

#

there it says serverinit = "call compile preprocessFileLineNumbers 'FEZ\Fez_Init.sqf'";

cosmic lichen
#

@velvet merlin Is it working now? I am a bit busy atm so I can't answer right away.

velvet merlin
#

np

#

did hack it now

#
  1. select the opposite tab (visual only)
  2. execute the code directly
cosmic lichen
#

Alright

vernal mural
#
[_c, true] call ace_dragging_fnc_setCarryable;
[_target, 1] call ace_cargo_fnc_setSpace;
[_c, _target] call ace_cargo_fnc_loadItem;```
#

how would you explain that this piece of code works 2 times over 3 tries ?

#

the third try create the canister near the target, but do not load it in its cargo space

proven crystal
#

whyyy

vernal mural
#

Nevermind, I just made the canister to spawn directly on the target's position with "CAN_COLLIDE", and now it works properly. With the previous code I think sometimes the canister spawn at a greater distance of the target for the ACE function to accept it

slim oyster
#

Thinking of making a function for parsing a map - creating node markers every 100m say, and then detecting nearby objects/locations and assigning that node with that information. Certain amount of trees -> forest node, certain amount of buildings -> urban node. Has this been done before?

proven crystal
#

sounds like ALiVE indexing?

halcyon crypt
#

kinda I guess, we make use of object IDs which sucks since we have to re-index whenever a map is updated and the IDs change ๐Ÿ˜ฆ

lusty canyon
#

is there a fnc/script that can get all the defined memory point names of an object?

minor lance
#

Is there any way to play synced music to all players ebvent if they are not in the game (Tabulated)

iron sinew
proven crystal
#

So i need a file to specify my pboprefix?

#

Seems to work without in my other mod

#

Im still stuck with this error message that it wont find my init file

slim oyster
#

Started a map parsing function, for the purpose of creating nodes for AI high level/commander behavior.

surreal peak
#
        private _dialogResult =
        [
            "Side Selector",
            [
                // The last number is optional! If you want the first selection you can remove the number.
                ["Combo Box Control", ["BLUFOR","OPFOR"]]

            ]
        ] call Ares_fnc_showChooseDialog;

        // If the dialog was closed.
        if (_dialogResult isEqualTo []) exitWith{};

        // Get the selected data
        _dialogResult params ["_comboBoxResult"];

        // Output the data to the chat.
        systemChat format ["Combo Box Result: %1", _comboBoxResult];

        if (_comboBoxResult == 0) then
        {_grp = createGroup west};
        if (_comboBoxResult == 1) then
        {_grp = createGroup east};        
        
        player groupChat (format ["%1",_grp]);
        
        _dog = _grp createUnit ["Fin_random_F", _pos, [], 0, "CAN_COLLIDE"];
        [_grp] joinSilent _dog;```
#
   
  player groupChat (format ["%1",_grp]); 
   
  _dog = _grp createUnit [">
17:11:29   Error position: <_grp]); 
   
  _dog = _grp createUnit [">
17:11:29   Error joinsilent: Undefined variable in expression: _grp```
#

why is _grp undefined?

#

_comboBoxResult is either 0 or 1 depending on which is selected

random crescent
#

because you define it within the if

#

it's never used outside of the if before

surreal peak
#

that's a thing?

#

how am I supposed to combat that

random crescent
#

private "_grp"; above your if's.

#

or, if you want to be fancy

surreal peak
#

oh shit, thanks!

random crescent
#
private _side = [west, east] select _comboBoxResult;
private _grp = createGroup _side;
#

you can also do stuff like private _grp = if ... else ...;

surreal peak
#

so does private just set the variable to be used inside what ever scope it is declared to be in?

still forum
#

private sets the variable in current scope and makes sure that you don't overwrite any variable in parent scope

#

if you just use _var = 5 then if _var already exists in a higher scope, it will overwrite it

marsh storm
#

Hi there, i'm using drongos missile system, and in it's start.sqf it defines

dmsRestrictUsers=false;

#

In the editor I can local exec

dmsRestrictUsers=true;

and get the desired result

#

but adding the restriction=true to the init.sqf doesn't work

#

any idea why that would be?

#

would kindly appreciate a ping if anyone replies ๐Ÿ˜ƒ

still forum
#

if it's start.sqf runs after your init.sqf it will overwrite your variable

marsh storm
#

yeah I thought that might be the case, but couldn't find any references about when start.sqf runs

quartz coyote
#

Anyone know a way to identify the script in why a resource is not found ?

#

black box saying "Resource xxxxxx not found"

still forum
#

Should I say "no" if I know a way which you can't use anyway?

quartz coyote
#

thanks for your answers full of wisdom as usual ๐Ÿ˜„

#

okay so no

still forum
#

I'd say CTRL+F for the resource name in all files

quartz coyote
#

yeah I was hopping not to do that

astral dawn
#

probably you have put your resource in the wrong part of config

#

IIRC dialogs are in mission config root, rsc titles are in missionRoot/RscTitles class

quartz coyote
#

I found what was wrong

#

the message was actually displaying "Resource title "" not found"

#

no I most have some brackets wrong somehow

marsh storm
#

OK so that missile system issue I was having is because the variable is being set in a PostInit XEH

#

and my variables are getting overwritten

#

i've tried adding a PostInit to the description.ext to overwrite it but it still seems to be running before the one in the mod

#

Any idea how I can run that variable assignment after the PostInit XEHs?

still forum
#

spawn with sleep

marsh storm
#

@still forum could you provide an example? i assume it goes into init.sqf

still forum
#

[] spawn {sleep 20; <your code here>}

marsh storm
#

appreciate the help.

still forum
#

just waits 20 seconds. might need to be longer

marsh storm
#

and in init.sqf yeah?

quartz coyote
#

@astral dawn I had added a titleRsc ["","BLACK FADED"]; to cancel the effect of my titleRsc ["Black","BLACK IN",5]; which is the source of my error. It works but creates an error.
How do you cancel a titleRsc normally ?

#

maybe titleRsc ["", "PLAIN"]; ? nope...

astral dawn
#

class: String - the class name of the resource. ("Default" will remove the current resource.)

#

IDK really I never had to remove it

quartz coyote
#

ooooh

#

nice

#

I never read to the end ๐Ÿ˜„

astral dawn
quartz coyote
#

ah yes good to know

#

it was needed indeed

#

thanks for your help

astral dawn
#

maybe I should read the documentation for my own issues too ๐Ÿค”

surreal peak
#

so everything works great with AI, as in the dog murders them; however, with players the dog does not attack them

#

which is doing me a confusion

high marsh
#

how would I go about generating average fps with diag_fps?

#

I have thought about creating an array of taken numbers, and then constantly adding them up, dividing by iteration number, etc.

#

but that sounds really jank

#

it also exponentially increases the number for some reason after rebuilding the proper numbers gathered from diag_fps

#

I have heard about cumulative average instead of regular average, but don't really understand the difference

tough abyss
#

diag_fps already calculates average FPS

#

It takes data from the last 16 frames

astral dawn
#

Calculating mean (everage) is the easiest, you sum up everything and delete it by the amount of measurements

#

Or export it somewhere and plot its historgram, or make it measure the FPS during 90% of time, or whatever gamers like to measure nowadays ๐Ÿ˜„

high marsh
#

@tough abyss So how soon is diag_fps available?

#

@astral dawn Well of course.

_recordedNums = 72 + 80 + 92 + 90;
_avg = _recordedNums / 4;
tough abyss
#

What do you mean how soon? @high marsh

high marsh
#

mission start? Game start?

tough abyss
#

Always

twilit scarab
#

How can i keep infantry flashlight and vehicle flashlight always on?

tough abyss
#

Even in daylight?

twilit scarab
#

No

#

But the missions gonna be at nighttime so it doesnt matter really @tough abyss

peak plover
#

Im ๐Ÿ’ฏ% sure ive found an answer to that on google more than once @twilit scarab

twilit scarab
#

Cool so you know one that works then? @peak plover

wispy cave
#

Anybody happen to know which algorithm is behind BIS_fnc_sortBy? Can't open arma atm

stuck lodge
#

I'm trying to use BIS_fnc_ANN, but the title text is very small, I tried using <t size='2'>"Title"<t/> but it gives me an error. I'm executing it in the debug console, would that be the issue?

winter rose
#

I hope it's AAN you are trying to use ^^

do you parseText?

#

@stuck lodge

stuck lodge
#

yes as I said I'm using the BIS_fnc_ANN, I tried doing this but it gives me an error [parseText <t size='2'>"Title"<t/>, parseText "Rolling Text"] spawn BIS_fnc_AAN;

#

vs with out <t size='2'><t/> it works, just that the text is really small

winter rose
#

parseText takes aโ€ฆ string?
it would then be sqf [parseText "<t size='2'>Title</t>", parseText "Rolling Text"] spawn BIS_fnc_AAN;

stuck lodge
#

I've tried using quotations around <t size='2'><t/> and in between, it didn't work

winter rose
#

</t> btw

#

test my syntax, see if it works

stuck lodge
#

I'll give it a test in a bit, need to grab food, thanks for the help

winter rose
#

bon appรฉtit

tough abyss
surreal peak
#

Bumping:
https://pastebin.com/LYf2jGKB
so everything works great with AI, as in the dog murders them; however, the dog does not damage players. It sits and follows them, just doesnt attack them
which is doing me a confusion

winter rose
#
      [_grp] joinSilent _dog;``` โ†‘ โ“
#

as for why it follows (enemy?) players, no clue โ€“ no distinction is made in this code

finite sail
#

joinsilent takes an array of units

keen bough
#

i know how to make player change sides (from independet to opfor, to blufor and so on) and all - but the method is very clunky because it needs a new group for each player.

Is the new-group-put-player-into-this-group the only way to change a players side? Because if they are opfor, and are in a vehicle, a blufor and/or inedependet unit cannot join the vehicle crew.

digital hollow
#

@twilit scarab enableGunLights and setPilotLight

astral dawn
#

Do isServer, hasInterface and other things work properly in preInit? Or to say it in other words, are there any limitations on what I can do in preinit?

random crescent
#

isServer, hasInterface
yes
other things
maybe

#

in preinit, no objects exist yet

#

so setting a variable on the player for example won't work.

astral dawn
#

Allright, that's what I need, thanks!

surreal peak
#

@winter rose sos for late reply, what do u mean by distinction?

#

The dog is supposed to follow the player and sit when it is supposed to damage it, however, the damage is not being dealt

winter rose
#

@surreal peak I meant I have no clue as to why the dog would sit and do nothing; but wait, the dog actually chases the enemy?

if so, maybe [_dogNearestEnemy, 1, selectRandom ["hand_l", "hand_r", "leg_l", "leg_r"], "stab"] call ace_medical_fnc_addDamageToUnit

โ†‘ ace_medical_fnc_addDamageToUnit may not be global

surreal peak
#

does that mean it wont work on players?

#

can I make it global?

#

also yeah, the dog chases the enemy

#

then applies the damage to it as it sits

random crescent
#

you can use remoteExec. addDamageToUnit requires the target to be local (it also logged an error message to your RPT, which you probably didn't look at).

vernal mural
#

How can I prevent a vehicle from "drifting" on the ground while using BIS_fnc_unitPlay ? I thought placing a dummy driver with all AI components disabled would help, but it doesn't

surreal peak
#

sos for @ ing u baer, firgured it out

keen bough
#

<jumps around happily> eventhandler, what a nice way to complement my disguise framework :3 so sweet.

lucid wind
#

Hiya, need a bit of help if anyone has a script handy.

I'm trying to make a bunch of object-to-object action menu player character teleports on a map. I can get things working in singleplayer no problem, but I'm unsure on how to set it up for multiplayer.

I'm not familiar with the difference between how arma considers players in SP and dedicated MP.

#

Anyone have a simple object teleport script, or mission that includes one that I can have a look at?

random crescent
#

In the Biki, every command changing an object's state has two icons right below the heading

#

AL / AG and EL / EG

still forum
#

"Anyone have a simple object teleport script"
setPos. done.

random crescent
#

Stands for argument local / global and effect local / global

still forum
#

teleporting things is literally the same in MP as in SP

random crescent
#

Yo let me teach this guy
Local means "where it's simulated".

still forum
#

And if you want to teleport player. you are only teleporting player, and don't need to worry about anything MP

random crescent
#

For AI that's usually the server or a headless client. For a player controlled unit, it's the players PC.

#

setPos is AG EG, so you can use that and you'll be just fine

lucid wind
#

right

#

one sec..

#

ok so, I have been using setPos

#

which is why i'm slightly confused as to why it doesnt want to work in mp

#

I've been using a simple setPos (getpos (teleportobject))

#

with a named object to teleport to

random crescent
#

What kind of object is it? Have you used disabled simulation of it perhaps?

lucid wind
#

I have use disabled simulation, I believe

#

object is an invisible soda can as the teleport target

random crescent
#

Disabled simulation means exactly that: render, but don't simulate it

#

So you need to enable simulation to change its position

lucid wind
#

well, it's the players changing position, to the object.

#

I'll just boot the game up. I didnt actually expect a quick reply lol

random crescent
#

Oh I see

#

Can you show us a little more of your script?

#

The problem is maybe somewhere else. Or is that all you do?

lucid wind
#

Ok so, the teleport objects players are supposed to interact with are are signposts the init (for example);

this addaction ["Teleport to Radio Training Area","RadioAreaTeleport.sqf"] ;

the sqfs are;
_tele = _this select 0;
_caller = _this select 1;

_caller setPos (getpos (RadioAreaTeleport));

With the teleport target name variable as RadioAreaTeleport

#

Works for me in SP and editor testing. Even works in non-dedi Mp for the host, but not in dedicated mp?

random crescent
#

instead of

_tele = _this select 0;
_caller = _this select 1;

you should just use

params ["_tele", "_caller"];
#

apart from that, looks totally fine to me

lucid wind
#

would the above break it for MP?

random crescent
#

nope.
the only other thing that i could think of is that RadioAreaTeleport is undefined in MP for a client.

#

you could just type that in one of the lines below the debug console

#

if it doesnt return anything, it's undefined

lucid wind
#

type what, sorry? I'm completely new to scripting and code in general.

#

Thanks for the help by the way

random crescent
#

you know what the debug console is, right?

lucid wind
#

I know where to find it, but not how to use it

#

RadioAreaTeleport is giving me an object return but I'm not quite sure what you mean

random crescent
#

that's good

#

did you test that in MP?

lucid wind
#

not yet, cya in a few mins because i need to boot up a server lol

short trout
#

for player character you need to ensure that actions are added locally (somewhere at init.sqf or initPlayerLocal.sqf). As player is local for client -- setpos commands will work fine in mp

lucid wind
#

back sorry, i cant see debug console in mp

high marsh
#

of course you have to enable it for mp

#

enableDebugConsole = 1 in your description.ext

lucid wind
#

thanks

lucid wind
#

Still having some difficulty with it. Would it be possible for someone to send an example mission folder?

zealous silo
#

guy's i have a problem.
build failed. result code=1
cfgconvert task failed
file c:\users\minas\desktop\payday\filelistwithmusictracks.hpp, line 477: config 'g' encountered instead of ','
config : some input after EndOfFile
error reading config file c:\users\minas\desktop\payday\config.cpp
class destroyed with lock count 1

#

after a full 7 hours of working on my mod i'm at my wits end with this. i just want some damn sleep but i have to finish this first and i can't tell what's wrong here

craggy adder
#

post that header file. Syntax error shouldn't be too hard to find

#

or not. I don't know. I'm new here

zealous silo
#

by header file do you mean my config? i'm really new to this whole mod making thing so i'm learning everything

craggy adder
#

Yeah. The error seems to indicate the issue is in filelistwithmusictracks.hpp which is a header file

#

Sorry I don't know if the preffered nomenclature is 'config file' or what

#

@zealous silo Line 477 you have an extra " right before go_in_with_the_squad

zealous silo
#

ok so i solved my errors in filelistwithmusictracks.hpp but now i have a error in my config.cpp

young current
#

@zealous silo you are trying to build from C:

#

you dont have the dev environment and P: drive set up?

craggy adder
#

For what it's worth I've done all of my modding from C: without issue

zealous silo
#

all of this was working before

young current
#

ok you guys figure it out then

zealous silo
#

then i broke it all by doing changing some other stuff

craggy adder
#

What the arbitrary drive letter? Is that an ARMA engine constant or something?

#

and why have I never heard of this before :\

young current
#

P: drive is the most commonly used one for virtual development drive

#

the tools are designed to work through it

craggy adder
#

wild

young current
#

but also the ArmaTools stuff to build it dont always work correctly

zealous silo
#

what i'm getting is
Build failed. Result code=1
CfgConvert task failed.
Config : some input after EndOfFile.
Error reading config file 'C:\users\minas\desktop\payday\config.cpp

#

i have a feeling on what it is but i can't be sure

young current
#

cant help since you dont adhere to the common procedure

#

also youre using Addon Breaker that is pretty much useless if you dont feed it exactly right data to pack

craggy adder
#

Ah yeah this is way out of my league. I've never packaged an addon. I've just created scenarios

zealous silo
#

i was just using a tutorial on adding music to the game. now i have a migraine

young current
#

what tutorial would that be?

young current
#

it might not be totally terrible.. but it does not explain how the tools are supposed to be setup and it uses addon breaker to build.

#

at least its not video tutorial ๐Ÿ˜œ

craggy adder
#

video tutorials are the worst

zealous silo
#

i find them to be better sometimes

young current
#

perhaps thats why you are in this pickle ๐Ÿ˜›

zealous silo
#

how was i supposed to go about making this?

#

i also found my problem i think

young current
#

9.5/10 video tutorials dont have quite right info

zealous silo
#

maybe

craggy adder
#

For me it's more about speed. You can't easily skim or search a video like you can a text based tutorial

#

I can consume a text tutorial at my speed and with the advantage of not listening to your mumbling

fossil peak
#

Well bois I'm wondering if there is a way to detect if a player is armed. Such as holding a rifle, pistol, or launcher that would preferably be able to set off an in game trigger. I have no idea where to start. The context would be if player holds weapon then player gets switched from civ side to independent side and when the weapon is no longer detected they go back to being on civ side

cosmic lichen
#

@fossil peak Singleplayer or multiplayer?

#

In singleplayer you can currentWeapon player == "" in a trigger

tough abyss
#

If i run this code on server start, server side:[_obj,true] remoteExecCall ["hideObjectGlobal",0,true]; [_obj,false] remoteExecCall ["hideObjectGlobal",0,true]; [_obj,true] remoteExecCall ["hideObjectGlobal",0,true];when a player join, all the tree hideObjectGlobal codes will run on player machine or just the last one?

fossil peak
#

Oh @@cosmic lichen thanks mate it worked for my purposes at least

tough abyss
#

@tough abyss all three

winter rose
#

don't set to true the last param
or simply just use the command, that is global (idk if it was just for the example)

tough abyss
#

What do you have against setting already JIP persistent global command to execute 3 times globally by every JIP?

tough abyss
#

It's just an example so i can know the behavior. Thanks for the help @tough abyss!

#

@winter rose thanks.

#

The real thing is a bit hard to explain with my poor english.

neon snow
#

How do I get nearest airport/runway coordinates?

random crescent
#

huh, thats actually not that easy from what it looks like

#

i'd try nearestLocation, but apparently only tanoa has a specific "airport" location type

neon snow
#

Yeah that is messed up becouse in A2 it returned for all maps O.o

#

I guess the only way would be by getting ILS position from config

#

And what about specific objects? I'd like to know the location of Radio towers?(on M map they are showed with markers with a little rdio tower inside)

random crescent
#

i mean you could use airport and do special handling just for altis and stratis - that might work.
nearObjects would probably be the best solution for that, if they are shown on the map they might also have a CfgLocationTypes entry which would allow you to use nearestLocations

queen cargo
#
systemChat (".,a,.b.,c,.d.,e,.f.," splitString ",.");
systemChat ("abc.,.,.,.,.,.def," splitString ",.");
systemChat ("abcdef," splitString ",.");
systemChat (",." splitString ",.");
systemChat ("" splitString ",.");
systemChat ("abcdef" splitString "");
```output??
ruby breach
#

Generic error in expression for all lines

peak plover
#

Dejavu

queen cargo
#

wut?

still forum
#

systemChat doesn't take array

queen cargo
#

๐Ÿคฆ

#

add a str in front of it ๐Ÿ˜„

#

stupid me

queen cargo
#

are you sure those results have been correct @random crescent ?
because if they are, the biki should be wrong ๐Ÿค” as strtok should take every character as delimeter and not the whole expression

peak plover
queen cargo
#

thanks

#

guess he was trolling around then

queen cargo
#
arr = [0,1,2,3,4,5,6]; arr deleteRange [0.6, 2.4]; systemChat str arr;
arr = [0,1,2,3,4,5,6]; arr deleteRange [2, 1]; systemChat str arr;
arr = [0,1,2,3,4,5,6]; arr deleteRange [1, 1]; systemChat str arr;
arr = [0,1,2,3,4,5,6]; arr deleteRange [-1, 1]; systemChat str arr;
arr = [0,1,2,3,4,5,6]; arr deleteRange [1, 10]; systemChat str arr;```
what happens on theese?
peak plover
random crescent
#

@queen cargo must have been a typo somewhere i suppose : )

queen cargo
#

or that ๐Ÿคท

astral dawn
#

I have two variables both of which can be nil or not nil, and I need to check their equality quickly, what's the best way?

still forum
#

[_val1] isEqualTo [_val2]

astral dawn
#

sheeet that's amazing ๐Ÿ˜„

still forum
#

might return true if both are nil. Not sure

astral dawn
#

hmm yeah ๐Ÿค”

still forum
#

you have to add extra check whether one of the variables is nil then, if you want false on both nil

astral dawn
#

I will handle that separately

#

actually it returns false

still forum
#

๐Ÿ˜ฎ

astral dawn
#

[nil] isEqualTo [nil] false ๐Ÿ˜„

still forum
#

in SQF-VM yes. Same in Arma too?

astral dawn
#

yes

#

X39 can relax ๐Ÿ˜„

peak plover
#

how about

private _var1 = nil;
private _var2 = 3;
private _isVarsEqual = (_var1 param [0,-1,[0]]) isEqualTo _var2;
still forum
#

both can be nil

astral dawn
#

returned nil

still forum
#

Also that won't work

queen cargo
#

still adding a testcase to cover that now ๐Ÿ˜„

still forum
#

param is silently ignored because of nil argument on left side

peak plover
#
[_var1] param```
would that work?
still forum
#

y

#

Version number is wrong. we already have it in 1.92

#

On latest profiling the command syntax already changed to return group instead of nil

proven crystal
#

hmm can i post a picture here?

#

negative

still forum
#

yes you can post a link to a picture here

proven crystal
#

ah well

#

does this work?

#

so my issue is that the game tells me on startup that it does not find the fezops\fezops_init.sqf

#

why though... i do it the same way for my other mod where it is just a slightly different path

still forum
#

Don't use pbo manager

#

use something real

#

also cba_common and ace_common are already included in ace_medical

#

also use a pboprefix instead of hoping that Arma can read your mind and does what you want

proven crystal
#

i tried that

#

made a file called $PBOPREFIX$ and wrote 'fezops' into it

#

that should be it, no?

still forum
#

if you then use a proper pbo packer which is not pbo manager or addon builder then yes

#

you can check if prefix is correct by opening your pbo in notepad++ and looking at the first line

#

if there is no prefix there, then it's wrong

proven crystal
#

interesting it has the prefix of my other mod there...

#

works now

#

once again -> thanks a bunch

surreal peak
#

What is a proper PBO packer dedmen? Will be nice for when I get back into modding

spice axle
#

I've got a real weird problem.
I wanted to have a loadout of the enemy in my mission. I've added a CBA_fnc_waitAndExecute (just because there were a lot of units and don't wan't to execute all at the same time) with this script:

params ["_unit"];

private _a = "BOKO_RFM";
switch (typeOf _unit) do {
    case "O_G_Soldier_LAT_F": {
        _a = "BOKO_LAT";
    };
    case "O_G_Soldier_GL_F": {
        _a = "BOKO_UGL";
    };
};
[_unit, _a] call KAT_fnc_applyPlayerLoadout;

true;

KAT_fnc_applyPlayerLoadout is a simple loadout script that remove all the stuff and give the new (right) one.
Problem is: Nothing happend. No loadout is given, no script error.
I tried following:
Taking the InitPost Event (with CBA) and execute the funtion there. Nothing happend. I even added the funtion in the init of the unit in zeus interface.
Debug console -> Nothing happend. But if I place a new unit everything is working fine. All the ways above are funtional if the unit isn't preplaced. Why? (Pls tag me if you got a idea)

peak plover
#

Add systemchat 'part 1' to parts of ur script and see whifh part it reaches

signal kite
#

Hello! I'd like to use a script to simulate an one-way traffic flow. I'm thinking:

  1. Create a manned vehicle at a random position around point A.
  2. Order the vehicle to move to a random position around point B.
  3. Repeat 1 . and 2. in random intervals.
  4. Delete each vehicle upon arrival.
    I have limited experience in scripting and would be grateful for any suggestions.
frigid raven
#

How can I assign an existing task? I found BIS_fnc_taskSetCurrent which makes an already "assigned" task the current task of a unit. But I want to actually really assign an existing task that is has been created for another unit (by ID) to a new unit. Can't find anything for that

#

or in other words - How can I add players to an existing task? Since it's possible to add an Array of "owners" to a task - how can I modify this array when the task has already been created?

keen bough
#

I want to be sure on this one: If i put a normal event-handler on a object (example: A player) it will fire locally whenever the handle is triggered (like killed etc.) right?

And MP-Eventhandlers are added to every single player globally as i understand but there are just the three: hit, killed, respawn (totally fine!)

But my actual question is: When i put a non-mp-eventhandler on an object (player unit) it will be not-readded to the player(s object) when he/she respawns and i have to re-attach the event handler, right?

#

so i can add normal eventhandlers "initPlayerLocal" and they will stay as long they are on the server?

dry inlet
#

Or you can assign it to every BLUFOR for example

peak plover
#

@signal kite https://community.bistudio.com/wiki/setDriveOnPath
https://github.com/CBATeam/CBA_A3/wiki/Per-Frame-Handlers
https://community.bistudio.com/wiki/nearEntities
https://community.bistudio.com/wiki/nearRoads
https://community.bistudio.com/wiki/inArea
https://community.bistudio.com/wiki/lineIntersects

Depending on your scenario and how dynamic you want it to be. You can go many ways with this.
Best case scenario, you know kind of which route the car should take and don't have to rely on the
vanilla paths and driving, you can get a set of points and save them in an array and just go through them with setDriveOnPath.
If not, you can just use waypoints or doMove etc.

I would make a script like this:
Car spawns, drives from A to B,
The car is added to an array,
A per frame handler loops through all the cars
Checks their position,speed and determines if they are stuck.
In which case nearEntities and nearRoads can be used to find another path or retrying the same one.
lineintersects could also be useful to finding a clear path and then using setDriveOnPath to drive past obsticles etc.

nearRoads is really nice for finding road positions to drive to or some in between, use getPos alternative syntax and getDir alternative syntax to get a road in a certain direction (from a to b) etc.

In the end you could also just have a special function on the first few cars that will periodically save their positions and do a lot more checks to make sure the road is clear etc.
Then use those positions and setDriveOnPath later on in order to avoid ai issues with road paths etc.
Maybe even drive the path yourself and then setdriveonpath with that, if nothing else works and you don't wanna make 100 markers or save 100 positions manually

signal kite
#

@peak plover thx for the elaborate reply. Sadly this surpasses my skills greatly; I had something much simpler in mind with just using addWaypoint. (Actuallly I'm fine with the bad AI-driving because it adds some kind of "fog of war"; Vehicles get stuck, break down and so on. I even appreciate that kind of stuff as it adds to the overall immersion.)
My problems are more basic: how to man a vehicle after createVehicle, how to assign a waypoint to it and how to have it deleted upon reaching the waypoint.

spice axle
#

It is way more simpler.
CBA_fnc_waitAndExecute

createVehicle command

[{
private _vehicle = "vehicleclassname" createVehicle position;
private _group = createVehicleCrew _vehicle;
private _wp = _group addWaypoint [center, radius];
_wp setWaypointStatement ["true", "deleteVehicle this; {deleteVehicle _x} forEach units group this"];}, [], seconds of vehicle spawn] call CBA_fnc_waitAndExecute;

You could make the real script a function that will call the function again. As a infinite loop with random numbers so like random (150) -> will be a random number under 150

#

Not tested just at the mobile @signal kite

peak plover
#

What if it gets stuck?

#

aah

#

He wants it to get stuck

spice axle
#

AI on a Street is quiet good not to get stuck

signal kite
#

@spice axle thx. I will try that. Actually I don't need the AI to get stuck, but I don't mind if it does ๐Ÿ˜ƒ

tough abyss
#

actually it returns false

switch [nil] do {case [nil]: {hint "true"}; default {hint "false"}}
still forum
#

@surreal peak armake or mikeros makePbo/pboProject.
Mikero is the safest one.

surreal peak
#

thanks!

keen bough
#

Can i get a units description? That what we see in selection like "unit xyz" "description: Tough Medic"?

wispy cave
#

What's the most efficient way of copying the contents of an array? E.g I have a global array called array1 and I want to copy the content of it into array2 but if I make changes to array2 I don't want stuff in array1 to change.

still forum
#

array2 = +array1

wispy cave
#

tnx

cosmic lichen
#

is there a command to get the mean of an array?

compact wyvern
#

is there a command to set a vehicles name with the debug console?

cosmic lichen
craggy adder
#

removed

random crescent
#

that's not the mean.

craggy adder
#

You're right. Not sure why I thought that would work.

random crescent
#
private _sum = 0;
{ _sum = _sum + _x } forEach _array;
_sum / count _array;
#

I don't think there's a much shorter way

craggy adder
#

Some of the things missing from SQF are maddening. += is one of those things.

#

Some kind of array_sum function would be nice too, but it's not quite as prolific

compact wyvern
#

im trying to unhide a fuelprobe on a blackhawk form a different mod (i know ignore the fact of its a mod lol)

_this animate ["Hide_Probe", 0];

#

that script doesnt seem to wor

#

ive given the blackhawk a variablename and it works but in mulitplayer i cant set a variable name

still forum
#

+= is one of those things. not possible with the way SQF works

compact wyvern
#

sorry im totally new to coding lol

still forum
#

Except array append I guess. But we already have append

random crescent
#

Some kind of array_sum function would be nice too, but it's not quite as prolific
we've got map (called apply in this case), reduce would be nice now, too. something like this:

private _mean = (_array reduce [0, {_left + _right}]) / count _array;

do it dmenn
pls

still forum
#

reduce? intercept_cba?

random crescent
#

not through intercept ๐Ÿ˜ฆ

still forum
#

oh

random crescent
#

only problem i see is the introduction of at least one magic var

craggy adder
#

SQF has map/reduce/filter functions? I had no idea

random crescent
#

no reduce, no

still forum
#

how?
[1,2,3,4]
1 op 2
3 op 4
res1 op res2

or
1 op 2
res1 op 3
res 2 op 3
?

random crescent
#

map = apply, filter = select

craggy adder
#

neat

random crescent
#

the latter

#

oh

#

one sec

#
_array reduce [0, {_acc + _x}]; // initial accumulator = 0
_array reduce {_acc + _x}; // initial accumulator = _array select 0
still forum
#
game_value cur = array[0];
for(auto i = 1u, i < array.size(); i++){
_x= cur
_y = array[i]
cur = call operator;
}

that?

random crescent
#

reduce basically does

[1, 2, 3, 4] reduce {_acc + _x} == ((1 + 2) + 3) + 4;
[1, 2, 3, 4] reduce [0, {_acc + _x}] == (((0 + 1) + 2) + 3) + 4;
still forum
#

sadly these need to be scheduler capable.. which requires crappy boilerplate

#

Can you check if my impl is basically right?
I prefer _x for left and _y for right
Or maybe _this for left and _x right? that's shit..
Adding new magic variable might confuse people?

random crescent
#

_acc would be more meaningful imo

still forum
#

Feels like it implies that you can change it. Aka "this is the accumulator, you can do stuff with it"
Maybe I'm too tired. Plus shorter variables faster, and for things like this, that might be enough to matter
We already know how bad _forEachIndex is ๐Ÿ™„

random crescent
#

your implementation looks right for the ARRAY reduce CODE variant
you can change the accumulator. it could be a different array for example.

#

you can implement select through reduce

still forum
#

"select through reduce" hey hey. put the gun down

random crescent
#
_array reduce [[], {if (_x mod 2 == 0) then {_acc pushBack _x}; _acc}];
#

^ == _array select {_x mod 2 == 0}

still forum
#

I told you to put the gun down! Not fire it off -.-

random crescent
#

i uuuuuh dropped it

still forum
#
_array reduce [[], {_acc pushBack if (_x mod 2 == 0) then {_x} else {nil}; _acc}];

๐Ÿค”

random crescent
#

oh that is neat

#

but very cryptic

#

also dunno if then has higher prio than pushBack

still forum
#

if is unary so yes. But then is binary. Not sure about that one

random crescent
#

the if was actually part of the sentence structure ๐Ÿ˜„

keen bough
#

vehicle does NOT return me the vehicle the player is in. What am i doing wrong?
_plVeh = vehicle player;
?

still forum
#

you aren't in a vehicle

#

duh

#

๐Ÿ˜

keen bough
#

<stares at @still forum out of my Karatel>

random crescent
#

he's right tho

keen bough
#

whats the solution i am looking for? objectParent also does not return the vehicle i am sitting in.

random crescent
#

vehicle returns the vehicle the unit is in.

still forum
#

If vehicle and objectParent don't return the vehicle.. Only reason I can think of is that you are not inside a vehicle

random crescent
#

or your mistake is somewhere else.

keen bough
#

I am in a vehicle.

high marsh
#

Or player isn't defined. Server exec.

random crescent
#

Or player isn't defined

#

what the fuck did you just say

high marsh
#

Undefined

keen bough
#

R Taskforce Crow:19 (Narsiph)

#

that returns with "vehicle player"

random crescent
#

player CANNOT be undefined

#

it's a command

#

it's never undefined

#

never ever ever

#

EVER

high marsh
#

_plVeh would be if just player

#

Anyhow

#

It's a command

#

Not a var

#

This is understood

random crescent
#

there is simply no way vehicle player will fail.

high marsh
#

Unless you're executing on server. (Which was my intended statement before pre caffeinated freakout)

keen bough
#

i am in pre-testing over eden editor (play in mp)

random crescent
#

Unless you're executing on server
it will return null, which is correct.

high marsh
#

Lol.
Add another line
test1

keen bough
#

What, please?

random crescent
#

are you remote controlling a unit?

keen bough
#

nope.

#

1: Eden Editor -> "Play in MP"
2: Get into Vehicle
3: debug console "test1 = vehicle player;"
4. Gives back unit, n ot vehicle.

random crescent
#

uuh

#

no

still forum
#

are you sure?

random crescent
#

typeof vehicle player

still forum
#

maybe they just both have the same name?

random crescent
#

try that

#

they have, demmen

keen bough
#

ill try, sec.

#

"I_Soldier_LAT_F"

random crescent
#

i doubt that.

keen bough
#

ah, wait, this time i was outside the vehicle

#

"O_MRAP_02_F"

random crescent
#

there you go.

keen bough
#

so with typeOf i get the vehicle class but without typeOf i dont get the vehicle at all? But 'vehicle' states it gives me actual vehicle object and if there's none the unit.

random crescent
#

it just has the same name

#

its not the vehicle

keen bough
#

okay, i will now spawn a total different vehicle

random crescent
#

dude

still forum
#

๐Ÿคฆ

keen bough
#

oh wait, i understand

still forum
#

vehicle just takes on your name

random crescent
#

it's the callsign

keen bough
#

at that moment I AM the vehicle (the vehicle object is actually me) right?

random crescent
#

NO

#

IT JUST HAS THE SAME NAME

keen bough
#

vehicle player = vehicle object?

random crescent
#

player == vehicle player returns false

#

yes

keen bough
#

aah.

#

yeah, now i understood ^^

still forum
#

My house number 4, has the same number as house number 4 in the next street. but they are different houses ๐Ÿ˜‰

keen bough
#

it was too confusing for me seeing my name XD

still forum
#

The name essentially tells you "the vehicle that Narsiph is in"
You are in both your body, and the vehicle. so both vehicles have Narsiph inside.

#

Not sure if there is a easier way to see the difference besides typeOf

random crescent
#

you can name it in eden

#

then it will show the name instead of the callsign

keen bough
#

the typeof was exactly the next step in my script, thats why i didnt execute typeOf earlier. I would've seen it then ^^

random crescent
keen bough
#

but i test scripts small step one after another

#

you helped me awesomely once more ^^

slim verge
#

wait might be wrong obj name

still forum
#

@slim verge if objects are not spawned in mission, for example they beaing unused playable units. Then it will be nil.
You should add a isNil check on _x

slim verge
#

was me being an idiot should knopw better been doing this for 17 years now

#

developing a script atm so not added niceties

still forum
#

maybe reduce is a too generic name and not obvious enough? on the other hand neither is apply nor select
I'm finding problems where there are no problems to find

Performance will be stupid for unscheduled if I don't write everything twice :/ And BI won't accept that if I'd do
I already hate it, I could make it fast but I can't

random crescent
#

An alternative for reduce that's often used is fold

burnt torrent
#

Hey guys, I'm new here. I've had a PC for 10 month now came from console I purely built my PC to play arma I've clocked 1k hours had fun in milsims and public servers now I want to move to making my own content I.E cinematics missions and so forth problem is I have 0 knowledge on scripting and was hoping I could get some help off the guys here

winter rose
burnt torrent
#

Thank you Lou I'll go check it out mate

winter rose
burnt torrent
#

I've made a little scenario on a map and got the mission in my missions sqf folder just want to learn more to add to it and I believe ite scripting where I'll achieve that

burnt torrent
#

You the man ๐Ÿ‘Œ

winter rose
#

My pleasure!

halcyon marsh
burnt torrent
#

@winter rose I've read through most of it but I cant find a section regarding how to write out the coding where to put it and what does what I.e what null means and stuff

winter rose
#

@burnt torrent you can create a script by creating a new txt file and changing its extension to sqf. One of the most used is "init.sqf", which is a script that is automatically fired (if it exists) on mission start/join for everyone (server and clients)

for other scripts, see execVM on the wiki ;-)

#

@still forum I blame morning and mobile keyboard (-:

still forum
#

Blame for what? I didn't even read your messge

burnt torrent
#

right im a bout to try my first bit of scripting wish me luck hahaa

frigid raven
#

I might've asked this one already but forgot the answer tbh. Is it possible to remove the map marker of a task (task framework) or at least hide it?

burnt torrent
#

change the game difficulty?

frigid raven
#

Already have - think this one is not affected by the difficulty

#

not the 3D marker but the marker on the map tho

#

this here

burnt torrent
#

ahhh i see im unsure tbh on that one xetra

frigid raven
#

wait a sec - I think this one is created by the "destination" param for a task

winter rose
#

@still forum I thought you pointed @ my typos ;-)

burnt torrent
#

Is c++ the scripting I should learn @winter rose

still forum
#

No. SQF has barely anything to do with c++

burnt torrent
#

okay thanks dedmen

#

@still forum nooby question mate how would i input a camera script into the editor

spice axle
#

Some days ago I had a private message and the guy said he want to script the Arma mods with c++. Who is the guy telling newbies that c++ is the language for Arma? Thatโ€™s absolute wrong

burnt torrent
#

i seen it on a discussion on steam, im just a little bit lost with it but im not giving up haha

spice axle
#

You got a link for me?

burnt torrent
#

i can try and find it for you mate

#

ive bin reading for last hour about c++ as well fml haha

#

all im trying to do is make cinematics i don't need to know that much surely

astral dawn
#

Arma has a standard interface with .dlls called callExtention. Parameters are converted to string and your functions receive a string.

#

Or there is an Intercept addon that lets you handle arma's data types natively

#

So you can even pass object handles and other things, and you can call all arma's scripting commands from the .dll side

still forum
#

C++ arma scripting is a thing. But that's something different

#

But that's something you might touch AFTER you've learned SQF itself

burnt torrent
#

is it worth me just finding a local pc class and paying for lessons ?

still forum
#

no

#

c++ knowledge won't help you much with SQF

#

Will help as much as general programming knowledge

#

there are free video courses online

burnt torrent
#

so i just need to learn sqfs then correct?

#

sorry for all the questions guys thanks for your paitience

#

ive downloaded notepad++ but cant find the impot on langauge for sqf?

still forum
#

SQF is a proprietary language for Arma

#

There are community made Notepad++ addons that add SQF language

burnt torrent
#

sorted it thanks ded

#

is notepad++ only thing ill req?

still forum
#

you don't even need notepad++

#

any text editor works.
Or you can even not use any text editor if you write your scripts ingame in the editor

burnt torrent
#

ahhh nice, so where can i learn what i need for scripting, i.e what null and stuff means?

#

and when and where i should use them

#

where i should put ; and [] and stuff if you with me

still forum
#

I have no idea. I learned everything by myself by just reading the wiki

burnt torrent
#

ill keep going through the wiki then thanks dedmen appreciate the help man i really d o

#

do*

unique atlas
#

@burnt torrent . I'm about 6 or 7 months into my study of sqf with very little code experience coming in. This is my third attempt over the course of a few years and I'm finally getting traction. Stick with it. Read a lot. Then read more. Generally speaking the semi colon ; is used at the end of a line of code. It's sort of like the period to a sentence. The brackets are, again generally speaking, containers. Within them go the arguments or values you are passing to a script...or sometimes they contain elements of an array, which is like a group of things. I'm sure they do other things I've yet to learn. Null seems to equate to "nothing". It is an undefined value. I've seen null used to launch a script which is called by execVM after declaring that null = [] execVM SCRIPT.sqf; I'm unclear why this would be used over just a standard execVM in the init sqf group (init.sqf, initplayerlocal.sqf, and initserver.sqf), but I'm sure there's a reason.

Good luck!

burnt torrent
#

thank you ever so much, i certianlly not be giving in! im slowly getting there ive had a pc 8 month now had one before sept a laptop which was used for just browsing the web then i got bored of console so built a rig purely for arma 3. im now 1k hours in and have often thought i wish the game did this or this happened so starting looking at scripting! i wish you all the best also with your studdying and i hope it all comes to you, thanks for pointing out certian things there they make sense now where as before they seemed to just mean nothing to me as such. im currently reading the wiki with a cupper t so no doubt ill progress some what today!

still forum
#

there is no "null" in sqf. There is nil and null types like objNull or grpNull.
@unique atlas
null=[]... is used in init boxes in editor, as there is a bug in there that won't let you confirm the script if it returns anything.
And x=x not returning anything is actually a bug in SQF that you need to use to workaround that editor script field bug.
It makes no sense if used outside of editor script boxes though. And CBA auto-fixes that bug and you don't need to do anything like that if you run CBA

unique atlas
#

I do run CBA. Thank you @still forum , and you're welcome @burnt torrent ! So basically @still forum , I could convert those lines in an init file to just the standard execVm call without repercussion?

queen cargo
#

noteworthy here: if one wants to know some inertias of SQF, there is a community led implementation of the internal VM
there are minor differences but it allows for an understanding why SQF is what it is (c/c++ knowledge required https://github.com/SQFvm/vm if you are not able to understand c/c++ then this is not really of much use probably to you)

unique atlas
#

I have seen nil, and nul, and null used. Very confusing, I must say. But I love to read so I find things out as I encounter them. Sometimes it takes learning a bit more before I can digest stuff. All good.

still forum
#

0 = [] execVM
works too. It actually sets the "0" variable..

#

Yes if you have CBA, you don't need to use it

unique atlas
#

thanks again. This conversation will spur me to learn about the differences in them.

spring stone
#

Can you limit the Garage? I'd like to have a Virtual Garage (so similar to the Virtual Arsenal) but I'd like to limit it to only a handful of vehicle.

peak plover
#

@winged wing had edited it once for a mission, maybe he knows

winged wing
#

No, the Virtual Garage cannot be limited. It also creates vehicles locally, which is problematic if you want to use it in multiplayer.

spring stone
#

๐Ÿ˜ฅ sad but okay. Thanks for the answer! ^^

idle obsidian
#

Hi! I am new to the scripting in Arma. I am using this http://www.armaholic.com/page.php?id=30731 script to do an intro, I want to get a camera strictly looking down while attached to the drone. But all the scripts seem to make camera attach to a static target

#

Does anyone know how to deal with it?

tough abyss
#

I have seen nil
You can assign to nil?

hollow thistle
#

You can assign to global with name nil

tough abyss
#

What does this mean?

hollow thistle
#
nil = 123;
missionNamespace getVariable "nil";
digital jacinth
#
myVar = nil;
#

ah you mean that way around

#
1 = 2;
missionNamespace getVariable "1";  // 2
hollow thistle
#

or not, won't work. needs setVariable.

#

"1" version works.

burnt torrent
#

when i save a scenario in editor then try to export it as a sqf i just get a error line am i doing it correctly?

cosmic lichen
#

What error line?

burnt torrent
#

error generic error in ecpression

cosmic lichen
#

How do you export it as sqf?

#

With the ingame tool?

burnt torrent
#

above that 'obectvehicle |hastag|+ obectsiumlated + obectdestructable'

#

yes mate

cosmic lichen
#

You are using 3den Enhanced?

burnt torrent
#

yes i am pal

cosmic lichen
#

Yes. Exporting doesn't seem to work with custom attributes.

burnt torrent
#

ahhh i see thanks r3vo i would of never of found that

#

im litreally so new im only learning how to export sqfs haha

#

i don't even know about scripting

cosmic lichen
#

I asked a developer a while ago but never got an answer.

burnt torrent
#

what other mods should i look out for ?

#

and you mentioned exporting with the ingame tool is that the best way?

cosmic lichen
#

There a script which do similar exporting, but I can't recommend one. Never used them.