#arma3_scripting

1 messages · Page 625 of 1

violet gull
#

And for the mission template I have Difficulty="Custom" in server.cfg

unique sundial
#

doesn’t mean anything it is a preset that is not applied

violet gull
#

Is it not applied via the server.cfg?

unique sundial
#

yeah, show your cfgmissions

violet gull
#
// MISSIONS CYCLE (see below)
class Missions {
  class ins {
    template="AltIns_39.Altis";
    //template="TakIns_1L.takistan";
    //template="AltIns_39.Altis";
    //template="Coin.Takistan";
    //template="LivIns_1.Enoch";
    difficulty="Custom";
  };
};

forcedDifficulty = "Custom"; ```
#

Also no mods used 😛

unique sundial
#

strange is this in 2.00?

violet gull
#

Yeah

unique sundial
#

dedicated served?

violet gull
#

Yezzir

unique sundial
#

i will check

#

what hint str difficulty; returns?

violet gull
#

1 sec, thought of something that could make me retarded.

unique sundial
#

also hint str missionDifficulty;

violet gull
#

I may or may not have been editing the wrong profile on the server.

#

Gonna triple check lol

#

... yes. I am an idiot. Disregard.

#

Edited the wrong arma3profile

jade abyss
#

I may or may not have been editing the wrong profile on the server.
@violet gull Welcome to the club 👍

tough abyss
#

Hello, where are global variables placed? In missionNameSpace or CurrentNameSpace?

still forum
#

both

#

current, but current is usually mission

#

Namespace is one word

tough abyss
#

Thx

fresh frigate
#

Debug tool in eden editor.
Test script in debug tool in editor or launch game then use debug tool is there any difference?

little raptor
#

Depends on what you're testing

#

If what you're testing involves some of the mission entities, most of the time the script won't work (because they're not initialized yet)

#

In general, testing during the mission is better

fresh frigate
#

Thank you that explains it

winter rose
#

storing UI variables

little raptor
#

As well as not being overwritten by publicVariable

sudden yacht
#

A script that hides a vehicle..... BUT... Still allows it to be functional. Like a jet. Help....

quartz pebble
#

There is a pilot camera on some plains. There is a flight horizon indicator at the lower left. Anyone ever tried to catch it with a script ?

sudden yacht
#

@austere nimbus disables the vehicle, becomes unusable.

warm hedge
#

I don't know what you're trying to say

copper raven
#

what? shouldn't iirc

#

yea me neither

warm hedge
#

That is temporary disabled, will be fixed soon tho

still forum
#

@tough abyss cannot be overwritten from elsewhere with publicVariable.

little raptor
#

That is temporary disabled, will be fixed soon tho
That's the global version.

#

what? shouldn't iirc
HideObject disables the object's "world simulations". It will not move anymore

#

A script that hides a vehicle..... BUT... Still allows it to be functional. Like a jet. Help....
Your best bet is to remake the object and remove all of its textures.

little raptor
#

It's a namespace, so yes

still forum
#

with everything that any other namespace can be used with

#

well besides publicVar and setVariable with public flag 🙃

dim owl
#

Hi guys, I just don't know what to do.
I want to check if a position of an object is in an array which is defined in a config and retrieved with getArray.
My problem:

(getPos cursorObject) in getArray(missionConfigFile >> 'CfgPos' >> 'blacklistedPos')
-> false

getPos cursorObject
-> [15422.5,21984.7,-1.2359]

getArray(missionConfigFile >> 'CfgPos' >> 'blacklistedPos')
-> [[3263.08,12440,-0.907945],[8364.61,10745.3,0.159745],[15422.5,21984.7,-1.2359],[19399.7,14311.5,0.202263]]

[15422.5,21984.7,-1.2359] in [[3263.08,12440,-0.907945],[8364.61,10745.3,0.159745],[15422.5,21984.7,-1.2359],[19399.7,14311.5,0.202263]]
-> true

What can I do to fix this?

little raptor
#

why do you define the positions in the config?

dim owl
#

Because it's easier to edit and keep it up-to-date in multiple places.

(getPos cursorObject) in [[3263.08,12440,-0.907945],[8364.61,10745.3,0.159745],[15422.5,21984.7,-1.2359],[19399.7,14311.5,0.202263]]
-> false

There is no change to the getArray

little raptor
#

Because it's easier to edit and keep it up-to-date in multiple places.
It is not.

Positions are floats. The chance that all 3 variables match is small

#

And I think you simply copied the results from the debug console

#

That's why they don't match (floating point accuracy)

dim owl
#

But how can I fix it?

little raptor
#

You can't. Positions are floats. You can't simply copy them to a new text file.

#

There is a slower way, if you want

dim owl
#

I could check if the house is near the positions in the array

little raptor
#

yeah, that's the slower way

dim owl
#

Could toFixed help for those positions?

little raptor
#

there's a very small chance it could. toFixed 20 maybe

dim owl
#

okay i will try

#

I fixed it with looping through the positions

little raptor
#

@dim owl I hope you mean findIf

compact maple
#

Hi :)
Is it possible to "lock" a listbox ? So the user can't make a new selection?

winter rose
#

disable it maybe?

compact maple
#

Will try ty 🙂

#

So using ctrlEnable on a listbox make every items of the listbox disappears

vague geode
#

Does anyone now how I can get the contents of supply boxes like e.g. Basic Ammo [NATO] (Box_NATO_Ammo_F)?
I tried getItemCargo _box but the result was just [[],[]] even though the box was full...

#

Never mind, the answer is getMagazineCargo, getWeaponCargo etc.

worn forge
wise frigate
#

I have been looking everywhere for an answer for this, but how do I get an array of items/magazines in a players vest. The goal is to have a script where the script will get the array of all equipment, then delete the old vest on the guy and give him a new vest with all his items in it still.

exotic flax
#

vestItems is the command you're looking for: ```sqf
_contents = vestItems player;
removeVest player;
player addVest "some_vest_class";
player addItemToVest _contents;

compact maple
#

^
@wise frigate
getUnitLoadout ?

wise frigate
#

And vestitems will take even magazines and weapons that are inside the vest?

exotic flax
wise frigate
#

Gotcha

#

Thanks

little raptor
#

@compact maple You can use onLBSelChanged EH and prevent the change

smoky raptor
#

Anyone had issues with bis_fnc_spawngroup? As my group is using the following to spawn AI in a mission and they are just frozen and won't move. groupsquad2 = [getmarkerpos "spawn_3", east, ["uns_men_nva_65_nco","uns_men_nva_65_rto","uns_men_nva_65_med","uns_men_nva_65_rf2","uns_men_nva_65_tri","uns_men_nva_65_mgs"]] call bis_fnc_spawngroup; wp = groupsquad2 addwaypoint [getmarkerpos "wpa_1",1]; wp setwaypointtype "sad"; wp setwaypointspeed "full"; I will add its on a Linux server.

fossil coyote
#

Hi. I'm looking to expand my current loadout system to include steam IDs. At the moment, players load in with a specific uniform for their slot, go to the loadout box and select whichever one. That changes vest, helmet etc adds stuff to them but doesn't touch the uniform. I would like them to select a loadout that checks their steamID and if it's one that is listed, it gives them a specific uniform. If their steamID is not listed it gives them a default one.
Would someone be able to work with me on it?

robust hollow
#

if (getPlayerUID player in _permittedUIDs) then {/*special*/} else {/*default*/};

fossil coyote
#

