#arma3_scripting
1 messages Β· Page 608 of 1
look
the variable name that i used was NCA_target_300m_x
where x denotes the number
so you could copy-paste it as many times as you want
the editor would increment X
the script is now looking at the 3rd separated point
so "300m"
because iu didnt feel the need for anything more complicated
"quick and dirty"
anyways, feel free to change it how you like it
fit it to your needs
the theory is RIGHT THERE
take it or dont
Looks good thanks!
Is it making a difference for the calculation of the condition(meaning is it saving performance) if i put a trigger on serverside only? Or is that just for the onAct. and on Deact.?
if you make trigger serverside then it will run serverside
your question doesn't make a lot of sense
Yeah. the things in the onAct. will run serverside. But the calculation if the conditions are met. Are those any different if it is a global or a serverside trigger.
nope, unless you use local values (like player)
Thanks. Thats what i thought π
Next question where i found an anwser but i think i had differing results in the past: Is the init.sqf global? MEaning if i put an AddAction in the init.sqf(lets say on a vehicle to unlock it) and join a server, and then someone else jips do i have two actions in the actionmenu then?
Cause i read that it is only executed on the joining client but addaction has a local effect yet i am pretty sure that i had that exact problem a long time ago (By now i am mostly using initplayerlocal.sqf to avoid such shenanigans but i would like to know for my understanding)
it runs for the connecting client, on their side
@knotty mantle β
you won't have a second action, but if there is a getPos player createVehicle "superHelicopter" it will obviously run again
hmm... then my memory is wrong... I sure remembering having a LOT of the same actions on the vehicle but i managed to do that via a different mistake then i guess. Anyway thanks again Lou π
Ah follow-up: That means that for JIP-Players there is no difference between init.sqf and initPlayerLocal.sqf?
no diff - init.sqf is run on the server as well
You mean in the beginning right. It is not run for the server if someone jips?
@knotty mantle I believe it is run on the server once at mission startup and then only on the joining players after that.
//any task sqf file, run by server.
...
All_tasks pushback _tsk;
[true,[_tsk],[_taskdesc,_tasktopic,_taskmark],_pos,0,2,true,"Destroy"] call BIS_fnc_taskCreate;
...
//another sqf file, called by player who is a voted admin.
....
diag_log format["All_tasks: %1", All_tasks];
{
private _completed = _x call BIS_fnc_taskCompleted;
if !(_completed) then {
private _taskType = [_x] call BIS_fnc_taskType;
private _markCenter = _x call BIS_fnc_taskDestination;
diag_log format["_x: %1, _completed: %2, _taskType: %3, _markCenter: %4", _x, _completed, _taskType, _markCenter];
switch (toLower _taskType) do {
case "download";
case "destroy";
case "intel": { ... code1 ... };
...
case "kill";
case "meet": { ... code2 ... };
default { [_x,'CANCELED'] call BIS_fnc_taskSetState; };
};
};
} foreach All_tasks; // All_tasks = ["task_ID1", "task2_ID2"...]
//rpt file
"All_tasks: [""tsk_terminal726[19339.2,13252,0]"",""tsk_terminal909[19339.2,13250.2,0]"",...]"
" _x: tsk_terminal726[19339.2,13252,0], _completed: false, _taskType: _markCenter: [19488.4,12974.5,0]"
I'm stuck with getting task Type . _taskType does not have the "Destroy" type. it's just empty. But others like _completed and _markCenter have the right value. So the switch-do loop just go to default paragraph, I definitely put "Destroy" type (or "intel" or "kill" etc.) in BIS_fnc_taskCreate Any tip for me?
are these types defined in CfgTaskTypes?
@quasi rover
Yes, I did with class CfgTaskTypes in description.ext and without it. and those are default task types, so it doesn't need to define it, I guess.
okido (not in front on my computer)
Infact, Lou is behind his computer, hiding from the 3den init-field that snuck into his room
shhhhhh it will hear ya!
hey iirc there was a way to split up the descritption ext. and use #include or sth to also include the extra file?
yes
im learning how to put in custom sounds and would like to keep them as a sperate class file
so it would my "myUberCoolSounds.hpp"?
and in the description i put #include "myUberCoolSounds.hpp"
for functions, i do like so:
class cfgFunctions
{
#include "functions\nca_functions.hpp"
};```
@spark turret it's a string
you must include with a string
also remember that #-commands dont take a semicolon
okay ill try that out
yep, like that
lets hope it wont directly crash the game
BUT!
a quick thing to remember
you want to define the base class in the description.ext
and then include within that your class
it's good practise
this way other people can include their configs without running into double-defined classes
@spark turret
what's in "IRN_CAS_sitrep"?
the hpp that holds all the sound classnames
like, the stuff that would normally go into the description
yes, show an example
dont have one yet, give me a second
ok
does "sounds[] = {};" go into the description or extra file?
im not quite sure on this, but im pretty sure it goes in description
not the extra file
i usually deal with functions
yeah, you wouldn't take the risk of defining it twice
you can leave it empty
#include literally just 1-to-1 copy-pastes the text of your included file, into the file where you are including
thanks for the clarification, Dedmen
ah cool good to know
i got that as my sound class
{
name = "sitrep intro";
sound[] = { "sounds\sitrep_intro.ogg", 1, 1 };
titles[] = {1,"JTAC starts sitrep"};
};
ahh oh i just remebered i want it as cfg radio
hm wait no i dont
do i
?
I usually do a #define to declare sounds easily
but if you don't use stringtables, it would be a harder time
idk what define does and dont know what a stringtable is
lets just get the sound into arma without crashing, then i can optimize
stringtable is a pwoerful tool for defining strings in one place
that you can use in your code
making changes to those strings a lot easier
like a global array?
I create a "macro", then all I have to do is write ```cpp
SOUND(voice_1);
and it automatically populates to
```cpp
class voice_1
{
name = "voice_1";
sound[] = { "sounds\voice_1.ogg", 1, 1 };
titles[] = { 0, $STR_voice_1 };
};
but you have to import/include it somehow
ouuuuuuu cool
you don't need/want a stringtable if you don't want to do translations
Which I assume you don't
if you dont do translations
other one would be having all the names and stuff in one place easily accessible if you have to access it from many places in your code
and then making changes to that string easier
like a name of a property
i remember using stringtables (not in arma 3 context) for UI element colours
just so you know, you could dub with various language sounds this way, by using a different sound path with stringtable
e.g "en\sound.ogg", "fr\sound.ogg", "de\sound.ogg"
ah no im not that dedicated
like im building a mission that approximately 2 people will ever play
could π
yeah well then people will do englisch
can arma auto apply radio effect on a sound?
or do i have to add that myself in a sound editor like audacity?
if you use CfgRadio, there is a radio effect. if it's not enough, yes use a custom filter
I don't think it will change anything; I think the difference is the "channel" used (sound/speech, fadeSound/fadeSpeech)
i tried cfgRadio and that didnt add an effect
and how did you play it?
playSound will use CfgSounds only, sideRadio/groupRadio/xRadio will use CfgRadio
yeah i changed it from cfg sounds to cfg radio
i used playsound with isspeech true and false, and sideradio
isspeech true makes it louder. idk why
sideRadio should have added something
well, time to save to 8 KHz!
isspeech true makes it louder. idk why
the "channel" used (sound/speech, fadeSound/fadeSpeech)
"8 KHz!"?
I used sndrec32.exe in WinXP at the time, and you could save to a lower quality ^^
the exe should still work in Win10 if you can grab it (legally)
that creates a radio effect?
yeah trying to figure out how to
Set the "Project Rate" (bottom left corner of the main Audacity window) to 8000 before you export
why the hell do most yt tutorials not present their effect first before talking about how to do it
don't go youtube, go text ^^
yeah
yeah already sounds worse
but not bad enough
high pass filter seems to do the job well
now to listen to the vanilla radios and see if i can produce sth similar
once again my YT seems to hate me
you may want to look for "old record effect"
now we are skipping towards #arma3_audio territory π
highpass filter with 1200khz and 36 db reduction does a nice job
hm i had a plugin that made all sounds the same loudness
i cant remeber it tho
1200 Hz* no?
ahh replayGain
ah yeah hz
hm okay replay gain effs up the radio effekt too much. going with 1200hz 6dB now + replayGain
#arma3_audio if we remain on this topic π
kk
okay i got a bunch of radioed recordings now
time to build a convo system thats less -profane word for mentally challenged- than the vanilla one
heh :p
I made some "simple" kb script, all you have to do is provide [speaker, "sentenceId"] and add the topic to all speaking units
something like thatsqf { { _x params ["_speaker", "_sentenceInfos"]; private _kbTellParams = +_sentenceInfos; private _to = _kbTellParams select 0; if (_speaker == _to) then { _kbTellParams pushBack true; }; // force radio [_speaker, _kbTellParams] remoteExecCall ["kbTell"]; _sentenceInfos pushBack 3; waitUntil { _speaker kbWasSaid _sentenceInfos; }; } forEach _this; };
ok, it takes an array of [speaker, [listener, topicName, sentenceName]]
yeah i have a "dynamicSentence" that just takes in an array of words as parameters
but i still dont like it. its complicated for little result
well,
CfgSounds β .bikb
<nothing> β kbAddTopic
say β kbTell
sleep X β kbWasSaid
so if you want to "simply"use it as CfgSounds + say, it's not harder, just different
hm the convoSys can take in any cfgSounds right?
the Conversations system (kbThing) doesn't use CfgSounds at all
uh
was it words? or sth
hm i already forgot. probably my body trying to forget the trauma
RadioProtocol words can be used from kbTell yes. Otherwise you would need to redefine them in CfgSounds
im staying with cfgRadio
it automatically queues the words
look what i made
(minor profanity might occur)
https://youtu.be/udQ-r-RV7DA
how can i include multiple files? do i have to disconnect the statments somehow?
Arma doesn't use the object data type right, by default? (JSON, etc)
Trying to make an array with keys..
an array of arrays could work:
[
["key1", "value1"],
["key2", player]
]```etc
See
BIS_fnc_addToPairs
BIS_fnc_setToPairs
BIS_fnc_findInPairs
Hmmmm.. ok thanks
I was thinking more like how PHP does it, example:
$array = ['key1' => ['val1', 'val2'], 'key2' => ['val1', 'val2']];
But if that's the only way then thank you
Maybe something for Arma 4.. if it ever gets officially confirmed
you can also do
[
["key1", ["value1-1", "value1-2"]],
["key2", ["value2-1", "value2-2"]]
]
multi-level arrays are a thing
hello!
First of all thank you very much for accepting me in the Arma3 community.
I have start my Arma3 server but I try very hard to make a proper set up alone without any good progress. I have searched from where to start for scripting and server set up but I didn't found anything... If someone can help me please send me a message.
Thanks in advance Raphael.
@mint kettle hi! For server support, peeps @ #server_admins or #server_windows are there to help you. For scripting, I recommend you https://community.bistudio.com/wiki/Multiplayer_Scripting - it should answer some of your questions. And if in doubt, we are here to help!
thank you very much @winter rose I will try to contact with someone in that section.
Hello, I am looking to create a scenario where you have to pick up a few objects (3), take x time to pick them up, possibly save the amount of time trying to pick up the object hif you have to stop for a bit), and then sinc all picked up objects to open a locked door. I know this might be a lot so if I could get steps and some scripts along the way I would appreciate it.
For picking up objects I think the vanilla revive symbol would work best to kinda show picking it up
cannnnn i make an array of sqf files and do a selectRandom with a execVM?
_array = ["apple.sqf","orange.sqf","pear.sqf"];
[] execVM (selectRandom _array);
yes
@hushed tendon you need to look into addactions and player namespace variables.
My approach would be that every key has an action that gives the player a variables "key1 = true". The door has an action which checks all key vars -> "if (key1 && key2 && key3) open up"
You can store the time it took the player in a public player var too, store the time when the first key is pickef up and the time when the door is opened -> total time needed
Can I insert scripts in .. forexmpl ammo crates . arsenal or even npc's in order to do specific things?.. or there are going to be a lots of bugs ..? Because I'm thinking if I just copy-paste multiple codes maybe it doesn't work...
Thanks in advance
Raphael.
@mint kettle without more details, yes and no π
I need to start reading I guess :p Thanks again @winter rose !
what do you want to do?
if copy/pasting in the init field, without an isServer check it is not recommended
@mint kettle?
Generally you can put code into the ammoboxes etc but the only difference is that your _this variable becomes the reference to the ammocrate. You dont get sudden magic ways to do sth in code just by pasting it into the ammo box :)
It doesnt really matter where the code is run from; is what i want to say
I want to create a permanent arsenal on the server which is going to be there.
Locker for each soldier (user) in order to save their gear and ammunition.
Animation's for some AI talk/sit e.t.c and if they see enemy unit they will respond hostile in order to create scenario for the mission.
That permanent locker thing is really high tech complicated. I recommend starting out simpler
The AI sitting around is quite doable
@spark turret I see .... In the Bohemian page maybe I find something that could help from where to start.. I really appreciate for the help guys..
No problem
I dont think there is a starter guide tho
.. Maybe I'll find something :p
@spark turret hmmmm
How would you go about doing that?
The locker type thing for users
Ask dedmen. You need some kind of server to store the lockers inbetween missions
Sounds like an interesting concept
And i have no idea how to do that
Couldnβt you use a database maybe? Who knows if SQF can support that but
but yeah, if you want data to be accessible across different servers, extension and db it is
something people always tend to forget: if you trust your userbase, use profileNamespace
aka: if it is for your clan-missions, just add something in there
and use that for the lockers
who trusts their users nowadays
but true @tribal trellis β save in profileNamespace
Are there security flaws with using that method or something?
Oh never mind I just read it on the wiki
anyone could edit these values on their side yeah - hence the "trust your users"
Yeahhh probably wonβt use it then, thanks anyway
As much as I trust users in my unit
Itβs just not worth the risk, especially since itβs for a training mission
Donβt want people giving themselves explosives and whatnot
you could still do a server-side check
they could edit that if they have some scripting knowledge
I might give it a go but Iβve already got something that works, nothing hurts in experimenting I suppose
At least it will give me more understanding on how it works
@queen cargo how did i not know about that!
time to do hwat i always wanted to do. profile specific bullying
we have a player whos notorious for hitting trees in any vehicle (including helicopters) and for the past 2 years i have wanted to make a tree that ports behind him, as the ghost of all the trees he s killed. local oc so only he can see it
lol i just remebered i (by accident) built a forest that runs away, check that out
https://youtu.be/ZP_A7apAQmc
EPIC!
the original intent was to be able to prep the trees with explosives so you can block the road for an ambush. something i learned in the army but couldnt quite get to work in arma
looks like the trees did not like their new role as a suicide bomber
who wants to be a suicide bomber today?
everyone runs ....
i miscalculated. they are supposed to fall over, but their object center is in the middle, not the root, so i didnt just rotate but also displace them. but apparently with faulty numbers
i did get it to work properly in a very sandboxy setting. not usable in missions but proof of concept
thats the working one
btw. do you know a command for fetching the variable of a unit?
like getVariable. but tbh I am not sure if getVariable realy does what i expact ^^
@stone totem https://community.bistudio.com/wiki/vehicleVarName
getVariable for every variable attached to the nit. you gotta know the name of the variable tho
btw, getVariable has a "default return value" feature that can be used to detect empty or faulty vars.
hmm ok. and how do I find the name of the variable? I searched a list but did not find anything
player getVariable ["amountOfCookiesHeAte",-1];
will return -1 if the variable is nonexistent or empty
what variable are you looking for?
the thing that is called "Variable Name" in the Editor if you Edit a Unit
basically the standart variable. ^^
look alt talyas post
"Returns the name of the variable which contains a primary editor reference to this object. This is the variable given in the Insert Unit dialog / name field, in the editor. It can be changed using setVehicleVarName. "
@stone totem
vehicleVarName - but it is not a 100% sure thing (as it can be changed)
the variable name is not the name of a variable but the variable that contains the name of the object
an ID so to say
a soldier is a vehicle π
wtf arma
yeah
!
vehicle definition in scripting and in reallife, are kind a different :)
hehehe
hm didnt we have a command recently that did work for vehicles but not units?
moveInCargo π€£
is it possible to write to the server log when the administrator uses the camera for screenshots or an observer?
you can use diag_log to write stuff to the log, but I'm not sure what you mean by
when the administrator uses the camera for screenshots or an observer
The administrator on the server has the ability to use the debug console and related functions (free camera, etc.). I ask if it is possible to log their use.
It should be possible.
Is IntelliJ better than Visual Studio for editing scripts in A3? Do either of them have a plugin for SQF besides Notepad++?
VSCode has
see https://community.bistudio.com/wiki/Category:Community_Tools#Code_Edition @tough abyss π
Checking it out now
There is also an IntelliJ one there.
hey, i have a performance problem in my mission and dynamic sim or just plain disables simulation doesnt bring a lot of FPS
so i thought about deleting all Opfor on mission start and respawning them piece by piece as the mission progresses
thoughts on that?
does it help?
havent tested
deleting the opfor?
im smelling some of your script might be iterating over all units
oh yeah it skyrockets fps from 11 to 45
if reducing the number helps, but not dynamic sim
a wild while loop that's iterating through all those units on every frame?
hm i do have a script that checks nearby enemies for the convoi but thats just running once a minute
no im very cautios with loops
hah alright ill look over my scripts again
Scheduled or unscheduled? Either grab the profiler build or the profiler tool and find out which script(s) it is.
mhm its not my scripts
i deleted and replaced all opfor, dynamic sim now has an impact
not great but better
What is this profile tool you speak of
ArmaScriptProfiler probably
@spark turret this begs the question
how much AI do you exactly have in your mission?
DynSim or not
because dynSim itself must have a eprformance impact (although far lesser than that of the AI)
too much of it will still be an impact
yeah
right now i got 24 groups of 8 guys each
its very playable at 25 -40 fps with dynamic simulation atm
not really
since i deleted and replaced the opfor groups, it works as intended
gotta test more deeply before i can tell whats wrong
singleplayer, hosted or multiplayer(dedicated)?
SP
ah, i see
yeah gotta host all units
you gotta also host the logic enabling/disabling sim through DynSim
that logic could be "flickering"
flickering?
hm everything now works fine. im really wondering what was wrong with the old AI untis that they caused such loss of performance
if there are any
also, what if your pc is just poor?
running a lot of AI and the game at the same time can be heavy on weaker systems
where do i find dyn logs?
docs
and again, without knowing your system specs, i present the argument that it could be possible that your system just isnt up to the task

