#arma3_scripting

1 messages · Page 546 of 1

astral dawn
#

Some event handlers might be transferred automatically as I recall... need to check that

radiant needle
#

is say3D broken?

#

WHen I try to play my ogg, it's all garbled and the .lip doesnt seem to work

winter rose
#

your ogg might be corrupt?

#

unless it works with say

radiant needle
#

say doesn't work either

#

It plays back fine in Windows Media Player

winter rose
#

most likely corrupt
when you say "garbled", some sound comes out or not?

radiant needle
#

yes, but it sounds really quick and misses chunks

#

should I try a specific sample rate/format

winter rose
#

ah! which unit is saying it?

errant jasper
#

Ogg is just the container format, so maybe try saving it with a different codec also if nothing else works.

radiant needle
#

I'm using [_target,_caller]

#

in conjuction with an addAction

winter rose
#

yeah but, a soldier or a virtual entity?

radiant needle
#

an actual unit

winter rose
#

can you playSoundit?

radiant needle
#

just noticed I was set to 96000 sample rate, let me try bouncing it down to 44.1 and trying again

winter rose
#

yyyup

radiant needle
#

Does Arma use 44.1 or 48k?

winter rose
#

44 iirc, but I might be wrong

restive leaf
#

Wait what... it's not in the biki 😿

restive leaf
#

@cosmic lichen for biki maintainer STAT!

winter rose
#

yeah, let's all blame R3vo for the lack of wiki!

restive leaf
#

Wait... what 🤣

#

I am disappointed that you have not memorized every biki page by now... what else do you have to do? I mean...

radiant needle
#

nope, still not working

#

I'll try playSOund

winter rose
#

one less responsibility on my shoulder @restive leaf 😄

radiant needle
#

weird when I try playSound it says sound not found

winter rose
#

something wrong somewhere ¯_(ツ)_/¯

radiant needle
#

Oh nvermind it works with the class name, but not with the name = name

#

sound is fine

winter rose
#

......??

#

well of course, you use say3D and playSound with the className

radiant needle
#

What's the name = ""; used for?

winter rose
#

only for in-game display

#

like, in triggers, etc

radiant needle
#

okay

winter rose
#

it's funny you even had a sound.

radiant needle
#

I actually had it correct in my addAction

#

but yeah, playSound is 100% fine, say3D or say2D is the glitchy audio

#

oh huh, I deleted the .lip file and now it works

#

but the lip syncing obviously doesnt

winter rose
#

does your unit have… an identity?

I had a crazy issue about sound that would randomly accelerate/slow down/Mickey Mouse voice ; deleting the .lip or reencoding sometimes made it better, but on some other occasions it went off again.

The thing was: I created a Logic to be "HQ", but you have to set an identity, else it is randomly decided… and the pitch with it!

radiant needle
#

He's placed through editor

winter rose
#

then… that shouldN'T be the issue 😄

radiant needle
#

Lets see what the chsnces are I get kbTell right the first time

#

well at least that works

#

weird that .lip works fine for kbTell but not say

winter rose
#

@radiant needle kbTell automatically uses setRandomLip if no valid lip file is found

tough abyss
#

Is Fired/FiredMan EH supposed to fire on placing of C4?

winter rose
#

I would say "yes", but testing would be required to be sure

#

It's the "put" weapon that is used. Same for grenades with "throw"

#

Why @tough abyss?

tough abyss
#

no throw triggers FiredMan and Fired

#

I think placing of C4 used to trigger those EHs too

#

not anymore

winter rose
#

oh, ok

tough abyss
#

Placing of mines as well cannot be detected now

#

Must have got broken when the mine detection and all that crap was tweaked

winter rose
#

and the "put" EH is about placing items in ammobox, not using mines/placeables

tough abyss
#

Put is transferring item from inventory

#

and also not 100%

winter rose
#

I would say it is a bug that needs to be reported

tough abyss
#

Need confirmation that it was working before

winter rose
#

It was, check the forums for "mine placing detection", this EH was used

tough abyss
#

Just tested it is working in SP for me but not on dedicated

winter rose
#

(sorry to ask but) did you mind the locality well?

tough abyss
#

Ok found the problem

#

if you give yourself backpack in arsenal and add c4 in it, it never triggeres the event handler, but if you spawn explosive specialist, it does

#

how weird

winter rose
#

Hmmm… weird indeed

tough abyss
#

same goes for all mines

#

now it works

#

undefined behaviour is undefined ¯_(ツ)_/¯

winter rose
#

I accuse you of inventing problems!

dim kernel
#

could anyone help me with ListNBox

#

like the headers how can i add them

radiant needle
#

can removeAction work with arrays?

#

like player removeAction [0,1,2,3]

tough abyss
#

script to long to fit in chat

#

nothing is happening

#

when i test it

#

nvm im just a facking idiiot and forgot to save it as an sqf XD

finite dirge
#

Ah ok. You may want to drop the global vars and just either pass the array through the spawn or just do it in the spawn. No reason to not have private variables there.

tough abyss
#

yeah im also getting an undefined variable error at line 40

#

line 41 undefined variable in object mapper

#

would the manned aa units be causing this

#

sigh fixed it objectsMapper not objectMapper

#

@finite dirge thanks for the help

viral bay
#

I guess it might fall under here too

#

is there a quick command to render all objects on the map as editable by zeus?

radiant needle
#

What's the best way to compare to multiple values? Basically I want Code A if var is == 100, Code B if var is < 100 && >= 50, Code C if var is < 50, etc

frigid raven
#

and if all are true you want it to be true and if one of them fails you want to return false?

cosmic lichen
#

@dim kernel You need to add headers as separate controls

south bloom
#
private _grp = createGroup sideLogic;
"BIS_fnc_moduleCurator" createUnit [
    getPos player,
    _grp,
    "this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true]; this setVariable ['owner', '#adminLogged', true];"
];

not really sure if this would actually work

radiant needle
#

What would be the best way to have an event occur every hour of in-game time?

quartz coyote
#

Hi all,
I'm trying to disable the popup targets with

{ _x addEventHandler ["HitPart", {(_this select 0) select 0 animate ["terc", 1];}]; } forEach _allTargets;```
But executed on server-side or on Client-side, it doesn't work 😦
#

It works in local hosting
But not on Dedicated server

tough abyss
#

Hitpart works only where shooter is local. Also you are not disabling anything in that code

quartz coyote
#

@tough abyss okay so this EH isn't the solution

#

also, I know I'm not "disabling" anything ... just stopping the animation in a precise phase

tough abyss
#
{ _x setVariable ["nopop", true, true] } forEach _allTargets;

here you go

#

there is also "popdelay" variable you can use to set longer delay

#

What would be the best way to have an event occur every hour of in-game time?
make extension callback every hour

winter rose
#

@radiant needle sqf [] spawn { while { uiSleep 60 * 60; true } do { // something }; };

tough abyss
#

could be 1 hour 17 minutes for what we know

winter rose
#

@tough abyss adapt to your public

tough abyss
#

not a fan of having scripts sitting in scheduler for very long

winter rose
#

also, I don't know if uiSleep skips the same as time

quartz coyote
#

it's not affected my accTime if that helps

winter rose
#

@quartz coyote doesn't 😄

uiSleep is supposed to be the "real time", the game being paused or not. I don't know if it is affected by a "scheduler skip", that happens when the scheduler is overloaded and a simple sleep 1 can be transformed into a "wait 30s"

quartz coyote
#

yes that's what I said... uhm 😄

hollow thistle
#

Both can take more time if scheduler is overloaded.

#

One is just "sleep in simulation time" and uiSleep is "sleep in render/real time"

tough abyss
#

there are many things that are "supposed to" but don't in Arma as well as "not supposed to" but do 😂

winter rose
#

weeeeeell, it wouldn't be Arma without these!

tough abyss
#

who would want a perfect game, anyway

#

modding would be dead

winter rose
#

Though, my head is still full of hair and that's my pride 😁

tough abyss
#

once you learn to control the rage

south bloom
#
private _grp = createGroup sideLogic; 
"ModuleCurator_F" createUnit [ 
    getPos player, 
    _grp, 
    "this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true]; this setVariable ['owner', '#adminLogged', true];" 
];

got zeus module spawning to work yay

frigid raven
#

I kinda feel stupid. I fill a combobox with data and afterwards try to get it again. In the logging you can see that there is no data inside of it. I doubled checked the doc for the lbSetData command. I think I use it the right way.
Anyway this is the (un)logic:

lbClear _rolesCombo;
{
    _rolesCombo lbSetData [_forEachIndex, _x select 0];
    DEBUG3("data set index %1: %2",_forEachIndex, _x select 0);
    _rolesCombo lbAdd (_x select 1);
} forEach (call coopr_fnc_getRoles);

DEBUG2("data get index 0: %1", _rolesCombo lbData 0);
DEBUG2("data get index 1: %1", _rolesCombo lbData 1);

Logging:

11:49:36 (0:27:22) [Server] COOPR.LOBBY.debug - data set index 0: Groupleader
11:49:36 (0:27:22) [Server] COOPR.LOBBY.debug - data set index 1: Medic
11:49:36 (0:27:22) [Server] COOPR.LOBBY.debug - data get index 0: 
11:49:36 (0:27:22) [Server] COOPR.LOBBY.debug - data get index 1: 

I guess it's a stupid mistake I can't see cause my focus is too narrow already 😄

#

coopr_fnc_getRoles returns [["Groupleader","Groupleader"],["Medic","Medic"]] (don't mind the double wording in the array - that is on purpose)

tough abyss
#

@south bloom you are already executing setVariable on every PC and JIP by placing it in that init expression, there is no need to also make it public. You are creating network nightmare by doing that

#

not to mention that when JIP joins it will overwrite the current value and set it to default everywhere. This is awful way of coding MP

#

Try this instead

private _cur =  createGroup sideLogic createUnit ["ModuleCurator_F", [0,0,1], [], 0, "none"];
_cur setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true]; 
_cur setVariable ['owner', '#adminLogged', true];
#

@frigid raven so you set data on non existing row then you add the row, pretty cool

frigid raven
#

oh I see

tough abyss
#

You might want to read wiki on lbAdd and what it returns, and what lbSetData takes as index

frigid raven
#

So first lbAdd has to be called

tough abyss
#

what I said above

frigid raven
#

having a bad day buddy 😄 ?

tough abyss
#

Sorry I forgot I should ignore you 😂

winter rose
#

DrArma 🙄 😒

south bloom
#

@tough abyss ah thanks i have 0 experience with arma scripting :v

#

that looks waaay cleaner tho

waxen tendon
#

where can i find a list of classNames?

daring parrot
#

@waxen tendon what kind of classnames do you trying to find?

#

vehicles?

#

it might be the helpful to you

tough abyss
waxen tendon
#

classnames of SimpleObjects

tough abyss
#

yes all those classnames in vehicles can be created as simpleObjects

waxen tendon
#

ah yes, didnt notice that, thanks!

dark ocean
#
_listChangelog ctrlEnable false;
#

remove color text listbox

#

solution?

#

I need to not click on the list

tough abyss
#
_listChangelog ctrlShow false;
``` ?
dark ocean
#

