#arma3_scripting

1 messages Β· Page 54 of 1

crystal lagoon
#

I just don't want to mess with it a whole lot if it works as is. That sounds like a good way to invite disaster.

midnight niche
cold rampart
#

thx, feel so dumb right now XD

pliant stream
#
_a1 = _a0;
_a2 = +_a0;

diag_log format ["%1 %2 %3", _a0, _a1, _a2]; // [0] [0] [0]
_a0 set [0, 1];
diag_log format ["%1 %2 %3", _a0, _a1, _a2]; // [1] [1] [0]```
#

arrays are pretty cool

still forum
#

Its a bit hard to understand from the text.
I'm just thinking hashmaps could surely help πŸ˜„
Combined with Leopard's OOP idea.

You could have
_classInfo = getClassInfo _thingy
_classInfo get "InterfaceX"

returns empty if interface is not implemented, returns hashmap if it is, with all the functions on it
smth like that.
Diamond wouldn't work then.. ish.. Could detect that at creation time and just block it? same with circular? should be somewhat easy to detect

I don't see how you want to implement a OOP approach without OOP, so combining with leopards idea is how I can visualize it.
Maybe throw in some pseudo code script ideas on how you want to do that

bold comet
#

references can kick you in the ass if you're not careful tho

#

need to pay great attention wether to use references or copies

cold rampart
#

yeah

#

I noticed :)

queen cargo
#

There is no reason to do it the "safe" way as there are no real race conditions or other shit that would cause trouble and could lead to invalid executions ... the only

#

You just cause the scriptengine to overflow

pliant stream
#

but i have no control over where the scheduler might pause execution do i? so what exactly is stopping race conditions from happening?

tender fossil
tender fossil
indigo snow
#

The way the scheduler in arma works you now run the danger of locking a variable forever :D

tough abyss
#

what would be the easiest way to detect when an arsenal is closed? i assume a scripted event handler?

warm hedge
tough abyss
#

thanks

wary sandal
#

@little raptor

#

what does revision mean?

#

is it added yet?

little raptor
#

yeah I saw that

little raptor
wary sandal
#

what patch/revision/version are we at exactly?

little raptor
#

150328

#

it doesn't matter anyway

#

it will be added to stable v2.14

#

in like 5-6 months

#

also accessible in next dev branch (next week or maybe this week)

quiet gazelle
#

i'm using vscode to edit sqf, can i somehow get it to autocomplete variable names?

tender fossil
quiet gazelle
#

which one do you use?

quiet gazelle
#

ah great, the second one does it

#

however it also marks all the cba macros as errors

tender fossil
#

Might be with mods yeah, I don't mind it personally though

slow isle
#

@tender fossil what other extensions do you use for arma 3 sqf in vscode

#

especially for formatting

tender fossil
slow isle
#

I used these two but both are bad imo

tender fossil
#

Might be just out-of-date

slow isle
#

or you do it manually

tender fossil
slow isle
tender fossil
slow isle
#

Thanks!

midnight niche
quiet gazelle
#

does anyone know of a way to either make sqflint accept CBA macros as valid or disable error highlighting completely?
these little squiggles annoy me very much.

#

i don't want to get rid of sqflint entirely since it allows me to autocomplete variable names

slow isle
tender fossil
#

What grinds my gears the most is that the current plugins don't support nagging about forgotten quotes from parameters of commands that require string as input (such as isNil). For some reason I make that mistake super often πŸ˜„

quiet gazelle
#

just made that mistake navigating configs

tender fossil
#