Sounds really weird
It should concern you when things dont work
It should seriously concern you when they work and you dont know why
Because the latter one can expose you to moving on without taking consideration on things that might not be working as expected/intended
A very dangerous phenomena... and all too common
im stillt rying to figure it out
Really, it's up to you to consider wether you care to, or not
Sometimes you wish you hadnt found the reason. Ignorance is a bliss
then it's not
Just to confirm, any scripting command which says "global effect" in wiki means that the result will be replicated to everyone no matter what machine it is executed on (or even if it is executed on the server)?
@slate cypress all connected clients and server
DO REMEMBER!
global arguments and global effect is different!!!
keep an eye on that
i want to detect when a bomb/missile/bullet impacts, which was fired from the players plane
working on an AI Jtac
how would i go about that?
trying with a fired EH for the plane which adds a killed EH to each bullet
hm i cant seem to get the projectile object
killed EH does not react to the object being destroyed, but objNull does
@spark turret the bomb doesnt get destroyed, if im correct. It gets deleted
@noble snow config error
ask the config folks
um okay i detected some really wonky wierd stuff
hm
it seems that the FIR AWS Gau ammo for the 1 a10 warthog gets immidiately deleted upon firing
the same happens for the vanilla a10-d
Yep thanks
hm the panavia tornado uses vanilla 20mm ammo and does not have that problem. the vanilla merkava also does not.
just the Fir gau ammo and the ACE gau ammo get instantly deleted and replaced by sth i assume
I'm looking to create some intel that can change how long it takes to pick it up and two possibly save how much time was taken picking it up (For example: starts to pick it up (10sec) and has to stop due to an interruption then going back to picking it up from 10sec to continue). If anyone has a script for at least the first one I would appreciate it.
@hushed tendon https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd can be converted to save progress by adding a small script on-interrupt case.
so im running into an issue regarding a script ive written which works when i try it out no errors at all, then once i put it on a dedicated server it just does not work, no errors pop up at all, idk if this is the right channel for it but anyone got any tips or ideas
it is the proper channel, and the issue might be locality
sarcasm bonk
once again i am discriminated against by out corporate overlords
gib three fiddy and leave free
lou do you by chance know if its possible that projectiles are deleted and replaced right after being fired?
i encountered that with the FIR a-10 and the vanilla a-10
all other vehicles i have tried dont have that with their projectiles
pls gib checking script so I check the vanilla A-164
wow
just the "size" of it ^^
yeah lots of debug stuff
also trying to work around false positives
im really surprised it doesnt impact performance at 0.02 loop for each bullet fired from a minigu
my wipeout is using ACE bullets
no issue here
ah okay so its likely an ACE thing
my wipeout is using ACE bullets
@spark turret
π¨
when you say vanilla, mean vanilla pleaaase!
sry π
Γ¨.Γ©
np, np adding to the paddlin' list
that "EH" thing is gonna get even bigger lol since there is no real EH for bullet impact, and the loop cant be fast enough to get the exact moment of impact, ill have to use the last pos and velocity and calculate the impact point
gonna be interesting to see how well that performs
there is a EH for bullet impact-ish... but.. its complicated
atleast if the impact stops the bullet
there is a config handler for bullet stuffz
but config only sadly
if you hit an object you can use Hit handler, but only if object receives damage i think
not usable. need J(AI)TAC to be able to tell how many bullets didnt hit and where
i also tried physx collision EH but didnt work
bullets are not physx
@crude vigil Do you know the save script?
@crude vigil Do you know the save script?
@hushed tendon Do you have the slightest idea how little that narrows it down?
I think he's refering to the "car script" meme π
But more a inside joke than a meme π€
Ah, well I do not hang in public places much regarding scripting, only here sometimes trying to help when nobody does. So excuse my lack of culture. π
Fine, a script to save the progress of time used to pick up object. Takes time already done and subtracts it from the total time
Based on my previous question
If you are looking for a ready to use code, I do not know. You need to craft it yourself.
π¦
It is not rewarding if you do not suffer.
Very little knowledge so can't wait to waste the next 5 hours on a small script!
π
Well, if you successfully accomplish, even if it takes 55 hours, it is still above average so, wipe the tears!
Well the last time I spent 5 hours making a script it took me a bit to realize the main mod was broken so not feeling to great
Actually might just scrap that script cause it can do without
Not using 5 hours for a tiny script that I have to make from scratch
I'm getting an error from this. Any ideas on how to fix? https://hatebin.com/stezfqzpwz
_document1 or document1?
1/ which error
2/ where is _document1 defined?
3/ where is this code executed?
If that is entire code, _document1 is not defined..
_document1 or document_1, not the same @hushed tendon
they are different for a reason
document_1 is to activate another script with the == true
_document1 is the object
And I'm getting an invalid number in expression
cant use == to compare bools
ninja'd
is pointless even if you could when using true or false specifically
x == true -> x
KK implemented == bool comparison recently..
Will be in next update
@Conner is that how I should do it?
I will probably write a script optimizer... will have to optimize out == true π
if document_1 is a bool then yes
yeah not so sure what even a bool is
true/false
Well let's stick with the code without the code completed on execution and I'll leave the bool for another question
jusst read ur paste properly.
{document_1 == true }, // Code executed on completion // == true used to activate something else
so you want to set document_1 = true to use it elsewhere?
It probably activates another document for some other purpose.
or use document_1 isEqualTo true π€·ββοΈ
so it is meant to assign true I guess.
yea, i mistook it for a condition
should this be in a file? cause the big script I have in a piece of intel rn
btw... https://community.bistudio.com/wiki/a_%3D%3D_b
Introduced with Operation Flashpoint version 1.00
Someone broke this? ^^
or just doesn't work with booleans
doesn't work with booleans yet
Boolean (since Arma 3 v1.99.146526)
unless we don't get your question
biki markup is π¦ sometimes, guess I'll need to make a solution for that 
Alright so I'm going to change this whole thing around a bit
I'm looking to have 4 intel documents, and upon picking the fourth one up a locked door opens. (All are picked up)
Any takers or scripts?
can help
private _documents = [doc1, doc2, doc3, doc4];
waitUntil { sleep 1 ; _documents findIf { not isNull _x } == -1 };
/* unlock door */
@hushed tendon
Alright and how would I activate another script upon the conditions being met?
would it be in place of _x?
no
the waitUntil will⦠wait until conditions are met
After that it will continue to execute what is written below
I'm confused. When conditions are met I want to execute gate setVariable["bis_disabled_Door_1",0,true]; gate setVariable["bis_disabled_Door_2",0,true]; could you show me?
oh wait should that all be in files not in the game init?
how do I detach an object attached with attachTo?
detach π€·ββοΈ
sounds reasonable enough
never write scripts late in the night lol
i was trying to attach it to objNull
usually if you check the wiki page for a command/functions you'll find a list under "Additional Information" with commands/functions related to it
yea I should have noticed it, my bad
can I make an unit launch flares but also tell the shooter that they are ineffective? I want the plane to get destroyed when everyone paradrop but if it shoot flares the missle miss
i'm not sure the subskill affect missle sensors
Could I expect this trigger condition to work a) in general theory and b) if one of the units in the array had not been slotted?
({alive _x} count [unitCSAT_space1,unitCSAT_space2]) == ({alive _x} count ([unitCSAT_space1,unitCSAT_space2] arrayIntersect thisList))```
Hi I want to make an script that when you hold "Alt" and click on map , you will teleport
Anyone can help me
@candid cape first link on Google: https://forums.bohemia.net/forums/topic/153367-teleport-script/
Thanks but I want the tp to work when the "Alt" is pressed
You need to consider whether that distinction is important enough to be worth what is likely to be an unreasonable amount of effort
I would say "no"
@candid cape you want someone to write the script for you or do you want to write it yourself?
Take the script in that link and add a check to it for the action:
Not exactly "alt" but the default bind to alt is freelook
You can use that
Although i would read the notes
What i recommend, though, is that you figure some other way
There isnt really an elegant one to do it
Well, elegant shorthand for simple and easy
Alt+click isnt chill in arma
well this is bad... apparently you can get yourself stuck in a loop where you can't control anything or enter a menu when previewing a mission which means the only way out is to alt-f4... I hope my stuff saved before the preview...
@ebon citrus On Infistar there is an option to do it
When you open the map and then hold "Alt" and click on the map , you will teleport where you want

Well, you see
The infistar devs dont come here asking people to write script for them
They write it themselves
From what i know, yes you CAN do it
But YOU (maybe) cant do it
Just because someone else knows how to do it, doesnt mean it's simple...
And just because someone else has done it, doesnt mean you should do it
@fair drum there is a lot of ways you can brick arma 3 from within the game
That's the beauty of arma
Everything is possible
In the eden editor it can be done, when you open it and hold the "alt" and the click you teleport
and?
you barely even gave us context on what you want to be using it for... you want all players to do it? want to just be able to teleport around in your own mission by yourself? you have got to give more than just... gib script please.
It is for a server, that if you are an administrator, when you press the "Alt" and any point on the map, you can teleport there
if you are an admin, you can get the debug console, you can then select spectator, then open map and middle mouse button and teleport anywhere
no need for script
Found my loop error... apparently respawn templates are case sensitive when it comes to its string...
respawnTemplates[] = { "menuPosition" }
is not the same as
respawnTemplates[] = { "MenuPosition" }
I see no mention of that on the wiki page btw
oh?
worth a note in the wiki if that's the case
just confirmed when testing. if you use "menuPosition" over "MenuPosition" it will throw a HUGE error and lock the player from any input
forcing an alt f4
Proof https://streamable.com/sr8jgp (now with my name removed lol)
Second part when I leave the menu, I lose any input over the game and must alt f4.
Thanks for the vid @fair drum (and activate your Windows =)
Windows keys are 3 bucks :)
i JUST changed my cpu and mobo
gonna have to get a new one cause they said they are unable to transfer π¦
Thats a lie
You can reactivate any key
Windows just doesnt like it but the EU high court forced them in 2013
unfortunately, don't think that applies to NA
Oh interesting!
Do you not have those huge second hand key websites that sell all windows for 3 to 10 bucks?
we do, just too lazy to go do it. its not a big deal for me
Ah alright haha i keep switchibg hardware and forget the keyes so i have to rebuy them once a year
Would bancrupt me if i bought fron windows directly
anyone have a way to allow all sides to use all uniforms?
without using forceAddUniform
erg would be faster just to change my player's faction. I didn't think about this before selecting a side for them
What is the problem?
Cant you just change the uniform in editor arsenal or the players do it themselves on runtime?
Or do you want to redress enemies?
I know there is a variable to check if a trigger has fired before
But i cant remeber its name
Ah i think its triggerActivated
Wasnβt sure what channel to put this in but, I wanna practice my SQF skills so was wondering if anyone had some cool script ideas for a milsim training mission?
Like a personal locker thing for equipment, shooting range functions, etc
Shooting range with pop targets with different programs
Also with a shot counter and a precision rating in the end
Got those already :L
Spent countless hours on that.. only to find out I should've rewritten my original script because the base was awful
Eloborate in the shooting range pls
?
You said you already have one
Ohhh right sorry
I've made a shooting range script which has like a sequence function, all different distances, each lane can be controlled individually (and all together)
There's a scoring/accuracy system built into it as well
Figured there might be some extra functionality missing to it
Don't know what exactly, but there's always something to add right
Little picture in picture display that shows the bullet imapct
Ok ok I like that, maybe that could be something for the Marksmanship test for the longer-range shots
Moving targets
On Rails. Its awful to script but cool effecr
Marksman is probably the easiest. Count shots till hit
Moving target is super important. Everyone can shoot a standing one but i guarantee you 50% of my clans players cant hit a running one at 200m
You could also give medals. We had bronze silver and gold medals in the army for each weapon
You had to do a stabdard shooting excercise and based on precision git the medal
A standardited precision excercise is sth i had wanted to script for a long time
That'd be neat
Do you have plans on sharing the script?
In ace, is there a way to either overwrite the join group action or disable those actions all together?
ace_interaction_enableTeamManagement setting.
thanks
@wispy cave idk if you want it but
If you go to Addons Options -> ACE Interaction
There's the team management setting there
Do you have plans on sharing the script?
@spark turret I didn't plan to if I'm being honest
It's something I might consider but never have released a script of my own to the public before
I could even make it into an addon, include modules and whatever to sync to so it's much more user-friendly
But yeah, never considered it previously
okay i tested chaining triggers
it appears that a trigger set to "opfor - not present" gives off false positives
hm?
The heck
You know you need to keep 'this' value in condition for that trigger to check OPFOR Not Present parts, right?
That is at least how I remember so far , been a long while since I have used anything in 3den though so I may be wrong.
If you want to write a condition script along with that condition as well, just use this && <your-code>
a tooltip in the editor would have been ^helpful lol
it should have a tooltip
i know how conditions work. i just didnt think a trigger would allow firing without fulfilling its own condition
it is why it always comes with 'this' written in there at start.
and tooltip (hovering on condition title) states it :)
I mean it somewhat says it
Doesn't explicitly say it but
unless I'm misunderstanding the tooltip
yeah unbelievabel! freaking BI devs expect me to read their tooltips!
not my fault i didnt read it and then it didnt work!
i want to speak to a manager. i demand a discount for the troubles BI gave me
how can i force a turret to look at a dir?
What are you trying to do exactly?
I need help with a music player within the vehicle, i have scripts but I dont know how to include them to locate the source of the audio clips
class CfgSounds
{
sounds[]={song1,song2,song3};
class song1
{
name = "song1";
sound[] = {"music\track1.ogg",0.5,1};
titles[] = { };
};
class song2
{
name = "song2";
sound[] = {"\music\track2.ogg",0.5,1};
titles[] = { };
};
class song3
{
name = "song3";
sound[] = {"\music\track3.ogg",0.5,1};
titles[] = { };
};
};
//Music.sqf
_vehicle = _this select 0;
_playtracks = _this select 3;
sleep 2;
switch (_playtracks) do {
case 1: //playing song 1
{
soundsource1 = "Land_FMradio_F" createVehicle [0,0,0];
hideObject soundsource1;
sleep 1;
soundsource1 attachTo [_vehicle,[0,0,0]];
sleep 1;
hint "playing song!.....";
sleep 3;
soundsource1 say3d "song1";
closesong1 = _vehicle addaction ["stop song 1","stopsong.sqf",1];
};
case 2: //playing song 2
{
soundsource1 = "Land_Can_V2_F" createVehicle [0,0,2];
hideObject soundsource2;
sleep 1;
soundsource2 attachTo [_vehicle,[0,0,2]];
sleep 1;
hint "playing song!.....";
sleep 3;
soundsource2 say3d "song2";
closesong2 = _vehicle addaction ["stop song 2","stopsong.sqf",2];
};
case 3: //playing song 3
{
soundsource1 = "Land_TacticalBacon_F" createVehicle [0,0,3];
hideObject soundsource3;
sleep 1;
soundsource3 attachTo [_vehicle,[0,0,3]];
sleep 1;
hint "playing song!.....";
sleep 3;
soundsource3 say3d "song3";
closesong3 = _vehicle addaction ["stop song 3","stopsong.sqf",3];
};
case 4://playing random song.
{
soundsource1 = "Land_Can_V1_F" createVehicle [0,0,4];
hideObject soundsource4;
sleep 1;
soundsource4 attachTo [_vehicle,[0,0,4]];
sleep 1;
hint "playing any song!.....";
sleep 3;
_songs = ["song1","song2","song3"];
soundsource4 say3d ( _songs select floor(random((count _songs) - 0.5 )));
closerandomsong = _vehicle addaction ["stop random song","stopsong.sqf",4];
};
case 5: //closing music player
{
_vehicle removeaction playtrack1;
_vehicle removeaction playtrack2;
_vehicle removeaction playtrack3;
_vehicle removeaction playrandomsong;
_vehicle removeaction closeplayer;hint "Music player switched off!";
playmusic = _vehicle addaction ["Start music player","musicplayer.sqf",true,1,false,true,"","player in _target"];
};
};
//Musicplayer.sqf
_vehicle = _this select 0;
hintSilent "Music player switched on!";
sleep 2;
hintsilent "";
sleep 2;
playtrack1 = _vehicle addaction ["Track 1","music.sqf",1];
playtrack2 = _vehicle addaction ["Track 2","music.sqf",2];
playtrack3 = _vehicle addaction ["Track 3","music.sqf",3];
playrandomsong = _vehicle addaction ["Play Random song","music.sqf",4];
closePlayer = _vehicle addaction ["Close Music player","music.sqf",5];
sleep 0.1;
_vehicle removeaction PlaySongs;
exit;
//Stopsong.sqf
_vehicle = _this select 0;
_stopsongs = _this select 3;
sleep 2;
switch (_stopsongs) do {
case 1: //stopping song 1.
{
hint "select other song!";
deletevehicle soundsource1;
sleep 0.1;
_vehicle removeaction closesong1;
};
case 2://stopping song 2.
{
hint "select other song!";
deletevehicle soundsource2;
sleep 0.1;
_vehicle removeaction closesong2;
};
case 3: //stopping song 3.
{
hint "select other song!";
deletevehicle soundsource3;
sleep 0.1;
_vehicle removeaction closesong3;
};
case 4://closing random song.
{
hint "Random song stopped!....";
deletevehicle soundsource4;
sleep 0.1;
_vehicle removeaction closerandomsong;
};
};
just the big concern is it not being defined in the scripts for the songs to play
So i need a way of getting an array of allplayers. Followed by
A waituntil on the server
To wait for anyplayer to within 30 meters of an object.
Private _players = allplayers;
If (isServer) then
{
Waituntil
{
??? Anyplayer??? in _players distance _myObject < 30;
};
< CODESTUFF>
};
I know that i could make use of a create trigger and then set activation to "anyplayer" but can I do it without it? And does it matter performence wise?
Thank you!
_playersThere = allPlayers inAreaArray marker_1;
if (_playersThere isEqualTo allPlayers) then {Hint "all players are in loc1";};
no
because isEqualto will check players' order in the array
more like```sqf
allPlayers findIf { !(_x inArea "theMarker") } == -1
hm even easier. count players in marker compare to count allplayers
or that
i found out that the "doWatch" command using a unit will not update the position and also doesnt allow new doWatch commands
you have to use a position, then you can overwrite it with a new doWatch
Alright. But this solution demands me to create a marker of 30 meters onto _myobject.
But i see how you thinking. Thank you π
distance?
( }
:}
Use objNull as the target to order a unit to stop watching a position/target.
ah cool
i found a genius, not at all wonky solution to have the radar on the trailer rotate
check this out and be enlightened by my genius
β¦zomg
@spark turret or animate the radar.

