#arma3_scripting
1 messages · Page 446 of 1
Picking up yesterday's convo: It is indeed status quo:
@eugenharton Well done! Btw: this is not well known: SQF = Status Quo Function and no, it was not named after https://t.co/dMy97djnoX :)
That's a really odd name.
@supple vine no weapons cant use user actions
right, thx
Can you add an action to a weapon holder though?
weapon holder is an separate "vehicle" type object that shows the weapon on it through a proxy
So it's like a transparent object placeholder that is transparent?
if I read that right, yes.
A little redundant in my wording lol
Those ground weapon holders are invisible models that show the items inside via proxy.
So, is it possible to add an action to them? Since they're still "objects" ?
If you pick them up, the ground weapon holder is destroyed and your soldier shows the item as proxy. In case of a weapon.
You could add an action to every player and put inside it's condition that player having the item.
Alright.
Backpacks are objects, so you probably can add actions to those too.
And uniforms and vests use a cargo dummy object similar to the backpack, though they are not themselves that object.
Which means that backpacks can be retextured, while vests can't...
This game is shit.
¯_(ツ)_/¯
you mean vest on ground?
didnt they add something for that
"something"
so you can reach the cloting proxies too with setObjectTexture
Is it a bug that BIS_fnc_holdActionAdd's param "conditionShow" even after beginning execution runs? I feel like it shouldn't since the action has already passed conditions to show. The action disappears but if you hold the key it still exec's code
kinda odd
{
this addEventHandler ["hitPart", {
this animate ["Terc",1];
}];
} forEach _KHTargets;```
How to access each index of the array to execute that code?
With "this" being replaced by the code which represents the array item for each iteration
@raven oracle _x is your special variable used with forEach, thus _x would represent the current tested element when iterating through
right, so _x is a magic variable created upon usage of this?
right, Thanking you for your help.
You also got _forEachIndex there too
The second this will also have to be replaced.
(_this select 0) params ["_target"];
_target animate ["Terc",1];
The select 0, because HitPart is bananas.
this is not an eventhandler method?
this is only a thing in the editor.
Local variable (despite not starting with _ underscore) used in the init box, and trigger code boxes and stuff like that.
i meant that the script you sent, looks to me like it just animates the targets into a down state?
Yeah, didn't bother to write down everything again.
That's just what goes into the code block of the HitPart eventhandler.
oooh, right, now im with you. Thanks
@still forum , you are totally the wiki guy now, you know what would be nice? If this page: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers
had the full params thingy to copy paste from for all events.
I'd do it, but:
Registraion of new accounts for the Community Wiki has been temporarily suspended. We apologize for the inconvenience.
I thought that was supposed to be reset after new year?
Apparently not
maybe it did and got closed again
They know and it's just me that's banned.
What page on the wiki shows all the new commands and fuctions BI has added from the new DLC?
@glass zinc Dunno, I use this one: https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
If it's not listed there, then no one made it yet.
ok thank you
was hoping for something just just showed me the ones that came out with the DLC so i could just pass those onto my actual coders to make them aware of them, will have to figure out another way
Wait, are we 1.82 or 1.84?
1.82
82
82.1
.812... Oh wait, that's Dayz, nvm
At the pace we're going, version 821 will be released in the year 6000.
@little eagle currently Lou Montana is doing the most wiki stuff. And he just asked if we want a remake of the eventhandler page
I have the source open and will edit it later, maybe. Can you or @winter rose just update it then if I give you the edited thing? Please.
hello there
:^)
@ruby breach the commands are labeled as 1.82. Just need to wait till the wiki cache refreshes
ppl keep placing devbranch commands as 1.81, and it's WROOONG
no
devbranch 1.81 is wrong
but that Kex guy labeled 1.81 as stable. Which is definetly wrong
@ruby breach cache is refreshed now ^^
that's what I meant, and yes, wrooong
devBranch, ok
1.81, nope, nope, noppity nope, patch not out
Sweet
@little eagle I thought your normal Bohemia Account is your wiki account now?
Was that plan abandoned?
Ah nevermind I just realized my account is gone now too 😄
No.
Behind the scenes your wiki account get's created automatically and connected to your BI account
But Bots used BI accounts to gain access to wiki and spam the crap out of it
ah okay
apply is something like forEach?
It's similar in that both are loops. The purpose is different though, as apply returns an array of the same size as the input containing the return values of each iteration of the code block.
Whereas forEach returns the return value of the last iteration of the code block. Which is seldomly used.
@little eagle ty
// Fire on target.
while {[_targets] call ORMP_fnc_numberAliveInGroup > 0} do {
["INFO | ORMP_fnc_sniperFire | Checking target validation."] call ORMP_fnc_log;
private _targ = selectRandom units _targets; // select rand victim in group
_sniper reveal _targ;
// If in view, take the shot.
private _vision = [objNull, "VIEW"] checkVisibility [eyePos _sniper, aimPos _targ];
if (_vision >= 0.4) then {
[format["INFO | ORMP_fnc_sniperFire | Good shot, %1 vision, needed 0.4.", _vision]] call ORMP_fnc_log;
[format["INFO | ORMP_fnc_sniperFire | Good shot, %1 is primary target.", _targ]] call ORMP_fnc_log;
["INFO | ORMP_fnc_sniperFire | Taking shot"] call ORMP_fnc_log;
_sniper setUnitPos "DOWN";
_sniper doTarget _targ;
} else {
[format["INFO | ORMP_fnc_sniperFire | No shot, %1 vision, needed 0.4.", _vision]] call ORMP_fnc_log;
_sniper forgetTarget _targ;
_sniper setUnitPos "MIDDLE";
};
sleep 25;
["INFO | ORMP_fnc_sniperFire | New target."] call ORMP_fnc_log;
};
["RETURNING ORMP_fnc_sniperFire."] call ORMP_fnc_log;```
IS there any reason that this would break on a dedicated server?
It works hosted locally, via edenEditor, but breaks if I host it anywhere else.
The sniper simply doesn't shoot.
https://community.bistudio.com/wiki/doTarget argument local
have to execute it on the machine where the sniper is on
In this case, the sniper would belong to the server correct?
If it's a AI then usually yes
Do all eden-placed AI belong to the server?
Let me back up.
To assure these scripts happen on the sever, should I clal them via initServer.sqf, or should I just pass the correct arguments to a remoteExec?
Currently they are called as such.
I would initServer I guess
enableSaving [false, false];
// All clients stop executing here, do not delete this line
if (!isServer) exitWith {};
// Execution stops until the mission begins (past briefing), do not delete this line
["SCRIPT COUNTDOWN STARTED"] call ORMP_fnc_log;
sleep 10;
["SCRIPTS STARTED"] call ORMP_fnc_log;
// Enter the mission code here
execVM "scripts\manageIndirect.sqf";
execVM "scripts\manageSnipers.sqf";
In just init.sqf
that should work though
if (isServer) then {
// do server stuff
};
???
I don't see _targets defined anywhere.
^ only if its called on server
init.sqf is executed everywhere.
yeh
I am defining targets in the editor
one player group called ormp1
another called ormp2
is the sniper member of player group?
the sniper, also defined in the editor as snp1, and snp2
No, they are ai, targeting the player group.
From a distance of 700+
clear weather, and clear LOS.
This script fails if you add any rain / overcast for some reason.
makes sense though doesnt it
It doesn't
Because I can cleary see, adn shoot said sniper.
In the same weather conditions.
Well, what does that fancy log say.
Also, calling forceWeaponFire doesn't work.
LEt me get some screen shots.
I need to do my file output... D:
But that's another day.
Well, what's the point of the log then? Seems like that is meant for situations like these.
It's right now for live trace debugging.
I can turn it on, and it throws sleeps into the log statement, and I can just kinda see everything as it goes, a bit slower..
It reports everythings working, and I can see the sniper go prone, and wiggle as he targets me.
diag_log format["Targets - %1 | Victim - %2 | Vision - %3 | Sniper - %4",_targets,_targ,_vision,_sniper];
best way to debug is to see what everything is doing then u might realize a issue
I do see it.
Live, via system chat.
Vision is good, target is repoting good, group is found and correct memebers alive is found.
Also, again, this is only failing on the dedicated server.
No mods are running, during these tests..
Hey, is the " radioChannelCreate " Command not working for anyone else in public servers? I have tried the third example on https://community.bistudio.com/wiki/radioChannelCreate but yet nothing works.
(other than CBA)
your not showing how _sniper is defined in your snippet so its hard to know
Sounds like a locality issue
sounds like the server doesnt know about it jay
snp1 is a unit placed via eden editor.
[snp1, ormp1, false] spawn ORMP_fnc_sniperFire;
[snp2, ormp1, false] spawn ORMP_fnc_sniperFire;
snp1, snp2 are eden placed units.
ormp1, ormp2 are eden placed groups.
_sniper reveal _targ;
where in the script is _sniper defined... must be above what you have posted?
Yeah, sorry
["CALLING ORMP_fnc_sniperFire."] call ORMP_fnc_log;
params [["_sniper", objNull, [objNull]], ["_targets", grpNull, [grpNull]], ["_danger", false, [false]]];
// stop, and reveal the target.
doStop _sniper;
// Set danger level
if (_danger) then {
["INFO | ORMP_fnc_sniperFire | -- DANGER ENABLED --"] call ORMP_fnc_log;
_sniper setskill ["aimingAccuracy", 0.9];
} else {
["INFO | ORMP_fnc_sniperFire | -- DANGER DISABLED --"] call ORMP_fnc_log;
_sniper setskill ["aimingAccuracy", 0.02];
};
// Fire on target.
while {[_targets] call ORMP_fnc_numberAliveInGroup > 0} do {
["INFO | ORMP_fnc_sniperFire | Checking target validation."] call ORMP_fnc_log;
private _targ = selectRandom units _targets; // select rand victim in group
_sniper reveal _targ;
// If in view, take the shot.
private _vision = [objNull, "VIEW"] checkVisibility [eyePos _sniper, aimPos _targ];
if (_vision >= 0.4) then {
[format["INFO | ORMP_fnc_sniperFire | Good shot, %1 vision, needed 0.4.", _vision]] call ORMP_fnc_log;
[format["INFO | ORMP_fnc_sniperFire | Good shot, %1 is primary target.", _targ]] call ORMP_fnc_log;
["INFO | ORMP_fnc_sniperFire | Taking shot"] call ORMP_fnc_log;
_sniper setUnitPos "DOWN";
_sniper doTarget _targ;
} else {
[format["INFO | ORMP_fnc_sniperFire | No shot, %1 vision, needed 0.4.", _vision]] call ORMP_fnc_log;
_sniper forgetTarget _targ;
_sniper setUnitPos "MIDDLE";
};
sleep 25;
["INFO | ORMP_fnc_sniperFire | New target."] call ORMP_fnc_log;
};
["RETURNING ORMP_fnc_sniperFire."] call ORMP_fnc_log;
That's the full function.
ormp1 and ormp2 are groups composed of players?
Maybe there is no player connected yet, and ai is disabled, so the groups are null / undefined.
[_channelID, {_this radioChannelAdd [player]}] remoteExec ["call", [0, -2] select isDedicated, _channelName];
Why is this on the wiki -.-
But the getAliveMemebers is returning the correct number of players
and the target is outputed
Each memeber in the group also has variable names, ormp1_1, ormp1_2, etc.
That way I can see who, in the group, after the selection is made, is being shot at.
So "Taking shot" is logged or no?
It is.
Here, you see, this is me, connected to the server, staring at the sniper.
The sniper never shoots.
I moved up until the vision was up to 1 as well, still nothing.
Well, then it's just a thing about doTarget.
Now, it works, hosted from the edenEditor
but the moment I put it on a dedicated box, or host an actual multiplayer game, it fails.
Have you checked the servers RPT?
I will check again.
Also, before I do.
I am going to add diag_log to my logger.
be right back
also as a test
// If in view, take the shot.
just make him take the shot with out a check
and see if he takes it
if he does then u can say its to do with the check on dedi
cancel out any checks etc
also try [snp1, ormp1, false] spawn ORMP_fnc_sniperFire; in debug after u have loaded in etc to see if theres a timing issue
heaps of things u can try and cancel out
Meanwhile, here's something quick for you to help me with:
I'm working on a sector control type missions and I want the arsenal to be spawned when sector is captured by BLUFOR. Works fine locally, when I use the "Play in Multiplayer" option in Eden it doesn't work. I suspect it's a locality issue, but I'm not quite understanding it well yet, so I hope you'd be able to help me fixing this issue...
- On the sector in the "Expression" field I've got:
null = [_this select 0] execVM "d_functions\fn_onSectorCapture_spawnHaloFlag.sqf";
fn_onSectorCapture_spawnHaloFlag.sqf:
private ["_module"];
_module = _this select 0;
if (_module getVariable ["owner", sideUnknown] isEqualTo WEST) then
{
diag_log format ["<<OperationSnake>>: Arsenal will be spawned"];
_arsenal_safepos = [getPos _module, 1,100,10,0] call BIS_fnc_findSafePos;
_arsenal_marker_name = format ["mrk_arsenal_%1", random 100];
_arsenal_marker = createMarker [_arsenal_marker_name, _arsenal_safepos];
_arsenal_marker setMarkerType "hd_dot";
_arsenal_marker setMarkerText "Arsenal";
_arsenal = "uns_EQPT_US" createVehicle getMarkerPos _arsenal_marker;
if (isServer) then { ["SpawnNotification",["An Arsenal box has just spawned in"]] remoteExec ["BIS_fnc_showNotification",-2,true]; };
if (!isServer) then { ["SpawnNotification",["An Arsenal box has just spawned in"]] call BIS_fnc_showNotification; };
if (isServer) then {[_arsenal] remoteExec ["execVM d_functions\fn_addArsenal.sqf",0,true];};
if (!isServer) then {null = [_arsenal] execVM "d_functions\fn_addArsenal.sqf";};
}```
- `fn_addArsenal.sqf`:
```sqf
if (!isDedicated) then {
waitUntil {!isNull player && {time > 0}};
diag_log format ["<<OperationSnake>>: Adding Arsenal action item to spawned crate..."];
_arsenal_object = _this select 0;
hint "Adding Arsenal";
_arsenal_object addAction ["<img size='1' image='\a3\ui_f\data\gui\Cfg\Hints\Gear_ca'/><t color=""#59f3ff""> Arsenal </t>",
{
["Open",false] spawn BIS_fnc_arsenal;
}
,nil,-1, true, false, "","", 3];
};```
Box itself is created, however on mutiplayer there is no arsenal action added and I don't have any clue how to make it work.
wheres _module defined?
if (_module getVariable ["owner", sideUnknown] isEqualTo WEST) then
{
ah
forgot to include
just above that line:
`private ["_module"];
_module = _this select 0;`
Please use the code block with highlighting:
```sqf
some code
```
aaaah, that I was searching for, thank you @little eagle
Highlighting?
@frozen knoll thanks man trying it now,.
@frozen knoll yes, I do, lemme fix that
haha sweet just looking thru what could be a issue... also did u check ur rpt?
yes, no errors there
mind that it's working when I use "Play in Singleplayer" in Eden, so I'm guessing I've got remoteExec messed up or something along those lines
on - fn_addArsenal.sqf:
On the sector in the "Expression" field I've got:
just try remove if (!isDedicated) then { };
The what?
because i dont know if "Play in Multiplayer" is dedicated
rpt shows no sign of what could be wrong, exact same logs I get normally.
Like I said, it works flawlessly hosted locally.
no, it returns false
It has to be a locality issue of some sort.
What is a sector?
yeh for sure
Very frustrating.
D:
I am also playing in multiplayer from eden
not playing in singleplayer./
personally i do all my multiplayer testing with a "dedi" setup on my machine
Maybe doTarget is just borked.
me too
not play in multiplayer
I need to set that up asap bamba
this is going to compleelty botch this weeks op for my group now.
D:
Been stuck on this for like 2 weeks.
use TADST
Wait.
nice and easy on ur own pc
Doubt it.
How come
if (vehicle player == player)then{
gives me true, even when I'm on my foot?
But it would be hilarious if the command actually checks and that's what breaks it.
Such a STUPID name for that.
vehicle player == player ONLY reports true if you are on foot.
@frozen knoll removed those two lines from that file, still didn't work
Would
if !(isNull objectParent player) then {do something};
Be better?
darjusz your script need to be called on all machines for it to work
not just server or just on player
Yes, MJRamon.
that's the "0" parameter in remoteExec, isn't it?
if (isServer)
if (!isServer)
before that
ur tring to tell the script to do stuff on server and do stuff not on server
Supreme in-vehicle check:
if (player in player) then {
// on foot
};
if !(isServer)
//versus
if (!isServer)
?
I got better commy
@frozen knoll I'll remove those if statements then and retry.
if (isServer) then {[_arsenal] remoteExec ["execVM d_functions\fn_addArsenal.sqf",0,true];};
was it initially called from server?
@little eagle
Arma in a nutshell
null = [_this select 0] execVM "d_functions\fn_onSectorCapture_spawnHaloFlag.sqf";
local
if (allPlayers findIf {_x in player} > -1) then {
};
I made an expanding brain meme image once with all the in-vehicle checks.
@gleaming oyster because
if (!isServer AND !hasInterface)
//versus
if !(isServer AND hasInterface)
@formal vigil if (isServer) then { ["SpawnNotification",["An Arsenal box has just spawned in"]] remoteExec ["BIS_fnc_showNotification",-2,true]; };
make it ["SpawnNotification",["An Arsenal box has just spawned in"]] remoteExec ["BIS_fnc_showNotification",-2,true];
without the isServer check as i believe ur running that locally
same for
if (isServer) then {[_arsenal] remoteExec ["execVM d_functions\fn_addArsenal.sqf",0,true];};
didnt meant it to be the same, just made it explicit
and change the 0 to -2
as u dont need to run it on server just all connected clients
@frozen knoll just did exactly what you've suggested and it still didn't work
Keep the 0 so it works in SP.
["SpawnNotification",["An Arsenal box has just spawned in"]] remoteExec ["BIS_fnc_showNotification",-2,true];
//if (isServer) then { ["SpawnNotification",["An Arsenal box has just spawned in"]] remoteExec ["BIS_fnc_showNotification",0,true]; };
//if (!isServer) then { ["SpawnNotification",["An Arsenal box has just spawned in"]] call BIS_fnc_showNotification; };
[_arsenal] remoteExec ["execVM d_functions\fn_addArsenal.sqf",-2,true];
@little eagle +1 for that
I get the Notification, though
play in multiplayer then open debug and paste [_arsenal] remoteExec ["execVM d_functions\fn_addArsenal.sqf",-2,true]; and click local
what happens?
sorry
_arsenal not defined
returned some number in the window, but still didn't attach the action to the box
_arsenal_safepos = [getPos _module, 1,100,10,0] call BIS_fnc_findSafePos;
arsenal_marker_name = format ["mrk_arsenal%1", random 100];
_arsenal_marker = createMarker [_arsenal_marker_name, _arsenal_safepos];
_arsenal_marker setMarkerType "hd_dot";
_arsenal_marker setMarkerText "Arsenal";
_arsenal = "uns_EQPT_US" createVehicle getMarkerPos _arsenal_marker;
[_arsenal] remoteExec ["execVM d_functions\fn_addArsenal.sqf",-2,true];
that number is probably the "JIPID" I guess
paste that and run as local
Wait, wtf is this:
[_arsenal] remoteExec ["execVM d_functions\fn_addArsenal.sqf",-2,true];
???
lol true
what I did wrong there?
[_arsenal, "d_functions\fn_addArsenal.sqf"] remoteExec ["execVM", 0, true];
oh, ok, lemme try that
_arsenal_safepos = [getPos _module, 1,100,10,0] call BIS_fnc_findSafePos;
_arsenal_marker_name = format ["mrkarsenal%1", random 100];
_arsenal_marker = createMarker [_arsenal_marker_name, _arsenal_safepos];
_arsenal_marker setMarkerType "hd_dot";
_arsenal_marker setMarkerText "Arsenal";
_arsenal = "uns_EQPT_US" createVehicle getMarkerPos _arsenal_marker;
[_arsenal, "d_functions\fn_addArsenal.sqf"] remoteExec ["execVM", -2, true];
try that in multiplayer debug run local
00000000000000000000000000000
with module defined
even so u dont have to define module
_arsenal_safepos = getPos player;
_arsenal_marker_name = format ["mrkarsenal%1", random 100];
_arsenal_marker = createMarker [_arsenal_marker_name, _arsenal_safepos];
_arsenal_marker setMarkerType "hd_dot";
_arsenal_marker setMarkerText "Arsenal";
_arsenal = "uns_EQPT_US" createVehicle getMarkerPos _arsenal_marker;
[_arsenal, "d_functions\fn_addArsenal.sqf"] remoteExec ["execVM", -2, true];
try that in multiplayer debug run local
just getPos player
-2 ... dont want it to run on server
in a multiplayer enviroment 0 is not needed
but if I put 0, the mission will also work in SinglePlayer
if ur supporting both
0 is the way to go.
No, this is the main concern here.
in multiplayer?
Dedicated server just ignores hint, there is no error.
correct
the error was thrown with:
_arsenal_object = _this select 0;
so I'm thinking maybe the order of parameters is incorrect?
Can you copy paste it from rpt? Because that is no error just a line of script.
sure
not in MP
ooh
Disabled in MP, because
_arsenal = "uns_EQPT_US" createVehicle getMarkerPos _arsenal_marker;
that makes no sense
Pubbies worried about their profile data.
meh
Error select: Type Object, expected Array,String,Config entry
_arsenal_safepos = getPos player;
_arsenal_marker_name = format ["mrkarsenal%1", random 100];
_arsenal_marker = createMarker [_arsenal_marker_name,[_arsenal_safepos select 0,_arsenal_safepos select 1]];
thats if ur getting player pos to test
Why the random 100, there're just as many numbers between 0 and 1 as there are between 0 and 100?
or position player]
@little eagle because I don't want my mission to create duplicate marker names when going after 20 sectors 😃
But there're just as many numbers between 0 and 1 as there are between 0 and 100.
You may as well write 1, because there's literally no difference.
really?
Yes.
isn't the parameter the max value for the random?
like: random 100 => give me a random integer between 0 and 100
Not integer, float.
Even if computers had actually real numbers and not just cheap floats, this would be the same.
The analogue computer will replace the quantum computer, you'll see.
meh I did remember wrong and you were right @little eagle cant use setobjecttexture on vests although the hiddenselectiontextures do work on them from config 😛
must have been a dream
so, it's throwing an error: Error select: Type Object, expected Array, String, Config entry for fn_addAdresnal.sqf in line 2
which is:
Yeah, because their containers are just dummies, whereas the backpacks are actually the container. Not that they couldn't weasel around that ofc.
_arsenal_object = _this select 0;
O rly commy?
params
perhaps these parameters should be in opposite order?
how do you explain:
https://community.bistudio.com/wiki/backpackContainer then 😄
[_arsenal, "d_functions\fn_addArsenal.sqf"] remoteExec ["execVM", 0, true];
The wiki is wrong, are you surprised?
no
yeh since backpack and face works the rest could too
_arsenal_object = _this select 0;
->
params ["_arsenal_object"];
And never again use _this select.
retrying
params
params is better
sending one bit of information
params everywhere and don't worry about it anymore.
Why make life hard? This is the -2 all over again.
oh god....
Hey
-2 was if ur running multiplayer why send shit to server that doesnt need to be
So it works in SP.
"why make life hard"
the answer is always:
"because I don't know better and can't admit i'm wrong"
I owe you big one, man!
Why script something only for MP. Makes testing it annoying.
i always script for the mode it will be played in
why add shit that is not needed.... sending to server is pointless waste of resources if its only multiplayer
But why make a mission broken in SP for no reason or benefit. 🤔
another +1 goes out to @little eagle
if its a multiplayer only game then make it multiplayer only for optimal perfromance
sending to server is pointless waste of resources if its only multiplayer
You do realize that in a server client structure, every message goes through the server anyway?
yeh but then making the server run the code when it doesnt need to aswell... why
the message has to go through the server to get to the clients....
yeh but it doesnt execute it.... just passes it on
@frozen knoll that's why you use isServer and isDedicated tho
It's remotely executed code! The resources for the actual execution are neglible compared to sending packages around.
may I reminder you you're remoteExec'ing execVM
It's like delegation, IIUC.
I think your worries are misplaced....
If I hover over the Server icon in HandleScore, the tooltip is bonkers.
@frozen knoll @little eagle can I send you guys that function, and maybe you guys test it on another dedi?
my pleasure! 😉 enjoy, and beep me if something's wrong / enhanceable
tabs are wiki default 😛 Dedmen could fix the tab size but he doesn't want to 😏
Just want to see if anyone get's variable results.
I feel something is indeed broken with doTarget / doFire
@winter rose I found an error, there're unfortunately some tabs that should be replaced by 4 spaces each.
Ok, one last issue to solve.
initPlayerLocal.sqf:
execVM "d_functions\fn_addPush.sqf";
fn_addPush.sqf:
player addAction [
"<img size='1' image='\A3\ui_f\data\gui\rsc\rscdisplayarcademap\icon_sidebar_hide_up'/><t color='#33cc99'> Push Vehicle</t>",
{
_veh = cursorTarget;
_vel = velocity _veh;
_dir = direction player;
if(isNull _veh) exitwith {};
if((_veh isKindOf "Ship")) then
{
_displayName = getText(configFile >> "CfgVehicles" >> (typeOf _veh) >> "displayName");
_upp = format["Pushing %1",_displayName];
//Setup our progress bar.
hint _upp;
_speed = 8.5;
_veh setVelocity [ (_vel select 0) + (sin _dir * _speed), (_vel select 1) + (cos _dir * _speed), (_vel select 2) ];
};
},
[],
-4,
false,
true,
"",
""
];
Script adds action to push out the ship if it's get stuck on beach / shore (?).
Works in SP, not in MP.
The statement of the action runs on the machine that used the action. setVelocity only works on local objects (local args), but the boat probably belongs to the server, not the client with the avatar.
Correct.
Is there a way to make it work on objects created by the server?
Would moving the statement to separate file and doing remoteExec like in the previous case did the trick?
Anybody have a good source or tutorial on how to pull data from a mission into a external program? Like kill counts and such?
_veh setVelocity [ (_vel select 0) + (sin _dir * _speed), (_vel select 1) + (cos _dir * _speed), (_vel select 2) ];
->
[_veh, _vel vectorAdd ([sin _dir, cos _dir, 0] vectorMultiply _speed)] remoteExec ["setVelocity", _veh];
@outer fjord only way that I have heard of is extDB
Thanks
@little eagle You have earned my utmost respect, Sir! Thank you so much for your help! Works now.
Thank the guy that wrote remoteExec.
I thank you for helping me understand which code needs to be executed locally or remotely.
And those sweet vector commands...
Added: New ctrlSetPixelPrecision script command what's that exactly?
How do i pass a string to a object? like _object = "MyObject" (remove the ""?)
Using Text returns a error that I am using a text and not a object
netID? Is that what you mean?
like netID is a stirng and then you can get the object from that
I found it call compile "string"
ah alright
i was doing it wrong at the begining
I need to actually put a object that is placed on the editor
or the variable is set
I though it would return a error or something but it just did nothing if the object did not exist
Is there a way to overwrite a config file script from a mod with a new script of the server, so instead of the mods script running it would be the changed one on the server?
No.
Is there a quick and easy way to increase a helicopters sling load capability?
No.
Yeah could cause more trouble than it's worth
Oh well, looks like the Brits in my mission will just have to settle for an American chopper delivering their vehicles 🇺🇸
@glad venture If the script is stored in a global variable, you can definitely do that.
Though, if the script gets called by the filepath....
You’ll have problems
@Dedmen Is it possible to add long range radio to infantry unit via script with TFAR Beta?
@still forum
need to select random unit in cfgGroup
_unit = (configFile >> "CfgGroups" >> "East" >>"OPF_F" >> "Infantry" >> "OIA_InfTeam" >> selectRandom vehicle );
I think the error is at end, tried selectRandom "unit"/this
unit = (configFile >> "CfgGroups" >> "East" >>"OPF_F" >> "Infantry" >> "OIA_InfTeam" >> selectRandom this >> vehicle ); ??
@astral tendon I found it call compile "string" no.
missionNamespace getVariable "string" does the same. And is like 10x faster.
@radiant needle Is it possible to add long range radio to infantry unit via script with TFAR Beta? Yes. Give him a Radio backpack.
Well duh, but I want it so he doesnt have to wear a backpack
or possibility to carry static backpack or parachute
@unkempt spire
selectRandom (getArray (configFile >> "CfgGroups" >> "East" >>"OPF_F" >> "Infantry" >> "OIA_InfTeam")) maybe?
I don't think that's possible then. Atleast not yet
Because I know you can script one to a vehicle
that's a completly different thing
And no you officially can't
you can hack around with the config caching to pretend that it has a radio
Am I thinking of the other TFAR?
"other TFAR"? What's that
The pre 1.0
I think that maybe had a variable you can set on a vehicle. Not sure
but that really only applies to vehicles
Also what are the chances of getting a RDF?
Think it'd be a cool little feature
_vehicle setVariable ["tf_hasRadio", true, true]
Does that work for TFAR Beta, or is that for old
what is a RDF?
Radio Direction Finder
RDF is a highly directional antenna, so you spin in a circle and if you hear a signal you plot it on a map
Ahhh Radiocompass on german. I don't think that'll be a thing ^^
though triangulating a radio signal opens lots of nice new gameplay possibilities
Yeah an RDF would allow you to either home or triangulate
but we wouldn't actually do anything with the signal. That thing would just take the coordinates of the sender and show you the direction
Yeah you probably could script it, because there are commands to see if a signal is attainable
and whether the unit is transmitting
There are no commands to see if a signal is attainable actually. That's all in plugin. But we can see who is transmitting... I think. And if we are receiving. But we don't know who we are receiving...
Yeah that'd be the only issue, don't want a unit getting a bearing if they are out of radio range
or not on the same frequency
I believe you can pull a units frequencyu though
nope. actually not.
or... Well... Kinda
With Intercept TFAR that should be easier though
Oh yeah I read the doc wrong, you only can get a groups default frequency
Now can you script it so a unit cant hear radio?
_unit = (configFile >> "CfgGroups" >> "East" >>"OPF_F" >> "Infantry" >> "OIA_InfTeam" >> "Unit0" >> "vehicle") call BIS_fnc_getCfgData;
works but randomizing "Unit0" with
_unitran= selectRandom (getArray (configFile >> "CfgGroups" >> "East" >>"OPF_F" >> "Infantry" >> "OIA_InfTeam"));
doesnt work
You can get the Radio with UniqueID and from the unique ID you can access the global settings list and that contains all currently set frequencies.
You can set the unit's receiving range modifier to 0. Then it can't receive anymore
Because you might be able to simulate a directional antenna by saying "If _Bearing1 - _Bearing2 <= 2 do nothing, if >=2 mute radio
obviously that's psuedo code but
@unkempt spire generate a list of all units in the team. Then use selectRandom.
I think getArray doesn't work on a class
So if you're facing within 2 degrees of target, it lets your radio behave as normal
but if you are more than 2 degrees away, make it so radio coef is 0
yeah that would be possible. But you don't know the source/target of a radio transmission in SQF
You can't get transmission source in SQF?
correct. You can only see that someone is talking or if you are receiving a transmission (1.0 only). The second one actually isn't needed but people wanted a eventhandler for receiving a transmission
Can you check if a unit has a radio?
Could you check if ANY unit with a radio is within 2 degrees when transmission is being received?
What if you restricted the radio being tracked to something that isn't in use elsewhere in the mission?
Like if everyone is rolling with PRC-152s, only track FADAKs
That's too bad, would be really fun mechanic
If it's something that would be significantly easier to do from within the mod itself, you should still totally think about adding it
If you want stuff like directional radios. Then you should use ACRE.
TFAR is made to be simple
I'll try scripting in one and see how bad it actually hits the performance, what was that command that checks if a transmission is being received?
couldnt figure it out, just went with:
_infTeams = ["OIA_InfTeam","OIA_InfTeam_AT","OIA_InfTeam_AA","OI_reconPatrol"];
_unitarray = ["Unit0","Unit1","Unit2","Unit3"];
_unit = (configFile >> "CfgGroups" >> "East" >>"OPF_F" >> "Infantry" >> (selectRandom _infTeams) >> (selectRandom _unitarray) >> "vehicle") call BIS_fnc_getCfgData;
limiting to 4 units
"Added: A new '#' script operator (works in the same way as select, but is shorter to write and has higher priority than math functions)" Does this mean we can now write _whatever # 0?
yes, but you'll get spanked.
also it's only for Array select index - all other syntaxes are not covered by #
Ahh, got it, cheers
and be very wary about its use when you are also using any preprocessor stuff
Has anyone had any issues with addActions on objects and having trouble getting the right angle on them for the action to popup since the last update? This is especially noticeable with info stands
Now you mention it. Yesterday during a playtest just to confirm DLC didn't break too much, we did have problem with a huge cluster of crates (one object). It could only be accessed from two out of four sides.
Yeah I'm thinking they've broken something with the changes they did with actions. Probably worth creating a ticket for
So as for 1.82, when tank (or any vehicle?) is close to some damage area, like destroyed building or indirect hit, it performs some scripted engine explosion, which doesn't respect any handlers. Thanks BIS.
UPD: Also some setDamage-like actions are also present. Even over >1 which means HandleDamage doesnt give any f...
How does ACE function compilation caching work? Everything is compiled into uiNamespace in XEH_preStart.sqf . Then later everything is compiled into missionNamespace in XEH_preInit.sqf again?
That's CBA not ace.
"Then later everything is copied from uiNamespace into missionNamespace in XEH_preInit.sqf"
? But both preStart and preInit simply runs all the PREP definitions which expands into compile preprocessFileLineNumbers
it doesn't expand into compile
https://github.com/CBATeam/CBA_A3/blob/master/addons/xeh/fnc_compileFunction.sqf That is what PREP calls
unless you disabled function caching
Ah I see. Since I am targeting CBA but using the structure of ACE, I should still keep my preInit something like:
ADDON = false;
#include "XEH_PREP.hpp";
ADDON = true;
yeah
So CBA recompilation only works if you use CfgFunctions?
My bad, I got it confused because certain modules of CBA does
CfgFunctions is BIS code. Which afaik also does caching. aka compile once at gameStart and then just copy on preInit
so essentially the same as CBA
But if ACE uses CBA then why they have their own cache wrapper?
E.g.: PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END;
That does nothing
unless the CBA cache is disabled.
That's used so you can ingame call [] call ACE_PREP_RECOMPILE; to have all functions reload/recompile. So you don't need to restart the mission to reload scripts if you are testing/dev-ing stuff
Ahh okay gotcha. Thx.
Hey, is the " radioChannelCreate " Command not working for anyone else in MP servers? I have tried the third example on https://community.bistudio.com/wiki/radioChannelCreate but yet nothing works.
I could swear I already read that message before 🤔
Where did you execute it?
correct, I got no answers tho. Twas late at night maybe now people are on :)
And i exucted it globally locally and on server none of them did anything
get a radio channel added to side/global/direct and stuff like that
i used the script a while ago and thats what it did and it worked
As Example 3 shows you have to add the channel on each player
i tried to run example 3 on server and yet nothing happened, Do i need to do something else to add it to the players?
I never used that command... And I'm already through all my guesses 😄
Damn, It just seems a update broke it
i have used that exact command before and it worked
i tried it yesterday and suddenly nothing happens
Ive used radioChannelCreate before with no problems. Only issue I had was occasionally players would randomly get removed from the channel after being added with radioChannelAdd (clientside)
Havent tried it since the update though
Did you use a altered script or the same one on the wiki?
A bit different. Created the channels serverside with publicVariables using the return value of the command. Then used that to radioChannelAdd them on the clients
ahh oke
Server:
SR_radioStaff = radioChannelCreate [[1, 0.5, 0, 1],"Staff Channel", "[Staff] %UNIT_NAME", []];
publicVariable "SR_radioStaff";
Client:
SR_radioStaff radioChannelAdd [player];
@willow trail
Thats how I did it
Thanks i'll try it in a bit once im done verifiying arma 3
ok
You only have to make sure that player isn't null and SR_radioStaff isn't nil.
Yep
I wonder, does access to the channel carry over after respawn?
What am I better off using for general vehicle/object position adjusting over water and over land? Or for storing building positions in a database? PositionWorld/PositionASL/PositionATL?
World or ASL I'd say, because you can actually use vector math on them, because their z=0 is on a flat plane and not dependant on terrain.
With ASL you can change the object type and it still works, World you can't (unless they're all soldiers) and is faster.
why can't you change object type with world?
doesn't world use model origin just like ASL?
Yeah, but different models have different distances from their center to their LandConntact, so you get things that float or get stuck in the ground (thus rocket jump thanks to physx).
how does LandContact influence that?
I thought ASL and world use the same model origin
If you put LandContact over the ground, your vehicle falls down.
ASL and World use the same z=0 for the map, but a different point in the model.
That was what I meant with doesn't world use model origin just like ASL?
and you said yes. Now you say no
Depends on what you mean by origin. Thought you meant the model.
Origin implies a point, z=0 for ASL and World is a flat plane.
model origin is 0,0,0 in model local coordinates
generally. Unless you use some mempoint for some reason
quick question: iirc one can create an array filled with 0 for example; how could I instantiate an array of 99 0s for example? besides _array = [0,0,0,0,(…)]
ASL doesn't use the models origin at [0,0,0].
for to loop with pushBack
what does ASL use then?
Something that uses the model origin should be the most exact thing
_array = [];
_array resize 99;
_array = _array apply {0};
ASL uses a point in the LandContact lod.
Thanks didn't know that. Is that written on the wiki even?
I didn't know anything does that
I thought they all use the model [0,0,0] origin
besides things like eyePos that obviously use a mempoint
Well, otherwise getPosATL wouldn't report z close to 0 everywhere.
@little eagle thanks! I totally forgot the resize
World using the origin, and ASL using the land contact is the only reason World is faster than ASL.
I use it for the CBA keybinding stuff: https://github.com/CBATeam/CBA_A3/blob/master/addons/events/XEH_preInit.sqf#L90-L92
I think ill use PositionWorld, seems the best option for what I have in mind. Thanks for the run down.
for storing positions and restoring them exactly as they were World sounds more appropriate
Yeah thats exactly what im wanting
Also Intercepts direct position access thingymabob returns worldpos 😉
tf is that again?
@still forum Here's your doc, indrectly: https://community.bistudio.com/wiki/getPosWorld
It's the dough that makes the cookies taste good
tf does that mean again?
When and how is the proper way to read your CBA settings? See some use CBA_settingsInitialized event, but is that the official way? It is not listed on https://github.com/CBATeam/CBA_A3/wiki/CBA-Settings-System
@errant jasper if your setting is called MY_setting_stuff then you read it by writing MY_setting_stuff because it's a variable
@lone glade wrong mention... kinda
Well that is simple.
You could also do:
"MY_setting_stuff" call CBA_settings_fnc_get
But why?
Guess it works in ui namespace.
And I can safely read it in post init?
If your cba_settings_fnc_init function is preInit, yea.
I'm looking at making my own version of the bis sectors. I currently have a function that finds any markers with sector in the name and initalizes a loop that just checks for blu and opf count inside the sector, should i just make one giant loop for all the markers or do it individually like i am right now?
They all exit when the alpha of the marker is zero
Or does it even matter?
I'd say one loop and work with an array of markers. Instead of killing the loop, remove the marker from it.
Okay, sounds good.
does anyone know if being incapacitated with Revive triggers the "Killed" Event Handler?
Anyone know what the issue is here? Like in-game it works fine but ends up in the log stating that there is an error :S
} else {
(_lines select _line) select _step setVariable ["rangeT>
17:28:19 Error position: <_line) select _step setVariable ["rangeT>
17:28:19 Error Undefined variable in expression: _line
17:28:19 File mpmissions\__CUR_MP.Malden\ranges\range6\full.sqf, line 18```
Code
```sqf
params ["_run", "_line", "_step"];
_lines = [
[range6_1,range6_2,range6_3,range6_4], //Line1
[range6_8,range6_7,range6_6,range6_5] //Line2
];
if (_run == "true") then {
//CANCELS THE FIRE RANGE
{
_x select 0 animate ["Terc",1]; _x select 0 RemoveEventHandler ["MPHit",0];
_x select 1 animate ["Terc",1]; _x select 1 RemoveEventHandler ["MPHit",0];
_x select 2 animate ["Terc",1]; _x select 2 RemoveEventHandler ["MPHit",0];
_x select 3 animate ["Terc",1]; _x select 3 RemoveEventHandler ["MPHit",0];
} forEach _lines;
} else {
//RUNS THE FIRE RANGE
(_lines select _line) select _step setVariable ["rangeTime", diag_tickTime, true];
(_lines select _line) select _step setVariable ["rangeLine", _line, true];
(_lines select _line) select _step setVariable ["rangeStep", _step, true];
(_lines select _line) select _step animate ["Terc",0];
};```
exactly as it says. _line is undefined
whoever called the function maybe passed nil to it
Yea but it can't be, like it's executed like this ["false", 0, 2] execVM "ranges\range6\full.sqf";
that's why, actually let me log it and see if it is empty or not
Nvm, seems that it is working till it should be executing the next row of targets. Thanks tho!
that part actually works, I wanted it to be a boolean but for some reason arma doesn't like it if I use that in a if statement so I just did the most simplest shit u could do.
_run = true;
if(_run)then{systemchat "Know your basic stuff"};```
oO
I guess you tried if(_run == true), or?
I know, like I said just did the simplest shit I could do, I just want the system to work after that I'll cleanup the code.
and yes to that question
I'm use to php in which if(whatever == true) would work but arma said no that doesn't work, so I just added it to a string for the time being xD
=}
in php bool == true makes equally no sense as in Arma or any other language
it's super weird as I use attach a MPHit event handler to the target and when it get hit it should send up the next target which it does perfectly and looking at the scoreboard gives the correct time as well but for some reason the error appears.
_oldTime = (_this select 0) getVariable "rangeTime";
_oldLine = (_this select 0) getVariable "rangeLine";
_oldStep = (_this select 0) getVariable "rangeStep";
(_this select 0) setVariable ["scoreTime", (diag_tickTime - _oldTime), true];
(_this select 0) animate ["Terc",1];
(_this select 0) RemoveMPEventHandler ["MPHit",0];
if (_oldStep != 3) then {
{
if (!hasInterface && !isServer) then {
diag_log format["_oldTime %1 | _oldLine %2 | _oldStep %3", _oldTime, _oldLine, _oldStep];
["false", _oldLine, _oldStep+1] execVM "ranges\range6\full.sqf";
};
} remoteExec ["call", HC];
};
wouldn't matter tho, it works just fine in php as if u just entered if(bool) in php, it's a habit ^^
Since the code is working I'm just canceling it if it's null.
Question, lets say I get a variable which then some how turns out to be null, could you do for example like this getVariable "scoreTime" || 0 to give it the 0 if it's null. I know in lua could do that, thats why I'm asking.
@inland badger ```sqf
_this getVariable ["someNumber",0]; //returns 0 if nil
@ruby breach Cheers bro! 😃
[[_msg,"PLAIN DOWN"],"cutText",true] call BIS_fnc_mp;
?? doesn't work for fnc_MP?
[_msg,"PLAIN DOWN"] remoteExec ["cutText"];
still giving same, found string expected array error.
well yes.
all variants of cutText expect a array as right argument
you are passing a _msg which I guess is a string. and a string.
just also give a layer number to not confuse it
[[_msg,"PLAIN DOWN"]] remoteExec ["cutText"];
this works.
I was confused because example show things like
"parameter" remoteExec ["hint"];
so I guess remoteExec, packs strings into a single element array before sending, and doesn't send parameter as a string.
Right. And for cutText you need an array as a parameter. Your first example sent two strings as parameters
Hey guys.. i just discovered a strange behavior...
i worte a script to chop down trees in a jungle and used _x setdamage 1; to get the falling tree animation.
3 seconds later, the tree will be hidden by _x hideobjectglobal true;.. but this isn't working in MP but in SP / Editor it works fine...
Does someone know this behavior or a way hide the tree after destroying it?
Are you calling hideobjectglobal from the server only?
"Call on the server only. " from https://community.bistudio.com/wiki/hideObjectGlobal
It does at least explain your problem 😃
I wish the wiki made this more clear generally, would be nice to have the index show markers for server only or everywhere commands etc. For now you have to scour the docs and learn every commands quirks.
it's arma.. why should it be easy?
Purposefully made hard to keep you guessing.
Thanks for the help earlier guys. Helped me make a replacement look-alike from T&E from ACE 2: https://imgur.com/fGNIG4e
@tough abyss thanks mate... is working now -.-
Is there a script for disabling the gmg on the marid?
Won't that remove the 12.7 ammo too?
this removeWeapon "missiles_titan"; for example
I don't know what the gmg is called (script wise) but you should be able to find it if you locate it in the functions viewer
Okay so quick question here, anyone here who has any experience with the 360 Degree Training course or making shooting ranges with a scoreboard?
Why? It says what's wrong.
i use forEach for array, and i check array in this script
typeName is ARRAY
but not for arma
Well, the code block too has to not be a string.
So maybe that's where you got it wrong.
post the error and the code then we can help you
23:11:27 Error foreach: Тип Строка, ожидался Массив
23:11:27 line 343 ```
_sls_lb lbAdd "Empty";
} else {
{
[_x,_forEachIndex] spawn _getPlayerTrd_listFill;
} forEach _data;
}; ```
systemChat returns array
that is array:
[[34,0,""30Rnd_556x45_Stanag"",100,7,48,""76561198029642630"",""1"",""TR""]]
@little eagle no, code block not in string 😦
Your code obviously says to use forEach on _data only when _data is NOT an array.
Did you miss that it says else?
in another place of script i use this construction and it works 😕
No, your logic is inverted.
if (_data isEqualTo []) then {
// _data is an array
} else {
// _data is NOT an array
};
Yet you use forEach _data exactly when _data is not an array.
That will error and that's a good thing.
isEqualTo like isEqualType?
omg
Let's start over.
_edt_cn ctrlSetText ">
Why does it print this line? That seems like a different line than the forEach.
this line right after forEach
Can you post the whole error?
This starts at line 2 or 3.
Why does an ui script use spawn? This looks weird.
Also 343 lines sounds concerning.
changed a little bit script, but error still
i use spawn because in all ui scripts 😄 don't know why
} forEach _data;
} else {
_sls_lb lbAdd "о
23:41:05 Error position: <forEach _data;
} else {
_sls_lb lbAdd "о
23:41:05 Error foreach: String, ожидался Array
23:41:05 File C:\My documents\Arma 3 - Other Profiles\TR\mpmissions\TR.Malden\code\auction.sqf, line 341
{
[_x,_forEachIndex] spawn _getPlayerTrd_listFill;
} forEach _data; << line 341
} else {
_sls_lb lbAdd "Empty";
};```
Just post the whole thing. No one knows what _data is, except that it clearly is a string.
pastebin or something.
Github gist has syntax highlighting.
idk, that pastebin added
my code starts from seller = {
(count _data > 0)
but
_data is string
count works on string and array.
For string reports the length of the string, where it counts non ascii as 2 or 3 chars, and for array it reports the size.
_getPlayerTrd_listFill is completely undefined.
Okay, I think I know.
Check _getPlayerInv_listFill
You probably use a variable called _data there and missed using private.
This is why private ARRAY is cancer.
You WILL miss a variable.
Only a matter of time.
@little eagle you are a genius, everything works 😃
phew, redeemed.
Well, the proper fix is to correctly use private in every function.
whats the best way to spawn in AI with commands?
I spawned in a blufor man with bis fnc spawnvehicle, set his side to WEST, and was playing as blufor, and he shot at me and killed me, does anyone know how to fix that?
If units from the same side shoot you, you probably were marked as renegade, because you killed too many friendlies or civilians.
player targets [];
For some reason the debug console is returning nothing, even though there is a guy right in front of me, but the Wacth is returning the aray
what are you trying to achieve and how
just the the aray
Anyway, seens like my debug console is broken, nothing works on it.
Do you have BIS_fnc_debugConsoleExec allowed in CfgRemoteExec?
Watch fields don't use it, which may explain your issue
Skip the panelWL variable alltogether, orherwise it doesn't work.
Skip the panelWL variable, otherwise it doesn't work.
A exemple is this
_unit = player;
_targets = _unit targets [];
_targets;
returns nothing on the debug but it returns on the Watch
what is going on?
what do u mean skip it? i want these Licenses to be in the combo
Your script is broken though due to this variable.
private _test = ["license_civ_pilot","license_civ_dive","license_civ_gun","license_civ_rebel","license_civ_dive"];
private _index = lbAdd [9902, _test];
lbSetData [9902, _index, _test];
lbSetCurSel [9902, 0];
?
private _test = ["license_civ_pilot","license_civ_dive","license_civ_gun","license_civ_rebel","license_civ_dive"];
{
private _index = lbAdd [9902, _x];
lbSetData [9902, _index, _x];
} forEach _test;
and i keep the lbSetCurSel at the end?
No, why? It's pointless. The first (0) element is selected anyway.
oh k
{
if (isPlayer _x and (_x != player)) then
{
_uid = getPlayerUID _x;
_index = lbAdd [9901, (name _x)];
lbSetData [9901, _index, _uid];
};
} forEach TW_panel;
if i remove _x !=player will i be albe to see my self?
Now my config view is strange too
https://ibb.co/dDGNP7
rip lol
The config viewer is scripted with scheduled code, and so by nature, it has tons of race conditions. If you're unlucky, it just dies.
race conditions?
@little eagle how do i paste my code in a box like u did
```sqf
player addItem "ace_banana";
```
🤔
player targets [];
For some reason the debug console is returning nothing
targetsdepends onknowsAboutvalues, Roque_THE_GAMER
race conditions?
Yeah. When different script instances are executed at once and run against each other resulting in unstable and unpredicatble results. Especially nasty when the broken behavior happens rarely, but consistently.
@meager heart but why it does on watch?
what ?
The debug console is returning nothing but the Watch is returning the aray
"Watch" is part of the debug console
But, as commy says, that maybe have to do with my scripts being shit
sounds trueble* 😀
Nah, the config viewer is not your script, though I guess a bad custom scheduled script can fry the scheduler faster.
if you not going to cringe, i show you
private _test = ["license_civ_pilot"]; in the arrays should it have "' , or ``
so both?
one of them
ye
both work
k
what if i wanna add more than one
private _test = ["license_civ_pilot","license_civ_drive"];
??
Yes.. That's... yes.
ty
on that page ^ in examples _mySingleArray = ["Item1","Item2]; missing "
🤦
`private _test = ["license_civ_pilot","license_civ_drive"];
{
private _index = lbAdd [9902, _x];
lbSetData [9902, _index, _x];
} forEach _test;
` this isnt working xdd help plz
@molten folio
```sqf
<code>
```
private _test = ["license_civ_pilot","license_civ_drive"];
{
private _index = lbAdd [9902, _x];
lbSetData [9902, _index, _x];
} forEach _test;
xddd
what do u mean copy paste?
-_-
@molten folio put a space bellow the sqf
its not showing in the combo
If the control is on the currently "active" dialog that should work
them paste it
also you can press SHIFT+ENTER for the new line
i have another sqf file for players which works fine
inside code block you can just press ENTER @meager heart
The code snippet has no combo box.
The code snippet on it's own does nothing, the error is probably somewhere else.
The code snippet has no combo box.
The code snippet on it's own does nothing, the error is probably somewhere else.
¯_(ツ)_/¯
https://community.bistudio.com/wiki/lbAdd
"Adds an item with the given text to the listbox or combobox with id idc of the topmost user dialog. "
If it's not on top. it won't work
which is probably your problem
Or maybe the idc is wrong. Or maybe the idc is used already.
Could be a thousand different things, but my 🔮 is malfunctioning.
made it like this
{
private _test = ["license_civ_pilot","license_civ_rebel"];
private _index = lbAdd [9902, _x];
lbSetData [9902, _index, _x];
} forEach _test;```
@still forum this what u mean ?
Okay, let me spell it out. You need to post more of your script, otherwise no one knows what you're doing and where it may fail.
Main.sqf
_k = createDialog "panel";
buttonSetAction [9903, "[] spawn life_fnc_givingWl"];
buttonSetAction [9904, "[] spawn life_fnc_removeWL"];
TW_panel = playableUnits;
{
if (isPlayer _x and (_x != player)) then
{
_uid = getPlayerUID _x;
_index = lbAdd [9901, (name _x)];
lbSetData [9901, _index, _uid];
};
} forEach TW_panel;
lbSetCurSel [9901, 0];```
Whitelist.sqf
```sqf
{
private _test = ["license_civ_pilot","license_civ_rebel"];
private _index = lbAdd [9902, _x];
lbSetData [9902, _index, _x];
} forEach _test;```
How are these executed?
^ if this was up to me I would say with a guillotine
these are exectued
with a hotkey
main.sqf works fully fine
but only main is exuted
do i need to #include ''whitelist.sqf"?
or [] spawn life_fnc_whitelist
?
Well, you do have to execute Whitelist.sqf somehow. Scripts don't magically activate themselves.
Did you define life_fnc_whitelist somewhere?
yes
Use call not spawn, for justice.
Also fix _test being undefined.
ye will do
so, if i wanted to add an action and only add values for title, script, and condition would I be able to do that without putting all the rest of the parameters?
Anyone know how to get
C_Van_02_vehicle_F Van (Cargo) Laws of War DLC vehicle
to have the rear passenger option enabled if spawned via createVehicle
•AnimateSource does not have any options for this
•By default, it seats 2 and holds cargo in the rear; Using virtual arsenal/vehicle customization, you can select an option allowing for seating in the cargo area floor.
"rear passenger option" ?
don't know what you mean by that, but probably addAction will helps 😀
@meager heart i am using addAction, but is there a way to skip all the other parameter and only put title script and condition instead of all this: [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection]
you mean _something addAction ["Text",{}];?
or
_id = _object addAction ["Action text", {/* code */}, [], 1, false, true, "", "<condition>"]; //nothing after the condition check ?
check wiki, if the parameters marked as (Optional), they are optional, you don't have to use them, in that case will be used default values
@glad venture
would i just put like [title,script,,,,condition] ?
if you mean skip arguments, priority, showWindow, hideOnUse, shortcut then no
you can skip radius, unconscious, selection after condition
so i just put in default values
If I add an MPKilled event handler, do I have to add it again if that player dies and respawns?
Is there a way to cancel doSuppressiveFire?
Also is there a way to set a UAVs name so it doesnt show up as a human
I tried that and it didnt work
do I need to try doing like (driver this) or something?
What?
if I just do this setName it doesnt work
do I need to do (driver this) setName or something?
What are you trying to do?
Make it so when you look at a Phalanx it doesnt show a generic person name like "Chalie Miller"
And it's placed in the editor and you're trying to do it via init box?
yeah, but I also need to do it via script in another mission I have
Can't you just double click the ai and rename it from the ui?
It doesnt have an Object: Identity tab like people do
Give me a minute, I'll try something with the game running.
If I look at the turret, it says "Praetorian 1C", not a name.
No "Chalie Miller".
effectiveCommander this setName getText (configFile >> "CfgVehicles" >> typeOf this >> "displayName")
Try this. Are you on a dedicated server?
Right now Im just running in editor
Well, I can't repro. Not what happens for me. Is the thing on bluefor or indep?
the thing you gave me works
Yeah, but I'm not sure it works on remote machines, MP.
according to Waffle SS it does not work in MP
That's not why, lol the comments on the wiki.
I'm starting a second instance of the game to test local hosted MP.
Not too big of a deal, since my missions in MP run difficulty where no name tags show
Also here is the script im working on if you have any suggestions
Problem is that there's a name randomization script by bi, and that could cause a race condition.
Race condition?
Two script running at the same time, whichever finishes last is the one taking effect.
Roughly.
Also any reason why [[[(getPos _CIWS), 1500],[]],[]] call BIS_fnc_randomPos; returns invalid so often?
Yeah, doesn't work in MP. But if you don't need to use it there, it's fine I guess.
My script or the name thing?
The name thing, well, it seems like it does work after a time.
OK, it is a race condition on clients. The command works fine in MP and the wiki is wrong again.
this spawn {
effectiveCommander _this setName getText (configFile >> "CfgVehicles" >> typeOf _this >> "displayName");
};
This makes it so it's executed after the name randomization synch script by BI.
Even on clients.
Also any reason why [[[(getPos _CIWS), 1500],[]],[]] call BIS_fnc_randomPos; returns invalid so often?
Dunno, I never used randomPos function. I don't even know what it does.
Picks a random position while evaluating whitelist and blacklist conditions
the way I have it, it's picking a random position within 1500 meters of _CIWS
Maybe there is no position that fits your blacklist conditions in the area.
I don't see this function in the ArnA 3 wiki
Only Take On Helicopters
Introduced Arma 3 in V1.0
Ah
I mean it works like 4 times out of 10
I could understand it failing if I had blacklist conditions
I think your syntax is wrong.
drawIcon3D supported parseText?
Too many brackets?
@radiant needle Use this one instead of the BI function:
private _randomPos = _CIWS getPos [1500 * sqrt random 1, random 360];
why times square root random 1?
Because the area of a circle grows with it's radius to the power of two. If you didn't use a sqrt'd random number, it would make the distribution biased towards the center.
yeah but you arent evaluating the area of anything
1500 is the radius around _CIWS
Yeah but isnt getPos just creating a vector