#arma3_scripting
1 messages · Page 447 of 1
Yeah but I'm thinking of it like you're creating a line extending from 0 to 1500 in a random 360 direction
and on that line you have 0-1500 enumerated
and it's just picking a random number on that imaginary line
although I guess if you look at it from a density point of view
and not imaginary dots with no dimensions
Just imagine 360 lines each pointing one degree apart from the center.
They get thinner the further away from the center you are.
So all possible spots at the edge become less likely.
because there're more of them.
Okay so I was looking at it like PoV of single instance. If you just randomed it, your chance of having the point be 1m is no different than it being 1500m away
Yeah, but that is bad.
but if you plotted multiple instances you'd have higher density towards middle
Correct.
Which actually would be a desired behavior if you were doing something like randomized artillery strike
or artificial artillery barrage I should say
Well, you may want a more controlled way of getting the distribution. Not just sqrt.
Well no like if you wanted a random artillery barrage you'd just do like random 600
Like gausian.
because ideally an artillery barrage would not be random but rather weighted towards the center
True, but real distributions are Gaussian, and not sqrt.
Which can be done in Arma too with not much effort.
yeah random alt syntax
private _randomPos = _CIWS getPos [random [-1500, 0, 1500], random 180];
I think.
Wouldnt you need sin cos to get gausian?
I assume that is what random ARRAY does in C++ land.
https://imgur.com/a/ax6wA
Wanna guess which is which?
sqrt gauss normal
This is cool stuff : D
wonder if I can invert it
1 - random
No like make it so that the edges are denser than middle
That's what I said, though you need to do something else for Gaussian.
private _randomPos = _CIWS getPos [1500 * (1 - random [0, 0, 1]), random 360];
I was just about to ask how to make an inverted uniform distribution
then I realized
1 - random, though it would the exactly the same 😛
Well, would it? I'm not sure 🤔
Dang, it would. I was thinking of sqrt.
Yeah, I probably misunderstand what it means for the random function if min and mid are the same.
private _randomPos = _CIWS getPos [1500 * (1 - abs random [-1, 0, 1]), random 360];
Try this one.
looks good.
Seems like it takes the max absolute value if min != -max and just clamps the result.
So min should always be - max basically.
That's fine.
Or reroll 50% if you hit the edge. Shit I like this stuff too much.
The regular gaussian one looks like a radiograph
Like if your film had really giant grain
private _randomPos = _CIWS getPos [1500 * sqrt (1 - abs random [-1, 0, 1]), random 360];
What about this?
Combines sqrt with inverted Gaussian.
So the density of the points at the edge should be the same as it used to be in center of the vanilla Gaussian.
A few weeks ago someone asked for this stuff with a safe area in the center.
When you consider the gaussian visible range is like 4000 when the actual set range is 4500 it makes sense
I mean there is a chance this would kill you
This one, yes.
you could always do a simple check though
private _randomPos = _center getPos [sqrt (random (_radiusOuter^2 - _radiusInner^2) + _radiusInner^2), random 360];
Hey, so i was browsing the BI Wiki, and i found this: lnbAddRow but a friend of mine told me it's depreciated, and was only used in ArmA 2. Is there another function that does a similar thing, but in ArmA 3?
Why would that be deprecated?
idk. he just told me it is. He attempted to use it before and said it didn't work
Well, they may've just made a mistake.
I dont think arma 3 uses lnb does it?
I was looking through the forums, and i found some people who were using it in ArmA 3 (not the function, but lnb)
I never used ListNBox myself.
I dont even know what a listnbox is
Because it's not a 2D list box
It's not a 3D list box
Apparently I worked with it in the past https://github.com/CBATeam/CBA_A3/blob/master/addons/keybinding/gui.hpp#L61
Is it just a list box that is handled differently by the engine or something?
Ok, thank you for clearing it up - turns out he was using standard lb, rather than lnb haha
Yeah if you have a listbox just use lbAdd and forEach
if you have an lnb use lnbAddRow
Ok, ty
Pretty sure some ListBox commands do work on ListNBox though.
Im still really curious what a ListNBox is lol
Instead of a list, it's more like a table. With multiple rows and collums.
The items don't have an index, they have two.
Oh is it, I thought a 2d list box was under a different command
Well they are. They are lnbX, not lbX.
The names are just really close, because bad conventions.
Where I'm from we call 2d list boxes tables
Let's just be glad though BI at least uses english words for commands
effectiveCommander toto setName "Phalanx Defender";
null = [to] spawn {
_CIWS = _ zvolí 0;
_GoodPos = 0;
_Pos = [0,0];
Spánek (Náhodný 10);
pro "_i" od 0 do 1 krok 0 do {
Pokud ((! Živý _CIWS) NEBO (isNull _CIWS)) exitWith {};
_CIWS setVehicleAmmo 1;
pro "_i" od 0 do 1 krok 0 do {
_Pos = [[[(getPos _CIWS), 1500], []], []] volání BIS_fnc_randomPos;
Pokud (_Pos vyberte 0! = 0) exitWith {_GoodPos = 1};
Sleep 0,1;
};
waitUntil {_GoodPos == 1};
_PosHeight = [Vyberte políčko 0, _Pos vyberte 1, ((_ Posuďte 2) + ((Náhodné 300) + 550));
_DistanceDelay = (_CIWS vzdálenost _PosHeight) / 980;
_ChargeType = selectRandom ["DemoCharge_Remote_Ammo_Scripted", "DemoCharge_Remote_Ammo_Scripted"];
_Charge = _ChargeType createVehicle [0,0,0];
_Charge hideObjectGlobal true;
_Charge setPosASL _PosHeight;
_CIWS doSuppressiveFire (getPosASL _Charge);
waitUntil {((_CIWS munice "Weapon_cannon_phalanx") <1450)};
Sleep _DistanceDelay;
_Charge setDamage 1;
_CIWS setVehicleAmmo 0;
Spánek ((náhodný 10) + 10);
};
};
That should just error out, because variables can only use a-z, 0-9 and _
Imagine half english half czech coding lol
I'm creating a mission. Using Optre.. I would like for the troops to spawn in a drop pod room, gear up and drop. And when they hit the ground. They would recieve a new spawn position. And the drop pod room wouldn't be accessible. Any ideas on how I could get this to work?
The most difficult thing would be the drop room model (?).
Im sure on the taru pods would work well enough
Oh, right. You could access gear while sittting inside a vehicle.
I think you can even use arsenal
Yeah, I see no problem with this idea. Should all be straight forward.
Omg my Iron Dome type CIWS defense looks so cool at night
too bad it cant actually intercept missiles or mortars though
You could delete the projectiles.
yeah, just add an eventhandler onto any mortars or artillery
Optre comes with ship modules and a drop pod room.
What is that drop pod room? A building?
Is there some script command for "Edit Vehicle Appearance" menu in Eden editor? I just want to change the camo and skin texture of New Tank.
https://imgur.com/IGwD1uU
Click Export
I know, but I want that the "edit vehicle appearace" window is displayed when I run some scripts , just like the url https://imgur.com/IGwD1uU
only Camo & Paint job, not spawn all vehicles.😅
Well this menu does all of that. If you don't want it to do all of that, you'll have to create your own menu.
The script, I just want, is the same as the "edit vehicle appearance..." menu in Eden editor, only Camo & Painting job.
hmm 🤔
['garage'] call bis_fnc_3DENEntityMenu;
Dunno if that works, back in 10 minutes, then I'll look closer into this.
@quasi rover
["Open", [true, _entity]] call bis_fnc_garage3DEN;
Try this. _entity being the vehicle.
@little eagle thanks, I'll give it a try. 😀
can someone help me? i made this Combo List and added a script to give the licnese that is choosen from the combo, and i have another combo for the player name but i cant get it working for the player like when i press on the player name and the license i wanna give him instead it gives me the licnese
Main SQF (Excuted by Hotkey)
_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];
[] call life_fnc_whitelists; ```
Whitelists.sqf (Shows Licenses in the combo)
```sqf
private _test = ["license_civ_pilot","license_civ_rebel","license_civ_trucking"];
{
private _index = lbAdd [9902, _x];
lbSetData [9902, _index, _x];
} forEach _test;
GiveWL.sqf (Gives the selected license)
_index = lbCurSel 9902;
_unit = lbData [9902, _index];
if (_unit == "") then {
hint "Please Select a whitelist!!";
};
if (_unit == "license_civ_pilot") then {
license_civ_pilot = true;
hint "You're Whitelisted!!";
};
if (_unit == "license_civ_rebel") then {
license_civ_rebel = true;
hint "You're Whitelisted!!";
};
if (_unit == "license_civ_dive") then {
license_civ_dive = true;
hint "You're Whitelisted!!";
};
if (_unit == "license_civ_gun") then {
license_civ_gun = true;
hint "You're Whitelisted!!";
};
if (_unit == "license_civ_trucking") then {
license_civ_trucking = true;
hint "You're Whitelisted!!";
};
IDC: 9901 is player Combo Box
IDC:9902 is Licenses Combo BOx
@still forum how does the profiler get data? Using prof executable? Or ur own dll?
Intercept plugin
It only needs prof build for the ingame profiling UI to display it
because it's not possible to open it on non-prof
But the brofiler version has it's own UI so it doesn't need that
Hi guys. Is there a function for raising/lowering landing gear on aircraft? Can't seem to find any with the "land" or "gear" in it. I need to force turn on landing gears on spawning aircraft
Yes.
🤔 could you tell me its name?
hey.
i've wanted to ask how do i change the place the menu starts to scale in? im using this fnc - ctrlSetScale
atm the menu starts to scale from the left.
ty.
I need to do this from an external script which detects nearby aircraft
someone?
ctrlSetScale is for 3d model controls iirc.
@verbal knoll You cant change the left upper corner by using ctrlSetScale, if you willing to achieve that, better create your own function which will shift the control position with ctrlSetPosition and some ctrlCommit with delay.
can anyone tell me how can i set this script to a selected player ? License_civ_tf141 = true;
@molten folio Remote exec that to a person.
since I don't get where it is selected exactly.
Can i screen share with you?
private _scale = 0.5;
ctrlPosition _control params ["_left", "_top", "_width", "_height"];
private _widthNew = _scale * _width;
private _heightNew = _scale * _height;
private _leftNew = _left + (_width - _widthNew) / 2;
private _topNew = _height + (_height - _heightNew) / 2;
_control ctrlSetPosition [_leftNew, _topNew, _widthNew, _heightNew];
_control ctrlCommit 0;
@twitch.tv/im_beast#8058 It's either this or something close. I'm very tired. -__-
@verbal knoll
I didn't understand your last question.
Well, like on the wiki.
[_value, {My_variable = _this}] remoteExec ["call", _target];
this?
^ but for security reasons its better to create a specific client function, since call|spawn can execute anything.
my brain is locked
[_value, {license_civ_rebel = true}] remoteExec ["call", _target];
like this?
xd
{license_civ_rebel = true} remoteExec ["call", _target];
["license_civ_rebel",_value] remoteExec ["myClientFunctionToGiveLicense", _target];
where your value is your true or false and _target is your selected player.
@little eagle are u free?
oh sorry, corrected
fml im confused
You need to read how the remote execution works before.
if (_unit == "license_civ_trucking") then {
{license_civ_rebel = true} remoteExec ["call", _target];
hint "You're Whitelisted!!";
};
like that?
yes
:thonk:
not working
how is _target defined?
Also... how about remoteExec setVariable @commy?
Yeah.. That is what I would want to ask you
apparently it isn't
You have to define it.
aigh
if (_unit == "license_civ_trucking") then {
Why would _unit be a string? This makes no sense to me.
_unit is an object.
It's just horrendous naming. if you had seen his earlier code you'd know it's a string
private _index = lbCurSel 9902;
_unit = lbData [9902, _index];
_target = lbCurSel 9901;
if (_unit == "") then {
hint "Please Select a whitelist!!";
};
if (_unit == "license_civ_pilot") then {
license_civ_pilot = true;
hint "You're Whitelisted!!";
};
if (_unit == "license_civ_rebel") then {
license_civ_rebel = true;
hint "You're Whitelisted!!";
};
if (_unit == "license_civ_dive") then {
license_civ_dive = true;
hint "You're Whitelisted!!";
};
if (_unit == "license_civ_gun") then {
license_civ_gun = true;
hint "You're Whitelisted!!";
};
if (_unit == "license_civ_trucking") then {
{license_civ_rebel = true} remoteExec ["call", _target];
hint "You're Whitelisted!!";
};
9902 is the License Combo List
9901 is the player Combo List
lbCurSel reports the index, right?
yes
Yeah, that is not how this works.
9901 is a ListBox will all connected players?
yes
its a ComboBox
TW_panel = playableUnits;
{
if (isPlayer _x) then
{
_uid = getPlayerUID _x;
_index = lbAdd [9901, (name _x)];
lbSetData [9901, _index, _uid];
};
} forEach TW_panel;```
jesus
TW_panel is a list of playable units?
ye
That's.. totally not confusing variable naming right there
and why do you use playableUnits and then isPlayer
instead of using allPlayers directly?
idk my friend told me
name errors for dead units too.
you have the players UID. I think there is a bis function to get object from player UID
But what if there's no player.
it wil be empty
This is something for BIS_fnc_netId / BIS_fnc_objectFromNetId
UID doesn't help here.
so i need to change the player list?
Is TW_panel used anywhere else?
{
private _netId = _x call BIS_fnc_netId;
private _index = lbAdd [9901, name _x];
lbSetData [9901, _index, _netId];
} forEach allPlayers;
and then...
private _unit = lbData [9902, lbCurSel 9902];
private _target = lbData [9901, lbCurSel 9901] call BIS_fnc_objectFromNetId;
I would also rename _unit to _type, because _unit implies OBJECT type, not STRING type.
fixed a typo
And then...
if (_unit == "license_civ_trucking") then {
{
license_civ_rebel = true;
hint "You're Whitelisted!!";
} remoteExec ["call", _target];
};
So, the hint is shown on the machine that got white listed, not on the admins (?) machine.
the hint was just there to test
if the function worked
but thhanks ill try this
now
@little eagle not working
Checked the rpt?
I'm doing stuff on the side you know, just post it here if there's an error,
k
i mean the function u gave me
not working
if (_unit == "license_civ_trucking") then {
{
license_civ_rebel = true;
hint "You're Whitelisted!!";
} remoteExec ["call", _target];
};```
Add some debug, print _target to rpt and look if it's the right one. Make sure call is white listed if you use CfgRemoteExec.
Is there a way to change the vehicle turret sights?
@astral tendon Sight modes or what exactly?
The reticle
how?
You can change texture of reticle to custom & then calibrate the ballistics
Which turret?
Here is a lot of nuances so, provide pls more info about what u're trying to do.
@astral tendon
Also, is that scope? Is that 3D scope & etc. etc.
Is the scope of the .50 UAV turret "B_HMG_01_A_F"
So, how to change it?
IDK, if u don't understood yet.
But that's would be useful for me.
So, gimme some time, i will try to investigate
And... What u want to change exactly?
Or you have new texture etc. etc.
I meant, if you trying to change sight's texture, it won't be hard but you would change ballistics too.
If anything else, say it.
I want to use a scope textere that is already in the game, like the LRPS
Instead of look like this
https://ibb.co/nKzm2S
I want it to look like this
https://ibb.co/kHOw2S
How you can see, it's UI
And only square mask there is texture...
Guess it's inside of HMG_01_F.p3d & HMG_01_high_F.p3d
Try to extract it & watch
So no way to do that by script?
You cant change scope textures, as scopes are actually objects which is created and held by engine internally.
Not sure how you are willing to attach that to yourself.
And also how to remove existing "texture"
Wow, this has been going on for hours now.
This is painful to watch.
Is there a way to change the vehicle turret sights?
No.
Done.
Is there a way to create your own turret based on vanilla with custom reticle?
No.
Seriously?
Always*
Uh, commy... 🙁
Yee?
U made me sad
is there command to get current fire "mode" of weapon ? _modes = getArray (configFile >> "CfgWeapons" >> _weapon >> "modes");
does anyone know if there is a way to export all available items in a virtual ammobox as an array?
@real tartan https://community.bistudio.com/wiki/weaponState
@blissful phoenix thank you 😃
anyone knows the transparent Color Code?
ty
If I run through a playableUnits loop on server side, how do I send a systemChat message to specific unit, if he mets conditions?
depends
So arma loosing precision on natural Number since how much, 9, 12 digits?
1E7
@little eagle Yeah, it's remoteExec, but ID is needed. Is it
_clientID = owner _unit;
"I am a message" remoteExec ["systemChat", _clientID];
?
"I am a message" remoteExec ["systemChat", _unit];
no need to ask the server who's the owner of that unit because the request has to go through it anyways
So it's just _unit as ID?
just pass the unit
the server knows who owns what, the remoteExec goes through the server, thus you don't need to pass the netID of the owner.
plus you'd need to use clientOwner, owner is server only
again, you don't need to get the ID of whoever owns what to use remoteExec
Yeah, I've got that, just trying to understand further 😃
clientOwner reports something different than the id used by RE anyway :^)
[_plane,[_unitTurretPlane,false]] remoteExec ["lockTurret",_plane];```
anything wrong with this from the looks of it?
and would this behave differently on an empty plane vs AI as pilot (SP/plane is local)?
anything wrong with this from the looks of it?
No, lgtm.
and would this behave differently on an empty plane vs AI as pilot (SP/plane is local)?
No, though I assume if the plane is empty,_unitTurretPlanewould be [] or something.
_unitTurretPlane is the turret index
seems actually this is the problem somehow
_unit action ["moveToTurret",_plane,_unitTurretPlane];```
for some reason moveToTurret doesnt work when the plane is not empty/the plane has an AI pilot
test case:
- plane with AI pilot
- start outside
- get in as cargo (manually or via
player moveInTurret [cursorTarget,[6]];orplayer action ["GetInTurret",cursorTarget,[4]];) - run
player action ["moveToTurret",vehicle player,[5]]to swap to turret
=> doesnt work driver vehicle player setDammage 1- retry 4
=> works
ive got an idea now. i think its due to commanding parameter in config
we adjusted these
now the pilot is effectiveCommander over cargoTurrets and thus he disallows you to change positions (even when using scripting)
Yeah, the AI will not let you leave a vehicle if they're the group leader. Maybe the same is true for switching slots.
yeah it was commanding=-1; in cargoTurret 😬
Does anyone know why the showGPS might not be working for me?
showGPS true and showGPS false both do nothing
whoops nevermind, that is for the map screen
Does anyone know how to show / hide the minimap then?
The minimap?
The GPS minimap, Right Control + M
Drop the GPS item.
I want to give players a GPS, so they can see their grid on the map view (using ACE), but I don't want them to have a minimap
Attributes -> General -> States -> Show GPS in the editor claims to do this, but has no effect
Well, that is what should control the gps. The showGPS attribute.
It hides the GPS object in the map view, but not the minimap
Do you have showGPS = 1; in description.ext? That's the mission config, and the mission config overwrites the attributes.
I don't have a description.ext for this mission
and ideally I'm trying to find a solution via scripting, it'd be nice to add it to a mod
Make one, put showGPS = 0; in.
No effect
Remember to load the mission after adding a file.
Yes
Make sure you load the correct mission. showGPS is definitely what toggles the gps.
I have other scripts in the mission and it is a very unique mission name, so I know I have the right folder open in my editor. I added description.ext with the contents showGPS = 0; and exited and reopened the editor just to be sure, then playing the mission. Both the minimap and ACE GPS on the map view are available.
Put this into the init.sqf file:
0 spawn {
waitUntil {!isNil "ace_common_AssignedItemsShownItems"};
ace_common_AssignedItemsShownItems set [4, false];
};
No changes
running ace_common_AssignedItemsShownItems set [4, false]; in the debug console also does nothing
Drop an item after executing this code.
alright, nothing happens
Can you screenshot that gps of yours?
I guess so?
do it
Are you inside a vehicle?
No
🤔
Got me stumped too
Let me start the game. Maybe it's fucked in 1.82.
Alright, thanks for the help
Yeah, seems like the mini map is shown regardless of the attribute.
@fringe yoke Put this into the description.ext:
class Extended_DisplayLoad_EventHandlers {
class RscCustomInfoMiniMap {
commy_hideMinimap = "\
params ['_display'];\
{\
_x ctrlShow false;\
} forEach allControls _display;\
";
};
};
It also works inside a config.cpp for an addon.
I have a performance question
I've already got that work around running 😛
if I have lots of items, and for each of them I spawn a script that basically just sleeps for 5 minutes and then deletes them
how much does that impact performance?
You do? I just made that up.
Well it ain't named commy_hideMinimap but yes. One interesting thing I found though, is that even unassignItem "ItemGPS" doesn't do anything. So it definitely looks like an Arma bug
I don't think this MiniMap has anything to do with the GPS.
They scrapped the GPS and replaced it with this thing some versions ago. I'm curius how you found this work around though.
@loud python spawn? Basically not at all.
so I can just spawn a new function fevery time a player drops an item and it won't do much bad, right?
that's nice 😃
I'm pretty sure the GPS is linked to the minimap, if I edit the loadout in the editor to remove the GPS and nothing else, when you start the mission you can't open the minimap
Seems broken.
Adding a GPS and then removing it does not remove the ability to toggle the minimap, and it stays open. So definitely broken.
GPS = minimap yes
although afaik vehicles will always let you see the minimap
(if you're a passenger for example)
could be a config thing though
Yes, it is a config option, most vehicles have it enabled
My script kills it for good.
Mine wasn't as nicely formatted, but it preserves it in vehicles that have a built in GPS
class Extended_DisplayLoad_EventHandlers {
class RscCustomInfoMiniMap {
synixe_nogps = "params ['_display']; { if (isNull objectParent player) then { _x ctrlShow false; }; } forEach allControls _display;";
};
};
well, actually I guess you could use it if you had a GPS in a vehicle that wasn't supposed to have a GPS. But I don't feel like going through configs
It would also nice to kill the annoying actions on the actions panel.
I had the same with Right Panel mode and Right Panel next
It disappeared after I bind hotkeys for them
what happened to event handlers wiki page? I'm the only one who is not convinced to new layout?
Nah, you are not the only one, reyhard. Previously, the ToC (Table of Contents) was on the left, and each listing was horizontal, meaning even if you skipped the ToC, you could still quickly find the entry you were looking for just by scanning the titles on the left.
Now the ToC is on the right, not the natural first place to look, in fact I almost forget about it everytime. And now everything about an entry is laid out vertically, so takes longer to find. Before anyone says I could just search - well yeah, I could that before - and then what is the point of a given layout.
I know this might not be the best place to ask but does ACE have any event handlers? It doesn't look like there is to me but I'm just wondering.
They have plenty
I can't find any :/
Most of ACE is works by using event handlers
I mean do they fire event handlers
Just posted lots of it.
Yeah, I had already type and hit enter before they popped up, thank you.
I was looking in the arsenal module, looks like they don't have any EH in there 😦
I think that is @lone glade area. Though if you are interfacing with ACE, you might want to restrict yourself to only the public events listed here: https://ace3mod.com/wiki/framework/events-framework.html
I just want to know when the ACE Arsenal is closed, an EH would be the most elegant solution. but there are other ways, thank you for the help.
I've used that page before :/ I think I am tired, I was searching in only arsenal and then was confused and thought all of ACE had no EH for a second.
There is one running locally: [QGVAR(displayClosed), []] call CBA_fnc_localEvent;
So the event is called "ace_arsenal_displayClosed"
So run something like
["ace_arsenal_displayClosed", {
// Your code here
}] call CBA_fnc_addEventHandler;```
Yeah, I know all about EHs. I was just putting too much faith in GitHub's search, https://github.com/acemod/ACE3/search?q=arsenal+in%3Apath+CBA_fnc_localEvent. Thank you for pointing out ace_arsenal_displayClosed to me.
For reference, when using Github search, it is: path:addons/arsenal event
gimme 5s
@dim terrace for feedback on the page #community_wiki @winter rose made it. The layout is not perfect yet but It's better than before
Huh, this is the first time I tried to use it for searching for code. Didn't realize it didn't search through code...
Thanks
https://github.com/alganthe/ACE3ganthe/issues/8
first post, events
that list is going to be added to the framework doc soon ™
I have same feelings as Muzzleflash about layout - imo TOC was faster to browse through
Does ace_arsenal_cargoChanged fire for weapons or other categories on the left hand side? Or just for uniform/vest/backpack items?
only when you click + or - in the right tab, so containers only
cool thanks
@dim terrace agreed
I´m looking for creating my own macros for saving time when programming.
But I don´t know if they´re expensive in optimization terms, what you guys think?
if I did player addAction[...]; would that give the action to everone looking at the player or just the player?
Having macros by themselves cost nothing.
However if the definition is more complex than necessary where you are using it, then it may worsen. But defining macros is essentially free.
@errant jasper Could you do an example?
@glad venture just the player who's PC it ran on
[[player, ["My Action Title","myAction.sqf", ...]],"addAction",true,true] call BIS_fnc_MP;
that is for an action for everyone, including people that join after the mission has started
you can read more at https://community.bistudio.com/wiki/BIS_fnc_MP
Someone knows or has developed a script listen to an audio in streaming in-game,it´s possible?
For example if i do #define GVAR(unit,var,default) (#unit getvariable [#var,#default])
That's just a waste.
Here is an example. Some ugly code that's hard to replicate exactly every time, but used in a few places:
@orchid saffron https://github.com/CBATeam/CBA_A3/blob/master/addons/main/script_macros_common.hpp#L1732-L1763
If you replace a getVariable with a GVAR, there's absolutely no point, since what you got afterwards is just as long as what you had before. You have all the drawbacks for no benefit.
anyone know the best way to convert mp4 to ogg
Thats...
I use VLC
I use ffmpeg for my audio and video conversion needs
how do you check if an obj typeof is in an attachedobjects array? do i have to foreach _x == typeof? or is there a faster way?
findIf urg
cant find the biki for that, undocumented?
oh ok great thanks
It should be >= 0 ofc
ic since its index of found element, and -1 if nothing, very nice i can replace alot of my foreach stuff
This is something that could get a macro, because that would give you more descriptive code than the mess above:
#define HAS_ATTACHED(obj,item) (attachedObjects (obj) findIf {typeOf _x == (item)} != -1)
There's scriptDone for execVM. What's the equivalent for call?
I don't believe there is one. Why would you even want one? But you can set a variable after the call is done I guess.
does anyone know how to get rid of saves for an mp map? i am testing all the slots out and I keep spawing with gear from one specific slot.
do i have to specify to use files like functions.hpp, defines.hpp, and dialogs.hpp or are they used by default?
you need to do #include functions.hpp in your configfile (config.cpp / description.ext)
@lethal ingot scriptDone for call doesn't make sense. Because after your call your call will be done
is there a way to pass variables to a dialog?
As in
is there a way to read side chat via script, to output it for logging or otherwise
kindof like how a rcon service works but ingame
No, and I tried.
The problem seems to be that the chat log is using structured text and not strings, and there actually is no command to read structured text.
ah
Yeah, same reason you can display stuff from html, htmlLoad, but you can't use it in SQF. No way to read it.
gotcha
@glad venture _display setVariable ["key", value];
@little eagle and so from the display would I just use this getVariable?
Yes.
Doesn't even have to be the display. You can also set the variables on all of the controls.
ok
I was making a vehicle spawner and just wanted to pass the location of the marker
CBA per frameHandler?
That's how I do it at least
Although I guess if HUD is mostly static that might be overkill - in which case I just modify the HUD elements whenever they have to.
You could add a MouseMoving and a MouseHolding eventhandler with the same code to the display.
Because, i using fsm, and thinking if cba or any other loop, maybe more optimized
That way it deletes itself once this display is killed.
Together they fire every frame.
"FSM or for loop" is a invalid comparison.
a for loop can be SQS or SQF or FSM and scheduled or unscheduled.
"cookie or cupboard"?
Nice @little eagle , I like it.
What do you like?
The idea of using mousemoving/mouseholding instead.
Not sure.
Well, the display is... Do you want to retrieve it? Then you need onLoad event in the class.
class My_Display {
onLoad = "uiNamespace setVariable ['My_Display', _this select 0]";
};
cutRsc "My_Display";
private _display = uiNamespace getVariable "My_Display";
Yeah, I guess that ought to do it.
And then I also move the perFrame args to uinamespace instead and that should be all the changes.
?
Currently I have args to my perFrameHandler. Since I no longer have those args passed from the mouse events I should store them somewhere to access them. Is there a better place to put them?
On the display as well I guess.
_display setVariable ["my_args", [_arg1, _arg2, _arg3]];
_display getVariable "my_args" params ["_arg1", "_arg2", "_arg3"];
Yeah. Side question, wasn't there something about the "code" passed to addEventHandlers was actually recompiled all the time, or do I misremember?
Yeah, that's true.
_display setVariable ["my_draw", {
...
};
private _fnc_update = {call (_this select 0) getVariable "my_draw"};
_display displayAddEventHandler ["MouseMoving, _fnc_update];
_display displayAddEventHandler ["MouseHolding, _fnc_update];
That way only:
call (_this select 0) getVariable "my_draw"
has to be recompiled, which is pretty short.
does nearestVehicle "vehicle" include people?
There is no command named nearestVehicle afaik.
@little eagle i ment nearestObject
nearestObject [position, "vehicle"]
would always report [], because there is no class named "vehicle" in CfgVehicles afaik.
how would select the nearest vehicle then
Define "vehicle".
anything you can enter and drive, including planes boats helicopter
Radius?
15
worldsize huehuehuehue
15 meters should be doable.
im trying to makesure that there aren't any cars near where I am about to spawn a vehicle
Alright, I got it changed. Thx @little eagle .
private _near = _position nearObjects ["All", 15];
// remove non-vehicles
_near = _near arrayIntersect vehicles;
// sort by distance
_near = _near apply {[_position distance _x, _x]};
_near sort true;
private _nearest = _near param [0, [nil, objNull]] select 1;
This is my attempt.
fixed something
hi all,
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers has been updated with Cfg ref template.
private _near = vehicles inAreaArray [_position, 15, 15];
// sort by distance
_near = _near apply {[_position distance _x, _x]};
_near sort true;
private _nearest = _near param [0, [nil, objNull]] select 1;
Maybe faster, would need some testing, but I assume so.
For a CBA setting overridden by mission or server, can it happen that the handling code is run multiple times with different initial values? E.g. the client has false, but server/mission overrides with true, might it run with false?
I guess.
I have a setting that I would prefer not handling changes to during a run. Imagine ace medical being changed from advanced to basic during gameplay. Can I somehow detect when the "correct initial value" has been determined?
I see ACE and TFAR use CBA_settingsInitialized - can that be used ?
after CBA_settingsInitialized all settings were propagated from server and everything is set
I think
I think you are right. At least it is ACE's interpretation https://github.com/acemod/ACE3/blob/cd30b09b4f8517ab3f075def26ee0cd4c37e366c/addons/common/functions/fnc_cbaSettings_settingChanged.sqf#L28
Hey, has anyone ever heard of a script that lets you kill people with thrown IR grenades?
Like, I'm trying to build something like dodge ball, where you can throw things at each other.
So I'm thinking there's a way to check if a thrown projectile has collided with a player?
I'd just use 40mm smoke grenades, but they don't do impact damage.
maybe attach a bullet to the grenade?
no, attach a bullet to it and check Hit Event Handler maybe
like attachto? doesn't that remove collision for the attached object?
I'm just trying to build a mini game for people who are in the dead box.
Did you already try a hit event handler to the IR strobe to see if it triggers ?
negative, I was about to start poking around with that.
just wondering if someone remember seeing something that existed like an Arma Snowball fight or something I could just copy.
MPHit usually only fires when someone is damaged by something, no necessarily when a projectile hits something.
If hit only triggers when damage is dealt (Which I believe it does) you can always try adding a fired eventHandler and then do a distance check
Basically just checking the strobes distance to different body parts, and if it still has velocity
Is IR strobe PhysX enabled? If it is you can try EpeContact eventhandler
Anybody know how to allow a scripted in map marker be editable by Zeus interface?
map markers are local.
You want do have a marker be draggable?
You can write something that has the marker follow a draggable object around, like and invisible helipad or something.
Or Make it a task that's synch'd to the object.
No I would need full Curator control of the object
You can add objects to curator, then it'll be like a little object symbol that they can drag around.
Where can i find the info about how the eden modules are done in script? Basically i want to know how to create the particle effect "smoke" via script.
addCuratorEditableObjects does not work on markers
Use it on an invisible helipad, then write a script that moves the marker to the helipad consistently.
I need the marker itself to be editable by curator
@knotty mantle in eden click tools > functions > moduleEffectsSmoke
noice. Thanks
Dear BI please add addCuratorEditableMarkers command
Anybody used the COS (Civilian Occupation System), if so having issues with the AI Civs moving off the road and follow their scripts, using the Tanoa map, if anyone wants the script let me know 😃
do sound files have to be put in description ext, or can i just do say3D "/sounds/sound.ogg"
for say3D yes, also you will need CfgSounds https://community.bistudio.com/wiki/say3D
Helo can someone clarify something for me. My problem is that when player join "_group" and then leave it this group becomes "NULL-group" Is there a way to keep it up? From what I've seen in wiki default attribute should be keeping this group alive even if all units leave but it seems that it's not exacly working as I think.
_group = (createGroup west);
missionNamespace setVariable["test",_group,true];
this addAction["Join",{[player] join (missionNamespace getVariable "test");},"",0,false,false,"",'side player == civilian'];
this addAction["Leave",{[player] join (createGroup civilian);},"",0,false,false,"",'side player == west'];
🙄
group with 0 units will returns as <NULL-group>, but it will be not destroyed and it can be used... createGroup [side, deleteWhenEmpty] (since Arma 3 v1.67)
also we have isGroupDeletedWhenEmpty
message was removed 🤔
So I guess it's useful for things like:
{
systemChat format["TESTING GROUP: %1",_x];
if(!isGroupDeletedWhenEmpty _x) then
{
systemChat format["GROUP: %1 NOT DELETE WHEN EMPTY",_x];
private _newGroup = createGroup[side _x,true];
systemChat format["CREATED NEW GROUP: %1",_newGroup];
deleteGroup _x;
systemChat format["DELETED OLD GROUP: %1",_x];
{
[_x] join _newGroup;
systemChat format["UNIT: %1 JOINED: %2",_x,_newGroup];
} forEach (units _x);
};
} forEach allGroups;
yep
How could I go about checking if a cutText layer is currently on the screen? I thought I could check if a layer name was in allCutLayers, but it stays there regardless of whether the actual text is on the screen or not.
Thank you for your help @meager heart @subtle ore . Just one follow-up questions so I will make sure that I understand. Once the group becomes NULL-group it's not deleted but players cannot join it any more so I need to check them and recreate if needed?
a group cannot become NULL-group
a variable can become that. Which indicates that the group doesn't exist anymore aka was deleted.
@subtle ore all your code
->
{[_x, true] remoteExec ["deleteGroupWhenEmpty", groupOwner _x];} forEach allGroups;
Ah you mean "<NULL-group>" and not NULL group. aka grpNull which are completly different things.
Yes
What a dumb Idea to call a empty group "<NULL-group>" instead of "<empty-group>"
"<NULL-group>" can be two things then. Empty group (in which case it's still valid and you can join units into it) or grpNull in which case it doesn't exist. It's just a pointer as "this variable would hold a group if it wasn't deleted"
I was trying to use my addAction mentioned above but when I joined, left and tried to join again it didn't work. I've also printed the "test" var and I've noticed that in the beginning it has a proper name but after leaving it becomes "<NULL-group>" and then I cannot join it any more. Is there some special way of joining into "<NULL-group>"?
The only thing that comes to my mind is that this var I created to get into group is no longer valid for use after group becomes "<NULL-group>".
player spawn {
private _group = createGroup playerSide;
hint format ["Test group: %1\nPlayer group: %2", _group, group _this];
sleep 5;
[_this] join _group;
hint format ["Test group: %1\nPlayer group: %2", _group, group _this];
sleep 5;
[_this] join grpNull;
hint format ["Test group: %1\nPlayer group: %2", _group, group _this];
sleep 5;
[_this] join _group;
hint format ["Test group: %1\nPlayer group: %2", _group, group _this];
};
```try it in the console ^
@native siren
Dedmen told you already... but
<NULL-group> empty group
grpNull not existing group
Yeah will do that @meager heart as soon as I will get home. I'm probably a little bit thick and the answer is in from of my eyes. Thanks guys 😃
Yeah as I said. Null-group can be two things apparently. In your case it apparently is the second case. Which means the group doesn't exist at all so you also cannot join it.
You should be able to check that using _group isEqualTo grpNull
In a HitPart handler how to detect if player was _shooter if in a vehicle with multiple weapons?
Thanks that did.
Hmm. How to get HitPart to fire for all kinds of objects? It works for vehicle and personel, but not a target object
Is it possible to prevent postprocessing effects being wiped by pressing Esc
private _item = "";
private _configName = switch true do {
case (isClass (configFile >> "CfgWeapons" >> _item)): {systemChat "1"; "CfgWeapons"};
case (isClass (configFile >> "CfgMagazines" >> _item)): {systemChat "2"; "CfgMagazines"};
case (isClass (configFile >> "CfgGlasses" >> _item)): {systemChat "3"; "CfgGlasses"};
case (isClass (configFile >> "CfgVehicles" >> _item)): {systemChat "4"; "CfgVehicles"};
};
Anyone know why _configName here is returning true here but nothing is being printed to systemChat?
because none of them are true
and there is no default case so I guess it just returns true?
Ah really? I thought it would return nil as it couldnt find anything true
it should
would think too
private _test = switch true do {
case false: {"test"};
};
systemChat str _test;
Apparantly not. The above returns true as well.
https://community.bistudio.com/wiki/switch_do
If the condition is not matched by any case and there is no default, it returns true.
getShotParents always makes me giggle
is there a way to add a handle damage event for the source of the damage, like an event handler that triggers when the player damages something else
no
@tame portal Batman is coming for you
@glad venture What are you trying to achieve exactly, didn't get you.
@unborn ether i am trying to make it so that when a player shoots ai with certain ammo, it triggers a tazer script
I could try adding the event handler to every ai that is spawned
@glad venture Well yes, thats what you need to do. Kinda might spam, but yes.
Dont forget to follow the locality of argument btw.
How would I do that would I just do _man = spawncmd; _man addEvent handler. For every AI I ever spawn?
@glad venture Yes, you should have a head function which does spawn every AI and simply apply it there, if its MP, server sided ofc.
Is there a command to check if there is a line of sight between two objects?
yes, can't remember what it is tho^
ah, remembered!
https://community.bistudio.com/wiki/checkVisibility
👏
yeah i tested that. @lone glade and either i am too stupid or it is pretty broken.
I did never get over 0.6 even if i went up REALLY close. And from a certain distance it was just 0.
And as i want to use it to make AI see us faster on higher distances that is not working so well.
Fiddling around currently with lineIntersectsSurfaces
Why surfaces?
@meager heart I've tested the code those are results:
Test group: B Alpha 1-1 Player group: B Alpha 1-2
Test group: B Alpha 1-1 Player group: B Alpha 1-1
Test group: <NULL-group> Player group: B Alpha 1-1
Test group: <NULL-group> Player group: B Alpha 1-2
If I add deleteGroup _group; after create I get.
Test group: <NULL-group> Player group: B Alpha 1-2
Test group: <NULL-group> Player group: B Alpha 1-1
Test group: <NULL-group> Player group: B Alpha 1-1
Test group: <NULL-group> Player group: B Alpha 1-2
Tbh I don't see any difference between deleted group and empty one. It seems like doesn't matter what attributes i use createGroup [side, deleteWhenEmpty] it always deletes it when it becomes empty and I cannot get this specific group to stay.
does anyone know of a way to hide/destroy a helicopter blades like it touched a tree or walls?
hideSelection only works on simpleObject, and setHitPointDamage doesn't break them
You could do it the really dumb way and just spawn a pole, engineOn, then delete the pole =D
hey @digital hollow would you by any chance know if im allowed to advertise my new wasteland server on #creators_recruiting
I think that's for content creators looking for contributors.
How does the RscHTML Work???
@molten folio It goes with htmlLoad
@native siren Something is cleaning up your groups then.
anyone here know a lot about ACE 3?
why ^ ?
@unborn ether That's what I thought but I tried it in new mission where I just run this and got the same results.
@native siren In Arma 3 when last unit leaves its group, the group usually gets immediately auto deleted, regardless of whether or not if it was set for auto deletion manually well, I personally don't understand the reason of that parameter.
Thank you at least I know I'm not going crazy. 😃 I don't get the point of this parameter as well but oh well. I will just create something to check if group is null and then recreate it.
im trying to figure out how to make ai unconscious or at least give medics the option to carry them when they are conscious in ace
but I hope there would be more elegant solution
@glad venture https://community.bistudio.com/wiki/setUnconscious
@native siren Well you can create some dummie npc elsewhere to keep it up
Yeah that could work as well.
there's a module in zeus for that
@native siren im already doing that but it still doesn't give me the option to move the person, i am trying to find the script name for carrying a person so i can add it to the interaction menu
@glad venture I don't think there is convenient way to achieve this. You need to use attachTo and some animations to make it work. I've seen some scripts on Armaholic that do that.
if that helps @glad venture or https://forums.bohemia.net/forums/topic/161291-a3-wounding-system-ais-by-psycho/
@native siren its already there, i have ACE , im trying to figure out how to add the option to carry them even if the person is awake
If i were to make a script that cycled over all the ai on a sever ever 10 seconds or so, would that cause a lot of lag?
Anything causes lag. What are you doing within the script
Ooh good question. I’ve got a while loop that checks the ai distance from the way point and changes the ai behaviour accordingly within 75m. That loop cycles every 15 seconds. If I have 5 or so groups running with that on the server, could that cause server lag etc?
depends on how many units you have in the 5 groups, if each group is 100 then sure. If you're worried with a reasonably high ai count then transfer them to an hc
if you're talking like 50 or something like that, probably not.
@glad venture Why do you wanna cycle all the ai?
Yeah they are on headless already. Sahweet
Help, please, broke my head already with this.
How do I do stuff in a loop with sleep, while dialog is opened, and then terminate it after it closes? [] spawn doesn't know about variables outside, and I can't make them global because this is per player.
_dialog = createDialog "MJ_TabletDialog";
while {_dialog} do {
systemChat format["Tablet opened %1", time];
//sleep 5; // This sleep breaks everything
};
Also time isn't refreshed, it just spams first value
If I make
systemChat format["Tablet opened %1", floor random 100];
Then it just gives several random numbres and then just stops. 😖
I don't know if I misunderstood you but global variables are not public variables and therefore still remain per player if you make them global
In Arma 3 when last unit leaves its group, the group usually gets immediately auto deleted, regardless of whether or not if it was set for auto deletion manually well, I personally don't understand the reason of that parameter.
0 spawn {
private _group = createGroup playerSide; //--- Default deleteWhenEmpty is false
hint str [_group, group player, count allGroups];
sleep 5;
[player] join grpNull;
hint str [_group, group player, count allGroups]; //--- _group is empty
sleep 5;
[player] join _group;
hint str [_group, group player, count allGroups];
private _unit = _group createUnit ["B_pilot_F", getPos player, [], 10, "NONE"]; //--- works
};
0 spawn {
private _group = group player;
hint str [_group, group player, count allGroups];
sleep 5;
[player] join grpNull;
hint str [_group, group player, count allGroups]; //--- _group is empty and will be auto removed
sleep 5;
[player] join _group;
hint str [_group, group player, count allGroups];
private _unit = _group createUnit ["B_pilot_F", getPos player, [], 10, "NONE"]; //--- fail here
};
@unborn ether
@grand sleet
Oh, my bad, yes. Private, public, global.
Anyway, got away with per player variables.
onLoad = "player setVariable [""tablet_on"", true]; systemChat ""Dialog opened"";";
onUnload = "player setVariable [""tablet_on"", false]; systemChat ""Dialog closed"";";
[] spawn {
while {true} do {
while {player getVariable "tablet_on"} do {
systemChat format["Tablet opened %1", time];
sleep 3;
};
};
};
@meager heart I got it, but still no idea why would I join unit to a deleted group, and also if it fails it gives more consequences)
idk 😀 ¯_(ツ)_/¯
BTW, doesn't
0 spawn {
have to be
0 = spawn {
or these are the same?
In case if you don't bother about returned values, of course
Also, I don't understand difference between displayAddEventHandler and displaySetEventHandler
Read the wiki, but looks like I lack some knowledge. Can someone explain in simple language?
afaik all display/control set EH are just leftovers from the older games 🤷
wrong
Add - stacks. Set - overrides.
so
(findDisplay 46) displaySetEventHandler ['KeyDown',''];
will override any keyhandler set before.
yes... but why you need override them ? 🤔
also
Game: Armed Assault displaySetEventHandler
Game: Arma 2 displayAddEventHandler
also x2
do they stacks ? 🤔 🤔
saw question about F1 try this, MJRamon 😀
(findDisplay 46) displayAddEventHandler ["KeyDown", {
_this select 1 == 0x3B
}];
btw that ^ is not 100% reliable
@meager heart you could use it to remove all eventhandlers
yes... but we have displayRemoveAllEventHandlers and ctrlRemoveAllEventHandlers
imo set UI EH that how you break some other addons/scripts 🤷
@drowsy axle Does arma's default SP save function save variables? yes.
@lethal ingot displayAddEventHandler as the name says. Add's a eventhandler.
displaySetEventHandler sets it.
There can be a "unlimited" number of displayAddEventHandler. but only a single displaySetEventHandler
no 0 spawn { and 0 = spawn { aren't the same. The second one actually doesn't make any sense. The 0 = something is just to get around a stupid bug in all the Editor script boxes
Hey guys, anyone here with some free time to explain a thing or two to me please? Trying to get commands going but I am a complete and utter noob to it.
don't ask to ask just ask
Well,
- I want a AI to open a boom gate when a friendly vehicle approaches, just vehicles, no infantry.
- Want to connect live feed to screens, want to connect laptop to screens
Oh man. I thought you're gonna ask easy stuff 😄
I know how to open a gate. Or atleast I know where to find that. But I don't know if you can make a AI go and open it.
live feed. Basically create a camera and then setObjectTexture on a laptop. I'm sure someone made that already gimme a sec
Otherwise I will just place a AI gaurd next to the gate and then we pretend he opens it XD
https://forums.bohemia.net/forums/topic/148623-openclose-bargate-solution/ Here to opening the gate. You can connect that with a trigger that detects if vehicles are in a certain area
I saw that video but for some reason I do not have the init file that he mentions
Ah I see! Will go google into that quick. Told you I am noob
is init.sqf used by default?
if the file exists then it will get called.
ok, and it's only on the servers start, right?
no
on mission start
mission also starts for you when you join in 20 minutes after everyone else started
so is it for every person that joins?
i was trying to apply a damage handler to all ai that spawns and someone told me that when they spawn, they call init.sqf
Everyone that joins executes that script yeah.
no. no one told you that. And it's not correct
someone told you they execute their init script.
You then guessed they mean init.sqf. And that same someone corrected you saying that it's not init.sqf
I was there when that conversation happened
is there a way to specify their init then?
yeah. There is the init script box in Eden.
There is also a init eventhandler which is kinda tedious to use except if you have CBA
so you mean like in attributes? I was planning on spawning them through scripts so I guess I'll just have to add the event handlers to every spawn script then
if you spawn them through script. Then you can just add the eventhandler in that script.
That's easier. Unless you have CBA. then the init eventhandler is probably still easier
I do have CBA, but is it like a global thing or do I still have to add it to each ai, I also might use the civilian presence module
you add a single global thing that will execute a script on any unit that ever spawns
Turn that into every soldier so you don't have vehicles. And you have all AI's and player units
and to get AI's would I just check if getPlayerUID == ""
or just use isPlayer 😄
oh
I was trying to find out what the command for that was
and the event handler goes into cfgVehicles.hpp or desc.ext?
ok
How could I go about checking if a cutText layer is currently on the screen? I thought I could check if a layer name was in allCutLayers, but it stays there regardless of whether the actual text is on the screen or not.
@warm gorge The thing is that any layer created stays there, until removed.
Ah damn makes it a bit difficult then
Is there a way to get all assigned variables for an object?
I would. But people tell me I shouldn't do that anymore ._.
People have feelings @still forum
@warm gorge Dedmen does not you see.
I'm sure we can fix that
is it possible to make addaction do multiple things?
Example?
You can put multiple things into it's script
You can execute whatever you want
You can set the world on fire.
Yes
this addAction["Take", {this attachTo [player,[0.5,0,1], "zada"], player setVariable["iscarrying", "true"]};
I'd expect that comma after zada"] to be a limiter, but it's not
I'm probably missing something super easy
semicolon <
not comma <
why is it called semicolon even? a colon is also a semi colon isn't it? It's one colon.
And if you mean semicolon as in only one dot of the colon.
Then it would be dot.
Asking the important questions here.
oehh thanks!
So, i am making a function that decays a number for a certain number of seconds, on a certain scale. If i were to make the return the variable that is being decayed. Will the return value change during decay or will it only change on exit?
you cannot return a number by reference
after return it get's copied
you can create an array with the number inside it and return that. That'll get returned by reference
and you can then use set to change the value in the array and it will change everywhere
Alright, cool.
now I'm getting error reserved variable in expression, I'm assuming that's something reserved by the game.. what am I misusing?
_thing addAction["Take", {_thing attachTo [player,[0.5,0,1], "zada"]; player setVariable["playeriscarrying", "true"];}, playeriscarrying != true];
setting a vehicle velocity inside a loop to maintain a certain speed, can this setVelocity cause some performance issue to the server?
it shouldn't change the rate of velocity updates I think
@steady terrace
_thing is undefined inside your script
it doesn't carry over.
and playeriscarrying != true will never work
you are comparing the global playeriscarrying variable. But you only set the variable on the player object
also "true" can never be true.
also you cannot compare booleans
you are like... doing everything wrong that you could do wrong 😄
_thing addAction ["Take", {
params ["_thing"];
_thing attachTo [player, [0.5,0,1], "zada"];
player setVariable ["iscarrying", true];
}, !(player getVariable ["iscarrying", false])];
Even more incorrect. The third argument are the arguments. But it looks like you think that's the condition
_thing addAction ["Take", {
params ["_thing"];
_thing attachTo [player, [0.5,0,1], "zada"];
player setVariable ["iscarrying", true];
}, [], 1.5, true, true, "", "!(player getVariable ['iscarrying', false])"];
Hey guys, how would i terminate a drawIcon3D that's encased in onEachFrame?
drawIcon3D ["targetIcon.paa", [1,1,1,1], _randPos, 1, 1, 45, "Drug Cache", 1, 0.05, "PuristaMedium"];
};```
Literally like that
There can only be one onEachFrame
so if you create a new one it deletes the old
so just onEachFrame {}
Ok, thank you
whoa thank you @still forum ! sadly i'm still getting the same error
hmm.. that's weird.. cause it does say line1. oh well
anyone know how to tell if an npc is handcuffed in ACE 3?
_target getVariable "ace_captives_isHandcuffed"
ok, is there a place where I can see all the ACE functions or should I just try to unpack the pbo's and look through them to find the function names and params? I tried the function viewer on configFile and couldn't find anything for ACE functions
Have you tried using the addon filter? You can select functions that have their own category and tag
is that the second select box? i tried looking through it but could only see stuff for default arma and CBA
@glad venture https://github.com/acemod/ACE3
@gleaming oyster ACE functions aren't shown in function viewer
So do I have to just unpack the pbo's and look through them?
I looked at it but theres nothing about the any of the functions or anything
squints wut
If it's not in there it doesn't exist
So I would have to keep doing what I was doing, unpacking the addon files and looking through them?
How are functions registered then? I took a look at say the advanced ballistics folder and i don't see how they connect, it's with the Extended event handlers that they are registered? Thus, they don't show in the functions viewer?
I see. Interesting
CBA*
generally everything in the functions folder is a function
CBA doesn't use that system itself though
CBA still uses CfgFunctions
all modules?
and where in the editor are all the modules for ACE, are they under system>modules?
That's where all of them are.
ok, I couldn't find some of them, ill try again later. also, are the variable applied to any unit name ace-moduleName-whaterver is called in qgvar (I replace underscore with dash)?
There are no ACE modules anymore
And I don't understand your question. which is also missing a question maro
how exactly am I supposed to enable things like FRIES on a helicopter?
it says this, "synchronized with the “Equip FRIES” module in the editor." Is there a fries module then?
yes
if it says that then it probably is that way
but there are no ACE modules to configure settings anymore. That's what I meant
and that's what 99% of the people mean that say "where are the ace modules"
so if the function sets variable using QGVAR(isState) then to get the variable it would be ace_addonName_isState?
is cbChecked still working? It seems to just completely ignore my control and state one isn't present
Anyone know how to disable the re-arming using ammo trucks? I wanna stop it in certain areas 😛
@chrome mason : setRepairCargo to 0
On what? The truck?
and that does ammo vehicles?
typed way too fast yeah :p
setAmmoCargo
setRepairCargo
setFuelCargo
Clonenfuhdbfdsnf = {
_index = lbCurSel 9110;
_unit = lbData [9110, _index];
player setUnitLoadout (getUnitLoadout _unit );;hint "Copied Player Loadout";
};```
does it working like that?
uh
yes..
That code does what it does
Ah
you edited it. No it doesn't
lbData is a string.
getUnitLoadout only takes object or classname
unless _unit is actually a classname...
how do i make it from a player list?
In which case you finally gotta work on your variable naming to stop being confusing
I don't know what your player list contains
if you have netID's then you can just turn the netID into an object
PlayerList = {
TW_panel = playableUnits;
{
if (isPlayer _x and (_x != player)) then
{
_uid = getPlayerUID _x;
_index = lbAdd [9110, (name _x)];
lbSetData [9110, _index, _uid];
};
} forEach TW_panel;
lbSetCurSel [9110, 0];
};```
if it is playerUID's then I think BI also has a function for that
so uid
_playerObject = allPlayers param [allPlayers findIf {getPlayerUID _x == _unit}, objNull]
will spectators mess with nearEntities if i search for "Man"?
Depends on the spectator script
ty guys
Don't suppose you lot know if cbChecked or ctrlChecked are working? Can't seem to get it to return anything >.<
good spectator scripts won't mess with that
which one is easier ? netID or getplayerUID
but there are many crappy spectator scripts in existance
I just gave you the solution for getPlayerUID...
?!!??!
netID is easier. But I'd have to also write that down
and writing is hard
And you would also need to change the rest of your code for that
so why not just take what you already have?
@brave jungle never heard of them not working.
where do i put this ```_playerObject = allPlayers param [allPlayers findIf {getPlayerUID _x == _unit}, objNull]````
hmm strange
where do i put this
Your original question was how do i make it from a player list?
it being the object you need for getUnitLoadout
There is the code to get the object
and you want it for getUnitLoadout
whats that code?
so I would put it just before getUnitLoadout so that you have the object that you need.
It's SQF code.
It finds the player with that playerUID
Clonenfuhdbfdsnf = {
_index = lbCurSel 9110;
_unit = lbData [9110, _index];
player setUnitLoadout (_unit getUnitLoadout);;hint "Copied Player Loadout";
};```
like that?
what the hell dude.
xDD
I'll go to bed. You'll figure it out.
what are you trying to do with loadouts exactly?
Just read what I wrote. And think about it
instead of begging me to solve the problem for you although I already did
can u rewrite it in a better form?
no
xd
You'll never learn how to script if you don't try to figure things out by yourself
lol
And I just don't have time to babysit you for the rest of your life.
Your function returns a string (PlayerID), and then uses that string in a command that requires an Object (the player). Dedmen gave you a script that converts a PlayerID into a player Object.
Before I confuse myself again on something simple, the control is the class "name" right? i.e
class RscCheckbox_2804: RscCheckbox
{
idc = 2804;
x = 0.402031 * safezoneW + safezoneX;
y = 0.533 * safezoneH + safezoneY;
w = 0.0154688 * safezoneW;
h = 0.022 * safezoneH;
};
Where RscCheckbox_2804 is the control.
i read the wiki for the GetPlayerloadout and lbdata and from my understanding _unit is a class
you mean the control aka the argument to ctrlChecked?
Yea
nope
wait a sec. Am searching
@molten folio Return Value: String from https://community.bistudio.com/wiki/lbData
k
You need to retrieve the actual control from the dialog by it's idc
There is a command for that. Just need to find it
@ruby breach which means its not a class?
Ah wonderful 😄
@molten folio https://community.bistudio.com/wiki/getUnitLoadout Takes a object or a config class.
I told you, you need object. But you still keep thinking you need the class?
Well. You have the playerUID. https://community.bistudio.com/wiki/getPlayerUID
Do you really think a player ID is a class?
i give up fuck the menu
That's the right decision now. You asked around for help for 3 or more days now. You got tons of people that helped you and threw the answers to your feet. Now you just need to copy-paste a single line of code.
And you give up.
tell me where is the that fucking line
find it
Your function returns a string (PlayerID), and then uses that string in a command that requires an Object (the player). Dedmen gave you a script that converts a PlayerID into a player Object.
Maybe you just have a blackout. Happens quite often. I would recommend to just sleep a night over it and get back to it with a clean head tomorrow
yep^
You have 3 lines of script.
And I gave you one line of script that you have to insert somewhere. There aren't that many combinations.
From what i've observed, yes, yes you do.
The harder you bite down on a problem the harder it is to solve. You need to free your mind.
Like how you get the best ideas while showering or trying to sleep.
But when you sit there and try to get ideas you get nothing.
if you get stuck walk away for 15 minutes and come back
...
from personal experience all my first attempt at problems are always way too complicated
then you'll say out loud "FUUUUCK"
I'm a personal fan of the "explain it to someone like they're 5" method. You eventually get to the broken line and feel like an idiot
"from personal experience all my first attempt at problems are always way too complicated" All the time, then say third attempt, BAM! something simple
explain how to program to a five year old. Without saying "just take this thing. And put it there"
doesnt apply to sex
haha
That's meta 😄
not necessarily - they just lack all fundamental knowledge and skills - which they will learn over time in school. One of them beeing able to read and/or understand . The last propably beeing patience...
+1
well yes, which is what I said but lengthier
kids are incredibly stubborn
they are literally stupid
no shit
they are not even capable at a certain age to understand the concept of multiple consciousnesses
that continues up to the point where the brain is mature enough
Hey guys. Could someone please explain to me what event handlers are, and where it's normally necessary to use them?
is there a way to rename weapons/mags display name using ACE 3?