#arma3_scripting
1 messages · Page 518 of 1
I don’t think it would come to that, it would be ambiguous before you need to worry about copy and reference. Gonna try to add ++string straight up, expecting it to fail
i will just stop talking to you about this right now 🤦
Whatever dude
I suppose you can have 3 unary ++ with higher precedence than unary + so that ++STRING is resolved first and ++NUMBER and ++ARRAY to duplicate chained unary + for those types to avoid errors. Super ugly but might work
Or just add one ++ANYTHING with higher precedence, a bit better
I feel that I'm going crazy over those score eventhandlers...
I'm using a "Killed" eventhandler in an environment with a headless client on a dedicated server. This eventhandler basically does nothing but writing in chat when it gets attach to something and when it gets triggered, also it returns false so nobody gets any scores.
This EH gets activated for every player on missionstart on the server, also every player adds it remotely on the server to itself when the player respawns.
This is working absolutely fantastic when I try this on a self hosted environment or on a dedicated server without any headless client.
But as soon as I start the mission with an HC connected (which handles all enemy AI's), the EH goes haywire and sometimes triggers, sometimes not.
When I run around as soldier and kill AI's, it seems to somehow trigger fine, but when I'm inside any vehicle, it sometimes detects kills, but on ~70-80% of all kills the EH doesn't trigger at all, even though I got kills & score added. When I exit said vehicle and kill an AI unit, it triggers again.
What? How? Do I need to add it to the HC? Any other thing I am missing?
Does anybody have any idea why arma ungroups my units sometimes when they enter a vehicle?
I'm trying to link Objects/Spawns to a invis object, so that if Invis object is present, one side (Opfor) spawns, but if not present Blufor spawns.. but i can't actually figure out how to do that.
Is there a better way to do this?
trying to make it so objects and spawns basically swap sides/locations for every new mission/run or something like that
have the script decide which side to use, collect the spawned units in an array. Delete given units when you want to switch
can you give more information on that? Atm trying to do this via in game Presence of Condition and a Invis object, unless i have to do via script?
You don't HAVE to, but you can do it via script.
Not sure how that would work in a trigger, especially since you would need to keep checking for the units
If not, just send it to scheduler.
Every time a unit is created, feed it to a variable that the script can use or make a loop to catch the created ones
Also, I'm not sure how a invisible object would help you. Unless you were using it as a getter/setter for the current side spawning
why not use random? avoid the use of an object and spawn probability.
That's what I mean
@tall dock try using MPKilled without any remote exec malarkey
Or use mission’s EntityKilled
You might be doing something wrong with Killed but it could take time to figure out what for no added benefit while there are better tools for the same job avaiable
I got this from the wiki, but it says generic error on the first line
addMissionEventHandler ["EntityKilled",
{
params ["_killed", "_killer", "_instigator"];
if (isNull _instigator) then {_instigator = UAVControl vehicle _killer select 0}; // UAV/UGV player operated road kill
if (isNull _instigator) then {_instigator = _killer}; // player driven vehicle road kill
_line = format ["%1 killed By %2", name, _killed, name _instigator];
[_instigator, _line] execVM "RewardMoney.sqf";
}];
show error from rpt
{
params ["_killed", "_>
1:18:54 Error position: <["EntityKilled",
{
params ["_killed", "_>
1:18:54 Error Generic error in expression```
not sure why it would error there 🤷
ur format is wrong tho
format ["%1 killed By %2", name, _killed, name _instigator];
name, _killed
didnt think it would recognize an error like that until the event fired 🤔
Why not? name, is a compile error
Why it pointed to params is weird though, unless that message was from another run
it pointed to the start of the addmissioneventhandler array
Error position: <["EntityKilled",
Ah yeah didn’t notice it
I shortened it because it doesn't seem to be getting the names. It keeps saying noVehicle for the instigator
addMissionEventHandler ["EntityKilled",
{
params ["_unit", "_killer","_instigator"];
hint format ["%1 was killed by %2", name _unit, name _instigator];
[_instigator] execVM "RewardMoney.sqf";
}];
Worth noting that instigator param is objNull during road kill.
does that apply to you?
Nope, just shooting guys
Error: no vehicle to be exact
and doing this returns Guy killed Guy (same names)
addMissionEventHandler ["EntityKilled",
{
params ["_unit", "_killer","_instigator"];
_unit globalChat (format ["%1 was killed by %2", name _unit, name _killer]);
[_killer] execVM "RewardMoney.sqf";
}];
do they actually have the same names?
Negative
are they the same object?
I would add eventKilled or whatever it is to each AI, but they're dynamically spawned via Ravage, so I'm not sure how I'd go about that
are they the same object how? I can kill 5 guys and each one will say "Martinez killed Martinez" or "Astorios killled Astorios" or whatever
have you considered adding logs to see where things go wrong?
I was hoping the event worked as it's explained on the wiki lol
soooo... thats a no?
of course not
zeus is myself
"unit O Alpha 1-3:1 : killer - O Alpha 1-3:1 : instigator - <NULL-object>"
2:20:21 WARNING: Function 'name' - O Alpha 1-3:1 has empty name
2:20:21 WARNING: Function 'name' - O Alpha 1-3:1 has empty name
2:20:21 "unit O Alpha 1-3:1 : killer - zeus : instigator - zeus"
2:20:21 WARNING: Function 'name' - O Alpha 1-3:1 has empty name
unit O Alpha 1-3:1 : killer - O Alpha 1-3:1
same dude?
suicide aye?
Shouldn't be, unless he killed himself somehow
_killer is getting the actual killer at least, I don't NEED the names, the whole point was to give money for kills and that seems to be working now
@robust hollow dunno if that might help - but I had my issues with this killing stuff back some months
https://github.com/CoopR-Mod/CoopR-Mod/blob/master/addons/core/functions/fn_onKilled.sqf
mybe you can extract something working for you out of here
could not exaclty look into your exact issue tho - just suggesting stuff
Wait, the money thing is only working on dogs for some reason
If you setdamage kill the unit it would obviously have instigator null
actually it works on all animals
Unless you set shotparents
I'm not setting anything, I'm shooting em
Other scripts might do that, using mods?
stop shooting dogs pls
ACE, Ravage, RHS
Well ace is known for fucking with engine killings so no surprise here
Ahhh yeah, I should've known
I gotta turn in for the night anyway, hopefully I can figure it out after some sleep
Hey, if anyone's around and has some time, I've got a little issue - I'm attempting to have a MP mission start with a bit of ambient chatter from some friendly AI. If I'm understanding it correctly it needs to be ran per-machine for it to show up so I have this placed in the missions init.sqf:
["localchat.sqf","BIS_fnc_execVM",true,true ] call BIS_fnc_MP;
The external sqf it's calling is basic: a few sleep commands between sideChat commands set to the soldiers via variable. Once I run the mission to test it though, the radio messages never show up. Any ideas why?
tested in MP?
Running off MP directly in the eden editor doesn't have it show up either. Im' assuming uploading it to my group's dedicated would provide a similar result.
I'm not certain if it applies here, but the ai soldiers might need Vanilla A3 radios equipped to speak on sidechat is something I stumbled across, I think?
You want them to have radio chat or face to face chat?
say3d works fine in my experience
DONT use BIS_fnc_MP , once and for all
Noted. I'll try to find a way around it, I'm sure there's a much simpler option I'm just missing.
HowTo:
1/ execVM the script on the server only
2/ in the script, use remoteExec
^
Alrighty, thanks!
I have random 3
How to convert? [1, 2 , 3] in [red. blue, green]
and select my random?
Damn I shouldn't write stuff here when I'm tired. When asking about the "Killed" eventhandler, I actually meant the "handleScore" EH 🙄
This is the one that's not working when a HC is connected. For other stuff I'm actually using the entityKilled EH and that one is working fine
@last rain
selectRandom ["red", "blue", "green"];
// or
["red", "blue", "green"] select (floor random 3);```
So, any idea why a "HandleScore" EH would not trigger correctly on a server with a conntect HC?
@winter rose ["red", "blue", "green"] select (2); - it is "blue"?
@winter rose
["red", "blue", "green"] select (test);``` it is true?
I wrote it: floor random 3 will return 0, 1 or 2
random 3is from 0 included to 3 excluded
@last rain
@last rain ```sqf
private _index = selectRandom [0,1,2];
["red","blue","green"] select _index;
Got an array of objects only. Do I use isNull or objNull if the element doesn't exist?
You can't do _x == objNull anyway so you have to use isNull(_x).
objNull is not equal to anything, including itself objNull == objNull is false.
There is more too it so it is worth a read on the wiki for the two items but I suspect isNull is what you are looking for to test the individual elements.
Alright will take a proper look, cheers
isNull _x
i have a very basic question, in a for "_i" from 0 to 1, does it exectue once or twice?
How to forcibly move the player's map to the desired position in the beginning?
@spark turret twice
Technically execute once, loop twice. But I know what you meant.
mapAnimAdd mapAnimCommit @last rain
Are there any (scripted) events that would trigger on a player living a mission in all scenarios? That means in editor preview restarting, SP, MP, etc. Whether it's end, or just leaving halfway.
Is there a script that toggles AI's NVGs down so I can take a screenshot of them?
is there one where it toggles them on? like down? I tried the action one and they just stay up
@tough abyss it is not work 😦
Then you have to give more details what you are trying to do
@vestal crow maybe disable fsm on the ai and then force nvg. Should prevent them from auto detecting day/night and put htem back on, I think.
_commander addAction [localize "str.coopr.aar.action.commander", { call coopr_fnc_deliverAfterActionReport }, [], 1.5, true, true, "", _aarActionCondition, 3];
The given function is automagically called with _target and _caller params in this case. Will the same work when using
{ remoteExec ["coopr_fnc_deliverAfterActionReport"]}
Or do I have to make it explicit in this case like
{ [_target, _caller] remoteExec ["coopr_fnc_deliverAfterActionReport"]}
_ammo = magazines _this;
type array, expected object
am i stupid or something i cant figure out what im doing wrong pls help
_this is an array
_this select 0?
nope still the same error
Aye - _this is the parameter array
_ammo = magazines _this select 0;
do hint str _this what does it show
If the first parameter is an Array as well then... you need to make another _this select 0 select 0
_ammo = magazines (_this select 0);
Ah yea that might work
_ammo = magazines (_this select 0); doesnt work
hint str _this
gives out
[[bis_o1,bis_o1]]
why 2 objects
_ammo = magazines (_this select 0 select 0); then
Pretty sure you dont need arrays that deep
_handle = [_this] execVM "Mortar.sqf" is in an vehicle respawn module
better switch to params (https://community.bistudio.com/wiki/params)
will make stuff less confusing
so _this is already [obj,obj], you can just do this:
_handle = _this execVM "Mortar.sqf"
and inside script
params ["_obj1", "_obj2"];
_ammo = magazines _obj1;
dunno what params respawn module passes, [old unit, new unit]?
then _obj1 will be old unit
This seems to be working with ACE, just need to differentiate between animals and humans
addMissionEventHandler ["EntityKilled",
{
params ["_unit","_killer","_instigator"];
_killer = if (_unit == _killer) then {
_unit getVariable ["ace_medical_lastDamageSource", _killer];
} else { _killer };
diag_log format ["unit %1 : killer - %2 : instigator - %3", _unit, _killer,_instigator];
_unit globalChat format ["%1 was killed by %2", name _unit, name _killer];
[_killer] execVM "RewardMoney.sqf";
}];
Anyone looking for work?
What kind of work?
What does ACE do with the killed event handle? it seems it does not fires if the vehicle was not killed by script
this is on a dedicated server
Yes
I’m looking for someone experienced
I have one guy that is experienced but he needs help
Pm me
If interested
Oh my apologies @tough abyss
can i somehow check if an element of an array exist without getting an error if it dont exist ?
{
marker = createMarker[str _i, getpos (_PlayerList select _i)];
}
else
{
deleteMarker str _i;
};```
because i getting errors here
(error zero divisor)
also can i check if somethink is not true. somethink like
if(marker select _i != nil) then
?
because i got errors when i tried this and i havent found anythink in the web
thx
or even better check that element exists
if (_index < count _array) then {_array select _index} element exists
ok thanx
now have the next error at marker = createMarker[str _i, getpos (_PlayerList select _i)];
it says 0 elements provided, 3 expected
_PlayerList select _i doesnt exist
im confused
i do _PlayerPos = GetPos (_PlayerList select _i); hint str _PlayerPos; and i get a position at the hint and a error (the position is changen when im walking so i think its my position)
Any ideas on how I can stop a unit dismounting a vehicle? I ordered via allowGetIn and orderGetIn, and they do get in to their assigned vehicles, then after a few seconds one of them dismounts.
btw it says undefined variable in _playerPos
My current code is like this (paraphrased):
private _newGroup = createGroup (side unit);
_newGroup setSpeedMode "LIMITED";
_newGroup setBehaviour "CARELESS";
_newGroup setCombatMode "GREEN";
[unit] joinSilent _newGroup;
unit disableAI "AUTOCOMBAT";
unit setSkill ["courage", 1];
unit setSkill ["commanding", 1];
unit assignAsDriver _vehicle;
[unit] allowGetIn true;
[unit] orderGetIn true;```
#define radio_global 0
#define radio_side 1
#define radio_command 2
#define radio_group 3
#define radio_vehicle 4
#define radio_direct 5
#define radio_system 6
disableChannels[] = {
{radio_global, false, true},
{radio_side, false, true}
};
Is there anything obviously wrong with that? For whatever reason it doesn't do anything
@loud python (really) random thought but have you tried without underscores?
technically underscores should be ok, but I guess there's no harm in trying 😉
I think too, I am just not that aware of configs and macros
maybe it's the fact it is between brackets that it doesn't like… I can't help you more 😐
{
_PlayerCount = count allPlayers;
_marker = [];
while {true} do
{
_i = 0;
sleep 2;
_PlayerList = allPlayers;
sleep 2;
while {_i <= _PlayerCount} do
{
if (_i < count _marker) then
{
deleteMarker str _i;
}
else
{
_PlayerPos = getPos (_PlayerList select _i);
hint str _PlayerPos;
_marker = createMarker[str _i, _PlayerPos];
};
_i = _i + 1;
};
};
};```
it says `error undefined variable in expression: playerpos`
but the hint is giving somethink out
```_PlayerPos = getPos (_PlayerList select _i);
hint str _PlayerPos;
_marker = createMarker[str _i, _PlayerPos];```
please help
are you selecting an index outside of the array length?
issue:
_marker = []
_marker = createMarker
if (_i < count _marker) then
that would make it nil
assuming this is just a playermarkers script you could use a draw event and not need to handle moving/deleting markers
There's also the fact that he's pulling the number of players, waiting a bit, and then using allPlayers which is gonna break if someone connects or disconnects
jup
i want to set markers on the player position a bit delayed
delayed from what?
Generic error in this...not sure where
addMissionEventHandler ["EntityKilled",
{
params ["_unit","_killer","_instigator"];
//diag_log format ["unit %1 : killer - %2 : instigator - %3", _unit, _killer,_instigator];
_killer = if (_unit == _killer) then {
_unit getVariable ["ace_medical_lastDamageSource", _killer];
} else { _killer };
if (_killer isPlayer) then {
switch (_unit isKindOf) do {
case "CAManBase": {_amount = 5; _killer globalChat format [" killed %1!", name _unit];};
case "LandVehicle": {_amount = 25; _killer globalChat " destroyed a vehicle!";};
default {_amount = 1; _killer globalChat format ["%1 hunting bonus!", name _killer];};
};
[_killer,_amount] execVM "RewardMoney.sqf";
};
}];
Not following, is the switch nested in there incorrectly?
Ohh I see what you mean about the switch
isplayer is unary, argument goes on the right. iskindof is binary, has an argument on each side
_PlayerPosList = getPos allPlayers;
i want to get the position of every player in a array but this doesnt work, how can i do this ?
allPlayers apply {getpos _x}
ninja'd
Obviously this isn't right, still a generic error
if (isPlayer _killer) then {
_kind = _unit isKindOf;
switch (_kind) do {
case "CAManBase": {_amount = 5; _killer globalChat format [" killed %1!", name _unit];};
case "LandVehicle": {_amount = 25; _killer globalChat " destroyed a vehicle!";};
default {_amount = 1; _killer globalChat format ["%1 hunting bonus!", name _killer];};
};
[_killer,_amount] execVM "RewardMoney.sqf";
_unit isKindOf
iskindof has a left and right argument
iskindof is binary, has an argument on each side
How do I get the kind?
typeOf, iirc
@quartz oracle to further expand on the draw event i mentioned before, you could do something simple like this so it still shows a delayed position and you dont need to delete old markers.
tag_updateTick = -1;
tag_currentPositions = [];
tag_nextPositions = [];
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",{
params ["_ctrlMap"];
if (diag_tickTime >= tag_updateTick) then {
tag_updateTick = diag_tickTime + 4;
tag_currentPositions = +tag_nextPositions;
tag_nextPositions = allPlayers apply {getPos _x};
};
{
_ctrlMap drawIcon [
"", // icon path
[1,1,1,1],_x,
24,24,0,"",1,0,"TahomaB","right"
];
false
} count tag_currentPositions;
}];
is a bit cleaner, but whatever works for you 👍
the wiki yes
a link maybe i cant find it ?
https://pastebin.com/0HFSzGk8
\a3\ui_f\data\map\vehicleicons
im not sure how many of those work as those names, wiki just says thats how it works. If you dont like any of those icons you can use any image, just use the full path to it
eg:
\a3\ui_f\data\map\markers\handdrawn\dot_ca.paa
Hey I was wondering if anyone knows how to make a zeus module make an object execute a script?
@quartz oracle allplayers is dynamic array it changes and do the count changes
It can change even between frames but you have seconds of sleep for no apparent reason
i alreadz changed that
What's wrong with this one?
if (isPlayer _killer) then {
if (_unit isKindOf "CAManBase") then {_amount = 5; _killer globalChat format [" killed %1!", name _unit];};
if (_unit isKindOf "LandVehicle") then {_amount = 25; _killer globalChat " destroyed a vehicle!";};
if (!(_unit isKindOf "LandVehicle") && !(_unit isKindOf "CAManBase")) then {_amount = 1; _killer globalChat format ["%1 hunting bonus!", name _killer];};
[_killer,_amount] execVM "RewardMoney.sqf";
};
is there an error?
@robust hollow how long is the delay between each call (and how long does it need do set the first marker) also can i change the delay and if yes, how ?
the event itself is called on every draw. basically every frame.
tag_updateTick = diag_tickTime + 4; is the line that sets the delay, like that it has a 4 second delay
so itl draw the position icon on every draw, but the positions only update every 4 seconds, using the position from 4 seconds ago)
thats how i understood what u were going for anyway
_amount is not being passed apparently
_amount is not defined outside the if scopes?
i wanted to do somethink that show the position of all player every few minutes with a bit delay so i wont get too boring with not many player
Yeah, it's not, I'll fix that
i cant see the marker / draw / whatever
give me a min to write up another snippet
btw i just pastet it in and commented my old code with /* oldcode */ hope thats right
tag_updateTick = -1;
tag_drawTick = -1;
tag_positions = [];
findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",{
params ["_ctrlMap"];
if (tag_updateTick != -1 && {diag_tickTime >= tag_updateTick}) then {
tag_updateTick = -1; // disable updating until after next draw
tag_positions = allPlayers apply {getPos _x};
};
if (diag_tickTime >= tag_drawTick) then {
// icons are drawn for 10 seconds before fading out
private _elapsed = diag_tickTime - tag_drawTick;
// start fading out at 8 seconds, finish at 10
private _iconSize = linearConversion[8,10,_elapsed,24,0,true];
{
_ctrlMap drawIcon [
"\a3\ui_f\data\map\markers\handdrawn\dot_ca.paa", // icon path
[1,0,0,1],_x,_iconSize,_iconSize,0,"",1,0,"TahomaB","right"
];
false
} count tag_positions;
// set next update tick after icons have faded out
if (_elapsed > 10) then {
tag_drawTick = diag_tickTime + 120; // 2 mins
tag_updateTick = tag_drawTick - 5; // 5 seconds before next draw
};
};
}];
@quartz oracle something like this should work. gets positions 5 seconds before drawing, draws for 10 seconds and then has a 2 minute delay until next draw.
thx ill try it
I see remoteExec wants a number, would clientOwnerID work?
params ["_unit","_amount"];
if (isPlayer _unit) then {
"format ['%1 added to account!',_amount]" remoteExec [systemChat, _unit];
customCover_credits = customCover_credits + _amount;
};
owner is the number is wants, yes.
that system chat should be in a string
remoteExec ["systemChat", _unit];
Oh ok
also that will literally print
format ['%1 added to account!',_amount] to the targets chat
do I need to format it separately?
_string = format ['%1 added to account!',_amount];
"_string" remoteExec ["systemChat", _id];
format['%1 added to account!',_amount] remoteExec ["systemChat", _id];
@robust hollow does the drawicon already exist because i cant see it
also i hope it is right that i put it in init.sqf
it does exist, just keep in mind it only draws once every 2 mins so perhaps lower that number while ur testing
how can i change the time of how long it drawing it _
if (_elapsed > 10) then { change the 10 to whatever you want
then also change the first two numbers here to mark the fade out time. like this is starts fading out at 8 seconds and ends at 10
private _iconSize = linearConversion[8,10,_elapsed,24,0,true];
_DelayTime = 5;
_IconStayTime = 10
_IconFadeTime = 2```
```if (_elapsed > _IconStayTime) then {
tag_drawTick = diag_tickTime + _UpdateTime; // 2 mins
tag_updateTick = tag_drawTick - _DelayTime; // 5 seconds before next draw
}; ```
``` private _iconSize = linearConversion[_IconStayTime - _IconFadeTime, _IconStayTime,_elapsed,24,0,true];```
id like to have every changable variable at the top to easely change them without much searching
hope ive done it right
@robust hollow ill go off for today if you have anthink for me send me a friend inv
they cant be local variables because the event runs in a new scope every time it fires
@robust hollow ok ive send you a friend inv pls let talk tomorrow because im really tired right now bye
Does isMultiplayer return true on apex campaign solo mode? I have a sneaking suspicion it does...
Oh, never mind. Checked wiki and I believe I'll have to use isMultiplayerSolo...
Is it possible to block access to buttons on the main menu? Im working on changing up the main menu like Arma-Life did.
May I ask how to add virtual Earplugs to a server without making people use a client mod?
"virtual Earplugs" as in a keypress toggle?
fadeSound w/ keybind and use the key press to increase fadeSound step if you want to adjust the intensity in which the sound is faded.
displayAddEventHandler has a event handler called "keyDown" you can use for this
#include "\a3\3den\ui\dikcodes.inc"
findDisplay 46 displayAddEventHandler ["KeyDown",{
params ["","_key","_shift"];
if (_shift && {_key == DIK_H}) then {
private _soundVolume = soundVolume - 0.25;
if (_soundVolume == 0) then {_soundVolume = 1};
1 fadeSound _soundVolume;
titleText [format["Sound adjusted: %1%2",_soundVolume*100,"%"],"PLAIN DOWN"];
true
};
}];
Connors got it
Is there a way to remove the addAction for "holster weapon" from a Ravage scenario? RemoveAllActions removed the looting action apparently
find the action id
So rip into Ravage? Is there any way to get the id in game or through debug?
that should do it, thanks
:+1:
Is it possible to change thermal vision contrast via scripting? For some reason my last MP session had thermals be almost useless because the contrast between hot and cold was so jacked up that you could only see hotspots and nothing else at all. It was like that for multiple different vehicles and scopes.
I checked in the editor afterwards and it worked fine there
Is online protection available for my own mod?
For Example;
I write a code to the config file of the my mod.
Can this code take a list from a url? http://www.domain.com/playeruids.txt
And players not in the playeruids.txt list cannot use mode.
Possible ?
yes. personally I'd find using an extension to load the list the nicest way to do it, but you probably couldnt get it whitelisted by battleye.
an alternative is to use
https://community.bistudio.com/wiki/htmlLoad
and get the text list off the ctrl (im pretty sure u can?)
@thorn wraith you are interpreting it wrong, it is the first _lpointer that is undefined and so the diag_log is ignored, it is the one assigned after selectRandom that is printed
nope, there's the full array of inputs above the logs, and the full array of outputs below
it's defined above as
_main = ["","","","","","","","","","","",""];
_main params ["_pointer", "_silencer", "_scope","_bipod","_hgpointer", "_hgsilencer", "_hgscope","_hgbipod""_lpointer", "_lsilencer", "_lscope","_lbipod"];
They all pull from the same array.
Make a pastie and give me the link
I rewrote it as set[], it 's possible it didn't like the params command somehow
👍
Also unless you specifically insert string "nil" this is not how you test for nil. https://community.bistudio.com/wiki/isNil
I actually did. Or, rather, I needed a "nil" value, while still writing down the var in the cfg. I'll replace it with "empty" or "none" or something probably.
it would make a lot more sense if that was a switch instead of all those if statements.
(_module # _i) params ["_itemName","_itemArray"];
if ((_itemArray # 0) != "nil") then {
switch _itemName do {
case "pointer":{_pointer = selectRandom _itemArray;};
case "silencer":{_silencer = selectRandom _itemArray;};
case "scope":{_scope = selectRandom _itemArray;};
// all the other names
};
};
it originally was, I switched it to see if it changes anything. It's now case "pointer":{ _main set [0, selectRandom (_itemArray)];};
since they're fixed pos anyway
could probably simplify it further to an apply
[["pointer",[""]],["silencer",[""]],...] apply {
if ((_x#1#0) == "nil") then {""} else {selectRandom(_x#1)}
};
@robust hollow
PE_DelayTime = 5;
PE_IconStayTime = 10;
PE_IconFadeTime = 2;
i made them global variables is it better now ?
@robust hollow also i still cant see the mark on the map https://imgur.com/a/h0xXLxx
Do you guys know what ACE does to the killed event handle? it does not fire when a vehicle is destroyed normaly by a explosive but fires when is killed by script like cursorobject setdamage 1.
@robust hollow and get the text list off the ctrl (im pretty sure u can?) afaik you can't
aww 😦
@quartz oracle your doing something wrong, i tested it before pasting the snippet here.
perhaps try adding a waituntil the map ctrl exists before adding the event
Probably a good thing. htmlLoad for URLs is a hack
how can i do it ? @robust hollow ?
Is the killed event handle effected by ownership like vehicles?
ace cookoff does things
How?
https://github.com/acemod/ACE3 see for yourself
🙄
Well, seems like I figured, does not seems to be ACE problem, the Killed event handle is effected by locality, if a player get in and out of a vehicle the ownership changes and the killed event handle does not fire on the server once the vehicle was destroyed, it was fixed by changing to mpkilled
Maybe that deserve a note? though it is needed a vanila test to ensure that.
parseSimpleArray is faster
and call compile causes a memory leak. So don't ever use that
@still forum Thanks
And safer
@still forum @tough abyss But in mod Exile file loading ```
private ["_code", "_function", "_file"];
{
_code = "";
_function = _x select 0;
_file = _x select 1;
_code = compileFinal (preprocessFileLineNumbers _file);
missionNamespace setVariable [_function, _code];
} forEach
[
["TestClient_session_requestReceived", "code\TestClient_session_requestReceived.sqf"]
];```
use compileFinal
yes
Is there a memory leak?
exile does stupid crap. We already know that
that string create there will stay in memory forever
That compiled function is supposed to stay forever though. so not really
@still forum I can use compileFinal without the threat of memory?
no
Wait Exile writes result into a file?
no
If that file doesn’t change there is no leak and it might be fast now but when cache is removed it will be a drag
Hey sorry to ask again, I didn't get any response:
How can I ensure units stay in the vehicles I ordered them into with the following code?
Or alternatively what reasons are there that they would suddenly dismount again after a few seconds?
private _newGroup = createGroup (side unit);
_newGroup setSpeedMode "LIMITED";
_newGroup setBehaviour "CARELESS";
_newGroup setCombatMode "GREEN";
[unit] joinSilent _newGroup;
unit disableAI "AUTOCOMBAT";
unit setSkill ["courage", 1];
unit setSkill ["commanding", 1];
unit assignAsDriver _vehicle;
[unit] allowGetIn true;
[unit] orderGetIn true;```
Try giving them more courage
More than 1?
Try setFleeing or whatever it is called
Okay I will try thanks, although they don't actually flee, they just dismount and stand next to the vehicle.
And in fact they get back in once they are ordered to move.
I have setAllowDismount [false, false] on all vehicles as well :/
There might be other commands and biki is down for me you must be very lucky
I am
Does anyone know where I can find the trench building sqf for ACE3. I'm looking to make an extension to add a new trench object.
Thank you!
What's the best way to handle ace extensions?
Because just editing the file won't do, unless I want to make a fork of the whole of ace. I'd just like to add new buildable trenches.
just add new ace interactions in the config that I linked
Just CAManBase self interactions
Okay. Would you be able to break this down for me, so that I could reference a vanilla asset. Say the Apex Trenches. model = QPATHTOEF(apl,ace_envelope_big4.p3d);
https://github.com/acemod/ACE3/blob/master/addons/trenches/CfgVehicles.hpp#L27-L35 add another one of these.
Replace ACE_envelope_small with the CfgVehicles entry that you want
What about the p3d wouldn't the object just be the same? Or would the actual reference of the classname change the model used?
Inside the interaction you tell it which classname to spawn
and it will then spawn that classname
The interaction being a different file correct?
So I've had a look at the differences for https://github.com/acemod/ACEX/blob/master/addons/sitting/CfgVehicles.hpp which I would need to make my own mod.
Are there any prerequisite files that I would need in my config?
What does ACEX sitting have to do with ACE trenches?
No you don't need anything special. Just CfgPatches with requiredAddons properly set up, like any other mod
Okay thanks.
Where are GVAR's defined?
CSTRING(DigEnvelopeSmall) is this meant to have all uppercase? unlike GVAR(digEnvelopeSmall)
ah okay great
class GVAR(digTrenchForest) {
displayName = "Dig Forest Trench";
condition = QUOTE(_player call FUNC(canDigTrench));
//wait a frame to handle "Do When releasing action menu key" option
statement = QUOTE([ARR_2({_this call FUNC(placeTrench)},[ARR_2(_this select 0,'Land_Trench_01_forest_F')])] call CBA_fnc_execNextFrame);
exceptions[] = {};
showDisabled = 0;
//icon = QPATHTOF(UI\icon_sandbag_ca.paa);
};```
class Land_Trench_01_forest_F: BagFence_base_F {
author = "Capwell";
displayName = "Forest Trench";
descriptionShort = "Forest Trench from APEX";
model = QPATHTOEF(apl,ace_TrenchForest4.p3d);
scope = 2;
GVAR(diggingDuration) = 30;
GVAR(removalDuration) = 22;
//GVAR(noGeoClass) = "Land_Trench_01_forest_F_NoGeo";
GVAR(placementData)[] = {2,3,0.35};
GVAR(grassCuttingPoints)[] = {{0,-0.5,0}};
ACE_TRENCHES_ACTIONS;
class EventHandlers {
class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};
};
};```
"CSTRING(DigTrenchForest)" That won't work, macro's don't get resolved in double quoted strings
You have to manually replace all the macros
GVAR(noGeoClass) = "Land_Trench_01_forest_F_NoGeo"; did you create that model?`probably not, leave it out
You have to manually replace all the macros
All of them
the QUOTE's and GVAR's and FUNC's
oh the GVAR's
Okay.
Do you mean this file? https://github.com/acemod/ACE3/blob/master/addons/main/script_macros.hpp
not really? why?
Well cannot find any defines on any of these words..
Okay. so i've read about CSTRING's and there need for placement in a stringtable.xml but I cannot find where they are defined in said file, in ace.
You don't need to use stringtable for that if you don't need translations
normal text is also good enough
but that's where the actual string is defined, whether for translation or not.
Also there is a search function on github.
CSTRING(DigEnvelopeSmall) -> $STR_ACE_trenches_DigEnvelopeSmall
https://github.com/acemod/ACE3/search?q=%24STR_ACE_trenches_DigEnvelopeSmall plug it into search and first result is literally it.
class ace_trenches_digTrenchForest {
displayName = "Dig Forest Trench";
condition = "_player call ace_trenches_canDigTrench";
//wait a frame to handle "Do When releasing action menu key" option
statement = "[{_this call ace_trenches_placeTrench},[_this select 0,'Land_Trench_01_forest_F']] call CBA_fnc_execNextFrame";
exceptions[] = {};
showDisabled = 0;
//icon = QPATHTOF(UI\icon_sandbag_ca.paa);
};```
class Land_Trench_01_forest_F: BagFence_base_F {
author = "Capwell";
displayName = "Trench - Forest";
descriptionShort = "Trench - Forest";
//model = QPATHTOEF(apl,ace_TrenchForest4.p3d);
scope = 2;
ace_trenches_removalDuration = 22;
//ace_trenches_noGeoClass = "Land_Trench_01_forest_F_NoGeo";
ace_trenches_placementData[] = {2,3,0.35};
ace_trenches_grassCuttingPoints[] = {{0,-0.5,0}};
ACE_TRENCHES_ACTIONS;
class EventHandlers {
class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};
};
};```
Yeah. I missed the GVAR
Anyone know what the player base address is?
There’s the player base address like the area around the player
Then the head address that stuff
I have no idea what you are talking about
No one has
So around the player or AI there is a address that’s the location of the player you use it for aim bot
I am just trying to finished my menu so I can add cool shit to Zeus
you use it for aim bot 🤔
Naaa I need it for other stuff to
I am making a menu that will help me zeus so I can add custom skins to the vehicles
I dont care
I didnt
Ok bye
I hope forever
That’s nice
I'm not nice to hackers and cheaters
Um I am using for the right reasons though
hey can someone help me out? When I load my mission into the eden editor it gives me an error with a path to my description.ext and then line 1: '.': '{' encountered instead of '='
Here's whats on the description
{
sounds[] = {};
class kam1
{
name = "kam1";
sound[] = {"\dubbing\kam1.ogg", db - 100, 1.0 };
title = "Kamino to Broadway, shots fired!";
};
class kam2
{
name = "kam2";
sound[] = {"\dubbing\kam2.ogg", db - 100, 1.0 };
title = "Requesting support, Broadway do you copy? Over.";
};
class br1
{
name = "br1";
sound[] = {"\dubbing\br1};.ogg", db - 100, 1.0 };
title = "Kamino, Broadway, we read you, wait one.";
};
};```
sound[] = {"\dubbing\br1};.ogg"
fixed it and it still shows up
looks like something is binarized that shouldn't be
fixed it and it still shows up save/reload mission from editor
are mouseEnter/mouseExit only one time with scripted controls, or broken in general, or only broken for some control types?
Adanteh had the same problem 1.5 years back
supposedly 1-2 guys got it to work in here
forum/google search doesnt turn more on this
restarted the whole game and it still showed up
how to check, when unit wait for revive?
'INCAPACITATED' == lifeState _unit
is it correct?
is there an equivalent to "(driver _vehicle) isEqualTo player" to find whether someone is the copilot in an aircraft?
Hmm, I was having dns issues with getting onto bohemia so I couldn't see that search result but now it works.
Thanks @robust hollow
Yeah, forums and wiki being down slowed my work this morning tremendously!
Could someone show me how or link me where to figure out how to add stuff to the custom command menu (0,9 in game)?
Would this work to remove this action?
{
if (player actionParams _x (select 0) == "Holster Weapon") then {
removeAction _x};
} forEach actionIDs player;
no
(select 0) wrapping this in parentheses means select has no array to select from
removeAction _x thats not how removeAction works
{
if (player actionParams (_x select 0) == "Holster Weapon") then {
player removeAction _x};
} forEach actionIDs player;
if (player actionParams _x select 0 == "Holster Weapon") then {
Seems to have worked
action params can return nil
{
private _params = player actionParams _x;
if (!isNil "_params" && {(_params#0) == "Holster Weapon"}) then {
player removeAction _x;
};
} forEach actionIDs player;
something more like this would be ideal i think
It's for this one very specific action
And it doesn't look like it bugs out if the action isn't in there already
sure, but its not uncommon for actionParams to return nil, so if you're sorting through to find your action and you encounter a nil action first, itl error without proper checks for it.
Ahh gotcha
so i have a variable defined as such
_mySound = createSoundSource ["rocket_idle", position _unit, [], 0];
``` which basicly all it does is create a sound. This part works. What im having issues with is checking if `_mySound` is undefined or not. Ive used `isNull` and `isNil` but neither work and instead I get an error saying `_mySound` is undefined, this is wat I am doing
```sqf
if(isNull _mySound) exitWith {};
and I tried
if(isNil _mySound) exitWith {};
isNull is the way to go. if the source isnt created for some reason the command returns objNull.
you will need to paste a full snippet of that code (including everything between the creation and isnull check) because that on its own should work fine.
okay ill try that real quick checking agaisnt objNull
what? why?
my point was isNull should cover createSoundSource being unsuccessful. to check if an object is objNull you use isNull like you have already.
oh okay I thought u ment the command returns objNull
_idleEffect = createSoundSource ["rocket_idle", position _unit, [], 0];
_idleEffect attachto [_unit,[0,0,0]];
[_unit] spawn namenai_fnc_jump;
waitUntil
{
sleep .005;((isTouchingGround _unit))
};
if(isNull _mySound) exitWith {};
detach _idleEffect;
deleteVehicle _idleEffect;
playSound3D [_soundLand, _unit, false, getPosASL _unit, 6, 1, 0];
``` thats what I got inbetween creating the sound and detecting if it exists, afik I dont see anything that would effect it
it does, so it shouldnt be nil unless you set it to nil afterwards. the point being isNil will always be false
_idleEffect = createSoundSource ["rocket_idle", position _unit, [], 0];
(isNull _mySound)
_idleEffect -> _mySound
isTouchingGround dont use, better check the height from position
What are the odds that BI will fix a bug in an eventhandler if I report it with a reproducable testmission? Less than 12 months? 😏
@tough abyss the reason why I use istouchingground is cause Im making a jump script, like predator/crisis style, and I want to be able to land on buildings or even floating stuff. Is there something better?
and so if I place a VR block say 100 meters up, itTouchingGround still detects when I land on the VR block
Does anyone know of a way to get the Field of View of the current camera, in degrees or radians?
I see that you can set it with camSetFov but I don't see a camGetFov or equivalent
Quick sanity question: You can not publicVariable _localVariables right? I mean what scope would it even be put into.... ?
@errant jasper cannot indeed
Have not scripted SQF in a while and wanted to ensure my memory was alright, since I came across this on the forum https://forums.bohemia.net/forums/topic/222041-utility-release-dynamic-structure-indexer/ which links to this https://github.com/Anaximandross/DynamicStructureIndexer/blob/master/BuildAutoGenV2.sqf#L293
Sure.. Was just wondering about what I saw above.
could just do this
missionNamespace setVariable [_varName, _func, true];
How would you be able to return backpack weapons as displayname formats?
You mean weapons in the backpack ?
Yes
Hello!
Anyone knows how to set the second fade color in a selected item of a listbox?
"lbSetSelectColor" sets the first color
@radiant egret you got any idea?
_backpackContent = backpackItems player;
_allWeapons = weapons player;
_backpackWeapons = [];
{
if(_x in _allWeapons)then {
_backpackWeapons pushBack _x;
};
}forEach _backpackContent;
systemChat str _backpackWeapons;
How do you run anything as displayname format?
sry i forgot
Yes
_Primary = "No Primary Weapon";
_Secondary = "No Secondary Weapon";
if (!(primaryWeapon cursorTarget == "")) then {
_Primary = ((configFile >> "CfgWeapons" >> primaryWeapon cursorTarget >> "displayName") call BIS_fnc_GetCfgData);
};
if (!(handgunWeapon cursorTarget == "")) then {
_Secondary = ((configFile >> "CfgWeapons" >> handgunWeapon cursorTarget >> "displayName") call BIS_fnc_GetCfgData);
};
_Action = format [
"
Suspect Name: %1<br/>
Primary Weapon: %2<br/>
Secondary Weapon: %3
",
name cursorTarget,
_Primary,
_Secondary,
"Header",true,true
] spawn BIS_fnc_guiMessage;
he just wantsgetText (configFileetc etc
This how i got it atm
I just need to get one for backpack displaying their weapons if they have any
((configFile >> "CfgWeapons" >> handgunWeapon cursorTarget >> "displayName") call BIS_fnc_GetCfgData)
plus what skullfox said
you should be able to figure it out with that
_backpackContent = backpackItems player;
_allWeapons = weapons player;
_backpackWeapons = [];
{
if(_x in _allWeapons)then {
_backpackWeapons pushBack [_x,getText(configfile >> "CfgWeapons" >> _x >> "displayName")];
};
}forEach _backpackContent;
systemChat str _backpackWeapons;
return an array [classname,"displayname"]
Ye, i see. But is it possible to get it in the format like the script i sent above so it will shows all weapons in backpack as displayname?
Right now it returns as Bakpack Content:["arifle_MX_GL_F"]
Use ```sqf
getText(configfile >> "CfgWeapons" >> weaponClassname >> "displayName");
to return the displayname
_Primary = "No Primary Weapon";
_Secondary = "No Secondary Weapon";
_backpackContent = backpackItems cursorTarget;
_allWeapons = weapons cursorTarget;
_backpackWeapons = [];
if (!(primaryWeapon cursorTarget == "")) then {
_Primary = ((configFile >> "CfgWeapons" >> primaryWeapon cursorTarget >> "displayName") call BIS_fnc_GetCfgData);
};
if (!(handgunWeapon cursorTarget == "")) then {
_Secondary = ((configFile >> "CfgWeapons" >> handgunWeapon cursorTarget >> "displayName") call BIS_fnc_GetCfgData);
};
{
if(_x in _allWeapons)then {
_backpackWeapons pushBack [_x,getText(configfile >> "CfgWeapons" >> _x >> "displayName")];
};
}forEach _backpackContent;
_Action = format [
"
Suspect Name: %1<br/>
Primary Weapon: %2<br/>
Secondary Weapon: %3<br/>
Backpack Content: %4
",
name cursorTarget,
_Primary,
_Secondary,
_backpackContent,
"Header",true,true
] spawn BIS_fnc_guiMessage;
I've done that but it displays as classname on the guiMessage
Show where are you using _backpackweapons in guiMessage?
_Primary,
_Secondary,
_backpackContent,
What’s that
The gui message
And how _backpackweapons is related to that?
Obviously each element is array of 2
Ye is it possible to get it to a string with just Mx 6.5 mm
You don’t know how to select element you want from array?
And why are you pushing array into _backpackweapons instead of just the name? Are you copy pasting chunks of code in hope something might work?
I have an issue with BIS_fnc_guiMessage when i use it with format, i dont get a cancel button and a header. I just get the text and ok. ```
_Action = format [
"
Suspect Name: %1<br/>
Primary Weapon: %2<br/>
Secondary Weapon: %3<br/>
Launcher: %4<br/>
Backpack Content: %5
",
name cursorTarget,
_Primary,
_Secondary,
_Launcher,
_backpackweapons,
"Seize Objects","Seize Objects","Cancel"
] spawn BIS_fnc_guiMessage;
_Action = [
format[
"
Suspect Name: %1<br/>
Primary Weapon: %2<br/>
Secondary Weapon: %3<br/>
Launcher: %4<br/>
Backpack Content: %5
",
name cursorTarget,
_Primary,
_Secondary,
_Launcher,
_backpackweapons
],
format[
"Header"
],
true,
true
] spawn BIS_fnc_guiMessage;
@crystal schooner
@radiant egret TY!!
Hello there, did someone managed to use this ? https://community.bistudio.com/wiki/BIS_fnc_ORBATSetGroupParams
Using custom ORBAT created in description.ext
How am I supposed to choose which class I'm overwritting since I can't choose it ? There is no argument for it.
@red linden Post your problem, cant guess it from here, im no magician, if config related -> #arma3_config
So I dont have any scripting to show because I have had this issue with 4 seperate versions of the script calling it, honestly I think this might be more of a general issue than script related
Essentially I have this old mission I'm bringing up to date and my sounds are working in editor both in SP and MP, but on our server I either don't hear them from the source model or they can be heard if your like 3 feet from the source and no further
Moving a step away just cuts it out entirely
I've used everything that can call my sounds and they all have this issue
This mission worked a while back, then after my break from Arma something must have changed idk
The sounds are accurately described in the description.ext file, its just when I move the mission onto our server the issue arises
which command you use to play the sound and post the cfgsounds parts
Hey yall. So Im going about making a mission intro that plays some music in the background as the players fly into an insertion (takes about 2 minutes or so). I use fadeMusic to fade their music volume to an acceptable level so the music is hearable but doesn't kill their ears. Looking around I was hoping to find a function to fade the effect volume but I cannot seem to find something of the sort? Is there one and its just oddly named?
That's the one I was using. I was looking for something to fade the effects sound. But I think fadeSouns may actually be it.
fadeSOund
Shit. fadeSound
I was thinking it would be something like 'fadeEffectSound' or something of the sort.
So my search-fu failed me.
Still having a hard time with this script.
What I want to achieve is that EVERY player who is WEST should trigger the onActivation when he enters the area.
If any player leaves the area onDeactivation should be triggered.
This should happen for every player interacting with the trigger.
At the moment the trigger gets only activated but never deactivated. I assume this is happening because when a player leaves the area and there are still other players inside the area it will not trigger deactivation. Can anybody tell me how to achieve an activation/deactivation for every single player?
_desertionTrigger setTriggerActivation ["WEST", "WEST D", true];
_desertionTrigger setTriggerStatements ["this",
_onActivation call coopr_fnc_codeAsString,
_onDeactivation call coopr_fnc_codeAsString];
meh just realized WEST D means if something is detected by west
fucks sakes
@frigid raven try a local trigger with "player" that rings the server on deactivation? Unless there are AI
else, go script
aye
How do I get rid of these extra quotes? This is from my RPT
13:53:56 "[""ItemWatch"",""ItemMap""] - ItemWatch,ItemMap"
and this is the code
params ["_distractionObject", "_objectPos", "_typedropped"];
_distractionList = _distractionObject splitString ",";
diag_log format ["%1 - %2",_distractionList, _distractionObject ];
if !(_typedropped in _distractionList) exitWith {};
I have a "deleteIfEmpty" set to 0 on my magazine, and I have an empty magazine in my backpack. If I run "magazinesAmmoFull", it's not listed unless it's in the current weapon. Is there a workaround, as I would like to get the ammo details etc. of all the players magazines, including empty ones?*
You can have empty magazines? I thought they disappeared when empty?
There's a config option for CfgMagazine to disable that behaviour (although, it still gets deleted on reload swapping the mag, so I have an EH adding empties for that occasion).
Didn't know that
@tough abyss add text before format
diag_log text format ["%1 - %2",_distractionList, _distractionObject ];
I mean in the actual code, I don't care about the log.
you cant
it is a string of a string
Oh, I need _distractionList and_distractionObject to look similar. I'm trying to get the items from "distractionObject" (which is a text input parameter, so> ItemMap, ItemWatch <and separate them into an array of objects
I wonder, maybe there is an easy way to know how many bytes my remoteExec causes to be sent to the server?
For anyone that cares, you can get the information of a players empty magazines via (magazinesAmmoCargo uniformContainer player) + (magazinesAmmoCargo vestContainer player) + (magazinesAmmoCargo backpackContainer player), plus some extra stuff for their current weapons.
@naive fractal Is there a way to set deleteIfEmpty globally?
You could probably override CA_Magazine and add it to that, but that might have some unintended side effects. Other than that, not really, no.
what about https://community.bistudio.com/wiki/magazinesAmmoFull @naive fractal ?
Doesn't return empty magazines except for the one that's loaded (if there's one).
http://www.armaholic.com/page.php?id=27697 I found this mod that seems to do it
I think that person is simply adding an empty magazine on reload to the inventory, given that the known issue is that they'll cease to exist upon the object being placed elsewhere. I don't have that issue with the config entry in conjunction with the reload EH script.
you are right
Best guess, could be wrong - the behaviour might have been fixed since they posted that.
Are you trying to do the same thing Bosenator? Just keep empty mags in the inventory?
Because my unit would be all over that
I'm extending the ACE repack for my group to add loose ammo/switching ammo between magazines. Most notably for us as a British group we have only 5.56 in 90s, and .303 (for the most part) in WW2, so it'd be nice to switch around ammo in a pinch.
Interesting
@errant jasper variables in mission namespace can be made up of any character, they might aswell start with _.
So technically you could have a _airfieldArray in missionNamespace that you can retrieve with getVariable.
It's still retarded code though, don't make the same mistake.
Hello guys, I am working with ace3.
I would like to disable the option to take a wheel from a vehicle.
Do you know how can I do that ?
Why would a variable defined like so:
x = (allMapMarkers select { _x find "airport" == 0 }) sort true; give undefined variable error a few lines later when run on server but not in single player? If I define x =['blah', 'blah'] instead it doesn't have the error on the server.
Never mind! sort doesn't work like that, it doesn' return anything it sorts in place.
sort doesnt return a value
it modifies an existing array
x = [1,2,0];
x sort true;
x; // [0,1,2];
😦 didnt scroll down to see ur last message
hi there, So i am taking over a dead script that still works 100% called mood jukebox. I was able to make the mod standalone for offline but could not get it to actually start on a multiplayer session (even if i am hosting in lan) Is there anyway to get this to work. I can post the handler scripts that are used. To be clear, I believe this mod was originally used as a map script to start then use the mod part as a custom music holder for the user if this make sense. I basically put in a init.sqf script in the mod folder to make it work.
in the config.cpp
{
a3_Post_Init = "a3_Post_Init_Var = [] execVM ""a3\init.sqf""";
};```
in the init.sqf
nul = ["A3"] execVM "a3\scripts\MoodJukebox\main.sqf";
idk if this is coded for offline only to have this start. would i need it to have something like "if server" or something in the init.sqf file?
any input would help
thanks
i can read code and sort of understand it but I have no idea what I may be looking for?
Extended_PostInit_EventHandlers subsection i assume. ur class doesnt match the setup it shows
i guess im confused to what you said
look at the Extended_PostInit_EventHandlers example and see how it is different to yours
class My_post_init_event {
init = "call compile preprocessFileLineNumbers 'XEH_postInit.sqf'";
};
};```
this one right
class My_post_init_event {
init = "call compile preprocessFileLineNumbers 'a3\init.sqf'";
};
};```
so that would be corrected maybe?
you will want to change the class name My_post_init_event, but assuming the init doesnt need to be scheduled, that should work fine.
class Start_Jukebox {
init = "call compile preprocessFileLineNumbers 'a3\init.sqf'";
};
};```
give it a go
ok ill replace this and try
nope still offilne only
would some server like init need to be made?
idk. entirely depends on how ur mod works.
this was orignially a map script where the init.sqf was in the map file but i placed it in the mod folder directory. would that cause a conflict?
maybe.
i can send the mod via google drive link if you want to take a look. If you really feel like it. I do not want to over step any bounaries
not really overstepping boundaries to have someone else look through ur mod. that being said, no i dont want to.
the execte handlers are just nul = _this execVM "filepath" in the main.sqf that is mentioned in the init.sqf line
?
@radiant egret what part was confusing?
Nvm
maybe I add in this line
if hasInterface && not isServer
just using this as example from a different script
call compile preprocessFileLineNumbers "Engima\Civilians\Common\Debug.sqf";
if (isServer) then {
call compile preprocessFileLineNumbers "Engima\Civilians\Server\ServerFunctions.sqf";
call compile preprocessFileLineNumbers "Engima\Civilians\ConfigAndStart.sqf";
};```
do you even know what the problem is? adding some checks hoping locality is the issue doesnt sound like much of a plan when you dont know the problem. i suggest you add logs in ur files to see what executes and what doesnt. then u can start to narrow down the problem from there.
im looking at this script as a map script since the INIT was "supposed" to be placed in the map folder.
I cannot execute the jukebox script directly from the config
I have already established that it will only bring up errors or not start if I tried to run it from there.
just how I am understanding this mod.
I will state this that I am a person with maybe a lack of understanding of how arma distinguishes its scripts and server scripts. in my mind right now I see that when looking at other scripts, they are using maybe 2 different identifiers like the example up above. I am wondering if i have to do the same thing in a way that will allow a script to fire if it looks like it is supposed to run if it is on a server or not when using the if (isserver) like identifier.
if this makes sense
and it is sort of my conclusion for the past year
or idea
didn't mean to sound like im hostile.
nope it doesn't work. ill just leave this on the backburner
thanks for your time
alright I'm trying to make something for a mission where the player activates a trigger, the screen fades to black, and when it fades back in, they're in a different place, how would I go about doing that?
// trigger activates
"tag_fadeToBlack" cutText ["","BLACK OUT",1];
uisleep 1;
player setpos _newPos;
uisleep 1;
"tag_fadeToBlack" cutFadeOut 1;
for _newPos should I put the x y z coordinates or the grid number?
xyz
it says type "number, expected Nothing"
paste the error
uisleep 1;
player setpos getPos [10313, 9126, 0];
uisleep 1;
"tag_fadeToBlack" cutFadeOut 1;```
thats not the error... anyway try putting nil on the line after cutfadeout
because I know nothing about scripting
you must read the wiki pages for the commands
it makes it a lot easier
Hey guys, Im getting an error, it says ==:type bool, expected number, string, not a number....
private ["_patrolGroup"];
private ["_guard"];
private ["_baseGroup"];
_patrolGroup = leader patrol;
_baseGroup = leader base;
_guard = leader guard;
_contactInfo = _patrolGroup targetKnowledge _guard;
//under here
if (_contactInfo select 1 == true) then
{
_baseGroup reveal _guard;
}```
cant compare bools using ==
===??
and in your case you dont need to compare bool, just do _contactInfo select 1. if it is true, then it is returning true anyway
im totally new to sqf and arma scripting, closest thing is im learning javascript
ohh ok
omg wow yeah that was it thank you so much haha
oh sorry I misunderstood, the error message is "On Activation: Type Number, expected nothing"
yea, so fix that misuse of getpos, and add a line at the bottom that says nil. string cutFadeOut number returns a number so i would like to think thats what the issue is.
so "tag_fadeToBlack" cutText ["","BLACK OUT",1]; uisleep 1; player setpos (player modelToWorld [10313, 9126, 0]); uisleep 1; "tag_fadeToBlack" cutFadeOut 1; nil;?
(player modelToWorld [10313, 9126, 0]) surely you dont mean that.
player setpos [10313, 9126, 0]; is most likely what you're after.
and yes, that nil is correct
still the same error
aww. ok give me a sec
i assume people usually get around this by calling a function or file instead of putting the actual script in their activation field. so you could do that or just wrap the code in a call like this:
call {
[] spawn {
"tag_fadeToBlack" cutText ["","BLACK OUT",1];
uisleep 1;
player setpos [10313, 9126, 0];
uisleep 1;
"tag_fadeToBlack" cutFadeOut 1;
};
};
cheers
When I use a structured text, is there a way to define the color as parameter, so the color is depending on that variable? Or do I need to switch between different texts with fixed colors?
private _color = "#FF0000";
format["<t color='%1'>text</t>",_color];
That easy? Nice, thank you very much!
what situations you usually dont want this to trigger? (including ACE)
waitUntil {(inputAction "DefaultAction" > 0) }
(like while in map, commanding mode, etc)
Hey,
private _query = "";
do the same thing than
private ["_query"];
?
first one initialises the variable in that scope and sets a value to it, second one only initialises it. first one is usually (always?) faster and so recommended.
first one is 100% faster than the second
Have just seen this:
private ["_contactInfo"];
private ["_patrolGroup"];
private ["_guard"];
private ["_baseGroup"];
That's just stupid, if you are already using the array variant you might aswell use an array with more than 1 element
And if you set all the values right after that, might aswell use the keyword.
Thank you for answering.
Dedmen told me one day than I should use the first case, but it didnt work, I first did this :
private _query = "";
switch (_side) do {
case west: {_query = format ["blablabla'", blablabla params];};
};
_queryResult = [_query,1] call DB_fnc_asyncCall;
But, this, is working :
private ["_query"];
switch (_side) do {
case west: {_query = format ["blablabla'", blablabla params];};
};
_queryResult = [_query,1] call DB_fnc_asyncCall;
why not let query be defined by the return of the switch then?
should work exactly the same, you must be doing something else wrong then
Nope I didnt change anything but this, with many tries
and yeah private _query = switch (_side) ... might be easier
Thanks, didnt think I could do this that way
same as forEach and if/then it returns the last value
yup
does anyone know a way to make ai use their bipod?
is there a way to get an AI gunner to apply doSuppressiveFire when you are inside the vehicle, or does being effectiveCommander stop anything?
Hey, anyone know how can I auto format sqf in Visual Studio Code? The SQF extension doesn't appear to support it, I can't find any extension that does. I'm wondering if there is a non SQF extension that could do it maybe?
like spacing? try Shift + Alt + F
Yeah but that only works if there is a formatter for the language right?
However I did just convert spoody online one to a VS code extension while waiting for an answer here 😃 I will ask them if I can share it.
nah that should work regardless, that Shift + Alt + F fixes like the spacing and braces around if thats wat u want, try it
@ebon ridge
Sure
cool thanks
@edgy dune Nah I get "There is no document formater for 'sqf'-files installed." There is no reason it should just work, VSCode has no idea of the syntax of the document unless you tell it, loads of languages don't use curly braces, or use them to mean something else.
But if you say it definitely works for you then I am interested how!
got a problem, i have a static UAV terminal script that give the player the possibility to control drones. problem is, when you close the terminal after flying the drone, the noise of the drone stays with you. Any sugesstions?
Oh u get that when u try to shift+alt+f? Huh it works for me and vs code sees it as sqf, maybe i have something installed. I dont remember what tho
I installed every SQF extension (Arma Dev, SQF Language 1.0.6 and 0.8.1, SQFLint) now and still no auto format! Would love to know what extension you have!
@ebon ridge better ask in #arma3_tools
I got permission to share the vscode extension I wrote, but it is a bit redundant if one of the common ones already does it :/ I will ask in tool makers as well, thanks.
Hello !
Is there an existing array that would define "allPlayersButMyself" ?
variable
okay so how would I acheive such ?
I'd want a forEach to apply to allPlayers (exept me)
forEach (allPlayers - [player])
oh.
as simple as that
hadn't event thought about it
I'll try
thanks
that didn't solve my issue so it probably isn't the problem ^^
@still forum
if (allPlayers - [player]) returns []
Why does this work :
if ((allPlayers - [player]) != []) then {...};
_allPlayersButYourselfBlah = count(allPlayers - [player]);
if(count _allPlayersButYourselfBlah == 0) then
{
};
Aaaaah.... true i'd forgotten !
can't remember what you said Dedmen about you can't == 0 you need to replace 0 by nil or something right ?
because 0 is considered as "false"
isNil
No, I think you tried to tell me that in the past and I told you it was wrong ^^
?
@high marsh
_allPlayersButYourselfBlah = count(allPlayers - [player]);
if(count _allPlayersButYourselfBlah == 0) then
{
};```
Isn't working. It tells be _allPlayersButYourselfBlah is a number and it expects array or config
if(_allPlayersButYourselfBlah isEqualTo []) then
{
};
thanks @digital hollow
if ((allPlayers - [player]) isEqualTo 0) then
is working
isEqualTo 0
should be
isEqualTo []
You are not excluding headless clients
How might one disable scroll menu actions available inside a vehicle? The don't show up in the actionIDs on the player or the vehicle. They seem to be from a mod's config.bin. Any ideas?
I'm a programmer but unfortunately pretty clueless with Arma scripting still
No easy way
ah ok, thanks. Is there a way I can overload the function the action executes? They are all one-liners which call the same function with different arguments
you can have a function do different things depending on the arguments it receives, no proper overloading though.
So no way to intercept a call like this? Alright, thanks for the help!
pretty sure the actions are defined in a config, so you might be able to hide/remove them with a mod, but thats getting into #arma3_config territory
You can intercept with a special event handler but any mod can add own and overwrite yours and the information it returns is not comprehensive. But if you want to waste some time no one can stop you, check inGameSetUIEventHandler
Yeah, sounds like it's going to be more work than it's worth, but I'll take a look
@robust hollow I was able to figure out the issue with my script not firing on a multiplayer session
the main init line for initializing had to be in brackets with if (hasInterface) then and then all the other execVM lines had to be coded if (isMultiplayer) then {}; else {}
then {} else {};*
I guess next step is to have the script restart after a player dies.
currently I have the multiplayer being executed with this execVM
{nul = [_x] execVM "a3\scripts\MoodJukebox\stress.sqf"} forEach (playableUnits + vehicles);
}```
would this reenable this script with a scriptdone statement?
{nul = [_x] execVM "a3\scripts\MoodJukebox\stress.sqf"} forEach (playableUnits + vehicles);
waitUntil { scriptDone script_handler };
}```
private _myScript = compile preprocessFileLineNumbers
"a3\scripts\MoodJukebox\stress.sqf";
while { true } do
{
{ [_x] spawn _myScript; } forEach (playableUnits + vehicles);
waitUntil { scriptDone script_handler }; // what is script_handler?
};
compile "a3\scripts\MoodJukebox\stress.sqf" -> compile preprocessFile "a3\scripts\MoodJukebox\stress.sqf"
woops
i guess I am confused. Would script_handler be _myScript in that example?
anyone good at making a pbo for a standalone mod?
technically its as simple as right clicking and selecting make pbo with pbo manager if u have that installed
but if u wanna make a mod
u make a folder called like myMod and then a folder inside called addons and then inside that the folder u wanna make a pbo so for example something like scriptLibrary
so
myMod>addons>scriptLibrary
i would link something that says how to make a mod but ehhh, idk any links 😦
well what I'm trying to do is just make a pbo i can host on workshop which has textures and sound for a mission
myMod<addons<scriptLibrary.pbo?
Any ideah why
(get3DENSelected "marker") select 0
returns a selected/highlighted marker name in editor but,
getMarkerPos ((get3DENSelected "marker") select 0)
returns [0,0,0] as if the marker does not exist?
Maybe because the marker is not yet created and cannot be detected by getMarkerPos
((get3DENSelected "marker") select 0) get3DENAttribute "Position"; should work
ooooooh, yes. Nice one @cosmic lichen , Thank you!
You're welcome
Is there a way to stop all simulations and totally everything in multiplayer?
I need to implement a custom save system of the whole game world (GTA-like, so save only important things) (into profileNamespace for instance) but for that I'd prefer the game world to not change state of the variables I want to save 🤔 🤔
Maybe I should save all data unscheduled? How is that going to look in MP when server freezes for many seconds?
could save sections of data at a time instead of everything in one go? spread out the impact a bit.
How is that going to look in MP when server freezes for many seconds? just multiple seconds desync for every player
Guess it's not so bad then? I think it's the way to go 🤔 I would rather have the server send events like 'done 10% saving', 'done 50% saving', I wonder if remoteExec sends data immediately or after the unscheduled scripts are done firing?
What data are you saving?
So let's say there are N outposts all over the map, every outpost has an array of soldiers it has, not all outposts are spawned ofc because there are no players/enemies nearby.
I'd prefer units to not die at least so that the array with units doesn't get screwed by multiple scripts accessing it 🤔
If I were making a video game I guess I'd just stop it for the time of saving and show a banner for player 'wait till I save your game bro' but here I can't do that in MP
I'm pretty sure Alive had to solve similar problems... maybe I can check how they did it
Anyway, does anybody know if remoteExec(Call) sends stuff right now or queues it for sending and does it some time later? I remember I have read it somewhere but can't remember where 😦
I was bored and checked out the function viewer, found this
call BIS_fnc_effectFiredLongSmoke
😂
Anyone have any information on how I can post from arma to a rest api?
With a Extension
Is there any currently out there that I could take a look at?
theres a nodejs extension
Oh shit so there is, thanks for that
call BIS_fnc_effectFiredLongSmoke the fastest and most efficient function in the library no doubt
Guys.
As me in game hide selection?
For homes do selectionNames cursorObject. Received array use this way:
cursorObject hideSelection [_x, true];
}forEach ["door_6","door_3","door_1","door_5","door_2","door_4","damt_1","door_handle_1","door_handle_2","door_handle_3","door_handle_4","door_handle_5","door_handle_6","glass_1_hide","glass_2_hide","glass_3_hide","glass_1_unhide","glass_2_unhide","glass_3_unhide","glass_4_hide","glass_5_hide","glass_6_hide","glass_7_hide","glass_8_hide","glass_4_unhide","glass_5_unhide","glass_6_unhide","glass_7_unhide","glass_8_unhide","glass_9_unhide","glass_9_hide"];```
But it doesn't work(
cursorObject hideSelection [_objects, true];```
Try that?
I didn't understand a single word. And no that doesn't work, command doesn't take array of selections
feelsbadman
@pale depot dont work
@fleet hazel What are you trying to use this for?
@still forum We need to hide the selections for the house.
@still forum I got the list with the command selectionNames cursorObject
Use on simple object with hideSelection
Are the format of config.cpp and descriptions.ext the same?
yea, theyre both configs.
So would renaming a descriptions.ext be acceptable?
well... if it isnt called description.ext then the mission wont load it. if a mod config.cpp isnt called that or config.bin (for rapified configs) the mod config wont load.
I could need a little hint in the right direction:
I'm currently creating a "Kill summary" text for players in the UI. Basically pretty easy with an "entityKilled" EH and it works fine so far.
But how would one approach a summarized vehicle kill with several units inside, where the vehicle and each unit are seperate kill and thus trigger the EH several times as well?
I thought of appending the units + killtime into an array and then display for example all kills in between 0.2 seconds into one message. But that would need some loop watching the array constantly, right?
Is there a more efficient way to do this? Maybe kills spawn a 3 second loop and before that one starts, it checks if another loop was already created and then just use that one instead? And every new kill just extends the loop so I don't need to loop all the time?
(I'm not really out of ideas, but also not trying to invent the wheel again. So if somebody already knows a better way, it would be greatly appreciated)
How can I make a marker in eden editor that tell me the dept of the water as the name from where the mark is at?
@marble flare _depth = ((ASLToATL getMarkerPos "markerWater") # 2); "markerWater" setMarkerText format["Depth: %1",_depth];
Try that
you would want atltoasl wouldnt you? water depth would be atl 0z
That works, but need to copy and paste the marker throughout the map probably about 500 times
so the name can't be unique
sure it can. You just have to change the last number like markerWater_1, markerWater_2 and then search for the "markerWater" string in https://community.bistudio.com/wiki/allMapMarkers, then just loop forEach through them
😬
"_USER_DEFINED #" setMarkerText format["Depth: %1",_depth];} forEach allMapMarkers```
Closest I got
If I remember correctly, he was trying to pull the eden attribute, which may be of use for what you're trying to do
anyone see any issues with my config.cpp? I have tried it but it doesn't seem to work whilst in game using sqf playsound "Airdrop_Plane_sound2";
class CfgPatches
{
class SlaysRavageResources
{
name = "Slay's Resource Pack";
author = "Slay No More";
};
};
class CfgSounds
{
sounds[] = {};
class Airdrop_Plane_sound2
{
name = "Airdrop_Plane_sound2";
sound[] = {"SoundZ\plane_fly_over_2.ogg",1};
volume = 1.0;
range = 50;
};
};```
@marble flare { private _markerName = [_x, 0, 10] call BIS_fnc_trimString; if (_markerName == "markerWater") then { private _depth = ((ASLToATL getMarkerPos _x) # 2); _x setMarkerText format["Depth: %1m", round _depth]; }; } forEach allMapMarkers;
Place this into any init and just drop lots of markers with "markerWater_1" etc as name on the map
If those are not editor placed but user defined, you have to manipulate the string a bit more, splitString should do the trick then
np, had fun trying that myself 😃
I'm utilizing the BIS_fnc_holdActionAdd function, I'm trying to make it so when the action is completed, it deletes 2 effects placed in Eden. Here is what I've got:
this,
"Put out fire",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",
"_this distance _target < 5",
"_caller distance _target < 5",
{},
{},
{deleteVehicle ((nearestObjects [player, ["Module_F"], 10]) select 0)},
{},
[],
12,
6,
true,
false
] call BIS_fnc_holdActionAdd;```
My objects are `ModuleEffectsFire_F` and `ModulePersistentSmokePillar_F`. I've tried putting these in and it did not work.
@tough abyss where did you see volume and range properties used like that? AFAIK they should be part of the sound property value
@tall dock what? use playsound Airdrop_Plane_sound2; You removed “ and this somehow should solve the problem? All you did was you passed undefined variable to playSound command
yeah kinda
In this case can you invent us some inventory commands as well please? Quite a few essentials are still missing. Appreciate it.
xD
Anyone got a tidy code snippet to return the intersection of two arrays?
that's more of an arrayAggregate
i mean return an array which contains elements common to both
Intersects array1 with array2 returning array of unique common elements.
oh, right, do'h, misread, thx
👍
what i wouldn't give for System.Linq...
you can write your own library @cursive whale
or, if you actually talk about the object related stuff, use one of the numerous "alt languages" out there
or: write a C# extension
If I ever needed to deal with really large arrays I might but it's probably not worth the overhead (not to mention time) for the garden variety PITA manipulations (right now i just want a crew list with commander, then driver first).
i just want a crew list with commander, then driver first
[commander veh, driver veh]
here you go
cheers, but i need the other crew also (ideally [commander, driver, gunners, cargo]). done now it's just a bit awkward dealing with arrays when I generally get to use linq.
Some guys which are sort of cargo are actually turrets
I mean the FFV seats, it's really annoying
yeah, I'm just going to pushback whatever it returns as Gunner _veh then append the balance however it comes
Yeah gunner should be one of the main turrets
So to sum it up, there are only three pure kinds of seats
Driver
Turret with turret path
Cargo with cargo index
Commander is a role rather than a specific seat 🤷 I think because he is actually a turret
are actually turrets they are both
Are you sure? So I can assign a guy as cargo index to an FFV seat too?
Yeah indeed, that's what I get if I get into a HEMTT FFV cargo seat and execute this: fullcrew (vehicle player)
[[B Alpha 1-1:1 (Sparker),"Turret",7,[0],true]] - cargo index 7, turret path [0]
[[B Alpha 1-1:1 (Sparker),"Turret",15,[1],true]] - cargo index 15, turret path [1]
But if I look at an empty HEMTT truck and do this: copytoclipboard str (fullcrew [cursorObject, "cargo", true]), that's what it returns:
[[<NULL-object>,"cargo",0,[],false],[<NULL-object>,"cargo",1,[],false],[<NULL-object>,"cargo",2,[],false],[<NULL-object>,"cargo",3,[],false],[<NULL-object>,"cargo",4,[],false],[<NULL-object>,"cargo",5,[],false],[<NULL-object>,"cargo",6,[],false],[<NULL-object>,"cargo",8,[],false],[<NULL-object>,"cargo",9,[],false],[<NULL-object>,"cargo",10,[],false],[<NULL-object>,"cargo",11,[],false],[<NULL-object>,"cargo",12,[],false],[<NULL-object>,"cargo",13,[],false],[<NULL-object>,"cargo",14,[],false],[<NULL-object>,"cargo",16,[],false]]
So it says, there are NO cargo seats with cargo index 7 and 15, what is going on here?
And if I go back into FFV seat and do this copytoclipboard str (fullcrew [vehicle player, "cargo", true]) it returns same array as above ^
You might want to read fullcrew page on wiki then
I don't get it, is cargo index only compatible with moveInCargo? What about assignAsCargoIndex?
which cargo index
there are 2
one for use with action one with cargo comands
assignAsCargo should take the same index as moveInCargo I suppose
This command: https://community.bistudio.com/wiki/assignAsCargoIndex has only one syntax
The fullCrew return value [<Object>unit,<String>role,<Number>cargoIndex (see note in description),<Array>turretPath,<Boolean>personTurret] has only one cargo index too
Where are there two kinds of cargo index you are talking about? I don't get it
Not sure worth discussing it until you read fullcrew page on biki where it is explained
Oh you mean this one unit action ["getInCargo", targetVehicle, positionNumber]
positionNumber is a specific cargo position index number
LOL
So there is 'cargo index' and 'cargo position index number', I get it now 😄
Guys. How can I determine the length of a value?
@fleet hazel What type of value?
the one returned by the car script
@fleet hazel count
Maybe he means magnitude of a vector? vectorMagnitude for that
Or by length he meant absolute value of a number? Then there's abs
@ebon ridge @tough abyss number 1634984189
What kind of length?
@ebon ridge Yes
@ebon ridge I need to do 1634984189 work [1,6,3,4,9,8,4,1,8,9]
Yes. and then team count I know the length
count (format ["%1", number])
How to make this format?
@fleet hazel count str 5677654
that is nicer
@tough abyss count str 5677654 output 12
But with large numbers it won’t work because of scientific notation
And there are 7 numbers
or because of float imprecision
Ok do count (5677654 tofixed 0)
And how do I choose 0 and 1 elements of this number?
error send me
Post your code
So post what you put there
(5677654 tofixed 0) select 0
What error says?
22:43:49 Error in expression <(5677654 tofixed 0) select 0>
22:43:49 Error position: <select 0>
22:43:49 Error General error in expression
toArray(5277654 tofixed 0)
select element and toString
(5677654 tofixed 0) select [0, 1] maybe
[0, 1] is start and length, so use [1, 1], [2, 1] etc to select each individual character
@ebon ridge Thanks. I know more now!
Ah yeah of course substring
New command addMEGAzine
@tough abyss if you wanna test perf of cache vs nocache, cache is removed now on RC
I will wait for the next dev, if it is gone it is gone, no one will change that now
How to call mod.cpp in the pbo files ?
can't
I've noticed that some playActions, when executed server-side, are global (Such as "SitDown") but others seem to not be. In this case, I'm trying to use switchAction instead and the AI looks like he's either just standing or gets frozen in a walking animation.
I'm trying to avoid the use of remoteExec because it doesn't always execute when I need it to (Slow / incorrect order)
Guys. I have 2 requests.
How can I combine 2 queries into 1?
SELECT name FROM players WHERE playerid = '76561198052742683
';```
The result of the first query should be used in the second.
the second query doesn't use a house pid
trying to use something that's not used, doesn't make sense
@still forum I need to get the name of the owner of the house.
well then you need to look for that in your database
I have no idea about your database layout
All columns exist. I'm having trouble creating the request.
The first request I make is to check the availability of the house, and the second is the name of the owner of the house. Separately, everything works. Need 2 requests to do 1.
Well noone here can help you without knowing your database.
So guess you have to figure it out for yourself
Oh the pain of sending manual sql queries via sqf 😂
I almost enjoy watching people suffering when they refuse to use stored procedures
i don't use sql that often but why is it "SELECT houses.pid FROM houses" and not "SELECT pid FROM houses"
SELECT pid, name FROM houses, players WHERE pos = '[3592.63,13081.3,0.128579]' AND classname = 'Land_i_House_Big_02_V1_F' AND playerid = '76561198052742683'; this should work @fleet hazel
@warm spade Empty set
Does arma handle sql different? I got results when testing it on localhost https://imgur.com/a/dAokd1x
@fleet hazel sry forgot to read the second part of your question.... something like this should check if the player id is linked to the house. SELECT houses.pid, name FROM houses, players WHERE pos = '[3592.63,13081.3,0.128579]' AND classname = 'Land_i_House_Big_02_V1_F' AND playerid = '76561198052742683' AND playerid = houses.pid; didn't tested it tho
assuming pid is short for playerid
Is there a way to update or remove a BIS_fnc_textTiles spawned text from screen? Or is there any other way to show a simple text on screen with a changable variable in it?
you can try running the function again, not sure if it works similar to bis_fnc_dynamicText which does replace the active text. other options are titletext and cuttext. use format to add ur variable into the string.
Just found ctrlCreate ["RscStructuredText", -1] , maybe that'll work
Hello, Does anyone know where to find A3 Apex classnames with pics? i can find class names but no pics of each one so i dont know which is which.. ( after clothing/vests mainly ) thank you!
the virtual arsenal is probably the closest thing
Any ezpz way to created a scripted "missionEnd" event?
missionEvent for Ended doesn't seem to trigger
Check CBA and unless my eyes are tricking me, don't see one in there either
Basically just need it when someone exits a mission (Leave preview from 3den, leave an MP mission (even if it still keeps running for others) etc.
is there a way to determine the 'center' of an airport/airfield? ilsPosition gives the edge of the runway and nearestLocations does not seem to reliably give results
can you average it with the taxi coordinates? https://community.bistudio.com/wiki/Dynamic_Airport_Configuration
HA! that's not ideal but MILES better than anything I tried so far
thank you @cursive whale
most welcome (i enjoy your videos), probably leave out the runway and average just the taxiway
Is there a way to fix it that remoteExecs wont arrive once the user tabs out without -nopause?
if there is no way, you'd probably have to implement an acknowledgement mechanism, but I hope there is a way
anyone know if there's a way to define a RscControlsGroup as initially hidden (to be revealed when required using ctrlShow)?
Was worried about seeing the group momentarily but if I ctrlShow false as soon as the display exists then you never see it, so all good.
I think there is a config param you can set so it is created hidden
would love to find it (the better way) but nada so far, will keep looking
Tried show = false; ?
can't find 'show' in https://community.bistudio.com/wiki/Dialog_Control but have run across it being used in AIO config so will give it a whirl
show = 0;
Maybe
Works, thanks.
Hi All !
I am pretty bad in script and even less on that of arma!
So for a specific mission I have to randomly spawn 1 ammoBox on one of 5 possible positions.
I think for example put traffic cones and replace randomly by a ammoBox but I can not do it.
Any Ideas?
Probably easier to just make the one box and move it to where you need. _box setPos selectRandom [_pos1, _pos2, ...];
18:59:44 Server: Object 109:572 not found (message Type_93)
18:59:44 Server: Object 144:602 not found (message Type_93)
18:59:44 Server: Object 34:17 not found (message Type_93)``` Any idea what might be causing this?
On a dedi server with 100 people, this spams the logs
clients sending messages about objects that don't exist anymore
possibly client uses mods that server does not have
Object deleted but server is not updated
@lean estuary totally normal, to hide, them append your startup CMD with -noLogs
Does anyone have an experience with creating a custom function library? I've never done it before and i'm having a little trouble
This is what i have and its throwing script takitest\functions\fn_HP_fnc_countGarrison not found
is your file called fn_HP_fnc_countGarrison.sqf?
you can paste an image link, it just wont expand in chat unless you're special
Ah ok
k, that is wrong
HP_fnc_countGarrison will compile to function HP_fnc_HP_fnc_countGarrison
so i assume ur files are named like fn_countGarrison.sqf?
change them all so instead of HP_fnc_ they start with fn_. then in the config replace class HP_fnc_ with class (no prefix).