this hide....

last rain
#

I have a lot of units, variable: un0, un1, un2, un3, un4, un5 ...
how to find them and add them to an array?

winter rose
#

getAllVariables missionNamespace iirc @last rain

#

allVariables*

last rain
#

un + index?

winter rose
#

You could do that too

call compile format ["myArray pushBack un%1", index]

waxen tendon
#
_allSimpleObjects = allSimpleObjects[]                    ;
_allHelipads = _allSimpleObjects find "helipad"    ;
{call "tripleR.sqf"} forEach _allHelipads                ;
```this works?
winter rose
#

no

waxen tendon
#

ok

#

how do i make it work

winter rose
#

you have four errors:
allSimpleObjects**[]**
find
nothing call "tripleR.sqf"
call "tripleR.sqf"

#

I am on mobile, I cannot write the solution easily but please look up the wiki to know how these commands work

tough abyss
#

allSimpleObjects[]
not an error
find
not an error
nothing call..
not an error
call "tripleR.sqf"
error

winter rose
#

@tough abyss here will help you @waxen tendon

tough abyss
#

@waxen tendon what is "helipad"? is it a class, it is a variable name, what is it?

waxen tendon
#

variable name

winter rose
#

Yep, my bad on this one. allSimpleObjects [] is fine.

#

If you know the helipad classname you could use it here

tough abyss
#

you can get object by simply getting the value of "helipad"

_helipad = missionNamespace getVariable ["helipad", objNull];
if (!isNull _helipad) then { _helipad execVM "tripleR.sqf" };

you cannot have multiple objects with the same variable

waxen tendon
#

ok

#

thanks

#

Yeah, i get it now

#

previously when i asked how can i search stuff without writing a searching algorithm from scratch i got answered find

#

i.e i want to find all helipad* objects

#

i guess i cant do that

winter rose
#

you could

#

not this way though

waxen tendon
#

is there a function for that

tough abyss
#

you can but it will be awkward with simpleObjects

waxen tendon
#

yeah, we can change that

#

what command/func do i have to use

tough abyss
#

You can try

{ [missionNamespace getVariable _x] execVM "tripleR.sqf" } forEach (allVariables missionNamespace select { _x select [0, 7] isEqualTo "helipad" });
waxen tendon
#

thanks! @tough abyss

empty tartan
#

i am having some problems packing a bunch of missions into a mod. They dont show up under multiplayer after I loaded the mod. I am sure I am overlooking something basic. Is there any open source projects on github that does this so I can have a look?

Basically I am tired of manually update all 14 missions through eden everytime I fix a bug, so I want to pack them up in a mod.

twin steppe
#

Hello. I need some help with a simple script that detect a set of clothes and replaces the textures of said clothes. Problem is that I don't know how to refer to these AI in the script. if((uniform _x isEqualTo "U_I_E_Uniform_01_shortsleeve_F") || (uniform _x isEqualTo "U_I_E_Uniform_01_F")) then { _x setObjectTextureGlobal [1, "\A3\Characters_F_Exp\Syndikat\Data\U_I_C_Soldier_Para_1_F_2_co.paa"]; _x setObjectTextureGlobal [0, "\A3\Characters_F_Exp\Syndikat\Data\U_I_C_Soldier_Camo_F_1_co.paa"]; };

#

The "_x" being the AI in question. This script works fine on players if "_x" is changed to "player". I just don't know what I should use so it replaces the AI's textures instead.

#

Any help would be appreciated.

winter rose
#

forEach allUnits?

still forum
#

@winter rose call compile format ["myArray pushBack un%1", index]
seriously? getvariable??

winter rose
#

@still forum OFP old-school, boiii 🤟

twin steppe
#

@winter rose Where would I put foreach allunits though? Thanks for the reply btw.

tough abyss
#

huzzah i did it i made a set of scripts that allow you to split a rifle squad in half add them to high command and have them join again later HUZZAH

#

now i can use actual fire team tactics

#

and the other team will have some what of a brain

winter rose
#

@twin steppe

{  /* your code*/ } forEach allUnits;```
tough abyss
#

im actualy quiet proud of my little fire team script

#

i managed to get it working by myself

twin steppe
#

@winter rose Appreciate the help. Worked like a charm.

hearty plover
#
player setPos (getMarkerPos "RALLY_RED")

What to do if I want to increase the z axis of the postion to 2500

high marsh
#

Store the marker pos, use the x and y positions, then use 2500 as z in an array

random crescent
#
player setPosATL ((getMarkerPos "RALLY_RED") vectorAdd [0, 0, 2500])
#

setPosATL should be your choice actually.

#

Fixed.

hearty plover
#

Thanks.

tough abyss
#

wasd with AI in driver seat isnt working in multiplayer?

winter rose
#

depends on the role you have. If you are gunner or commander, yup, only passenger, nope.

tough abyss
#

My project was always a mission, now it's turning into a mod since i'm in need of original content. Where can i begin to understand how to create new classnames for building objects and magazines? Thanks!

#

I plan to create food objects as magazines.

#

And other things, like a ceil building object.

spice axle
#

First of wrong channel. Check out #arma3_config and #arma3_model for your new assets. But why do you wanna add a food object as a magazine?

winter rose
#

so it goes into the inventory I suppose

tough abyss
#

not even gunner/commander is working

#

specifically on prowers and qilons @winter rose

winter rose
#

Strange.

restive leaf
#

If he's using Epoch then food items have to be derived from CA_Magazine to be usable... Same with some other mods I think

#

I had to provide new definitions (with permission) from MattAust for his Australian food and drink for an Epoch Australia server back in the day

#

But on rereading he is creating his own mod... so maybe so he gets the count class variable in a magazine?

oblique vale
#

Is there a way to use -filePatching with an absolute path or does the addon have to be inside the "Arma 3" folder? Creating a shortcut doesn't seem to work to trick ArmA into using another directory 😦

astral dawn
#

creating a shortcut will never work - but you can use symlinks instead

#
MKLINK [[/D] | [/H] | [/J]] Link Target

        /D      Creates a directory symbolic link.  Default is a file
                symbolic link.
        /H      Creates a hard link instead of a symbolic link.
        /J      Creates a Directory Junction.    <---- that's what I typically use and it seems to work. Not sure if it's the correct way though...
        Link    Specifies the new symbolic link name.
        Target  Specifies the path (relative or absolute) that the new link
                refers to.
#

(in the command line of course)

oblique vale
#

Nice that works

radiant needle
#

Is there a list of available materials somewhere

nova shuttle
#

Do I mis-understand the purpose of addWeaponWithAttachmentsCargo? I thought it would add the weapon, "with" its specified attachments, to cargo - not add the weapon "and" it's attachments (aka one item in inventory not one weapon + one item for each specified attachment)

still forum
#

It creates the weapon with pre-attached attachments

#

The command was specifically created because that was previously impossible. If you want to add attachments into a container separately then you can do that.

nova shuttle
#

Hmm okay must be an error in something I'm doing then. Because I'm not getting it created with pre-attached.

#

Thanks, I'll debug further

still forum
#

show me the line of code

wispy cave
#

There's no 'continue' command to skip to the next itteration of a loop without executing the statements after that continue command in SQF right?

still forum
#

yes

#

Sounds doable tho 🤔

wispy cave
#

oh I know I've done it in the past by simply making a boolean variable and checking for that after where I want a continue but it'd be much easier to just type continue; and not have to worry about it

still forum
#

I think I can push that forward, I'll put that on my list

wispy cave
#

that'd be nice, thanks

viral bay
#

hey so

#

If I wanted to run a script that would add everything in the mission to the editable objects list for zeus

#

how'd i do that

viral bay
#

so like

#

curatorModule addCuratorEditableObjects [[_allMObjects =allMissionObjects "All";],true ];

#

?

still forum
#

you never scripted?

#

curatorModule addCuratorEditableObjects [allMissionObjects "All", false];

viral bay
#

Not really no, I'm just desperately trying to find a fix for zeus not working the way it used to

#

So then if I wanted to get it to check again every minute or so, throw in a sleep for 60 seconds or whatnot?

tough abyss
#

How it used work that it doesn’t work now?

viral bay
#

So, the mission I have; modded warlords to have zeus for shits and giggles, and it would constantly track everything in the mission as editable objects and update it constantly

#

it doesn't do that anymore; it doesn't even register any objects as editable

#

I think there was an option somewhere in the editor with a checkbox to do just that but cant remembver

#

so i dont know if i have to have it scripted in now or what

tough abyss
#

You could only edit objects you put down with Zeus or objects you added to Zeus editable objects since always. Maybe you remember it wrong

viral bay
#

Well whatever was going on it worked like that

#

and opening the mission file in the editor breaks it

#

so I don't know whats going on

tough abyss
#

The only way it can break mission when you open it in editor if you edited mission.sqm manually. If you did, then all bets are off.

viral bay
#

Well, not break break it, just, it doesn't have the list of editable objects update every 60 seconds like it used to

#

but i've run every file through comparison tools and there's not a difference to be seen so my last bet was the script to do it

tough abyss
#

Sorry I don’t understand what you mean, forget I asked

viral bay
#

ah fuck i think i know what it was, i used to have 3den enhanced and forgot to install that. this is thepart of the mission file it kept removing

#

I dont know if that helps explain the issue or not

tough abyss
#

I can see that it is mission.sqm on the screenshot, hence you are on your own

viral bay
#

well i got it working

grave stratus
#

Hello, i am trying to write a code that create a task, and upon tigger activation, it will show some text and create second task.

It seems that the create task part is successful, but it is like the trigger is not doing anything.

i use helipad invisible for taskLoc and SPY1 is the name for Lucy.

https://pastebin.com/ad9wNtFf

#

there is no script error shown when i ran it in MP

tough abyss
#

Even though you created trigger that is global the params you set on it are not, so it may activate on server but on clients it won’t. You can add your second task into onActivated statement if trigger no need for waitUntil it is activated, it is trigger after all, designed to trigger statement on activation

grave stratus
#

what do you mean by the params is not global?

#

sorry my scripting skill is pretty basic

tough abyss
#

For example if you look at https://community.bistudio.com/wiki/setTriggerStatements it has 2 icons AG EL which means you can apply this to any trigger object local or remote but effect E will be local, means effect will be applicable to server only since you execute it on the server only

#

Sorry I can’t help you more, just google locality

mortal nacelle
#

weird question

grave stratus
#

i actually understand about locality

mortal nacelle
#

how do you get the camera to go back to normal after setting camsetpos

#

lol

tough abyss
#

What do you mean normal

grave stratus
#

i am trying to make a trigger that is only activate once on a server, should not i execute it server only?

mortal nacelle
#

in 1pp m2

#

setpos position player right?

