#arma3_scripting

1 messages Β· Page 585 of 1

placid badger
#

thanks! Will just make sure I have enough backups πŸ˜›

runic edge
#

@finite sail ok makes sense ! And is there a way to choose in which order the different records / subjects are shown ?

finite sail
#

iirc, you have to create them in reverse order πŸ™‚

#

im in mission now, i make screenshot that will make it clearer

#

ok, so heres the code

#

ill make a screenshot as soon as i can batter shadowplay into submission

runic edge
#

No problems I'll try to run tests on this, thanks and enjoy your mission

finite sail
#

here is what that code gives

runic edge
#

And thanks again ! You 're awesome mate !

finite sail
#

np

placid badger
#

Are values like
#define QRF_SEARCH_TIMEOUT 8
In minutes? I find it hard to believe those are seconds

cunning crown
#

Yes probably minutes, but you can do a project-wide search for that and see how it's used

upper rose
#

I'm having an issue with a pop-up target script; it's meant to keep pop-up targets down once they are shot until they are 'reset' by a player

Situation: the player has the option to 'activate/reset' a firing range so that when he shoots a pop-up target, the target stays down until he interacts with an available action on a laptop and 'resets' the range, causing all targets to pop back up

Problem: only the session host is successfully able to 'reset' ranges in this fashion. If any other player in the session triggers the action and shoots a target, that target pops back up, even if the player shoots a target when the range has been activated by the session host

#

Action Trigger Entry on the Laptop:
this addAction ["Range 1: Activate/Reset", "Scripts\AC1.sqf", nil,0,true,true,"","",2,false];

Script (truncated):


AC1RangeTargets = [AC100];

{_x animate ["Terc",0];} forEach AC1RangeTargets;
{_x addMPEventHandler ["MPHit", {(_this select 0) animate ["Terc",1];
(_this select 0) RemoveMPEventHandler ["MPHit",0];}]}forEach AC1RangeTargets;

systemChat "Assault Course Range 1 ready";```
#

I even tried having this execute with a trigger at the beginning of the mission:

remoteExec ["Scripts\MasterRangeArm.sqf", 0, false];```
#

Now, the scenario does contain this file as an initPlayerLocal.sqf so the briefing can be read in a diary file:

{
  waitUntil {player == player};
};
_null = [] execVM "diary.sqf";```

Don't know if that's doing anything to contribute to this problem
#

Any ideas? I've been beating my head against a wall and seeing how other people do firing ranges and pop-up target scripts, but I haven't found anything definitive. I know it's a locality problem, but I'm not sure how to define this to allow ALL players to hit targets, keep them down, and then reset them

still forum
#

remoteExec ["Scripts\MasterRangeArm.sqf", 0, false]; remoteExec doesn't take a file path

#

waitUntil {player == player}; thats nonsense in initPlayerLocal. The player unit is even passed as argument to the file

upper rose
#

good to know πŸ˜›

#

im listening

still forum
#

_null = that useless
nul= thats useless

#

at the beginning of the mission
If you want it to run at the beginning, why not run in init/initServer/initPlayerLocal?

upper rose
#

because i didnt know about those

still forum
#

Now, the scenario does contain this file as an initPlayerLocal.sqf
But you have a file that you don't know about?

upper rose
#

i knew about initplayerlocal; i didnt know about any other init files...

still forum
upper rose
#

didnt consider that...

#

alright, ill read

still forum
#

_x animate ["Terc",0] this is supposed to keep the target down? or up? or.. what?

#

do you now execute your script at mission start? to keep them down?

upper rose
#

essentially yes, lemme look

#

animate 1 drops the target

animate 0 has them pop back up to their default position

#

and definitely dont want to use nopopup = true because that drops ALL targets globally and causes them to not pop back up XD

#

hmm, interesting...ok, lets see what happens

high horizon
#

Sorry, this seems obvious but can anyone know where the error is?

                markers = ["intro_1","intro_2","intro_3","intro_4","intro_5","intro_6","intro_7"];
                for "_i" from 0 to 6 do {
                    _markador = markers select _i;
                    _posMarker = getMarkerpos "_markador";
                    cocheintro doMove (_posMarker);
                    waitUntil {if ((player distance _posMarker) < 10) exitWith {true}};
                };
still forum
#

for "_i" from 0 to 6 do
why not forEach?

#

waitUntil {if ((player distance _posMarker) < 10) exitWith {true}}; wtf is that? waitUntil takes a bool, and no exitWith. you'll pass nil which will throw errors

#

"_markador" is _markador a marker name?

#

and why do a loop if you always use the same marker?

#

markers = ALWAYS use a tag for global variables

#

Also I cannot see why you would need that to be a global variable?

high horizon
#

Noo!! I wanna use different markers.

waitUntil {if ((player distance _posMarker) < 10) exitWith {true}}; wtf is that? waitUntil takes a bool, and no exitWith. you'll pass nil which will throw errors
@still forum Never used it before, I have read on the web that it always returns boolean so I have decided to try that syntax, it seems that it is not adequate.

Also I cannot see why you would need that to be a global variable?
@still forum I was just testing.

My goal for that code is to go to one marker and when it gets closer, go to the next.

still forum
#

that it always returns boolean so I have decided to try that syntax
Yes you always need to return boolean, your code doesn't do that though

#

I guess something like this is what you wanted then?

private _markers = ["intro_1","intro_2","intro_3","intro_4","intro_5","intro_6","intro_7"];
{
    private _posMarker = getMarkerPos _x;
    cocheintro doMove (_posMarker);
    waitUntil {(player distance _posMarker) < 10};
} forEach _markers;
copper raven
#

why don't you use waypoints then?

high horizon
#

I guess something like this is what you wanted then?

private _markers = ["intro_1","intro_2","intro_3","intro_4","intro_5","intro_6","intro_7"];
{
    private _posMarker = getMarkerPos _x;
    cocheintro doMove (_posMarker);
    waitUntil {(player distance _posMarker) < 10};
} forEach _markers;

@still forum Could work, let me test it, thanks!

quaint oracle
#

So, I'm back, this time I'm trying to make a very bone simple script. I want to do an addAction on a flagpole. Players walk up to it, scroll to it, and get teleported into a vehicle. I've looked around the interwebs extensively, but all that I really find is moving people into the vehicle's proximity, and I'm not sure I trust my scripting skills to go that far, and I'd prefer it if they tele'd into the vehicle.

So I'd like to start with a syntax error. I'm just starting out, so it's probably something stupid.

this addaction ["Teleport to MHQ", moveInCargo] gets accepted by the init box of a flagpole, but obviously does nothing. But when I add the expected vehicle MHQ, to get this:

this addaction ["Teleport to MHQ", moveInCargo MHQ]

It throws "Error Missing ]"

still forum
#

correct

#

thats not how addAction works

#

so it's probably something stupid.
yep

high horizon
#

I guess something like this is what you wanted then?

private _markers = ["intro_1","intro_2","intro_3","intro_4","intro_5","intro_6","intro_7"];
{
    private _posMarker = getMarkerPos _x;
    cocheintro doMove (_posMarker);
    waitUntil {(player distance _posMarker) < 10};
} forEach _markers;

@still forum It says error on waitUntil, thats why i tried the other syntax, it just takes the car to "intro_7"

still forum
#

It says error on waitUntil
what error

quaint oracle
#

I have perused this and tried working through it. I've even tried adding a _this to tell it to perform the action on the unit calling it, but it rejects that. with the same syntax error, so I'm trying to boil it down.

still forum
#

it just takes the car to "intro_7" well yes thats the last marker your script is supposed to go to, it won't go further

#

@quaint oracle look at the examples

high horizon
#

it just takes the car to "intro_7" well yes thats the last marker your script is supposed to go to, it won't go further
@still forum Yep, but I say that it takes you directly, without going through the other markers.

what error
@still forum I have the game in my native language, in English it should be something like "Generic expression error"

copper raven
#

run your code in scheduled

quaint oracle
#

I've seen the examples, and tried them a few ways>

This, for example, gets accepted by the init box on the flagpole, but does nothing.

this addaction ["Teleport to MHQ", {_this moveInCargo MHQ}];

still forum
#

@quaint oracle that fixed the syntax error. But _this is not an object

#

but moveInCargo takes an object

quaint oracle
#

I gathered, in that it tells me I'm passing an Array, when it wants an object.

still forum
#

correct

#

see wiki

high horizon
#

run your code in scheduled
@copper raven What do you mean 😩 ? On code?

quaint oracle
#

To my understanding, _this would grab the caller as an object.

still forum
#

addAction wiki page, parameters, script

#

To my understanding, _this would grab the caller as an object.
But it doesn't. see wiki

copper raven
#

anyway, where are you even running that?

quaint oracle
#

So, I'm looking at the wiki. How I'd pull in the player as an object calling the addaction is not jumping out at me. Any clues here?

high horizon
#

Working!! thx @still forum @copper raven

still forum
#

How I'd pull in the player as an object calling the addaction is not jumping out at me.
The wiki tells you how

#

even lists you two possible ways

#

both in the parameter descriptions and the examples

quaint oracle
#

I've seen this, and have been trying to work through it. I'm struggling here on how to add the params into the addaction call. I need it to pull the player calling it back out of params and pas it into the move in cargo function with _this select 1. Most everything I try comes out as gobbledygook with syntax errors. I distinctly remember, once upon a time, having a MHQ script that I've lost, that was extremely simplistic and functional.

still forum
#

I need it to pull the player calling it back out of params
Thats exactly what the params command already does for you

#

Most everything I try comes out as gobbledygook with syntax errors.
Then figure out what the correct syntax is

#

most likely parenthesis

quaint oracle
#

Can I, inside the addaction script, define an obj id = params[_this select 1], then pass that on to moveincargo?

still forum
#

Yes
but thats not how params works

#

I sent you the wiki page link

copper raven
#

read what params does, the examples are legit there, you just need to read them

still forum
#

you are overthinking it.
Reading stuff on the wiki, skipping the important parts, and then trying to adapt what was written on the wiki to you own needs and thereby breaking it without even first reading the wiki pages about the stuff you are trying to adapt.
You cannot adapt something while you have no idea how it works, you should read first.

All you really need is to literally copy-paste, all your attempts to adapt something you've seen is overcomplicating it

quaint oracle
#

You're right, I was overcomplicating things. I went and routed around for how I solved this problem the first time from a backup file I had externally, on a hunch.

#

this addaction["Teleport to MHQ",{[player moveInCargo MHQ];}]

#

Is what I wanted, and it works.

#

Would it work if I had 30 people trying to run into the same vehicle? Maybe not.

#

But, small ops

still forum
#

if I had 30 people trying to run into the same vehicle? Maybe not.
No, but more because Arma bug and not because ofy our script

quaint oracle
#

So, the vehicle in question is a CUP Vodnik, with 12 seats. If I had a mass cas, and 13 people attempted to teleport in, what would happen, do we think?

upper rose
#

@still forum unfortunately im still having problems with pop-up targets not staying down when someone other than the session host shoots then X( even after changing animate to animatesource X(

tough abyss
#

Hi, I have a problem with hidden objects becoming unhidden during high load. Anybody has a clue?

surreal peak
#

@tough abyss little more context/ information? How are you hiding the object, when you say high load is that due to the mission spawning in more stuff or more players joining? Do you have any code anywhere which unhides objects

tough abyss
#

I run a script at preinit that gets the objects by model name and hides them with hideobjectglobal. When starting the mission everything is fine but when many groups start spawning some of the hidden objects become unhidden

#

no code that unhides them anywhere

fluid cairn
#

Is there any way to script a ai to pick up a weapon? I want it so when you enter the room the guy runs for a gun

tough abyss
#

ah and i'm talking about single player

meager granite
#

Something to do with unloading terrain when not in use?

#

Maybe you're not really hiding them and having groups spawn makes terrain nearby stream&load thus objects appear for the first time?

#

Not sure about exact mechanics of that

tough abyss
#

@meager granite what do you mean with unloading? It does seem related to spawning but happens with objects very far from spawned groups, and not all objects unhide, it seems random

meager granite
#

How do you hide them anyway? What's the script?

#

Pretty sure you're just not hiding them due to objects not being loaded into the terrain yet.

tough abyss
#

I get objects with nearestTerrainObjects. I filter the resulting array to match the models I want and then do {hideobjectglobal _x; _x allowdamage false;} foreach _array

meager granite
#

I'm guessing that nearestTerrainObjects doesn't trigger terrain loading.

#

As experiment, add a marker on the map for each hidden object and see the picture

tough abyss
#

we're talking thousands of objects here. and they are remain hidden if just a few groups spawn

meager granite
#

Pretty sure you'll have markers only around playable content and where your camera was

#

Give it a try with the markers

tough abyss
#

ok, i'll try it, just a moment

placid badger
#

has anyone tried messing with QRF in Old Man? Changing QRF_defines did not seem to do anything

#

Even commented huge functions (in other files ofc) to just see if it's doing anything, but still seems like nothing happened, not even error messages

#

I'm editing missions_f_oldman.pbo btw, which is in Expansion/Addons folder

#

Basically all I want to do is set a bigger timer for when QRF shows up, default it seems like 2 minutes, which gives you no time to loot or whatever (I guess it's intended, but still), so something like 15 mins would be ok, but haven't really been able to find what to modify in order to achieve this

tough abyss
#

@meager granite so I only got one marker right at the middle of the map. but would it even be possible to create 50000 markers?

meager granite
#

Did you use same name for each marker or something?

#

Yes its possible to have as many markers as you want

tough abyss
#

sorry. I did so. let me check again🀦

#

wait I actually didn't

#

I put (str _x) in the name

#

_x being the object

#

wait I'll try again i know what i did

meager granite
#

Just have something like str random 1e6 + str random 1e6

waxen tendon
#

any way to create composition groups via script?

winter rose
#

@waxen tendon see BIS_fnc_spawnGroup for config groups, besides that, no I don't think so

waxen tendon
#

that'll do, thanks!

tough abyss
#

@meager granite it gets stuck loading the mission, i'm still waiting for it to start

#

meanwhile tell me: if the problem is that the objects were not loaded yet, why do they appear hidden at start? and setting the script to run at postinit would solve it?

fluid cairn
#

I’ve used addWeapon and addMagazine, to a trigger that is activated OpFor Present, but as soon as I spawn in the character has it. I want him to get the weapon when he walks into the trigger

#

Anyone help?

winter rose
#

@fluid cairn link the trigger to that unit

fluid cairn
#

Oh okay thanks

tough abyss
#

@meager granite hey I changed it to postinit and it seems fine for now. Thanks for your help

tough abyss
#

it seems i've spoke too soon

undone flower
#

hey uh, I have an idea for a pylon-mounted weapon, where do I start?

unreal scroll
#

How can I turn on the Sentinel UAV engine? The engineOn command doesn't work.

meager granite
#

@tough abyss How did that marker picture look?

karmic swift
#

Is it safe to add publicVariable and setVariable to CfgDisabledCommands?

meager granite
#

Well your PC won't catch fire, but you'll probably break plenty of default Arma stuff and limit yourself quite a bit.

karmic swift
#

@meager granite I'm just trying to make my scenario more secure. I decided to allow clients only remoteexec specific functions, but looks like any broadcasted command (such as createVehicle) can be executed on client without any restriction. Is there any way to fix this?

meager granite
#

Battleye's createvehicle.txt filter

karmic swift
meager granite
#

Yes it differs a lot from it, battleye filters broadcasted data through some functions so you can specify what kind of data is allowed and what isn't

#

Still, even disabling every command under the sun wont make you 100% safe, proper cheats form network messages themselves without using any scripting commands.

#

Its a balance of your effort being worth it

karmic swift
#

I know there are also some kind of "map hacks" (which one are really just game process memory reading and parsing) and they allow to get more information, that player had to get usually. But I just want to not let hackers ruin game for other players (I mean giving everyone dozens of in-game money and spawning of blowing up helicopters everywhere). Is there any de-facto way of that for public server like KOTH and AltisLife?
So, there are no way of forcing game being multiplayer with authoritative server?

vivid monolith
#

How do I put in a animation script where a Marine team is looking everywhere while moving tactically to clear a building or hallway for any hostiles or hostages

quartz pebble
#

I'm making a spectator script, like this:

while {true} do
{
   _camera setPosASL _pos;
   [_camera, _angles] call BIS_fnc_SetObjectRotation;
};

it works nice, but. In multiplayer it has issues with sound. Literally when you try to watch a fast-moving plane in MP, plane`s sounds are breaking-up with high frequency.
In singleplayer there are no sound issues.
How can I solve this?

