#arma3_scripting
1 messages Β· Page 550 of 1
yeah im crap arma dev. but still i dont know why my map icons thing isnt showing incapacitated players
can you look at this plz.
https://pastebin.com/d3nWNMbi
side _x isEqualTo west dead players are of side civilian.
im not doing that.
It's right there in line 3.
yup
try maybe filtering by faction or something
I think you can check side of group instead?
that too
im gonna do this instead
(side _x isEqualTo west) || (side _x isEqualTo civilian)
but I don't know if it is valid after the unit has been found as dead, I would need to check
side _x in [west, civilian]
have you checked that lifeState of your players really returns INCAPACITATED ?
if (((lifeState _x) isEqualTo 'INCAPACITATED')) then
Yes. Yes I can read your code.
also you should use Code instead of String in your event, if you use some IDE code highlight will work better
Have you checked?
also you should
there are many "also you should" in that piece of code :D
So while your code doesn't show any icons,
(allPlayers select {side _x in [west, civilian]}) apply {lifeState _x}
in debug console does show incapacitated units?
the script works great, just doesnt show incapacitated players atm.
Didn't answer my question
in debug console does show incapacitated units?
need to make sure the basics work, before looking into that big script with multiple potential issues
yes it does, it shows the player i just incapacitated as civ and me as west
[] spawn {{
hint format ["%1 - %2",name _x, side _x];
sleep 5;
} foreach (allPlayers select {side _x in [west, civilian]}) apply {lifeState _x};
};
also all other west vehicles show up on the map just fine. with the code i shared in link
What?
that code doesn't work
either you pass a nil into apply instead of an array.
or your _x is a string, can't get name or side from a string
also instead of hint and sleep, I'd recommend systemChat no need to wait if you can see the whole list of outputs
(allPlayers select {side _x in [west, civilian]}) apply { systemChat str [_x, name _x, lifeState _x, (lifeState _x) == 'INCAPACITATED']; };
ok, the code i shared here does work i can share the images. so not sure what u mean.
the code in link does show all west vehicles and us when we are alive on the map but not when incapacitated.
The code doesn't make sense
It can run in two ways, depending on the precendence of foreach vs apply.
And both ways are errors.
you are correct, this does not work.
[] spawn {{
hint format ["%1 - %2",name _x, side _x];
sleep 5;
} foreach ((allPlayers select {side _x in [west, civilian]}) apply {lifeState _x});
};
Variant 1:
({} foreach (allPlayers select {side _x in [west, civilian]})) apply {lifeState _x};
forEach takes precedence over apply, forEach returns nil. You then run nil apply {lifeState _x}
which is nonsense.
Variant 2:
{} foreach ((allPlayers select {side _x in [west, civilian]}) apply {lifeState _x});
apply takes precedence. Apply returns array of strings. _x in forEach is string, neither name nor side take string
i add parenthesis around the apply
As I wrote above
in debug console does show incapacitated units?
in debug console. In a watch field.
If you don't want to use a watch field, you can use
(allPlayers select {side _x in [west, civilian]}) apply { systemChat str [_x, name _x, lifeState _x, (lifeState _x) == 'INCAPACITATED']; };
to print to chat.
perfect. So all is good in the input data coming to your script
Do you have error message popups enabled?
have you checked the RPT?
maybe your loop errors and that's why it doesn't show them
Actually.
yep
your code has syntax error
Line 45.
_sideColor = _sideColor = 1,0.41,0,1;
about to test. Im on our production server cuz my local dev doesnt allow players to connect for testing atm. so no client errors are not enabled and nothing is showing up in the rpt for the server
that syntax error fix didnt change anything
do you have errors displaying?
no
do you have -showScriptErrors flag?
no its our production server, i dont have access to the commandline
for your client I mean?
yes but it doesnt show anything
AH SHIT IT WORKS!
im tarded again. sorry @still forum and @winter rose
You can go to bed now π
i converted that side color to string instead of array. lol
yes bed so much bed
well hangon
so how can i get this script to run for GPS?
Line 45.
_sideColor = _sideColor = 1,0.41,0,1;
He has been told about incorrect colour 5 hours ago, looks like waste of time tbh
lol, ur Criticizing me for being afk and not reading messages, while just a few lines above you can see that we fixed it and i took others advice.
@tough abyss
So glad you guys figured this out. thank so much.
Well you could atleast read messages that mentioned and pinged you and told you the solution to your problem
Instead of going all "OMG ARMA! SO BUGGED! EDIT WIKI IMMEDIATELY!" and wasting multiple peoples time to solve the same problem again, while it was already solved for you.
i left the channel open so when i came back to computer i didnt have the message.
real life happens sometimes
rarely but sometimes
So you ask and ask and ask because you donβt read replies? Let it be a lesson to next person wanting to help you
Guysβ¦
again i left the channel open so when i came back there was no alert and loads of messages since i left. while i have flaws im glad one of them is not being rude to others and bashing.
thanks again.
Has anyone else problems with scripting command "in" ?
Official example gives me a syntax error: _isInString = "foo" in "foobar"; // true
with arrays it just works fine, seems only to be corrupt with strings
@thorn mural try using find
@thorn mural yeah you are right, it doesn't work with strings for some reason in arma
yeah im doing that right now
It will work, string in string is v1.95 (dev build)
noone reading the version notes β¬ββ¬ γ( γ-γγ)
Somehow when I read 'since' my brain thinks about past time or smth which has already happened π€
All this wiki for naught!
it's not for naught, @winter rose , some of us use that wiki like it's a sacred text-- and to say we appreciate the contributors would be a gross understatement.
Don't worry; I serve the wiki and it is my joy π π
Better one starts implementing that in sqf-vm then
Lol, you have to keep up with all new commands havenβt you?
How do you list mods as required, optional, etc, for a server mission? Is this something done via script? Or server config?
@dreamy kestrel are you using a dedicated server?
has anyone messed around with the v44 armed and adding weapons to it? I cant seem to get the turret path figured out for it.
this addWeaponTurret ["cannon_125mm",[1]];
this works but fires from an imaginery turret above the vtol. I've tried lots of [1,1] combinations for turret path with no luck. I'm very new to this btw.
What's a simple way to attachTo a unit's bone so it follows the bone's rotation?
this bush1 attachTo [fugitive1,[0,0,0], "pelvis"]; does not follow the units rotation as he stands/goes prone etc.
always remains vertical
you cant do such attach
Excuse me, I would like to write a code on the special equipment (clothes, trousers) so that when this item is lost, it can not be picked up by anyone. Which grammar of Wiki should I refer to? Thank you.
you would need to compensate vector direction changes for each frame
that sounds like a pain
attachto is not meant to attach new parts to characters
if you want to introduce yourself to vector mathematics then you can solve the problem
or you can figure out some simpler way to do whatever it is you want to do
htmlLoad in lobby, possible?
With the display config and running __EVAL or something to run the htmlLoad command? What about allowedHTMLLoadURIs in CfgCommands?
What sort of scripting and/or server side configuration do I need to do in order to white/black list certain mods, or allow some as optional?
Is there any particular reason why setAperture doesn't do anything if used in initPlayerLocal.sqf? It's supposed to be local and I need it to be JIP-safe, so I figure it should work.
What are the best resources for learning about the FSM Editor and how to create good FSM scripts?
Wiki should have good info about that
Also @errant patio you can open someone's FSM and see how it works, you can take VCOM's FSM for example
alright, i'll take a look at that too. not planning to use it to control AI per se, but seeing how something like that ticks should be helpful π
23:24:34 [1.07856e+006,28939.7,8.616,"XEH: PostInit started. MISSIONINIT: missionName=4th_Battalion_MSO, missionVersion=53, worldName=pja310, isMultiplayer=true, isServer=true, isDedicated=false, CBA_isHeadlessClient=false, hasInterface=true, didJIP=false"]
23:24:34 [1.07856e+006,28939.8,8.616,"CBA_VERSIONING: ace=3.12.6.43, cba=3.12.2.190909, zen=1.4.1.10, acex=3.4.2.13, ctab=2.2.2.1, acre=2.7.1.1016, mrhsatellite=1.52.4, "]
23:24:35 "8.616 MCC Medic System: Can't init ACE medic is on"
23:24:35 [ACE] (common) INFO: ACE is version 3.12.6.43.
23:24:35 [ACE] (common) INFO: CBA is version 3.12.2.190909 (min required 3.9.0)
23:24:35 [ACE] (common) INFO: Extension version: ace_break_line: 3.8.4-ef4d289
23:24:35 [ACE] (common) INFO: Extension version: ace_parse_imagepath: 3.8.4-ef4d289
23:24:35 [ACE] (common) INFO: Extension version: ace_medical: 3.8.4-ef4d289
23:24:35 [ACE] (common) INFO: Extension version: ace_clipboard: 3.8.4-ef4d289
23:24:35 [ACE] (common) INFO: Extension version: ace_fcs: 3.8.4-ef4d289
23:24:35 [ACE] (common) INFO: Extension version: ace_advanced_ballistics: 3.12.0-8ddde18
23:24:35 [ACE] (nametags) INFO: ACRE Detected.
23:24:35 [ACRE] (sys_io) INFO: Pipe opened.
23:24:35 [ACRE] (sys_core) INFO: Loading Map: \MAK\ProjetA3-10\pja310.wrp with radio signal code 5
23:24:35 Error in expression <]] call ace_common_fnc_canInteractWith} >
23:24:35 Error position: <>
23:24:35 Error Missing )
23:24:35 Error in expression <]] call ace_common_fnc_canInteractWith} >
23:24:35 Error position: <>
23:24:35 Error Missing )
23:24:35 Error in expression <]] call ace_common_fnc_canInteractWith} >
23:24:35 Error position: <>
23:24:35 Error Missing )
23:24:35 Error in expression <]] call ace_common_fnc_canInteractWith} >
23:24:35 Error position: <>
23:24:35 Error Missing )
23:24:35 Error in expression <]] call ace_common_fnc_canInteractWith} >
23:24:35 Error position: <>
Anyone have any idea what this error is telling me?
I'm interested in writing a script that would allow a trader/s, for example Black Market Trader to be the only available sell point for certain items. Excluding or blacklisting the selected traders from being able to sell a (item_x) for a player if not listed.
Ive searched online for all the information i could but nothing really defines this function/script I'm trying to create plus being a noob doesn't help either, lol. If someone out there has the knowledge on how i would go about this could you please help me out.
As of now i have a Black Market Trader and Farming on my server but the items from farming i would like them only to be sold at the Black Market Trader. As of now your able to sell them at all traders, how can i fix this or can someone direct me into the right path to writing a script for this to add into the server to prevent those items from being sold at the other available traders UNLESS its a Black Market.
How would i go about getting this added?
@hallow mortar It should work, you must be doing something wrong
@errant patio wiki + learn from other FSM scripts
@wide anchor traders are not a part of vanilla package, you find better response if you ask at the relevant forum/discord
@tough abyss thanks
@hearty plover
Anyone have any idea what this error is telling me?
uh....
23:24:35 Error Missing )
you are missing a paren there. Do you use canInteractWith anywhere? is your ace maybe corrupted?
Guys i'm bulding a tvt cache hunt type and i wishing if anyone can help me i am new to scripting so i need to spawn opfor player with a cache randomically anyone know how to make this ?
@finite dirge can confirm that the script did not work
I don't call that anywhere in my code. I will reinstall mods, hope that fixes it.
@tough abyss I'm not sure what I could possibly be doing wrong. My initPlayerLocal.sqf consists of one line: setAperture 4.5;
Try other values, 200 for example, does screen go dark?
I know the value is fine because when I run it in the debug console, the change is obvious
Does the script run? Add systemchat before and after setaperture
The script is running. I see both systemChat messages.
Is this the only setAperture command in mission?
Somebody can explain me difference between this example, i dont remember.
if ((condition) && {condition}) then {};
if ((condition) && (condition)) then {};
In the first example second condition only checked if first condition is true
ok ty
@hallow mortar maybe try sqf waitUntil { not isNull player }; // sleep 1; // test that if it doesn't work without it setAperture 4.5;
Adding the sleep worked. It seems the issue is really that setAperture doesn't work during the initial briefing stage.
Can you guys confirm that example 4 of https://community.bistudio.com/wiki/BIS_fnc_initVehicle has a mistake?
varspace setVariable [name, value, public]
one too many yes
Thanks
@wide anchor LOL, if you really want to do such stuff and modify exile to a extend that trades work differently, you will have to write that code on your own.
What is the mistake in example 4? @quartz coyote
@spice axle there is one argument too many in the setVariable command. setVariable can only hold 3 arguments max in the array
varspace setVariable [name, value, public]
this setVariable ["BIS_fnc_initVehicle_customization", false, false]; // set in an init field
This is what I got there
I fixed it already
@cosmic lichen thanks β€
No Prob β€
Anyone know of a IR strobe script (outside of using ACE) that can 1. Can be attached to all members of "west" (not just my team) when i trigger it 2. Also a way to turn them all off/on if needed (for all in west)? I have found some working botched to together scripts but I mainly can only find ones that are just for player only or own team .. or if I can get it to work the strobes detach after about 10 mins of game play.
Triggering this works to place them all on and attach but they then fall off after a short while in game - and I dont know how to then set this to take them all off again (on/off I want to put under a radio trigger).
if ((side _x) isEqualTo west) then {
_ir = createvehicle ["O_IRStrobe",[0,0,0],[],0,"NONE"];
_ir attachTo [_x,[-0.02,-0.05,0.04],"LeftShoulder"];
_ir setLightBrightness 1;
};
} foreach allunits;```
fyi:
```sqf
/* your code */
```
@low pagodasqf { private _ir = createVehicle ["O_IRStrobe", [0,0,0], [], 0, "CAN_COLLIDE"]; _ir attachTo [_x, [-0.02, -0.05, 0.04], "LeftShoulder"]; }; } forEach (allUnits select { side _x == blufor };
("O_IRStrobe" createVehicle [0,0,0]) is even a bit faster than createVehicle ["O_IRStrobe", [0,0,0], [], 0, "CAN_COLLIDE"];
https://community.bistudio.com/wiki/setAperture
he listens us π
AFAIK aparture settings do not work on NVGs
IDK, I think not
I remeber testing and it sadly didn't work
yeah, I was more interested in aparture though. Increasing brightness/contrast is not the same
anyone aware of a script that forces the AI to vote again in Warlords? This would be for the enemy team, I've pushed them back but they're still trying to get to a friendly location 5km away rather than contesting the same one
thinking maybe you can call a function or some kind?
Hey guys. I'm pretty sure i'm asking in the right section. I'm trying to create a "Diary record" when a unit picks up documents(From the props "intel" section.) But as far as I know this can only be done in Zeus, unless you want to script something. I've done a little digging. But haven't really found anything. I've seen a couple videos to. But they were making tasks complete when intel picked up. Any help.
for a basic diary record when you "pickup" a document you could do this. when the player walks up to the documents he will have the option to pickup intel, if the player clicks that then it deletes the documents and will create a diary record
this AddAction ["Pickup Intel",
{
Params ["_Target", "_Caller"];
DeleteVehicle _Target;
_Caller CreateDiaryRecord ["Subject", ["Title", "Text"]];
}];
@tame socket And I would just place that code in an .sqf file? And I'm assuming I would modify the title and text to my needs, correct?
@finite dirge Thanks dude, I'll check this out aswell.
put that inside the init of the documents. i figured it would be easier to do it that way for ya. read the wiki page that he linked so you can see the other parameters that CreateDiaryRecord takes in incase you want to implement anything else
Oh, really. I'll try it out and let you know @tame socket
@tame socket I've added that code to the documents file. And it opens up the map. But doesn't display anything. I've edited the Subject, Title and text. What else would I have to change?
what do you mean by it opens up the map? also ive never created a diary thing before so i have 0 clue what it does
xD
Well it added "Pick Up Intel" To my scroll menu. but nothing happened. My dude just picked it up. And so I restarted the mission and clicked "Take Intel" And it opened up my map and went to a sub menu where Diary Records would show up. but nothing is there. I just want it to display some texts in a Diary Record.
thats strange, it should be fine. let me read the wiki a bit
try putting "Diary" as the subject
@finite dirge
Start here: /* */
π :D
Start here:
https://community.bistudio.com/wiki/Arma_3_Task_Framework_Tutorial
@tribal stump
Diary records may follow π
Hah. Well... fair point.
to be totally honest I read too fast, he mentioned Diary record, not tasks π
nailed it
does anyone know how to get the action menu to show up in multiplayer with revive enabled on the server when the player is incapacitated? armas revive system hides and and doesn't show the menu even when the parameter for show when unconscious is set to true.
does anyone know how to get the action menu to show up in multiplayer with revive enabled on the server when the player is incapacitated? armas revive system hides and and doesn't show the menu even when the parameter for show when unconscious is set to true.
@exotic tinsel Doesn't vanilla Arma use the space bar to revive down units? Not 100% sure since I use ACE3.
@winter rose lol, Thanks though.
units getting revived works fine. i need the unit that is incapacitated to be able to use some items in the action menu.
are you positive the unit is not out of range of the action?
he means, when you are the down unit, action menu doesn't show up
@exotic tinsel Just use ACE3.
If the unit is incap and the revive works.... Then whats the issue?
You mean treating the wounded works. When they are incap the action doens't show?
the unit that is incapacitated, needs to be able to see some of the items in their menu, while INCAPACITETED that are set to show when unconscious. Not other alive players. just the unit that is down. he needs to see his action menu.
@tribal stump
@finite dirge Thank link you provided. That to be entered in an sqf?
Or would I add it after the "addaction" part?
@tribal stump the link he provided is the CreateDiaryRecord portion of the addaction i showed you
did you change the subject to Diary? if so then something should appear under the briefing tab
That was my issue. Facepalm Thanks.
scroll up and i said the same thing XD
Hello i need help, i have a arma 3 server ( altis life ) but when i join there is this :
Is the contact DLC installed on the server?
well, buy the DLC
read the error lol
It's pretty much telling you what you have to do.
There is no dlc installed on the server
it disagrees with you. check again to make sure
Cause it tells you right there. You used premium DLC.... Buy it
but how can I do that even those who do not have dlc can join the server?
by removing whatever DLC content is being used by the server. the server thinks the DLC is being used
and how and where can I delete it? desolate i start my server i'm bad ::
we cant tell you, you have to just go through it and figure out whatever is using the dlc and remove it
Ok...
@winter rose said "well, buy the DLC" I say... It's a Lifer... π€·
Yet I have all the dlc, it's not a problem of me but my server
The mission has been made with some DLC content
Remove said content, mission is DLC-free
Is there a way to make drones available to be connected only to selected players and hidden from others?
disableUAVConnectability pretty sure, can't check wiki not working for me atm
Same here. Good to know the wiki isn't just down for only me
Excuse me, I would like to pass (the equipment will disappear or cannot be picked up immediately after the player drops the specific equipment). Do you have any help, thank you.
PSA:
For those of you who need the wiki, you can use the Wayback Machine in the meantime:
http://web.archive.org/web/20190429161147/https://community.bistudio.com/wiki/Main_Page
(Search field obviously doesn't work)
A3 Commands:
http://web.archive.org/web/20150821041655/https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
A3 Functions:
http://web.archive.org/web/20150619050018/https://community.bistudio.com/wiki/Category:Arma_3:_Functions
actuallyyyβ¦
He added marquee
is there a way to get the move position of a specific AI unit in my group that I commanded to move somewhere? (using the action menu)
I thought about waypoints, but they're shared across all group members
nevermind, found it
hey guys - what's the best way to distinguish IR lasers from flashlights via cfg?
i compared the config values and the only obvious differences are in stuff like 'displayname', so if some addon has a weird name configured it would ot work. must be overlooking something
i love how without fail, one tries a lot of things, then asks, then tries some more things, then learns a thing that you asked about.
_isPointer = getNumber (configfile >> "CfgWeapons" >> _itemName >> "ItemInfo" >> "Pointer" >> "irDistance") != 0;
_isFlashLight = getNumber (configfile >> "CfgWeapons" >> _itemName >> "ItemInfo" >> "FlashLight" >> "intensity") != 0;
Why do you need to read properties, is it not enough that one says pointer and another says flashlight?
mods maybe?
There's an errant object in my scenario from LOW DLC that I must get rid of. I can't find it.
_appID = getObjectDLC cursorTarget;
Isn't super useful because there's no way I'll ever be able to search in game.
I mean, I can't find it in the editor, there's no way I'll find it in the game
make a backup of your mission.sqm, delete the Laws of War DLC line from the required addons and try to load it
it should tell you "cannot load the mission because LoW isn't installed, used because of xxx"
@winter rose thanks. I've not explained the situation well. I do have the LOW DLC but I don't want it required to play my Scenario. It was only used for a couple outfits in the first place. Totally unnecessary. I'm flat out positive I've removed every object/outfit/accessory from the DLC but it's still in the required add-ons list.
On one hand I wouldn't be terribly surprised if I missed something but on the other hand I'm super-sure I got 'em all. Is it possible that since it once required the DLC, it's stuck somehow?
no
just to be sure, remove the DLC from Steam, do what I said, and it should throw the error of what's wrong
okay, I couldn't figure out how to disable it in the launcher. I'll look in steam-- very easy process, very tiny checkbox
I propose it is impossible to disable DLC π
Did you try steam?
why not try
print out ALL dlc objects in the map
_MissionObjects = AllMissionObjects "All";
_DLCObjects = [];
{
_AppID = GetObjectDLC _x;
if !(IsNil _AppID) then
{
_DLCObjects PushBack _x;
};
} ForEach _MissionObjects;
hint str _DLCObjects;
or if you know the DLC id
_MissionObjects = AllMissionObjects "All";
_DLCObjects = [];
{
_AppID = GetObjectDLC _x;
if !(IsNil _AppID) then
{
if (_AppID == IDOfDLC) then
{
_DLCObjects PushBack _x;
};
};
} ForEach _MissionObjects;
hint str _DLCObjects;
not sure how well this will work but its an idea
copyToClipboard if there are too many ^_^
Yeah, it says "not installed" on steam-- it's still very much installed (and un-configurable) in game-- I'll try Cody's method too-- thanks guys
Why, you can still play the campaign?
If you untick Apex, can you open Tanoa?
Iβm assuming you are restarting the game each time, yes? Yes?
in game, none of the DLC can be configured at all. The options are greyed out
and yes I restarted-- several times
like each time
Is there any sane way to create a while-do loop (or with some other method) that keeps polling from here to eternity for some condition to be true but applies the result only once when the condition has been met?
For example create a continuous check if a player is inArea (of some marker) then for example display a hint but only do that once (while the checking of the condition still keeps looping in the background)
Yeah create a no repeat trigger
For reasons would need to do this without triggers. Also, if it doesn't repeat then it will completely stop after true has been met the first time
and a boolean _showHint = false, if not _showHint then _showHint = true, hint "blah"
@tough abyss My scenario requires LOW and I don't want it to. I can't find the object/accessory/character associated to the DLC.
Eden has menu that shows dependency
if I could filter the left side panel the same way as the right side panel (by dlc) we'd be all good
(unless it's in a character's inventory)
There is other menu
I appreciate the help. There's a topic on the forum where I'll post the solution when we find it.
does your mission have mods?
I'm receiving this error: 20:44:50 Error Type Number,Not a Number, expected Number when calling this function with parameters ["123",1] call DT_fnc_setFreq;
params [
["_freq","",[""]],
["_index,",1,[0]]
];
if (_freq isEqualTo "") exitWith {};
private _radio = call TFAR_fnc_activeSwRadio;
[_radio,_index,_freq] call TFAR_fnc_setChannelFrequency;
[_radio,0] call TFAR_fnc_setSwChannel;
if (_index isEqualTo 1) then {
[_radio,0] call TFAR_fnc_setSwChannel;
} else {
//[_radio,_freq] call TFAR_fnc_setChannelFrequency;
[_radio,1] call TFAR_fnc_setAdditionalSwChannel;
};
20:44:50 Error in expression <te _oldFrequency = (_settings select 2) param [_channel, 0];
(_settings select >
20:44:50 Error position: <param [_channel, 0];
(_settings select >
20:44:50 Error Type Number,Not a Number, expected Number
20:44:50 File z\tfar\addons\core\functions\fnc_setChannelFrequency.sqf..., line 34
Full error ^^
@winter rose no, sir. no mods.
@hot kernel mind to send me the mission.sqm?
@cold pebble your error seems to have nothing in common with the script you posted
Its to do with TFAR_fnc_setChannelFrequency
Which I find here, I'm pretty sure I'm sending through the correct parameters (and the _radio) passes through the check in params
setXXStereo command don't take a "index"
And your _index in [_radio,_index,_freq] call TFAR_fnc_setChannelFrequency; seems to be NaN
@winter rose I'm happy to,
https://drive.google.com/open?id=1h6whMCT11TlAo0wWSH0Hs5LB7kiUqSXe
Altis?
tanoa
I've removed the setxxStereo bits and still having an issue π¦ and _index seems to be defined
test3 = {params [
["_freq","",[""]],
["_index,",1,[0]]
];
systemChat str(_this);
if (_freq isEqualTo "") exitWith {};
private _radio = call TFAR_fnc_activeSwRadio;
[_radio,_index,_freq] call TFAR_fnc_setChannelFrequency;
[_radio,0] call TFAR_fnc_setSwChannel;
if (_index isEqualTo 1) then {
[_radio,0] call TFAR_fnc_setSwChannel;
} else {
[_radio,1] call TFAR_fnc_setAdditionalSwChannel;
};};
["123",1] call test3
That produces the same issue π¦
someone can help me about this : 21:56:43 Warning Message: Script \life_server\init.sqf not found please π¦
I found my issue Lou π
yep, said nothin' :p
always close the cage, dammit
π
@acoustic iris where do you call it
well...
@hot kernel dependencies on Arma 3 Orange - Characters and Clothing found in your SQM
"A3_Characters_F_Orange_Facewear"
yeah, that's what I found too. But I don't know how many times I can go through the few characters inventories and come up with naught. There's not a lot of places to look
It was headsets. That was the "facewear" object I removed.
I'll look again...
There are 7 characters with inventories. The first thing I checked was that the character model is not from LOW. They are all vanilla and APEX.
The second thing I checked is their clothing, head and face pieces. Despite what the sqm says there is nothing character related to LOW in the actual mission.
the thing I had though, civilians don't appear in the "Entities list" in Eden π€
hmmm indeed
in the editor everything is in layers
there's nothing in the folder "civilian"
ah yes, my bad
kk, thought I'd broken everything
I don't use layers very much, so it didn't tilt
how can I disable AttachtoRelative from an object?
Its probably obvious but I can't see it
I have an error, when I connect to my server it does not download the map or anything
My logs :
@smoky verge you make no sense
@smoky verge detach
@tough abyss I've used AttachtoRelative to tie 2 objects together
I want that when a trigger is activated it will detach them
simply detach?
Is there a way to add an eventHandler for a group being deleted?
or something with equivalent functionality
Looks like not
You will have to poll the group handle until it is isNull
Or what do you actually want to achieve? Maybe there is another way?
Excuse me, when a player can not pick up or disappear after throwing down specific equipment, how to write? tks!
what i'm trying to achieve is a system where AI units are associated with a building (where they spawned at), and that building can't spawn any more units until those ones are dead.
I ended up doing what Sparker suggested but the issue i ran into is that the group doesn't seem to become grpNull when all the units are dead? the corpses still say they belong to the group for example.
Not sure why that happens but I think i'm just going to have to check if there are any units alive in the group and then go with that.
are you trying to have 'waves' spawn out of the building pritchard?
@errant patio
when you spawn the group (assuming bis_fnc_spawngroup?) in the next line you can run the deleteGroupWhenEmpty command. If you make you're group global you could have a trigger condition set to check if there are any units in the group via a count, once dead it runs the script / code again. Or see if the group is null
to spawn another group
trigger activation:
spawnedGroup = [(getPosASL thisTrigger), EAST, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfSquad")] call bis_fnc_spawngroup; spawnedGroup deleteGroupWhenEmpty true;
trigger condition:
(count units spawnedGroup) == 0;
Its a bit quick and dirty and is only for a CSAT squad but it should help you get started hopefully. I'm not toooo sure how it'll handle being in a building cuz this is based on trigger pos
ah, at the moment i use creategroup + createunit but that's going to be expanded on a lot in the future probably.
I'll try using the deleteGroupWhenEmpty command anyway since i think it should work?
Of course, I need to clean up corpses properly too.. should be interesting :/
it's all a bit of a mess due to a lot of complicated stuff going into spawning these units (populating an 'open world' mission)
your way is better for cusomtisation if thats what you're after, mine uses set group from config
can groups be defined in mission configs? in the end this might end up being an addon rather than just a mission since i want to define my own units but.. that's a ways off lol
im honestly not sure, are you trying to mix say csat with FIA to hunt down players or something?
btw, edited my original trigger setup, just tested and when one group is deleted it creates a new one BUT they spawn in formation so unless you got a big building they'll be outside
right now the groups only have a single unit but i'm not planning to use formations.
The units atm are just from the Looters faction and so potentially i want to create a faction in the same vein but with more diversity in equipment
someone know why when i join my server i dont download all the file and the map
@errant patio dead units are not instantly ungroupped as I know
Did you wait for a few minutes at least?
yeah using cursortarget i noticed that.
I have to admit i haven't waited that long probably. I tried setting the GC to some extremely low settings too but it didn't seem to work either :/
Excuse me, when players throw down specific equipment, they can not be picked up or disappeared. How to write this code? Thank you!
@acoustic iris check your logs? any errors or anything?
@errant patio You could make something that loops every 5mins or maybe that deletes groups with dead ai in. For a custom faction, I would recommend Drongos config generator. Its easy to use but will make it an 'addon'. The long was is do as you're doing with create units then apply loadouts with add weapon etc
Amazingthegay, im not sure arma deletes objects by default of GC is turned off? could be wrong though
i already have the FSM for spawning running on a loop. Maybe I can extend it to work on dead units and their groups to clear them :O thanks for the idea
@plain raven I see my logs but i don't find the error ( sorry i'm beginner on arma 3 server ) https://pastebin.com/dSMxzg6b
yeah so if you're spawning those groups, you should store them somewhere (in an array maybe?) then you can access them for other stuff such as deleting when empty, providing your array isn't too big you could just periodically iteratet through it and check each group. Bear in mind, you're returning a group so you can check if its null (which as sparker says isn't automatically done) BUT you can't check if the ai in the group are dead, for that you can use the units command which will return any units of the specified group (see wiki), then as i've done do a simple count to make sure its == 0
@acoustic iris I can't see anything in that one I'm afraid and I've never played a life server, can you PM the server logs maybe?
make sure it has no sensitive info in it like passwords etc
yeah, i'll have a look at what works. trying to make sure nothing i do kills performance lol
i know that feeling!
Anyone up in here sitting on a Jeroen Limited Arsenal script where the ACE Misc items are where they should be?
interesting thought - would it be possible to write a script that adjusted the mass of a vehicle based on its cargo (items etc.) load? Thinking about the conversation in the feedback tracker chat
...would it be a good idea though π€
not for planes
heh, i suppose not. I do wonder if some vehicles would struggle even more to get up slight inclines though. I can't say I like the idea of making that more annoying :/
AFM does take the weight of passengers though
ah dang. im gonna have to test this now aren't i lol
that's the issue with Arma scripting, you just have to Β―_(γ)_/Β―
hehe, yeah. I've been on a bit of a binge lately, made an addon (which i really need to polish up and release..) and now the mission i've been working on... it's very addicting.
okay. arma vehicle physics are really broken with tiny mass values lol
Okay, i figured out why no one has bothered to do it yet - there doesn't seem to be an easy way to get the loading other than taking each item and checking its config :/
Someone can help me about spyglass
i have a question regarding vehicle loadouts. so i set pylons 4-6 on a gryphon to contain shrieker pods. my problem is that the wepons normally used on those pylons still show up on the top right corner. altho not being on the vehicle
hope this is the right channel
Hello guys!
Anyone knows how to reset player animation after being unconcious in a car?
with fixed wing we can script camera orientation, reset direction, azimuth, lock, etc. is there an analog to this for rotary asset gunner positions?
mainly what I want to do is, when the gunner gets out of the rotary asset, I want to reset the turrent (?) i.e the AH-1Z, camera (?) i.e. the CH-53 or UH-1Y, whatever that happened to be, to a nominal forward orientation.
/*
* Argument:
* 0: Action name <STRING>
* 1: Name of the action shown in the menu <STRING>
* 2: Icon <STRING>
* 3: Statement <CODE>
* 4: Condition <CODE>
* 5: Insert children code <CODE> (Optional)
* 6: Action parameters <ANY> (Optional)
* 7: Position (Position array, Position code or Selection Name) <ARRAY>, <CODE> or <STRING> (Optional)
* 8: Distance <NUMBER> (Optional)
* 9: Other parameters [showDisabled,enableInside,canCollapse,runOnHover,doNotCheckLOS] <ARRAY> (Optional)
* 10: Modifier function <CODE> (Optional)
*/
Can someone better explain params 6-10
The action is a returned array from the frunction ace_interaction_menu_fnc_createAction (func name iirc) and position is a position from the target object, either [0,0,0] of the model or a selection name as a string or a position [2,8,0] from origin of the model. Distance is the distance between you and the object for the action to be sown. Other params are the ones there and 10 is a function that will modiy this action, like the icon or the name
How do I close someone's inventory when they open a crate? I already added an event handler to listen for when they open the crate and tested it works fine but I've tried deleting the display and other things but none have worked.
Tried closing Display not dialog
Trying this
params ["_container", "_unit"];
closeDialog 1;
}];```
Not working
Works with this, but I wanna make it so when someone opens a crate it closes automatically
sleep 3;
closeDialog 1;
};
[] spawn test;```
You could add an eventhandler for InventoryOpened and just breakout if it's a crate.
Well I'm wanting it for a specific crate
Yes?
Correct.
Type or by variable. It's a vehicle so, in would work fine with the class if it was for a certain type.
Alright
@tough abyss do you want the player to be able to use his inventory, but not a crate?
Yeah.
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#InventoryOpened
and if the box is not objNull, override the inventory
Alright
Should i use CursorObject or CursorTarget to get units and vehi? looks like it's easier to get object with CursorTarget.
cursorObject is better (targets trees, bushes, etc and is no different from cursorTarget for other things)
it's "easier" maybe because cursorTarget uses a bigger "hitbox" idk
@winter rose
I see some notes on Wiki for CursorTarget like enemy units will not be detected that is not true right?
why would it be false?
they will be detected when the player know about them, aka "declared" them with T
really, just use cursorObject @tough abyss
Seems to work fine will switch to CursorTarget, like u said hitbox seems to be a bit bigger.
Β―_(γ)_/Β―
Is there a way to force lower weapon on a player via script? we have dragging func on the server and when the player is looking down scope before dragging, they cant walk backwards once animation changes.
@exotic tinsel ```
player action ["WeaponOnBack", player]
This will lower the weapon of the current player.
source: https://community.bistudio.com/wiki/action
@exotic flax Thx mate!!!
@exotic flax actually thats not what i need. i want them to be able to have gun up while draggin backwards. which they can do now, but issue is when they are looking down sight before drag animation plays they cant walk backwards. so before i play the animation on them for dragging, i need to zoom them off their sight so they can walk backwards.
@hot kernel reading now
maybe like this?
player action ["SWITCHWEAPON",player,player,-1]
gonna test now
i am trying to use ussrlongbow's chatcom script where it would execute commands by calling it via in-game chat.
class commands
{
class t100
{
code = [East, 100] call BIS_fnc_respawnTickets;
};
};
this works fine but how can i change the number 100 in [East,100] to any number that i want. I am guessing i have to put some string in there but i have no idea how.
eg. by entering t356 via in-game chat, it would add 356 ticket
and by entering t1573, it would add 1573 ticket.
i know i can make it a fixed number for every command but i would like to have the flexibility
https://sqfbin.com/xobokarirugupizurosu This is the code in fn_ontake item that restricts players to pick up equipment. I changed sab_CUAV_Terminal here to other class names (clothes, hats). But when I entered the game, the name of the specified item class was invalid. I can still pick it up. Where did I go wrong?
i'm confused. isNil is the right way to test if a variable is defined or not, right? so...
_group = _groupNetId >
17:00:49 Error position: <_groupNetId) then{
_group = _groupNetId >
17:00:49 Error Undefined variable in expression: _groupnetid``` how am I getting this error??
Yeah best advice is double read the wiki
isNil is an especially tricky one that can also "fail" silently
Yeah... I think I probably need a better solution than this but I'm not sure what it's going to be yet.
@errant patio if you need a net id even in SP, you can use BIS_fnc_netId
(I don't know if this is your goal though)
i already am, this is for retrieving the group from the net id
if !(isNil "_groupNetId") then{
_group = _groupNetId call BIS_fnc_groupFromNetId;```
etc
it's not code-breaking afaik
sqf is pretty lax with whitespace but good catch
where is first defined _group ?
_buildingsWithExpiredSpawns = unitBuildingIDs select {time - (_x select 1) > _maxLifeTime};
{
_building = _x select 0 call BIS_fnc_objectFromNetId;
_groupNetId = _building getVariable "spawnedGroup";
if !(isNil "_groupNetId") then {
_group = _groupNetId call BIS_fnc_groupFromNetId;
if !(isNull _group) then {
_building setVariable ["spawnedUnit", false, true];
_building setVariable ["spawnedGroup", nil, true];
{
deleteVehicle _x;
} forEach units _group;
deleteGroup _group;
};
} else {
_building setVariable ["spawnedUnit", false, true];
_building setVariable ["spawnedGroup", nil, true];
};
unitBuildingIDs deleteAt (unitBuildingIDs find _x);
sleep 0.1;
}
forEach _buildingsWithExpiredSpawns;```
have you heard of the private keyword our Lord and Saviour?
:P
i will definitely have to polish a lot of things up, that's for sure
https://www.youtube.com/watch?v=W1gNYbnpIts here is where it's at functionality wise now, not 100% but decent.
btw. who is the actual maintainer/hoster/owner of http://sqfbin.com ?
See, if you click on my name... magic:
https://i.imgur.com/4dzYrF6.png
that actually is only rly working if you are at the desktop @finite dirge π
Someone know how i can edit the difficulty " custom " ? π http://prntscr.com/p6v3jp
Yeah, it shows on the side, but I'm a regular user in this discord, so you'd have to scroll like mad 
@acoustic iris The server's profile.
also that would be #arma3_config @acoustic iris
Oh okay
private _arr= [ ["assertTrue", { [] in [[],1,2,3] }],
["assertFalse", { [] in [] }],
["assertFalse", { [] in [[123]] }],
["assertFalse", { [] in [1] }],
["assertTrue", { 1 in [1,2,3] }],
["assertFalse", { 1 in [2,3,4] }],
["assertFalse", { 1 in [[1]] }],
["assertFalse", { 1 in [] }],
["assertTrue", { false in [false] }],
["assertFalse", { false in [true] }],
["assertFalse", { false in [1,2,3] }],
["assertFalse", { false in [[false]] }],
["assertFalse", { false in [] }],
["assertTrue", { "abc" in ["abc",1,2,3] }],
["assertFalse", { "abc" in ["ABC",1,2,3] }],
["assertFalse", { "abc" in ["",1,2,3] }],
["assertFalse", { "abc" in [["abc"]] }],
["assertFalse", { "abc" in [] }],
["assertTrue", { "abc" in "abc" }],
["assertTrue", { "abc" in "zzzabc" }],
["assertTrue", { "abc" in "zzzabczzz" }],
["assertTrue", { "abc" in "abczzz" }],
["assertFalse", { "abc" in "ABC" }],
["assertFalse", { "abc" in "zzzABC" }],
["assertFalse", { "abc" in "zzzABCzzz" }],
["assertFalse", { "abc" in "ABCzzz" }],
["assertFalse", { "abc" in "" }],
];
{
private _res = [] call (_x select 1);
if (_x select 0 == "assertTrue" && !_res) then {systemChat "invalid test: " + str (_x select 1);};
if (_x select 0 == "assertFalse" && _res) then {systemChat "invalid test: " + str (_x select 1);};
}foreach _arr```
can one confirm this? (feel free to add testcases if you feel like one is missing)
aaah, it requires the latest dev
], ]; really?
10/10
sqf-vm supports [[],]?
what about
[
[";slkd ; lskdsakd ;sakd "],
]
I can confirm some old reports of playSound3D not being global any more
]
^
[ERR][L3|C0|] Expected BINARYEXPRESSION start.
repro @astral dawn
playSound3D ["A3\Sounds_F\sfx\alarm.wss", objNull, false, (AGLTOASL _pos), 20, 1, 1000];
well, it's a copy-paste, hold on
@finite dirge and the example @queen cargo posted compiles fine?
Nope.
issue is, I am currently running an in-game-hosted server and I can hear the sound there, but when I switch window to a client which has joined the same server, I can't hear the sound any more
volume: Number (optional) Default: 1 Maximum value: 5 (limited since A3 v1.91.145537)
you have 20. it will not be capped at 5
I think it wont just play period
Yeah looking at that too.,.. let me try!
Ha yeah you are right, it plays on both if volume is within the range
And it only plays locally if volume is over 9000 5
Make a note on biki
Me?
you
I have no rights, so please, someone else π
You gotta fight
For your right
To eeeeeeeeediiiit
I'll do it as soon as Lou bugs Dwarden enough to make me an account 
@finite dirge what sqf-vm for [123] in [[123]] should be true
[WORK] <BOOL> true
cool
never said my example compiles fine π
it is literally draft-code
for the test-cases
of SQF-VM
aka: SQF-VM is not yet producing expected results (maybe)
anybody got any ideas to why the variable isn't working? been trying to figure this out now for awhile.. thanks for any reponses
{
Params ["_unit", "_killer"];
_clientID getvariable ["cash", 0, true];
_clientID = owner _killer;
_killreward = 50;
_playerfunds = _playermoney + _killreward;
_killer setVariable ["cash", _playerfunds, true];
[Format["Player Wallet: $%1", cash]] RemoteExec ["hint", _clientID, false];
};
/////////////////////////////////////////////////////////////////////////////////
While {true} do
{
{
_unit = _x;
_EHID = _unit GetVariable ["killedEHID", -1];
if (_EHID == -1) then
{
_EHID = _unit AddEventHandler ["killed",
{
Params ["_unit", "_killer", "_instigator", "_useeffects"];
[_unit, _killer] Call ControlPlayerCash;
}];
_unit SetVariable ["killedEHID", _EHID, false];
};
} ForEach (Allunits Select {!(IsPlayer _x)});
sleep 3;
};```
which variable?
the cash variable
sorry should have made it more clearer
if i kill somebody, it says player wallet: $50 but doesnt carry it on
so it always remains $50
when i check it it comes back any
you mean the function ControlPlayerCash, which doesn't exist within the eventHandler (since it's a separate script)
it would make more sense to make it a proper function through CfgFunctions, so it will be available everywhere
@tough abyss where did you define _playermoney ?
He doesn't. Which is part of his problem
line 3 should be
_playermoney = _clientID getvariable ["cash", 0, true];
and I would exchange line 3 and 4... otherwise _clientID isn't set
Clientid is a number? You canβt getvariable from a number
bad copy&paste also doesn't work π€£
btw... I came here for a question too...
is there a way to add an init event handler to all children of a specific class (eg. add an EH to all units under Tank_F)
@finite dirge on it
i got given the code about.. 2 weeks ago i've just tried to work off of it since
By script, no @exotic flax
would it help if i got you the original ?
@tough abyss it also doesn't seem to work with Extended_Init_EventHandlers, unless I add each class manually...
I dunno about modded solution they might be one or might not
damn that playermoney wasnt even set fuck my life
thanks i'll try this out
kk so i tried doing those changes
ControlPlayerCash =
{
Params ["_unit", "_killer"];
_clientID = owner _killer;
_playermoney = _clientID getvariable ["cash", 0, true];
_killdistance = _unit distance _killer;
_killreward = 50;
_killtotal = _killreward + _killdistance * 1.5;
_playerfunds = _playermoney + _killtotal;
_killer setVariable ["cash", _playerfunds, true];
[Format["Player Wallet: $%1", _playerfunds]] RemoteExec ["hint", _clientID, false];
};
now i'm getting this error
line 10
Error Generic in expression
line 10 is the _playermoney = line
Yeah, you are trying to getVariable on a⦠number
It's (maybe) _killer getVariable ["cash", 0]
Yeah
And no need for ["cash", 0_, true_]
awesome
not sure what i'm doing wrong
its like the variable isn't attaching to the player
i have all this in the initserver, should i have the first half in the initplayerlocal? its just returning 0 for the getvariable
Can someone assist me with spawning triggers on markers via scripts?
_trigger = createTrigger ["EmptyDetector", getMarkerPos "marker_name"];
_Spawnmarkersfortele = true;
_Respawnmarkerarray = ["ModuleRespawnPosition_F"];
if (_Spawnmarkersfortele) then {
{
if (typeOf _x in _Respawnmarkerarray) then
{
respawnMainBase = createMarkerLocal ["respawnMainBase" + str(_forEachIndex), getPos _x];
respawnMainBase setMarkerShapeLocal "ICON";
respawnMainBase setMarkerTypeLocal "mil_circle";
respawnMainBase setMarkerColorLocal "ColorGrey";
respawnMainBase setMarkerSizeLocal [1,1];
//this V is the attempt to make a trigger
_markersfortele = createTrigger ["EmptyDetector", getPos _x, true];
_markersfortele setTriggerArea [55, 55, 0, false];
_markersfortele setTriggerActivation ["NONE", "NOT PRESENT", true];
_markersfortele setTriggerStatements ["this", "hint 'test';", ""];
//this ^ is the attempt to make a trigger and it isn't working.
};
}
forEach allMissionObjects "All";
};
Thats what i'm using atm
It's meant to be plopped ina mission which has respawn markers, it then finds all of em, places a marker on them, the goal of that is to then place a trigger on the marker for a fast travel script, so i don't have to modify this guys fast travel script. and that way I don't have to place a trigger and a map marker under all of my respawn markers as intended.
I've got the feeling the triggers ARE created, since nothing seems to be wrong here (unless the position of the module can't be found).
The only thing I can think of without testing is that the trigger is never triggered because the activation is set to "NONE".
Hmm
I gotta see what he's doing to make the triggers have that mouse over effect on the map screen.
well... triggers don't work on the map screen... they only work in-game
weird
can i pm you?
I wana show you the script i'm trying to make this script for.
I'm far from an expert on this topic π€£
however, if I use:
_markersfortele setTriggerActivation ["ANYPLAYER", "NOT PRESENT", true];
I do get a hint after I spawned on a respawn marker
so the trigger is created (and working with the correct settings)
i'll try that but the dudes trigger activation is set to type none and activation to none
but then the trigger never fires, unless it's done with an external script
I wish I knew how his script was working, it would determine how I go about this I suppose. It somehow makes the markers on the map screen have interaction and clicking them fires off a gui
ahh actually your triggeractivation worked
but this time i also put the script that is in the trigger in both fields of the setTriggerStatements
Ty m8
no problem
{
Params ["_unit", "_killer"];
_clientID = owner _killer;
_playermoney = _killer getvariable ["cash", _playerfunds];
_killdistance = _unit distance _killer;
_playerfunds = _killdistance + 50 * 1.5;
_killer setVariable ["cash", _playerfunds, true];
[Format["Player Wallet: $%1", _playerfunds]] RemoteExec ["hint", _clientID, false];
};```
i'm getting $75 no matter the kill and it's still not adding.. anytime i get the variable it's just returning 0 after any kill too
not sure what i'm doing, i think it might just be fucked
even if theres another money system i can use at this point i'd be down i've been trying to get this done for 2 almost 3 weeks
@tough abyss , add a systemChat after _killdistance to see what it is? Like,
systemChat format ["%1", _killdistance];
it's returning with nothing
I think i'm going to call quits with it - I should have tested it first before making a whole mission around it
thanks to everyone that helped
Excuse me, I use player addEventHandler ["Take", {this call UnionClient_system_onTakeItem}]; if (EQUAL (_item, "sab_CUAV_Terminal") & & license_civ_press) & then{
[_item] call UnionClient_system_removeItem;
Hint "UAV data for media use only";
}
I changed sab_CUAV_Terminal to other clothes or helmet, and added if the sentence below, but it did not work. Players can still pick up the corresponding equipment. Can anyone help me? Thank you very much!
What's the best way to stop MP Synchronization behaviour?
is there a issue running almost everything in an arma mission on the server? ive gotten into the habit of making everything that could easily be cheatable being performed on the server thanks to UE, but im wondering if this is bad to do in arma due to the load being put on the server.
for example a weapon shop. i use setvariable on the server for each connected player and keep the variable local to just the server so any money earned/lost is performed on the server. when a player tries to buy a weapon i have the client call a function on the server that tests to see if the player has enough cash, if so then it does everything else accordingly. i know something like that does not really put any stress on the server, but what im wondering is if going this route is good practice in arma or should this stuff just be done on the client
@errant patio what do you mean?
Take for example fog. It's automatically synced over the network in A3 when in the past it wasn't. I'm wondering if it's possible to get that old behaviour back somehow
Log? π€
Ah sry I just woke up :D
It's okay lol
Personally I have never seen anyone disable synchronization of such things, or even want to do that
heh
i already do it with time in a rather clunky way in my mission, to allow players to be in properly dark indoor areas while others are outside in daylight. But it's really jank (onEachFrame EH to setDate) and doesn't work in 100% of cases
so i've been wondering if it's possible to do it any other way
But if fog is not synched then players with less will have a combat advantage over others. If this is for a COOP mission it is even worse for immersion
yeah fog isn't a great example. Time works better
Anyway. Since ARMA 3 weather is global
setTime is a function? I use setDate
Yeah. I meant skipTime
ah right. anyway yeah it's pretty janky.
SetDate has local effecf
it's also synched, it's just.. a weird command
Has to be executed on each client that you want, not the server though - at least from the biki and its notes. Never tried it
Yeah. Unfortunately, that's the biggest caveat of my system
it only works correctly in singleplayer games where you can't see it 'not' working, and games on dedicated servers
So if you have the code running on a server remoteexec to the specific clients
if it's player-hosted it's going to be set on the 'server' when they host player is under the effect of my script
and so people outside suddenly find themselves in night time
Remoteexec on the clients affected or run the code on the client not server
? that doesn't really seem to be different
the problem is that the server is also a client
Doesmt matter Other than JIP. Effect of the command is local
I am surprised that it is not server side and global. But it is not
Don't run it on the server though.
it's not really local. that's why i said it was weird before. The biki itself mentions that it 'seems' to get synced and it does, just not instantly like a normal global command.
My code works by running setDate on clients that are standing inside a trigger. The server in a dedicated environment thus never has its date tampered with
Based on a note on the wiki page which is easy enough
Unfortunately, in a server that's hosted in game, there is a client that is also the server (the host). When the code is run on them and their date value is set, it's then propagated later by the game
It does not matter what the server thinks from the biki. If isDedicated don't run the code
e_e
You can combine that with if !hasInterface don't run it either
it runs perfectly on the dedicated server lol, it's player hosted that breaks.
Anyway yeah I could stop it from running if isServer is true for the client it's trying to run on, they'd have a much crappier looking bunker but for other players it'd be alright
Yeah. Unfortunately that would be true. You'd be fine with a dedicated server or the server running on a PC for someone who was a Zeus and not bothered
mhmm. and so... square one :p
if i could stop the server from ever propagating the variable it'd be great but i'm not sure that's possible, nothing anyone has said seems to suggest so at least
You cannot if the comment on the biki page is correct. Which it seems to be. That page needs updating to reflect that
Using isServer and having one person who knows not to go inside is better than all affected thougg
yeah. can't really tell people not to go inside since it's the central hub area of the mission but it's probably still better
indoor area is also a safe zone thankfully lol
i do set the year, as far as i know the issues it has according to the wiki shouldn't affect me
I'm looking at the last comment on the biki setDate page. Have you looked at those comments?
yeah.
It suggests that if you don't set the year it is not global from the server. Old comment though
And odd too. That page needs some love
since i never setDate on the server itself i'm not really affected.
But you just said that the server is a players PC yes?
Otherwise we were done at if isDedicated don't run the code
I took your advice and told the script to not run if it's the server client
so now it only ever runs on clients
where it is local
Cool.
But if the server is a player's PC you might want to see whether that comment on the biki saying not setting the year on the server (or anywhere) does fix your issue
And let us know so the biki page can be properly updated
i tinkered with that a while ago and it's just the year itself that doesn't get set. it still syncs other fields
and i'm still waiting on my biki account from dwarden :v
Me too LOL
WTF is it really true that we can add specific item types to a cargo box but can not remove specific item types?
https://feedback.bistudio.com/T76533
you can, but all at once
So I can remove all FAKs from a crate at once? (for instance)
ah nvm, I forgot that my items are actually magazines
And for magazines there are such commands
it's not impossible to achieve the desired effect but it is very inefficient :/
@astral dawn it's not possible to remove specific items from containers.
I looked into that while doing addWWACG but it's not really doable sensibly
my solution would be to get the cargo of the object, manipulate that array and then clear + add back everything (with your changes of course)
But it isn't something I would want to do often during a mission :/
Also, what about half-used mags? :)
what about them? You can get/add them with their ammo count
which one to remove then?
clearMagazineCargoGlobal
We talked about removeOneMagazine
If you use it without other arguments than just the classname, what does it do, remove the first one it finds, the first full one, the first not-full one, etc
If you add the ammo count parameter, does it take the closest one to the ammo count, etc
If you wanted to make a script that worked like that, sure. You can do literally anything to the array here before you add it back:
https://community.bistudio.com/wiki/magazinesAmmoCargo
If you use it without other arguments than just the classname, what does it do, remove the first one it finds, the first full one, the first not-full one, etc
neither of any of these. Read the wiki :U
As I said, not viable
Read the wiki :U
NEVER!!
anything's viable with enough bruteforcing >_> hides inventory database system
That's what I mean, for such a command to work it would need some overhaul that is not going to happen
I suppose
:p
I can make something that'll work, but you wouldn't want to use that
π
anyway. i had a question a while ago that im still stumped on.
I have a loot spawning system set up in my mission, that checks if a building is inside a trigger with a specific triggerText to see what kind of loot it should spawn.
It works, but would require me to pretty much cover the map in triggers, which isn't exactly ideal for portability or just... anything, really.
Something I've been wondering, if you had a similar problem, how would you tackle it - ideally without something that's part of the mission file itself
framerate suddenly drops 20 FPS
- hey what happened?
-β¦I took a magazine from a box
I had the idea of something like a heatmap that the map could look up, with pixel brightness indicating loot quality
duh it won't drop if you run it in execVM
but i don't think it's possible in sqf
@errant patio transparent markers with some colour?
Still in the editor, sadly. And triggers work better if you're working in the editor
also, triggers bad
yeah i know :p i made the ones i had up to now as basic as possible - not repeatable and condition {true}
Well, you are forgiven for this⦠for once.
Thy shalt read Code Best Practices twice and Mission Optimisation thrice to find salvation
also, triggers bad
You keep misinforming people but I donβt understand your agenda
I am paid by the SQF lobby, that's why
i assumed you disliked them because of how many frames a complicated Condition check can cost lol
because of their check every 0.5s and their unscheduled execution
Anything can be abused
Well let me tell you a secret, this is how the game works, it simulates shit every frame and does tens of thousands checks every frame. Triggers are only checked once for every 30 to 50 other frame checks. And they are engine checks. Of course if you start dumping your entire mission code in trigger conditions it is not going to help but there are plenty of other stupid things you can do to make your mission extra special
Can't tell a beginner to build their own custom scheduled/unscheduled loop with some advanced SQF stuff just because "trigger bad"
No trigger not "bad"
Trigger bad if abused, just as everything else in life
sometimes you just want to use inArea and you're lazy :v
Maybe i should write a tool to let me draw polygons outside of the game and load them up in the mission... then inPolygon :v
Let me tell you a secret, triggers are not bad per se, but usually people don't really need them. And people that use them, well, most abuse them.
So I invite people to tread with them carefully.
Otherwise, you end up with a mission that has 120+ triggers and cry about performance and "this shitty game"
No, though importing that would be a fun challenge lol.
I mean. I have a map for my mission that is 8192x8192.
I want to cover that entire map in regions where different kinds of objects will spawn.
How do i define and store those regions in an efficient way?
I already use inidb2 so if I created polygon coordinate data in the right format for the game I could load it up easily enough
How do i define and store those regions in an efficient way?
polygons and inAreaArray
Does inAreaArray support polygons? i didn't think it did
Depends on what kind of areas and how many and how often you need to check. A simple coordinate with radius is easy to store quick to check
mm. I should probably start by doing that at least, to be fair. I can worry about how to generate them later
@winter rose triggers simulation can be disabled on per trigger basis making them shapeless inert local objects that are not worse than a simple object thus taking no resources until you activate them. I can argue that putting 120 units is bad for performance and much worse than 120 triggers but I donβt see you telling everyone units are bad
because people tend not to see triggers are potential performance issues, units, they get that
also because there are way better ways to run scripts than triggers, that too
also because easily 90% of trigger usage I see is replaceable by simple sqf/awful usage
as I said,
triggers are not bad per se
But there are no issues with triggers unless you abuse the condition and even then you have to really try, much more than the shit people dump in addAction
but I donβt see you telling everyone units are bad
I invite them to use agents wherever full AI is not needed, though
if you tell a beginner he should not use triggers, he will use a even worse script instead
while I may have a bias towards triggers given the support I do, is it fair to say that it is worth giving a big warning about them?
I think you should stop being biased and leave the triggers be
may
so to you, triggers are fine with their 0.5s and unscheduled execution? I feel it's like giving a handgun to a baby.
Yes they are fine 0.5 sec makes a lot of difference
I mostly loathe the unscheduled code. Big conditions / big area triggers are expensive
note to self: next time you want your problem solved, don't mention your stopgap solution as well or people will just start debating scheduled/unscheduled code π
There is no difference between unscheduled code and scheduled code in terms of performance or usage of system resources. The only difference is that one allows to run up to 3ms and another until it is finished. Loath spawn while true sleep if you want to hate on something
I have loads of hatred towards bad code, and I don't miss targets
:p
Big conditions / big area triggers are expensive
correct, but that's just expensive in general, not the triggers fault
There is no difference between unscheduled code and scheduled code in terms of performance or usage of system resources.
There is. Unscheduled code doesn't check the 3ms timeout constantly, scheduled does.
yeah, but not significant
it's not the trigger's fault, it's the trigger usage that makes it so. Again, I don't blame the trigger itself but how most people use them
"let's place a trigger that's as big as the map" (looking at you BIS_fnc_IdontRememberTheName) "and let's trigger it when there are less than 3 opfor left"
that's not the trigger's fault; but triggers are usually the sign of someone not knowing how to do it
(I don't screech when I see a trigger in the editor, don't worry)
big area triggers are expensive
area size makes no difference. Checking if a unit is in trigger area is the same for small area or huge area
area size makes no difference. Checking if a unit is in trigger area is the same for small area or huge area
it does. Trigger collects all units in area into thisList, and also checks side and such
2 years ago that atleast was the case when I investigated some performance troubles with huge trigger areas
could have been some other issues
triggers not linked to anything, triggered by SIDE may be the ones that have the issue
well, some more testing is required I suppose.
would inArea be more efficient than a trigger? :\
I don't know what that has to do with triggers
a trigger checks a condition every x frames...
inArea is a check if a position is in a trigger area, in a marker area, in a location area or in a custom area.
i need more sleep
You can use a trigger to define the area for a not often checked inArea used in a script.
You can use inArea, because it is more specific to what you want to do.
Only want to check for players? use allPlayers.
Only want to check every 5 seconds? sleep 5
With a trigger:
Only want to check for players? let the trigger check all units first, and then filter players out afterwards
Only want to check every 5 seconds? well outta luck. 0.5 seconds is what ya get
yeah. i think at this point my key problems are how do I create a system that lets me define a lot of areas and tie some variables to them
since essentially what I need is to be able to tell the game which loot table from the config to use, where
For your case, where you have lots of areas and stuff to check. It makes more sense to just script it, instead of creating a bunch of triggers
in script you can just iterate through your areas
Only want to check for players? let the trigger check all units first, and then filter players out afterwards
There is ANYPLAYER
And what does it do under the hood?
@errant patio if you want to just define a specific amount of areas. Use area markers or triggers without anything. This visualizes you the areas neatly in the editor.
Otherwise. Well arrays I guess
this conversation is so long we are now coming in circles lmao
i'll keep brainstorming i guess
Hmm, three random questions
- Do triggers still spend computation gathering the
thisListif you do not usePRESENTor anythisListmode that actually requires it? - Unlike spawned scripts, are triggers guaranteed to be checked every 1/2 seconds?
- Disregarding everything but the condition and on-activation, is the a practical difference between a trigger and a corresponding spawned script with a 0.5 second sleep loop ( and using isNil around the condition check and activation)?
I thought triggers are checked every frame
I thought triggers are checked every frame
no
Unlike spawned scripts, are triggers guaranteed to be checked every 1/2 seconds?
yes and no. If the game runs with <1fps then they can't run every 0.5
alright fair point.. Though not sure if I care if my fps is <1
Disregarding everything but the condition and on-activation, is the a practical difference between a trigger and a corresponding spawned script with a 0.5 second sleep loop ( and using isNil around the condition check and activation)?
Well if you disregard everything then no?
trigger gathers object list, then checks condition, and then maybe activates.
If your condition doesn't check object list, you'll still get it
Do you know that you can check if all members of a group are present inside a trigger before activating it, right? But I see countless monstrous solutions for this check that amount to some resource hogging code, while a properly set up trigger would do it in a split second
The available options are specific to the connected trigger owner.
Whole Group - Activated when all the owner's group members satisfy the 'Activation Condition'.
Need to connect to the group then
set it to group yes but connect to 1 member, a player for example
I think this is what Lou was talking about, when you have {,,,} foreach units group yada yada in condition
putting loop in condition is bad indeed
Does the editor lines for "trigger owner" work differently than the lines for synchronization? I know that synchronization lines does not get reset for JIP objects.
How can I get rid of this: The "ACE_" namespace is reserved. Please enable ACE commands in the settings. https://cdn.discordapp.com/attachments/617025956137271316/623469972588462081/unknown.png
I am using Visual Studio Code.
some broken visual studio code plugin that you are using
In the common vs code extension is a setting that you have to activate to allow reserved namespaces
How do I access the settings?
Found it. Thanks for ya help!
Which ones don't I need? https://cdn.discordapp.com/attachments/617025956137271316/623473915015987200/unknown.png
all
Including TOH?
They all "share" commands?
No, I guess not.
Would be weird if they did
So why do I need TOH commands, if I'm just in arma 3?
Didn't say you need them
Also Arma contains some TOH commands. Like the rotorlib stuff
Okay.
Does anyone know of a command that will allow me to limit a vehicles "thrust" Im trying to force a plane to stay still for X seconds without disabling the simulation. Only workaround ive figured is Spawn an invisible helipad on the plane, attachto and detach when ready.
On the ground? defuel, disableAI path, lots of options.
attachTo would be the simplest way to simulate wheel brakes yes
Yes on the ground, and its more aimed towards players than AI
myPlane setDamage 1;``` π
XD
Lol thanks guys just wanted to know if I was missing a command but seems like i wasnt.
Attached plane will have no collisions though
Could try setVelocityTransformation on each frame at the same position
hmm that could be a problem, ill have to try your idea M242
{switch (true) do {
case (player inArea "marker1"): {testActionID = player addAction ["Test action",{}];};
case !(player inArea "marker1"): {player removeAction testActionID};
};
sleep 5;
};
};```
Would need something like that to check (in this case) every five seconds if player is inside the area of *marker1* and then add *Test action* action if true. Now that adds a new *Test action* every five seconds while the player is inside the marker area. Is there a way to stop the function from adding a new action if one has already been added but still continue to check for the second case where player isn't inside the marker area?
Quick question as i have yet to find a solution... Is there a way to get something from the server and await its response, like in c# and javascript? Say I wanted a variable from the server is there a way I can get that? Or say i wanted to run a function on the server and return its result to me (client side)? Currently how i have done it for the past few years is: ClientsideFile1 -> ServersideFile->ClientsideFile2
@grizzled spindle what is the situation that needs this?
That's pretty much the easiest way to do it. remoteExec from client to server and then back to the client. Making your second clientside function essentially a callback. You could use a broadcasted/public variable and then a waitUntil in the first function on the client and then have the server set it and broadcast it, but the loop would make it worse on performance (probably). That would be similar to the promise system of those await functions.
Loads of situations that could use this. Its currently for Altis Life. Lots and lots of data stored ina database and it would be nice to be able to easily be able to get this data without 3 files and having to split a function
You don't need to split the function, just add a param and split the function in half
(Hello Fellow Dirty Lifer)
RemoteExec the same function 2 times with a parameter to tell the function what to run. So three executions, but only 2 files 
Yeah haha, Still doesnt solve my original problem π
Well
It does
but not what I was wanting lol
I did give you the answer on how you do it in my first message. There's no function to just do that.
And it would likely be less efficient.
Yeah, thanks anyway mate π
I guess you want something like this (untested)
RSV_ReadVariable = {
params ["_requestId", "_variable", "_machineId"];
// Read from DB or whatever... Read from local variable space
private _data = missionNamespace getVariable _variable;
[_requestId, _data] remoteExecCall ["OnServerVariableRead", _machineId];
};
RequestServerVariable = {
params ["_variable", "_callback"];
if (isNil "RSV_Request") then {
RSV_Request = 0;
};
RSV_Request = RSV_Request + 1;
private _requestId = format ["RSV_%1", RSV_Request];
missionNamespace setVariable [_requestId, _callback];
[_requestId, _variable, clientOwner] remoteExecCall ["RSV_ReadVariable", 2];
};
OnServerVariableRead = {
params ["_requestId", "_data"];
private _callback = missionNamespace getVariable _requestId;
missionNamespace setVariable [_requestId, nil];
[_data] call _callback;
};
["AwesomeServerData", {
params ["_data"];
systemChat format ["Behold I have the server data now: %1", str _data];
}] call RequestServerVariable;
Oops, RSV_Request should increment.
Yes was just looking at that
Regarding group's waypoints OnActivation; does the code run on every machine, or only on the group owner's?
the script looks like this : USbox setPos ((getPos player) findEmptyPosition [0, 25]);
but its spawing at another player, it needs to spawn in front of me
how to check if a mine was disabled?
@astral tendon if I'm correct a disabled mine simply has its simulation disabled, so you should be able to check it with simulationEnabled _mine (https://community.bistudio.com/wiki/simulationEnabled)
whats the best way to get a vehicle unflipping script to be usable on vics when only they're upside down/sideways?
You have answered your question right in your question
I have a script somewhere which checks if a car or tank is flipped
https://github.com/Sparker95/Project_0/blob/development/Project_0.Altis/Misc/fn_isVehicleFlipped.sqf
coolio
negative vectorUp!
Hi guys! Is there a good way to get a real pixel size of an icon for the drawIcon3d command?
Yeah. The thing is I want to get an icon size (which could vary from 1px width to 100) and set the drawIcon3D size related to the real size of an icon, to avoid rescaling it too much. It's for the healthbar.
Hi, I started to study the editor of the game Arma 3. I began to study script commands. What does the "_" sign mean in scripts?
can you give an example?
Ok
or you mean like thing vs _thing
Oh, thank you, I was looking for this article on this site.
You could have done it before having an answer, it is (really) against the #rules to have the same message in multiple channels (cross-posting) in order to get more attention. But thanks for abiding @abstract idol
I found your channel today, so I will give you questions, get used to itπ
this channel isn't mine; but feel free to ask here as much as needed! π
know that itβs not yours, but thanks anyway for the informationπ
a little up π does anyone know?
Regarding group's waypoints OnActivation; does the code run on every machine, or only on the group owner's?
@winter rose I only tested with a single client and a dedi but they run for all
Are there built-in or BIS-scripted or CBA-scripted functions to just get all items (weapons, mags, everything) of some cargo box in an array form and then pack it all back into the box?
I'm totally lost in all the cargo SQF commands right now
@winter rose However, the condition is the weird one!
oh! How so?
So my setup was that waypoints
- condition true
- isServer or RADIO_ALPHA
- not isServer or RADIO_BRAVO
The radio variables are set by using the radio ingame. The on activation was this:
[judge, format ["machine %1 sees group reached WP #3", clientOwner]] remoteExecCall ["globalChat", 0];
The judge was just a unit for globalChat. For each waypoint I got both machine 2 and 4.
However, I could not advance past both waypoint 2 and 3 unless I activated the corresponding radio.
I would expect one of the, the Server, or the groupOwner to have the deciding role in when I could advance to the next waypoint.
oooh, like conditions are on the group owner's side, whereas effects are global
crazy stuff - okay, stop using waypoints from now on π
Well if it was just the group owner, I as a joining player, should not have to activate RADIO_BRAVO.
And vica versa with the Server and ALPHA
not clarified yet, it was may player's group that had the waypoint
tests needed
Initially, I though okay may the Server does the condition check, and the local client does the check to "advance the waypoint gui stuff - e.g. allow me to receive the next waypoint".. But then waypoint 2 should immediately broadcast the chat from the server at least, but that did not happen.
@winter rose To add, in my situation the units were from the opfor while I and my friend were bluefor so we got the systemchat, I fixed that by just adding IsServer since the code inside the waypoint was not suppoused to run on all machines, only on server.
I added global chat to the condition field and it looks like only the group owner checks... But then why am I not allowed to progress with an not isServer clause when joining a server...?
Looking to learn how to use a Zeus like thing to let players make little bases in my mission.. Is that doable? Like fly around and place some sang bags down within an area?
Just put me in a direction and I'll muddle through all the things and eventually make it work
@errant jasper were you the group leader?
yup
huuuh,strange.
maybe the server hit this condition, the waypoint stays there and you don't "get" the waypoint until it is passed
OR
waypoints are calculated server-side??
wait I am gonna redo the runs.. Looks like the condition handling might have choked on the undefined radio-trigger variables
@winter rose My condition checks were borked... So simply put
- Condition check at group owner only
- Activation on all machines
shouldn't really do sqf after an entire day of reading pages of c++ template errors....
how would I make a waypoint that cannot be completed? Say I want a unit to always "move" to position player (they can't be grouped). If I set the waypoint competion radius to 0, it'll probably just complete instantly,
[SWO_grp, 0] setWaypointCompletionRadius 0;
no probably, that's exactly what happens
or another method of an un-grouped follower?
the answer is probably that I don't want them to "always move" to player position, but rather periodically move to player position under conditions so nevermind, answer is self-evident
a Search And Destroy WP doesn't complete;
but there is a BIS fnc that does make a group "track" another
@winter rose , thanks, the bis_fnc might work
I'll try this some variation of this example,
_stalking = [grp1,group player,nil,nil,{player distance BIS_Heli < 100},"BIS_mrkRetreatMarker"] spawn BIS_fnc_stalk;
@winter rose does this look right?
followPLAY = [group SWO_SA, group Player,5,5,{false},""] spawn BIS_fnc_stalk;
follower/following, 5 sec interval, ~5 meters, {no end cond}, "empty"
Doesn't seem to work in the character init or the debug console. The wiki doesn't explicitly say will follow same SIDE.
β¦what?
[group SWO_SA, group player, 5, 5] spawn BIS_fnc_stalk;```
use that somewhere else than in character unit and it should work @hot kernel , no matter the group sides
sorry, I didn't mean in the init properties I meant in the script that loads the character with attributes. I'll play around with it.
β¦given SWO_SA is a unit and not a group or an empty vehicle, of course
@winter rose , I agree that it should work... but even in the debug console I get nothing. With (unit SWO_SA) or generic EAST or WEST characters.
changing nothing else but embedding it in a while true it works
works perfectly fine for me in the editor.
@winter rose , surely I have configured something incorrectly but it seems inexplicable that the code doesn't work unless,
follower = [] spawn {
while { true } do {
followPLAY=[group SWO_SA, group Player, 5, 5, {false}] spawn BIS_fnc_stalk;
sleep 5;
};
};
Vanilla Arma ?
I have FEMALE installed from Steam Workshop and Seattle but I don't think they should interfere with this kind of thing
the testing is all in VR
[otherGroup, playersGroup] spawn BIS_fnc_Stalk``` and just that worked for me in Vanilla Arma.
using "Group Unit", or straight "Groupname"?
groupName. I can try group unit if you want, but it will simply work as well
I'm gonna load an empty scene and try with only generic characters
that worked as expected. There's no way the character model makes the difference. I must have another issue somewhere. Thanks for helping me troubleshoot. @winter rose
Welp, FEMALE might be on its period (harr harr)
hello party people
the script looks like this : USbox setPos ((getPos player) findEmptyPosition [0, 25]);
but its spawing at another player, it needs to spawn in front of me
.<
the USbox
@austere silo you obviously execute the script locally?
@winter rose , (for the record [otherGroup, playersGroup] spawn BIS_fnc_Stalk, works perfectly in the scenario, thanks again)
noice
what was the issue?
@austere silo no
β player means a different unit on each machine; if you do "getpos player" and it returns another unit, it's that the code is run there
@winter rose , it would seem the problem was with this,
5, 5, {false}
for some reason, because just removing that made it work. Those optional parameters are unnecessary anyway.
β¦no issue with these either, so IDK π
okay...
if you do sqf USbox setPos getPos player what is the outcome?
what's the preferred way to manage an unscheduled loop that has a delay?
to explain what I mean: I want to add a number, wait half a second or so, add another number
it feels like using something like cba waitandExecute is sort of excessive
maybe perframe handler with the delay?
it feels like using something like cba waitandExecute is sort of excessive
no it's not. That's the best way, most efficient way.
rgr that
This CBA thing is a per frame handler.
Although, it might be implemented not to run all the checks at each frame or not, I don't remember
depending on the delay, waitAndExec is more efficient
PFH checks the delay every frame, WAE doesn't
what does WAE do
keep sorted array sorted by time they execute
Hey guys!
recently I created a function that will check if the player have a unit tag on them, If they dont they will be kicked from the server with a "endmission"
So everything works as it should but I wanted to reduce the files needed for mission makers to get it to work by simply keep it as a function and run it from a postinit. (so I dont need a init.sqf, initplayer, initserver etc... And that sorta works unless one thing is weird. as it is right now the missionmaker only needs two files. mission.sqm, a description.ext and the folder with the function.sqf
The problem
If one or two players join a dedicated server with this function and at the same time the mission starts, everything works, but the loading takes alot of time..
BUT if more players join the first time before the mission have started lets say 5 players go from lobby -> download the missionfile -> loadingscreen
the players will be stuck on the loadingscreen and nothing will happen.
I went around the problem by start the mission with me as the only client and then the players could load in by JIP.
I belive the Postinit function is causing this problem somehow and thats why I seek your help here.
Below is the description.ext and the function, Thanks.
Description.ext
class CfgDebriefing
{
class End5
{
title = SPG Mission;
subtitle = "";
description = You have to wear the SPG tag to take part of this mission;
pictureBackground = "scripts\spg\spg.paa";
};
};
class CfgFunctions {
#include "Scripts\spg\enforceTag.hpp"
};
enforcetag.hpp
class KLTEnforceTAG {class EnforceTag {class postinit{postInit = 1; file = "scripts\spg\enforceTAG.sqf";};};};
enforcetag.sqf
if (isserver) exitwith {};
if (hasInterface) then {
UnitTag = ["-SPG-"];
private ["_unit","_SPG_member"];
waitUntil { alive player };
sleep 1;
_unit = player;
_SPG_member = false;
if ( !isNil "UnitTag" ) then {
if ( count (squadParams _unit) != 0 ) then {
if ( ((squadParams _unit select 0) select 0) in UnitTag) then {
_SPG_member = true;
systemchat "Welcome SPG member!";
};};};
if ( !(_SPG_member) ) then {
sleep 1;
if ( alive _unit ) then {
endMission "END5";
};
};
};
for description.ext and *.hpp, use ```cpp , cleaner
waitUntil { alive player }; β might be your issue, idk
waitUntil { alive player }; there's your issue. You can't do that in postInit.
you need to spawn your script.
Also don't use private array. Use private keyword instead.
UnitTag = ["-SPG-"];
// converts to
private _unitTag = ["-SPG-"];```
(unless it is used elsewhere of course)
oh alright, thanks guys! π no its just used in this function. you guys are awesome cheers!
w00t w00t
It is postInit script, why would it block everything? It will just go into suspension until player is alive
Would this still work if I simply remove the waituntil {alive player}; ?
Or will the game recognise the tag even tho the player is not alive?
player might be objNull, squadParams on objNull will not work
just put a spawn around everything
PostInit scripts are launched from init functions in their own spawned scope
ah right, so the spawn wont block everything? since itΒ΄s gonna be runned "external" ?
PostInit scripts are launched from init functions in their own spawned scope
correct so?
initFunctions waits till they ran through. To end the loading screen
if your script never runs through. endless loading screen
@obsidian violet exactly, as after the spawn the script returns immediately
Cool, thank you π
Since when spawned script can halt everything, unless of course it performs impossibly long command?
it doesn't
Noone said it does
the players will be stuck on the loadingscreen and nothing will happen.
That's what happens.
Initfunctions can be suspended?
postInit is spawned from initFunctions, and initFunctions keeps loading screen open till they are done
Sounds like bad design
_SpawnEnforceTAG = [] spawn {
if (isserver) exitwith {}; //Deactivate this line for debug. Makes sure the script doesnΒ΄t run while you edit your mission.
if (hasInterface) then { //Runs the script on all clients but not headless clients.
private _unitTag = ["-SPG-"]; //The Unit tags that are allowed.
private ["_unit","_SPG_member"];
waitUntil { alive player };
sleep 1;
_unit = player;
_SPG_member = false;
if ( !isNil "_unitTag" ) then {
if ( count (squadParams _unit) != 0 ) then {
if ( ((squadParams _unit select 0) select 0) in _unitTag) then {
_SPG_member = true;
systemchat "Welcome SPG member!";
};};};
if ( !(_SPG_member) ) then {
sleep 1;
if ( alive _unit ) then {
endMission "END5"; //Insert a Endmission 5 in description.ext
};
};
};
};
this should do the trick then? π
I give it a try later on.
If you spawn it from enforcetag then yes
if (isserver) exitwith {}; β so a non-SPG member can host
_SpawnEnforceTAG = why? useless.
Missions within the unit is always being run from a dedicated server =)
the server cannot wear a unit tag
only if the server is dedicated
so better use isDedicated, or better only hasInterface
if (!hasInterface) exitWith {};```
oh so, only
[] spawn {all my code} ; ?
@winter rose itΒ΄s good as it is because when sitting in the editor and testing the mission, the missionmaker donΒ΄t have to worry about if the unit tag is worn. the member may be part of another unit? or some other factor π
okie, just so you know π
yes
Thank all of you β€
postInit are called scheduled so suspension is allowed but any long term suspension will halt the mission loading until suspension has finished. Parameters passed are [ "postInit", didJIP ].
What can be done about it?
I suppose that this gibberishy explanative sentence means "it will block loading until it's not waiting anymore", but it's not clear
Well it holds loading screen from ending as Dedmen pointed. I guess presence of loading screen messes up other init processes as well
not sure if you want to do anything about that.
Seems reasonable. Game wants to wait till postInit is done. That makes sense.
people infinitely waiting in their postInit is what doesnt make sense
So loading screen is there to speed up loading scripts and hide postinitiation.
Maybe hardcoded limit that would end screen? Besides the order of postInit scripts is irrelevant so maybe launch a bunch of them in parallel?
Need to experiment
Besides the order of postInit scripts is irrelevant
Is it though? they are ordered by requiredAddons, so might not be irrelevant
Gonna check on that
private _arr = [ ["assertTrue", { [] in [[],1,2,3] }],
["assertFalse", { [] in [] }],
["assertFalse", { [] in [[123]] }],
["assertFalse", { [] in [1] }],
["assertTrue", { 1 in [1,2,3] }],
["assertFalse", { 1 in [2,3,4] }],
["assertFalse", { 1 in [[1]] }],
["assertFalse", { 1 in [] }],
["assertTrue", { false in [false] }],
["assertFalse", { false in [true] }],
["assertFalse", { false in [1,2,3] }],
["assertFalse", { false in [[false]] }],
["assertFalse", { false in [] }],
["assertTrue", { player in [player, 1, 2, "", []] }],
["assertTrue", { player in [objNull, player, 1, 2, "", []] }],
["assertTrue", { player in [objNull, 1, 2, "", [], player] }],
["assertFalse", { player in [objNull, 1, 2, "", []] }],
["assertFalse", { player in ["",1,objNull,2,3] }],
["assertFalse", { player in [[player]] }],
["assertFalse", { player in [] }],
["assertTrue", { "abc" in ["abc",1,2,3] }],
["assertFalse", { "abc" in ["ABC",1,2,3] }],
["assertFalse", { "abc" in ["",1,2,3] }],
["assertFalse", { "abc" in [["abc"]] }],
["assertFalse", { "abc" in [] }]
];
{
private _res = [] call (_x select 1);
if (_x select 0 == "assertTrue" && !_res) then {systemChat ("invalid test: " + str (_x select 1));};
if (_x select 0 == "assertFalse" && _res) then {systemChat ("invalid test: " + str (_x select 1));};
}foreach _arr```
Please one send me the results this time
(fixed the code too)
(Fixed the dev-branch requirement)
(Added Object `in`)
^ requires dev branch
nothing

my eyes
i will just assume that my in string test-cases are correct btw.
it is in the actual runtests.sqf
but this is a lil bit overkill to ask in this chat π
Run, Test, Run!
plus it uses special sqf-vm commands
to gather all files
((to name it: allFiles__ [".sqf"]))
why _x select 0 == "assertTrue"
why not have bools and just compare directly
[false, { [] in [] }],
or
{!_x} count [
false isEqualTo ([] in [] ),
true isEqualTo (1 in [1,2,3])
] > 0 // failed
because the test-framework supports multiple checks:
- "assertTrue"
- "assertFalse"
- "assertEqual"
- "assertNil" or "assertIsNil"
- "assertException"
the reason why every testcase is shipped as separate code is again, due to SQF-VM commands
to name it again: CODE except__ CODE
that allows to catch actual SQF exceptions
aka: continue running if an error occurs
Hi, what does the code "private _myName = _this select 0" mean in the script

