#arma3_scripting

1 messages ยท Page 477 of 1

tough abyss
#

@velvet merlin maybe it realigns a group formation direction with the group leader

errant jasper
#

@unreal siren That's a bug in the call to the script.

compact maple
#

hey, how can i use include to create custom actions in ace_interaction ?

unreal siren
#

Any tips on solving?

quartz coyote
#

Hey could someone help me with vertor retation

#

I have an object that is slightly rotated. I want his retation to be zero, as if he was flat on the ground

#

probably

#
object: Array - Vector in format:
1: Yaw
2: Pitch
3: Roll

EDIT : Found it : [_Veh,[0,0,0]] call BIS_fnc_setObjectRotation;

digital jacinth
#

in short
create an action with ace_interact_menu_fnc_createAction
then add it to either a class or an object with
ace_interact_menu_fnc_addActionToClassor ace_interact_menu_fnc_addActionToObject

#

With the two last ones you need to say where the action should be found

unborn ether
#

@meager heart Try creating it inside a controls group, you will encounter that there. (if nothing been fixed since then)

unreal siren
frank ruin
#

life_RscPicture can I use ctrlSetStructuredText parseText format to change the background image?

halcyon creek
#

@meager heart its the name of an object it just takes that variable name and creates an explosion ontop of it

hollow thistle
#

So I'm using display with listBox on top of camCurator, does anyone has any idea if I can somehow block the mousewheel camera zoom when the mouse is over the listbox?

tough abyss
#

@hollow thistle Use _cam camCommand "manual off";

hollow thistle
#

Does this disable all camera engine key handling?

tough abyss
#

It disables moving and zooming

hollow thistle
#

Ok, ty.

#

So I need to find when cursor is over the listbox and disable the zooming then.

tough abyss
#

Yep and "manual on" to resume

frank ruin
#

How do I change the background image

#

of a Life_rscpicture ?

#

Outside the .hpp file

#

CONTROL(6969,_card1) ctrlSetStructuredText parseText format["images\draw\box.jpg"];

#

Cause that ain't fucking working :p

meager heart
#

@unborn ether rgr

prime fox
#

Hey guys, I need some help on my init.sqf. Ive created a cinematic intro of a briefing but when i try to use radio chat, nothing appears? I have tried everything and i just cannot get this to work. The script is here: ```cutText ["", "BLACK FADED"];

[0,0,false] spawn BIS_fnc_cinemaBorder;

Ryan playMove "Acts_A_M01_briefing";

sleep 5;

titleCut ["", "BLACK IN", 10];

player playMove "AmovPercMwlkSnonWnonDf";

sleep 1;

Ryan sideChat "Are we all ready? Yes?";

sleep 4;

Ryan sideChat "Right okay we have got alot to get through so if we all could settle down it will make life a hell of alot eaiser";

sleep 8;```

#

So yeah everything works other than the radio chat which is annoying but any help would be massively appreciated ๐Ÿ˜ƒ

tough abyss
#

altis life game mode made by tonic.

#

i was free killed in a role play experience server.

dusk sage
#

๐Ÿ˜ฎ !

heavy patrol
#

@prime fox if the guy receiving the message isn't a BLUFOR, you will have to put the message as global, or use a custom channel, I figured that out 1day ago with a bit of help. Kinda sucks, an option to just display the messages to players instead of a side would be the best.

outer fjord
#

So with knowsAbout How can I pull out info on what type of unit the AI sees?

#

Or would that be some other function?

meager heart
#

sees != knows

high marsh
meager heart
high marsh
#

๐Ÿ˜ฑ

meager heart
#

so yes targetKnowledge will return "position error" and "target position", maybe will works for you...

outer fjord
#

So I know the AI basically auto-detect the source of say artillary if it hits around them

#

So I would use like select 7;? That way I can get basically the grid of said unit?

meager heart
#

yeah... also maybe checkVisibility or lineIntersectsSurfaces will helps (idk what are you doing there)

outer fjord
#

I basically want to exploit the nature of the AI detecting enemy arty positions by default, and in return counter-battery them(Assuming AI is crewing a artillery piece)

#

I'm pretty newish to scripting. So I just assume.

  1. I need to determine if target is artillery
  2. Get coordinates
  3. Use one the arty functions to get the AI to fire mission said coordinate.
tough abyss
#

Two basic approaches that may work. If you determine the artillery unit (allUnits filtered with those driving an artillery or perhaps you just have the unit that needs blasating) then you can use knowsAbout to determine if they know the unit, anything above 1.5 is knowledge of being an enemy. The other way is targetsQuery which goes from all the units that unit knows about and provides some filtering so you can then get the shorter list of units and check for driving an arty.

#

Then determining if the unit is in a mortar is probably just name (vehicle _unit) == "mortar" or something pretty similar.

meager heart
#

maybe just event handler Hit ๐Ÿค”

astral dawn
#

You can make it more advanced: attach 'fired' EH for artillery. When it fires its mortar round, spawn a script to monitor shell's position every few seconds. If it gets within range of an artillery radar, you log the launch position with some accuracy.

#

As I remember by default AIs spot artillery many kilometers away if the artillery kills someone from their squad. I might be wrong.

prime fox
#

@heavy patrol Hey cheers for replying man. Yeah i got it working at 2am this morning haha. I was a survivor unit and the guy doing the talking was an officer. Turns out that i had to be a rifleman in order to receive the messages, annoying that when i am stuck on a piece of script, it is always something so small that's stopping it from working.

heavy patrol
#

wait what, a survivor is considered different of a rifleman at the point of not receiving messages ? WTF ARMA

#

Well, on my side the issue is, I still can't make any good looking chatter because I'm using the Independents to make a guerilla scenario.

prime fox
#

yeah ikr haha. took me like 4 hours to figure it out because i would never have thought blufor survivors are not classed as regular Blufor ๐Ÿ˜†. And i'm not sure what your problem is? Is the text just not showing or?

heavy patrol
#

yeah, but that's because I'm using sidechats and groupchats, and these events work only for BLUFOR not INDIE, I think I'll need a big script file to change this but I'm a noob at scripting.

#

I'm pretty sure there's a logic handler or something like that but I just can't find it

mellow wedge
#

hey guys, i'm fooling around with tvSetPicture but i can't display the picture in true colours ... it just stays black without being set to by tvSetPictureColor. does someone have any bones for me?๐Ÿ˜…

vernal mural
#

hey there. Trying to place some crew in the USS Liberty bridge, on the seats. The best way I've found is to attachTo the unit to the ship with proper offset, and it works good, but when I make him play an animation with switchMove, the animation is played stuttering, like one or two refresh a second, no more. Any idea on how to avoid it ?

mellow wedge
#

nvm, wrong baseclass definition, thanks anyway

young current
#

@vernal mural as far as I know, no way to avoid that. It has something to do with attach to and characters.

prime fox
#

Hi guys me again. Im wanting to addAction on a bed and once activated, time skips for two hours. I know how to do this normally however, im wanting to only allow the player to see this and select this once another certain trigger has been activated. I can't figure out how and would love to know how. Cheers in advance ๐Ÿ˜ƒ

#

@heavy patrol Ah right yeah im not too sure man. Worst comes to worst you can always set your side to blufor, change the loadouts and change your faction relationship status to how you want although that would be a massive ballache haha

round scroll
#

is there an easy way to have two objects attach/place via two memory points? E.g. the Nimitz has a shuttle_start memory point, the plane has a pos_launchbar memory point. The end result would be that both points are together. Currently I use modelToWorld for both, measure the distance2D and then move the plane in the direction of the shuttle_start. Anything more elegant?

vernal mural
#

when using getOut and getOutMan event handler, is there a way to check what action has been performed (get out, eject, or moveOut command) ?

halcyon creek
#

Trying to make a script where it changes the uniform when an add action is completed, I have tried various different ways and it always comes back with an error, where am I going wrong? ```titleCut ["", "BLACK", 0.2];

comment "Remove existing items";
removeAllWeapons this;
removeAllItems this;
removeAllAssignedItems this;
removeUniform this;
removeVest this;
removeBackpack this;
removeHeadgear this;
removeGoggles this;

comment "Add containers";
forceAddUniform "UK3CB_BAF_U_CombatUniform_DDPM_ShortSleeve";
addItemToUniform "FirstAidKit";
addItemToUniform "SmokeShell";
addItemToUniform "Chemlight_green";
addItemToUniform "UK3CB_BAF_556_30Rnd_T";
addVest "UK3CB_BAF_V_Osprey_DDPM9";
addItemToVest "ACE_EarPlugs";
addItemToVest "ACE_personalAidKit";
for "_i" from 1 to 2 do {this addItemToVest "ACE_morphine";};
addItemToVest "ACE_tourniquet";
addItemToVest "ACE_IR_Strobe_Item";
for "_i" from 1 to 2 do {this addItemToVest "UK3CB_BAF_9_17Rnd";};
for "_i" from 1 to 3 do {this addItemToVest "UK3CB_BAF_556_30Rnd_T";};
addHeadgear "UK3CB_BAF_H_PilotHelmetHeli_A";

comment "Add weapons";
addWeapon "UK3CB_BAF_L85A2";
addPrimaryWeaponItem "UK3CB_BAF_SUSAT";
addWeapon "UK3CB_BAF_L131A1";

comment "Add items";
linkItem "ItemMap";
linkItem "ItemCompass";
linkItem "ItemWatch";
linkItem "ItemRadio";

comment "Set identity";
setSpeaker "ACE_NoVoice";

sleep 3;
titleCut ["", "BLACK in", 0.2];```

#

Have also tried this before each one so i.e this addItemToUniform and it returns the error undefined variable this tried _this i.e _this addItemToUniform and it returns with the generic missing ;

#

It seems to be around line 14 each time where it goes wrong, so right below comment "add containers";

digital hollow
#

Syntax: unit addItemToUniform item You're missing part of the syntax for that command.

#

Same for forceAddUniform

#

You need to give those commands the unit object somehow. this works in a unit's init field. addAction will pass default parameters, one of which may be the unit, depending on how you have it set up.

ruby breach
#