grave stratus
#

because i used this execution before and it works well

tough abyss
#

You can’t control player default camera with cam commands

#

Means you created cam with camcreate

mortal nacelle
#

yeah i have used camCreate

#

but how do i terminate it

tough abyss
#

You can cancel effect to return from it

mortal nacelle
tough abyss
mortal nacelle
#

terimnate i guess

#

yeah ^
lol

grave stratus
#

oh wait, i only used it for creating task before this, so i should seperate trigger creation for isServer command?

#

i mean, i dont need to use isServer for creating trigger

#

@tough abyss just one more question, if dont use isServer for trigger creation, wont the trigger get activated everytime a client triggered it?

mortal nacelle
#


_cam = "camera" camCreate [position player select 0, position player select 1, 2];
_cam camSetTarget player;
_cam cameraEffect ["internal", "BACK"];
_cam camSetPos [15492.3,698.813,15.0197];
_cam camCommit 6;
waitUntil {camCommitted _cam};

player cameraEffect ["terminate","back"];
camDestroy _cam;
#

justgiving me a general expression error

tough abyss
#

Theoretically, but you can’t just remove it and be done with it, your whole code needs to be adjusted to this as well as trigger should be created local in this case

#

CameraEffect expects camera for once not a player

grave stratus
#

I am somewhat understand locality, its just i am not sure whats go where

#

Thanks @tough abyss i will try adjusting the code

mortal nacelle
#

this doesn't make any sense

#

is there an issue with the actual BIS function?

#

nevermind

#

im using integer for a boolean

#

🤔

winter rose
#

¯_(ツ)_/¯

mortal nacelle
#

i know right..

#

lol

tough abyss
#

Always blame BIS first

mortal nacelle
#

pmsl

#

hey @tough abyss i have a question

#

my shot seems to be going on forever

#

would you happen to know why that is

tough abyss
#

Shot?

mortal nacelle
#

it says wait time and i put 10

#

does that mean 10 minutes?

#

lol

tough abyss
#

Open it up in notepad or function viewer and see what it does

mortal nacelle
#

eh? i'm watching what it does

#

it just spins around infinite times

ruby breach
#

Then open the code in notepad or the function viewer and see what it does to do that

mortal nacelle
#

What do you mean by 'notepad'?

#

Oh

#

Okay

fossil yew
#

Hey! Is it possible that directChat command doesn't exist despite all others?

#

We have groupChat, sideChat ...

still forum
#

have you checked the wiki?

#

doesn't look like that exists.. soooo

fossil yew
#

is there anything similar?

young current
#

Probably not

#

whats the use case?

fossil yew
#

You approach the NPC, select some action on him, he "replies" in old RPG style games

#

Voiceovers are too expansive...

#

(in terms of creating them)

young current
#

hint or theres some other thing that pops up text on the screen

#

cant rememeber what it was

#

something to do with cutscenes maybe

fossil yew
#

cutText

#

yeah, might use that

young current
#

dont think theres much options really

winter rose
#

kbTell

crude needle
fossil yew
#

kbTell is voice-over isn't it?

cosmic lichen
#

Yes.

#

and subtitles.

#

Don't need to have a voice file so far I know. But ask @winter rose Master of awesome voice acting 🙂

winter rose
#

haha thanks @cosmic lichen 😄
You don't need a sound file to use kbTell, even though it might trigger a warning in the logs (that I am not sure)

#

You could also create a custom channel, or use globalChat (which is local) - you would only have "CIVILIAN" as speaker's name though

tough abyss
#

What is the difference from ctrlAddEventHandler and ctrlSetEventHandler?

#

One keeps alive after the control is closed, the other dies when control is closed?

tough abyss
#

set is not stackable, add is stackable

grave stratus
#

when using setTriggerStatements, do i need to put (') on the beginning and end of every command? or just put those multi commands in a single set of (')?

#

i think i have a bracket problem

median totem
#
    {
        switch (_variant) do
        {
            default            { _pylons = ["PylonRack_12Rnd_missiles","PylonRack_12Rnd_missiles"] };
            case "HellcatGun": { _pylons = ["",""] };
            case "HellcatAA":  { _pylons = ["PylonMissile_1Rnd_AAA_missiles","PylonMissile_1Rnd_AAA_missiles"] };
            case "Hellcat20MM": 
            {
                _pylons = ["PylonWeapon_300Rnd_20mm_shells","PylonWeapon_300Rnd_20mm_shells"];
                _customCode =
                {
                    _veh setAmmoOnPylon [1, 1200];
                    _veh setAmmoOnPylon [2, 1200];
                };
            };
        };
    };``` Has stopped working after one of the recent updates (Can't be specific, noticed it stopped working in the past 30 days. What in the code has stopped working and is no longer supported?
#

Before if a player chose the Hellcat 20mm they'd have the 2400 rounds as indicated by _veh setAmmoOnPylon, however that stopped working. They spawn with the default amount which is 600 rounds (2x PylonWeapon_300Rnd_20mm_shells)

copper raven
#

commands like setAmmoOnPylon, setMagazineTurretAmmo are now capped to the magazine ammo count, appereantly "a measure against cheaters"

median totem
#

Well, that's no fun. It really limits the customizability for our servers.

#

Bohemia should at least list those as "deprecated" on their documentation website.

#

Is there any way we can bypass that?

restive leaf
#

You mean the wiki maintained by the community?

median totem
#

Anyways. I'd love to know if there's a way to bypass it. For our game mode and style, default pylon values are really wack.

#

Hmm, would adding multiple magazines actually do the trick, you guys think? So say instead of the above, could have 3 magazines of 300 rounds for each pylon, which would then result a total of 2400 rounds.

copper raven
#

Yea, its all about playing with magazines now

#

Would've been great to have it as a server side setting atleast, really sucks to get capped

median totem
#

Yeah.

#

It drastically affected us because a lot of our premade loadouts that are made available in a in-game vehicle store got suddenly changed. So it greatly affected the balance that we wanted and visualized on our server. Especially when we run a wasteland server that has 80 players on it every day.

tough abyss
#

Thiscode = {systemChat "A";} codeArray = [code,code,code,code,code]; uses less resources than thiscodeArray = [{systemChat "A";},{systemChat "A";},{systemChat "A";},{systemChat "A";},{systemChat "A";}];?

mortal wigeon
#

When I'm using private _variables do I need to consistently refer to them by private _variable as opposed to _variable?

#

Example:

private _role = assignedVehicleRole _x; 
if (private _role select 2 == "Cargo") and. . . . 
grave stratus
#

i cant enter zeus after respawning, how do i solve this?

my description.ext

respawnButton = 1;
respawnDelay = 5;
respawnVehicleDelay = 20;
respawnTemplatesWest[] = {"Counter"};
respawnOnStart = 0;```
#

and i t doesnt even show my time counter when respawning

tough abyss
#

@mortal wigeon you normally use private keyword once when defining the variable for the first time

grave stratus
mortal wigeon
#

How can I detect if a number is even or odd?

#

Right now I'm using this to detect even/odd of _index:

if (round (_index / 2)  == (_index / 2)) then {_door = 1;} else {_door = 2;};

Which works, but seems really clunky.

grave stratus
#

but still the zeus thingy still not solved

quartz pebble
#

Guys, anyone knows if triggerAmmo needs ammo to be local?

ruby breach
#

@mortal wigeon ```sqf
["Odd","Even"] select (_index % 2 == 0)

winter rose
grave stratus
#

sorry @winter rose i didnt know where this zeus problem need to go to.

still forum
grave stratus
#

@still forum lol. i guess i'll delete here and repost it there.

anyway, i am trying to make a script that spawn a box and add items in it, i am trying to universalize it (i wonder if that is the correct term 😅 ) The box spawned fine, but im having trouble seperating the item for each boxes.

https://pastebin.com/F77AfN4G

#

i know that the code currently will add items to both boxes

still forum
#

i guess i'll delete here and repost it there.
you already got your answer here tho

#

you can use a switch

grave stratus
#

@still forum no i didnt? i cant enter zeus after respawning

still forum
#

switch (_marker), if you want different boxes per marker?

#

you got a answer, tho didn't solve the problem I guess

grave stratus
#

i got my answer for my another problem.

i want same box with different items in it per marker

#

im guessing i just need to use the box name

#

oh i cant do that either, i will get an error

still forum
#

As I wrote, use switch

#

//Weaponbox.sqf:
 
_marker = _this select 0;
_this = "Box_NATO_Wps_F" createVehicle getMarkerPos _marker;
clearWeaponCargo _this;
clearMagazineCargo _this;
 
switch (_marker) do {
    case "eqbox1": {
        _this addWeaponCargo ["SMG_05_F",5];
        _this addBackpackCargo ["Mal_AssaultAT_WD",10];
    };
    case :"eqbox2": {
        _this addWeaponCargo ["arifle_AKM_F",5];
        _this addBackpackCargo ["Mal_Carryall_WD",10];
    };
}
#

Also it's a bad idea to reuse _this there as the variable usually has a special meaning (arguments passed to function)

grave stratus
#

ahh i wrote it as case 1: and case 2: it didnt work 😓
in this case where is i pass _this as name of marker & box on execVM, is it a bad idea?

#

it wont conflict with other _this on other scripts right?

#

should i just use if with the box name instead?

still forum
#

it doesn't cause any conflicts here

#

case 1 won't work as your marker name is not a number

#

should i just use if with the box name instead?
Why? the switch is perfectly fine and makes more sense

#

also your box doesn't have a name

grave stratus
#

i know it works perfectly, it is just that i didnt get why did you mention it is a bad idea to reuse _this

still forum
#

it doesn't break anything

#

but _this means "arguments passed to this function" EVERYWHERE else. Except in your script. There it means "arguments passed to this function" until line 2 and after that "the box that I spawned"

#

So you have a variable with 2 different meanings in your script.
And one of the meanings is counter to what everyone else expects

grave stratus
#

ahh, so it is better if i change the box variable name to

_wpbox= "Box_NATO_Wps_F" createVehicle getMarkerPos _marker;```

and in weaponbox.sqf :
```switch (_marker) do {
    case "wpbox1": {
            _wpbox addWeaponCargo ["SMG_05_F", 5];
            _wpbox addMagazineCargo [30Rnd_9x21_Mag_SMG_02", 100];
            };

    case "wpbox2": {
            _wpbox addWeaponCargo ["arifle_AKM_F",5];
            _wpbox addBackpackCargo ["Mal_Carryall_WD",10];
            };
};```
#

so now that _this has only 1 meaning now right?

still forum
#

yes

#

and it's also clear that the _wpbox variable contains a box, just by reading it's name

grave stratus
#

nice! thanks @still forum . I thought i was looking like a advance scripter re-using _this 😂

runic quest
#

excuse me ! i want to ask a question please. Does database SQL correspond to exdb3 or life_server?

lapis jungle
still forum
#

