#arma3_scripting
1 messages · Page 535 of 1
and then put that into string
endl should already do that, it returns \r\n afaik
check in extension what is actually the content of the string, if you get double newline it might be a problem on extension end
toString [10] worked thanks!
possible to scan via sqf for colliding terrain objects? (ie using bb, or what else may work better)?
LineIntersection, just at the phone but look up at the wiki
in what way specifically?
like there is no obj intersect obj cmd, right?
so you need to check if the two shapes do
How you guys handle multiple CfgFunctions in one same mission? The open-world mission I'm currently creating happens to be first one where I need to use two different functions at the same mission. TedHo's HLF inf unit UnitCapture/play and 7erra's Arsenal shop.
Both works well when only one of the is included in the mission but once both of them are implemented one of them doesn't work.
The closest of victory I've got is with the following on description.ext
class CfgFunctions
{
#include "arsenalShop\cfgFunctions.hpp"
#include "functions1.hpp"
};
In functions1.hpp I got the HLF UnitCapture/Play stuff and it works. However when I start the mission I got the pictures error. https://ibb.co/YtZ77CV Line 3 in confing.sqf I haven't touched and it works when HLF-function is not implemented so the problems is clearly concentrated on having two CfgFunctions at the same mission.
Is there any proper way to detect CarHorn weapon being used, because both Fired | FiredMan doesn't seem to be triggered when driver horns? Thanks.
Is there a way to change ammo count in a magazine without a weapon on a vehicle? I have a dummy mag that is just there, without a weapon and I want to change the ammo in that magazine.
@velvet merlin Maybe with bounding box and inArea command?
@lavish ocean Added: RVExtensionRegisterCallback and "ExtensionCallback" mission event handler << can we have please a bit more informations on how to used it ? (function prototype, and handler exemple) >> first test, the handler returns that extension is unknown, it seems to act like a call extension function (...)
@rocky mortar check tools channel history
thanks you kju, i m going to look
@cosmic lichen cant see how with a simple use
with BB, therefore comparing relative positions, radius, etc - aka more complex maths i can see, but seems somewhat difficult
i guess most simple would be still to make point clouds forth both
and then check if there is any overlap
however for a whole terrain with all its objects, this may be quite a lot of data
Why do you wanna check a whole terrain? Some sort of quality control?
Guys. How to make the horizontal bar in the RscControlsGroup work by scrolling the mouse wheel?
If there is a vertical scrollbar I think that one gets priority
@cosmic lichen No vertical bar.
Just saw the picture
Horizontal bar only
@cosmic lichen correct. check for faulty placement
@cosmic lichen thn
hey there.... a short question about "how to fuck around with triggers" wanted to split chernarus in half for pvp zone and pve zone... and want to get the players a message when they enter the red zone or leave it.... now when one player enters... all players get the message... not only the one who enters
_ZoneTrigger setTriggerActivation ["ANYPLAYER", "PRESENT", true];
_ZoneTrigger setTriggerArea [3500, 8200, 0, true, 500];
_ZoneTrigger setTriggerStatements
[
"this",
"['ErrorTitleAndText', ['PVP-Zone', 'Du bist nun in der PVP-Zone! Feuer Frei!!']] call ExileClient_gui_toaster_addTemplateToast;",
"['SuccessTitleAndText', ['PVE-Zone', 'Du bist nun in der PVE-Zone! Pass auf worauf du schiesst!!']] call ExileClient_gui_toaster_addTemplateToast;"
];```
ideas? also i set the trigger to LOCAL with the false in the first line... where true would be global...
how would I define a global variable in an addon that is referenced by multiple functions?
myVariable = "myVariableValue";
Of course you must make sure that your variable name is unique enough
by using prefix or something like that
ACE/CBA use different macros for that a lot
But probably that is not what you wanted to know?
@astral dawn I guess what I'm really asking is where in an addon would I define that and make sure that it actually gets set?
ah ok
so you are probably using cfgFunctions
preInit is the best place to set it I think
you know what cfgFunctions is, right?
yeah, that's what I'm using
ok, so just set some function to be run at preinit and do the initialization there
but I am not sure in which order one addon's preinit is going to run VS your other addons' preinit 🤷
well the functions are all in the same addon so that should be fine
I was just looking for a place to define all the types of ghillie suits so I wouldn't have to update several functions every time I modified it
read-only data can be stored in config
BUT as I know, reading configs is much much slower than reading from a global variable
so you will probably read these values and write them into a variable anyway to make it not so slow to read this data, but it depends on what code you run, how fast it needs to run, how often you run it, etc
basically just checking to see if a player has a ghillie in their items or are already wearing one and I plan to run it about once a second
consider event handlers instead of polling every second
CBA has an event handler for when player changes clothes
well, it will just poll this for you I think
maybe it's not so much use for you then
I wouldn't think so in this point... it's a pretty short amount of code to begin with
@astral dawn Thanks for helping
hello, do i have to remoteexecute ace_interact_menu_fnc_addActionToObject on the clients?
i thought it was enough to do it only on the server
it appears only the host sees the actions atm
I'm having a problem deleting a respawn marker via script. It works fine in SP and local MP (both from editor) but on dedicated server the respawn doesn't disappear. The marker is respawn_west and I just calldeleteMarker "respawn_west" on the server during init phase. Any ideas?
never mind :/ doing it globally is apparently required for some reason?
@remote monolith add
_ZoneTrigger triggerAttachVehicle [player];
is it possible to change vcom settings on the fly? skillevels i mean?
Hello. I need to detect if cargo container has items inside, and if it has, exit the loop. I've been trying various ways, but keep getting "Error type Any, expected Bool" on my if checks....
_container = _this;
waituntil {
sleep 0.5;
if !(itemCargo _container isEqualTo []) exitWith {};
if !(magazineCargo _container isEqualTo []) exitWith {};
if !(weaponCargo _container isEqualTo []) exitWith {};
if !(backpackCargo _container isEqualTo []) exitWith {};
};
};```
I just wonder why it doesn't work, when I execute `itemCargo _container isEqualTo []` it returns bool, but when I do these checks with if condition inside my loop it keeps throwing error.
I don't think you can compare to empty array like that
What does an empty container return for that command?
sure I can, it returns empty array, I took this syntax from this example:
https://forums.bohemia.net/forums/topic/206131-checking-if-a-cargobox-is-empty/
Actually, I'm beginning to think something is wrong with the loop or exitwith command
.< yep, I should have used
exitWith {true};
problem resolved
Hey there,
is there a way to get something like allVariables but with the values? Including values of nested arrays
(allVariables _object) apply {[_x, _object getVariable _x]} ?
that does not give me the values of nested arrays though
Is nested array an array like [[1, 2], [3, 4]] ?
yeah
then if your _object has a variable "myvar" having value of [[1, 2], [3, 4]] then you will get it
the code you send up there, returns this:
["bis_wl_sectorlockmrkrs",["BIS_WL_sectorMrkrLock1_11","BIS_WL_sectorMrkrLock2_11","BIS_WL_sectorMrkrLock3_11","BIS_WL_sectorMrkrLock4_11"]],
["size",150]
(part of what it returns, didnt want to post all of it here)
and I want the values of stuff like "BIS_WL_sectorMrkrLock1_11" aswell
oh ok, so you need to use recursion I think
I'm not a master of recursion because it's hard because it's hard because it's ~ 😄
I could hardcode for the max number of nested arrays, but that'd be endangering my sanity
okay, better question: When I save a mission object (warlords sector in this case) to profileNameSpace on my server, can I somehow update the placed sector with the one I saved in profileNameSpace?
well there is no physical/computational/whatever limit why you would not be able to do that I think, but probably it's more related to #warlords_discussion and it's saving (if it has any saving, I don't know)
warlords sector is just an example though, so I thought this channel is still correct.
Doesn't really have to be saved.
If I any logic object (task, gameMaster etc) and copy it into a variable, and after something happened I want to restore the logic object to the state it was in when I copied it.
How would I update the changed object, to the copied?
Well, if the whole state of the 'object' is determined only by the values of the variables, then you can save variables then load them and in theory it should work allright, unless the variable values are copied to some spawned scripts or some other places...
getVariable/setVariable should be used, I think there is no other way
also, I think tasks from the BIS task framework are not logic objects but I am not 100% sure what they are
dang, in that case I need to make sure all arrays (even nested) are saved correctly. So back to the start :/
@tough abyss @velvet merlin easier imo to check for specific things, like floating entities, and objects with other objects too close I think that's a good idea. Check the bounding box or size of two objects and then check if the distance is smaller than the box of one of the objects. That way you could find potentially intersecting objects.
well, if you are not the author of the code for which you want to make the saving system, probably it's quite hard to say for you how everything is connected and if it's possible to change values on the run, probably you would want to halt the whole mission, perform load of your new values, then make it work again.... would need access to all the processing which is being done there...
I just want to load the previous state of sectors in warlords, so we can pause warlord sessions. Meaning it would only run once at mission start, so halting the mission once would not be ideal, but not too bad
probably it would be easier just to write save/load code for the sector module manually
most likely if you find the initialization code for it you will understand what the structure is and what means what
I should learn looking in the function viewer first 🤔
there is the BIS_fnc_WLSectorUpdate function, that basically does the things I need....
I'll try that for now. Thanks for helping me out 🙂
is there a way to get Transport helicopters from the support menu to have more accurate landings rather than land 100+ meters away? i know there's invisible heli pads, but rather not place 1000 of them around the map for a CTI mission
AFAIK the invisible heli pad is the best method
Well, you can delete it afterwards
For example you could add a "deleted" event handler to your helicopter, so when it's deleted his heli pad is also deleted https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Deleted
Since the createVehicleLocal is about to be nuked, what is an better alternative for local creation of a vehicle with 3D preview and also allow for vehicle modification?
createSimpleObject will have an aditional boolean to create locally
But that also allows the use of modifications and also get the array with BIS_fnc_getVehicleCustomization?
There will be a param i see, will just enable it for me.
Why they do this? i mean createVehicleLocal is not very critical for server security?
@astral dawn could it be used with the SingleMapClick command...so when i choose the helo's drop off destination it spawns a heli pad on that marker?
sure
nobody know for my issue?
Admins can see the HC
i'm not logged as admin
how would i set up the singlemapclick for the Helicopter trasport module?
Probably with this event handler
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#MapSingleClick
hello, is it possible to pass callbacks into a function? for instance...
_transform = { params ["_cb", ["_vals", []]]; private ["_transformed_vals"]; _transformed_vals = []; { private _y = [_x] call _cb; _transformed_vals pushBack _y; } forEach _vals; _transformed_vals; };
or perhaps there is already an Arma 3 function that does this? what I am looking for is a LINQ style "select" transformation.
So before anything else, sqf params ["_cb", ["_vals", []]]; private ["_transformed_vals"]; _transformed_vals = []; is a travesty. No. Just... no. ```sqf
_transform = {
params ["_cb", ["_vals", []]];
private _tVals = _vals apply {[_x] call _cb};
_tVals
};
You could also include _tVals in your params to make it private as well.
Since the createVehicleLocal is about to be nuked
Nobody is nuking anything, you’ve been misinformed, so please stop spreading it further @astral tendon
Só, the comand will still work just fine and no server will disable it?
@ruby breach Ah, well it seems apply is what I was after in the first place. I do not even really need a transform function, that is what apply does.
apply does this, and yes you can pass callback to the function, why not? @dreamy kestrel
It will be entirely optional @astral tendon
@tough abyss no, the callback function is the transformation I wanted to take effect, as in the apply function. problem solved 👍
i.e. private _add_one = [0,1,2,3] apply {_x+1};
So, why would i make a mission or an script with that comand and have the risk of being broke or unreliable due user error?
or in my case, private _target_distances = targets_list apply {_shooter distance _x};
apply returns copy, if you want transform by reference then you can forEach and set
@tough abyss Good to know, however, a copy is what I want. I do not want to effect the original.
@tough abyss that looks nuked to me still.
It don’t understand your dilemma @astral tendon
Why would a server owner deliberately break a mission by restricting CVL if the mission is using it and still run it? That is pretty idiotic thing to do
Maybe, he does not know it and it will take forever to figure.
Besides this is still debatable wether there should be server option to restrict it
Do you always take missions you know nothing about and put on your expensive dedicate server?
I know some who does it.
I bet they run it without BattlEye either
I do that, i gave access to mission makers. I do not see much of a problem in a small community
And why would you restrict CVL on your server?
well no i do not restrict it as i am against the change as dwarden already knows
You are against an option that can help with cheating problem ?
How does this option affect you personally?
for close nit communities yes. I am not running some large gamemmode kinda server. peopole, make their own missions to play with friends
I use local only objects a ton, such as filling houses, helper objects and so on
Maybe some one or some Palace says that its safer to do.
@digital jacinth I don’t understand your objection to making it optional
i would like the "safe" part to be opt in and not opt out
It is opt in and has been said by @lavish ocean already gazillion times
last information i had was, it will have 3 modes, off, somewhat safe and safe, with somewhat safe being the default. might have changed again, as teh biki still has the on and off option only documented
No the 3 modes version was never safe default
You’ve been misinformed too
BI did not realise how many ppl use CVL in all sorts of interesting ways, so opt in became the only option
on the agents vs units discussion some days ago, spawning the agents seems to be much less costly than a unit. Unfortunately it seems the agents cannot board anything with 'getin', otherwise it would be nice to load and unload hordes of them into helos/trucks/boats.
what's the best way to select the closest safe position?
@tough abyss your line didnt work for me... the trigger doesnt work at all when i add this line...
You sure it is my statement and not your trigger position [3500,295.67999,8200]??? This means your trigger is 8200 metres in the air, is this correct?
the position format is [x,y,z]
z is the height above the ground @remote monolith
_ZoneTrigger = createTrigger ["EmptyDetector", player getRelPos [10, 0], false];
_ZoneTrigger setTriggerActivation ["ANYPLAYER", "PRESENT", true];
_ZoneTrigger setTriggerArea [4, 4, getDir player, true];
_ZoneTrigger setTriggerStatements ["this", "hint ""IN""", "hint ""OUT"""];
_ZoneTrigger triggerAttachVehicle [player];
works for me, walk a few metres forward, activated, back, deactivated ¯_(ツ)_/¯
Someone gave you the same answer on the forums too https://forums.bohemia.net/forums/topic/223796-triggers-a-never-ending-story/?do=findComment&comment=3362630
can someone confirm if Respawn event handlers are stackable?
all event handlers are stackable apart from old onXXXX
ok thanks, getting odd behavior
@tough abyss it works for me too..when im alone in editor or the server...but if a 2nd player comes into the game and triggers it...you get the message as well.... (corrected the position... thnx for hint... copied the line from mission.sqm where its mixed up)
and the hint in the forum already solved my problem....
Hello guys, im testing vehicle penetration and cargo bots keep jumping out when they knowabout enemy player unit, no matter to disableai "all". Do you know how to completely turn their brains off?
Is anyone aware of a way to change the time an audio clip starts playing from without editing the original clip.
Similar to how playMusic does it? https://community.bistudio.com/wiki/playMusic#Alternative_Syntax
@verbal saddle for playSound I suppose?
Preferably anything that would support 3d audio.
That's why playMusic is out of the question for my situation.
@remote monolith then you must be doing something wrong, because triggerAttachVehicle makes trigger monitor local player only, so there is no way in hell it can trigger for remote player
anyone knows a simple way to prevent a unit from being able to use weapons?
there is none
You can override fire action @sturdy cape
like an EH? right now i am trying a while loop which checks for weapons and class of the player and does removeweapon after.will see what that does
what is the relationship between setTriggerActivation and setTriggerStatements? Does latter override the behaviour of the former, or is the former a pre-requisite for the latter?
both work together
setTriggerActivation is evaluated first, and then the condition code is ran with it's results, and then the onActivation statement runs if both
Atleast I think that's the case :U
setTriggetActivation controls Boolean this which you put in setTriggerStatements condition
thanks
Looking to find or create a rescue winch script but not sure where to start. Any templates someone has laying around or a foundation I can use?
Hey guys, I am doing so many reboot of my loczl server when testing scripts. Sometimes when I try to connect to my server, an error appear "cur mp mission is modified", I have to close my game, go to appdata, arma3, delete the curmpmission.pbo, then start my game against
Is there any way of getting the task name from a task created by createSimpleTask? I need to be able to do something dynamic, using setVariable on it would have been the preferred solution but the caveat of it not being set directly on the task but the FSM makes absolutely no sense to me.
hello, I have successfully placed Jets DLC UAV controlled assets, VLS, the Hammer, and so on. this is all well and good, I can connect to them via UAV Terminal...
however I am finding that the Hammer sometimes drops artillery into the AO, and I want to prohibit the AI from doing that. is there a setting I can tell it to not engage?
Remove the ammo from it on init?
@craggy adder that's absurd, but thank you for the suggestion. then it would be useless for everyone.
anyone know if there is soemthing wrong here? https://i.imgur.com/PRuLqSk.png
wanna make sure
that it looks normal
Have any of you guys had problems with PlaySound3D having wildly varying volumes?
For context, here's my code that's attached to an On Activation trigger:
_soundToPlay = _soundPath + "sounds\jellyfishjam.ogg";
playSound3D [_soundToPlay, trackspeakers, false, getPosASL trackspeakers, 5, 1, 175];```
However, when I play the mission, it seems a 50/50 chance if the volume will be either really really loud, or so quiet you need to be right next to the object to barely hear it. For the life of me I cannot figure out why it's so inconsistent. The only mods I have installed for this mission are ACE3 and CBA.
@vapid wadi Post code, not screenshots
You're probably getting "expected bool, type number"
``sqf
private _ServerName = tolower(MAIN_SETTINGS_TYPE(getText,"GameSettings","discount_serverName"));
private _nameCheck = (tolower profileNameSteam) find _ServerName;
private _discountPricing = M_CONFIG(getNumber,"VirtualItems",_itemData,"buyPrice") * 0.1;
if (_nameCheck) then {
_buyPrice = M_CONFIG(getNumber,"VirtualItems",_itemData,"buyPrice") - _discountPricing;
} else {
_buyPrice = M_CONFIG(getNumber,"VirtualItems",_itemData,"buyPrice");
};
``
whoops
welp
thats it
3x `
ahh
private _ServerName = tolower(MAIN_SETTINGS_TYPE(getText,"GameSettings","discount_serverName"));
private _nameCheck = (tolower profileNameSteam) find _ServerName;
private _discountPricing = M_CONFIG(getNumber,"VirtualItems",_itemData,"buyPrice") * 0.1;
if (_nameCheck) then {
_buyPrice = M_CONFIG(getNumber,"VirtualItems",_itemData,"buyPrice") - _discountPricing;
} else {
_buyPrice = M_CONFIG(getNumber,"VirtualItems",_itemData,"buyPrice");
};
_nameCheck is a number, not a boolean
uhh im stupid lol, how would I fix it then?
private _nameCheck = ((tolower profileNameSteam) find _ServerName) > -1)
``` probably
I didnt write that part, that works fine
its used for boosting paychecks on altis life I copied it out of our servers paycheck script and removed one of the checks
that works fine Sure it does, but it causes an error a few lines down
if (_nameCheck) then { doesn't work when _nameCheck isn't true or false
if (_nameCheck) then { needs a bool (true/false), you give it a number
Thats why -> Change it to the one that Gnashes posted, for example.
if (_nameCheck != -1 && MAIN_SETTINGS_TYPE(getNumber,"GameSettings","paycheck_bonus") isEqualTo 1) then { this is how we had it before. I fucked it up sorry
How our old dev team had this written is like a rewrite of the Altis Life Framework. Im just new and dont usually do scripting.
Thanks for the help tho
So I currently have SQF [ _helo, "Remove Flight Recorder", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_hack_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_hack_ca.paa", "_this distance _target < 4", "_caller distance _target < 4", {}, {}, {_recorder = "rhs_flightrecorder_assembled" createVehicle position player; hint "Flight recorder removed, get it back to base"}, {}, {}, 3, 0, true, false ] remoteExec ["BIS_fnc_holdActionAdd",[0,-2] select isDedicated,true]; in a script and later on I want to delete the object _recorder
I understand that that variable is only local to that function, so how do I go about making it so I can reference it later in the script?
if there's just one instance of recorder around, make it a global variable, easiest path to follow
and if concerned on locality, publicVariable to broadcast it to all clients, depending on where the removal script runs
OK cool thanks
Is lbSetPictureColor just changing the color of the light that is illuminating the image ?
@white sky something like that yes
would someone be willing to better explain what setGroupOwner does. i dont fully understand the wiki. Im trying to change the squad leader of a squad dynamically.
You need to use setLeader
setGroupOwner sets "owner" of the group. That means who simulates the group / where group is local.
Eg you can set that headless client is a group owner of the group and it will simulated on hc not the server.
You can't change ownership of the groups where player is a leader because groups lead by player are always local to him.
ok now i get it, thanks all
what is the deal with arma. there are 3 ways to disable a coms channel and still after respawn they have access to the disabled channel.
I have this in the initPlayerLocal
0 enableChannel [true, false];
1 enableChannel [false];
2 enableChannel [false];
3 enableChannel [true, true];
4 enableChannel [true, true];
5 enableChannel [true, true];
setCurrentChannel 3;
this is in the onPlayerRespawn
0 enableChannel [true, false];
1 enableChannel [false];
2 enableChannel [false];
3 enableChannel [true, true];
4 enableChannel [true, true];
5 enableChannel [true, true];
setCurrentChannel 3;
same configuration in the description.ext
and in the initserver
the player can still use side chat
i have also used 1 enableChannel [false, false];
By the way, is there a way to completely remove a radio channel from the list? E.g. if player has no other members in his group, he doesn't need the group channel. If player is not in a vehicle - he does not need the vehicle channel.
let me know if you find out. lol this has been a pain for a while for me.
The only thing I found out so far, is the existing commands like enableChannel can't completely hide any of builtin channels.
It is possible
But afaik no built-in way
you could however, just catch the keys and manually swap channels
Hm, nice Idea. @queen cargo thank you!
Urgh ... those closed-source DLLs ...
Is anyone aware of a work around for moveOut not working for AI that's under the players command?
i guess having them leave the group and rejoin but surely there is a script command where it works without needing that?
note this is when the AI units are in a turret of a moving aircraft
is there a way to add arguments to the addAction condition param
Hi, please let me know if this is the wrong spot for this, I have been searching for a script or maybe a mod that would allow the player upon incapacitation to go back to shooting while bleeding out, or the "last stand" state, I have played on some servers before that had this feature, but all searches on the internet and workshop lead to player created missions. I have very very limited experience with scripting and any help in the right direction would be extremely appreciated. thank you
"this and assassinate, intel, rescue, secure"
This is a condition script for an end trigger that's only supposed to activate when the four tasks are completed
Only, it gives me an error when I preview
I’ve noticed in the collision light entry for an aircraft config, there is a daytime option. If set to 1 it makes no difference though. Does the engine not support that type of lighting when the time is still set to day?
@tough abyss yo see my lines of code right? so what can i do wrong then in your opinion? and like i said...when i add your line then it doesnt give me or anyone else any message at all...so it seems it doesnt trigger at all
but doesnt matter anymore.... problem solved...
@exotic tinsel Probably unrelated, but there is still weirdness when people leave/rejoin a mission and disabled channels - https://feedback.bistudio.com/T117205
To the best of my knowledge, that's still not been addressed; but I've not really managed a mission in about a year now.
@remote monolith You told me the line still makes it trigger for other players, now you tell me the line stops triggering it for anyone. Make up your mind, dude.
well... you should read the whole texts i write..
CoolGargamelgestern um 11:11 Uhr
@tough abyss your line didnt work for me... the trigger doesnt work at all when i add this line...
How can i make ai attack a player via a script? I want to do it that way because its a melee attack and playaction/setdamage Combo. Any simple way to check targets,move to target and Start my attack fnc?
Or do i need to create an fsm and functions for all the Staates like Ryan did it for his Zombies? I want to keep is as simple as possible
@remote monolith @floral dew it works for me too..when im alone in editor or the server...but if a 2nd player comes into the game and triggers it...you get the message as well.... (corrected the position... thnx for hint... copied the line from mission.sqm where its mixed up)
Anyway, I have little interest in you said I said, so could you please stop tagging me
Is there anything that can return more accurate representation of a model than the boundingbox
why do we need CBA functions to effectively deal with inventory after arma has been out for x years? can you please add a removeItemCargo and addItemCargo for each item type already
@robust brook https://community.bistudio.com/wiki/addItemCargoGlobal
Should be getting something along the lines of "error: type array expected string"
👋 @robust brook _item is a multidimensional array, addItemCargoGlobal accepts a single dimensional array [item, count]
asylum dev team pog thanks
if you want it to add all those items, you can use {_crate addItemCargoGlobal _x} forEach _item;
Had anyone else have issues with ctrlTextHeight a very imprecise value?
doubt it has something to do with ctrlTextHeight
and rather with the way fontscaling works
My guess is that it does not take the line height into account propely.
Any known workaround for that?
You talking about the 3denCopy thing?
From what I've read it appears to be using a hidden ctrlStructuredText to get the height of the text. Then using the height of the text in that control to set the height of the ctrlEditMulti.
I'd say that the height of the text within the ctrlEditMulti is much higher then the height of the text in the ctrlStructuredText control.
Files for context:
onload: https://i.imgur.com/FDkyp2K.png
display: https://i.imgur.com/cbh8OQp.png
Hi, guys! Is there a handler for the new spawned units? I think that EntityRespawned does not fit for the AI spawners, right? I've tried to add units to the array with while (true) do {} but it looks that it's too much for the script - my mission never started 😃
If you have CBA you can use CBA XEH Init event handler.
https://github.com/CBATeam/CBA_A3/wiki/Extended-Event-Handlers-(new)#event-handlers-related-to-objects
https://github.com/CBATeam/CBA_A3/wiki/Adding-Event-Handlers-to-Classes-of-Objects
Without it there are only config based init handlers.
But if it will be config based class how do i get spawned AI unit there?
also chuckled on this: 'because Man is the parent class of all animals'
Do you use CBA or not?
I have the mod, but as it is for MP mission I'd stick to the vanilla
Then I think the only way to do this would be getting entities [[], [], true] and storing it in variable and periodicaly compare stored value with entities [[], [], true] again. That way you will know what entities were created between your loop executions.
This will be kinda slow 🤷
With cba you can do ["All", "init", {systemChat str _this}] call CBA_fnc_addClassEventHandler; and done.
Nice!
@cosmic lichen
Ok this is what I've got currently.
Using excel I created a string of numbers from 1-675 in a column.
I then created a string of numbers in a row from 1-5982.
If I put the column of numbers in to the display it will only show a specific number of lines at once.
Example code: https://pastebin.com/raw/JmXmUeuV
Example image: https://gyazo.com/a2222b7053d997f44862aea8906d558a
BUT, if I put the row of numbers from 1-5982 in the code then it will show all of the numbers.
Example code: https://pastebin.com/raw/kkc1JLPJ
Example image: https://gyazo.com/40eccccc90281e917eb110eca5f20eaa
Looks like it might be the line breaks that are causing the issue.
Does ctrlStructuredText interpret text differently when using ctrlSetText vs ctrlSetStructuredText?
@verbal saddle Might be the issue. Gonna test that.
Issue is still there even if both controls are ctrlEditMulti
Hello! So what I've been trying to do is dialogue between players in a custom mission.
Whenever player3 says anything to player1 (both are real players) it gets repeated by the amount of players on the server so I think this is the script running on every PC which causes the problem, but I don't know how to fix it.
Here's the script .sqf
`player3 KbAddTopic ["introduction","radio1.bikb","",""];
player1 KbAddTopic ["introduction","radio1.bikb","",""];
player1 KbTell [player3,"introduction","radio1"];
waitUntil {
player1 KbWasSaid [player3,"introduction","radio1",3];
};
sleep 1;
[player3, [player1,"introduction","radio2"]] remoteExec ["kbTell", player3];
sleep 5;
player1 KbTell [player3,"introduction","radio3"]; `
Normal way of doing KbTell doesn't work at all between players
```sqf
```
@sand anvil your script may be executed on each machine!
you should then call it only from the server
Yup and I don't know how to make it run locally if that's the correct way of saying it
where is the call defined?
Umm sorry, what do you mean?
It executes when player enters a trigger 0 = execVM "radio1.sqf";
If that's what you mean
Well the code still shows an error with the sizing of the scrollbar so hopefully it can he helpful for debugging the issue.
@verbal saddle I found the issue with the text height
It's caused by two things. First of all, one control is a ctrlEditMulti and the second issue is the font.
@winter rose The weirdest thing is that I got this to work earlier on my old mission and it still works and I copied the script 100% and it doesn't work on my new mission anymore 😄 The only thing that differs is the length of voicelines
If both controls are ctrlEditMulti with the font font = "PuristaMedium"; it works fine with both your examples and mine
1.56 - Eden Editor
CT_EDIT 2 (Since Arma 3 v1.57.135040)
Ahh
@sand anvil yes, what I meant.
make the marker server-only, and trigger "on player entering" (iirc there is such a thing) and you should be good
or, inside your file, if (!isServer) exitWith {};
How does one make it server only? I'm really shitty at scripting 😄
the trigger has a tickbox in Eden Editor, don't worry 😉
I'll try the !isServer tho
Oh I'll take a look
Oh damn
That might be it
I'll test it with my friend
Nah now the other player is completely silent
gonna try if (!isServer) exitWith {}; next
https://community.bistudio.com/wiki/Conversations may help for further usage
The shitty thing about this is that I can't test with bots 😄 so it's pretty slow
@winter rose You are a god among men!!! It works! if (!isServer) exitWith {}; is the solution!
take note everyone! \o/
but seriously, thanks 😄 hehe
Thank you ❤
Does anybody know if it's possible to use UnitCapture and UnitPlay to create a dynamic, on map click, airstrike call in? I only ask this because I'd like to create a divebomb call in with Stukas and aside from UnitCapture, idk how to get the AI to simulate a divebomb. My thoughts were to spawn a plane on map click and have it execute the movement data I capture. The movement data I capture would be to bomb a Target at the origin on a map [0,0]. Then if I theoretically execute the movement data, but replace the position with _pos + UnitPosition for each frame time. Theoretically I'd get that movement data to play anywhere I click on the map and be on target. Anybody know if this sounds possible? Or maybe another work around to a divebomb script?
_pos = my map click position
UnitPosition is just the part of the capture data array.
[FrameTime, UnitPosition, UnitDirectionVector, UnitUpVector, UnitVelocity]
trigger
i fucked up
i have important trigger
i haven't steup it's name in editor
and activation
we are in this
trigger
any way?
to activate?
you don't need to give the trigger a name to let it trigger
script
to activate
anyway
found solution
i will leave it here
for others if they make a litlle mistake
_triggers = [getpos player select 0,getpos player select 1] nearObjects ["EmptyDetector", 5000];
{
_x setTriggerActivation ["ANYPLAYER", "PRESENT", false];
}forEach _triggers;
👍
Using these two winch scripts, how am I able to attach a custom basket model to the end of the rope (Winch) once activated? Once activated how could I get the patient to be loaded into it once it detects them?
_pilot = _this select 0;
_veh = assignedVehicle _pilot;
~0.1
#RopeDef
_SideRope = (ropes _veh) select 0;
_ropePos = ropeEndPosition _SideRope select 1;
_length = ropeLength _SideRope;
?(_length <=1.5) : goto "ExitScript";
~0.1
_ManSearch = _ropePos nearEntities ["Man", 3.5];
~0.1
?!(isNull (_ManSearch select 0)) : goto "ManCatch";
~0.1
goto "RopeDef";
#ManCatch
(_ManSearch select 0) switchmove "InBaseMoves_sitHighUp1";
~0.1
(_ManSearch select 0) enablesimulation false;
~0.1
(_ManSearch select 0) setpos [ getPos (_ManSearch select 0) select 0, getPos (_ManSearch select 0) select 1, (getPos (_ManSearch select 0) select 2) +0.5];
[(_ManSearch select 0),[0,0,1.2]] ropeAttachTo _SideRope;
ropeUnwind [_SideRope, 3, -1, true];
~0.2
_veh vehicleChat "man on winch rope";
#LengthCtrl
_length = ropeLength _SideRope;
?(_length <=1.5) : goto "ExitScript";
~0.1
?(speed _veh) >= 30 : ropeUnwind [_SideRope, 4, -20, true];
?(speed _veh) <= -30 : ropeUnwind [_SideRope, 4, -20, true];
~0.1
goto "LengthCtrl";
#ExitScript
?!(isNull (_ManSearch select 0)) : (_ManSearch select 0) moveincargo _veh;
~0.1
?!(isNull (_ManSearch select 0)) : _veh vehicleChat "man onboard";
?!(isNull (_ManSearch select 0)) : (_ManSearch select 0) enablesimulation true;
?!(isNull (_ManSearch select 0)) : [(_ManSearch select 0)] joinsilent (group _pilot);
~0.1
exit
Here is the rope attachment position
#RopeAttachPos
_SideRope = ropeCreate [_veh, _AttachPos, 4];
~0.1
_ropePos = ropeEndPosition _SideRope select 1;
~0.1
[_pilot] exec "\SCmod_fire\script\SCmod_Catch.sqs";
~0.1
_id1 = _pilot addAction ["<t color='#FFFFFF'>RS winch</t>","\SCmod_basic_waterkit\functions\SCmod_bambyRS.sqs","",4.6,false,true]; _pilot setVariable ["Raise", _id1];
_id2 = _pilot addAction ["<t color='#FFFFFF'>LW winch</t>","\SCmod_basic_waterkit\functions\SCmod_bambyLW.sqs","",4.5,false,true]; _pilot setVariable ["Lower", _id2];
Best I can tell, it looks like it may be from something related to https://steamcommunity.com/sharedfiles/filedetails/?id=1115246886
Yes, I had permission to use his scripts as a template for my own. Having trouble deciphering them lol. SQS is not my specialty
didnt even know A3 still supports sqs lol
Works well client side, not server lol
I'm not even sure you'll be able to get a lot of help with SQS. Might be better off translating everything into SQF first, then tuning/debugging
@winter rose you're my hero lol
hahaha it brings back ooold memories actually
I usually enjoy scripting, but trying to do this is a pain in my ass lol
@winter rose if it helps I could actually send you both the SQS scripts to make it easier? Both entries I posted are from two different files.
I am doing the rescue script you pasted
Oh great. I really appreciate that. My time for scripting is very narrow now days..
Let me test it real fast
how do I set a plane's (Jets DLC) targeting camera initial orientation? such as AZ, Direction, Angle, that sort of thing.
I need to set it on init. I know how to wire that event up on a class of objects, just not how to work with the targeting pod.
anyone know how to get the eventhandler for honking a vehicle horn?
Is "Fired" not working?
nah fired doesnt work for horn as it technically doesnt 'fire'
I assume you're wanting to see when a player does it right?
if so your option may be monitoring inputaction "defaultaction"
and checking if the currentweapon is the horn
@hallow spear could try using the keydown handler and check if player is in a vehicle and is driver
thanks for the suggestions, i will work on the key handler approach
I'm sure there's a better way of doing this, but here's the 30 second version ```sqf
(findDisplay 46) displayAddEventHandler ["mouseButtonDown", {
params ["_displayorcontrol", "_button", "_xPos", "_yPos", "_shift", "_ctrl", "_alt"];
if (_button == 0) then {
if !(isNull objectParent player) then {
if (toLower(currentWeapon (objectParent player)) find "horn" > -1) then {
//It's a horn! (probably)
};
};
};
}];
thank you for this example!
Looking if someone can maybe shed some wisdom on me or if someone has the time help me. Looking for a "if is indfor then set invent random item from x list". I have 0 scripting knowledge and what I tried from google and the little I do know I managed to break my mission file.
you want an independent unit to get a random item? @drifting copper
@hallow spear yes and no. Want them to get a random "uniform" from a predefined list. This counts for editor placed and zeus spawn-in
Hello guys, I'm trying to get some text displayed at the startup of my mission but the valign parameter isn't working. I'm unable to find my mistake at this point, what am I missing ?
Thanks in advance
sleep 2;
[parseText "<t valign='top' align='right' font='PuristaBold' color='#417630' size='8'>D. I. S. : </t> <br/> <t valign='top' align='right' font='PuristaBold' color='#417630' size='5'>Ad augusta per angustam </t>",
false,
nil,
8,
0.7,
0]
spawn BIS_fnc_textTiles;
sleep 9;
[parseText "<t valign='middle' align='left' font='PuristaBold' color='#417630' size='5'>Opération éclaircie </t>",
false,
nil,
5,
0.7,
0]
spawn BIS_fnc_textTiles;
sleep 6;
[parseText "<t valign='bottom' align='center' font='PuristaBold' color='#417630' size='5'>Altis, H0600</t>",
false,
nil,
5,
0.7,
0]
spawn BIS_fnc_textTiles;
@hallow spear found me a work-a-round via DMs. Thank you.
Hey guys - I've got a script to spawn a BO_GBU12_LGB on a target for a scripted explosion but I'm looking for a bigger blast... Anyone know if there's a munition in say, RHS, that's bigger? Can't find their classnames for ammo on their wiki at all :/
I'd really like the SCUD explosion or something similar but I can't find the classnames for any projectiles anywhere
@runic edge where do you execute it?
@hollow thistle thanks for that CBA event handler, it worked. AI is still stupid (or too smart) to do a zerg rush 😃 But it is much better than it was before (especially for troops out of groups)
@spice axle It's in a file cantrecallname.sqf that i call in my init
Got a question about setting up Zeus via script.
I need it only to have some units available and I need costs for these units. So the units part of the code works just fine - I can see only them in MP. But I don't have any points for the Zeus 😦
`//add Zeus Points
z1 addCuratorPoints 1;
// set Zeus available units and their costs
[ z1,
[
"RyanZombieC_man_1walkerOpfor",0.1,
"O_support_AMG_F",0.1,
"RyanZombie25mediumOpfor",0.1,
"RyanZombie15Opfor",0.1,
"RyanZombieboss7Opfor",0.2,
"RyanZombieC_man_polo_5_FOpfor",0.1
]
] call BIS_fnc_curatorObjectRegisteredTable;`
Also it's possible to set up any amount of points with the Resources module in the editor , but the addCuratorPoints command page says that it is only from 0 to 1. While BIS_fnc_moduleCuratorAddPoints page looks unsupported https://community.bistudio.com/wiki/BIS_fnc_moduleCuratorAddPoints
@runic edge you call it? sleep isn’t a valid command in a sheduled environment. You need to spawn it.
Like _null = [] spawn my_function
What is the error message?
made a try with 1= ["Mission name", "By: Author name", "Date"] spawn BIS_fnc_infoText;
It's still appearing in the top right side corner of my screen
BIS_fnc_infoText should appear bottom right
try without any mod…?
What's the best way to use a units INIT to apply ACE damage to it and have it work with bandages etc?
I have damage being applied correctly with [this, 0.8, "rightleg", "bullet"] call ace_medical_fnc_addDamageToUnit; but when bandaged the wound never fades. Is there something I'm missing that would help?
can someone test
cutRsc ["binocular", "PLAIN"]; in stable branch?
What is the comand like abs that make numbers negative?
abs makes numbers absolute (positive)
Oh missunderstood the question
- makes things negative
-abs _num 
correct way to always get a negative number:
private _num = -1;
diag_log - abs _num; // -1
_num = 1;
diag_log - abs _num; // -1```
how do i open the debug console during briefing?
if ((isNull (getAssignedCuratorLogic player)) or (player == ace_player))
no need for parenthesis for isNull or getAssignedCuratorLogic
should return me true if a player is not a zeus, OR if he is a zeus but not in zeus mode?
first part checks if player is a zeus
second checks if he is NOT remote controlling someone
oh
if (hasZeusAccess && !isRemoteControllingUnit)
i want to exitwith whenever a player is not actually in zeus mode.
so i guess that is not only remotecontrol
check for whether the zeus display is open
or remotecontrol
RscDisplayCurator, dunno the idd
how do i check for the zeus display?
findDisplay
hmmm
you want display or just if it is open?
findDisplay 312 is display
could also check if curatorCamera is not null
ok that curatorcamera might be the thing for me
I have spawned from artillery and AA assets at the beginning of a mission and crewed them, Mk49 VLS, Mk45 Hammer, in particular. I am finding that the AI engages lasers pointers and such in an AO on its own. I want to turn that AI behavior off. Does anyone know of a way to do that? Thanks!
AI engages lasers pointers and such what do you mean by "and such"
thermal targets?
try https://community.bistudio.com/wiki/enableIRLasers @dreamy kestrel
mainly I just want the AI to not engage anything. the only purpose I want it to serve is as a UAV Terminal object.
ah ok, so if I do something like crew vic_name and iterate that crew over the enableIRLasers, that should do the trick?
you might want to try something like this maybe?
_x disableAI "AUTOTARGET";
_x disableAI "TARGET";
_x disableAI "SUPPRESSION";
_x disableAI "AUTOCOMBAT";
_x disableAI "FSM";
basically they wont do anything
Perfect, I'll experiment. thanks all for the suggestions.
also _x enableAI "PATH"; if you wnat them to stay where they are
sure, I'm only talking about the static turret assets, but I appreciate the insights.
_group setCombatMode "BLUE";
_group setBehaviour "CARELESS";
could also be options
Hello!!!!!!! I want to try disabling friendly fire in my mission, I have tried putting the below which I found online in my init.sqf with no luck. I've also tried the Arma 3 Friendly Fire module and that does not work with the correct sync set up. Any help please? Did I put the below in the wrong place? ta
{
if (side _x isEqualTo WEST) then
{
_x addEventHandler
[
"HandleDamage",
{
_returnDamage = (_this select 2);
if ((side (_this select 0)) isEqualTo (side (_this select 3))) then
{
_returnDamage = 0;
};
_returnDamage;
}
];
};
} forEach allUnits;
This EH can accept a remote unit as argument however it will only fire when the unit is local to the PC this event handler was added on
``` Individually have each player add it to themselves via initPlayer. AI need to have it added wherever they are local (probably server)
Interesting... so I'll add it to InitPlayerLocal and give it a go
Yea does not work I'm afraid
Ok lets spin this a different way... I use the following for spawn protection, how could I modify this to only take effect for WEST vs WEST damage?
0 = [] spawn {
while{true} do {
{
if(_x distance (getMarkerPos "safe_zone") < 200) then {_x allowDamage false} else {_x allowDamage true};
} forEach allUnits + vehicles;
sleep 1;
};
};
I could then expand it to cover the map for example... janky ik 😄
You don't
The only way to check what you're taking damage from before it kills you is handleDamage
This method is effective in preventing death though
direct fire protection is enough
I'm aware it would not protect against indrect
doing while true sleep when you can add a trigger is not "effective"
^ performance aside, I don't believe there's a way to "prevent only west vs west damage" via script without using the EVH
Alright, thanks fellas
I'm at a loss for finding a working EH script for this
No locations work either, init.sqf or initplayerlocal
I even tried initserver
😄
If you have access to debug, local exec this on yourself - ```sqf
if (playerSide == west) then {
player addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
[_damage,0] select (side group _instigator isEqualTo side group _unit);
}];
};
Thanks Gnashes, I also have the ability to exec global & JIP
so this may do the job
I'll check and come back
Granted, depending on how early that is applied to JIP, may cause issues with playerSide
dont forget that any override of "HandleDamage" EH is null and void when you have another "HandleDamage" EH added afterwards
Doesn't work online with global & JIP I'm afraid @ruby breach
Thanks for trying tho
Theoretically, if I wanted the below to only affect WEST entities, how would I modify the below?
0 = [] spawn {
while{true} do {
{
if(_x distance (getMarkerPos "safe_zone") < 200) then {_x allowDamage false} else {_x allowDamage true};
} forEach allUnits + vehicles;
sleep 1;
};
};
0 = [] spawn {
while{true} do {
{
if (((side group _x) isEqualTo west) && {_x distance (getMarkerPos "safe_zone") < 200}) then {_x allowDamage false} else {_x allowDamage true};
} forEach allUnits + vehicles;
sleep 1;
};
};```
@coarse plover
Also, don't use distance when checking this many units
You can use an alternative like inArea
Thanks dude
If this is for a bigger project, use a per frame handler and check only one unit per frame, currently it would cause other scripts to lag when there are a lot of units
This is the only looping script 😃 everything else is eden / ace modules / basic triggers
and they are few
With in area, I'm guessing I could use a transparent elipse area marker
then format the code as:
0 = [] spawn {
while{true} do {
{
if (((side group _x) isEqualTo west) && {_x position inArea elipsemarker1}) then {_x allowDamage false} else {_x allowDamage true};
} forEach allUnits + vehicles;
sleep 1;
};
};
// markers have to be strings
_x inArea 'elipsemarker1'
Do you only have a safezone for blufor?
Correct, this is a player west vs ai east mission
shit I just realised this is going to take effect for shots from the EAST side too
I did say that earlier
You mean outgoing shots from blufor to opfor?
From opfor to blufor
Are ineffective due to the fact we have allow damage as false on the west players
You could just alter the Fired EH in the safe zone on blue players to delete their bullets as they are fired and revert after
Something like this that would be added to a player when they enter the SZ: sqf EH_firedSZ = player addEventHandler['Fired',{deleteVehicle (_this select 6)}];
Would not stop grenades or explosive charges ofc
iirc throw or put EH for nades (or however the name was)
Actually no... Maybe the solution is to alter the HandleDamage EH so that damage from BLUFOR is ignored, i.e. return 0 if the side of argument 6 is BLUFOR
setVehicleAmmoDef 1 @tough abyss
Oh for units
I think you have to read some other variable because it doesn't know how many magazines is 'full'
@tough abyss
https://community.bistudio.com/wiki/setAmmo
?
Hello guys,
If I may ask a very noob question : what's my error in this _m = if(date select 4>=10) then {date select 4} else {str(0,date select 4)}; I want to display the minutes in game but as a clock do 04 if it's the fourth minute not just 4. I think if is the correct way to do this but I don't now what syntax I should use in my else.
Thanks in advance for your help !
str takes only one param
use -showScriptErrors startup parameter to get a popup on script error, explaining (usually) where the issue is 😉 @runic edge
Wait don't script errors turn on automatically
With the white on black popup on the top middle left
I probably turned it on without realising
Wait don't script errors turn on automatically
Nope, it's an option
Huh
StartParameter
-showScriptErrors
I must have known at some points
Probably
I got the winfows jesus's talking about
there's an error as the script except the "]" here
_m = if(date select 4>=10) then {date select 4} else {format ["0%1",select**|#|** 4];};
select|#| 4 <- ?
What are you trying to achieve anyway?
want to display the minutes in game but as a clock do 04 if it's the fourth minute not just 4
There was somewhere a function for that, that gives out a string
DATE select 4
Not sure if i mix it with something else, but iirc there was a param to add the leading 0
oh ?
couldn't find it while I was searching for something like this
_m = if(date select 4>=10) then {date select 4} else {format ["0%1",select 4];};```
yes, some getTime HH:MM something
Yeah
But i am not rly sure, if that was Arma or somewhere else 😂
fnc_toTime somethingbla
@runic edge @winter rose
it was Arma indeed ^^ used it not so long ago hehe
😄
Thanks mate so to be clear, i dont need my ifs i just need to put it in my text ?
Ah yes, I wanted to use it for dates, but there is no dateToString iirc
¯_(ツ)_/¯
@jade abyss, find it for me
InitPlayerLocal has the same effect as running something local exec via console right?
@winter rose No time fo dat! (huehue)
Hi guys, any thoughts on the Zeus points question I've shoot yesterday?
Oh, I cannot mention my own previous message in Discord >__>
Got a question about setting up Zeus via script.
I need it only to have some units available and I need costs for these units. So the units part of the code works just fine - I can see only them in MP. But I don't have any points for the Zeus 😦
`//add Zeus Points
z1 addCuratorPoints 1;
// set Zeus available units and their costs
[ z1,
[
"RyanZombieC_man_1walkerOpfor",0.1,
"O_support_AMG_F",0.1,
"RyanZombie25mediumOpfor",0.1,
"RyanZombie15Opfor",0.1,
"RyanZombieboss7Opfor",0.2,
"RyanZombieC_man_polo_5_FOpfor",0.1
]
] call BIS_fnc_curatorObjectRegisteredTable;`
Also it's possible to set up any amount of points with the Resources module in the editor , but the addCuratorPoints command page says that it is only from 0 to 1. While BIS_fnc_moduleCuratorAddPoints page looks unsupported https://community.bistudio.com/wiki/BIS_fnc_moduleCuratorAddPoints
Everything above is running as initServer.sqf execVMs
Ah yes, I wanted to use it for dates, but there is no dateToString iirc
Sure there isstr date
[2019, 6, 20, 10, 44] yeaaaaaah
see my year-old comment on https://community.bistudio.com/wiki/date 😄
Is there any mystery involved to make valign='middle' for ctrlSetStructuredText work, or is it broken (RscStructuredText)? 🤔
... -.-
There is a bug with valign that requires adding 1 extra trailing space per line to the displayed text in order to keep it centered horizontally:```
would someone be so kind to give me a bullet list of things to do and not to do to increase the FPS for players on a multiplayer server? getting alot of players complaining of low FPS. between 10 and 20 fps for alot of them. I get 50 so i dont know what the issue is and i have a 5 year old vid card.
Less is more
less objects, less enemies = more fps
Don't give ai backpacks and attachments
Delete dead bodies
plz do keep going or PM me. didnt know about the backpacks and attachements thing
what are proxies?
@exotic tinsel GPU doesn't matter THAT much. It's the CPU
PLZ keep going. im writing these all down
@tough abyss Have you ever tried to go mentaly crazy with setVelocity? At a certain speed the Scope deattaches from the Gun 😂
I did, was fun 😄
pushed me hiiiigh in the sky. Since then, i knew how Scopes were attached 😄
@exotic tinsel Loops that don't need to be executed every frame -> put a sleep in it for example
+Most important thing:
Optimize your code.
and kickout crappy Mods
He asked about getting better FPS
so... it is kinda important
e.g. there is crap outside like
_pos = [(getPos player select 0), (getPos player select 1), (getPos player select 2)];
blabla setMarkerPosEachFrame;
hehe a mission can have between 15 and 30 EI, and if mission in an urban area then max of 50 civi to populate the area.
a "mission optimisation" page maybe could be useful with these tips? what do you say
And the link above, posted from Lou
well for pilots i bump view distance up but for infantry
setObjectViewDistance [1000,800];
setTerrainGrid 25;
setViewDistance 1000;
altis
shared hosted with fragnet
thats not a lot, indicates another issue
perhaps the client draw distances are too high```
Not thinking about the obvious? Like... e.g. Scripts? Oh, i forgot, not worth it.
🤦
Or having a shitload of unoptimized crap that might not affect/suck alone, but in the mass..
we run a couple sleep whiles on the client for monitoring things like chat so they can use chat commands
So alot of loops?
no like 3 whiles with low sleep
i dont want to advertise here
can i PM it to you. i dont want to get in trouble
loads lol
@tough abyss anythoughts?
ok. well i got a lot of good advice. thank you all.
@coarse plover Yes and no. Yes in that both will execute the given code locally on a single machine (debug local exec runs on the machine that pressed the button only, IPL executes locally on each player's machine as they connect to the server and initialize the mission). No in that debug is happening postInit, while the other is happening during init. Something that may be useful for you in the future is https://community.bistudio.com/wiki/Initialization_Order
If it comes down to it
Make sure the background for firefights and stuff is empty
Example, pushing towards ocean instead of a city
But if it's a tvt, that wouldn't work
Also
Does:
_configs = "true" configClasses (configFile >> "CfgVehicles");```
Give the same output as:
```SQF
_array = getArray (configFile >> "CfgVehicles")```
shouldn't
What would be the correct equivelant for arma 2
is there a simple way to detect an rpg on unit?
check against weapons on unit if array of classes has one then it has an rpg?
Is there any way to reload current weapon via script? reload page states that it will reload all weapons, while loadMagazine is a strange thing with necessary turret position in params >_<
Hmm, eventually it looks like the reload page is a lie. It reloads current weapon just fine without reloading everything. Problem solved!
Now I have my player behaving like some Overwatch character ^__^
How to get the key that the player binded for some imput like shift for sprint?
actionKeys
but it doesn't work properly if shift/alt/ctrl are involved. There is no way that works perfectly
¯_(ツ)_/¯
has anybody ever made a replacement for the sidebar action menu?
If it was changed into something like an ACE interaction wheel menu, I'd be super happy
I've never seen a mod that fooled with the sidebar though, so maybe it's untouchable
Yes, not me but both ACR and Epoch mods have dynamic radial menus. Lot of work though
so nothing you can drop on the base game, they only work in the context of that mod
No, they are both APL-SA so...
More seriously, the code is designed with the mod being present but could be coded to be more generic. Epoch's DynaMenu is particularly good, context based - what you are looking at, what it's state is, what is near you, very configurable and graphically pleasing on the eye
So I'm script illiterate and need some help.
Would there be a way to set up camera modules, and code so a monitor was showing that camera's view? As if it were the security center display of some kind?
Hey, do you think this : https://www.soyoustart.com/fr/offres/1801sys47.xml
is enough for a arma 3 server ?
Is there a way to retrieve the "name" of a curator ? I tried name myCurator but it returns an empty string
module's config says expression = "_this setVariable ['%s',_value,true];";, what is this %s duda ? Never seen this anywhere
Nevermind, it kinda means "the name of the attribute you are setting up". In my case the attribute is "Name", so myCurator getVariable "Name" returns Zeus#1, as expected !
Thanks everyone for being my rubber duck 😉
@still forum Oops my bad, thanks for answering anyway
i desperately need help with solving our supposed FPS issues. Is there anyone willing to PM/Talk to me about configuration?
run the profile build
but I don't guarantee that you will understand the profiler sections or that anyone here will tell you what they mean
but if you have scripts which take FPS then you might be able to see them in the diag_captureSlowFrame output
Is there a way to check if the helicopter is ready to fly afther turn on the engine?
You mean if rotor spins fast enough?
yes
Could check rpm maybe
@dull drum maybe add magazine to weapon with addWeaponItem, that should reload it
@astral tendon what is the purpose of the knowledge?
Why ask?
perhaps someone has figured out what you are trying to do in some other way
I only need to check if the player helicopter engine is ready to fly
I mean its ready to fly the momeny the engine is turned on
No its not.
there is however a paramterer that determines the time when it actually takes off
startDuration = 5;```
if this is set to 0 the helo takes off immediately
So, how do I put that on script to check if the engine is ready and the helicopter can take off?
I recall the value is in seconds
possibly you can read it from the config and calulate form the time engine turns on
or check if the RPM changes when the time is up and it lifts off and do something with that
rotorsRpmRTD can check it, but I guess the RPM is variable from helicopter from helicopter right?
Indeed
It might help if you explained what you are trying to do @astral tendon
check if the helicopter can take off afther the engine has ben turn on.
For doing what?
Cause I will go back to my original answer of "when it takes off when you hold down SHIFT"
We are not mind readers... so explaining the end game of what you want always helps
If (TheHelicopterEngineIsReadyToTakeOffCommand _myheli) then {
systemChat "Hey jimbo, your helicopter is ready to take off"";
};
Why would you need that... don't you get in the helo beforehand? Maybe for a message saying "Get your arse in here bud, we are leaving!"
yeah sounds like a lot of hassel for just to remind someone to get into the chopper
especially when it might not even be doable
Why soo much questions? is like if I ask how do I sprint in the game and you want me to write a hole essay why I need to that instead of saying press shift.
also not sure if advancedFlightModel uses StartDuration
because what you aim to do with often helps to come up with a solution
You are asking for something that requires a bit of coding to do... i.e. our time... but you're not getting my time now
Last time I asked for a code check here I was called stupid for not using google.
That's... unfortunate. That said... the message that "Hey jimbo, your helicopter is ready to take off" really should be if the player is near the helo... cause you don't want to bring in punters when the rotors are turning anyway
Would this possibly be for a Life server?
🙄
Now see, that's the problem right there... demonstrated in a few semi-anonymous discord messages starting with "Why soo much questions?" Well, see all those people with blue tags... They are people who over the years have done quite a bit of stuff for ARMA in all its many incarnations. Then there are the other people on the discord many of whom have spent a large portion of their free time working on the many incarnations of ARMA... And all of us try to help people who need help. And help people do things that, sometimes have been done before but many times are new... But when you're asking the community to spend time working out how to do something there may be a question of why? Because none of us get paid for this and we have many other ARMA demands on our time and if we don't understand what you are trying to achieve, or you suddenly develop an attitude then we might just go "Meh"... just speaking for myself tbh
As far as my experience in this discord teached me is that I should not ask for script or help clear/debug a code because it's usually ends with people questioning why im even doing it or why I'm Lazy or stupid for not search on right places (Yeah, I know those places to begin with) and how I'm a terrible coder, so I'm limiting my self to only ask for commands and clarifications on how they work instead ask for help with my code as I use to do before.
Of course is not all users that do that, others actually try to help or message me explaining stuff, those guys save this discord for me.
So your, questioning may end with what I'm already expecting, sorry if I juged you wrong.
You can check my message history mate... always try to be helpful
@astral tendon mostly I've found the feedback helpful. there is always the occassional turd response, but that's to be expected in a public forum such as this one. take the good from the bad.
Okay all I’ve been screwed so many times, I’m stressed,every person I have hires for custom framework has turned out to be total assholes and scammed me out of a lot of money, is there anyone out there that can make a custom framework for my community, not a milsim but a life server, and I would like it to be rp framework not altis please let me know thank you
I would recommend learn your self really, Its kinda hard do that kinda stuff with out people who you trust or have money into it..
☝
Must say, as someone who has run persistent 24x7 servers since 2014... Make the server yourself, or in a team..
Your server has problems, how would you fix them?
But not pay someone to do it for you
if you pay money for stuff you must make ironclad contracts
also off topic: but damn it irks me that "Altis life" mode is now called Altis
makes not sense to me
Just "Altis"?
Deliberately I suspect🤢
People have referred to it as "Altis" on chat at least.
I dont pay that much attention to what the servers and whatnot are called
anyway. carry on with the channel business
I'll catch some ZzZ
Not long before it gets shortened even more to A mod
is it possible to temporarily change an individual spawned vehicle's "threat"? ie so an AI tank would shoot at a civilian vehicle
You can try to assign the Driver group to a different Side. E.g.: Creating a new one (using the Enemyside) for him, then let him join in that one.
Again me with my noob questions, not finding much on google.
Looking for a if ai unconscious then enableSimulation false; till revived or something like that, and maybe the best way to implement it? Using ACE3 but find it annoying how knocked out AI "track" players while in unconscious state - basically ending up "twitching" all over the place.
A nudge in the right direction would be appreciated
"till revived or something like that" can't revive things without simulation tho I guess
Will you be able to change state back to true if someone interacts with the AI? say try to apply a bandage or open medical menu, something along those lines?
Not sure if ACE Interaction works if simulation is disabled
Maybe you could do disableAI stuff instead
make the AI deaf and dumb and blind
I'm not sure if there are good eventhandlers for ACE unconscious stuff
https://ace3mod.com/wiki/framework/events-framework.html#22-medical-ace_medical ah yes. ace_unconscious
https://ace3mod.com/wiki/framework/events-framework.html#22-medical-ace_medical ah yes. ace_unconscious - not too sure what I am looking at.
But what you suggested first is that I look into a if _unit setUnconscious true; then _soldier1 disableAI "AUTOTARGET"; type of argument? The script does not have to be repeatable as the AI should be ziptied by the time they are revived
Also, with _soldier1 is that global or a unit variable name? If it is a variable name is there a way to set it to global or "all AI in mission"
"that I look into a if _unit setUnconscious true; then " no. Use the eventhandler to detect when a unit goes unconscious
"Also, with _soldier1 is that global or a unit variable name?" _soldier1 is a local variable, so it is neither global nor a unit variable name
"If it is a variable name is there a way to set it to global or "all AI in mission"" a variable can only point at one thing
As I said, use the eventhandler. The wiki page shows how
On the wiki now. Thank you
@restive leaf were the people I'm making this for not already downloading a 13Gb mod-pack, I'd happily add thyose to the list.
But I was more concerned with general / vanilla ARMA capabilities, and if so how one goes about scripting / writing those lines to do so.
https://community.bistudio.com/wiki/createDiaryRecord Anyone knows what's ment by unit ID? See teamSwitch tag
hmm, like that I would say the sqm id
but I clearly don't know
@tough abyss would you mind if I provided an off-the-shelf script inspired by your sqf if (dayTime < 16) then { if (sunOrMoon isEqualTo 1) then { if (!((hmd _unit) isEqualTo '')) then { _unit unlinkItem (hmd _unit); }; }; }; on what will be https://community.bistudio.com/wiki/Mission_Optimisation ?
unit/objectid is apparently not really intended to be used by normal users 😄
It's the unique object id, same that's used over network too. I don't know of a way to retrieve that.
You know the numbers on trees that you could get in 2D editor to hide trees? That's object id.
Also check CfgDiary>>FixedPages there is a %LINK_UNIT_TEAMSWITCH% it autofills something.
Thanks alot. I already thought it was something like that. Didn't know about CfgDiary though.
ObjectId @cosmic lichen same id you use for triggerAttachObject
Thanks.
it would make sense
There is waypointAttachObject that uses id as well, same id
Only works when you sync in the editor AFAIK
And yes it is sent over network, but net id could be something else
In any case this shit is old
I want to use set3DENAttribute on the module moduleRespawnPosition_F to change the side value to blufor.
I tried using side and the value of 1, as well as "BLUFOR", west and BLUFOR but it doesn't nothing, here is the config path for you to see it too
configfile >> "CfgVehicles" >> "ModuleRespawnPosition_F" >> "Arguments" >> "Side"
Any ideas?
_logic setVariable ["Side","-1"]; Side is represented by a number
@tough abyss reload alone went pretty well, now I'll do the trick for pressing R 😃
right
@brave jungle I don't think set3denAttribute will work because this module uses Module Framework
YourModuleVarName setVariable ["Side","1"];
So what does test = player createDiaryRecord ["diary", ["Record 1", "We can't refer to next record (("]];
return?
typeName test fails.
test = player createDiaryRecord ["diary", ["Record 1", "We can't refer to next record (("]];
typeName test;
// returns
"DIARY_RECORD"
@hollow thistle How did you test that?
hey there,
Is there a way to retrieve the player's BI Unit by script ? I know we can gather UID, profileName, Steam name. What about other player's info ?
hey quick question
Can a mission have a script in it that runs during 3den
automatically?
@vernal mural Do you mean their character?
nope, the Arma 3 unit I guess
Ahhhhhh, gotchya
I know about https://community.bistudio.com/wiki/squadParams for squad, but not about Unit
maybe a unit fills these
gonna try, thanks
Indeed squadParams give Unit informations 😮
And the Unit name is Unique, great way to check if a player can have some privileges. However I wonder if it's a HTTP request made on the fly, or if there is some kind of local storage once the game is started. If so, modification of local content might be possible
@peak plover What do you mean by running during 3den?
Can anyone explain why the variable "briefingname" does not show the briefingname defined in intel class in mission.sqm and in descriptiont.ext? trying to understand why I'm always getting the filename instead of the actual briefing name when reading the variable.
Returns the name of the current briefing/scenario name. <- THIS it does not do. It returns the filename,
It does. And missionName returns the foldername
Well not for me, defined briefingname in description.ext and verified it is under the intel class in the mission.sqm, but all it shows is the filename
briefingname is a command though? Not a variable as Dedmen said
have you saved and reloaded the mission? MIght be a syntax error somwhere
You call it and it returns the mission name
You 100% sure the description.ext is in your mission/pbo?
checked missionConfigFile in config viewer?
YES. It shows correctly when loading the mission and everything just not in the mission itself
I'm trying to use it in an intro text and all it shows it the filename
Oh. Never have mission selections. Just one mission per ARMA instance on the dedi. Learn something new every day. Thanks
Yeah i'll try to make a new mission then and just set these things and nothing else and try to figure out why it returns the filename, not the actual briefing name. If I can reproduce I'll make bug report.
Can anyone spot the error ? https://pastebin.com/rEvNMXN9 Code is executed when display is loaded onLoad = "_this spawn Enh_fnc_briefingEditor_onLoad";
The display is found properly, also the controls, but nothing happens. No log entry, no script error. I am too blind to see it.
diag_log on start of script?
disableSerialization? can't store ctrl/display into script as can't be serialized
No luck
"colours" there's your error, you misspelled color
😄
Have you tried filling literally everything with diag logs or systemChats and seeing where something stops?
Can't find anything that hits my eye
Enh_fnc_briefingEditor_onLoad are you sure its not nill at the moment of execution?
Yes I did. Actually this script was working when I was testing it from within a mission.
It's not nil.
The variable retuns the code, tested that already.
I checked Enh_fnc_briefingEditor_onLoad with the debug console so see if it isn't nil. Before opening the UI
Enh_fnc_briefingEditor_onLoad -> missionNamespace
but if you'd put a diag_log/systemChat right after your params, you'll know 100% whether it runs or not
I did that, as I said 😃
"Enh_fnc_briefingEditor_onLoad -> missionNamespace" not sure what you're trying to tell me
Then explain what's wrong. Because I hear that it doesn't work, but it works. And I have no idea what's what
That's exactly the issue. The script runs fine, but none of the controls are filled. (ColourLB for example)
adding logs at the comands that fill the controls, the control is defined properly, and you are passing the right arguments to the command that add's stuff?
Check that the other controls are loaded before your onLoad fires? nvm spawn does that
private _ctrlComboTags = CTRL(90);
diag_log _ctrlComboTags;
{
diag_log (_ctrlComboTags lbAdd _x);
diag_log _x;
} forEach ["Linebreak","Marker","Image","Font","Execute","ExecuteClose"];``` ```22:40:13 Control #90
22:40:13 -1
22:40:13 "Linebreak"
22:40:13 -1
22:40:13 "Marker"
22:40:13 -1
22:40:13 "Image"
22:40:13 -1
22:40:13 "Font"
22:40:13 -1
22:40:13 "Execute"
22:40:13 -1
22:40:13 "ExecuteClose"```
{
idc = 90;
x = CENTERED_X(90);
y = DIALOG_TOP + CTRL_DEFAULT_H + 92 * GRID_H;
w = 90 * GRID_W;
h = CTRL_DEFAULT_H;
onLBSelChanged = "_this call Enh_fnc_briefingEditor_onLBSelChanged";
};```
Controls detected, data which should be added is correct. The control#90 is the correct display control with idc 90. But for some reason it's not adding the stuff to the control.
maybe some script runs later which deletes all elements
Checked that by removing every other script related to that ui
Add a sleep 5 between every element, so that you should be able to watch it live adding element by element
Alright, I found the issue
Calling ["ShowPanelLeft",false] call BIS_fnc_3DENInterface; ["ShowPanelRight",false] call BIS_fnc_3DENInterface; after the _display variable seems to do some weird stuff to the _display variable
Hiding the panels before actually storing the display into a variable solves the issue. That's actually how I did it in my other scripts.
Is that even possible?
fucking hell
better PM KK on BIF 😄
FUCDJFo<shDFOIjahdfoüasdfdsf
tons of other vars in there without private too
I just spend 3 hours finding that.
Well not quite 3 hours but still
Alright, requested that to be changed.
Guess I learned another lesson today. Private variables need a TAG now too _Enh_display 😄
Thanks @still forum for your help
wonder if logging the _display would've showed you anything. Probably see the different idd
But weird that the other display happened to have controls with same idc
Nah not entirely.
lul. You could also spawn that thing instead of calling (from commy ACE slack)
Spawn what?
the bis fnc
Sure, next time I just spawn about anything
Any supply drop with random gear script? For a single player mission
I'd use the vanilla supply drop module and randomize the crates content.
However, randomizing the crates content can be a bit tedious. So I'd google for a solution to that.
Wasn't there a command for it?
I have seen it somewhere ... 🤔 Can't check niw, currently on mobile.
Biki search finds nothing.
What Lifestate returns?
a string
i assume
one of
"DEAD"
"DEAD-RESPAWN"
"DEAD-SWITCHING"
"INCAPACITATED"
"INJURED"```
Was asking @tough abyss
The Wiki answered!
freshly tested: "INCAPACITATED" @tough abyss @tough abyss
Nice 👍
Not nice 👎
true
true; returns "unconscious"-based animations
unconscious
unconsciousfacedown
unconsciousoutprone
and deadstate for… well, you know
can i just check something
i'm doing a position based music fading thing
just to test
is it jip safe to have a localplayerjoin script or whatever it's called that plays music, then fade it elsewhere
and is it better to use event handlers or the script file
yes, safe to have a local script
and i can't find the name of the sqf file that gets run on player load
as long as it doesn't have to be synced with other player's music
yep that was the only thing
that's fine
what's the best way to run a script when a player spawns in
or
hmm
the issue is basically i want music to always be playing
regardless of jip
and fade it in and out
https://community.bistudio.com/wiki/Event_Scripts for all available event scripts
ah thanks
can i just check something else: with JIP, presumably you only have to worry about synchronising the state of your scripts, i.e. if you destroy a building with a script, anyone who joins will presumably have it destroyed for them as well because it comes with the built in multiplayer synchronisation of the world
huh
but it syncs positions of units and things
that seems very odd
is that because it would be insane to sync the map on join
so if you kill a unit it would work with jip, but map buildings aren't synced
ok
thanks
wait so spawning the explosion
would the JIP client see it as they join
i.e. the explosion object doesn't get removed after it goes off
so what's the mechanism by which the syncing works like this then
i could see if the explosion object was created exploding for the JIP player because the explosion's explodeyness isn't tracked
i see
ok
wait so when someone joins do they have all these events happening on their client
seems like it would be slow
to recreate the world from what's been done to it reather than syncing the state
yep
ok
so it would work with setdamage (setdammage hehe) but wouldn't with a removign one
i don't know what removevehicle is for map objects
so does deleting not get synced
units and vehicles etc i assume are always synced
so i can have a non repeatable server only trigger that e.g. spawns a car, and it will work and JIP players won't be able to trigger it again
Does anyone know what parameter task does? https://community.bistudio.com/wiki/createDiaryRecord
Using simpleTasks player # 0 for testing fails with an error message
that's a different command you linked
also maybe the player has no tasks, so it's an empty array so it has no first elemen
and this is what the task type hsould be
No I didn't link the wrong command
typeName (simpleTasks player # 0) returns "task"
So is it a task now or is it not.
what
ah i see
hang on but your initial question was 'what does the task parameter do'
Well, if I could get it to work I'd probably find out myself.
I don't really understand your question
you're not able to create a task and thus simpleTasks is empty
is that it
and the reason you're unable to create a task is because of the task parameter to createDiaryRecord
gimme a sec, gonna check something
The question remains the same, what does the parameter task in createDiaryRecord do? Does it create a task, does it add a reference to the task in the briefing, or does it do nothing?
In order to find that out, I create a task and afterwards added that task as parameter to createDiaryRecord
But nothing.
since there's a Tasks tab which tasks automatically go to
hmm
not sure then
but I would assume it's what the tasks system uses to create the diary menu Tasks tab and its contents
most likely.
So it's doing nothing because creating that task prior already created that entry.
Alright, the taskState parameter does what I expected.
Gonna add that to the wiki.
i was unable to register an account
pm @ dwarden for an account
yes
Hey I'm trying to add music to a vehicle when the engine is on, but it doesn't play anything
if (isEngineOn (vehicle player)) then
{
nul = [this] spawn {while {true} do {(_this select 0) say3D ["radiomusic", 25, 1]; sleep 268;};};
}; ```
It works without the if then thingy
but then it plays 24/7
Well, considering you're not looping the check but are looping the execution of the sound, that would make sense
Should the check be looped as well then?
i mean yeah, but you need to make it an efficient check.
How would one do that 🤔
you dont need, but it's highly recommended
I'm basically just copy pastaing script from forums and praying it works xD
.
Well, check if the player isn't on foot (vehicle player != player) and then check the engine. Or you add a GetInEH and GetOutEH so you can terminate the loop properly
And you'd need to create a loop to check if the player is on foot then the rest of the code
Oh i didn't know that existed, instead of the GetIn and GetOut use ^
Uhhh I don't know If I can do that by myself tbh but I can try
Something like
someVehicle addEventHandler ["Engine", {
params ["_vehicle", "_engineState"];
if(_engineState) then
{
// some code executed when the engine turns on
nul = [_vehicle] spawn {while {true} do {(_this select 0) say3D ["radiomusic", 25, 1]; sleep 268;};};
}
else
{
//engine off code, terminate the thread somehow.
};
}];```
or truck, or helecopter, or whatever
^
Ye ye
Also, if (_engineState)