meager granite
#

@karmic swift There is no 100% solution. To change your money\other values you don't even need scripting if you're cheater, you just edit the memory.

#

@quartz pebble Per frame execution

quartz pebble
#

@meager granite you mean instead of while {true} use onEachFrame ?

meager granite
#

Doing stuff like this in scheduled thread is a bad idea because camera will not update perfectly, lag behind in some frames thus these sound issues due to variable distance to the object

quartz pebble
#

TX

karmic swift
#

@meager granite If you change your local memory then you are gonna be kicked due to 'out of sync', isn't it? Or you mean case when 'money' and other important things owned and calculated by clients itself?

meager granite
#

Depends on how mission works of course, sure you can make everything server-side and but proper cheats still can generate network messages to mess stuff up and you can't catch any of that

#

moveOut message for example, to randomly kick players out of vehicles, no BE filter for that, blocking scripting command won't do anything as cheaters don't address scripting.

#

There must be a balance of scripting and BE filter restrictions, good mission architecture with critical info being server-side and proper constant admin attention.

fleet hazel
#

How to get all the controls for a control group

summer pelican
#

Item names wont appear, using ravage mod

winter rose
#

@summer pelican please use sqf formatting (shown in pinned messages)

fervent kettle
#

Is there any info about the Tank & Car class names for setting damage?

summer pelican
#
rvg_Medical_custom = ["Medicine (Hank)",
  [
   ["ACE_fieldDressing", 3,"ACE_ItemCore", 50],
   ["ACE_elasticBandage", 5,"ACE_ItemCore", 50],
   ["ACE_quikclot", 6,"ACE_ItemCore", 50],
   ["ACE_packingBandage", 8,"ACE_ItemCore", 50],
   ["ACE_tourniquet", 30,"ACE_ItemCore", 50],
   ["ACE_morphine", 20,"ACE_ItemCore", 50], 
   ["ACE_epinephrine", 25,"ACE_ItemCore", 25], 
   ["ACE_atropine", 30,"ACE_ItemCore", 10], 
   ["ACE_bloodIV_250", 200,"ACE_ItemCore", 50], 
   ["ACE_plasmaIV_250", 175,"ACE_ItemCore", 50], 
   ["ACE_salineIV_250", 150,"ACE_ItemCore", 50], 
   ["ACE_bloodIV_500", 350,"ACE_ItemCore", 25], 
   ["ACE_plasmaIV_500", 325,"ACE_ItemCore", 25], 
   ["ACE_salineIV_500", 300,"ACE_ItemCore", 25], 
   ["ACE_bloodIV", 650,"ACE_ItemCore", 10], 
   ["ACE_plasmaIV", 600,"ACE_ItemCore", 10], 
   ["ACE_salineIV", 625,"ACE_ItemCore", 10],
   ["ACE_surgicalKit", 1000,"ACE_ItemCore", 10]
  ]
];this setVariable ["istrader", "rvg_Medical_custom", true];};```
#

uhh

#

Yeah, idk what im doing, not an avid scripter

winter rose
#

@fervent kettle classnames, or selection names?

fervent kettle
#

on the Wiki it says hitPointName

winter rose
#

there should be a get hitpoint command around

fervent kettle
#

Yea, but there was also a list for helicopter damage parts and i was wondering if there`s the same but for tanks & cars

winter rose
#

Take a car and use the command ^^

fervent kettle
#

aah right, i see

meager granite
#

@summer pelican Not sure what your mission expects from istrader, but you're broadcasting the string, not array with its contents.

spiral fractal
#
NC_fnc_repair = {
    params [
        ["_vehicle", objNull]
    ];
    if (isNull _vehicle) exitWith {};
    _vehicle engineOn false;
    sleep 1;
    _vehicle setDamage 0;
    _vehicle setFuel 1;
    _vehicle setVehicleAmmo 1;
    _vehicle setVectorUp [0,0,1];
};

this function has AL and AG commands, how should I execute it so it works on dedicated server? and use minimum bandwidth?
I still have troubles understanding the locality stuff in Arma...

meager granite
#

setVehicleAmmo 1 has to be executed everywhere (in case different turrets will be owned by different clients)

tough abyss
#

Coming from C# I'm suprised i have difficulties understanding arma scripting.
Mighr be some subconscious thinf they have tweaked that I don't recognize.

meager granite
#

setDamage 0 has to be executed anywhere but preferably on server

#

setFuel and engineOn only where vehicle is local

#

To make it easier, execute setFuel,engineOn,setVehicleAmmo everywhere (server and all clients), and setDamage 0 on server.

#

You can do setDamage 0 from anywhere but do it only from one source, up to you where

#

Having it no non-local client will trigger BE's setdamage.txt filter

#

Having it on server or where vehicle is local won't.

spiral fractal
#

so inside this function I have to execute each command in separate remoteExec?

meager granite
#

Who calls this function in the first place? Anyone?

karmic swift
#

@meager granite I think I got it. In Arma3 server don't perform any client behaviour validation checks (or does perform but a very few), but it just transport of commands between synced clients. So, to prevent clients from doing nasty things they (people who creating engine of A3) decided to add traffic-level filtration of 'bad commands' from client (BattleEye's createVehicle.txt as you said). Even special tool that should prevent sending 'bad commands' from clients (CfgDisabledCommands) don't add server's special reaction to these commands, but just forces original client to not execute it.
I don't want to blame anyone, but if it's true then it is.... sad?

tough abyss
#

Y'all talking about servers and headless clients when 75% of my hours are singleplayer πŸ˜‚πŸ˜‚πŸ˜‚

spiral fractal
#

I dont even know 😐 I added it to player init it didnt worked right, now I added it to both idk

meager granite
#

CfgDisabledCommands doesn't prevent anything from sending, it simply cuts off these commands from being executed in scripts. Command may be local, may send network stuff.

#

Arma is very client-side oriented game and relatively easy to cheat in, unfortunately

tough abyss
#

well thabk you

meager granite
#

(Might confuse even more at first but give it thorough read and it will become clear)

tough abyss
#

try reading github docs

meager granite
#

@spiral fractal player init as in initPlayerLocal.sqf ?

#

or editor Init field of the player unit?

spiral fractal
#

C# and SQF has nothing in common, SQF is just madness

quartz pebble
#

it is madness only if you haven't learned it before C#

meager granite
#

SQF is alright. Mess with scripting commands is the issue, as they've evolved over 20 years from OFP times.

spiral fractal
#

yes you probably right winse, but I think anyone who know programming understands that SQF is not right

winter rose
#

getPosWorldVisualWorld, boundingBox/realBoundingBox, viewDistance/getObjectViewDistance, etc ^^

meager granite
#

Namely BI introducing commands to solve their missions needs only, usually without much flexibility or future-proofing

quartz pebble
#

@spiral fractal keep in mind it has been developed before year 2000. In that times there was no all that best practices we have now

meager granite
#

WFSideText the real gem of scripting commands πŸ‘Œ

winter rose
#

WF prefix was for WarFare?

meager granite
#

Yep, a command to turn side into string for Arma 2 Warfare

spiral fractal
#

I dont understand... because I dont have to deal with lazy devs who port stuff 4 times

winter rose
#

indeed, pretty much self-oriented

quartz pebble
#

@meager granite by the way, I checked the spectator with eachFrame camera. Can't say there are much difference comparing to the while {true}.

meager granite
#

Thankfully it all changed for better in Arma 3 but remnants of old mess will forever stay in SQF

#

@quartz pebble Oh I remember now, there are different each frame handlers that execute at different times in frame

#

You need specific one to have smooth spectator camera experience on fast moving objects

#

Trying to remember which one

quartz pebble
#

my current approach is addMissionEventHandler ["eachFrame", ...]

meager granite
#

Yeah, you need another per frame handler. Had this issue years ago, trying to remember what I did.

#

Maybe it was Draw3d

quartz pebble
#

hm

#

let me try

spiral fractal
#

why BI cant change those commands? to make them execute right, without the need for remoteExec etc? or prevent vehicles from changing locality?

meager granite
#

Locality change is fundamental concept in networked games.

#

In your case you need to call setDamage 0 ONCE from whoever initializes the repair and then boardcast call for another function that does other commands everywhere on all clients and server (no JIP of course)

quartz pebble
#

Nope. draw3d makes it worse.

spiral fractal
#

what if I just remoteExec this function with 0?

lost copper
#

@spiral fractal func will exec on server and every connected client

winter rose
#

@quartz pebble try to target visual position?

meager granite
#

Oh yeah, I assumed you already had visual position commands used

#

@spiral fractal It should work but you'll do setDamage 0 needless amount of times

#

Each client will do setDamage 0 sending the message to each other client

#

as command is global

spiral fractal
#

where should I put that function? I have server and client init, if I add it to client, when I call remoteExec what will happen?

meager granite
#
  1. RemoteExec engineOn false globally
  2. sleep 1
  3. setDamage 0
  4. RemoteExec other 3 set* commands (remote exec call function which has them or something)
karmic swift
#

But I know that PUBG and DayZ was initially created in ArmA. For such kind of gameplay cheating is terrifying.
I heard that Arma 4 will use DayZ:SA engine. I believe that it should have better cheat-protection (and maybe totally different engine architecture). So, will cheating became harder sometime?
And, to not let this message being totally offtopic, I want to ask:

