#arma3_scripting
1 messages · Page 497 of 1
What are we talking about speed wise?
well ideally double
but 0 difference in arma land
just less backlog inside extdb end
closed the game, deleted the table, checked back 5 minutes later and found the table had 20MB because still being written to.
@torn juniper
I wrote this a while ago to check if players are not close to a position to do some spawning/despawning.
private _pos = param [0,[0,0,0],[[[0],[0],[0]],[[0],[0]]]];
private _radius = param [1,3000,[0]];
if (_pos isEqualTo [0,0,0]) then {diag_log "fn_check_player_distance.sqf - WARNING - no center coordinates provided!"};
private _all_headless_clients = entities "HeadlessClient_F";
private _real_players = allPlayers - _all_headless_clients;
private _return = true;
{
private _distance = _pos distance2D (getpos _x);
if (_distance < _radius) exitWith {_return = false};
} forEach _real_players;
_return
I don't call that often and it seems reasonably quick thing to do.
The database has to be crawling to have any backlog, what does one have to do to it?
@waxen tide thanks 😃
Basically making a custom trigger for each location, rather than 60+ triggers all checking themselves as I don't need instant results
just checking over them every little bit
"custom trigger" ?
if you have an array with all your locations and an array with all your players, checking the distance between all of them is really fast if you just do distance2D between them.
inAreaArray :u
Lol.
🙏 inAreaArray, but yes @high marsh instead of a trigger activating when a player enters X location I will just have a HC monitoring all locations for new players on a random delay since I don't need anything fast/accurate just handled in a way with the least impact on the server
maybe i should change that.
Yes, I was under the impression you were already using inAreaArray by your description. So that's what confused me, cool stuff. Glad you got it working.
😄
is there any way to do a smoother version of progressSetPosition that doesn't look like the bar is just jumping to the next value instead of sliding to the next value?
The only thing that comes to my mind is to have more values inbetween
yeah, i tried this:
for "_i" from 0 to 1 step 0.05 do {
_bar progressSetPosition _i;
sleep 0.1;
};```
and its pretty close
but i still notice it, guess i just have to sleep shorter times
When scripting do the pros write it the long way at first then optimize the code later?
or use perframe
I am not a pro but I try to optimize it as early as possible but sometimes when I am testing things I just write it dirty
@carmine abyss Make it work, and then make it fast. If you can do both at the same time, great. If not, better to optimize working code than to write fast code that doesn't work.
Thank you that's the answer I was looking for.
Is there a way to make vehicles hot for FLIR via script?
https://community.bistudio.com/wiki/engineOn turn the vehicle on and it should heat up by itself
What's the source of the light?
how can i check whether a unit is remote controlled by zeus?
hmm cant find either
hm thanks. although that did not seem to work for that guy. will try it out
could i check for isPlayer and whether the unit is in playable units?
so true and false would mean remote controlled?
although... remote controlled units dont seem to be in allPlayers. not sure if isPlayer would work then
yawns
I am slowly... sloooowly figuring out how I want/can integrate JSBSim for missile/bomb dynamics in Arma...
like 5 years later...
😛
@tame lion probably scheduled scripts fault. Your Sleep 0.1 might take between 0.1 seconds and a couple hours.
Soooo.... Yeah.. It will lag if you keep using scheduled.
@simple solstice yes. https://github.com/acemod/ACE3/blob/master/addons/map/functions/fnc_determineMapLight.sqf roughly.
A wild Nou reappears out of the ether.
@tame lion
_bar progressSetPosition _i;
sleep 0.1;
This won't work if you want continuous progress, only visible steps.
To make it smooth you need to stick to frames/ticks. Example by using CBA: https://github.com/10Dozen/dzn_EJAM/blob/master/Source/Script/functions/fnc_uiShowProgressBar.sqf
If you don't want to use CBA you can try https://community.bistudio.com/wiki/BIS_fnc_loop with timerType frames
can you use variables such as pixelW/pixelH inside of a script rather than inside of a gui config? I.e. ctrlSetPosition _x * pixelW
ah i thought they may have been global variables. Not quite sure how those all work yet lol. sticking with my pretty underscores 😛
i should be able to copy paste server side sqf functions out of mission and into intercept sqf blocks in registered functions, then throw easylogging++ performance monitoring on each of those c++ functions to get full performance logging of each sqf function right?
into intercept sqf blocks in registered functions why though? That's kinda dumb
and will kill your performance
better would be to just sqf::call(sqf::get_variable... your function by your old name
which is essentially just calling the func in unscheduled. Which you can already do in just normal SQF
we have a lot of codebase run scheduled
You could make a registered function call wrapper.
callInstrument My_fnc_function;
Where in intercept side you do
callInstrument(game_value func)
_StartTime = stuff;
auto result = sqf::call(func);
_endTime = stuff;
<do logging stuff here>
return result
into intercept sqf blocks in registered functions
But intercepts sqf::call is not that good for performance.
SQF->Intercept is as fast as it can get.
Intercept->SQF is rather slow (still very fast, but not fast enough for me)
mmmm
becti is big sprawling codebase and trying to track down performance bottlenecks that we only really see in live games with lots of people
Also if that code has to be scheduled. Then moving it to unscheduled will probably not work
yea
Intercept is entirely unscheduled. Unless you go into the REALLY advanced territory
mmm
Sounds like what you are trying to do is essentially what my profiler is already doing.
Which just won't work for scheduled. You'll get nonsense readings if you try to do that.
Though.. Again. unless you move to very advanced code, which I couldn't be bothered to do yet as it's too much work for too little result
what happens if u call intercept func from scheduled code?
Same as any script commands
it executes. And when it's done the script continues (or exits if it's over the 3ms limit)
think itd be worthless to call an intercept function at beginning and end of complex scripts that log to a thread safe datatype in intercepts then have background thread log that to file?
i want more to monitor debug if some scheduled stuff is going haywire
if the scheduled scripts happens to suspend in the middle of it. You'll measure a runtime of several seconds or even minutes.
Even if the script in total just takes a couple milliseconds to run
mmm
k
thats fine
you mean jusy what it tells me
that wouldnt have much overhead would it?
i guess i can just try it and see if its worthless
yeah. Overhead wise that's neglible. Especially in scheduled scripts
codebase is goofy enough and big enough its hard to even guess logic flow and when things are going
withouy shittons of time
hoping maybe i can reggex output and notice stuff
https://github.com/RSpeekenbrink/ArmA-3-BECTI this thing?
Make a PR and fix the bad stuff 😄
Wow. I randomly click into the repo. And the first function I hit is already garbage
deleteAt doesn't care about what type the value is that you are removing
Never heard about that problem. Never had it either
Ight i am struggling here lol. So i am making a little custom gui that shows ammo,currently selected type etc etc. I want it ti be in a different location if _x is true, well i have been testing that _x is true, and when using ctrlSetPosition and ctrlCommit, I can see the ammo count fly off into space at the distance increments at set, and my current ammo selected rsc goes up the screen every time I press F. This leads me to believe that the code is being re ran each time it is updated.
tl;dr, How can i isolate a block of code to run once inside of a script that is constantly checked
@wide hamlet set a global variable after you ran the code. And check if it's set before you run it
if (ctrlShown _weaponControl) then {
if (_weaponType isEqualTo 3) then {
_pos1 = ctrlPosition _weaponControl;
_weaponControl ctrlSetPosition [(_pos1 select 0),(_pos1 select 1) - 0.2];
_weaponlControl ctrlCommit 0;
_pos2 = ctrlPosition _muControl;
_muControl ctrlSetPosition [(_pos2 select 0),(_pos2 select 1) - 0.2];
_muControl ctrlCommit 0;
};
Yeet = 1;
};
};```
ish?
yes. Like that. Make sure that Yeet is defined beforehand somewhere. Else it will be nil and error out.
Btw.. You know that you can use && to combine if's so that you don't have to nest them?
yea. More so getting it to work rn and ill optimize later
hmm...weird
How does intercept sync with global scripts simulation?
what do you mean "sync"?
Race condition
it doesn't
intercept is unscheduled. Like any other unscheduled script
no race conditions
So theoretically you could crash requesting the same resource ?
Dunno something game engine is using at the time you run your script that uses it too
Well. As I said. Intercept is unscheduled. And runs in mainthread like any other script
Make sure that Yeet is defined beforehand somewhere Im assuming you meant in a different file/script?
not necessarily. Just have it be defined. Else you wanna use isNil
If you mean self-registered SQF commands. They work exactly like other sqf commands.
If you mean intercept eventhandlers. They work exactly like other eventhandlers.
I don't know what else you could mean
might use isNil then. Because it was getting reset back to what i defined it to for whatever reason
So it never crashed on you?
Tons of times.
All of them while working on a new feature and misstyping something or making a logical mistake
Like I said. I don't know what you mean. There are no race conditions. There are no races
You are all driving on a single-lane-road.
you can't overtake
exactly the same as unscheduled scripts
You are calling game functions from different thread than arma, are you not?
no
Oh
You could if you wanted to. But then you need to make sure to synchronize with main thread by yourself.
Essentially freeze main thread while you execute, and unfreeze when done, which is really inefficient and essentially makes the seperate thread kinda useless
im using a seperate thread for polling and mysql connections
on Linux you could potentially run some SQF commands from a seperate thread without problems.
But only commands that don't change any state. And only on Linux (because the malloc there can multithread)
But what's the point of calling stuff like splitString or arrayIntersect or selectRandom's SQF commands if you could just use the C++ equivalent
i hate sqf
why doesn't arma have something like a multithreaded scripting environment which runs asyncronous on another cpu core?
because you'd have to make sure that you don't touch anything that any script could be touching right now
which will hurt performance way more, than just running scripts in main thread
sounds dangerous and hard
yeah how about you ignore that and leave that up to the scripter to worry about?
Yeah. How about you just let everyone crash the game and they say it's their fault
fun right?
why put a handle on a pot?
Also the scripter cannot detect such stuff
i mean say you're reading config data, or look for objects on the map, stuff like that. you're reading data, not changing it, that could be async to anything else happening.
Like. What are the main things that run next to script stuff.
Simulation (scripts can change positions and animations anytime), Sound (script can start/stop sounds anytime), Graphics drawing (scripts can spawn/delete models, start/stop particle effects, change textures anytime), Networking (scripts can remoteExec stuff anytime, or change positions, or start/stop sounds, or spawn/delete models, or change textures, or start/stop particle effects, or change animations anytime)
yeah. You could async read config data. Or read object data (as long as simulation or networking is not currently running)
yeah but what if you're not doing anything like that?
You cannot check what the engine currently does.
So how would you prevent to do anything like that while the engine does it's stuff?
I already have a Intercept lib for async config scanning in a seperate thread. That works fine
And you also cannot do it because the scriptings memory allocator is not thread-able. On windows.
F-ton of work. For almost no useful result
well trivially simple. sort all script commands into two categories, ones that mess with stuff and ones that don't. add a command for spawning a script thread, like spawnthreaded "something.sqf"; and inside that new environment all the script commands that mess with stuff aren't allowed.
non-threadable memory allocator on windows?
that's fancy enough of an explaination
accepts it
Well you could replace that malloc. And make everything slower.. But....
Apparently I'm a pristine german-ist
Let's learn russian
Wow wtf.. The first lesson starts with me having to know russian words already :U
How good that I know them.
i gave up learning russian at like 100 words
but my finnish swearing is excellent. EI VITTU HELEVETTI, SAATANA PERKELE!
Yes. Yes yes. indeed.
Can I check if unit is detected by other unit's sensors ?
That’s a group knowledge
Yes and?
Well
As far as I understand it. If both units, even if not in the same group have datasharing enabled. It would still be added to it's knowsAbout stuff
Hmm, but the knowsAbout will change if unit is out of sensor range ?
Could someone proof read this for me? ```sqf
private _side = [
west,
east,
independent
];
private _sector = [
LZConnor
];
{
_side = _x;
{
private _varSTR = "isOwner" + (str _sector) + (str _side);
missionNamespace setVariable [_varSTR, true];
[
_x,
_side
] call BIS_fnc_moduleSector;
} forEach _sector;
} forEach _side;
if (isOwnerLZConnorwest) then {
WZeus addCuratorEditingArea [1,LZConnor,100];
EZeus removeCuratorEditingArea 1;
IZeus removeCuratorEditingArea 1;
};
if (isOwnerLZConnoreast) then {
WZeus removeCuratorEditingArea 1;
EZeus addCuratorEditingArea [1,LZConnor,100];
IZeus removeCuratorEditingArea 1;
};
if (isOwnerLZConnorindependent) then {
WZeus removeCuratorEditingArea 1;
EZeus removeCuratorEditingArea 1;
IZeus addCuratorEditingArea [1,LZConnor,100];
};```
missing private
missing tags for your isOwner stuff, although it's so specific that it's not really needed.
_var = missionNamespace setVariable That's nonsense.
_var = [ that's nonsense too.
] BIS_fnc_moduleSector; missing a call or spawn
You mean _side = _x?
Your bunch of If's contain alot of duplicate code. While only a single variable changes.
You could just set the variable in the if's and move all the duplicate code out of there
Ah no you can't. Missunderstood that code. Though you are setting all variables to true. Why do you check for them then?
+_side won't work. STRING+SIDE is invalid.
looks like you want + (str _side)
your useless _var's are still in there you never use them. They are useless.
Sorted
(str _sector) will only work if LZConnor's vehicleVarName is "LZConnor"
if it's editor placed. Then it will be
Sorted the if statements to be true to how I want them done. The initial was testing
LZConnor is the Sector Module Variable.
still you are setting all the variables to true. Why do you need to check that they are true?
In the screenshot. It's all done through the editor, which is fine. I'd rather have the trigger checks / anything done when a side captures the sector, in script.
private _varSTR = "isOwner" + (str _sector) + (str _side);
missionNamespace setVariable [_varSTR, true];
You are STILL setting the variables to true. Setting it to true again in a trigger won't really change anything?
I'm bypassing the trigger. If the script works, the trigger is not needed.
But I want the script to do the same thing as the trigger, so that it's one less thing to place down.. well 3.
would this work? sqf _CheckIfSideHoldsSector =[ _x, _side ] call BIS_fnc_moduleSector; private _varSTR = "isOwner" + _sector + (str _side); missionNamespace setVariable [_varSTR, _CheckIfSideHoldsSector];
no idea what that returns
it;s a boolean
yes
but no idea what it is
according to wiki it's a setter function. I don't know what boolean a setter would return
it shouldn't return a bool
Can be also used to get sector parameters.
--- Set sector owner ---
Parameter(s):
0: OBJECT - sector module
1: SIDE
Returns:
BOOL```
Can be also used to get sector parameters. where did you get that from? that's not on wiki
No...
/*
Description:
Initialize a sector module. Can be also used to get sector parameters.
--- Get all sectors ---
Parameter(s):
0: BOOL
Returns:
ARRAY of OBJECTs
--- Get number of sectors held by a side ---
Parameter(s):
0: SIDE
Returns:
NUMBER - number of sectors owned by the side
--- Set sector owner ---
Parameter(s):
0: OBJECT - sector module
1: SIDE
Returns:
BOOL
--- Initialize ---
Parameter(s):
0: OBJECT - sector module
Returns:
NOTHING
*/```
setting the sector to a new owner. Doesn't really check who owns the sector.
True.
Though after you call that. _side will definitely own the sector. As you've just set it
Hmm. I'll just stick with the trigger. lol
Would this work? ```sqf
[] spawn {
while {true} do {
#include 'sectors/LZConnor.sqf'
};
};
LZConnor.sqf:
if (isOwnerLZConnorwest) then {
WZeus addCuratorEditingArea [1,LZConnor_Sector,50];
EZeus removeCuratorEditingArea 1;
IZeus removeCuratorEditingArea 1;
};
if (isOwnerLZConnoreast) then {
WZeus removeCuratorEditingArea 1;
EZeus addCuratorEditingArea [1,LZConnor_Sector,50];
IZeus removeCuratorEditingArea 1;
};
if (isOwnerLZConnorindependent) then {
WZeus removeCuratorEditingArea 1;
EZeus removeCuratorEditingArea 1;
IZeus addCuratorEditingArea [1,LZConnor_Sector,50];
};```
Yes. Of course 😃
and constantly removing/adding areas even though they were already removed/added seems like a waste
hmm
Hi guys. I don't know if this question has been asked a million times before, but I couldn't find a solution yet. I try to display a live camera feed on a texture surface (a billboard in this case). As you can see in the video, as soon as I go to distances over 50m the rendered picture is blurred by mist or fog. When I run the same camera movement as cutscene, the view is totally clear - exactly like I want it to be. My video settings are maxed out but still fog wenn rendering the feed to a texture. Here's the video: https://www.youtube.com/watch?v=kow-asNziN4
And your PiP settings?
@mental dawn This depends on PiP settings, and to be clear R2T will always have some grain effects, the bigger the surface - the lower the "quality".
@unborn ether Yeah I'm aware of that. But it is not a grain effect. Its fog or better mist that rapidly increases in density with the distance of the camera from the camera target. When I use distances up to 50m the picture is almost clear. (good enough at least)
why would you watch the tv at 50 meters 🤔
No, the camera is supposed to be a uav that circles a couple of dozens of metres above the camera target. The distance between the camera and the target object is the problem. Camera >50m away from target -> fog
Ahh. I thought it's the distance between you and the screen. Because you didn't walk forwards/backwards in the video 😄
Sadly yes, thats exactly what I mean. That issue I also found when researching the problem ...😞
Well. It's a bug then that cannot be fixed ¯_(ツ)_/¯
Why do you come here and ask if you know that it's a bug?
Because I'm sure there can be ways around it. There is a mod that deals with this issueso I thought it can be dealt with within my script. https://forums.bohemia.net/forums/topic/213341-lowlands-warrior-enhanced-pip-viewdistance/ (I will contact the author of the mod later this day, he's not online at the moment)
Maybe he sees it? 😊
It's a config mod yeah. You can just unpack the pbo and look at it yourself
50m is way too low your PiP must be set at “rubbish”
its set at 12000
There is no such setting
if you have enhanced video settings, or that mod by Crielaard then there is such setting
If you come asking why my modded game doesn’t work then the answer is pretty obvious
The video doesn’t show the PiP setting
So 🤷♂️
Ah yeah, difficult to see on mobile, and yeah 12000 well, good luck with that
I maxed all video setting to checkif I can influence the rendering of the fog - but no change.
@mental dawn Are you using camCreate as your R2T source?
yes
Didn't try it before, but try using camCommitPrepared (along with any prepare) commands. Just as test.
I've tried.
Hello guys _unit = _this select 0; _animation = _this select 1; while {alive _unit} do { _unit switchMove _animation; waitUntil {animationState _unit != _animation}; };
Where in this script is my unit variable defined?
any help would be appreciated
_unit = _this select 0;
Yeah rgr I tried that first changed _unit to _officer the variable of my AI unit being officer
Trying this instead while {alive officer} do { officer playMoveNow "Acts_A_M05_briefing"; sleep 1; waitUntil {animationstate officer != "Acts_A_M05_briefing"}; };
Na did not work this animation just doesn't wanna loop
is there a version of drawPolygon that returns something like a marker object?
Returns? What do you mean by that
@long glacier I think you will need to use an event handler to capture the end of the animation https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#AnimDone
@tough abyss a way to store the polygon as an object
i know i could simply store it as the points but i wont have access to what i just draw
You can’t, you can store points in array, that’s it
too bad... :(, unfortunately arma does not offer triangle map markers...
Of course it does
anything real and not the icon marker?
You can find them in 3DEN
Seeing you guys talk reminds me of M47 Dragon
You mean a triangle area?
You can draw triangle with, well, drawTriangle and set texture of a marker on it
would lead me to the same problem as early because i will not have anything as return
i think it even uses draw polygon?
It doesn’t use draw polygon
It draws triangles
And paints them
Not quite sure what this has to do with returning something, it is a draw command, it draws
I’m sure a separate data type like Polygon would have allowed for some fancy map drawings, but Arma gods decided against it
need help so i've converted a mp4 video to ogv. i've set it up a tv where it plays that video straight away, but i want it to play it on the tv via trigger so far in the video.sqf i have this in there
this addAction ["Allumer la télé", "video.sqf"];
Script à mettre dans le fichier video.sqf:
scopeName "main6";
while{true}do{
tv setobjecttexture [0,"video.ogv"];
["video.ogv",[10,10]] spawn bis_fnc_playvideo;
sleep duréedevotrevideo+1;
if (!alive TV) then {
breakTo "main6";
};
};
ignore the french, im not french i just found a french video lol...
@tough abyss thanks a lot, i smell lots of workaround todo
@heavy garden and your problem with that stuff is?
it works i just want it to work via trigger...
instead of straight away after previewing the mission...
move the code into a trigger then
Workaround is always better than not being able to do it period
Can’t 🛏 💤 in trigger
No need to sleep then, call function it will stall the “thread” until video is finished
if (!alive TV) then {
breakTo "main6";
};
that's kinda dumb too. That should just be the condition of the while loop
dumbness party! utz utz utz 🎉
i'll break it down and put that code in the condition field lol
im not the guy who made that script just some frenchperson lel
French? 🏳
yes the snail eating surrender monkeys
nuu don't eat our alganthu
You are using it, I find it funnier
Hi guys,i´ve made a new desing of the inventory dialog and i wanted to know how can i mantain the init of the inventory (adding items to vest, uniform... etc)
With this onLoad="['onLoad',_this,'RscDisplayInventory','IGUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')"; I can load the player name, rank and some other things but inventory itself
Inventory is engine driven UI, you can mod it but if you want to make scripted alternative this will be a massive project
What does it mean?
I loaded into GUI Editor the RscDisplayInventory dialog
And modified it
Then exported it
So you changed pbo?
Without adding new controls or functionality
I don’t understand what exported means
Did you modify pbo?
Am nope
Did you make a mod?
I know what you mean
No, i created a mission and imported the dialog
But i need to modify the pbo overwriting it, right?
That won’t work
It is engine driven, engine doesn’t know anything about the dialog you made
I don´t know if it can be done but if I take the ui_f.pbo -> change it -> load it?
That is one way of doing it if you want to play solo
Then you are in the wrong channel #arma3_config is what you want
Hello here. Is it possible to remove specific item/weapon/magazine/ammo from GroundWeaponHolder?
Without clear and add one by one
Ok, thank you I´m going to ask there
@tough abyss
Fffffffuuuuuuu
thank you.
Hello
i'd like to give orientation (setDir) to Unit1 so he looks at Unit2 whatever the location I give to Unit1
setDir. getDir. @quartz coyote
get dir from unit1 to unit2. And turn unit1 so it looks in that dir
Unit1 setDir (unit1 getDir unit2)
what happens to _x if have to nested forEach loops?
same as any local variable if you use private
have you guys ever managed to script ai aircraft to behave in an intelligent manner when taxiing on the ground from the airport apron to runway without crashing into a tree?
whenever ai aircraft are spawned on the ground they are useless and do almost everything wrong in terms of aircraft ground movement
Anyone familiar with RSC Dialogs? I have my defines.hpp, dialogs.hpp both #include "defines.hpp" and "dialogs.hpp" in my desc.ext. When I call the dialog my mouse is available but I dont see any windows or buttons.
Not tested, but maybe try setDriveOnPath @unreal cave
driveonpath eh?
thats a new function to me ima explore it
dont see any results for it on BI website
coolio
i want it do it naturally though
would i have to specify markers for the entire taxiway?
Kinda, but it might not even work
Answer to my question is changed Position Type to Safezone
Right now i've got
if ("SmokeShellRed" in Magazines Player) then { _detec = Detective;
if(name player == name _detec) then {
_detec = ["TaskSucceeded",["TRAITOR!","TRAITOR!"]] call BIS_fnc_showNotification;
};};
I'm trying to get only the person named "Detective" to receive the message
continuing from #arma3_editor
Just post your script. You are starting to violate #rules 9 already ^^ Which I tried to prevent
_hasBlue = "SmokeShellBlue" in magazines player;
sorry i don't post often in here i just watch pretty screenshots of people
Is that what you're looking for?
well i've got that part figured out, I'm trying to get the message to work. I need some sort of message to be send to only 1 person named detective in the editor ( so with the variable name detective ) IF the person inside has a specific smoke color
so lets say person A walks in with red smoke it will send a message to ONLY the detective saying "red smoke detected"
if person B does the same with green it will do it for green smoke
name player == name _detec && local _detec
for that thing to work. The trigger has to run everywhere. aka not a server-side only trigger
right i'm very new to this i'm just trying to create my first mission, So i apologize in advance for any noobish behavior.
So i'd need to name the detective first and then execute it on him?
not execute it on him no
_detec = Detective you already have that? I assume Detective is the detective? And there's only one?
oke last attempt at me doing something right
_detec = Detective;
if(name player == name _detec && local _detec) then {
_detec = ["TaskSucceeded",["Innocent!","Innocent!"]] call BIS_fnc_showNotification;
};
like that?
and you don't need to check if local if all you are doing is showing notif
Unless showNotification has local effects
Which I imagine it does, filling blank UI element with text.
If you'd have read what we wrote about further up.
You'd know that he does indeed need it
He wants trigger fired for player that is detective and wants notification displayed to player, right?
Reading is obviously a challenge.
trigger already fires fine. But message is displayed to everyone. He only wants detective to see it
thus local _detec so it will only show on Detective's machine
Player is already local so no need to check detective for locality is detective is player
hallo. does anyone know how boundingbox works?
Some puzzles on this channel I am telling ya
are the returned coordinates relative to the boundingcenter?

Yes
ah cool. thanks. but the boundingcenter is not equal to the object position is it?
It could be
only in a 2 dimensional object i would guess?
otherwise it should be above ground, no?
Right so the script i just send works, However instead of announcing the person's smoke color that is in the trigger it announces the color the detective has on him
orah well some objects are somewher in the ground....
So you want message displayed for detective or any player with specific smoke grenade?
only the detective should receive the message
but he should get hinted what color smoke the person INSIDE the trigger has not what the detective has on him
And if there are more than one person inside the trigger?
doesn't matter i'm making a rule so they don't do that, And i have 3 triggers running for the 3 "roles" there are seperatly
so it will just resend the message
So a person with smoke grenade walks onto a trigger and you show detective message with the colour of the grenade?
yes
Any smoke grenade?
So different trigger for different colour?
thats what i've done so far yes
however if lets say person with red smoke walks into the trigger and i hold a blue smoke. the hint will only display that i have a blue smoke not that the person inside has a red smoke
Then do what I said just add check for grenade
_detec = Detective;
if(name player == name _detec && local _detec) then {
_detec = ["TaskSucceeded",["Innocent!","Innocent!"]] call BIS_fnc_showNotification;
};
thats what i've done so far and it returns what the detective is holding not what the person inside the trigger is holding
oh wait thats not the complete script
hold up
if ("SmokeShellRed" in Magazines Player) then { _detec = Detective;
if(name player == name _detec && local _detec) then {
_detec = ["TaskSucceeded",["TRAITOR!","TRAITOR!"]] call BIS_fnc_showNotification;
};};
thats my script right now
if ("SmokeShellRed" in magazines player) then {
["TaskSucceeded",["TRAITOR!","TRAITOR!"]] remoteExec ["BIS_fnc_showNotification", Detective];
;};
0-0.
No
Player might be outside the trigger unless trigger is synced to player
Best check if grenade is in magazines of the entity that tripped the trigger
how'd i do that? doesn't my script already do that?
i tried this before as well
if ("SmokeShellRed" in Magazines Player) then { hint format ["TRAITOR TRAITOR TRAITOR",Detective];
} foreach thisList;
that didn't work either
is that last part the part you're hinting at?
Because you are checking for smoke in player magazines
oooh not the person INSIDE the trigger but ALL players
Not for smoke in unit that tripped trigger
my first script worked then but it was searching in the wrong inventory?
Yeah all players, 1 player owner on each pc
oke now the stupid question, How'd i fix this 😛
You could sync trigger to player so it fires only on the machine where the owner of that pc walks into trigger
And do what Dedmen said or if you don’t want remoteExec and sync do the way I said
my way would work (I hope). But I don't check if player is inside trigger area. If that matters
If you sync you don’t have to
Your current problem is the message showing only to the player who has the smoke. ANd not anyone else right?
my current problem is that it checks the detectives smoke and shows him what smoke he has not who is in the trigger
ah yeah. because the == name _detec
wouldn't thisTrigger do the job to check who activated it?
thisTrigger is the trigger.
thisList is the units inside the trigger.
thisList. Would show you list of who was inside trigger when it was activated
oh
But with your solution M242 wouldn't i need a trigger for each player slot then?
or am i misunderstanding this?
Triggers placed in editor are kinda global
hi
Even if the statements are local but because they are identical they will execute on every pc if trigger is activated because if you don’t sync it specifically it will trip on every pc
Difficult to grasp
But once you do it gets easier
lol so i only need the 3 triggers for each role?
i'm so confused at the moment i'm sorry. i heard ArmA was a pain in the buttocks to script in but i didn't think it'd be this bad to start learning haha
You could have one if you want
i have one trigger for each smoke grenade so 3
If you want, you can combine everything and check for different types of grenades in one trigger
but then i'd need different outputs for each grenade too, wouldn't that be extremely complicated?
Those notifications are ladder up aren’t they? So you can spam them, 3 would certainly be ok
my brain doesn't comprehend ArmA scripting, I just need it to start showing person A ( Detective outside trigger ) what person B ( inside trigger ) is holding ( what smoke color he has )
You were almost there
and what you said makes a bit of sense to me ( not that you're doing anything wrong i'm just not as smart with this yet ) but i don't know how to apply it properly just yet
Trigger condition: this && {"smokewhatever" in magazines (thisList select 0)}
On activation: if (player == detective) then { shownotification..}
You can also do this
if (local detective) then...
It works. Thanks everyone for your help i learned allot today lol. Really do appreciate it!
I'm creating a module, that's sync'd to some units and is trigger activated. Is there a way to get a reference to the trigger that activates the module?
@naive fractal maybe via https://community.bistudio.com/wiki/attachedObjects or close 😉
Cheers for a potential lead, I might just have to reproach the design pattern for my use case
yes, there's no way to get -the- one trigger (also because there can be many others)
Can someone steer me in the right direction with the GUI Dialog. I need to activate certain buttons depending on the amount of points a team has. Do I use the idd for this? findDisplay? I just need to either show/hide buttons or activate their addiction or deactivate.
@carmine abyss Use ctrlEnable or ctrlShow for your controls. To grab a control u can use displayCtrl.
Ok Great thank you. I'm going to go read up on that now.
"vehicle types" ("all","tank",..) represents class inherition?
can anywhere be found full scheme of it for arma3 ?
@trail grove https://community.bistudio.com/wiki/isKindOf
Kronzky
This command can be used on the whole hierarchical class tree (i.e. when checking a HMMWV, one could test for "HMMWV50", "Car", "LandVehicle", etc., all of which would return true.)
looks like it
basically anything in the config should be checked by this. here is a stone age old list for arma 2 or something: https://community.bistudio.com/wiki/ArmA:_CfgVehicles#Land_Class_Vehicles
Might be offtopic, but can anyone tell me where to find all that vehicles, like explosion debris, fire, smoke, craters. I know some of them are #particlesources but not all of them are particles, they are just not documented much. Thanks
Yeah I mean where to find some breakdown of # like objects
I know its some #crater and #craterbig blah blah.
But thats all I know about those.
Is there anything else to see?
Hi guys. Is there a way to display text (on runtime) on an objects texture like the rugged screen or tv set ? I mean directly "text to texture" instead of creating a picture with the text on it and then setObjectTexture.
@mental dawn Likely best solution is https://discordapp.com/channels/105462288051380224/105462984087728128/437965763144450048
Otherwise, no
Thanks
Only if the object is UI object, then you could fake it, otherwise texture only which is an image or procedural texture
text to texture yeah sure. setPlateNumber or what the name is
only works with.. well.. number plates tho
Hi! Can someone pls help me?
How do i change the ownership of a respawn position?
rp_a setVariable['Side', 1] does nothing
@waxen tide from the comments https://community.bistudio.com/wiki/BIS_fnc_returnParents, thanks
I did google it they all seem to be mods sadly.
Yeah just loop animation
I bet if you put Arma AI on PUBG server it will own everyone
is some way to determine when curator holds object for placing? (preferable with info on what is the object)
https://photos.app.goo.gl/E65Qmh5HsJni9i6u8
I tried looking into curator display (ui_f_curator) but it doesn't have any eventHandlers there
So i am looking to move a gui that was created using ctrlSetPosition. Works like a dream as, is. However it seems that depending on resolution, the gui will move different amounts. Im hoping i can get it to where it moves the same relative amount no matter the resolution. Does anyone have info on this? 😛
@wide hamlet look into safezones
unable to use them in this specific scenario
i think at least
the gui HAS to use pixelW pixelH but i might be able to move them based on safezone?
@wide hamlet https://community.bistudio.com/wiki/safeZoneH, [1*pixelW,1*pixelH]== size of 1 pixel, both commands outputs is in screenMeasurmentUnits, ctrlSetPosition using the 'units' as input,
https://community.bistudio.com/wiki/Pixel_Grid_System
ill just explain whats up real quick. Mod i use has a hardcoded GUI. That gui uses pixelW/pixelH along with some math. So i cant change that. I am, however tryting to move that gui using ctrlsetposition. I get the current position using ctrlPosition and move it accordingly.
@wide hamlet so whats the problem?
finding the correct units to use to move the gui a constant relative distance based on resolution/aspect ratio/gui scale
for example right now i am simply moving it +0.1 units. Works fine on 1080p normal scale etc. As soon as one of those variables changes it borks. Im pretty sure safezone is the way to go, Im just not sure how to implement it if that makes sense
@wide hamlet ctrlPosition returns UI coordinates (in screenMeasurmentUnits) resulting after the math used to position the GUI, i described above commands which giving you values in the s.m.units for certain represents (screen border, pixel size) for resolution used when they are called
Edit: I did overlook something
Not sure if this is the place to ask this, but does anybody know why wind is not affecting mortar rounds shot by AI in ACE3 and if this can be enabled somehow from scripts?
I have the advanced ballistics and mortar air resistance enabled from settings but it seems they only affect the mortar rounds player fires.
@tough abyss No, I have a script that makes the AI to aim the mortar barrel at a certain direction and elevation so it definitely fires at the values I give it
I also tested it so that I let the AI aim the mortar and fire one round, then I killed him and went to the mortar as a gunner and without changing the aim I fired one myself
the AI fired round landed way farther
I also disabled the Air Resistance setting for a while and fired the mortar, then my rounds landed at the same place as the AI fired rounds
interesting, so AI rounds supposedly ignore wind deflection/air resistance?
Yeah
I was making a script where I could give AI mortar gunner charge, direction and elevation and he would aim and fire.
It just doesn't work now that the range table takes into account wind but the AI doesn't
oh boi its because of the wrong use of exitWith
is there any other way to return a value and stop further execution of the function?
breakout / breakto
ah i see, very well. Thanks
if you use cfgFunctions then var1 breakOut (_fnc_scriptName + "_main")
var1 being the value you want to return, _fnc_scriptName is set in a header
(Which cfgFunctions compile adds for you if you use that)
thats exactly what i need
👌🏻
soo in action it goes like: result breakOut (_fnc_myfancyscript + "_main") ?
no
dont change the _fnc_scriptName
thats an automatic variable set by BIS' cfgFunctions
merci
what would i have to do to set a module to destroy itself after it runs once? i'm using a module that dynamically spawns units but i only want it to spawn a single wave. it doesn't have that feature so i need to figure out a script to stop it
@austere granite are you sure each CfgFunction has a scope named (_fnc_scriptName + "_main")?
Aaaand of course this is not true, just checked, scopeName is not used anywhere to set scope in initFunctions. I am curious where did you find this @austere granite ?
@sleek token don’t do it, if it works it is only because of some fluke with no existing scope name, just define your own scope with scopeName, will be cheaper anyway than adding strings together for no reason
Can someone guide me. I found that groundweaponholder created by script does not disapear when empty. What I missed? (Tested in editor)
Have you got another weapon holder very close to it? Then it is a bug
Does anyone know what is used to acquire tree data when opening Zeus UI (e.g. units classes)?
how do you mean "what" ?
is it sqf function or some engine based stuff that cannot be modified
engine
so if i don't want to load all 100500 assets each time i open zeus - i need to write my custom zeus UI with blackjack and whores?
at that point it might be easier to get a BI dev to fix the Zeus search freeze crap
search i fixed with scripted search field
but looks like zeus re-create asset tree each time you open ui, so when playing with CUP+RHS+many_fancy_mods it become very slow when you switching between direct control and zeus
Where can I get that mod?
Are you kidding https://puu.sh/BYju3/17c2aa9e10.jpg ?
No. I don't know that it existed
https://steamcommunity.com/workshop/browse/?appid=107410 oh.. First object on first page
dudum
cmon. it's 3 days old
nah
you failed bro
reminds me that i might should get back into actual arma gameplay ...
because i would have failed to find that too 😄
i wish there were laws enforcing minimum standards in software development.
it is not like millions upon millions of lifes would depend on software on a daily basis
ohh .. wait
mind as well ban 95% of software
yup 🤷
software has a rough lifecycle of 3 years until it is completely outdated due to technology having progressed
that xkcd about voting booths comes to mind
by the time you finish writing one software, you need to start the next
but you cant because the specs changed
so you needed to adapt
so your code is a mess
but you need to maintain because rewriting is expensive
but you need to rewrite to be able to maintain proper
so you refracture
so your code gets more messy
so you finally start rewriting parts of it
but your codebase is getting worse through that
now people want to leave the company
now you just got one of the elder ones who wrote the core left
now he gets high salary and everybody hopes he is not dying
now you are fucked
80% of the companies, this happens
20% the one dude died
Why write laws for software development when you could develop an ASI and put all the codemonkeys out of business.
In most of the cases if occasionally everybody stop development for a while - nothing explodes and nobody dies and actually there are a lot of stuff users want you to fix and most of it can be made without catastrophic regression, but all of them are not planned and all planned new features are actually not needed to anyoune except 2% of users (and even for them - working in old manner will be more effective than using new feature)
everybody stop development for a while - nothing explodes and nobody dies this is the false assumption that the software world is actually okay
it is mostly the job of admins to keep software alive, programmers created
the sole reason why everything is working is because we established a whole job around keeping software up
no no no no. imagine there was a reasonably short, simple test that your software needs to pass, and it is upon the company selling the software to prove that it does. like a search field that hangs and crashes? test failed! can't sell it. can't release it. what would happen? people would FIX that shit or die. simple as that. in reality it would just shift the focus a tiny bit, people would care because they have to. like cars having to actually pass fucking basic crash tests or not being allowed to be sold. it didn't kill cars, it made them safer.
@waxen tide such a test is impossible for software
you also could try to implement such a "test" for art ... same problems
the "test" you talk about are the tasks a software needs to fullfill
no it fucking isn't. all you need is 3 underpaid interns.
hah
no
it starts at those underpaid QA testers and ends at companies using legacy code for too long because rewriting it is too expensive
heres the prototype. wait what, we dont need to continue? wait why are you using that in production!
just set the system up in a clever way. pay a bunch of people to find bugs, and pay them a bonus for each bug found. give them a limited amount of time. every bug they find, you have to fix. simple.
sure 🤦
it would not 😉
the problem is fairly simple: lets compare it with building a house
at start you know what rooms are required, how their layout is
etc.
but in software? nobody knows any fucking shit
the customer says "i want 10 bathrooms"
while in reality he just wants 3 (one for each floor) and a big pool
but the developer understood that he wanted 10 pools
so he builds 10 pools
a crash is a crash. a freeze is a freeze. a non working search bar is a non working search bar. a roof that isn't watertight and lets rain in is a roof that isn't watertight and lets rain in.
then randomly, the customer finds a new room he wants to have
essentially, in the end you got a mess
doesn't care what the dev build as long as it works.
i talked about minimum standards, not perfection.
especially because your pipes and cables are required to change color all few weeks
so you pull all of them out
and replace them
but some, you cannot pull out
so you create other layers
that is software development
solar flares are why my code has bugs....yea
there is something called "building code" for houses. if you nail together two 2 by 4's you need to use two size 9 nails or something. can't use one. can't use a size 8, can't use a size 10.
cause THE CODE
every guy nailing wooden framing together for houses knows this
that's what is needed for software
and it will emerge eventually
will never happen
that sounds dilusional
because it will be a competitive advantage you can advertise with if you can say "our software is coded to this standard and thusly better than our competitors garbage"
¯_(ツ)_/¯
might take 200 years
but it will happen
it is inevitable
the forces of capitalism will drive it forward.
by then itll be ML generated scripts cobbled together
might be
and noone will know how it works
but those will pass all unit tests and adhere to a script standard 😄
🍿
strict*
oh yeah fuck no, in 50 years nobody will have a clue about how anything in IT works.
"how does it work?" "idc it's ML magic"
imagines the xkcd comic in his head already
no
it will not happen @waxen tide
it is simply impossible
unless you create only one way to archive the same problem over and over again, you are literally fucked
you forget that software is essentially just math, and math existed for so long that nobody can even date it
and here is the problem: Try to apply the one rule to math
we just got syntax rules in math. But you still can mess up a whole function by just adding random stuff to it like 1000000 * 5 / 5000000
if you fix math
come back to me
i think you didn't get what i was trying to say
i sometimes suck at expressing stuff.
i exactly understood what you try to express
Have you got another weapon holder very close to it? Then it is a bug
@M242 Yes. I've created for example 3 holders on same spot with 1 magazine in each. After I picked up all magazines there is still action icon to open inventory on ground
and i can tell you, that this is impossible
unless you can somehow make software so strict, that only one way is possible
fuck sake there are like 10 million ways to create UIs and i am not talking about frameworks here
it can't be impossible because it is already happening. i mean, people are doing unit testing. people are trying to come up with languages that reduce the possible fuckups a developer can possibly do. i'm not on about solving every single problem ever in software development, i'm on about people finding ways and processes and standards to raise the quality of their software slowly, but surely. And at one point people will want to differentiate this to differentiate their abilities and their capabilities and their software quality from competitors. and like any other (and older or simpler or both) industry, the software industry will mature and thru the pressure of capitalism, develop universally accepted standards of quality.
people will simply figure out that having your UI freeze just because you do some heavy lifting in the background is stupid, just like people figured out you need TWO nails in a 2 by 4 or your house might collapse.
I can't get. Is this channel to post a shit? 🤔
unit testing? garbage that is only to prevent regressions and ensure algorithms work, not to create quality software.
people will simply figure out that having your UI freeze just because you do some heavy lifting in the background is stupid guess what, they already did
and they still cannot always prevent that. There are standarts in place due to this. But you sometimes need to violate those because otherwise you cannot archive what you want
you want the software development to mature? have fun creating not one programmer job but rather thousands with specific field
and we talk about "if this method also requires networking, i am fucked because i can only do data structure creation" fucked
Go fucking #offtopic_politics
it is not politics
it is actual programming stuff
and relates to scripting in a different, but still relatable way
all said can be applied to SQF
and scripting
rookies creating scripts, other people use
creating shit missions with horrible performance
and more leaks then the titanic
can you show me one example of a leak?
take a random mission and check how the spawned script count is growing
our mission leaks memory and we have yet to find it :(
what mission is that?
pushBack's into an array that's being iterated over. But which is never emptied.
Haven't seen that yet. But I mostly only look at good code.
highly customized becti
i dont think we havr any arrays that grow though
get set at beginning or go out of scope
and or memory issue persists mission ends
i would probably do something silly, like log the size of every single var.
i have detailed logging setup with grafana front end on sql and influx db
its quite pretty
maybe pretty but apparently inadequate otherwise you would find the issue, no?
codebase is pretty large and conveluted
its a slow growth
hard to narrow down
ive been trying to come up with logging that will show logic flow through scripts
so i havr an idea of what runs when and how often
typically
some rogue script somewhere
prob
also havr a maybe related io issue where i guess we dig into pagefile all game :(
6MiBps reads lewl
Hello guys i need advice. Ive read the crap about the numbers in actionkeys command (combo keys are stored like Left Shift + Key = 704643072 + DIK).
My problem is that game stores that "large" numbers not in decimal form (Lshift + R == 7.05888e+008)
I cant even divide that crap from itself : ((actionKeys "ReloadMagazine" select 1) - 704643072) == 19 returns false
yes. Correct.
so, anyone have a workaround to get it like [key,[shift,control,alt]] form?
i am trying to block task force radio keys while the one reloads and block reload while transmitting (there is a bug in a nice mod that adds animation to that)
Asked @ornate quail yet if he knows a fix?
No i did not, i assume if he knows he would fix it himself)
maybe you can do some kind of dumb workaround.
If there is no magazine in weapon. Then don't try to play the animation
reloading is one of that strange engine handled things
old magazine is removed from weapon and added to inventory
and if reloading gesture is replaced by radio gesture it is lost
so main problem that reload is a gesture and gestures are not scripted well
maybe it is better to use the Reloaded EH for the unit? you get the old magazine info. All you need to do is to detect if the person i talking over radio.
Well it is just a half of the problem
it covers only situation when reload started after transmission start
reloaded eh fires as soons as the new mag is in
yep, but there is no reload if you start reloading and activate radio gesture
and old magazine is already nowhere
is the mod author not aware? you should tell him
Sure he is
so why doesn't he skip the animation if reloading?
it is a gesture you cant detect it
because he doesn't know how to detect reloading
Well its easy to detect it by simple key handler
only problem is that combo keyis like shift come in strange encrypted form
i guess that 95% of players use simple key so there is viable workaround
but one always want to make 100% reliable workaround))
by gesture you mean animation?
im not into animations very much but as far as i know it its different terms in the game
gesture is addition to animation
damn i am always missing the articles)
so he can't use animChanged EH to detect start/stop reloading?
the gesture only applies on top of regular animations, these are not played with switchmove, playmove or playmovenow
https://community.bistudio.com/wiki/playGesture
i believe this was used
oh no "playActionNow " is used
i guess that if we can transfer 7.04643e+008 back into 704643072 we can do the math
may be its like the comparison of float numbers
You can do a rough estimate of what key might've been pressed
But the data is just not there
if you detect something. It might've been that someone pressed CTRL+ALT+SHIFT+R. But he might've also pressed CTRL+ALT+SHIFT+E or CTRL+ALT+SHIFT+Q and you couldn't tell the difference.
add a new keybind with CBA, bind it at the same key as reload, make it execute custom code to detect it :^)
That would work. But people would have to bind it by themselves
yeah i was only being half serious
Well that is what i do actually
If you cannot detect a reload. I don't see a better way
reload key is not a problem, but task force keys are likely to use combo keys for the most players (and by default)
i have not looked into tfar code, but doesn't it have a cba event when using the radio?
Uh.
And it has a CBA keybind
ok only problem is in custom ctrlalt del reload key
well looks like its users will face a bug
you say reload key is not a problem. But you say reload key is the problem.
What now
hehe)
thats because you proved i cant handle combo keys, so i can leave them peacefuly
diwako's solution would be a solution though.
Just tell users "use this one small trick to keep your magazines from disappearing"
or you could do use the reloaded eh, have an cba eh listener to the "use radio" event and just add the old mag to the inventory if you detect a reload and the person is talking over the radio
however this might add additional mags, who knows
but still, no key detection necessary
BTW, do you guys know some more optimized "blocking" method than the one on cba_fnc_addkeybind side?
tbh i would not try to block it, but react to it. it has to be fixed on mod level. Either you add it into the mod yourself or wait for a fix. I doubt kola likes people uploading his work on sw
i am not uploading anything
@calm bloom @still forum Im working on one, almost done
is possible to change playerSide?
I'll share it once it's done, but it may take a few days
@dusky pier i think it's static even if you join another side's group. in most cases you'd want to use side group player instead of playerSide
i use side player, just asked 😃 i have a list player on map. And there - used playerSide
you should check the side for the player's group unless you want it to be civilian when player is dead among other quirks
@ornate quail Very nice thank you for your great work
When activated with a radio trigger; Null = [thistrigger] spawn {gip1}; returns
Error in expression <Null = [thistrigger] spawn {gip1};>
Error position: <gip1};>
Error Undefined variable in expression: gip1```
and
`Null = [thistrigger] spawn {asg_fn_gip1};` returns
```sqf
Error in expression <Null = [thistrigger] spawn {asg_fn_gip1};>
Error position: <asg_fn_gip1};>
Error Undefined variable in expression: asg_fn_gip1```
This is happening despite the fact that the function gip1 is plainly visible in my function viewer. Could anyone explain what I'm doing wrong and how to correct it?
so what now. gip1 or asg_fn_gip1?
Your spawn does literally nothing
Something is wrong here
Either way I do it, it returns nothing.
you are not spawning any function
you are spawing a piece of code.That retrieves the value of a variable, and then ignores the result it got, and exits
Okay. Right. So how do I do it correctly?
Also if that asg_fn_gip1 is supposed to tell me that you are using CfgFunctions. CfgFunctions is _fnc_ not _fn_
0 = [thisTrigger] spawn asg_fnc_gip1
Interesting. So the brackets are not for this at all?
curly braces mark a section of code
You can do that of course. But if you do that you should put actual code inside it.
Got it. Thanks a ton!!
Okay, so your solution fixed my dumb problem. Now I have a better problem. It doesn't appear to be taking [thisTrigger] the way I expected. Previously,
If (!isServer) exitwith {};
params ["_trigger"];
_Base = (getpos _this);
_HQ = [_Base, INDEPENDENT, ["I_officer_F","I_medic_F","I_officer_F","I_soldier_UAV_F"],
[],["LIEUTENANT","PRIVATE","SERGEANT","PRIVATE"],[],[],[],180] call BIS_fnc_spawnGroup;```
That would work, but now it isn't taking it. Must I reformat it, or is it impractical to continue trying to plug the trigger in as a location?
it takes thisTrigger just perfect
It's put into the _trigger variable. Perfectly fine
The issue is that you don' t use the variable
You grab _trigger and then never use it
Got it. I need to change _this to _trigger? Makes sense.
I used to have a wrapper that did that, but it seemed redundant, I guess I forgot to adjust accordingly.
if you want to get the position of the trigger. getPos _trigger makes more sense than getPos _this
But here are actually two issues.
0 = [thisTrigger] spawn asg_fnc_gip1
You move thisTrigger into an array. Which is fine, but you don't need it in an array. So why do you?
0 = thisTrigger spawn asg_fnc_gip1
Some people may do that for code style reasons I guess
I only do it that way because that's the way I've always seen it done. I guess it helps people visualize it as an "input" slot.
@tough abyss seems you are right, i haven't used in cfgFunctions in a while and the one i use does have that, turns out it's just scriptName (parent) in BIS one, srry :3
All is well. It's working as intended now. Thank you very much, @still forum.
Can we call Arma a MMOFPS?
I would say it would depend on the sandbox.
Also, I think you would start to run into serious issues with the appropriate numbers for that classification, but that's just a guess.
I don't know what I'm doing wrong here, either.
[thisTrigger] remoteExec ["asg_fnc_gip1", HC1];
Where HC1 is a headless client on the server.
is possible to remove players list from map dialig?
was units also returning driver etc.?
driver?
https://community.bistudio.com/wiki/units the units command returns units in a group. not vehicle
Is it at all possible to make it so i restrict everyone on my server to only use global voice chat? I want it set up this way because we want to use task force radio and we want to be able to communicate across teams and with zeus
Is this possible using server scripts?
if you want to communicate across teams with TFAR. Just give both teams a radio
and give Zeus a radio too
wait ... ohh ...
I tried that in the zeus gamemode but last i tried it didnt work
Did they ever fix that?
It only worked when i got my friends to switch to global chat in the base game
no one told me yet that Zeus radios don't work
I mean.. Might be that noone noticed..
Besides that we talked to Zeus over radio in a op 2 weeks ago. And it worked then..
Zeus logic or zeus unit?
Not sure what the difference is. I have 1000 hours in arma but thats just all boots on the ground. Im VERY new and noobish to scripting and mission making. But i wanna do some cool custom stuff with my friends so i wanna get into it
zeus unit can around as a unit without having to remote control anything.
Zeus logic is a invisible thingy floating in the sky. And you can only enter units via remote control
Logic
I only just got mcc and tried zeus unit stuff the other day, making zeus mission setups with the eden editor. So i havent tried TFAR with the zeus unit yet
Does it work normally with the unit?
Never works with the logic for me
Idk why
Ill try it with the unit later when i get on
is it possible to receive the backpack owner with https://community.bistudio.com/wiki/vehicle like with https://community.bistudio.com/wiki/objectParent ?
No
what is returned in that case, the backpack itself?
cant
needed to delete arma again as steam thought to remove it
and SSD is not having the capacity to reinstall it
Me too, driving
Where HC1 is a named headless client on the server;
[thisTrigger] remoteExec ["asg_fnc_gip1", HC1];
Does nothing and gives no errors, even in the .rpt.
I know I'm doing something wrong, but can't identify it.
could somebody also please double-check KKs comment on https://community.bistudio.com/wiki/vehicle ?
ohh ... and what is happening when the driver slot is already full with https://community.bistudio.com/wiki/moveInDriver (or any other corresponding commands)
Nothing
dindo nufihn
What are you trying to do, your questions seem quite strange without context
@tough abyss implementing SQF-VM
i literally mean exactly what i ask
because those are the questions that arise while implementing those commands
So you want to fake vehicle/unit related commands?
real fake stuff.
or fake real stuff?
Are you adding pseudo vehicles?
nope
they actually do read the configValues
crew etc. already implemented
just that the actual moveInXXX commands are missing
@dusky pier yeah i think you can, you must grab the idc from the playerlist button and then you can disable the button with ctrlEnable or you grab the listbox where the players are and clear the list (lbClear idc)
i try'ed ctrlAddEventHandler on main listbox. But still don't working 😦
i tryed hide subtopic listbox
but is not working
do you have the idd and the idc for me?
@queen cargo vehicle _backpack returns _backpack
objectParent returns the weaponholder
vehicle returns the vehicle AI/person entity is in or the argument you passed to it in all other cases @queen cargo
@pure blade ,```sqf
idc's:
1001 - main list
1002 - subcat list
My problem is, this code once worked in a former mission. But when I copied it (including the sound file and folder structure) It does noct work in the new mission. What am I doing wrong?
_soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
_soundToPlay = _soundPath + "sound\sound.ogg";
playSound3D [_soundToPlay, itm_speakers, false, getPos itm_speakers, 10, 1, 100];
https://community.bistudio.com/wiki/playSound3D
"Follow this guide"
-> http://killzonekid.com/arma-scripting-tutorials-mission-root/
-> MISSION_ROOT = str missionConfigFile select [0, count str missionConfigFile - 15];
did you check that the path is correct?
did you pack as pbo? Did the sound file get packed too?
yes, did put it on a hint and pathing is correct
not yet packed. still testing in editor
position is ASL
not AGL/ATL/AGLS/whatever getPos is
You can hear it 100m far. Maybe it's 100m under you?
hmmm gonna check that ...
And before you get it working, please use the select method above instead of BIS_fnc_trimString
That trimString crap is on biki too 🤦
KillzoneKid described above method as "his favorite". Thats why I used it
With a note that says select is 18x faster
KK doesn't even list that method in his blog post
So where is that "his favorite" ?
In fact. He writes So far, this is my favourite. about the one I posted
Seems that I mixed up something with his blog post. You're right
if position doesn't work. Make sure the ogg file is not broke or smth
Unfortunately no success so far. Changed getPos to getPosATL, checked that Soundfile by playing it in Browser (works) . Btw it is a copy of the sound file that already worked well. And pathing with your suggested method of creating the path is working too (path is correctly leading to the file)
Sometimes I forget a ";" at a lines end, but I double checked the code many times and can't find a syntax error.
by any chance do you plan on running that on a dedicated server? I played around with that as well a bit and found some solution which also works on one
if(isNil "MISSION_ROOT") then {
if(isDedicated) then {
MISSION_ROOT = "mpmissions\__CUR_MP." + worldName + "\";
}
else
{
MISSION_ROOT = str missionConfigFile select [0, count str missionConfigFile - 15];
};
};
ARRRGGHL. found it. You were right with the getPos . I really mistyped ATL instead of ASL. Now it works. Many thanks guys!😇
Does it play ogg files? I don’t think it does
it plays it well 😄
Something somewhere doesn’t like ogg, can’t remember what though
ALIVE mod features dynamic simulaiton correct?
Guys, are there any EG spectator code?
I want to use spectator menu as the target for selectplayer
why wont this work. it seems so simple. ```sqf
private _timer = diag_tickTime;
waitUntil {
hint "Choose a Loadout";
sleep 1;
diag_tickTime == _timer + 10;
};
_rLoadouts = createDialog "r_Loadouts_Dialog";
@carmine abyss Don't use == when comparing things like time
Use diag_tickTime > (_timer + 10);
@carmine abyss @ruby breach
Since you put
private _timer = diag_ticktime
and waitUntil will wait until it returns true, it will never execute because...
diag_tickTime == _timer + 10
will never be true, it will always be false.
It can return true. The odds are just infinitesimally small
If you're thinking that _timer is always equal to the current diag_tickTime, it's not
Anyone got any experience with building an Animated Briefing using the setup added in Tacops? I've got no idea where to even start with it.
@carmine abyss you are expecting the script to land at that exact spot 10 seconds after the start. To the micro or even nanosecond exact. That's not gonna work.
Scheduled scripts are unreliable. Your sleep 1 can sleep anywhere from between 1 second to a couple hours.
So even if you rounded the times down to the whole second so that you have a 1 second window where that condition would be true. It's still very likely to not actually happen in that timeframe
A trigger could do
How do i spawn units with a script?
Lovely
[[[arguments],serverfunc1,sf2,sf3],{(_this select 0) call (_this select 1)}] remoteexec ['bis_fnc_spawn',specificclientid,false]
sf1 mentions sf2 and sf3.
sf1 launches on client fine but gets sf2 and sf3 undefined.
Any ideas what i am doing wrong?
what are you doing even?
[arg1, arg2] spawn {arg1 call arg2} Wat? Why not just
arg1 spawn arg2 and be done with it?
Same end result
And where are they "undefined" ?
you are doing [arguments] call serverfunc1 in the end. sf2 and sf3 are never used
Bet it related to some rp server, always made in a way noone knows why :)
Its obvious that its related to some RP rookies server, since allowing bis_fnc_spawn and similar to any destination is insane bs.
sf2 and sf3 are called inside the serverfunc1
you guys are free to have fun on your server fantasies
Serverfuntion1 is transfered by the remoteexec arguments and is successfully fired from the code block, but the sf2 and sf3 functions are not defined
yes question is related to transfering serverside private functions
serious question: are you actually calling them Serverfunction1 and Serverfunction2? or is that for abstraction purpose?
if it is the latter, use real names. Abstraction on this level is only confusing
if it is the former, go name them proper
Okay guys i can pass the code
i have made a system that generates mission sqm with the current game state
a do not want to settle it into public addons bacause it is a lot of effort
{
[[[~~~ there goes long list of arguments for "pzn_saving_server_fnc_savetsgremote"~~~],pzn_saving_server_fnc_savetsgremote,'pzn_saving_server_fnc_writefromarray3','pzn_saving_server_fnc_writemodulesfromarray3',_x],{~~here i try to publish undefined functions again{(_this select 4) publicvariableclient _x} foreach [_this select 2,_this select 3]~~~;(_this select 0) call (_this select 1)}] remoteexec ['bis_fnc_spawn',_x,false];
} foreach pzn_server_backup;```
all pzn_saving_server_fnc's are defined from the config on server
pzn_saving_server_fnc_savetsgremote is calling other two functions: 'pzn_saving_server_fnc_writefromarray3','pzn_saving_server_fnc_writemodulesfromarray3'
{
[[[~~~arguments for the 1st func~~~],pzn_saving_server_fnc_savetsgremote,pzn_saving_server_fnc_writefromarray3,pzn_saving_server_fnc_writemodulesfromarray3],{(_this select 0) call (_this select 1)}] remoteexec ['bis_fnc_spawn',_x,false];
} foreach pzn_server_backup;```
this one does not work too
@unborn ether okay thank you for the security review, but we do not run public server, every user is authorized by vpn connection, so we can afford that stuff
(doesn't sqf higlight work?)
private _meTest == "I am toaster";
Use this to make it more readble: http://puu.sh/BYVm7/2b605b92a3.png
i don't get it. Why are you trying to publish functions via remoteExec?
You need to
private _client = <cliend id>;
_client publicVariableClient "pzn_saving_server_fnc_savetsgremote";
_client publicVariableClient "pzn_saving_server_fnc_writefromarray3";
_client publicVariableClient "pzn_saving_server_fnc_writemodulesfromarray3";
[~~~arguments for the 1st func~~~] remoteexec ["pzn_saving_server_fnc_savetsgremote", _client, false];
yes thanks
the first one with the publicvariableclient is the wrong one
originaly i was trying to pass functions via argumets of remoteexec
and succeded for the one function i called
but failed for others
the first one with the publicvariableclient is the wrong one
What is wrong?
i mean my code
originaly i was trying to pass functions via argumets of remoteexec
Are you familiar with sqf data types?
There are 2 groups of data -- that passed by value and one that passed by reference.
But both of them should be initialized by some reference.
I mean your code was doing this:
Remote client called bis_fnc_spawn in form of
[[params], {code}] call bis_fnc_spawn
so given params passed to {code} scope as _this
You picked 2 params and called you inner code
param1 call param2
Inside called scope there is only 1 reference -- param1 as _this
and param3 and param4 left in same scope as 'call param2' was triggered
And as they local variable of this scope -- they are not available anymore
SO as fix in you style it should be like this:
[[[~~~args~~~], FN1 ,FN2 ,FN3],{_this call (_this select 1)}] remoteexec ['bis_fnc_spawn',_x,false];
so i should do siomething like this?
modify fn1 to get new arguments
{
[
[
[~~~arguments for the 1st func~~~]
,pzn_saving_server_fnc_savetsgremote
,pzn_saving_server_fnc_writefromarray3
,pzn_saving_server_fnc_writemodulesfromarray3
]
,{
pzn_saving_server_fnc_writefromarray3 = _this # 2;
pzn_saving_server_fnc_writemodulesfromarray3 = _this # 3;
(_this select 0) call (_this select 1)
}
] remoteexec [
'bis_fnc_spawn'
,_x
,false
];
} foreach pzn_server_backup;
So insde called scope there will be references to pzn_saving_server_fnc_writefromarray3 and pzn_saving_server_fnc_writemodulesfromarray3 functions
Holy cow # is an alias for select?
thank you for help, man, you really altered my view on that variable to value thing
@dusky pier hm the problem is arma write the lists permanently new, here is one way you can do it but i don't know if this the best way:
addMissionEventHandler ["Map", {
params ["_mapIsOpened", "_mapIsForced"];
if(_mapIsOpened) then {
[] spawn {
while {visibleMap} do {
((findDisplay 12) displayCtrl 1002) ctrlEnable false;
lbClear ((findDisplay 12) displayCtrl 1002);
};
};
};
}];
you need to make a condition to check if 1002 is the playerlist and you must find out the idc's for the right box next to the playerlist and set the text to an empty string
how can i highlight my code, i am new to discord 😄
```sqf
ah ok thx
@pure blade thank you a lot!!! 😃