#arma3_scripting

1 messages Β· Page 608 of 1

kindred lichen
#

TargetBootcampHumanSimple_F as long as there aren't any like this that you don't want to apply it to

ebon citrus
#

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

kindred lichen
#

Looks good thanks!

knotty mantle
#

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.?

copper raven
#

if you make trigger serverside then it will run serverside

#

your question doesn't make a lot of sense

knotty mantle
#

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.

winter rose
#

nope, unless you use local values (like player)

knotty mantle
#

Thanks. Thats what i thought πŸ™‚

knotty mantle
#

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)

winter rose
#

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

knotty mantle
#

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?

winter rose
#

no diff - init.sqf is run on the server as well

knotty mantle
#

You mean in the beginning right. It is not run for the server if someone jips?

slate cypress
#

@knotty mantle I believe it is run on the server once at mission startup and then only on the joining players after that.

quasi rover
#
//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?

winter rose
#

are these types defined in CfgTaskTypes?

winter rose
#

@quasi rover

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.

winter rose
#

okido (not in front on my computer)

ebon citrus
#

Infact, Lou is behind his computer, hiding from the 3den init-field that snuck into his room

winter rose
#

shhhhhh it will hear ya!

spark turret
#

hey iirc there was a way to split up the descritption ext. and use #include or sth to also include the extra file?

ebon citrus
#

yes

spark turret
#

im learning how to put in custom sounds and would like to keep them as a sperate class file

ebon citrus
#

.hpp

#

you can drop your config in one and import it

spark turret
#

so it would my "myUberCoolSounds.hpp"?

#

and in the description i put #include "myUberCoolSounds.hpp"

ebon citrus
#

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

spark turret
#

okay ill try that out

ebon citrus
#

yep, like that

spark turret
#

lets hope it wont directly crash the game

ebon citrus
#

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

spark turret
#

i got this in my description now

#
{
    #include "sounds\IRN_CAS_sitrep.hpp"
};
ebon citrus
#

what's in "IRN_CAS_sitrep"?

spark turret
#

the hpp that holds all the sound classnames

#

like, the stuff that would normally go into the description

ebon citrus
#

yes, show an example

spark turret
#

dont have one yet, give me a second

ebon citrus
#

ok

spark turret
#

does "sounds[] = {};" go into the description or extra file?

ebon citrus
#

im not quite sure on this, but im pretty sure it goes in description

#

not the extra file

#

i usually deal with functions

winter rose
#

yeah, you wouldn't take the risk of defining it twice
you can leave it empty

still forum
#

#include literally just 1-to-1 copy-pastes the text of your included file, into the file where you are including

ebon citrus
#

thanks for the clarification, Dedmen

spark turret
#

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

#

?

winter rose
#

I usually do a #define to declare sounds easily

#

but if you don't use stringtables, it would be a harder time

spark turret
#

idk what define does and dont know what a stringtable is

#

lets just get the sound into arma without crashing, then i can optimize

ebon citrus
#

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

spark turret
#

like a global array?

ebon citrus
#

for localization or otherwise

#

like XML, im pretty sure

winter rose
#

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 };
};
ebon citrus
#

but you have to import/include it somehow

spark turret
#

ouuuuuuu cool

still forum
#

you don't need/want a stringtable if you don't want to do translations

ebon citrus
#

not clear on that

#

yeah, you dont need them

still forum
#

Which I assume you don't

ebon citrus
#

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

winter rose
#

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"

spark turret
#

ah no im not that dedicated

#

like im building a mission that approximately 2 people will ever play

winter rose
#

could πŸ˜›

spark turret
#

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?

winter rose
#

if you use CfgRadio, there is a radio effect. if it's not enough, yes use a custom filter

spark turret
#

okay illtry cfgradio then

#

bc playSound over radio didnt add any effect

winter rose
#

playSound over radio
?

#

oh, isSpeech perhaps?

spark turret
#

ah i set it to true

#

lets try false

winter rose
#

I don't think it will change anything; I think the difference is the "channel" used (sound/speech, fadeSound/fadeSpeech)

spark turret
#

i tried cfgRadio and that didnt add an effect

winter rose
#

and how did you play it?

#

playSound will use CfgSounds only, sideRadio/groupRadio/xRadio will use CfgRadio

