#arma3_scripting
1 messages ยท Page 98 of 1
You could trigger off animStateChanged instead but that's likely hard work and probably has gotchas. Sleep after onUserAction might be the best bet.
There are so many animStates ciphered behind those letter codes, my brain would explode, not to mention that it spams the event too often.
yes
There might be a way to convert animation state => stance with config. I'm not sure how the game does it otherwise.
I have one little idea. Whenever he presses/releases the button it resets one shared timer for all those events. Or maybe something like a semaphore, so it won't do any chnges unless its sure that all anims are completed. But I am not yet sure how to implement it. ๐
Are you using onKeyDown EH?
No idea what onUserAction event is.
Doing such things is bad for numerous of reasons
Having a star/stop method, best used with with a timeout and keep alive would be the much, much better option
Designwise, keeping a local loop (scheduled) active that says "yes continue doing that" every X seconds with a corresponding start and stop remoteexec
An external loop, checking if it still should continue doing that and aborting if it was not told to continue in X seconds
Is the smarter thing to do and much more network friendly because of less chatter
What, like have a local monitor thread on every box?...
I'm not sure you understand. This is just replacing setMass with remoteExec ["setMass", 0]
It is replacing remoteExec with setMass
Not the other way around
ok now I have no idea what you're talking about.
In here, you said that you are spamming remoteExec
remoteExec target 0 is spam in my book.
When there's a command that should just be updating things efficiently.
Instead, do a start/keep/stop remoteExec call to reduce the spamming of the remoteExec, reducing network chatter
Spamming, in for code, means running an operation over and over again (eg. "spamming that page refresh")
Got you. Looks like it works the same way.
Are you doing something similar to DynamicCamo?
https://forums.bohemia.net/forums/topic/223202-release-dynamiccamo-script/
DynamicCamo (Updated Version 1.5 ) 17/5/19 What does it do? It takes account of players stance, uniform and environmental factors to adjust the players and/or AI unitTrait CamouflageCoef and audibleCoef A low camouflageCoef and audibleCoef gives greater camouflage to the unit and makes it harder ...
Just adjusting the camouflage and audible coeficients based on player's stance.
I got that. DynamicCamo, from what I recall, does exactly that.
You may want to check it out for inspiration, ideas, or improvements.
Thanks for the tip, I think that I have checked it already, and had not found it good enough. But it migh been a different mod though. ๐ It will be part of a greater stealth system, which I plan to use in my scenario. ๐
No bother. ๐
I want to make it as simple as possible (vanilla like). But it starts to look promising now, at least from my point of view. ๐
But what does it look like from the enemy's point of view? ๐ฅ
Oh... Bad joke.
Oh well, they will get their ||as*|| kicked. ๐
Actions
Because it works. Most people really don't care. The amount of time required to work properly with RV's SQF is huge.
Only a bunch of idiots like us would do this type of thing.. Because we are masochists... ;)
Thanks for all the answers guys!
Morning Everyone
'afternoon
I am having issues uses an attach to effect with a aircraft but itโs a little complicated
I was told this channel might be able to help
sure, if the issue is expressed ๐
Iโm not home so iโm going to do my best with what I can on my phone
am I able to post config in here or no?
idk the rules on posting files
Just use pastebin or something if it's long
iโll have to wait till later then for the config
And if it's purely config, use the config channel
What do you mean by actions?
I mean the action property in anim state config
but why do you even need that?
just use the stance command in animStateChanged EH
what happens if you exitWith from an exitWith block?
you exit the exitWith block
does it mean the original exitWith will not do the exiting and continue execution of what was after it
no
ok
it means you return early
if (true) exitWith {
if (true) exitWith {2};
1
};
0
returns 2
this is kinda offtopic but discord seems to be mad sometimes when i try to send chunks of sqf through private chats, has anyone experienced this lately? it kinda has been happening more and more for me and my bud
never had that issue
Well easy to zip file and send. It may try send that message.txt/ is too long.
it happens too with >20 lines sometimes, but yeah its no biggie, was just wondering why discord thinks im trying to send maliscious code
Hello,
If I want to make some kind of IED.
Well , I have.
But it's only an object where it is "bomb" attached to it , that is not a bomb, just a simple object.
So when I want to make it explode.
I delete the current object and create the bomb (like "Bomb_03_F") position of my "bomb".
When I do this on a dedicated , on server, the created bomb does not affect players, none of the client sides do not get damaged.
How do I need to create a current bomb that explodes and kills players near it.
did you try createvehicle the bomb (so there is explosion) ?
Yes, it explodes. But does not do damage
created on server?
Definitely using createVehicle and not createVehicleLocal?
going out on a limb but it might be that the server does not have time to propagate the bomb, and once it is destroyed there is nothing to propagate
try adding a slight delay between creation and explosion?
Thanks, I will try that.
it should explode when the bomb touches ground
so create it on ground
Yes, it explodes. But does not do damage
It does work if I do that on local (local host tested, host dies ๐)
i was just thinking he uses a command to make it explode... that should not be needed
Question, this gives me error saying "Error Missing )". Why?
_loop = true;
if (_loop = false) exitWith {};
while {true} do
{
sleep 1;
waitUntil
{
player distance2D teleportoriginobject01 < 2
};
player setPosATL (getPosATL teleportdestinationobject01);
};
_loop = false is invalid
thanks!
leader player limitSpeed -1; // remove the limit This seems to have been broken?
Trying to make an helicopter move with limitSpeed and FlyInHeight.
And setting to -1 (trying to reset) will just slowly move the helicopter backwards.
While setting to 100 it will move again.
how to change sector owner?
[SECTOR, "WEST"] call bis_fnc_sectorcontrol;
doesnt do anything
that's because this function does not even exist
fuck, it was typo
I mean BIS_fnc_moduleSector, now it works
thank you
anyway
do you know how to start capture proccess for a sector?
After save/load sectorControl doesnt work, I decide just switch owner of sector by a script, but its not a proccess as default, now its just a switch between sides of sector
doesnt work - I mean that sectors cannot be captured by any side, Im already report to BIS about this bug
nope, sorry - no experience in that
if you create a wall of repair trucks, is it invincible because they all repair each other?
no because they won't
hm, they do in A2
they dont repair other repair trucks in A3?
oh, it looks like it depends on whether player is in them
It wouldn't be truly invincible because repair doesn't prevent one-shot kills
What's the function for creating editor preview images for units? Have forgotten it and now cannot find it 
BIS_fnc_exportEditorPreviews thanks
I seem to recall seeing recommended settings for it somewhere? Got anywhere for that? ๐
Ah nvm, it's in the see also
Ofc
If you don't read BIKI, I won't slap you. Lou will
thats why i dont read it
what do I have to do to make a part of initIntro.sqf file be played as an init of my Outro phase? Wiki says that this file is used for intro phase and both outro phases but does not say how do I put my code there so part of it is only in intro, the rest in outro.
I'm surprised there isn't a command to get the current phase ๐ค
Phase, as in, mission, intro, outro?
No, different phases. Honger only mentioned those to confuse you
Ah, yeah
https://community.bohemia.net/wiki/Eden_Editor:_Scenario_Phases I mean these, just to clarify
right now I have a trigger in outro-win that runs my code but there is and will always be a small delay between phase start and trigger
You could check the time? If it's under a certain amount it's probably intro, over a certain amount probably outro
Unless time resets on phase change, which wouldn't be totally surprising but would be very sad
Just a guess but it's probably for blocking the AI's view
would one know how to make something like it?
open object builder, create new file, create big cube in View Geometry LOD, save, pepper with some minimal config.cpp, use 
would a view block attached to yourself still block ai view ๐ค
ah, good old Oblivion bucket-on-a-head moment
YES I FIXED THAT
NOW YOU CAN PLAY SECTOR CONTROL IN SP
https://steamcommunity.com/sharedfiles/filedetails/?id=3018645836&searchtext=SECTOR+CONTROL+SP
anyone wanna make it for me?
im thinking of using it for a kjw imposters rewrite or something similar if it works ๐คท
changing setcaptive can cause problems (tho it can make ai dead check bodies which is neat for sp)
seems to work when attaching a random person-sized rock to player in editor
hmmmmmm
noted thank you for the test
didnt think about just using an actual object instead lmao
Hello - Is it possible to create a rearm timer for a server? One that prevents the player from rearming a vehicle for X amount of time? Any help is appreciated
you could make a rearming truck unavailable for a certain amount of time, but not per player
see setAmmoCargo and the "Service" mission event handler
addMissionEventHandler ["Service", {
params ["_serviceVehicle", "_servicedVehicle", "_serviceType", "_needsService", "_autoSupply"];
}];
can you use the reforger string table editor for arma 3? or is it a completely different format?
different format
Thanks ill see what i can do, appreciate the response
don't hesitate to post in this channel if you need help
WIll do - i have a few things im stumped on. I also wanted to know how to change the plane landing script in warlords to make them appear on the runway as opposed to flying in and landing. The problem is that they crash in the trees and dont read the runway properly and land wonky and crash 100% of the time. Is that possible to create a script where the plane spawns near the player - or better yet spawn them inside of the jet?
Mind you I am very green with scripts
like "create a jet and teleport the player in it"?
Yes but i am not sure how to incorporate that into the already existing script in the warlord mission/functions
ah, that, I do not know ๐
I think i found the requestaircraft function, but from there i am lost lol
anyone know why that dont work?
because you're doing it wrong
"fn_WLAircraftArrival.sqf" can I override a mission script to make it instead place the player in the aircraft? https://sqfbin.com/apepisagafuzowejoziq
I have completed my function for checking player's stance. ๐ Seems like it works reliably now. Feel free to suggest or criticize! https://sqfbin.com/gumiqetapapukixitage ๐
sqfbin.com please
I see, I didnt think it would be different than a regular script. Thanks
it's a framework, and an official one so I do not know what is allowed / secured
Ahh makes sense. I know someone made the redux with all this stuff but id assume its a full rewrite done privately. My quest continues โญ Thanks again
How to make text highlighted on sqfbin?
there is a syntax highlight bug if you use #; use select instead
is there any way of detecting when an ai unit speaks (and what they said if possible but i'll just take an event for now)
you can get a Ai to lip sync to a speech you have done
speak as in Conversation system or speak as in radio system?
radio system/ai callouts
so contact, man, 100 meters, front etc
use case is eavesdropping on enemy ai radio comms
hmmm I don't think there is such a thing
i suspect as such given cant find anything on biki but feels like it wouldve been added by now
though at the same time i cant think of any other use case
I had https://community.bistudio.com/wiki/Arma_3:_Scripted_Event_Handlers#BIS_fnc_kbTellLocal for Conversations system, but that's about it
yeah unfortunately ai speaking is engine driven it seems 
have checked through mission events too and theres nothing
theres no getter for setRandomLip either so i couldnt even take a guess
meh, back to just using randomness based on group combat state
there is group "spotted" EH iirc
eh, not really much point as cant get the voice lines
my hope was to be able to get the voice line the AI had spoken then play it to the player whilst their spectrum device was in the right frequency
I see
no cigar I'm afraid. perhaps an EH request ๐
but seems its not possible unfortunately
I would but I cannot think of a single use case otherwise
meh, i'll request anyways
How do I make sure that a piece of code is executed within one game frame, so I can be sure that the conditions has not been changed.
if (condition) then {
command;
command;
//is the condition still true here?
command;
...
};```
isNil{ code... }
OK, is this good to use in practise?
I have this code https://sqfbin.com/gumiqetapapukixitage. It works, but in-between any condition checks, there might be a few frames gap I suppose, and if the conditions change during those gaps, then this code migh become unpredictable.
if I have some variables %1-%12 and the line ends with ...Monitor%4and I need to put a 4.) next to that, how can I not trigger %44 and not have the space if I did ...Monitor%4 4.)?
%4%5 and put the 4.) into another argument
or just
format [...] + "4.)"
or if its just for displaying, you can use a zero-width space
Having some trouble using flyInHeight. I'm putting this in the init of my helicopter: this flyInHeight [5, true]; but I keep getting an error, "Init: flyinheight: Type Any, expected Object". What does that mean?
(code and syntax taken right from the wiki page https://community.bistudio.com/wiki/flyInHeight)
alt syntax is 2.14 only
Ah... is there any way to specify I want it flying at 5m in that case? Or will it only work for >10
this flyInHeight 5 is perfectly valid IME
okay tysm
I'm not sure what the difference is supposed to be for the alt syntax.
oh, it's kinda documented.
I only used very low flyInHeight values to hold helis on the ground after a setVelocityTransformation, so maybe it doesn't work for actual hovering.
worst case you can force it with setVelocityTransformation but that's a lot more work.
Is there a good way to set, say, the 1st, 2nd, 3rd, 5th, 6th, and 7th elements of an array while leaving the 4th alone?
Or is it just _arr set [0,value]; for each one
{ _arr set [_x, _value] } forEach [1,2,3,5,6,7]; ?
yep this, use for/foreach if needed
The set-spam should be faster though. Depends on what you're optimizing.
yeah I'll just setspam
devs: spending a lot of efforts to be lazy ๐
Now if the array only has 8 elements then the faster way is probably to create a new array using resize (fill version) and then copy elements 0 and 4 into it.
But if there's some arbitrary amount of extra crap on the end then that's probably not a great idea.
Is there any possibility that this piece of code executed withing one frame could cause stutering of my game?
yes, if you have a Pentium II
According to my calculations, under the presumption that the game runs at stable 60FPS (if only CPU dependent), the total available execution time for each frame is 16,66 milisecs. That would mean that my code consumes 0,00024% of that capacity, i.e.** 0.0024โฐ** of my frame. But my calculations could be wrong, because graphical FPS is not the same as game engine ticks, or am I wrong? ๐ค
1/ if it is needed, just do itยฎ
2/ only two instructions in an unscheduled thingy are not going to kill the game
3/ the game: you lost it
One of your calculations is wrong too :P
should be 0.024% of a frame.
wait, did you use some weird-ass percentage symbol
That's promille. ๐
you used a weird symbol and got it wrong? :P
Is there a way to retexture a unit to be completely black?
It's correct! ๐
I am not sure to be on the right channel but I have some question about how to mod the CAS Modul. To be more precise, I just bought the new creator DLC and spotted they added their plane to the CAS effect modul. I really enjoy the SOG dlc but thereโs no plane added. So do you know how to edit or add plane to the list ?
What do you mean by "3/ the game: you lost it"? ๐ Explain pls.
an old internet meme ๐ https://en.wikipedia.org/wiki/The_Game_(mind_game) the game's goal is to not think the game - every time you think of "the game", you lose
god dammit
I know players can have a custom face texture. But can an AI unit get a custom face texture? If so, what command would it be to apply a custom face texture on an AI unit?
setFace
Thank you โค๏ธ
Probably a very simple question, but I'm brand new to scripting and am experimenting and figuring things out mostly on my own.
I've got a simple sequence where a heli is unable to move via the script inside the heli init
Transport2 disableAI "MOVE";
A trigger later down the line overrides that and the heli takes off, flies a while, and then lands to collect the player squad. The issue is, the heli only lands for a few seconds before taking off again and moving to a Transport Unload waypoint to transport the players. I have the following script also in the helicopter's init
Transport2 disableAI "TRANSPORT UNLOAD"; but it isn't working.
The trigger that is supposed to set the heli to move to the transport unload waypoint is a radio trigger, but the heli will leave and go to the transport unload waypoint without the trigger being used. Obviously, something is wrong with the script itself but I can't figure out what
Provide the script and the names of all relevant variables and files.
A potential method would be to tell Transport2 to land and hold on the specified position then the radio trigger would skip the hold waypoint to move to transport unload. I often use the Hold waypoint to manually pause AI movements until I am ready.
see https://community.bistudio.com/wiki/disableAI for possible values
you are trying to disable "TRANSPORT UNLOAD" which is not an AI trait but a waypoint name
I think this is where I'm going wrong ๐ Like I mentioned, I am BRAND new to scripting and have near-zero knowledge with it and really only know a handful of things I can do using the object's init box. I've been using the disableAI "MOVE" script a lot and taking it literally- I assumed it stopped the MOVE waypoint specifically. I'm going to be trying Uncle's method of utilizing a Hold waypoint.
the page says it all; you can disable AI aspects like move, target etc
if you want to prevent a helicopter from moving, prevent him "MOVE" as well
but the hold wp method is better/safer
This worked very well, and it's really easy to set up too. Thank you!
setRepairCargo available since OFP, getRepairCargo introduced in A3. i'm taking an SDL vacation from this for now
So I need a bit of help, I am trying to make a script to go in a helicopter on a flight deck, so that when a player is detected inside, it forces them to dismount (this will be a respawn and is currently sync'd to a module) I have tried a few things but cannot get what I could find to work
Thatd be the command to use, all you have to do is work out how you want it to trigger, and point it at everyone aboard.
At least, thats a very hard instant get out :p
i guess most sqf scripters are more enthusiastic gamers than professional coders.
some player one day decides he wants a scenario where x does y. so he goes and asks somebody how to do that. the resulting answer is treated as magical incantation rather than something that can be taken apart and understood. and so it is copied around, de-formatted, horribly disfigured but never changed.
I ended up figuring it out, Basically stuck that in a trigger in an if clause and set it to activate if a player entered the area, thus whenever a player spawned it would instantly boot them out of the vehicle
taken times ten โฆ and you get a gargantuan mess that makes every programmer puke, and works sort-of
its the majority, me thinks. ofc, high-profile projects like ACE or ACRE are created by and attract professionals
i saw my code doing circles and found it so badly copy pasted that even the simple stuff stopped working
heli addEventHandler ["GetIn", {
params ["_veh", "", "_unit"];
if (isPlayer _unit) then {moveOut _unit}
}]
Hadn't considered GetIn EH; would that work if a unit spawns into it rather than boards?
Does anyone have experience using isLocalOnly vs turning things into simple/super simple objects? Which would be more performant in a scenario with a large number of decorative objects?
I can find basically no information on isLocalOnly apart from:
When enabled, the object will exist as a local instance on every client. It will not be synchronized over the network. Use this primarily for static (decorative) objects in order to optimize large-scale scenarios.
Well
It helps in theory. If it's noticeable, that's a different story
From my experience there is no noticeable difference
in MP it just stops network sync which does have a noticeable difference if you are creating custom maps from complete scratch using editor props (which I have done before, ~20k objects without issues)
Whether it was without issues because of local only or not? ๐คท
If you want to get the best performance you need to combine different methos
simple object + dynamic simulation + conditional show/hide + localOnly
and so on.
but at least they put their name under the code
Hello. Im trying to have an AddAction in my mission on multiplayer but I am the only one who can see the action as the host. Can somebody please tell me how to bake it global?
This script is in the init of a laptop in Arma 3
casa1crew = laptop addAction ["pickup CASA 1 Crew", {[c11, c12, c13, c14] join p24; laptop removeAction casa1crew}];
I think that, with isLocalOnly, if you disable damage and physics simulation on bigger objects (boxes, containers, hosues..), and enable simple object option on small decorations (bottle, laptop, radio, tv, furniture, or distant big objects..), then it might work. But everything local should be non-interactive (like doors) or have no effect on other units, players etc. Not sure about the performance gains though. You might put the objects into separate layers in Eden editor, and then edit them in bulk, and try both local and non-local options. And as @cosmic lichen suggested, you might combine different approaches. One group "Local only - simple objects on", second group "Local only - damage on, simulations off", third group "Global - fully interactive things".
I don't think you need to choose between the two if your concern is purely performance.
I've never looked into it, but my assumption was that if you have both checked, a local simple object would be created.
Which I would think is the most optimized version of a static object possible. No network sync and limited simulation.
I mean to do simple objects in multiplayer you need to convert them with a script, as even before the box got removed it didn't work in mp. I'm pretty sure they only exist on the server, with just the geometry/textures passed to clients?
So I don't really know if they'd work together?
I'll probably do a test with like 1000 props and see if there are any noticeable performance gains.
Is there any inbuilt performance testing tool other than the one for how many ms script takes?
Or any better way to do it than just looking at average fps for 5 minutes?
FPS would be a good indicator for local machine performance impact, but network performance might not be directly associable with FPS. 
Try these:
https://community.bistudio.com/wiki/diag_fps
https://community.bistudio.com/wiki/Mission_Optimisation (performance at the bottom)
Ok, thanks
Client fps is really my main goal. In the past thatโs the main thing thatโs been a problem for missions I make
I have no idea how I managed to miss the second link 
Also, maybe try to enable dynamic simulation on AIs (unless you do something scripted (/waypoints) with them, when they are still far away from a player), or lower the number of AIs. For civilians, use civilian presence module with simple agents option on. And if it is at night, then restrict the number of dynamic light sources.
As a professional developer, scripting in arma is only frustrating due to figuring out all the nuances of when bis functions fail. Also, i miss libraries with overloaded functions. Took me way too long to realize joinSilent only accepts arrays and not units.
Regarding dynamic light sources, do you know whether streetlights on the map would be good to hide when not in range of players?
Or would that not do anything for performance?
If the area close to the player is spammed with active light sources, then it might help to use hide terrain object module to hide some of them. But other than that, it does not matter.
Ok
You need to have Simple Object selected to have the Local Only option available.
I'm pretty sure they only exist on the server, with just the geometry/textures passed to clients?
Simple objects still have some amount of network traffic as objects if that's what you mean.
Iโve had a bit of trouble with that module quite often, as well as with the edit terrain object module every time. It only hid/changed stuff on the server and for clients both the edited and original objects were present
I think Bohemia mustโve got rid of the simple object button? Either that or 3den enhanced has got rid of it
Depends on the object you are looking at, some have it, some don't.
I don't know, I think it should work in MP. But I would use operate locally, if you want to clear out many objects. If there are large quantities of redundant objects that you don't need, like a forrest or a block of buildings, then you might try if removing them helps the performance.
Player joinSilent grp; fails - [player] joinsilent grp; correct
Or like you can't use moveInDriver on someone already in the vehicle.
i know what you mean. coding for 2 hours testing everything and than its cause of one little freaking detail
Hmm ok, maybe there was something weird going on with the server? Or I didnโt have that ticked so it didnโt sync properly with clients?
The button should only prevent excessive network traffic. This way the server does not need to tell the clients to remove the object, they do it themselves.
Ah yeah thatโll be it, Iโm just coming back to making some stuff after a bit of a hiatus
Ok, some other weirdness mustโve been going on when it failed then
It is old, but they had similar issues here:
https://forums.bohemia.net/forums/topic/210154-hide-terrain-objects-module-in-multiplayer/
I have the new hide terrain objects module removing everything but vegetation on Tanoa and it runs great in single player through the editor, but it seems to make multiplayer unplayable. I went from 60+ fps to 0-5 fps on a mission that runs fine in SP. To test the cause I loaded a new game on Tan...
How about lacking a debugger :D
Also, i miss libraries with overloaded functions.
my friend you dont have to wait for long
OOS is getting better
thats what i do. i test little bits in the debug console to see if it works xD
How about lacking a debugger ๐
for that OOS will also have a solution in some future
I'm looking at ur doc but it's not really clear to me as what the idea of OOS is
it's a new scripting language?
wasnt that the object oriented one?
Sorry to bother you replying to such an old post but did you ever get this to work properly? I found the same video recently and i've been trying to get the script to work for an op i'm planning to do with my unit and part of it is having low gravity (its using the optre phobos moon map) for immersion.
Actually yes i have. I can send you the example mission in dm if you want.
I would greatly appreciate it
And I'm also missing some sort of performance profiller
Would be nice to know which scripts are being suspended a lot (e.g. are performance heavy)
scripted low gravity is very difficult to pull off in multiplayer due to locality problems
and even then looks pretty bad
If you mean inside the init box of the object in the editor, try using this instead of laptop when adding the action.
casa1crew = this addAction ["pickup CASA 1 Crew", {[c11, c12, c13, c14] join p24; laptop removeAction casa1crew}];
Scenario: Mission on dedicated server, im zues, I have a function that needs to run on a player.
If from my client I run
// zues module
params ["_posASL","_unit"];
_isUnit = isPlayer _unit;
Assume the object passed to _unit is a player controlled unit, is _isUnit true?
This code make sense?sqf 0 setOvercast 1; 0 setRain 1; forceWeatherChange; // Force immediate change overriding smooth transitions
0 setOvercast 1; Instant effect
0 setRain 1; Instant effect
So why the need of forceWeatherChange?
0 setOvercast 1; Instant effect
0 setRain 1; Instant effect
no it doesn't mean instant effect
time setRain rain
time: Number - transition time in seconds to the new value
transition time of zero seconds
it just says "I want the weather to be like so in X seconds"
doesn't mean "magically change the weather"
e.g. if you want rain, first the clouds should appear, then the rain slowly starts pouring
and instead of randomly guessing stuff, just test
the just run these two lines in a clean mission:
0 setOvercast 1;
0 setRain 1;
nothing will happen immediately
I understand. I tested them alone.
I guess the point is that the values are not the weather and only influence the progression of it, but this is... not explained in the wiki.
I think you are correct. The change from current value to the target value may happen in zero seconds, but that might not result in an immediate storm, like swapping the sky, if it is done mid mission. Using it during the init stage might be a different story though.
"Would be nice to know which scripts are being suspended a lot (e.g. are performance heavy)"
soonโข ;)
Thanks for the help, i'm doing ok ๐ซ
you mean โข? :)
...
fail
looks correct in the chatbox but all sorts of different in the chatlog
Yea i know :P
Hey, sorry if this is super simple, but I've looked online for this and also just tried it myself but I can't seem to get any of it working. Does anyone know a way we can create a restricted Virtual/ACE arsenal that also works with loaded equipment?
The standard restriction for getting gear works fine, the issue is that currently players can load anything up and it will simply allow them to keep it - we've switched to a kit list recently and sadly we can't actually enforce it due to this at the moment.
I should mention, we don't want to disable loading or saving loadouts - I'm aware that some modes like KP Liberation had a great save/load system but I wouldn't know where to begin with making something like that.
If anyone knows how I might be able to go about making one of these, or knows of a place I could find one, please let me know ๐
Antistasi has a system but it is appallingly complex
Somewhat easier if all items are either available or unavailable but still quite a chunk of code.
how big of a chunk are we talking?
Hundreds of lines. Plus it's an Arsenal hook so fundamentally complex.
How are you setting the restrictions?
from what louis has said to me in the past the way they tried was "We're using the old KP liberation script that removes items loaded from arsenal if they're not allowed"
and regarding the restrictions
the basic way
sorry if thats not the awnser ur looking for, im not the one really doing it but louis has gone to sleep for now
After testing many broken weather mods (and lost many hours of my free time) i'm doing my own weather script, with much less than 50 lines.
Just messing with setForecast, all rest automatic by Arma 3.
"Set here the time of change, for example, 30 seconds will change all in a 30 seconds cycle" - Really yes, lovely SUNNY STORM DAY!
Soon as in addon or soon as in buildin arma
ping @ashen ridge
It come back
Here is my Weather Change script. I'm sure you will love: https://pastebin.com/6FH1L17V
I think that this has to be less than, not greater than. Isn't it? ๐
if (random 1 > CFG_chanceToChangeWeather)
Yes, i fixed and updated the link ๐ค
That's a nice little script, it kinda inspires me to implement some events tied to weather forecast in my scenario, like zombies spawning during storm, so you have to find a hideout or something before. ๐ The debug thing, I like the most about it. ๐
@ornate whale thanks a lot, i tried to add dynamic weather on my missions many times, and today i finally understand how it works. for servers with greater timeMultiplier the changes will be faster, but there is nothing else we can do to make it faster other than increase timeMultiplier.
If you use timeMultiplier you can do this (small example).
private _weatherChangeDelay = 300;
(_weatherChangeDelay * timeMultiplier) setOvercast 1;
Ah nvm, should read better xD
You want it faster, not slower.
I use 0 setOvercast 1 from a 0 overcast and still the change takes 1 hour to fully happens in a progressive, flowlly and nice way (timeMultiplier = 1).
The same change will take 30 minutes if timeMultiplier is 2
Default server were 24h is 24h (timeMultiplier 1) will allways need to wait 1h more or less for a full progressive, flowed overcast change, from 0 to 1.
There is nothing that can be done about that, as i understand now.
The engine just don't let you go mad about changing overcast, like you can do with Fog for example, were a 10 setFog 1 really takes 10 seconds.
Another method would be to fade out the screen, force the change, and fade in again. Or, you can make a mid-mission cutscene with the camera pointing at the horizon, and speed up the time x times, then give the control back to the player. Like it was in Far Cry 2 hideouts. Or you can use fog as a masquerade for the transition. Build up a dense fog, force change the weather, then remove the fog.
From wiki:
NOTE: To get instant, seamless overcast change to overcast 1 advance the time 24 hours with skipTime while setting overcast transition time to 86400 seconds (24 hours) - Killzone_Kid (12:08, 15 August 2013)
86400 setOvercast 1;
skipTime 24;
// to remain on the same date:
skipTime -24;
86400 setOvercast 1;
skipTime 24;
Or try setAccTime.
https://youtu.be/WSxdmv4r9f0?si=quw_pW5vydDMvz7m
Set acceleration to as fast as possible with setAccTime command. Also use setTimeMultiplier 120.
are variable names case sensitive?
In what sense?
specifically, in Alive, if I name a TAOR marker Town1 and then later reference it as town1, will it read Town1?
Well in that sense that is definitely insensitive
Im using POLPOX Artwork supporter and i cant find a way to have 2 animations play one after the other
You don't
how would i do an execution animation then?
switchMove or some other commands
ok
now they arent playing in the right order
man2 switchMove "Acts_Executioner_Kill";
man1 switchMove "Acts_ExecutionVictim_Kill_End";```
Because switchMove updates the animation right now
so how would i do it
Read BIKI around there. For instance playMove playMoveNow
currentley it only plays executionVictim_Kill_End and not the one at the begining
ok
still doesent work
the first animation isnt playing and its just skipping to the last one
Like POLPOX said.
Take a look
https://community.bistudio.com/wiki/playMove
how would i remove a specific eventHandler in another file?
_killedEH = player addEventHandler ["Killed", {//some code}];
do i need to setVariable on it?
and then remove it using getVariable? does this work with eventHandlers?
Store the handle on the player with setVariable.
player setVariable ["myTag_killedEH", _killedEH]
Why is it that this code changes the orginial variable "targetsArray", and not just the private copy "_targetsArray"? Does it act as some kind of pointer?
private _targetsArray = _group getVariable "targetsArray";
(_targetsArray select _index) set [1, true];
yeah, = on an array or hashmap just creates a reference.
If you want to make a copy instead, you can use +
I thought I would need to do this at the end on the third line. Like replacing it all.
_group setVariable ["targetsArray", _targetsArray];```
Yeah that doesn't actually do anything.
It's just setting the reference to what it already is.
I think getVariable only returns the variable in it, not a reference of it, unlike _a = _b?
Technically everything's a reference at lower levels.
can i do the same with addaction?
_someAction = player addAction ["",{//some code}, "", 0, false, true, "", ""]
Can I turn on SQF (or similar) syntax highlighting in Notepad++? If so, how?
2.12 added isEqualRef if you want to play around.
There was an SQF highlighter for Notepad++ but I think it's a bit dead.
How do you code then? Which software do you use?
player setVariable ["test",[1,3,4]] ;
_a = player getVariable "test" ;
_a set [1,5] ;
player getVariable "test" ;//[1,5,4]```Oh! I never knew this. Thanks for your insight
There are SQF syntax highlighters for VS Code but I never found a really good one. If I have a sticky syntax problem I'll sometimes paste the code into ADT.
theres an sqf-vm linter now
Found something here. Old, but gold - better than nothing.
https://forums.bohemia.net/forums/topic/138891-arma-3-notepad-syntax-highlighting/?page=10
Updated for 2.10 Hotfix 1: https://drive.google.com/file/d/1-hnVUZx98BHKD8La5RePfoT47eHG0vfD/view?usp=sharing 06. September 2022 ChangeLog: - added: getTIParameters and setTIParameter scripting commands
Its what I use, and it serves me just fine.
Granted, I am a trash coder, so 'serves me fine' in the voice of a McDonalds patron.
It's pretty easy to add new commands to it from the "your language" window - you can use the "added in [version]" categories on the wiki to find them
Is there any way of blocking an AI's road route? i.e they will not path through that position?
Rather than just blocking it off so they get there and go around
I don't think so, but Arma's pathfinding is undocumented.
that sounds like a brilliant rabbit hole to dive into
though time is probably better spent just thinking of an alternative
Hey! Sorry for the late reply (been at work today), we have a list of allowed items, essentially when a player loads a loadout - if that loadout contains any items that aren't in that list it should reset the loadout to empty.
It is feasible to build up a road navigation map in SQF and use that to generate waypoints, although you get some corner-cases with badly-made maps.
@true frigate This is ACE arsenal, right?
Virtual Arsenal
The BIS one?
Just vanilla, yep. The issue is half of our members use ACE arsenal and the other half use Virtual - so somehow it has to work for both ๐
This is why I've been banging my head on brick walls for months on this haha
months...
Yeah..
Why not force everyone to use one or the other?
I wish that was an overexaggeration, but we've been waiting for a kitlist too
There is nearestRoads
It's just about freedom of choice really, I can see why it'd be useful but personally I use Vanilla and a lot of the rest of the squad prefer ACE
There also was some Navigation mod which allowed for road based navigation
Antistasi community has a navgrid generator and editor that you could potentially use for other mods. It mostly works.
Then you can just write a basic Astar on top of that, which is quicker in SQF than you might imagine.
ACE might be relatively easy because it throws events when you load a loadout.
Not sure how you'd do it with the BIS arsenal. You'd probably need to hook the UI button.
Might be easier to trigger a check when people exit the arsenal.
Even the BIS arsenal has an arsenalClosed event: https://community.bistudio.com/wiki/Arma_3:_Scripted_Event_Handlers
Possible, but could just not obstruct the road instead tbh given its just random spawns of ambient stuff
ye idea was for police roadblocks but theres no point if they just drive around
Hello,
Does anyone have some kinda workaround to check when the player gets assigned to the curator/ deleted ?
I need to add EH on my curator (s),
What would be the easiest way to do that ?
Didn't find any EH/ scripts for this.
Can I handle these via when the curator module is created/ for each already in the editor placed curator modules or something?
You could try the "curatorUnitAssigned" scripted event handler.
Alternatively you could just install the curator event handlers on every client for every curator :P
Yeah, i will try this one.
Thanks for the tip.
Is "ceil" a good way to prevent while-do {sleep x-y}; from cycling to infinitely smaller numbers? Next worry are extremely large negative numbers, overflowing, etc.
OOS is a highlevel lang for SQF @cold rampart
It can't cycle to infinitely smaller numbers. The minimal sleep is a single frame.
For any cases:
sleep (ceil(abs(CFG_timeToLoseTarget - _difference))) mod CFG_timeToLoseTarget;
```๐
I don't know if I am being paranoid or not, but I am really not sure, whether my code will run well under all possible input values. ๐ I don't want the function to halt or cause stuttering mid mission.
The point of the code is to make AI lose track of player after certain amount of time.
dont they do that anyway
They do but it takes 5-6 minutes. ๐ I need better control over it.
fair enough
hmm, I'm wrong. sleep for less than ~0.001 seconds apparently doesn't do anything.
Simplest way though is just add a fixed 0.01 and then you guarantee minimum one frame.
well, or _value max 0.01 if you don't want to occasionally sleep two frames when one was enough. In this case you don't care about that sort of accuracy though.
what script can i use to provide a global hint with the players name who did the add action
Remoteexec, and format the name of the unit (_caller).
https://community.bistudio.com/wiki/remoteExec
https://community.bistudio.com/wiki/addAction
https://community.bistudio.com/wiki/format
there's no need to format the name
True.
It's string.
well I guess you mean you want to format a message?
[format ["Player %1 completed the action", name player]] remoteExec ["hint", [0,-2] select isDedicated];
so it would be like "Hello" remoteExec["hint" ]
Yes, I would do that with
format ["this action activates by ..
Damn you are fast
what does this do exactly?
just returns players name publically?
it shows the message "Player blabla completed the action" globally to everyone, except to the dedicated server (because it cannot see the message anyway)
i see
thank u โค๏ธ
trying to pair this with a change time script for players to use, just dont want some goober changing the time tryna troll
you can use a whitelist or something
I can whitelist who can use a script, via a script?
yes
๐ฎ how so
hardcoded way would be:
Soarin_whitelist_UIDs = createHashmapFromArray (
[
"1234534342323",
"5124124124124",
....
] apply {[_x, nil]};
);
// later in some script, such as an addAction
if !(getPlayerUID player in Soarin_whitelist_UIDs) exitWith {}; // not in whitelist
Why a hashmap there?
Ah, fair
Someone pr'd my two primary weapons to change the cba options array to a hashmap but just caused a bunch more issues than it solved 
probably did it wrong 
Had it convert from array to hashmap on setting change -- so it just wouldn't convert to hashmap if you didn't change the setting in that session iirc
Either way not fussed about performance for that given its a local lookup when player presses a key
its a local lookup when player presses a key
it can still be slow
depends how many items you search in, and what kind of items
roughly speaking, an array of 10 numbers or fewer is fast enough without hashmap
ya i know but im not super fussed about a brief dip in performance given the player is now just waiting for the weapons to swap
rather than it being mid firefight or something
onKeyDown for a speed boost is not ideal x_x any suggestions for a 'press E to add 10 forward velocity'?
question is unclear, what are you actually needing suggestions for?
how you handle the input or what you do?
addUserActionEventHandler?
but yeah depends on what you want
hey leopard im over 3 weeks into trying to fix that lag bug with no further headway 
i love this game
Is "time" always at most in 3 decimal points, or does the engine handle it more precisely under the hood?
I wanna make sure that I for example don't try to compare myTime == 10 when actually myTime=9.9998989898 and it would never meet that condition.
You don't compare two floats for exact equality
Define some arbitrary small acceptable error and check for "close enough"
like is X between (Y and Y+0.1) ?
Yes
I was sloving it with rounding, ceilling or floring, or min maxing the numbers
Or waitUntil {time > 10}, for example
Is this performance efficient?
I wanted to do something like this, but I imagine how this line is runing throught the CPU again, and again ๐, without any restrictions.
waitUntil is rarely an efficient thing
waitUntil {sleep 1; time > 10};
Can I use exitWith to jump out of the eventHandler body?
not to return a value, otherwise yes iirc
exitWith will just exit the EH code (assuming it's top-level within that and not exiting a sub-scope of the EH code). You can't use it to return to the script the EH was added in; EH code is not "inline" with the script it was added in, it's a separate context with no connection.
Is it possible to disturb the compass in Arma 3 ?
Is there a way to smoothly delete a control created with ctrlCreate i.e. fade it out? because ctrlDelete deletes it immediately
ctrlSetFade
thanks for your answer ๐
how can you change the flag on carrier? (via script)
What carrier?
the vanilla
USS Freedom you mean?
whatever comes with arma I forgot its name ๐
Well using both flag and carrier words I could imagine flag holder, but you are talking about Aircraft Carrier right?
yes
Then no
really, i mean the flag/banner on the carrier tower. its US by default
No, I mean, no
oh weird
What have you ever seen?
sorry?
I mean why you think is weird?
well i expect some leavel of customization
the destroyer can have it's flag changed among other things like name
Well USS Freedom is not that customizable more like impossible by default
I've made a Mod to have multiple Gerald R Fords but that uses very stupid workaround
You can cover it with a user texture
If you mean the flag on the island
yeah the tower. do I create simpleobject with texture? positioning that could be challenging
You can make a simple object if you want. But not super simple object
ok
It does have no hiddensels
hmm setObjectTexture and setFlagTexture doesnt do anything. I guess it really is nondoable
Pretty much it is
can I make mod that changes the textures? or is it all in single texture
if setobjecttexture or setflagtexture dont do anything then its model baked
ok
did you retexture the carrier?
This is why I suggest you to check this up
ok thx ๐
i think im going with Leo's advice to use the UserTexture1m_F object to cover the US flag because then I can support any flag
thx all ๐
๐
I'm looking for a repro of a UI eventhandler crash.
That long known bug where deleting a display from inside a eventhandler crashes the game.
Anyone have some repro for that I can test? Or multiple different ones?
I just found what caused this in KeyUp eventhandler and it was very easy fix, I want to check other cases to see if its the same
Had a couple of crashes yesterday when doing 3DEN attribute UIs with list boxes, not sure because of something I did wrong and somehow fixed it in the end though. I'll have a look if I can reliably replicate it.
I just fixed it in KeyUp, KeyDown, Char, IMEChar, IMEComposition
I see Eden attributes also has it. If you somehow delete that control from there, you're likely to crash
I had once this problem where trying to delete RscShortcutButton made arma crash. Don't know if this is related or not. The control was inside controls group
Probably is
There are notes about that crash in the CBA progress bar code. I think that was KeyDown again though.
That's keyUp, that's the first I fixed today
Is there easy way to achieve something like this:
private ["_unit", "_weapon", "_ammo", "_rocket", "_missile", "_ammoCount", "_magazineReloadTime"];
_unit = _this select 0;
_weapon = currentWeapon _unit;
_ammo = _this select 4;
_rocket = nearestObject [_unit, _ammo];
if (isNull _rocket || (!isPlayer _unit)) exitWith {};
_missile = ["M_Sidewinder_AA", "M_Sidewinder_AA_F35"];
if (!(_ammo in _missile)) exitWith {};
_ammoCount = _unit ammo _weapon;
hint format ["Ammo Count: %1", _ammoCount];
// Must be two since the magazine size is two and this script is executed upon firing the weapon
if (_ammoCount == 2) then {
// Trying to modify it like this, but it's not possible to modify the config files
_magazineReloadTime = getNumber(configFile >> "CfgWeapons" >> _weapon >> "magazineReloadTime");
_magazineReloadTime = 1;
};
(the script doesn't work because apparently you can't modify the config files in script runtime)
The issue is that the _magazineReloadTime is very long on those ammo types (30 seconds). I'm modding vanilla Arma 2 OA, but I assume it's the same thing in A3.
https://community.bistudio.com/wiki/setWeaponReloadingTime won't work either because the issue isn't reloading time itself between the rounds, rather the magazines.
After looking up from this discord that removing the weapon and adding it back might work, tried this, it didn't work:
// Must be two since the magazine size is two and this script is executed upon firing the weapon
if (_ammoCount == 2) then {
_unit removeWeapon _weapon;
hint format ["Ammo Count after removing weapon: %1", _ammoCount];
_unit addWeapon _weapon;
_unit selectWeapon _weapon;
};
I tried adding sleep timers between the removeWeapon, addWeapon and selectWeapon, and it seems that it just adds the same weapon back, it has the same reload timer.
Could perhaps use mods as last resort that are optional if there is no really way to fix this with scripting, what do you think? thanks.
Well you can make a mod? And config patch it
Yeah this is what I thought, but our server runs on vanilla Combined Operations, although we have an optional modpack, a scripted solution would be better (just that if it's possible), since not all players are going to download those mods.
If everything else fails (before using the mods), would it be possible to alternate between two different types of weapons that still have the same magazine? The problem is that this isn't an option for the Spike launcher that we're going to use alongside with the sidewinder modifications, since afaik there's only one type of that weapon.
im attempting to make my 1st arma mission but its not going well lol. im trying to have opfor and bluefor hold fire until a sniper kills bluefor officer then all set to open fire. I got them to hold fire with "set ai mode" but i cant seem to get my trigger to cooperate with the second "set ai mode" to allow them to fire.
if by scripting, waitUntil { sleep 0.1; not alive theOfficer };
if by editor, make a trigger with not alive theOfficer as condition and synchronise this trigger to new waypoints with shooting firemodes
Trying to make a "cooldown" script to only allow x action to work every y amount of time.
Easy enough, but when testing I realized that it also didn't work for the first y amount of seconds at the start of the mission.
Should have been easy enough but I think I've been staring at it too long and could use a second pair of eyes.
// Some other conditions...
// _lastUsed is set to time when activated, defaults to 0 if not set
// _cooldown is config property, 25 seconds in this case
if
(
(time - _lastUsed) > _cooldown // Checks if vehicle is on cooldown
) exitWith { false };
true;
do i sync the officer to trigger then trigger to ai mode? (editor)
@tulip ridge
defaults to 0 if not set
You'd need to default it to-_cooldownor lower for your use case if you want it to work correctly from the start of the mission.
time starts at 0.
no need at all
just the officer should be named theOfficer
Yep, appreciate it ๐
Had to also invert the condition but works fine
hmmm i still am having issues dose this look right?
Remove the trigger owner and set the Activation to None.
Hello, I am sorry for interjecting, May I ask if my remoteExec code is alright?
[convoyGroup, _pos] remoteExec ["MOVE", 2];```
perfection would be```sqf
[convoyGroup, _pos] remoteExec ["move", leader convoyGroup];
thank you that did it!
IIRC that doesn't work. Group target remoteExec does not work as expected.
you have to use leader convoyGroup unless there's a player in the group.
or groupOwner convoyGroup
ah correct, mb - I got got by it some times indeed
will amend
added text highlight in the doc as well ๐
insert me shilling cba events instead of remoteexec
thank you :)
player isnt in group
(& John Jordan for the fix)
How do you usually interpolate values if you want to make smooth transitions?
there is BIS_fnc_lerp https://community.bistudio.com/wiki/BIS_fnc_lerp
LinearConversion 
BIS_fnc_lerp being added after https://community.bistudio.com/wiki/linearConversion is kinda sus, though
there being 2 different implementations of BIS_fnc_lerp is double sus 
well, there's https://community.bistudio.com/wiki/bezierInterpolation as well. But i don't think there's much more in terms of applicable math available
Thank you all.
Can't remember if that's what you are looking for exactly, but It is trying to delete a ui element in an event handle
Quick quesiton. Is there any way to get this command to work with a domain? I've read that it only works via IP but maybe some of y'all know a workaround?
connectToServer ["play.domain.com", 2302, "test"];```
How performance demanding is FiredNear on all AIs in the level? It gets triggered every time anyone shoots, so AIs would trigger each other. So if one fires, all 10 AIs (including the shooter) will detect the sound. How much performance would this cost, if I had few condition checks in the handler?
this addEventHandler ["FiredNear", {
params ["_unit", "_firer", "_distance", "_weapon", "_muzzle", "_mode", "_ammo", "_gunner"];
}];```
measure the performance cost of your code then multiply it by the number of times you expect it to trigger at once 
what you get should be very close to what you'll actually experience
the actual one is slower tho, but you have no means to measure it
afaik the command itself doesn't support it
but with an extension, you can get the IP address and then pass it to the command
You're saying with an extension? How would that look?
if you mean the actual code, it depends on which langauge is used
in C++, gethostbyname. in C#, DNS.GetHostAddresses (iirc)
looks like getaddrinfo should be used instead
is there any way of returning a control to its config-defined values without having to look up all of them or re-create the control? 
no
Hi guys simple Question. What would be the best practice to make a array objects to appear and disappear. More Context: I am making like PVP arena and i want to have selected objects in arena with a variable name to have a % to either be there or not To make arena a bit more randomized so its not always the same. How would i make it so script selects random object from array then either hides it or unhides it depending if the object has been selected and if the object was hidden in the first round how to unhide it in the second round if its selected again ?
private _yourarrayofobjects = [];
{
private _chance = 0.5;
private _value = random 1;
if (_chance < _value) then {_x hideObjectGlobal true; continue;};
_x hideObjectGlobal false;
} forEach _yourarrayofobjects;```
should be roughly what you're looking for, alter _chance accordingly
atm half objects on average will show
if you want some objects to appear more often than others then things can get funky there, depends how much copy+paste into init you want to do
Oh snap didnt know it was that easy. Hell yea. For someobject that i would make to appear more woulnd i just make seperate array for that and saperate loop with diffrente chance ?
showObjectGlobal -> hideObjectGlobal.
private _yourarrayofobjects = [];
{
private _chance = _x getVariable ["Legion_AppearanceChance",0.5];
private _value = random 1;
if (_chance < _value) then {_x hideObjectGlobal true; continue;};
_x hideObjectGlobal false;
} forEach _yourarrayofobjects;```
then put
`this setVariable ["Legion_AppearanceChance",0.5];` in the init, and replace 0.5 with how much you want it to appear
oh is that how that works
oh wait its just not a command
bruggin
fixed
Also what is _max variable used for ?
thats just for keeping it as a percentage
dont touch
no need
i think i intended to put random _max and just put random 1 instead
ive been doing gui all day my brain is fried
understandable
understandable
it didnt even touch a single gui component i just modified the scripts
because when i did touch a gui component i ended up with this
What is the speed of sound in Arma 3?
Almost same with IRL
Can anyone help? I just bought a bisecthosting arma3 server. I'm trying to get EZM and enable scripts. I've tried everything I've seen online. Pls dm.
wrong channel; try #server_admins
โฆI suppose?
Got it thanks
Hey, Sorry i was a bit busy.
Looks like the control does takes the r2t BUT only the first frame of the camera is get and then no updates. Does it has to be in a OEF eventhandler?
Edit: I was just being a dumbass and had PIP option disabled xD
If I was to define a 3den Module in a mission file's description.ext, would it show up?
Try it and see what happens. Likely not because Modules need to be in a mod.
Im kinda hoping someone could answer it before I get to testing it
Is there anything wrong with running everything in a scheduled environment?
Say I wrap all my code in init.sqf between a [] spawn {} command, would it be bad for me?
Gotta share some gold I just found out, Chatgpt can write scripts for arma3
Idk how deep it can go but so far it is much better than I am and can actually explain which field to put it in
In detail
ChatGPT can lie to you about what's possible in SQF, because it isn't fully knowledgeable in it.
See pinned message
Damn my b
you can eventually use it to learn/dig, but never ask us to fix its code ^^
Yeah no worries
I wouldnโt do that, Iโve just been using it to write tedious stuff
Stuff that I already know is possibly and that I could do but Iโd have to spend an hour or more looking at the wiki for just for it to become irrelevant 30mins later
Is it just that chatgpt doesnโt understand the limitations of the code because it has been pretty good with stuff like formatting from what I can tell
it doesnt know all the commands so it can just make it up
Scheduled vs. unscheduled really comes down to a matter of how important it is to have your code happen immediately and in order. As far as the init.sqf, technically it's already scheduled. In singleplayer (according to the wiki), init.sqf is scheduled but it the engine waits for it for to finish before continuing, letting your init.sqf run before modules are initialized and post init functions are called.
I dont know a situation where an unscheduled env would be better than scheduled env
Gotcha right thx
Is there a way to order a helicopter to move into a position precisely, like make them closer to the WP itself ~1m not ~70m?
If you mean an easy way then the answer is no.
Yeah apparently I've tried a workaround that it tries to overshoot the designated position itself and eventually gets closer than 70m, but found is unreliable enough so
yeah, the waypoint completion radius check is low-precision so it's pretty random.
EachFrame velocity adjustment after the waypoint completes is maybe the easiest method.
Well, yeah, please BI, I mean two decades ago... please make a simple thing simple
Have no experience with setDestination but does it even work after all?
I've only tried it for ground vehicles and it's weird enough there.
It switches out of waypoints about halfway between them, so it'd probably require a lot of setup to fly to a point. Likely harder than EachFrame velocity adjustment.
Not sure if this is what you are asking, but use an invisible helipad if the landing is scripted
Oh, you arenโt talking about landing my bad
One thing Iโd maybe try is within the waypoint attributes see if you can adjust the precision necessary for the waypoint to be completed
Yeah landing is not what to achieve but basically flyover
setWaypointCompletionRadius isn't useful except to increase the completion radius from default.
I have one
https://github.com/dedmen/DAA_Mod/blob/main/main/XEH_preStart.sqf#L7
But it only handles TXT DNS entries
https://github.com/dedmen/DAA_Mod/blob/main/extension/src/main.cpp#L211-L216
Would need to copy this and add QueryType::A
Thank you, I appreciate it.
I could build it for you with battleye compatibility but that'll take some unspecified amount of time
Nah thank you I'm good. I already figured it out via some ui navigation. Definitely gonna look into this extensions stuff tho
@warm hedge setDestination for an agent driven helicopter is good, i even got a whole landing script for landing/hovering precisely where i need it.
it is your responsibility though to make the trajectory safe, he wont do that kind of thinking for you
Yes. It'll clog up the scheduler and make every spawned code take longer to finish
It could lead to disaster when you take into account all the mods/modules that rely on scheduled environment
The general rule is: use as few spawns/execVMs as possible. Even combine your loops if you can
- Making sure a block of code runs without interruption
E.g. if you have 2 codes, each one reading and modifying a global variable, and they run scheduled together, it causes data race. Each read and write process has to happen unscheduled (it's not limited to read and write but you get the idea) - Timing in scheduled env is very inaccurate. For accurate timing one should only use unscheduled env
- Some processes must happen unsch to be safe. E.g. if you create a vehicle and reposition it in schd env, the engine might simulate the vehicle before you get to put it in a safe pos, leading to explosion
Well 3 is just the same as 1
unschedule everything unless you know you need it to be scheduled
No. That's also bad. Even worse if you don't know what you're doing. At least if you f up in schd you won't mess up the FPS
you instead mess up the execution time of everything that is scheduled which is much less noticeable so you dont notice youve done something stupid
uncheduled is better because it forces you to fix bad code earlier 
just dont write bad code 
if you were creating a mission with fully emergent gameplay, where nothing is 'scripted' and it's more like a sim, what would you use scheduled for?
if you need the fps to remain somewhat stable and the code doesnt need to be executed immediately
that means that theres quite a few different systems/modules that run together and have to interact a lot, would you want the pain of synchronizing them if they were sched
Is there a way to save stuff to a text file? Just out of curiousity.
My mission.sqm is kinda large and Im wondering if I could have it save some stuff outside of it. I prpbably wont implement it but again, just curious.
example of something that using the scheduler for is a good idea is my imposters mod's main loop -- it's high cost (checking nearly every ai) but doesnt need to be executed at all if theres lots going on (youre not going undercover mid firefight etc)
sounds like a state for an FSM
possibly but easier to disable/modify when its script
just don't write code 
define "save stuff"
you cant write bad code if you don't write code ๐ง
save information for a mission outside of the description.ext and mission.sqm, but still inside mission folder, and only for the mission
Like, text for example.
Describe your use case
yes please
(OFP runs on Windows 10)
https://code.visualstudio.com/updates/v1_70 โ the last VSCode to support Windows 7
steam will stop working on win7 in 140 days anyway
I have a mod that writes data to the sqm file, currently it has written 265,747 characters. I am wondering if it was possible for it store it's data in a dedicated file.
what is that data
if text, use stringtable
if object position, use spawn scripts
if "random.txt"โฆ use "random.txt"
Modify a text file via a script
I'm assuming this is an Editor mod and this is all dynamically generated data, like object custom attributes or whatever, so it's not possible to hardcode it into a stringtable etc.
I think you're probably stuck with it, no good solution
ah oki, yea, thought so :P
Is there any way for camera position commands to take ASL?
Im currently facing a situation in where a cam that I have for a scene has to be above water but while trying to set up positions it always ondulates with the waves motions.
//Ondulates, the script is in a loop changing around a relative position in very short intervals to simulate a smooth traverse path
_cam camSetPos _aglPos;
_cam camCommit _speed;
And of course, using setPosASL obviously removes that issue but makes the movement super jittery. Would there be anyway to simulate the commit movement buttery smooth interpolation effect or have an alternative to camSetPos?
The logic of the relative position is getting a circumference from an object adding a degree, decreasing my movement interval and angle for my transitions helps greatly, but still causes really noticeable jitter.
Any ideas?
can you not just use setVelocityTransformation?
alternatively, ASLtoAGL or ASLtoATL etc
the camSetPos takes only agl, transforming it actually gives me worse results sadly
ah, ASLtoAGL then
indeed, that still leaves me with the problem of the ondulation above waves when not in a surface :c
setVelocityTransformation might be the solution
have to try if it actually moves the camera object
It shouldn't do 
yet AGL is ASLW
oh 
that's why I guess, AGLToASL may not consider waves in that case
tbh IDK
wait im looking at the wrong page anyway
but either way thats probably why @kindred zephyr
if setvelocitytransformation works use that though
it is a complicated command to get your head around initially tho
how do you get this _aglPos to begin with?
private _camPosASL = [0,0,10];
_camPosAGL = ASLToAGL _camPosASL; // does it consider waves?
// if not:
private _camPosASLZero = +_camPosASL;
_camPosASLZero set [2, 0];
private _waveZOffset = -(ASLToAGL _camPosASLZero select 2);
_camPosAGLww = _camPosAGL vectorAdd [0, 0, _waveZOffset]; // ww = without wave
_target getRelPos [_radius, _angle];
ah, and you are camCommitting so it's not instant
nah I'm afraid you're out of luck here, "it is how it is"
sadly ๐ฆ
I guess I can still try to remove the offset of the waves manually and account it in the position transition in camSetPos, even if its not a lot, that cam is kinda nauseating xD even reducing the wave bobbing a bit is a win
if you can deal with vectors, you can always setPosASL & setVectorDir manually
the cam having a target set already deals with the vector direction anyway, and setPosASL is something that, while works, gives me very jittery results.
I wonder, maybe if I go in super low intervals for angle transition and loop speed it would be better 
At what point would someone benefit from an OEF eventhandler in this situations?
right now im arbitrarily moving 1deg every 0.025 sec
visual = onEachFrame, definitely
I reckon a full scripted camera system could be done in Arma
if camera is local it can be
my capital ships system could be changed to camera easily
cameras are always local yeah
yeah twas what i was getting at
its easy enough to do once you learn how to setvelocitytransformation
or even setposasl/setvectordirandup on each frame
"Draw3D" EH would be better I suppose
no real difference locally
will try both later on as well as setVelocityTransformation, thanks to both for the insight and recommendations
once you have setposasl/setvectordirandup you can just feed them into svt on each frame, no need to bother with interval really as is local
If you need any reference this moves by a bunch of arbitrary values on each frame
Works perfectly in SP, just has MP interpolation issues on orientation, not an issue for you
Is there a way to detect when selectPlayer _unit is used ?
I can't see an event handler, surprisingly.
Thanks for the advice. I didn't realize the scheduler is a single instance, I thought there were multiple schedulers per spawn and per machine.
well there is one per machine (or maybe better said, game instance) ofc
On a separate note, how could I recreate execution from initPlayerLocal.sqf in the XEH_preInit.sqf file. I am running a bunch of CBA_fnc_addSetting functions, some running globally, that I want to run on players only.
Currently, I have it like so:
if (!isDedicated && hasInterface) then {
// Code
};
But this does not run the code the same way as if running it from initPlayerLocal.sqf. Am I missing something?
if hasInterface should be enough?
!isDedicated prevents HCs from running it.
is initPlayerLocal.sqf for players only, or for HC as well? and player-server?
Executed locally when player joins mission (includes both mission start and JIP).
https://community.bistudio.com/wiki/Event_Scripts#initPlayerLocal.sqf
Players only. I do not want to run anything on HCs.
then if hasInterface will target just peeps with interface, aka players (server or not)
No way, I'm looking this up. Was my life a lie?
Wow, TIL what a Player Server is
a "listen server" iirc
Makes sense.
How about this. Would these two executions have the same result?
XEH_preInit.sqf
if (hasInterface) then {
// Code
};
initPlayerLocal.sqf
// Code
I appreciate the attempt nonetheless
Hey all, firstly trigger warning I'm going to say the "C" word. I'm looking to commission someone for two basic mods. I'm talking a ACE self interaction that makes noise & a new ammo type for a weapon. I've tried to do it myself but I've hit a wall, coding is not my strong suit
If I bundle my scripts as an addon on Workshop, and I have some fundamental code lines in files like init.sqf or initServerPlayer.sqf, would it work, if someone wanted to make a mission with it? And in which file can I let the users to configure my addon behaviour? Currently I have options in init.sqf. I don't want to distribute the sourcode on GitHub.
no you will need different logic
How can I replace init files then?
use cba postinit/preinit event handlers
Is it not possible without CBA?
if its something you want to enforce you can do modules to enforce functions upon mission start or postInit attributes for functions
it works real good, no more vomit inducing rocking
For example, I add an eventHandler to a player when he connects and starts controlling a player avatar, in initPlayerServer.sqf
yeah, you can do it in modules
or
you can do unit eventhandlers for classes or parent classes
But modules has to be downloaded on both server and client side, isn't it?
Now, I have an init.sqf, where I declare some variables, mainly for configuring the scripts, and also I add some event h. to AI units. I tried to create a customInit.sqf and I gave it preInit=1, but it does nothing
if thats the case you can do init eventhandlers for units
This is an example, if you want to do client sided base addons to do something on units, but you might be better off doing it properly and have it be accessible on server machine
class Land;
class Man: Land ///<-- declaring that camanbase inherits from man
{
class EventHandlers ///<-- telling the game to add to the eventhandlers class in the desired class
{
class MKClass
{
init = "anyFunction goes here";
};
};
};
But where do I do this? ๐
Will this config.cpp work also in Eden Editor when playtesting, or only with completely packed and compiled addon?
you could probably use the file patching to "test live", but i have no idea on that
diag_mergeConfigFile does, but if you have no clue how to use, just pack it into a Mod
Normally non-mission config is only loaded at startup.
Now I have my scripts structured like if it was just for one mission (scenario with scripts), but I have no god dam* idea how to refactor my code (mainly init files) to make it even barely shippable as a mod/addon. lol I don't even know where should I learn it.
why doesnt getArtilleryComputerSettings return grid? it would make life so much easier
The answer for "why" is "it is just how it is", if you want to suggest, just #arma3_feedback_tracker
Does it hve to be class Man or class CAManBase? Or is it the same?
depends on what class/es you want to apply the init eventhandler into
I have a script I am trying to make work for a medavac tent, with a doctor in it. I want to be able to pull uncon/critical patients into it from the field, and hold action on the doctor to have them full healed.
Issue is that I cannot get it to work, and I am fairly noobish at scripting. So I was hoping I could get some extra eyes onto what I am missing.
The doctor in the tent has this line in it's init: [this] execVM "baseDoctor.sqf";
And I was trying to use an .SQF file to launch it, but the file keeps getting deleted. So I switched to using TypeSqf Editor, and a non binarized mission file.
Hey there, I am trying to remove a magazine with specified amount of ammo in it from the players inventory/GroundWeaponHolder. I check if the magazine is in there with
private _magazines = magazinesAmmo player;
private _removed = false;
{
if (_x#0 == _magazine && _x#1 == _ammoCount) then {
_removed = true;
// TODO really remove the mag from the players inventory
};
} forEach _magazines;
I am looking at the functions, but none of them allows me to remove the exact magazine by ammo count. Any ideas? 
anyone know how to make the blood mist particle effect apear?
@leaden ibex I think you have to remove all magazines of that type and then re-add the ones you want to keep.
I want to die
But yeah, that's a way I didn't think of... Even though I am already doing this for some reason in my mortar script with ground weapon holders
Thank you! 4:30am brain is not functioning as it should 
// Global execution
params ["_doctor"];
if (local _doctor) then {
_doctor allowDamage false;
["MOVE", "COVER","FSM"] apply {_doctor disableAI _x};
_doctor setVariable ["lambs_danger_disableAI", true, true];
_doctor setUnitPos "UP";
};
if !(hasInterface) exitWith {};
[
_doctor,
"Get Medical Treatment",
"\A3\Ui_f\data\IGUI\Cfg\HoldActions\holdAction_revive_ca.paa",
"\A3\Ui_f\data\IGUI\Cfg\HoldActions\holdAction_revive_ca.paa",
"_this distance _target < 3",
"_caller distance _target < 3",
{},
{},
{
params ["_target", "_caller", "_actionID", "_arguments", "_progress", "_maxProgress"];
private _units = _caller nearEntities ["CAManBase", 10];
if (_units isEqualTo []) exitWith {};
_units apply {
[_x] remoteExec ["ace_medical_treatment_fnc_fullHealLocal", _x];
};
},
{},
{},
15,
0,
false,
true
] call BIS_fnc_holdActionAdd;
you need to remoteexec the ace heal local function to where the unit is local
can I bypass the limitations of ambientAnimCombat by manually terminating a BIS_fnc_ambientAnim instead?
having some issues with getting an AI unit to actually trigger with this knowsAbout player
which limitation?
the fact that theres like 7 animations instead of 40
i'd like to have a bunch of units stand at briefing, then break when they start getting shot at or detect a player
currently using [this, "LISTEN_BRIEFING", "LIGHT"] call BIS_fnc_ambientAnim;
if ((this knowsAbout player) > 1) then {this call BIS_fnc_ambientAnim__terminate; test2=true};
through the test2 in there for debug, not even getting set to true.
you can't get around the # of animations that you have available without rewriting your own version of the function.
ugh. is there some way to do this i'm not aware of?
use the group/unit's behavior for detection rather than knowsAbout, use a FiredNear event handler, etc
Oh jesus. I was being to direct with approaching it. thank you.
works perfectly.
if is a one-time check that happens at the time the code is executed. If this is in an object init field, that's during the mission init phase. So you're checking for the knowsAbout once, before the mission is even properly started, it fails, and there are no further checks.
so I should write an sqf script for this, and then execvm?
does anyone know how to activate the blood effect?
if you go that path, start the animation, then create your while loop for checking the knowsAbout
gonna give this a shot
thanks lads
you have to find the class name that is in CfgCloudlets that looks like the blood effect you want. You would then create a particle effect
see:https://community.bistudio.com/wiki/Arma_3:_Particle_Effects
I hate this so much, but it will work, thank you for the idea!
private _magazines = magazinesAmmo player;
private _removed = false;
private _index = 0;
{
if (_x#0 == _magazine && _x#1 == _ammoCount) exitWith {
_removed = true;
_magazines deleteAt _index;
player removeMagazines _magazine;
{
if (_x#0 == _magazine) then {
player addMagazine [_magazine, _x#1];
};
} forEach _magazines;
};
_index = _index + 1;
} forEach _magazines;
be careful using deleteAt when doing a forEach
oops I mean in context with _forEachIndex
Can't just - [x] as it would delete all the occurrences and player could have multiple magazines with the same ammo. Was my first try.
So I switched to index. What could be wrong?
Does forEach "not guarantee" it being one by one? 
tbh, I didn't even know _forEachIndex exists 
But what can be wrong with it, looking at it, it would be ok.
Mainly as I delete only once and leave.
The only problem I could see is using normal forEach and deleting one by one insted of using forEachReversed
I would use continue
got this working. Again, I appreciate the help!
I want to exit the forEeach, as I only delete one of the magazines. No need to continue searching
oh ok
So using the magic variable _forEachIndex could be used here without any worry, right?
yeah, as long as you stick with the exitWith
Alright, wonderful, thank you!
take a look at the notes under deleteAt's wiki page and make sure you don't run into conflicts with _forEachIndex not keeping up
Yeah, that's what I've written as I can see as the only problem.
_forEachIndex continuing counting while the array itself is getting smaller
I actually wonder how forEach handles it 
Might need to do some testing
Yeah, it get's fucked
after the first 2, the array itself is only 7 long, but still runs 12 times
(BI please fix
)
The code you pasted is fine anyway. Issue is with deleting from an array that you're iterating over, which you're not doing.
I am
You're exiting when you delete, which is fine
But in a way that won't matter
there's an inner loop that readds the remaining mags
but the outer loop is the one exited on delete
yeah it's fine, just kinda weird. Normally you'd do the outer one as a findIf
Outer loop checks if the mag is in the players inventory, as it could be on the ground too.
Deletes the one instance of the mag in the mags array
removes all the mags from player inventory
inner loops add them back in

private _magazines = magazinesAmmo player;
private _index = _magazines findIf {_x#0 == _magazine && _x#1 == _ammoCount};
if (_index != -1) then {
_magazines deleteAt _index;
player removeMagazines _magazine;
{
if (_x#0 == _magazine) then {
player addMagazine [_magazine, _x#1];
};
} forEach _magazines;
};
should also work then
(I am coming from C, findIf is magic for me and my brain isn't wired for that)
wouldn't you want to remove magazines before the deleteAt, as you would then preserve the magazine you removed
Are you scripting infinite ammo?
I won't, as I delete ALL the magazines of a type magazine, no matter the ammo count in them
Nah, rewriting CSW a little differently, so I can "easily" add it to vehicles.
you could probably simplify it with private _magazines = magazinesAmmo player select {_x#0 == _magazine}
Ohhhh, Missed that context clue.
True that. Can save me the loop again
and a chunk of the findIf
oh I see _magazine is supposed to be another variable different than _magazines
either way, good luck ilbinek
_magazine is just a string of the classname
something wrong
Won't save me the loop, as I need to add them one by one because of the different ammo count
yeah, just loses the condition within the loop.
yep
not pseudo, literally using it!
private _magazines = magazinesAmmo player select {_x#0 == _magazine};
private _index = _magazines findIf {_x#1 == _ammoCount};
if (_index != -1) then {
_magazines deleteAt _index;
player removeMagazines _magazine;
{
player addMagazine [_magazine, _x#1];
} forEach _magazines;
};
is the final form
Wrote it here, VSC should tell me I am a dumbass once I copy it over
Hey, Czechs got to continue in writing "Arma" code eh? 
on the charecter
Ello :D
Im sorry for interjecting may I ask if there is a way to use while loop and have it "run" every 10 seconds?
I saw someone using while loop like this:
while {sleep 5;!isNull convoyGroup} do {
//
convoyGroup setFormation "FILE";
convoyGroup setCombatMode "RED";
convoyGroup setBehaviour "CARELESS";
convoyGroup setFormation "FILE";
};```
is this the same thing?
Yeah
Although most people put the sleep at the end of the loop, rather than in the condition
It's the same thing either way though
so I should use it this way?
Yeah, just change the 5 to a 10
If you're wanting to check if the group exists, use isNull
okay :)
You'd use isNil if you're checking if a variable exists
if (isNil "someGlobalVariable") then
{
someGlobalVariable = ...;
};
You'd use isNull to check if group exists
if (isNull myGroup) then // myGroup could be null if all the units in the group died, joined another group, etc.
{
myGroup = group player;
};
tysm
wait.. do I need to have the group or string/variable in quotes?
No, that's specifically for isNil
okay :D
Was just giving an example for it to show the different use-cases
hey all, I'm trying to filter config classes, getting a 'access/' is not a class ('side' accessed) in-game popup
min example:
{
_displayName = getText (_x >> 'displayName');
} forEach (configProperties [configFile >> "cfgFactionClasses", "(getNumber (_x >> 'side')) <= 2", true]);
any idea how I can prevent this error? It's not a blocker, but it's an annoying popup for players...
configProperties [configFile >> "cfgFactionClasses", "isClass _x && ((getNumber (_x >> 'side')) <= 2)", true] 
or "getNumber (_x >> 'side') <= 2" configClasses (configFile >> "CfgFactionClasses")
...thanks. I had tried configProperties [configFile >> "cfgFactionClasses", "(isClass _x) && (getNumber (_x >> 'side')) <= 2", true] which still caused the issue, didn't think removing that first set of brackets would do that aha
probably errors out when trying to access 'side' inside non-class property. And probably works with isClass _x && (... because that's special case that can exit early.
Then the proper code should be isClass _x && {(getNumber (_x >> 'side')) <= 2} (notice the curly braces), so the right part isn't even executed when running on non-class
There is also "break" command to break out of the loop
No it's not. You are not changing the array length, you are creating a new one.
for each still runs on the old array
Using that is only good, if the first condition is often false. In this case it's not and you're adding more overhead than what you gain
In this specific usecase with isClass being treated special on engine level it's indeed faster. But in general when the right part straight up errors out if left is false - i'd argue && {} is the way. 
Even without special treatment
If it errors then it's necessary. Ahh, yes ๐ indeed
Huh I didn't think about when I added that isClass thing
fun interaction indeed
If you make it "isClass _x" with two spaces, it would break ๐
as it did with "(isClass _x)" for the original poster
We love Arma ๐ซ
how do you make a script that applies to everyone indivually when exec with initPlayer doesn't work?
Has anyone created a script that moves the player's control to a new unit (not remotecontrol, player straight up becomes new unit) without getting rid of the old unit? Cannot seem to figure out how to do it with selectPlayer
from looks of it it doesnt seem doable in MP 
I did something like this, but it serves as an "emergency respawn" for dead units. They are moved into custom spectator interface, but I guess it could be used.
/*
Name: WMT_fnc_Respawn
Author(s):
ilbinek
Description:
Respawn a unit
Parameters:
UID of the unit to respawn
Returns:
Nothing
*/
params ["_uid"];
// Check that the UID is really local player, otherwise exit
if (_uid != getPlayerUID player) exitWith {};
// Check if the player is dead, otherwise exit
if (alive player) exitWith {};
// Create a unit
private _group = createGroup PlayerSide;
private _unit = _group createUnit [typeOf player, position player, [], 0, "NONE"];
_unit setUnitLoadout (getUnitLoadout player);
if (!isNil "WMT_Local_Group") then {
[_unit] joinSilent WMT_Local_Group;
};
// Not working in arma 3? Maybe they will fix it one day and the unit will be visible in the slot selection screen?
// If they fix it, we might create a "spectator" slot that will create always at least one spectator that will be able to spectate the game
// So people that disconnected can still spectate (but that won't happen)
setPlayable _unit;
// Delete old body and move player into the unit
hideBody player;
selectPlayer _unit;
// Set HIA3 target as the new unit
HIA3_Spectator_ViewUnit = _unit;
// Make HIA "move" the camera in 1st person of the unit
player cameraEffect ["terminate","back"];
camDestroy HIA3_Spectator_Camera;
[player] call HIA3_spectator_fnc_changeTargetUnit;
HIA3_Spectator_ViewUnit switchCamera "INTERNAL";
// Turn off HIA3 spectator
("HIA3_SPECTATOR" call BIS_fnc_rscLayer) cutText ["","PLAIN"];
Thanks; my intention is for the player to be able to hit respawn and if CBA setting enabled then they will just leave their body -- which gives medics fun and also gives the player fun
selectPlayer just didn't seem to do anything at all when I was testing on my dedi
This worked in testing in MP, but didn't ask the admins if it was ever used
hm, wonder what i was doing wrong then
I sometimes managed to have my camera stuck in a unit I was not controlling, while running around in different body when creating the script (and figuring out how to turn off the custom spectator).
Possibly that?
selectPlayer was just having zero impact at all
like, wasn't even giving me control of the unit selected
did you set it playable? 
Did you create the unit dynamicaly?
yes and yes
but setPlayable only works in SP according to BIKI
i ran the command anyways ๐คท
(I know, bot who knows? Exactly why I do too
)
i think i'll probably have to come up with something else -- i'm trying to refrain from just spawning a unit on the player and giving it all the players wounds but i think i may have to unfortunately
or i just setdamage 1 to the player then setdamage to previous damage... ๐ค
that doesnt work on dead units nvm
@sullen sigil just did simple test, worked like a charm (editor hosted MP)
At least you figured it out!
Ya, thank you ๐
just tested on dedi, also works 
Currently seeing how much I can automate on the trello for this project too 
how do i turn some word in a task description into a clickable link that scrolls the map to some location?
like e.g you have a mission description in your diary that highlights names of some villages and when you click on them the map shows where they are
<a marker="MyMarker">clicky</a>?
@kindred tide
try https://community.bistudio.com/wiki/createDiaryRecord 's tags
<marker name="respawn_west">Respawn point</marker>
... guys
how to get the backpack added via addBackpackCargoGlobal
dont want to get ingame to fix the script of some idiot of my clan
I had any mod idea that would work I'm not sure if it's on the workshop as I can't check right now but an ambush module that you can place down in Zeus and eden, it would branch off the "hold fire unless fired upon" ROE, for example and this is mainly for like resistance groups if you're doing a World War II role play for example you could have a single Frenchman surrendering in the middle of the street or something or maybe even a Russian or whatever the moment the players go to interact with him or shoot him the AI on either side of the road stand up and open up on the convoy/group, it would also make it easier for the Zeus not have to babysit/mircomanage the AI to make sure they don't start firing or running around trying to set one up
I am unable to do it myself so i figured i would drop the idea in here for you script jockeys to mess with and see what happens
You could also add an extra module onto this for the AI will not engage unless players are within a certain range
They will remain prone and hold fire and then stand up and open fire if players come within say 200 M for example
That would work really well if you're doing Vietnam or Japan World War II as they did that constantly
I don't expect it to be perfect by any means but it's better than nothing
iiit's not exactly how it works ^^ you can ask here for help or go #creators_recruiting to hire (even for free) a scripter to do that, but suggestions or wishes here are not the way to go ๐
anyone ever had experience with missions refusing to initialize once they hit a certain size
i've been prodding around with a very edited version of the old BeCTI from years and years ago; it still seems to work today, but behaves strangely between testing and launching on the dedicated server my group is using
playing the scenario locally in "multiplayer" (a local LAN) has zero issues; but when I port the mission to the server, it spits an error code that it's got an undefined variable in the missionstart sqm, even though the variable is defined literally three lines above it
even more perplexing, sometimes the issue can be "fixed" by just aborting the mission and trying again a few times until it goes through
bisterious
It sounds like your mission is making incorrect assumptions about init ordering.
i apologize in advance, because i'm a bit stupid and also very new to script editing beyond prodding at config files
It's not making it up about the undefined variable anyway.
right, i'm assuming whatever issue is in the code, not the engine; just trying to get a better understanding of how it works
And yes, mutiplayer init can be unpredictable enough that a variable is sometimes undefined.
i don't know a whole lot about init ordering; does multiplayer init get shaky under heavy load or something similar?
thanks for your help, by the way
Well, each machine is separate and networking is unpredictable.
If your client init needs something to have happened on the server then it should explicitly wait for it.
Some ordering is probably guaranteed, but undocumented.
Like you can assume that publicVariables arrive in order.
right, gotcha
On init order, this is incomplete but useful:
https://community.bistudio.com/wiki/Initialisation_Order
already got it open on the other monitor ๐ thanks!
that page helped, i did it this way:
_playerTask = player createSimpleTask ["Convoy"];
_linkFrom = format ["mapAnimAdd [1, 0.1, %1]; mapAnimCommit;", locationPosition _from];
_linkTo = format ["mapAnimAdd [1, 0.1, %1]; mapAnimCommit;", locationPosition _to];
_playerTask setSimpleTaskDescription
[
format
[
"Destroy convoy going from <execute expression='call %1'>%2</execute> to <execute expression='call %3'>%4</execute>",
_linkFrom, text _from, _linkTo, text _to
],
"Destroy convoy",
"Convoy"
];```
forgive me if this is very stupid;
if !(_team in _teams) then {
[_team, _side] call CTI_S>
7:44:58 Error position: <_teams) then {
[_team, _side] call CTI_S>
7:44:58 Error Undefined variable in expression: _teams
7:44:58 File mpmissions\__cur_mp.utes\Server\Functions\Server_OnPlayerConnected.sqf..., line 56
7:44:58 "[CTI (INFORMATION)] [frameno:38836 | ticktime:904.586 | fps:46.6472] [FILE: Server\Functions\Server_OnPlayerConnected.sqf] Team [O Alpha 1-1] units are now being removed for player [Roke] [76561198043112464]."
7:44:58 Error in expression <r _x && !(_x in playableUnits) && _x != _hq) then {deleteVehicle _x}} forEach _u>
7:44:58 Error position: <_hq) then {deleteVehicle _x}} forEach _u>
7:44:58 Error Undefined variable in expression: _hq
7:44:58 File mpmissions\__cur_mp.utes\Server\Functions\Server_OnPlayerConnected.sqf..., line 76```
if i'm understanding correctly, the the _teams and _hq undefined variables are reading as such because the server is waiting to define them before *something*, but network connectivity issues cause the server to wait to define those variables; if a player joins before those variables are defined, then it'll spit the error
so the "fix" would be to figure out how the server wants to define those variables and when, then try and engineer a way to make them defined before a player joins?
if player. backpackContainer << will couse interesting stuff to happen
if object, everycontainer << Also will be extreamly fun to add stuff to that backpack :P
have fun1
Or use defaults as fall back

