#arma3_scripting
1 messages Β· Page 54 of 1
Yeah it's possible,
eventhandler which sets a value to an MFDvalue, then use that value to manipulate something on the HUD
https://community.bistudio.com/wiki/setUserMFDValue
thx, feel so dumb right now XD
_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
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
references can kick you in the ass if you're not careful tho
need to pay great attention wether to use references or copies
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
but i have no control over where the scheduler might pause execution do i? so what exactly is stopping race conditions from happening?
I'll reply soon in more detail, but what's the Leopard's OOP idea you mentioned?
Omg, gib 
The way the scheduler in arma works you now run the danger of locking a variable forever :D
what would be the easiest way to detect when an arsenal is closed? i assume a scripted event handler?
https://community.bistudio.com/wiki/Arma_3:_Scripted_Event_Handlers
missionNamespace "arsenalClosed" [displayNull, uiNamespace getVariable ["BIS_fnc_arsenal_toggleSpace", false]]
thanks
yeah I saw that
you can think of it as "version"
what patch/revision/version are we at exactly?
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)
i'm using vscode to edit sqf, can i somehow get it to autocomplete variable names?
There are SQF extensions for that yes
which one do you use?
E.g. these
ah great, the second one does it
however it also marks all the cba macros as errors
Might be with mods yeah, I don't mind it personally though
@tender fossil what other extensions do you use for arma 3 sqf in vscode
especially for formatting
Nothing else for formatting. I have just a debugger setup for advanced development but it's broken atm (after the game update)
Might be just out-of-date
wait so does it automatically format?
or you do it manually
Depends on how you define formatting but I'd say that it assists in it
Are you certain I can use this with SQF and without a mod?
Yes because it's a SQF command
Thanks!
Oh i missed that, you might have to create a custom hud in the description.ext to avoid using mods then..
Maybe draw3D might be better suited?
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
I saw it as an open issue on their GH page
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 π
just made that mistake navigating configs
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 {
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
The syntax is still wrong in your example (AFAIK), that would throw an error I think
yep
isNil takes a string, and you're passing a string. As far as isNil is concerned that's alright
that's PHP's "variable variable" π
$var1 = "hello";
$var2 = "var1";
print($$var2); // prints "hello" :D
Stahp
well it's easy to avoid making that mistake if you understand how SQF works. the first thing to know is that you can never use a nil variable with any command. (well unless if you count = as a "command")
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)
Yes, I was just typing that it actually tells quite a lot about how SQF works π
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)
private _sayHi = { hint "Hello!"; };
if (alive player) then _sayHi;
anyone used ZEN dynamic_dialog?
https://zen-mod.github.io/ZEN/#/frameworks/dynamic_dialog
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]];
Using _this and this
Also, you've put it in the init of the group, not the object. It needs to go in the object init.
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"?
isKindOf "CAManBase"
Why CAManBase and not just Man?
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?
I would use "CAmanBase" instead of "Man", since "man" kind includes animals as well... BIS logic. True in some sense. :)
Thanks
It's where the arma.exe file is
do you have all the necessary parts of VS installed?
Yeah I am able to compile my plugin using cmake through VS like the tutorial on github says
I am just using the default templates right now, I followed the tutorial on github
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
before i had this entire pack installed i was able to compile it but it didn't work in game
I'm pretty sure I installed this but I will double-check
Yes I have it installed
what is your dll's filename
Config says "Ruskov Plugin" dll filename says "Ruskov_Plugin"
they don't match
No way
Let me try changing it
I'm assuming I have to re-pack the addon every time I rebuild the dll right
no
Here is the intercept mod and my addon installed, I also have CBA_A3 installed through the workshop
the pbo only contains the name to tell intercept what plugin to load
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
- Create player unit (blufor) in VR editor
- Start singleplayer
- Plugin works?
It still isn't doing anything, do I have to enter any scripts
if config is correct and dll is there, it will be loaded at game start before main menu
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
@stable dune fixed it it was both the issues you said. thanks!
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
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?
Yeah I would spawn a script that checks the number of living squad members then sleeps for 5 seconds or something
Cool I'll give it a shot
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
It wasn't liking game_state& either
Do I have the wrong version of intercept included or something
What did the compiler say
Its
using binary_function = game_value (*)(game_state& state, game_value_parameter, game_value_parameter);
should be this
I must have the secret hpp
or did you download one of the 4 year old github pre-releases
Yes I have the 4 year old headers
download master branch directly instead π
Ok I will add that the 4 year old ones are the ones packaged with the template plugin
So based
The while function does nothing unfortunately :/
They tend to do that
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 
I think new name is "dynamic link library"
C++, windows, library as filters on top
I'm not sure you can block respawn except by blocking death :P
The Arma wiki extensions page has a guide
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.
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
neither
you put your plugin's dll, into your mods intercept folder, like you had before
you don't build intercept itself
I just built the library from source using VS to make sure the versions match
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
Update the intercept folder in my plugin template folder?
ye
I mean from here
That intercept folder has to point to latest master branch, instead of that 3/4 year old commit there
and after you have that, you do that ^ indeed
if you can compile with using game_state&, it'll be correct
Yeah I have the most recent sources downloaded into the intercept folder in the template
jup then just rebuild your plugin and it should work then
This error shows up when I put in the call to register_sqf_command which is why I thought it was a library error
π€
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
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
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.
They autocomplete in the debug console but don't return anything
attach a debugger, set breakpoint and see if they're called
if they autocomplete the plugin is definitely loaded and "working"
@sacred dove A group is needed:
_soldier = _group createUnit ["O_Soldier_F", _soldierPos, [], _soldierDir, "NONE"];
So I don't need to callExtension or anything like that before it starts working
systemchat prints to chatbox, in singleplaye you have no chatbox
diag_log to RPT would be better
I can systemChat through the debug console but I'll try that
ahh, so simple yet overlooked. Thanks Jib!
no
It's loading intercept and my addon but it's just not doing anything
As I said, if the command is registered, your plugin is loaded
attach a debugger, and check if your code is called
Attach a debugger to arma?
yes
attach during splash screen, intercept loads once arma goes into black/fullscreen
I can see now that intercept is being loaded in the RPT after turning on logging
Is the syntax for my custom commands correct
^
If the commands show up in debug console, it means they are correctly registering
and you said they show up
They don't return anything when I call them though
is now atleast the third time I say that
Like I can't do hint testCommand;
attach breakpoint and see in debugger what happens
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
Don't assume that ChatGPT has any idea what it's talking about
I am out of ideas for where to look for answers here
I would start reading what Dedmen said
I realized I wasn't packing my pbo correctly
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
its scary to see how much people want to rely on a chatbot neural network for coding lately D:
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
Done, non-binarized
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
nvm there is none
I see in the PBO that the prefix is main, but I don't know what that means
something is setting the prefix to that, that may conflict
but you can also just check if config is there in ingame config browser
addon builder has a prefix field in options iirc
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
Intercept_core is also showing up in cfgPatches
"intercept" callExtension ("load_extension:Ruskov_Plugin"); can try running this in debug console
Well yes, very much
Do I just change that to 2
Lmfaoo wait
I set that to 1 when I was setting everything up
The template uses the macro https://github.com/intercept/intercept-plugin-template/blob/master/src/main.cpp#L5
And intercept sets it to https://github.com/intercept/intercept/blob/fd16da9ff8b4b890d51af7c94b86f8804e7b4460/src/client/headers/shared/functions.hpp#L19 2
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
// ... 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.
commandGetOut probably doesn't unassign the units from the vehicle, so they'll just get back in.
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.
Is it enough to plain unassign und reassign each unit?
Not necessarily. If the vehicle is also assigned to the group then it might decide to reassign the units to the vehicle anyway.
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.
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.
_spawnedHeli = [_spawnPosition, 0, (selectRandom _helicopters), west] call BIS_fnc_spawnVehicle;
_chosenHeli = (_spawnedHeli select 0);
By doing it like this.
That's just hiding even more stuff from you.
Which does all that crew filling and assigning stuff for me. At least I thought so.
You need to read BIS_fnc_spawnVehicle to see what it's doing.
Yes, maybe...
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.
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.
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.
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
@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
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
Make sure that you load the game with startup parameters that shorten the startup time (like -noSplash and maybe also -world=empty at least)
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
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
Speaking of Intercept, any ETA on Arma Debug Engine fix? π
so far seems i have time on weekend
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?
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)
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
Looks like you have the /ZI but not /INCREMENTAL linker flag?
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?
"remote" normally means "on another machine" rather than "on a different drive"...
Can't imagine what else it could mean, my Arma install IS on another drive
I'll try installing the JIT debugger
Got it working, just had to move my VS install to the drive where Arma was installed
Thanks again all
bump to this
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.
CBA extended init event handler maybe? @hasty violet
as you would in ALiVE: http://alivemod.com/wiki/index.php/Script_Snippets#Adding_Custom_Inits_to_Spawned_Units
np
@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.
will send cake
is there a way to change the magazine reload speed of a weapon?
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
Can you retrieve the error from RPT (the Arma log file)? The line you posted doesn't need second ;, so either it's misplaced or the error it gives is wrong for some reason
And now that I'm turning my brain on again with coffee, the error is on that line indeed. removeAction needs an unit on the left side of the command as parameter. Now there's [MapData] this that probably isn't an unit
does it need a variable name?
Basically yes, and that variable has to be an unit / type of unit
MapData is the variable name of the unit the action is on
You can then just remove the brackets and this, so ```sqf
MapData removeAction 0;
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
What has been called by the action? I mean that removeAction needs the unit as the parameter on the left side. See the BIKI page (especially the example): https://community.bistudio.com/wiki/removeAction
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
had that up beforehand prior to getting stumped lol
didnt seem to work. must be implementing it wrong
If you used addAction on that object then you can remove it similarly with removeAction
If it doesn't work, maybe the right side parameter (the action ID number) is not right
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
Aight, np π
Works perfectly
broke how
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?
_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 
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
I like the unpredictability of VCOM... ASR AI seem to just stand there and shoot back
_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.
if you only want the center, is just:
_centerPos = [worldSize/2, worldSize/2, 0]
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...
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.
Trying to find the center of Altis' landmass, as opposed to the whole playable map area, then?
No, the other way around, center of main landmass is given by the formula displayed by @open hollow
all maps are squares
How do you know?
because you can only do squares as maps, you cant do a rectangle
because it is not possible to make a non square map
Alright, taking that for granted, how to get total length of any map inside SQF?
Or is it even fixed?
worldSize
No... that's just terrain length. What if there are 2 major Islands instead of just one?
A picture is worth a thousand words
Yes
worldSize
Though we should probably move this discussion to either #arma3_ai or #arma3_scenario
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.
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?
that bigger island looks familiar π€¨
the world
all of it
y e s
terrain as in "world area", underwater included
as in what I drew above
SURE I GOT THAT. I just wanted to point out that the description is misleading, big time!
a terrain is the entire world
not really misleading because in scripting terrain = terrain (world), not landmass
but I kinda get your point
(with colours)
may be worth altering it still though for clarification
if you do that, you also change it everywhere it is written "terrain" on the wiki - not doing that
i am a master at ctrl+h
it can be misleading if you don't know what "terrain" means in sqf context
then learn
how if its not on the wiki
make a Terrain page and link to it π
This is the way
i dont have membership π₯Ή
Not to be confused with: map
Not to be confused with: scenario
i am making a map, any help?
you are making a terrain π
maybe POLPOX is making a paper map YOU DON'T KNOW
gib wiki member lou i want dark theem
dunt breach the agremen!
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
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
Use Japanese IME and assign BIKI URL to a easy word so it is very easy to make an URL like https://community.bistudio.com/wiki/addAction
ez
but this command doesn't exist
make it exist π
β¦yet
It does dkldkddkd, yeah
i frequently use dkldkddkd in all my scripting projects
Tbh I just need it to turn damage on for all units that have been dropped - I added that and it seems to work so with any luck that's great.
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?
The main issue I have, personally, is that yes the wiki link does tell me what I need to use, but it doesn't give me enough information about where to put it, how to format it, etc
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
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
do you have an example and how it could be better formatted? (#community_wiki if possible)
Hold on
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
like this?
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting
https://community.bistudio.com/wiki/Code_Best_Practices
https://community.bistudio.com/wiki/Code_Optimisation
if you find code errors in examples, please report them in #community_wiki
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?
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.
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
There wouldn't be need to reinvent the wheel, could just link e.g. to official Wikipedia articles and/or other good resources about the fundamental principles
But, I know there is biki documentation because I've seen it. I just wasn't pointed towards it very quickly
this is what https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting is about
even though "by now" boarding on SQF is less important (obsolete, plenty of examples, etc), it is nonetheless good to have (and improve)
that's feature documentation, and this is sometimes missing entirely
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
which copy-pasted it from the BIKI π
Of which, a Biki that I couldn't find for the life of me XD
remoteexec an action add? 
It's for a server
Yeah, it's a good article. I would just explain the fundamental logic of SQF (e.g. interpretation and it's consequences, like the funny isNil related discussion we had last night π ) too. Links to resources elsewhere would be decent already
If its in the init if an object you can (probably) just use call
I'll check the function wiki page though
If the code works I don't touch it
Right now it works so I ain't messing with it XD
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)
Wouldn't init run when... game is init?
Though, I would say that programming/scripting is complex and at some point you just need to get your hands dirty. But it's important to start from simple things to not to overload your brain with don't-knows and kill your motivation that way (I suck at this, I must admit lol)
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
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
i may be wrong but ik thats the case for a simple addAction and iirc all the function does is jostle about some params
Its the same on the biki
Yeah it's a direct copy of Example 2
I'm not on my computer right now so can't check though
it's not the wrong way to do it
it's putting in object init that is the wrong way
explained in many places
But not explained on the page containing the code itself..
because we won't copy-paste that on all command pages
But the problem is that most of us just go straight to the command pages
i will β
exactly!
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
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
@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
Yeah I tried one of those at college.
It taught me Pico-8 of all things
you complain about nitpicking one piece of information without reading the base principles that are written somewhere
can't do anything against that 
i think the accessibility of reaching "somewhere" is probably a better nitpick here though
Then you just add something that literally just says, even in the //quote (Not to be used on object init - refer here)
no
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
you then have thousands of examples to maintain
Unfortunately that's the reality (for now) at least in programming world in general; it requires quite a bit of mental effort (see the related accurate comic). But I agree that the BIKI could be improved in a way
That sounds like an opportunity for a programmatical solution π
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 π€·
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
it's just an example, you can execute it in many ways, as Lou said, no one will go and copy paste same things everywhere
that specific piece is related to locality
"I want to fix this and that together"
"twist these bolt & nut together"
"THE SCREWDRIVER DOESN'T WORK OMG"
"β¦there is a tool documentation to read first"
"it should be written on the bolt that it is not compatible with the screwdriver - and the toaster - and the fridge"
etc
I mean, yes, but at least specify that its related to locality
huh?
It literally says multiplayer implimentation in the same example
read the introduction β read how commands are used β use commands
not the other way around π
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
i ended up reading the introduction for the first time today
the wiki page is about BIS_fnc_holdActionAdd, not locality
dont we all
yeah, start with that - more can relate π
Why is everything so damn confusing
Lou put it pretty well. Fundamentals at first, and only then to the details
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.
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```?
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
yes
no
Is that everything I need to do?
unless you know what youre doing never use remoteexec in an objects init
The problem is clearly that I don't know what I'm doing
thats reforger lou
As a general tip, I think it would be a good idea to start with simpler things. Otherwise you might have too many moving pieces and can't figure out anything because you don't know what change causes which effect
then all you need to do is swap to call
Reforger π
If this breaks my code
thatll make the function run locally once on the client
Yeah but. Cool mission stuff.
duh stupid ljw
I've already made the code do the thing I just need it to do the thing while formatted correctly
idk the formatting for the function with call off themtop of my head
i think itd just be changing everything after and including remoteExec to call BIS_fnc_holdActionAdd
I shall try this
but im on mobile with no syntax highlighting and 2 peas instead of brain cells
oh my god
It's just yelling "ACCESSING LAPTOP" in the side chat every half a second
then get rid of the Nomad sideChat "Accessing laptop!" part
I put it in the wrong place
i figured
that's what she said
why is she saying that lou
I don't know; she won't speak but garbled noises
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
that sounds like a mod issue
this is why you test code in empty missions
gotta go fast
It's literally vanilla
i test code by making them addons
Also use Virtual Reality map for testing
I'm using tanoa lmfao
use vr map yeah
then you have either very poor hardware or crapton of entities in Eden
I code the mission while I make it π
simply do not
and you lose time everytime
so simpler = better
more clutter = more failure causes
That will just make your life hard π
Mission 1 seemed to work just fine
So did mission 2
Mission 3 is having all these issues
the only problem with testing on vr map as a beginner is you end up using setpos instead of setposasl
So... can't use .png files for laptop screen textures?
What code editor are you using btw? Using Visual Studio Code with certain extensions is highly recommended I'd say
you have to use .paa
Y'all are using an editor? I'm slapping it raw into the init box
should I mention it on the BIS_fnc_addAction page?
...thats what she said?
It's weird because I have used a png for a big screen texture before and it worked then, just not now
#arma3_scripting message Visual Studio Code extensions that I'd highly recommend
I remember using a jpg once too
Lowkey hate visual studio
jpg or paa, nothing else
I'll change it to a jpg
I don't got anything to change it to a paa
Visual Studio and Visual Studio Code are entirely different editors/programs (just to make sure)
better paa for better performance
use Arma 3 Tools
But I dont wanna download more things my poor SSD
The development tools barely take any space at all compared to the game itself
i have 300gb of arma mods clogging up my hdd you have no excuse
You have a HDD
i have both π
I'm on a 256gb M.2 SSD
Arma 3 Tools = 400 MB
use https://paa.gruppe-adler.de/ then
uses image to paa software off your computer already installed iirc
Welp, it claims to
its more likely im wrong
DIMENSIONS HAVE TO BE A POWER OF 2?
yes
It's 1280x1024
welcome to computers
For goodness sake
yes
256Γ512
1024Γ8
128Γ128
your choice, your call
the laptop textures arent the entire image too iirc
theres a format on the bi forums somewhere if not
Is 1280x1024 not to the power of 2?
no
1024 is, but 1280 isn't
root 1280 isnt a whole number
still has to be to power of two iirc
But its a screenshot of a laptop screen that's the same aspect radio of the screen I'm putting the texture on
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
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)
time to open paint3d to stretch it I guess
advanced developer tools ingame too
1280Γ1024 is not 4:3 nor 16:9, it is 5:4 btw
Yeah the screen I'm putting it on looks 5:4
ive made entire mods from debug console thanks to adt
doesnt mean thats how the texture looks
Oh yeah, this too (and some other development oriented mods). Here's my list:
Welp I've edited it
I would have Arma Debug Engine too but it's broken atm
you may know this -- does 3den enhanced hide the dynamic simulation box? Ive not been able to find it 
I use 3den enhanced and no
No idea 
Dynamic sim is in the group menu not the object iirc
The tables have turned
thats... odd. base game its object but ill look later
happy editor noises
Arma is one of the programs on the taskbar too
Both the launcher and the program are open
Girls and Panzers too
i hadnt noticed it was win11 gross
anyway
praise be to dynamic simulation
W11 gross yes but Win 10 now end of life
people still use windows xp
I know, I'm one of them
so, win10 is the new win7, hate for upgrade included?
yes
Win10 EOL 2025
win11 looks gross
(W10 is not end of life yet) yeah what Lou said, I'm slow
Yeah but it will be soon so i might as well run it now while I support it
the only thing it has over win10 is tabs in file explorer by default
They change the hardware requirements every week
wait 2025 is only 2 years away too 
I love W11 look, it's the best aspect of it. Never liked W10 UI design π
anyway :p
Yeah and then we'll be 5 years away from Arma 4 like in 2013, 2018, 2023 and and... 
I paradrop vehicle, all works fine, but then I want there to be blue smoke that signals the location to the players
i don't really care about windows looks, it's only there to launch Chrome/Total Commander/Steam/Discord/VSCode offtopic much
create blue smoke grenade when vehicle position above ground is below height u want
Yes yes, how?
If I know I can get everything I need right here I ain't even gonna touch the wiki XD
quick, guys, give them a bunch of wrong advices
Hmmmyes sounds... Way too complicated for my knowledge
The players can just use their eyes
invisible zeus throws smoke grenade at it
It's a zeusless mission
my condolences
Yeah
inb4 parachute "Deleted" EH
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
I got nothing to give them in return for their service
ive found isTouchingGround doesn't work well for some modded vehicles
nbd though
It doesn't return anything or return true in wrong altitude?
dicordUser isTouchingGrass false
not a problem, you can make it clear with Paid: no
Yeah but then I feel bad for not giving them anything
give them Hell
returns false when on ground
Oh this wasn't aimed btw I just found it funny to put XD
Good to know
You can give them puzzles and they will solve those
I suppose their reward is the satisfaction they get of correcting all my smoothbrain bull
a colouring book
2, GIVE 'EM HELL!
"2, go to He11!"
"oh no, 2, is down!"
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?
i guess there isn't one then
You could give some example what you are trying achieve , I would say you will get answers , if there is workaround
I'm trying to check in the debug console if i messed up my macro definitions or not
It's not reliable for vanilla vehicles either. Ran into that issue with a destroyed HEMTT.
yeah as expected there wont rlly be a one size fits all for touching the ground itself
Funny thing there is that it was arguably true :P
There was definitely an air gap under the thing.
Which would be best way ?
Like artemoz said
inb4 parachute "Deleted" EH
?
Probably best approach imo
Likely most "realistic" too - it'd likely be the thing that activated the grenade irl
I did with isTouch wo problems but I will change that isTouch doesn't work correctly
Yeh, i will try this out. Thanks for these
IIRC isTouchingGround is reliable for units, if that's what it's for.
Judging by the comments that'd be my guess too
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
what's the problem?
it doesnt log
oh right, not working on dedi?
well u have to look to server .rpt not client
i did
k
For reference, it can rpt log self inflicted damage, ai to player damage, but not player to another player
then it sounds like locality issue
player is null on a dedicated server
iirc hitpart wont fire if the instigator is not local either
where does this code run, where is it put?
//playerinitlocal = initPlayerLocal.sqf?
yes
player init local != init player local
ok, worth checking you'll agree π
oh
The event will not fire if the shooter is not local, even if the target itself is local.
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HitPart
ta-da yep
currently trying to make my hitpart bullshit work too 
why not Hit eh?
wanted hitpart for the type of ammo param. good for investigatory*
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
so something like
((configFile >> "CfgMagazines" >> currentMagazine _instigator >> "displayName") call BIS_fnc_GetCfgData)```
idk i just copied this in google but if this idea works then ill put my mind on this
ok
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
variable is set properly initially but then as soon as it hits it becomes 0
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
how do i get the length of an auto_array from intercept using size() or count()?
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;
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
use createVehicleCrew
https://community.bistudio.com/wiki/createVehicleCrew
does that go in side the for loop? I am editing what chatgpt is spewing me as i originally wanted 4 units inside.
Any reason setVectorDirAndUp won't work on an attached object? Isn't working for mine nor is the bis function for relative attaching 
do not use chatgpt to script sqf
its creating all the Crew in the Vehicle ( Gunner, Driver, commander etc)
very new to sqf so I was just looking to get some basics from it but it seems to be inaccurate for many things so far
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"];
};
}];
yes its dogshit for sqf do not use it for sqf especially compared to other languages (which you should not use it for either)
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?
chatgpt would give you negative understanding of scripting. As in actively less than nothing
_heli_group doesn't have any members here.
//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 
You know it sets them relative to the object you attach it to?
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
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
has anyone an idea?
I've just tried setVectorDirAndUp [[0.5,0.5,0.5],[0.5,0.5,0.5]] too and it's done nothing
a bomb should detonate if _bomb setDamge 1; π€¨
yes i am aware thats why its an issue
What is logichelper?
[0.5,0.5,0.5] isn't a valid direction vector either although I'd expect Arma to normalize it.
setPos doesn't work well in MP.
BRICK setVectorDirAndUp [[0,0.5,0.5], [0,-0.5,0.5]]; wiki example
okay so I had to add the createVehicleCrew line before the addVehicle line. They are created now and I can see the pilot and copilot. But they now (slowly) just crash into the ground and I get an error on the setMarkerPos line :
Error setmarkerpos type object expected string
I've got a seminar I've got to attend now but will be back with this later on
which is being set in the init.sqf
_marker1 = createmarker ["church2", _markerPos2];```
magnitude is not 1
setMarkerPos on a vehicle is garbage.
you cant set an Object (_Heli) with markerPos....
oh wait it's not
then you have to do _marker1 setMarkerpos... If its in another script you need to use global variables
Any alternative?
so you're saying the setmarkerpos has to be attached to the pilot instead of the helicopter object? How would I just get it to fly to a marker once it has spawned? I get the same error with the script updated to include the church2 marker. https://sqfbin.com/zufomeranafawoyedemo
its no t
you have no waypoint commands
helicrew addWaypoint markerpos
I don't have a helicrew variable. do I do _heli_group addWaypoint markerpos ?
_heli_group addWaypoint "church2" ?
try this:
https://sqfbin.com/wexorefexoceyixebaxi
I have about 20 triggers, which I guess is a little excessive.
is it possible to display a guiMessage in Multiplayer only for selected players/units?
They're just like bluefore present in a 2x2 square.
basically cover pops up when people step on platforms.
when the heli spawned, it gave me
Error setmarkerpos: 0 elements provided, 3 expected```
wouldnt it need to be set on the pilot?
I've always had janky issues with setPos taking time after doing something, especially if that some that has a Road on it.
~20 of those triggers should not cause multiple seconds of execution lag tho
Yea, they shouldn't.
I didn't think so,
Delete the setMarkerPos line.
It's just chatGPT garbage.
So are the setBehaviour and setCombatMode, although they're harmless at worst.
like it "runs" instantly, Like if I run through the triggers, they all proc, but the objects take a few seconds to synchronize.
also any line with _heli_group in it.
Hey, don't spread misinformation, setPos works fine.
doesnt it need a group to spawn?
It's unused. You're creating a group for each heli crew with createVehicleCrew.
It was also unused in the original shitcode.
setPos works fine indeed, setPosWorld is faster tho
There is literally 0% issue with that command doing what it intends
I'll try SetPosWorld.
are your triggers local to the server ?
Yeah.
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];
well, they're placed in the editor, and I have a "isServer" check
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"];
};
};
using this also doesnt work
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
that's not how it's done. you should send another remoteExec back
use triggerAmmo
wasn't aware that was a command, thanks
that works great, now it's just the issue of the attachTo not letting me rotate it 
what issue?
Here
Using the BI function also doesn't keep rotation
vector dir and up should be in model space
oh one moment it is to do with it not having simulation
but if you disable simulation in the init it doesn't work? 
if logicHelper is not simulated you can't even attach anything to it tho
Uh
I have been 
it's a vehicle
disabling simulation once it's been attached seems to be fine though
i'll try enable simulation then disable it
what's the point of attaching something to something with no simulation? 
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 
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
i am making an entire moving & boardable capital ship system i think the name is appropriate
It is. But made my night seeing that 
missiles seem to go through attached objects but bullets dont? wtf? 
and how would i do that? since i still need to get the result on the client at the first place
what is _GuiResult?
how is it defined?
normally I mean
in SP
If anybody has experience working with Intercept sqf bindings DM me
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;
what is [] call BIS_fnc_displayMission
findDisplay 46
default value for this parameter π€·
oh i see
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
this is one example:
https://gist.github.com/X39/709ecbf88c5fda594586c9b995c8c6a0
thank you very much. I will try that tomorrow π
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:
- Select and parse data gathered from GUI to identify which magazine I want to reload.
- Gather Turret Path, Magazine Class Name, and Bullet Count from all turrets.
- Loop forEach to compare gathered data from Step 2 until a match is made with identified data from Step 1.
- 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?
The only hope that I see is maybe https://community.bistudio.com/wiki/magazinesAllTurrets since it allows you to ID the magazine object...but I see no command to replace that ID or do anything useful with that ID?
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.
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
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
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.
or maybe setPosATL is just longer with buildings and such
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
so the whole script is pausing until the variables are broadcasted.
That would explain it right>
/* 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
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
I have no idea what you mean 
should only ever see this
this feels like really basic scripting that im just drawing a blank on
what is mcbanana?
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
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 
you mean you want to see the arrow as an arrow an not just a rectangle?
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
that's the sun 
I think
most likely
the cubes do not seem to exist
do you want to project those cubes onto the screen?
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
well you can't make it exactly like a window
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
they are
you've attached it
also you should use getPosWorld instead of getPosASL
removing the -1 doesnt seem to have resolved it either
i also shouldve seen the back of the billboard anyway
and rgr
well that's not what I meant
the arrow's front is different from camera's front
they're perpendicular
errrrr
i can solve that by just getting rid of the attachto cant i
that's one way. or just don't rotate the arrow
