#arma3_scripting

1 messages · Page 607 of 1

spark turret
#

Try another object and see if the problem still exists

#

Also look at it and scroll. It wont automatically show

amber lantern
#

Yeah I've tried scrolling

#

Okay interesting

#

I managed to get it working with a leaflet

#

So it's perhaps like Dedmen said?

spark turret
#

That maybe its the object.

#

how about you use a laptop obj or sth else that works?

amber lantern
#

I'd need it to be some small object like a flash drive

winter rose
#

Why not a File Document?

amber lantern
#

Like I said, something small

#

I just tested it with the leaflet

spark turret
#

Why does it have to be small

dim terrace
#

@amber lantern you can create small debug sphere, change textures to something transparent, attach usb dongle to it and voila

hallow mortar
#

Do make sure you haven't placed the one that's an inventory item (it will be in the Inventory Items category in the editor)

still forum
#

He said classname is Land_, which will be the vehicle. We already talked about that above

random loom
#

Is it possible to determine how much is intersected between point A and point B somehow?

#

I'm currently looking at lineIntersectsSurfaces, which only gives the first points that the line intersects surfaces

still forum
#

lineIntersectsSurfaces

#

gives you all surfaces

random loom
#

What I mean is if it is possible to determine how much of a line is submerged in a surface

#

in meters, percentage, whatever.

still forum
#

Does it give you both entry and exit points?

#

if the line is fully inside a surface, you'll have no intersections so that wouldn't give you 100%

random loom
#

It doesn't appear to give exit points

#

there's returnUnique parameter, which I'm unsure how exactly it works

still forum
#

Just read the wiki

returnUnique (Optional): Boolean (added in v1.69.140138) - When false, all intersections in the same object are included not just the 1st one. Default: true

#

set it to false, and you should get both entry and exit

random loom
#

I'll check

amber lantern
#

once you know the intersection point it's trivial to calculate the fraction that's on the other side

#

and you'll just bound it by the end points

random loom
#

Only problem is that it doesn't return the exit point @still forum

still forum
#

even if you remove the unique?

random loom
#

running with this to check

{
    deleteVehicle _x;
} forEach (missionNamespace getVariable ["arrows",[]]);
arrows = [];

_ins = lineIntersectsSurfaces [
    AGLToASL positionCameraToWorld [0,0,0], 
    AGLToASL positionCameraToWorld [0,0,1000], 
    player,
    objNull,
    true,
    10,
    "VIEW",
    "FIRE",
    false
];

{
    private _arrow = "Sign_Arrow_F" createVehicle [0,0,0];
    _x params ["_asl","_norm","_obj","_parentObj"];
    
    _arrow setPosASL _asl;
    _arrow setVectorUp _norm;
    arrows pushBack _arrow;
    
    systemChat str _x;
} forEach _ins;

arrows
#

But I guess you could just do it once from the front, and once from the back

winter rose
#

that's what sh—

random loom
#

Okay so doing further testing

#

it appears to work for buildings and such

#

but from what I can tell returnUnique doesn't work for terrain

#

This is the script I'm currently running with

{
    deleteVehicle _x;
} forEach (missionNamespace getVariable ["arrows",[]]);
arrows = [];

_ins = lineIntersectsSurfaces [
    AGLToASL positionCameraToWorld [0,0,250], 
    AGLToASL positionCameraToWorld [0,0,0], 
    player,
    objNull,
    true,
    -1,
    "VIEW",
    "FIRE",
    false
];

_ins append lineIntersectsSurfaces [
    AGLToASL positionCameraToWorld [0,0,0], 
    AGLToASL positionCameraToWorld [0,0,250], 
    player,
    objNull,
    true,
    -1,
    "VIEW",
    "FIRE",
    false
];

{
    private _arrow = (selectRandom ["Sign_Arrow_Large_F","Sign_Arrow_Large_Green_F","Sign_Arrow_Large_Blue_F","Sign_Arrow_Large_Pink_F","Sign_Arrow_Large_Yellow_F","Sign_Arrow_Large_Cyan_F"]) createVehicle [0,0,0];
    _x params ["_asl","_norm","_obj","_parentObj"];
    
    _arrow setPosASL _asl;
    _arrow setVectorUp _norm;
    arrows pushBack _arrow;
    
    systemChat str _asl;
} forEach _ins;

count _ins
exotic flax
#

you mean pushBackUnique?

random loom
#

returnUnique parameter

stone totem
#

hey guys.
Me again ... still learning ;)

So I try to create an ace-arsenal that has all stats removed.

First of all ... if I understood the word "stat" right in the framework-description I think "stats" are the "menues on the left and right".

So far so good. Now my problem is, that I am not sure where and how to call it.
I tried it in the ini, which is for sure dump.

Then I tried it in the items ini in the editor, which did also not work. But tbh I have no clue where else it would fit.

This is what I did to the items-ini.

[this, true] call ace_arsenal_fnc_initBox; 
[this, ["scopeStatL00","scopeStatL01","scopeStatL02","scopeStatL03","scopeStatL04","scopeStatL05","scopeStatL06","scopeStatL07","scopeStatL08","scopeStatL09","scopeStatL10","scopeStatL11","scopeStatL12","scopeStatL13","scopeStatL14","scopeStatR00","scopeStatR01","scopeStatR02","scopeStatR03","scopeStatR04","scopeStatR05","scopeStatR06","scopeStatR07"]] call ace_arsenal_fnc_removeStat;
#

I am not sure about the "This" in line 2, cause the framework does not say anything about it. But somehow it made sense to me

cosmic lichen
#

Check the example, there is no this in it

stone totem
#

jea i know. i tried both 😦 (with and without)

#

the "this"-version is just the last one that i copied before i came here

uncut rapids
#

Quick question, is there issues with moveInCargo? moveInAny works fine but I want the unit to be in the passenger seat, not the driver seat since thats where they go when the vehicle is empty.

params ["_detained"];
_nearestVehs = nearestObjects [_detained,["Car","Helicopter"],8];
if(count _nearestVehs >= 1) then {
  _nearestVeh = _nearestVehs select 0;
  if(!isNil "_nearestVeh") then {
    _typeVeh = typeOf _nearestVeh;
    _detained assignAsCargo _nearestVeh;
    _detained moveInCargo _nearestVeh;
    systemChat format ["Working. Vehicle is: %1",_typeVeh];
  };
};
#

I've seen that moveInCargo has alt syntax but I didn't have luck with that either

#

never mind, had to remoteExec it 🤦‍♂️

night dew
#

Im currently attempting to add custom music to an operation I am creating and I have no clue on what im doing and any YouTube tutorials are outdated or I just don't understand. Anyone who could help me out?

exotic flax
winter rose
exotic flax
ebon citrus
#

i can see why you would go for playSound3D for this, since it's easy and doesnt require configs, but believe me, Dont use it for this... not what it's meant for

#

instead, do what montana said

#

CfgMusic isnt all that complicated

#

and you'll get a lot better results

exotic flax
ebon citrus
#

i never understood tutorial videos

#

written word is better for me, personally

exotic flax
#

trial and error is my way to go 🤷‍♂️

#

might take a bit longer till results, but it teaches a lot other stuff as well

slate cypress
#

When using a Radio Alpha trigger, is there any way to know who used Radio Alpha?

exotic flax
#

I believe in the activation statement you can find the player in thisList (and since only 1 person can trigger it, it should be thisList select 0)

slate cypress
#

Isn’t thisList for zone triggers only?

exotic flax
#

well, it contains whatever is triggering the trigger, so I don't see why not

#

one way to find out 😉

#

and might be interesting to add the result on the wiki

candid cape
#

Hi , I want to make a script that if any player die with currentweapon "arifle_MXC_F" , a box appears with this weapon "hgun_P07_F"

#

on position player

#

I have this at the moment

#

`if (!(alive player) && currentWeapon player isEqualTo "arifle_MXC_F") exitwith {

_cajaes = "Box_NATO_Grenades_F" createVehicle position player;
clearMagazineCargoGlobal _cajaes;
clearItemCargoGlobal _cajaes;
clearWeaponCargoGlobal _cajaes;

_cajaes addItemCargoGlobal ["hgun_P07_F", 2];

sleep 15;
deleteVehicle _cajaes;
};`

fair drum
#

is it currently not workin?

candid cape
#

I don't know why it don't work

#

the code it's perfect

fair drum
#

no errors?

candid cape
#

no one -showscripterror

#

the code its perfect

fair drum
#

where are you running it?

candid cape
#

Lan (eden editor)

fair drum
#

ok so this is end goal a single player thing then

candid cape
#

Have I to run it on a dedicated server ?

fair drum
#

no. just wondering your intentions. is this for single player? or multiplayer? or multiplayer with JIP?

candid cape
#

Multiplayer pvp

fair drum
#

mk, and where are you placing this code? initPlayerLocal? the unit's init box? etc etc

candid cape
#

Maybe on Init or on InitPlayerLocal

fair drum
#

well which are you currently doing?

candid cape
#

I have place the code on init.sqf