How could I change Player UID? I'm using it in scripts for persistent player differintiation, but when I testing mission localy (one PC, two ArmA windows) looks like it getting mess. Maybe there is some 'testing mode' when I can temporarily change UID to random one.

quartz pebble
#

@winter rose I use visual pos atm. Draw3d makes camera jump

winter rose
#

@karmic swift there is none.

vague geode
#

@winter rose Is it possible to change the default loadout of dynamic loadout vehicles in a warlords mission?

winter rose
#

I don't know and don't think so

meager granite
#

@quartz pebble Remember it now, check how BI spectator camera works

#

EGSpectator in functions_f_exp_a.pbo

quartz pebble
#

@meager granite checked yesterday - was looking for some magic but there wasn't

meager granite
#

It does make smooth camera follow though, there is magic on a way its done but I can't recall exact details now.

quartz pebble
#

The only thing seemed unusual - it tries to do some FPS based calculations

vague geode
#

@winter rose Ok, I have seen that there is a CfgVehicles which can be put into a Config.cpp but I am not sure how to use it nor if it will actually solve my problem...

winter rose
#

Β―_(ツ)_/Β―

vague geode
#

Β―_(ツ)_/Β―

mortal crypt
#

Hey I'm trying to add ace-Actions which will also be added to players which join later in game. This is what I got, it works on players that are on the server but not the one that do jip.

["eh_setupACEComputer",
[_computer,_antenna],FORMAT["%1_setupACEComputer",_computer]] call CBA_fnc_globalEventJIP;```
mortal crypt
#

Thats what I use. The other side looks like that.(Only that there are more actions) sqf // ACE-Actions ["eh_setupACEComputer", { _code = { // DO THIS }; _condition = { // WHEN THIS }; _action = ["JAM_SwitchOn","Computer Anschalten","",_code,_condition,{},_antenna] call ace_interact_menu_fnc_createAction; [_computer, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToObject; }] call CBA_fnc_addEventHandler;

spiral fractal
#

I think if you just add the ACE interaction to player init and the object name set in mission.sqm it will work without the CBA_fnc_addEventHandler

mortal crypt
#

The problem is that because the way the mission is setup/the scripts are linked I cant just put it in the initPlayerlocal.sqf because that will cause the variables to be defined more then one time and similar stuff.

fervent kettle
#

any way i can delete mines created with the createMine command?

mortal crypt
#

The problem is that because the way the mission is setup/the scripts are linked I cant just put it in the initPlayerlocal.sqf because that will cause the variables to be defined more then one time and similar stuff.
@mortal crypt I get the feeling that I setup something wrong. Even the remoteExec jip is not working

mortal crypt
#

any way i can delete mines created with the createMine command?
@fervent kettle with deleteVehicle

mighty vector
#

so, why...

veh1 = "LIB_SdKfz124" createVehicle ([1731,50,0]);
_grp = createVehicleCrew veh1;
veh2 = "LIB_OpelBlitz_Tent_Y_Camo" createVehicle ([1731,40,0]);
_grp = createVehicleCrew veh2;
veh3 = "LIB_OpelBlitz_Fuel" createVehicle ([1731,30,0]);
_grp = createVehicleCrew veh3;
veh4 = "LIB_OpelBlitz_Ammo" createVehicle ([1731,20,0]);
_grp = createVehicleCrew veh4;
veh5 = "LIB_OpelBlitz_Ambulance" createVehicle ([1731,10,0]);
_grp = createVehicleCrew veh5;
veh6 = "LIB_SdKfz251" createVehicle ([1731,0,0]);
_grp = createVehicleCrew veh6;
grp = createGroup west;
[veh1, veh2, veh3, veh4, veh5, veh6] joinSilent grp;
grp selectLeader (units grp select 0);

systemChat str(units grp);

(Creates and prints "B Charlie 1-6:1, B Charlie 1-6:2...B Charlie 1-6:6")

Creates adicional Bravo 1-5 and Bravo 2-5 groups. (?)
https://paste.pics/87e90fc61102b812a98e238dc663688c

fervent kettle
#

@fervent kettle with deleteVehicle
@mortal crypt how exactly? IΒ΄ve used that only once to delete infantry, but not for mines

meager granite
mortal crypt
#

@mortal crypt how exactly? IΒ΄ve used that only once to delete infantry, but not for mines
@fervent kettle What and where do you want to delete?

fervent kettle
#

So, i have a script that places mines createMine and i want to add another script to delete the spawned mines

mortal crypt
#

simply all mines?

fervent kettle
#

Yep

#

In a radius tho

meager granite
#

@mighty vector joinSilent takes units, not vehicles. I just checked, providing unit only uses first unit in the vehicle to move groups, not entire vehicle crew.

mortal crypt
#

{if(_x dist _pos < _maxDist)then{deleteVehicle _x};}foreach allMines;

#

*distance

meager granite
#
(crew veh1 + crew veh2 + crew veh3 + crew veh4 + crew veh5 + crew veh6) joinSilent grp;

Try this, might work

mighty vector
#

@meager granite ill try. However, trying to avoid that error I tried:

grp = [[1731,50,0], WEST, ["LIB_SdKfz124", "LIB_OpelBlitz_Tent_Y_Camo", "LIB_OpelBlitz_Fuel", "LIB_OpelBlitz_Ammo", "LIB_OpelBlitz_Ambulance", "LIB_SdKfz251"],[[0,0,0],[0,-10,0],[0,-20,0],[0,-30,0],[0,-40,0],[0,-50,0]]] call BIS_fnc_spawnGroup;
grp setFormation "FILE";
grp selectLeader (units grp select 0);

the first vehicle of the convoy is not the LIB_SdKfz124, but the 2nd, then the 3rd and so on...until the LIB_SdKfz124 (the first in the array)

#

perhaps is better to use this approach? (better code, less error-prone...)

fervent kettle
#

{if(_x dist _pos < _maxDist)then{deleteVehicle _x};}foreach allMines;
@mortal crypt like that? {if(_x distance "removemines1" < 25)then{deleteVehicle _x};}foreach allMines;

meager granite
#

@mighty vector Just change order or vehicles in that joinSilent above?

mortal crypt
#

@mortal crypt like that? {if(_x distance "removemines1" < 25)then{deleteVehicle _x};}foreach allMines;
@fervent kettle lets take this to private will be faster to help. you can post something when its finished

mighty vector
#

@meager granite u mean 6th,1st,2nd,3rd,4th,5th ?
...a kitty just died for that
could this be based on how the "insert node in list" is implemented, hence shall be corrected or at least reflected in docs?

mortal crypt
#

I am really wondering what I do wrong. Or if I understand something wrong.

["Text"]remoteExec["systemChat",0,true];```
This should send the message to all players including the ones that are going to jip in the future right?
meager granite
#

"Text", not ["Test"]

#

You need string argument, not array containing a string

#

@mortal crypt

mortal crypt
#

Okay thanks, that actually works. Now I have to translate that to my script.

#

Found my problem. The eventhandler is created after the jip code is executed. now to delay the jip code..

#

*think I found my problem

round scroll
#

In a multiplayer mission on a dedicated server, what's the correct waitUntil statement before opening a camera that the player need to watch?

winter rose
#
waitUntil { not isNull player };
```?
round scroll
#

is player null during the briefing screen?

proper sail
#

i think its null until it has a unit

winter rose
#

JIP, player is null before being a unit

round scroll
#

thanks, will try. Thought it was way more complicated

slim verge
#

Query on available spectate scripts. I used CSSA3 back in 2015 and now am back into mission development etc.
What i am after is a more up to date and light spectate script if there is one that I can add to a mission template/framework. (Main usage 1st person spectate mode while in a "waiting for revive" state, which i need to control dynamically)
Failing that is it possible to interact and dynamically control the BIS system using mission based scripts.
(I really don't want to attempt to extract the BIS system into a local version, there systems always seem to be a tangle of function calls to other pbo's and its a pain to try and trace extract them)
So if i were to use the BI internal system, I would need to control the following within the mission code

  1. Enable and disable dynamically
  2. Set to 1st person only
  3. Define the spectatable objects
#

UPDATE:
nm found it BIS_fnc_EGSpectator

slim oyster
#

I am trying to find a var renaming function similar to the editor auto naming of varnames when copy pasting: var and then var_1 , var_2 etc. It's pretty simple but a search didnt yield any results and someone must have made it in sqf already, does anyone know of anything like this? thanks

slim verge
#

not sure what you mean, other than mass rename of all "strings" that equal "ABC" to "XYZ" across multiple files but thats done in most code editors

slim oyster
#

there is a unique varname system in the editor, you cannot have two unique varnames. When you copy paste something with a varname, it automatically renames it. I think it is very likely that someone has replicated that already in sqf.

slim verge
#

I didnt know that existed, most mission devs use a tag for their global vars, mine is Txu to avoid this happening

slim oyster
#

I am talking about object varnames not general global variables

slim verge
#

well the editor doesn't allow you to define 2 objects with the same varname, it warms you and doesnt acceot the second version of the value... so am failing to see how you manage to achieve that

slim oyster
#

if you spawn objects and you want to set varnames

#

if object has already been spawned I want next iteration to have _1, _2 suffix etc

slim verge
#

if your creating say 1000 markers then typically you will have your first marker called something like MyMarker and then copy and pasting creates newer versions with a _(+1) incremental name

#

if you want to do that in a script then you create a loop with an incremental counter to change the varname

slim oyster
#

yes in a var loop sure which gives you the naming scheme

#

I just dont want to rewrite a function that checks missionNamespace for the existence of a varname, and then renames it akin to how the editor does it. I would assume someone has already written it

slim verge
#

Here is an example used to dynamically increase the varname by adding a tag _(+1) to every iteration of the loop, if this is what you are after.

#

This is used to create a series of group indivdual tracking markers

slim oyster
#

thank you but this is not what I am after

slim verge
#

then you havent explained it in a way that makes sense to me... or it isnt required

#

you want something like
If exists ABC_1 then create ABC_2 ??

slim oyster
#

yes, as simple as can be

#

just checking missionnamespace and renaming like the editor

slim verge
#

and where do you grab ABC from

slim oyster
#

from a user input

#

its a passed var

#

renaming function would only be called if passed var is supplied

slim verge
#

ok so you need to check isnil for the string version and then compile the string version and check is isnul

#

it may also depoend on the type of var that is being passed

slim oyster
#

I am just asking if someone has already done that since it seems like it would have been done before

#

not really, it is just a suffix on an already valid var

slim verge
#

it seems doubtful to me that this would be the case, because anyone writing a system that increments in that way would be using a unique varname that they create and incrementing the varname in their own script. For example someone creating a scripted composition if they needed to keep track on say an object within that composition and there were 5 or 6 versions of that composition created within a mission. They wouldnt even need to do that for the objects because they would just store all the objects in an array allowing them to later delete the composition..... Can you give me a real world example of why you see this an necessary... What objects within a mission are you working with that you cannot control or know the varname for ?

slim oyster
#

...

#

user input names of spawned objects

#

if they spawn compositions of objects more than once, I would like a predictable varname for the duplicated which have been renamed

#

as the editor does it

slim verge
#

aha so you have a gui that players can create objects with and you need a dynamic naming system for them ?

slim oyster
#

not a gui but an init function but yes user inputted string for a varname which gets set

astral dawn
#

I guess you can find last "_" in existing string, parse number after it, increment it, etc... I'd do it like that πŸ€”

real tartan
#

@slim oyster

_marker = createMarker [format ["marker_%1_%2", player, time], _position];
slim oyster
#

I'm using an existing inputted string as the base varname I just want the suffix to change

#

not just a unique name

real tartan
#

"player + time" should be enough unique, I don't think that player will spawn multiple compositions in less that 1 second

astral dawn
#

you can use position as a part of name πŸ€”
but yes I understand your idea

slim oyster
#

I want a predictable varname to point to and access not just a unique name, a predictable name akin to the editor

real tartan
#

player + time is predictable πŸ˜‰

slim oyster
#

no it isnt lol

astral dawn
#

you can't guarantee that time won't ever be absurdly large...

slim oyster
#

@astral dawn yeah, guess i'm writing that then

real tartan
#

then do player + counter (player setVariable ["composition_counter", 0])

astral dawn
#

wheel reinvention... inevitable 😦

slim verge
#

INIT.sqf:
Txu_MyCounter = 1;

//ok so maybe use the players name as the unique varname
//SCRIPT
ObjectID = format ["%1%2",name player, Txu_MyCounter];
Txu_Mycounter = Txu_Mycounter +1;
(call compile _ObjectID) = createvehicle ............;

#

then you can add the object to an array with all the other objects PV it if you need to remotely interact with the objects or an array of objects for say the admin

#

seems when you add code in here it removes some underscores

slim verge
#

or use the first X letters of a players name if you want to maintain a shorther varname, add some "X's" if you wanted a 4 letter tag and the players name was Ted πŸ™‚

#

maybe you could also incorporate NetID into the varname, thats unique to each client

#

or this..... BIS_fnc_objectVar (Fits your requirements perfectly)

surreal peak
#

if you want reproducable identifications, you could always hash the persons name

slim verge
#

[object, varNameRoot] call BIS_fnc_objectVar automatically adds an increment so its exactly what you wanted. Am assuming this is networked and not local but you would have to test or look at the function code to see if it pv's or remote calls the varname

slim oyster
#
private _return = if !(isNil _varName) then {
    for "_i" from 1 to 100 step 1 do {
        private _testName = format ["%1_%2",_varName,_i];
        if (isNil _testName) exitwith {
            _testName
        };
    };
} else {
    _varName
};

_return```
real tartan
#