Could you simplify that for me?
Does that roughly translate to
if (gets the players UID and if it's in a different script/defined space of steam IDS) then (switch uniform to _____) if not (switch to ____)

robust hollow
#

yep, thats correct

#

so _permittedUIDs would be an array of steamids

fossil coyote
#

Could you give me an example of the skeleton of it

#

So that I can expand with more steamids

#

like how that would be laid out

robust hollow
#

yea, one sec

#

is it just one uniform for specific ids or you have multiple uniforms for different groups of ids?

fossil coyote
#

Long story short, we've got a lot of personalized uniforms - milsim unit stuff 70 people. When they load for example a rifleman kit from the box, I'd like to it detect their steamID and just switch their uniform to their personal one

winter rose
#

@smoky raptor works perfect in vanilla, as:

groupsquad2 = [getPosATL player, west, ["B_Soldier_F", "B_Soldier_F", "B_Soldier_F", "B_Soldier_F"]] call BIS_fnc_spawnGroup;
wp = groupsquad2 addwaypoint [player modelToWorld [0, 50, 0],0];   
wp setwaypointtype "sad"; 
wp setwaypointspeed "full";```
#

(also, private variables!!1! (_group, _waypoint))

fossil coyote
#

So essentially connor I'd like a line that goes in with the script(s) that change the loadout to run a script that gets their steam ID and changes it to the uniform that matches their ID

robust hollow
#

you might prefer to do something like this then

switch (getPlayerUID player) do {
    case "UID1":{/*special*/};
    case "UID2":{/*special*/};
    case "UID3";
    case "UID4":{/*special*/};
    default {/*default uniform*/};
};

it will let you define the default uniform and a specific uniform for each individual uid, and you can have multiple uids sharing the same loadout (if desired, for example UID3 will use UID4's loadout)

fossil coyote
#

I have some scripts that work but to me they seem overcomplicated. Uses stuff from Squad XML etc

#

so script 1 would be ___?
that would contain for example

switch (getPlayerUID player) do {
case "UID1":{Uniform classname};
default {Uniform classname};
};

What would need to be added to the script that changes loadout to check the ID and assign uniform?

robust hollow
#

depends how you're defining the uniform to begin with. you can use the switch to define all uid-specific items at once, or use it to return individual classes like

private _uniform = switch (getPlayerUID player) do {
    case "UID1":{"class_a"};
    case "UID2":{"class_b"};
    case "UID3";
    case "UID4":{"class_c"};
    default {"class_d"};
};
fossil coyote
#

I'll hop on arma in a few minutes and start putting some stuff in and testing

#

What do yu mean by defining the uniform to begin with and switch to define all UIDs at once / individually

robust hollow
#

like if you define the default loadout fully to start with and then adjust specific items as needed or if you define each item in the loadout one by one.
either way is fine it just changes what you would do in the switch. to start with just give that a go and see if it works for you.

fossil coyote
#

What would work best? 60 people turn up, 35 of those have their IDs listed for their custom uniform. They choose all scramble to box to grab kits and select different ones. Rifleman, NCO etc etc. For each individual person, I'd like it to check them and add their uniform.

robust hollow
#

i personally would list entire loadouts in the switch so you are copying uids less, but that may not work for you. it can be done however you want.

little raptor
#

The best method is using an array

#
_UIDs= [UID1, UID2, ...];
_codes = [_code1, _code2, ...];

call (_codes#(_UIDs find getPlayerUID player))
exotic flax
#

*PS. we use a database to handle personal loadouts, but it should apply to non-DB solutions as well*
You could simply make a config or script with an array containing the UID and the uniforms/loadout for that UID.
And each time someone uses the arsenal, a container, or even dead body, simply check if the UID exists, if the current uniform is accepted, and if not change it.

#

In our case we load a full loadout on the player, but have a limited arsenal so people can modify it (which only contains stuff they may use)

robust hollow
#

call (_codes#(_UIDs find getPlayerUID player))
you'd need to check if the uid is in _uids first, otherwise zero divisor error.

little raptor
#

@robust hollow or just:

_codes = [_default, _code1, _code2, ...];
call (_codes#((_UIDs find getPlayerUID player)+1))
robust hollow
#

that works too 👍

winter rose
#

readability, peeps!!1! 😡 😄

bitter anchor
#

Is the games scripting actually native C code or just something C-Like?

winter rose
#

it is its own thing called SQF @bitter anchor

little raptor
#

@winter rose Performance beats readability any time!

robust hollow
#

performance is less important in scripts that are not frequently repeating though. Is why I went for the switch instead.

astral dawn
#

yeah if it happens once when player respawns then you totally don't need to care if it takes 100us or 200us to run it. So I'd prefer something which is readable to something which gives 50% performance gain.

hollow thistle
#

you'd need to check if the uid is in _uids first, otherwise zero divisor error.
or use param. Depends if you need default value or what.

little raptor
#

It is still perfectly readable. Just add comments! 🙄

#
[
  {//case1
  },
  {//case2
  }
]

looks like switch to me! 🤷

robust hollow
#

yea, many different ways it can be done. just depends how experienced you are with sqf i guess.

#

yea but for someone who doesnt understand sqf it may not be so obvious is all im saying

astral dawn
#

I dunno, IMO switch is a control structure, and what you have is an array trying to be a control structure 🤷 but really both are style preferences

hollow thistle
#

I would map it on a "namespace" 😛

little raptor
#

and what you have is an array trying to be a control structure
except it is a few times faster if there is a lot of cases

astral dawn
#

I would map it on a "namespace" 😛
yeah that's best solution in arma world I guess

#

except it is a few times faster if there is a lot of code
well as I said if it runs once per lifetime or so then either are fine IMO

hollow thistle
#

can't wait for the hashmaps.

astral dawn
#

can't wait for the hashmaps.
blobcloseenjoy blobcloseenjoy blobcloseenjoy

#

were we promised hashmaps?

hollow thistle
#

promised? no. there's a chance.

#

using objects/locations for hashmaps has garbage collection issues.

astral dawn
#

how will it look? _map = createHashmap ? And it will be cleared up when not referenced any more?

hollow thistle
#

idk, however dedmen will make it if ever.

bitter anchor
#

@winter rose one of the reasons I ask is I was wondering if it supported enums

winter rose
#

nope, doesn't

astral dawn
#

Your best replacement for enums are either #define or strings

#

I think that defines are better

#

you will have to include some file where they are defined which helps to organize things
if you make a typo it will make the code fail because the game will treat it as nil (no value) and make an error

bitter anchor
#

I don't have a need of one, was just looking at the switch statement and thinking usually I'd use a enum (or define) for case values

astral dawn
#

Also one reason why it can't have proper enums, is because SQF is a dynamic-type language

quasi rover
#

Is there a way to prevent solo player from entering the server when it's empty and voting itself admin in MP environment?

still forum
winter rose
#

@quasi rover disable voting?
I don't know if there is a "min voters number" option.

astral dawn
compact maple
#

Hi, is there a way to randomly pick a class from a config ?

winter rose
#

yes

#

there is 😁

compact maple
#

tought of BIS_fnc_selectRandom but it takes an array

winter rose
#

get the class list and use selectRandom on it

warm hedge
#

And don't use BIS_fnc_selectRandom anymore!

winter rose
#

^ ☝️ meowthis

tought of BIS_fnc_selectRandom but it takes an array
you can get an array of subclasses

compact maple
#

alright, spent so much time on the wiki I didnt even see that green box lol

#

got it thanks 🙂

vague geode
#

Can someone (maybe from @Bohemia.net) tell me how to convert windStr into wind speed (e.g. in knots or in metres per second) because I would like to create autometic METAR (Meteorological Aerodrome Report) [https://en.wikipedia.org/wiki/METAR] weather report information.

While we are at it maybe someone could also tell me how to get the actual visible range e.g. from fogParams.

winter rose
little raptor
#

it's wind, not windStr
_windSpeed = vectorMagnitude wind (in m/s)

winter rose
#

windStr is 0..1, whereas wind is 0-infinity I guess

#

the thing is, IDK what is windStr

little raptor
#

maybe a multiplier?

#

_windSpeed = windStr * vectorMagnitude wind

winter rose
#

well all I suppose is that it might be a variability value
because wind also can have gusts… adding to my confusion

little raptor
#

I guess we need an official answer from @Bohemia.net after all.

#

ok bois, let's ping @Bohemia.net and ... get kicked immediately after!
I guess we can't do that, even if we wanted to! notlikemeow

winter rose
#

I have -guessed- that
wind = set wind (max) force
windStr = strength of "usual" wind (e.g 0.75 = 0.25 possible gusts)
setGusts = gusts frequency

wispy cave
#

Does anyone happen to know if ace_interact_menu_fnc_addActionToObject has local or global effect?

little raptor
#

@wispy cave

ACE_Actions and ACE_SelfActions can be added via config or by calling functions. Be aware that the functions modify the UI, and therefore need to be executed on client-side to take effect.

wispy cave
#

I completely looked over that, thanks

potent dirge
#

Have a bit of an issue here using addMissionEventHandler giving me a reserved variable error.
init.sqf where EH is:

addMissionEventHandler ["EntityKilled", {
    _this execVM "scripts\points.sqf";
}];

points.sqf:

params = ["_var1", "_var2", "_var3", "_var4"];
systemChat "Test";
distant oyster
#

you are trying to assign a value to params which is a command. correct usage would be ```sqf
params ["_var1", etc];

potent dirge
#

Thanks 👍

#

Also is there a way to get a unit's display name. E.g. instead of O_Soldier_GL_F you return Grenadier

warm hedge
#

getText (configFile >> "CfgVehicles" >> (put class here) >> "displayName")

potent dirge
#

Thank you so much

distant oyster
tough abyss
#

Good afternoon boyz, probably the wrong channel to ask but how would I go about replacing the default map UI? Something like what they did for the contact dlc first mission

#

I'm guessing its probably within a terrain's files

worn forge
vague geode
#

Is there a way to autometically check how far the actual visible range at a certain position (or in general) is due to things like overcast, fog etc.?

PS: Thanks for your help with the wind speed, @winter rose & @little raptor.

winter rose
#

well, keep in mind this info may not be true at all, just guesses/thoughts

little raptor
#

@tough abyss UI only? The map UI is RscDisplayMap or something. I'm not in the game but if you use configSourceAddonList you can find out which pbo it is and then you can modify it

winter rose
#

(at least on my side ^^)

tough abyss
#

ah ok, and which config file should I put in as parameters?

little raptor
#

@worn forge Revives scripts are typically custom made by community members. You can write your own, or modify the one you said to also give you the unit you want

#

ah ok, and which config file should I put in as parameters?
what do you mean?

#

which parameters?

#

oh you mean the command

#

configSourceAddonList (configFile >> "RscDisplayMap")

tough abyss
#

ye ye

#

thank you

little raptor
#

I'm not sure if it's the right one. So check it in config viewer to make sure it exists

tough abyss
#

will do, thank you again

worn forge
#

@little raptor I'm talking about Bohemia's vanilla revive system.

little raptor
#

Larrow already explained it

#

player getVariable ["BIS_revive_helper", objNull ]; // Unit that is reviving the player

worn forge
#

He sure did

#

That variable does not exist.

#

As in, (as I stated), I have run up and down that scenario as described, and it does not work.

#

Thus, I am hoping that someone who may have had a hand in developing that system can point to some more helpful variables.

winter rose
#

tried… in vanilla?

worn forge
#

Yes.

#

You would think that player getVariable ["BIS_revive_helper", objNull ]; would get set when the reviving player starts the action, but it does not, on either the revivor or the revived.

winter rose
#

(you have to use getVariable on the reviv_ed_ unit)

worn forge
#

I've done it both ways. Nada.

#

And yes, it makes more sense on the revived unit.

winter rose
#

I may be able to try tonight (in ~4h), meanwhile you can check the revive functions in the Functions viewer

worn forge
#

Yup, have been going through them.

winter rose
#

dang, quit killing my options!

worn forge
#

🙂

#

Thanks for your interest 😉

winter rose
#

well, I'm curious
it is also possible that the functions got revamped (e.g with remoteExec), and got rid of unused variables. Will check

worn forge
#

I have a feeling that Larrow's information was accurate and then the functions got overhauled.

finite sail
#

^^^^ this

worn forge
#

I see Jiri uses the same awesome code comments I do
//draw the sh1t

winter rose
#

lol!!

calm mantle
#

Lol

worn forge
#

Doesn't look like revive is captured by the handleHeal eventHandler, which isn't surprising.

astral dawn
still forum
#

it would still have to iterate over your array

#

much cheaper than generating a string definitely, but still some cost

stuck rivet
#

what is wrong with GunHandler = player addeventhandler ["Fired", { private ["_bullet", "_last_pos"]; _bullet = _this select 6; waitUntil {!alive _bullet}; _last_pos = getPosATL _bullet; player sideChat format ["Pos: %1, Time = %2", _last_pos, time]; } ]; ?

#

gets generic error in expression and the sidechat gives the position of end of barrel

#

the hashtag is at the waituntil line

still forum
#

private ["_bullet", "_last_pos"];
thats useless. and wastes performance, which is especially important in a fired eventhandler

#

also you cannot wait inside a eventhandler

#

eventhandlers freeze the game until they are done processing

#

so your waitUntil would just hard freeze the game forever

stuck rivet
#

this is a copied script

#

what I'm trying to do is getting the impact points of bullets

worn forge
#

But you could spawn a waitUntil yes?

still forum
#

this is a copied script
doesn't make it any less wrong/invalid.
Yes youd have to spawn your thing.
But the script makes no sense, when the bullet isnt alive anymore after the waitUntil, you cannot get the position as the bullet will be gone by then

#

dead bullet == despawned

stuck rivet
#

ah i see

worn forge
#

Perhaps using a Hit eventHandler on the target?

still forum
#

I assume it also wants to get ground impacts?

stuck rivet
#

no target, just the ground

still forum
#

How about "Deleted" eventhandler

#

bullet impact/despawn == deletion

#

Or should be

stuck rivet
#

could work, but you would also have to take ricochets into account

#

brb

worn forge
#

Dedmen, since your eyes are on the page

still forum
#

which page

worn forge
#

This page right here on discord, ie., I have your attention 😛

still forum
#

be quick

#

my eyes were on the shutdown button because i wanna go home :U

worn forge
#

Any advice on how to find the revivor in a vanilla revive situation?

still forum
#

no

worn forge
#

Rog. Thanks.

still forum
#

k thx bye

compact maple
#

Is there a way to get rid of white space at the start and at the end of a string ?

little raptor
#

white space?

compact maple
#

" blablabla lollol "

#

"blablabla lollol"

#

splitString could work ?

#
"   foo     bar    " splitString " "
> ["foo","bar"]
#

well found the solution

#

can rebuild the string then

fleet lagoon
#

why would moduleTracers_F cease to function when a player gets close to it and how can I make it continue to function regardless? this initially worked now they only work when I am some distance away from them

winter rose
#

place it bottom-left corner of the map 😄

calm mantle
#

Lul

fleet lagoon
#

ahhh sarcasm my favorite, so is there a better way then to create tracer fire over a specified area that i am missing?

worn forge
#

Could you put down two modules? Player can't be in two places at once.

astral dawn
#

much cheaper than generating a string definitely, but still some cost
What I have found is that floats are very costly to convert so string, when there are lots of them. So it will be a good improvement, I believe 👍

fleet lagoon
#

so i am creating a barbwire crawl area with tracer fire over the top i have several tracer effects set to the one side with targets on the opposite side that the effects are set to target. now whenever I get remotely close to the area where you would crawl under the fire stops and as soon as i get away from the area the fire resumes

stuck rivet
#
{ 
 _bullet = _this select 6; 
  _bullet addEventHandler ["Deleted",  
   { 
    hint str (getPos _bullet); 
   }]; 
} ]; ```

doesn't return anything
winter rose
#

yep, bullets don't get EH

stuck rivet
#

any way around it?

winter rose
#

no

stuck rivet
#

i have a mission where it constantly reads out the position of a bullet and keeps it for a moment when it stops, so it must be possible

winter rose
#

probably

#

if you want the location of where the bullet hits, you have as far as I know only the choice of looping a getPosASL until it returns [0,0,0] (objNull)

stuck rivet
#

this is the loop I just tried that doesn't work:

{
    private ["_bullet", "_last_pos"];
    _bullet = _this select 6;
    while {alive _bullet} do
        {
            _last_pos = getPosASL _bullet;    
        }; 
    hint str _last_pos; 
} ];```
#