It's a turret
I remember doing this for my helicopter tank conversion
You enter "helicopter mode" and the tank's turret spools up
All with particle effects, sounds and all the galore
Not anymore, unfortunately
I had to do some spring cleaning to free up space and deleted all my videos
Is there a way to get a direction (0..360 or north/southetc) between 2 points?
_reldir = player getRelDir tank; only takes in object as first parameter
ah maybe getDir allows two pos
I need to have a tank heli now...
@spark turret https://community.bistudio.com/wiki/getDir, alt syntax
Yeah dont know how i missed that
you know whats funny @winter rose . I show that error above with the respawn templates, and I forgot to change it back, which just wasted everyone's time for 30 min haha
Anyone know how to make an on screen timer? I was thinking of using hint but I can't figure out how to make it wait a second before hinting
please note the
this command only guarantees that the code will be suspended "at least" the given amount of time, however it often is more and on occasion is a lot more if script scheduler is particular busy
this command will suspend the script indefinitely if game simulation is paused in SP. To avoid this, use uiSleep.
yeah I checked it out but still can't figure it out
so the code should be in an SQF file or in a [] spawn {};
see https://community.bistudio.com/wiki/BIS_fnc_VRTimer (and my note for a countdown)
@hushed tendon
where does the _timeout come from?
that's the created function (click "Show text")
the written function above @hushed tendon
@still forum as far as I remember you are the TFAR-Gentleman. So I hope you can help me.
I am planning to use the enableChannel command as a quick way to disable some channels. Will this interfere with TFAR?
no
great thanks β€οΈ
@winter rose For the countdown where do I put the activation?
wherever you want� I am not sure to understand the question
Actually nvm
I can't get it to start a countdown on screen
Is there a way to modify the vrtimer to countdown from 300 sec?
β¦that's what I did with my function?
I guess I just don't understand this at all then
what did you try ^^
I put the big section into an sqf, and called it from the mission init
am I supposed to use the vrtimer script along with yours?
you can place all the code that is within sqf LM_fnc_timeoutCountdown = { /* this part*/ }; in an sqf, then use sqf [300, "#FF5500"] execVM "mySqf.sqf";
@hushed tendon β
workies?
in your sqf file, place the function code that is between the main code brackets { }
have done
then in your mission, use```sqf
[300, "#FF5500"] execVM "theSqfFileName.sqf";
even in the debug console, it should work
(beware, as the timer is to the right of the screen and may be hidden by Eden menus)
do I have to modify anything from inside the {}?
nothing at all
just be sure that your sqf file is file.sqf and not file.sqf.txt (make sure that Windows has "show file extension" enabled)
it is sqf.
I wish I could have just
+300 vrTimer; or something as easy as that
But not for scripting...
well, something is wrong somewhere here
my lack of skill?
mostly the setup of this specific function π
It would be a much messier script but could I use sleep and hint to countdown? Like
hint "3"
Sleep 1;
hint "2"
Sleep 1;
hint "1"```
Pretty sure that using that would fail though
no stop
dont write that. use for _i
its a loop that runs a set amount of times
for "_i" from 1 to 10 do {
hint str _i:
sleep 1;
};
this will count from 1 to 10 with 1 second sleep inbetween
_i is the variable and changes on each iteration
you can also do more advanced stuff like setting the size of the steps to count in and more conditions
I did that, gave an error and only showed 10 as a hint
I used yours
oh
under the init
What are some key things to look into regarding connecting something in game to a spreadsheet? For instance: Someone buys an item and then the number of items they bought is copied onto a google sheet. The purpose of it would be to get easy to read/access info to analyze
i heard arma cant write files but thats little more than a rumor
hm standby wagons, ill check
ah i know. init line does not allow code suspension
the sleep command is what throws the error
what do you want to do with the countdown?
My goal is to countdown from 300, show the countdown, and end scenario after countdown.
ah you can use an empty trigger for that, no need for script
trigger has a built in countdown function.
if you want to do it by code you need to do it in a separate scriptfile or use the "spawn" command to allow suspension
certain environments like the init file and addActions and eventhandlers do not allow sleep commands, so you have to run it outside of those environmetns. -> yourscript.sqf
so mySqf.sqf
hint str _i:
sleep 1;
};```
then in init
```execVM "mySqf.sqf";```
?
and how do I activate a trigger on mission start?
do you want the trigger to end the mission after it was activated or sdo you want to limit the whole mission to 300 seconds?
well I can't put execVM "mySqf.sqf"; in the init so I put it in the activation of a trigger and I'm looking to just show the countdown rn
I already know how to end it after 300sec
if you use execVM you dont need the trigger. but you can use it if you want
keep in mind that "hint" is a local command, so you have to execute it on every client.
maybe systemChat is better. i assume thats global
prob
don't assume anything, it's local
https://community.bistudio.com/wiki/systemChat
why would a chat command be local
that seems rather counterproductive π
directChat ok but systemchat?
because it's to display something in the chat channel
you wouldn't want a group conversation to happen on both sidesβ¦ π
use my script, and placesqf if (!didJIP) then { [300, "#FF5500"] execVM "theSqfFileName.sqf"; }; in init.sqf, that's it!
so in the box is the caller and the show function from the page in the sqf?
I didn't understand this sentence
[300, "#FF5500"] execVM "theSqfFileName.sqf";
};``` calls the sqf
```private LM_fnc_timeoutCountdown = {
params [
["_time", 30, [0]],
["_colour", "#FFFFFF", [""]]
];
private _timeout = time + _time;
RscFiringDrillTime_done = false;
1 cutRsc ["RscFiringDrillTime", "PLAIN"];
while { time < _timeout } do
{
private _remainingTime = _timeout - time;
private _timeFormat = [_remainingTime, "MM:SS.MS", true] call BIS_fnc_secondsToString;
private _text = format ["<t align='left' color='%1'><img image='%2' />%3:%4<t size='0.8'>.%5</t>",
_colour,
"A3\Modules_F_Beta\data\FiringDrills\timer_ca",
_timeFormat select 0,
_timeFormat select 1,
_timeFormat select 2
];
RscFiringDrillTime_current = parseText _text;
sleep 0.01;
};
private _timeFormat = [0, "MM:SS.MS", true] call BIS_fnc_secondsToString;
RscFiringDrillTime_current = parseText format ["<t align='left' color='%1'><img image='%2' />%3:%4<t size='0.8'>.%5</t>",
_colour,
"A3\Modules_F_Beta\data\FiringDrills\timer_ca",
_timeFormat select 0,
_timeFormat select 1,
_timeFormat select 2];
sleep 4;
RscFiringDrillTime_done = true;
};``` in the sqf?
yes, but you should NOT have
private LM_fnc_timeoutCountdown = {
// ...
};
```only what's in it
oh
Thanks a bunch you guys for helping me
And I'll be back in an hour with another question that will take 2 hours to solve
you script as posted just defines the LM_fnc function but doesnt call it
And is the vrTimer local?
yes
ohhhhhh
but if you placed this call in init.sqf, it will call it for every player
(not the JIP players though)
Alright
Well I'm not making this an online thing, just a simple game mode for my unit so it can do with monir problems
minor*
yep
w00t! cool thing
I can go to bed freely now π
oh sorry
no no, my pleasure
Alright if you say so
I am not blaming you at all
just saying that I can sleep knowing the topic is done ^^
nothing from Arma, sounds like a l*fe specific thing, so I would suggest to ask on the discord/forums from the framework you use
The problem is that , the function it's working , but there isn't defined
I don't know why
copy&pasted a feature which required it without adding it, broken version of a framework, etc.
it's not an Arma function, so hard to tell what it is or where you can find it
iirc it is supposed to be the cursorTarget object you looked at to open the vehicle interact menu. i think it is set either in the keydown evh or in the fnc used to open the interact menu.
@candid cape that's not a function
can I set a helicopter flying per script? or turn the engine on, but skip the long start-up process?
like when you place a helicopter in the air, it spawns with full rotor speed
If the helicopter has Advanced Flight Model enabled (unsure how this applies to AI helicopters) you can use setEngineRPMRTD
if you just want the vehicle to start airborne (i.e. the takeoff part isn't important), createVehicle has a parameter that causes the created vehicle to spawn in the air and flying, just like with editor-placed vehicles
seems like ill have to use the conversation system
cfgRadio adds the on/off sound so you cant add multiple sounds together to a compelte sentence
and cfgSounds doesnt give a good way to queue sounds up
no, the helicopter is already placed. my problem is, it's on a building and the physics are weird, making it bounce
so I disabled simulation, but later on it must take off. but because the engine is so slow, it doesn't take off before it explodes from the bouncing
sure, I could put it somewhere else, but I don't wanna :p
i hate my life and especially arma sounds rn
y u do dis
attachTo perhaps? Then turn its engine on, and when ready release it (like a pigeon)
@barren spire
@spark turret I will be off for 1.5 weeks so you can try during this time π
shame, noone to rant to
alright, I'll try the attach to idea :)
Depending on the geometry of the building, you could try "reinforcing" the roof with more physics-friendly objects, such as the concrete slabs added in Contact
@winter rose engine turns on, but the rotors don't spin until it is detached π
@winter rose 2 days in your vacation your hands will start shaking and your head spins and you will have to come back to the discord.
It is inevitable.
let me dream!!
invisible walls under the wheels actually fixed it π
THank you!
help i dont know anymore what to do
arma says it doesnt know any OT_one sound
but im clearly looking at it
//description
author = "IR0NSIGHT";
onLoadName = "Showcase AI JTAC";
onLoadMission = "Showing and testing the automated JTAC for CAS";
class CfgRadio
{
sounds[] = {};
class Ot_start_TEST
{
name = "";
sound[] = { "sounds\offTarget\ot_start.ogg", db + 100, 1.0 }; // .wss implied
title = "";
};
#include "sounds\offTarget.hpp"
};
//offTarget.hpp
class Ot_start
{
name = "";
_sound[] = { "\sounds\offTarget\ot_start.ogg", db + 100, 1.0 }; // .wss implied
title = "";
};
class Ot_zero
{
name = "";
_sound[] = { "\sounds\offTarget\ot_zero.ogg", db + 100, 1.0 }; // .wss implied
title = "";
};
class Ot_one
{
name = "";
_sound[] = { "\sounds\offTarget\ot_one.ogg", db + 100, 1.0 }; // .wss implied
title = "";
};
oh for
PROFANTIYS SAKE
that damn \ infront of sounds came back
Ta-daaa π
Ctrl+S
Sure you don't have two text editors open?
Is there any way to adjust the global contrast of a mission?
I wish to make the mission a little black and white-ish if possible.
Even if it is just for a cut scene
Thanks!
["ColorCorrections", 1500, [1, 0.4, 0, [0, 0, 0, 0], [1, 1, 1, 0], [1, 1, 1, 0]]] spawn
{
params ["_name", "_priority", "_effect", "_handle"];
while {
_handle = ppEffectCreate [_name, _priority];
_handle < 0
} do {
_priority = _priority + 1;
};
What is the point of the while loop?
Basically nothing
You cannot create ppEffects if priority is taken by another ppEffect
^ this tho, that almost won't happened on my experience
That while loop is to ensure to find the _priority available, otherwise there is a chance you can fail to create the effect and move on.
finally got the sounds for my JTAC to work properly
So is this while loop simply recreating the effect until it has the unique priority (higher)?
No, it is to ensure that it is created.
if handle is less than 0 , it means that it failed to be created.
as that priority was occupied by another _priority.
Ohh I see now
So as long as the handle is less than 0, it needs to bump up the priority by 1 to ensure it is created and the priority is not used by another effect
π
And Iβm assuming this is all local?
is there a way to disable a vehicles collision with the ground?
No
i want to remove an EH if the same EH fires. so it fires once, gets deleted
i know there is a way of doing it, but i cant remeber how
ahhhhh _thisEventHandler
i want to get every number in a mutli letter number.
so 1069 -> 1,0,6,9
count str 1069 returns 4 positions, implying it can be turned into an array
how do i do that?
splitString
Guys, I want to make a script that adds an action to every player (Multiplayer) to open the arsenal, but the code I came up with only adds it to the host and instead of just opening the arsenal, makes so that the his model becomes something like a virtual ammobox, so everyone who get closer to him receives the action in the context menu, which I don't want. This is the code:
[[player, ["Arsenal", {["Open", true] call BIS_fnc_arsenal;}]], "addAction", true, true] call BIS_fnc_MP;
Can someone help me? (Sorry for any english errors, not a native speaker)
have you tried you addaction in SP?
any particular reason you dont want to use remote exec?
its a lot more inuitive imo
I've just discovered the existence of remote exec lol
haha alright. advantage is it can take in whole sections of code
{hint "hello there"; }remoteExec ["call",0,true];
hey, does the functions parameters stand before or after the statement? It's confusing compared to conventional programming languages, I can't tell the diference between the {hint...} and the ["call"...]. Seems like the part in the left of the statement is just the first parameter of the function, is that right?
Code is inside {} and [] are parameters
Call is the function and the {...} is the code that "call" takes in as parameters
And remoteexec execs the call on all clients with the {..} as parameter.
I am making a custom debug dialog and trying to emulate the default debug global/server exec buttons
ive tried this (99007 being the main code box) but it doesnt work
_code = ctrlText 99007;
[_code] remoteExec ["call",0];
Try without the bracktes
fantastic it works, tyvm
i assume to run it as server just change 0 to 2
Yup
cheers dude
99007 is an RscEdit box, where we will write/test code, ctrlText returns the text inside the box
basically making it the same as the Execute box for the default debug console
{player, ["Arsenal"], {["Open", true] call BIS_fnc_arsenal;}} remoteExec ["addAction", 0, true];
what have I done wrong?
A command B translates into [A,B] remoteExec ["command"]. So,
[player, ["Arsenal",{["Open", true] call BIS_fnc_arsenal;}]] remoteExec ["addAction", 0, true];```This should do
i cant believe i never did this before but:
can i create functions with a return value?
just local ones
I didn't understand the "A command B", but It seems it worked, gonna test it in mp right now
lucas the code brackets
you are giving the addAction code as parameters but it takes in an array
can i create functions with a return value?
huh? what do you mean by that?
every function returns a val......... almost every function returns a value
method (a,b) return (a-b)
_myCoolFunction = {
params ["_a","_b"];
_sol = _a - _b;
return _sol
};
last value left on stack is returned
sqf can be so easy!
and then on the other side of the spectrum you spend 90 mintues trying to figure out why your CfG Radio doesnt work
until you find a faulty \
A command Btranslates into[A,B] remoteExec ["command"]. So,[player, ["Arsenal",{["Open", true] call BIS_fnc_arsenal;}]] remoteExec ["addAction", 0, true];```This should do
@warm hedge didn't work in multiplayer, maybe I've made a mistake, can I insert this code in the game logic entity module?
does it give an error?
btw this here
Name: Arma 3 - Open Last RPT
Id: bux578.vscode-openlastrpt
Description: Quickly opens the last Arma 3 log file (`*.rpt`).
Version: 1.1.1
Publisher: bux
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=bux578.vscode-openlastrpt
is a Visual stuido code extension that allows you to open the last MP log file with ctrl alt r
saves time π
lmao arma is acting up again
i wrote a function that takes in any number and translates that into cgf radio sounds so the number can be read out via radio
now, arma translates big numbers from 08002222222 to 0.2 e^9 which effs up my splitstring
just a random note for interest.
use toFixed
kk (y)
can i make variables restricted to a scope that are not able to modify var with same name on the upper scope?
the keyword
private _variable = x
you should basically always do that when you define a "new" variable
cool (y) i rarely use public access modifiers in arma
bc most scripts arent complex enough to need em
private, public, restricted
Thats a very different thing
and its protected, not restricted
bc most scripts arent complex enough to need em
yeah.. until you run into an error you can't explain yourself and get stuck on it for hours
its a different thing?
also making them private like I posted above will make your scripts run faster and more efficient
interesting
what you said is object oriented stuff, SQF isn't object oriented
and private, public have NOTHING to do with variable scoping
okay interesting
@sacred turret player is a different value on each machine; but here, you sent them the server's player value (which is objNull on dedicated btw)
what I want to do is just like that mod Personal Arsenal, but via game logic entity in a mission, is that possible ?
@sacred turret ----> #arma3_editor is probably what youre looking for
ok ty
anybody know a good nuke script?
most mods I've found add too much stuff for what I need; I just want a scripted nuke with some nice visuals and no damage or radiation scripts
@worthy parcel https://www.armaholic.com/page.php?id=23963
the one from arma 2
smarter ways to activate it, but the script is included in the download, so you can activate it however you like
Hey everyone! currently working on a script that would reference the memory points of a player's headgear...unfortunately I can't seem to figure out how to reference the memory point for the selectionPosition command....any ideas?
Is there a client-side event handler which runs on client and is triggered when client disconnects from server or goes back to game menu in a SP mission?
Or maybe you have some other idea:
I want to save something to profileNamespace. There is something like a notepad in the mission where player can write to and I'd like the notes to be saved to profileNamespace at some point.
Except that data is added to that notepad from the server too.
Ideally I'd do this when data is added to it, but it might happen during gameplay, and profileNamespace can be up to 12 megabytes in my case which means game will freeze for large amount of time.
I might do it on notepad GUI close as well, but if data is added there and player never opens the notepad then data is not saved, it's not perfect too.
What
@astral dawn why?
ArmA 3 servers aren't exactly FTP servers
how are you even transfering that 12 MB?
Sorry man, why what exactly?
vars,arma3profile has save game data which might be huge in my mission and I can't re-save it (saveProfileNamespace) whenever I want, so I want some event handler which runs when client leaves π€
although, maybe arma saves it itself when game is closed?
also, the client might disconnect whenever
it's not exactly an event you can "handle"
so you best bet is to do what you need to do periodically
also, why does this data need to exist on the server and the client, exactly?
Yeah I know that he can do Alt+F4... yes yo uare right π€
well if he plays in singleplayer or self-hosts
then the has the saved game data
by self-hosting I mean if you run arma game, then start a new multiplayer game as a host
not a dedicated server
so disconnect EH's for the server would run on the hosts client
I guess arma doesn't have such event handler so there's nothing I can do anyway
it doesnt have the eventhandlers because the event cannot be handled on the disconnecting client's end
there is nothing TO handle
the mission ends when the client disconnects
there is something to handle, I click escape to terminate the mission, mission is terminated - we can handle what happens when it is terminated
in theory I mean
it's like mission end (for this client) but not because of endMission but simple because he went back to main menu π€
yes, nice idea Nica, I should seek solution in UI then 