#

on eden editor

fair drum
#

mk well. if you go to make it a pvp scenario on a dedicated server and you run it through init only, the server has no player as each player is local to the client

candid cape
#

ok

fair drum
#

secondly, have you tried placing this within a while loop so that it is constantly checking the if condition

candid cape
#

I have tried this :

while {sleep 30 } do { [] spawn life_fnc_box;

#

on eden editor

#

init.sqf

fair drum
#

while you have a good idea, event handlers are really nice as well and it will be easier in the long run ^

candid cape
#

@slim oyster What have I to do with this ?

fair drum
#

ill type something up

candid cape
#

ok , I will try it

#

It says that

#

remain ];

#

deleteVehicle _cajaes; }; };#

fair drum
#

oops forgot one, good catch

candid cape
#

that's says

fair drum
#

add a ]; to the very end

candid cape
#

It doesn't work xd

fair drum
#

you need to take out the sleep too since you aren't in a scheduled environment

#

or start it with [] spawn
or write it in a different file then execVM it into that event handler if you want the sleep

#

one sec, testing something for you

candid cape
#

omg thanks

fair drum
#

ok got it working

candid cape
#

ok

fair drum
#

in your init

addMissionEventHandler ["EntityKilled", {
        params ["_unit","_killer"];
        [_unit] execVM "yourOtherFileHere.sqf";

    }
];

in yourOtherFileHere.sqf

params ["_killed"];

if (_killed == player) then {
private _cajaes = "Box_NATO_Grenades_F" createVehicle position _killed;
clearMagazineCargoGlobal _cajaes;
clearItemCargoGlobal _cajaes;
clearWeaponCargoGlobal _cajaes;
_cajaes addItemCargoGlobal ["hgun_P07_F",2];
sleep 15;
deleteVehicle _cajaes;
};
candid cape
#

L m a o

#

Thanks dude

#

it work

fair drum
#

yup. read up on params as well as what can go in a unscheduled environment and what cannot. also read up on locality

candid cape
#

ok and the last thing

#

I want that if the player have an specific weapon (a pistol like "hgun_P07_F") that's will execute

fair drum
#

then add that to the second file under the if condition as well

#

just like you did before

#
if ((_killed == player) && (currentWeapon _killed == "arifle_MXC_F")) then {};
#

but its better to use primaryWeapon and handgunWeapon

#

since currentWeapon can be circumnavigated by switching to a weapon other than what you have in there.

candid cape
#

ok I will try it

#

If I put if ((_killed == player) && (currentWeapon _killed == "arifle_MXC_F")) then ... it doesn't work but if only I place the other code it works

fair drum
#

doesn't work as in error? or doesn't work because you aren't using that rifle

#

try with primaryWeapon. currentWeapon is really meant for vehicles

candid cape
#
if ((_killed == player) && (primaryWeapon _killed == "arifle_MXC_F"))
fair drum
#

probably has to do with how the player is already dead and doesn't actually have a equipped item when dead.

#

might have to forget the second condition for now and make due. I gotta go to bed so someone else might be able to help you from here

candid cape
#

ok np

#

thanks for all

ebon citrus
#

@fair drum correct, the weapon that is dropped on the floor is not equipped by the container(player), but rather simply in another (simulated) weapon holder

candid cape
#

and what can I do ?

ebon citrus
#

What is your intention?

candid cape
#

My intention is that if the player that I kill have a specific weapon then drop a box with a specific weapon

#

like a "arifle_MXC_F"

quartz pebble
#

Anyone has tested if AIs attack targets beyond the view distance?

winter rose
#

some did iirc, and it's a nope (unless shared data / laser thing)

quartz pebble
#

Do AIs use view distance setting from the machine they're local to?

winter rose
#

I believe so.

candid cape
#

what do you think about my problem @winter rose ??

winter rose
#

I think it is a problem indeed!

candid cape
#

I'm talking about Arma 3 not my problems hahahaha

stone totem
tribal trellis
#

Yes

#

That’s correct if I understood the documentation properly

stone totem
#

Ok thaks. 🙂 .... already thought I just call the wrong function.

Now the second thing I am not sure about is where I call this cause I dont know if its global or just "local".

#

Means: I am not sure if i call this in the map-ini or if i call this on the item-ini in the editor

#

nevertheless .... i tried both and nothing worked

tribal trellis
#

It’ll more than likely be in the objects init

#

Did you give the object an ACE Arsenal?

stone totem
#

yes

tribal trellis
#

And then run the function in that objects init?

stone totem
#

yes.

tribal trellis
#

What was the result? Did it just look like nothing happened?

stone totem
#

so first i call the "make arsenal function" and then the remove function. Dont have the exact code here tbh

#

the arsenal worked, but the remove didnt

tribal trellis
#

Hmmm weird

stone totem
#

Tbh .... it looks like no one ever used it. At least google etc dont know anything about this function.

#

Might be that its bugged .... but its more likely that I am doing something wrong

#

^^

tribal trellis
#

Did you use the right IDs in the array?

#

Might well be, I’ve never used it myself

stone totem
#
[this, true] call ace_arsenal_fnc_initBox; 
[["scopeStatL00","scopeStatL01","scopeStatL02","scopeStatL03","scopeStatL04","scopeStatL05","scopeStatL06","scopeStatL07","scopeStatL08","scopeStatL09","scopeStatL10","scopeStatL11","scopeStatL12","scopeStatL13","scopeStatL14","scopeStatR00","scopeStatR01","scopeStatR02","scopeStatR03","scopeStatR04","scopeStatR05","scopeStatR06","scopeStatR07"]] call ace_arsenal_fnc_removeStat;
#

1 sec

#

now better

#

^^

#

tbh I have no clue what the "scopeStat" is used for. I exctracted the bpo of the function and it looked as if its not used

#

seams like the only go for the last 3 letters

tribal trellis
#

You don’t need this at the start

#

Never mind you edited it

stone totem
#

😄 .... that was an earlier try

tribal trellis
#

Ah haha

#

Might well be that it’s a deprecated or bugged function

#

I’ll give it a test later when I’m back from work if you haven’t figured it out

stone totem
#

I am already experimenting since yesterday. So I bet I will not find it.
I would really appreciate your help!

spark turret
#

are you trying to get a blacklisted arsenal?

stone totem
#

I try to create an Arsenal that only allows to load default loadouts

spark turret
#

ah

#

can you just make an empty arsenal including the loadouts?

#

or do all items in the loadout have to be available in the arsenal?

tribal trellis
#

So if I understand correctly, you’re just trying to make a box with a predefined set of kits?

stone totem
#

As far as I understood it, they all must be available

#

Yes thats what I try. But I would love to have this fast adaptable, cause we dont have a stable mod-set yet

#

at least not stable enough

tribal trellis
#

Ah ok well my suggestion is out the window then, was going to suggest having a box using addActions for the kit s

#

But it’s far less convenient to regularly make changes to

spark turret
#

ace is better, easier tohandle

#

yeah cole.

#

i once made a modular kit thing with ace addactions but it was to complicated and not very dynamic

#

@stone totem how about you just make an arsenal that allows all the stuff in the default loadouts?

#

bc the only way to ONLY allow loadouts but not chnagning them is probably the addaction kit

stone totem
#

People would start searching through the arsenal and would waste time

#

... I know them to good 😦

tribal trellis
#

That’s why I use addAction kit boxes in my milsim haha

#

No clothes shopping

#

Just grab the kit, weapons and equipment from the boxes and all good to go

spark turret
#

yeah i mean if the addactions could be fine

#

its just a getUnitLoadout, setunitloadout probably

tribal trellis
#

I personally don’t do it thst way but it might work

#

Just grab the local user from the _this variable and add items and remove items

spark turret
#

that would be the most dynamic way. get a couple AI guys, dress and equip them in the ediotr and have a script that gets all their loadouts and makes them available as addactions

#

that way you can adjust for every mission easily

tribal trellis
#

Oh, I never even thought about that

#

Genius

spark turret
#

kinda like in a clothes shopping store with mannequins lol

tribal trellis
#

Yeah

#

That’s actually a genius way of doing it

#

Do you think you’d be able to change it via Zeus arsenal?

#

Not that I would want to but out of curiosity

spark turret
#

hm i guess you could build it so it detects loadout differences and then redo the addactions

#

OR you have the addaction not store the loadout but get the loadout from the unit at the time of calling

#

thats probably better

#

so the addaction just has the varname of its "mannequin" and pulls the loadout upon being executed

tribal trellis
#

Just dynamically get the load out every time yeah, I guess

#

Would actually be very useful for my units training mission as well

#

Not only would the load outs be dynamic but also would be good to have the mannequins for equipment overviews

spark turret
#

yeah and players could have some kind of decision

#

also that way you could allow to have generic slots that dont have a designation and inside the mission decide who gets what role + equipment

#

add a line that checks for the mannequins medic and engineer ability and add/remove that to the player as well

tribal trellis
#

I do that part anyway haha, the generic slots

#

But I like your thinking

slate cypress
#