it just returns muzzle end

#
{
    private ["_bullet", "_last_pos"];
    _bullet = _this select 6;
    while {getPosASL _bullet != [0,0,0]} do
        {
            _last_pos = getPosASL _bullet;    
        }; 
    hint str _last_pos    ; 
} ];``` gives generic error in expression
little raptor
#

@stuck rivet Event handler codes are NOT scheduled.
And NEVER, EVER use a time dependent while loop without sleep

stuck rivet
#

lol you can see I'm a noobie at scripting

little raptor
#

getPosASL _bullet != [0,0,0]
Generic error because != doesn't support arrays

#

isEqualTo and isNotEqualTo do

winter rose
#

the logic is good, though

#

(isNotEqualTo is not in 2.00)

little raptor
#

And also,

GunHandler = player addeventhandler ["Fired",
{
  _this spawn {
    _bullet = _this select 6;
     _last_pos = getPosASL _bullet; 
    while {alive _bullet} do
        {
            _last_pos = getPosASL _bullet; 
            sleep 0.001;   
        }; 
    hint str _last_pos    ; 
  } 
}];
#

waitUntil might be better

winter rose
#

(private one line lower ^^)

little raptor
#

No need

winter rose
#

params, do you speak it?

little raptor
#

No need for that either

worn forge
#

back up; Shalerei, what are you trying to do? Is there an easier/better way?

stuck rivet
#

get bullet impact on ground

little raptor
#

side note about scheduled environment: doesn't work well when a lot of scripts are being processed. use an each frame EH

worn forge
#

to what end? You want a hint every time a projectile is fired, telling you how far away it landed?

#

If it's about finding the distance between A&B I can think of a half-dozen better ways

stuck rivet
#

don't care about performance much

#

yeah im trying to figure out range basically

#
{
  _this spawn {
    _bullet = _this select 6;
     _last_pos = getPosASL _bullet; 
    while {alive _bullet} do
        {
            _last_pos = getPosASL _bullet; 
            sleep 0.001;   
        }; 
    hint str (position player distance _last_pos)    ; 
  } 
}];``` seems to work, though it doesn't seem to take ricochets into account but I can deal with that
#

thanks everyone

little raptor
#

@stuck rivet The only way to detect ricochets is through the acceleration vector (maybe velocity too)

stuck rivet
#

probably, or possibly adding checks for positive Z axis changes(since Im shooting at ground) but it's good enough as is thanks

fleet lagoon
#

So is there an actual fix for my issue that you are aware of @winter rose

#

is there a way to change the despawn in the config viewer?

winter rose
#

oooh, this tracer module

#

no you cannot, because it is """virtual"""

#

they spawn vehicles/units that shoot, and of course if you get closer, you would see them (also see there are no vehicles) so they hide them

#

unfortunately, it is "by design" @fleet lagoon

little raptor
#

Create tracer bullets manually and fire them

winter rose
#

fyi, it is a "B_Boat_Armed_01_minigun_F" that is spawned - and I can't find the code where it is hidden (yet)

fleet lagoon
#

got to love the civilian version of things, okay ill see if i can figure out a workaround thanks

little raptor
#

and I can't find the code where it is hidden (yet)
what's hidden again?!

winter rose
#

and sorry for the "sarcasm" earlier, I thought of a totally different tracer btw @fleet lagoon

#

@little raptor the firing boat stops firing when one gets close I think?

little raptor
#

boat?

winter rose
#

BIS_fnc_moduleTracers

little raptor
#

Isn't the objective to show tracers?

#

What's the boat for?

#

When you can just create bullets?

winter rose
#

tell that to BI? 🤷‍♂️

little raptor
#

who makes these functions at Bohemia?! I gotta know

winter rose
#

it's… Dedmen

#

surprisingly, this one has no author/header info

compact maple
#

Is it possible to create playable slot via scripts ?

#

Or it's only possible by placing NPC into the sqm ?

winter rose
#

no can do, unfortunately

hot fractal
#

good evening all,
I'm hoping I'm at the right place.
My unit and I have recently bought a server, downloaded the Invade & Annex by Quiksilver and have been live for about 3 weeks now.
One thing we've noticed is that we'd like to restrict access to vehicles so that only the "Commander" or "Pilot" role can "ACTIVATE" the vehicles.

None of us are script coders so we have absolutely NO IDEA as to where to begin because the scripting files don't appear to have a solution (we've asked on his discord)

#

I'm hoping someone can take the time to explain how to make one or direct me as to where to research?

little raptor
#

By activate you mean turn on?

steady terrace
#

rather quick question, how do I get the entity of a player in the format of entities?

#

I want to get all entities safe for the player

#

player doesn't do it, and neither does player nearEntites 0.1

little raptor
#

what do you mean by entity? And what do you mean safe?

steady terrace
#