only works when run on the server
no.
On server machine, returns the ID of the client. Otherwise returns 0.
It also works on non server, there it always returns 0.
Is there an equivalent that is run on any client?
No

#

for what do you need ownerid on a client?

lapis jungle
#

I'm checking the locality of an item in game. Specifically an ammobox. I have a function that is run on the server only, and changes the inventory of the specific object. So, I transfer the item to the server before doing stuff to it

#

It's a Zeus module I'm writing, so it'll always be local to the Zeus client on creation

still forum
#

if you want to check if it's local use local

lapis jungle
#

Hold up. I'm going about this all the wrong way. Where's my rubber ducky...

runic quest
still forum
#

connect to what server?

#

the database doesn't connect to your server, the server connects to the database

runic quest
#

@still forum That's right, because I want to write a log in it so that I can record the player's operation information more easily, instead of using the complicated RPT to view, so what I want to ask is that I need to change the code in those files.

still forum
#

you probably need to create a new table to store the log stuff in I would assume

runic quest
#

What do you mean by this? Just write the corresponding code in the SQL table, and modify the file in life_sever?

still forum
#

no idea how life stuff works

#

why not ask in a life forum?

#

This is the #arma3_scripting channel for Arma scripting. SQL database stuff is frankly out of scope

runic quest
#

@still forum oh,sorry.i dont now that.

#

thanks a lot!

dull drum
#

Hi guys! Trying to place a hp bar over my units. It works but with modelToWorld command the parts of the hp bar are offsetting in the 3d world. I need it to offset to the screen coordinates. What is the best way of doing that? Thanks.

#

Oh, worldToScreen should help I suppose.

still forum
#

modelToWorldVisualWorld (to make sure it doesn't lag) combined with worldToScreen

dull drum
#

And it shouldn't be an 'drawIcon3D` anymore after that. right?

still forum
#

yes

#

why do you want to use screen coordinates?

dull drum
#

When I'm using world coords with a icon3d my progress bar spreads by 3d coordinates, it looks superawkward

#

It rotates whith camera when I'm moving mouse cursor

real tartan
#

Is there a function to check if building position is reachable by foot (there is path to position) ? Some of building positions in CUP buildings are inside texture/building, I want to filter them out of all possible building positions.

#

e.g. buildings Land_Mil_House_no_interior_dam_CUP and Land_Mil_House_no_interior_dam_EP1_CUP have 2/24 reachable positions, rest of them are inside building with no way to reaching them.

tough abyss
#

Maybe contact CUP team and ask them to remove those positions?

real tartan
#

@tough abyss I already submit ticket to their tracker, in mean time I am searching for solution to resolve it (find some workaround). I managed to create config for such buildings, but I don't want to spend my summer to searching for unreachable positions manually]

tough abyss
#

Maybe can do something with lineIntersectsSurfaces, I would imagine normal would be pointing in the wrong direction if you are inside the object

elder karma
#

So I'm getting an error

#

addAction ["Teleport", {player setPos (getPos object)}];

#

Is coming back with an error that the init field is missing a ;

tough abyss
#

addAction cannot be added to nothing

elder karma
#

Ah 'this'.

#

Wow it was staring me in the face this whole time.

high thicket
#

Don’t you love that 😀

elder karma
#

No. No I do not. XD

#

On the plus side it now works. lol

mortal nacelle
#

is there any pre-defined script that allows you to copy one vehicle inventory into the next

sturdy sage
#

How can i create an array of marker that have similar names?
Only thing that is different is the ending number for example: [east_marker_0,east_marker_1,east_marker_2,east_marker_3....].
I want this to work with any amount of markers placed.

still forum
#

format

#

format ["east_marker_%1", _number] then just get your number into _number. Maybe with a for loop

sturdy sage
#

I had the wiki page for format open, i just don't really understand what %1,%2 and so on do. Is that just where the variable is entered? And in case of %2 it would be a second variable added to the string?

ruby breach
#
_1 = "That";
_2 = "would";
_3 = "be";
_4 = "correct.";
format["%1 %2 %3 %4",_1, _2, _3, _4];
tough abyss
#

Just do this then ("east_marker_" + str yournumber)

sturdy sage
#

Thanks for the help, i will try to figure it out 🙂

frigid raven
#

I try to rotate my picture here but fail hard on it. ctrlSetPosition and a ctrlCommit 1 afterwards have worked however.

_perk1 ctrlAddEventHandler ["ButtonClick", {
    params ["_ctrl"];
    DEBUG2("%1 pressed", _ctrl);
    _ctrl ctrlSetText "\x\coopr\addons\rpg\data\images\perk-sixth-selected-256.paa";
    _ctrl ctrlSetAngle [25, 0.5, 0.5];
 }];
#

The controls style is style = 48;

#

The doc says Procedural textures filled controls do not rotate. which I can't apply to my control class since I do not fully understand the meaning of that hint

tough abyss
#

Say I want to make all map rotation mission. I want the player to own both DLCs, Apex and Contact because those maps will be in rotation and also because there will be less cheaters who can afford to buy both DLCs after getting banned. So, when rotation comes to maps like Stratis and Altis, how to make sure those without Apex and Contact cannot join

mortal wigeon
#

How can I detect a co-pilot? driver, commander, and gunner all return false for the copilot of the CUP C-130

tough abyss
#

currentPilot

mortal wigeon
#

AFAIK that returns the pilot not copilot

tough abyss
#

then turretUnit

mortal wigeon
#

if (testVehicle turretUnit [0] == player) then. . . .

Successfully detects player as copilot. Thanks @tough abyss !

high thicket
#

i have a issue here, any help is greatly appreciated.

i have set up missions and now moving to trying out a setup for wasteland, i gathered my files from GitHub and noticed that the garage is not working. i play on wasteland servers and seen they are working so im guessing it is a script issue.
https://imgur.com/a/PAX9kUx
this is what it is set to be and i talked to a guy that helped set up servers and he said i have everything correct as far as he can tell.

tame lion
#

anybody have any idea how to detect if an object was hit by a bullet? the "Hit" and "Dammaged" EHs aren't helping me any as I'm probably not doing enough damage to the object when shooting it. But the amount of damage doesn't matter, I just want to know if the object was hit or not.

young current
#

what kind of object?

#

other than those eventhandlers there is no other way

#

so possibly your object has something preventing those working right

real moat
#

Does anyone know of a way to add items to specific player containers when creating respawn templates?

#

As far as I can tell, I can define items I was to add to a respawn template using

Weapons[] = {};
Magazines[] = {};
Items[] = {};
Equipment[] = {};
#

But cant figure how to add to vests and backpacks specifically

outer fjord
#

additemcargo

#

Example

this addbackpackcargo ["Backpack",3];```
#

Same thing with itemcargo, only Itemcargo is for optics, vest, ect.

real moat
#

Hmmm

#

The wiki description does not seem to suggest this solves my problem

#

But I will give it a go thanks

#

Hang on

#

Nope

outer fjord
#

Apologize, I might have read your problem wrong. You looking to add items to crates, or add items to a player?

real moat
#
class CfgRespawnInventory {
    class Rifleman {
        
        // Here goes items included in respawn template

    };
};
#

So instead of just defining items I would like the role to include, I would like to take it a step further and define which item goes in which container. That being the Uniform, Vest and Backpack.

#

In the example, items are just added to whatever container it fits in first.

outer fjord
#

Ah

#

I don't know if you can do it through just that function.

#

You would have to hand crank it like arsenal does.

real moat
#

Im thinking exporting through Arsenal works nicely

#

Makes use of the AddToVest and AddToBackpack commands

#

I just have no clue how I would go about making that work for Respawn Templates

outer fjord
#

Do you want players to be able to switch roles mid-game/

real moat
#

Just on respawn

#

Using the BIS respawn menu template

outer fjord
#

mmm, only way I know of is making a mod, but I'm more of a modder then a scripter.

real moat
#

Yea I thought of that too

#

If I could define all of these roles and loadouts in a mod then I could just call the unit classes alone

#

How much of an undertaking would it be to make a simple mod, atleast for now, that contained some basic things like a Faction, roles, perhaps some insignia. Is it something someone could just dive right into or do I need to make some larger considerations?

outer fjord
#

Not silly hard, it's just connecting the proper dots. Lots of tutorials either give you too little or too much info.

#

I suggest you read through this, then watch a tutorial video, but ignore everything in the tutorial video but how they make the folders and such 😛

restive leaf
#

See MenuInventory, CfgRespawnInventory and BIS_fnc_addRespawnInventory

real moat
#

Have done

#

Haha sounds about right @outer fjord, thanks 🙂

restive leaf
#

But between MenuInventory and CfgRespawnInventory you can do what you want without a mod ```hpp
class CfgRespawnInventory
{
class Blufor1
{
displayName = "Light"; // Name visible in the menu
icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa"; // Icon displayed next to the name
role = "Assault"; // Optional, see CfgRoles

    // Loadout definition, uses same entries as CfgVehicles classes
    weapons[] = {
        "arifle_MXC_F",
        "Binocular"
    };
    magazines[] = {
        "30Rnd_65x39_caseless_mag",
        "30Rnd_65x39_caseless_mag",
        "SmokeShell"
    };
    items[] = {
        "FirstAidKit"
    };
    linkedItems[] = {
        "V_Chestrig_khk",
        "H_Watchcap_blk",
        "optic_Aco",
        "acc_flashlight",
        "ItemMap",
        "ItemCompass",
        "ItemWatch",
        "ItemRadio"
    };
    uniformClass = "U_B_CombatUniform_mcam_tshirt";
    backpack = "B_AssaultPack_mcamo";
};
class Blufor2
{
    // Alternative configuration pointing to a CfgVehicles class. Loadout will be copied from it.
    vehicle = "B_soldier_AR_F"
};

};```

real moat
#

Okay so how do I take that ^

#

And arrange the items into specific containers?

#

@restive leaf

restive leaf
#

Ah... you want the same initial loadout on each respawn?

#

Or changeable on each respawn?

#

And would they respawn back at base?

#

Please don't ping me if you are not going to hang around for a response. I'm going for food now

real moat
#

Oh I didnt ping to gain your attention xD
Pppsh, if you gotta do shit then do it.

But yes, respawn is "BASE"
Also respawn on start

restive leaf
#

Not made it out yet... so same loadout as at start? @real moat

grave stratus
#

i want to create a trigger where it spawn a marker and after 5 minutes i want to delete it but i have error in generic expression when i put in command sleep 300;

trigtask setTriggerArea [3, 3, 0, false, 3];
trigtask setTriggerActivation ["WEST", "PRESENT", false];
trigtask setTriggerStatements ["player distance PERISIK1 < 3",'
                                _supplymark = createMarker ["supplymark", respawnmark_2];
                                _supplymark setMarkerType "hd_flag";
                                _supplymark setMarkerText "Bekalan";
                                sleep 300; // <---- Generic Error In Expression
                                deleteMarker "supplymark";
                                deleteVehicle trigtask;',
                                ""];```
real moat
#

So the placed units have nothing. No loadouts, no groups, nothing.
The flow is you load in, select a spawn, select a role, select a loadout.

Question is: using "MenuInventory, CfgRespawnInventory and BIS_fnc_addRespawnInventory" how can I define specifically which container in the loadout, has what items.

#

you need to put it into a scheduled environment by using spawn.

#
- A scheduled script has an execution time limit of 3 ms before being suspended to the benefit of another script until its turn comes back. It is a bit slower than unscheduled but suspending (sleep, waitUntil) is allowed.

- An unscheduled script is not watched and will run without limitations. It is recommended for time-critical scripts, but suspending (sleep, waitUntil) is not allowed!
grave stratus
#

so i need to create the marker outside of the trigger?

restive leaf
#

@real moat class Inventory in the player entry in mission.sqm, very basic example: hpp class Attributes { isPlayer=1; class Inventory { class vest { typeName="V_Rangemaster_belt"; isBackpack=0; }; class backpack { typeName="B_Carryall_oli"; isBackpack=1; class MagazineCargo { items=1; class Item0 { name="Chemlight_red"; count=1; ammoLeft=1; }; }; class ItemCargo { items=1; class Item0 { name="Medikit"; count=1; }; }; }; map="ItemMap"; compass="ItemCompass"; gps="ItemGPS"; }; };Tested and works, never actually used before. May need additional stuff for respawns but I know that... Suggest searching for it for longer examples, unless you can wait until tomorrow and I will send you a full example in PM...

#

Love ARMA... Learn something new and cool every day!

high marsh
#

🤔

restive leaf
#

Now I am going for food

high marsh
#

Go for it

restive leaf
#

Guess you knew about that then @high marsh Never needed it... not even on MILSIM servers...

high marsh
#

Albeit, it has no mission support as of right now. It works with any configuration

grave stratus
#

should i use spawn with triggerActivated?

hollow lantern
#

Anyone knows why lockCameraTo does not work anymore? Worked before but all the sudden stopped working. Camera is created, however does not look down to the surface (where A_CAMP_MIDDLE_POS is located) :

A_screenR setObjectTexture [0, "#(argb,512,512,1)r2t(ascreenfeed,1)"];

/* create camera and stream to render surface */
cam = "camera" camCreate [10272.3,10329.8,60.0];  
cam cameraEffect ["Fixed", "BACK", "ascreenfeed"];
cam lockCameraTo [A_CAMP_MIDDLE_POS, [0]];


/* make it zoom in a little */
cam camSetFov 0.1;

/* switch cam to thermal */
"ascreenfeed" setPiPEffect [2];```
restive leaf
#

But this is vanilla ARMA @high marsh and you just need an initplayerlocal for respawns (I think you need the latter)

high marsh
#

Right, but the same exact thing could be achieved vanilla.

restive leaf
#

This is vanilla

#

mission.sqm... NO MODS!

high marsh
#

Right. Scripts.

restive leaf
#

No mission.sqm and a script for respawns and the OP wanted to avoid a mod!

high marsh
#

There is zero point in hammering out each object's inventory in mission sqm

restive leaf
#

"the OP wanted to avoid a mod!"

high marsh
#

Mod in what way? The entire damn thing is contained in a mission

#

You could do this without A MOD.

restive leaf
#

You just posted a link to A MOD!

#

With cfgvehicles changes

high marsh
#

🤦 I know, I said I wrote this as a result of having the same issue. The same exact concept applies in a mission script. No mods.

restive leaf
#

Oh... damn... you were agreeing with me..?

high marsh
#

Yes. It's a gigantic waste of time to be applying all of the inventories through mission sqm alone th ough.

restive leaf
#

Agreed. I would have suggested Arsenal scripts based on saved loadouts and the roles, but the OP asked for an alternative

#

Thus me spending half an hour delaying going for food and learning something new 😉

#

And testing to make sure it worked

high marsh
#

Eh. I would approach it with mission configs. I like those. Mission config -> Unit type -> Does this type of inventory exist in config (like vest items) -> Wooho, apply the vest.

restive leaf
#

Seems complicated for a small MILSIM with a few roles but also sounds interesting. Care to share an example, and how it's implemented?

#

Because your mod concept does not work in a mission cause you cannot reconfig CfgVehicles unless you do it in a mod... sure you could do it with a lot of scripting, but given you can just set roles in mission.sqm and assign loadouts and have this in an initplayerlocal.sqf for respawns (this bit I have to test)? ```sqf
waitUntil {!isNull (findDisplay 46)};
missionNamespace setVariable ["SpawnData",[getpos player,getUnitLoadout player]];

player addMPEventHandler ["MPRespawn", {
_parameters = missionNamespace getVariable "SpawnData";
_respawnLoadout = _parameters select 1;
_respawnPos = _parameters select 0;
player setUnitLoadout _respawnLoadout;
_respawnPos
}]; ```

high marsh
#
class CfgMilsimRoles {
    class rifleman_1 {
        vestItems[] ={ 
            "BlahBlastProtector"
        };
    };
};
#
params[
    ["_unit",objNull,[objNull]]]
];
/*
    let's assume the classtype is "riflemnan_1"
*/
#define getRoleCfg(unitclass,var) var = missionConfigFile >> "CfgMilsimRoles" >> unitclass
#define getRoleArray(cfg,array,var) var = getArray(missionConfigFile >> "CfgMilsimRoles" >> cfg  >> array)
getRoleCfg("rifleman_1",classType);
getRoleArray(classType,"vestItems",vestItems);
{
    _unit addItemToVest _x;
   _unit canAddItemToVest _x;
} count vestItems
#