is there some means of parachuting a player

#

I used this:

#

but I'm getting some error within the function

#
_unit = _this select 1;
_unit action ["Eject", vehicle _unit];
[] spawn {sleep 3; [_unit] call BIS_fnc_halo};
#

HALO feature is already implemented in Arma 3. Using this function will result in incorrect behaviour and animation.

winter rose
#

parachuting = eject the unit

#

(add him a parachute before that)

slate cypress
#

I want the units to keep their backpacks though

grim coyote
#
_chute = createVehicle ["Steerable_Parachute_F", getPosATL Player,[],0,"NONE"]; // Create parachute
player moveInDriver _chute;```
winter rose
#

something like this indeed yes ^

slate cypress
#

Thanks 😄

slate cypress
#

Why am I being knocked unconscious when the parachute gets spawned and I get moved into the driver seat?

random loom
#

clipping with anything?

exotic flax
#

velocity too high?

spark rose
#

Alright team, asked this over on the multiplayer channel and crickets so here goes. Can anyone tell me which files are run when a player connects to a dedicated server? I ask because my mission works well - unless someone joins after it has started, replacing an AI teammate - if that happens they are invulnerable until they force respawn. I can't change it through the console by doing "player_x allowDamage true" or even "player_x setDamage 1"

winter rose
#

mods?

spark rose
#

CUP, NIArms All in one, FHQ Weapons pack. That's it aside from DLC

#

oh, and CBA_A3

#

i'll see if i can test run it tonight without any on w/ exception of DLC required to run the mission

#

It seems related to another bug where if a player leaves and rejoins, although they are still shown in the squad (co-op mission) they are civilians (purple if viewed by zeus)

#

made me rack my brain on the second one because normally side is determined by group

exotic flax
#

sounds like a weird script in a mod or the mission 🤔

spark rose
#

I agree, that's why i wondered what files are run when a player connects

winter rose
#

well, unless you use init fields

spark rose
#

AHA!

exotic flax
spark rose
#

i bet i have some old entries in player inits, Lou, from before i scripted everything

#

like version .0001 of this mission

#

i will take a look!

#

thanks

winter rose
#

dem init fields!!

slate cypress
#

@exotic flax Terminal velocity, yeah

#

@random loom Negative, chute is set to deploy at 200m above terrain.

#

Thing is even at terminal velocity, it works as long as I'm above sea...

#

If I'm above a town or some buildings, I just get knocked

random loom
#

Try setting player position somewhere above the ground

#

and then move them into the parachute

stone totem
#

Ok ... now I think I did not understand something completaly fundamentally ...

_this addaction[_soldierRole,{player setunitLoadout (getunitloadout ARSENAL_SOLDIER1)}];

I try to extract the role from ARSENAL_SOLDIER1 and have this as an interaction entry for my box.
The interaction works, but the menu is empty. Thats why I think I completaly misunderstood the thing with the call of addaction.

Question.
I call


The "" is a String.
If "roleDescription" gives back a String. Why cant I just put my variable in there and go? What am I doing wrong?

ebon citrus
#

are you sure the roledescription isnt empty?

#

have you set it?

stone totem
#

tbh. nope. Is there a way to test this?

#

without turning the AI into playable i mean

ebon citrus
#

roleDescription cursorObject; in a watch field and look at the unit

stone totem
#

ok ..... hmmm. let me google to find out what a watch field is ^^

ebon citrus
#

in the debug console

#

there are 4 entry fields under the console

#

with the title "watch"

#

these print out a value returned by the command/script in the field to the field below the watch entry

#

at a set interval which you can find in the biki and i dont care to google

slender schooner
#

i have a quick question, does anyone here know a good "Structured text" editor for arma

#

except for the 7erra one?

stone totem
#

ok. Thanks Nica. I will try it from here. Thats the best way for me to learn.
Thanks a lot 🙂

ebon citrus
#

any XML text editor?

exotic flax
#

Notepad will do the job IMHO

ebon citrus
#

notepad++

slender schooner
#

i mean, an editor that has a built in preview

#

for structured texts in arma

ebon citrus
#

yes, arma

slender schooner
#

euh, where?

ebon citrus
#

if i remember correctly, the GUI editor (Although horrid) has some preview functionality

#

but arma 3 is well capable of displaying its own structured text type

slender schooner
#

hm, true

ebon citrus
#

i've jsut used the gui editor before

#

but you can jsut save your structured text into a variable and have a control display it from that variable and refresh when it changes

slender schooner
#

well, what i need/want, is a text editor that displays the structured text as it will be shown later in the game itself, and that its scrollable

ebon citrus
#

THE GAME

#

literally

slender schooner
#

yea, i know

ebon citrus
#

i know what you want, but the game itself offers this

slender schooner
#

👍

ebon citrus
#

tge best way to know what the text looks like in-game is to view it in-game. And since arma 3 can refresh your control elements live at any rate you wish, i dont see why you would need anything else

#

turha mennä merta edemmäs kalaan
Useless to head further than the sea to fish

stone totem
#

thanks @ebon citrus . It worked. And it does not have a Roledescription ^^

ebon citrus
#

you need to set it in the editor

#

there is the description field

stone totem
#

I did

ebon citrus
#

is the unit playable?

stone totem
#

I think it only appears when the unit is played or AI controlled

#

but i dont have it on playable

#

ah .... yes no its not 😦

ebon citrus
#

i have a hunch it's voided if the unit is not playable

stone totem
#

jea. Need to find something else then

ebon citrus
#

setvariable and getvariable

#

can be used in init-field, but remember to set the effect to local only if you use it in init

winter rose
stone totem
#

and there it is

#

ok. gonna find something different. Actully the getVariable is an idea. I will see

#

need to go pick up my wife.
Thanks for your help people.
I think I am getting better

#

i think .... 😄

ebon citrus
#

@winter rose Pierre's note is more valid here

#

but good to know that one aswell

#

very rarely use the editor though

winter rose
#

(yep - read both, thought one)

slate cypress
#

I increased the dropping altitude - I think that fixed it somehow...

ebon citrus
#

so you were hitting the ground?

#

can i see what you wrote, just out of curiosity? @slate cypress

slate cypress
#

I still wasn’t hitting the ground. Something would just knock me unconscious as soon as the chute spawns.

#

Yeah I’ll post the code in a little bit. I’m afk atm

ebon citrus
#

no hurry

#

im just asking

fair drum
#

so apparently BIS_fnc_moduleLightning deletes the thing it targets. Wanted to create a scene where a plane gets hit but instead of blowing up (or nothing happening rather if I have allowDamage to false), it deletes the plane completely

#

Doesn't seem to act like when a Zeus uses the module itself.

stone totem
#

there is a nice storm-script from a guy called "alias". he did a lot with lightning etc. perhaps you can find something there.

#

you can find it on armaholic and on youtube (with the links in the comments)

fair drum
#

i just had the lightning target the pilot which sends the plane careening. it works for what I want

stone totem
#

löl 😄 .... good that I am not a pilot in your missions 😄

fair drum
#

its AI this time. just for an opening scene

#

making a "lost" type of mission for my unit with a little twist

stone totem
#

ah nice

fair drum
#

what I do need though is a command that plays loud enough for people inside of a vehicle to hear it. playSound gets seriously attenuated when they are in first person

#

and since they are on veteran, I can't use switchCamera to force them into 3rd person for the playSound since it autothrows them back into 1st person

winter rose
#

is playSound attenuated though? I thought it was only 3D sources 🤔

fair drum
#

ummm let me see if there is a recording from the last op to show you @winter rose

#

two different time stamps

stone totem
#

@tribal trellis @spark turret

So I tried what you said about the addaction on the arsenal.
The Basic Addaction worked but I wanted to try the smartass-way and tried to automate things.
My idea was that the arsenal basically extracts all the loadouts from all units that I sync on the arsenal.

Thats how my function looks. The call works, etc.
But I think he does not like the ...

```... line
I have the feeling that he simply does not catch the syncroed objects.
But so far I like the idea .... :)

_this = param [0];
private _namesOfUnits = [];

{
_namesOfUnits = name _x;
_this addaction["_namesOfUnits",{player setunitLoadout (getunitloadout _x)}]; //for the record ""_names****" is for testing
} forEach synchronizedObjects _this;

tribal trellis
#

Can't use loops for addActions

#

I've tried before

stone totem
#

naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah

fair drum
#

real keyboard mash moment

stone totem
#

and there all my dreams crash

#

😦

tribal trellis
#

Yup I know the feeling

winter rose
#

Can't use loops for addActions
what?