is variable name for setVariable getVariable case sensitive ? E.g. _object setVariable ["MyVariable", 0] vs _object setVariable ["myvariable", 0]

unreal scroll
#

@real tartan No. But be careful, as it could became case sensitive when you try to operate the lists/arrays, like "myVariable" in (allvariables _object), but it is rare case, and allvariables returns all in lower case.

Is there any event handler for helicopters, as analogue for LandedTouchDown for planes?

spiral fractal
#

as far as I understood, sqf if check will not exit if the first value is false, it will check all the rest unless I add { }, it is true?

still forum
#

if doesn't check anything

#

then gets a boolean, if the boolean is true it executes its code

#

Not sure how I should explain SQF basics to you,
But basically.
(A && B && C) then
is what you write down, what SQF executes is
A
B
C
&&
&&
then

#

it doesn't even get to the if/then before it finished executing ABC and the &&'s

spiral fractal
#

wow

still forum
#

But!
&& and || have a special syntax
A && {B}
will be executed like
A
{B}
&&

#

as you can see, B never gets executed, its just a CODE type value thats being passed on, its content wasn't executed yet.
&& checks if A is true, if yes it will execute the CODE that was passed, if not, it'll skip it and return false, never executing B itself.

winter rose
#
// game will check both conditions
if (alive player && damage player == 0) then { ... };

// game will not check player's damage if he is dead
if (alive player && { damage player == 0 }) then { ... };
spiral fractal
#

another nice feature of the language, I still forget to add thethen and now I have to add brackets πŸ™ƒ

unreal scroll
#

@still forum Is there any difference between A && {B} && {C} and A && {B && {C}}?

still forum
#

Yes

#

in the first one the {B} and {C} will be pushed onto the stack, and the second && will always evaluate

#

in the second one.. not

unreal scroll
#

Thanks

spiral fractal
#

Thank you for the explanation! but if you work on Arma 4 please use normal language such as C#, and dont worry about the code base, I am pretty sure it will be much better to rewrite stuff anyway

#

it has to be done at some point...

winter rose
spiral fractal
#

I read somewhere that BI want to keep "backwards compatibility" for all the sqf content so I am not very optimistic about the next Arma game / engine...

winter rose
#

that's on the "wishes" list. Main syntax is EnScript.

queen cargo
#

Sqf is consistent in itself
Just to Note

astral dawn
#

Imagine I had to create a few thousands of shapeless objects for the purpose of helper snap points, what's my best choice? createUnit logic? createVehicleLocal with some light shape like helper arrow then hide it? Or the CBA namespace location?

winter rose
#

nevah createUnit - it brings AI to the issue

#

I usually createVehicle(Local) an invisible helipad @astral dawn

astral dawn
#

πŸ€”

#

well we don't want to make ai crazy πŸ˜„

winter rose
#

createUnit is not needed if AI is not needed ^^

#

even better with createSimpleObject and the arrow stuff to make sure the position is correct - then hiding it

astral dawn
#

yes I'm just not sure if shape still is being processed somehow even though it's hidden

winter rose
#

no, or at least I am not aware of it

astral dawn
#

okay cool, proceeds to generate thousands of arrows

winter rose
#

note that createSimpleObject takes a world position

wet shadow
#

Hello people, Im having issues with the setAmmo so if anyone has hints that would be great. I am creating a script that forces AI vehicles to deploy smoke screen. To be on the safe side I would want to make sure the vehicle in question has ammo for the smoke launcher. I am currently working on the vanilla APCs and _unit setAmmo ["SmokeLauncher", 2]; seems to work only for the CSAT Marid. I have no idea why since I have checked the configs for all vehicles and the weapon is the same (with same magazine size). I've also douple checked locality as that is relevant for setAmmo command.

young current
#

you need to point to the vehicle

#

not unit

wet shadow
#

Its done earlier in the script params

#

Defining the unit in question works for other functions its so not the issue

young current
#

then possibly you need to also find the correct turret the smoke launchers are on

wet shadow
#

