#arma3_scripting

1 messages · Page 633 of 1

little raptor
#

You can't lock a vehicle for just one player (the effect is global)
You might be able to do it using "GetIn" event handler, and throw out the unit if the vehicle is locked. It's not really clean.

exotic flax
#

possible solution: always lock the car (globally) and only unlock when owner calls the unlock script.

little raptor
#

that works too

rancid mulch
#

Or dont unlock at all. Just use moveInXXX commands.

winter rose
#

adding a fake "get in" action is a possibility yes

supple vine
#

I've been trying to find in on BIki but I guess my question is so simple there is no answer there - how to increase one value in an array by given value?

#

I don't want to increase the size of an array, I just want to increase one of the values by 0.1

robust hollow
#
_array set [0,_array#0 + 0.1];```
supple vine
#

thanks, I think also vectorAdd might work

robust hollow
#

yes it would, if the array is a 2d or 3d vector.

fiery orbit
#

quick question about params:
I star with my call being:
private _object = [_stationID,_stationLetter] execVM "returnObject.sqf";
My receiving end isn't receiving the strings
params["_stationID","_stationLetter"];

robust hollow
#

are the two variables defined when you are using them? also execVM wont return the result of the script (presumably an object). you need to use call.

fiery orbit
#

yes they are defined (used hint to check) do the params look good?

robust hollow
#

yes it looks fine. put hint str _this; in the receiving script and see what it says

wild prairie
#

I'm looking to implement a system to allow players to customize already spawned vehicles, like a Virtual Garage-lite. Is there any way to make BIS_fnc_garage work based on an already existing vehicle and not spawn a new one when it's opened? I've already figured out limiting the available options to just the target vehicle, but I need help with making it not spawn a duplicate of it in the same place. I've considered making an entire new system for this, but considering I know jack about GUI manipulation, I figured this'd be faster.

nova shuttle
#

You could use BIS_fnc_addScriptedEventHandler with garageOpened to delete the pre-placed vehicle in order to substitute it with the virtual one, it might take some fiddling to get it smooth but it could work as a hacky work-around

sharp grotto
#

No need to create a New vehicle

topaz field
#

Hi there my addaction works fine. But when I have 1 player there is only 1 addaction. but when I have 2 players in multiplayer there is instead 2 addactions of the same one how can I only make it one

fiery orbit
#

I have a script that is supposed to return an object from within an If statement, how do I make this happen?

nova shuttle
#

@topaz field sounds like it's a localisation/jip issue

fiery orbit
#

so as long as I place the object in the exitWith{} it should return?

nova shuttle
#

yup

tough abyss
#

Idk if this is possible but are we able to use zeus enhanced on public servers as a script?

nova shuttle
#

I'm going to assume no

tough abyss
#

I just set up an I&A server, still building stuff and trying to get more options for zeus to spawn things and edit stuff, but I don't necessarily know how to atm

languid oyster
#

Morning, ladies.
Can't I optimize this

if (isServer && _Simu) then {
    HZ_ServerControllingSettings = true;
    publicVariable "HZ_ServerControllingSettings";
} else {
    HZ_ServerControllingSettings = false;
    publicVariable "HZ_ServerControllingSettings";
};

to this

HZ_ServerControllingSettings = false;
if (isServer && _Simu) then {HZ_ServerControllingSettings = true};
publicVariable "HZ_ServerControllingSettings";

And is this public declaration even necessary?

distant oyster
#

And is this public declaration even necessary?
if you want everyone to know what the value of the variable is then yes. if only the server should know then no.

distant oyster
distant oyster
languid oyster
#

Oh, cool, thank you. Thought a variable without underscore would be public anyway.

cosmic lichen
#

global, not public

languid oyster
#

rgr

#

is the double underscore a typo? Does it do any harm?

__cleanup_loop = [] spawn HZ_fnc_Cleanup;
winter rose
#

most likely a typo, yet no harm done

#

(as long as it's named the same everywhere - underscores included)

languid oyster
#

Roger, thanks

cosmic lichen
tough abyss
cosmic lichen
tough abyss
#

Is this able to be put into the mission file via SQF?

#

Or without adding CBA or anything, as base zeus stuff is pretty bland

cosmic lichen
#

Read the documentation, I don't know

cosmic lichen
#
_logo = if (configSourceMod _x == '') then {[""]} else {modParams [configSourceMod  _x,["logoSmall"]]};
_logo = _logo # 0;

is there a nice way to do this?

winter rose
#

select?

#
private _logo = if (configSourceMod _x == '') then
{
  ""
} else {
  modParams [configSourceMod  _x,["logoSmall"]] select 0;
};

// or
private _logo = "";
if (configSourceMod _x != '') then
{
  _logo = modParams [configSourceMod  _x,["logoSmall"]] select 0;
};
```@cosmic lichen
rancid mulch
#

what's nice?
One line? remove array in if case, select 0 in else
Optimized? isEqualTo? 'cache' configSourceMod?

winter rose
#

nice is nice! la la, la lala 🎵

cosmic lichen
#

Forget about it. Looks even worse than mine 😄

#

modParams command is so annoying since it spams rpt if mod name is ""

winter rose
#

Muh! :<

compact maple
#

hi!
I dont remember how can I define a variable in one line with conditions

#

it should be something like

a = condition : if true ? if false
still forum
#

a = if condition then {true} else {false}

compact maple
#

thanks!

sharp grotto
#

Working on arma and giving Support on discord. Dont get burned out dedmen thonk

distant oyster
compact maple
#

didn't know this format

compact maple
#

If I set a variable using setVariable on a display, once the display is closed, the variable is instantly set to nil too ?

robust hollow
#

basically, yes

winter rose
#

its namespace gets deleted, and all its variables with it @compact maple

compact maple
#

okay ! 🙂

tough abyss
#

So I know this must sound extremely simple, but I want to put a link through a billboard I have that can get people to automatically join our discord, anyone able to help quick?

finite sail
#

sounds simple when you say it like that

tough abyss
#

Yeah but things like that are never simple are they XD

finite sail
#

never, there is this command, but its only in dev build at the moment

tough abyss
#

hm

finite sail
#

it doesnt do quite what you want though

oblique arrow
#

I've been looking for a way to open a URL through arma aswell but dont think I found anything good last time I looked

finite sail
#

you want the billboard to make the link, presumably the billboard has an image that says 'click here to join our discord

distant oyster
#

addaction takes structured text so as a title
"<a href='http://arma3.com'>Arma 3</a>" could work

winter rose
#

I doubt it, but I am curious now thonk

distant oyster
#

emphasis on "could" 😄

spark turret
#

biki is dead send help

distant oyster
#

yep just wanted to fix something on the addAction page

finite sail
#

i downloaded an offline copy just yesterday

oblique arrow
finite sail
#

yes. that, Lou 🙂

winter rose
#

You have great taste.

finite sail
#

i do

#

forums are offline too

#

Is it hosted elsewhere?

spark turret
#

it was online for a second, dead agaimn now

winter rose
finite sail
#

me too

#

opens NAT

#

posts home ip

#

wonders why ISP are on the phone

winter rose
finite sail
#

and here

still forum
#

tries to publish profiling
internet problems parrotexplode

little raptor
#

😏

winter rose
finite sail
#

hehe

spark turret
#

biki fix when 😠

#

dedmen pls figgs

still forum
#

Quite sure IT is on it

finite sail
#

is there any chance we can get an offline FNCref, Lou?

#

i use functions as much as commands

spark turret
#

its not really down, rather at internet speed of 1997

finite sail
#

biki working again

#

everyone, log on a break it

spark turret
#

d❤️dmen

finite sail
#

by using it too much

willow hound
tough abyss
#

Holy shit you right

finite sail
#

yes, QR codes is s funky solution

#

Im making YT vids linked from QR codes that I will show in mission

#

as a video briefing

spark turret
#

TMKY: if you try to create a marker with the same name again, it will silently fail without logging.

still forum
#

Glad I could help

winter rose
#

In Soviet Russia, The More Know You

finite sail
#

The marker name has to be unique, if a marker with the given name exists, the command will be ignored.

spark turret
#

i dont read docu

#

real programmers just try n error until it works

finite sail
#

yep

spark turret
#

does ace simulate complicated stuff for sound traveltime like temperature etc ?

worn forge
#

Quick note re allMapMarkers, and I'm wondering if other coders are seeing the same thing;
_userMarkers = allMapMarkers select {_x find "_USER_DEFINED" > -1};
This script will return an array of user-placed markers. However, when the server runs the command, it gets far fewer markers than when the player runs the command. Is this intended behaviour?

finite sail
#

i do use that, let me check

#

I only use it on the server and it always gets what I expect

#

ive never noticed any problems

winter rose
#

some markers are local maybe? (e.g createMarkerLocal)

worn forge
#

hmm - how much load is your server under? Ie., how many players are dropping markers

finite sail
#

all my markers are global, might be relevent

worn forge
#

These are all standard vanilla markers placed by players on the map (you know, double click on the map)

finite sail
#

its rarely under big load, Ryko

worn forge
#

I'm looking at 40-60 players

finite sail
#

lol, i wish i could see that many

#

the channel selected when marker placed is going to be the thing here?

worn forge
#

So my intended behaviour is to have markers placed in sideChannel to fade away gradually over time; in the end I've pushed the functionality to the client rather than the server, side effect is one less thing the server has to do

#

But I do have to do a complicated dance to ensure the player gets their direct play id so they can find markers they have placed, as I don't think there's a command which picks that up

finite sail
#

there are new marker related commands coming iirc

worn forge
#

Yeah, there's a command which segregates markers by channel, but I can already do that by parsing out the text of the marker name

#

If there's a further command that associates ownership of a marker with a UID that'd be golden, but it's all for naught if the server isn't detecting the same number of markers as the client

finite sail
#

is the discrepancy in server / client marker counts only happen with user markers? or does it happen with mission created ones?

#

done a few quick tests.....i can't recreate the problem, count of user markers is the same on both server and client

#

but makers all placed in global channel

worn forge
#

I've only been checking user created markers

finite sail
#

mmm, i only check user created markers server side

#

not sure i can help much

spark turret
#

do i have to kill coroutines after i spawned them?

#

i noticed my script seems to hurt performance in the long run

winter rose
#

depends on what they do really

spark turret
#

most do some simple thing but delayed

winter rose
#

the script is ended when it reaches code's end, no need to "free the memory"

spark turret
#

alright thats what i wanted to know, thanks (y)

hot kernel
#

How can I format a debug message to show the params and name of the called function?

you_fnc_debug=
{    params [["_arr", [], []], ["_fnc", "you_fnc_debug", []]];
systemChat format ["%1 call %2", _arr, _fnc]
};

if each function has a line like,

if (missionNameSpace getVariable "you_debug") then { [params, function name] call you_fnc_debug}

How do I reference the params array?
Or is there just a better method to get this information?

little raptor
#

_this for params

#

if you defined the code as a function, you could also use:
_fnc_scriptName to get the function name

#

the latter requires being defined in cfgFunctions

formal brook
#

So Im trying to make it so the Artillery bombards the Enemy posistion then the Infantry will charge, The problem is, How do I get the Artillery to cease fire after a certain amount of time?

hot kernel
#

@little raptor ,
that's great, thanks so much!
the functions are defined in config and that will work perfectly!

formal brook
#

Is there any way to make the Artillery cease fire and consider the waypoint complete?

little raptor
#

@formal brook for firing, doArtilleryFire
to stop, maybe doArtilleryFire at a position too far (like [-1e20,-1e20,-1e20])?

formal brook
#

Im using the Fire mission waypoint

little raptor
#

does clearing the waypoint help?

#

I've never used the waypoint variant so I'm not sure

willow hound
#

Probably not

#

I suggest ditching the waypoint, it'll be much easier

little raptor
#

This waypoint, or the squad's ammo, may have to be modified/deleted via script in order for the squad to cease fire.

#

maybe it does work, if that's to be taken as true

willow hound
#

Yeees but we still need to get sleep or waitUntil incorporated, that'll be easier if the whole act is done via script

formal brook
#

So there is no way to do it via waypoint?

#

I just need help understanding the waypoint timer tool.

willow hound
#

You see @formal brook, usually what I would do is write a script like this and execute it (we can tell you how):

while {time < STOP_ARTILLERY_FIRE_TIME} do {
  MyArtilleryUnit doArtilleryFire [ENEMY_POS, currentMagazine MyArtilleryUnit, 10];
  sleep 10;
};
```That is because editor modules and waypoints are often hard to bend to one's will - they can barely offer more than basic functionality.
hot kernel
#

is there a better way to call a debug message like above? Instead of calling it through each function could I intercept this information as it is sent for execution?

willow hound
#

I vote not possible...

still forum
#

no

#

But you can probably just run a real debugger and just set a breakpoint

#

maybe I need to make a tutorial on how to get the debugger going...

willow hound
#

systemChat and educated guesswork all the way

winter rose
#

hint "plop" 😄

hot kernel
#

@still forum ,
so I'll call it a "call monitor"? I don't mean to misappropriate terms but you can see what I want it to do

still forum
#

I think that might be right term yea

#

how do you compile your functions?

#

you can also just add a custom header to all your functions that just dumps on call

little raptor
#

Notepad++ search and replace in multiple files!

hot kernel
#

the functions are defined as configs

still forum
#

none of these do logging....
I guess _headerLogScriptMap logs the call/callstack.
But I think textLogFormat is internal-only command

#

sadly doesn't let you set a custom header

willow hound
#

Is there documentation on that? First time I see that stuff

still forum
#

probably not

hot kernel
#

thanks, it's a kinda gimmicky idea anyway-- but that's what I do!

still forum
#

write faster plox hyped

oblique arrow
#

👀 BIS gotta stop letting Dedmen get into the cocaine stash

minor tulip
#

Anyone know how to make a module repeat over time without using a trigger? Maybe in the init?

willow hound
#

Either way, if you're trying to avoid putting your code

if (missionNameSpace getVariable "you_debug") then { [params, function name] call you_fnc_debug};
```into every function, you could try writing a wrapper function for `call` / `spawn`:
```sqf
params ["_args", "_function", "_debugFlag"];
if (_debugFlag) then {
  systemChat format ["%1 call %2", _args, _function];
};
_args call _function;
```Something like this, probably won't work exactly like this because `call` expects code, but you get the idea. Then you can change the way you invoke functions that you want to log:
```sqf
[[ARG1, ARG2, ...], ME_fnc_someFunction, true] spawn MyWrapperFnc;
still forum
#

which module

little raptor
#

also repeat what?

still forum
#

@willow hound params missing quotes

minor tulip
#

TF Snow Storm. Basically it will have snow for a set period and thats it. I'd like it to repeat itself over time.

still forum
#

every module uses a script in the backend

#

its probably easier to run that script manually, rather than going through the module

minor tulip
#

Good call @still forum . Thanks for the pointer. I'll give that a shot.

graceful kelp
#

hello i have an issue were im trying to get radar missiles to be able to lock and fire on dead targets because evan though its dead it shoudl still be lockable
unfortunately the only way of doing it i know of is https://community.bistudio.com/wiki/setMissileTargetPos which requires manual control is there another way of doing this im not seeing

willow hound
#

Could try creating a dummy target on the dead target's position and use that for setMissileTarget.

idle jungle
#

Hello again all

Addaction question

How do i limit the distance for people to access it.

"_this distance _target < 2"

Is that right so if over 2m then it won't appear

If yes can someone show me how or where to put this code in an example addaction in a remote exec that target is 2

#

this addAction ["Enter", {player setPosASL (getPosASL S1)},nil,1.5,true,true,"","_this distance _target < 2"]; think i got it now not to worry:)

winter rose
#

@idle jungle ooor use the radius argument

idle jungle
#

Whats a radius argument

winter rose
willow hound
#

Read the documentation aaaaaaaaah

smoky verge
#

hey any reason a script would work in singleplayer and local hosted but not on a dedicated server? I'd post it here but its like 36k lines

winter rose
#

plenty of reasons yes

#

don't post it, but do tell how it is started

crude needle
#

36k line file meowsweats

idle jungle
#

I have a script with 570,000 lol!

winter rose
#

smells like refactoring

idle jungle
#

Spawns in a whole mission

#

Waypoints units etc

smoky verge
#

same

#

I'm posting a pastebin
its kind of just the same script played 36k times

winter rose
#

not - needed

#

don't post it, but do tell how it is started

smoky verge
#
_newObject = createSimpleObject ['Land_DistrictWall_Straight', [1482.52,1956.62,12.1676]];
 _newObject setPosWorld [1482.52,1955.36,46.0151];
 [_newObject, [[-1,1.19249e-008,0], [0,0,1]]] remoteExecCall ["setVectorDirAndUp", 0, _newObject];

basically a line like this but for 36k times and this at the end

    {
        _x enableSimulation true;
    } forEach (getMissionLayerEntities "Enemies" select 0);
winter rose
#

and how is it called?

smoky verge
#

nul = [] execVM "script.sqf"

#

via console

winter rose
#

and when you are on dedi, this console execution doesn't work?

idle jungle
#

this addAction ["Enter", {player setPosASL (getPosASL S1)},this select 3 _this distance _target < 2];

Is that it?

winter rose
#

can you test in solo, but not from the editor?

smoky verge
#

as a single player scenario?

willow hound
#

How much of the documentation did you read? Example 5 shows the radius argument being used correctly.

winter rose
idle jungle
little raptor
#

this select 3 _this distance _target < 2
what's this?!

#

what argument stands for
it refers to any parameter you provide to the commands

idle jungle
#

I dunno 😭

#

I'm just gonna give up i really can't get the grips of it

little raptor
#

I think you may have skipped a lot of stuff and now you're confused

idle jungle
#

I'm really really trying

little raptor
#

and sqf syntax?

idle jungle
#

I kinda just dived into it and learnt what I know from examples

#

Thats probably the issue lol

little raptor
#

yeah

idle jungle
#

I apologise if I'm causing people headaches

little raptor
#

anyway, if you're referring to the "arguments" part of addAction, look at its code

#

params ["_target", "_caller", "_actionId", "_arguments"];

smoky verge
little raptor
#

whatever you put there will be later available in the code (in the 4th param, aka _this#3)

winter rose
#

from the attributes, otherwise description.ext @smoky verge

willow hound
idle jungle
#

Yeah the radius bit then someone said i could do radius in an argument that's where I got confused

#

Otherwise I will stick with the nil,true,true,1.5,"",2 (radius bit)

smoky verge
open flume
#

is there a script to make preplaced AI spawn via a trigger when players enter it
?

willow hound
#

Chances are its disabled in description.ext then, that overrides the editor settings.

idle jungle
#

@open flume I use fen a3 mod

#

Also eden 2.0 has that feature

exotic flax
open flume
#

@idle jungle ty

willow hound
#

@idle jungle The code you're looking for is something like this:

this addAction ["Enter", {player setPosASL (getPosASL S1)}, nil, 1.5, true, true, "", "true", 2];
```That `2` at the end is the radius.
idle jungle
#

Ah I missed a true out in my version woooops lol

willow hound
#

You're welcome. Don't forget to practice with the documentation, it answers many questions!

idle jungle
#

I will mate I will start at the beginning instead of skipping like I did

#

I think there maybe some videos I can watch also

smoky verge
#

@winter rose ok managed to play it in a singleplayer scenario outside of eden and it worked
so I'm not sure whats up with the dedicated server one

cosmic lichen
#

Maybe a stupid question but is there a counterpart toappend ? Like _arrayNew = array1 - array2; without returning a new array?

crude needle
#

@smoky verge
Did you use allSimpleObjects on the dedicated server to make sure the objects actually weren't created?

May or may not be the issue, but you should change
[_newObject, [[-1,1.19249e-008,0], [0,0,1]]] remoteExecCall ["setVectorDirAndUp", 0, _newObject];
to
[_newObject, [[-1,1.19249e-008,0], [0,0,1]]] remoteExecCall ["setVectorDirAndUp", _newObject];
as it executes that on all machines otherwise.

cosmic lichen
#

Guess a - b is faster then

smoky verge
#

@crude needle the general idea is that it plays it on every player locally but not on the server
also don't think I've used allsimpleObjects

crude needle
#

That's just gonna multiply the objects every time you run that script on a player. createSimpleObject already creates one for everyone to see.

smoky verge
#

oh alright
could this fix the dedicated server problem?

crude needle
#

Honestly can't say for sure. Definitely helps the network and player performance.

The objects in theory should've still shown up on the dedicated server and that's why my money is on the setVectorDirAndUp being the issue since when you run object manipulations like that in quick succession from multiple machines, things have a tendency to teleport to [0,0,0].

smoky verge
#

oh actually running the script on a trigger worked

but still gonna fix that code

#

thanks

smoky verge
#

@crude needle sorry to bother, a friend suggested I used this at the beginning of the script

if(!local) exitWith {};

to do it only locally for every player
but it gives me an "unexpected )" error that way

cosmic lichen
#

local WHAT

#

🙂

crude needle
#

Yeah, needs something to test against.

cosmic lichen
smoky verge
#

notlikemeowcry don't shoot the messanger I didn't come up with that

crude needle
#

Just to be clear, your goal is to create these objects for everyone and do nothing else with them, correct?

smoky verge
#

I'm trying to play this script, which creates a lot of simple objects, but not on the server, I want it locally on the players machines so it doesn't destroy the server CPU causing desync and other problems.
from whats in that biki page I guess I need to put something after !local, but what?

crude needle
#

No.

#

createSimpleObject will always sync across the network since it has a global effect. You can't get around that.

smoky verge
#

oh I see, @still forum suggested this

do local only simple object and run script on every client
now I'm not sure what he meant by that

crude needle
#

As far as I know, there isn't a local only simple object command, just regular objects.

#

Wait,

#

There is a local flag.

#

createSimpleObject [className, positionASL, local]

#

So just add true where local is.

smoky verge
#

so referencing from that initial script I posted

_newObject = createSimpleObject ['Land_DistrictWall_Straight', [1482.52,1956.62,12.1676], true];
 _newObject setPosWorld [1482.52,1955.36,46.0151];
 [_newObject, [[-1,1.19249e-008,0], [0,0,1]]] remoteExecCall ["setVectorDirAndUp", _newObject];

it should be something like this?

crude needle
#

Exactly.

smoky verge
#

do I just scratch the if (!local) part?

crude needle
#

Yeah, no need for it.

smoky verge
#

it kinda scares me to run something so big locally but I guess if there is no JIP there should be no downside to this?
could it cause desync on the players computers?

crude needle
#

The only thing I would be curious about is setPosWorld since it definitely has a global effect. Not sure how other players will handle that or if they would get a message, though I'd imagine there are things in place for objects being marked as local only as to not send that message across the network.

#

Shouldn't be an issue otherwise.

smoky verge
#

a message?

crude needle
#

Just a message that tells everyone to set that object to that position.

smoky verge
#

not sure honestly
tried to reverse engineer a script meant to mass spawn objects with createVehicle
so the setPosWorld may be redundant?
but the values seem different so no clue

crude needle
#

Could be redundant. Don't know what the one in createSimpleObject is based off of (ASL, AGL, ATL, etc.) but they are likely the same since the positionWorld only has it's z axis changed.

smoky verge
#

yet you can see a difference in the y and z axis

#

also is there something I can do on the server management to help run this script better?

crude needle
#

On the map for this mission, type this into the debug console:

AGLToASL [1482.52,1955.36,46.0151] 

and see if it comes out as the other one in createSimpleObject

smoky verge
#

gives me this
[1482.52,1955.36,45.9612]
different from
[1482.52,1956.62,12.1676]

crude needle
crude needle
smoky verge
#

yeah the number of people is my main concern
hard to test a mission meant for 30+ people

crude needle
#

I'd imagine that since you are creating objects in the thousands here, if it were going to cause issues with 30+ it would be noticeable if even just one other person were present.

smoky verge
#

mhm, could be true
so, not sure what caused it, if the local or the setVectorDurandUp fix you told me
but now all the simple objects have 0 dir

crude needle
#

On dedicated?

smoky verge
#

yeah

crude needle
#

Is the trigger local?

smoky verge
#

don't think so
used radio alpha

smoky verge
crude needle
#

If it's editor placed, put that in the onActivation field to be sure it doesn't run on the server.

if (!isDedicated) then {
/*code*/
};
smoky verge
#

you think could that cause the 0 dir?

crude needle
#

Probably not, but it keeps the server from running that script just in case.

smoky verge
#

the activation should look like this right?
if (!isDedicated) then {
nul = [] execVM "script.sqf"
};

crude needle
#

Yep.

smoky verge
#

huh apparently it was the true that brokes the direction
why would locality do that?

crude needle
#

Could be the use of remoteExecCall on a local only object.

smoky verge
#

or not nevermind
its very confusing
its like only when both the _newobject fix and the local = true are not used it works

crude needle
#

Try clientOwner instead of _newobject.

#

On the right of the remoteExecCall I mean.

crude needle
#

@smoky verge Tested it with createVehicleLocal, doesn't look like you can remoteExec (at least setVectorDirAndUp) onto a local only object, gonna test it with createSimpleObject.

smoky verge
#

sorry if I haven't replied but been making tests mixing combinations
it seems to work at random, so confusing

#

if I either add the true or the _newobject fix, or both, it breaks the direction, I'll try that clientOwner thing

crude needle
#

Doesn't work with createSimpleObject on local mode either.
So it would appear that you need to remove the remote execution from setVectorDirAndUp.

smoky verge
#

and what should I put in its place?

crude needle
#
[_newObject, [[-1,1.19249e-008,0], [0,0,1]]] remoteExecCall ["setVectorDirAndUp", _newObject];

to

_newObject setVectorDirAndUp [[-1,1.19249e-008,0], [0,0,1]];
smoky verge
#

mhm ok let me try

#

bit hard to doo when there are so many lines, even with the replace function

crude needle
#

Yeah. Gonna take some voodoo to do it.

smoky verge
#

ok made it
it didn't break but I'm not sure if it optimized anything
I still haven't added the true for the locality

torpid quartz
#
_allSpawnPos = [[4783.464,6112.624,3.453],[4728.515,6154.601,4.023]];
_randomPos = selectRandom _allSpawnPos;
CP1 setPos _randomPos; 

any idea why this would be giving me the error
On Activiation: local variable in global space

It's just in the "On activation" part of a trigger.

silk ravine
#

Is hintC entirely broken?

smoky verge
#

ok @crude needle the true worked too
I forgot why I was making all this in the first place

crude needle
smoky verge
#

yeah I'll test it on the server, thanks for the time

torpid quartz
#

i used this code just a day or two ago for something else and it worked fine so i'm not quite sure what's gone wrong lol

crude needle
crude needle
torpid quartz
#

i'll do that in a sec

silk ravine
#

@crude needle It doesn't show.
Its called via init.sqf execVM within isDedicated condition
followed by a (player getVariable ["isSurvivor", false]) then condition.
command is structured like in wiki example.
In Ticket T123800 in 2017 reported broken. Reported fixed in 2019.

#
if (player getVariable ["isSurvivor", false]) then {
    hintC format [ 
        "TEXT1<br/>
        TEXT2<br/>",
        "TEXT3<br/>
        TEXT4" 
    ];
    hintC_arr_EH = findDisplay 72 displayAddEventHandler ["unload", {
        0 = _this spawn {
            _this select 0 displayRemoveEventHandler ["unload", hintC_arr_EH];
            hintSilent "";
        };
    }];
};
crude needle
#

Thanks.

silk ravine
#

above code is called from init.sqf via execVM, as said above

crude needle
#

What does the isDedicated bit look like?

silk ravine
#

"isSurvivor" is assigned to the playable unit init field

#
if (!isDedicated) then {

    waitUntil {!(isNull player)}; //JIP proofing

    execVM "startHintSurvivors.sqf";

};
crude needle
#

Try sleeping 0.5 just before the hintC.

silk ravine
#

within the if condition or before?

crude needle
#

Within.

#

If that doesn't work, use a systemChat or something to make sure you're getting past the condition.

silk ravine
#

condition doesn't fire

#

this is within the player init _this setVariable ["isSurvivor", true];

crude needle
#

_this would be an array, not the player.

silk ravine
#

So the right place would be playerInitLocal using _player?

#

or would this suffice instead of _this

crude needle
silk ravine
#

dude

#

this fixed it

#

what the hell

crude needle
#

Interesting. 🤷‍♂️

silk ravine
#

One day SQF will put me in a coffin, I swear

#

@crude needle also you were right about sleep

#

sleep 0.1 suffices for hintC to load

#

weird as fuck

crude needle
#

Cool.

torpid quartz
#

From the mission that works (with mods)
_allSpawnPos = [ [3708.646,4151.678,1.712],[3714.204,4192.589,2.384],[3710.093,4243.225,0.232]]; 
_randomPos = selectRandom _allSpawnPos;
CP1 setPos _randomPos;

With no mods at all, doesn't work
_allSpawnPos = [[4783.464,6112.624,3.453],[4728.515,6154.601,4.023]];
_randomPos = selectRandom _allSpawnPos;
CP1 setPos _randomPos; ```
#

weird

little raptor
little raptor
#

And what you wrote has nothing to do with mods

languid oyster
#

Is there an easy way to align text in a formatted text correctly? Like so
from this

bla1: blablabla
blablabla: blablabla
bla: blabla bla

to this

bla1:        blablabla
blablabla:   blablabla
bla:         blabla bla
little raptor
#

Is that a gonna be used in a control

#

If so, why not use two separate controls?

#

anyway, I don't think there's an "easy" way.
you can use something like:

_spaces = ":   ";
_leftSides = ["bla1" + _spaces , "blablabla" + _spaces , "bla" + _spaces];
_widths = _leftSides apply {_x getTextWidth ["font", 0.1]};
_widths sort false;
_longest = _widths#0;
_spaceW = " " getTextWidth ["font", 0.1];
{
  _dw = round ((_longest - (_x getTextWidth ["font", 0.1]))/_spaceW);
  _txt = [];
  _txt resize _dw;
  _leftSides set [_forEachIndex, (_txt apply {""}) joinString " "];
} forEach _leftSides;

maybe there's a better way. that's just what I thought of right now

#

what this does (or is supposed to do, bcuz not tested) is that it adds spaces to texts that are shorter than the text with maximum length

It can be made a lot easier if you use a font with uniform character spacing (e.g. EtelkaMonospacePro, or maybe PuristaMedium but not sure about that one)

winter rose
#

str_pad 🙂

#

(no, not a thing in SQF)

languid oyster
#

@little raptor omg, I asked for an EASY way 😅. But many thanks for your solution.

little raptor
#

@languid oyster that's the thing. there's no easy way
as I mentioned it can be made easier if you use a font with uniform character spacing

#

That code is using a more general approach

scarlet rain
#

hiho all - I am stuck with an issue and I believe the issue is connected with publicVariable: The client places an _object via script. the information about the _object is sent to the server (information is stored into a DB, this works well). Same time the server should now setVehicleVarName the _object vehicleVarName and send that information to all clients. This works on Hosted MP but not on a dedicated Server. This is the code i execute server sided to update the _object vehicleVarName:_ojectVN = MyObjectVarName123; _object setVehicleVarName str _objectVN; _objectVN = _object; publicVariable str _objectVN;. The objects vehicleVarName is stored correctly on the DB, but for the clients, the object would still return "" when checking the vehicleVarName (vehicleVarName cursorobject). What am I missing XD? Any help or direction is appreciated.

little raptor
#

@languid oyster one more thing you can try (but it may not work) is define two texts, one with left alignment and one with right alignment.

languid oyster
#

@little raptor Will try it. Let's see, if I can do some Word worksheet with SQF ^^

winter rose
#

_ojectVN @scarlet rain ?

#

_ojectVN = MyObjectVarName123; no quotes?

scarlet rain
#

no quotes yeah, i am using it in connection with inidbi2 and in some instances i need the information without str

#

so my base variable is without quotes

#

and i add str where needed in the scripts

winter rose
#

I don't think it does what you think it does

scarlet rain
#

i was afraid that would be the case 🙂

winter rose
#

str hello will not return "hello"

little raptor
#

But he's using setVehicleVarName

#

so str _object does return the varname

winter rose
#

if it has one

#
_ojectVN = MyObjectVarName123; 
_object setVehicleVarName str _objectVN;
_objectVN = _object;
publicVariable str _objectVN;
#

here, _object doesn't have a vehicle var name
because _o(b?)jectVN doesn't have one

scarlet rain
#

so str _objectVN will not return "MyObjectVarName123"

little raptor
#

Since it is possible to setVehicleVarName individually on each PC, the value of vehicleVarName returned will be local to the PC on which command is executed.

scarlet rain
#

sh*t, i thought i had tested that and figured it did

winter rose
#

also, why do you want to broadcast a vehiclevarname? only the varname would be enough no?

little raptor
#

yeah good point

#

I don't see why you'd need the vehicle var name

winter rose
#
MyObjectVarName123 = _object;
publicVariable "MyObjectVarName123";
```no bs, all clean
scarlet rain
#

riight maybe i was overcomplicating stuff and therefore breaking it 🙂 thank you guys - let me rewrite the larger scripts behind this with the above. will report back in with results

#

much appreciated!

winter rose
#

good luck!

still forum
cosmic lichen
still forum
#

"getTextWidth" ahhh, missing unicode support and missing optimization stuff

cosmic lichen
#

I just have to repost it 😄

#

It fits so nicely

little raptor
#

missing unicode support
even with forceUnicode?

winter rose
#

quick! release a v2.00 hotfix with everything in devbranch this afternoon! 😄

still forum
scarlet rain
#

Hi again! I cant wrap my head around how i can replace setVehicleVarName with the above suggestion and while I appreciate that I might have gotten some basics wrong here, I might not have explained well enough what I am trying to do.
Hence i will provide a detailed explanation of my code / feature below:
Sorry for the wall of code but hopefully this helps to explain why i believe that i would need to use setVehicleVarName/vehicleVarName to name and identify my object.

Generally this whole feature works well except that I want this vehicleVarName of the recently placed object to be instantly broadcasted to all clients.
So all clients should get the same information whan checking for vehicleVarName _object

right now, on hosted MP, if player "A" places an object he will be able to interact with the object and remove/update it in the database because player == server here and the player knows what the server knows. In that case the vehicleVarName of that object.
on Dedi the whole feature fails as the player != server and does not know what vehicleVarName the server created for the object. This could be fixed for player "A", who placed the object by setVehicleVarName to update the objects vehicleVarName localy within the placement script.

However, other clients (player "B", player "C") do not know about the objects vehicleVarName.

#
///////////
//client side
_objectCN = "Land_VR_CoverObject_01_kneel_F";
_object = _objectCN createvehicle getposatl player; //player places object
_pos = getposatl _object;
_dir = getdir _object;
_vectorDir = vectorDir _object;
_vectorUp = vectorUp _object; //gather placement info of object

_objectVN = formatText ["OB%1%2%3%4%5%6", _crateCN,floor (random 9),floor (random 9),floor time,selectrandom ["a","b","c","d","e","f"],selectrandom ["a","b","c","d","e","f"]]; //create unique identifier for DB storage and later loading from DB

saveDataObjects = [_objectVN,_objectCN,_pos,_dir,_vectorDir,_vectorUp,_object];
publicVariableServer "saveDataObjects";

///////////
//server side
"saveDataObjects" addPublicVariableEventHandler
{
private ["_data"];
_data = (_this select 1);
_objectVN = (_data select 0);
_objectCN = (_data select 1);
_pos = (_data select 2);
_dir = (_data select 3);
_vectorDir = (_data select 4);
_vectorUp = (_data select 5);
_object =  (_data select 6);


_object setVehicleVarName str _objectVN; //this will apply my custom/unique var name to the placed object


_inidbi = ["new","Objects"] call OO_INIDBI;
["write",[str str _objectVN,"Array",[str _objectVN,_objectCN,_pos,_dir,_vectorDir,_vectorUp]]] call _inidbi; //writing info into DB

/////
//this here should inform all clients about the objects new variable name.
_objectVN = _object; //following BI instruction on how to use publicVariable (it thought)
publicVariable str _objectVN; //following BI instruction on how to use publicVariable (it thought)
};
#

the above correctly names the new object as intended and it will also store it in the Database with the right Information and identification (vehicleVarName).
On dedicated server, the clients currently do not get the information about the objects vehicleVarName.
This is a porblem as later functions rely on clients knowing the vehicleVarName to update object information or delete it in the database.
this is why i have been using setVehicleVarName and vehicleVarName so far. it allowed me to identify an object and work with it as per below example (except on dedi where clients miss the vehicleVarName).

//client side deletion /Database removal script
params ["_object"];
_objectVN = vehicleVarName _object;
player playactionnow "putdown";
sleep 0.8;
removeObjectDB = [_objectVN];
publicVariableServer "removeObjectDB";

removeDataObjectsArray = [_objectVN];
publicVariableServer "removeDataObjectsArray";

deletevehicle _object;


//server sided script to remove object from database
"removeObjectDB" addPublicVariableEventHandler
{
  private ["_data"];
  _data = (_this select 1);
  _objectVN = (_data select 0);

  _inidbi = ["new","Objects"] call OO_INIDBI;
  ["deleteSection", str _objectVN] call _inidbi;

};

still forum
#

remoteExec the setVehicleVarName, that command is effect local

#

not sure if you need JIP handling tho

scarlet rain
#

[_object, _objectVN] remoteExec ["setVehicleVarName", 0, true];

#

thank you

#

i used the above in a previous version but it would not update the vehvarname for clients

still forum
#

yeah as said not sure if JIP is needed. Server might transmit what it has locally, to joining clients

scarlet rain
#

ok i will retry with this option (with and without JIP enabled) - thanks!

finite sail
scarlet rain
finite sail
#

mine works 🙂

#
{
    params ["_veh", "_name"];
    missionNamespace setVariable [_name, _veh, true];
    [_veh, _name] remoteExec ["setVehicleVarName", 0, true];
};```
scarlet rain
#

oooh, thanks!

finite sail
#

np

#

£15 + tax

#

or beer

#

or pics of sister

scarlet rain
#

i identify as church so i am tax freed but your £15 have been donated for a good cause, i have no sister and i am too greedy to share beer so lets make a compromise: i send you pics of my beer!

finite sail
#

I think you misuderstood the terms of this deal 🙂

tough abyss
#

what language is dayz written in

little raptor
#

DayZ itself? maybe C++
the scripting language is kind of similar to C#

oblique arrow
#

And why are you asking that here? @tough abyss

tough abyss
#

uhhh scripting channel

little raptor
#

Arma Scripting

tough abyss
#

dayz is WAS an arma mod

#

so like

#

idk thought someone might know

little raptor
#

no it's not

oblique arrow
little raptor
#

it's based on a completely different engine

still forum
#

Dayz mod is written in SQF @tough abyss
If you are talking about that

next kraken
#

is there any way to change the colour and the size of conversation / chat / dialog in the left corner when using kbtell function?

winter rose
#

size, no
colour yes, by using custom radio channels

#

@next kraken ↑

next kraken
#

thanks lou

scarlet rain
winter rose
#

anytime, this chan is open!

spark kiln
#

So I am playing with basic tasks and triggers.
I figured out most of things I am just stuck on how to get a task by interacting with a civi.
this addaction ["Ask about Soviet","????? civ1"];

What do i write in the ??? Or how do i got about doing this

#

I used this this addaction ["Ask about Soviet","DeleteVehicle civ1"]; based on how I did it with items, but I just want to talk to the civi not kill him

winter rose
#
this addAction ["Ask about Soviet", {
  params ["_target", "_caller", "_actionId"];
  _target removeAction _actionId;
  _target setDamage 1; // 😬
}];
spark kiln
#

I meant I want to interact with him and have the trigger activate and just walk away.

#

without killing the civ

winter rose
#

then… don't kill him?
what do you want to do exactly

idle whale
#

Is _Unit already definite by itself or I have to definite it with _this?

winter rose
#

depends of stuff

#

as in, moar details plz

little raptor
#

definite by itself
it's a variable, so it's never defined by itself

finite sail
#

i think he means, is it a magic variable that is set by another function or command

little raptor
idle whale
#

I'm trying to make ai throw chemlights randomly, so I'm just creating a init script that gives them colors depending on their side. I tried _this select 0 and _this and I still always get undefinite. First time scripting

little raptor
#

it all depends on how and where you execute the script

idle whale
#

in the init I tried compiling it then executing it with execvm

little raptor
#

so like this?

[this] execVM "pathToScript"
idle whale
#

with out the [this]

little raptor
#

that's where you're wrong

#

execVM creates a new handle

#

none of the variables defined before are gonna be accessible to it

idle whale
#

oh

little raptor
#

so first add that: [this]
and in your script put this at the start:

params ["_unit"];
#

what it does is that it defines a new variable called _unit and gives it the value of the first element of the array you're passing to it ([this])

#

it was also possible to use:

this execVM ...
_unit = _this;
winter rose
#

but not recommended

little raptor
#

for educational purposes

winter rose
#

without warning nor historical context!

idle whale
#

still showing up as undefine for me. when I put params at the first of the init or in the script

little raptor
#

in your script put this at the start
adding params to init makes no sense. you must add it to your script

idle whale
#

yea I did that at first. But I guess it just the way I have the script set up. below it I have _Unit addmagzines

little raptor
#

post your whole script.
and the init too

idle whale
#

how do I get the boxes you guys use?

little raptor
#

see the pinned messages

idle whale
#

or I just copy and paste?

little raptor
#

put three accent graves (on most keyboards it uses the same key as ~)
then put sqf next to it
and last also end it with three accent graves

winter rose
#

↑ ↓ overheating Dedmen going crazy

little raptor
#

Dedmen having fun with his new toys

#

he's even using one as his new profile picture! 🙃

idle whale
#
chem = compile preprocessFileLineNumbers "chem.sqf";
[this] execVM "lightinit.sqf";```
#
    
    
    _Unit addMagazines ["chemlight_yellow", 2];
    
if((side _Unit) isEqualTo WEST) then
{
    _Unit addMagazines ["chemlight_blue", 2];
};    
    
if((side _Unit) isEqualTo EAST) then
{
    _Unit addMagazines ["chemlight_red", 2];
};    

if((side _Unit) isEqualTo RESISTANCE) then
{
    _Unit addMagazines ["chemlight_green", 2];
};


[this] execVM "chem.SQF"; ```
little raptor
#

why do you compile a code without even using the compiled code?

idle whale
#

took me a long time to realize the "`" wasn't "''"

winter rose
#

```sqf
code after line return

little raptor
#
[this] execVM "lightinit.sqf";
params ["_Unit"];
    
    
    _Unit addMagazines ["chemlight_yellow", 2];
    
if((side _Unit) isEqualTo WEST) then
{
    _Unit addMagazines ["chemlight_blue", 2];
};    
    
if((side _Unit) isEqualTo EAST) then
{
    _Unit addMagazines ["chemlight_red", 2];
};    

if((side _Unit) isEqualTo RESISTANCE) then
{
    _Unit addMagazines ["chemlight_green", 2];
};


_this execVM "chem.SQF"; 
#

that's it

#

your main issue was: [this] execVM "chem.SQF"; at the end of lightinit.sqf
this is no longer defined in lightinit.sqf

idle whale
#

I was looking at some vcom scripts for reference and it looked like that in the init.

little raptor
#

Yeah, sadly most people use bad coding practices and some new comers learn from them

#

it spreads like a disease

idle whale
#

lol

#

I added the execvm chem because I also had a system chat that would tell me if it was running the script. Never got that in till I added the execvm

little raptor
#

anyway, you could've written that bit in a "cleaner" (plus faster, performance wise) way:

params ["_Unit"];

_sideID = [west, east, independent, civilian] find side _unit;

_Unit addMagazines [format ["chemlight_%1", ["blue", "red", "green", "blue"] select _sideID], 2];

_this execVM "chem.SQF"; 
#

and note that this is only used in eden init fields. don't use it anywhere else
the equivalent in other places is _this (if applicable)

idle whale
#

now it's saying this is undefine

#

idk why

little raptor
#

like I said, pay attention to your scripts and the variables. when you use execVM, the local variables defined in the "previous" script will no longer be available in the "next" script

idle whale
#

It's just the init.

little raptor
#

If you used the above code, it should work fine.
your problem is probably in "chem.SQF"

#

It's just the init.
are you talking about a unit's init?

#

because this is always defined there

idle whale
#

not the chem it's something else I think I removed it then I hidden my light code.

#

could be a local or singleplayer thing

little raptor
#

no
how does your init look like right now?

idle whale
#

Just one line of code like the one you posted above

little raptor
#

well post it

idle whale
#
[this] execVM "lightinit.sqf";```
little raptor
#

it doesn't have any problem
did you update "lightinit.sqf"?

idle whale
#

yep

little raptor
#

post the full error from the rpt

#

this will take you to the rpt folder if you're having problem with that:

%localappdata%\Arma 3

paste it in your explorer address bar and press enter

spark turret
#

is there something i can do to optimise coroutines? this here looks really p**py but idk how to make it better:

[_expSound,_expposLocal,_expVol,_id,_distanceDelay] spawn {

  params ["_expSound","_expposLocal","_expVol","_id","_distanceDelay"];
 
 sleep _distanceDelay;
  [[_expSound, nil, false, _expposLocal, _expVol, 1, 0]] remoteExec ["playSound3D",_id,false] ; // play sound !double array is required

};
still forum
#

"coroutines" oof.
Don't see much to optimize on that, besides the useless false for JIP flag in remoteExec

spark turret
#

parallel threads?

#

alright then, thx dedmen

still forum
#

Not parallel. Maybe async code

spark turret
#

coroutines it is

still forum
#

Only thing I can see you might wanna optimize is passing variables, but you can't really

spark turret
#

just noticed i use the exact same code to spawn delayed sound somewhere else, so ill move it into a function

idle whale
#
[this] execVM "lightinit.sqf";>
13:17:28   Error position: <this] execVM "lightinit.sqf";>
13:17:28   Error Undefined variable in expression: this```
little raptor
#

you're running that in init.sqf

still forum
#

init.sqf doesn't have a this

little raptor
#

As I mentioned, you should put it in the unit init

spark turret
#

check that lightinit does not need any input params and get rid of this

#

or listen to leopard

winter rose
#
[
  _distanceDelay,
  [[_expSound, nil, false, _expposLocal, _expVol, 1, 0]],
  ["playSound3D", _id]
] spawn {
  params ["_delay", "_left", "_right"];
  sleep _delay;
  _left remoteExec _right;
};
```@spark turret?
#

you could also make a function that is called delayedRemoteExec ^^

spark turret
#

i like 👍

#

very thanks

winter rose
#

much wow 😁

little raptor
#

@idle whale Also, if you're planning to use that in MP, you should use this (it is safe to use in SP as well, because in SP isServer is always true):

if (!isServer) exitWith {};
[this] execVM "lightinit.sqf";

because every client that joins the server will run the init again (and the unit will have too many chemlights)

spark turret
#

are you sure lightinit doesnt need to run locally? lights are local after all

#

just a wild guess

little raptor
#

his code adds some chemlights to the unit

spark turret
#

ah alright thats global then i guess

little raptor
#

addMagazine has global effect yes

spark turret
#

also quick tipp: if you add stuff to units or crates, check if theres cargo space. i think if you overstuff a vest, it doesnt get added, but it does for normal cargospace.

#

hm can i spawn a function instead of calling it?

winter rose
#

…yes?

#

spawn instead of call?

spark turret
#

okay 🙂

little raptor
#

a function is just a variable containing a code

spark turret
#

first time cleanly organizing my arma stuff so i wouldnt know

little raptor
#

you can even use

if (true) then function
#

and everything else you can do with codes

winter rose
#

hehe, lettuce know 🥗

spark turret
#

i dont trust intuivity in arma

winter rose
#

so you're right in trusting your instincts! so you're wrong! so you're right!

spark turret
#

after i learned that remote [jip = true] isnt "also call on players that spawned later" but rather "collect all calls and spawn as soon as someone JIPs and kill them will a wave of sounds"

winter rose
#

well, that's more or less "call on JIP" yeah 😄

#

"add to the JIP spamlist" :D

spark turret
#

yeah i thought originally that it just asks if it should run to for clients who were added after mission start lol good thing dedmen corrected me

winter rose
#

aaah I see now what you mean

still forum
#

Well what you said in your first sentence is correct

#

It does exactly that

winter rose
#

yeah but I believe he thought that a currently present JIP player needed that flag to receive it

spark turret
#

exactly

still forum
#

Aha!

#

So if you replace the "who were" by a "who will be" it'll be correct

idle whale
#

got it to work now thanks m8s

spark turret
#

if i want to kill of the light of a tracer, do i check for alive bullet or bullet isEqualTo objNull?

#

/isNull

still forum
#

alive is the same as isNull in that case

#

alive is always false for null objects

spark turret
#

👍

idle jungle
#
if (isServer) then { 
this setVariable ["RscAttributeDiaryRecord_texture","image\text.jpg", true]; 
[this,"RscAttributeDiaryRecord",["Mobile phone","Receiving Message:<br/><br/>We have the US NATO helicopter in a warehouse close by to you.<br/>We have asked our friendly Spetsnaz to help us guard it. Be on your look out.<br/>They have already taken our prison over. We have got some of our friends up north to send us a MBT, that should help!",""]] call bis_fnc_setServerVariable; 
this setVariable ["recipients", west, true]; 
[this,"init"] spawn bis_fnc_initIntelObject; 
};```

for some reason this works on lan but not our server any ideas?
#

ohhh i had damage disabled on the object would that be it? as intel gets "deleted" dont it

winter rose
#

damage disabled does not impact deletion

#

and why mixing setVariable with BIS_fnc_setServerVariable?

#

@idle jungle ↑

rugged spindle
#

Hey guys, probably a dumb question. I'm trying to hide the USS Liberty until a trigger reveals it, but it doesn't hide at all. Tried using the module in the editor, added this hideObjectGlobal true to the init and tried adding boat hideObjectGlobal true to the initServer.sqf, nothing seems to work. Is the Liberty a different kind of object that can't be hidden or am I doing something wrong? Thanks for the help.

willow hound
willow hound
idle jungle
#

Woops lol

willow hound
idle jungle
#

Oh ok those examples help a little

rugged spindle
obtuse quiver
#

Hello, is there any way i can make a car more though to explosion or something like that? still destructable tho

winter rose
#

yes, playing with the "HandleDamage" EH @obtuse quiver

obtuse quiver
#

Nice, thanks!

#

and if i wanted to make the car resistant to crashes but not explosions?

winter rose
#

same 🙃

#

not sure if you can distinguish them though

obtuse quiver
#

Oki doki, trying to make a tank vs bad drivers lol

analog walrus
#

I was wondering, is there any way to "track" the last object that dealt damage to a target, even after the target is dead?

I'm trying to build an MP mission where players get money in the form of score for each kill. Incapacitation is toggled, and everything works fine if the incapped player gets executed, but if they force respawn, the "killer" does not get awarded any score. I'm trying to find a workaround for that.

#

Tag me if anyone has any ideas

exotic flax
#

you could store the (last) data from the HandleDamage EH locally at a player, and when he/she dies (Killed EH) and no killer is known, use the stored data to get the person who gave damage the last.

#

and for respawn you can do the same with the Respawn EH, simply check if there is data store about the last handled damage, and reward the score to the person who inflicted that

ember path
#

Hi so i just started making my first mission and i ran into a bit of a wall:
I want to make an AI run into a building and hide once the shooting starts, and then when a player interacts with them i want them to change from independent to WEST
Rn theyre just walking around with other units and i want that, but how could i make them break out of the patrol and hide once shooting happens?

#

And is there a list of various trigger conditions? like custom ones cuz i assume ill have to use a trigger for this?

#

I tried messing around with the event handler FiredNear

#

but couldnt get it to work

#

(so basically i want them to act as the enemy ai, so theyre like undercover, until the shooting starts, and then i want them to hide, and to avoid them getting killed by the enemy only have them change the side once someone interacts with them)

#

(feel free to @ me)

spark turret
#

FiredNear is not a good Eventhandler for that. It ignored anything further than 50 m and is also local to the shooters machine i believe

#

Combatmode "red" is a good one imo.

#

= when they go into combat mode

ember path
#

i still dont understand how to use them to like... trigger something tho

#

like how do you use an event handler to like...
_opforGroup = createGroup WEST; [boy] joinSilent _opforGroup;

#

or like

#

is there a...Hm

#

there is like a create waypoint move, but how do you tell it where to move

#

like thats the thing im a bit confused about still is how do you use these things to then set off other things, sorry im very new to this

spark turret
#

You dont really need an eventhandler. Eventhandlers react to hardcoded events and there is none which suits your needs.
You can use a trigger to continueosly check if YourGroupVarName combatmode == "red" or sth similar.
In the ontrigger actication, you do
Yiur group join code

#

So to break it down:
Trigger has condtion "group in conbat"
Trigger checks all the time if condition is true
If true, trigger executes code

#

if (combatMode _grp1 == "BLUE") then {_grp1 setCombatMode "GREEN"};
https://community.bistudio.com/wiki/combatMode
(combatMode Group01_specialbois == "RED")
is the condition to check if the group with the variablename "Group01_specialbois" went into combat mode.
watch out as they turn into combatmode red if they spot an enemy or a danger.

#

so not necessarily when shot at, but before.

#

@ember path

ember path
#

could this be done with a single unit, i need only one of them from the group to leave and hide

spark turret
#

group members share the same combat mode.

ember path
#

right i see

spark turret
#

but you can command the single unit by giving it a unique name and just ordering this name around

#

like you already suggested:

_opforGroup = createGroup WEST; 
[boy] joinSilent _opforGroup;
ember path
#

okay cool that works, now how do i make him move to a building and stand still.....

spark turret
#

is he the only one in his group?

#

btw, calling you WEST side group "_opforGroup" doesnt make sense 😉

ember path
#

nah i know

#

its for testing

#

no he is in a group

spark turret
#

if hes alone, you can just order the group around. create a waypoint at position of desire and the group will move there

ember path
#

should i make him leave the group then move

spark turret
#

well that depends on what you want to do with him. does he still need the group afterwards?

#

if no, make a new one

ember path
#

no, he needs to hide and then wait for players to find him, but i dont want him to switch sides just yet so that he doesnt get shot by enemy ai

#

hes basically undercover

spark turret
#

you can use "doMove". thats like his AI commander giving him an order and will overwrite group behavior

#

but once he reaches this position, he ll try to regroup i guess, so you ll need another check to prevent that

ember path
#

is there way to disable pathing with code

#

like how u can do it in eden

spark turret
#

yeah, boy disableAI "path"

ember path
#

so i disable pathing until hes found and then enable it

spark turret
#

enable by enableAI "Path"

#

i havent tried, but apparently "doStop" works better/more immersive. disable path will make him stuck, no matter what, so he ll die standing instead of taking cover. doStop is like a soft version of no pathing, he ll leave if its really necessary

ember path
#

oh could i maybe use garrison instead of doMove.. i mean idk how id do it in code

#

cuz i assume with doMove its only 1 position, or i guess hm i could set multiple positions and then make it randomly choose one

spark turret
#

i think garrison is a waypoint, so he needs to be a solo-man group then

#

doMove is good for precise movement. might not work for going indoors

#

Ai is really bad with buildings.

ember path
#

hmm ok lets try..

#

how would i add a garrison waypoint after hes in a new group

spark turret
#
_wp = (group boy) addWaypoint [[0,800,2222222],0]; //add waypoint to boy`s group at position [0,800,2222222]
ember path
#

oh i just did
_newGroup = createGroup independent; [boy] joinSilent _newGroup; _newGroup addWaypoint [GARRISON]; hint "time to hide";

#

xd

spark turret
#

does it work?

ember path
#

can u not just tell it to use one of the like waypoints u have on the right side in eden

#

no

spark turret
#

Ai has enabled pathing?

ember path
#

MHM

#

woops

spark turret
#

without pathing, they dont do any waypoints

ember path
#

mhm

spark turret
#

even ones that dont require moving.

ember path
#

yeah it has pathing, OH

#

wait no

#

1 elements provided, something something 3

spark turret
#

syntax error

#

tip:
in c:/users/you/appdata/local/arma3 you find a .rpt file. its the log file

#

very important as errors get logged in there so you can see what you did wrong

ember path
#

1 elements provided, expected 3

#

which hm

#

so you cant just put names of waypoints like you see them in eden into code?

#

OH

#

wait

#

uhhhhhhhhhhhh

#

i could use lambs

#

right those are just scripts?

spark turret
#

its because you didnt give a position

#

yeah but lambs is more complicated

ember path
#

yeah ok ppfs

#

made my game crash

#

ok i gtg sleep ill continue this tomorrow, thanks for your help!

#

i assume i could also use

#

_tgt = [target1]
_wp =_newGroup addWaypoint [target1,1];

#

maybe? and then have like an empty marker be target1

ember path
#

Last thing before i go,is there a list or rule or something to what you can use in the Condition, for a trigger

#

For example I didn't even know you could use combat mode thingy

analog walrus
#

Okay, can anyone please help with a code I have no idea how to fix:

"respawn_west" setMarkerPos getMarkerPos ["dead_west", 1];

Getting the following error when code is called:

call{"respawn_west" setMarkerPos |#|getMarkerPos ["dead_west", 1]; ...

\\ Error type Number, expected Bool
#

I cannot for the life of me understand where the Boolean expect is coming from

lost copper
#

The second param of getMarkerPos must be boolean (true/false), not number (0/1)

fair drum
#

we aren't at v2.01 yet right for release?

oblique arrow
#

v2.01 is dev @fair drum

exotic flax
#

and we'll never be

oblique arrow
#

next stable release will be 2.02

exotic flax
#

^^

little raptor
ember path
#

just so i understand this better, combatmode == RED is asking: is the combat mode red now, and if its true then execute this. Is there a way to write it so it checks if its false?

little raptor
#

!=

ember path
#

i see

#

thanks!

#

thats very useful

#

oh and i managed to get my boy to move

#

hint "time to hide"; _hidePos = [hidepos1]; _newGroup = createGroup independent; [boy] joinSilent _newGroup; [boy] doMove (getMarkerPos "hidepos1");

#

and then theres a trigger that triggers when he gets to the place that does doStop

#

it works really well so far

little raptor
#

I don't see why you had to make him join a new group, but okay

#

I wasn't following your conversation with IRONSIGHT, so I'm out of the loop 😅

ember path
#

well maybe i dont need to, but i also dont want him to go back after the doMove

#

it works so why not, is there a command to make him join the players group, i wanted to just reuse
_goodGroup = createGroup WEST; [boy] joinSilent _goodGroup;

#

but thatll put him in a new group

#

not the one the player is in right

little raptor
#

i also dont want him to go back after the doMove
doStop + doMove (or doStop + moveTo) usually does the trick

little raptor
ember path
#

i think i made the doStop thing kind of in a bad way xd, its just a triger that makes him stop when he enters in

#

cuz i tried just putting doStop; after doMove, cuz i thought it waits for him to move there and then stops him but nah

#

okay lets see if this will work

#

so i can just do

#

[boy] joinSilent group player;

little raptor
#

yes
provided there is a player (e.g. not a dedicated server)

ember path
#

hm

#

im getting error generic error in expression

#

oh wait lemme test it in mp

little raptor
#

where? post your code

#

Generic errors have nothing to do with SP/MP

ember path
#

[boy] addAction ["Rescue undercover agent", [boy] joinSilent group player];

#

this is in a trigget

#

trigger

#

trigger is actiavetd by a player being present in the area

#

condition is the default: this

little raptor
#

well take a look at the wiki

#

what is the second argument supposed to be?

#

a code

ember path
#

yeah

#

am i missing {

little raptor
#

a code is wrapped in { }

ember path
#

gotcha, heck

little raptor
#

also it should be boy addAction ...

#

not [boy]

#

the lefthand param is an object

#

not an array

ember path
#

oh i thought [] was for like any variable okay

little raptor
#

Especially the data types

#

you seem to not know what they are

ember path
#

i got into this like 3 days ago so yes i have no clue what im doing xd

cosmic lichen
#

No problem, but do youself a favour and read through the introduction, it will save you time in the long run.

ember path
#

will do

#

also i love this and i hate this, switched the independent side to enemy, and the pathing for my boy is all messed up in the best ways

#

idk if i should try and fix it or not xd

ember path
#

Helipad (invisible) is the mvp

brave jungle
#

Hi just want to double check, while using remoteExec, whatever variable is attached is related to the remoteExec command and not the command I am trying to remote execute?
For example BIS_fnc_holdActionAdd:

_actionID = [] remoteExec ["BIS_fnc_holdActionAdd", 0, _someObj];

The name of the variable _actionID would actually be false as its not the actionID its actually the remoteExec return? Ive been away from coding for a while just trying to re-remember things 🙂

cosmic lichen
#

@brave jungle

brave jungle
#

Ah perfect thanks

spark turret
# ember path am i missing {

to give you an overview over very helpful and important additions to scripting:
the biki has a documentation for every command:
get familiar with magic variables:
https://community.bistudio.com/wiki/Magic_Variables
get familiar with the magic files:
https://community.bistudio.com/wiki/Event_Scripts

visual studio code has extensions that help you developing by highlighting, syntax error detection and even a virtual machine to test code.
recommended by dedmen:
-SQF Language (Armitxes)
-SQFLint
-SQF Debugger

recommended by me:
-arma open last rpt
https://marketplace.visualstudio.com/items?itemName=bux578.vscode-openlastrpt

winter rose
#

^ yesss that last one, found it ony recently but it is wonderful to have

still forum
#

I just pinned Arma appdata folder as a favourite in explorer 🙃

#

what would be nice, a extension that just live-displays the RPT in like, how the terminal panel works.
Just automatically detect when Arma is running, add a RPT panel that scrolls through live.
Does open last rpt do that maybe? I never used it

spark turret
#

open last rpt opens the latest one if you press cntr alt R and / or jumps to the bottom of it

#

and VSC auto refreshes the file so thats nice

#

never going back to the days of .rpt in notepad bc poseidon would freeze 😂

still forum
#

auto scroll most important thing.. next to handling a 50MB RPT file getting spammed

oblique arrow
#

Are Rpt's actually written live while the game is running or only created afterwards? I never thought about how that works

still forum
#

live-ish

#

main Arma live, it freezes the game while it writes to file.
Performance branch it queues up writes and does them as it has time while the game runs.

Which is technical info that you didn't even ask for, but here you go

oblique arrow
#

Huh nifty, thank you

ember path
#

Oh ill have to check those out thanks @spark turret i already had some extensions in visual studio code. Also is it more performance impacting to have more scripts or to execute scripts in eden

#

Like to have them as files, or to just write them in eden

still forum
#

where the script code came from doesn't matter.
The performance impact when the script runs is the same

little raptor
#

Quick question: Why should exitWith in a count code return a number and not boolean?

#

Isn't that a "bug"?

exotic flax
#

because count always returns a number(?)

little raptor
#

count does, yes, but doesn't exitWith end the current scope?

exotic flax
#

if you return true within the code of count, it will return the last counted element

#

see wiki 🤷‍♂️

little raptor
#

That's what I wanted to do, but it doesn't

#
{
if (_x >= 2) exitWith {true};
true
} count [1,2,3]
#

Strangely, breakWith works

exotic flax
#

that would return 2

little raptor
#

no it doesnt

#

it returns true

#

That's why I suspect it's a bug

exotic flax
#

not sure if bug or unintended feature

#

although comments from 2014/2015 already state that "feature"

#

so if it was a bug it should have been fixed by now

#
_result = {
    if (_x isEqualTo 3) exitWith { "Hello" }
} count [1,2,3,4,5];
// _result = "Hello"
little raptor
#

well, maybe no one realized it's a bug. afaik exitWith breaks the current scope with a code.
ie it should be the same as:

breakWith (call _code)
#

and you can definitely tell that by referring to the waitUntil behavior

exotic flax
#

well breakWith is only on DEV for now, so perhaps that one is broken

little raptor
#

no it's not

#

exitWith in count could be

exotic flax
#

again... I doubt it if it is known to work like that since 2014/2015

little raptor
exotic flax
#

and count was added in OFP, without any changes (according to the wiki), so must have been known/reported when it was a bug...

finite sail
#

both do highlighting so spotting errors and debug messages is easy

spark turret
#

execVM "myscript.sqf" shouldnt be able to clog up the main thread right?

#

like, if i have a waitUntil {false} in my script, the rest of arma wont be too much affected by it

serene quiver
#

Howdy folks... is there a way to open a strategic map on a "neutral" map? What I want to do is using a strategic map inside an Op-center for the player to choose multiple missions ON MULTIPLE MAPS. For that reason, the overview pics of the strategic map should be something "custom-made"...e.g.; a map of the earth image/pic...

exotic flax
#

you could copy and rewrite BIS_fnc_StrategicMapOpen to use a custom version of RscDisplayStrategicMap, which shows you custom map/image/etc

#

although not sure if that would work outside of a mission, and I don't think it's possible to switch missions from within a mission

#

and I would remove all other duplicate comments... before you get a warning or worse

serene quiver
#

I know is possible to have the strategic map starting any mission you want (and if it's inside a campaign folder with the correct "description.ext" set up is doable)..

serene quiver
#

for the warning part..

exotic flax
#

A mission is build on a single terrain; so the moment you load a mission, you load the terrain. You can build multiple "missions" in a mission (like it's done in the Contact mission), but you can't switch terrains.
If it's a multiplayer system, you could have a script which would let the player exit the server and join a new server (with correct mission/terrain), but that won't work in SP.

serene quiver
finite sail
#

guys, forgive me, but there is a better way of doing this, but it escapes me right now
((str (floor servertime)) select [((count (str(floor servertime))) - 2),3]) isEqualto "00"
for doing something every 100 seconds

#

please remind me 🙂

#

there's a function, but I'm damned if can remember it

willow hound
#

Uhhhh...
sleep 100;?

#
_targetTime = time + 100;
waitUntil {time > _targetTime};
exotic flax
#

so many options...

(serverTime % 100) == 0
proper sail
#

@finite sail yeah your question is a bit weird, i would say just sleep 100 lol

finite sail
#

yeah, i could spawn a thread and sleep 100, but there's other conditions that might change during the sleep

willow hound
#

Two contestants remaining!

finite sail
#

@exotic flax was the solution i wanted 🙂

#

or at least, the solution i had forgotten

exotic flax
#

It really depends on the situation; if you need to repeat code in a while loop, than checking if the current time (or serverTIme when it needs to be equal on all clients in MP) can be divided by 100 is a viable option.
Downside is that it will keep running the loop every n milliseconds.

With the waitUntil solution it will simply wait till it's time before continuing the script (which can be inside a loop as well); not sure what the performance difference is though

finite sail
#

yes, the code is in a loop which has a sleep 0.5 in it

willow hound
#

You can sleep in the waitUntil "condition".

finite sail
#

the loop does other things beside this 100 second check

willow hound
#
while {true} do {
  private _maxWaitTime = serverTime + 100;
  waitUntil {sleep 1; time > _maxWaitTime || COND1 || COND2};
  //Put worker code here...
};
```Checks the `waitUntil` condition once per second (thus it can't work with `%`).
exotic flax
#

^^

finite sail
#

yes, i often have a timeout or a quit flag as an OR in waituntil

#

and always a sleep

exotic flax
#

Although time and serverTime return the time in seconds, it's possible to skip a second when using sleep 1; making % useless.
Running 0.5 sec sleep makes it possible again, but I don't think you need to check every half a second to know if 100 seconds are over.

finite sail
#

no, but the loop it is in is doing other stuff

#

some of which does need to be half a second or so

#

now that I'm actually coding it, I'm thinking the %100 inside a loop might not be the best way 🙂

spark turret
#

Modulo always rules for timed stuff

#

Downside is constant check for it. But i doubt thats a Problem

#

Combine sleep 1; with _iterationCounter % 100 ?

finite sail
#

its sleep 0.5, but yes

spark turret
#

It might get desynched to true servertime bc sleep 0.5 might not be exact. Never mattered for me

finite sail
#

this is serverside

willow hound
#

Is time incremented in whole second steps though?

spark turret
#

Nope

still forum
still forum
still forum
#

or does it not?
I know that exitWith in loops is not intuitive, gladly you won't need to do that anymore.

willow hound
#

It's super intuitive to me O.O

queen cargo
#

iirc exitWith exited the loop indeed

willow hound
#

Of course it does

#

That's why it's so useful O.O

still forum
#

it might be a bug, but won't fix. I guess I can see how that might happen, but exitWith is just not intended for that, its intended for real scopes like call/spawn.
Not like, also somewhat scopes but not really like then/while/count/forEach

queen cargo
#

that is why you should not use it 🤪
exitWith == bad style

willow hound
#

Pfffff

queen cargo
#

soooo ... with count too i guess

proper sail
#

yes

still forum
#

Not sure how it really does/doesn't, but I know using it in loops like this is not supported and has issues

#

Just be angry at the bug and get hyped up about breakWith coming

queen cargo
#

refusing to join the hypetrain until we get hashmaps
change my mind

still forum
#

Should be able to start working on hashmap next week.
Hit small roadblock when I remembered the problem with circular references
But I think I got a better solution than what we did with Arrays, atleast better for people who write correct code...

willow hound
#

So far it has always behaved as I expected...

spark turret
#

Always bully ppl with incorrect code 👀

winter rose
#

we bully the incorrect code, mostly 😄

spark turret
#

I want hashmaps too. I really hate armas array search methods

#

Cost me 2 hours of my life to search and overwrite a string 2 days ago

#

Can you just steal javas methods? Pls

still forum
#

We'll youll get them before anyone else, so be happy

spark turret
#

🥳

still forum
#

Actually.. I think we already have them in the modpack? My old implementation from 2 years ago

regal night
#

Is there any script I could put in an ai init to make them call one other backup squad with the same init after 30 seconds of contact? I'm wanting to somehow make ai squads that will, after 30 seconds of finding a player, will call one other squad and that squad will do the same when coming in contact.

little raptor
#

@regal night
Not sure about existing scripts, but I can point you in some direction to make your own script:
You need a loop such as waitUntil or while to periodically check if the group knows about the player
You need a command to tell how well the group knows about the player. You can use a combination of knowsAbout and targetKnowledge
an example:

_knowledge = 0;
while {_knowledge < 30} do {
  if (_group knowsAbout player > 1 && {
    time - (leader _group targetKnowledge player select 2) < 5 //last seen less than 5 seconds ago
  }) then {
    _knowledge = _knowledge + 1;
  } else {
    _knowledge = (_knowledge - 1) max 0;
  };
  sleep 1;
};
//call for backup after the loop is done

a simpler approach:

waitUntil {
 sleep 1;
 _group knowsAbout player > 1 && {
    time - (leader _group targetKnowledge player select 2) < 5 //last seen less than 5 seconds ago
  }
};
sleep 30;//wait 30 seconds

For calling backup, you can either look for nearby groups using something like : allGroups select {side _x == side _group1 && {leader _x distance leader _group1 < 200}}
or use predefined arrays:
_availableSupport = groupArray - [_group1]; //any group except the original group is available to provide support to this group
and for calling them in, either give them waypoints (addWaypoint) or use a command like move

serene quiver
#

Howdy folks..
I have a little script where it needs to check if the surface is water, to move a diver at the position and at the right depth.

if (surfaceIsWater _pos) then { Diver1 setPosASLW and so on....

Now my question is that I read somewhere that 'surfaceIsWater' may give the wrong result if someone clicks on a small river or something, not the sea.
Is it like that?..and if it is, how to prevent that?

little raptor
#

no it is not correct

#

probably they click somewhere where the map is showing there might be water but there isn't

#

that's like a map precision error

#

another case where you might not get any result for surfaceIsWater is if the surface is simply using a water shader but it isn't actually water

serene quiver
#

I just want to avoid players choosing a little stream or river..need to be sea..

little raptor
#

ok you can try this then

#
_testObj = "Land_wrench_f" createVehicleLocal [0,0,0]; //not sure what to use, but this will work
_testPos = +_pos;
_testPos set [2, 0]; //terrain surface
_testObj setPosATL _testPos;
(getPosASLW _testObj select 2) * -1 > 2 //depth is larger than 2 meters

not sure if you meant depth or width by "little", but this covers the depth

#

you can use some grid check (points around the pos) to also account for the width

serene quiver
#

depth was intended...

little raptor
#

I wish there was an ATLtoASLW command

#

that way there was no need for a test object

#

Unfortunately it never got implemented

serene quiver
#

Oh man..you have been so helpful in the last few day and helped me many time. Will credit you in the mission dude..thank you and anyone else helping lost folks like me here..

little raptor
#

no problem!

#

@serene quiver btw, don't forget to delete the test object when that script is done

#

I forgot to include it

regal night
#

@little raptor Thanks! I will try and figure this out. I'm pretty clueless when it comes to scripting, but this helps a lot!

little raptor
smoky verge
#

anyone knows why my mission music (played while I was in a vehicle) stops as soon as I leave my vehicle?

astral tendon
#

how do I check if one of the two objects are the nearest from the player?
Like, objject1 is 100m from player and object2 is 50m, how do I check that in a array? like [objject1,object2]

willow hound
#
MyObjectArray = [Object1, Object2, ...];
private _nearestObj = MyObjectArray # 0;
{
  if (_x distance player < _nearestObj distance player) then {
    _nearestObj = _x;
  };
} forEach MyObjectArray;
astral tendon
#

MyObjectArray # 0?

#

never seen that

willow hound
#

ARRAY # INDEX is the same as ARRAY select INDEX.

astral tendon
#

cool

serene quiver
#

Ok..I'm back again...
as I stated above, I have this little snippet to teleport the player group in a SDV positionable by a singleClick command on the map.
https://sqfbin.com/zizekosofutimoyelama
It works great...It checks if there's water...BUT...if the player group has more than 4 units, there's a problem. So I declare a variable in the init.sqf (SDVsquadlimit = 4;)

How do I get the add action on the object where I call the script not showing up or better hinting the player that the squad is too big?
Thank you all.

willow hound
#

There is no addAction in that script.

serene quiver
#

// Place the following addaction on a flag pole or similar object at the base. // this addAction["<t color='#ff9900'>Move SDV</t>", "scripts\SDVinfil.sqf"];

willow hound
#

Ah, got it.

#
this addAction ["Title", {if ((count (group player)) > SDVsquadlimit) then {systemChat "Too many group members!";} else {execVM "scripts\SDVinfil.sqf";};}];
proper sail
#

Is it worth converting arrays to strings, sending them over network and then converting them back to an array on the server. I am asking as (i think) dedmen said arrays were not good for sending across the network.

obtuse quiver
#

Hello again, i wanted to play more song one after the other but i don't know how to do it and i don't know the classname for the songs since they're customs musics

serene quiver
#

Forgot to say..is SP

still forum
obtuse quiver
#

Basically i don't know where to get Classnames for custom musics

proper sail
#

Alright thanks for the answer

obtuse quiver
#

or can i do something with triggers? like they activate once the previous song

obtuse quiver
#

"Multiplayer
The next sound is chosen randomly on each computer, therefore in multiplayer each client may hear different sounds."

willow hound
#

And?
I don't really know what you're trying to do.

obtuse quiver
#

ambient music that plays one after the other

willow hound
#

I guess playMusic (or playSound3D).

smoky verge
#

@obtuse quiver 3den enhanced has an ingame music selector to get the classnames and hear the music tracks

obtuse quiver
#

where do i find it?

#

usually i use the ambient musics with 3den enchanced

smoky verge
#

on the tool bar on the top

obtuse quiver
#

oh so im really blind uh?

#

thanks m8 🙂

smoky verge
#

prego😉

obtuse quiver
#

eheheh

serene quiver
winter rose
#

count units player

serene quiver
# winter rose count units player

So it should be:

this addAction ["Title", {if ((count units player)) > SDVsquadlimit) then {systemChat "Too many group members!";} else {execVM "scripts\SDVinfil.sqf";};}];
?

#

Nope...lol...

willow hound
#

Might have to be (count (units player)).

#

Brackets are love, brackets are life.

serene quiver
willow hound
#
this addAction ["Title", {
  if ((count (units player)) > SDVsquadlimit) then {
    systemChat "Too many group members!";
  } else {
    execVM "scripts\SDVinfil.sqf";
  };
}];
```Brackets in the condition were (still / again) wrong.
#

Always think, look and copy-paste precisely when programming.

serene quiver
exotic flax
#

why have the if statement inside the callback, and not in the condition?

willow hound
#

For the systemChat.

exotic flax
#

which you won't need when the option isn't available to begin with 😉

oblique arrow
#

In terms of usability it'd props be good to give the player info on why it doesnt work though, no?

exotic flax
#

How do I get the add action on the object where I call the script not showing up or better hinting the player that the squad is too big?

willow hound
#

Client suggested it himself and it's always better to communicate openly with the player instead of showing the action to some and having others guess why they don't see it.

exotic flax
#

"Client"? You're getting paid for this? I need to talk with Dwarden fast! 🤣

serene quiver
#

I'm sure he's referring to the one playng the mission the missio-maker delivered..right?

willow hound
#

Damn, krtecek is a cute little guy.

idle jungle
#

Triggers are executed globally right? so if i put player setdamage 1; it will kill everyone?

exotic flax
#

yup

idle jungle
#

hmm any tricks to make it local?

still forum
#

Krtecek best ever

idle jungle
#

dedmen can we have an option to make triggers local or global 🙂

willow hound
#

Scripters have that option 😛

exotic flax
#

global or server already exists

idle jungle
#

so if i tick the server thing it wont kill everyone??

willow hound
#

That's hardly scripting, is it?

exotic flax
#

no, but it also won't execute on any client

idle jungle
#

ohh okay

#

i could not spot any local target on remote exec either

#

but i have feeling im about to be proved wrong

willow hound
#

createTrigger has a makeGlobal parameter 🙂

#

But not even I use createTrigger 😄

idle jungle
#

i need local not global 😄

#

just that 1 person in the radius

#

gets killed

willow hound
#

Well that's easy

exotic flax
#

anyhow; in the activation code you have access to 2 variables:
thisList - list of all objects in trigger area, based on 'Activation'
thisTrigger - trigger object

So you can use:

{ _x setDamage 1; } forEach thisList;
#

iirc

idle jungle
#

ooooo

#

superb

exotic flax
#

which will execute for everyone who is in the trigger when it triggers

idle jungle
#

thats great thank you

exotic flax
#

PS. not entirely sure how that behaves with AI and vehicles though, but when it only triggers on players, it will only contain players