Also, in general, never use comment unless you have some specific reason to (it's infinitely slower than using //)

digital hollow
#

It doesn't help that the default arsenal exports use it. =p

tough abyss
#

@round scroll I suppose you could give memory point of the 1st object you attachto to the attachTo command and for the offset you give reverse offset of the memory point of the object you attach, obtained with selectionPosition. You could vectorMultiply it by -1 to reverse. Not tested but I think the theory is sound

halcyon creek
#

Yeah thats just how the arsenal exported it @ruby breach I was going to remove it. @digital hollow when I put this so it says this forceAddUniform "UK3CB_BAF_U_CombatUniform_DDPM_ShortSleeve"; for example it returns an error

#

The add action should pass it over but doesn't appear to

digital hollow
#

Is this code going in the addAction? this doesn't mean anything in an addAction code section. Look at the wiki page for the default parameters that are passed in.

halcyon creek
#

No this is in a seperate script thats activated by an addAction

#

this addAction ["<t color='#22FF00'>Change into Flight Gear</t>","Scripts\FlightGear.sqf",[],1,false,true,"","_this distance _target < 4"]; this addAction ["<t color='#22FF00'>Change into FOB Uniform</t>","Scripts\BaseGear.sqf",[],1,false,true,"","_this distance _target < 4"];

ruby breach
#

addAction passes the following parameters to the code being called sqf params ["_target", "_caller", "_actionId", "_arguments"]; . You would need to use _caller (if using those params) or _this select 1 (if not using params) rather than just using this

halcyon creek
#

So it would have to be _caller forceAddUniform "UK3CB_BAF_U_CombatUniform_DDPM_ShortSleeve";

ruby breach
#

If you put the params line at the top of your code block/function, yes

halcyon creek
#

Right gotcha, thanks for your help ๐Ÿ˜ƒ

#
// Params

params ["_target", "_caller", "_actionId", "_arguments"];

// Remove Existing Items 
    removeAllWeapons this;    
    removeAllItems this;
    removeAllAssignedItems this;
    removeUniform this;
    removeVest this;
    removeBackpack this;
    removeHeadgear this;
    removeGoggles this;

// Add Containers 
    _caller forceAddUniform "UK3CB_BAF_U_CombatUniform_DDPM_ShortSleeve";
    _caller addItemToUniform "FirstAidKit";
    _caller addItemToUniform "SmokeShell";
    _caller addItemToUniform "Chemlight_green";
    _caller addItemToUniform "UK3CB_BAF_556_30Rnd_T";
    _caller addVest "UK3CB_BAF_V_Osprey_DDPM9";
    _caller addItemToVest "ACE_EarPlugs";
    _caller addItemToVest "ACE_personalAidKit";
    for "_i" from 1 to 2 do {this addItemToVest "ACE_morphine";};
    _caller addItemToVest "ACE_tourniquet";
    _caller addItemToVest "ACE_IR_Strobe_Item";
    for "_i" from 1 to 2 do {this addItemToVest "UK3CB_BAF_9_17Rnd";};
    for "_i" from 1 to 3 do {this addItemToVest "UK3CB_BAF_556_30Rnd_T";};
    _caller addHeadgear "UK3CB_BAF_H_PilotHelmetHeli_A";

// Add Weapons
    _caller addWeapon "UK3CB_BAF_L85A2";
    _caller addPrimaryWeaponItem "UK3CB_BAF_SUSAT";
    _caller addWeapon "UK3CB_BAF_L131A1";

// Add Items
    _caller linkItem "ItemMap";
    _caller linkItem "ItemCompass";
    _caller linkItem "ItemWatch";
    _caller linkItem "ItemRadio";

// Set Identity
    _caller setSpeaker "ACE_NoVoice";

sleep 3;
titleCut ["", "BLACK in", 0.2];```
#

Still returning an error, line 30 _caller addHeadgear "UK3CB_BAF_H_PilotHelmetHeli_A";

#

missing ;

still forum
#

why are you sometimes using this and sometimes _caller?

#

this is only valid in very specific cases. And I'm guessing your's isn't

#

That might be your problem. If it is. Then not finding it before is your fault for not looking at the whole error message

#

because it tells you exactly where the problem is

halcyon creek
#

Well not finding it, would obviously be my fault? Dont believe I blamed anyone else in what I said.

still forum
#

Actually I'm complaining about you not posting the full error message

#

if you did that it would've taken me half a second to find the issue

halcyon creek
#

If you read what I said though it returns the error on a different line in the message

still forum
#

yes.

#

I know

#

That's why I said what I said

#

The full error message shows more precisely where the error is

#

Line numbers are quite often incorrect

#

Actually in CBA/ACE for example. They are always incorrect.

halcyon creek
#

Right so the first part I'm having to change to _caller instead of this which I missed when I changed to caller? thats possibly the problem?

still forum
#

could be yeah

prime fox
#

Guys i know you are busy with someone else but if after or if you have the time can you help me with description.ext for custom sounds? I have looked everywhere and i Still cannot get my sound to play. It comes back with no error however, the sound / music just does not play for some reason. The description.ext is here: ```class CfgMusic
{
tracks[]={};

class Music1 {
    name = "Music1";
    sound[] = {"\sound\basem", db+0, 1.1};
    titles[] = {0,""};
};

};``` Cheers a million if you can, im still getting used to description.ext's in arma 3 because i hate them and can never get sounds working.

still forum
#

For reference. Here is the actual complete error

    for "_i" from 1 to 3 do {this addItemToVest "UK3CB_BAF_556_30Rnd_>
17:47:28   Error position: <this addItemToVest "UK3CB_BAF_556_30Rnd_>

it points right at the this

#

@prime fox also no error in description.ext?

prime fox
#

@still forum Yeah no error mate, it is just not working for some reason

still forum
#

how are you playing the music?

prime fox
#

I have tried to use, 'playSound "basem"'; playMusic "basem"; and also tried to select it on the trigger effects

still forum
#

both are wrong

#

you should use playMusic

#

and the name of your music is Music1

#

not basem

prime fox
#

oh

still forum
#

You should be getting errors about that though

prime fox
#

okay, il have a go

#

at what you told me

still forum
#

The wiki page I linked shows to use it. It also shows playMusic "MyIntro" below it to play the MyIntro from the snippet above

prime fox
#

YESSS!! Got it thanks a million! I just copied and pasted the CFG music and edited it around, added playMusic "Music1" like you said and now i got it working. Legend man thanks! Been trying this for 4 hours straight and gave up trying a while a go because I couldn't do it. Im guessing with sounds, its just the same but with sound?

still forum
#

look at the wiki page. It has CfgSounds too

#

I think that was more complicated

prime fox
#

what the sounds or music?

still forum
#

sounds

prime fox
#

Should be able to get the sounds working now you told me to use the class name instead of the other name. It sounds so obvious now I know what to do, cheers again man

quartz coyote
#

how would I say LeaderScore == ZERO ? Null ? because obviously 0 = false so I can't put that in

still forum
#

what?

#

what is leaderscore?

#

why "obviously" ? I see nothing obvious here

quartz coyote
#

LeaderScore is a public variable I created

#

and LeaderScore == 0 gives me a Generic error

still forum
#

Only you can know what your variable contains

quartz coyote
#

well I do know : A number

still forum
#

Apparently not

#

because then ==0 would work

quartz coyote
#

mmmh ...

#

indeed, mybad, I had set the default value to " " so it coudn't work

#

is it possible to have :

waitUntil {getPosATL Veh == [_randomPosMapNoWater select 0, _randomPosMapNoWater select 1, (_randomPosMapNoWater select 2) + 7000]};

It looks like it's expecting a number and not an Array

digital hollow
#

Use isEqualTo to compare arrays.

quartz coyote
#

great thanks

strong shard
#

@quartz coyote Are you trying to compare two positions for equality? Where one position is position of object?

quartz coyote
#

one position is position of object

strong shard
#

@quartz coyote use distance instead equal, all numbers is float, not integer

quartz coyote
#

like this ?

waitUntil {Veh distance [_randomPosMapNoWater select 0, _randomPosMapNoWater select 1, (_randomPosMapNoWater select 2) + 7000] < 0};```
still forum
#

distance cannot possibly ever by <0

#

You'd have to get very high on drugs on a international philosophy conference for that to make sense

quartz coyote
#

well since that seems to be obvious to you... it's isn't for me ๐Ÿ˜‰

#

and I never took drugs ...

#

or almost ๐Ÿ˜‰

#

oooh

#

I seeee

still forum
#

you know how far something that's 0 meters away from you is..?

quartz coyote
#

sorry

#

yes

#

indeed

#

I understand

#
waitUntil {Veh distance [_randomPosMapNoWater select 0, _randomPosMapNoWater select 1, (_randomPosMapNoWater select 2) + 7000]  < 1};```
still forum
#

is that a position in the sky?

quartz coyote
#

indeed

still forum
#

might be a little hard to hit exactly that.

quartz coyote
#

mmh

strong shard
#

@quartz coyote you waiting when heli or plane reach some point?

still forum
#

especially with a scheduled waitUntil that might only check the position once a minute...

#

I'd say impossible with a plane

#

might want a couple hundred meters as tollerance probably

quartz coyote
#
Veh setPosATL [_randomPosMapNoWater select 0, _randomPosMapNoWater select 1, (_randomPosMapNoWater select 2) + 7000];
waitUntil {Veh distance [_randomPosMapNoWater select 0, _randomPosMapNoWater select 1, (_randomPosMapNoWater select 2) + 7000] < 1};```
still forum
#

huh?

#

what use does the waitUntil even have?

#

when you set it's position it will be at that position

quartz coyote
#

well for some reason it doesn't ...

#

some times it's higher, sometimes lower

#

probably due to my setposATL

#

and terrain hight changing

#

I should probably us setPos

ruby breach
#

Higher or lower is all relative. Higher or lower compared to.... what?

still forum
#

setPosATL and setPos are the same.

#

you might want setPosASL

quartz coyote
#

@ruby breach well setPosATL is compared to Terrain no ?

ruby breach
#

ATL is going to be relative to the terrain; unless that's not what you want, in which case using ASL is probably better

quartz coyote
#

ah !

#

ASL then

still forum
#

above terrain level
could say that it's "compared to terrain" yeah

quartz coyote
#

yeah plus i'm messing up my random position aswell

round scroll
#

@tough abyss thanks, that worked nicely with the vectorMultiply

digital jacinth
#

is it possible to make AI shoot dogs? Even when i create them as a unit instead of an agent the ai will ignore them.
I create them like this

(group player) createUnit [_type, position player, [], 0, "FORM"];
#

I am looking for a solution to make ai recognize them as enemy and not manually program them to shoot them

quartz coyote
#

Maybe

Dog addRating -10000; ```
heavy patrol
#

ahah, give TK point to the dog, does that works just like for civilians ?

digital jacinth
#

iirc that won't do as a dog does not inherit from camanbase

#

and yeah it did not work

tough abyss
#

Attach invisible enemy target?

digital jacinth
#

like an AI?

high marsh
#

Here, instead of shooting the poor puppy let me just have em. I swear they'll all be friendly in 3 months

halcyon creek
#

Quick question if I want the script to run on every player when one player activates it what would I put? remoteExec VM "Scripts/Scriptname.swf"; ?

#

and then if (isServer) then { }; in the script?

ruby breach
#
[[], "Scripts/Scriptname.sqf"] remoteExec ["execVM", -2]; //executes on (all) players only
``` https://community.bistudio.com/wiki/remoteExec
inner swallow
#

.swf?

#

should be sqf

dusk sage
#

Maybe he has a Super Wicked File

high marsh
#

@inner swallow
swf = Ascended SQF (top secret)

inner swallow
#

lol

#

I'm hoping that was just a typo ๐Ÿ˜„

high marsh
#

Have no idea about the rogue "VM" between remoteExec and the string though. (Virtual Monkey, does the execution)

digital jacinth
#

swf = shock wave file
He is programming flash with action script ๐Ÿ˜‰

high marsh
#

๐Ÿ˜ฑ

digital jacinth
#

now i gotta cry because i also do that at my job

halcyon creek
#

That was just a typeo haha

digital hollow
#

special warfare function

halcyon creek
#

@ruby breach so I wouldnt need if isServer in the script?

ruby breach
#

As long as you pass -2 as the target, no

halcyon creek
#

Fantastic, cheers

ruby breach
#

0 - Everyone, 2 - Server Only, -2 - Everyone except Server

halcyon creek
#

If I was hosting the server would -2 not run on mine then?

inner swallow
#

correct

#

in which case, [0,-2] select {isDedicated}

#

(i think, my memory is rusty)

#
[[], "Scripts/Scriptname.sqf"] remoteExec ["execVM", [0,-2] select {isDedicated}]; //executes on (all) players only```
#

okay, no, because that's running on a player and isDedicated will always be false

#

I don't remember, but something like that ๐Ÿ˜„

still forum
#

wtf is that code after the select??

inner swallow
#

it is uh... stuff

#

either something very similar works, or this works, i can't remember exactly

#

yeah okay

#

i mean you don't need the {}

#

but that should work

#

(not in this context but [0,-2] select isDedicated is correct as far as i can tell)

#

aha, for this you'd want isServer

#

[-2,0] select isServer @halcyon creek

halcyon creek
#

Ill give it a shot

tough abyss
#

No, dedicated is also a server you will be executing on dedicated with that expression. Donโ€™t reinvent the wheel, BIKI has all the code you need

#

Add if isDedicated exitWith {} to the file that will be executed and use 0 for target. Clear and simple, the script will abort on dedicated every time.

#

If you have headless client you will need to abort on it too unless you consider it a player, which it is by default

gleaming cedar
#

Hello

#

How can I get an Ai to switch seat

inner swallow
#

@tough abyss that's run player side

#

At least, that's what I understood from his initial description

tough abyss
#

Have you tried action with MoveToxxxxxx?

gleaming cedar
#

I just do setdammage and hide object lol

quartz coyote
#

@still forum Is there a way to delete a Vehicle (called "Veh") and create a new one (Called "Veh" as well) and still keep a loop with Veh in it running ? Doesn't the Veh var get updated with the new vehicle ?

still forum
#

deleteVehicle
setVehicleVarName
Veh = _newVehicle

#

Dunno what you mean with "keep a look with Veh in it" doesn't make any sense in my brain

quartz coyote
#

loop sorry

#

when I SQF deleteVehicle Veh; Veh = "B_Plane_Fighter_01_F" createVehicle _Pos; my loop gives me the error "Veh variable undefined"

#

My loop is in a side script

still forum
#

do it in unscheduled

quartz coyote
#

sorry I still have problems understanding what is scheduled and unscheduled

waxen tide
#

unscheduled means the engine will execute it as soon as possible and not stop executing it until it is done. Everything else will wait for your script, basically. Scheduled means it is added to a scheduler and, together with all the other stuff running, given 3ms execution time per frame. Which means you have no clue when your script will be finished exactly, and scripts might not finish in the order you issue them into the scheduler. Use unscheduled for timecritical stuff, basically realtime, and scheduled for everything else.

#

You can issue massive scripts that take minutes to complete to the scheduler, and the game will largely be unaffected (depending on the situation, what your script accesses, etc) If you try to do that in unscheduled, i think the game will look up until your script is done or more likely the engine will abort your script after time X.

quartz coyote
#

like Spawn is unscheduled and Call is Scheduled ?

waxen tide
#

it should say on the wiki page.

quartz coyote
#

I use that everyday

#

it's just the knowledge behind that scheduled thing

#

I can't get what is what

#

and how to identify it

#

but thanks for trying to explain !

#

Can someone at least link me a post where I can read something about it

#

?

waxen tide
quartz coyote
#

thanks

prime fox
#

Hey lads me again haha, I'm trying to create a chat.sqf but I'm having some problems. I have grouped up some units along with the player in the same group. Set everyones group identity however, when i try to script in sideChat, it comes up with wrong names. If i try group chat, it just stays on 1. Any help?

waxen tide
quartz coyote
#

So what @still forum wanted to say is : Call your script so it will be unscheduled ?

inner swallow
#

yeah

#

spawn is scheduled

quartz coyote
#

Right now i've understood f

inner swallow
#

but i think for call you'll have to make it a function first

quartz coyote
#

got it

#

But i don't understand what this will change in my situation ...

#

what ever I do it doesn't change anything ...

#

I tryed calling the loop and calling the deletevehicle, nothing changes, the Veh is undefined after deleteVehicle

meager heart
#

๐Ÿค”

cosmic root
#

Your best bet would be to add some check if the vehicle is null or the variable is nil. Something like

if (isNil "Veh") exitWith {};
if (isNull Veh) exitWith {};
//CODE
unreal siren
#

Hey guys! I read a changelog for a scenario, why would you do this? I thought compile was better.
Tweaked: All spawn compileFinal preprocessFileLineNumbers replaced with execVM.

meager heart
#

execVM is shorter, about 45+ characters are gone... ez to write now /s

#

if you're not trying to hide your stuff, just use cfgFunctions... ๐Ÿคท

kindred lichen
#

Hey, has anyone had any trouble with MoveInDriver not working for newly spawned AI units?

#


player addMPEventHandler ["MPRespawn", {
_veh = "OPTRE_M12G1_LRV" createVehicle position player;
_newGroup = createGroup [east, true];

[Player] joinSilent _newGroup;

_driverDude = "OPTRE_UNSC_Marine_Soldier_AT_Specialist" createUnit [position player, group player];

_nul = [_driverDude,_veh]spawn {
    
    sleep 1;
    Player  moveInGunner (_this select 1);
    sleep 2;
    (_this select 0) moveInCargo  (_this select 1);    
    
    
};
}];

#

trying to make a gauss-Hog deathmatch, where players spawn in a vehicle, with an AI driver, so they can essentially solo the vehicles, but the AI never seems to get moved into the vehicle.

#

Damn, I got no idea.

#

Might be something specific to using ace3 and OpTrebuchet mod.

#

Also using vcom AI

tough abyss
#

Why don't you just waypoint them to get in? Or am I misunderstanding?

kindred lichen
#

I'd like it to just instantly happen on respawn.

#

I want the player to respawn in the gunner seat of a vehicle with an AI driver in the driver seat.

#

nvm I found it.

#

type createUnit []:
doesn't return a reference to the unit.

#

wow.

#

player addMPEventHandler ["MPRespawn", {
_veh = "OPTRE_M12G1_LRV" createVehicle position player;
//_veh = "B_LSV_01_armed_F" createVehicle position player;
_newGroup = createGroup [east, true];
[Player] joinSilent _newGroup;
_driverDude =_newGroup CreateUnit ["OPTRE_UNSC_Marine_Soldier_AT_Specialist" ,position player, [], 0, "FORM"];    
_driverDude moveInDriver _veh;
Player  moveInGunner _veh;
}];

This works fine lol

dry egret
#

is it possible to set textures on the screens on the USS Liberty?

#

i didnt see anything in the config listed in the hiddenTextures so i was hoping BIS was going about it another way

unreal siren
#

@meager heart Won't server startup be noticably slower with execvm?

meager heart
#

yes it will be slower vs function

unreal siren
#

Vs call precompile processfilenumbers?

#

Mission restarts are instantanious right now, the UI loads on the client almost overlapping the ArmA loading screen. Server loads the objects from the database before the player can notice right now.

meager heart
unreal siren
#

My bad - I meant call precompile vs a function

meager heart
#

well... CfgFunctions does exactly that ^ in better way and automatically... with extra options...

unreal siren
#

So it's cleaner & faster, if I were to redo everything to work as a function...

meager heart
#

imo 100% yes, but it's up2u

unreal siren
#

I'm probably overthinking this.
fnc vs compile preprocessefilelinenumbers
Function1 = Time: 0.000497217, Time: 0.000498389, Time: 0.000497119

Function2 = Time: 0.000497803, Time: 0.000501709, Time: 0.000498877

#

I'd have to be writing an actual game for this to add up

meager heart
#

if you want the "real performance benchmarking" you can ask @still forum how to do it

still forum
#

@unreal siren Tweaked: All spawn compileFinal preprocessFileLineNumbers replaced with execVM.
for on the compileFinal is just idiotic and you'd only do that if you had no idea what the F you were doing.
Second
spawn compile preprocessFileLineNumbers is literally equal to execVM.
But execVM is still retarded for everything that you call more than once. Because you are recompiling the whole script everytime.

#

@quartz coyote call is not unscheduled. Don't know why the other people are trying to tell you that. It's wrong.
call just keeps the scheduled-ness. call in scheduled stays scheduled. call in unscheduled stays unscheduled. spawn always makes things scheduled.
and isNil {code} always makes things unscheduled.
So do

isNil {
deletevehicle
Veh = createVehicle
};
#

@kindred lichen you might also want assignAsDriver for AI before you moveIn.

quartz coyote
#

@still forum oh.... Thanks...

still forum
#

@unreal siren fnc vs compile preprocessefilelinenumbers
You are doing something wrong there.
Function = compile preprocessFileLineNumbers "myFile.sqf";

Then profile
call function
vs
call preprocessFileLineNumbers "myFile.sqf"
and see the difference.

quartz coyote
#

@still forum I just can't understand why this will enable VEH to be undated with the new vehicle inside my loop

still forum
#

undated?

#

you mean updated?

#

p is quite far from n to be a typo

#

The problem is that scheduled script will just pause inbetween

#

so it pauses after you deleted the vehicle and before you create the new one

#

Also Veh is a stupid variable name and may break at any time

quartz coyote
#

I'm on my phone and it's autocorrecting

#

Break ? Why and how ?

still forum
#

Because it's such a short variable name without a tag

#

anyone else might also happen to reuse that variable

#

and then you'll be like "whaa? Why is it suddenly not working anymore I didn't make any errors anywhere"

quartz coyote
#

I see

#

So SQF isNil
That's going to pass the full code and pause only when it's finished ?

still forum
#

yes

quartz coyote
#

So my Loop containing Veh will never get the update due to pause between deletevehicle and createvehicle and will only get the update when the createvehicle will finish ?

still forum
#

what?

#

It won't pause

#

Don't know what you are trying to ask

meager heart
#

probably it's time for sqf blogs links... ๐Ÿ˜ƒ

quartz coyote
#

No plz

#

No links

still forum
#

my scheduler post is too technical

#

Wouldn't understand anyway

quartz coyote
#

I can't understand shit when I read. I need a conversation

still forum
#

And it also doesn't really explain this

#

a scheduled script may pause at any time. And it can theoretically pause for up to several hours

#

So it could be that you call deleteVehicle Veh and after that the script doesn't continue executing for an hour

#

meanwhile you other script comes along and tries to do stuff with Veh but that was just deleted.

quartz coyote
#

yea I understood that. Thats why : If I understood corretly the perpous of the isNil {}; is that it will pass the code without pausing and will not give time to my other script to see that Veh has been deleted right ?

still forum
#

isNil {} will freeze the entire game until it's code finished executing

#

no other script can be executed inbetween

quartz coyote
#

Ohhhhhh I see

#

now it's cristal clear

#

I'm a slow learner so thanks for your patience man.

scenic pollen
#

How long is too long (in ms) for a function to complete execution in a non-scheduled environment every second?

still forum
#

depends on how much fps you want

#

especially every second. If you have consistently slightly lower FPS the player doesn't notice it as much as sudden fps drops

#

I'd say don't go over 5ms. But that's already a drop from 60->45 fps

blazing quiver
#

I was hoping someone could give me a hand with a question I had. I have a mission that requires that players have access to a limited arsenal, but not be given the ability to load any pre-saved loadout they may otherwise have. I found a script that disables the "load loadout" buttons in the vanilla arsenal UI, but players can still use the keyboard shortcut of Ctrl+O to open the loadout screen. Is there any way I could disable the shortcut as well?

#

[ missionNamespace, "arsenalOpened", {
disableSerialization;
_display = _this select 0;
{
( _display displayCtrl _x ) ctrlSetText "Disabled";
( _display displayCtrl _x ) ctrlSetTextColor [ 1, 0, 0, 0.5 ];
( _display displayCtrl _x ) ctrlRemoveAllEventHandlers "buttonclick";
}forEach [ 44146, 44147 ];
} ] call BIS_fnc_addScriptedEventHandler;

#

There is the script in question

scenic pollen
#

@still forum Thanks. This is for a script running server-side (potentially where AI will be running if not using a HC), so I'm just wondering how long a func should run before performance impact on AI is noticeable.

#

5ms sounds like a good shout

still forum
#

ah on server you should be fine with 10ms or more

#

wouldn't go past 100ms

scenic pollen
#

Great, thanks!

meager heart
#
/* 
    Buttons controls ID's  
    HIDE   44151 
    RANDOM 44150 
    SAVE   44146 
    LOAD   44147 
    EXPORT 44148 
    IMPORT 44149 
    TRY    44346 
*/
[
    missionNamespace, "arsenalOpened", {
    params ["_display"];
    _display displayAddEventHandler ["KeyDown", {_this select 3}];
    {
        (_display displayCtrl _x) ctrlEnable false;
        (_display displayCtrl _x) ctrlShow false;
    } forEach [44151, 44150, 44146, 44147, 44148, 44149, 44346];    
}] call BIS_fnc_addScriptedEventHandler;
```did that ^ long time ago, but afaik still works
vernal mural
#

hey @still forum ? Is there a reference doc that I can read about the communication tower added by TFR > 1.0, please ? Or is it enough to be close to it in order to increase the radio range ?

still forum
#

what is TFR? And how am I related to it?

vernal mural
#

Task Force Arrowhead Radio, missed the A

#

sorry ^^'

still forum
#

Ahhhh

#

If your radio can reach the tower. The tower will retransmit it

#

But the transmission loss add's up.
If the tower is 2km away behind a hill and you have 50% transmission loss. The tower will retransmit the signal with 50% loss. And the loss from Tower->Receiver is added on top of that

errant jasper
#

Why the tower retransmit with loss? Gameplay reasons? Or is the loss not signal strength, but more like "part of the signal" that never reached in the first place?

vernal mural
#

Ok great, thank you !

unreal siren
#

@still forum Gotcha. So I should revert the changes he did back to spawn compileFinal preprocessFileLineNumbers? Or spawn compile preprocessFileLineNumbers?

still forum
#

@errant jasper second one exactly. Distorted signal arrives. Distorted signal gets retransmitted

#

@unreal siren you shouldn't do anything at all. Re-read what I wrote

unreal siren
#

for on the compileFinal?

still forum
#

what?

unreal siren
still forum
#

wtf...

#

my brain bugged

#

just ignore the for on

unreal siren
#

I was trying so hard to comprehend

#

Gotcha

#

So it's the compileFinal that was no bueno

still forum
#

The Final is useless.
And if you remove the final then it's just equal to execVM so you might aswell just use execVM

unreal siren
#

I see. What makes it useless?

#

HDD vs memory block, I thought it's purpose was to write to memory

#

probably a doc or page I'm overlooking

still forum
#

It's useless because it just does literally nothing

#

compileFinal marks the variable as final if you write the script to it

#

you never write it into a variable though

#

so.. useless

ruby breach
#

@rocky mortar Re: the code you posted in #dev_rc_branch, you're going to error during _object = call newobject; because newObject needs arguments to return a value. Beyond that point, I'm pretty sure that _object is just going to be nil

still forum
#

yes. That's the problem

#

he wants to somehow keep private variables valid in that script even though he leaves it. That's just never going to work

rocky mortar
#

newobject returns a scope wich should still have acces to private variable until the scope is unreferenced

solar coyote
#

Hey guys. I've come here looking for advice. Currently I have an issue with Zeus. I'll make it short. I'd like to play it competitevly and also with free range for Zeus camera, but ability to spot players is giving an advantage to Zeus. What i'd like to do is to hide player (and all opposing faction units) while they are not in sight of friendly units. hideObject does not work, as it seems completely removes model therefore AI cannot spot them at all. I saw GetTactical achieved results similar to what i want, but its SP only so same technologies may not apply here. I'm looking forward to any suggestions. Cheers!

meager heart
#

afaik hideObject has local effect, so maybe you can try remoteExec it on zeus (as target) aka it will be hidden only on zeus client... ๐Ÿค”

peak plover
#

Yeah, run a script that hideObjects the units you want on the client you want them hidden on

solar coyote
#

If ai is local (i tested it only hosting, not dedicated) they cannot detect unit. A guy can just stand 5m away and shoot them all and all AI do is run around like headless chicken. It might work on dedicated, but i'm not sure if spanned AI is local to Zeus player or server. Also i would like to make it hosting friendly.

peak plover
#

ex. ZEUS hideObjects all players, this will make all players invisible for the zeus

#

yeah, ai spawned in zeus is local to the player spawning them most likely

#

you need to get a script to move the units from player client to server or headless client

ruby breach
#

@rocky mortar What is is that you want _result to return?

snow pecan
#

He wants it to return "billy"

#

Pretty sure he wants to use newobject as a constructor for class instantiation.
The following would then be used as a setter ["_set_prenom", "billy"] call _object;
But that's just not going to work.

quasi rover
#
[_unit] join (group _caller);``` 
`join` also change the side of _unit?     e.g. _unit was a civillian, now change to _caller's side, west ?
meager heart
#

try this in debug console >

player spawn {
    hint str [side group _this];
    sleep 3;
    [_this] joinSilent createGroup east;
    hint str [side group _this];   
};
dark swallow
#

I am having a issue when someone join my server everyone else there gear disapears off them so the vest,helmet and backpack?

quasi rover
#

@meager heart thanks.

tough abyss
#

@dark swallow donโ€™t put your gear code in unit init

dark swallow
#

@tough abyss thanks

rocky mortar
#

@ruby breach result expected is billy as it was set just before

dry egret
#

anyway to get createVehicle to create the vehicle on the deck of the carrier?

#
possit = getPos loc;
possit set [2,200]; //adjustment to be above the carrier deck
signCircle ="Sign_Circle_F" createVehicle (possit);
hint str(possit);
#

even with offsetting the z axis, createVehicle is still placing the object on the ground at the bottom of the sea

still forum
#

@rocky mortar newobject returns a scope no it doesn't. You can't "return" a "scope"

rocky mortar
#

What do you mean ?

#

closures works in some other langage that bring variables of parent scope to child scope

hollow thistle
#

But SQF is not an JS. I doubt they would implement that even if asked.

#

I guess it would require a lot of internal changes.

jade abyss
#

closures works in some other langage <- There is your Problem. Sqf != AnyOtherLanguage ๐Ÿ˜„

rocky mortar
#

@hollow thistle yes perphaps, but it could be so powerfull

hollow thistle
#

Could be. But imagine what bugs would be able to be made by inexperienced scripters.

#

:D

#

And SQF was kinda made to be accessible even for random "Jon Doe".

still forum
#

The core of SQF can't support such a thing

#

That's what namespaces are for

rocky mortar
#

: )

