#arma3_scripting
1 messages ยท Page 564 of 1
Hello again! ๐
Thanks @austere granite for your reply, looks like I'll have to just tell admins to set the difficulty themselves :D
I've a little curiosity and I was wondering if anyone has extensive knowledge about https://community.bistudio.com/wiki/remoteExecCall
In the wiki it says that:
It just means that the execution of the function will be carried on in unscheduled environment.
I understand the example that it makes but I still have some doubts about how it works when multiple client use it to execute a function on a server.
If n clients do
[] remoteExecCall ["func1", 2];
at the same time, does this mean that "func1" is called n times sequentially (in order of arrival) or there are going to be n threads running "func1" in parallel that just can't be suspended?
it'd be the later but depends on network traffic and speed probably
scripts cannot run in parallel at the same time
it'd be the later
latter? no. Can't
sequentially in order of arrival is the answer
oh you're right I misread
Yay! I guess it's definitely what I want then, thanks a lot! ๐
(I guess it would be behave similarly to having a thread that constantly listens for new remoteExecCalls and just runs the desired function as you would with "call", right? If this is the case I assume the function that's being invoked doesn't really matter, it just behaves all the same)
uh.. not really.. but yeah i guess similar
As a way to imagine it let's say, don't want to go down in the technicalities ๐ Thanks a lot, appreciated!
Is there a script trigger activated where a group is dead or maybe 3 remaining it spawns the same group again?
Hi there!
I am trying to initialize an Alien's behavior system one Waypoint activation and I get an error. It works if I don't set a waypoint but I need it so once it gets to a spot, then it initializes. The error I get is:
|#|params[
"_group",
"_pos",
["_arg",-1],
[...'
Error Params: Type String, expected Bool
File A3\functions_f_contact\waypoints\fn_wpDroneMove.sqf, line 1```
I am using: `[alien] call bin_fnc_behaviorInit;` for the code inside the Activation Waypoint
Am I doing something wrong here, I have created a script, defined everything correctly in cfgFunctions, but when I go to use my addaction (delcared on the init box in the mission), it says my function is undefined?
this addAction["<t color='#FF0000'>Retrieve Standard Loadout</t>",{[]call LW_fnc_spawnStandardLoadout},nil,1.5,true,true,"","true",5];
try to only type your function's name in the debug console first
Yeah that isn't doing nothing, it isn't in the fuctions list either, which is whats bamboozling me
I don't think so? Functions.hpp class LW { tag = "LW"; class core { file = "core"; class Loadouts{}; }; };
description.ext ```author = "Lewis Williams";
disabledAI = 1;
class cfgFunctions
{
#include "core\functions.hpp"
};```
fn_loadouts.sqf ```sqf
LW_fnc_spawnStandardLoadout = {
player setUnitLoadout[["hlc_rifle_M4","","rhsusf_acc_anpeq15A","rhsusf_acc_ACOG",["hlc_30rnd_556x45_EPR",30],[],""],["mas_launch_M136_F","","","",["mas_M136",1],[],""],["hlc_pistol_P226US","","","",["hlc_15Rnd_9x19_B_P226",15],[],""],["Gen3_aor1",[["ACE_EarPlugs",1],["ACE_morphine",2],["ACE_elasticBandage",5],["ACE_packingBandage",5],["ACE_tourniquet",2],["ACE_CableTie",2],["ACE_IR_Strobe_Item",1],["ACE_MapTools",1],["ACE_quikclot",1]]],["milgp_v_jpc_assaulter_belt_AOR1",[["ACE_Flashlight_XL50",1],["ACE_Chemlight_HiRed",2,1],["SmokeShellRed",3,1],["SmokeShell",3,1],["rhs_mag_mk84",3,1],["rhs_mag_m67",3,1],["hlc_30rnd_556x45_EPR",10,30],["hlc_15Rnd_9x19_B_P226",2,15]]],["milgp_bp_Tomahawk_AOR1",[["AMP_Door_Wedge",1],["ACE_wirecutter",1]]],"milgp_h_airframe_02_AOR1","milgp_f_face_shield_shades_shemagh_AOR1",["ACE_Vector","","","",[],[],""],["ItemMap","ItemcTab","tf_anprc152","ItemCompass","ACE_Altimeter","NVGoggles_mas_hv18"]];
};
๐ฆ
also, whatever the file content; if it doesn't appear in the Functions viewer, it wasn't properly configured
ok, so where do i define each individual function?
see https://community.bistudio.com/wiki/Arma_3_Functions_Library for all the details ๐
@winter rose This is better? ```sqf
_functions = [
"LW_fnc_spawnStandardLoadout"
];
{
_x call BIS_fnc_recompile;
} forEach _functions;
Can the "OnLoad" UI EH be applied to a UI before it is created? I want to create a textbox in Zeus Interface that will display custom information for Zeus w/o having to directly edit the interface. I want to do it through SQF only if possibly
no
How can I determine whether player is using backup red dot sight or main sight on NightStalker sight?
I don't think that's possible
No idea, but would this do it: https://community.bistudio.com/wiki/currentVisionMode
Ok thx
I could put NVG with action command but how can I cycle NVG mode to TI with command?
@young current Will you mind elaborating?
Script uses
_unit setPos [getPos _chair select 0, getPos _chair select 1, -5];
I tried set/getPosASL & set/getPosASLW
Sounds like it's working as designed. At the x and y coordinates of the chair, 5 meters below the surface of the water. That's what you've just posted code for anyway
@ruby breach If I change -5 to lets say 100 it still drops you under water. Object is placed at Z = 41.781
@drifting copper then something else places the unit, like an attachTo
So because I am at sea on my version I am using
_unit setPosASLW [getPosASLW _chair select 0, getPosASLW _chair select 1, getPosASLW _chair select 2];
I added getPosASLW _chair select 2]; and this got me to float just above the chair
_unit setPosASL (getPosASL _chair);
``` is a much shorter way of doing the same thing
@ruby breach it does not pull you to the XYZ then
it's the exact same thing (besides ASLW - ASL)
doing [select 0, select 1, select 2] is the same as the original array, without three calls to the command
Yeah, I'm trying to avoid ASLW, since it sounds like waves are irrelevant to what you're trying to do
Yep, I don't blame you for that ๐
Doing just select x spits errors. So not sure about that.
Either or, it does not change the fact that you are either under the water or 1m above the chair. Which was the original issue.
You can get real fancy and use switchMove, setDir, and attachTo to make the unit actually sit in the chair
Then maybe you could set the unit's position to 1 meter lower on the Z axis compared to the chair?
Will google that, thank you
I meant "what you do with select"
Is there an SQF command which checks if two points are on same island?
I could swear I saw it somewhere... damn
never heard of that
๐ฆ maybe it was in my dream then
on the same island? Nope, no command. Maybe a function, but I can't remember anything alike in the BIS ones
You could trace a virtual line and check every two meters "surfaceIsWater", but it is a very raw check that would return false on e.g a creek
It would return false on U-shaped islands and such
A parabala????
Oh well, basicly we need a grid of true/false generated with some step with isOnWater (existing SQF command), then find islands with that, then convert it to another grid where each element is island ID or whatever
You could use calculatePath for a soldier and verify each node
Yep
although it seems logical to me ill ask anyways. i have a switch that is getting one of 3 conditions in form of numbers. 0,1 and 2.can i do a CASE !2 for "not 2"?
no you can't
although you could use switch (true) and use _case != 2 @sturdy cape
at that point you might aswell just use if
well i want it to be structured all the same but i get your point
@astral dawn isWater or however it was called?
surfaceIsWater
Yeah
@slim oyster Maybe you have a solution for that for your AI? (How to check quickly if two points are on same island or not)
Hinting returns scalar. How to turn the scalar to some readable form?
Map it out at Start @astral dawn
Alt. Check what location is the closest and keep a list in memory what location is on what Island
Oh sweet, you are so damn right, this might work generally
Although to check on which island each location is, I need to check on what island each location is xD
Hinting returns scalar.
what?
How to turn the scalar to some readable form?
scalar is a number, can't you already read numbers?
I can if I'm shown one jajaja. Why am i being shown scalar and not an actual number
because its nil
Ahh, copy that
How does one do such combination from these so that it would then be possible to count the owned vehicles?
_vehicles = format ["OwnedBy_%1", getPlayerUID player]; _vehicles;
So that returns "OwnedBy_76................." but that does not work when doing count _vehicles since it will count the number of letters. Eh, how to combine those two things so that it won't end up being a string in the end?
all you do with format is creating a string, which in your case looks like "OwnedBy_12345678" since getPlayerUID player only returns the ID of the user.
so you most likely are looking for setVariable and getVariable
Thanks Grezvany. Weell I took a look in the wiki for both but couldn't figure out how to combine the OwnedBy_%1 with playerUID.
forEach (all)vehicles?
Stuff is being saved in variable OwnedBy_%1 and I'd need to be able to count what the variable holds
missionNamespace getVariable "myGlobalVar"``` then
If I know the specific player's UID like so
missionNamespace getVariable "OwnedBy_12345678";
``` I'm able to return what vehicles have been saved for that certain player but the problem is that I'd need to somehow substitute the UID dynamically at any given time
Oooh Lou, indeedly. ```sqf
missionNamespace getVariable format ["OwnedBy_%1", getPlayerUID player];
whenever your mind is "lost" in-between multiple pieces you know fit but can't assemble together, remember:
how do we eat an elephant? one piece at a time. The trick (and it's hard, even for a seasoned dev) is to step back, and break the issue into multiple, smaller pieces. Then to address these pieces one by one. my two cents (:
Also remember to have your ducky on hand 
oh! that one
Rubber ducky, you're the one. You make coding so much- OH REALLY, THAT'S WHERE IT WAS!?
can someone help me
this Ends mission at the end
but can i have it end mission and then restart the mission again?
Is it possible to change a difficulty setting via scripting from the mission side?
Specifically, our server has waypoints enabled for general play, but I'd like to disable it in a particular mission as it has an emphasis on manual land nav, and the waypoint can be used to "cheat" by powergamers.
Or with serverCommand you can just force a revote which in turn you can manage the difficulty. But otherwise - no.
I was hoping to do it automatically because I can guarantee that manually changing the difficulty for that mission is more work than we'll remember to do
oh well, guess I'll just have to live with it
Do like X39 said, change the starting difficulty
with your server.cfg you can add forceDifficulty and have the server force the difficulty persistant across missions
Yes. We do that. We have a custom difficulty setting that is used for all missions.
It has waypoints turned on, because it's meant to accommodate most missions, and in most of our missions the waypoint is useful, not a cheat.
tamper a bit with showHud command. Specifically the syntax with showHud [array]
you can hide or show certain elements of the hud this way. Execute locally.
The parameters on that look like they cover a variety of things that are necessary to keep, but not waypoints specifically
Cant think of anything else really
I found this:
player onMapSingleClick "_shift";
in a forum thread, which will allegedly take the waypoint command and throw it in the bin, but I'm unsure whether it would also interfere with standard map marker placement (it's not explained in much detail in the thread)
Map markers are double click, waypoints are shift click
oh, huh, it's right here on the onMapSingleClick wiki page:
// The following code will disable Shift+click waypoint marker creation
onMapSingleClick {_shift};
onMapSingleClick likely just adds a handler to the map control to do something when a user clicks on the map once. Shift being whats returned. Not sure how that would work exactly, but likely just exits when shift is held.
question, does anyone have issues with lip files?
(on a side note, I have wss sounds that work well with kbTell, but don't work well with say)
they did ๐ข
I dunno. All I remember is there is a sound command that doesn't like the sound of LIPS
in OFP (and later), samename.ogg and samename.lip would have lips moving (declaring only the .ogg in CfgSounds/CfgRadio)
heh, just plain
class CfgSounds
{
class StartPlayer1
{
name = "StartPlayer1";
sound[] = { "Sound\StartPlayer1", 1, 1 };
titles[] = { 0, "StartPlayer1" };
};
};```or ```cpp
class CfgRadio
{
sounds[] = {};
class StartPlayer1
{
name = "StartPlayer1";
sound[] = { "Sound\StartPlayer1", db, 1 };
title = "StartPlayer1";
};
};```
and ```sqf
player say "StartPlayer1";
// or
player groupRadio "StartPlayer1";
Hmm, have you tried declaring the extension in the sounds array?
negative (but the sound file is properly read, and the subtitle reads properly)
Being read you mean it's not seen as missing? Subtitles work tho.
the sound works, the subtitle works, but the lips won't move
it is weird reallyโฆ
question, does anyone have issues with lip files?
(on a side note, I have wss sounds that work well with kbTell, but don't work well with say)
the side note is about me using wss files that I know work! and declare them in CfgSounds too, and say makes the sound skip like read at 100ร speed without changing the pitch
Oh no. Not the lips. Uhhhhh...is it some sort of FSM state?
the main issue here is: generated .lip files are not considered by Arma when using say.
Is it possible to create a mod that modifies a modded armors protection values? Like, let's say Mod @A introduces 'Cool_Vest', which has a model and everything, but it's like wearing paper. I -do not- want to take their work without asking, I merely want to create a patch that modifies the value of their mod to what I need
Yes, and relatively easy to do. Although that fits more in #arma3_config since it requires you to override the original configs of the objects.
Fair enough!
Can anyone point me in the right direction to use a p3d file as a graphic overlay on the player's HUD? Specifically I'm creating a camera that emulates the look of a UAV (and is way more controllable) and want to use the UAV turret hud model as an overlay (which is a p3d).
unless you want to put an object in front of the players head (which is also visible by other players), I suggest just putting an image on the screen of the user
@exotic flax there is (was?) a way to display 3D objects such as a sphere or whatnot e.g cutObj
@worn forge or you may createVehicleLocal a simple object that you would position on each frame (through event handler)
I must have used the wrong terminology as that's not what I'm after. You know the vignette you see when you use night vision goggles? That's what I refer to as an overlay - a much finer effect is used when you perceive through the turret of the UAV.
pp Effect then - but you can only une NVG/TI and add "filters" (Arma\ยฎ Instagram Edition), but not create a completely new new view mode @worn forge
How do I getPos by object variable name? Not finding much on google.
Concept is to set player position to a specific object activated by a onplayerrespawn.sqf
It s just getPos varname
@runic edge thank you, I was using "testobject" instead of just testobject
You're welcome ;)
So not too sure how this works yet. Basically just learning and trying to figure out how to do things without using triggers.
If I run
player setPosASL [getPosASL RSPN select 0, getPosASL RSPN select 1, getPosASL RSPN select 2];
edit : RSPN is a object variable name
through a onPlayerRespawn.sqf and a onPlayerConnected.sqf will it only affect the player connecting/respawning or will it effect everyone in the mission?
The 2 .sqf files I have on init.sqf / execVM
it's the same as doing ```sqf
player setPosASL getPosASL RSPN;
@winter rose can you read the question?
and this will affect respawning players
@drifting copper let me type, only then you can complain
also onPlayerConnected.sqf seems to be a server-side script so beware of the player variable there
So got the answer for onPlayerRespawn, thank you.
So if onPlayerConnected is server side I should define player to local client? Does it change if I run it through initPlayerLocal instead?
this file seems not to be an Arma-called file but a framework file, if that's the case you should refer to their documentation
Roger
How are supposed to use initServer.sqf and initPlayerLocal.sqf ?
I mean I understand that it s related to https://community.bistudio.com/wiki/Multiplayer_Scripting but I m not sure how
properly
Yeah using them properly should help
Have you checked the above Event Scripts link?
Yes
Yeah (only for the files I'm interested in though) but it only tell me where and when those files are executed
well, they are init* files
they are run once
Maybe if I rephrase my initial question it 'll be clearer
What should be executed on the server and what need to be treated locally
?
And yeah Lou I know local stuff should be executed locally and the rest don't need to ๐ญ
Multiplayer_Scripting kinda says it, the server should deal with mission data, synchronisation, checks, and the fewer code on the client the better
I figured that out but I kinda don't understand it somehow
The server has the mission and data responsibility ; the client should only use fancy stuff
e.g UI, graphical fancy, pp Effects
what is your current situation?
@runic edge a client can disconnect, be low perf, has high ping
Everything that is mission-critical should be ideally done server-side (except for specific situations, like check if something is on a player's screen etc)
it's a local arg, global eff command
Wut
If it is in an "action" the player clicks, then do it player-side yes
no problem here since the action needs a player, and if the player disconnects then nothing happens. If there are other effects though, it depends
it is explained on the allowDamage wiki page and in Multiplayer_Scripting ; the object has to be local to the machine that runs the command
(@cunning crown are we preventing you from typing? ^^)
Just sending not typing
You're faster than me, I've no time to answer xD
and on mobile! โ๏ธ
it is explained on the allowDamage wiki page and in Multiplayer_Scripting ; the object has to be local to the machine that runs the command
But objects placed on Eden are local to the server
Then I'm placing it in initserver
Right ?
again, it depends
what is the real, actual situation of yours?
the command should be run on the server, yes
but:
- is it after a player action?
- is it straight from the beginning of the mission?
- will the object change locality?
Can you explain this pls
it's a local arg, global eff command
local argmeans that you must be the one who created the object, theplayeris always local to the client; the vehicle in which theplayeris also local to the client, but if you're client X and you're only a passenger in the vehicle, then the vehicle will be local to the one driving it. If no one is in the driver place, it is then local to the server (not sure).
Pre-placed mission objects are owned by the server, unless vehicle, then refer to what I said before
global eff just means that every client will see the repercussions of that command on their machine
"run on the server" can also mean a remoteExec from a client
a vehicle turns back local to the server if empty yes
else the locality depends on the seats used by players
the command should be run on the server, yes
but:
- is it after a player action? No
- is it straight from the beginning of the mission? No
- will the object change locality? Need to check
tell - us - the - current - situation dammit ๐
I'm reworking some missions templates and I want to clean the Eden s in it and call this in files
After what you 've told this morning
I just don't know how ace and the r3f logistics handle localities
what is the scripting situation needing allowDamage?
moar details plz
What more is it to saaaay :/
What kind of object is this; when will you dis/enable damage; ...
the context of your script!
it may be moved?
Yeah
and you want it to be destructible at one point?
Then do the allowDamage on the serveur
ah yes, we are all three French ๐ซ๐ท ๐
if always indestructible, indeed, server exec in initServer.sqf and that's it
Ok that's what I understood from earlier explanations
Sorry to disappoint you @winter rose but I'm Swiss (french speaking side tho) ๐
the good side ๐
I noticed some "exรฉcute" from you earlier, I spotted but needed confirmation ^^
I should have switched my keyboard to German to confuse you ๐
nein nein nein!
What I still can't get is : why doesn't the clients need to know that this object isn't allowed to be damaged ?
because the Effect is Global
the game broadcasts the information
so the clients get the info automatically
That's like the owning a pet, if you shout that everyone can pet him, everyone around you will know, but only the owner can allow that, not a random stranger
haha
I like the comparison btw
because some stuff, you want to keep to yourself and not spam the network
(also, some commands were not made with multiplayer in mindโฆ)
also, some stuff only the owner can change, for security reasons
And if you want to show something to only one user, no need to propagate that to other clients
Ok then I minize the impact from a command on everyone s perfs by running it only where it makes sense
if you did run it everywhere, it would have a slight CPU impact (processing the command) but no impact at all regarding effects
But those two logics seems to be quite contradicting each other's
like "I CAN PET YOUR DOG!" and the guy says "no."
maybe you will understand it here with e.g addAction:
you want the user to have an action in his menu to e.g self-detonate
if the action was added to him for everyone, then everyone closing to him could trigger this action, same as with a laptop (-:
when you do a "hack computer" action - the action is added to the computer on all clients
but! what if you wanted a PC hackable only by BLUFOR, while OPFOR are defending it?
then you addAction only on BLUFOR clients
If you put a button on hist chest which will represent the self detonate action, everyone one will be able to press the buton but it will detonate him; addAction to him for everyone
Ok you 're trying to say he alone will be able to see / take damage from the explosion if I miss the for everyone part ?
no, no.
https://community.bistudio.com/wiki/addAction
addAction takes Global arguments; this means that you can use addAction on for example an empty vehicle (local to the server, so not local to the client)
addAction effect is Local, which means the action will only appear on the client that executed the command, not any other client.
See https://community.bistudio.com/wiki/Multiplayer_Scripting#Code_examples ; this is a table that explains it well
Okkkkk I think I just misinterpreted "effect"
yes, effect of the Command - not effect of the addaction's script ^^
What you call effect is just having the interaction in your menu
Better now?
Yeah much clearer !!! Thanks
Ive set up a mission where units spawn on a carrier and their respawn point is the carrier, issue is warlords base module is being used to respawn them and its spawning them underneath/around the carrier, do i require a script to ammend this? And if so can someone point me in the right direction
Does anyone know how to tell ai to get out of a taru troop transport pod? took an hour to make sure it was completely unlocked but not the dont use the getout waypoint on them. also when we use moveout or action getout they just dismount and then get back in. wtf.
unassignVehicle @exotic tinsel ๐
leaveVehicle ?
also, be sure to test in an empty VR map and just your situation. if it works there but not in your full mission, something else in it impacts it
just tried that one, did nothing. they didn't even get out
action?
Not sure anymore, how i did it ๐ค
_unit action ["Eject", vehicle _unit];
_unit action ["getOut", vehicle _unit];
works very well with allowGetIn
ill give them all a try later. getting too frustrated with it. thx guys
here is a quick video of a script I made that uses the A* algorithm for finding the shortest route. Still have a few optimizations to throw in there for reducing the number of roads it has to check cost functions of but it works pretty quickly if you dont try to go from the bottom left of the map to the top right ๐
That was a pain in the butt, not going to lie. It was a big issue when I was testing using stratis. So the way it works is by checking each nodes neighbor (a node is a segment of the road), so I used roadsConnectedTo for that, but obviously that wouldn't get the intersections that weren't setup correctly. So I ended up also putting in a check for the road segments that weren't within roadsConnectedTo but where also within a 20 meter radius.
One thing I want to do to improve it is add the ability to select an island, and then it will give you the path to the closest road segment to that island
Also add automatic updates and such
Gotta do a bit more research for that though
Online SQFVM is back up now. But no cba includes as planned :U
looks really neat @tiny wadi !
especially when you can see it into action ๐
I sat there for about an hour the other night just watching it work ๐
Wasn't there already an A* star and Dijkstra algoritm for Arma 2 and 3?
Sure
PS. Not saying that it isn't impressive to make, although I remember a forum post about it
Lots of them
I was following this implementation for some time
https://github.com/AmauryD/A3GPS
It has problems with detecting crossroads, that's why I asked
Yeah I saw a few of them before I made mine, I mainly did it because I just wanted the challenge
It was fun
That's the spirit ๐
The only problems I have run into mine is 1. the optimization, and 2. I will select a road segment, but then once the algorithm gets to it, it doesnt realize it has found it and then continues searching
What do you mean 'doesn't realize it has found it'?
So you specify the end node, and while walking along nodes you can compare them... somehow it fails?
are you comparing object handles?
Damn it's strange! It should never fail
I believe the issue occurs with how I select the "end" node
I take the position where the user selected and just get the closest road to that
But that wouldn't make much sense for why it would fail
and it only occurs sometimes, so I've got to do some debugging
Are you sure then that it has evaluated that node?
Not entirely, thats what I'll need to do is double check that the node has been evaluated
Yes I'd log all the checked nodes to make sure
It could also have to do with the way I store the roads index within my node array as well. Altis has 30,000 roads so what I did to be able to get the specific nodes index as quickly as possible was create hidden sign objects locally at every road when the mission starts to store that roads index in the array
Is it possible to setVariable on the actual road?
That could save me from creating those objects, and then use the direct object reference rather than searching for the nearest sign arrow
Not sure, IIRC the other GPS used a hashmap for something like that
you could do str the road's object handle
then setVariable / getVariable with it in some dummy object (namespace)
but I don't remember what he used it for
Ahhhh, yeah that could work. That'd save a ton of objects from being created on the client
is it possible to exclude null object from a count of a variable?
_house getVariable ["containers",[]];
count _containers;
some null object are stocked in this var and I want to not count them.
If you take a look at example 2, i believe that will do what you need
@tough abyss
you could do {_x != objNull} count _myArray;
General question but I was looing into how to go about doing this.
I wish to take multiple scores from players on Simple targets and relay it to one computer so an instructor could check the scores.
is this possible?
There a lot of possibilities.
https://github.com/RaynorD/cav_ranges
https://community.bistudio.com/wiki/BIS_fnc_target
something written yourself
just be careful with BIS_fnc_target, since it only works with one (vanilla) object
Unless you build a mod and add support for other targets as well
I have a reset script that resets the score working
but how to use getShotsDataFromTargets
I have no idea
hah im not building a mod LOL
I havent the foggiest clue how anyway ๐
this getShotsDataFromTargets _Tagetname;
?
just add ["uiOpen", [myTarget]] call BIS_fnc_target; with addAction to a laptop and it will show the scores
thats but what if I only want it to show certain targets
oh duh
sorry the Mytarget part
sorry
you'll need one for each target ๐
soooo its not possible to have one score board show all the the targets data at once
or more specifically
player 1: 2 hits
player2: 4 hits
not with that system
!purgeban @magic lance 14d link without description, advertising in wrong channel #rules
*fires them railguns at @magic lance* ร_ร
@still forum can we get := (more assignment expressions) in sqf?
should be super easy to implement.
https://www.python.org/dev/peps/pep-0572/ as reference
:= looks like penis with testicles
you have a weird anatomy KK
what is the proper way to use a if statement to check if an array is equal to something ?
then ... ```
The = is used to asign a value to a variable; to test you need either == or isEqualTo
And for arrays, you should use the later
๐
would you mind helping me with arrays as well ? i need to do basic vectorials additions but in sqf [1,2,3]+[4,5,6] returns [1,2,3,4,5,6] instead of [5,7,9]
Iirc there's a group of command called vector... on the wiki
@queen cargo it is a short it for assign a value to a var and check the expression for true or false
example:
if (a := 10 > 5) then {
systemChat str a;
};
Outputs: 10
a is assigned the output of the expression and the if statement is based on the expression
But we already know if it's true/false since it's in an if-statement. Elif, +=, ++, ... would be a bbetter addition
This was just a basic example there are more complex variants for it
Ah and i messed up of course a is not True it is 10
ive been trying to make a helicopter cut scene with unit capture it works kinda but the helicopter doesn't turn on it flys without the engine on i don't know if it's a problem in my script or something but I would like so advice/help
this is the mentioned script:
_movementdata = <mdata> ;
//_firingdata = <fdata> ;
_sequence = [VehicleName, _movementdata] spawn BIS_fnc_UnitPlay;
//[VehicleName, _firingdata] spawn BIS_fnc_UnitPlayFiring;
waitUntil {scriptDone _sequence};
hint "Playback finished";
@potent river engineOn
unitPlay is only for vehicle's position and direction, nothing else
(unitPlayFiring captures firing too, obviously)
alright thats good to know but where do i paste the engineOn in the heli init?
just before unitPlay?
Sorry if it's a dumb question but i never really played with arma coding in any way i don't have unitPlay like that only in BIS_fnc_UnitPlay form
alright thank you
hello again, i have a problem with a piece of script copied bellow with returned values
{
private _markerHalo = (markerText _x splitString " ");
//hint str(_markerHalo); sleep 3; hintSilent "";
//hint str(_markerHalo select 1)); sleep 3; hintSilent ""; /!\ returns 3000
//hint str(parseNumber str(_markerHalo select 1)); sleep 3; hintSilent ""; /!\ returns 0
if ("DZ" in _markerHalo)
then {
_coord2D = getMarkerPos _x;
//hint str(_coord2D); sleep 3; hintSilent "";
_coordZ = [0,0,parseNumber str(_markerHalo select 1)];
//hint str(_coordZ select 2); sleep 3; hintSilent "";
};
}forEach allMapMarkers;
I don't understand why but parseNumber _markerHalo select 1 returns an error as it needs a string as an input ...
please format your code with
```sqf
/* your code */
hint "Hello There";
```
โ
/* your code */
hint "Hello There";
uv bin ninja'd eniwe
after 100000 Edits ๐
shhhhhhhhh no one saw that ๐
SO ANYWAY
{
private _markerHalo = (markerText _x splitString " ");
//hint str(_markerHalo); sleep 3; hintSilent "";
//hint str(_markerHalo select 1)); sleep 3; hintSilent ""; /!\ returns 3000
//hint str(parseNumber str(_markerHalo select 1)); sleep 3; hintSilent ""; /!\ returns 0
if ("DZ" in _markerHalo)
then {
_coord2D = getMarkerPos _x;
//hint str(_coord2D); sleep 3; hintSilent "";
_coordZ = [0,0,parseNumber str(_markerHalo select 1)];
// hint str(_coordZ select 2); sleep 3; hintSilent "";
};
} forEach allMapMarkers;
I don't understand why but parseNumber _markerHalo select 1 returns an error as it needs a string as an input
you are usingstron a string, you double the quotes
parseNumber can parse "5", not ' "5" '
Ok parseNumber _markerHalo select 1 returns an error as arma think that i m trying to use array as an input
parseNumber (_markerHalo select 1);
*magic* ๐
also str is not a JS function; no need to always wrap arguments between brackets
str player / str (player) // is the same
Ok will try thanks !
Didnt get the part on js though
In JS to stringify something you would do player.toString() or Object.toString(player) for example.
Ok and i dont need the ()
only if you need it to force operation priority (like with _markerHalo select 1 where you wanted the select to happen before parseNumber)
Ok gotcha thanks
Or, a much worse suggestion, is you could use a_hash_b ๐
(Seriously though, don't)
is fine, I like it
b-but it's bad!
Why is it?
I believe the hatred towards this command is mostly due to
1/ it was not needed and came out of nowhere
2/ it "took someone" to do that instead of something else
3/ code readability
it is not bad per se , I mean the command doesn't have a performance impact or anything, it's justโฆ a cheap version of select with higher precedence, that's it
how do I turn BIS_fnc_configPath into a proper config path i.e config file >> "blah" - it's currently returning ["configFile","Cfg"]; etc.
you're curious, aren't you

using ```
_side = "west";
{ systemChat str ([_x] call BIS_fnc_configPath) } forEach ("true" configClasses (configfile >> "CfgGroups" >> _side))
in debug
I read you can have a strict param
but
it doesn't accept?
I did [_x, true] call blah
but it said error bool expect array
oh
because index 1 not 2
silly
format (2nd param) doesn't take bool yes
indeed, you got it. I was your rubber duck ๐
๐
everytime
I swear
I post and then fix myself
also any ideas on my question in #arma3_editor ? ๐ don't hurt for linking :P
literally can't find doc on it anywhere

@cosmic lichen may know
try cameraOn in the console maybe?
3/ code readability
May be the only point that make sense, although I find the hash more readable but everyone disagrees with me ยฏ\_(ใ)_/ยฏ
you're supposed to stay neutral ๐
๐๐๐
are you saying I am a quack??
I believe the hatred towards this command is mostly due to
1/ it was not needed and came out of nowhere
2/ it "took someone" to do that instead of something else
3/ code readability
it is not bad per se , I mean the command doesn't have a performance impact or anything, it's justโฆ a cheap version of select with higher precedence, that's it
tbh, i switched instantly to it.
_arr#0>_arr select 0
ooooh so that's why I have feathers on my bum

in order to cover my buttquack! ๐
oh my..
no facepalms? I am disappoint
tbh, i switched instantly to it.
another reason you are not an example to follow @jade abyss ๐
_arr param [0]
params ?
I don't think I used select for anything but positions (select 0, select 1, etc)
Nah, param with only an index provided. Because why do things the simple way. :p
_array select (parseNumber str (1-1));
https://prnt.sc/qnkmgr how do you texture these?
that textures the middle monitor
how do i texture the rest of em
it has multiple texture areas
another index of setObjectTexture?
_objectname setObjectTexture [0, "\pboname\texture.paa"];
_objectname setObjectTexture [1, "\pboname\texture2.paa"];
use https://community.bistudio.com/wiki/getObjectTextures to check the object
so the 0 and the 1 are the different screens?
that's the different index in question yes
sweet, thank you
_factions = [];
_configgroups = "true" configClasses (configfile >> "CfgGroups" >> _side);
{
_factions pushBackUnique ([_x, "", true] call BIS_fnc_configPath); // not adding element
} forEach _configgroups;
systemChat str _factions;
am I being dumb
array is empty
yes nvm
_side not defined
๐คฃ ๐ฆ
Lou makes for an excellent ducky
100%
aha
@spice axle
should be super easy to implement.
How do you know that? (Hint: its not, not at all. Commands don't know the names of variables they've been given.)
I would rather prefer = return the asssigned var, so you can doa = b = 0;but that needs changes in 3DEN too which is annoying.
any luck to have init/trigger fields to not need 0 = ... ?
exactly thats the "3DEN changes" i wrote
I hope there is a chance to fix that
does @unique sundial have a opinion on that?
Does it exist a complementary command to isNull
@runic edge please elaborate?
isNull checks if an object is absent
what would i use if an object is present
like is there a more elaborate command than !isNull ?
well nope ๐
@runic edge
https://community.bistudio.com/wiki/typeName
?
Otherwise no idea what you want, with that limited information. What are you trying to achieve, for example?
i'm trying to run a script if a certain object is present
isNull
waitUntil{!isNull certainObject};
doStuff
if(!isNull certainObject)then
{
doStuff
};```
*
No idea where the problem with isNull is/was ๐ค
was just looking if they were a command ~= !isNull
And you got it now (example above)?
if (not isNull obj) then { /* */ };
```yup
yeah kinda
waitUntil{!isNil "certainObject"};
if(!isNil "certainObject")then
if var is not set yet and will be set later*
i rather "know i cant get it" ๐
then i am completely confus0rd
it's just that i thought that they created a special function for it
for "**!**isNull"
i found more logical to test if something is present than if it's not ^^
Nah, this way around is better
not in computer's logic :p
better check that object is null (easy) instead of checking if the object "is not any of all the other types"
you will get used to it, don't worry ๐
I am currently making a database of all Items mostly because of weird (camo)variants, to help the Antistasi mod. I would like to avoid having to manually type as best as I can. For that I wanted to ask if there is any way to get a print of all the "displaynames"? I had no problem with getting the "classnames", but can't seem to find a way to export the "displaynames".
PS: I know that they shouldn't be used for any coding, I would just like to have them for easier visualization of the data if it is possible without to many hurdles. Especially as I am rather handicapped arma coding/scripting wise.
I also hope this is the right channel for asking that question.
getText configclass >> "DisplayName"
When remoteExecuting a function with JIP = true from the server before any client loads the mission, the function will not be remoteExecuted to JIP players, is this behavior excepted?
hm, weird?
Yeah, I would except it to be put in the queue (?) regardless of the amount of clients
Nop, postInit, the remoteExec was targeted with -2 and setting it to 0 fixed it
Well I don't know if the server is supposed to be a player in our case
some do```sqf
[0, -2] select isDedicated;
Ah yeah, you're right @winter rose , it was a self-hosted mission, that's why it wasn't working but while testing with self-hosted I've noticed something:
When no clients joins, ever, and if you have the target as -2, you'll never get the remoteExec as the host but as soon as another client spawns, the host and they other clients get the remoteExec
wait, so:
- exec on -2 (clients only)
- you host, nothing happens
- someone connects, they receive the remoteExec
- and you too?
Yep, me as the client/server
it is weird indeed. what did you remoteExec? hint?
(I mean, not a global effect command?)
No no, a variable, global variable so it should stay local to the client
hm ok, yes indeed
a bit weird then
unlessโฆ you did remoteExec a function which remoteExec'ed it ๐
That's the function, it's called from the ss_fnc_initServer by [] remoteExec ["this_function", -2, true] which is in postInit
systemChat format ["#changeWeapon %1", "undefined"];
_weapon = "none";
systemChat format ["#changeWeapon %1", _weapon];
call ACE_fnc_arsenal;
// Et voilร , la variable change
systemChat format ["#changeWeapon %1", _weapon];
hint "Test";
GLOBAL_VAR = 1;
Yeah in the briefing but they're not what I tested, just leftover from an example to prove that private should be used everywhere. But for the JIP client they fire twice.
And for the server/host only once, although it should also be the case for the JIP as nothing can trigger that function except the remoteExec in the serverinit
zoooโฆ weird?
maybe -2 considers ServerClient as client indeed then
But it should be executed right away then, not waiting another player to update that queue ?
if this is the case, that is what I would expect
can you try a simple:
HYX_fnc_hint3s
[] spawn { sleep 3; hint "hint3s received"; };
```and use it w/ 0 & -2 ?
e.g```sqf
remoteExec ["HYX_fnc_hint3s", -2, true];
For debugging purposes, I would pass the clientOwner along with the message, and on the receiving side output put the sender and the local clientOwner.
Wait, I think I may have put the condition the wrong way ๐
:3
Yeah that was the case, put isServer instead of !isServer ๐คฆ
๐ฆ
That explains the double runs, not why -2 caused the server to do anything
Broken clock is right twice a day ๐
3 times (occasionally) with daylight saving times
That explains the double runs, not why -2 caused the server to do anything
Yeah you're right, I'll check what else I've changed (since I cleaned the mission to be sure it was not another function causing that)
Oh well, that's embarrassing, I had the wonderful idea to put the condition after the script... I should stop thinking after 9pm, I'm not successful at that ๐
if (awake Heyoxe) then { Heyoxe moveInDriver Bed } else { doGetOut Heyoxe }; // The Arma way
stackoverflow if you loop that; you should add a ```sqf
sleep (86060);
how can i delete all ejection seats from the map with out doing nearestobjects on the whole map and lagging my server?
check the config viewer for parent class (or wiki's classes)
yeah i think that is even worse than nearest objects on performance mate.
it's "cheaper" but still impacting.
you can detect by script when someone ejects then
classes:
B_Ejection_Seat_Plane_Fighter_01_F
O_Ejection_Seat_Plane_Fighter_02_F
I_Ejection_Seat_Plane_Fighter_03_F
I_Ejection_Seat_Plane_Fighter_04_F
yeah boii
or try entities , too
(although I thought entities was only about men/animals)
ok on this wiki it says i can use this to return the results it says it will return. but i tried it and i get some thing else. i even used thier example
https://community.bistudio.com/wiki/BIS_fnc_returnParents
this is what i get [bin\config.bin/CfgVehicles/Land_FirePlace_F,true]
what am i doin wrong?
you didn't call anything?
copy/pasted their example in debug console, worked just fine
@exotic tinsel ^
HMM
I'm attempting to double incoming damage on a vehicle/tank and none of the init values I've tried appear to be having any effect. Is there best way to handle this?
you'll need to use a Damage Event Handler, and can't be done with a single line of code in the init
is that because of the damage handler and individual sections?
it's just how Arma handles damage and allows us to modify it
copy that
Theres clearItemCargo and clearItemCargoGlobal, can someone explain what the actual diffrence between them is? does clearItemCargo desync the inventory in MP? or would I just want to use global version?
NVM i just finished testing. Always use clearItemCargoGlobal in MP. clearItemCargo even when executed globally would only affect the executing client.
Is BIKI description not enough to tell the difference?
Hi, I'm having a slight trouble with functions, I wanted to use one to ease the load for a group teleportation, I have the path working, but the function viewer displays an empty function file and I can't call the function it contains. Any idea what I could've done wrong ?
Have you recompiled it after adding the code?
actually, the option to recompile isn't even available
so I reloaded the entire scenario, not much new result, it's still empty
aaaand, it just told me that the file was not found... ?
File name : CustmFunc.sqf
Editor says "fn_CustmFunc.sqf" not found
Displays : core\fn_CustmFunc.sqf
maybe I should add the prefix to the file
WTF
it worked, sounds pretty weird, but okay
Anyone know a way to make it so initServer is jip or any work arounds for that
Or any ways to exec a lot of code to the server
initPlayerServer?
@cunning crown
if (awake Heyoxe) then { Heyoxe moveInDriver Bed } else { doGetOut Heyoxe }; // The Arma way
so.. when you are awake you go to bed, and when you are asleep you leave the bed? ๐ค
Uh well, that's a prototype, things may not work as excepted ๐
while { alive Heyoxe } do {
waitUntil { sleep 45 * 60 ; getFatigue Heyoxe > 0.8 || not alive Heyoxe };
if (not alive Heyoxe) exitWith {};
Heyoxe moveInDriver bed;
Heyoxe engineOn false;
sleep 8 * 60 * 60;
Heyoxe engineOn true;
doGetOut Heyoxe; // exception on Sunday
};
syntax error, missing ; in line 6
also why only check isTired every 45 hours? I'd check every 10 minutes. maybe 30
45 min is the sleep cycle
if you miss the train, you have to take the next one
(can't find the missing ;)
if you put that into Arma, isTired is not a command :p
Lets create a wiki page anyway
(can't find the missing ; )
then you don't know arma well enough ๐
engineOne is typo, command doesn't exist -> missing semicolon error
as far as I can say, it's because there is a problem.
{
params ["_group", "_position"];
private _leader = leader _group;
{
private _dir = _leader getDir _x;
private _dist = _x distance2D _leader;
_x setPos (_position getPos [_dist, _dir]);
}
forEach units _group - [_leader];
_leader setPos (_position getPos [0, 0]);
};
//example
//[group player, [4090.231,4123.156,0]] call fnc_teleportGroup;```
That's the function, for some reasons, it's not willing to work even on a dry test
_leader setPos (_position getPos [0, 0]);
just setPos _position?
tried filling it with tons of diag_log's to see whats going on?
fnc_teleportGroup =
{
params ["_group", "_position"];
private _leader = leader _group;
{
private _dir = _leader getDir _x;
private _dist = _x distance2D _leader;
_x setPos (_position getPos [_dist, _dir]);
}
forEach units _group - [_leader];
_leader setPos (_position getPos [0, 0]);
};
//example
//[group player, [4090.231,4123.156,0]] call fnc_teleportGroup;
```(formatted)
Well, the objective is to have the player & his group to be teleported at a random start point out of 3 with his group.
I mean, it's a script made by Killzone_kid I found by looking around, I'll try to remove the [0,0] and see how it goes
anyone know why this doesn't work? ```sqf
while {"firstTask" call BIS_fnc_taskCompleted} do
I'm trying to make a script that loops when a certain task has been completed
that should return "true"
while the task is completed, do something? you sure you don't want to use waitUntil?
I have a waituntil inside the while
I don't see it
I need it to loop
that should return "true"
Have you tested in debug console whether it does?
because when that task is completed, it creates dynamic tasks that recreates when they're finished
Well the task gets completed
check
["firstTask", "SUCCEEDED", true] call BIS_fnc_taskSetState;
``` runs without a problem
BIS_fnc_taskCompleted = Returns true if task is "SUCCEEDED", "FAILED" or "CANCELED".
and ```sqf
"firstTask" call BIS_fnc_taskCompleted
what is the code before your while loop, when is it entered?
the script is run in the init automatically
I'm just using the while loop to make it check that the firstTask is completed, when it is it should just run
"while {true} do" always works
maybe the script can't gather info from the task framework somehow?
as if it doesn't know the taskID exists
private _position = [8350.96,3082.77,19.34];
private _leader = leader testgrp;
{
private _dir = _leader getDir _x;
private _dist = _x distance2D _leader;
_x setPos (_position getPos [_dist, _dir]);
}
forEach units _group - [_leader];
_leader setPos (_position getPos [0, 0]);
So, I tweaked the script and did a manual value entry, it only teleport the group leader.
try ```sqf
forEach (units _group - [_leader]);
Yeah, I just spotted it
I really am a rubber ducky ๐
nha, I'm a dum dum, this one was easy to see ^^'
so, yeah, it worked. Half the problem solved, now the issue is, why would it not work when it's a function with global parameters
Nope, not working with "[testgrp, [###,###,##]] call fnc_teleportGroup;"
@brittle dock The problem is that... eh.... You left the discord already.. uh.. okey. Bye then?
this one was easy to see ^^'
was it? what was the problem there?
Only issue i can see there is it teleporting all units, and not skipping the leader
I had forgotten to replace _group by "testgrp" as manual input
yeah. But.. the original script in a function doesn't ahve that problem ๐
so, it manually works, but doesn't work as a function for some reasons, it should, but, something gets lost somewhere
tried adding diag_log into it? log the parameters and stuff and see if it is what you expect?
then I'll ask a simple question since I never used it, do I put the diag_log at the start or the end ?
everywhere where you want to log something
just do like
diag_log [_group, _position];
after your params to see if the values are right
Mhm. Could anybody help me with a script issue?
I'm getting a generic error in expression and I can't figure out what's causing it.
Okay, thanks, that should help to find where it doesn't catch
go ahead and throw your doogles at us!
// Autokrat 1
[
autokrat1,
"Doorzoek krat",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_hack_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_hack_ca.paa",
"_this distance _target < 3 && (missionNamespace getVariable ['krat1_done', 'false'] isEqualTo 'false')",
"_caller distance _target < 3 && (missionNamespace getVariable ['krat1_done', 'false'] isEqualTo 'false')",
{},
{},
{ [{krat1_done = "true";
publicVariable "krat1_done";},"BIS_fnc_spawn",true,true] call BIS_fnc_MP;
["", "Je doorzoekt het krat, maar vind niks bijzonders"] spawn BIS_fnc_showSubtitle];
},
{},
[],
10,
0,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0,autokrat1,true];
Basically its a addaction using the holdaction. Once completed, I want the person completing it to recieve some text on screen using showSubtitles.
autokrat1 is the object and the dutch text you see is mainly the dialog I want displayed, so not completely relevant for the question.
'false'] isEqualTo 'false' why? you we have booleans, just use them?
krat1_done = "true" -> krat1_done = true
(missionNamespace getVariable ['krat1_done', 'false'] isEqualTo 'false') -> !(missionNamespace getVariable ['krat1_done', false])
[{krat1_done = "true"; publicVariable "krat1_done";},"BIS_fnc_spawn",true,true] call BIS_fnc_MP;
1st BIS_fnc_MP has been replaced by remoteExec
2nd, why are you trying to publicVariable, a variable that you already globally set using BIS_fnc_MP? you are setting it global twice.
Every player will re-set and re-publicVariable the same value and spam network traffic
Also you set isPersistent parameter to true, but.. publicVariable is already persistent, so you are not setting the variable twice, but thrice even.
I got this from a friend, and I try to refurbish it for my purposes. I didn't write this script myself.
3rd, "BIS_fnc_spawn" why call a function that just executes spawn, why not spawn directly?
Next
["", "Je doorzoekt het krat, maar vind niks bijzonders"] spawn BIS_fnc_showSubtitle];
open array, close array, spawn function, close array.
Where is the open array for the last close array bracket? Its not there
yes. That part is correct
you close an array at the end that you never opened
that errors
Oh. right.
generic error in expression --> what dedmen said, pretty much always syntax errors
i think ...
damn ... last time i actually ran code in arma was literally ages ago
Gotcha. Well. I guess that leaves the triple variable setting to resolve honestly.
pretty much always syntax errors
No. Actually not
it literally always says "generic error" so, every syntax error is a generic error. but not every generic error is a syntax error.
yup ... really has been a long time since i last saw some real arma scripting error ๐
Alright. So. having fixed most of what you said dedmen. The only thing I cannot wrap my head around all that much is the variable fuckery at [{krat1_done = "true"; publicVariable "krat1_done";},"BIS_fnc_spawn",true,true] call BIS_fnc_MP;
@tough abyss BIS_fnc_MP is obsolete; use remoteExec or remoteExecCall
what you are doing is "setting the variable to true, publicVariable it"
but you are broadcasting this effect, so it will be multiplied by the number of clients
because every single client will set this value to true and publicVariable it
Mhm. Darnit. I just want the person completing the addaction to see he found nothing. That's all.
not sure about the 2x true though.
there is no 2x true in remoteExec
make it go away
actually. That whole thing is useless, don't use either BIS_fnc_MP, nor remoteExec
just set the variable, and publicVariable it
Heard. Thank you for your time.
So, after searching into the RPT, I am now having even more questions ^^'
Error in expression <osition getPos [0, 0]);
Error in expression <"_position"];
I guess
@heavy patrol also, please use -showScriptErrors exe flag so you have errors displaying in game ๐
Thanks, that's nice to tell me that, I'm very unfamiliar with the debug tools ๐
11:18:52 EPE manager release (0|29|0)
11:18:52 Error in expression <osition getPos [0, 0]);
diag_log params;
diag_log _group;
diag_log _leader;
dia>
11:18:52 Error position: <;
diag_log _group;
diag_log _leader;
dia>
11:18:52 Error Invalid number in expression
11:18:52 File core\fn_CustmFunc.sqf [Tutorial_fnc_CustmFunc]..., line 18
11:18:53 Error in expression <osition getPos [0, 0]);
diag_log params;
diag_log _group;
diag_log _leader;
dia>
11:18:53 Error position: <;
diag_log _group;
diag_log _leader;
dia>
11:18:53 Error Invalid number in expression
11:18:53 File core\fn_CustmFunc.sqf [Tutorial_fnc_CustmFunc]..., line 18
11:21:03 EPE manager release (0|29|0)
11:21:04 Error in expression <Pos (_position getPos [_dist, _dir]);
}
diag_log forEach units _group - [_leader>
11:21:04 Error position: <diag_log forEach units _group - [_leader>
11:21:04 Error Missing ;
11:21:04 File core\fn_CustmFunc.sqf [Tutorial_fnc_CustmFunc]..., line 14
11:21:04 Error in expression <Pos (_position getPos [_dist, _dir]);
}
diag_log forEach units _group - [_leader>
11:21:04 Error position: <diag_log forEach units _group - [_leader>
11:21:04 Error Missing ;
11:21:04 File core\fn_CustmFunc.sqf [Tutorial_fnc_CustmFunc]..., line 14
11:21:25 EPE manager release (0|29|0)
11:21:25 Error in expression <Pos (_position getPos [_dist, _dir]);
}
diag_log forEach units _group - [_leader>
11:21:25 Error position: <diag_log forEach units _group - [_leader>
11:21:25 Error Missing ;
11:21:25 File core\fn_CustmFunc.sqf [Tutorial_fnc_CustmFunc]..., line 14
11:21:25 Error in expression <Pos (_position getPos [_dist, _dir]);
}
diag_log forEach units _group - [_leader>
11:21:25 Error position: <diag_log forEach units _group - [_leader>
11:21:25 Error Missing ;
11:21:25 File core\fn_CustmFunc.sqf [Tutorial_fnc_CustmFunc]..., line 14
So that's the errors, there was some "magazine issues" in between
diag_log params;
eh
you are calling the params command without any parameters.
diag_log forEach units _group
what? you can't diag_log a syntax error.. foreach is missing the code
I already told you above what/how to diag_log and linked you the wiki page ^^
Well, I checked the wiki page and kinda tried what I could ^^'
So, you're telling me that diag_log blocked the params here or it is what I guess and the parameters are just not getting filled ?
params is a command, it's like doing ```sqf
diag_log setDir
Ho, I see
Well, let's recompile all of this and see what we get
{
params ["_group", "_position"];
diag_log [_group, _position];
private _leader = leader _group;
{
private _dir = _leader getDir _x;
private _dist = _x distance2D _leader;
_x setPos (_position getPos [_dist, _dir]);
}
forEach units _group - [_leader];
_leader setPos (_position getPos [0, 0]);
diag_log [_group, _position];
};
I'm asking just in case, something like this should work or am I doing something wrong again ?
brackets after forEach
parenthesis*
Well, right now I'm confused to the highest and probably went wrong somewhere
the rpt file doesn't countain any line with the arguments
that means your function didn't get called :3
parenthesis*
I never know in English!!
Time for an EVEN MORE DRY RUN
add sand!
result?
Well well well
Warning Message: Script core\fn_CustmFunc.sqf not found
applies lube
So, the basic function file name is "CustmFunc.sqf"
But, if I do that, it says it doesn't find it, so I add the "fn_" prefix, then the function appear in the function viewer of the editor.
So, which part of all of this is wrongly done ? The define in description.ext maybe ?
because it looks like this
class CfgFunctions
{
class Tutorial
{
class core
{
file = "core";
class CustmFunc {};
};
};
};
personaly, i switched to the file= tag
class CustmFunc {file = "\pathTo\CustmFunc.sqf";};
See https://community.bistudio.com/wiki/Arma_3_Functions_Library for all the doc needed @heavy patrol
file can mean file itself, or parent directory
e.g.:
class CfgFunctions
{
class Tutorial
{
class core
{
//"Tutorial_fnc_CustmFunc"
class CustmFunc {file = "\pathTo\CustmFunc.sqf";};
//"Tutorial_fnc_AnotherCustmFunc"
class AnotherCustmFunc {file = "\another\pathTo\TotalyDifferentFileName.sqf";};
};
};
};
@heavy patrol
Well, guess I'll do that, at that point
I found that much easier to deal with
Well
*edited above
now it's not crying for "fn_" prefix when I remove it from the file
So, that's one progress
I'm confused
It sees the function. And yet it doesn't find it.
It is displayed in the function viewer
basically
so, I assume it means that the files are compiled when the scenario is started
Get in the editor, open the debug console, insert the name of the function, click exec. In the textbox below, should appear some text. Is it?
Yeah, when you start the mission it will be "compiled"
CfgFunctions more or less just does this:
MyTag_fnc_ThisIsAFunction = compileFinal preprocessFileLineNumbers "\pathTo\myFile.sqf";
(just some more steps of course)
Okay, I'm looking at something really weird in the editor... something is off
So technicaly, you could just add this to your init.sqf:
MyTag_fnc_ThisIsAFunction = compile preprocessFileLineNumbers "\pathTo\myFile.sqf";
MyTag_fnc_ThisIsAFunction would be the function then. (compile ! Instead of compileFinal)
For testing of course*
If I load another scenario and come back to the dry one, the function viewer now consider the function an "empty" file
and of course, going by the debug console gives nothing, since it's empty
Let's try
okay, is doesn't even finds it lol
let's try to put it in the root
try removing the first \
I did
๐
Hi! Quick question. Is there any way to stop compositions from bouncing around when placed with zeus in the config.cpp? I tried using init and enableSimulation false. Thank you
Ermm... not quite what was I was looking for, but thanks
enableSimulation false should work
class Object24 {side = 8; vehicle = "PowerCable_01_StraightShort_F"; rank=""; position[] = {3.18445,-3.75049,0}; dir = 269.808; init="this enableSimulation false";};
i have this for example @winter rose
is there something wrong here?
maybe enableSimulationGlobal, I don't know much about objet inits
ok i will give that a try!
@chrome violet yes it should be the global version indeed
https://community.bistudio.com/wiki/setEffectiveCommander
In multiplayer, execute globally.
Does it mean it should be remote-excuted on every client?
yes plus server
remoteExec 0 it is
interesting, yep
what happens if one uses https://community.bistudio.com/wiki/selectLeader with a unit that is not part of the left-hand group?
good question ๐
if I had to guess, I would say silently fail
another (secondary) possibility would be that the group units join the leader's group
(@ work, can't test that)
me neither, at university
uh... That might actually be interesting.
The unit on the right will become the groupLeader of the group but will not change group
but doesn't that cause further issues? like.. when the leader is not even in the group. That must cause some issues somewhere ๐
That might actually be interesting
I second this statement
(Return from the tests done with that command):
https://i.imgur.com/vMlbfiJ.png
playersNumber?
Alt-tabed
Not sure what exactly is going on from that view, would you be so kind to further explain?
Well unit1 is in group2, and player in group1, I've executed the selectLeader on the group2 and it sets the player as the leader (as excepted) BUT the player is not in the group2. he's still in his group and the leader of group1 and group2
but you can't give orders ๐
No, and I can even set a unit from group2 as the leader of group1 which has the leader for group2 etc. ๐
Sooo
Literally bugged but kinda working
works as not expected ๐
Should probably be added to biki as Note
will do
Maybe should add a simple safety check into that. but then, why would you ever need to pass the group to the command.
If the group can be read from the unit
triple indeed
what if either the group or the unit is null?
stop asking weird questions! ๐
it is important for sqf-vm ๐ฆ
If the group/unit is null before the selectLeader exec, nothing seems to happen; if you delete the leader after he has been selected as one, leader (group ...) returns <NULL-object>
leader (group ...) will return null only when the deleted unit is leader of a group it is not in
Okay, we need notes in the biki
looking for me?
More for anybody with access and a pc at hands
so if you select an unit which does not exist, you expect something? ๐ค
Yes, some Script error or Warning
For dead units, objNull is returned.
Could addFor non-existing units, null is returned
so:
An invalid combination can be provided to this command, e.g unitName not being part of group. In that case:
- ''unitName_ will be [[leader]] of group, but will not be able to command them
- once unitName killed, [[leader]] of group will be [[objNull]] and will not automatically be reassigned.
correct?
Question now is... Is it actually ever automatically reassigned?
What if multiple units are Inside the Groups
moar testing indeed plz
Doesn't seem to be reassigned, also, if an unite which is not part of the group is the leader, none of the 2 units will be able to command the group
Makes me wonder ๐ค๐ค what effect does this have to Formations?
https://community.bistudio.com/wiki/selectLeader
note added, will be adapted when more details arise
The group follows the leader which was inside the group, the same unit as formationLeader I guess?
Ohh, when you have a group with 2 or more units, and the leader is not part of that group HH:MM:SS Join to another group will be spammed non-stop in the log
So it is a Bug ๐ ๐
I feel like we just opened Pandora's box ๐
so wrong channel ๐คฃ #arma3_feedback_tracker
So it is a Bug ๐ ๐
a feature*
Maybe I should give bi my sqfvm Test Cases So they can actually test their Code
talk about adding insult to the injury x)
For theese pitfalls
๐ ๐
Though... Kinda useless as sqf-vms goal is to emulate the arma Environment
so it should also be broken in sqfvm
one question, will SQF-VM support BIS_fnc functions?
I suppose "yes as it will compile'em"
you mean it can't read fncs directly into config & pbo??!?
Nope, nรถ pbo Reader yet in sqf-vm
But it can obviously read Config and sqf Code ๐ ๐
soon it will parse p3d and you will include your own 3D engine ๐
it will be Arma 3 Free ๐
๐ ๐ and in slow and without actual simulation and, and, and
Plus I need like a shitton of Developers to pull that Trick off
but you can multithread it properly ๐
Yeah, the objects are still colliding with each other and fly everywhere when I place them on a slope with zeus. Tried enableSimulationGlobal false, enableSimulation false, enableDynamicSimulation false, even [this] call BIS_fnc_replaceWithSimpleObject.
@chrome violet again, I don't know a lot about Zeus configs but are you sure that
init="this enableSimulation false" is valid in the object, and are you sure the parameter is this?
are these commands/initfields called when placing compositions with Zeus?
because maybe init="this setDamage 1" doesn't work either, and it is not a command issue
Hey do any of you smart peeps know if directional signals are possible with the basic (vanilla) spectrum device api and if so can give me some pointers on how to achieve that 
I am doing this in a mod config.cpp @winter rose and @jade abyss . Trying to apply this to objects in CfgGroups, Empty
I also think that the init line is not read when it loads
maybe objects in composition groups can't be manipulated by init lines?
No clue, tbh. Never touched them.
No probs, thanks for trying
It wont help but in my group we made a structure mod and run around this problem by simply having the Zeus adding them after popping the composition. Plus Eden provides some cool features that are not available to a Zeus and you can make your mods work there too and have your Zeus preparing their missions there !
something like
_arr = [[0,1]];
_a = param[0][1]; // 1
wasn't possible, right?
thats syntax error
_arr # 0 # 1 ?
Yeah, except multiselect/#.
params of param yes x)
meh, no then
_nObject = nearestObject [_unit, "man"]; can and will return snakes and rabbits... the more you know
yes ๐ CAManBase is the root for people I think
solid thatnks, i was just having a laugh when i realized i had been moving around a random snake
Welcome to Arma! ๐
also, im trying to move this object "_ghost" one step away from the unit _nObject, but it seems to just disappear
probably teleported somewhere where it shouldn't
but when executed on the player, it works fine
_ghost setposATL (_ghost getRelPos [1, ([_ghost, _nObject] call BIS_fnc_dirTo)-180]);
iirc, BIS_fnc_dirTo can be replaced with getDir alternate Syntax
An alternative syntax was added that gets heading from one object or position to another object or position, the engine equivalent of BIS_fnc_dirTo.```
just saying
alright
i was told once by someone to use calls, and then i get told to not use calls
attachTo?
UserTexture1m_F seems to be an invisible object, so would make sense it "disapears"
Who told you not to use calls? ๐ค
it's invisible if you dont assign a texture to it
the object needs to be able to move on it's own or be further away but not any closer
i know im doing some logical error here, but i dont understand why the object either flips or goes somewhere
constantly systemchat the pos?
currently, for testing i have this running on a loop
_ghost setposATL (_ghost getRelPos [1, ([_ghost, _nObject] call BIS_fnc_dirTo)-180]);
};
AGS=ATL?
Array - format [x,y,z], where z is land surface in format PositionAGL
https://community.bistudio.com/wiki/Position#PositionAGL
on land, AGL=ATL
ASL โ Presumably โAbove Sea Levelโ ATL โ Presumably โAbove Terrain Levelโ ASLW โ Presumably โAbove Sea Level inc. Wavesโ AGL โ Presumably โAbove Generic/Ground Levelโ AGLS โ Presumably โAbove Generic/Ground Level inc. Surfacesโ
if standing on someting !=
As mentioned before: Systemchat the poos of the ghost obj and compare with yours
Not really what i was looking for
ok, so now it's being super weird
ok...
it doesnt like me changing the direction it's facing
Hm what does the Activation 'Game Logic' for a trigger mean? As in what does that actually do?
I think it is when a GameLogic reaches a (synchronised) waypoint @oblique arrow
oki
now i know why
getDir returns an absolute direction
azimuth
but getrealpos wants a relation direction
this is so stupid
so i need to use getRelDir instead
also, why is it that when i set an RVMAT using setObjectMaterial i need to completely close down the game and reload it if i want changes in that rvmat to take effect?
Cache I guess? You can change the name on each change as a workaround
and i tried this. i even DELETED the rvmat in question
geez, alright, sounds reasonable
is there a way to disable caching?
I don't think so, I've always did texture_XX and incremented by one each time ยฏ_(ใ)_/ยฏ
๐ alrighty
looks like that's what it has got to be
seems like a really bothersome thing considering the game can load the rvmats pretty much on the fly
why cache them
cuz cache faster
yeah, i went from 120fps to 120fps
but this workaround seems good enough
just have to define my rvmats
i wonder if i can use keyframes to do 2d animations in arma
or are they only for positional stuff
i bet they made that drone checkpoint in Old Man with keyframes
UV animations in rvmat are also a thing
question regarding Wind direction in ACE; is wind direction always the same across the entire map? It doesn't change from pos to pos?
thanks @still forum that answers my question
So, this is my first time actually working on a script, anyone know how to change it so it allows the particles to spawn near the player? Because as it currently stands, they won't spawn within 10-15 meters of the player. https://gyazo.com/b5fc49f855d6d5c0d64dfeb5884e5a3f
Generally, pasting the code with the sqf tag, or a link to a pastebin, is preferable to a screenshot of your code
Yeah sorry man, didn't even write this, I'm just reworking it to work for a mission I'm making. How would one do either of those?
```sqf
/* your code */
hint "Hello There";
```
โฌ๏ธ
/* your code */
hint "Hello There";
yeah I don't know why this doesn't work ๐
I don't know much about particle sources, but if I had to guess it's the position parameter of setParticleParams or the positionVar parameter of setParticleRandom
If at first you don't succeed
Ah found the issue, the * was not escaped so Discord formating was lost ยฏ_(ใ)_/ยฏ
oooooooooh