spark turret
#

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

winter rose
#

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)

spark turret
#

"8 KHz!"?

winter rose
#

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)

spark turret
#

that creates a radio effect?

winter rose
#

yes, very poor quality signal effect

#

you can do the same in Audacity

spark turret
#

yeah trying to figure out how to

winter rose
#

Set the "Project Rate" (bottom left corner of the main Audacity window) to 8000 before you export

spark turret
#

why the hell do most yt tutorials not present their effect first before talking about how to do it

winter rose
#

don't go youtube, go text ^^

spark turret
#

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

winter rose
#

you may want to look for "old record effect"
now we are skipping towards #arma3_audio territory πŸ˜‰

spark turret
#

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

winter rose
#

1200 Hz* no?

spark turret
#

ahh replayGain

#

ah yeah hz

#

hm okay replay gain effs up the radio effekt too much. going with 1200hz 6dB now + replayGain

winter rose
spark turret
#

kk

spark turret
#

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

winter rose
#

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]]

spark turret
#

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

winter rose
#

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

spark turret
#

hm the convoSys can take in any cfgSounds right?

winter rose
#

the Conversations system (kbThing) doesn't use CfgSounds at all

spark turret
#

uh

#

was it words? or sth

#

hm i already forgot. probably my body trying to forget the trauma

winter rose
#

RadioProtocol words can be used from kbTell yes. Otherwise you would need to redefine them in CfgSounds

spark turret
#

im staying with cfgRadio

#

it automatically queues the words

#

look what i made

#

how can i include multiple files? do i have to disconnect the statments somehow?

still forum
#

#include "file1"
#include "file2"

#

as I said, its just a plain copy-paste

tribal trellis
#

Arma doesn't use the object data type right, by default? (JSON, etc)

#

Trying to make an array with keys..

winter rose
#

an array of arrays could work:

[
  ["key1", "value1"],
  ["key2", player]
]```etc
#

See
BIS_fnc_addToPairs
BIS_fnc_setToPairs
BIS_fnc_findInPairs

tribal trellis
#

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

winter rose
#

you can also do

[
  ["key1", ["value1-1", "value1-2"]],
  ["key2", ["value2-1", "value2-2"]]
]
#

multi-level arrays are a thing

tribal trellis
#

Bruh I'm dumb

#

I completely forgot about 3D arrays

#

Thank you

mint kettle
#

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.

winter rose
mint kettle
#

thank you very much @winter rose I will try to contact with someone in that section.

hushed tendon
#

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

fair drum
#

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);
copper raven
#

yes

spark turret
#

@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

mint kettle
#

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.

winter rose
#

@mint kettle without more details, yes and no πŸ˜„

mint kettle
#

I need to start reading I guess :p Thanks again @winter rose !

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?

spark turret
#

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

mint kettle
#

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.

spark turret
#

That permanent locker thing is really high tech complicated. I recommend starting out simpler
The AI sitting around is quite doable

mint kettle
#

@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..

spark turret
#

No problem
I dont think there is a starter guide tho

mint kettle
#

.. Maybe I'll find something :p

tribal trellis
#

@spark turret hmmmm

#

How would you go about doing that?

#

The locker type thing for users

spark turret
#

Ask dedmen. You need some kind of server to store the lockers inbetween missions

tribal trellis
#

Sounds like an interesting concept

spark turret
#

And i have no idea how to do that

tribal trellis
#

Couldn’t you use a database maybe? Who knows if SQF can support that but

spark turret
#

πŸ€·β€β™€οΈ

#

Thats far beyond my expertise

winter rose
#

but yeah, if you want data to be accessible across different servers, extension and db it is

queen cargo
#

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

winter rose
#

who trusts their users nowadays

#

but true @tribal trellis ↑ save in profileNamespace

tribal trellis
#

Are there security flaws with using that method or something?

#

Oh never mind I just read it on the wiki

winter rose
#

anyone could edit these values on their side yeah - hence the "trust your users"

tribal trellis
#

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

winter rose
#

you could still do a server-side check

they could edit that if they have some scripting knowledge

tribal trellis
#

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

spark turret
#

@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

stone totem
#

EPIC!

spark turret
#

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

stone totem
#

looks like the trees did not like their new role as a suicide bomber

#

who wants to be a suicide bomber today?

#

everyone runs ....

spark turret
#

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

stone totem
#

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 ^^

crude vigil
spark turret
#

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.

stone totem
#

hmm ok. and how do I find the name of the variable? I searched a list but did not find anything

spark turret
#

player getVariable ["amountOfCookiesHeAte",-1];
will return -1 if the variable is nonexistent or empty

#

what variable are you looking for?

stone totem
#

the thing that is called "Variable Name" in the Editor if you Edit a Unit

#

basically the standart variable. ^^

spark turret
#

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. "

winter rose
#

@stone totem
vehicleVarName - but it is not a 100% sure thing (as it can be changed)

stone totem
#

ok ... so that is not just for vehicles?

#

o_O

spark turret
#

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

winter rose
#

a soldier is a vehicle πŸ˜„

stone totem
#

wtf arma

spark turret
#

yeah

stone totem
#

!

crude vigil
#

vehicle definition in scripting and in reallife, are kind a different :)

spark turret
#

wtf = what the frigg i assume

#

just to avoid profantiy

stone totem
#

hehehe

spark turret
#

hm didnt we have a command recently that did work for vehicles but not units?

still forum
#

moveInCargo 🀣

stone totem
#

Now I need a schnapps ....

#

πŸ˜„ thanks guys πŸ™‚

#

ok. It's working. Thanks πŸ™‚

plain sable
#

is it possible to write to the server log when the administrator uses the camera for screenshots or an observer?

exotic flax
#

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

plain sable
#

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.

crude vigil
#

It should be possible.

tough abyss
#

Is IntelliJ better than Visual Studio for editing scripts in A3? Do either of them have a plugin for SQF besides Notepad++?

winter rose
#

VSCode has

tough abyss
#

Checking it out now

crude vigil
#

There is also an IntelliJ one there.

spark turret
#

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?

ebon citrus
#

does it help?

spark turret
#

havent tested

ebon citrus
#

deleting the opfor?

#

im smelling some of your script might be iterating over all units

spark turret
#

oh yeah it skyrockets fps from 11 to 45

ebon citrus
#

if reducing the number helps, but not dynamic sim

#

a wild while loop that's iterating through all those units on every frame?

spark turret
#

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

ebon citrus
#

cautious doesnt mean you didnt make a mistake

#

we all do

spark turret
#

hah alright ill look over my scripts again

ebon citrus
#

let me know if you need help

#

i have some time on my hands

tough abyss
#

Scheduled or unscheduled? Either grab the profiler build or the profiler tool and find out which script(s) it is.

spark turret
#

mhm its not my scripts

#

i deleted and replaced all opfor, dynamic sim now has an impact

#

not great but better

fair drum
#

What is this profile tool you speak of

still forum
#

ArmaScriptProfiler probably

ebon citrus
#

@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

spark turret
#

yeah

#

right now i got 24 groups of 8 guys each

#

its very playable at 25 -40 fps with dynamic simulation atm

ebon citrus
#

thats shouldn't be too much

#

weak computer?

spark turret
#

not really

#

since i deleted and replaced the opfor groups, it works as intended

#

gotta test more deeply before i can tell whats wrong

ebon citrus
#

singleplayer, hosted or multiplayer(dedicated)?

spark turret
#

SP

ebon citrus
#

ah, i see

spark turret
#

yeah gotta host all units

ebon citrus
#

you gotta also host the logic enabling/disabling sim through DynSim

#

that logic could be "flickering"

spark turret
#

flickering?

ebon citrus
#

rapidly enabled and disabled

#

you could take a look at dynSim docs?

spark turret
#

hm everything now works fine. im really wondering what was wrong with the old AI untis that they caused such loss of performance

ebon citrus
#

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

spark turret
#

where do i find dyn logs?

ebon citrus
#

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

spark turret
#

like i said, everything is fine now.

#

it has got to be the now replaced opfor units

ebon citrus
#

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

spark turret
#

im stillt rying to figure it out

ebon citrus
#

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

spark turret
#

i cant recreate it

#

i really dont know why. its all exactly the same

ebon citrus
#

then it's not

slate cypress
#

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)?

ebon citrus
#

@slate cypress all connected clients and server

#

DO REMEMBER!

#

global arguments and global effect is different!!!

#

keep an eye on that

spark turret
#

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?

spark turret
#

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

ebon citrus
#

@spark turret the bomb doesnt get destroyed, if im correct. It gets deleted

#

@noble snow config error

#

ask the config folks

spark turret
#

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

slate cypress
#

Yep thanks

spark turret
#

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

hushed tendon
#

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.

spark turret
#

like a charging action?

#

doneTime - startTime = time totally needed

crude vigil
vestal estuary
#

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

winter rose
#

it is the proper channel, and the issue might be locality

spark turret
#

ah so thats what the Hold in holdaction means

#

what

winter rose
#

sarcasm bonk

spark turret
#

once again i am discriminated against by out corporate overlords

winter rose
#

gib three fiddy and leave free

spark turret
#

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

winter rose
#

pls gib checking script so I check the vanilla A-164

spark turret
winter rose
#

wow

spark turret
#

?

#

pls dont judge the loop

winter rose
#

just the "size" of it ^^

spark turret
#

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

still forum
#

oh ma gawd what abomination is this

#

looks pretty good tbh

spark turret
#

my wipeout is using ACE bullets

winter rose
spark turret
#

ah okay so its likely an ACE thing

winter rose
#

my wipeout is using ACE bullets
@spark turret

#

πŸ”¨

#

when you say vanilla, mean vanilla pleaaase!

spark turret
#

sry πŸ˜„

winter rose
#

Γ¨.Γ©

spark turret
#

its 1 am my brain is kinda fried

#

sorry πŸ™‚

winter rose
#

np, np adding to the paddlin' list

spark turret
#

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

still forum
#

there is a EH for bullet impact-ish... but.. its complicated

#

atleast if the impact stops the bullet

spark turret
#

Ex-Explain :dalek:

#

lel of course there was A BUT

still forum
#

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

spark turret
#

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

still forum
#

bullets are not physx

hushed tendon
#

@crude vigil Do you know the save script?

crude vigil
#

@crude vigil Do you know the save script?
@hushed tendon Do you have the slightest idea how little that narrows it down?

still forum
#

I think he's refering to the "car script" meme πŸ˜„

#

But more a inside joke than a meme πŸ€”

crude vigil
#

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. πŸ˜”

hushed tendon
#

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

crude vigil
#

If you are looking for a ready to use code, I do not know. You need to craft it yourself.

hushed tendon
#

😦

crude vigil
#

It is not rewarding if you do not suffer.

hushed tendon
#

Very little knowledge so can't wait to waste the next 5 hours on a small script!

#

😭

crude vigil
#

Well, if you successfully accomplish, even if it takes 55 hours, it is still above average so, wipe the tears!

hushed tendon
#

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

winter rose
#

if you can do without, good! πŸ˜‰

Scripting is not a solution to everything
πŸ™‚

hushed tendon
crude vigil
#

_document1 or document1?

winter rose
#

1/ which error
2/ where is _document1 defined?
3/ where is this code executed?

crude vigil
#

If that is entire code, _document1 is not defined..

winter rose
#

_document1 or document_1, not the same @hushed tendon

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

robust hollow
#

cant use == to compare bools

winter rose
#

ninja'd

robust hollow
#

is pointless even if you could when using true or false specifically

#

x == true -> x

still forum
#

KK implemented == bool comparison recently..
Will be in next update

hushed tendon
#

@Conner is that how I should do it?

still forum
#

I will probably write a script optimizer... will have to optimize out == true πŸ™„

robust hollow
#

if document_1 is a bool then yes

hushed tendon
#

yeah not so sure what even a bool is

winter rose
#

true/false

hushed tendon
#

Well let's stick with the code without the code completed on execution and I'll leave the bool for another question

robust hollow
#

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?

crude vigil
#

It probably activates another document for some other purpose.

exotic flax
#

or use document_1 isEqualTo true πŸ€·β€β™‚οΈ

crude vigil
#

so it is meant to assign true I guess.

robust hollow
#

yea, i mistook it for a condition

hushed tendon
#

should this be in a file? cause the big script I have in a piece of intel rn

exotic flax
#

Someone broke this? ^^

#

or just doesn't work with booleans

winter rose
#

doesn't work with booleans yet

robust hollow
#

Boolean (since Arma 3 v1.99.146526)

winter rose
#

unless we don't get your question

exotic flax
#

biki markup is πŸ¦† sometimes, guess I'll need to make a solution for that thonk

hushed tendon
#

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?

winter rose
#

can help

#
private _documents = [doc1, doc2, doc3, doc4];
waitUntil { sleep 1 ; _documents findIf { not isNull _x } == -1 };
/* unlock door */
#

@hushed tendon

hushed tendon
#

Alright and how would I activate another script upon the conditions being met?

#

would it be in place of _x?

winter rose
#

no
the waitUntil will… wait until conditions are met

After that it will continue to execute what is written below

hushed tendon
#

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?

flat elbow
#

how do I detach an object attached with attachTo?

exotic flax
#

detach πŸ€·β€β™‚οΈ

flat elbow
#

sounds reasonable enough

#

never write scripts late in the night lol

#

i was trying to attach it to objNull

exotic flax
#

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

flat elbow
#

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

hallow mortar
#

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))```
candid cape
#