still forum
#

put a variable into a namespace.

hollow thistle
#

I wonder why. Are code blocks stored serialized?

still forum
#

They are compiled to VM instructions and stored along with the string of the code (that you get back when you str)

#

code blocks are code.. literally.

#

They don't have a stack. No variables. No nothing

hollow thistle
#

Yeah so no way it would hold reference to private var so it is not unrefernced.

#

Tl;dr don't ever think about closures ๐Ÿ™ƒ

still forum
#

not even know what that is. I could give you script commands to get/set variables to current scope or any higher scope. That would do that too.
But why? Just use a frickin namespace instead of shitty dumb workarounds that will never work.

hollow thistle
#

Idk, don't ask me.

#

The guy just wanted to use practices from JS.

#

But SQF is SQF.

rocky mortar
#

not JS, you have too in other langage

#

like Go :x

#

or Python

#

: ))

hollow thistle
#

Or php

dry egret
#

give me C++ anyday

still forum
#

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

dry egret
#

lol

still forum
#

Intercept-Python ยฏ_(ใƒ„)_/ยฏ

rocky mortar
#

i dont understand how private variable go along code across the different scope

#

it's just a guess, I think the variables are deferenced when the brackets close.

hollow thistle
#

dedmen said above why it wont work.

still forum
#