You can in theory override mod configs by having the function search mission config for the class first, and then if it it doesn't exist there then use the config values.

#

of course you can't use it for anything that has properties in the vanilla game like weapon configs

#

but for anything custom you can

#

with my example above, any unit that has the classname "rifleman_1" for example will receive the loadout

#

and realistically, if it doesn't exist in config it doesn't get added or changed. So you can roll with whatever you need to change just in config

#
cfgToUse = nil;
if(isClass(missionConfigFile >> "CfgMilsim")) then {
    cfgToUse = missionConfigFile >> "CfgMilsim";
} else {
    cfgToUse = configFile >> "CfgMilsim";
};
restive leaf
#

That's very cool if it works. But for the OPs situation the mission.sqm and initplayerlocal may be easier

high marsh
#

\ ¯_(ツ)_/¯

#

easier to control and you can make changes without any modification of script. It does work, have used it a few times before.

restive leaf
#

Sorry. You did say "in theory" I misunderstood that. But always remember that earlier posts may be answering a specific question from someone

high marsh
#

Hell, if you really wanted to you could even point to global vars for changes during runtime. But that gets all too needless.

#

This is one way to go about it.

restive leaf
#

Yeah. And all answers have now been lost 😂

high marsh
#

Saves you time in the longrun, but if this is still too much then I guess you could just grind out the mission.sqm

restive leaf
#

I am definitely gonna be using your stuff for something I need to do. Thanks 👌

#

As I said. Every day I learn something new

#

And LOL, saw that 😂

high marsh
#

😮

restive leaf
#

So @real moat a couple of different methods to achieve what you need above. With all things in ARMA there is always a way and often more than one. Mostly...

real moat
#

Daaamn, I dont know how you arrived on that arrangement, but it looks pretty solid.

#

I will certainly give that a try @restive leaf, thanks a bunch man.

#

May I PM you if I run into any issues?

restive leaf
#

Sure

#

In the morning NYC time

slim oyster
#

What is the best practice for hooking module functions? Say if I want to make a modular hooking of a module that adds multiple attributes from different components/addons?

real moat
#

Hmmm perhaps I should also just put more context out there.
Because if there is a better way of doing this, I am all ears.
Its just that still amateur with my sqf knowledge.

#

Okay so just for context:

In the unit, we would like to not have to use the lobby for role selection essentially. Ideally, most slots in the lobby would be generic, bar medics and engineers. The reason for this is that we'd like to work on a non-fixed team basis and the composition of the roles would change heavily from mission to mission.

So instead of having to arrange the composition in the editor every single time, we'd like to have it that you're picking your role through the loadout selection essentially. From there you'd be checked and assigned to a team depending on the composition and turnup for the mission.

Lets say last moment, co decides he wants an FSG, well instead of potentially not having FSG roles in the lobby to begin with or having to back out to get it, he just needs to tell a group to respawn and pick the corresponding role by means of loadout.

Not necessarily my first decision, but it was what people wanted, along with the functionality of being able to pick the spawn location using the same menu UI. So yea, that is why I went with this method. Hopefully that clears things up, but if anyone has a better idea of how to achieve this, please do shoot it my way.