Hi I want to make an script that when you hold "Alt" and click on map , you will teleport

#

Anyone can help me

exotic flax
candid cape
#

Thanks but I want the tp to work when the "Alt" is pressed

hallow mortar
#

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"

ebon citrus
#

@candid cape you want someone to write the script for you or do you want to write it yourself?

#

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

fair drum
#

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...

candid cape
#

@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

ebon citrus
#

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

candid cape
#

In the eden editor it can be done, when you open it and hold the "alt" and the click you teleport

fair drum
#

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.

candid cape
#

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

fair drum
#

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

fair drum
#

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

winter rose
#

oh?
worth a note in the wiki if that's the case

fair drum
#

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.

winter rose
#

Thanks for the vid @fair drum (and activate your Windows =)

spark turret
#

Windows keys are 3 bucks :)

fair drum
#

i JUST changed my cpu and mobo

#

gonna have to get a new one cause they said they are unable to transfer 😦

spark turret
#

Thats a lie

#

You can reactivate any key

#

Windows just doesnt like it but the EU high court forced them in 2013

fair drum
#

unfortunately, don't think that applies to NA

spark turret
#

Oh interesting!

#

Do you not have those huge second hand key websites that sell all windows for 3 to 10 bucks?

fair drum
#

we do, just too lazy to go do it. its not a big deal for me