The scope is stored on a stack of scopes. If you leave the scope. It's removed from the stack. Because why keep something in memory that can't ever be accessed again and has absolutely no use?
And when the scope is removed from the stack. It's deleted.

jade abyss
#

true.

rocky mortar
#

yes that's what i understand, but "has absolutely no use" according the closure the example, there is a usage ๐Ÿ˜ƒ

jade abyss
#

Wich one?

jade abyss
#

๐Ÿค”

#

Why not giving it a simple "Output"?

rocky mortar
#

can you give more details?

still forum
#

I just don't understand why you would want to take the hard and impossible way. Instead of just using a namespace or an array

hollow thistle
#

The closure here is used to create some kind of OOP code, go with namespaces for that in SQF and you will be fine.

rocky mortar
#

namespace are public

#

if i use namespace the variable will be share with all the whole code

still forum
#

use multiple namespaces then?

rocky mortar
#

in fact it s not really a problem of workaround

#

cause i have already some public workaround

#

it was to raise a request for evolution that could bring a lot of things

jade abyss
#

Like?

#

Sry, but for me it sounds just like "Opening the possibility to break more things"

still forum
#

No matter how often you ask it's not gonna happen ^^. It's a major change in the scripting system that no one besides you ever asked for

rocky mortar
#

closure are a master piece dscha, you should look for documentation on this

jade abyss
#

I am not asking to "look for Demonstration", i was asking for an example from you.

#

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

snow pecan
jade abyss
#

Like: What would be the benefit in it

hollow thistle
#

Data encapsulation.

#

IMO in sqf they would be kind of "nice to have" but not necessary to have as we have other ways of doing same/similar things.

jade abyss
#

And the benefit of it would be? (asking again)

meager heart
#

well you can have it... i thought it's clear ๐Ÿ˜„