The syntax from the wiki has nothing on the turret path so I am not sure where in the array to put it. Also it is noteworthy the example I gave does workd for the marid, just not for the other apcs (haven't even tried other vehicles)

young current
#

there are other commands to manipulate ammo for vehicles/turrets

wet shadow
#

Magazines for the turrets are a real pain once I get into modded vehicle territory, setAmmo has so far worked for mods wihtout an issue. Also assuming the vehicle is out of ammo it would have to reload the new magazine if I went doen that path, setAmmo would allow instant firing. So besided stuffing new magazines in any other avenues you had in mind?

young current
#

off the top of my head I dont have any other ideas. I think your approach may just be incomplete as it is now

wet shadow
#

😩 Thx anyway

young current
#

Doesnt mean Im right, just cant think of how you should do it

wet shadow
#

setVehicleAmmo Works but is obviously not ideal

surreal peak
#

why not?

wet shadow
#

Because it loads all weapons

#

So it would be filling all the cannons etc which is not desired

mighty vector
#
grp = [[1731,50,0], WEST, ["LIB_SdKfz124", "LIB_OpelBlitz_Tent_Y_Camo", "LIB_OpelBlitz_Fuel", "LIB_OpelBlitz_Ammo", "LIB_OpelBlitz_Ambulance", "LIB_SdKfz251"],[[0,0,0],[0,-10,0],[0,-20,0],[0,-30,0],[0,-40,0],[0,-50,0]]] call BIS_fnc_spawnGroup;
grp setFormation "FILE";
grp selectLeader (units grp select 0);

the first vehicle of the convoy is not the LIB_SdKfz124, but the 2nd, then the 3rd and so on...until the LIB_SdKfz124 (the first in the array)
could this be based on how the "insert node in list" is implemented, hence shall be corrected or at least reflected in docs?

winter rose
#

@mighty vector if you mean that vehicles are not driving in the same order, this must have to do with rank/vehicle leader, not the function itself.

mighty vector
#

in a group, the first to walk is not the leader but the highest rank?

winter rose
#

yep. 3 can be the leader

mighty vector
#

did i missunderstood the meaning of lead?

winter rose
#

also, there is a difference between vehicle (and therefore formation) leader and group leader

mighty vector
#

so, let me check if i got it...to make the first vehicle go first, i should set him the highest rank

#

then, whats the use for setleader?

winter rose
#

force the leader?

mighty vector
#

and than means...?

winter rose
#

actually, maybe the first spawned unit (in-game!) is the group leader, that I don't know

#

but if you have e.g a car driven by a soldier with Private rank, and he is the group leader, and he is followed by a tank with full crew, the tank commander is higher-ranked in term of vehicle formation (as "leader" of a vehicle) so he will take the lead, iirc

mighty vector
#

to be honest...this doesnt make much sense for me.
I'm probably wrong, but AFAIK, lead shall be the "first" to walk. no matter who "commands"/give orders.

winter rose
#

to you Β―_(ツ)_/Β―

mighty vector
#

so, if the above code doesnt make first vehicle move first, i think it's suitable to be filed as a bug

winter rose
#

place two soldiers with "private" rank in Eden, the place a third one with "sergeant" rank, and see which one links all the others

mighty vector
#

going to check

#

btw...i think the first vehicle happen to have a higher rank! lol

winter rose
#

also, IDK if BIS_fnc_spawnGroup gives ranks to units

spice vigil
#

Hello,
Back again with a sqf scripting question.
I've managed to script in an action that lets me teleport my vehicle
onMapSingleClick "vehicle player setPos _pos; onMapSingleClick ' '; true;";

However, I would also like it to teleport at a high altitude alongside teleporting to the position. I've tried a while now but I can't seem to change the altitude of the vehicle alongside teleporting it to the map click location (the altitude change always happens before i click on the map). Any suggestions?

winter rose
#

@spice vigil ```sqf
onMapSingleClick {
_pos set [2, 2000]; // 2000m altitude
vehicle player setPos _pos;
onMapSingleClick "";
true;
};

spice vigil
#

That makes sense. Thank you so much Lou, I ask so many question you should be the one credited for making this script, haha.

winter rose
#

I demand 50%!

glacial lagoon
#

Is there any way to reload in dev_branch SQF scripts?

distant wave
#

someone with GUI experience?

mighty vector
#

@winter rose just tested, it seems is not a rank issue, although I could set ranks in BIS_fnc_spawnGroup. I'll dare to ask in general chat, to see if dedmen consider it a bug (and hence file it)

winter rose
#

@mighty vector have you tried one-crewMember vehicles?

mighty vector
#

on my way!

#

seems to work thonk

#

hmmm

#

setleader receives unit...perhaps is not working 'cause is not "a single unit" vehicle?

#

ie: instead of

grp selectLeader (units grp select 0);

grp selectLeader (crew (units grp select 0) select 0);

winter rose
#

units returns units, not vehicles

#

@mighty vector try maybe```sqf
private _firstUnit = units _group select 0;
private _firstVehicle = vehicle _firstUnit;
_group setLeader effectiveCommander _firstVehicle;

mighty vector
#

that last line seems buggy (Generic in expression)

#

and now the first vehicle is moving just after spawn..."breaking" the "FILE" formation to do a wedge

#

...

#

nevermind...ill try tomorrow (i need to sleep!!!)

#

thanks Lou!

spice vigil
#

Do you think it is possible through a script to lock a vehicle (like a plane class) X and Z axis movement so it can only go up or down in a straight line?

winter rose
#

yup
with setVectorDir/AndUp I suppose

spice vigil
#

I'll try something like setVectorDirAndUp [[1,0,0],[0,0,1]];

spice vigil
#

Hmmm, is there any way to make _x setVectorUp surfaceNormal position _x constantly be in effect?

winter rose
#

a loop

fluid cairn
#

How do I give a variable name to a person I spawn in with script? Say I wanna have a Rifleman spawn with script, and give him a variable H1

kindred dagger
#

I might be going about this the wrong way, or just overlooking something simple; I am trying to use BIS_fnc_showMarker to show markers, in this case changing Marker_5's alpha to 75 over 2 seconds with: ["Marker_5",2,0.75] call BIS_fnc_showMarker;.
I can get it to work when including as part of a timeline and spawn BIS_fnc_AnimatedBriefing however I am trying to call the function without the use of the animated briefing. Am I going about this the completely wrong way or is there something I'm missing? Any assistance would be greatly appreciated.

winter rose
#

@fluid cairn H1 = createUnit (…)

manic sigil
#

So I see how to find a task's children/parents, but how do I make a task a child/parent?

robust hollow
manic sigil
#

Ahh, I see it now.

#

I'll give that a try real quick.

robust hollow
#

the wiki says it can be the task id as a string, or an array [task ID, parent task ID] , however the setTask function appears to support children as a third element

#
_ids     = _this param [0,"",["",[]]]; if (typeName _ids == typeName "") then {_ids = [_ids]};
...
_parent   = _ids param [1,GET_DATA(_taskVar,PARENT),[""]];
_children = _ids param [2,GET_DATA(_taskVar,CHILDREN),[[]]];

SET_DATA(_taskVar,ID,_id);
SET_DATA(_taskVar,PARENT,_parent);
SET_DATA(_taskVar,CHILDREN,_children);
manic sigil
#

That did the trick πŸ™‚

fading plover
#

sorry if this is the wrong place but i was wondering if there is a way to make an addaction scroll wheel thingy a one time use?

robust hollow
#

yes there is, remove the action in the script it executes

#
this addAction ["Hello World",{
    params ["_target", "_caller", "_actionId", "_arguments"];
    _target removeAction _actionId;
    // ur stuff
}];
fading plover
#

thank you

still forum
#

@glacial lagoon look into filepatching. Will need stuf fin Arma dir and stuff. Not sure if there is a wiki page explaining the setup, I think there should be one

verbal rivet
#

I'm trying to play with some CBRN stuff and ran into a small issue. For some reason Say3D does not play custom sounds defined in description.ext:

class CfgSounds
{
    sounds[] = {};
    class P0Choke03 { 
        name="P0Choke03";
        sound[] = { "A3\Sounds_f\characters\human-sfx\Person0\P0_choke_03.wss", 1, 1 };
        titles[] = {0, ""};
    };
};

player say3d "P0Choke03" does nothing
playSound3d ["A3\Sounds_f\characters\human-sfx\Person0\P0_choke_03.wss", player, false]; plays the sound (so I know the sound file name is correct), but the sound is not attached to player when he moves. Besides, Say3d has the advantage of interrupting unit speech (I think)

Does anyone know what might be the issue?

robust hollow
#

you might need an @ at the start of the filepath.

#

i cant seem to find an example of it in use on the wiki, but iirc in the mission file CfgSounds you use @ to indicate the sound is not in the mission file or something

verbal rivet
#

That worked, thank you!

robust hollow
verbal rivet
#

I've read it too, but I was confused by what AddOn meant there, I thought it meant unofficial addons

Since Arma 3 v1.49.131710 it is possible to define AddOn sounds in mission config. In order to make engine look for the sound in AddOn, the sound path must start with @ (instead of ) for example:

#

Although the example shows @a3\Ui_F_Curator\Data\Sound\CfgSound\visionMode so yeah, should have guessed

robust hollow
#

arma pbos technically count as addons too i guess, they load from addons folders just like mods do.

winter rose
#

also, you could simply use say 😬

exotic tinsel
#

is it possible to setup push to talk to also put what your saying over direct? if so could you point me in the right direction so i can research it.

winter rose
#

no setup needed, the game does that I believe

#

and if not, there are no scripting commands regarding VOIP @exotic tinsel

exotic tinsel
#

so if im in group i can have it also push to direct?

robust hollow
#

thats a modded only thing i believe. like tfar

winter rose
#

you said "also" push to direct; you can chat in direct channel by switching them, and if you want to speak e.g in side channel and be heard closeby, either the game does that by itself or there is no way to do so (without mods)

exotic tinsel
#

Arma does not allow you to speak in two channels at the same time natively. im in the scripting channel looking for a way to script this/create mod. If someone has any "direction" to do this please reply.

winter rose
#

none in scripting I'm afraid

#

the game does it for pre-recorded voices (you can hear AI talk over the radio when close)

robust lichen
#

how can i triger a trigger if a player is in the trigger and a object is null

#

im pretty new to scripint in arma

#
intelNull = false;
intelNull = if (mission_2_intel_tablet isNil) then {true} else {false};
#

ive been tring that and putting

winter rose
#

you can link the trigger to units you want to be able to trigger it
wrong syntax for isNil

robust hollow
#

surely you mean intelNull = isNull mission_2_intel_tablet;

winter rose
#

^

robust lichen
#

let me see iff that works

winter rose
#

that better be good @robust hollow πŸ‘€ πŸ˜„

robust hollow
#

🀞 😟

robust lichen
#

didnt do anything

robust hollow
#

do you return intelNull somewhere?

robust lichen
#

wait one i may of done something stupid

robust hollow
#

i'd believe it πŸ™‚

robust lichen
#

so i have a intel item called mission_2_intel_tablet

#

and the triggers set to be active when anyplayer is present

winter rose
#

may have, please 😰

brave jungle
#

There a function that grabs all factions on a side, for example all faction on West?

robust lichen
#

and i want the conditional of is the obj mission_2_intel_tablet exist to triger the trigger when all critera is met its 5 am and ive been pulling my hair out past three hours so i may need a dumb down explnation

winter rose
#

@brave jungle BIS_fnc_getFactions xD

brave jungle
#

I need to search more

#

too lazy

clever radish
#

Anyone can help me? I've got a little trouble activating my scripts. I have three BLUFOR units, each having the INIT to execVM "RandomLoadout.sqf" inside RandomLoadout.sqf i've got "_unit = _this select 0;
_RandomLoadout = ["Loadout1.sqf","Loadout2.sqf","Loadout3.sqf"]; selectrandom _RandomLoadout;" Each loadout.sqf has a different hint (to confirm that script has been activated, and which). Though it does not work. The purpose is to have each unit select a random loadout from loadout1, loadout2 or loadout3. If i execute the "_unit = _this select 0;
_RandomLoadout = ["Loadout1.sqf","Loadout2.sqf","Loadout3.sqf"]; selectrandom _RandomLoadout;" inside the console when inside a mission it works just fine.

winter rose
#

oh wait, this does not search by side @brave jungle

brave jungle
#

Oh it doesn't?

winter rose
#

@clever radish use ```sqf please (see pinned message)

brave jungle
#

Then I stand by my question πŸ˜„

robust lichen
#

so if i put intelNull isEqualTo true; in conditions on trigger and intelNull = isNull mission_2_intel_tablet; in init.sqf would that work?

brave jungle
#

i'll look a little more, otherwise i'll just make myt own function

winter rose
brave jungle
#

πŸ‘ will report back if there isn't so you know for future πŸ‘Œ

#

oh

clever radish
#

@winter rose I do not understand. I'm pretty new to Discord

brave jungle
#

But thats just for objs

#

I'll let you help him first I'll come back when it's quieter πŸ˜›

clever radish
#

@winter rose Oh, i got it. Sorry.

robust hollow
#

@robust lichen no

#

just put isNull mission_2_intel_tablet in the trigger condition

robust lichen
#

oh

#

will try

#

it still isnt functioning

#

["intel","FAILED"] call BIS_fnc_taskSetState;

#

this is correct right

#

task id is intel

brave jungle
#

Anyone can help me? I've got a little trouble activating my scripts. I have three BLUFOR units, each having the INIT to execVM "RandomLoadout.sqf" inside RandomLoadout.sqf i've got "_unit = _this select 0;
_RandomLoadout = ["Loadout1.sqf","Loadout2.sqf","Loadout3.sqf"]; selectrandom _RandomLoadout;" Each loadout.sqf has a different hint (to confirm that script has been activated, and which). Though it does not work. The purpose is to have each unit select a random loadout from loadout1, loadout2 or loadout3. If i execute the "_unit = _this select 0;
_RandomLoadout = ["Loadout1.sqf","Loadout2.sqf","Loadout3.sqf"]; selectrandom _RandomLoadout;" inside the console when inside a mission it works just fine.

@clever radish If you adjust your comment to add code formatting someone will help you better, its hard to read like that

#

as lou said, see the pinned messages

robust lichen
#

this is picture of my trigger

warm hedge
#

F12 is always your friend, mate

robust lichen
#

:p steam likes to hide the screen shots from me

brave jungle
#

@clever radish

#
_unit = _this select 0;
_RandomLoadout = ["Loadout1.sqf","Loadout2.sqf","Loadout3.sqf"]; 
selectrandom _RandomLoadout;
_unit = _this select 0;
_RandomLoadout = ["Loadout1.sqf","Loadout2.sqf","Loadout3.sqf"]; 
selectrandom _RandomLoadout;```
#

that's what I mean

#

Anyhow

#

the reason it works in the debug is because you have _this select 0 at the start

brave jungle
#

but you're not passing anything via execVM

#

Yeah exactly

clever radish
#

I have tried 1000 times now, and it keeps bugging the message i wanna send. The ´´ suddenly stops working.

brave jungle
#

Okay well i've formatted it now xD

#

you;'ll need to do something like:

clever radish
#

XD Thanks

brave jungle
#
[player] execVM "RandomLoadout.sqf";

in the init then it will work.

#

or just remove the _unit = _this select 0 to _this; and then you can just do player execVM "RandomLoadout.sqf";

clever radish
#

I will try it out. Thank you

brave jungle
#

you have to have your argument in an array format because you are using select 0. _this is a "magic variable", can read about that on the wiki, but it means that _this takes the place of argument(s), so in this case player

robust lichen
#

so with isNull mission_2_intel_tablet as the condition and any player present set as well as on activation ["intel","FAILED"] call BIS_fnc_taskSetState; it dosent do anything and im not exactly sure if its triggering and not calling the setTaskState or what

brave jungle
#

do you have show script errors

#

on

#

from the launcher

#

?

robust lichen
#

no, restarting arma

brave jungle
#

Cool

robust lichen
#

did know that was a thing

brave jungle
#

Very handy πŸ™‚

robust lichen
#

where does it show the errors at?

clever radish
#

An error pops out, saying it got a script, but excepted nothing

robust hollow
#

should paste the error

brave jungle
#

Oh course it's execVM

#

nul = [player] execVM "RandomLoadout.sqf";

#

If I remember right

clever radish
#

Yeah, that works

brave jungle
#

Perfect

clever radish
#

I dont know, but it should, as all of my other execVM has the "nul =" in front

brave jungle
#

Yeah it's weird I forget why but it always has it

clever radish
#

Apprently this makes my ARMA go to windowed mode.. weird

robust lichen
#

so do the acript errors show in rpt or?

brave jungle
#

Will display in a box on your screen

#

you'll notice it

#

trust me

robust lichen
#

okay

brave jungle
#

if it encounters one

robust lichen
#

well with it off i got those every know and again lol

brave jungle
#

haha

#

Yeah well you'll get them more now

#

so when a player enters a trigger, you want it to see if an object is destroyed then set the task to failed?

robust lichen
#

yeah

#

well gone

#

an object has probablity of not being there

clever radish
#

It does not work. It's the same as before, the hint message does not show

brave jungle
#

but it still exists?

robust lichen
#

in the object attributes the probability of presence is what im using to determine if its there or not

brave jungle
#

@clever radish see your DMs

robust lichen
#

also does it log the black box errors anywhere

brave jungle
#

your rpt always logs unless you turn it off

robust lichen
#

mk

brave jungle
#

If i were you, always have the object there, but then a chance of it being "hidden", so maybe move it to [0,0,0] if its cahnce of being seen is false

#

avoid it erroring out

robust lichen
#

and i gues you check if its at that cords?

brave jungle
#

If its in the trigger area

winter rose
#

else you would have to check```sqf
if (isNil "mission_2_intel_tablet" || { isNull mission_2_intel_tablet }) then
{
...
};

brave jungle
#

there ya go

#

πŸ˜„

#

Right back to making a faction checker

#

have fun πŸ™‚

robust lichen
#

do i put thin in conditions?

#

or do i put in in init and use that to set a variable true or false?

#
if (isNil "mission_2_intel_tablet" || { isNull mission_2_intel_tablet }) then
{
  aTestVar isEqualTo true;
};
brave jungle
#

activation

#

the bit inbetween { ... } is whatever you want to happen if it's not present or is destroyed

verbal rivet
#

Has anybody found/documented how to place sick civilians from Old Man in a mission? I've found the CfgIdentities with _sick suffix, but they only seem to show it on face, not on hands/legs

winter rose
#

not documented yet, but you can read functions in the Functions viewer @verbal rivet

verbal rivet
#

Do you have a hint on what they're called?

warm hedge
#

IDK there's something but it must has OM_ prefix

#

Yeah, I know there's sicky arms and legs material in the pbo but I've never seen in-game

verbal rivet
#

Ah, right, prefix + there's "addon" filter in functions viewer, and "Old Man" is selectable

clever radish
#

Does anyone know a easy way to make a shed, which has some crated inside, randomly spawn on helipad1, helipad2 or helipad3?

winter rose
#

a combination of createVehicle, selectRandom and getPosATL should do

verbal rivet
#

If you know how to spawn a shed, you can select a random position by using getPos selectRandom [helipad1, helipad2, helipad3]

clever radish
#

If you know how to spawn a shed, you can select a random position by using getPos selectRandom [helipad1, helipad2, helipad3]
@verbal rivet yes, but the crates inside should not be centered inside the shed

#

For example; I've got a shed, it has some crates below a window and some crates at the door, which is on the other side. I want the crates to stay like that, no matter on which helipad it spawns. I have tried a few methods, but it makes the crates and shed center in XY of the helipad

winter rose
#

if you setPos them at the same position, of course yes
now you can use modelToWorld to set the crate from the shed's position

verbal rivet
#

Or, place your shed/things in editor, calculate difference between current shed position and helipad position using vectorDiff, and then use vectorAdd to add that diff to every object's position (but that supports translation only, not rotation)

clever radish
#

okay, thank you. I will try

winter rose
#

another one 😁

use getPos' alternative syntax:

_shed setPosATL _randomPos;
private _shedDir = random 360;
_shed setDir _shedDir;
_crate setPosATL (_shed getPos [2, _shedDir + 90]); // 2m, relative 90Β°
_crate setDir _shedDir + 15; // if you want a relative 15Β° dir
brave jungle
#

if i remb right, switch do default doesn't require any code right

#

can just do default: {};

astral dawn
winter rose
#

@brave jungle no : after default

#

also, you don't have to remember anything: the wiki is here for that 😁

#

@astral dawn ab - so - lutely!! πŸ‘

brave jungle
#

Ah ty πŸ˜„ and yeah true

#

Not getting a return, needs to return an array.
_selectedSide is a number, 0 to 3 depending on the ID of the side. this gets run through a faction splitter which works perfectly and sorts it all out into sep arrays, but _selectedFaction isn't taking the value of the _sideFactions, side being a side.
_eastFactions is returning the list correctly so I don't get why the simple reassignment isn't working?

_fnc_sideGetFaction = {
  _selectedSide = param [0, [1], [0, 1, 2, 3]];

  _westFactions = [];
  _eastFactions = [];
  _indeFactions = [];
  _civiFactions = [];

  //format each faction into its side
  _fullfac = [] call BIS_fnc_getFactions;
  {
    _value = getNumber (configfile >> "CfgFactionClasses" >> _x >> "side");
    switch (_value) do {
        case (0): {
            _eastFactions pushBack _x;
        };
        case (1): {
            _westFactions pushBack _x;
        };
        case (2): {
            _indeFactions pushBack _x;
        };
        case (3): {
            _civiFactions pushBack _x;
        };
        default {};
    };
  } forEach _fullfac;


  switch (_selectedSide) do {
      case (0): {
        _selectedFaction = _eastFactions;
      };
      case (1): {
        _selectedFaction = _westFactions;
      };
      case (2): {
        _selectedFaction = _indeFactions;
      };
      case (3): {
        _selectedFaction = _civiFactions;
      };
  };

  _selectedFaction
};
warm hedge
#

_selectedFaction is only defined in the cases. You need to define it outside, or make it private I think

brave jungle
#

it is with the rest rig... oh I forgot

warm hedge
#

(I honestly don't understand how private is important πŸ™ƒ )

brave jungle
#

ikr

#

Always the simple stuff haha

winter rose
#

private declares the variable in the scope you use it. if you don't use it, you create the variable in the switch scope, and this scope disappears later

brave jungle
#

It's so you can reference the same variable name in seperate scopes right?

winter rose
#

yep

brave jungle
#

I never use it πŸ˜…

#

Just rename your variables. Problem solved πŸ˜„

warm hedge
#

That's why I don't get when is the time to use it honestly

winter rose
#

@brave jungle that's also why you have undefined variable too πŸ™ƒ

brave jungle
#

hehe

winter rose
#

default behaviour: use private whenever you use a new private variable

#
private _var = 1; // boom - problem solved
brave jungle
#

oof

still forum
#

@robust lichen are you sure you wanted isNull and not isNil?

an object has probablity of not being there
You want isNil.
isNil "mission_2_intel_tablet"
null checks for null type, nil checks for existance. If the object doesn't exist, the variable will not exist.
Also
if (x) then true else false
is nonsense and always the same as just
x
Same as
x isEqualTo true
is just as much nonsense.

Also sorry for being a few hours late :U

winter rose
#

way too late - now gib PiP settings

still forum
#

I can give you pip settings 1.99 build if you want blobcloseenjoy

winter rose
#

oh, you…! ❀️

still forum
#

But only because i have my whole unit on 1.99 internal dev builds and thus already have it laying around derpWolf

winter rose
#

n-not for my beautiful eyes? hurt in my meow meow 😒

unreal scroll
#

There is a condition field for objects in editor. I'm using persistent save/load system, and I need to track if some objects, placed in editor, were destroyed.
Of course, the mission file loads every time on each savegame load, so the placed objects.
Is there any way to store some variables for objects status checking on the mission load, in that condition field?

winter rose
#

I am not sure I got what you mean

#

@unreal scroll ?

unreal scroll
#

I.e., instead of true - server getvariable ["KennyAlive",true] in a object init field. In this case, server initialized after mission load, so for all of the objects placed in editor, it would be true by default.

exotic flax
#

if your server is persistent (set in server.cfg) you should be able to use

_someVar = "test";
missionNamespace setVariable ["some_var", _someVar , true];
// restart server
_someVar = missionNamespace getVariable ["some_var", "some_val"];
#

alternatively, when you want to share data between missions(!) you should even be able to use profileNamespace instead, as long as it's ran on the server

unreal scroll
#

@exotic flax Thanks

clever radish
#

What does it mean, when a Unit cannot be null?

cunning crown
#

That the unit cannot not exist (I guess?)

runic edge
#

hello guys, I'm looking to count the number of players in a given radius. May this nearestObjects [_position, ["player"], _radius];nearestObjects [_position, ["player"], _radius]; work ? (i cant test it rn)

cunning crown
#

I don't think player is a valid type

meager granite
#

@runic edge allPlayers count {_x distance _position < _radius}

runic edge
#

thanks @meager granite you're probably the man for counting players ^^

still forum
#

count (allPlayers inAreaArray [_position, _radiusm _radius])

unreal scroll
#

allPlayers count {_x distance _position < _radius}
Wrong sytax in this example, btw.
Should be {_x distance _position < _radius} count allPlayers

eternal steeple
#

Hello ! Anyone know how to start a direct connection to a server just with a button? I made a script which launches the server browser and which automatically launches the connection but does not work, someone have an idea?

winter rose
still forum
#

I use grad_spotlight I think, its probably on github

eternal steeple
still forum
#

ugh so ugly. Somewhat similar to mine

#

Ah, just as ugly as mine just never scrolled down that far

eternal steeple
#

i have not found grad_spotlight

still forum
#

yaeah that spotlight probably what I'm using

agile anchor
#

I'm trying to open the map mid mission and zoom to a certain area but am having no luck please can someone point out where I'm going wrong unless I'm well off ```openMap [true, false];

this = [markerSize ["Marker_0"] "BIS_areaMarker", markerPos [5206.29,5004.85] "BIS_areaMarker", 1] call BIS_fnc_zoomOnArea; //zoom on the area given by the marker in 1 second.``` thanks

eternal steeple
#

Thanks i go test it

meager granite
winter rose
#

…and code with show script errors enabled

tough abyss
#

What did i have to write in the trigger condition, when the "demoCharge_F" was placed in an vehicle?

still forum
#

"demoCharge_F" in magazinesCargo _x
count thisList

Smth like that, just not typed on phone with wrong syntax and without reading the biki pages for the used commands

#

findIf would be better but I don't wanna type that on phone

tough abyss
#

It should be activate with "alpha" radio call!

#

Thanks!

spice vigil
#

Time for my daily question asking:
while {(speed _pod) > 1} do ( _pod setVectorUp surfaceNormal position _pod );

Am I doing something wrong here?

winter rose
#

yes! next question please

#

while {} do {}, not () πŸ˜‰

#

@spice vigil ^

spice vigil
#

Haha, thanks, it's hard to tell when reading the wiki.

#

honestly, the whole { and ( explains why I kept getting errors for something else i tried, haha.

winter rose
#

do you use show script errors though? it should tell you I believe

mighty vector
#

Here i go again. Why:

grp = [[1731,50,0], WEST, ["LIB_SdKfz124", "LIB_OpelBlitz_Tent_Y_Camo", "LIB_OpelBlitz_Fuel", "LIB_OpelBlitz_Ammo", "LIB_OpelBlitz_Ambulance", "LIB_SdKfz251"],[[0,0,0],[0,-10,0],[0,-20,0],[0,-30,0],[0,-40,0],[0,-50,0]]] call BIS_fnc_spawnGroup; 

sets the formationLeader to second unit? (when the first unit is +1 unit vehicle)
Is doFollow the correct command to make 1st unit to LEAD the group?

spice vigil
#

Yes, I just couldn't understand it because I thought I was putting { but I was accidently putting ( XD

mighty vector
#

are "selectLeader" and "setLeader" the same?

#

same may apply to "formLeader" and "formationLeader"

winter rose
#

@mighty vector does the second vehicle have a gunner/commander, and not the first one?

mighty vector
#

nope.
first is a tank(3), second is a truck(1)

winter rose
#

idk then, maybe because tank driver < truck driver

try in editor to see if the behaviour is the same

mighty vector
#

no, its not.
i think its an issue with BIS_fnc_spawnGroup

#

going to create a few issues.

tough abyss
#

Bros, can someone help me out with spectator? I want to disable the free cam mode. In my mission on Multiplayer screen I have Respawn set to "Disabled" with "Mission fail when everyone dead" and in my onPlayerKilled.sqf I have this:

    diag_log "onPlayerKilled.sqf called";

    sleep 2;
    
    // Terminate the default spectator
    ["Terminate"] call BIS_fnc_EGSpectator;

    sleep 2;
    // Run spectator without free cam

    [
        "Initialize",
        [
            player,
            [east],
            true,
            false
        ]
    ] call BIS_fnc_EGSpectator;

Thing is, in MP when player is killed he's thrown into a spectator with default settings, including free cam. Somehow onPlayerKilled.sqf doesn't get called at all as the "onPlayerKilled.sqf called" doesn't appear in neither server nor client logs.

#

Aside from wasting my life on Czech games, what am I doing wrong?

tough abyss
#

oooookay I thing I got it

#

Respawn = Disabled on Multiplayer screen does not translate into Respawn = "NONE" in the description.ext

#

It seems that it's equivalent to Respawn = "BIRD"

#

And BIRD respawn doesn't call for onPlayerKilled.sqf

#

gonna check it, brb

tough abyss
#

yes

#

but

#

before you run the spectator in onPlayerKIlled.sqf you need to manually disable death blur

#

like this:

BIS_DeathBlur ppEffectAdjust [0.0];
BIS_DeathBlur ppEffectCommit 0.0;

I hope one day BI will be held responsible for all the time people wasted battling Arma lmao.

robust lichen
#

@still forum thank you ill test it here in a moment and see if it works

still forum
#

runs away

robust lichen
#

am i alright to @ you ?

#

it hasnt worked

#

its still not doing anything

#

how would i got about moving the object randomly and checking if its in the trigger

#

instead of using the presence rng

still forum
#

it hasnt worked
what did you actually try?

robust lichen
#

i put isNil "mission_2_intel_tablet" into conditional for the trigger

still forum
#

but you want to check if its not nil right?

#

so !isNil "..."

#

how would i got about moving the object randomly and checking if its in the trigger

if (local this) {this setPos (selectRandom [pos1,pos2,pos3])}
where each pos is a position array

robust lichen
#

randomly as in a probablity the object wont be there at that location, so a % chance its there and a percent change its at 0,0,0

#

and check if its no longer in the trigger

#

instead of completly removing the object on the probablity

still forum
#

think that goes beyond what I can quickly type down in a minute

winter rose
#

didn't we cover that already πŸ€” @robust lichen

robust lichen
#

if (selectRandom > 75) {intelObj setPos [0,0,0]} somethng like this? except limit the rng to 100

#

what you told me didnt function still trying to get something that works

robust lichen
#

so do i need to make an array with every value the RNG chooses from?

crude vigil
robust lichen
#
_ranNum = seed random 100;
if (_ranNum > 75) {intelObj setPos [0,0,0]};

im going to try this but knowing me it might not work lol

crude vigil
#

make sure you check what Dedmen has posted and fix your syntax issues as well.

copper raven
#

ranNum doesn't have to be global there, also^

robust lichen
#

ill make it local

still forum
#

and seed will be a undefined variable

robust lichen
#

yeah noticed lol

#

so i put ```
_ranNum = random [0,50,100];
if (_ranNum > 75) {intelObj setPos [0,0,0]};

still forum
#

and make sure to wrap it in the local check I posted above

crude vigil
#

your if syntax is not correct, that is why.

#

it is not if (_condition) {_code};

robust lichen
#

_local = if (condition) then {code];?

still forum
crude vigil
#

yes, you dont need _local part for this scenario though as you don't do any assignment to it.

still forum
#

thats not what I meant with the local check

robust lichen
#

the local check is this right ```(local this)````

still forum
#

yes

#

if you don't do that, every player that joins your mission in multiplayer will execute your script and randomly set the position, meaning your thing will be teleported around maybe a dozen times

robust lichen
#

what do i do to add both of those as conditional seperations via comas? or does it have to be in like a array

still forum
#

via comas?
no commas

robust lichen
#

oh and it

still forum
#

But don't do that in a single condition, just have two nested if statements

robust lichen
#

okay

#
_ranNum = random [0,50,100];
if (local this) then
{
  if (_ranNum > 75) then
  {
    intelObj setPos [0,0,0];
  }
  else 
  {
    intelObj setPos [2753.08,4460.58,0.440994];
  };
};
``` solike this?
still forum
#

ye, can't see any errors

robust lichen
#

and to check if the obj is in the trigger do i do thisList intelObj;

still forum
#

no

#

thats a syntax error

#

you need a command between variables

#

you want to check if your intelObj is in thisList

robust lichen
#

intelObj getPos [0,0,0];

#

would it be batter to check if its at a position?

#

better

still forum
#

thats not how getPos works

#

and no it wouldn't

#

you'd get floating point accuracy issues

robust lichen
#

fair

#

okay so i need a command between thisList alive intelObj;

still forum
#

A command that makes any sense

#

read the wiki

robust lichen
#

lmao i was sitting here thinking that thisList is the things in the trigger and that saying if the object is alive inside of the trigger it would be true?

#

intelObj in thislist;

#

does this work for objects or only units\

still forum
#

i was sitting here thinking that thisList is the things in the trigger
it is
and that saying if the object is alive inside of the trigger it would be true
Yes that would be, but thats not what you wrote

#

does this work for objects or only units
units are objects
and if you check the in wiki page, you'll read that it works for Anything

robust lichen
#
_ranNum = random [0,50,100];
if (local this) then
{
  if (_ranNum > 75) then
  {
    intelObj setPos [0,0,0];
  }
  else 
  {
    intelObj setPos [2753.08,4460.58,0.440994];
  };
};
``` undefined variable this
still forum
#

where do you put it?

robust lichen
#

init

still forum
#

Yeah, init box of the object

#

this will definitely be defined there

#

its the object that belongs to the init script

#

Actually your "init" wasn't too precise, could be init box, or init script, or init.sqf

robust lichen
#

init.sqf

still forum
#

Yeah no, the init script, on your object that you want to setPos

robust lichen
#

okay

#

so this isnt a defined variable in init.sqf

#

and putting it init box of the obj this is the object correct

still forum
#

ye

robust lichen
#

should i leave _ranNum = random [0,50,100]; in init.sqf or also move it to init box

still forum
#

_ranNum is a local variable

robust lichen
#

thats right it wouldnt be seen by it

#

mk

#

well hasnt given me an error thats a start

quartz pebble
#

https://i.imgur.com/NmVAyr1.jpg
See the fisheye effect on the screenshot?
How can I get rid of it?
It appeared itself after I was watching a soldier failing from high altitude through the BIS spectator. I closed the spectator but the effect has left.

robust lichen
#

!intelObj in thislist; the not operator or do i have to wrap it in ()

hazy trail
#

@quartz pebble, i believe that's radial blur. Go to your video settings to turn it off.

quartz pebble
#

@hazy trail I'll try next time I face that bug

tough abyss
#

Hi, I have a problem where hidden objects become unhidden after a while. I solved it but I can't belive in the solution because it makes no sense. Can someone help me before I start to disbelieve in mathematics?

winter rose
#

no need for maths here

theObject hideObject true; // hides the object
theObject hideObject false; // unhides the object
#

see also hideObjectGlobal

astral anvil
#

This is probably a longshot, but is it possible to add a custom variable to the profile variables from outside the game. Want to add a custom variable to a headless client so it can be read from profilenamespace

#

Nvm actually i can just store it in the hc mod config

tough abyss
#

I did {hideobjectglobal _x} forEach _array

#

everything I need is hidden upon mission start

#

after a while, under load, things start to unhide

#

same script but then in the end I do test = count (_array select {!(ishidden _x)});

#

nothing gets unhidden

winter rose
#

I call armagic then

tough abyss
#

you bet. its driving me nuts cause it makes no sense

cunning crown
#

Welcome to scripting in Arma πŸ˜„

tough abyss
#

every other time I had issues I finally found some stupid thing I was doing or some piece of information that was missing. In this case I've been wondering for weeks

#

so magic exists in Arma, I'll have to live with that

winter rose
#

well, when you talk about "heavy load" of your mission… I can't be but afraid to ask how and why 😐

tough abyss
#

hehe, some group spawning and shitty computer

#

it happens even if just start the mission as zeus and add about 30 groups

spice vigil
#

Okay, I've been trying with setting my vectors all day but I can't get my plane to drop while it's nose still faces the horizon the whole way (rather than being dragged down). Any more scripting suggestions or is this something that might have to be fixed by the model maker?

high horizon
#

Any eventhandler that detects when the unit wants to get out of a vehicle? Getout and Getoutman do not work because it is activated when it has already exited.

jade abyss
#

Could anyone confirm, if ctrlSetChecked on RscCheckBox works?

robust hollow
#

didnt work for me. wiki says
ctrlSetChecked is for CT_CHECKBOXES type 7
while cbSetChecked (which does work), is for CT_CHECKBOX type 77
so i guess its a different command for different types

jade abyss
#

...

#

tested both, both didn't worked, checked code, duplicate IDC i missed before... πŸ˜‘

#

πŸ¦†

robust lichen
#

so ive been trying to get a trigger to set a var true jammerEnabled = true; publicVariable "jammerEnabled";

#

and it seems to not work

robust lichen
#

im trying this instead commsDevice setVariable [jammerEnabled, false];

#

what var space should i use? its a script.sqf

#

the script its runs when the var is set to true and spits info out in chat

#

so im running it and its functioning but when i set it to false by default and try to set it to true through the trigger it dosentspit info out hince its not starting

#

on activation of the trigger it sets the var to true, and an if statment in the script runs the code when the var is true

#

the script runs every 5 seconds

#

trigger condition !alive radio_commsDevice;

#

ah

#

onActivation commsDevice setVariable [jammerEnabled, true];

#

is the varspace the issue?

#

oh i know one sec

#

can i dm you it?

#

too big

misty epoch
#

SQFBin also works

robust lichen
#

okay

#

thank you

#

yeah

#

so

#

im trying to make it start off and turn it on after the triger triggers

robust lichen
#

Thank you dino im testing as we speak

winter rose
#

@robust lichen ```sqf
commsDevice setVariable [jammerEnabled, true]; // WRONG

commsDevice setVariable ["jammerEnabled", true]; // CORRECT

bold timber
#

Where I can get in touch with one maintainer at the CBA (If it's not here) ? I'm having some troubles adding the CBA Disposable Framework to some launchers

glass zinc
#
    //--- Add Large FOBs if available.
    if (CTI_BASE_LARGE_FOB_MAX > 0) then {
        _large_fobs = CTI_P_SideLogic getVariable ["cti_large_fobs", []];
        _upl=if (!( count ((CTI_P_SideJoined) call CTI_CO_FNC_GetSideUpgrades) isEqualTo 0)) then {((CTI_P_SideJoined) call CTI_CO_FNC_GetSideUpgrades) select CTI_UPGRADE_REST} else {0};
        _respawnrangelargefob=CTI_RESPAWN_LARGE_FOB_RANGE+500*_upl;
                    _cti_entities = _x nearEntities[["Man","Car","Motorcycle","Tank","Air","Ship"], CTI_RESPAWN_FOB_SAFE_RANGE];
                    if ({_x countSide _cti_entities > 0} count ([west, east, resistance] - [CTI_P_SideJoined]) < 1) then {_list pushBack _x};
                {if (alive _x && _x distance CTI_DeathPosition <= _respawnrangelargefob) then {_list pushBack _x}} forEach _large_fobs;
    };

can i put 2 if statments beside like that?

winter rose
#

@glass zinc all this code for one if question?

glass zinc
#

i dont know how to explain it any better

winter rose
#

can you simplify and tidy it up please πŸ™ƒ

glass zinc
#

hmm

#

how?

#

the linter throws no errors...

#

but that does not mean it works

winter rose
#
if (condA && condB) then { if (condC && condD) then { "ABCD" } else { "AB!C!D" };
#

it's barely readable… and throws me off :3

cunning crown
#

if ({_x countSide _cti_entities > 0} count ([west, east, resistance] - [CTI_P_SideJoined]) < 1) That's a big condition, too big, move that in variables and compare those variables ^^

glass zinc
#

thats cool i can barely read it either, but thats allways the case when i try and code πŸ˜„

winter rose
#

1/ make it work
2/ make it readable
3/ optimise after
πŸ˜‰

#

making temp variables for readability is OK
code is destined to humans, not machines

warm hedge
#

4/ remake the entire again after years

glass zinc
#

5/ ask yourself what idiot would make it that way in the first place?

winter rose
#

always code as if the reader of your code has a loaded 12 gauge shotgun… and your address

glass zinc
#

well no one taught me to code, im a home build manufacture of private parts grooming products. its very use at own risk

#

is there a guide on how to clean up code somewhere?

#

ill be honest the linter does most of the work

winter rose
#

so, properly indented:```sqf
if (CTI_BASE_LARGE_FOB_MAX > 0) then
{
private _large_fobs = CTI_P_SideLogic getVariable ["cti_large_fobs", []];
private _upl = 0;
if (!( count ((CTI_P_SideJoined) call CTI_CO_FNC_GetSideUpgrades) isEqualTo 0)) then
{
private _sides = (CTI_P_SideJoined) call CTI_CO_FNC_GetSideUpgrades;
_upl = _sides select CTI_UPGRADE_REST;
};
private _respawnrangelargefob = CTI_RESPAWN_LARGE_FOB_RANGE + 500 * _upl;
private _cti_entities = _x nearEntities[["Man","Car","Motorcycle","Tank","Air","Ship"], CTI_RESPAWN_FOB_SAFE_RANGE];
if ({_x countSide _cti_entities > 0} count ([west, east, resistance] - [CTI_P_SideJoined]) < 1) then
{
_list pushBack _x;
};
{
if (alive _x && _x distance CTI_DeathPosition <= _respawnrangelargefob) then
{
_list pushBack _x;
}
} forEach _large_fobs;
};

glass zinc
#

how does proper indenting work?

winter rose
glass zinc
#

kk ill give it a read

winter rose
#

again, note that these are recommendations - the most important thing for your code is that you can read (and understand) it, and that you remain consistent through your indent / code / variable naming

quartz pebble
#

Hi there..

I have an injure/revive script:

_unit setUnconscious true;
_unit switchAction "Default";
....
_unit setUnconscious false;
_unit switchMove "UnconsciousOutProne";

But sometimes (1 times of 50 approximately) AI units stuck to get back to normal functioning. Soldiers lay on the ground and refuse moving.
Any ways to deal with that?

glass zinc
#

maybe add a sleep timer?

#

do you mean they will just stay down?

#

or that they will get stuck during the revive animation?

quartz pebble
#

maybe add a sleep timer?
The revive animation completes, a unit lays down with his hands forward and weapon on the back. It can rotate to a side you point, can open its inventory, but refuses to stand up and/or move.

#

Also ignores scripted commands like move/doMove/commandMove; if you change his animation with switchMove/playMove, the unit accepts the animation but still refuses moving.

glass zinc
#

if you try UnconsciousOutProne in google there seem to be a couple theads dealing with similar issues, dont know if any will help though

still forum
#

@bold timber ACE Slack.

vague geode
#

I would like to use the USS Freedom as an airfield in my warlords mission but there are a few things I need help with:

  1. How do I make it so that you can only call in planes when you only own the carrier sector that can actually land on the carrier?
  2. Can I somehow make the AA ship turrets work fully autometic and can I make them have unlimited ammunition (not unlimited magazine sizes but unlimited magazines)?
  3. I don't want to have a just a normal, "dead" airfield but I living carrier (with deck crew etc.) so is it possible and if so how is it possible to have deck crews man the carrier, repairing, rearming and refueling planes when they come in as well as clear the runway when a plane if about to take off long story short how can I make a fully functional aircraft carrier?

I know that's a lot but thanks in advance for your time and help.

round scroll
#

sounds like a year long project to me

vague geode
#

@round scroll That's my fear...

round scroll
#

feel free to take a look at the ttt_nimitzfunctions for the Nimitz to get an idea how to use switchMove and so forth to get a deck crew launching a plane

winter rose
#
  • there might be functions to populate the USS with crew already
  • you can make the magazines unlimited with event handlers
  • call in plane, that's on you and your conditions - you could also enableSimulation false + hideObject to everything until the conditions are met
vague geode
winter rose
#

maybe BIS_fnc_Carrier01CrewPlayAnim
you can check what the code does in the Functions Viewer in-game

for the turrets… just place them (not empty of course)
they are drones, they will fire on approaching enemies

primal marten
#

Question Hi all, I am trying to fix the issue with Swivel Targets not working in Multiplayer. I have found that the script _target setVariable ["BIS_exitScript", false]; should work but that the advice is to execute this on the client side? How do I do this? Do I simply add this to the Init on each target? Do I need to add the command on the player.init? Advice welcome and thanks in advance!

vague geode
#

@winter rose I don't know how I could place them empty... Do you mean with empty out of ammunition? Also does the USS Freedom have a radar by default or if now (how) could I give it one?

winter rose
#

just place the turrets

#

they will be automated

#

the USS Freedom is one big building, not a vehicle; therefore, no radar
you can share radar detection between UAV turrets though

glass zinc
#

@winter rose thx btw

primal marten
#

@vague geode have you tried the USS Nimitz mod? That is a working carrier.

vague geode
#

@winter rose So I can't add a radar to it appart from placing one on it? Also do the turrents share that information autometically?

winter rose
#

exactly - same as "placing a radar to a house", no sense in it

there is a tickbox in their attributes, they should be enabled by default

vague geode
#

@winter rose I meant placing a AN/MPQ-105 Radar station on deck...

primal marten
#

why do you want the radar?

winter rose
#

turrets should have one already iirc

primal marten
#

You can just use the defence turrets they have their own.

fervent kettle
#

is there a way i can hide/show smoke from the smoke module per script?

surreal peak
#

the smoke particles should be a vehicle if the module which I think you are talking about is fn_moduleEffectsEmitterCreator.sqf so if you execute a nearestObjects command by where you are placing the smoke object, you should be able to hide this

#

@fervent kettle

fervent kettle
#

Its the ModuleEffectsSmoke_F so the one you can place in editor

#

oh and i have tried to do this smoke1_3 hideObjectGlobal true;

winter rose
#

The module itself is invisible; the spawned smokeshell might be accessible by script though

fervent kettle
#

ikr, the question is how can i acces that shell, oh and it is not the smoke grenade module, just the smoke one

winter rose
#

try using getVariable on some "emitter" variable;
see allVariables to get all variables on an object

#
private _allVariables = allVariables smoke1_3; // find the emitter value here

// then either set its drop to 0, or delete it, or anything you want to do
quartz pebble
#

My morning question about stuck AI animations.
I could reproduce it.
AI stucks if it got unconscious while it was healing itself (default arma healing animations were playing). And it unstucks if after reivive you injure it again and order to heal itself.

#

Think it is not about animations, but about AI state machine. It can't do anything if it didn't finish healing.

winter rose
#

aaand what is the question? 😬

primal marten
#

Question Hi all, I am trying to fix the issue with Swivel Targets not working in Multiplayer. I have found that the script _target setVariable ["BIS_exitScript", false]; should work but that the advice is to execute this on the client side? How do I do this? Do I simply add this to the Init on each target? Do I need to add the command on the player.init? Advice welcome and thanks in advance! Posting again as may have got lost with all the Aircraft carrier chat.

winter rose
#

@primal marten where did you see that, and what do you want to do

#

context plz

primal marten
#

I have a MP training area for my unit. The swivel targets dont move as server and client are trying to do that. Indeed that is where I found the solution. Thanks Lou!

winter rose
#

put this in the init field (I can't believe I just wrote that!)```sqf
if (!isServer) then { this setVariable ["BIS_exitScript", false]; };

primal marten
#

what no pretty central script.... sad times πŸ™‚

#

thanks dude thought so but i got all confused

winter rose
#

np, the explanation is not crystal clear either

#

@primal marten it should work, but don't hesitate to come back and say if it doesn't (or if it does, too!)

primal marten
#

will do will try it shortly

glass zinc
#
if (CTI_BASE_LARGE_FOB_MAX > 0) then
{
    private _large_fobs = CTI_P_SideLogic getVariable ["cti_large_fobs", []];
    private _upl = 0;
    if (!( count ((CTI_P_SideJoined) call CTI_CO_FNC_GetSideUpgrades) isEqualTo 0)) then
    {
        ((CTI_P_SideJoined) call CTI_CO_FNC_GetSideUpgrades) select CTI_UPGRADE_REST
    };
    private _respawnrangelargefob = CTI_RESPAWN_LARGE_FOB_RANGE + 500 * _upl;
    private _cti_entities = _x nearEntities[["Man","Car","Motorcycle","Tank","Air","Ship"], CTI_RESPAWN_FOB_SAFE_RANGE];
    if ({_x countSide _cti_entities > 0} count ([west, east, resistance] - [CTI_P_SideJoined]) < 1) then
    {
        _list pushBack _x;
    };
    {
        if (alive _x && _x distance CTI_DeathPosition <= _respawnrangelargefob) then
        {
            _list pushBack _x;
        }
    } forEach _large_fobs;
};

I keep getting the error private _cti_entities = _x nearEntities[["Man","Car","Motorcycle","Tank","Air","Ship"], CTI_RESPAWN_FOB_SAFE_RANGE];
undefined variable in expression _x
what am i not seeing, its also saying _cti_entities is unused, but its used right below it

still forum
#

correct, you never set _x

#

atleast I cannot see that you do

glass zinc
#

hmm ok ill try to figure that out

winter rose
#

also @glass zinc I updated the code I posted earlier:```sqf
private _upl = 0;
if (!( count ((CTI_P_SideJoined) call CTI_CO_FNC_GetSideUpgrades) isEqualTo 0)) then
{
((CTI_P_SideJoined) call CTI_CO_FNC_GetSideUpgrades) select CTI_UPGRADE_REST
};

// becomes
private _upl = 0;
if (!( count ((CTI_P_SideJoined) call CTI_CO_FNC_GetSideUpgrades) isEqualTo 0)) then
{
_upl = ((CTI_P_SideJoined) call CTI_CO_FNC_GetSideUpgrades) select CTI_UPGRADE_REST
};```

glass zinc
#

ok thank you

#
    //--- Add FOBs if available.
    if (CTI_BASE_FOB_MAX > 0) then {
        _fobs = CTI_P_SideLogic getVariable ["cti_fobs", []];
        _up=if (!( count ((CTI_P_SideJoined) call CTI_CO_FNC_GetSideUpgrades) isEqualTo 0)) then {((CTI_P_SideJoined) call CTI_CO_FNC_GetSideUpgrades) select CTI_UPGRADE_REST} else {0};
        _respawnrangefob=CTI_RESPAWN_FOB_RANGE+500*_up;
        {if (alive _x && _x distance CTI_DeathPosition <= _respawnrangefob) then {_list pushBack _x}} forEach _fobs;
    };
``` how come this one works? I have never worked with a magic variable before, and im trying to copy how it was used in the original code
#

i cant seem to see why _x works in this and not in the other

cunning crown
#

I asume this one is "the other"?

    private _cti_entities = _x nearEntities[["Man","Car","Motorcycle","Tank","Air","Ship"], CTI_RESPAWN_FOB_SAFE_RANGE];
    if ({_x countSide _cti_entities > 0} count ([west, east, resistance] - [CTI_P_SideJoined]) < 1) then
    {
        _list pushBack _x;
    };
    {
        if (alive _x && _x distance CTI_DeathPosition <= _respawnrangelargefob) then
        {
            _list pushBack _x;
        }
    } forEach _large_fobs;
#

(It seems it is)
The _x doesn't work here because it's outside of the scope:

systemChat str _x; // Error
{ 
  systemChat str _x; // Works because we are in a code-block that added a magic variable
  call {
    systemChat str _x; // Works, because ONE of the code block above the call has "injected" the magic variable
  }
} forEach [0,1,2];
systemChat str _x; // Doesn't work, because we are not in a block with a magic variable
ornate marsh
#

ok, so getting an error when running this execVM'ing this code:

_caller = _this select 0;
_target = _this select 1;
if ([_caller, 2] call ace_repair_fnc_isEngineer) then
    { 
        [15,
        [_target], 
        {        
            {
                _x setDamage 0;
                systemChat format ["%1 repaired",_x];
            } forEach nearestObjects [_this select 0, ["Air"], 25]
        },
        {},
        "Repairing aircraft..."]
        call ace_common_fnc_progressBar;
    }
    else
    {
    systemChat "Only logistics crew can repair vehicles";
    };

error:

16:26:07 Error in expression <at format ["%1 repaired",_x];
} forEach nearestObjects [_this select 0, ["Air"],>
16:26:07   Error position: <nearestObjects [_this select 0, ["Air"],>
16:26:07   Error 1 elements provided, 3 expected
16:26:07 File C:\Users\User\Documents\Arma 3 - Other Profiles\BenFromTTG\mpmissions\CARRIER%20SIM%20ALTIS.Altis\repair.sqf..., line 11
winter rose
#

why would you use _this select 0 though

ornate marsh
#

used _target and got 0 elements provided

winter rose
#

you are giving Code to ace_common_fnc_progressBar. use its arguments

#

are you sure that [_target] is a proper second argument for it, too?

ornate marsh
#

its from an addAction, so yes

winter rose
#

…sorry what?

ornate marsh
#

_target is one of the params from the addAction, i pass it through the execVM to the script

winter rose
#
params ["_caller", "_target"];
if ([_caller, 2] call ace_repair_fnc_isEngineer) then
{
    [
        15,
        [_target],
        {
            params ["_target"];
            private _objects = nearestObjects [_target, ["Air"], 25];
            {
                _x setDamage 0;
                systemChat format ["%1 repaired", _x];
            } forEach _objects;
        },
        {},
        "Repairing aircraft..."
    ] call ace_common_fnc_progressBar;
}
else
{
    systemChat "Only logistics crew can repair vehicles";
};
```try this maybe?
ornate marsh
#

same error, on the _objects line

winter rose
#

then output _target, because it is wrong

it might be thatsqf params ["_target"]; should be replaced by```sqf
params ["", "", "", "_target"]; // caller, target, id, arguments

#

if target is in the ACE code params, then you don't need to pass it in the arguments

ornate marsh
#

fixed it, just gave the object a variable name and made sure it wasn't called anywhere else

winter rose
#

ah well

quartz pebble
#

If call _vehicle setDammage 0.9 it will most likely explode itself within a minute (checked for tanks). Why?

winter rose
#

*magic*

still forum
#

Well above a certain threshold things explode

#

A tank with such high damage will just have its ammo go off and self destruct

quartz pebble
#

What`s the safe max damage?

winter rose
#

Try (no sarcasm) 0.89?

quartz pebble
#

Checking right now.. It seems the setDammage itself is not the single critical part. setDammage 0; setHitPointDamage ["HitHull", 1] -> boom

#

While setDammage 0.95; setHitpointDamage ["HitHull", 0.85] -> no boom

plain linden
#

odd question. Trying to set task (task1) to Succeeded
task1 setTaskState "Succeeded";
however, it tells me that it was expecting a task

some background, i created the variable task1 via the eden editor, I did not script it

#

figured it out

#

im just stupid lol

oblique arrow
#

What was the problem?

plain linden
#

no quotes im assuming. i did change it

["task1", "SUCCEEDED"] call BIS_fnc_taskSetState;

#

so this may be an odd question, but im learning still

if in the eden editor, i name a squad "squad1"

would i call it as a variable like _squad1

example _marker1 = createMarker ["Marker1", position _squad1];

brave jungle
#

don't need to say odd question everytime πŸ˜…
No you gave it a variable name squad1 so just reference it the same.
using " " implies its a string (to your task question)

#

When using commands, see the wiki to find out what data types the command requires.

plain linden
#

lol my bad. bad habbit saying that.

great, I will try it out as _marker1 = createMarker ["Marker1", position squad1];

brave jungle
#

hah np πŸ˜„

That'll work yes.

tough abyss
#

Hi guys. I really need your help.
I've been trying it endlessly and it's probably something I couldn't figure out.
I'm trying to run a dedicated server which has a server mod, which will be the server side scripting of everything, and a client mod, which will be the mission and the client scripts.

#

Does this design even work ?

#

or do I have to do if(server) all around the "client" mod

#

cause I've been trying to add the servermod with the commandline, it shows loaded, but the initServer and init SQF does not even run

fervent kettle
#

I am trying to set up a cycle wich will basicly heal a unit every "x" seconds

h1 = (_this select 0);

wh = [h1]spawn
{
    while {true} do
    {
        [objNull, h1] call ace_medical_fnc_treatmentAdvanced_fullHealLocal;
        sleep 2.0;
    };
};
#

but guess what, it doenst work

faint kraken
#

how would i remove the addaction from this so i can have it play on start up

#

while {true} do
{
_object = _this select 0;
_caller = _this select 1;
_id = _this select 2;
_object removeaction _id;
[_object,3] call BIS_fnc_dataTerminalAnimate;
sleep 2;
with uiNamespace do {
disableserialization; //thank you so much tankbuster
_object setObjectTexture [0,"images\ee6.ogv"];
1100 cutRsc ["RscMissionScreen","PLAIN"];
_scr = BIS_RscMissionScreen displayCtrl 1100;
_scr ctrlSetPosition [-10,-10,0,0];
_scr ctrlSetText "images\ee6.ogv";

_scr ctrlCommit 0;

};

};

autoplay = 1;
loops = 1;
_closeaction = [[_object,["Close","DataTerminal\CloseTerminal.sqf"]],"addAction",true] call BIS_fnc_MP;

#

so its just open and playing at the start without having to be opened

#

or how would i tell a near by ai to perform the action with a scripted waypoint

winter rose
#

```sqf please (see pinned messages)

faint kraken
#

that is the sqf

#

i dont know how to put it in the box lol sorry

plain linden
#

so is a squad not considered an "object" is it a group? is there a way I can make it be considered a group?

#

_marker1 = ["enemyPos1", position squad1]; _marker1 setMarkerType "mil_objective"; _marker1 setMarkerColor "ColorRed"; _marker1 setMarkerText "Large OPFOR unit";

#

i have pictures of the error if needed

winter rose
#

i dont know how to put it in the box lol sorry
@faint kraken
see pinned messages

faint kraken
#

oh yeah sorry

#

so if the waypoint is placed on the terminal would i just put the script in the on activation part ?

tough abyss
#

help me please 😦

#

I really need a beginners help with making a mod start the init.sqf of him

winter rose
#

@tough abyss no bump rush please πŸ‘€

#

as for your server-side "init.sqf", init.sqf is a mission thing only

#

use CfgFunctions and post-init attribute in your mod

tough abyss
#

Well, I don't want the server "backend" to be exposed to the user

#

so my design is ok right?

#

I just need to know how to initialize it properly and communicate with the client

winter rose
#

if you want a server-side execution of a script in any mission, use CfgFunctions, that's it

tough abyss
#

Ok. Is there an example or somewhere I can read about how to integrate it properly?

fervent kettle
tough abyss
#

so I need to define them in "Config.cpp", yes?