#
{
    private _unitName = name _x;
    _this addaction[_unitName, { player setunitLoadout (getunitloadout (_this select 0)) }];
} forEach synchronizedObjects _this;
```(or something close)
ta-daaa @stone totem
stone totem
#

when this works I gonna marry you

#

till then, I first want to understand some details ^^

#

but please let me find this out myself 🙂

winter rose
#

ah well, nothing, I can do 🙂

stone totem
#

what is this pointing at? _this select 0

spark turret
#

First provided parameter

#

Look up there params passed into addaction. They differ fron normal execVM f.e.

#

Like it has a caller and target param iirc

winter rose
#

_this select 0 = the unit/object holding the action
_this select 1 = the unit that used the action
_this select 2 = action ID

spark turret
#

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

#

Ah now i get it. Each mannequin will get an action where you can get its outfit

stone totem
#

I think I just need to test it ^^

spark turret
#

Keep in mind it has to run local to every client since addactions are local

#

To be MP compatible

stone totem
#

hmmmm. Not sure if this works then. Since now I called my little sqf from an objects ini in the editor

spark turret
#

Yeah thats fine

#

The object init gets executed on every client and the server on missionstart and on every client who joins later

stone totem
#

ah ok

spark turret
#

Same for init.sqf

stone totem
#

good to know

tribal trellis
#

So I just tested the script myself

stone totem
#

me to. did not work for me 😦

tribal trellis
#

Neither, I found out why though.

#

The script given above will basically look for objects synced to a unit, not units synced to an object.

#
} forEach synchronizedObjects _this;

The line above is where the issue lies. I personally can't see a way around it but maybe there's a function I've yet to use.

stone totem
#

😮

spark turret
#

How about group them together and run it from a units init with units group _this;

stone totem
#

What do you think. Would he check it, if the object I but this in the Ini-Line is actually a unit?

#

so checking for units linked to a unit?

spark turret
#

What do you think. Would he check it, if the object I but this in the Ini-Line is actually a unit?
@stone totem
I dont understand a single thing

stone totem
#

welcome to my world

#

thats basically how my live is since I started working myself into scripting ^^

spark turret
#

Lol

tribal trellis
#

lmao

stone totem
#

So how I understood it, the problem is that the item I put my code in, is an object and no unit

#

but the sychronizedObjects checks for synced objects that are synced to a unit .... at least how I understood it

#

you know what. I will simple try it

#

simply

spark turret
#

"This command only returns the synchronized objects when used on intelligent objects such as units or logic objects. All other objects returns an empty array."

#

So maybe try and use a unit or game logic to run the code from

stone totem
#

unit worked

#

but not exactly how I wanted it. but at least it did something ^^

spark turret
#

Whats wrong?

stone totem
#

1 sec

#

I syced to units on a third unit. he offers me a menue with the loadout from the 2 units. but when i select he gives me the loadout from nr3

#

I think I know where the failure is. Just need to find out how to fix it. 🙂 .... But the most important steps are done

#

THANKS GUYS! ❤️

#

and girls may be ... who knows

spark turret
#

I know whats wrong

stone totem
#

its the this select 0

#

i guess

spark turret
#

You code adds all actions to one central selector mannequin but gets the loadout of the unit its attached to =》 the selector mannequin

#

So you can either pass the other units names into the addaction and get their loadouts or add 1 action to every mannequin instead

#

So yeah it the "this select 0"

stone totem
#

that is why I had "getunitloadout _x" in there. But he does not like that

spark turret
#

Yeah the addactions code is run outside your script so it doesnt knlw any variables yiu have defined there

#

You have to tell the addaction which variables to keep for later use.

stone totem
#

so i need to pass _x into another variable every cycle?

#

a little like unitName

#

I will just try

spark turret
#

Thats not the issue. The variables name doesnt matter

stone totem
#

oh yea i understand

spark turret
#

But the addaction has a field where it takes in variables which it should store:

#
arguments:Anything - (Optional, default nil) arguments to pass to the script (will be _this select 3 inside the script). If Array is used as an argument for example, its first element reference would be _this select 3 select 0```
#

So you can put _x there, the addaction will storw the value of x for later use and then you can call/use that with _this select 3 which in yourcase will be _x => the units var name

stone totem
#

so _this select 3 is basically just a reference on _x when calling the function?

spark turret
#

_this is an array that holds the valued the addaction gives it. Position 0 in the array is the object the action is attached to, pos 1 the unit that uses/calld the action and pos 3 is the values you gave to the action in the "arguments" part

#

so _this select 3 is basically just a reference on _x when calling the function?
@stone totem
Yes but keep in mind it has the value that _x had at the moment of the actions creation. It does not change when _x is changed

#

Like, it kinda copies your homework, so if you change yiur own homework again, the copy is not changed.

stone totem
#

OK ... I got it. But wtf. ^^

spark turret
#

Yeah i know it gets complicated fast if you dig to deep

stone totem
#

I already said to my wife .... I learned many programming-languages in my life. But this one is by far the worst ..... ^^

spark turret
#

Lmao

#

Its actually kinda cool to have an environment where you can just input some code and get immediate results to look at.
But as soon as you want to do more than like spawn a flare, it becomes a shootshow

ebon citrus
#

i wish arma 3 had pointers you could pass as arguments

tribal trellis
#

SQF is undoubtedly one of the stinkiest languages out there

ebon citrus
#

global variables is your best bet

#

if you want to have changes occur

stone totem
#

ok ok ok ... sorry I did not want to start something here ^^

tribal trellis
#

haha

spark turret
#

I still hope they go to c# or sth for arma 4

stone totem
#

but seriously @spark turret thanks for your very detailed explanation

tribal trellis
#

Please

spark turret
#

Instead of reinventing the wheel

#

Np

ebon citrus
#

@spark turret enscript, it looks like

#

well, that's just a hunch

stone totem
#

Anyway. Good night and thanks again for all your help 🙂

spark rose
#

Hey all. Trying to make a radio play music. I'm using this (which does not work at all). ```sqf
playSound3D ["a3\missions_f\data\sounds\radio_track_03.ogg", Radio1, true, (getPosATL Radio1), 5, 1, 100];

#

i have it in the onActivation field of a trigger (any player present)

winter rose
#

I am not sure, but have you tried "\a3\?

spark rose
#

I hadn't, but just did. It doesn't seem to make a difference, game throws no errors.

winter rose
#

of course, I want to know so I am firing the game 😄

spark rose
#

Help me Lou, you're my only hope

winter rose
#

are you sure the trigger triggers?

#

Help me Lou, you're my only hope
Star Wars intensifies

spark rose
#

aye

#

trigger is trigger-izing

winter rose
#

works in Eden for me

spark rose
#

...wut

winter rose
#

oh! I know.

#

getPosATL

#

it's expecting an ASL position

spark rose
#

ok now it works, just extremely quiet

#

oy vey

#

hours...Lou. Hours.

winter rose
#

I can't stress it enough, but read the wiki 😁

#

and in general, when you want to debug something try to boil it down to the simplest - no MP, no "mission scripts", no nothing - a test.VR mission that does only what you want to do

spark rose
#

thats a very good idea

#

thanks Lou

slim oyster
#

I found even with the ASL pos adding params to playSound made it very quiet

half jay
#

Hey im just getting into scripting for my missions, I am planing to create a simple script that rotates a light cone object using the setDir command. Is there anyone with an idea on how to loop this command? Also since im new I dont really know how to call said script, could someone give me some pointers?

winter rose
#

you could loop it with e.g while

#

something like that maybesqf myObject spawn { while { sleep 0.01; true } do { _this setDir (getDir _this + 0.1); }; };

half jay
#

yeah i was constructing something like that, cheers mate, will give it a try

#

And how would i go about calling the script? I have written basicly what you gave me in "light.sqf" in the mission file

#

nvm figured it out, cheers mate!

winter rose
#

REDACTED my pleasure! 👍

half jay
#

haha this is gonna be dope af

#

how would you go about terminating this script? do i have to add another param that is checked along with sleep? that way i can change the value of the second param and the script stops

winter rose
#
private _scriptHandle = myObject execVM "light.sqf";
sleep 60;
terminate _scripHandle;
half jay
#

just out of curiosity what does the "private" do?

winter rose
#

it "secures" the variable by making it local, but that's another topic: locality

half jay
#

alright, will read that. also terminating does not seem to work?

#

first i run

private _light = lamp6 execVM "light.sqf";

#

then i run

terminate _light;

#

but it does not terminate

winter rose
#

ah yes, but where do you run this?

half jay
#

now im just trying it in the debug console

winter rose
#

Ah, yes
This is the "private" thing - the variable only exists on the first execution (because 1 execution = 1 scope)
If you want to get it across scopes, use a global variable.

From private _script = to script =

half jay
#

allright, cheers, will try

dusky drift
#

how do I spawn a vehicle from the init field of a player unit in an mp scenario and have it register properly for other players
I have multiple player controlled units doing this and everything I've tried either doesn't spawn the vehicles, spawns multiple vehicles for each player or only spawns the vehicle for each client

winter rose
#

@dusky drift