meager heart
#
private _thing = createVehicle ["Sign_Circle_F", player modelToWorld [0,0,30], [], 0, "CAN_COLLIDE"];
```into the console ^ and look up @dry egret
digital jacinth
#

in order to make AI shoot the player dog I had to resort to this
https://i.imgur.com/BEAeNZd.jpg

Luckily you can make the thing fully invisible with setObjectTextureGlobaltoo bad the shadow will stay

#

at leat the dog has now an "inventory"

still forum
#

Angel dog

digital jacinth
#

now i need to make it fly

still forum
#

just flip the attachTo around ๐Ÿ˜„

digital jacinth
#

and i need to fix the "smell-o-vision" detecting the crew inside the drone...

meager heart
#

that dog shadow there... ๐Ÿ˜ƒ

digital jacinth
#

yea... one of the many downsides playing as a dog, i had to reverse engineer ace throwing and dragging a bit

meager heart
#

๐Ÿ˜„

digital jacinth
#

but hey, you can get into vehicles now, drag downed people, pick up that grenade and run into the enemy

meager heart
#

Advanced K9++ ๐Ÿ˜ƒ

digital jacinth
#

requirements are cba and ace, tho i accidentally launched with acre, so woops

meager heart
#

you can remove init.sqf with enableSaving [false,false]; and just add in description.ext > saving = 0;

digital jacinth
#

good to know.

meager heart
#

yeah, afaik it does exactly the same

waxen tide
#

Is there a good tutorial around classes for a slow witted person?

still forum
#

classes?

waxen tide
#

No more like classes people define in missions

waxen tide
#

glances at Dedmen

digital jacinth
#

I am afraid you do not define classes in mission really. What exactly do you mean?

#

SQF is not an objective based language sadly

waxen tide
#
class CfgCompositions {
    class test {
        #include "test.sqe"
    };
#

That structure is from Larrow's eden comp spawn script for example

cerulean locust
#

that's just a custom class defined in description.ext.

#

It doesn't do anything on it's own. But it can be read from script.

ruby breach
waxen tide
#

"uses the same syntax as the config.hpp file"

#

is there more documentation on that?

#

my wiki fu is weak today

#

Well thanks so far ๐Ÿค”

cerulean locust
waxen tide
#

Not defining the load order will guarantee you to end up in a world of pain and horror.

#

Been there done that โ˜•

still forum
waxen tide
#

Really? Good thing you mention it, i had not noticed.

#

#define DEBUG_DEV getNumber( missionConfigFile >> "LARs_spawnComp_debug" ) isEqualTo 2 Oh there is a missionConfigFile? splendid

still forum
#

that's description.ext

#

next to mission.sqm

#

the normal configFile is config.cpp inside mods pbo's

waxen tide
#

the entirety of it?

unreal siren
#

@still forum Thanks for helping me with the compile methods! It clicked. The new code is much more readable.

waxen tide
#

shouldn't the missionconfig show up in the config viewer?

inland badger
#

So, I've been trying to figure out how to kill the lights on a map that I'm working on a scenario for. I've managed to kill most of the lights but for some reason these once keep staying on. I've tried to find the class name for them by outputting the objects located near me but still no success. Is there anyone out there able to help me out? https://imgur.com/a/zB8gN18

This is what I got so far, the map is set on Chernarus 2035 which uses CUP objects sadly, and no it's not a zombie mission...

{
    for "_i" from 0 to count getAllHitPointsDamage _x - 1 do
    {
        _x setHitIndex [_i, 0.97];
    };
} 
forEach nearestObjects 
[
    player, 
    ["Lamps_Base_F", "PowerLines_base_F", "Land_PowerPoleWooden_F", "Land_LampHarbour_F", "Land_LampShabby_F", "Land_PowerPoleWooden_L_F", "Land_PowerPoleWooden_small_F", "Land_LampDecor_F", "Land_LampHalogen_F", "Land_LampSolar_F", "Land_LampStreet_small_F", "Land_LampStreet_F", "Land_LampAirport_F", "Land_PowerPoleWooden_L_F"], 
    600
];
still forum
#

That light that's staying on on your screenshot doesn't even have a pole or a bulb :u

#

I'd say bug report to CUP's feedback tracker with that. If the light is really there floating in the air like that

inland badger
#

That's the thing it does it on several buildings, when I kill all of the lights in the area it becomes brighter even :S but yea I'll report it to them as well

kindred lichen
#

In order to run something in "preinit" do I just make a preinit.sqf file?

#

or is it somewhere else like description or something?

still forum
#

description.ext

#

CfgFunctions

kindred lichen
#

So if I define a function in cfgFunctions it gets ran?

noble pond
#

it compiles on mission start i believe

dusk sage
#

If you mark it as preInit, yes

kindred lichen
#

I'm trying to remove all the rocks and bolders from a map, and hideObjectGlobal is suggested to be run in preinit.

still forum
meager granite
#

@inland badger I think you iterate through wrong array

#

getAllHitPointsDamage will always return array of 3 arrays

#

Not sure if it will help with your issue though

#

{_x setHitIndex [_forEachIndex, 0.97]} forEach (getAllHitPointsDamage _x select 0)

inland badger
#

@meager granite cheers mate, I'll give it a try and see if it works ๐Ÿ˜ƒ

quasi rover
#
_hostage setCaptive false;
[_hostage] joinSilent (group _caller);

In Host Server mode, _hostage joins our group and become WEST faction from CIV, but Dedicated Server mode, the _hostage do not join our group and still CIV faction. any tips to solve?

ruby breach
#

setCaptive is AL

digital jacinth
#
[_hostage,false] remoteExec ["setCaptive",_hostage];
[_hostage] joinSilent (group _caller);

Explanation, setCaptive has to run on the machine the unit is local to. joinSilent is actually global and it should work on any machine. Make sure that _calleris defined

quasi rover
#

I will give a try, thanks guys.

drowsy axle
#

Quick Question: Variable aren't case-sensitive, right?

#

Example: Capwell and capwell will be the same variable?

dusk sage
#

yes

tame portal
#

yEs

halcyon creek
#

trying to get a vehicle to have a set distance between eachother in a convoy, on the commnuity wiki it states theres a command for it (https://community.bistudio.com/wiki/setConvoySeparation) and the given example is this vehicle setConvoySeparation 20; however when I put this in a vehicles init field it returns and error stating that there is a genreic error in the expression and it is missing ;

#

any ideas?

ruby breach
#

Are you actually defining vehicle?

halcyon creek
#

Nope, so say if the variable name is mast1 it would be mast1 setConvoySeperation 20;

digital jacinth
#

use thisinstead of vehicle

#

vehicle is a command to get the current occupied vehicle of a unit, you are putting this into the init field, so you can simply use "this"

ruby breach
#

If in script, yes (assuming mast1 is a variable for an object). In an init field, you would use this

halcyon creek
#

Thanks for the help, im going to use the fact its 6.50am here to put such a simple and obvious oversight on my part as the excuse ๐Ÿ˜‚

vernal mural
#

@still forum following my previous question about TFAR antennas, if I understand the headers correctly, in order to create a new tower by script I should
1 - create the object
2 - call TFAR_antennas_fnc_initRadioTower on it
3 - call TFAR_antennas_fnc_pluginAddRadioTower ??
According to the code initRadioTower seems to use a CBA delay function to call pluginAddRadioTower, so maybe the third step is useless ?

still forum
#

plugin stuff is called by initRadioTower. You shouldn't touch that

vernal mural
#

Good, thanks

still forum
#

If you want to move the tower. You have to call initRadioTower again for each position update

vernal mural
#

Is the old position still considered as a valid tower ?

still forum
#

yes

#

wait

#

not after you call init again

#

so if you move the tower but don't call init. Everyone will think the tower is still at it's old place

vernal mural
#

I see, it is linked to the object, it will know that a tower is already created with the given object and will update the former position instead of creating a new one. Good to know

vernal mural
#

@still forum again asking questions about TFAR ^^ what if a tower retransmit a player's signal, and another tower is reached ? Is the signal broadcasted adding its own deterioration ?
like : player1 ==> towerA ==> towerB ==> player2 with each players and towers only in range with their direct neighbors ?

still forum
#

only one tower supported

#

I planned satellite connection between towers for later

vernal mural
#

Good to know. So if I want to ensure a good radio connection between a base and a remote location, I have to make sure that the base tower is able to reach the remote location, and the other tower is able to reach the base.
Alternatively, a single one tower is enough if placed half distant of the base and target location, and if personnal-carried radios are powerful enough to reach the tower.
Okay thanks. Lots of side missions ideas there !

still forum
#

there is also a global radio range modifier. Can be used to reduce the range of every radio (Like turning the 152 from a 5km into a 2.5km radio) to make radio towers be more worth it

vernal mural
#

Playing on Altis, the map is wide enough to make the towers worthy, even without reducing the range of radios : indeed, a 5km remote location is still reachable but with a horrible signal loss. Adding radio towers in secured locations (on a persistent mission) will allow to enhance the global communication network for future battles and objectives in the area. However, I will check this modifier, maybe we can tweak it to force the deployment of relays in some very remote and isolated places. More gameplay possibilities !

still forum
vernal mural
#

ohhhh great ^^ further questions will be in a better place there

tight cave
#

Might be a bit off topic and have nothing to with arma 3

Greetings, (using google sheets) I'm attempting to have information show up in the red info box depending on what sector I have highlighted.
I have made a flowchart as to how I see that working. From what I understand I may need to have a script written for this, however if it is at all possible to achieve this using the available functions, that'd make my life a lot easier. Any help would be appreciated. Thank you.

https://cdn.discordapp.com/attachments/476107547221164042/477113735031291934/unknown.png
the flowchart as mentioned above(edited)

https://cdn.discordapp.com/attachments/138772603694350336/477116625225646083/unknown.png

errant jasper
#

You would probably have to use another technique since you cannot capture simply clicking on a cell (see https://productforums.google.com/forum/#!msg/docs/JBhprb-b6x0/5FSuFQjHEQAJ ).

Once you find a mechanism to detect "cell" selection, you can use JavaScript to get the cell coordinate and read / write the proper cells.

Also second image looks like a game of Battleship: "You sank my Starship!". Also yeah, this is definitely be off topic.

vernal mural
#

I wonder if there is a way to use ACE arsenal to define what items a crate contains, and then make this content accessible only with the vanilla inventory system ?

drowsy axle
#

Thanks @dusk sage

#

& @tame portal

tame portal
#

Lol don't mind my comment ๐Ÿ˜„

drowsy axle
#

:/ I did mind it

#

@vernal mural isn't used that way. You could use the export function on BI arsenal. And input it into a box's init

vernal mural
#

Mh, good idea. Will check

astral dawn
#

I make an AI man sit with switchMove. Is it possible to make him automatically stop the animation and engage enemy when his behavior automatically switches to COMBAT without waitUntil {(behaviour _this) == "COMBAT"; }; and without polling his behavior in a loop?

astral dawn
#

I am actually thinking, maybe to make AIs sit on benches it would be better just to make bench-vehicles through an addon?

limpid pewter
#

Hey buddies,

#

Anyone know what the aspect ratio is that's used for all weapon pictures extracted from their configs? For example; ```sqf
_picPath = getText (configFile >> "CfgWeapons" >> _classname >> "picture");