spark turret
#

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

fair drum
#

anyone have a way to allow all sides to use all uniforms?

#

without using forceAddUniform

warm hedge
#

Using script, no, using config, yes

#

Or, maybe tons of script related to inventory?

fair drum
#

erg would be faster just to change my player's faction. I didn't think about this before selecting a side for them

spark turret
#

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

tribal trellis
#

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

spark turret
#

Shooting range with pop targets with different programs

#

Also with a shot counter and a precision rating in the end

tribal trellis
#

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

spark turret
#

Eloborate in the shooting range pls

tribal trellis
#

?

spark turret
#

You said you already have one

tribal trellis
#

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

knotty mantle
#

Little picture in picture display that shows the bullet imapct

tribal trellis
#

Ok ok I like that, maybe that could be something for the Marksmanship test for the longer-range shots

spark turret
#

Moving targets

#

On Rails. Its awful to script but cool effecr

#

Marksman is probably the easiest. Count shots till hit

tribal trellis
#

Yeah that'd be cool

#

Liking these ideas so far

spark turret
#

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

tribal trellis
#

That'd be neat

spark turret
#

Do you have plans on sharing the script?

wispy cave
#

In ace, is there a way to either overwrite the join group action or disable those actions all together?

hollow thistle
#

ace_interaction_enableTeamManagement setting.

wispy cave
#

thanks

tribal trellis
#

@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

spark turret
#

okay i tested chaining triggers

#

it appears that a trigger set to "opfor - not present" gives off false positives

tribal trellis
#

hm?

spark turret
#

yup

#

the trigger will falsely fire up, even if opfor is in the area

tribal trellis
#

The heck

spark turret
#

check my setup here

#

detect opfor present works just as intended

tribal trellis
#