if (isServer) then { createVehicle stuff };
```because init fields are _baaad_, and are run for every network machine
dusky drift
#

aight I'll try that

void badge
#

Hi ! Does anyone know how assignItem works behind the scene ? It seems to work for everything except primary, secondary and handgun weapons

ebon citrus
#

@void badge
Assigns existing item from inventory (uniform, vest, backpack) to a correct slot. If the slot is occupied by another item, it gets replaced.

#

weapons are not items

#

use addWeapon to assign weapons

#

remember that binoculars are weapons

#

and HMD are items when in containers

#

just use linkItem

#

i noticed an error in my script aswell... well, not an error, just inconsistency

#

i lost some hairs to do with the HMD, binocular and item slots

#

ended up making NCA_fnc_itemType to differentiate HMD and BINOCULARs into their own itemtype

void badge
#

Add weapon does not assign a weapon

#

it creates one

#

I'm trying to assign items from inventory to their slot

#

Instead of removing the item and creating a new one i'd like to assign it to its slot

#

As arma does when equipping a weapon from player inventory

ebon citrus
#

erm...

void badge
#

yeah...

ebon citrus
#

delete it from the inventory and add it to the unit

void badge
#

that's a way that would work but you have to handle weapons details such as ammo count

ebon citrus
#

yes?

#

it's all in there

#

make your own assign weapon function or explore the depths of the uncompiled scripts

#

i opted for the former one

void badge
#

I was working on the first one but I was wondering if a simpler method was not possible

ebon citrus
#

what are you making? if i may ask

void badge
#

an inventory display

ebon citrus
#

an alternate inventory?

void badge
#

yes

ebon citrus
void badge
#

indeed, looks nice and clear

#

how did you handle the transfer of item from inventory to their slot ?

ebon citrus
#

feel free to ask when you start to get into the problems

void badge
#

the way we discussed above ?

ebon citrus
#

yep

#

delete it from container and assign to unit

#

also, not all the things in arma 3 biki related to inventory work

#

some just... dont work

void badge
#

oh, you didn't work on the inventory to slot part of the inventory

ebon citrus
#

?

#

the arma 3 drag and drop?

void badge
#

oh non yes you did my bad

ebon citrus
#

from container to inventory slot, you mean?

void badge
#

not used to arma 2 inventory style

ebon citrus
#

it's ok

void badge
#

i meant an "equip" action

ebon citrus
#

there's a humble 104 KB of sqf that went into this

void badge
#

from inventory to slot

ebon citrus
#

yeah, you can do that

#

from backpack to inventory

#

works the same as container to inventory

#

since backpacks are essentially just containers parented to the player

#

atleast that's how the engine views them

#

most likely something carried over from arma 2

#

same deal with clothes

#

vests

#

although, if youre making an inventory overhaul, like i did, you WILL have to go through every single one of the inventory commands at some point

#

and get a thorough understanding of the guts of the inventory

#

it's a fun ride with many slopes and turns

void badge
#

yes i'm already deep into it ahah, coming asking here was the last resort to get informations about BI inventory functions

#

I'll use assignItem function when possible otherwise gonna use the delete/add method.

#

I still would be interested in taking a look at the uncompiled code there may be about the inventory

ebon citrus
#

linkItem is also a good one

void badge
#

Yes but it creates the item, I need a function to handle already present items

#

assignItem working for weapons would have been ideal

#

not convinced removing/adding is how BI handles its inventory actions

ebon citrus
#

these all work with assignItem: [<Map>, <Compass>, <Watch>, <Radio>, <GPS>, <NVG>, <Binoculars>].

void badge
#

others work too

#

just equipped a headgear with it

ebon citrus
#

such as?

#

ah, yeah

#

i meant items, as in ITEM

#

although binoculars are weapons

void badge
#

indeed

ebon citrus
#

but i feel like the reason for assignitem not working with weapons is the same reason you will have fun with it

#

BI dev looked at the weapons and said "dear lord, this is complicated, i shant do this"

#

and left the script as "MVP"

#

that's all just my funny talk

#

i made a script that handles moving and removing items, assigning them and so on

#

you pass it the container, target and item class(array or string) (any specifics, if it has attachments)

void badge
#

It means we may find the dirty add/remove method in BI inventory ahah

ebon citrus
#

the add-remove is essentially what it all boils down to

#

you dont "move" things in the computer world... well, you usually dont

#

you copy and remove

void badge
#

yes but engines can handle such transaction a certain way

ebon citrus
#

yes, but in the end it always boils down to moving data from one variable to another

#

which means the data is removed from one and added to another

#

not arguing at all, just trying to make it sound a bit more reasonable

void badge
#

yes sure it's reasonable

ebon citrus
#

that's why i myself didnt really like the assignItem command

#

it's inconsistent

#

i'd rather deal with all data in a consistent manner

#

less exceptions

void badge
#

still looking for juicy functions that avoid having to write code that need to handle edge cases

ebon citrus
#

oh, boy

#

believe me

#

it wont be the edge case

#

have you dwelled into dropping and taking items, magazines and weapons from containers?

#

welp, you'll find that assignItem IS the edge-case

void badge
#

yeah I reworked this part but got rid off the arma "container" part. I use variables to simulate contents. It allows multiple inventory in an object, such as a glovebox/trunk on a vehicle

ebon citrus
#

setvariable?

void badge
#

yes

#

I access inventories using model selections

ebon citrus
#

nifty

#

actually something i thought of, but cheers for saving me the trouble

void badge
#

ahah

ebon citrus
#

i just distrust setVariable

#

im not sure of the performance impact of having large variables having to be synced across network for JIP

#

Grez, any idea?

void badge
#

yes that's always to take into consideration when broadcasting variables

exotic flax
#

I was just wondering how bad server performance would be when using set/getVariable on large scale

ebon citrus
#

i mean, containers are synced somehow globally aswell

#

but im not sure if this is done in more efficient manner than setvariable

void badge
#

I stocking inventory item in format [ [ 'item_1_class', 'item_2_class', ... ], [ 'item_1_count', 'item_2_count', ... ] ] to avoid large inventory payload

#

default items player arma format can be large

ebon citrus
#

could be

#

but items are probably updated one by one

#

not the whole inventory

#

setVariable needs to update the WHOLE variable

#

across the network

exotic flax
#

setVariable already has an interesting note:

The variable space of the object is local to each client and by default changes are not broadcast.
Since Arma 2: If the public parameter for supported types is true, the value will be synchronized also for a JIP player.

void badge
#

yes

#

that's known

ebon citrus
#

you want to brodcast changes across networks

#

unless you have some subscriber-status system

void badge
#

you can also specify a owner id to share it

ebon citrus
#

which would be what i am doing for my non-arma related project

#

owner id?

void badge
#

yes

ebon citrus
#

mmmh

#

so...

#

store data server-side and reguest on inven tory open?

exotic flax
#

prolly the "best" way is to have the access points available in configs (client-side) and run a simple function to ask the server for the contents (so storage remains on the server, including updates).

ebon citrus
#

and sync changes only to server and subscribed clients?

#

clients who open the inventory subscribe to it

exotic flax
#

Nica, seems we're thinking the same 😉

void badge
#

store data server-side and reguest on inven tory open?
that's a method I used when data is not accessed very often

ebon citrus
#

it's the method i use for my project

#

when you open an inventory, you subscribe to any updates to that inventory

#

any updates to that inventory on server-side are sent to you

#

subscription happens at the same time as you request the inventory contents

#

when you close the inventory, the subscription is nulled

void badge
#

Oh

ebon citrus
#

this way you dont have to send countless player inventory and stats data across an already saturated network

void badge
#

I have a mutex on inventories so players can't open them at the same time. I only update the inventory when inventory is closed

ebon citrus
#

what if a player disconnects when an inventory is open?

void badge
#

ahah let's go into the tricky part

ebon citrus
#

i know exactly what youre doing

void badge
#

when doing modification I save the current inventory state in the player profile

exotic flax
#

1 point accessed 100 times:

  • setVariable/getVariable: broadcast 100 times, to all players
  • "serverAccess": broadcast 100 times, 1 time per player

100 points accessed 1 time:

  • setVariable/getVariable: broadcast 100 times, to all players
  • "serverAccess": broadcast 100 times, 1 time per player

So in both cases, serverAccess is better 🤷‍♂️

Not to mention "security", especially in a PvP environment

ebon citrus
#

facepunch did the same with rust in early days

#

simple point, dont

#

there's a reason they dont do it anymore

void badge
#

and log server with inventory when connecting

ebon citrus
#

exploitation prone? Very

void badge
#

yes who cares

ebon citrus
#

also, what if you edit a vehicle?

void badge
#

who wants to create a log for himselft i mean

ebon citrus
#

will that vehicle's inventory remain locked?

void badge
#

edit a vehicle ?

#

you mean open an inventory ?

ebon citrus
#

yes

void badge
#

yes

ebon citrus
#

if you open a vehicles inventory (edit)

#

ok, example case

void badge
#

i'll lock it using a variable

#

and unlock it when clear

ebon citrus
#

I open a vehicle's inventory and take some items from it, then i disconnect when the inventory is open

void badge
#

variable is player guid so inventory wont be lock if player disconnect in it. You can check if guid is connected when opening the menu

ebon citrus
#

the item-changes are not updated to server on the vehicle, what happens?

void badge
#

you've duplicated stuff

ebon citrus
#

tsk

#

i will leave in my helicopter of disappointment

#

🚁

void badge
#

ahah

ebon citrus
#

tsk tsk tsk tsk tsk

void badge
#

but I mean owner would still have a notification

ebon citrus
#

sure

void badge
#

unless you've cleared you trace but who knows where to look

ebon citrus
#

i dont mean to say your way is wrong or it couldnt be patched

#

it's a valid way of doing it

#

maybe not all convenient, but it works

#

just...

#

dont get discouraged

#

there is a lot to arma 3 that you have to do in a weird way

#

but it's all doable

#

take it from me

#

i made arma 2 inventory in arma 3 from the ground up

exotic flax
#

For single player it could work, it would just create a a huge file on the computer.
For MP it's the worst thing to do to let clients handle important stuff like that.

ebon citrus
#

arma 3 is a wild beast

#

Not necessarily

void badge
#

handle what ?

ebon citrus
#

handle trusted data

#

"inventory"

#

"health"

#

etc.

#

Grez has a point, but it's only one point

exotic flax
#

inventories, scores, currency, etc.

ebon citrus
#

if you can trust your clients, then yeah

#

go for it

void badge
#

having to remote call on the server on each inventory action would have been horrible in my opinion

ebon citrus
#

not

#

dont remote call

exotic flax
#

it just takes a bit more work to make it work, but will prevent a lot of extra work afterwards after people complain about "hackers"

ebon citrus
#

Grez, i hope you respect their way too

#

we're here to advice, not to discourage

#

i will note that it's not secure

#

but this is arma

#

nothing is secure

#

🤷‍♂️

exotic flax
#

again, depends on how you script it... which most people can't do correctly 🤷‍♂️

ebon citrus
#

if someone has enough dedication, they will get through every single barrier you set

#

yeah, but i feel like this is a first time for him

void badge
#

Indeed

ebon citrus
#

first things first, get something working

#

i made 3 different iterations to my inventory until i was happy with it

#

each one from the start

#

learning a little bit more on each try

void badge
#

Have to trust BE and filters

ebon citrus
#

in god we trust, others we monitor

void badge
#

Ahah

ebon citrus
#

but, like i said

#

Hola if you need help

void badge
#

Even god is monitored

ebon citrus
#

I'm always happy to help a compadre(buddy) tackling the guts of arma 3 inventory

exotic flax
#

move to object, scroll mouse wheel down, click "open inventory" 🤣

#

Although believe me, there are worse quirks in Arma 3 ;)
For example the loadout system; for which there are 2 ways to do it, which both are (semi-)required and not 100% compatible... Making sure you need to do the same stuff at least twice to make it work...

ebon citrus
#

make an engine function
it doesnt work
someone reports it not working

intended behaviour

exotic flax
#

more

otherwise it will break other stuff

ebon citrus
#

that aswell

#

"we cant fix it because it would break things that depend on it being broken"

#

"it is too late to fix this"

gentle plaza
#

I am having trouble removing an addAction after use, via hideOnUse Boolean. Action still remains after use…?```sqf
/* your code */
intel1 = false; this addAction ["<t color='#00FF00'>Search Body", {intel1 = true}, nil, -10, true, true, "", "", 5, true];