#

Or are they all different?

meager heart
#

probably 2 : 1

#

like 1024x512

limpid pewter
#

Thanks mate, will try that.

quartz coyote
#

Hello, Is this possible ?

if ({_x distance Object < 50} forEach playableUnits) exitWith {}; ```
I want to detect when no playableUnits are at 50m from an object
still forum
#

no that's.. yes it's possible.. but what you are doing doesn't make sense

#

forEach returns only the result of the last value

#

so you are checking here if the last unit inside playableUnits is less than 50m away

quartz coyote
#

ah

still forum
#

playableUnits findIf {_x distance Object < 50}
Use this to find the first unit inside playableUnits that's closer than 50m

#

if you don't find any. That means there is no unit

#

if (playableUnits findIf {_x distance Object < 50} != -1) exitWith {};

quartz coyote
#

genius ....

#

thanks

#

other question, if at the end of a script, I decide to execute the same script, will the 1st script end while the second is booting of will the 1st stay active because init command was in it

#

?

still forum
#

depends on how you execute it

#

if you call then yes.

quartz coyote
#

and spawn ?

still forum
#

because the call waits till the script is done executing

#

whereas spawn continues right away

quartz coyote
#

so if I spawn Script2 then Script1 will close without any trouble

#

but it I Call Script2 then Script1 will stay open ?

still forum
#

ye

quartz coyote
#

okay thanks

brave jungle
#

{
   if (side _x == "EAST") then {

   _x addEventHandler ["Killed",
        {
            switch (_x isKindOf) do
            {
                case "Tanks":
                {
            //Code incl. other params for isKindOf and default
        };
            };
        }];
   };

} foreach allunits;

How do switch isKindOf ?

still forum
#

You.. don't

brave jungle
#

I don't want a bunch of Ifs

still forum
#

Like... Well. I guess... Maybe

#
switch true do
            {
                case (_x isKindOf "Tanks"):
                {
            //Code incl. other params for isKindOf and default
        };
            };


#

Like so maybe?

brave jungle
#

I'll give it a try, hopefully :3

brave jungle
#

Anyone free still? I need some help on this: https://pastebin.com/3mTjSmwe
Bascially, when a unit is killed, detect what kind of unit, add points to an array, display points.

meager heart
#

๐Ÿค”

#

maybe you can try >

private _rewards = []; //--- array with rewards
private _types = [];   //--- array with types
private _index = _types find (typeOf _unit);
CUR_Points_Available_Array = CUR_Points_Available_Array + (_rewards select _index);
```something like this ^
still forum
#

(isKindOf "Tank") != (typeOf == "Tank")

#

won't work. Unless you specify every type for every vehicle of type tank and so on

meager heart
#

yeah, list with classnames will be huge... ๐Ÿ˜ƒ

brave jungle
#

Hmm

#

Annoying :c

meager heart
#

also maybe you can just check parent classes

#

i mean > isKindOf "LandVehicle/Air"

hollow lake
#

Heya, I had an Idea to place for example a door down and to make it so only few ppl can access it, open/close it. Is there a way of doing that? Any help would be apprechated. Maybe where to start or so c:

still forum
#

opening/closing doors is just done via scripts

#

so yes. you can do that

#

If you made the door yourself you already know how adding the open/close action works. But I guess you didn't?

hollow lake
#

Did not mean like a normal door, ment like backalley fence or something. I am not into scripting. x)

cosmic kettle
#

@hollow lake Depends, what kind of door and who can use it. Once you know those things, you should be able to. If you made the door, add it to the config, if not; try script wise.

tender fossil
#

Can you create a camera view (in any way) so that the player watching the camera feed hears also the direct channel VOIP at the camera's position?

muted glen
#

simple way of doing that might be to just hide the player, disable him and tp him. switchCamera might work but idk if the camera also picks up audio. Could also use selectPlayer to temporarily move player to a camera object?

unreal siren
#

Wait

#

Are _vars automatically private now?

#

Or at least, private to the file and not the scope?

#

Wait, nevermind. I read that wrong.

#

File was using the new private _myvar thing

inner swallow
#

Eh? New?

unreal siren
#

As in, past two years new... lol

digital jacinth
#

private _varis just to tell that it is a whole new variable, youc an go into another scope with call and stil have access of the private vars outside teh call

#
private _var = 1;
[] call {
    hint str _var; // 1
    private _var = 2;
    hint str _var; // 2
};
#

at least how i understood it, tho i write my functions without call for reference to never run into some kind of reference issues

hollow lantern
still forum
#

Can't

half inlet
#

(among other things)

#

it never got any attention, and probably never will, but at least I tried

unreal siren
#

Is there a good way to find this error? Bad conversion: bool

#

About 30 lines of it.

#

Namespace error IIRC

#

21:17:48 Global namespace not passed during: true
21:17:48 Error in expression <true>
21:17:48   Error position: <true>
21:17:48   Error Local variable in global space
21:17:48 Global namespace not passed during: false
21:17:48 Error in expression <false>
21:17:48   Error position: <false>
21:17:48   Error Local variable in global space```
#

I have literally no idea how to find this. lol

waxen tide
#

undo the last thing you did, ideally.

still forum
#

That's probably a fuff up in the profileNamespace

#

you won't have much luck searching for it

#

without a engine debugger

unreal siren
#

Oh

#

It's addon related

#

meta.cpp/mod.cpp whatever

#

hidePicture and hideName don't take booleans

#

1/4th my mods use "true" or "false" when it should be 1 or 0

waxen tide
#

what are meta.cpp and mod.cpp actually good for? i mean in what context are they fully utilized?

still forum
#

mod.cpp ingame icon. Main menu/arsenal/editor

#

meta.cpp is just metadata for workshop items. So the game knows from where it comes

waxen tide
#

someone should write a wiki article on those files.

still forum
#

No...

waxen tide
#

someone should add important missing information to that article.

still forum
#

which?

waxen tide
#

when a client queries the server over steam, only the "name" from mod.cpp and "publishedid" from meta.cpp is transmitted. nothing else.

still forum
#

doesn't really fit into there. That's not mod.cpp's fault

waxen tide
#

publishedid is used by the launcher to recommend the mod if missing, name can be altered to whatever. if name is missing, folder name (of server) is used as modname.

#

shrugs

#

i was pondering about putting it on mods section of dedicated server setup page, but the google captcha on the wiki defeated me. thrice.

#

bots are now better at captchas than i am, apparently.

#

kinda weird people write so much rubbish into their mod cpps btw. some mods have publishedid = 0

#

and now they mess up and put bool in there?

unreal siren
#

It's also a problem in the mod.cpp as well

hexed swift
#

Asked in another channel, figured it would be more appropriate here. I'm looking to limit the range of the automated turrets such as the Praetorian and the Centurian. Is there a way to alter their range to something like 2km? Currently, the Centurian can lock on and fire from 16km away. Didnt want people getting missiled at their base.

unreal siren
#

Can CutRsc accept a filepath?

meager heart
#

afaik only classes defined in RscTitles config

#

if you want show some pictures on screen you can use ctrlCreate
that will be like 2 lines of code...

unreal siren
#

Yeah, I kept messing up while defining my RscTitles lol

static compass
#

Why am I even looking at here if I donโ€™t know a shit about scripting

digital jacinth
#

Is there a way to find out where the positionCameraToWorld is for every player? I need to check if some camera (mostly for zeus) is near a location.

#

basically i want to activate trigger (enable simulation) if a camera is near it, that already works. I just need a server side solution to let that trigger stay enabled globally for everyone if at least one camera is close.

fleet wind
#

Is there any way to have a player control both the driving and gunning of a tank at once? since WASD shift ect is not usually used for the gunner position.

digital jacinth
#

put an ai in the driver seat, since tanks dlc that is a thing already out of the box

fleet wind
#

So he will follow your exact orders ?

digital jacinth
#

yep

#

not even with a delay

fleet wind
#

Thanks! i clearly have played to little latley.

astral tendon
#
{player setDir 145.776} remoteExec ["bis_fnc_call", 0]; 

This works unreliable, i get it to work once on a script file but then it does not work on a client, that script is called by the server

copper raven
#
[[],{player setDir 145.776}] remoteExec ["call", 0]; 
astral tendon
#

That will fix it and make it work 100%? any back ground on why that was happen?

copper raven
#

Yes, it should work, your syntax was wrong from what i think.

quartz coyote
#

@still forum This doesn't work ...

if (playableUnits findIf {_x distance (getMarkerPos "FlagTraining") < 50} != -1) exitWith {};```
tough abyss
#

@digital jacinth put a trigger in editor and add positionCameraToWorld in the condition, on each client it will be local to client

digital jacinth
#

yeah thatis not what i want. I want the trigger to globally active for everyone even if one positioncameratoworld is near

#

it is about simulation enabling the triggers so the checks are only active if someone is near

tough abyss
#

You have to make it monitor global var and public var it, the statements are also local means every local instance of the trigger has to fire at once

still forum
#

@quartz coyote what does doesn't work mean?

quartz coyote
#

It seems to exit with even though I'm inside rang

#

Oh hold on

#

I'm an idiot

#

It should be a > instead <

still forum
#

noo... actually not...

#

I thought you wanted it to exit if there are units within 50m

#

if you swap that it will exit if any unit is not within 50m

quartz coyote
#

That's what I want. I want it to exit is no playable unit is within

still forum
#

yes.. That's what that does
find the first unit that's within 50m
if no unit is found. exit

late gyro
#

Hi everyone, Im trying to create a simple script that "switches" an action to either turn some portable lights on or off but its not working as intended. The action keeps stuck on the initial one instead of processing the else line, despite the variable having changed.
https://pastebin.com/VKc57Few

still forum
#

local variables don't carry over into different scripts

#

the code of your addAction is a different script

#

it cannot see your _lightsOn Variable

late gyro
#

So i should remove the underscore to make it a global one?

#

or should it be a public one?

inner swallow
#

global, remove the underscore

late gyro
#

and could you explain how the hint function in the addAction code does seem to pick up on the correct value?

inner swallow
#

public is for sharing between clients (or client-server)

late gyro
#

ah thanks for sorting that out for me SuicideKing ๐Ÿ˜ƒ

still forum
#

and could you explain how the hint function in the addAction code does seem to pick up on the correct value?

#

just look at your code?

inner swallow
#

it's in the same script file i.e. the variable is local to that script

still forum
#
                _lightsOn = "0";
                hint format ["_lightsOn off %1!", _lightsOn];

I don't understand why you even have to ask why _lightsOn is "0" at that point

#

you set the variable to "0" so of course it's value will be "0"

late gyro
#

ah i see

#

damn im thick xD

inner swallow
#

oh nvm you're talking about within the addAction

#

oh

#

yeah

late gyro
#

yeah I needed that slap in the face ๐Ÿ˜›

inner swallow
#

you have _lightsOn = "1"; within the addAction too