I don't know if anyone else has the same issue but I write sqf if (isNil _variable) then { // ... so often instead of this ```sqf
if (isNil "_variable") then {

quiet gazelle
#

however how would it distinguish that from something like this?```sqf
_variable = "otherVarName";
if (isNil _variable) then {

#

i suppose it would have to check if without quotes it's a variable referencing a string

tender fossil
quiet gazelle
#

it doesn't

#

just tested it

tender fossil
#

Oh, I see. Didn't expect that

#

Are you sure?

quiet gazelle
still forum
#

isNil takes a string, and you're passing a string. As far as isNil is concerned that's alright

winter rose
#

that's PHP's "variable variable" πŸ˜„

$var1 = "hello";
$var2 = "var1";
print($$var2); // prints "hello" :D
tender fossil
#

Stahp

little raptor
#

you can only put nil values in arrays: [nil, _someNonExistingVar] (you would get an error for referencing that var tho, but your array will remain functional)

tender fossil
little raptor
#

the other thing to know is that SQF executes everything unless it's wrapped in {} (which is a code, and must be executed by another command)

winter rose
#
private _sayHi = { hint "Hello!"; };
if (alive player) then _sayHi;
south knoll
solid ocean
#

howdy so im having trouble with a remove weapon script im running, it wont work in eden but i can get it to work in zeus.

i need it to work in Eden so i can save it as a composition.

anyways the script is below:

#

_this removeWeaponTurret [""Gatling_WAP_01_F", [0]]; _this addWeaponTurret ["TIOW_Tau_BurstCannon", [0]]; _this addMagazineTurret["TIOW_Tau_BurstCannon_mag",[0]]; _this addMagazineTurret["TIOW_Tau_BurstCannon_mag",[0]]; this removeWeaponTurret ["Raptor_R", [0]]; this addWeaponTurret ["TIOW_SM_PlasCan_01", [0]]; this addMagazineTurret["TIOW_SM_PlasmaCannon_Mag",[0]];

stable dune
#

Using _this and this

hallow mortar
#

Also, you've put it in the init of the group, not the object. It needs to go in the object init.

slow isle
#

How can I check if something is not a vehicle? if(is not vehicle) then {}

#

(or if something is a soldier unit)

#

just iskindof "Man"?

hallow mortar
#

isKindOf "CAManBase"

slow isle
ivory locust
#

Hey I'm having trouble getting my intercept plugin to work in-game, can anybody help me? I have it all set up in VS and compiled and the plugin, and the Intercept mod are both enabled, but it's not doing anything in-game.

#

Are there any other setup steps that aren't on the github, like do I have to callExtension?

slow isle
ivory locust
#

It's where the arma.exe file is

quiet gazelle
ivory locust
#

I am just using the default templates right now, I followed the tutorial on github

still forum
#

did you make your mod with config.cpp and the plugins entry?

#

if you create a "logs" directory in your arma folder, intercept will write logs into it

quiet gazelle
#

before i had this entire pack installed i was able to compile it but it didn't work in game

ivory locust
ivory locust
#

Yes I have it installed

still forum
ivory locust
#

Let me rebuild it, give me 15 seconds

still forum
#

Config says "Ruskov Plugin" dll filename says "Ruskov_Plugin"
they don't match

ivory locust
#

No way

#

Let me try changing it

#

I'm assuming I have to re-pack the addon every time I rebuild the dll right

still forum
#

no

ivory locust
#

Here is the intercept mod and my addon installed, I also have CBA_A3 installed through the workshop

still forum
#

the pbo only contains the name to tell intercept what plugin to load

ivory locust
#

Ok, that makes sense

#

I'll add that it wasn't working when I was using the default plugin template but I'll try it again with the underscore added

#

I'm using the default tutorial template that makes an Opfor unit follow you around, are there any other steps I have to take to get it working

#
  1. Create player unit (blufor) in VR editor
  2. Start singleplayer
  3. Plugin works?
#

It still isn't doing anything, do I have to enter any scripts

still forum
#

if config is correct and dll is there, it will be loaded at game start before main menu

ivory locust
#

Is there any way I can test each component separately, like can I check that intercept is installed with some callExtension command

#

Is this correct

#

Addons folder is also in @Ruskov_Plugin with the pbo inside it

#

There's no errors, it's just not doing anything, nothing is printed to sidechat or systemchat, no unit is spawned

solid ocean
ivory locust
#

These are the last lines in the log after I launch the VR scene from the editor, no mention of my Ruskov_Plugin by name

hybrid sundial
#

I've been throwing my head around with a script that I have in mind, simple stuff really and I've searched basically the whole afternoon to no avail.. anyone has time to lend a hand? What I want to implement is a script that before respawn waits for the whole group to be killed

#

Maybe an if statement that checks if the alive members of the group are more than 0 in onPlayerKilled.sqf?

#

Or a while statement might be the case?

ivory locust
#

Yeah I would spawn a script that checks the number of living squad members then sleeps for 5 seconds or something

hybrid sundial
#

Cool I'll give it a shot

ivory locust
#

With this in my dll the game will now register these two commands, but they have no return value when I call them directly

#

Wouldn't compile unless I changed the first lambda argument to a uintptr_t instead of game_state

still forum
#

should be game_state*

#

not just game_state

#

or game_state&

ivory locust
#

It wasn't liking game_state& either

#

Do I have the wrong version of intercept included or something

still forum
#

What did the compiler say
Its
using binary_function = game_value (*)(game_state& state, game_value_parameter, game_value_parameter);

little raptor
still forum
#

uh what

#

wtf

#

did you download intercept master branch

ivory locust
#

I must have the secret hpp

still forum
#

or did you download one of the 4 year old github pre-releases

ivory locust
#

Yes I have the 4 year old headers

still forum
#

download master branch directly instead πŸ˜„

ivory locust
#

Ok I will add that the 4 year old ones are the ones packaged with the template plugin

still forum
#

welllllllll...

#

:harold:

ivory locust
#

So based

hybrid sundial
#

The while function does nothing unfortunately :/

ivory locust
#

They tend to do that

still forum
#

No idea how to control respawn

#

waiting for all members of group are dead
_allDead = (units _group findIf {alive _x}) == -1
but how you use that as condition to block respawn blobdoggoshruggoogly

#

I think new name is "dynamic link library"

#

C++, windows, library as filters on top

granite sky
#

I'm not sure you can block respawn except by blocking death :P

still forum
#

The Arma wiki extensions page has a guide

lethal dew
#

why does my spawned in helicopter wiggle vertically when approaching the landing zone and after taking off, basically always, looks plain stupid, as if the pilot is totally loaded.

ivory locust
#

Do I put intercept_client.lib and intercept_x64.dll in my VS lib folder

#

It is still not doing anything despite building properly and showing no errors

still forum
#

neither

#

you put your plugin's dll, into your mods intercept folder, like you had before

#

you don't build intercept itself

ivory locust
#

I just built the library from source using VS to make sure the versions match

still forum
#

you just use the intercept dll from the workshop intercept minimal dev

#

that one is a o k

#

you just need to update the intercept folder in your plugin template folder, and then rebuild your plugin

ivory locust
#

Update the intercept folder in my plugin template folder?

still forum
#

ye

ivory locust
#

So just rebuild my plugin and put the dll in the intercept folder

still forum
#

I mean from here
That intercept folder has to point to latest master branch, instead of that 3/4 year old commit there

still forum
#

if you can compile with using game_state&, it'll be correct

ivory locust
#

Yeah I have the most recent sources downloaded into the intercept folder in the template

still forum
#

jup then just rebuild your plugin and it should work then

ivory locust
#

This error shows up when I put in the call to register_sqf_command which is why I thought it was a library error

still forum
#

πŸ€”

#

Maybe re-run the cmake project build

#

On top I think Project -> generate cmake files

#

if that update added new source files, it will not have auto detected them

ivory locust
#

Ok I cleaned and rebuilt and it's building now

#

Time to test

#

Still not doing anything

#

I swear I'm missing like one tiny step but I can't find what it is

#

testCommand and otherCommand will autocomplete in the debug console but they don't return/do anything

#

Only sign of life I have at the moment

sacred dove
#

I'm trying to run a simple script and I'm not understanding why it is complaining about "Undefined variable in expression: Createunit" and "Error Missing ;" https://sqfbin.com/ogiqacodeqajiqofelim πŸ€” I've even tried hardcoding the Pos and Dir values in the createUnit line with no luck.

ivory locust
#

@still forum Do I have to do anything but this to test the plugin

still forum
#

try with custom commands

#

I don't remember if on_frame will really work

ivory locust
#

They autocomplete in the debug console but don't return anything

still forum
#

attach a debugger, set breakpoint and see if they're called

#

if they autocomplete the plugin is definitely loaded and "working"

peak pond
#

@sacred dove A group is needed:

_soldier = _group createUnit ["O_Soldier_F", _soldierPos, [], _soldierDir, "NONE"];

ivory locust
#

So I don't need to callExtension or anything like that before it starts working

still forum
#

no

#

if the commands are showing up, it is loaded and working

ivory locust
#

This never shows up

still forum
#

systemchat prints to chatbox, in singleplaye you have no chatbox

#

diag_log to RPT would be better

ivory locust
#

I can systemChat through the debug console but I'll try that

still forum
#

and again, attach a debugger and set a breakpoint

#

to see if code is executed

sacred dove
ivory locust
#

Does this need to be in my plugin

still forum
ivory locust
#

It's loading intercept and my addon but it's just not doing anything

still forum
#

As I said, if the command is registered, your plugin is loaded

#

attach a debugger, and check if your code is called

ivory locust
#

Attach a debugger to arma?

still forum
#

yes

#

attach during splash screen, intercept loads once arma goes into black/fullscreen

ivory locust
#

I can see now that intercept is being loaded in the RPT after turning on logging

#

Is the syntax for my custom commands correct

ivory locust
still forum
#

If the commands show up in debug console, it means they are correctly registering

#

and you said they show up

ivory locust
#

They don't return anything when I call them though

still forum
#

is now atleast the third time I say that

ivory locust
#

Like I can't do hint testCommand;

still forum
#

attach breakpoint and see in debugger what happens

ivory locust
#

Ok I was wrong it's not actually registering the commands, it was autocompleting them because I typed them into the console before

#

ChatGPT is saying I have to use the intercept command to load my DLL

hallow mortar
#

Don't assume that ChatGPT has any idea what it's talking about

ivory locust
#

I am out of ideas for where to look for answers here

winter rose
#

I would start reading what Dedmen said

ivory locust
#

I realized I wasn't packing my pbo correctly

still forum
#

and doing what I said

#

if you had attached debugger, you would've seen that the code is never called and dll is not loaded.
That may have pointed you to check the pbo

kindred zephyr
#

its scary to see how much people want to rely on a chatbot neural network for coding lately D:

ivory locust
#

It is really only useful for tedious stuff like "Write me a function in c++ that checks if a string is a palindrome" but it's pretty useless for everything else

#

I repacked my PBO and it's still not working

still forum
#

send me your pbo

#

just drag&drop in dm

ivory locust
#

Done, non-binarized

sullen sigil
#

is there any way to reverse base game controls

#

...without having to intercept them

still forum
#

delete your pboprefix file, your prefix is "main" which may conflict with other mods

#

check in ingame config viewer, that your config is actually present

ivory locust
#

This is all that's in my addons folder

#

Where is the pboprefix file?

still forum
#

nvm there is none

ivory locust
#

I see in the PBO that the prefix is main, but I don't know what that means

still forum
#

something is setting the prefix to that, that may conflict

#

but you can also just check if config is there in ingame config browser

sullen sigil
#

addon builder has a prefix field in options iirc

ivory locust
#

I will check the config

#

The Ruskov class is showing up under my CfgPatches config

#

I will try changing the prefix in the pbo tool

still forum
#

The intercept one is important

#

if its in cfgpatches then the prefix is fine

ivory locust
#

Intercept_core is also showing up in cfgPatches

still forum
#

"intercept" callExtension ("load_extension:Ruskov_Plugin"); can try running this in debug console

ivory locust
#

This seems important

still forum
#

Well yes, very much

ivory locust
#

Do I just change that to 2

#

Lmfaoo wait

#

I set that to 1 when I was setting everything up

ivory locust
#

Yeah ok let me rebuild and try this time

#

Dude that's so silly

#

It's working perfectly now, sorry for all the spam guys

#

@still forum Thank you for all your help

lethal dew
#
// ... logic to spawn and land ...
commandGetOut (units _heliPilot);

Sleep 5;

// This has no effect as intended, countdown seems to start only after crew re-entering and heli already taken off!
[(group _heliPilot), (getPos _chosenHelipad), 100] call BIS_fnc_taskPatrol;
while { _countdownCrewGetInCounter > 0 } do { // Countdownvalue is passed as 60, which shall mean the crew is ordered to wait 1 minute before re-entering.
    Sleep 1;
    _countdownCrewGetInCounter = _countdownCrewGetInCounter - 1;
};

(units _heliPilot) orderGetIn true; // Instead this seems to be executed instantly, and then the heli waits the 1 minute while in the air before leaving area.

if (!isEngineOn _chosenHeli) then {
    _chosenHeli engineOn true;
};
// ... further logic for take off and leave ...

Can someone explain that to me? I'm about to give up on this. I already tried the opposite with waitUntil (timeout). Same unwanted effect.

granite sky
#

commandGetOut probably doesn't unassign the units from the vehicle, so they'll just get back in.

lethal dew
# ivory locust

But you seem to have found source of the error by yourself after looking around and trying over and over again, that's pretty much the point of learning stuff like this. So, well done I guess.

lethal dew
granite sky
#

Not necessarily. If the vehicle is also assigned to the group then it might decide to reassign the units to the vehicle anyway.

lethal dew
#

man... I don't get it.

#

Sorry.

granite sky
#

No-one does :P

#

Basically there's this mass of undocumented AI spaghetti that is continually fighting against anything you want to do.

#

but key points here are that units can be assigned to particular positions in a vehicle, and vehicles can additionally be assigned to groups.

lethal dew
#

πŸ˜„

#

i wanted to avoid all this

granite sky
#

The only control you have over the latter is addVehicle and leaveVehicle. I thought there was supposed to be a command added in 2.12 to list the assigned vehicles in a group but I can't find it.

lethal dew
#
    _spawnedHeli = [_spawnPosition, 0, (selectRandom _helicopters), west] call BIS_fnc_spawnVehicle;
    _chosenHeli = (_spawnedHeli select 0);

By doing it like this.

granite sky
#

That's just hiding even more stuff from you.

lethal dew
#

Which does all that crew filling and assigning stuff for me. At least I thought so.

granite sky
#

You need to read BIS_fnc_spawnVehicle to see what it's doing.

lethal dew
#

Yes, maybe...

granite sky
#

Well, it probably does. But to keep units out of a vehicle you may need to undo some of that.

#

allowGetIn also might work as a temporary thing.

lethal dew
#

I think earlier today when I just did Sleep 120 or something it actually worked.

#

But I don't remember the (exact) preconditions, so... nvm.

granite sky
#

shrugs

#

Try allowGetIn false. If you're lucky it'll work.

#

What sometimes happens is that units will stay out of the vehicle if given a short-distance move order but get in the vehicle if given a longer-distance order. So given that BIS_fnc_taskPatrol is giving random move orders, you may get unpredictable behaviour.

lethal dew
#

Sounds reasonable!

#

And you are right πŸ™‚ it's as simple as that.

ivory locust
#

Is there a way to rebuild and reload plugins without having to relaunch the game? I can't overwrite a plugin dll while the game is running

queen cargo
#

@pliant stream feel free to show me your "race condition"
because you simply do not have race conditions (again: in SQF) if you use proper SQF and coding

still forum
#

visual studio has a feature called Edit and continue, can do quite alot of edits while the game is running live

#

intercept can unload plugins, but not if you use pre_start or register custom commands

#

also not when you use the config way of registering/loading the plugin

tender fossil
ivory locust
#

I only have stuff in post_init

#

Do I really have to relaunch the entire game every time I want to change the plugin

#

I can't edit the .dll even after unloading with intercept through the debug console

still forum
#

I just told you, visual studio has a "edit and continue" feature that lets you live edit while its running.
I really don't like repeating myself

#

This is a way to load from script, but you cannot unload if you have the Intercept class in config and the plugin is loaded via that
"intercept" callExtension ("load_extension:" + _plugin_name);
"intercept" callExtension ("unload_extension:" + _plugin_name);

#

mh actually seems like you can unload

#

but if you register commands it would crash

tender fossil
#

Speaking of Intercept, any ETA on Arma Debug Engine fix? πŸ˜„

still forum
#

so far seems i have time on weekend

ivory locust
#

Could you give a few steps on how to live edit the .dll

#

I have the dll open and I have a debugger attached to Arma

#

Will any changes I make automatically get inserted into the dll as I make them?

little raptor
#

no

#

first make the changes and save the files

#

then under debug menu select "Apply Code Changes"
if that doesn't work pause the debugger then just continue

#

you need to enable incremental build (iirc) for that to work

#

and /ZI (iirc)

ivory locust
#

Experimenting with it currently, thanks

#

It just keeps saying this

#

Did a clean build with /ZI, everything went fine

#

Happens whether I pause the debugger or not

#

Edit and Continue : error : 'main.cpp' in 'Ruskov_Plugin_x64.dll' was not linked with Edit and Continue enabled. Ensure that /INCREMENTAL linking is enabled, and the /EDITANDCONTINUE directive is not ignored.

#

This must mean something

granite sky
#

Looks like you have the /ZI but not /INCREMENTAL linker flag?

ivory locust
#

Project : error (null) : Edit and Continue could not create a safe command line to compile changes. UNC, relative and remote drive paths are disallowed.

#

No way

#

My game install has to be on the same drive as VS?

granite sky
#

"remote" normally means "on another machine" rather than "on a different drive"...

ivory locust
#

Can't imagine what else it could mean, my Arma install IS on another drive

#

I'll try installing the JIT debugger

ivory locust
#

Got it working, just had to move my VS install to the drive where Arma was installed

#

Thanks again all

sullen sigil
hallow mortar
#

By reverse you mean e.g. S to move forwards, W to go backwards?

#

If yes, to do that properly requires blocking the original input (sort of possible but not really) and sending a new input (not possible). You could do it improperly by using a UserAction EH to detect the input and apply a reversed setVelocity, but that wouldn't be pretty. There isn't even an improper solution for mouse input.

final oracle
#

CBA extended init event handler maybe? @hasty violet

#

np

gleaming rivet
#

@hasty violet there is a how-to in the tutorial for DAC. Take a look at it.
You may also be able to disable VCOM mission wide, but I'm not sure.

#

I remember something being in the documentation. Could be getting confused with something.

final oracle
#

will send cake

past wagon
#

is there a way to change the magazine reload speed of a weapon?

tough abyss
#

I've managed to get the action to occur, however i've been unable to get it to be removed upon doing so. it told me initially that i was missing a ; so i added a 2nd, and now its telling me i need a third. i dont quite understand whats going wrong here

tender fossil
tender fossil
tough abyss
#

does it need a variable name?

tender fossil
tough abyss
#

MapData is the variable name of the unit the action is on

tender fossil
#

You can then just remove the brackets and this, so ```sqf
MapData removeAction 0;

tough abyss
#

even though its been called by the action?

#

@hasty violet , nice find with the VCOM line. We've recently switched from ASR to VCOM and in the process of tweaking

tender fossil
tough abyss
#

I've got it so that (MapData) the variable name of the map with data on it, calls the action and then this is the line within the file. i want the action to remove the action so that its gone. then i was gonna do some other unrelated things in the operation

tough abyss
#

didnt seem to work. must be implementing it wrong

tender fossil
#

If it doesn't work, maybe the right side parameter (the action ID number) is not right

tough abyss
#

i used addAction to add the action, this is the script of the action. so after its called the action its not removed it like the code says

#

theres only 1 in the entire operation

#

im pretty sure they start counting from 0

#

Got it working

#

your solution worked

#

thanks for that

tender fossil
#

Aight, np πŸ™‚

cedar kindle
#

broke how

crisp sonnet
#

Hiya, having some issues with my parachute script - When the players are kicked out of the aircraft, they collide with each other and die or go unconscious.

This is the script I was using:

{ 
    params ["_player"];  
    _player setVariable ["OriginalLoadout", getUnitLoadout _player]; 
    removeBackpack _player;   
    _player addBackpack "B_Parachute";   
    [_player] ordergetin false;   
    [_player] allowGetIn false;   
    unassignvehicle _player;   
    moveout _player;   
    sleep 0.3;  
    _player spawn  
    { 
        params ["_unit"]; 
        waitUntil {sleep 0.1; isTouchingGround _unit}; 
        _unit setUnitloadout (_unit getVariable "OriginalLoadout"); 
    }; 
}; 
 
[] spawn  
{   
  {   
    if (((assignedVehicleRole _x) select 0) == "Cargo") then  
    {  
      [_x] remoteExec ["Paradrop_fnc_ejectPlayer", _x]; 
    }; 
  } forEach(crew dropship1);   
};```
#

Is there a way for me to add a line in there to make the players invincible until they've touched the ground? If so, where and how would I have to put it in?

#

New idea - I've made them invincible in the editor. Now I just need them to have allowDamage true when they touch the ground

#

I assume that'd be a _unit allowDamage true?

meager granite
#

_player allowDamage false; then _unit allowDamage true; later

#

Blunt solution, might require HandleDamage for cover lots of nuances.

#

client_sideColorsArrayTriggerHashMap guess the data type here and what it contains notlikemeow

gleaming rivet
#

Honestly, I'd recommend ditching VCOM for ASR unless you have a real reason for it. DAC handles radio simulation and reinforcements, so there is a distinct lack of need of the main function of VCOM

tough abyss
#

I like the unpredictability of VCOM... ASR AI seem to just stand there and shoot back

lethal dew
#
    _terrain = worldName call BIS_fnc_mapSize; //Not 100% sure
    _terrain = worldSize; //This for sure returns a calculation of terrain side length as type Number 
        _center = how?;

I mean, since (probably both) of these functions return the worlds terrain side length, if I understand the docs correct, how is one supposed to find the exact center without the need to calculate by some rocket science formula?? Isn't the whole point of built-in functions to avoid that? Does even a function do exist that simply returns [x-length, y-length] of the current world?? Or even JUST the center itself? At least that's all I need right here, right now.... Couldn't find anything.
But then there is this guy called: BIS_fnc_mapGridSize
Description: Returns the size of map grid square at current zoom level.
???
Thanks.
P.S. My apologies in advance in case I missed something obvious.

open hollow
lethal dew
#

Yes of course, works fine like that, I forgot to mention that I am using this already, but I want to be able to get the exact center of the whole map as a rectangle. For instance, Altis looks like one to me. As I am typing this I begin to understand that probably no one else sees this as a necessity anyway, so whatever... Will try by rocket science then...

gleaming rivet
#

My issue with VCOM is the fact that it's AI don't listen to orders. Force them into a town and they'll take a route around.

manic sigil
#

Trying to find the center of Altis' landmass, as opposed to the whole playable map area, then?

lethal dew
#

No, the other way around, center of main landmass is given by the formula displayed by @open hollow

lethal dew
#

How do you know?

open hollow
#

because you can only do squares as maps, you cant do a rectangle

sullen sigil
#

because it is not possible to make a non square map

lethal dew
#

Alright, taking that for granted, how to get total length of any map inside SQF?

#

Or is it even fixed?

stable dune
#

worldSize

lethal dew
#

No... that's just terrain length. What if there are 2 major Islands instead of just one?

open hollow
#

A picture is worth a thousand words

winter rose
#

worldSize

gleaming rivet
winter rose
#

unless I misunderstood your question, but if you want the landmass' centre, there is no command for that and you will have to take measurements yourself.

lethal dew
#

Description: Returns the engine calculated size (terrain side length) of the current world

So... by terrain it means the world then. regardless of any water?

sullen sigil
#

that bigger island looks familiar 🀨

winter rose
winter rose
lethal dew
#

SURE I GOT THAT. I just wanted to point out that the description is misleading, big time!

sullen sigil
#

a terrain is the entire world

winter rose
#

not really misleading because in scripting terrain = terrain (world), not landmass
but I kinda get your point

#

(with colours)

sullen sigil
#

may be worth altering it still though for clarification

winter rose
#

if you do that, you also change it everywhere it is written "terrain" on the wiki - not doing that

sullen sigil
#

i am a master at ctrl+h

open hollow
#

it can be misleading if you don't know what "terrain" means in sqf context

winter rose
#

then learn

sullen sigil
#

how if its not on the wiki

winter rose
#

make a Terrain page and link to it πŸ˜„

tender fossil
sullen sigil
#

i dont have membership πŸ₯Ή

winter rose
#

Not to be confused with: map
Not to be confused with: scenario

warm hedge
#

i am making a map, any help?

sullen sigil
#

you are making a terrain πŸ˜„

winter rose
#

maybe POLPOX is making a paper map YOU DON'T KNOW

sullen sigil
#

gib wiki member lou i want dark theem

warm hedge
#

dunt breach the agremen!

open hollow
#

to be honest, ppl hardly reads all the wiki, even when want to ( it happened to all of us, searching for an hour, ask here, and get a link as response ) so making a page for everything... it wont we a solution

lou didn't pay me to be against of more wiki pages, i promise

sullen sigil
#

this channel could do with a wiki bot to link commands tbh

#

seeing as a good chunk of traffic here does seem to be things resolved by just reading the wiki link

warm hedge
sullen sigil
#

Very easy

winter rose
#

but this command doesn't exist

sullen sigil
#

make it exist πŸ˜„

winter rose
#

…yet

warm hedge
#

It does dkldkddkd, yeah

sullen sigil
#

i frequently use dkldkddkd in all my scripting projects

crisp sonnet
#

I now have another issue, while it's not a problem, I want the vehicles that I just dropped to spawn a single blue smoke where they land to mark their position for the players - How can this be done?

crisp sonnet
sullen sigil
#

it does tell you how to format it

#

and it cant tell you where to put it because everybody needs to put it in different places

meager granite
#

I guess there is no way to tell if map finished preloading satellite textures?

#

Made a script to generate map previews with ui2texture but got this:

#

All that effort just to have maps scroll and hide properly inside controls group

#

Nothing is easy in Arma

winter rose
crisp sonnet
#

Okay so

#

All of the things are formatted enough to be used on their own

#

What I'm meaning is that most of the time it doesn't explain how it can be formatted to work with other scripts and like, become a huge spaghetti of workable code

#

Not to mention some of the code that I've copy and pasted from community Wiki has just... errored out upon running or just doesn't work in certain circumstances

crisp sonnet
#

It's mostly just small nitpicking that my poor autistic brain doesn't know how to get around

#

Like it all makes sense

#

But looking at it all confuses me

#

Like these examples - I'm sure they all make sense and show what they need to show, but looking at it all just makes me confused

#

I think that's more to do with just how the Wiki looks and is formatted than how the code itself is laid out and formatted

#

It's not very... Beginner friendly?

tender fossil
#

I think that the BIKI documentation is pretty good nowadays and has improved greatly even recently – kudos for that! However, I do think that it could indeed use an more of an in-depth but logical explanation of the fundamental principles of how SQF as a language works. Like the foundation to start building on.

crisp sonnet
#

I also find that things referring to the wiki aren't very well labeled. Like I was just trying to recreate the script that adds the APEX interaction on space bar thing but I ended up finding help on steam instead of any biki documentation

tender fossil
crisp sonnet
#

But, I know there is biki documentation because I've seen it. I just wasn't pointed towards it very quickly

winter rose
winter rose
crisp sonnet
#

I did find something eventually

#

But in order to execute it I had to use this:

 myLaptop,
 "Interact with Laptop",
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",  "_this distance _target < 3", "_caller distance _target < 3",
 {}, {Nomad sideChat "Accessing laptop!"},
 {laptopProp setDamage 1}, 
 {},
 [], 12, 0, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, myLaptop];```
#

And that's just what I got via copy-paste from steam community

winter rose
#

which copy-pasted it from the BIKI πŸ˜„

crisp sonnet
#

Of which, a Biki that I couldn't find for the life of me XD

sullen sigil
#

remoteexec an action add? thonk

crisp sonnet
tender fossil
sullen sigil
#

I'll check the function wiki page though

crisp sonnet
#

If the code works I don't touch it

#

Right now it works so I ain't messing with it XD

sullen sigil
#

Yeah but init is ran when someone joins

#

Meaning you'll have the action added for all clients every time someone joins (at least for addAction)

crisp sonnet
#

Wouldn't init run when... game is init?

tender fossil
sullen sigil
#

object init is ran on client when they join

#

so remoteExec adding it to all clients would run every time someone joins and the object init is ran

crisp sonnet
#

Yeah but it only shows up on that object so... probably fine

#

But yeah to say that's copy-pasted from the biki and is already the wrong way to do it

#

Admittedly it's been taken from the biki, put on steam community, then to me

sullen sigil
#

i may be wrong but ik thats the case for a simple addAction and iirc all the function does is jostle about some params

crisp sonnet
#

Yeah it's a direct copy of Example 2

sullen sigil
#

I'm not on my computer right now so can't check though

winter rose
crisp sonnet
crisp sonnet
winter rose
#

because we won't copy-paste that on all command pages

crisp sonnet
#

But the problem is that most of us just go straight to the command pages

sullen sigil
#

i will βœ‹

winter rose
#

this is why data is cut this way - wherever something makes sense, have it
otherwise we would only have one big 50MB page with everything on it

crisp sonnet
#

We're looking for that specific piece of code and aren't gonna waste time looking at every single page that relates to the thing we're using

tender fossil
#

@crisp sonnet Also if you want to really get into scripting/programming, there's the option of taking an introductory course teaching the universal fundamentals of programming at first

crisp sonnet
winter rose
sullen sigil
#

i think the accessibility of reaching "somewhere" is probably a better nitpick here though

crisp sonnet
#

Then you just add something that literally just says, even in the //quote (Not to be used on object init - refer here)

winter rose
#

no

crisp sonnet
#

Like this: // adds the action to every client and JIP, but also adds it when it was already removed. E.g., Laptop has already been hacked by a player [ _myLaptop, // Object the action is attached to "Hack Laptop", // Title of the action "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Idle icon shown on screen "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Progress icon shown on screen "_this distance _target < 3", // Condition for the action to be shown "_caller distance _target < 3", // Condition for the action to progress {}, // Code executed when action starts {}, // Code executed on every progress tick { _this call MY_fnc_hackingCompleted }, // Code executed on completion {}, // Code executed on interrupted [], // Arguments passed to the scripts as _this select 3 12, // Action duration in seconds 0, // Priority true, // Remove on completion false // Show in unconscious state ] remoteExec ["BIS_fnc_holdActionAdd", 0, _myLaptop]; // MP compatible implementation - Not to be used on object init, use 'call' instead

sullen sigil
tender fossil
tender fossil
sullen sigil
#

Maybe, but imo the wiki could just do with being easier to navigate at times due to it being difficult to find things when you already know what you're looking for

#

There's been some instances where a command has been quite well documented but just... hasn't appeared in searches

#

So I end up having to directly type the url in and so on 🀷

crisp sonnet
# winter rose

So I'm expected to remember every little bit of information on all of those pages at all times when making a mission? Or are they more tabs that I just have to now have open and refer to in my very limited time of making missions? All over the top of a "see here:" that could be added to the correct usecase

copper raven
#

that specific piece is related to locality

winter rose
crisp sonnet
copper raven
#

huh?

crisp sonnet
#

It literally says multiplayer implimentation in the same example

winter rose
#

read the introduction β†’ read how commands are used β†’ use commands

not the other way around πŸ˜‰

kindred zephyr
#

thats why you search in the command index instead of looking by association of command families or trying to look for specific keywords on the bar tbh, its easier if you have the entire command list and just ctrl+f instead of waiting for your keyword to deploy the command you want on the searchbar

sullen sigil
#

i ended up reading the introduction for the first time today

copper raven
#

the wiki page is about BIS_fnc_holdActionAdd, not locality

crisp sonnet
#

I'm confusing myself here

#

I hate sqf

sullen sigil
#

dont we all

winter rose
#

yeah, start with that - more can relate πŸ˜„

sullen sigil
#

actually thats a lie i quite like sqf

#

more readable than other languages ngl

crisp sonnet
#

Why is everything so damn confusing

tender fossil
crisp sonnet
#

Can we just like. Live in the matrix. So I can just like. Beam this stuff into my brain via a cable?

#

I need to know arma 3 sqf scripting. Plug me in.

crisp sonnet
#

Boom now I know arma 3 sqf

#
 myLaptop,
 "Interact with Laptop",
 "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",  "_this distance _target < 3", "_caller distance _target < 3",
 {}, {Nomad sideChat "Accessing laptop!"},
 {laptopProp setDamage 1}, 
 {},
 [], 12, 0, true, false] remoteExec ["BIS_fnc_holdActionAdd", 0, myLaptop];```

So what am I actually changing here? ```remoteExec``` to ```call```?
copper raven
#

on the wiki page, in the top left corner, it says effect local, example makes sense - it tells you to use remoteExec so you achieve a global effect. it can also be achieved without it, if we... put it in initPlayerLocal.sqf, object init, trigger activation field, CfgFunctions with a postInit attribute and 50 other different things that run on every machine (vs server for example, where you would want to use remoteExec)... no one will go and specify every possible execution method on every single command/function

winter rose
crisp sonnet
#

Is that everything I need to do?

sullen sigil
#

unless you know what youre doing never use remoteexec in an objects init

winter rose
crisp sonnet
#

The problem is clearly that I don't know what I'm doing

sullen sigil
#

thats reforger lou

tender fossil
sullen sigil
crisp sonnet
#

If this breaks my code

sullen sigil
#

thatll make the function run locally once on the client

sullen sigil
#

wait

#

yeah you need to reformat it

sullen sigil
#

duh stupid ljw

crisp sonnet
#

I've already made the code do the thing I just need it to do the thing while formatted correctly

sullen sigil
#

idk the formatting for the function with call off themtop of my head

crisp sonnet
#

Well it won't let me do it with call

#

So

#

I guess I'll die

#

suffer

sullen sigil
#

i think itd just be changing everything after and including remoteExec to call BIS_fnc_holdActionAdd

crisp sonnet
sullen sigil
#

but im on mobile with no syntax highlighting and 2 peas instead of brain cells

crisp sonnet
#

oh my god

#

It's just yelling "ACCESSING LAPTOP" in the side chat every half a second

sullen sigil
#

then get rid of the Nomad sideChat "Accessing laptop!" part

crisp sonnet
#

I put it in the wrong place

sullen sigil
#

i figured

winter rose
#

that's what she said

sullen sigil
#

why is she saying that lou

winter rose
#

I don't know; she won't speak but garbled noises

crisp sonnet
#

ugggggggggggggh now I have to wait 10 minutes for it to go back to 3den because even my m.2 NVME SSD isn't fast enough

sullen sigil
#

that sounds like a mod issue

winter rose
#

this is why you test code in empty missions
gotta go fast

crisp sonnet
#

It's literally vanilla

sullen sigil
#

i test code by making them addons

tender fossil
#

Also use Virtual Reality map for testing

crisp sonnet
#

I'm using tanoa lmfao

sullen sigil
#

use vr map yeah

winter rose
#

then you have either very poor hardware or crapton of entities in Eden

crisp sonnet
#

I code the mission while I make it 😎

sullen sigil
#

simply do not

winter rose
#

and you lose time everytime
so simpler = better
more clutter = more failure causes

tender fossil
crisp sonnet
#

Mission 1 seemed to work just fine

#

So did mission 2

#

Mission 3 is having all these issues

sullen sigil
#

the only problem with testing on vr map as a beginner is you end up using setpos instead of setposasl

crisp sonnet
#

So... can't use .png files for laptop screen textures?

tender fossil
#

What code editor are you using btw? Using Visual Studio Code with certain extensions is highly recommended I'd say

sullen sigil
crisp sonnet
#

Y'all are using an editor? I'm slapping it raw into the init box

winter rose
sullen sigil
#

...thats what she said?

crisp sonnet
tender fossil
crisp sonnet
#

I remember using a jpg once too

crisp sonnet
#

I don't got anything to change it to a paa

tender fossil
winter rose
#

better paa for better performance
use Arma 3 Tools

crisp sonnet
#

But I dont wanna download more things my poor SSD

tender fossil
#

The development tools barely take any space at all compared to the game itself

sullen sigil
#

i have 300gb of arma mods clogging up my hdd you have no excuse

crisp sonnet
#

You have a HDD

sullen sigil
#

i have both πŸ˜„

crisp sonnet
#

I'm on a 256gb M.2 SSD

winter rose
#

Arma 3 Tools = 400 MB

sullen sigil
winter rose
#

a website can't do that without a big plugin

#

they have their own converter iirc

crisp sonnet
#

Welp, it claims to

sullen sigil
#

oh im wrong then

#

ignore me

winter rose
#

no wait, I might be

#

no, it's just "JS-processed"

sullen sigil
#

its more likely im wrong

crisp sonnet
#

DIMENSIONS HAVE TO BE A POWER OF 2?

sullen sigil
#

yes

crisp sonnet
#

It's 1280x1024

sullen sigil
#

welcome to computers

crisp sonnet
#

For goodness sake

winter rose
sullen sigil
#

the laptop textures arent the entire image too iirc

#

theres a format on the bi forums somewhere if not

crisp sonnet
sullen sigil
#

no

tender fossil
#

1024 is, but 1280 isn't

sullen sigil
#

root 1280 isnt a whole number

crisp sonnet
#

Ahhhhhhhhhhhhhhhhhhhhhhhhhh

#

Imma just jpg it

sullen sigil
#

still has to be to power of two iirc

crisp sonnet
#

But its a screenshot of a laptop screen that's the same aspect radio of the screen I'm putting the texture on

winter rose
#

yep
stretch it

#

you want to go to the easiest and not to the smartest/most adapted here β€” really, use paa, you'll enjoy it
better perf, better integration, better size, etc

tender fossil
#

But yeah, really, use Visual Studio Code with the plugins mentioned above to have life-saver stuff like syntax highlighting and instant nagging by the editor if there's an error in your code (works often at least)

crisp sonnet
#

time to open paint3d to stretch it I guess

sullen sigil
#

open paint.net -> change 1280 to a square number

#

easy as that

sullen sigil
winter rose
#

1280Γ—1024 is not 4:3 nor 16:9, it is 5:4 btw

crisp sonnet
sullen sigil
#

ive made entire mods from debug console thanks to adt

#

doesnt mean thats how the texture looks

tender fossil
crisp sonnet
#

Welp I've edited it

tender fossil
#

I would have Arma Debug Engine too but it's broken atm

sullen sigil
crisp sonnet
#

Dynamic sim is in the group menu not the object iirc

tender fossil
#

The tables have turned

sullen sigil
#

thats... odd. base game its object but ill look later

crisp sonnet
#

happy editor noises

sullen sigil
#

using arma wiki in arma game

#

armaception

crisp sonnet
#

Both the launcher and the program are open

winter rose
#

Girls and Panzers too

sullen sigil
#

i hadnt noticed it was win11 gross

crisp sonnet
#

It's a WoT mod package

sullen sigil
#

anyway
praise be to dynamic simulation

crisp sonnet
sullen sigil
#

people still use windows xp

crisp sonnet
#

I know, I'm one of them

south swan
#

so, win10 is the new win7, hate for upgrade included?

sullen sigil
#

yes

winter rose
#

Win10 EOL 2025

sullen sigil
#

win11 looks gross

tender fossil
crisp sonnet
#

Yeah but it will be soon so i might as well run it now while I support it

sullen sigil
#

the only thing it has over win10 is tabs in file explorer by default

crisp sonnet
#

They change the hardware requirements every week

sullen sigil
#

wait 2025 is only 2 years away too meowsweats

tender fossil
#

I love W11 look, it's the best aspect of it. Never liked W10 UI design πŸ˜›

winter rose
#

anyway :p

crisp sonnet
#

Yeah back to my question

#

How make blue smoke pop when vehicle touches ground

tender fossil
crisp sonnet
#

I paradrop vehicle, all works fine, but then I want there to be blue smoke that signals the location to the players

south swan
#

i don't really care about windows looks, it's only there to launch Chrome/Total Commander/Steam/Discord/VSCode oldman offtopic much

sullen sigil
#

create blue smoke grenade when vehicle position above ground is below height u want

sullen sigil
#

createvehicle

#

waituntil

crisp sonnet
#

If I know I can get everything I need right here I ain't even gonna touch the wiki XD

sullen sigil
#

getpos and select

#

there

#

go open all those wiki pages

south swan
#

quick, guys, give them a bunch of wrong advices

crisp sonnet
#

Hmmmyes sounds... Way too complicated for my knowledge

#

The players can just use their eyes

sullen sigil
#

invisible zeus throws smoke grenade at it

crisp sonnet
#

It's a zeusless mission

sullen sigil
#

my condolences

crisp sonnet
#

Yeah

south swan
#

inb4 parachute "Deleted" EH

crisp sonnet
#

I make all my missions so they work without the zeus doing anything, like the zeus can do things to make it better, but they don't have to and it's playable start to finish

crisp sonnet
sullen sigil
#

nbd though

stable dune
crisp sonnet
#

dicordUser isTouchingGrass false

winter rose
crisp sonnet
#

Yeah but then I feel bad for not giving them anything

winter rose
#

give them Hell

sullen sigil
crisp sonnet
stable dune
stable dune
crisp sonnet
#

I suppose their reward is the satisfaction they get of correcting all my smoothbrain bull

sullen sigil
#

a colouring book

tender fossil
winter rose
#

"2, go to He11!"
"oh no, 2, is down!"

quiet gazelle
#

will this

#define P_EAST(var) var vectoradd [0, _cellsize] 
_polygon pushBack P_EAST(_positions # _currentindex);```
have the same effects as 
```sqf
_polygon pushBack ((_positions # _currentindex) vectoradd [0, _cellsize]);```?
#