exotic flax
#

hideOnUse will just hide the option when selected, but won't remove the action completely.

#

2 things you can do are:

  • set the condition (param 8) to check if intel1 is false
  • remove the action completely with something like this in the script part (param 2)
{ intel = true; (_this select 0) removeAction (_this select 2) }
gentle plaza
#

Thank you for the detailed response! I used your 2nd recommendation and works perfectly.blobcloseenjoy

tough abyss
#

Hi guys I made this small code to make my dialog have a loading screen which spins but I’m not sure how to make it loop around so it actually spins instead of just staying still. Can someone please help me make it so it loops and spins? I am very new to sqf so all help will be very much appreciated! with uiNamespace do { display = findDisplay 999210; ctrl = _display ctrlCreate ["RscPictureKeepAspect", -1]; ctrl ctrlSetPosition [0.43875,0.46777778,0.2,0.279999]; ctrl ctrlSetText "A3\Missions_F_Exp\data\Img\lobby\ui_campaign_lobby_background_tablet_radial_left_ca.paa"; ctrl ctrlCommit 0; angle = 0; onEachFrame { with uiNamespace do { if (angle > 359) then {angle = 0}; ctrl ctrlSetAngle [angle, 0.5, 0.5]; angle = angle + 3; }; }; };

exotic flax
#

I'm not very familiar with UI stuff, but I have the feeling the the namespace stuff is not needed at all and the onEachFrame might be a bit too much and a simple while {} do {} with a short sleep would do perfectly fine as well

rotund otter
#

anyone here know anything about DMS for exile and why it might fail (defent mission system)

normal abyss
#

Hey, I'm looking to setup a 2d polygon triangulation script to draw custom shapes on the map, I'm already working on one at the moment however I was wondering if anyone may already have something that may achieve this or any experience any models that could share some knowledge on it?

torpid quartz
#

hey i'm trying to get the Hold Action add to work, i've pretty much just copied the example but I still can't get it to run, anything looking glaringly wrong here?
[_DataPad,"Download Intel","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa","\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa","_this distance _target < 3","_caller distance _target < 3",{},{},{},{},[],5,0,true,false] remoteExec ["BIS_fnc_holdActionAdd", 0, _DataPad];

warm hedge
#

Any error?

torpid quartz
#

hang on i was just trying
this addAction ["Download Intel",{[this, player,1,part1 = true];}]; and it sure didn't like that either. i'll go back and run the other one

#

uh yeah 3, none in eden but all when the game starts.

#

was playing around with stuff trying to fix it but no dice, that's why i tried the other one

#

ok yeah 2 of the 3 errors where ace, but the one that wasn't was

'...get <3",{}.{}.{},{},[],5,0,true,false] |#|remoteExec ["BIS_fnc_holdActionAdd", 0, ...'
Error Type Any, expected string, bool, object, group

#

Tried removing the empty brackets and leaving the ","s but that's not it either, i'll keep having a play around

#

However, still wondering, how would i change a bool in an addAction/holdActionAdd code? "part1 = true" doesn't seem to work like it does when using trigger "on activation"

cosmic lichen
#
[
    _myLaptop,                                            // Object the action is attached to
    "Hack Laptop",                                        // Title of the action
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",    // Idle icon shown on screen
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",    // Progress icon shown on screen
    "_this distance _target < 3",                        // Condition for the action to be shown
    "_caller distance _target < 3",                        // Condition for the action to progress
    {},                                                    // Code executed when action starts
    {},                                                    // Code executed on every progress tick
    { _this call MY_fnc_hackingCompleted },                // Code executed on completion
    {},                                                    // Code executed on interrupted
    [],                                                    // Arguments passed to the scripts as _this select 3
    12,                                                    // Action duration [s]
    0,                                                    // Priority
    true,                                                // Remove on completion
    false                                                // Show in unconscious state 
] remoteExec ["BIS_fnc_holdActionAdd", 0, _myLaptop];    // MP compatible implementation
#

This is a working remoteExec example.

#

@torpid quartz

torpid quartz
#

yeah that's what i was using to make mine, that YT video had another method where you put it in a SQF so i'll try it again there.

tough abyss
#

Hey um I have a question I don't know if this is the right place to ask, but how do you make AI talk while hearing what they are saying with their voice?

spark turret
#

You mean lip movement?

tough abyss
#

Yes

#

I've been trying to figure this out for a mission I'm working on.

spark turret
#

That can be turned on and off. But sounds are a dumb system, iirc there is no way to tell if a sound os still playing so you have to time the lip movement

#

So it might get a little complicated

tough abyss
#

ok thank you

spark turret
#

You should test if thats a local or global command

#

Bc setFace is local; so i assume setRandomLip might be too

#

Do you know the difference between local and global?

tough abyss
#

I recently got into learning how to script so it may be confusing for me, but I'll eventually figure it out.

winter rose
#

you have say, that will use soundFile+lipFile by itself.
otherwise and for more complex but rewarding setup, there is the Conversations system

spark turret
#

The Konversation system is not rewardning at all

spark turret
#

It took me so long to figure out, it would have been faster to make my own convo system

winter rose
#

and now you know it, you can use it easily
as everything, you can either learn or do it the hard way. There are good reasons they created it

spark turret
#

No. We hates it

#

Filthy bohemia hobbitses only made it to annoy us

winter rose
#

No. We hates it
You hate it huehuehue

tough abyss
#

In singleplayer all objects are local correct?

spark turret
#

I demand that on the new engine, the sound and convo system are to be reviewed by me. To ensure its fool proof and intuitive

winter rose
#

@tough abyss ↑

ebon citrus
#

BI devs are not gods, they make things their iwn way and sometimes your thought process doesnt match theirs. Especially in programming this is evident. What might seem inuintitive to you, is actually pretty reasonable to them. Also there are just honest mistakes and inconsistency left by demand for legacy support

warm hedge
#