(with doesn't do it I mean that both those commands return [playername] )

little raptor
#

huh?

steady terrace
#

what do you mean by entity? And what do you mean safe?
@little raptor I want to narrow the result of entities to just the player

little raptor
#

I don't really understand what you mean. Explain what you're trying to do

crude vigil
#

do you want to find out all players through entities command?

#

you mean entities that are solely players to be returned?

steady terrace
#

I'm trying to disable the simulation of all entities(players, ai, vehicle) without disabling the simulation of the player who runs the command

little raptor
#

allUnits - [player]

#

Is probably what you mean?

crude vigil
#

^pretty much but u missed vehicle part

#

entities - [player] would do I guess?

little raptor
#
allMissionObjects "" - [player, vehicle player]
steady terrace
#

you mean entities that are solely players to be returned?
@crude vigil I want to return just the player so I can remove them from the entities list, which would pretty much everything that moves in it

crude vigil
#

@steady terrace Leopard wrote what you wanted pretty much.

steady terrace
#

I'll look at allMissionObjects, thanks

worn forge
#

@hot fractal you're asking scripters here to go through Quiksilver's code for you, or hoping that someone else has already done so and is here - either of which might be a lot to ask. Your best place to get help is Quiksilver's discord, and hope, or buckle up and learn scripting to DIY.

hot fractal
#

@worn forge Hi Ryko, I've actually asked already on the QUiskilver's discord

#

hence I aimed to came here with people with knowledge to assist

#

as well as stating that i'm willing to help research wehre to go

#

rather than having someone do it for me

worn forge
#

I understand all that. I'm just letting you know in advance why you might not get a response here. Doesn't hurt to ask.

little raptor
#

@hot fractal What you're asking is pretty much impossible in Arma. you can't tell who's trying to turn on the vehicle

#

It could even be a script
vehicle engineOn true

worn forge
#

@little raptor he's not talking about turning on the engine, he's talking about how vehicles are spawned

hot fractal
#

You see, there's the 77th JSOC servers i'm not sure if you're aware of them...and they were able to do it so that only "HQ" can spawn and activate said vehicles?

#

I didn't want to "steal" their code so didn't dare ask them

#

haha

#

in fact let me try and send something that Mynar sent (an admin on Quik's discord)

#

2 sec

worn forge
#

Half of learning to script is by taking apart other missions, as long as you learn from it and just don't cut/paste/claim as you're own it's acceptable

hot fractal
#

Mynar: @[FOX] Red Fox I believe it would have to be something along the lines of .... THIS IS NOT REAL CODE TO USE ... I'm too rusty and pulling this off the top of my aged gray matter:
if qs_mission_config_commander && (player getunittrait qs_role = "commander" else exitwith hint "You must ask the Commander to activate this vehicle"
[4:49 AM] Mynar: The first finds out if the commander role is active via parameters.sqf and the second would be checking to see if the current player is the commander, else exit tell the player they need to be commander to activate the vehicle.
[4:50 AM] Mynar: I don't have anywhere near correct, efficient, and sanity checked code, but should give you an idea in a direction.

steady terrace
#

thanks @little raptor , just doing allUnits - [player] did it

hot fractal
#

copy paste sorry

#

unfortunately, it was like reading another language to me, which it is basically xD

little raptor
#

@steady terrace that doesn't include the vehicles (empty) you asked for.

hot fractal
#

not sure if you are able to make heads or tails with that

worn forge
#

Redfox it's not about whether I can understand it, it's about whether you can, this channel is about discussion and guidance, but I can't see anyone doing the actual work for you (unless there are some really nice folks in here)

hot fractal
#

that's what I mean

#

I don't understand it

#

I would like to

#

but not sure where to even begin researching

#

So far, in the last 3 weeks - my basic knowledge has expanded into using notepad ++

worn forge
#

¯_(ツ)_/¯

hot fractal
#

is there no "guide" so to speak as to begin understanding what/how the code qs_mission_config even means anything?

#

or do I have to take a google lesson on python

little raptor
#

@hot fractal qs_mission_config is probably a global variable

#

It's not a code or something.

#

And why Python

#

Arma scripting language is SQF

hot fractal
#

Python is only one of the few things i understand about coding

little raptor
#

See the pinned links to see some guides

hot fractal
#

ooh will do

#

thanks

hot fractal
#

ah this site looks interesting, i'll see if i can pin the two together

#

thanks for pointing to a general direction

hot fractal
#

Have I got this right?
An Identifier can be based on "local variables" so does that mean these local variables can be found within the Quiksilver's codes somewhere?

If so, how would i know what Variables are attached to said identifier?

little raptor
#

@hot fractal There are two types of variables in Arma: (excluding variable spaces)
Global: Can be accessible outside of a script once defined. Its identifier (aka name) must not start with _
Local: Accessible within a certain scope (and sub scopes, unless privateed). Its identifier (aka name) must start with _

As for understanding what type of data they're holding, you should read the code. There's no general rule about that (Arma doesn't have data type declaration like int Var)

hot fractal
#

hmm thanks will try to get head around

winter rose
#

scripting question, beside reading missionConfigFile, is there a way to access the mission's header? (mission type, minPlayers, maxPlayers)
as it can be located in mission.sqm now…

#

just needed maxPlayers, and I can live with playableSlotsNumber!

grim coyote
#

loadFile + custom parser?

winter rose
#

yeah but that's quite heavy ^^
there is also a trick where you #include mission.sqm into a description.ext's subclass, too…
but that's artillery against a footmobile 😄

compact maple
#

I am looking for a snippet code to display a player face in an image ctrl meowsweats

little raptor
#

@compact maple Use r2t

compact maple
#

wdym?

little raptor
#

lol

#

render to texture

compact maple
#

never used that before

#

I'd like to pass a classname like "GreekHead_A3_01" and get the image

cold glacier
#

@winter rose Could pull all the Event editor mission attributes using an editor script, and add them to an object's init field or something, so they're available as global variables in the mission.

Not exactly a great solution though, as you'd need to run that command in the editor :/

little raptor
#

@compact maple So it's not a player that exists in the world? (as in an object)

compact maple
#

It's not yea

little raptor
#

You want the profile faces?

compact maple
#

Yep!

little raptor
#

It's probably under CfgFaces.

#

I'm not in the game so I'm not even sure if it's thing! If not maybe cfgIdentities

compact maple
#

Let me check 😄

#

seems to be it!

little raptor
#

I think it's the face texture

#

Not the image

compact maple
#

.paa isn't the image ?

cold glacier
compact maple
#

Oh yea I see

winter rose
#

@cold glacier oooh yes thanks!

compact maple
little raptor
#

Create a head then slap that texture onto it!

compact maple
#

But just the rotating part

little raptor
#

Create a head then slap on that texture onto it!

compact maple
#

How do I create a 'head'?

little raptor
#

That head you see there is a model. It should be doable

#

Idk, but it should be somewhere in the game files. 🤷

compact maple
#

Alright, thanks! 🙂

little raptor
#

Maybe find the display ID, find which addon creates it, and then look for the model

#

@compact maple The alternative method is to create a normal guy with that face

#

Then zoom in on it

#

Maybe even use setObjectTexture [0, ""] to hide his uniform

compact maple
#

I see, Idk if I explained what I needed correctly, I'm not a native english speaker so x),
I have a dialog, with many controls, and I'd like to display a face form the CfgFaces
so there is 2 ways:

  • using the model from the Arma 3 dialog directly?
  • your alternative method
#

right?

little raptor
#

if I explained what I needed correctly,
You did

actually, I'm starting to think it is not a head but actually a man

#

You know you can create 3D models in displays right?

compact maple
#

I've seen a post from kk's blog about it, but never used it

little raptor
#

Ok. So try this:
create a normal soldier as the 3D model
obj setObjectTexture [0, ""] to hide his uniform
use setFace to change the face (not 100% sure if this part works)

maybe it works

compact maple
#

Ok I'm going to read a bit of doc before because never tried to create a model inside a dialog, I dont even know the type

little raptor
#

It's a separate class. Under "objects", not "controls"

compact maple
#

thats it

little raptor
#

yes

Ok, Arma 3D controls. There are about 4 types of those, type 80-83, but I personally experimented the most with CT_OBJECT_CONTAINER (type = 82;)
Interesting. I didn't know this one!

steady terrace
#

is there a workaround for fadeSound? talk on the biki says it hasn't worked --since-- in arma 2..[mistake]

little raptor
#

It says in, not since

#

Did you test it?

steady terrace
#

very true

#

doesn't change it not working though 😄

#

1 fadeSound 0.1 should do it, right?

little raptor
#

yes

steady terrace
#

sadly it doesn't

winter rose
#

mooods

exotic flax
#

Q: I have a waitUntil which checks if a player contains a variable ```sqf
waitUntil { (_unit getVariable [QGVAR(hasUserData), false]) isEqualTo true };

Is there a way to wait till something happens, but continue if it a) contains the wrong value or b) takes too long?
little raptor
#

Let me ask a question: why isEqualTo?

hallow mortar
#

Make a separate timer loop that stores a time in a different variable, then use or in the waitUntil?

little raptor
#

Make a separate timer loop that stores a time in a different variable, then use or in the waitUntil?
notlikemeow

robust hollow
#
private _tick = diag_ticktime;
waitUntil { (_unit getVariable [QGVAR(hasUserData), false]) || (diag_ticktime - _tick) > 10 };
#

(wait 10 secs)

little raptor
#

@robust hollow

private _tick = diag_ticktime + 10;
waitUntil { (_unit getVariable [QGVAR(hasUserData), false]) || diag_ticktime > _tick};

same difference!

hallow mortar
#

essentially what I meant but I forgot about diag_tickTime

little raptor
#

You said a different loop. There was no need

robust hollow
#

hah, yea i was thinking there was a less involved way but couldnt think of it

hallow mortar
#

the principle of checking a separate timer and then using or is the same. I just forgot diag_tickTime was available to check instead of making your own timer.

exotic flax
#

hmmm.... so CBA_fnc_waitUntilAndExecute 🤔
which does all of that

little raptor
#

It's different (unscheduled). And you can't use it in the same script

exotic flax
#

why not?

little raptor
#

It runs somewhere else.

#

In an eachFrame loop. So your code has to "end" here

exotic flax
#

it doesn't...

warm hemlock
#

Hello, Is there away to make it so i dont need to fill in Marker_1 till Marker_20 like this
_Cachelocations = selectrandom ["Marker_1","Marker_2","Marker_3","etc"];

exotic flax
#

and even if... I can simply put the rest of the code in the statement (which isn't a lot), and even have alternative code in case it fails

little raptor
#

@warm hemlock a for loop?

robust hollow
warm hemlock
#

@little raptor No

_Cachelocations = selectrandom ["Marker_1"];

if (isServer) then
{
_Box1 = "rhs_mags_crate" createVehicle getmarkerpos _Cachelocations;
_House = nearestObject [position _Box1, "House"];
_Box1 setPosATL (_House buildingPos 2);
};
For this

little raptor
#

I mean use a for loop

#
_markers = [];
for "_i" from 1 to 20 do {
  _markers pushBack format ["Marker_%1", _i];
};

or even better:

_ID = 1 + floor random 20;
_marker = format ["Marker_%1", _ID ];
warm hemlock
#

Aha, never worked with that, but ill test it out!

exotic flax
#

@warm hemlock I have a simple function to fill an array with names like that:

FNC_fillArrayPrefix = {
   params ["_prefix", "_count"];

   _array = [];
   _array resize _count;
   {
      _array set [_forEachIndex, format["%1_%2", _prefix, (_forEachIndex + 1)]];
   } forEach _array;
_array
};

usage:

_markers = ["Marker", 20] call FNC_fillArrayPrefix;
// will return ["Marker_1", "Marker_2", ... , "Marker_20"]
robust hollow
#

why not just _Cachelocations = format["Marker_%1",ceil random 20]; or something?
already said 😦

little raptor
#

That looks familiar!🤔

astral tendon
#

Is there a event handler for units that got created in Alive or CBA?

warm hemlock
#

@warm hemlock I have a simple function to fill an array with names like that:

FNC_fillArrayPrefix = {
   params ["_prefix", "_count"];

   _array = [];
   _array resize _count;
   {
      _array set [_forEachIndex, format["%1_%2", _prefix, (_forEachIndex + 1)]];
   } forEach _array;
_array
};

usage:

_markers = ["Marker", 20] call FNC_fillArrayPrefix;
// will return ["Marker_1", "Marker_2", ... , "Marker_20"]

@exotic flax So id make a seperate file with the function? or keep it in the same SQF?

little raptor
#

If you want a random marker, use what Conner and I said, because it's faster

exotic flax
#

that depends on how you want to use it; I have it in a separate file (part of my framework), but the above snippet can be placed inside the same SQF file

warm hemlock
#

Aha alright

#

Thanks for the help guys, ill be playing around with it

astral tendon
#

finded this in Alive

class Extended_Init_EventHandlers {
 class Man {
  init = "_this call (compile preprocessFileLineNumbers 'my_script.sqf')";
 };
};
little raptor
#

um...so?

astral tendon
#

Yes.

potent dirge
#

Are there keyed arrays in Arma, like a dictionary

little raptor
#

what do you mean keyed?

#

indexes?

potent dirge
#

not indexed

#

Like a dictionary. Not like a list

exotic flax
#

key => value arrays don't exist in Arma, unfortunately

little raptor
#

do you mean hashmaps? I have no idea what key is in this context!

exotic flax
#
// PHP example
$array = array(
   key => value
);

^^ does not exist in Arma

potent dirge
#

Not sure what a hashmap is. A dictionary uses a unique key for each value

little raptor
#

That's also called a hash table (or hashmap)

#

Anyway, you can have something similar, but the exact thing doesn't exist as Grezvany13 said

potent dirge
#

Unfortunate, thanks for the help

warm hemlock
#

why not just _Cachelocations = format["Marker_%1",ceil random 20]; or something?
already said 😦
@robust hollow
`_Box1= [];
_Box2= [];
_Box3= [];

Cachelocations = format["Marker%1",ceil random 14];

if (isServer) then
{
_Box1 = "rhs_mags_crate" createVehicle getmarkerpos _Cachelocations;
_House = nearestObject [position _Box1, "House"];
_Box1 setPosATL (_House buildingPos 2);

_Boxloc = createMarker ["Boxloc", _box1];
_Boxloc setMarkerType "mil_destroy";
//_Boxloc setMarkerAlpha 1;

_Box2 = "rhs_mags_crate" createVehicle getmarkerpos _Cachelocations;
_House2 = nearestObject [position _Box2, "House"];
_Box2 setPosATL (_House2 buildingPos 3);

_Boxloc1 = createMarker ["Boxloc1", _box2];
_Boxloc1 setMarkerType "mil_destroy";
//_Boxloc1 setMarkerAlpha 1;

_Box3 = "rhs_mags_crate" createVehicle getmarkerpos _Cachelocations;
_House3 = nearestObject [position _Box3, "House"];
_Box3 setPosATL (_House3 buildingPos 1);

_Boxloc2 = createMarker ["Boxloc2", _box3];
_Boxloc2 setMarkerType "mil_destroy";
//_Boxloc2 setMarkerAlpha 1;

};`

Got it working sort of, but the boxes all spawn in the same house

robust hollow
#

because you only define one random cache location

#

you would need to use getmarkerpos format["Marker%1",ceil random 14]; on every createvehicle instead to have a random marker every time

warm hemlock
#

Aha

#

Now the marker doesnt spawn on it..

robust hollow
#

getmarkerpos format["Marker_%1",ceil random 14];*
just noticed your paste is using the _ for formatting

warm hemlock
#

Oh wait i see now

winter rose
#

```sqf please 🙂

little raptor
#

@robust hollow @warm hemlock Since random can return 0, you should change it to: 1 + floor random 14

warm hemlock
#

What would this do?

winter rose
#

ceil?

warm hemlock
#

the 1 + floor random 14

little raptor
#

Selects a random integer between 1 and 14

warm hemlock
#

Oh because there is no 0

little raptor
#

yes.

exotic flax
#

Random real (floating point) value from 0 (inclusive) to x (not inclusive).

little raptor
#

ceil 0 = 0

winter rose
#

lies!

exotic flax
#

ceil 0.0000000001 = 1

little raptor
#

Oh right. Arma uses floats all the time meowsweats

warm hemlock
#

Its not very reliable, sometimes it spawns 2 or 3 or non ar all

tiny wadi
#

Instead of doing this:

vectorNormalized ((_truck modelToWorld [0, 1, 0]) vectorDiff (_truck modelToWorld [0, -1, 0]))```
Should I do this?
```sqf
vectorDir _truck;```
#

I assume they're the same thing, not sure exactly why I wrote it the first way

warm hemlock
#

I think it has something to do with this _House3 = nearestObject [position _Box3, "House"]; because it only spawns in 1 type of house

little raptor
#

@tiny wadi Yes. Plus, there's always: vectorModelToWorld
Long story short: object vectorModelToWorld [0,1,0] is the same as vectorDir object

tiny wadi
#

Ah okay

#

Thanks!

copper needle
#

If I have an array like [1, 7, 2, 1, 1] what can I use to return the number of 1s and there positions?

exotic flax
#

probably something like this

_foundOnes = [];
{
   if (_x isEqualTo 1) then {
      _foundOnes pushBack _forEachIndex;
   };
} forEach [1, 7, 2, 1, 1];
copper needle
#

perfect thanks!

little raptor
#

WHY?! Jeez.

exotic flax
#

What my son?

little raptor
#

why do you loop through the array?

exotic flax
#

got a better solution?

little raptor
#

nvm he asked for indexes not the elements

exotic flax
#

read before shouting 😉 it helps

little raptor
#

what can I use to return the number of 1s
I stopped at here. and I read it as number 1s

cold glacier
#

do you mean hashmaps? I have no idea what key is in this context!
@little raptor Hashmaps/associative arrays/dictionaries are all language-specific names for a "Map" style data structure, that takes a "key", and retrieves a "value" associated with that key very quickly. They "map" a key to a value. "Hashmap" (which is the Java name) is implemented using a hash table, hence the name. Java also has a "TreeMap", which is internally implemented using a search tree, which has different performance characteristics. (No idea if this was interesting, but thought I'd clear up the terminology 🙂 )

@potent dirge - The closest Arma has right now is objects or locations, which you can create and use "setVariable" and "getVariable" to set and retrieve values on. (https://community.bistudio.com/wiki/setVariable). CBA implements this as "namespaces" (https://github.com/CBATeam/CBA_A3/blob/master/addons/common/fnc_createNamespace.sqf). However namespaces are not automatically garbage collected - i.e, when you're done using them and no longer reference them from any variables, they don't get deleted. This makes it really, really easy to accidentally leave them lying around (leak them), which is something to avoid. This makes them impractical for a lot of use cases, I find.

CBA also has a "map" implementation, sort of, in its "hashes" library - but I'd steer clear of it personally, as SQF-based hash tables have really quite poor performance, because SQF is incredibly damn slow as a language. Use sparingly.
(https://cbateam.github.io/CBA_A3/docs/files/hashes/fnc_hashCreate-sqf.html).

It's possible to try implementing your own too, but as mentioned above, SQF implementations I always find to be too slow to be practical if they're being accessed regularly.

winter rose
#

there are also BIS fnc key-value pair functions somewhere

astral dawn
#

This makes them impractical for a lot of use cases, I find.
@cold glacier Why? Just manage own memory manually and it will be good 🤷

#

It's totally usable for everything which has a life span of a mission, because it is collected when mission is unloaded.

#

For stuff which is more short-lived, yes it's annoying, but I can't think of a situation where it would prevent someone like you from using it if it's needed. 🤔

cold glacier
#

I generally use it that way @astral dawn - Mission-length lifespan, or areas where I can be very, very careful with allocation and deallocation.

#

I also use it where there's a need to remove other objects anyway, such as when the lifespan of a namespace is tied to that of a building.

#

I'm always wary of them, as guaranteeing deallocation in Arma is a pain, since there's (to my knowlede), very few ways to be 100% sure code will run, even in the situation where there's errors.

#

It's also tricky if you plan to share that namespace widely, as either:

  • Bits of code that don't "own" the namespace, need to be prepared to deal with it being deleted at any point
  • Something like reference counting needs manually adding.
#

I imagine it's a little bit easier for you with the destructors in your OOP implementation though.

#

Tl;DR I use them, but sparingly, because manually managing de-allocation reponsibilities when they're widely used is a pain in the ass 😛

violet gull
#

fadeSpeech does nothing in Arma 3, right?

cosmic lichen
#

fadeSpeech does nothing in Arma 3, right?
@violet gull It should work. At least there is nothing documented about it not working in A3

violet gull
#

Haven't noticed a difference with fadeSpeech 0 and 1, plus there's no speechVolume command that I can see

#

There's radioVolume, soundVolume, and musicVolume only (And getPlayerVONVolume)

#

Was gonna experiment to see if it effects Direct channel volume at all, but I doubt it festivepepe

still forum
#

@cold glacier CBA hash is not a hash, its just a key-value array thing.

idle jungle
#

ah should that have been in troubleshooting? :/

#

ill move my post and remove this one ^above^

cold glacier
#

@still forum - Aye, worth pointing out, cheers. It's a map implementation, not a true hash-based lookup. Not quite sure why they called it "hashes", bit of a misleading name.

still forum
#

because to the outside it looks like a hash

astral dawn
#

Hash should have constant lookup time, and the cba thing is linear as I know

#

IIRC it uses find internally

still forum
#

yes

jade abyss
#

Hash should have constant lookup time, and the cba thing is linear as I know
IIRC it uses find internally
@astral dawn That's why having 2 arrays, one with the tags, the other one with the value, so much faster than (prolly) almost anything else.

trail smelt
#

has anyone tried "XY addAction" to "this addAction"?

little raptor
#

?

trail smelt
#

I need addAction which do addAction to object

little raptor
#

Use the object as the left hand argument

#

object addAction [...]

worn forge
#

@trail smelt it also matters where you are trying to run this command. Are you inputing it in the "init" box in the Eden editor? Running it in the debug window while the game is running? Using a script file? this is very specific

trail smelt
#

i thing first object1 addAction [object1 addAction [..]], in eden init

#

first action named "X" add action to same object named "Y"

little raptor
#

So you want to use addAction to add another action to the object?

trail smelt
#

Yes

little raptor
trail smelt
#

Thanks ❤️

#

is it still possible to somehow implement sleep between two functions in addAction?

little raptor
#

Yes. It is scheduled.

object1 addAction ["Action X", {
  params ["_object"];
  _object addAction ["Action Y", {}];
  sleep 1;
  hint "Action Added 1 second ago!";
}];
trail smelt
#
keyboard addAction ["Zapnout stahování", {mainlcd setObjectTextureGlobal [0, "pic\armed.jpg"];keyboard say3D ["music1", 1000, 1];keyboard1 removeAction (_this select 2);sleep 25;
  params ["_object"]; 
  _object addAction ["Dokončit stahování", {mainlcd setObjectTextureGlobal [0, "pic\disarmed.jpg"];keyboard say3D ["music1", 1000, 1];keyboard1 removeAction (_this select 2);}] 
}];```
#

Thanks for help 🙂 😄

little raptor
#

@trail smelt See the pinned messages to see how to add syntax highlighting to the code.
There was no need for params ["_keyboard1"]; at the beginning. Since you have given global names to your objects, there's no need for params ["_object"] either.

keyboard addAction ["Zapnout stahování", {
  //params ["_keyboard"]; 
  mainlcd setObjectTextureGlobal [0, "pic\armed.jpg"];
  keyboard say3D ["music1", 1000, 1];
  keyboard removeAction (_this select 2);
  sleep 25;
  
  keyboard addAction ["Dokončit stahování", {
  mainlcd setObjectTextureGlobal [0, "pic\disarmed.jpg"];
  keyboard say3D ["music1", 1000, 1];}] 
}];
#

Thanks for help 🙂 😄
np

worn forge
#

It's important to consider what context you're adding that addAction into; if you are creating a multiplayer mission, and putting that addAction in the init field of an object, that script will be run every time a client joins the mission. So if 20 clients join, object1 should get 20 addActions added to it.

astral dawn
#

@astral dawn That's why having 2 arrays, one with the tags, the other one with the value, so much faster than (prolly) almost anything else.
@jade abyss
It's still a linear search and it's not faster than getvariable if there are lots of values

#

Lots like... 100 or so I think

#

But it's probably best implementation right now.

jade abyss
#

Never said that it's faster than getVar - "almost"
getVar is still, by far, the better choice. But... yeah... still annoying.

astral tendon
#

is there a way to get a array of faces that a faction uses?

winter rose
#

I would guess yes through config

hidden bane
#

So, I'm pretty new to scripting and I am wanting to have three sqf scripts activate at the same time at the start of a mission file, but I'm having some trouble.

#

It only executes the first sqf in the line and ignores the others. Any way to fix that?

worn forge
#

We'd need to know what the scripts have in 'em. First step will be to check your .rpt file to see if there are any errors

hidden bane
#

It's ALIAScartoon's scripts; specifically the Worm, Twins, and Screamer.

worn forge
#

Means zip to me. You may want to contact the script owner.

hidden bane
#

This is what I got in the init.sqf


enableEnvironment [false, true];

/*
Example: how to delay the script until units are in area, so Screamer will sort of ambush
the variable units_in_area will be made true via a trigger placed on map in desired location
units_in_area = false;
publicVariable "units_in_area";
waitUntil {units_in_area}; - this line must be before script command
*/

null=["screamer_1"] execvm "AL_screamer\screamer.sqf"

null=[tow_1,800,true,70,true,true] execvm "AL_twins\twins.sqf"

sleep 7;

null=["worm_1"] execvm "AL_worm\worm.sqf"```
#

Yeah, I'm in the process of doing so

worn forge
#

Only thing I could guess would be "scream_1" is referring to an object and does not need to be in quotes, but I have no knowledge of what those scripts do

#

Similarly with "worm_1"

hidden bane
#

To my understanding, scream_1 and worm_1 relates to a marker that I put down also named scream_1 or worm_1 in Eden Editor*

On that specific marker, it will have a set range that if a player walks within a certain vicinity of the defined marker, it will activate the script

worn forge
#

Well then sounds like it's set up correctly, markers are located by strings

#

Technically you don't need null= at the beginning of those lines

hidden bane
#

The only one that's different is the Twin which I put down and create as this entity. It will then have Weeping Angel mechanics.

#

While Screamer and Worm are based on a trigger within an area and are their own models

worn forge
#

If you're not running on a dedicated server this line
if ((!isServer) && (player != player)) then {waitUntil {player == player};};
could be an issue; when you run a local multiplayer session you're technically both the server and a player... frankly I'm not sure how this line is important to your use case

hidden bane
#

So would deleting it be beneficial?

#

Again, I'm new to scripting haha I'm just trying to make something cool

trail smelt
#

It's important to consider what context you're adding that addAction into; if you are creating a multiplayer mission, and putting that addAction in the init field of an object, that script will be run every time a client joins the mission. So if 20 clients join, object1 should get 20 addActions added to it.
@worn forge Yea its for clan game ... (only after all players are connected game start ..)

worn forge
#

Fox I think the intent of the line is to delay it so that the player has fully loaded in before the scripts are run, you'd have to test with and without to see if it's necessary

hidden bane
#

Have done so far, but the problem still persists. When I start the mission file, it will only execute the first line it comes across which would be the screamer_1, but ignore the other two below it.

#

So it'd only spawn 1 entity instead of the 3.

#

The init.sqf when executed pulls from other sqf's to run them plus pulling from a sound file with custom sounds.

compact maple
winter rose
#

hummm… yes? 😁

little raptor
#

Did you mean me?

winter rose
#

it's @little raptor that helped you yes ^^

#

@compact maple ↑ 🙂

compact maple
#

Oh my bad

#

sorry

winter rose
#

np ^^ hehe

little raptor
#

@compact maple Well, that's the head model you were looking for!

model="\A3\ui_f\objects\face_preview";
#

What about what I said? That didn't work either?

compact maple
#

yup saw that 🙂

little raptor
#

compact maple
#

didnt took the time to try it

#

will tell you when I test it :p

little raptor
#

@compact maple Also, I read the topic very briefly. It wasn't tested properly. It could still work. They simply spawned the display and were like : "No head? It doesn't work"
I think the head didn't have any textures. It probably has hidden selections, and if so you can apply the texture to make the head visible.

#

you can try spawning the head model as a regular object, see if I'm right about that

compact maple
#

Maybe they didnt applied the texture yeah

#

Yes I will first try your alternative

compact maple
#

In this part:

model = "\A3\blah";

I have to set the path to the 3d man model right ?

winter rose
compact maple
#

oops

little raptor
#

@compact maple anyway, yes

compact maple
#

The problem is I don't know how to set a texture on a model ctrl

little raptor
#

Right. it might not be possible. I just realized! 😟

#

I thought there would be a command for that

#

There's just one command for animating the model

compact maple
#

I searched for it, but I dont think it exists

#

yup

little raptor
#

@compact maple Are you making a mission?

compact maple
#

yup

little raptor
#

I had one idea. Let me see if it works

compact maple
#

Sure, thanks 🙂

#

Im having a hard time finding what I need in the config/functions splendid viewer

little raptor
#

There is of course one more solution. But I want to see if the head thing works.

#

@compact maple is it ok if the heads are all vanilla?

compact maple
#

Sure!

jaunty zephyr
viral basin
#

Hey there, I tried to use _vehicle setOwner 3 on my dedicated server to transfer the locality to the client but it returned false and didn't change the ownership. Is it broken or does the command not work with vehicles?

winter rose
#

any crew in it?

viral basin
#

no completely empty

torn juniper
winter rose
#

…what is it that you encounter? might be faster to start with that 🙃

torn juniper
#

me? I am not encountering anything extra

little raptor
#

@compact maple I couldn't get it to work.
You can still use the other method, altho in a different way.

_head = "B_soldier_F" createVehicleLocal [0,0,1000];
_head setUnitLoadout [[],[],[],["U_C_Driver_1_black",[]],[],[],"","",[],["","","","","",""]];
_head enableSimulation false;
_head setObjectTexture [0, ""];
_head setPosASL [0,0,1e3];

Then create a display, with an empty "window" region to show the "head" in.
You're gonna need a camera object. Set its position so that it faces the head. e.g:

_cam = "camera" camCreate ASLToAGL (eyePos _head vectorAdd (_head vectorModelToWorld [0,0.5,0]));    
_cam setVectorDirAndUp [_head vectorModelToWorld [0,-1,0], [0,0,1]];
switchCamera _cam;

The position must be aligned with the "window" tho. With this setup the window is assumed to be at the center of the display.
You can also create a background object, such as a big VR block, so that the "sky" is not visible.
A light source might also be necessary to show the head in the dark.

torn juniper
#

Just wondering if there is anything known about the command that isn't on the wiki that I have to look out for. Besides the mag refill bug for the command

winter rose
#

well, if one encounters anything it shalt be added to the biki

torn juniper
#

fair 😛

winter rose
#

so far, the wiki is up-to-date afaik :p

torn juniper
#

It works as best at it can get for a player version of addweaponwithattachments that I was seeking out the other day

#

no cutting of outfit/bag.. besides that one hiccup 😄

compact maple
#

@little raptor wow! thanks for your help man, I'm going to try this out with my dialog 🙂

#

(just realized I cant put a cam into a ctrl)

little raptor
#

@compact maple No problem. There's also another way. Using render to texture like I mentioned before. In case you don't know what it is, if you happen to have noticed the vehicle mirrors in Arma, they're also r2t; basically a low quality texture captured from the world. (like a snapshot)

#

just realized I cant put a cam into a ctrl

#

you can't. you have to do it in the world

compact maple
#

I see what is it, like looking at a window/mirror and see trees in it, but there are no trees around you lol

#

yup but I already did a script camera that displays the world randomly while the player is in the dialog

little raptor
#

It's still ok. You can use the same camera.

#

Instead of putting the camera in front of the face, you put the face behind the camera!

#

Anyway, you can always use r2t

#

without the uav part of course!

compact maple
#

I see, thats cool

little raptor
#

yeah. same thing as before. except no need to switch to the camera

torn juniper
#

Fix for the setUnitLoadout ammo bug https://pastebin.com/SHX41Jkk would have to compile that code into a function but yea, that cleans out loadouts and arma applies them correctly without refilling ammo bug

little raptor
#

Question: Does anyone know if it's possible to somehow save the return of a function as nil when it doesn't return anything?
This expression gives a generic error:

_result = [] call {a=1};
still forum
#

_result = [] call {a=1; nil};

#

your function doesnt return nil

little raptor
#

Yeah but I don't know the function

#

I'm making a "debug console"

#

Do you happen to know how the vanilla debug console does that?

still forum
#

there is some trick with apply

little raptor
#

Thnx. I'll check it out!

still forum
#

CBA surely uses it somewhere, probably in their XEH system

#

or maybe param or smth

#

maybe

#

[[] call {a=1}] param [0]

#

smth like that?

little raptor
#

Thanks a lot! Apply worked:

[nil] apply {[] call {a = 1}} select 0
#

I'll also test param

#

It didn't work. It's also a generic error

#

But thanks anyway!

brave jewel
#
_group = [[0,0,0], west, ["B_Soldier_TL_F", "B_Soldier_F", "B_soldier_AR_F", "B_soldier_LAT2_F","B_soldier_M_F","B_Soldier_SL_F","B_Soldier_F"]] call BIS_fnc_spawnGroup;
hint str (_group);

keeps telling me _group is undefined. no idea why. send help pls notlikemeowcry

little raptor
#

I don't see anything wrong

brave jewel
#

I might post the whole script if you mind

little raptor
#

And it works for me in editor

#

I might post the whole script if you mind
Yeah do that. The problem isn't here

brave jewel
#
_count = _this select 0;

        if (_count > 6) then {

            _group = [[0,0,0], west, ["B_Soldier_TL_F", "B_Soldier_F", "B_soldier_AR_F", "B_soldier_LAT2_F","B_soldier_M_F","B_Soldier_SL_F","B_Soldier_F"]] call BIS_fnc_spawnGroup;

        };

        if (_count >= 6 && isNil "_group") then {

            _group = [[0,0,0], west, ["B_Soldier_TL_F", "B_Soldier_F", "B_soldier_AR_F", "B_soldier_LAT2_F","B_soldier_M_F","B_Soldier_SL_F"]] call BIS_fnc_spawnGroup;

        };
        if (_count >= 5 && isNil "_group") then {

            _group = [[0,0,0], west, ["B_Soldier_TL_F", "B_Soldier_F", "B_soldier_AR_F", "B_soldier_LAT2_F","B_soldier_M_F"]] call BIS_fnc_spawnGroup;

        };
        if (_count >= 4 && isNil "_group") then {

            _group = [[0,0,0], west, ["B_Soldier_TL_F", "B_Soldier_F", "B_soldier_AR_F", "B_soldier_LAT2_F"]] call BIS_fnc_spawnGroup;

        };

        if (_count < 4 && isNil "_group") exitWith {};

hint str (_group);

        /*
        if (local _grp) then {
            _grp deleteGroupWhenEmpty true;
        } else {
            [_grp, true] remoteExec ["deleteGroupWhenEmpty", groupOwner _grp];
        };
    */

        _bluTransport = createVehicle ["B_Heli_Transport_01_F", getPos bluSpawn, [], 0, "FLY"];
        _bluTransportCrew = createVehicleCrew _bluTransport;

        //{_x moveInCargo _bluTransport; _x assignAsCargo _bluTransport;} forEach units group _group;

little raptor
#

Group is not defined outside the scope

brave jewel
#

for real T_T

little raptor
#
private ["_group"]
#

Put this at the start

brave jewel
#

If this will solve it, I will praise you as a god

#

It works, thanks a lot Leopard20! 🙂

little raptor
#

no problem

#

I would also like to advise you to change the structure of your code

brave jewel
#

I guess with a switch?

little raptor
#

with exitWith

#

for example

brave jewel
#
        if (_count > 6) exitWith {

            _group = [[0,0,0], west, ["B_Soldier_TL_F", "B_Soldier_F", "B_soldier_AR_F", "B_soldier_LAT2_F","B_soldier_M_F","B_Soldier_SL_F","B_Soldier_F"]] call BIS_fnc_spawnGroup;

            _bluTransport = createVehicle ["B_Heli_Transport_01_F", getPos bluSpawn, [], 0, "FLY"];
            _bluTransportCrew = createVehicleCrew _bluTransport;

            {_x moveInCargo _bluTransport; _x assignAsCargo _bluTransport;} forEach units _group;
        };
``` I guess you mean like this?
little raptor
#
_group = call {
  if (_count >= 6) exitWith {
    [[0,0,0], west, ["B_Soldier_TL_F", "B_Soldier_F", "B_soldier_AR_F", "B_soldier_LAT2_F","B_soldier_M_F","B_Soldier_SL_F"]] call BIS_fnc_spawnGroup;
  };
  if (_count >= 5) exitWith {
    ....
  };
  if (_count >= 3) exitWith {
     ...
  };
};
#

As you can see, the expressions are designed so that there's no "gap" between them

brave jewel
#

I see

#

Never been that familiar with ```sqf
call

little raptor
#

the structure I wrote is very similar to switch

#

But faster

brave jewel
#

Oh! Thats good to know, thank you

little raptor
#

There are still better and faster ways, but they might be confusing

brave jewel
#

probably haha

#

so I also don't need the isNil part right? because the script gets exited anyways

little raptor
#

yeah. I don't see any way where _group could become nil

brave jewel
#

true lul

violet gull
#

My radio script utilizes displayEventHandlers for display 46 (Main game) and findDisplay 312 (Zeus). However, if any dialog pops up, the eventHandlers pause. I'm assuming due to a new display being created and set as the focus or something? How can I detect the display that is causing display 46 to pause so I can recreate the DEHs for that new display?

robust hollow
#

you'd probably need to either manually add events in the scripts where each display is opened, or use some loop to check the displays in allDisplays against displayParent to add to displays that are children of display 46/312. that may not be 100% reliable though 🤔 you could also simply add events to all displays after display 46/312 in allDisplays, but thats ugly.

violet gull
#

I'm thinking displayParent

robust hollow
#

wouldnt mind having a onChildCreated ui event for situations like this tbh.
or an onDisplayCreated (not sure if createDialog counts as a child of an existing display the first createDialog display has no parent, but using createDialog while one is already open creates the new display as a child of the one before it)

violet gull
#

I'll look into it, thanks 🙂

trail smelt
#

Hello :)

//video.sqf:
scopeName "main6";
while{true}do{
 mainlcd setobjecttexture [0,"vid\lb.ogv"];
["vid\lb.ogv",[10,10]] spawn bis_fnc_playvideo;
 sleep 28;
 if (!alive TV) then {
  breakTo "main6";
 }; 
};

I use this script to play ogv on the object but after activation video playing is looped, any advice please?

willow hound
#

It's... in a while loop...

runic edge
#

Hello guys, quick question about variables names. Does the vehicle respawn module ModuleRespawnVehicle_F keep and restore variable names upon respawn ?
Cheers

crude vigil
#

@runic edge yes,iirc.

runic edge
#

nice, thanks man !

trail smelt
#
//video.sqf:
scopeName "main6";
while{true}do{
 mainlcd setobjecttexture [0,"vid\lb.ogv"];
["vid\lb.ogv",[10,10]] spawn bis_fnc_playvideo;
 sleep 28;
 if (!alive ObjectX) then {
  breakOut "main6";
 }; 
};

and after activate this sqf use this command..

objectX setDamage [1, false];

After 6 hours i did it..

winter rose
#
 if (!alive TV) then {
  breakOut "ObjectX";
 }; 
``` `exitWith`?
unique sundial
#

and after activate this sqf use this command..
makes 0 sense

#

TV setDamage 1; maybe?

still forum
#

ObjectX scopeName is also never set as far as I can see

trail smelt
#

I'm sorry I swapped it

unique sundial
still forum
#

how about
while{alive ObjectX} do {
instead of your weird if and breakOut thing

little raptor
#

I was literally gonna say that

still forum
#

but you didnt

finite sail
#

The God of reboot. He smite me

spice vigil
#

Hello, is there an event handler that automatically switches between a weapons primary and underbarrel weapon every time you fire?

compact maple
#

These two cmd are ok to be used ? allPlayers / call BIS_fnc_listPlayers

#

@spice vigil Hi, you can add a Fired EH & manually switch ?

winter rose
#

@compact maple well, each have their specificities

compact maple
#

yea, as I only want real player I will probably pick the function

spice vigil
#

Thanks for info, follow up question though because of my lack of knowledge. What is a manually switch command? (is there a link to the wiki page?)

low zodiac
#

I need some help for a teleport trigger: My plan is to teleport a boat and his crew to a location via trigger. But how can I do this? (Tried with player setPos (getPos xy, but didn't work) Thanks in advance!

winter rose
#

@low zodiac show script? because it should work

#

@spice vigil see selectWeapon on the wiki 🙂

spice vigil
#

cheers

low zodiac
#

I've put the script in the init in the Trigger, don't know if i need to make a sqf file: boat setPos (getPos marker1). [Not sure if I correctly remember, as I am not ingame anymore.]

amber inlet
#

Yo

manic sigil
#

@amber inlet To follow up from General; AttachTo attaches one object to another, while setVectorDirAndUp changes the heading and other factors of how the object sits.

amber inlet
#

So if i want to attach it to the top of the bench where do i put in the command

manic sigil
#

AttachTo uses a straightforward system,

A attachTo [B [How far back on the X axis, Y axis, and Z Axis you want it]]

So in your case;

Backpack attachTo [Table [0,0,0]]

#

You have to name the objects, first.

#

Done in their properties window, Variable Name

#

And Backpack won't work, since it's a used script name - you can use it to see what backpack a unit has, etc

amber inlet
#

Says im missing ; but i put it in already

#

I put the coordinates of the bag in

#

On bag init

manic sigil
#

Hrm, I'm tooling around with it too

amber inlet
#

Ok

low zodiac
#

I've put the script in the init of the Trigger, don't know if i need to make a sqf file: boat setPos (getPos marker1). [Not sure if I correctly remember, as I am not ingame anymore.]
@winter rose ^

manic sigil
#

Lovely, looks like backpacks cant be attachTo'd xD

amber inlet
#

Ah thanks anyways its fine under the bench lol

#

Im just glad it shows up

#

Maybe ill attach it to my squad buddy’s face and see if that works lol

#

And have him crab crawl all the way to extraction

#

😆

winter rose
#

@low zodiac no need to bump
also, what you want is getMarkerPos "marker1"

low zodiac
#

Sorry for ping and thank you! Will try later.

winter rose
#

should work, np keep me posted

low zodiac
#

kk

amber inlet
#

If i put a dlc weapon in a box will the people without the dlc still be able to play the mission? I assume they will only see the weapon in the box but not be able to use it

winter rose
#

correct

#

they simply cannot pick it up.

#

also, don't crosspost (#rules) @amber inlet

amber inlet
#

Ok its awesome that the devs did it that way, thanks

#

Gotcha

#

👍🏽

#

So i can use dlc vehicles but just not enter them if i dont have a dlc?

#

Ive been avoiding using anything besides apex and regular content

manic sigil
#

They can passenger, but can't crew

winter rose
median cairn
#

Heyo!
I'm trying to make an insignia appear on players when we load in.
Currently, it doesn't seem to be working in multiplayer for people when they respawn. (Tested on locally hosted server where I also play in client)

Code wise:
Description.Ext:

respawnOnStart = -1; // So it runs initPlayerLocal.sqf first, and doesn't run onPlayerRespawn until after the player respawns

initPlayerLocal.sqf:

_storePatch = [player] call BIS_fnc_getUnitInsignia;      // Gets player Insignia pre-set in Identity in Eden Editor
uiNameSpace setVariable ["StoredUnitPatch", _storePatch];    // Sets player Insignia as "StoredUnitPatch"
// _storedPatch = uiNameSpace getVariable "StoredUnitPatch"; // Gets data from "StoredUnitPatch" as _storedPatch    
// hint str _storedPatch;                                    // Tests to check if StoredUnitPatch gets & sets correctly - it does so commented out

onPlayerRespawn.SQF:

storedPatch = uiNameSpace getVariable "StoredUnitPatch"; // Gets "StoredUnitPatch" as storedPatch
hint storedPatch;                                           // Checks if storedPatch has got successfully
[player, ""] call BIS_fnc_setUnitInsignia;                  // Resets Insignia if none there
[player, storedPatch] call BIS_fnc_setUnitInsignia;         // sets unit Insignia with data in 

I have also changed position of code. Instead of _storePatch in initPlayerLocal.sqf, I commented it out and instead:
In the player's init - [this] ExecVM "savedPatch.sqf";

savedPatch.sqf:

_storePatch = [player] call BIS_fnc_getUnitInsignia;
uiNameSpace setVariable ["StoredUnitPatch", _storePatch];

Does anyone have any advice as to how I could get it on via multiplayer?
Do I need to do a wait until or an init Event Handler with waitUntil getClientState or something to make it work?
Thanks
(Edit 1 - Added sqf for readability)

amber inlet
#

So i can use the dlc jets to fight each other and still be able to play in a mission. I figure i wouldnt be able to do a mission with dlc content required but required is kinda grey

#

Say the main character has a ghillie and weapon from marksmen dlc but i dont , in that situation i wouldnt be able to play right?

median cairn
#

Roaring - I could be wrong, but unless the mission maker has stated in the attributes that you need the dlc, you should be able to play.
If you spawn in the DLC ghillie & weapon, you'll be able to play but if you drop it, you will not be able to pick it back up.

Also: The DLC overlay will appear. ```Weapons Restrictions:

  • Cannot be picked up from a box, a corpse, or anywhere else.
  • If added by script or already provided, the DLC ads overlay will appear more and more frequently.``` with the link Lou linked
winter rose
#

if player 1 has DLC and DLC weapons, it doesn't matter if player 2 has the DLC or not

amber inlet
#

Hmm so could i technically start inside a dlc jet if i dont own jets dlc as long as i dont get out?

#

As dlc creator

#

As creator i mean

winter rose
#

yes

#

you will have more and more ads, that's it

amber inlet
#

The ads in loading screen?

winter rose
#

no, on top of your game screen

amber inlet
#

Oh i guess i havent been in that situation to see it yet, its cool that they still let you play it

winter rose
amber inlet
#

Oohh lol

#

I’d rather avoid that lol

#

But its nice to let us check the content out with that to test it out

#

Thanks

winter rose
#

little by little, it's not immediately a full screen ad 😄

#

but yeah, play 10, 20, 30 minutes with DLC content… etc

urban cloak
#

Hey guys i dont know if this is the right place to ask this since im not even remotely good at scripting, But im trying to edit the BMR Insurgency mission Malden by jigor and just for like a private group of like 5 people, we wanted to replace the BTC revive with the standard Arma 3 respawn system to have it work with PIR. Ive tried just out right deleteing the BTC revive and quick revive scrips in the PBO but it seems to just remove all the slots and paramamerters when i do that

winter rose
#

ask jigor for help/advice - it is their mission after all

amber inlet
#

My trigger got messed up after i moved it back , it appear to be under the sea dirt the coordinates are fine

low zodiac
#

no need to bump
also, what you want is getMarkerPos "marker1"
Worked, thanks Lou!

amber inlet
#

I put the size 100k for it and it still doesnt show up maybe it bugged out

amber inlet
#

What’s script for a task to be completed upon 1 certain guy dying? It’s alive something

median cairn
#

Though Lou's is probably more optimised for multiple checks

amber inlet
#

Thanks

#

I got another question. I can get a task to show notification after i complete the first task. Any ideas?

#

I can’t get a notification

little raptor
#

Use the tasking framework

#

And an event handler to change the task state when that guy dies

median cairn
#

I tend to use triggers. I link a trigger to the Set Task State, which links back to the original Task Create

amber inlet
#

I linked them to triggers but once i entered the condition !alivee1 it stopped working

median cairn
#

Try in the conditions box:
!alive e1
instead, make sure there is a space

amber inlet
#

Oh ok

#

Also im trying the task to pop up when i enter the trigger not when i take the guy out right

median cairn
#

You will want a different trigger for that then. I tend to use 2 triggers.
One to start the task, one to finish it

amber inlet
#

Thats what i need

#

2 triggers

#

Go ahead

median cairn
#

Trigger 1 linked to the Create Task, activated when you enter (condition = this )
Trigger 2 Linked to the Set Task State, activated when the enemy dies (condition = `!alive e1)
Set Task State linked to the create task, make sure to set it to the complete (tick) icon in the module

amber inlet
#

Do i need to put a trigger on the guy then?

#

Ok cool

little raptor
#

This discussion has nothing to do with scripting anymore. Take it to #arma3_editor

amber inlet
#

Ok thx

brave jewel
#

Hey there it's me again. I have another problem:

I am currently creating a conquest mission and I want the Sector Tactics Module to also "command" AI spawned via script. I've tried to synchronize them with ```sqf
{_x synchronizeObjectsAdd ["var_SPAWN_AI_MODULE"]}forEach units _group;

and also with ```sqf
{_x synchronizeObjectsAdd ["var_SECTOR_TACTICS_MODULE"]}forEach units _group;

but none of them worked. They refuse to move.

little raptor
#

That's not an object

robust hollow
#

well... synchronizeObjectsAdd expects an array of objects as the second argument

little raptor
#

You're providing an array of strings right now

robust hollow
#

_module synchronizeObjectsAdd units _group is probably what you want

#

(replace _module with your module var)

little raptor
#

Although maybe the group alone works too?

#

I'm not familiar with that module

robust hollow
#

wiki doesnt say anything about a group for the command

brave jewel
#

(replace _module with your module var)
@robust hollow those vars were only for the purpose of showing hehe

#

Okay so this will probably sync the whole group the module right?

#

also, do I need to sync them to the Spawn AI Module or with the Sector Tactics Module?

amber inlet
#

Whats the script to make 1 task wait for another one to be completed first?

little raptor
#

what kind of task?

amber inlet
#

One for go here and one for a kill task

#

Do i sync 2 tasks to each other?

little raptor
#

No.

#

That depends

#

How do the tasks get completed?

amber inlet
#

First one i just walk into the trigger, then the second kill a certain guy

little raptor
#

So the guy has to dead before the first task is completed?

amber inlet
#

No. First one is a go here, then the second activates when i walk into it. They’re both in the same house, but the guy is km away

#

Its doing what i want just nit picking really, i dont expext anyone to go to the back of the house to activate the second task trigger but they could

little raptor
#

So you want the second one to appear after you've gone there right?

  1. Go to house.
  2. Go to second floor (or something)
    ?
amber inlet
#

No i just want to null the second trigger while im walking in it until the first one is complete

little raptor
#

Change the completion code of the first trigger

#

For example, disable the second trigger in editor (uncheck Simulation)
Then, put this in the on Activation code of the first trigger:

trigger2 enableSimulationGlobal true
#

trigger2 is the name of the second trigger, of course

amber inlet
#

Ok

#

Thanks

little raptor
#

actually

#

I just noticed the the simulation checkbox doesn't show for triggers

#

You may have to do it manually

brave jewel
#

Hm I tried ```sqf
sector_tactic synchronizeObjectsAdd units _group;
//and
spawn_ai_blu synchronizeObjectsAdd units _group;


But they still don't move. Any other Ideas?
amber inlet
#

Dude, i can just make the trigger bigger to make it impossible for then to reach the 2nd one first lol

#

Dunno why i didnt think of that earlier

#

It doesnt matter of they overlap

little raptor
#

@brave jewel

amber inlet
#

I came across another issue tho. I want to creat a final 3rd take to go here for extraction after i kill the !alive guy. Whats a good way to set that up? I dunno where to put the 3rd trigger

#

*task

#

3rd task*

little raptor
#

you have to create it dynamically (script it)

amber inlet
#

Ah dunno how

brave jewel
#

Yea I've read this before posting here, it only says that you can sync editor placed units to the SPAWN AI Module to include them to the manpower cap

little raptor
#

It says the tactics module doesn't need syncing

#

Insert the Spawn AI: Sector Tactics module (Modules > Mics > Spawn AI: Sector Tactics). No synchronization needed

brave jewel
#

Yea the tactics module doesn't need to be synced with the spawn AI module

#

they are not synced in my mission

little raptor
#

maybe the problem is somewhere else again. not the syncing

brave jewel
#

I want script spawned AI to utilize the sector tactics module

#

But they don't 😦

little raptor
amber inlet
#

Thank you

little raptor
#

@brave jewel How did you define the sectors? using that guide?

brave jewel
#

Sector Control Module -synced with- Sector Module -synced with- Area GL -synced with- trigger (for area size)

#

of course the Sector Control Module is synced with each faction

little raptor
#

If you use the spawn AI module, do the AI move?

brave jewel
#

Well, the thing is: I do not use the Spawn AI Module to spawn AI, but infact I need it for the Sector Tactics Module to work

#

If I only use the Sector Tactic Module it gives me an error

little raptor
#

I'd say it's better to test it to make sure that your scenario works before trying to fix that problem (maybe your scenario is set up wrong)

brave jewel
#

hm thats true, brb 2 minutes

#

Yep, AI Spawns and goes their way

little raptor
#

@brave jewel According to this function: BIS_fnc_moduleSpawnAISectorTactic

#

The code runs only once

#

That's why it won't work afterwards

#

I will see if there's a workaround

brave jewel
#

Hmm, is there a way to "refresh" a module?

#

I guess it runs once everytime a group spawns through Spawn AI Module and runs only for their group

little raptor
#

yes

brave jewel
#

I mean I could just write a whole new AI Movement Script, but why shouldn't I just use the sector tactics to go for this. Especially when new groups are spawned dynamically

little raptor
#

@brave jewel I think I got it

brave jewel
#

Well I'm not finding anything 😂

little raptor
#

How many of these spawnAI modules do you have?

brave jewel
#

Right now only one for BLUFOR

#

I am spawning the Group with ```sqf
_group = [getPos hpadblu, west, ["B_Soldier_TL_F", "B_Soldier_F", "B_soldier_AR_F", "B_soldier_LAT2_F","B_soldier_M_F","B_Soldier_SL_F","B_Soldier_F"]] call BIS_fnc_spawnGroup;

little raptor
#

One thing you can try is:

[_group, _spawnAIModule, [0,0,0, count units _group, 0, "infantry"]] execVM "\A3\Modules_F_Heli\Misc\Functions\ModuleSpawnAISectorTactic\initGroup.sqf"
#

Not sure if it works, but that's the part that initializes the group so that the they could capture the sector

brave jewel
#

what are all those arguments for? 😮

little raptor
#

Those number 0s I wasn't sure what they were. They could cause an error

brave jewel
#

Where or how did you find this?

little raptor
#

what are all those arguments for? 😮
it's complicated

brave jewel
#

hahaha

little raptor
#

Where or how did you find this?
I read the function that is executed by the module

brave jewel
#

ooh, and you got that from the game files?

little raptor
#

yes

brave jewel
#

I guess that's a lot of work to get this out there

little raptor
#

unPBO modules_f_heli

#

that's where the scripts for this module are

exotic flax
#

or use arma3p to setup a P drive with all Arma 3 content extracted

little raptor
#

if you have some 60 GBs to throw away

violet gull
#

I've created a display via cutRsc but it isn't listed in allDisplays, but the variable for the display returns the correct display I want. WUT DO

brave jewel
#

Leopard, I don't need ```sqf
spawn_ai_blu synchronizeObjectsAdd units _group;

little raptor
#

rscs never register in allDisplays
Use the onLoad event handler

exotic flax
#

if you have some 60 GBs to throw away
34.2GB (including dub pbo's, which aren't needed at all)

little raptor
#

Leopard, I don't need ```sqf
spawn_ai_blu synchronizeObjectsAdd units _group;

@brave jewel No

brave jewel
#

Omg it really worked

#

They are all moving to the nearest sector now

#

Now let's see if they move to the next sector after capturing this one

#

I don't have a module_heli_F pbo btw

little raptor
#

It's in the heli folder

brave jewel
#

at least not in the /addons folder

#

oh

#

I'm dumb

#

Oh my god, you saved me so many hours or even days of work @little raptor ! Thank you so much to spend your time to look for questions people ask here! To all of you who spend their time to answer questions from other people on this discord, thank you from the depth of my heart! ❤️

#

But don't worry, I will come back tomorrow with another stupid question 😂

violet gull
#

@little raptor How would I add eventHandlers to the cutRsc'd display? This no workie:


private _d=uiNamespace getVariable"R_RSCAFAR";

(uiNamespace getVariable"R_RSCAFAR")displayAddEventHandler["KeyDown",{systemChat"Boop";_block=false;if((_this#1)in(actionKeys'nextChannel'))then{_block=true;currentChannel call NextCH};_block}];```
little raptor
#

wherever you made it

robust hollow
#

rsc displays dont take keyboard input

violet gull
#

Technically it workie because the EH index goes up every time I add it but doesn't execute the code

robust hollow
#

it is an overlay, not interactive

violet gull
#

Shit.

little raptor
#

cuts are shown on display 46 I think, so add the EH to that

robust hollow
#

you may also need to add an event to display 24 (chat display) while it is open

violet gull
#

Well I've been using findDIsplay 46 for a while but the mission display is overwritten/paused when other displays/dialogs pop-up sometimes, such as the Dynamic Groups interface, which pauses all my EHs

#

My idea was to create a new display that won't get interrupted butttt if can't do that with cutRsc then poop.

robust hollow
#

mmm, yea, until there is an event for displays opening i'd say a repetitive check is the only reliable way to go

violet gull
exotic flax
#

Which makes sense because you can only have one active display.
You should be able to create a dialog though on top of 46 and set EH's on that.

robust hollow
#

the issue is he cant always know which display has opened without some ugly loop

little raptor
exotic flax
#

use onLoad on the Display or Control, set a variable in uiNamespace with the current display/control and reference that in your scripts 🤔

violet gull
#
idd=23202320;
fadein=0;
fadeout=0;
duration=1e+011;
onLoad="uiNamespace setVariable['R_RSCAFAR',_this#0]";
onUnload="uiNamespace setVariable['R_RSCAFAR',nil]";
class Controls{};};```
#

I know it's doable, I'm just messing up somewhere

#

Muh brein

little raptor
#

onUnload="uiNamespace setVariable['R_RSCAFAR',nil]";
When it closes, it becomes Null automatically, so no real need for a "clean up"

trail smelt
#

Every i use zeus control / open arsenal/ace arsenal, my camera is broke (https://cdn.discordapp.com/attachments/612046432295452673/769751361893564416/2020-10-25_03-33-34.mp4)

Camera ini:

cam = "camera" camCreate [0,0,0]; 
cam cameraEffect ["Internal", "Back", "camrtt"]; 
cam attachTo [this, [0,0.4,0.5]]; 
 
"camrtt" setPiPEffect [0]; 
 
addMissionEventHandler ["Draw3D", { 
 
_dir = 
(objCam selectionPosition [0,0,0]) 
vectorFromTo 
(objCam selectionPosition [0,0,0]); 
 
cam setVectorDirAndUp [ 
 
_dir, 
 
_dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0] 
 
]; 
 
}];

TV ini:

this setObjectTexture [0, "#(argb,512,512,1)r2t(camrtt,1)"];

where is problem ?

robust hollow
#

@violet gull well... that is messing up because it is an rsclayer. yes if it is a mod you can go adding onload events to every display that might possibly open over display 46, but imo thats just as undesirable as a loop check, with more work 🤢

little raptor
#

@trail smelt change the name of the r2t

#

for example:

cam cameraEffect ["Internal", "Back", "MY_camrtt"];
"MY_camrtt" setPiPEffect [0]; 
#

and also the name of your camera

#

MY_cam for example

wary spoke
#

Is there any particular issue within Arma that would be causing dead bodies to go partially or sometimes fully under the terrain?

robust hollow
#

the unit respawning tends to make the corpse sink underground, thats just the cleanup system though

trail smelt
#

Camera ini:

kamera = "camera" camCreate [0,0,0]; 
kamera cameraEffect ["Internal", "Back", "kamerartt"]; 
kamera attachTo [this, [0,0.4,0.5]]; 
 
"kamerartt" setPiPEffect [0]; 
 
addMissionEventHandler ["Draw3D", { 
 
_dir = 
(objCam selectionPosition [0,0,0]) 
vectorFromTo 
(objCam selectionPosition [0,0,0]); 
 
kamera setVectorDirAndUp [ 
 
_dir, 
 
_dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0] 
 
]; 
 
}];

TV ini:

this setObjectTexture [0, "#(argb,512,512,1)r2t(kamerartt,1)"];

Ok i did it, but now this totally isn't work (now is only black screen from start mission..) :/

#

yea typo 😄 but still after use zeus control on ai/arsenal, screen set to black..(like video)

little raptor
#

_dir =
(objCam selectionPosition [0,0,0])
vectorFromTo
(objCam selectionPosition [0,0,0]);

@trail smelt this part makes no sense. it's just a zero vector

#

Also it's selectionPosition

#

You have to provide a selection (string)

#

You can change it to vectorDir objCam

#

Also, you didn't change the name of your camera.

#

It's still called cam

trail smelt
#
kamera = "camera" camCreate [0,0,0]; 
kamera cameraEffect ["Internal", "Back", "kamerartt"]; 
kamera attachTo [this, [0,0.4,0.5]]; 
 
"kamerartt" setPiPEffect [0]; 
 
addMissionEventHandler ["Draw3D", { 
 
_dir = 
(kamera selectionPosition [0,0,0]) 
vectorFromTo 
(kamera selectionPosition [0,0,0]); 
 
kamera setVectorDirAndUp [ 
 
_dir, 
 
_dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0] 
 
]; 
 
}];

I thing change it..

little raptor
#

What about the _dir thing?

#

_dir = vectorDir camObj

#

That's what it should be

trail smelt
#

I have no idea, it's from the tutorial for setting up the camera it should be to determine the direction but it suits me without change

little raptor
#

It's wrong

#

At least for your code

trail smelt
#

same things do UAV with live feed on screen from killzone kid tutorial..

little raptor
#

Yes, but it was different

#

It was selecting two positions defined on the object

#

Your code doesn't do anything

#

Since you're attaching the cam to the object, you don't have to change the dir at all