also is there a command to run the preprocessor over strings without having to save them into a file?

quiet gazelle
#

i guess there isn't one then

stable dune
quiet gazelle
#

I'm trying to check in the debug console if i messed up my macro definitions or not

granite sky
sullen sigil
#

yeah as expected there wont rlly be a one size fits all for touching the ground itself

granite sky
#

Funny thing there is that it was arguably true :P

#

There was definitely an air gap under the thing.

stable dune
#

Which would be best way ?
Like artemoz said
inb4 parachute "Deleted" EH
?

sullen sigil
#

Probably best approach imo

#

Likely most "realistic" too - it'd likely be the thing that activated the grenade irl

stable dune
#

I did with isTouch wo problems but I will change that isTouch doesn't work correctly

stable dune
granite sky
#

IIRC isTouchingGround is reliable for units, if that's what it's for.

sullen sigil
#

Judging by the comments that'd be my guess too

jovial aspen
#

Hello

#

I have this code in local that rpt logs friendly fire

// playerinitlocal
player addEventHandler ["HitPart", {
  (_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"];
  _unitName = name _target;
  _instiName = name _shooter;
  _disSide = side _shooter == side _target;
  if(_disSide) then {
  //if((side _shooter) == (side _target)) then {
    private _message = format ["%1 has friendly fired %2 with %3", _instiName, _unitName, _ammo];
    timesFriendlyFired = timesFriendlyFired + 1;
    publicVariable "timesFriendlyFired";
    private _message2 = format ["Friendly fire incident: %1", timesFriendlyFired];
    _message remoteExec ["diag_log", 2];
    _message2 remoteExec ["diag_log",2];
  };

  if(!isNull (getAssignedCuratorLogic _shooter)) then {
     private _curMessage = format ["Curator %1 shot incident on %2 secretly", _instiName, _unitName];
     _curMessage remoteExec ["diag_log",2];
  }
}];```
#

pls dont mind the weirdness of the if statement. its a product of trying to figure out why its not* working. i can rpt log in local machine but not in server

#

anyone have explanation

proven charm
jovial aspen
proven charm
jovial aspen
#

yes

#

i mean no not working

proven charm
#

well u have to look to server .rpt not client

jovial aspen
#

i did

proven charm
#

k

jovial aspen
#

For reference, it can rpt log self inflicted damage, ai to player damage, but not player to another player

proven charm
#

then it sounds like locality issue

winter rose
sullen sigil
#

iirc hitpart wont fire if the instigator is not local either

winter rose
#

where does this code run, where is it put?

sullen sigil
#

initplayerlocal

#

says at the top

winter rose
#

//playerinitlocal = initPlayerLocal.sqf?

jovial aspen
#

yes

winter rose
#

player init local != init player local

jovial aspen
#

i mean its in initplayerlocal

#

just typo

winter rose
#

ok, worth checking you'll agree πŸ˜„

jovial aspen
#

oh

sullen sigil
winter rose
#

ta-da yep

jovial aspen
#

oh

#

okay i see

sullen sigil
#

currently trying to make my hitpart bullshit work too meowsweats

jovial aspen
#

whats the workaround on this 😭

#

been trying to get it to work for a week already

sullen sigil
#

why not Hit eh?

jovial aspen
#

wanted hitpart for the type of ammo param. good for investigatory*

sullen sigil
#
player addEventHandler ["Hit", {
    params ["_unit", "_source", "_damage", "_instigator"];
        if (side _instigator isEqualTo side player) then {
          systemChat "someone's been a naughty boy";
        };
}];```
#

can just use the ammo type selected in the instigator i would imagine

jovial aspen
sullen sigil
#

that'd probably work yes

#

any reason for GetCfgData over just getText?

jovial aspen
#

idk i just copied this in google but if this idea works then ill put my mind on this

sullen sigil
#

ok

jovial aspen
#

tysm

#

just quick question. what if it used a vehicle

sullen sigil
#
thing setObjectTextureGlobal [0,""];
thing setVariable ["KJW_CapitalShips_HP",10000];
thing addEventHandler ["HitPart", { 
    params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"];
    systemChat "hi";
    private _mm = thing getVariable ["KJW_CapitalShips_HP",0];
    thing setVariable ["KJW_CapitalShips_HP",_mm-(_ammo#0)];
    systemChat str (thing getVariable ["KJW_CapitalShips_HP",0]);
}];``` think im missing something, variable remains undefined? ran in obj inint
sullen sigil
#

oh
i removed (_this select 0) from the wiki example thinking it was an old example. it was in fact not an example and was required

quiet gazelle
#

how do i get the length of an auto_array from intercept using size() or count()?

torpid mica
#

is it possible to show the following Gui Message in Multiplayer only to specific Players/Units if executed on the server?

_result = [format ["Are you sure you want to change your GroupType from '%1' to '%2'?",_grouptype, _NewGrouptype], "Project CombinedArms", "Yes", "No", [] call BIS_fnc_displayMission, false, false] call BIS_fnc_guiMessage;
sacred dove
#

I am trying to create a script that spawns an OPFOR helicopter when an OPFOR soldier is killed. I got it to spawn on its death, but I am having trouble getting the units spawned in the heli so it just spawns with no units and crashes into the ground. Not sure what I'm missing here: https://sqfbin.com/jikoluzeremohijanoje

torpid mica
sacred dove
#

does that go in side the for loop? I am editing what chatgpt is spewing me as i originally wanted 4 units inside.

sullen sigil
#

Any reason setVectorDirAndUp won't work on an attached object? Isn't working for mine nor is the bis function for relative attaching thonk

sullen sigil
torpid mica
#

its creating all the Crew in the Vehicle ( Gunner, Driver, commander etc)

sacred dove
torpid mica
#

it would be something like this:

_grp = creategroup east;
_opfor_unit = _grp createUnit ["O_Soldier_F", getMarkerPos "base1", [], 0, "FORM"];


_opfor_unit addEventHandler ["Killed", {
    

    for "_i" from 1 to 4 do {
          _heli = createVehicle ["O_Heli_Light_02_dynamicLoadout_F", [3447.61, 4163.89, 50], [], 0, "FLY"];
        createVehicleCrew _heli;        

        _heli_group addVehicle _heli;
        _heli setVelocity [0, 0, 15];
        _heli setCombatMode "YELLOW";
        _heli setBehaviour "CARELESS";
        _heli setSpeedMode "FULL";
        _heli setMarkerPos [getMarkerPos "church"];
  
    };

}];
sullen sigil
#

yes its dogshit for sqf do not use it for sqf especially compared to other languages (which you should not use it for either)

kindred lichen
#

Hey, just made a quick mission, and i'm using setPosATL to move an object around, but it seems to have a huge delay like ~5s, when I run the mission on our dedicated server. Works instantly when I host locally. Really wierd. Anyone have any experience?

south swan
#

chatgpt would give you negative understanding of scripting. As in actively less than nothing

granite sky
#

_heli_group doesn't have any members here.

sullen sigil
#
//shieldpoint settexture stuff
private _vectorDir = vectorDir shieldpoint;
private _vectorUp = vectorUp shieldpoint;
shieldpoint setVariable ["KJW_CapitalShips_HP",10000];
//add hit eh and code to get run inside of it
shieldpoint attachTo [logichelper];
shieldpoint setVectorDirAndUp [_vectorDir, _vectorUp];``` just refuses to set the vectordirandup ![thonk](https://cdn.discordapp.com/emojis/700311400152825906.webp?size=128 "thonk")
granite sky
#

You know it sets them relative to the object you attach it to?

sullen sigil
#

erm
i do now
but im pretty sure it was just setting it to 0,0,0 for all of it

#

the bis function was doing the exact same thing

granite sky
#

0,0,0 isn't valid for direction vectors.

#

They have to point somewhere :P

sullen sigil
#

0,0,0 insofar as just resetting it to have default orientation

#

ive also got some issues with a bomb and setdamage in a moment too

sullen sigil
#

I've just tried setVectorDirAndUp [[0.5,0.5,0.5],[0.5,0.5,0.5]] too and it's done nothing

torpid mica
sullen sigil
#

yes i am aware thats why its an issue

granite sky
#

What is logichelper?

sullen sigil
#

random vehicle object

#

has simulation disabled

#

...that could be why? thonk

granite sky
#

[0.5,0.5,0.5] isn't a valid direction vector either although I'd expect Arma to normalize it.

gleaming rivet
#

setPos doesn't work well in MP.

sullen sigil
#

BRICK setVectorDirAndUp [[0,0.5,0.5], [0,-0.5,0.5]]; wiki example

sacred dove
sullen sigil
#

I've got a seminar I've got to attend now but will be back with this later on

sacred dove
#

which is being set in the init.sqf

_marker1 = createmarker ["church2", _markerPos2];```
granite sky
#

setMarkerPos on a vehicle is garbage.

torpid mica
simple trout
#

oh wait it's not

torpid mica
kindred lichen
#

Any alternative?

sacred dove
sullen sigil
sacred dove
#

I don't have a helicrew variable. do I do _heli_group addWaypoint markerpos ?

#

_heli_group addWaypoint "church2" ?

kindred lichen
#

I have about 20 triggers, which I guess is a little excessive.

torpid mica
#

is it possible to display a guiMessage in Multiplayer only for selected players/units?

kindred lichen
#

They're just like bluefore present in a 2x2 square.

#

basically cover pops up when people step on platforms.

sacred dove
kindred lichen
sacred dove
#

wouldnt it need to be set on the pilot?

gleaming rivet
#

I've always had janky issues with setPos taking time after doing something, especially if that some that has a Road on it.

indigo snow
#

~20 of those triggers should not cause multiple seconds of execution lag tho

gleaming rivet
#

Yea, they shouldn't.

kindred lichen
#

I didn't think so,

granite sky
#

Delete the setMarkerPos line.

#

It's just chatGPT garbage.

#

So are the setBehaviour and setCombatMode, although they're harmless at worst.

kindred lichen
#

like it "runs" instantly, Like if I run through the triggers, they all proc, but the objects take a few seconds to synchronize.

granite sky
#

also any line with _heli_group in it.

tranquil nymph
#

Hey, don't spread misinformation, setPos works fine.

sacred dove
granite sky
#

It's unused. You're creating a group for each heli crew with createVehicleCrew.

#

It was also unused in the original shitcode.

lone glade
#

setPos works fine indeed, setPosWorld is faster tho

tranquil nymph
#

There is literally 0% issue with that command doing what it intends

kindred lichen
#

I'll try SetPosWorld.

lone glade
#

are your triggers local to the server ?

kindred lichen
#

Yeah.

torpid mica
#

I need help with a multiplayer Script: i got it to work to show a guiMessage only to a specific Client, but iΒ΄m not able to return the button he clickt in the remoteExec... can somebody help me pls? Just need to get the resul of the guiMessage somehow

[format ["Are you sure you want to change your GroupType from '%1' to '%2'?",_grouptype, _NewGrouptype], "Project CombinedArms", "Yes", "No", [] call BIS_fnc_displayMission, false, false] remoteExec ["BIS_fnc_guiMessage", leader _grp];
kindred lichen
#

well, they're placed in the editor, and I have a "isServer" check

torpid mica
# torpid mica I need help with a multiplayer Script: i got it to work to show a guiMessage onl...

so i need to embed _GuiResult somehow into the RemoteExec but i don´t know how 😦

[_grp, _grouptype, _NewGrouptype] spawn 
        {
            params ["_grp", "_grouptype", "_NewGrouptype"];
            [format ["Are you sure you want to change your GroupType from '%1' to '%2'?",_grouptype, _NewGrouptype], "Project CombinedArms", "Yes", "No", [] call BIS_fnc_displayMission, false, false] remoteExec ["BIS_fnc_guiMessage", leader _grp];
            //_result = [format ["Are you sure you want to change your GroupType from '%1' to '%2'?",_grouptype, _NewGrouptype], "Project CombinedArms", "Yes", "No", [] call BIS_fnc_displayMission, false, false] call BIS_fnc_guiMessage;
            if (_GuiResult) then 
            {
                _grp setVariable ["groupType",_NewGrouptype];
                _grp setVariable ["groupTypeChange", "locked"];
                systemChat format ["Project CombinedArms: %1 changed GroupType from '%2' to '%3' and will now recive %4 orders.", _grp, _grouptype, _NewGrouptype, _NewGrouptype];
            }
            else 
            {
                _grp setVariable ["groupTypeChange", "locked"];
            };
        };
sullen sigil
#
private _bomb = createVehicle ["Bo_GBU12_LGB", [0,0,0]];
_bomb setPosASL (getPosASL shieldpoint);
_bomb setDamage 1;
deleteVehicle shieldpoint;```
also spawns the bomb, deletes `shieldpoint`, but doesn't explode -- anyone got any clue why?
#

it falls to the ground and still explodes

little raptor
sullen sigil
#

that works great, now it's just the issue of the attachTo not letting me rotate it thonk

little raptor
#

what issue?

sullen sigil
#

Using the BI function also doesn't keep rotation

little raptor
#

vector dir and up should be in model space

sullen sigil
#

oh one moment it is to do with it not having simulation
but if you disable simulation in the init it doesn't work? thonk

little raptor
#

if logicHelper is not simulated you can't even attach anything to it tho

sullen sigil
#

Uh
I have been meowsweats

#

it's a vehicle

#

disabling simulation once it's been attached seems to be fine though

#

i'll try enable simulation then disable it

little raptor
#

what's the point of attaching something to something with no simulation? thonk

sullen sigil
#

Because I don't want the vehicle to move until I tell it to

#

(setvelocitytransformation)

#
helpmeobiwan enableSimulationGlobal true;
[this, helpmeobiwan] call BIS_fnc_attachToRelative;
helpmeobiwan enableSimulationGlobal false;``` also doesn't work ![thonk](https://cdn.discordapp.com/emojis/700311400152825906.webp?size=128 "thonk")
#

even when simulation is true in the first place

#

I'll try replace logichelper with an invisible cba target airplane and enable simulation instead and see if that still works for my purposes

#

not entirely sure why i didnt do that in the first place tbh

#

yeah that works fine wtf was i on initially

frank mango
#

helpmeobiwan kekwpoint

#

(Sorry had to!)

sullen sigil
#

i am making an entire moving & boardable capital ship system i think the name is appropriate

frank mango
#

It is. But made my night seeing that blobcloseenjoy

sullen sigil
#

missiles seem to go through attached objects but bullets dont? wtf? thonk

torpid mica
little raptor
#

how is it defined?

#

normally I mean

#

in SP

ivory locust
#

If anybody has experience working with Intercept sqf bindings DM me

torpid mica
# little raptor what is `_GuiResult`?

normally its the return value of the Bis_fnc_giuMessage

_Guiresult = [format ["Are you sure you want to change your GroupType from '%1' to '%2'?",_grouptype, _NewGrouptype], "Project CombinedArms", "Yes", "No", [] call BIS_fnc_displayMission, false, false] call BIS_fnc_guiMessage;
sullen sigil
#

what is [] call BIS_fnc_displayMission

little raptor
#

findDisplay 46

torpid mica
#

default value for this parameter 🀷

sullen sigil
#

oh i see

little raptor
#

well it shouldn't be passed in a remoteExec

#

that's a local display

little raptor
# torpid mica normally its the return value of the Bis_fnc_giuMessage ```sqf _Guiresult = [for...

as for the solution to this, this is what you should do:

[format ["Are you sure you want to change your GroupType from '%1' to '%2'?",_grouptype, _NewGrouptype], "my_fnc_messageResult", [_grp, _grouptype, _NewGrouptype]] remoteExec ["my_fnc_showSomeMessage", _someClient];
my_fnc_showSomeMessage = {
  params ["_message", "_callbackfn", "_callbackargs"];
  _Guiresult = [_message, "Project CombinedArms", "Yes", "No", [] call BIS_fnc_displayMission, false, false] call BIS_fnc_guiMessage;
  [_guiResult, _callbackargs] remoteExec [_callbackfn, remoteExecutedOwner];
};
my_fnc_messageResult = {
  params ["_result", "_args"];
  _args params ["_grp", "_grouptype", "_NewGrouptype"];
  if (_GuiResult) then 
            {
                _grp setVariable ["groupType",_NewGrouptype];
                _grp setVariable ["groupTypeChange", "locked"];
                systemChat format ["Project CombinedArms: %1 changed GroupType from '%2' to '%3' and will now recive %4 orders.", _grp, _grouptype, _NewGrouptype, _NewGrouptype];
            }
            else 
            {
                _grp setVariable ["groupTypeChange", "locked"];
            };      
};
#

the first block sends the message to the client, as well as a callback function name + callback args (callback is called by the client to send the results back)

#

the second block is a function on the client machine. it shows the BIS_fnc_guiMessage, gets the result, then sends it back by remoteExecing the callback function

#

the third block is the callback function

#

there is a more efficient version of doing callbacks (i.e without bouncing around useless parameters) but it's a bit more complicated

torpid mica
#

thank you very much. I will try that tomorrow πŸ™‚

viral birch
#

I am trying to build a GUI-based vehicle reload system that will allow players to pay in-game currency to reload selected turret magazines so they can minimize cost if they can't afford to fully rearm the vehicle. Code is attached in screenshots, but here is the TLDR step by step:

  1. Select and parse data gathered from GUI to identify which magazine I want to reload.
  2. Gather Turret Path, Magazine Class Name, and Bullet Count from all turrets.
  3. Loop forEach to compare gathered data from Step 2 until a match is made with identified data from Step 1.
  4. Once a match is made, remove the magazine and add a new/full magazine.

Everything is working perfectly fine with no errors, but I am not able to replace the specific identified magazine because it seems that removeMagazineTurret only removes the next magazine inside the turret even though I singled out which magazine I want to remove, making it impossible to reload the correct magazine.

Does anyone have an idea of how I can accomplish this? It must be possible, right?

kindred lichen
#

SetPosWorld didn't seem to fix it.

#

I'll just use Create / Delete. They seem to sync / propagate with more priority.

#

thanks for the help.

sullen sigil
#

What's the name of the commands used for putting cameras onto textures? Can't seem to find them but that's likely because I've not a clue what the feature is called

bold comet
#

that's weird, setPosATL is instant for me in multiplayer even with 300 units

#

you may have an issue

#

must be more an issue with the script doing setPosATL than setPosATL itself

kindred lichen
#

Yeah it's wierd, when I teleport myself or players it seems to work instantly, These are just VR blocks.

#

I'll try different implementations and I'll try to see if it's something with the localization or the way I'm running the script.

jade abyss
#

Ah

#

Let me guess: EnableSimulation false?

bold comet
#

or maybe setPosATL is just longer with buildings and such

kindred lichen
#

I think I found it!

#

hint "Station Activated";

_target setVariable ["cover",_cover,true];
_target setVariable ["coverb",_coverb,true];

_markerPos = getMarkerPos _coverMarker;
_cover setPosATL [_markerPos select 0,_markerPos select 1,0];
_coverb setPosATL [_markerPos select 0,_markerPos select 1,1];

#

The setVariable Calls are being executed synchronously

sullen sigil
#

ah that does indeed help thanku πŸ™‚

#

I just need to make it look like a window now meowsweats

kindred lichen
#

so the whole script is pausing until the variables are broadcasted.

#

That would explain it right>

bold comet
#

broadcasting a variable should be near instant too

#

unless your server is dying

sullen sigil
#
/* create render surface */
billboard setObjectTexture [0, "#(argb,512,512,1)r2t(mcbananartt,1)"];

/* create camera and stream to render surface */
cam = "camera" camCreate [0,0,0];
cam cameraEffect ["Internal", "Back", "mcbananartt"];

/* attach cam to gunner cam position */
cam attachTo [mcbanana, [0,0,0], "PiP0_pos"];

/* make it zoom in a little */
//cam camSetFov 0.1;

/* switch cam to normal */
"mcbananartt" setPiPEffect [0];

/* adjust cam orientation */
addMissionEventHandler ["Draw3D", {
    _dir = 
        (eyePos player) 
            vectorFromTo 
        (getPosASL mcbanana);
    cam setVectorDirAndUp [
        _dir, 
        _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
    ];
    mcbanana setVectorDirAndUp [
        _dir, 
        _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
    ];
}];``` figured this out with help of kk's blog, however doesn't work for looking up and down -- anyone able to provide any pointers?
#

fuck you can hear the music
please ignore that

sullen sigil
#

effectively my problem is i need to make the vectorUp the vectorUp between the player's eye position and mcbanana but I've not the foggiest how to do that

#

no thats wrong

#

i need the player to only see the rear end of mcbanana

#

Currently it sees this

little raptor
#

I have no idea what you mean meowsweats

sullen sigil
#

should only ever see this

#

this feels like really basic scripting that im just drawing a blank on

little raptor
#

what is mcbanana?

sullen sigil
#

the arrow

#

im slowly going insane so all my variable names arent very helpful

little raptor
#
mcbanana setVectorDirAndUp [
        _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0],
        _dir vectorMultiply -1
    ];
#

iirc the arrow's "up" means it points downwards

#

hence the -1

sullen sigil
#

ah

#

will try in a mo im getting a glass of scripting milk

#

ah i think that works thank you
im just not entirely sure because camera fov seems to be odd (its default) and i have no clue how on earth i'd figure out what that should be thonk

little raptor
sullen sigil
#

nono it works properly right now

#

the camera fov is just odd for the window-ness

#

like i should see the 3 vr cubes behind surely but i only see whatever that is

#

even though

sullen sigil
#

most likely
the cubes do not seem to exist

little raptor
#

do you want to project those cubes onto the screen?

sullen sigil
#

i want to be able to see the cubes

#

i want the billboard to look like a window

#

it's so that i can have the arrow transformed elsewhere and have it appear to be a window to elsewhere

#

similar to a portal im just using it as a window

little raptor
#

well you can't make it exactly like a window

sullen sigil
#

yeah but as close as possible is my goal

#

so long as you can see an 800m long object and go "thats over there" it'll do the job

#

except i cannot even see a 1m long object right now πŸ˜”

#

...wait i wonder if the camera and arrow are pointing opposite directions

little raptor
#

they are

#

you've attached it

#

also you should use getPosWorld instead of getPosASL

sullen sigil
#

removing the -1 doesnt seem to have resolved it either
i also shouldve seen the back of the billboard anyway
and rgr

little raptor
#

the arrow's front is different from camera's front

#

they're perpendicular

sullen sigil
#

errrrr
i can solve that by just getting rid of the attachto cant i

little raptor
#

that's one way. or just don't rotate the arrow

sullen sigil
#

wait it'll need to be attached in the first place
fml

#

removing the attachto also didnt fix

little raptor
#

just do

mcbanana setVectorDirAndUp [
        _dir, 
        _dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
    ];

like before

#

ah wat? you've attached the camera and you rotate it? wat?