astral tendon
#
    _Group setBehaviour "CARELESS";
    _wp =(group driver (vehicle (leader _Group))) addWaypoint [(getpos _helipad), 0];
    _wp setWaypointType "TR UNLOAD";
    _wp2 =(group driver (vehicle (leader _Group))) addWaypoint [(getpos EnemyAirSpawn), 0];
    _wp2 setWaypointType "move";
    _wp2 setWaypointCompletionRadius 100;
    _wp2 setWaypointStatements ["true", "
    _vehicle = (vehicle this);
    {_vehicle deleteVehicleCrew _x} forEach crew _vehicle;
    deleteVehicle _vehicle;
    "];    

My problem is that the AI just hover over the helipoint and then he is like: https://i.imgur.com/R9I0OBs.jpg
Then leave and never landed and droped the trops, in my first test it did worked and now he just refuses to land again.

grave stratus
#

@astral tendon how do you make the code colorized?

astral tendon
#

add the ```sqf

grave stratus
#

oh okay thanks

#
if (isServer) then {
    [ WEST, "Task_001", ["Bunuh Musuh di Jalan ke Kamenka dan", "Clear Jalan.", "Clear"], taskLoc, TRUE ] call BIS_fnc_taskCreate;
    trigtask = createTrigger ["EmptyDetector", getPos PERISIK1, true];
    trigtask setTriggerArea [3, 3, 0, false, 3];
    trigtask setTriggerActivation ["WEST", "PRESENT", false];
    trigtask setTriggerStatements ["player distance PERISIK1 < 3",'
    supplymark = createMarker ["supplymark", respawnmark_2];
    supplymark setMarkerType "hd_flag";
    supplymark setMarkerText "Bekalan";
    deleteVehicle trigtask;',
    ""];
};

[] spawn {
    if (triggerActivated trigtask) then {
        sleep 10;
        deleteMarker "supplymark";
        };
};

it seems that the script if working fine except that it does not delete the marker, where did i go wrong?

grave stratus
#

i wanted it to delete the marker after 10 seconds

slim oyster
#

you can put the sleep and deletemarker right in the trigger statement within a spawn

#

depending on where/when you execute that spawn with the sleep in it, it will check if trigtask is triggered, and if it is, sleep 10 seconds and delete the marker

#

if it is not triggered at the time you execute that spawn, it wont execute the code inside the if () then {} check

#

you could use waituntil, or put the spawn within the trigger statement

grave stratus
#

@slim oyster i will try it with waituntil

slim oyster
#
    "supplymark = createMarker ['supplymark', respawnmark_2];
    supplymark setMarkerType 'hd_flag';
    supplymark setMarkerText 'Bekalan';
    deleteVehicle trigtask;
    [] spawn {
        sleep 10;
        deleteMarker 'supplymark';
    };",
    ""
];```
#

or

#
    waituntil {sleep 0.1; triggerActivated trigtask};
    sleep 10;
    deleteMarker "supplymark";
};```
#

The second route spawns a new script thread that will continuously check if trigtask is triggered... while the setTriggerStatements simply executes that code which includes a new thread to wait and delete the marker. Spawning a thread to check if a trigger is triggered is redundant

grave stratus
#

well yeah i use triggeractivated because i use spawn outside of the trigger commands

grave stratus
#

thanks @slim oyster it works perfectly now

slim oyster
#

no problem

still forum
#

@tough abyss

So, when rotation comes to maps like Stratis and Altis, how to make sure those without Apex and Contact cannot join
Add something in the optional contact dlc part to requiredAddons in the mission. That'll be easy for contact, Apex not sure, but I assume there will be atleast one CfgPatches in apex that only owners have.

Is there a way to properly description.ext all of my functions to be included in the functions viewer if some of them look like this ?
Yeeeeeaaaaas.. kinda.. look at the script behind CfgFunctions. functions_f/something/initFunctions.sqf
The function viewer afaik reads the functions from variables, you can probably just inject your stuff into there manually.

#

@hasty violet

tough abyss
#

@still forum danke

tough abyss
#

You won’t be able to inject anything because functions are compiled before everything. If you want your mission functions appear in function viewer add them to description.ext CfgFunctions

still forum
#

yes you can inject functions that weren't defined previously

#

Though that only really works if functions viewer reads from the variables that initFunctions leaves. Instead of config directly

#

I looked into that some 3 years ago, don't remember

dull drum
#

Is there a way to damage a unit without shooting it but still hitting the HandleDamage EH?

#

Except of pushing unit off the roof 🙂

plain current
#

@dull drum doesn't the EH fire if u hit the unit with a car? or explosions? or something like that

winter rose
#

@dull drum set the velocity down 😄

dull drum
#

It does, @plain current . But RZ zom ies are hitting with set damage and I have no idea how to get them hit with velocity

winter rose
#
unit1 setVelocity [0,0,-10e10]```
high marsh
#

send the unit to hell

#

straight down

dull drum
#

But i only need to got it a bit with a zombie attack punch :)

high marsh
#

super punch

dull drum
#

One punch!

dull drum
#

@winter rose the fun part is that it really helped. Looks clumsy though when the attacked unit tries to hit the ground, but technically it works 🙂

tame lion
#

To reply to @young current about my object question, I'm building a prop hunt knock off for some simple fun for muy clan. The objects are just random props

#

I think I'm gonna have to do some jury rigged way with a "fired" eh and just wait till the bullet is deleted and detect the closest object to it, hoping it detects an object attached to a player

delicate lotus
young current
#

not yet. I think

#

current version is 1.94

#

dev is on 1.95

#

and next stable release is 1.96 where that command should get into main game

hollow lantern
#

@tough abyss I looked at the wiki and yes it claims UAV there, hence it worked at some point I'm pretty certain of it. But anyway, how else would I lock the camera? rn it is just looking straight forward where it has been created

tough abyss
#

The command works but it works with UAV, scripted camera is not UAV

#

If you want to control scripted camera look at gazillion of commands that start with camXXXXXX

winter rose
#

@dull drum you could also create the smallest ammo and make it a tiny velocity to simulate a bullet hit

dull drum
#

Zombies don't shoot, they are just waving hands doing setDamage 🙂

#

In case of ammo I should give them invisible guns or something.

#

Totally unrelated: I have a UI Dialog with some controls inside. It showed them by Draw3d EH. I'm trying to change controls position dynamically but it just stuck in place. I even changed the [x,y,w,h] to get them from the sqf var, but still no luck. Only reload moves controls.

#

Like x = "missionNamespace getVariable 'TEXT_POS' select 0";

#

But when TEXT_POS changes nothing is happening

winter rose
#
(missionNamespace getVariable ['TEXT_POS', [0,0]]) select 0``` just to be sure
dull drum
#

['TEXT_POS', 0] right? It's just a single X coord

#

Ah, no. It should be an array, sure

winter rose
#

yup, select

#

also, yes, you would have to ctrlSetPosition - from what I know, x/y/w/h don't update themselves if you "simply" update a var, it's set on dialog opening

dull drum
#

Well, it worked in the script that I robbed of this functionality 😦

#

actually it worked wit ctrlSetPosition

#

which failed in my script so I moved to the variable option

winter rose
#

I'm no expert ¯_(ツ)_/¯

austere granite
#

What do you mean by reload? Mission reload or reloading the UI resource?

#

Because changing TEXT_POS to whatever won't change anything at all while the UI is opened, it's not constantly going to look at what its config entries are and then constantly readjust by pure magic

hollow lantern
#

anyone can guide me whats he best approach to include a variable inside a string? I tried this: sqf _screen setObjectTexture [0, "#(argb,512,512,1)r2t("_feed",1)"]; seems not to work. the variable is just a value from a params array

#

normally the string would be one solid thing like sqf _screen setObjectTexture [0, "#(argb,512,512,1)r2t(feedname,1)"];

ruby breach
#

format @hollow lantern

tough abyss
#
format ["#(argb,512,512,1)r2t(%1,1)", "feedname"]
still forum
#

Kinda-popular mission framework breaks ACE and CBA.. what might be the cause?
Oh

{
    removeAllMissionEventHandlers _x;
} forEach [
    'HandleDisconnect',
    'EachFrame',
    'Draw3D'
];

uh.. okey then...

edgy dune
#

oh, lol wats the framework called

still forum
#

I'm already throwing enough shit at that guy for his abominable code, so better not name him 😄

tough abyss
#

You are doing Life support now?

edgy dune
#

oh okay thats understandable. I thought everything else was nice code but that. Here I thought u couldnt break ACE or CBA

ornate sky
#

what would cause a Zeus mission that works fine when tested my local dedicated server (Win), to not work properly on the remote Linux server, exact same file and mods

hollow lantern
high marsh
#

Wherever the camera is local to I assume.

winter rose
#

maybe a mix of cameraOn and setApertureNew?

#

@hollow lantern

hollow lantern
#

well said camera is created and then displayed on a rugged screen using r2t, so not sure if that works but I'll give it a try

winter rose
#

Ah, that maybe not. You might use ppEffects iirc? Wait, maybe not.

hollow lantern
#

that's my code for displaying camera data on a screen:

params ["_screen", "_feed","_pos", "_target", "_effect", "_aperture"];

_screen setObjectTexture [ 0, format ["#(argb,512,512,1)r2t(%1,1)", _feed]];

/* create camera and stream to render surface */
_cam = "camera" camCreate _pos;  
_cam camSetTarget _target;
_cam cameraEffect ["INTERNAL", "BACK", _feed];

_cam camCommit 0;

_cam camSetFocus [-1, -1];

setAperture _aperture;

/* switch cam to thermal */
_feed setPiPEffect [_effect];```
#

that aperture obviously doesn't work as expected

#

I just didn't remove it while pasting the code

winter rose
#

I am pretty sure it is touching HDR so it's a "general" setting yeah

hollow lantern
#

it is, sadly

tough abyss
#

does anyone know what this means