late gyro
#

exactly

#

working now, not quite as intended yet but ey

#

now to figure out how what to add in the addAction to make it end the while loop and refresh the action

#

hmm it doesnt remove after sleeping either :/

copper raven
#

Why don't you just use addAction condition field?

late gyro
#

Ive been trying for days to get this language figured out but its pretty complicated imho

#

you mean something like putting an addaction in the condition field of a trigger?

still forum
#

no

#

by putting a condition into the addAction

peak plover
late gyro
#

ah so i would end up with one single action "lights on/off" instead of two actions

peak plover
#

ie. if a car explodes when does entity killed run, before or after the explosion?

late gyro
#

id like to show the specific action ๐Ÿ˜ƒ

still forum
#

no you wouldn't

#

you'd have two actions. Which only display on condition

peak plover
#

@still forum what the name ๐Ÿ˜„

late gyro
#

Honestly I dont know how ๐Ÿ˜’

#

wait

#

(I mean have some patience with me please :P)

meager heart
#

maybe something in that direction >

private _id = command_monitor addAction ["text off", {
    params ["_target", "_caller", "_id", "_args"];
    if (missionNamespace getVariable ["var_ligts", true]) then {
        {_x setDamage 0.9} forEach [gate_light_l, gate_light_r];
        _target setUserActionText [_id, "text on"];
        missionNamespace setVariable ["var_ligts", false];
    } else {
        {_x setDamage 0} forEach [gate_light_l, gate_light_r];
        _target setUserActionText [_id, "text off"];
        missionNamespace setVariable ["var_ligts", true];
    };
}, [], -1, false, true, "", "local _target"];

๐Ÿ˜ƒ

peak plover
#

^

meager heart
#

condition maybe wrong there... with local

peak plover
#

Has anyone ejected units out a vehicle when it get destroyed?

#

I have an issue when a destroyed vehicle will make dead bodies dissappear

late gyro
#

thanks sldt1ck ill try to figure that out

#

would have never figured that out myself xD

#

thanks alot

still forum
#

setting the variable on _target would allow you to have multiple actions

peak plover
#

    addMissionEventHandler ['EntityKilled',{
        params [['_killed',objNull]];
        if (isNull _killed) exitWith {};
        if (_killed isKindOf 'Man') exitWith {};
        {
            [_x,(getPosASL _x)] remoteExec ['setPosASL',_x];
            false
        } count (crew _killed);
    }];
#

I want to eject units out of destroyed vehicles so the bodies don't dissapear

#

Anyone done this and know if this mite have issues?
My only concern is that it might not fire fast enough and still cause bodies to become invisible ( I think this is a feature in the vanilla game )

wet cobalt
#

Solved

polar folio
#

are simpleObjects similar to fixed map objects in terms of network and overall performance? i'm wondering since i spawn them dynamically but for some (bigger ones) it would make more sense to leave them instead of despawning them, when out of range. bad idea? ofc i'd make sure to only spawn stuff once in each area

inner swallow
#

are simpleObjects similar to fixed map objects in terms of network and overall performance?
maybe not exactly the same, but similar, yes, afaik

peak plover
#

overall performance

inner swallow
#

cool graphs. what's super simple?

hollow thistle
#

simple objects created from shape not config name.

#

You cant for eg. change their texture etc.

inner swallow
#

aha, thanks

quasi rover
#
//fn_rescueHostage.sqf:
.......skip...........
_pow setCaptive true;
_pow setVariable ["notrescued", true, true];
.......skip...........
[
    _pow, "Rescue Hostage",
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", 
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",  
    "(_target getVariable 'notrescued') AND {(_this distance _target) < 5 && alive _target} ",  
    "true",  
    {}, {},  
    {call MY_fnc_hostageJoin;},  // Code executed on completion
    {}, [_anim], 10, 6, true,  false 
] remoteExec ["BIS_fnc_holdActionAdd" ,0, _pow];    
 .......skip(taskcreate & trigger)...........
//fn_hostageJoin.sqf:
params ["_host","_caller","_id"];

[_host] joinsilent (group _caller);
_host setCaptive false;
_host setVariable ["notrescued", false, true];
_host domove (position _caller);
removeAllActions _host;
 .......skip...........
```I'm getting in trouble about hostage joining on Dedi-server.  The hostage joins the squad only when Squad leader run the <Rescue Hostage> action.  he does not join when squad member do the <Rescue Hostage> action(actually join the squad for 1 sec  and gone). And he also join the squad when I'm the only member of  the squad and do the action. Any clues?
inner swallow
#

well i assume for some reason the group leader (i'm assuming is AI) removes the hostage after it joins the group

#

when it's just you then you are the leader

quasi rover
#

It's MP Environment. and group leader is not AI.

meager heart
#

you can try it this way ```sqf
{call MY_fnc_hostageJoin;}, // Code executed on completion

```sqf
{
    params ["_target", "_caller", "_actionId"];
    [_target, _caller] remoteExec ["MY_fnc_hostageJoin", 2];
    _target removeAction _actionId;
},

and the function will be >```sqf
params ["_target", "_caller"];
[_target] joinsilent (group _caller);
_target setCaptive false;
_target setVariable ["notrescued", false, true];
_target domove (position _caller);

#

@quasi rover

quasi rover
#

thx, I'll give it a try, I need other player to test.

violet gull
#

When pressing Ctrl+O in the GUI editor (trying to import an existing UI I made to make changes) the screen just flashes a loading screen for a split second and nothing happens. Am I missing something?

#

Nevermind, got it to work; apparently have to hold down the Ctrl+I for like 10 seconds for it to work.

unreal siren
meager heart
#

that is engine solution for BIS_fnc_selectRandomWeighted not for BIS_fnc_selectRandom and there is comment with "tests" ๐Ÿ˜ƒ

unreal siren
#

I was being lazy and stuffing my arrays with duplicates, lol

meager heart
unreal siren
#

I wasn't very clear, my bad. I ,know about selectRandom, selectRandomWeighted is more what I need.

meager heart
#

(Example 2 from there ^, maybe ๐Ÿ˜ƒ)

#

(even if you planned to have duplicates lol)

unreal siren
#

Yeah, awsome to know!

unreal siren
#

Oh my God, this is disgusting ๐Ÿ˜‚

meager heart
#

๐Ÿค”

astral dawn
#

I've just had an idea... making an SQF interpreter and interfacing it with Intercept to spawn my script in a pure separate thread ๐Ÿค” did anyone ever have this idea?

still forum
#

Don't you think there is a reason why SQF is single threaded?

#

Not possible.

tough abyss
#

Pretty sure there are better and more exciting ways of crashing Arma

astral dawn
#

Why? Another sqf interpreter runs its code. When there is something like unit setPos it interfaces the engine through Intercept.

still forum
#

No. The interpreter is not the problem

#

what happens if the unit suddenly changes position while the graphics renderer tries to render it on your screen?

#

What happens if you suddenly stop a sound. While the sound engine is trying to play it?

astral dawn
#

Yes I get it. But I thought that intercept solves this problem, or not?

still forum
#

How?

#

Magic?

astral dawn
#

I didn't work with intercept but I assume there is a way to wait until the engine has halted for this frame if I execute something like setPos through intecept

still forum
#

Yes...

#

Wait for a onEachFrame handler and execute it in unscheduled while the rest of the engine is halted

astral dawn
#

IDK maybe @queen cargo will like this idea, I've seen he is working on an SQF VM. Maybe what I'm suggesting could work with some limitations, like not changing states of ingame objects. Still could be useful for creating worker threads for calculating numbers.

still forum
#

No it doesn't.

#

On Linux you can execute some few script commands in parallel.

#

But you can't on windows

queen cargo
#

Theoretically it should be possible.. Though... Not with arma itself

#

I could make sqf-vm with actual threads

#

But that is because I barely have anything to actually create Race conditions

#

Besides global variable access

astral dawn
#

No parallel things on Windows? I mean, CreateThread and launch an instance of a VM inside it for every spawned script. Global variables and functions are going to be a problem indeed.

still forum
#

๐Ÿคฆ

#

It's not like I didn't try.

#

The pool allocators for gameData types are not threadsafe

queen cargo
#

Was talking about my very own sqf-vm @still forum

still forum
#

It works on linux because the pool allocators don't exist there

#

I know what you are talking about. I'm still talking about Arma

queen cargo
#

๐Ÿ‘Œ

#

Though... When you are already using intercept... Then there barely is a reason to use sqf anyways ๐Ÿคทโ€โ™‚๏ธ

astral dawn
#

Then one would be able to avoid messing with C++ and compiling it. One would just write standard SQF code and let it consume as much CPU as it needs.

still forum
#

You could implement SQF VM inside intercept and remove all the script commands with side effects.

queen cargo
#

๐Ÿค”

#

that actually is a quite funny idea

#

and it would be already possible without much to do

tough abyss
#

If you have something that is heavy on calculation and you run it on a seperate thread then you could at least capture from intercept all you need then run your calculation on a separate thread and then rejoin to the primary one to apply to the game engine to apply your effects. But you can't be calling even gets in parallel.

still forum
#

we would need a async call that returns something like a std::future.. inside SQF
Which I already wanted to make for things like database interaction or TFAR

tough abyss
#

Yes that would be a reasonable abstraction as would be channels or async. But I think the end result would still end up pretty limited since a lot of decisions often need game data part way through the algorithm. The only use case I can really think of is something with substantial AI calculation, where you could arguably export world information (terrain and objects) and then just pass enemy location information and get macro orders back.

#

The amount of cases which have large calculation and small data input isn't all that big from a game perspective.

astral dawn
#

I thought, getting game world data is even less a problem than setting it

still forum
#

It is

#

but it's still not possible

queen cargo
#

mhh ๐Ÿค”

#

need to do 3 things for sqf-vm intercept plugin:

  • commands
  • datatypes
  • time
still forum
#

you cannot execute any SQF commands that take arguments or return values in parallel

#

don't you already have your own commands and datatypes?

queen cargo
#

and when that is done: you actually do can run sqf in parallel
though ... it is a different vm entirely
but ... well ..

#

for the intercept plugin i mean

#

new commands would be pretty much:

  • createVM
  • destroyVM <VM>
  • <VM> execute <STRING>
    with the new datatype being VM containing the whole sqf-vm vm
#

sqfception

still forum
#

and you need a way to get data back out

#

because waiting for the VM to execute in a different thread wouldn't be that helpful

dusk sage
#

SchedulerV2

queen cargo
#

ye ... forgot that one @still forum ๐Ÿ˜„

astral dawn
#

If Intercept can call SQF functions then the VM can return data back

queen cargo
#

yield <VM>
done <VM>

#

there you go

dusk sage
#

If the intention is to block whenever ever you want to run SQF commands specifically, what's the point? You're still relying mostly on a single thread

still forum
#

And compiling and executing the code in a second thread and piping the results back will probably take more time and effort than just executing that script right there in the main thread when you need it

dusk sage
#

Sounds more logical if you want to do something not relying on the engine, like database interaction, like Dedmen said. But if your plan is to block continuously?

still forum
#

