#arma3_scripting
1 messages · Page 318 of 1
Ah ye, time is just for how much time has passed since mission start
Or since you are in the game with display #46
if this command still works, this is the most optimal method for me personally: https://community.bistudio.com/wiki/estimatedTimeLeft
the "CAN_COLLIDE" tag for create vehicle will drop the barrel to the ground if it's floating above something correct?
Well that wouldn't make any sense if it returns localy okay then it should be fine on remote? Unless the object only exists locally and the effects of the bullet are handled somewhere else? 🤷
^ just throwing ideas out there
@tough abyss https://feedback.bistudio.com/T70699
if (isNull _projectile) then {
_projectile = nearestObject [_unit, _ammo];
};
Oh, projectiles are like createVehicleLocal objects
only exist on their local machine, but everyone has a copy
aha!
that wouldn't work anyway. attachTo doesn't work for CfgAmmo
could sync the marker instead of the projectile
but yeh doesn't seem very efficient
but i thought i would ask here wats wrong with this code http://i.imgur.com/KmsJcI1.png
missing { } around the event handler code
player addEventHandler ["respawn", { enable fatigue etc }]
thank you sir , i wish you a great day 😃
newguy question-- i had an idea to use an array of logical expressions in order to test the end of a waitUntil loop. Can you use expressions in arrays, or is there a better way given a bunch of ending conditions?
I guess my assumption is that all the logical expressions to test end have to be on the last line after a sleep
_myWaits = [
(!alive _unit),
(isNull _item),
(_timeOut < time),
(unitReady _unit)
];
waitUntil {
sleep 1;
{
if (_x) exitWith {True};
} forEach _myWaits
}
does something like that work?
I thought about wrapping the expressions in {} inside the array variable, but I didn't know if that would create some weird scope issue
would the forEach still exit properly with true -- as so end the waitUntil
hmm yeah not certain about that
if not, could use breakOut
but it might work anyway
yeh i agree.. don't like using them
you could also just do like _done = false; { if (call _x) then {_done = true}; } forEach _myWaits; _done
yeah that works-- and it's easy to read too
thanks-- i hate ask such questions but even simple in-game tests are still difficult for me to setup
yeh the original would be better if it works (won't check unnecessarily)
getting a function recognized by the game seems the hardest part of all of this
i'm only a week into this-- i've not figured all that out yet
debug console just lets you run any working code (unscheduled though, so can't sleep unless you spawn your code)
without restarting the game, etc
or mission
cfgfunctions is just a convenient way to declare/compile all your sqf files:
https://community.bistudio.com/wiki/Functions_Library_(Arma_3)
hehe There is currently no text in this page.
need to add the ) back to the url, discord breaks it
facepalm thanks
I've been reading KillZoneKids blog -- it's been very helpful with the basics
thanks for the quick assistance
Are there any full guides on ArmA 3 scripting/editing that are written within last 12 months?
I don't know of any full guides. Back in ARMA or maybe ARMA 2 I remember someone made huge PDF that was the bible at the time for scripting. But so much changed over time.
Yeah. I've been really looking forward to getting into ArmA 3 editing/scripting. But it just boggled my mind when I found out there wasn't an official editing guide.
I found little scripting problems like above are actually some of the easier things to deal with. Setting up a work enviroment, build/make, testing. That's all the soul crushing stuff for me so far
Everything takes 20x longer than you think it would
I'm gutting it out so far
So how does lbSetPictureRight work in the arsenal menu, but I cant seem to get it working in any of my menus?
Any way to add in dialog, a button, to connect to an server, with ip and port ? ( i want to modify my main menu of the game)
Don't think it's possible
@inner cypress I have been working on a SQF analyser to cut dev time exactly for these type of things. https://github.com/LordGolias/sqf
It may be useful for you, as it is being for Epoch and Exile devs.
@thick sage thanks -- someone pointed me to yesterday for use with atom. It must be very good.
let me know if you need help installing it (I am always searching for people to use it, because the more feedback (aka bugs) I get)
Disregard my question above ^^ Was doing something wrong.
@thick sage This can be useful, if we can use it with Atom ❤
@little oxide : https://atom.io/packages/linter-sqf
@thick sage Hooo, thanks dude
in my script i need to read config properties of hitpoint classes. Problem: with the EH eventhandler i only get selection names. I can turn that into classnames (strings) no problem. But then there are 2 more problems - 1)hitpoints in turrrets are not under the same config path as regular hitpoints. 2) all turrethitpoints (HitGun, HitTurret) have the same name for every turret... How would i be able to get the config path of a specific hitpoint in this situation?
iterate through all class HitPoints and identify them by their selection name.
Turret paths can be found with the allTurrets command.
They correspond to how you would use ((_cfgVehicle >> "Turrets" select 0) >> "Turrets") select 0 >> "HitPoints"
which is turret [0,0]
_firstTurret = (_cfgVehicle >> "Turrets" select 0) <- thats a syntax one can use?
I think so. Maybe I'm off with the parenthesis, but you should get the gist.
_cfgVehicle >> "Turrets" select 0
corresponds to turret path [0]
And all the classes inside all "turrets" classes are turrets that have class "Hitpoints" and all of those have unique selection names. Each turret can have additional "Turrets" sub classes.
yes i know
Not all hitpoints are valid though. They only are if the selection exists in the model.
i use "HitTurret01_01" as selectionname for 1st subturret of turret 1 for example
Can be checked with getAllHitPointsDamages or whatever it was
It's a huge PITA and sucks all around imo.
i know the pathNumbers to the turret from the selection, just not the name of the turretclass or its parrents. If the "turrets" select 0 would work that would make things much much easier
e.g.
_path = ( _cfgVehicle >> "Turrets" >> "Turrets" select 1 >> "Turrets" >> "Turrets select 0" >> "HitPoints" >> _desiredHitpoint ) for 1st subturret of turret 2 ?
that is wrong. check out config select number syntax
_cfgVehicle >> "Turrets" >> "Turrets" select 1 >> "Turrets" >> "Turrets" select 0 >> "HitPoints" >> _desiredHitpoint )
just a misplaced quote mark I think
no wait
_cfgVehicle >> "Turrets" select 1 >> "Turrets" select 0 >> "HitPoints" >> _desiredHitpoint )
again, not sure if this needs parenthesis
[1,0] turret
EXTdb3 question: say I have 3 fields ... Index, uid, and allowed in a table. Does it make a noticeable performance difference if I create an array to store all of those values at server start or just check the value of allowed using onPlayerConnected?
ie checking only executing when the player connects ... or just making a large array of all the known values when the server starts up?
For sake of argument .... on a 100 player server?
// the list of all men, including in vehicles and the dead
_listMen = entities [["Man"],[],true,false];
// the list of alive men only, including in vehicles
_listAliveMen = entities [["Man"],[],true,true];
// filter out those alive from the list of all men
_corpses = _listMen - _listAliveMen;
Is this a reasonable way to accomplish this? I could iterate through the first list and test alive _x, but I'm not sure which is optimal
on one side, it compiles all of the information at server start and just runs a quick check to see if they are allowed
on the flip side, I lose a valuable piece of the puzzle .. the ability to flip the bit in "allowed" in the database without having to restart the server
just tell the player ... disconnect and reconnect and boom! you are allowed. Whereas the former, I have to tell them to wait until server restart
Thanks.
yw
When would it be fired? On a runway
Ahh. I seee, one of those faked runways sort of placed near the carrier.
Ohh. landing canceled huh? CANCELED.
(╯°□°)╯︵ ┻━┻
I swear to god they used google translate for that shit, I translate the Czech translation back into english and it spits out "canceled"
I've seen it still spelled cancelled in the uk. ¯_(ツ)_/¯
it's canceled in the US and cancelled in the UK 😛
¯_(ツ)_/¯
is there an easy way to damage/ kill a unit or vehicle via script, but have it react /make it so the instigator is another unit or vehicle?
Right now for example my damage script causes destruction of a vehicle and crew if ammo was hit. But since the damage is scripted, a team killer would receive no penalty for example and killed EH returns "" as instigator.
what about: handleDamage EH -> SetVar on Veh about last instigator -> script checks for last instigator?
so you mean i should save the instigator on the veh and then use scripts on killed event to manually set the score? Thats the hard way i would like to avoid... as i would have to replicate the entire AI reaction and score system
or is there a default vanilla variable for the last instigator for such things?
how would i create a group and join that same group? i was looking at the join thing but i dont understand it. if someone could type up a example? thanks
[player] joinSilent (createGroup west)
_group = createGroup west;
[player] joinSilent _group;
etc
can you create as group in civilian?
sure
ok thanks
taking a position2d as a parma -- is position2d also a type? does anyone have a typical guard expression for them?
params
position 2D is just an array of size 2 instead of size 3
either only take arrays on length 2 or take any length greater than two and resize
i think most of the commands even plain take normal position arrays too btw
marker creation ones do
just be aware get you use getMarkerPos it will be position2D not 3D
ok-- i eventually use it in a distance2D expression
distance2D takes normal positions too
_unit distance2D _refPosition > CONSTANT
aye but I would like the distance to be agl only
it will just ignore the Z component tho
no difference between using a normal position or a normal position with Z snipped off
ohh really? ok.. well then. thanks
how do i get someone to leave a group?
how does grpnull work
[_unit] joinSilent grpNull
ok and what does it do? join another group or ...
ok thanks
Would anyone know what this means? 0:08:44 Skipping mods and signatures due to overflow flag being set. Could it be a variable being too big?
this sounds more like some engine thing during startup
It was not during startup, it was after a syncing script of mine ran
What's the syntax to create a group's waypoint on a marker?
What do you mean "syntax" waypoints and markers aren't inheritely associated.
you could add a waypoint at a marker position (getMarkerPos "MySuperCoolMarker")
Ex: (Yes I did grab a biki example because I am in rush of time) _wp =_grp addWaypoint [(getMarkerPos "MySuperCoolMarker"), 0];
_grp being deinfed like: _grp = createGroup west;
@subtle ore, that's exactly what I needed! Thanks!
@shadow sapphire Sure thing.
Can anyone tell me how to create a waypoint for an AI group based on another existing AI group's waypoint?
This is what I'm doing currently:
private _wpPosition = waypointPosition _waypoint;
_wpPosition = _wpPosition getPos [100, 0];
_waypoint setWPPos _wpPosition;
} forEach waypoints _G4;```
What'm I doing wrong?
@shadow sapphire I'm pretty sure getPos in this situation still contains 3 numbers just like a regular position array. Don't see as to why it wouldn't.
getPos?
what;s the error?
No error, it's just not executing anything.
The code looks like it just moves the waypoints of _G4, not create new ones for a new group.
Ah! Okay, so I need to create a waypoint first??
No
All you do atm is move the old waypoints.
You need to create the waypoints for the seperate group with the data from the other group.
Yeah. The other group isn't even part of the script. Only _g4
No surprise that nothing happens.
All you do is move the waypoints of _g4 100 meters north.
No, that's not the whole script.
It'll work now. Wait one, then I'll share complete script.
Working perfectly now.
Sleep 1;
_G1 = [(getMarkerPos "M1"), EAST, ["I_Soldier_SL_F","I_soldier_F","I_Soldier_M_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G2 = [(getMarkerPos "M1"), EAST, ["I_Soldier_TL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G3 = [(getMarkerPos "M1"), EAST, ["I_Soldier_SL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G4 = [(getMarkerPos "M1"), EAST, ["I_Soldier_TL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G5 = [(getMarkerPos "M1"), EAST, ["I_Soldier_SL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G6 = [(getMarkerPos "M1"), EAST, ["I_Soldier_TL_F","I_soldier_F","I_Soldier_GL_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;```
{
_x execVM "Gear\FN_CentralGreen.sqf";
_x setBehaviour "AWARE";
} forEach units _x;
} forEach [_G0,_G1,_G2,_G3,_G4,_G5,_G6];
_G2 addWaypoint [(getMarkerPos "M2"), 0];
sleep 30;
_G1 copywaypoints _G2;
_G4 copyWaypoints _G2;
{private _waypoint = _x;
private _wpPosition = waypointPosition _waypoint;
_wpPosition = _wpPosition getPos [100, 0];
_waypoint setWPPos _wpPosition;
} forEach waypoints _G4;
_G6 copyWaypoints _G2;
{private _waypoint = _x;
private _wpPosition = waypointPosition _waypoint;
_wpPosition = _wpPosition getPos [100, 180];
_waypoint setWPPos _wpPosition;
} forEach waypoints _G6;
sleep 30;
_G0 copywaypoints _G2;
_G3 copywaypoints _G4;
_G5 copywaypoints _G6;```
Eeeek, execVM
Alternatives?
call compile
Preprocessfilelinenumbers is missing @subtle ore /cc @shadow sapphire
@queen cargo Aye, duh. sorry bout that.
In an optomal world CfgFunctions would be used
Saving the compiled code in a variable is OK too though
@queen cargo Only if something is ran more than once. Otherwise something that runs and closes once the entire game it wouldn't make a difference.
Organization is key
That part belongs to it
Right, but none the less.
Organization indeed. If you have 6 times essentially the same line, then there is much room for improvement.
Getting dizzy from looking at the patterns.
Never used
copyWaypoints
myself.
@little eagle thats where you put it into the functions config.
Whats the alternative? @tough abyss
Aye, i see.
@tough abyss how would you write my script above!? I'd be very curious to see how it would be done your way. I'd like to be a real cool guy and use move/domove.
@shadow sapphire cool kids club 😎
Kool kids klub??
It's not far up, like at all. I'm surprised it's not still on screen.
Can't work that way, I don't think. The markers are just placeholders.
Their waypoints and spawn locations are going to be dynamically determined.
Well, it probably can work that way, but it's over my head.
Well, I'm familiar with it. Our community developer does everything, really. But i read his code.
Haha, yeah, I have had hard times with that, too.
make your scripts case insensitive
For sure! Especially when sometimes the wiki has the wrong shit, you gotta go copy/paste the shit from the editor.
'if(troubled) then {laughItOff};'
I thought this was about in, but the command being case sensitive is legitimately retarded.
No one uses these commands, because no one uses artillery.
Was it you Quik that suggested doc videos or was that dedmen?
_entry in parseSimpleArray toLower str _array
I'd laugh about it, but the BWA3 Leopard does the same :S
So a loop for something that happens twice a mission. 😃
Are they for actually touch down or for using the auto pilot to land?
Is there much control available over the tactical ping? As in detecting it with inputActions or something. Trying to intercept it to prevent it from being used in global channels
Is there a way to unstring a string?
call compile "hint 'a'";
call compile "hint str 123";
https://community.bistudio.com/wiki/compile
https://community.bistudio.com/wiki/call
@warm gorge it could be prevented with a keyDown event just like other arma default keybinds could be
@spark phoenix Yeah I figured out which actionKeys value to use for it. Just a pain to handle it with combinations, such as the shift + t as default, but even then when people changed it to other combinations would be more of a pain
I do know it
What is it?
disableSerialization;
_html = findDisplay 46 createDisplay "RscCredits" ctrlCreate ["RscHTML", -1];
_html ctrlSetBackgroundColor [0,0,0,0.8];
_html ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH];
_html ctrlCommit 0;
_html htmlLoad "http://www.bistudio.com/newsfeed/arma3_news.php?build=main&language=English";
};``` how do i get the html from the control as a string?
@warm gorge ill work on something, with desolation i just disabled it in the cfgDifficulties
Hello,
how and from where does one remoteExec this: player addAction ["<t color='#FF0000'>Group Management</t>","disableSerialization; ([] call BIS_fnc_displayMission) createDisplay 'RscDisplayDynamicGroups'",nil,1,false,true,"",""]; so that every player on a dedicated server gets a Group Management text in their Action Menu (mouse wheel menu) from where they can then access the BIS Dynamic groups functionality?
@warm gorge here is one shit code that works
should work with any inputAction defined and any key combination
given that its a keyboard combo and not a mouse button
This is arguably the worst thing ive ever written so dont judge
just include the header 😛 ?
its a live compile for the DIK_(key) so #define wouldnt work so i just parsed them all in as variables 🤣
🙈
lul
like i said
worst thing ive ever written in the last 2 years of my life
but its just the basic concept i wanted shadow to get
_ids = actionKeys BLOCK_ACTION;
_names = actionKeysNamesArray BLOCK_ACTION;
using ids and names to block shift+T alt+T and normal characters
it's working, if not you doing something wrong or bug ...
Thanks @jade abyss!
[4:42 PM] Dscha:
call compile "hint 'a'";
call compile "hint str 123";
https://community.bistudio.com/wiki/compile
https://community.bistudio.com/wiki/call(edited)
compile
call
Ah, yeah. That was me.
😆
Anybody using aissp script?
Is there a way of checking a player name and by his name determine which classname of vest give to him?
Do it for 20 players without running through all of them
what?
?
Don't answer with a questionmark to a question^^
I didn't know what to say though :I
Is there a way of checking a player name and by his name determine which classname of vest give to him? <- ?
here's an example
I want a player named "mark" to have the vests with the class name "tf24_marciras_assaulter_aor2_mark"
I have 6 versions of this classname, assaulter, grenadier, machineguner, etc,etc
I have 20+ classnames with other names than "mark"
This "playername mark" part is confusing me
am just guessing what you mean
player addVest format["tf24_marciras_assaulter_aor2__%1", name player];```
¯_(ツ)_/¯
uhm, i guess. I still have no clue if that was helpfull or not^^
But the Syntax up there works
yeah that's what I want
(i still don't get, why a player needs the name "mark" to get that Vest. That still confuses me)
so now let's say you are a player and your name is Dscha and I have a classname with "Dscha" in the end. it will be like player addVest "tf24_marciras_assaulter_aor2_dscha";
Yep
I made the vests have the player names on them
sorry I didn't say that in the begining
no, I only re-textured it
But you know.. there will be no Vest added ,when the name is not existing?
it's possible to make the vest have the player name on it without this thing?
Okay okay, wait
wait
So: You want a Texture on a Vest, that shows "Mark", "Grenadier" etc?
depending on, who wears it.
OR
do you want the names of that person (who is wearing it) on a Vest?
Then...
don't do it that way
You end with ... erm... a few trillion names (and configs/Textures) or players don't receive a Vest
I know, I mean only the players in-game will receive their own vests
Outgame wouldn't make sense^^
well yeah ><
oh
I doubt you will have that in your Config, wich would result in:
tf24_marciras_assaulter_aor2_[GGH] HellBoyMasterLeetYOLOSwagL0rd
right ><
😂
(solution: I can't think of any, tbh. Not without draw3D, and that takes alot ofp erformance)
I won't have that kind of name in my group since I force first names and last names
but you're still right
yeah
Even if -> He only Retex them, so adding a HiddenSelection can't be added
there's something else though. what if someone connects with a name I don't have
unless he gets the MLOD (Source)
Thats what i said.
You end with ... erm... a few trillion names (and configs/Textures) or players don't receive a Vest
You better scratch that. Might be a nice idea, but not doable a) without mlod/Source file b) your current knowledge (no offense)
for every name? yes. A select set of names, sure.
keep in mind that would be 6 or so full textures per name and filesize goes up fast
How might I plug BIS_fnc_findSafePos into this?
[((getMarkerPos "M1") findEmptyPosition [20,50,"B_APC_Tracked_01_AA_F"]), 180, "B_APC_Tracked_01_AA_F", _G1] call bis_fnc_spawnvehicle;
Sleep 1;
[((getMarkerPos "M1") findEmptyPosition [20,50,"B_APC_Tracked_01_AA_F"]), 180, "B_APC_Tracked_01_AA_F", _G1] call bis_fnc_spawnvehicle;
Sleep 1;```
so 10 guys already half a GB
@shadow sapphire what do you want with it?
just use it to get you a position, you already use findEmptyPosition there
10MB textures 😄
@indigo snow, I'm trying to spawn an armor troop, but after the first few tanks, they all start spawning inside each other. So, I'm trying to figure out an alternative command to keep them from spawning inside each other.
plug ((getMarkerPos "M1") findEmptyPosition [20,50,"B_APC_Tracked_01_AA_F"]) into BIS_fnc_findSafePos
(or just spawn less tanks)
it's actually 30 but it doesn't make any difference doesn't it? 😦
Not rly, wayyyy to big
well that's the size of the texture :I
Spawning fewer tanks isn't really an option. If they don't have a full armor troop, it won't even be a challenge for my players.
just plug that location into the other function then
I have 14 textures for a name, 7 different camos * 2 textures of the model
although im quite sure that other function already uses that command
I don't understand the syntax. That's why I asked how to plug it in.
look up BIS_fnc_findSafePos in the function viewer
Really, I don't understand what center is or how to designate it.
it takes like 9 arguments
center is probably just a position
the position it searches around
although all of the struggle, there is no other method that takes the name of the player, checks if theres a classname with that name and if there is he will get the item with the name, if isn't he will get tf24_marciras_assaulter_aor2_noname?
Right, but can I put my marker in there as center? I figure I'll just go ahead and try it.
Adir thats easy to do with format amd some checks if the classes exist
DelJ you should check the function documentation
Cant know that by heart
Alright, thanks @indigo snow and @jade abyss
I'm staring at it, but I'm not a scripter, haha. I don't really understand it.
I will try IFs and formats
np
I don't fully understand how isClass works. isClass (configFile >> "cfgPatches" >> "addonClass")
You point it at a config entry
addonclass is the classname of the item?
Since uniforms have config entries, in order to exist it should have a class
Yes but probably not in that place
Reference your config.cpp
Youll want the entry in cfgWeapons IIRC
isClass (configFile >> "cfgWeapons" >> "tf24_marciras_assaulter_cptnnick_aor1")
Update! BIS_fnc_findSafePos is vastly superior to findEmptyPosition.
Not even in the same league. If you ever have trouble with findEmptyPosition, use BIS_fnc_findSafePos instead.
just use the clan or unit texture for this. Way better solution. Works on vanilla stuff too
give every guy a custom texture with whatever logo you want + his name in it
doesnt work on vests, but thats life. Who needs their name on headcap, uniform, weapon, vest, shoes... all at once? unless this is a dementia group...
is there any command available that can check which addons are required by the mission, or which will return the name of the addon that an object belongs to?
i.e. something like getObjectDLC but for addons (PBOs)
_Exp stuff comes from Apex. The rest of the DLC stuff everyone has anyway
@still forum yeah but do you know a way to check this within the game?
like via scripts or something
hmmm i don't suppose
{
if (configSourceMod (typeOf _x) == "tanoa") then {/*do something*/};
} forEach all3DENEntities select {typeOf _x == "structure"};```
would work? I know "tanoa" and "structure" are probably the wrong strings to use, but will `(configSourceMod (typeOf _x)` work or is the full path required?
I'm very sure it needs full path
It's not like the BIKI examples only show full paths. And It's also not like that command expects config and typeOf returns a string...
I guess you can answer that question yourself 😉
yeah that's what i was thinking too, but was hoping/wishing that it work regardless 😛
so is it a good assumption that there's no way to querry addons without knowing the full config path?
Yeah.. But getting full config path is not that hard.. Structures are CfgVehicles afaik
It's not possible to have vehicles outside of CfgVehicles..
So... I suppose that Mods would be somewhat consistent in having vehicles in CfgVehicles..
Cool, thanks for the help, will see if i can get something to work.
Is there a command to tell AI pilots to fly with anti collision lights on or would anti collision lights turn on automatically when set to safe or careless?
Thanks
use forEach?
or if you really want to make it a multidimentional array, _newArray = _oldArray apply { [_x, 20] };
err nvm, think i misunderstood
from your 20 example
which i think should have been 15
i don't know of a good way (just counting/removing them)
need to keep the array in tact?
only way i know is probably messier
would have to use while count array > 0 instead of foreach, and
array = array - [array select 0];```
@tough abyss on my phone, but how about this?
array = [["magname", 4], ["magname2", 2]];
{
entity addMag [_x select 0, _x select 1];
} forEach array
Randomize quantity and class?
pushBackUnique may be useful?
Nice
What's the implementation for this?
Ok, gotcha
Should work nicely. Don't see the network fingerprint being much tbh
Never seen selectRandomWeighted before.
For sure.
Are you limited to adding 1 item x quantity every time?
Would be nice for it to take an array
For regularly getting values such as prices of weapons/items/vehicles etc, would I be better off using 2 dimensional arrays or configs with getNumber/getArray etc?
That depends if they're arrays or not? 😛
What do you mean @dusk sage
yea
It's your preference
How would you feel more comfortable doing it? There is no 'better' way
Just wasnt sure if it was faster one way or the other
Most people use configs (personally I'd say it's more elegant, unless you want to fill up your namespaces with invididual names)
You're talking negligible times
i think usually you're better off using configs, because otherwise you sorta have to search in SQF
which is gonna be slow
(unless you use some sort of index.. but it gets messy)
having it in a variable does have the advantage of being able to edit it on the fly though
How would I go about applying code using forEach to each unit in an array of groups?
forEach units group _spawnedUnits doesn't seem right...
{
_group = group _x;
{
_unit = _x;
//your code
} foreach units _group;
} foreach _spawnedUnits;```
(_group and _unit are just to make it clearer)
Hm, ok. Thank you.
err sorry that's for if _spawnedUnits is an array of groups like you said
would have to be _group = group _x; if it's actually an array of units
Will I have to adress every unit as in the code as _unit or is it still _x?
inside that foreach, it will be both
you can remove the _unit = _x if you want
{
{
//your code
} foreach units group _x;
} foreach _spawnedUnits;```
would also work
Thanks.
that will do groups/units multiple times though (ie 10 guys in 1 group in _spawnedUnits will run your code 10 times on each guy)
Eh... that's kinda bad.
yeah, depending on what you're doing
Basically this ```SQF
#include "script_component.hpp"
private _i = 0; // Private loop number var, so we can hint it later
_spawnedGroups = [];
// Froup spawning loop
for [{_i = 0}, {_i <= 5}, {_i = _i + 1}] do {
// Select random pos at a max distance from player
_aiPos = [player, GVAR(maxDistance)] call CBA_fnc_randPos;
// Check if pos is too close or if pos is on water, if so exit loop
if (((player distance _aiPos) < GVAR(minDistance)) || surfaceIsWater _aiPos) exitWith {};
// If above is false, spawn defined groups
_dummyGroup = [_aiPos, GVAR(groupSide), GVAR(groupArray)] call BIS_fnc_spawnGroup;
// Move spawned group into array, for which code will be ran on each element
_spawnedGroups pushBack _dummyGroup;
};
// Apply code to spawned units
if (GVAR(unitCode) != "") then {
{
{
call compile GVAR(unitCode);
} forEach units group _x;
} _spawnedGroups;
};
// Hint how many groups were spawned based on number of loops, max is 5
systemChat format ["Created %1 groups", _i];
private _allUnits = [];
{
{
_allUnits pushBackUnique _x;
} foreach units group _x;
} foreach _spawnedUnits;
{
//your code
} foreach _allUnits;
So code will only be ran on units inside _allUnits?
yep, which is all units 1 time (because pushBackUnique)
Nice.
all the units in all the groups that _spawnedUnits are in that is
looks like you have _spawnedGroups, not _spawnedUnits though?
Yes.
then if the groups are already unique, you can just use
{
{
//your code
} foreach units _x;
} foreach _spawnedGroups;```
otherwise you can make them unique by adding _spawnedGroups arrayIntersect _spawnedGroups at the top
They're spawned using BIS_fnc_spawnGroup so they're already unique.
As seen using diag_log ```
11:25:41 "SPAWNED UNITS: [B Alpha 1-4], DUMMY GROUP: B Alpha 1-4"
11:25:41 "SPAWNED UNITS: [B Alpha 1-4,B Alpha 1-5], DUMMY GROUP: B Alpha 1-5"
11:25:41 "SPAWNED UNITS: [B Alpha 1-4,B Alpha 1-5,B Alpha 1-6], DUMMY GROUP: B Alpha 1-6"
11:25:41 "SPAWNED UNITS: [B Alpha 1-4,B Alpha 1-5,B Alpha 1-6,B Alpha 2-1], DUMMY GROUP: B Alpha 2-1"
11:25:41 "SPAWNED UNITS: [B Alpha 1-4,B Alpha 1-5,B Alpha 1-6,B Alpha 2-1,B Alpha 2-2], DUMMY GROUP: B Alpha 2-2"
11:25:41 "SPAWNED UNITS: [B Alpha 1-4,B Alpha 1-5,B Alpha 1-6,B Alpha 2-1,B Alpha 2-2,B Alpha 2-3], DUMMY GROUP: B Alpha 2-3"
It's meant to be "SPAWNED GROUPS" 😛
Thanks again 😄
Is there a way of figuring out a PBO location on disk through scripting?
Quick question, is this proper?
private _someCode "
// Some Code Here
";
[[], call compile _someCode] remoteExec ["spawn", _owner];
private _someCode = "
// Some Code Here
";
[[], compile _someCode] remoteExec ["spawn", _owner];
But I'm not sure if you can do multiline strings like that
Tested in debug console
Guess so
myString = "
this is a
multilinestring
";
myString:
"
this is a
multilinestring
"
But true, I guess I don't need the call. Thanks
Hello there so i am developing atm a dynamic campaign with use of extDB and i am currently working on the player persistance, i am thinking at the moment about how i will call the script if i use for that initPlayerServer.sqf , initPlayerLocal.sqf or init with an MissionEventHandler like PlayerConnected and Disconnected
This is already done and the Data is already recived is just need to think about the execution
Client can request to server to get the information. Server gets it and sends it back to the client.
So i have my functions ready and tested now i want to know a good way to execute the functions and there are more than one possibilty it seems
And i am not asking for the perfect code just for informations about the pros and cons of each possibility
Client:
[_uid, _sender] remoteExec ["query_fnc_checkPlayer", 2];
Server:
// Code for getting result from db if they exist
[_playerExists] remoteExecCall ["process_fnc_playerCheckReturn", (owner _sender)];
Client:
if (_playerExists) then {
// Have them query the data
[_pid, _sender] remoteExec ["query_fnc_getPlayerData", 2];
} else {
[] call Process_fnc_newPlayerSetup; // Does a similar thing as ^ but inserts new player
};
Personally the process I go about with getting it.
i am working quiet diffrently since i use extDB3
As do I
I have the server run a server only mod for handling the transfer of data, etc.
Client just sends requests and handles returns
sure i thought in the beginning about a init which saves all 5 minutes for each player their progress if they are already in the DB, let them either insert & update while getting on the server the first time, and give them a action to save for themselfs if they want to be sure, also well on the disconnect
Easily done, just loop every 5 minutes and run [PASS DATA HERE] remoteExec ["query_fnc_updatePlayer", 2];
Server needs to know what query_fnc_updatePlayer is and run it, which inputs data into db.
sure, this is the easiest part of all already have done that with some enviroment part
while {true} do {
sleep 60;
[] call ser_fn_updateingametime;
};
i don't know much of the remoteExec part yet but i am learning still this is the first project and since i am often throw code awy and create a new one cause of new informations this isn't a big issue
also you brought in some ideas already about one part
if a player joins on the server is it faster to load or insert data over an eventscript like initplayerServer.sqf or an eventhandler like PlayerConnected
i mean such task only have to be executed once
initplayerServer.sqf
OR:
Use in the mission folder the
initPlayerLocal.sqf
Player connects -> blackScreen+waitUntil{VAR} (maybe input disabled later?) -> Send a request to the Server vis IPL.sqf -> Let the Server handle the stuff, send it back to player via remoteExec -> after Vars are set (or Gear assigned, or whatever you wanna do) -> server sends (again REC) VAR = True -> blackscreen dissapears and Player input is enabled again -> profit
roughly written
I think for that task initPlayerServer will do better the other option is a bit like working around a corner
and since it is a one time task for each player and it won't have frequently changes like KoTH the server should be handling it perfectly
Do as you please ¯_(ツ)_/¯
It's just idea gathering for an Military Roleplay Campaign (ZEUS) ^^ i trying to get some ideas with the help of you since i don't know about the most stuff i am glad about that. Is there a idea about the disconnect part? I just seen yet a MissionEventhandler and OnDisconnect which is mostly the same i seens just with a diffrence that it is stackable
check the wiki, it explains it perfectly
Oh hello there Adanteh ^^
Okay maybe the Handler HandleDisconnect seems the way because it contains the unit not sure about the override part
player addaction["<t color='#FF0000'>Save</t>", {call ser_fn_updateplayernato;},[],0];``` can someone tell me why the UAV Terminal is still under this action? This only happens when i use the init script if i execute it over the cosole it is at the right place
_staticObjects = (all3DENEntities select 0) select {_x isKindOf "Static"};
_tanoaBuildingCount = {getObjectDLC _x == 395180} count _staticObjects;
if (_tanoaBuildingCount > 0) then {
systemChat format [ "Warning: %1 Tanoa map objects detected",_tanoaBuildingCount]}
else {systemChat "no Tanoa map objects detected"};```
@lavish ocean would this cover all tanoa map objects? Could there be some restricted structures that are not `isKindOf "Static"`?
Would the receiving function treat these two calls the same in terms of the arguments? I see the [] used sometimes and sometimes not, but I'm not sure of the consequences.
_arguments = [_foo, _bear, _swim];
_arguments spawn tag_fnc_doLotsOfStuff;
vs. this call
_arguments = [_foo, _bear, _swim];
[_arguments] spawn tag_fnc_doLotsOfStuff;
i think it would, yes
2nd one is an array with args within an array
1st one is an array with args
i think
hehe
// tag_fnc_doLotsOfStuff
params ["_funcParameters"];
private _bigFoo = _funcParameters select 0;
private _bigBear = _funcParameters select 1;
private _bigSwim = _funcParameters select 2;
isn't working for me.
ERROR: Argument exception - expected ARRAY but provided ARRAY tag\functions\AI\orders\tag_fnc_doLotsOfStuff.sqf:62
it spits out an array, but the guard reads an array-- but it isnt
without the [] in the call _funcParameters comes out as OBJECT
lol
to be fair, I'm using CBA IS_ARRAY() macro to test, but everywhere that helper works fine
it's not the macro
I look at spawn vs call, but not sure why that would matter here
Is it ok to declare array's private?
private _myNewArray = [];
maybe it's the original declaration that is messing it up
btw try with _this instead of params and see what happens? not a solution but if you're trying
good advice thanks-- i never use this really
almost always I find these problems are the result of some minor typo way up stream and never considered
do check out the biki in that case, some of the examples looked interesting.
not used params much so can't be of more directed help.
kk will do
[_a,_b,_c] call FNC; ---> params ["_a","_b","_c"];
[[_a,_b,_c]] call FNC; ---> (_this select 0) params ["_a","_b","_c"];
Are waitUntil delays better used with time or diag_tickTime? I'm having trouble understanding the difference betweent he 2
time will give the time in seconds sincethe mission started, diag_tickTime since the game was launched
time doesn't move if the game is paused
and also that
BI have a habit of naming their functions in a stupid way imo
What does diag refer to?
Ah maybe thats it
Diagnostics
what pisses me off is that there's no consistency with the names. camPreload / curatorCamera. visiblePosition / getPos. eyeDirection / getDir. the list is endless
B-but diag_tickTime reads the machines system time and uiSleep reads the unsuspended simulation time : (
getPos alternative syntax is stupid.
The dir & distance one?
yes
Why? oO
params wrong way around imo
Because it's totally different from the original purpose of the command.
nope
original Purpose -> Get a position
Alternative -> get a position in Direction.
I can't see a problem there
Get a position of an object (AGLS)
Okay, true. But who reads the Description anyway
Now it also has get a position relative from an origin (object or position) (and ATL)
It's not about the description
Oh my Commy. Instead of beeing happy that this exist, you rant again^^
Yes, because the way it's done is stupid.
Glad you agree.
not rly.
tbh, i don't give a damn about namings, as long as the commands does, what it says.
shouldve been relPos
tbh, i don't give a damn about namings, as long as the commands does, what it says.
🤔
Should be yeah.
and have options for differentiating Z or something too and be fancy
you mean switching between asl/AGL stuff?
getPos normal syntax is for the trashcan anway, because AGLS lol
getRelPos should've been what the alternative syntax of getPos is plus an optional boolean to toggle the "relative" part.
also drop the "get"
Yeah, i know the text 100%
mimi mimi mimi mimi mimi mimi
😄
mimi mimi mimi mimimimi mimi mimi mimi
mimi mimi mimi mimi
mimi mim
MIMI
sorry
saved for eternety, when i get a warning for spamming and you don't 😄
Do I hear "mimi mimi" from you?
Oh noes.
wut?
I don't suppose there's an easier/better way to get the value of a local private variable from its name (as string) other than this?
call compile "_some_private_variable"
yes, I thought I explicitly mentioned that in my question
You don't wanna know how many ask question but mean something else.
Then answer might be no. Call Compile for that only.
for Global Vars, it can be done with
missionNameSpace getVariable[format["My%2","VarName"],"Stuff"];```
fyi, i'm trying to do something like this:
fnc_array_reduce = {
params ["_array", ["_expression", {_acc = _acc + _x}], ["_vars", [["_acc",0]] ] ];
private (_vars apply {_x select 0});
{ call compile format ["%1 = %2", _x select 0, _x select 1]; } forEach _vars;
_expression count _array;
call compile (_vars select 0 select 0)
};
Just pass the value of the variable in instead of the name.
private (_vars apply {_x select 0}); What is this?`
Setting up an array containing the string names of local variables, probably.
Seems an array with [["_a"],value] pairs
yes, it's a list of all local variables, which might be used for the calculations in _expression
in simplified terms, it's to sum up an array (optionally with a more complicated expression)
}else
{
Ewww
New arma update outt
Added: New modelToWorldWorld and modelToWorldVisualWorld script commands 😂
Tweaked: Security of the debug console was improved
:kappa:
wow at those names..
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Dammaged
Tweaked: The Dammaged Event Handler is now extended with additional arguments ([unit,selection,damage,hitPointIndex,hitPoint,shooter,projectile])
👍
👌
@rotund cypress Not sure what security improvements they mean
Would be nice if they could've said what they improved ^
I know this is non-scripting related but theyve changed flying mechanics of everything, feels so weird flying everything now
So, I trust that the new pylon commands have better documentation now?
I want to make Praetorian (new dlc turret) OPFOR. Is there any script for that?
modelToWorldWorld what?
How to remove next d panel from mouse wheel
You can't with scripting.
@rancid ruin Same as modelToWorld, but instead of reporting PosAGL, reports PosWorld,which is the same as PosASL, but relative to the model center instead of the lowest LandContact point.
what a crazy name for a function though
Done
The name of PosWorld is fucked. Should've been PosASLCenter
i wish they would just go back and make aliases for all these functions
inb4 "mimimi"
like when they realised they spelled damaged wrong 🤙🏿
Has anyone brought up the right panel actions yet? Any info?
(the addactions there 24/7)
look at convo
Has any seen the enableTraffic command before? Just noticed it in latest stable - its on the wiki but only for ToH.
ta
Anybody know, if intersect is broken or not?
https://community.bistudio.com/wiki/intersect
Descr. says:
Return Value: Array - array of intersections in format: [[selection, distance],...], where
...
The results are also sorted, closest selection first
No matter what, i get 1 back max.
90% sure it wasn't broken a few months ago, not sure about now
disregard, i was thinking of lineIntersectsObjs
Yeah
hm, also select just the one, wich is the furthest away
(glass_13_hide = the one right infront | glass_12_hide = Door)
https://i.gyazo.com/0179d4518350bed31732ff4c6d6afbd2.jpg
@BoGuu#1044 the panels have been a problem since day 1 even on the dev, rc revisions. Dunno.
@grand berry is it available on the function viewer? I was very intreaged by it as well, just no documented parameters.
hm, with LOD "FIRE" it detects both, GEOM and VIEW not. strange
@subtle ore not sure, will give it a look in a minute
@here did anyone ever suggest "BOOL := is64Bit()" as a script command?
or integrate it into productVersion() ?
(let me guess. i am dumb and it is already in productVersion() ?)
^ confirmed
that is what happens when you dont look into arma for half a year
I wouldn't call the state of being dumb temporary
what?
@austere hawk The annoying part is: You rly have to filter out the dmg... no clue why 0 dmg is beeing in the HandleDamage EH anyway :/
it returns the current damage... i only just realized this now
this makes this EH super useless in trying to detect how much damage was actually caused
Yes and No. You have to store the current Dmg in the Vehicle itself (setVar).
Still -> Messy as hell and nonsense
yes i was thinking that. I just dont get the point. Why do you need to return current damage? It can be easily read with getHit and the equivalent commands when you have a selection.
e.g. if you wanna negate dmg (safezone etc.). Otherwise the dmg could restore that Hitpoint to 0 again.
or when you wanna alter the Dmg handled itself (e.g. reduced dmg from bullets)
+"when you have a selection." <- thats also a strange thing, sometimes the selection is an emptry string.
Same with the _hitPartIndex (wich can be -1)
empty selections are either wrongly configged hitpoints, or global Hitpoints
if hitpartindex is -1 its global hitpoints, otherwise not
iirc i tested with Vanilla Vehicles
like i said, you can easily get the hitpoints by different means and also find pretty well what part is actually meant. What you cant get easily is the damage caused, at least not without pointless checking of every hitpoint every hit, custom variable writing and reading (needs to be globally synched after all...)
Anyone here messed around with making extensions for arma?
"What you cant get easily is the damage caused" <- _damage - oldDmg 😄 happy workaround again
#arma3_tools <-- prolly better place to ask Bornasm
Alright will do, thanks 😃
@jade abyss and where do you get oldDmg from?
mom
Your mom gave you oldDmg Dscha? What a lucky boy 😀
roughly ripped apart:
mom
oh, i thought the hitpoint already has updated values when the EH triggers. apparently it doesnt. just tested it
ok that makes things alot easier
Could be that. Last time was ~4-5 weeks ago, that i touched it. Confused myself
params["_unit","_hitSelection","_damage","_source","_Projectile","_hitPartIndex","_instigator","_hitPoint"];
_NewDamage = _unit getVariable ["CurrentDamage",0];
if( _damage > 0 )then
{
if(isNull _source || {_source isEqualTo _unit})then
{
_NewDamage = _NewDamage + _damage;
};
_unit setVariable ["CurrentDamage",_NewDamage];
};
_NewDamage```
no clue why i have that isNull _source in it... hm...
i tend to confuse myself pretty often oO
dafuq did i wrote there?
no, i mean i used getHit for the hitpoint, and it returns the "old" value that was there before the handledamage
no setVariable
Could work also. No clue. I still try to figure out what i did there 😑
it does work, i just tested it
except now i feel pretty stupid... or bad at reading. Welp, at least the fix to my script is easy now.
At least (dafuq did i wrote there...)
AH!
{
_NewDamage = _NewDamage + _damage;
}```
= When crashing with your Car against a wall
(got a dmg modifier, thats why i need that)
isnt there a config param for that?
epe something
wlep, fix to script easy, except now i have to retune all my damage values. Great fun.
epe available in non-Dev?
epeImpulseDamageCoef = 30;
whats that now. Oh my
epeImpulseDamageCoef
int≥0, (PhysX)
<?>Undocumented: the name suggests this is a coefficient influencing how much damage the vehicle takes from physics-controlled impacts (i.e. crashing into a wall, another vehicle, etc.). Higher numbers suggest the vehicle takes more damage from such events.
[undocumented]```
https://community.bistudio.com/wiki/Config_Properties_Megalist#epeImpulseDamageCoef
ima baseclass explorer, thats why i know this shit 💩
i'm used to it now. considering i thought there was yet another bug that i had to circumvent and now i dont, i feel even slightly better about it 😄
Greetings. Any config entry which helps me decide if a vehicle is actually a DLC/Expansion vehicle or not? Using configsourcemod command now, but I think that's not 100% reliable. Eg: m-900 shows up as Apex. I think the non-civ classnames were added in Apex, original was in Heli DLC, but not even sure if it needs heli dlc.
every DLC weapon has a special icon in EDEN. So maybe you could search for all the DLC icon pathnames?
The config entry is named "dlc".
pahhh too easy 😄
yes, Jets DLC doesn't have it
AND
although it's not vehicle, but some Apex objects which are in the vanilla package (so you don't need to have or download APEX) actually has them
the icons or the classname?
the DLC config entry 😄
eg dlc = "expansion"
just looking for a reliable way to tell if they are DLC locked or not without testing eveything
Sounds like a problem with the Jets DLC then.
Try this?
configSourceModList (configFile >> "CfgVehicles" >> "B_Plane_Fighter_01_Stealth_F")
-> ["jets"]
yes, that's what I tried
....and?
as far as I can tell, it's still not representing actually if it's dlc locked, but testing it now
private _test = "B_Plane_Fighter_01_Stealth_F" createVehicleLocal [0,0,0];
private _result = getObjectDLC _test;
deleteVehicle _test;
_result
-1
hmm
yeah, that would be the usual hacky workaround 😛
Yeah, but it doesn't work.
Seems like it's broken. Probably BECAUSE the DLC config entry is missing.
jet dlc isnt deployed yet, is it? maybe thats why
Oh, but I'm on 1.70 and the planes are in the game 😐
stable?
eg: Land_IRMaskingCover_01_F . It's in the vanilla game without Apex, shown up as apex, showing "expansion"
["Arma 3","Arma3",170,141764,"Stable",true,"Windows","x64"]
And I just created a "B_Plane_Fighter_01_Stealth_F"
I_C_Heli_Light_01_civil_F is Apex "content", also you can get into it without Apex
this is my actual problem
hm ok then i wonder why i still get the DLC warning even though i have the DLC - which i thought way because Steam doesnt "know" the BI pack yet
but propably unrelated then
getText (configFile >> "CfgVehicles" >> "I_C_Heli_Light_01_civil_F" >> "dlc")
"Expansion"
yes, but it's not
That was APEX, no?
private _test = "I_C_Heli_Light_01_civil_F" createVehicleLocal [0,0,0];
private _result = getObjectDLC _test;
deleteVehicle _test;
_result
reports nil
I mean, I know it works
but for example.. for an ingame vehicle shop... it might not be the best idea to create every listed vehicle locally to test if it's DLC content, right? 😄
i would make a request for a function to BI if you dont find something that works easily. This seems like something they should provide and maintain.
if you get lucky you have killzone kid jump on it and have it the next day ^^
I thought maybe "dlc" is ignored when inherited like "author" is, but:
getText (configProperties [configFile >> "CfgVehicles" >> "I_C_Heli_Light_01_civil_F", "true", false] select {configName _x == "dlc"} param [0, configNull])
"Expansion"
I made a "layout" editor for our multiplayer mission. General rule that you cannot place Apex objects on Altis/Stratis, as it would need the players to have Apex expansion. But there are Apex, but not apex objects. I basically disabled Apex and listed all the addon/pbo names and created a whitelist 😄
I just wanted to avoid such solution
that heli it part of the dlc, so "expansion" is not wrong, but its of the free part
That could be it, but then how to determine if you have access to an object?
getObjectDLC alone?
Requires an object and not classname.
Also a bit tricky to handle since it reports nil.
nil can be handled if you expect it 😃
And -1 for the jets, so maybe they haven't come up with a id for the DLC yet.
well, they have an id
-1
seems more like a placeholder
or what I would've used instead of nil
confusing, confusing
id is basically the appID of the steam game
it's 601670
oh it really returns -1
the heck 😄
_plane = cursorObject;
[isDLCAvailable getObjectDLC _plane] param [0, true]
That's the magic words, but it needs an object. Classname insufficient.
isShowingWatermarksIfIequipIt
I think there was something for the weapons, but I'm not sure anymore
The classnames are listed in configfile >> "CfgMods" >> "Jets" >> "Assets" in arrays in subclasses.
hm
Including weapons. Not for jets DLC, but for marksemen at least.
but does that mean only those are locked?
I think that's how it's done.
reference[] = {"CfgVehicles","B_Plane_Fighter_01_F"};
configfile >> "CfgMods" >> "Jets" >> "Assets" >> "DLCJetsBluforFighterJet" >> "reference"
tryAsset[] = {1,"B_Fighter_Pilot_F","B_Plane_Fighter_01_F"};
configfile >> "CfgMods" >> "Jets" >> "Assets" >> "DLCJetsBluforFighterJet" >> "tryAsset"
For weapons you could've used this on a dummy:
https://community.bistudio.com/wiki/getPersonUsedDLCs
BUT
This command is broken and doesnt work on dedicated server
¯_(ツ)_/¯
I relly just want a command where I can put vehicle/weapon/magazine/whatever classname and get the DLC(s)
anyways... it conforms me a little that I wasn't just not paying attention and it is actually a real issue
Well there are all the assets to hack something together.
assuming they are only showing the dlc locked assets
Pretty confident in that. The heli you mentioned for example is not listed in configfile >> "CfgMods" >> "Expansion" >> "Assets" >>
configfile >> "CfgMods" >> "Heli" >> "Assets" >> "DLCBcivilianHeli"
tryAsset[] = {1,"C_Man_Pilot_F","C_Heli_Light_01_civil_F"};
C_Heli_Light_01_civil_F is not DLC locked 😛
possibly
Anyone know the difference between using RscDisplayDebug and RscDisplayDebugPublic?
Well, RscDisplayDebugPublic is inherited from RscDisplayDebug @warm gorge
Essentially, exactly the same. You get all the RscDisplayDebug stuff with RscDisplayDebugPublic
Was just wondering if something was changed, because I use createDialog with it in an admin menu which no longer works
Shows nothing but a cancel button at the bottom so wasnt sure if it was changed or something
createDialog "RscDisplayDebugPublic";?
yes
Worked fine up until this update, and no no mods. Vanilla arma
Do you have it on escape in 3DEN?
Works fine in singleplayer, but not in multiplayer
In singleplayer it works fine both through createDialog and escape menu, however on a mp server it doesnt display it properly.
On a different topic, is there any way to control the capabilities of vehicle radars? I cant find any scripting commands or difficulty settings regarding it
I can't remember, but I would advice checking the changelog 1.70
@rotund cypress Come to think of it, could my issue have something to do with the user not being a logged in admin? Related to these security improvements
if you are using createDialog, shouldn't have an effect.
Yeah hmm
I'll double check for you one sec
In your debug console, do call BIS_fnc_isDebugConsoleAllowed
But hmm, you don't have access to it anyways
One sce
I cannot remember if that was there before
But that is the check upon opening it
Ye so, BIS_fnc_isDebugConsoleAllowed is now blocking it.
[
"DebugConsole",
getMissionConfigValue ["enableDebugConsole", 0]
]
call (missionNamespace getVariable "BIS_fnc_getParamValue");```
try putting enableDebugConsole = 1; in description.ext and see if that solves your problem.
@rotund cypress Yeah making myself an admin seems to work. Do you know if its possible to have multiple admins logged in at once?
No you cannot be logged in multiple at once
However, you can assign preset UIDs in server.cfg in order to not have to input password when logging in.
Will that work for multiple admins? Because im gonna need to allow debug console for certain players
Will be extremely painful having only 1 person to access debug console at one time
I could suggest to copy/paste the debug console into your mission and remove the BIS_fnc_isDebugConsoleAllowed
Well, it is in ui_f
Under RscDisplayDebug
And RscDisplayDebugPublic
Then you need the function which handles the debug console. Which is located at ui_f/scripts/GUI/RscDisplayDebug.sqf
Alright ill give this a go
@rotund cypress Having trouble finding RscDisplayDebugPublic.hpp, however I did find the .sqf
It's in the ui_f / config.bin
Which you will need A3 Tools CfgConvert in order to convert to a cpp
Then in there RscDisplayDebug and RscDisplayDebugPublic will be located
@rotund cypress Found the class, so the onLoad/onUnload calls BIS_fnc_initDisplay, I assume that then calls the RscDebugConsole.sqf?
Yep
So just do the following
[_this, "onLoad"] execVM "location of RscDIsplayDebug.sqf";
Put that in onLoad
I think I jacked up big time
RscDisplayDebug does not check function BIS_fnc_isDebugEnabled
I was looking in wrong debug console script
(RscDebugConsole.sqf)
So there shouldn't be an issue, but give it a go if you want
@rotund cypress It must be called somewhere for it to be preventing access. If its not in RscDisplayDebug.sqf then I dont think this will work lo.
RscDisplayDebug is the script called when doing createDialog "RscDisplayDEbugPublic"
RscDebugConsole.sqf is the script called when pressing escape if I think correctly
So that would be why that is doing a check for isDebugConsoleAllowed
RscDebugConsole.sqf contains onLoad and onUnload modes. Just having trouble finding any checks to see if the player is admin in this script
It has checks in RscDebugConsole, it does not have checks in RscDisplayDebug
look at RscDisplayPause
Yeah this is ridiculous. This debugConsoleAllowed check is in the actual code execution scripts as well. Ill have to message Killzone Kid about this causse I noticed he wrote a couple of these scripts. Theres gotta be a way for multiple admins to access the debug console
There isn't.
Not with the one in Pause Menu
It is however possible with createDialog "RscDisplayDebugPublic"
Its not though because the buttons on it (Local exec, global exec, server exec) dont work unless the user is an admin (checked through isDebugConsoleAllowed)
Im looking at the updated execution scripts for all the buttons now
The buttons wont work in MP if you don't have call in CfgRemoteExec
fn_debugConsoleExec.sqf:
if (isServer && call (missionNamespace getVariable "BIS_fnc_isDebugConsoleAllowed")) exitWith
This is called at the top off the script which is run when you click Local Execute, Server Execute etc
And that is called from where?
The buttons in the debug console for executing on server, global and local call that script
Yes
Well, that is the wrong one.
You need to be looking at RscDisplayDebug.sqf
or RscDisplayDebug in config.cpp
RscDebugConsole is probably the one in pause menu
It's RscDisplayDebugPublic.
Thats what im trying to use, but it doesnt work for non-admins
Before this update anyone who could call createDialog "RscDisplayDebugConsole" could use it fine. Now the user needs to be an admin to access it
Because somewhere in the scripts behind it theres calls to this new fn_isDebugConsoleAllowed script
Not for RscDisplayDebugPublic
In multiplayer, the debug console is unavailable by default. It is possible to make it available by configuring access option (see below). It is worth noting that when debug console is configured for admin access, it is only available for logged in admin, voted in admin is treated just like any other user in this respect.
that would be the menu integrated one though
youve always been able to create the display scriptwise
i could check tonight if our admin tools been affected for you if you havent solved it by then
What's inside fn_isDebugConsoleAllowed.sqf?
Its the check for default debug console in Pause Menu @tough abyss
Checks the missionConfigFile for allowDebugConsole = number;
It also checks if the user is an admin, or if we're in singleplayer. But this is what im trying to say, something has been changed with RscDisplayDebugPublic which now uses this fn_isDebugConsoleAllowed otherwise if that check fails you cant use it
I understand the pause menu debug console is different, but the other one created through createDialog is now also affected
@indigo snow Please let me know. Because my admin menu worked fine calling createDialog "RscDisplayDebugPublic
Now it doesnt.
You are on about RscDebugConsole in Pause Menu
they might have changed the rsc itself in the latest update
ill take a peek tonight
in the meantime you might just wanna set that BIS_fnc_variable to true first or something
oh wait thats just a roundabout way to call the function
From changelog: ```
Tweaked: Security of the debug console was improved
worst case just copy the rsc and remove that requirement
Hmm
Thats what im trying to do but cant find the related checks for it
I just tried it on MP
It only shows cancel
So I guess you are right @warm gorge
Just do as I previously mentioned then
Yeah thats what im trying to work on now, but im just having trouble trying to figure out exactly which scripts I need to work with
Cause theres multiple for debug console stuff
RscDisplayDebug class and rscDisplayDebugPublic class
And script RscDisplayDebug.sqf
With all the functions which it is calling
it's probably an onLoad event?
Yes ^
just copy the rsc into a custom class and modify the unload
assuming this is a mod thing btw
@rotund cypress @indigo snow So it turns out RscDisplayDebugPublic calls RscDebugConsole.sqf, so would need to change quite a few scripts to make a custom class for this. Not only RscDebugConsole.sqf, but also fn_debugConsoleExec.sqf which is called for each execute button as these all make calls to isDebugConsoleAllowed. Very painful for something so simple
Shouldn't be that hard
but you can change the config entry that calls that script 😉
How would I change the config entry that calls it
with a mod
With a mod
Then your options is copy/pasting
yup
Or writing an angry letter to bohemia describing your frustration wishing they will revert back kappa
its a decent speedbump for scriptkiddies
^
Considering isDebugConsoleAllowed checks for the variable BIS_fnc_admin, couldnt that just be set manually or is there some sort of thing in place that prevents that
I mean @warm gorge if you copy/paste it, you can have it do whatever you want, i.e. server side check to make sure they are admins
It's compiled finally
So no
Ah alright, welp, guess ill just have to make my own debug console and just edit all the scripts. Annoying but I guess once done it works
^
I have a question for the peeps here. I am currently working on a system for the dynamic loadouts. I am struggling with a good way of finding out what magazines are compatible
I have checked in the vehicle class, but nothing there
So I guess it would be under the magazine itself, but that makes things complicated
No it's not in CfgMagazines either, so maybe I would check hardpoints then and check them together... hmm
compatible magazines are stored in the weapon config
or at least before
the new pylon system might work differently
Ah ye right, but that seems to complicated to do, I think maybe comparing the hardpoints on the pylons to the magazines are easier
Yes
Well, as long as server initializes
I call the extension on server init
initServer.sqf
if (isServer) {callext...};
why an isServer in initServer.sqf?
could someone check this: count [1] + [2] gives error on evaluates to 2?
(not in windows atm)
you would be better to do count [1] + count [2] anyway
count wowuld be a unary operator here
so it doesn't create a whole new array just to count
unary commands have higher precedence than +
so it would evaluate to (count [1]) + [2]
count is both a unary and binary operator. My question is whether what matters is the operation (count [1]), or the operator (count).
without a code block in front of it it acts as a unary operator
so, to double check, {true} count [1] + [2] returns 2
because now count is binary, and + has precedence over binary
@vapid frigate yes, this was just an example of a unary/binary op on the left side of a binary op, to double check operators precedence.
it should but likewise i have to access no arma atm
yeh fair enough.. i just add brackets when it's not obvious
better for anyone reading your code that doesn't know all the obscurities anyway
i figure the code itself just serves as an illustration to the underlying question
the precedence behaviour of commands that can both be unary and binary
@vapid frigate I agree, but since I am programming the SQF parser (https://github.com/LordGolias/sqf), I need to implement it 100% correctly. Because the whole point is to detect when someone "abuses" precedence.
Thanks a lot for testing it ingame!!