#
Fault address:  DA8BAFD1 00:DA8BAFD1 Unknown module```
tough abyss
daring parrot
#

This newbie have a question. :/

#

I would like to know is it possible to make all server users are using same modified config with out the mods

#

I don't think it's the smart way or easier way but, i really want to know about this

tough abyss
#

A mod is short for modified config, so if you are using modified config you are using mod, so no you can’t use modified config while not using mods (unless you are on special branch of Arma not available to public)

exotic tinsel
#

how can i make an ai bloody but have full health?

still forum
#

sethitpointdamage on legs mayb

#

in short: you can't

#

but you can probably give it veeeery little damage

exotic tinsel
#

na, looking to keep the bloody uniform on unit even though at full health. im trying to see now how to use getObjectMaterials on ai uniform. then i might be able to do setObjectMaterial when they get healed up

mortal wigeon
#

How can I get the position of a waypoint?

tough abyss
#

You can apply bloody texture and material with setObjectXXX @exotic tinsel

dull drum
mortal wigeon
#

Another question: I'm writing a paradrop script. When I eject the infantry out the back, the distance at which I do it has a huge effect on the way the pilot flies. If I eject them close (15m) he tries to pull up and fly away from them, screwing up the drop pattern. If I eject them far away (40m) he ignores them and stays level. Is there a way to make the pilot ignore them either way?

exotic tinsel
#

@tough abyss any idea on how i figure out what texture to apply for each type of uniform?

tough abyss
#

Look up in unit/uniform config, those bloody textures are listed somewhere

ornate sky
#

GameLogic vs Invisible Helipad performance?

#

I can use both to setup invisible scripts, which is better?

still forum
#

helipad better

#

game logic is simulated

#

just delete the object once script is executed?

rancid ruin
#

what is the (_this#1) we're iterating over?

#

it doesn't quite explain that and i've never seen a # in sqf other than as part of a map object's ID

rancid ruin
#

yeah but what is that?

still forum
#

_path

rancid ruin
#

ohhh

rancid ruin
#

ahh hash is the new select?

still forum
#

no

rancid ruin
#

oh my god

winter rose
#

oh my customer?

still forum
#

it's just a ugly alias that conflicts with preprocessor and only does a few things that select does

rancid ruin
#

["A","B",["C","D"]]#2#0; //C leave sqf for a while and it always gets worse

#

anyway that calculatePath looks like a good function

#

i wrote something that did the exact same thing a few years ago by spawning an invisible enemy with a super high animation speed lol

dull drum
#

@winter rose with a script like this one can make UI dance

HB_HBAR  ctrlSetPosition [(random 1), (random 1)];
HB_TEXT  ctrlSetPosition [(random 1), (random 1)];
HB_HBAR ctrlCommit 0;
HB_TEXT ctrlCommit 0;
winter rose
#

I bet yes 😁

ornate sky
#

The above, I'm using the object for both init box and to reference later for distance

hollow lantern
#

@tough abyss Yes, I'm already using that, that however has nothing to do with Aperture and I can't set it using setPiPEffect

austere granite
#

@dull drum

dynamic text changing you will have to do it with onLoad and ctrlSetText combination.

#

In general you should jus script those UIs anyway, its a lot more versatile

#

Might take some more thinking originally, but you can do everything you want for a UI through scripts these days in A3 so imo its a lot better to just go with that, unless you want them to be 100% static (which you dont)

dull drum
#

ctrlSetText works without ctrlCommit that's true.
Color and position as I found could be set dynamically with ctrlCommit, so it's fine.

#

Somehow I tend to keep basic UI settings in cfg, minding that now I can operate them how ever I want after.

sturdy sage
#
{
         private _pos = getMarkerPos _x;
    private    _target = ([_pos,0,"sab_boat_freighter_o", WEST] call bis_fnc_spawnvehicle) select 0;
    private    _ehKilled = _target addEventHandler ["killed", "deleteMarker _x"];
} forEach _eastMarker;

Not sure why it does not delete the marker when i kill a unit. I already tested with a hint message if the event handlers are working and they do.

hearty plover
#

okay... so,

I want civilians to have a unique ID(Like, ID Card with info) / Identity, and some other meta-data.

For example, given a mission I want to pre-create a roster of about 100 possible identities. When a civ spawns, means TBD (could be enigmans, could be ambeint module, could be eden placed) then the civ should randomly pick a ID from the list of identities, and if that ID is not being used in the active mission, they become that person (set identity, addItem ID with info, etc).

I have some ideas for implementation, but wanted to consult you guys to see if anyone has any ideas, or maybe can help me see some pitfalls.

#

My priamry idea is a array of identity properties,

[[ id, identity, face, voice, isDead, isWanted, isWhatever ], [...]]
#
_id select random arrayOfIds;
 - if id in use, select another
 - else add id to in use list
 - return the id
#

Once we have the id, we set all props on the civ, add inventory items, and build them (id badges with fields script or something)

#

My question is I have seen a mod like this, Advanced Civ Interaction, however it's grossly broken and ID's never match the NPC, and can be diffrent for each person checking the ID of the civ!

#

My first guess would be, to keep a list of civ units with ID's active, and spawned, on the server, and keep the meta-data vars their.

#

idk tho.

#

Not sure how this interaction needs to happen.

#

_ai setVariable ["id", "1234]

#

_aiMetaData = [_ai getVariable ["id", 0]] call fn_getAiData;

#

so, I keep the id assigned on the civ, and then wehn I need the identity info I can make a call to the list of id's on the server, this can be used to then pop any gui elements I need on the client?

#

Sorry folks, at this point I a rubber-ducking.

dull drum
#

Is there a BIS_fnc_rscLayer thing that kills rscLayer by name? 🙂

tough abyss
#

Explain what you want to do

dull drum
#

I generate health bars for ai units (both friendly and enemy). Each healthbar is a rsc Layer and a dialog + control inside. When units die I want to get rid of everything including their rsc layers.

hearty plover
#

Health bars hmmm

#

Sounds fun

hollow lantern
#

What's the best way to keep an AI steady? I have a gunner with an HMG behind a rounded sandsack barrier. After enemy contact the gunner just does a 360 all the time and with it sometimes is way out of the barrier and could be killed easily. I still want him to shot targets, just not look around as the only entrance where enemies would be is at the gate where I had him looked with doWatch

#

not sure if disableAI would fit here

hearty plover
#

disable movement on him, try that.

#

He should still be able to aim, I think.

#

Not sure for statics, but I use it for snipers allot.

hollow lantern
#

ah ok, thanks

dull drum
hearty plover
#

Not bad.

#

Looks pretty decent tbh, nice job.

dull drum
#

The main pain in the ass now is that some bars are staying on the screen after unit is dead. And it looks like it draws also the player's one, which I strangely can't get rid of.

hollow lantern
#

@hearty plover I think that should work: "PATH" - stops the AI’s movement but not the target alignment Available only since Arma 3 v1.61.

#

lets see

hearty plover
#

Please let me know.

#

Thank you for testing it.

#

Sounds like you should revist the logic that controls when they draw and when they remove @dull drum , maybe take some steps back out and focus on the life-time of the bar again.

hollow lantern
#

It's not just you! forums.bohemia.net is down. OOF

#

and so is the wiki

#

D:

#

works again

sturdy sage
#

It was up the whole time for me, i was browsing wiki the whole time. ^^

thorn saffron
#

Is it possible to attach something to a specific bone on A3 character using a command?

astral dawn
#

Is getPlayerUID the same for two arma clients with different arma profiles but same steam profile?

ruby breach
#

Should be

#

It's their SteamID

astral dawn
#

Yeah that's what I also thought, thx

winter rose
#

@thorn saffron yes, see attachTo

thorn saffron
#

WIll object attached to memory point will copy the direction of the bone?

winter rose
#

nope

viral mulch
#

Can u add controls to a ControlsGroup control via script?

serene vector
#

No

viral mulch
#

U sure about that?

serene vector
#

no

#

Found something^^

viral mulch
#

ty

tough abyss
#

hello nice gentlemen

#

on the apex protocol lobby there is a thing where if you hover over the image it blurs the image, is this a built in scripting command or is there some trickery going on here? I am curious on how to reproduce this, thx

winter rose
#

@tough abyss isn't it the blurred image in paa on top of the other?

tough abyss
#

yeah thats what i thought

#

but i was hoping not 😦

winter rose
#

Why not?

flint iris
#

Hello, I am looking for a script. I need an object to rotate around its axis 360° and start again. Will drop 5€ paypal to whoever helps me with this.

young current
#

what type of object, which axis, how smoothly

#

throwing the money card might also be considered tacky.

cosmic lichen
#

@flint iris I might be interested, but not for money

winter rose
#

send money first, I help later 😄

cosmic lichen
#

What axis and what object? Also, in a permanent loop?

flint iris
#

It will be a vehicle and preferably by 1° every 0.1s so it will look smooth.Axis will by x

#

Basically will be something with setDir

cosmic lichen
#

I see

young current
#

so a carshow spin.

cosmic lichen
#

Yep

young current
#

oh but X-axis would mean its spinning forwards

flint iris
#

Oh sorry my bad.As you said it will be carshow spin

young current
#

you might want to consider making a object with slow non-stopping spin animation and attaching the object to that

#

it would not have to be managed by the script constantly

cosmic lichen
#
    "Zebra_CarShow", 
    "onEachFrame",  
    { 
        params ["_vehicle"]; 
        private _dir = getDir _vehicle + 0.2;
        _vehicle setDir _dir;  
    },
    [VEHICLE_VAR_NAME_HERE]
] call BIS_fnc_addStackedEventHandler;```
#

If performance is important you might want to consider @young current suggestion.

#

To increase the speed, change 0.2

flint iris
#

Lovely!

#

@cosmic lichen Ive send you an PM

obsidian violet
#

hey guys, quick question regarding remoteexec.

I have a curator module and want to unassign the module from the owner.
it seems to work when the mission is locally hosted but not on dedicated.
Can you please help me set this up correctly?

Variable name of the curator module is KLT_moduleZeus

KLT_moduleZeus remoteExec ["unassignCurator",0,false];
cosmic lichen
#

Where do you execute the command? unassignedCurator is supposed to be executed on the server and should be mp compatible.

obsidian violet
#

I execute it locally from a ace self interaction

//Remove zeus 2
        zeus_remove_two = ["Disconnect Zeus","Disconnect Zeus","",    
        {hint "Disconnecting zeus 2..."; //Debug
        zeustwoBusy = 0;
        publicvariable "zeustwoBusy";
        I_amonlist = 0;
        remove_action_2 = 0;
        KLT_moduleZeus remoteExec ["unassignCurator",0,false];
           

        },{remove_action_2 == 1}] call ace_interact_menu_fnc_createAction;     
        [player,1,["ACE_SelfActions"],zeus_remove_two] call ace_interact_menu_fnc_addActionToObject;
cosmic lichen
#

I see

#

KLT_moduleZeus remoteExecCall ["unassignCurator",2];

#

Set the server as target by replacing 0 by 2.

#

See if that works.

obsidian violet
#

Did try it to only run on the server before but there was no difference...

I did try it just before you posted and now it works.
I forgot the [] around KLT_moduleZeus. 🤦

//Working 
[KLT_moduleZeus] remoteExec ["unassignCurator",0,false];

Im going to set it to run only on server. would it be better to use remoteExecCall instead?

cosmic lichen
#

I always prefer call over spawn.

#

We don't need suspension for that code so we avoid it.

hollow thistle
#

doesnt matter for commands.

#

you can't spawn a command.

cosmic lichen
#

@obsidian violet The brackets are optional and only need to be used with multiple parameters

#

Not sure if that's the issue.

#

it could be that when you exec that code KLT_moduleZeus is unknown since it local to the server only.

obsidian violet
#

Optional or not. It did make the difference somehow since its working after that change.
But as I said, It worked when it was hosted locally the way it was before but not on dedi.

Now it works on both 🙂

cosmic lichen
#

Maybe because the array is passed to remoteExec instead of evaluating the variable first and then sending the value to remoteExec. wild guess

#

Maybe someone with more knowledge can clarify @winter rose @still forum

winter rose
#

w8 wat?

#

so sqf KLT_moduleZeus remoteExecCall ["unassignCurator", 2]; doesn't work but sqf [KLT_moduleZeus] remoteExecCall ["unassignCurator", 2]; does?

cosmic lichen
#

That's what @obsidian violet said

winter rose
#

it seems to be a requirement according to the biki yeah

#

…or not

hollow thistle
#

should work without wrapping array for unary commands.

#

🤔

cosmic lichen
#

"hello" remoteExec ["hint", -2, "some_JIP_ID"]; from biki example

winter rose
#

yep, as I am used to do

sooo explain yourself @obsidian violet , why did you break it?

obsidian violet
#

Nearly have not changed to remoteExecCall yet.
so following

//Does not work on dedi but do work locally.
KLT_moduleZeus remoteExec ["unassignCurator",2,false]; 


//The change - Does work locally and on dedi. 
[KLT_moduleZeus] remoteExec ["unassignCurator",2,false]; 

If I remove the brackets it does not work anymore. Something is weird here... need to check it even further. Thanks for your help guys. main thing is that its working.

hollow lantern
#

@hearty plover so nope, the auto-rotating gun stops when issuing disableAI "WEAPONAIM"

#

it's not path or move related

young current
#

sounds logical if the AI stops aiming it?

hollow lantern
#

yeah, my point was that I had an gate entry I want to cover with the gun, however AI moved 360 around with the gun once an enemy was present and the sandsack barrier was not covering him once he moved out of it. AI looked at a completely different direction where no enemy would appear.

#

even while I ordered a doWatch at the gate

#

didn't came across a solution to that other then disabling the WEAPONAIM

lucid junco
#

do someone know if possible to delete roads via script in mission?

dim kernel
#

is there a way to log every script that is executed?

ruby breach
#

More a #arma_battleye question, but sure. Change your filter to just be 1 ""

tough abyss
#

Wouldn’t this log every script statement rather than every script?

winter rose
#

@lucid junco hideObject, but you will have harsh cuts in the road

still forum
#

Maybe because the array is passed to remoteExec instead of evaluating the variable first and then sending the value to remoteExec. wild guess
That's impossible @cosmic lichen