no the SQF vm would execute asynchronously

#

But it'll just have commands that don't interact with the world

#

so.. math stuff. Basically

astral dawn
#

Yeah the calling script would have to wait. Then spawn a script in the external VM to, for instance, plan a route or calculate something. When calculation is done the VM would send the data back through intercept then into some queue in the game's SQF VM. The difference is that the external VM will not be bound to 3ms run time per frame, nor it will share resources with the ingame VM.

#

Indeed the only application I see for it is, probably, AI mods which would always be hungry for more CPU

still forum
#

Give me a example of some math calculation which doesn't require ANY data from the game world that runs for over 3ms

#

AI would probably need information from the world wouldn't it?

astral dawn
#

No ofc we need data from the game world. If as you say we can't execute any SQF commands in parallel, including ones that only take game world data, we in a trouble. We would have to serialize requests by external VM through Intercept, which would have to sync to the game engine. ๐Ÿค” We would have to cache retrieved data to yield more performance ๐Ÿค”

dusk sage
#

I think you need to ask the question whether it's actually needed. Unless you have some massive algorithm planned, chances are it's going to run quicker synchronously unless you've already pooled threads

astral dawn
#

No I don't have anything in mind yet. It's just a quick idea I've had: if X39 VM is ready enough, could it be interfaced to game through an Intercept layer, to let others spawn scripts to achieve more performance for their algorithm. From what I see it's still quite hard.

queen cargo
#

pff ... at least the idea of using sqf-vm with intercept would be no problem
only thing: there is no interaction unless it is explicitly done

#

and the sqf-vm project is already ready for that kind of tasks

#

hell ... you all can try it whenever you want ๐Ÿคท
the current release version may not be on-pair with what is currently available

dusk sage
#
to achieve more performance

Whilst adding another layer of abstraction on top of another

queen cargo
#

but there is a discord bot and i lovely share binaries at any time

#

well ... theoretically, it would allow to utilize more cores ... but i also doubt that there is much use ๐Ÿคท
maybe some caching stuff ... could get useful ... but ... ye ...
in the end it probably will still be smarter to just write the intercept plugin to do that task for you

dusk sage
#

Get a threadripper to use the 64 threads

#

64 while true

astral dawn
#

Yeah making an intercept plugin is better. But I would have to compile the C code for linux as well. Then test it there. I'm sure not everyone can do that. Also it looks like not many addons use intercept currently. Is there a list of addons based on Intercept?

still forum
#

script profiler, script debugger,
That's about all of the public ones ๐Ÿ˜„

peak plover
#

is ther a way to disable input for some keys?

sleek token
#

I would love to see a tutorial video about Intercept. The Dokumentation is kinda hard ro read and understand

still forum
#

I don't think I've ever seen a tutorial video about a c++ library ๐Ÿค”

queen cargo
unreal siren
#

How would I go about accessing my mission parameters ingame?

#

At the very least, returning them.

#

IE GRLIB_csat_aggressivity or whatever

meager heart
unreal siren
#

sweet!

#

Any way to change the par ingame? I'm leading towards no.

meager heart
#

par ?

unreal siren
#

The parameters, or variable behind it

meager heart
#

they are stored in global variable BIS_fnc_storeParamsValues_data... probably you can, but that will be more hax than scripts ๐Ÿ˜ƒ

unreal siren
#

ah

tough abyss
#

is there a way to see if the user is interacting with a display with exception of display 46

austere granite
#

depends on what you mean by 'interacting with'

tough abyss
#

Basically when you can see the mouse

#

And you arenโ€™t moving your character around by moving it

unreal siren
#

So selectRandomWeighted, if an item is set to 0.8, it's 20% less likely to be selected than normal? What about 1.5?

#

What are the best conventions for this? going over 1x or under?

normal monolith
#

@tough abyss you want to know if a user opened a dialog ?

tough abyss
#

ye

normal monolith
#

well, you can create a loop that check if a dialog is opened, use dialog

umbral oyster
#

why he moved to dir 0???

tough abyss
umbral oyster
#

I tying

#

trying*

#

nothing

tough abyss
#

Together with setDir

umbral oyster
#

and this too))

gleaming cedar
#

Is there an animation for putting an helmet on ?

sleek token
#

can arma interpret forward slashes in pathes?

#

or does it need to be a \

still forum
#

I don't think I've ever seen someone use /. so I'd guess no

sleek token
#

ok

#

having some trouble with vscode while using linux with sqflint..

still forum
#

sqflint&vscode != arma

sleek token
#

i know

still forum
#

might very well be that it handles it differently

sleek token
#

just checking if it could work

austere granite
#

it depends on the sort of path i believe

#

in some cases it does support it

#

it others it doesn't

#

same thing with leading slashes

#

best is using \ which is always safe

sleek token
#

so conclusin better dont use it and keep \

austere granite
#

yep

sleek token
#

thx

unborn ether
#

One question around Init EVH: when does it trigger? Does SQM placed vehicles trigger that? etc. Thanks.

umbral oyster
#

anyone know how to overwrite initWorld and demoWorld in CfgWorlds?

unreal siren
#

Is there a way to call the arsenal in a way that pulls from the box it's called on?

#

(And reduces the count of the objects in the box as used)

waxen tide
#

if you use the ace arsenal, the first part is trivially easy. generate an array of stuff in the box and hand it to the ace arsenal as whitelist. Reducing the amount of stuff in the box and limiting the player(s) to that i recon would require a lot of custom scripting. You can look at Hearts&Minds/Antistasi mission, i think both? (at least one of them) has an arsenal that is limited in amount, players basically fill it with enemy looted gear to extend the stuff they have. But it is a bit buggy (if a player takes out an object, it will disappear entirely all other players have to re-open arsenal for it to re-calculate the available amount)

unreal siren
#

Totally understand

#

For somebody who understands how UIs are updated and whatnot, forcing an update would be trivial I think, but probably not worth my time right now to figure out... lol

#

And that case is exactly what I was trying to avoid

cerulean crane
#

I need a little help if someone has a moment. I have coding experience, but 0 experience with Arma Scripting. I decided recently to play around with it a little.

Here's what im trying to do. I am trying to make a round trigger area that when its activated by a player, spawns a stalker anomaly from a mod, somewhere within it. Ive managed to figure out how to spawn the anomaly directly where the trigger is, but Im struggling to figure out what to add next to make the location semi random.

#

This is what i have so far.

#

the parameters of the createFog are [Pos, Size, booleanIsSquare]

cerulean crane
#

@waxen tide Thank you I will.

I think i actually found something to un elegantly smash into place while I learn by imitation and documentation.

Do you think you could look at something for me and just let me know if this is not the right way to call a variable?

_nul = [thistrigger, 10, true] call anomaly_fnc_createFog;

Works perfectly to spawn my Fog cloud right in the middle of the trigger.

_loopCount = 0;
while {_random_pos_in_trigger isEqualTo [] && _loopCount < 100} do {
    _random_pos_in_trigger = trigger_spawn call BIS_fnc_randomPosTrigger;
    _random_pos_in_trigger = _random_pos_in_trigger findEmptyPosition [0, 0, "vehicleType"];
    _loopCount = _loopCount +1; //Prevents infinite executions with severe hit on performance if no position can be found
};
_nul = [_random_pos_in_trigger, 10, true] call anomaly_fnc_createFog;```

Doesn't seem to spawn anything. Am I calling ``_random_pos_in_trigger`` wrong?
waxen tide
#

Did you enable script errors?

cerulean crane
#

I dont think so.

#

I didnt know it had to be enabled

waxen tide
#

-showScriptErrors Enables on-screen script error reporting (ARMA 2 v1.03.58627)

#

Very handy for basic script debugging.

#

You should also check C:\Users\Zombie\AppData\Local\Arma 3 for an .rpt logfile, it will also contain script errors

#

To debug the code you posted, my first step would be to see what's inside the variables step by step, and verify they contain what you think they contain. So i would do like:

_random_pos_in_trigger = [];
_loopCount = 0;
while {_random_pos_in_trigger isEqualTo [] && _loopCount < 100} do {
    _random_pos_in_trigger = trigger_spawn call BIS_fnc_randomPosTrigger;
    diag_log format ["%1", _random_pos_in_trigger];
    _random_pos_in_trigger = _random_pos_in_trigger findEmptyPosition [0, 0, "vehicleType"];
    _loopCount = _loopCount +1; //Prevents infinite executions with severe hit on performance if no position can be found
};
_nul = [_random_pos_in_trigger, 10, true] call anomaly_fnc_createFog;
#

diag_log writes to rpt logfile, systemchat shows up ingame in chat.

cerulean crane
#

oooooooh

#

i was wondering how people debugged in arma

waxen tide
#

if you get no output at all, then your while condition actually never equals true, and thus your while loop is never even executed once. If you get one output, then your while condition is true at first, but then turned to false during the first loop.

#

Ehh thats nothing. X39 has written some external sqf interpreter, Awooooo wrote some intercept stuff for fancy debugging, and i probably missed a lot more cool stuff.

cerulean crane
#

The arma scripting isnt exactly very user friendly from what ive seen.

#

Wish it was like lua or something that ive worked with before.

#

Maybe Arma 4.

waxen tide
#

It's okay, you'll develop a love-hate relationship with it over time.

#

oh btw that "format" command is really nice, it even works for undefined vars. will simply throw out "any" without any script error.

#

and with format you do not need to care what type it is. literally eats any data type afaik

cerulean crane
#

diag_log {_random_pos_in_trigger}

22:17:02 {_random_pos_in_trigger}

#

lol

#

clearly im very good at this (sarcasm)

#

not sure why that came out as a string.

waxen tide
#

Err {} ? In sqf that's usually code brackets. Never even tried it like that. Try

diag_log format ["Debug info: %1", _random_pos_in_trigger];
cerulean crane
#

my man.

waxen tide
#

oh also if you add like ``````sqf``` before your code you get fancy syntax highlighing in discord. Like the cool kids ๐Ÿ˜Ž

cerulean crane
#

neat.

#

ROFL

#

22:21:18 "Debug info: array"

waxen tide
#

๐Ÿค”

cerulean crane
#

bangs head on desk

waxen tide
#

I think you have an empty array.

cerulean crane
#

oh.

#

OH

waxen tide
#

Heh i'm just the nightshift guy, okay?

cerulean crane
#

i appreciate you my dude.

#

ive learned so much in a short period of time

waxen tide
#

What's trigger_spawn? Trigger name?

cerulean crane
#

i was just looking at that

#

im running a test right now replacing it with thistrigger

waxen tide
#

oh you working in that init field of that trigger, yes?

cerulean crane
#

OH THAT DID SOMETHING

#
};

_pos set [2,(_pos#2) - 2];
_trg = createTrigger ["EmptyDetector", _pos];
_>
22:25:45   Error position: <createTrigger ["EmptyDetector", _pos];
_>
22:25:45   Error Type Any, expected Number
22:25:45 File diwako_anomalies\functions\anomalies\fn_createFog.sqf [anomaly_fnc_createFog], line 41
22:25:45 "Debug info: [<null>,<null>,-2]"```