No idea this goes #arma3_scripting or somewhere else though... What determines the direction of a ladder? I know (configFile >> "CfgVehicles" >> typeOf _house >> "ladders") have ladder data, but there's no direction data it seems. How do I get direction of it?

ebon citrus
#

Rotation?

#

Never been really interested in ladders. Stairs++ is better

hollow thistle
#

It might have some mempoints

ebon citrus
#

This too

#

Check the lods for triggers and selections

#

With the next patch, we should be getting some more fun related to that

tough abyss
#

Other than that I appreciate the help.

warm hedge
#

There's nothing I can see. Tried selectionNames "memory" to a solar tower which has 3 ladders, but everything I got is: ["ladder_1_start","ladder_1_end","ladder_2_start","ladder_2_end","ladder_3_start","ladder_3_end","door_1_axis","door_1_trigger","light_1_pos","light_2_pos","light_3_pos","light_4_pos","dam_1_effects"]

winter rose
warm hedge
#

Fair point, but let me see something. I think something useful came to my mind

#

And didn't worked

tough abyss
#

I'm also trying to make a unit where he is a hostage including using the animations "Acts_ExecutionVictim_Loop" to show he is tied up and "Acts_ExecutionVictim_Unbow" for when you untie him. Any examples?

warm hedge
#

switchMove and playMoveNow

tough abyss
#

Thanks

ebon citrus
#

@warm hedge

Seems to me like you missed something

#

Ladder 1 start, ladder 1 end

#

Ladder 2 start, ladder 2 end

warm hedge
#

?

ebon citrus
#

These are OBVIOUSLY the starts and ends of the ladders

warm hedge
#

They are

ebon citrus
#

So draw a line from one to another and you have a ladder

warm hedge
#

I thought they don't determining the direction, but I was wrong

ebon citrus
#

Start is the start and end is the end

winter rose
#

…he means the direction

#

not the line direction, more like the ladder's orientation

ebon citrus
#

Yes, the direction is the vector direction form the start to the end

warm hedge
ebon citrus
#

Translate the points to world space

#

And then get the vector direction

winter rose
#

no, no, no, and no.

warm hedge
#

What are you talking about?

winter rose
#

not the line direction, more like the ladder's orientation
the "ladder facing", if you prefer @ebon citrus

ebon citrus
#

So where the ladder is rotated?

#

The model itself

warm hedge
#

Yes?

#

It is...

ebon citrus
#

So what is the model's direction

#

I wish you could get a rotation of a memory point, but they dont have that

#

Did you find a conclusive answer?

ebon citrus
#

Ok, so it's a slope

#

Interesting

warm hedge
#

And worked well

ebon citrus
#

I guess the player is positioned on the ladder through some algorithm that gets a point on the ladder from above. Like projecting from the top of the bounding box, if that makes sense

#

A 2d bounding box... so a plane?

#

If you view the ladder plane from so that the slope starts from the left bottom ( of a x-y coordinate spaxe) and goes to the right top, then it would be pretty simple to do a function that determines where on that ladder the player should be positioned. This way you also save data on the rotation of the ladder... and effort. Not sure if intentional or not, but it's clever

#

Might yoink

slate cypress
#

When using a trigger which is synced to a "set task state" module, does it matter whether the trigger "server only" box is checked or not?

#

The condition is simply "is there a driver, if yes, return true"

#

there is no activation code, simply relies on sync

#

I'm wondering whether "server only" only applies to activation code or if it applies to syncs also

winter rose
#

I could not tell; it would be more #arma3_editor-related, hoping there are experts there

spark turret
#

Server only will execute the code only on the server

#

Hm also evaluate only on server iirc

#

So to avoid being triggered for each player

winter rose
weak crest
#

Why doesn’t the errors in this game tells you nothing

#

Such as generic expression error

winter rose
#

because if it told you nothing, you would not know the issue (beware of the double negative)

sometimes, the game cannot figure it out

astral dawn
#

I wish the game provided variable dump by default

#

Why doesn’t the errors in this game tells you nothing
It is underdesigned :/

#

Your best option is to use lots of logging

spark turret
#

Hint and diag log

#

Also usually the game tells pretty percisely where tze error is

#

Just not why

still forum
#

just generic error should never be printed

#

it should always ALSO print the actual error.
if it doesn't its a bug. I have a ticket where the ingame error overlay doesn't state the correct reason for some warning type

winter rose
#

there is a difference between scheduled and non-scheduled too no?

ebon citrus
#

generic error prints when you make a generic error

#

usually syntax issues or scheduled command such as sleep in unscheduled environment

#

to my experience, Arma 3 gives a lot more useful error information than some C compilers

astral dawn
#

Syntax is good, runtime is terrible. Like this value is nil. Ok, there might be 100 reasons why it can be nil 🤷

#

Would it be terribly hard to add stack dump on error to base game? Lots of people would find it useful.

hollow thistle
#

Would it be terribly hard to add stack dump on error to base game? Lots of people would find it useful.
it would not, afaik it's planned if Dedmen will have time pepe_happy

#

Why it was not added in the first place by earlier devs, blobshrug

winter rose
#

Dedmen might 👀

turbid zenith
#

Hello everyone, I am working with a COS script, and I was wondering if there is a way to only give the ''hint'' to the person triggering the action
Something like this, but I don't like the ''hint'' there
_unit addAction ["TEXT", {hint "TEXT"}];

digital hollow
#

hint effect is local, so it by default does that.

turbid zenith
#

Huh, I always thought that hint was global for some reason

winter rose
#

(what is COS btw?)

turbid zenith
#

Civilian Ocupation System

#

Or something along those lines

winter rose
#

oh

acoustic abyss
#

Hey everyone.

I remember that there was a mod released that helped give an overview of all the character animations. Anybody recall the name/link?

winter rose
#

…the in-game anim viewer?

still forum
#

Would it be terribly hard to add stack dump on error to base game?
no, we already have that as internal diag command.
Not sure if we'll release in public build, or just profiling/dev branch

winter rose
#

release, with a -showStackTrace param?

still forum
#

I wanted to just integrate with showScriptError

#

Not sure yet, that's why I only made internal POC for now

winter rose
#

noice

acoustic abyss
#

…the in-game anim viewer?
@winter rose

Thanks, but I'm not referring to that.

The Splendid animation viewer is a bit flawed. Eg: I used the various drop-down menus to select a standing, unarmed, walking animation. The result was a prefixed "AmovPerc...". However this list ignored a much better animation that I had found in another mission, "Hubspectator_walk".

So the question is maybe where I can find a complete list 😅

winter rose
#

all the animations exist in there; most likely listed under Cutscenes

#