#

You cannot pass a variable to anything

silent latch
#

is there a way I can put a variable name on a vehicle I spawn in the mission

rough heart
#

Yes

#

Google knows le answer, set variable Arma 3

cosmic lichen
#

@still forum Do you have an idea why ```//Does not work on dedi but do work locally.
KLT_moduleZeus remoteExec ["unassignCurator",2,false];

//The change - Does work locally and on dedi.
[KLT_moduleZeus] remoteExec ["unassignCurator",2,false];``` That happened?

still forum
#

"but do work locally" already means that remoteExec understands the parameters

#

maybe something wrong with the function itself

#

what does "does not work on dedi" mean?

#

or rather "do work locally" mean? unassignCurator is a server only command

#

why would it work locally

winter rose
#

Maybe he means in the editor

obsidian violet
#

@winter rose correct, when I said locally its a started mp game in the editor.
I can send over what I got later.
it does work the way it should now. Must be something with the function like dedmen said, when im using the same line for other functions it works like it should, with or without brackets.

winter rose
#

command* though

#

But yeah… strange.

still forum
#

no i mean function, not command

#

though at that point I didn't realise that unassignCurator != call, and that KLT_moduleZeus != CODE

runic quest
#

I have a question about how to write an EXE program to connect to the database and write the corresponding functions in the EXE program to more easily and intuitively rewrite player data. Thank you

still forum
#

You are asking how to learn programming?

#

Watch some C# tutorial on youtube or smth

runic quest
#

@still forum Yes, I want to use an EXE program and write corresponding tables to represent the corresponding functions, intuitively rewrite it, and connect to the database through config.

tough abyss
#

Check stackoverflow

narrow pollen
#

I've been messing around with the Civilian Presence module released with the Tac-Ops update, however It doesn't seem to despawn the units when I get out of my trigger zone (which is synced to the presence module). Does they despawn gradually/ after a few seconds ? Thanks for any help

#

I did see that it doesn't spawn or despawn when in LOS of the player, however would that count Zeus as well ?

lucid junco
winter rose
#

that's what I had in mind, I thought it would work

#
{ hideObject _x } forEach (player nearRoads 100);```
astral tendon
#

Were can i get a list of all ACE variables to edit? especially the ones related to action range

lucid junco
#

dont remember if tried exact this syntax

#

will try

still forum
#

@astral tendon nowhere. Go through the code manually

lucid junco
#

@winter rose nope. Seems roads cant be operate like object

#

its sad

winter rose
#

welp, indeed!

#

(tried in the editor, right? as hideObject is local)

hasty tundra
#

nearestTerrainObjects?

#

{
_x hideObjectGlobal true;
} foreach (nearestTerrainObjects [(getPos _target),["ROAD","MAIN ROAD","TRACK"],500]);

winter rose
#

@lucid junco

lucid junco
#

will try

#

thx

#

@winter rose @hasty tundra no succes

#

i think i tried some variations of this already

astral tendon
#

Does ace makes the MBT kuma malfunction its coaxial? im having that by just firing a little

#

the coxaial reloads afther a few shots

winter rose
#

10 rounds magazine

astral tendon
#

really?

winter rose
#

yup, due to videogames bringing gun violence they had to tune it down for the USA market

astral tendon
#

🙄

winter rose
#

next patch brings flower picking 😄 💮

astral tendon
#

We need the bolt action glock to bypass those laws

winter rose
#

joke aside, IDK Ace a lot. isn't it some overheating of some sort? any other mod?

astral tendon
#

im just using RHS and its compacts and ACE

#

that does not happens 100% of the times

#

also, that malfunction happened in the tank campain

astral dawn
#

I wonder if remoteExecuted functions are executed in order on the remote machine?

#

If I do

... remoteExecCall ["fnc1", ...];
... remoteExecCall ["fnc2", ...];

Does arma guarantee that fnc2 is be executed after fnc1 on the remote machine?

winter rose
#

I would say "don't count on it"

astral tendon
#

maybe make another function to call it in order locacly?

cosmic lichen
#

@astral dawn They are not.

#

Check the note in the description of remoteExecCall.

finite dirge
#

If you run two of them on the same target, it should queue them, but as Lou said, don't count on it.

astral dawn
#

You mean the note with the orange exclamation mark? This note deals with a bit different topic.

winter rose
#

it should
☝ …but don't count on it yeah 🙂

cosmic lichen
#
call func1; call func2; // func2 will always execute after func1```
#

I am takling about that note.

#

Ah I see the difference

winter rose
#

yup

cosmic lichen
#

Sorry for that.

astral dawn
#

Yeah it doesn't correspond to my question though, I am talking about two remote calls on a remote machine

winter rose
#

remoteExecCall might queue them as @finite dirge stated, but further stress test is required (or dev insight)

astral dawn
#

Yeah thanks guys
We know so far that remoteExec is reliable, although no info if it also works in order 🤷

finite dirge
#

It does from my experience in the hated Life Community ABlobHaha

remoteExec wouldn't be in order, remoteExecCall should be, but if you want it guaranteed, use remoteExec and some logic or pass a var to a loop or something you have as a worker to handle that if it's something constant.

astral dawn
#

Yeah I meant the remoteExecCall all the time, not remoteExec.
Thanks for the info!

crisp cairn
#

_coreTemp = 37;

systemChat "Worked";

onEachFrame {hintSilent str getPos player; _playerPosY = hintSilent str getTerrainHeightASL (position player);};```
#

Hello all, I am struggling with this basic little script. I want the game to give back the player position each fame and the hintSilent str does this good enough. But I want to store the players height each frame so it can be used else where. Anyone know how this can be done?

winter rose
#

@crisp cairn you should use a global variable, onEachFrame works in its own scope

#

also, sqf private _myPrivateVar = "value";

crisp cairn
#

Ta mate, so

#

onEachFrame {private _playerPosY = getTerrainHeightASL (position player);};

#

Within each frame?

winter rose
#

Nope, a global variable 😉

WEL_playerTerrainHeight = blah```
plain current
#

You mean a global variable? Public variables are ones on everyclient broadcast with publicVariable or setVariable

winter rose
#

er, yes! global

#

let me facepalm while I get back to you

#

never said "public", totally never said that

dusk sage
#

(edited)

winter rose
#

ssssssh don't ruin it 👀

mild pumice
#

anyone good in math ? I have a problem with relative/world position between objects and the attachTo command

#

I use BIS_fnc_attachToRelative to attach the car to the object while keeping its orientation

#

but i need to attach it to a specific memory point, otherwise the car doesn't follow the object's animations

#

and this method can't do that

#

the code of attachToRelative :

params ["_obj1", "_obj2", ["_visual", true]];
private _orient = _this call (missionNamespace getVariable "BIS_fnc_vectorDirAndUpRelative");
_obj1 attachTo [_obj2];
_obj1 setVectorDirAndUp _orient;
#

So what i need is this

_obj1 attachTo [_obj2, [0,0,0], "attach"];

But i need to know how to calculate the pos to put instead of [0,0,0]

plain current
#

So what is the question?

mild pumice
#

i need a script which attach obj1 to obj2 on a specific memory point without changing the pos and orientation of obj1

plain current
#

Ah

#

selectionPosition to get memory positions of objects

#

worldToModel to get the relative position of obj1

astral dawn
#

attach obj1 to obj2 without changing the pos ... of obj1
Must be a mistake in your sentence? 🤔

mild pumice
#

no why ^^'

plain current
#

vectorDotProduct with [-1,-1,-1] to make the relative pos negative and then _memPos vectorAdd _dotProduct

#

And attach to the result

#

There you go

#

Then the object should be attached to the memory pos without moving the object

astral dawn
#

Yeah ok, so you need an offset from the memory point, in model's space, my mistake

plain current
#

Dont have a pen and paper and writing this on my phone since im at a party, so no clue if that'd work and unable to test

astral dawn
#

Ugh isn't there an SQF command to get position of a memory point of an object? 😮

plain current
#

^^ selectionPosition to get memory positions of objects

astral dawn
#

ah yes!
I'd assume that you need to:
selectionPosition to get memory position in object1's model space
then worldToModelVisual object2's pos into object1's space
substract the two and you get the offset
I think... 🤔

plain current
#

If obj1 is the main object and obj2 is the one being attached then yes

astral dawn
#

ah damn... yes, I mixed them up 😕

plain current
#

obj1 worldToModel getpos obj2

#

And yes obj1 selectionPosition "mempoint"

mild pumice
#
_memPos = _obj2 selectionPosition ["attach", "Memory"];
diag_log ["_memPos",_memPos];
_objRelPos = _obj2 worldToModel getPos _obj1;
diag_log ["_objRelPos",_objRelPos];
_finalPos = _memPos vectorDiff _objRelPos;
diag_log ["_finalPos",_finalPos];

_obj1 attachTo [_obj2, _finalPos, "attach"]; 
#
19:38:31 ["_memPos",[-2.64375,0.136325,-0.59973]]
19:38:31 ["_objRelPos",[-0.215332,0.427734,-0.891212]]
19:38:31 ["_finalPos",[-2.42842,-0.291409,0.291482]]
plain current
#

Sure

astral dawn
#

instead of getPos you should use getPosWorld

#

getPos's Z coordinate is relative to terrain or objects or whatever

#

_finalPos = _memPos vectorDiff _objRelPos;
maybe the other way around?
objRelPos - memPos

frigid raven
#

is there a way to check by script if a unit is behind a bush/tree/etc. ?

astral dawn
#

Hmm how do you define 'behind'?
I think there should be a way, yes

#

do you need to check only bushes and trees specifically?

#

or also buildings, cars...?

mild pumice
#

@astral dawn it almost works when switching _memPos and _objRelPos
https://i.imgur.com/bbxaW4i.png
it's just the Z, i tried getPosWorld but it puts the car in the sky

astral dawn
#

(I assumed worldToModel to accept world coordinates)

plain current
#

@frigid raven intersect and its variants

still forum
#

AGL makes that even more complicated as you have two reference systems.
One is the height above the terrain of the source position, and the height above the terrain of your model 🤔

#

you can workaround by doing a vectorDiff after a modelToWorldWorld

#

And that way work with world coords

astral dawn
#

_objRelPos = _obj2 worldToModel (ASLToAGL (getPosASL object _obj1));
maybe this can work...

frigid raven
#

I was hoping for a _unit nearbyBush _radius 🤣

still forum
#

Is that talk about attachTo and keeping the object in the same position as it was before?

astral dawn
#

yes

still forum
#

Because that thing we solved right here a few weeks ago

frigid raven
#

Ok then I screwed the context

mild pumice
#

that's it + link it to a memory

still forum
#

you are probably overcomplicating things then

#

Our solution from a couple weeks ago was very simple

mild pumice
#

😦

still forum
#

basically end result was that we both thought it's gonna be complicated, while it wasn't at all

#

TLDR; do nothing