That's weird..

#

I've never use not present but

crude vigil
#

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.

spark turret
#

oh wow

#

that makes sense

crude vigil
#

If you want to write a condition script along with that condition as well, just use this && <your-code>

spark turret
#

a tooltip in the editor would have been ^helpful lol

crude vigil
#

it should have a tooltip

spark turret
#

i know how conditions work. i just didnt think a trigger would allow firing without fulfilling its own condition

tribal trellis
#

it's arma dude

#

lmao

#

expect the unexpected

crude vigil
#

it is why it always comes with 'this' written in there at start.

#

and tooltip (hovering on condition title) states it :)

tribal trellis
#

I mean it somewhat says it

#

Doesn't explicitly say it but

#

unless I'm misunderstanding the tooltip

spark turret
#

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

spark turret
#

how can i force a turret to look at a dir?

crude vigil
#

What are you trying to do exactly?

spark turret
#

make the radar trailer rotate 360

#

so kinda like "loop turret lookat _dir; dir ++;"

torpid glacier
#

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

obsidian violet
#

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!

spark turret
#
_playersThere = allPlayers inAreaArray marker_1;
if (_playersThere isEqualTo allPlayers) then {Hint "all players are in loc1";};
winter rose
#

no

spark turret
#

no

#

why not

winter rose
#

because isEqualto will check players' order in the array

spark turret
#

al alright

#

arrayIntersect and then count?

winter rose
#

more like```sqf
allPlayers findIf { !(_x inArea "theMarker") } == -1

spark turret
#

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

obsidian violet
#

Alright. But this solution demands me to create a marker of 30 meters onto _myobject.

But i see how you thinking. Thank you 😊

winter rose
#

distance?

spark turret
#

allPlayers findIf { !((_x distance _targetObj < 30) } == -1)

#

should work

winter rose
#

( }

spark turret
#

:}

digital hollow
#

Use objNull as the target to order a unit to stop watching a position/target.

spark turret
#

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

winter rose
#

…zomg

ebon citrus
#

@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

spark turret
#

like the tank turret becomes the rotor?

#

thats hilarious. you got a video?

ebon citrus
#

Not anymore, unfortunately

#

I had to do some spring cleaning to free up space and deleted all my videos

spark turret
#

shame

#

im getting towards my jAItac working properly

spark turret
#

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

fair drum
#

I need to have a tank heli now...

winter rose
spark turret
#

Yeah dont know how i missed that

fair drum
#

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

hushed tendon
#

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

surreal peak
#

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.
hushed tendon
#

yeah I checked it out but still can't figure it out

surreal peak
#

so the code should be in an SQF file or in a [] spawn {};

winter rose
surreal peak
#

^^^ or do that ^^^

#

will be nicer

hushed tendon
#

where does the _timeout come from?

winter rose
#

that's the created function (click "Show text")

#

the written function above @hushed tendon

stone totem
#

@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?

still forum
#

no

stone totem
#

great thanks ❀️

hushed tendon
#

@winter rose For the countdown where do I put the activation?

winter rose
#

wherever you want…? I am not sure to understand the question

hushed tendon
#

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?

winter rose
#

…that's what I did with my function?

hushed tendon
#

I guess I just don't understand this at all then

winter rose
#

what did you try ^^

hushed tendon
#

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?

winter rose
#

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?

hushed tendon
#

no

#

so the first box is just the "show function" from the page?

winter rose
#

in your sqf file, place the function code that is between the main code brackets { }

hushed tendon
#

have done

winter rose
#

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)

hushed tendon
#

do I have to modify anything from inside the {}?

winter rose
#

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)

hushed tendon
#

it is sqf.

#

I wish I could have just
+300 vrTimer; or something as easy as that

#

But not for scripting...

winter rose
#

well, something is wrong somewhere here

hushed tendon
#

my lack of skill?

winter rose
#

mostly the setup of this specific function πŸ˜„

hushed tendon
#

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

spark turret
#

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

hushed tendon
#

I did that, gave an error and only showed 10 as a hint

spark turret
#

show your code

#

i showed you my code pls respond

hushed tendon
#

I used yours

spark turret
#

oh

hushed tendon
#

under the init

copper needle
#

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

spark turret
#

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?

hushed tendon
#

My goal is to countdown from 300, show the countdown, and end scenario after countdown.

spark turret
#

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

hushed tendon
#

so mySqf.sqf

  hint str _i:
sleep 1;
};```