(but to answer the question, I don't know that mod)

winter rose
vestal estuary
#

so im very very new to arma 3 scripting and scripting in general, im working on a lock 1st person script and ive gotten everything work except for when youre in the passenger seat, is there a variable im missing , i cant seem to find it the currently script i have rn is "//1stperson

addMissionEventHandler ["Draw3D", {call {
if (cameraOn == player ) exitWith {player switchCamera "Internal"};
if (vehicle player != player) exitWith {player switchCamera "gunner"};
if (cameraOn == _vehicle && cameraView == "External") exitWith
{player switchCamera "internal";
};
}}];"

stone totem
#

@tribal trellis @spark turret @winter rose I made the arsenal script. It works.
But I bet I will end up in a special section of hell, just reserverd for people like me ....

I hardcoded the addarsenals ... no loops

Anyway: Just wanted to thank you guys for your help. Would not have get it done without you. ❤️

tribal trellis
#

No problem, sorry we couldn't find an efficient solution

stone totem
#

it works now 🙂

tribal trellis
#

Oh lol I misread

stone totem
#

and thats what counts

tribal trellis
#

Either way np

spark turret
#

Any particular reason you hardcoded the addactions?

willow hound
#

@vestal estuary In the last if you use _vehicle, that variable is undefined in the Event Handler function's scope.

stone totem
#

The truth is I needed to get finished cause it looks like the mission will be this Saturday. 😆

vestal estuary
#

ah gotcha im also running into that gunners are locked in the gunner cam in heli and what not, and cant switch between 1st and gunner cam

stone totem
#

But it's not completely hard-coded. It still extracts up to ten loadouts and even detects how many are synced.

tough abyss
#

I'm not very familiar with UI stuff, but I have the feeling the the namespace stuff is not needed at all and the onEachFrame might be a bit too much and a simple while {} do {} with a short sleep would do perfectly fine as well
@exotic flax But this small code is working fine it is displaying the loading image but I want it to loop around so it actually looks like its loading. I'm just not sure how to make it loop...

ebon citrus
#

show what you have?

#

i'm not getting the problem

#

ah, i found it

#

"angle" is a bad name for a global variable

#

but uhhh, what's wrong with it?

#

also, dont use oneachframe for that

#

something might override it

tough abyss
#

@ebon citrus I am trying to create a loading screen like this (https://youtu.be/uyPYtgU2LGo) but I'm not sure how do actually make it load in circles. You get what I mean?

#

I'll show u what i have

#

damn my game crashed 1 sec

#

There you go

#

Thats what I have

#

also, dont use oneachframe for that
@ebon citrus What would I use how would I do the script then?

#
_ctrl = _display ctrlCreate ["RscPictureKeepAspect", -1];
_ctrl ctrlSetPosition [0.43875,0.46777778,0.2,0.279999];
_ctrl ctrlSetText "A3\Missions_F_Exp\data\Img\lobby\ui_campaign_lobby_background_tablet_radial_left_ca.paa";
_ctrl ctrlCommit 0;
_angle = 0;
while {true} do
{
     if (angle > 359) then {angle = 0};
     ctrl ctrlSetAngle [angle, 0.5, 0.5];
     angle = angle + 3;
};```
#

Maybe like this I will test now

ebon citrus
#

@tough abyss where is this code running?

#

where is it called from and how?

#

also, as i've been let to know, the best replacement for onEachFrame is missionEventHandler for frame or draw

#

@tough abyss your problem is here:

_display = findDisplay 999210;
_ctrl = _display ctrlCreate ["RscPictureKeepAspect", -1]; <---------------------- "_ctrl is a local variable"
_ctrl ctrlSetPosition [0.43875,0.46777778,0.2,0.279999];
_ctrl ctrlSetText "A3\Missions_F_Exp\data\Img\lobby\ui_campaign_lobby_background_tablet_radial_left_ca.paa";
_ctrl ctrlCommit 0;
_angle = 0;
while {true} do
{
     if (angle > 359) then {angle = 0};
     ctrl ctrlSetAngle [angle, 0.5, 0.5]; <---------------------------- "ctrl is a global variable and doesnt exist?"
     angle = angle + 3;
};```
#

same with "_angle" and "angle"

#

i'm not giving you "right answers" because i want you to read that article

#

there's a lot more you need to ingest from it, by the looks of things

#

dont get demotivated though

#

nothing wrong with not knowing but still trying

#

youre doing good

#

👍

tough abyss
#

Thanks so much. I will read the article for sure

ebon citrus
#

also, enable script errors, if you dont already have

tough abyss
#

Trying to figure out to make a task where you download intel from a laptop.

exotic flax
#

check BIS_fnc_holdActionAdd, which is used in official missions as well

ebon citrus
#

@tough abyss task as in the task-system?

tough abyss
#

I will take time to read this, thanks!

astral dawn
#

How do I create the backpack right where player is?
This one puts it several meters nearby somewhere :(
thebag1 = createVehicle ["B_FieldPack_khk", player, [], 0, "CAN_COLLIDE"];

#

...and I can't setPosWorld it afterwards too

hollow thistle
#

I'm not sure if I remember correctly but I think it might be creating the ground holder with the backpack.

#

Try to create the GH first and then add backpack as it's cargo.

#
_weaponHolder = "WeaponHolderSimulated" createVehicle [0,0,0];

Not sure if this one can hold backpacks.

exotic flax
#

or use the prop version of the backpack (when it exists)

astral dawn
#

Thanks, I can create it now, but how do I get the actual backpack object from it so I can put some items inside?

#

If I add items to holder, they are put on the ground next to the backpack

ebon citrus
#

no, they are put into the weaponholder

#

this si what youre looking for

astral dawn
#

eyah Just found it same second as you posted 😄

#

thanks a lot, it works now

ebon citrus
#

this also works

#

if you have only one backpack

astral dawn
#

yeah works too!

#

never really udnerstood these weapon holder manipulations...

ebon citrus
#

think of it like a box any other container

#

that's what it is

exotic flax
#
_container = "groundweaponholder" createVehicle getPos player;
_container addBackpackCargoGlobal ["B_Carryall_ocamo",1];

_backpack = firstBackpack _container;
_backpack addItemCargoGlobal "FirstAidKit";
ebon citrus
#

just has some proxies to display items in it

astral dawn
#
_container = "groundweaponholder" createVehicle getPos player;
_container addBackpackCargoGlobal ["B_Carryall_ocamo",1];

_backpack = firstBackpack _container;
_backpack addItemCargoGlobal "FirstAidKit";

yes that's my current code, thanks

exotic flax
#

👍

tough abyss
#

@ebon citrus Thank you SO ducking much I finally got it working 🥳 😂

#

After so long I got it to work thx for linking those articles

#

So my tiny brain is trying to script and I'm getting an issue that I know is soooooo basic but my lack of syntax knowledge in sqf leave me powerless.

So here is what I have on an object init on the mission:

this addAction ["Skip 1 hour",{[[1],"scripts\skipTime.sqf"] emoteExec ["execVM",2];}];
this addAction ["Skip 5 hour",{[[5],"scripts\skipTime.sqf"] emoteExec ["execVM",2];}];```
and here is what I have in scripts\skipTime.sqf
```sqf
_timeToSkip = "_timeParam";

skipTime _timeToSkip;

The point of my script would be to allow users to skip time via an addaction but I need it server-sided to sync it to everyone

anyone able to spot the issue?

exotic flax
#

emoteExec?

tough abyss
#

typo in the copy pasta... remoteExec of course

astral dawn
#

emoteExec?
sends an emote to every client, since arma 4.0.3.1 xD

tough abyss
#

script is launched but dosn't do anything and poops an error on the skipTime _timeToSkip; line. I'm guessing the _timeToSkip variable isn't passed correctly

exotic flax
#

and second, remoteExec requires a function name, not a script

ebon citrus
#

@tough abyss dont worry, we all were there once. Take this and use it with care in the future when you feel like you need to use it:
🔨

cold glacier
#

Yeah, you want to replace the _timeToSkip line with

params ["_timeToSkip"]
tough abyss
#

and so that line means 'turn so and so param into so and so variable' or 'accept so and so param as a thing'?

cold glacier
#

So, normally when a function is called in Arma, either via 'call', 'spawn' or 'execVM', the arguments (your [1] and [5]) are automagically put into the _this variable.

tough abyss
#

and so would params ["_var1", "_var2"] would that give me 2 vars or 1 arrays of 2 cells?

exotic flax
#

2 seperate variables, with the names _var1 and _var2

cold glacier
#

params takes the _this variable, and if it's an array, loads each element of that array into the local variables you specify.

tough abyss
#

that acctualy makes sence 🤔 thanks guys

#

so let me fiddle a bit more with the script ^^

#

so correct me if I'm wrong but my sqf just needs to be

params ["_timeToSkip"]

skipTime _timeToSkip;```

and then I need to mess with the object init right?
ebon citrus
#

you forgot a semicolon

#

params

#

needs to have one

#

params ["_timeToSkip"];

cold glacier
#

Yeah, that should sort the issue you were having. That and the typo are the only two things I can see stopping that working after a quick read.

tough abyss
#

damn semicolons XD

#

Works! Thanks guys! 🙂

ebon citrus
#

👌

#

also, that's gendered speech, please use "l33t programmer xXcodeSlayerXx" in the future MenheraWink

kindred lichen
#

Is there a trick to building an array of editor placed objects? I have put down like 150+ markers for spawn locations, and I want them in an array to randomly select 1, but I don't really want to type
markers = [marker_0,marker_1,marker_2 ....... etc

is there a trick to declare like all of them like markers = [marker_0:marker_150];

ebon citrus
#

@kindred lichen iterate through all markers?

#

and add the ones with a specific identifier to your array

kindred lichen
#

_markerNumber = floor( random (COUNT spawnGuardMarks));
I'm using invisible objects, not true markers

ebon citrus
#

then jsut copy paste your marker a billion times in the editor

#

ok...

kindred lichen
#

Yeah, I made a CSV, in excel and just pasted it

ebon citrus
#

missionObject with a specific type

#

and iterate by the variable name

#

sec

#

something i used a while back for a quick and dirty scalable method of adding more range-targets whenever:

NAC_targets_300m = [];
NAC_targets_ring = [];
NAC_targets_ring_handle = false;

{
    switch ((str _x) splitString "_" select 2) do {
        case "300m" : {
            NAC_targets_300m pushBack _x;
            _x enableSimulation false;
            if isServer then {
                _x addEventHandler ["Hit", {
                    params ["_unit", "_source", "_damage", "_instigator"];
                        _unit animate["terc", 1];
                    }];
            };
        };
        case "ring" : {
            NAC_targets_ring pushBack _x;
            _x enableSimulation false;
            if isServer then {
                _x addEventHandler ["Hit", {
                    params ["_unit", "_source", "_damage", "_instigator"];
                        _unit animate["terc", 1];
                    }];
            };
        };
    };
}forEach allMissionObjects "TargetBootcampHumanSimple_F" ;```
#

not foolproof, for sure

#

but does the job

#

the point is that you have some identifier in the variable-name to pick your stuff out

#

allMissionObjects "TargetBootcampHumanSimple_F" helps the script to ignore all objects not a specific type

kindred lichen
#

works as long as your object is unique. I was thinking more along the lines of
_marker = MissionNamespace getVariable "guard_marke_"+i;
then adding it to the array

ebon citrus
#

what do you mean "unique"?

#

all objects ARE unique