then in init
```execVM "mySqf.sqf";```
?
spark turret
#

yup exactly

#

should work

hushed tendon
#

and how do I activate a trigger on mission start?

spark turret
#

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?

hushed tendon
#

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

spark turret
#

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

hushed tendon
#

prob

winter rose
spark turret
#

why would a chat command be local

#

that seems rather counterproductive πŸ˜„

#

directChat ok but systemchat?

winter rose
#

because it's to display something in the chat channel
you wouldn't want a group conversation to happen on both sides… πŸ‘€

spark turret
#

hm

#

stop reasoning

winter rose
#

I know, it hurts but the more you do, the less it hurts!

#

from dumb to numb! πŸ˜…

hushed tendon
#

😭

#

All I want is a simple countdown

winter rose
#

use my script, and placesqf if (!didJIP) then { [300, "#FF5500"] execVM "theSqfFileName.sqf"; }; in init.sqf, that's it!

hushed tendon
#

so in the box is the caller and the show function from the page in the sqf?

winter rose
#

I didn't understand this sentence

hushed tendon
#
  [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?
winter rose
#

yes, but you should NOT have

private LM_fnc_timeoutCountdown = {
// ...
};
```only what's in it
hushed tendon
#

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

spark turret
#

you script as posted just defines the LM_fnc function but doesnt call it

hushed tendon
#

And is the vrTimer local?

winter rose
#

yes

hushed tendon
#

ohhhhhh

winter rose
#

but if you placed this call in init.sqf, it will call it for every player

#

(not the JIP players though)

hushed tendon
#

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*

winter rose
#

okido

#

so it works now? you get the countdown as expected?

hushed tendon
#

yep

winter rose
#

w00t! cool thing
I can go to bed freely now πŸ˜„

hushed tendon
#

oh sorry

winter rose
#

no no, my pleasure

hushed tendon
#

Alright if you say so

winter rose
#

I am not blaming you at all
just saying that I can sleep knowing the topic is done ^^

hushed tendon
#

ik ik

#

anyways gn

#

😴

candid cape
#

Hi , anyone know what it's this function ?

#

life_vInact_curTarget

exotic flax
#

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

candid cape
#

The problem is that , the function it's working , but there isn't defined

#

I don't know why

exotic flax
#

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

robust hollow
#

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.

ebon citrus
#

@candid cape that's not a function

silent latch
#

^

#

thats a global variable

barren spire
#

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

hallow mortar
#

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

spark turret
#

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

barren spire
#

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

spark turret
#

i hate my life and especially arma sounds rn

winter rose
#

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 πŸ˜„

spark turret
#

shame, noone to rant to

barren spire
#

alright, I'll try the attach to idea :)

hallow mortar
#

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

barren spire
#

@winter rose engine turns on, but the rotors don't spin until it is detached πŸ˜…

young current
#

@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.

winter rose
#

let me dream!!

spark turret
#

just teleport it on a loop?

#

or put an invisible wall underneath it

barren spire
#

invisible walls under the wheels actually fixed it πŸ˜„
THank you!

spark turret
#

help i dont know anymore what to do

winter rose
#

Make a SP scenario!

#

Create a terrain!

#

Make a LEGO mod!

spark turret
#

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

winter rose
#

Ta-daaa πŸ˜„

spark turret
#

and the _ also

#

I JUST FIXED THAT

winter rose
#

Ctrl+S

spark turret
#

i did

#

oh man i hate all that sounds s_

winter rose
#

Sure you don't have two text editors open?

spark turret
#

nope

#

think that might have been the case

slate cypress
#

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

slate cypress
#

Thanks!

slate cypress
#
["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?

warm hedge
#

Basically nothing

crude vigil
#

You cannot create ppEffects if priority is taken by another ppEffect

warm hedge
#

^ this tho, that almost won't happened on my experience

crude vigil
#

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.

spark turret
#

finally got the sounds for my JTAC to work properly

slate cypress
#

So is this while loop simply recreating the effect until it has the unique priority (higher)?

spark turret
crude vigil
#

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.

slate cypress
#

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?

spark turret
#

is there a way to disable a vehicles collision with the ground?

warm hedge
#

No

spark turret
#

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

crude vigil
#

the eh handler is passed to code

#

yep, that one.

spark turret
#

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?

still forum
#

splitString

spark turret
#

ah and give it no delimiters than it splits every letter

#

cool thanks

sacred turret
#

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)

spark turret
#

have you tried you addaction in SP?

#

any particular reason you dont want to use remote exec?

#

its a lot more inuitive imo

sacred turret
#

I've just discovered the existence of remote exec lol

spark turret
#

haha alright. advantage is it can take in whole sections of code

#

{hint "hello there"; }remoteExec ["call",0,true];

sacred turret
#

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?

spark turret
#

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.

ionic anchor
#

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];
spark turret
#

Try without the bracktes

ionic anchor
#

fantastic it works, tyvm

i assume to run it as server just change 0 to 2

spark turret
#

Yup

ionic anchor
#

cheers dude

spark turret
#

Np

#

Btw whats that ctrlText number stuff?

ionic anchor
#

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

sacred turret
#

{player, ["Arsenal"], {["Open", true] call BIS_fnc_arsenal;}} remoteExec ["addAction", 0, true];
what have I done wrong?

warm hedge
#

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
spark turret
#

i cant believe i never did this before but:
can i create functions with a return value?

#

just local ones

sacred turret
#

I didn't understand the "A command B", but It seems it worked, gonna test it in mp right now

spark turret
#

lucas the code brackets

#

you are giving the addAction code as parameters but it takes in an array

still forum
#

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

spark turret
#

method (a,b) return (a-b)

#
_myCoolFunction = {
params ["_a","_b"];
_sol = _a - _b;
return _sol
};
still forum
#

remove just return

#

and done

spark turret
#

ah

#

oh

still forum
#

last value left on stack is returned

spark turret
#

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 \

sacred turret
#

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

@warm hedge didn't work in multiplayer, maybe I've made a mistake, can I insert this code in the game logic entity module?

spark turret
#

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.

still forum
#

use toFixed

spark turret
#

kk (y)

#

can i make variables restricted to a scope that are not able to modify var with same name on the upper scope?

still forum
#

the keyword

#

private _variable = x

#

you should basically always do that when you define a "new" variable

spark turret
#

cool (y) i rarely use public access modifiers in arma

#

bc most scripts arent complex enough to need em

still forum
#

public access modifiers?

#

πŸ€”

spark turret
#

private, public, restricted

still forum
#

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

spark turret
#

its a different thing?

still forum
#

also making them private like I posted above will make your scripts run faster and more efficient

spark turret
#

interesting

still forum
#

what you said is object oriented stuff, SQF isn't object oriented

#

and private, public have NOTHING to do with variable scoping

spark turret
#

okay interesting

winter rose
#

@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)

sacred turret
#

what I want to do is just like that mod Personal Arsenal, but via game logic entity in a mission, is that possible ?

ebon citrus
#

@sacred turret ----> #arma3_editor is probably what youre looking for

sacred turret
#

ok ty

loud python
#

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

ebon citrus
#

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

signal sky
#

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?

astral dawn
#

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.

tribal trellis
#

What

ebon citrus
#

@astral dawn why?

#

ArmA 3 servers aren't exactly FTP servers

#

how are you even transfering that 12 MB?

astral dawn
#

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?

ebon citrus
#

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?

astral dawn
#

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

ebon citrus
#

i dont get it

#

are we talking about hosts or dedicated server environment?

astral dawn
#

by self-hosting I mean if you run arma game, then start a new multiplayer game as a host

#

not a dedicated server

ebon citrus
#

ok...

#

the host IS the server

astral dawn
#

yes

#

and a client too

ebon citrus
#

so disconnect EH's for the server would run on the hosts client

astral dawn
#

I guess arma doesn't have such event handler so there's nothing I can do anyway

ebon citrus
#

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

astral dawn
#

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 meowcamera

ebon citrus
#

IDK, there was some stuff to run code when the client gets disconnected

#

but the problem is that it's not a handled event

#

why would you want to run anything on it?

#

im still not getting this