#arma3_scripting

1 messages ยท Page 197 of 1

snow viper
#

i checked the timestamp to make sure that log output belongs to that particular AI

errant iron
#

dumb question, does your game server have the all same mods loaded as you?

#

like RHSSAF, 3CB and all

snow viper
#

its not as dumb as you think

#

but all the content that is being used by this script is in fact on the server yeah

#
  • requirements
#

i guess what i could do is reupload the mod to server just to be sure, its been updated a bunch over the past weeks but shouldnt be in any way that impacts this

#

i installed arma 3 server on same machine as my game earlier, and in those tests the units always spawn with their loadout fully sorted

#

so i think you are on to something with the delay

#

since i was connecting to that with internal ip

errant iron
snow viper
#

im beginning to doubt FASTER now

errant iron
snow viper
#

its been behaving erraticly

#

i think the RPT lists the loaded mods

#

sec

#

got confused for a sec which mod we were talking about lol. Man its been so long staring at this stuff im just seeing stars at this point lol

#

i check RHS mods are all loaded on server, so is 3CB, so are the other content mods that are used for the loadouts

snow viper
thin fox
#

How can I get the laser object from an UAV directly? I can't get it with laserTarget ๐Ÿค” laserTarget (remoteControlled player) // returns null

fair drum
#

or, do you even have mod verification with keys enabled?

plucky pewter
#

Is it possible for me to overload a built-in function for my mission? For instance, I'd like to overload fn_masterarm.sqf to remove the capability to change loadouts.

snow viper
#

it looks like Faster shit the bed thoroughly

#

im gonna bite the bullet and set it up from scratch

#

its so bad i dont think my problem its script related anymore

#

i think all sorts of stuff is messing up under the hood of faster to the point where the UI and what actually happens with mod files and on server launch dont correspond in the slightest

#

so beginning to think those classnames were in fact missing @errant iron

granite sky
snow viper
granite sky
#

nah

snow viper
#

buhhh

granite sky
#

It's Arma, everything is awful

snow viper
#

fair

#

๐Ÿ‘ป haunted house

granite sky
#

It's likely a lower level issue because many hosting providers have the same issue. steamcmd tends to timeout in the middle of downloading mods or something.

fair drum
#

faster is pretty solid once you know the quirks, but shes also busy and can't put out more patches atm

#

and yeah the steam timeout is a big thing

granite sky
#

I'm not sure what the standard workaround for that is.

fair drum
#

you keep trying

#

you still keep the partial files

granite sky
#

I just see a lot of people with the problem and send them to the Faster discord :P

fair drum
#

there is always CLI too ๐Ÿ˜ฆ

granite sky
#

And they can at least tell them which button to click on.

#

For a personal server you can re-use the client data and not bother with steamcmd at all. Saves a lot of hassle, but then making command lines for high mod counts is a pain.

snow viper
#

im hosting for a community, we play with a variety of mod sets so faster is really the only option

#

i know there is a good linux software for arma server management but my box is windows

granite sky
#

Ah well, keep clicking that update button or whatever it is

snow viper
#

oh i ahvent had that issue in a while

#

i started suspecting things when a while ago it told me i had unsigned content when in fact everything was properly signed on client and server

#

since then i guess its just been degrading

#

just now i found that RHS mods were on the server, though not being used by faster, while still visible in the UI, and it was loading what now seems like empty mod folders lol

#

dont even know whats going on anymore, just select all, delete, and start over

grand oracle
#

I need a hand, I'm trying to make a thing that does one line if BOL_1 is taken, and another thing if the slot is untaken (variable undefined)
At the moment the code breaks due to undef var

#
    //OP LEAD
    if (isNil BOL_1) then {
        "There is not an OP Lead yet, there may be an Element Lead to run the show.";
    }
    else {
        if (vehicleVarName player == BOL_1) then {
            "You are the OP Lead.";
        }
        else {
            format[ "The OP Lead is %1." , name BOL_1 ];
        }
    },
#

this is a block from the total hintC script

warm hedge
#

isNil takes a string, not a identifier

grand oracle
#

I see, when I ran that before using string I got a dif error.

#

[] spawn { 

"Mission Information:" hintC [

if (isNil "BOL_1") then {
"Ther>
14:21:51   Error position: <hintC [

if (isNil "BOL_1") then {
"Ther>
14:21:51   Error Type Any, expected String,Text```
#

That was when it had quotes

warm hedge
#

Post your code not just error

grand oracle
#
    //OP LEAD
    if (isNil "BOL_1") then {
        "There is not an OP Lead yet, there may be an Element Lead to run the show.";
    }
    else {
        if (vehicleVarName player == "BOL_1") then {
            "You are the OP Lead.";
        }
        else {
            format[ "The OP Lead is %1." , name BOL_1 ];
        }
    },
#

this led to error above

warm hedge
#

Where is hintC

grand oracle
#

This is a block only hang on

warm hedge
#

It seems one of your texts within if and switch is not returning a string properly

grand oracle
#

Yeah error's on the first block I sent

warm hedge
#

You really sure the first if is doing it

grand oracle
#
if (isNil BOL_1) then {
"There is not an OP Lead y>
14:57:42   Error position: <BOL_1) then {
"There is not an OP Lead y>
14:57:42   Error Undefined variable in expression: bol_1
14:57:42 File C:\Users\alex-\Documents\Arma 3 - Other Profiles\TechnoTrog\mpmissions\OPS - Regular\Cherno.chernarusredux\scripts\welcome.sqf..., line 9
#

from RPT

#

wait no wrong error

#

that was no quotes

meager granite
#

Your conditions return nil and it seems hintC doesn't like it

grand oracle
#
15:19:39 Error in expression <0;

[] spawn { 

"Mission Information:" hintC [

if (isNil "BOL_1") then {
"Ther>
15:19:39   Error position: <hintC [

if (isNil "BOL_1") then {
"Ther>
15:19:39   Error Type Any, expected String,Text
15:19:39 File C:\Users\alex-\Documents\Arma 3 - Other Profiles\TechnoTrog\mpmissions\OPS - Regular\Cherno.chernarusredux\scripts\welcome.sqf..., line 7
#

Thats the error using the above sqf

meager granite
#

Simplified:

"asd" hintC [
    if(true) then {"100"},
    if(false) then {"200"}
];
```will do array of "100" and nil which errors it out
#
"asd" hintC ([
    if(true) then {"100"},
    if(false) then {"200"}
] select {!isNil"_x"});
```do this to filter out nil lines
grand oracle
#

What does that return then?

meager granite
#

it will remove nil items from array before sending it to hintC

#

First code bit will produce ["100", nil] and error out, second will make ["100"] array

grand oracle
#

does that not just only then return the first value?

meager granite
#

no, it selects items that aren't nil

#

try it, wrap your right hintC array like that

grand oracle
#

ok

meager granite
#

[1,nil,2,if(false)then{100},3] select {!isNil"_x"} => [1,2,3]

#

More specifically your if ((groupId group player) == "Bruiser 1") then { lines end up in nil as they don't have else condition

grand oracle
#

We might be in biz here

#

first slot worked.

#

checkin gthe others

#

Yew

#

rock on that worked, love the community

open marsh
#

hey is there a way to destroy the glasses / window of a building? ai inside buildings dont wanna shoot at a target they see if there's a window infront of them that isnt broken...

#

ok i foud it

#

private _building = nearestBuilding player; {if ((_x select [0,1] == "g") || (_x find "glass" != -1)) then {_building setHitPointDamage [_x, 1];}} forEach ((getAllHitPointsDamage _building) select 0);

runic blade
#

Hey so idk where to address this, but I seem to have a problem where the DLC watermark appears on a modded item. I do not own any of the dlc's

#

but when I play on a different modpack, there's no watermark anymore

#

we're still talking about the same item in two different modpacks

swift cedar
#
_nearestPlayer setPosATL (getPosATL pad1);

Trying to make a teleport trigger that if one player steps on it, they (the nearest to the trigger) get teleported to pad1. Tried to use just player setPosATL but it teleports the whole lobby meowsweats.

^ Current result of using _nearestPlayer is that it doesn't teleport anyone or anything. Tried to run this via singleplayer and MP (locally hosted) with no luck.

swift cedar
runic blade
#

yeah, but the thing is on one modpack, with 17 mods and this one, the item (helmet) has no watermark

#

but the other modpack with about 60 mods, the same helmet proceeds to have the watermark

#

my best guess is a collision somewhere

stable dune
real tartan
#

how to process event handler once per hit ? want to also register fire from handgun if possible
with these conditions event is still triggering multiple times

_tank addEventHandler [ "handleDamage", {
    params [ "_unit", "_selection", "_damage", "_source", "_projectile", "_hitPartIndex", "_instigator", "_hitPoint", "_directHit", "_context" ];

    if ( not local _unit ) exitWith {};
    if ( damage _unit >= 1 ) exitWith {};
    if ( not isDamageAllowed _unit ) exitWith {};
    if ( _projectile isEqualTo "" ) exitWith {};
    if ( _context isNotEqualTo 0 ) exitWith {};

    // process damage

    _damage
}];
meager granite
meager granite
hallow mortar
# real tartan how to process event handler once per hit ? want to also register fire from hand...

As far as I know there is no 100% consistent way to do it with handleDamage. hit EH might do it, I forget, but then you don't have damage handling.
The reason it's firing multiple times is because the bullet is hitting multiple sections of the body, either directly or by damage spreading to adjacent selections. If you want to properly handle incoming damage, you'll need to process these secondary hits too.

meager granite
#

But yeah, you must process your HandleDamage function for each hit part. You can come up with some elaborate scheme like saving the damage into variable and then do calculations at the end of frame but I wont recommend it as its very complex topic

#

What's your end goal anyway?

real tartan
# meager granite What's your end goal anyway?

register hit by any weapon
calculate overall damage based on projectile ( e.g. missile = kill in 1 hit, tank shell = kill in 2 hit, bullet = kill in 500 hit )
apply damage to vehicle

do a more "arcade" damage model

#

problem is, that event is trigger multiple times = adding more damage than suppose to

meager granite
#

What you need is to get previous damage and return it instead (not exitWith) if you want to skip that damage part

swift cedar
meager granite
#

You can't exitWith out of topmost scope in event handlers

#

exitWith {0} will heal the unit to 0 damage on that part

real tartan
#

ah, so exitWith { damage _unit }

meager granite
#
_tank addEventHandler [ "handleDamage", {
    params [ "_unit", "_selection", "_damage", "_source", "_projectile", "_hitPartIndex", "_instigator", "_hitPoint", "_directHit", "_context" ];
    private _old_damage = if(_hitPartIndex < 0) then {damage _unit} else {_unit getHitIndex _hitPartIndex};
    
    call {
        if ( not local _unit ) exitWith {_old_damage};
        if ( damage _unit >= 1 ) exitWith {_old_damage};
        if ( not isDamageAllowed _unit ) exitWith {_old_damage};
        if ( _projectile isEqualTo "" ) exitWith {_old_damage};
        if ( _context isNotEqualTo 0 ) exitWith {_old_damage};

        // process damage

        _damage
    };
}];
snow viper
#

guys im going absolutely crazy

#

how is it possible for a server to demand for mod signatures with the verification turned off?

warm hedge
fair drum
snow viper
#

๐Ÿ‘

#

alright so sorry for wasting everyone's time with the randomized loadouts issue, it turns out it was cursed FASTER

#

fresh install + all mods deleted and redownloaded fixed the loadouts script

#

i have no idea why there were no related errors generated for anything else missing

#

weve been playing missions on this busted configurations with all sorts of assets for weeks without trouble with anything but my home made random loadout script

#

my last question is what would be the optimal way to implement this stuff, the current state of things is based on the latest attempt of fixing the problem

#

should i do this?

#

or this?

snow viper
errant iron
#

both options work, but IMO i would keep the local check inside the function

#

that'll simplify your init= fields and make it less likely to encounter the same bug again, like if you call the function in a different script, it'll simply do nothing on remote units rather than sometimes half-loading them incorrectly

snow viper
#

thanks again for all your help @errant iron

rustic bloom
#

.

open marsh
#

is there a guide for obfuscating ur code files

winter rose
#

why would you

open marsh
#

so it doesnt get stolen

winter rose
#

make your addon/script server-side then
obfuscation is slowing things down and does not even prevent finding the original code

granite sky
#

Most likely no-one wants your code except OpenAI :P

fair drum
#

One way to get obfuscated code is to just write it absolutely poorly lol.

thin fox
#

๐Ÿ˜‚

thorny osprey
#

Who knows how to use RadioProtocol from script? What I want to achieve is scripted messages to group radio mimicing player commands to AI. I know the RadioProtocl config and figured out that you can do eg.
player groupRadio "SentCmdDetonate", which works (player says "Detonate charge" in correct voice/language and radio chat message is shown. What doesn't work is that the selected AI team member is not said as part of the message, eg. "Two, Detonate charge".

#

The RadioProtocl config shows that there are arguments in the messages, eg. configfile >> "RadioProtocolENG" >> "SentCmdDetonate" >> "__1_1___Detonate_charge" >> "text" is "%1.1 - Detonate charge"; How can you fill the %1.1 argument from script?

kindred zephyr
junior totem
#

hello, so i want to make a simple mod, but after i load the mod and get in to the main menu of the game it says that the mod's fn_initPlayerLocal.sqf is missing, even though its in the mod folder where i work it on before i pack it into a pbo, can someone help me with this?

#

im new to modding arma3 so sorry if i made any confusion

stable dune
junior totem
#

sure

errant iron
#

I hadn't thought about this before, but if I create a unit and then remote execute a function on another client with the unit as an argument, is it guaranteed that the unit will be broadcasted to that client before the function is executed?

errant iron
#

whew, was a thought that came up while debugging my curator modules not initializing reliably

#

well, half fixed at least, module comes out uninitialized in postInit, but it now works if i delete it and let the mission regenerate the module later

#

meh, good enough ๐Ÿ™‚

kind wind
#

Has there been any luck? I was planning to do something like this for a survival mission but just couldn't wrap my brain around it.

olive cipher
#

Is it possible for a Task to have multiple targets attached to it?

proven charm
#

Example 2

olive cipher
#

Ah ok cool, seemed a bit overkill as i just want to highlight like 5 enemies at the end of a wave. So best case would to be create a task per enemy?

proven charm
#

yeah

#

child tasks

olive cipher
#

Thank you

zenith sleet
#

dont know if this is the right place but. I am trying to start Arma 3 and I keep getting a crash on startup followed by
z/ace/addons/main/script_macros "not found"
I dont want to use ace anymore but the game wont work unless I have ace loaded is there any way to fix this?

proven charm
#

maybe some other mod requires it?

zenith sleet
proven charm
#

hmm maybe you should still try without any mods

zenith sleet
#

its weird

haughty timber
#

What code do youn need me to show you?

errant iron
#

How would I go about compiling a bunch of scenarios together and publishing it in a mod? I'm currently maintaining five different workshop scenarios involving different sets of dependencies, and that requires me to re-open Eden Editor repeatedly and manually update each scenario which is getting cumbersome, hence the idea to compile them together.

Ideally this mod would work server-side and the scenarios could be downloaded onto clients like a normal scenario file, though if I can't do that, I'll likely continue offering the bare scenario files outside of workshop. The scenarios share a ton of scripts, and as part of keeping it server-side, I (probably?) can't afford to extract them into a common addon. However, I maintain each scenario as a separate branch in a Git repository, so merging changes across them is relatively easy. I'd imagine having a branch that contains just the addon files, and then using a Python script to copy the scenario directories into the addons before packing and publishing it.

FYI I've never published a proper mod before and couldn't fully grasp the addon mechanism from the "Creating an Addon" wiki page, so I might need some pointers on that too.

errant iron
#

yeah, i have a rough idea that i'll probably need CfgMissions.MPMissions, multiple addons, and CfgPatches.requiredAddons to specify each scenario's dependencies, i'm just not sure about other details that i might not know about

#

HEMTT seems like a pretty useful tool too, but i previously didn't know how to proceed after generating the project template, and couldn't find much more info from the docs either

lone needle
#

does anybody know how to create an eden editor script for the following please: land_3as_Sullust_Factory_Light_Red

I am trying to make it flash on and off repeatedly on activation.

If u can help that would be great thanks.

meager granite
lone needle
meager granite
#

I don't know what this object is but start simple, make it appear on your "activation" event, whatever you wanted it to be

#

Learn triggers and addAction, depending on what you need

lone needle
manic verge
#

i suppose this fits here

#

im very new to scripting in pretty much anything lol

#

but ive managed to load some textures onto a shikra using SetObjectTexture (in the eden editor)

#

all im trying to figure out is

#

the fuselage is
SetObjectTexture [0, 'texture.jpeg'];
and then wings are
SetObjectTexture [1, 'texture.jpeg'];

#

is there one of these numbers for the cockpit texture?

#

or do you have to modify the vehicle config to change that

hallow mortar
#

Depends on the vehicle. Custom textures are applied to "selections", which are defined in the model. If the model doesn't have an accessible selection defined for a particular part of it, then you can't change the texture of that area without modifying the model.

manic verge
#

ahhh the fuckin hiddenselections

#

thats what those are?

hallow mortar
#

You can inspect the vehicle in the Config Viewer to see what hiddenSelections are available. (They might not have useful names; if not you can test them in numerical order to see what they cover, or use Advanced Developer Tools to see what their texture looks like.)

manic verge
#

ahh yea i see it now

#

theres only camo 01 and camo 02

#

cant change the cockpit one

#

ahh well thanks for the help lol

hallow mortar
#

BTW, I'd recommend using PAA files for object textures rather than JPEGs. JPEGs have some rendering problems at longer ranges. Arma 3 Tools contains a converter.

manic verge
#

loading them from the mission file just to learn texturing

pallid palm
#

hello all: why is it sometimes when p1 as in, ( i'm the player named p1) and i add 9 more soldiers, p2 p3 p4 and so on, why do i end up being p10 or the last playable unit in the group at the start of the mission, this is just nuty to me,

kind wind
stable dune
pallid palm
#

yes i checked the box player only on me

#

i seem to have to group each playable unit to me one at a time, and then hit save mission, each time

#

to get it the way i want , its just nutty

#

but if thats what i must do then so be it lol

#

yes i make each playable soldier one at a time and i make sure every thing is ok then i group them to the leader me witch is named p1 and when i start the mission sometimes im p10 it just nutty

thin fox
#

hey... I noticed that too

pallid palm
#

good so im not going nuts

thin fox
#

even tho I'm the leader, I'm like the last in the group

pallid palm
#

so what i did to fix this is: i seem to have to group each playable unit to me one at a time, and then hit save mission, each time
to get it the way i want

#

what do we have to make p10 first and then p9 and so on to end up being p1 lol

#

like backwards lol

proven charm
#

works here

#

maybe i did something different

#

u guys on stable?

hallow mortar
#

Unit ordering in the slotting screen is based on order of creation, not group hierarchy

pallid palm
#

yeah thats the way i was doing it

hallow mortar
#

Can we have a more exact description of what you're doing? Like in detail.

pallid palm
#

yes ok so i would make a playable unit and i would make it the player

#

then i would make each playable unit after that

#

and the i would group each playable unit to the leader and each playable unit would be ranked in order

hallow mortar
#

What do you mean by "ranked in order"? Like Sgt, Cpl, Pvt?

pallid palm
#

like the leader would be the highest rank

hallow mortar
#

Okay, and then what do you do next?

pallid palm
#

then i would make each playable unit after that
and the i would group each playable unit to the leader and each playable unit would be ranked in order

#

from highest to lowest rank

hallow mortar
#

...yes, and after that?

pallid palm
#

then i would save the mission and start it and i would end up being p10 insted of p1

hallow mortar
#
  • How are you defining who is "p1" and "p10"?
  • How are you starting the mission?
pallid palm
#

in the ummm name of the unit

#

i just hit play in the editer to test it

hallow mortar
pallid palm
#

variable name

hallow mortar
pallid palm
#

SP and MP both

hallow mortar
#

When you select a unit to play in MP, you can see the role description of the unit you're selecting. Is this different from the unit you end up being put into?

pallid palm
#

yes sir

#

i can see p1 at the top then i chose that 1 and some how i end up being p10

#

but it only happends sometimes

#

so what i did to fix this is: i seem to have to group each playable unit to me one at a time, and then hit save mission, each time

hallow mortar
#

Science: I created an empty VR mission containing a Squad Leader (playable, player) and 9 Riflemen (playable), named from unit_p1 (Squad Leader) to unit_p10.I created them all at once, auto-grouped to the Squad Leader by proximity, and then saved the mission. I started the mission several times, in SP and MP, including saving and reloading the mission between attempts. Every time, I selected the Squad Leader, and was deployed as the Squad Leader on mission start.
Anecdote: I have never seen this happen in 7500 hours.

proven charm
#

corrupted mission .sqm?

pallid palm
#

everything seem to work perfectly sep for that

fluid fog
#

So I'm scripting some ai movement, or atleast trying to. Where do i put my .sqf files in my mission file? (I'm new)

hallow mortar
pallid palm
#

copy that @hallow mortar ahh by proximity hmmm

#

maybe thats whats going on

thin fox
# proven charm u guys on stable?

maybe I'm talking about something different, in my case I'm the last in group ui (sp), even tho I placed the unit first in editor but gonna to double check that

pallid palm
#

yes same here

fair drum
#

If you want to make a mod, the root is the folder with config.cpp for each addon, but it's going to be a lot more involved in packing it.

thin fox
pallid palm
#

its a easy fix but was just woundering

thin fox
#

maybe I reloaded the mission and got working, dunno

pallid palm
#

hmmmmm

fluid fog
pallid palm
#

you dont need the null at the begining of the script call

#

just do [] execVM " ";

fluid fog
#

ahhh

pallid palm
#

no = eather

fluid fog
#

thank you, i'll test that

pallid palm
#

just do [] execVM " triggerZone1.sqf";

thin fox
hallow mortar
cobalt path
#

On shit sorry

#

deleted

fluid fog
pallid palm
#

cool

#

adding the directory for the folder. is what did it, the null part was no big deal

#

that null = stuff i learned from NikkoJT that was from way back in the game left over from old stuff

fluid fog
pallid palm
#

omg don't use ChatGPT omg

fluid fog
#

lol, why not

pallid palm
#

cuz my ChatGPT is the guys in discord

#

ChatGPT is stupid

fluid fog
#

making simple scripts has never been easier, and you still need to understand the code, to see if your variable names line up

#

it's getting better

pallid palm
#

yeah but yu'll have more headakes , then if you just ask the guys in discord

#

like i said cuz my ChatGPT is the guys in discord

fluid fog
#

Discord is still very useful, chatgpt is kinda just like looking at a wiki page of whatever your prompt is, and I find it easier to understand at times

pallid palm
#

ok well i hope you enjoy headakes lol

fluid fog
#

That's my life, don't worry

pallid palm
#

ok np m8

#

i was not trying to be mean was just warning you

fluid fog
#

going into a test of my scenario, hopefully I fixed my code correctly (no chat gpt this time)

fair drum
#

Chatgpt is poor for a very small language like sqf with a small sample size. And that small sample size is 90% garbage.

fluid fog
#

well shit, didn't work

pallid palm
#

what was the erra

fluid fog
#

trigger was activated by group type apparently, not sure what happened

#

not by the conditions

#

okay maybe lets look at things more in depth.

does this snipbit of code make sense?

_eG1 move (getPos _heli1);

#

i'm trying to move a squad to a heli in the sqf script

pallid palm
#

well it does make sense but what about this

#

_eG1 move (getPos heli1);

#

or this

#

eG1 move (getPos heli1);

fluid fog
#

When is the underscore necessary?

#

Not at all?

pallid palm
#

globale or local variables

#

globale variables eG1

#

local variables _eG1

fluid fog
#

when should I distinguish between the two of them? All of this is in a external .sqf file that is imported into a trigger

#

whats the difference between global and local

pallid palm
#

well like i said your getting some what out of my range help @hallow mortar lol

#

i mostly use globale variables it easyer to me

#

Private and global are different

Global means the variable is in the global scope.
Such as mission variables, variables on an object, etc.
Private is only for local variables,
i.e. variables that start with an underscore
Variables that being with an underscore are local variables,
meaning they are only defined in that scope
someVar = 1; global variable
_someVar = 1; local variable
All local variables have to start with an underscore

fluid fog
#

interesting, so you use global if you want something to be shared between functions, and local for a safer way of running within the function. Both at the end of the day in my application of the scripts would function pretty similarly

pallid palm
#

like i said help @hallow mortar lol

#

im not that good m8 we need good guys to help you

fluid fog
pallid palm
#

see im still a noobe when it comes to scripting

fair drum
#

esAlpha is already a group

hallow mortar
pallid palm
#

lol thx man shooo

fluid fog
#

So that variable should refer to the squad leader and not the squad it self

fair drum
#

The error tells you that esAlpha is a group. The group command is for getting a group reference such as a group of a unit. You already have that reference in esAlpha (which you can use directly if you want)

pallid palm
#

see why my ChatGPT is the guys in Discord woohoo

pallid palm
#

thx for saving me guys the water was getting to deep for me lol

fluid fog
#

Simply just remove the group Infront of the name

fair drum
#

For that particular error, yes

#

For _eG1

fluid fog
#

that would be the case for the other 2 for sure

#

thank you

fair drum
#

_fG1 is fine as is

#

_fG2 depends on what crew1 is

fluid fog
#

no they would be the same that unit1 is referring to the group not the leader

fair drum
#

Is crew1 a group? An array of units? An accidental single unit?

fluid fog
#

a group of 2, with a leader

#

driver, and gunner

fair drum
#

Then yes, you would remove the group command since you already reference the group in crew1

smoky peak
#

@little raptor Thank you for posting this so many years ago. It has greatly helped me trying to solve a mission issue currently. However, I'm trying use the addEventHandler ["Take"..."Supply" option instead the addAction command, basically forcing the player to either reload or move the mag around in the inventory (simulating clearing the malfunction). I've tried removing the actionID variable and some other things and it's clear I'm not a coder. Any chance you can assist? I'm getting lost in the tree of command lines assisgned to the function, I think.

fair drum
#

Look into how ace does their jam system. Or just use ace.

smoky peak
#

The intent is not to use ace, just to use the script for a one-off need.

digital hollow
#

If you want to keep it simple, just straight up remove the loaded mag and add it back to the inventory. Then they have to reload.

smoky peak
#

That's an idea. Although simple for you and simple for me may be relative. ๐Ÿ™‚ Leopard's script works great as is, so at the end of the day, I can still roll with it, but figured I'd ask for help in adjusting it. If that doesn't happen, that's okay and I'm thankful for what he's offered.

pallid palm
#

sep i did not add it back to inventory

#

its gone i removed it ๐Ÿ™‚

#

plus i added this to my player reload script ```sqf
if (needReload _player == 1) then { reload _player };

#

but you may need to change this so all players don't reload

spiral narwhal
#

How can i check if an object exists in a mission?

#

i have var name for an object, and if that object doesn't exist in the mission, i want my script to throw an error message

spiral narwhal
#

maybe vehicle varname could work?

stable dune
#

If you create in editor with var name object, that is broadcasted globally, and you want check in where is that object exist on mission?
You want use it in some condition if var x exist then, or some other situation?

spiral narwhal
spiral narwhal
#

seems like isNil worked somehow as the way i intended

#

thanks for the help duckheart

coarse sedge
#

hey guys, I'm pretty new to scripting in A3 and would like to have a helicopter teleport elsewhere on spawn, so that when it is destroyed, it will spawn at its "original" spawnpoint, e.g. the base. I've got this in my init.sqf,

waitUntil { !isNull heavy_gunship };
sleep 1;
_position = getPosATL helipad;
heavy_gunship setPosATL [_position select 0, _position select 1, _position select 2];
diag_log "Attemped to move heli";

where heavy_gunship is the actual helicopter and helipad is the actual helipad I would like it to move to. My script seems to run fine, get no errors in the mission, but the helicopter remains. (am testing by hosting in multiplayer) - would anyone be able to assist here? Am I somehow not understanding how setPosATL is meant to be used? Or maybe this should go in a separate file or in the helicopters own init section?

#

as an update - maybe this is an issue with global/remote/local issues? I've got it down as to literally hard-coding in a timer trigger, which does nothing with the activation line: heavy_gunship setPos [19962.613, 9723.102, 6];

however, when I hit Esc and run the same exact command as above, it works perfectly fine. I don't understand this at all

thin fox
coarse sedge
#

do I need to use a RemoteExec somewhere?

thin fox
#

using module?

coarse sedge
#

aircraft retrieved by the players or destroyed, essentially yes

#

so once they "find it" they have it for the remainder of the mission even after destruction

#

so with the module for vehicle respawns I'm using, I technically need the helicopter to at least exist in the actual spawnpoint for a bit prior to then moving it over

thin fox
#

ah okay, so the players find the helicopter, then if it's destroyed, it spawns back in the base

coarse sedge
#

yessir

#

however, the trigger that I've setup just does nothing in multiplayer for some reason, but works perfectly in SP

thin fox
thin fox
coarse sedge
coarse sedge
thin fox
coarse sedge
#

I mean would my trigger setup work though?

#

that's with the hardcoded code that works for sure

#

now it doesn't seem to work in SP either, this is very inconsistent

thin fox
coarse sedge
#

I thought the this code in condition is always true?

thin fox
#

what is the condition that you want to activate it?

coarse sedge
#

nothing - I just want it to be a timer

thin fox
coarse sedge
#

so that I can teleport the helicopter after 5 seconds

thin fox
coarse sedge
#

to start the timer? So should I switch to timeout?

thin fox
#

put in the condition field: !alive heavy_gunship

#

destroy it and see it

coarse sedge
#

but I don't want to destroy it - I don't understand

thin fox
thin fox
coarse sedge
#

then I don't understand, why doesn't just putting true; into the condition also satisfy the activation requirement?

hallow mortar
#

If the condition code contains true and nothing else, the trigger will activate as soon as it starts evaluating.
this is not true.
In a trigger condition, this contains the result of the trigger's basic activation conditions (as configured in its Editor attributes or with setTriggerActivation), which can be true or false depending on whether those conditions are satisfied.
For example, if the trigger is set to BLUFOR PRESENT, this contains true when a BLUFOR unit is in the trigger area, and false when no BLUFOR units are in the trigger area.
It's provided in the Condition code so you can combine it with other scripted conditions.

#

Your "barebones" trigger has no activation conditions set, so this will never contain true.

coarse sedge
thin fox
coarse sedge
#

though I still don't know why my init.sqf wasn't working properly

#

but that can wait for another day

thin fox
tough abyss
#

Tried attaching this static weaponn to a glass decal with [this, glass1] call BIS_fnc_attachToRelative; , but it keeps janking out like this being unable to fire. Anyone know a solution?

ivory lake
#

attachTo makes the attached use the simulation/updaterate of its parent

#

so attaching a proper vehicle (or static in this case) to a decal causes issues like this

tough abyss
#

ah makes sense, drove me nuts every time I would use attachTo to an object in a trench composition and it would cause this. I'll find a workaround.

arctic bridge
#

I've been working on a custom module but I'm really struggling to get it working, does anyone know where I can find some documentation for it? (other than the wiki)

cosmic lichen
#

What's wrong with the wiki?

#

It has all you need.

warm hedge
#

You can also tell what's unclear

arctic bridge
#

Fair enough, serves me right for not elaborating lol.
I've been trying to basically make a trigger in the form of a module that checks if a player is in a given area. (I figured it'd be better to use the module as the trigger rather than a middleman that spawns one)
This is what I cobbled together (I know it's rough lol)

#

The problem is the _isActivated seems to only apply once when initialized, then the module just deletes itself? (I have set it to isDisposable = 0; in the config)

#

I've tried using the registeredToWorld3DEN case and I've tried both is3DEN = 1 and 0. There's something I'm not getting

warm hedge
#

https://community.bistudio.com/wiki/while

In non-scheduled environment, while do loop is limited to 10,000 iterations, after which it exits even if condition is still true.
No it is not deleted, it is just reached the limitation

#

while {_isActivated} do in that context will not end

quick kettle
# tough abyss Tried attaching this static weaponn to a glass decal with `[this, glass1] call B...

Workaround for bad simulation when using attachTo on static objects. For example: a turret attached directly to a static building inherits its simulation and appears to lag.

So instead make an invisible logic under the turret and attach the turret to the invisible logic.

Turret init:

private _logicCenter = createCenter sideLogic;   
private _logicGroup = createGroup _logicCenter;   
private _logic = _logicGroup createUnit ["Logic", (getPosATL this), [], 0, "NONE"];      
[this, _logic] call BIS_fnc_attachToRelative; 

this enableWeaponDisassembly false;   
 
this addEventHandler ['Deleted', { 
  params ['_logic'];  
  deleteVehicle _logic;    
}];
sturdy sage
# arctic bridge Fair enough, serves me right for not elaborating lol. I've been trying to basica...

If you don't need your module to run in 3den you can do:

private _logic = param [0,objNull,[objNull]];
private _activated = param [2,true,[true]];
if !(_activated) exitWith {false};
...

Then you don't need to deal with the modes and all that.

Its how i start most of my module functions. Only works if is3den = 0; is in the module config.

And i am pretty sure **activated **is just a value passed into the function. It never changes. So you can't loop over it expecting it to change.
The module function is just called again if a trigger activates it (that time with activated true).

sturdy sage
# arctic bridge Fair enough, serves me right for not elaborating lol. I've been trying to basica...

If you need repeating logic, which you can stop: While loop (or CBA PFH preferably) -> write condition in a code field in the module and use that. And stop the loop when module is deleted. Either with delete eventhandler if you use a PFH or just checking alive _logic in the while loop.

A synced trigger can then control when the module starts its loop. You have a condition checked on each iteration which is defined in the module. And you can stop the whole thing by deleting the module ๐Ÿ™‚

hallow mortar
#

* the hard limit is 288 per side, so this is not likely to be an immediate issue, just something to keep in mind

sturdy sage
#

I never had a need to try it. But you could probably just group your logics into one group?

#

Also logics have their own side "sideLogic". So this is only really a concern if you create a ton of them.

hallow mortar
hallow mortar
#

Logic entities are also used by other systems, like Editor and Zeus modules, as well as some BI functions, so you do need to leave space beyond what's being used for this specific purpose

still forum
#

I would rather it behave like you would expect from SQF :harold:
Its easy to workaround by assigning it in constructor

arctic bridge
arctic bridge
delicate tangle
#

Is there a way to stop static weapons from tipping over without disabling simulation?

unreal lark
#

I wonder if it would be possible if to run a HTML5 version of mumble be compatible with the steam browser and be compatible with ACRE at the same time? So you could kinda run mumble in the stream browser as background and have that as a PTT client instead of teamspeak?

hushed turtle
#

It might worth pointing out on wiki through. It's not easy to see, that creating objects from same array(with nested arrays) results in objects having same empty array references.

granite sky
haughty linden
#

How do I reduce the AI's ability to detect threats for a stealth mission? I don't want to be in captive mode. The AI โ€‹โ€‹always detects me, no matter what precautions I take... it's impossible to remain undetected. Please help me.

#

It doesn't matter if I use silenced weapons in the rain or in the dark. Their threat detection capabilities are still beyond normal.

granite sky
#

have you tried not using weapons

#

What's your actual requirement?

haughty linden
#

I did everything

granite sky
#

Like the detection is pretty sensible at ~0.5 skill IME

west grove
#

out of curiosity, is it possible to detect a magazine that is supposed to be reloaded into a weapon right now, and then swap it out with a different magazine? like a replacer?

#

i'm kinda annoyed that some special magazines like round mags have a custom animation in config, which ofc only works with certain weapons

#

so my first thought was.. to write a script that swaps the magazine with a different one with a different defined animation ๐Ÿ˜„

#

but i think it would be stupid to track magazines at all times when picking up, dropping, starting a mission, etc..

granite sky
#

Ask the SPE people, they do that shit and it fucks us up.

west grove
#

in what way?

granite sky
#

Oh, garbage fake magazines to deal with in the arsenal.

west grove
#

hm. ok, but what i am thinking about is effectively the same magazine - in itself it would still be usable

haughty linden
haughty linden
granite sky
#

So give an example of what AI response you want from what action.

granite sky
#

You can always do disableAI "CHECKVISIBLE" and manage all the checks yourself. Might be appropriate in some cases.

haughty linden
#

To enter a building where the hostage is, I must shoot the one at the door, but the enemies on the 2nd floor always notice and start killing the hostages.

haughty linden
granite sky
#

Yeah they'll hear that. I think CHECKVISIBLE still works but haven't tested.

granite sky
#

Also I think if you kill a unit in a group (even in one shot, miles away) they automatically gain some knowledge.

#

You can use the knowsAboutChanged group event handler to see how that works.

thin fox
#

I think he should try disable FSM also, makes AI dumber and slower

haughty linden
haughty linden
thin fox
#

yea test both of them and check the results

haughty linden
granite sky
#

There is also forgetTarget. And disableAI "AUTOCOMBAT".

haughty linden
leaden needle
#

Once again I come crawling here for help after my lackluster understanding of SQF Syntax and the Real Virtuality Engine fail me.

I am trying to implement BIS_fnc_holdActionAdd in a multiplayer scenario.
I have the attached code in my init.sqf. It (including its comments so I can actually know what I am looking at) is copied from the Wiki and only slightly modified to fit my needs.

When the mission is started, no interaction prompt with the object is visible. Can someone tell me why this is?

hallow mortar
#

If you're running it in init.sqf, you don't need to remoteExec it.
remoteExec is used to instruct other machines to execute the function, so you'd use it in code that's only running on one machine. init.sqf is executed by every machine when they start the mission, so by adding remoteExec in, you're making every machine instruct every other machine to add the action.
That's not why the action isn't appearing - it would cause the opposite effect, multiple actions on each machine - but it is an issue.

leaden needle
#

thank you, i will try a different implementation and see if it magically fixes anything

hallow mortar
#

What is pizza1? Specifically, is it a Simple Object or does it have simulation disabled, and how is it created?

leaden needle
#

it is a user texture displaying a pizza, i should probably have tried to see if that is an issue already.

hallow mortar
#

Probably worth testing with a different object, user texture might not have the right kind of geometry to be "looked at"

#

If that is the issue, a neat trick you can do is use an Invisible Wall object as a proxy

leaden needle
#

i may have done that before actually

#

I always forget how I did anything between making two missions and try to piece it together from my old scripts with variable success

hallow mortar
#

You can deleteVehicle objects to remove them entirely btw, which you may find more convenient than using hideObjectGlobal, since hideObjectGlobal must be executed on the server

leaden needle
#

I got it to work but the pizza exploded when damaged for some godforsaken reason

cinder zenith
#

Hello, I'm trying to edit a mission with some dialogues and voiceovers. Everything works allright when playing on singleplayer but when I test it on my server dialogues repeat tons of times, they get delayed, actions that are supposed to happen at a certain time don't happen at all or are way way way delayed etc... I guess it has to do with the functions used on the scripts because they're not compatible with multiplayer but I don't really know what I have to change. If someone can help me I could share the .sqf files

thin fox
cinder zenith
#

this the intro.sqf for example

#
Cuttext ["", "BLACK FADED", 999];
[0,0,false] spawn BIS_fnc_cinemaBorder;
0 fadesound 0; 


//HideAll - units
{_x enableSimulation False;_x hideObjectGlobal true;} forEach (getMissionLayerEntities "Layer_AA_Units" select 0);
{_x enableSimulation False;_x hideObjectGlobal true;} forEach (getMissionLayerEntities "Layer_CargoBase_Units" select 0);
{_x enableSimulation False;_x hideObjectGlobal true;} forEach (getMissionLayerEntities "Layer_Fieldbase_Units" select 0);
{_x enableSimulation False;_x hideObjectGlobal true;} forEach (getMissionLayerEntities "Layer_HQ_Units" select 0);

Sleep 1;
Playmusic "SG_Intro_Music"; 
["<t font='PuristaBold' color='#f7f9fa' size='1'>El equipo ruso SSO estรก en el terreno para recuperar los mรณdulos de vigilancia perdidos<</t>",-1,-1,4,1,0,789] spawn BIS_fnc_dynamicText;

sleep 6; 
5 fadesound 1;
Cuttext ["", "BLACK IN", 8]; 

[["01 - Marzo - 20XX", 4, 3], ["Cerca de Oteren, Fiordos - Noruega", 4, 3], ["223.ยบ Destacamento de Propรณsito Especial, Indicativo 'Sputnik'", 4, 3] ] spawn BIS_fnc_EXP_camp_SITREP;

Sleep 8;
["Kasatka", "Sputnik, tienes luz verde para ir. Cambio."] spawn BIS_fnc_showSubtitle;
["KasatkaTopicChat", "MissionConversation", ["Kasatka_Start_1", "Kasatka_Start_1"], "SIDE", nil, nil, 1, true] spawn BIS_fnc_kbTell;

Sleep 0.25;
["Sputnik", "Recibido, comandante. Por favor, repita sus รณrdenes. Cambio."] spawn BIS_fnc_showSubtitle;
["SputnikTopicChat", "MissionConversation", ["Sputnik_Start_1", "Sputnik_Start_1"], "SIDE", nil, nil, 1, true] spawn BIS_fnc_kbTell;

Sleep 0.25;
["Kasatka", "Dirรญgete a su torre de comunicaciones y apรกgala para retrasar la respuesta de cualquier unidad fuera de esta regiรณn. Seguimos investigando dรณnde estรก exactamente nuestra carga prioritaria. Corto."] spawn BIS_fnc_showSubtitle;
["KasatkaTopicChat", "MissionConversation", ["Kasatka_Start_2", "Kasatka_Start_2"], "SIDE", nil, nil, 1, true] spawn BIS_fnc_kbTell;
#
Sleep 2;
[1,1,false] spawn BIS_fnc_cinemaBorder;
{_x setunitpos "Auto"; _x EnableAI "Move"} foreach units CB_G_Player;

MissionStart_Con = true; //Flag for scenario start
#

If I managed to fix just the intro dialogues then I could fix every other dialogue that happens throughout the mission because the logic is the same

#

And well, this is the init.sqf but I believe this one has to be alright

//Start
execVM "scripts\CB_Intro.sqf";

//Environment set up
"colorCorrections" ppEffectEnable true; 
"colorCorrections" ppEffectAdjust [0.9, 0.9, 0, [0.05, 0.05, 0.1, -0.05], [0.6, 0.7, 0.9, 0.6], [0.5, 0.6, 0.9, 0]]; 
"colorCorrections" ppEffectCommit 0; 
smoky peak
tough abyss
#

Anyone have any insight as to why uisleep 0.1; is throwing the following error?

#
 5:58:09 Suspending not allowed in this context
 5:58:09 Error in expression <xtDB2: uisleep [4]: %1", diag_tickTime];uisleep 0.1;} else {_v77yl = false;};};}>
 5:58:09   Error position: <uisleep 0.1;} else {_v77yl = false;};};}>
 5:58:09   Error Generic error in expression
 5:58:09 File mpmissions\dominateStratis_50v50.Stratis\uk97z89ylo\z4urzj7cwc\fn_jurqmhmkr5.sqf, line 22```
cinder zenith
#

@thin fox you got any idea of what's happening?

tough abyss
#
    _nyi1g = "extDB2" callExtension format["4:%1", _bpc19];

    if (_nyi1g isEqualTo "[5]") then {
        _nyi1g = "";
    
        while {true} do {
            _oqpen = "extDB2" callExtension format["5:%1", _bpc19];
            
            if (_oqpen isEqualTo "") exitWith {_v77yl = false};
            
            _nyi1g = _nyi1g + _oqpen;
        };
    } else {
        if (_nyi1g isEqualTo "[3]") then {
            diag_log format ["extDB2: uisleep [4]: %1", diag_tickTime];
            uisleep 0.1;
        } else {
            _v77yl = false;
        };
    };
};```
midnight sand
#

something is wrong in the script on line 22

tough abyss
#

Well it is saying "Suspending not allowed in this context" with the position right before a sleep. So it must be the uisleep command

#

the bottom most uisleep

midnight sand
#

idk

#

i just got into scripting a little while ago, not vary good at it

#

not good at all to be honest

fluid fog
#

variables are setup else where

#

and it's missing a get in function, but other than that it works great

stable dune
#

Use

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
stable dune
#

Easier read when you use code block

fluid fog
#
// === Helicopter Movement ===
// =============================================================
// === STEP 1: Order enemy squad to board heli1 ===
_eG1 move (getPos _heli1);

// === STEP 3: Wait until all units are inside the heli1 ===
waitUntil {
    ({_x in _heli1} count units _eG1) == ({alive _x} count units _eG1)
};

// === STEP 4: Prepare FRIES and fly to drop zone ===
[_heli1] call ace_fastroping_fnc_prepareFRIES;
_heli1 move _dropZone;
systemChat "HQ: Be advised, bad sever rain storm and Enemy MI8 are inbound to your position.";

// === STEP 5: Wait until heli1 reaches drop zone (within 50m) ===
waitUntil {
    (_heli1 distance _dropZone) < 20
};

// === STEP 6: Deploy ropes and rappel troops ===
[_heli1] call ace_fastroping_fnc_deployFRIES;
sleep 2;
[_heli1, _eG1] call ace_fastroping_fnc_fastRope;

// === STEP 7: Wait until all troops are out of the heli1 ===
waitUntil {
    ({_x in _heli1} count units _eG1) == 0
};

// === STEP 8: Return to base ===
sleep 5;
_heli1 move _returnLZ; ```
#

is that better?

stable dune
#

Yes.

midnight sand
#

btw are you a mission maker?

tough abyss
#

Yes.

fluid fog
cinder zenith
#

Yeah, you can

midnight sand
#

are you intereseted in being in a unit, cause we need a mission maker right now, im the head currently of S-3 Operations but i cant put all of my time into it right now due to exams and school

tough abyss
#

I figured it out. It is because it is being used in a call. Cant sleep.

#

My time is quite filled at this point, sorry.

midnight sand
#

ok

tough abyss
#

Do you have a server?

midnight sand
#

yes, and we are getting a dedicated box soon

tough abyss
#

I can help you with that aspect. Check out our services.

midnight sand
#

we have 2 other people working on the server.

fair drum
#

You have many locality issues in that

tough abyss
#

Yes, but as a provider. Not running the server for you.

midnight sand
#

do you have a website that i can look at?

thin fox
cinder zenith
cinder zenith
#

Okay

tough abyss
#

Sent it in a message, some people wouldn't like me posting that.

still forum
#

@tough abyss you cant sleep in unsheduled environment that the problem if you want to sleep you have to spawn or execVM your script

midnight sand
#

one

thin fox
#

just to get the idea

midnight sand
#

sec i have to move my computer

#

laptop*

tough abyss
#

Figured that out a few minutes ago @still forum but thanks!

#

It was being used in calls

#

So I just took it out

fair drum
tough abyss
arctic bridge
tough abyss
#

Is there a way to make it so anybody (not just engineers) can use toolkits?

still forum
#

If you wanted to test if it can work, just run the live demo in steam overlay.

still forum
unreal lark
#

Yeah. Will do that later.

still forum
#

Sure there is ^^ But its hard to find out i guess

tough abyss
#

Haven't been able to find anything anywhere online on it. I will have to look through the functions viewer to see if I can find something

still forum
#

That was what i just tried... I searched for keyword toolkit but didnt find anything... There has to be a script that decides if player can repair or cant

tough abyss
#

yep

#

Ill let you know if I find anything

still forum
#

Unit has variable engineer = 1; in config

            engineer = 1;
```};
tough abyss
#

So if I put in the init field of all the players: engineer = 1; they probably could use a toolkit?

still forum
#

no

tough abyss
#

Or would I need some more gibberish in there

#

to edit the player config

still forum
#

You cant do that per script that has to be done in config... Which could be done in the description.ext like

class cfgVehicles{
class Man{engineer = 1;};
};

#

i guess atleast

tough abyss
#

ahh, gotcha

#

So I should build a script for it instead or make everyone an engineer? lol

pallid palm
#

hello all: is there a way to change the size of the text on a marker
i want it to be smaller

#

even if i have to script the marker it would be ok too

#

ahhhh dam

#

while there's no explicit setting to adjust marker text size independently, try adjusting the overall interface size in the game's video options

#

yeah im not doing that lol

still forum
#

I guess yes

pallid palm
#

i did not try that but i will now lol

#

thx for helping m8

#

its really no big deal i can live with the way it is

tough abyss
#

Well, mission doesn't require any specific classname for my players, all 100 are rifleman, so won't make a difference.

pallid palm
#

but im going to try anyway

thin fox
#

I'm not sure if parseText will work tho because it returns a structured text not a string ๐Ÿค”

pallid palm
#

yeah i guess i must script the marker to have that work maybe right ?

thin fox
#
_marker setMarkerText (["<t size='2.0'>", "Marker Text","</t>"] joinString "")
pallid palm
#

ahh nice cool man

thin fox
#

try it first, not sure if it will work

pallid palm
#

looks like it will i hope it does

hallow mortar
# thin fox ```sqf _marker setMarkerText (["<t size='2.0'>", "Marker Text","</t>"] joinStrin...

This is exactly the same as just doing _marker setMarkerText "<t size='2.0'>Marker Text</t>" btw. joinString is useful for making a string out of modular components - for example, you could use it to make a function that applies your text formatting tags to any string you feed it, so you don't have to type them as part of the string content every time. But it's not strictly required for making a string. If you already know exactly what you want to put into your string, then you don't need to use it.

pallid palm
#

copy that NikkoJT

thin fox
#

so is there any option to change the marker text size? that not involve draw

hushed turtle
#

I prefer joinString over format honestly

pallid palm
#

i want the text to be 0.5 and to have the text EX Chop

hushed turtle
pallid palm
#

rgr that

hallow mortar
#

It's worth trying the structured text and string-containing-structured-tags methods, just in case they do work.
If not, then I don't think there are any options. I don't remember if marker size also controls the text size; if it does then you could combine a standard size marker with a smaller one that's just the text.

thin fox
pallid palm
#

i'll try but im not that good

thin fox
pallid palm
#

rgr that your right

#

i just want the text to be smaller

still forum
#

you could make your own action and just use something like this

player playMove "ActsPercSnonWnonDnon_carFixing2";
sleep someSeconds;
_vehicle setDamage 0;

pallid palm
#

theres got to be away

hushed turtle
#

Nah don't want to be launching a launcher for 5 minutes just to test this out. And I'm not joking, it does takes that long on Linux ๐Ÿง

hallow mortar
#

Well, you could try any of the ways that have just been suggested. That would be a good start.

pallid palm
#

im going to try my best but like i said im not to good

hallow mortar
#

Good thing PiG13BR provided an exact example then

pallid palm
#

yes sir

#

yeah he always helps me

#

thx btw

#

most times all i need is a example then i can run with it

#

i hope a don't fall he he

hushed turtle
#

PiG13BR's example doesn't parse string using parseText

pallid palm
#

copy that

#

im trying the string thing 1st

hallow mortar
hushed turtle
#

Nah, setMarkerText just supports string according to wiki. So, it most likely won't take Structured Text from parseText

thin fox
hallow mortar
pallid palm
#

thats a roger

#

as a matter of fact my teacher said im the most trying guy in her class lol he he

hallow mortar
#

I'm really impressed by your ability to type in here at the same time as typing the code in the game

pallid palm
#

yes thx, thats the 1st time anyone was impressed by me (sep when i'm on the Golf Corse) ๐Ÿ™‚

#

i go back and forth

#

ahh dam forgot a end of block damit lol

#

fingers crossed

#

oh so close let me try again

#

ahhh man

hushed turtle
#

It does not work. It won't take Structured Text, nor it parses the string in any way. Using "<t size='2.0'>Marker Text</t>" just displays the string like it is, without any parsing.

pallid palm
#

yup yes sir: there must be away i can feel there is

hushed turtle
#
hint parseText "<t size='2.0'>Marker Text</t>";

Displays hint with nice and big font. Just to test it out.

pallid palm
#

i want the small font lol

hushed turtle
#

That's besides the point

pallid palm
#

i think it will work with a scripted marker

hushed turtle
#

It doesn't support formating, it doesn't matter if large or small

#

It took longer to launch a launcher than test this out.

pallid palm
#

lol

#

there must be away to do this i just feel there is

tough abyss
#

Ya, just one more script to write

pallid palm
#

btw hello @hushed turtle

#

nice to see you m8

proven charm
#

i wish you could use getText in configs but this doesnt work ```sqf
class AAAA
{
atest1 = __EVAL(call compile "getText(configfile >> 'cfgVehicles' >> 'B_soldier_AR_F' >> 'displayname')"); // Sets empty string (not working)

atest2 = __EVAL(call compile "isClass(configfile >> 'cfgVehicles' >> 'B_soldier_AR_F' >> 'displayname')"); // Sets "false"
};

pallid palm
#

ah man

#

it seems like it would be a simple thing to do, but what do i know

proven charm
#

simple outside configs

tough abyss
#

Next question I have. I have a script looping on the server to every minute remove all "Killed" event handlers from Independent AI and add one, because I want the killer (player) to be given a reward after they kill an AI.

#

I am using a Headless Client and sometimes it works once at the very beginning, then never again, sometimes it doesnt even work at all

#

Reason why I am looping is because there is a spawn AI module and I want to make sure all AI are accounted for.

#

No errors in the logs, nothing.

#

I am using a regular event handler for "Killed" not the MP ones because I don't want it broadcasted to every client when an AI is killed (over 150 AI)

high plume
#

guys, I need help from someone who works with unpacked pbo data. anyone out there? ๐Ÿ˜ƒ

tough abyss
#

shoot

high plume
#

@tough abyss thanks.

i cant get arma to read unpacked data. i added -filePatching to startup parameters, ran the filePatching script command in a formatted hint, result is always "any", disregarding the startup parameter. if i remove it, result is still "any". so im confused.

tough abyss
#

filePatching is not in the list of scripting commands.

high plume
#

it is according to this SITREP

tough abyss
#

Check your logs on the first line or two and it will tell you if filepatching is launching in the parameters

high plume
#

"Add scripting command filePatching to detect the actual state."

#

yep, filePatching is in the RPT.

tough abyss
#

according to this list, doesn't exist

high plume
#

wtf. y put it in sitrep goddamit. ๐Ÿ˜ฆ

tough abyss
#

Even when testing the value in the debug console, doesn't work

high plume
#

exactly

#

so im really curious why arma does not accept my config changes from the unpacked data.

#

hmm...

raw vapor
#

Is there a way to make units follow a specific move path and still stop to fire, but not take cover or deviate from that path?

I want units to follow a specific path down through a tunnel, I don't want to use unit capture since unit capture is recording player action and I want the units to stop and shoot. What I don't want is for them to pathfind out of the tunnel because their AI is telling them to take cover from getting shot at. I want them to advance into position and stay there.

#

Better still if the AI can fire on the move like players can while walking.

hushed turtle
#

You might need to split them into individual groups

hallow mortar
#

You can use disableAI "COVER" to turn off at least some of that behaviour

raw vapor
royal quartz
#

hi guys, wondering if there is a command to find which target the gunner in a AA vehicle e.g tigris is locking currently?

for players there this command playerTargetLock but I cant see anything for AI that works the same. best ive found is getAttackTarget _unit;

unreal junco
#

I used to make single player story driven missions all the time back in day - I liked to try and follow a similar structure as BIS and the official missions in terms of how theyโ€™re created and scripted etc.

I began to learn how to use FSMs for the mission structure- one thing I donโ€™t fully understand is why isnโ€™t the FSMs used for more of the scripting. Often, the FSMs are used for a small amount of scripts and then just call another script stored in its own SQF.

What is the benefit of doing that as opposed to just having the scripts in the FSMs?

Iโ€™m trying to get back into mission making as Iโ€™ve gone down a rabbit hole of war lore and was researching the newer campaigns structures and community campaigns.

thin fox
#

and filter the returned array using other commands

royal quartz
# thin fox try **getSensorTargets**

mmmh I saw that command, but im not sure what further filtering could be applied.

Ofcourse checking if its enemy etc. But if there is 2 targets close to each other I couldnt find which one was currently being locked by the AA past that. getAttackTarget _unit; this seems to work ok tbh. Just when the AI change targets it takes a few seconds for it to update

arctic bridge
#

Quick question, if I use getVariable to retrieve a variable assigned to a player, is the server contacting that client to retrieve the variable? Or is the variable also stored on the server somehow?

#

I want to avoid repeatedly contacting the client

granite sky
#

getVariable is purely local. So it depends how/where setVariable was used.

hallow mortar
#

If you're doing getVariable on the server, and succeeding, then you're accessing the server's copy of that variable. The variable was broadcast at the time it was set, not the time of retrieval.

granite sky
#

Each machine can potentially have a different value for the same variable on the same object.

arctic bridge
pliant stream
#

the wiki says that lineInterstectsSurfaces includes ground intersections but it doesn't seem to work, anyone have experience with it to share?

high plume
#

@tough abyss fyi - command is called "isFilePatchingEnabled", returns true on my system. still no loading of unpacked data. oh well.

spiral canyon
#

anyone have a good preset for a spark effect? I cant seem to find anything that says "sparks" on the wiki to help point in that direction. If the forums worked, there seems to be alot of things there but of course they cant seem to fix that.

tough abyss
#

oh, ok

warm hedge
#

While I'm away, look for "drop" and "ParticleArray"

pliant stream
#

nvm it's eyeDirection that doesn't work..

#

or do what it implies anyway

tough abyss
#

haha I crack myself up

#

Wrote it like 10 months ago, just opened it up, funny stuff

proven charm
little raptor
#

that's just how configs work. you can use strings instead (and call compile it)

proven charm
#

but i dont understand why isClass works but getText doesnt?

little raptor
#

it doesn't "work" tho

proven charm
#

no?

little raptor
#

if you can make it return true I'll believe you ๐Ÿ˜…

#

false is just the default value

#

e.g:

class AAAA
{
 atest1 = __EVAL(call compile "getText(configfile >> 'cfgVehicles' >> 'B_soldier_AR_F' >> 'displayname')"); // Sets empty string (not working)

 atest2 = __EVAL(call compile "isClass(configfile >> 'cfgVehicles' >> 'B_soldier_AR_F')"); 
};
proven charm
#

aah yeah you are right. that explains it

#

im already using strings there

proven charm
#

leo can you explain on the strings and call compile?

proven charm
#

and ideas how to use getText with those? cause i have tried....

granite sky
#

Oh, might be impossible.

#

What if you don't do the __EVAL?

proven charm
#

ill try

granite sky
#

This documentation doesn't describe when EVAL is actually evaluated :/

proven charm
#

without eval the code just becomes string

granite sky
#

Ah yeah, I guess it'll only execute if you do getNumber.

#

config is silly

#

I don't know the logic here though. If the class is definitely loading after the stuff it's reading then I guess config commands aren't usable until config init is done.

proven charm
#

that could be

tough abyss
#

Why would you do that?

agile pumice
#

can someone help me out with a script? http://pastebin.com/raw/VCdCuGQQ the setDammage 0 for the foreach objects isnt triggering, but I can stick the nested forEach bit in the debug and replace _kart with vehicle player and the objects get repaired like I want

drifting badge
#

hey guys, hope everyone is doing fine! I have run into an issue that I can not seem to solve:

I am trying to keep objects, that have been "attachto", always on ground level, even if a unit moves from flat ground to a slope. On flat ground all is great, but when moving to a slope all that is downslope is "floating" and all that is upslope is "stuck in the ground". I have experimented with sqf _x setVectorUp surfaceNormal getPosASL _x; in a repeating trigger, but it is not really working (am pretty sure I am doing something wrong).

proven charm
#

i guess it wont work because the object is attached

little raptor
#

setVectorUp and dir do work on attached objects

#

but the vectors should be relative to their parents. this simply means that your code will work incorrectly.

#

since it doesn't work at all, the issue here is your repeating trigger

#

idk what you're using and where _x is coming from here

tough abyss
#

pls use setDamage with one m

#

You use _x (if (str _x find ": tyrebarrier" > -1) then {_x setDammage 0};) inside the event handler

#

The _x is probably from the forEach

#

That doesn't work. It's a completely different scope

hallow mortar
#

setVectorUp will rotate the object around its own origin, not around the object it's attached to (although the rotation vector will be relative to the object it's attached to). It will rotate the object in place, not change its position.

Your code (if corrected for being relative) won't move the object to the ground surface, it'll just rotate it to be at the same angle as the ground surface. The object will still float, just at a funny angle.

tough abyss
#

Local variables don't carry over to the event inside the addEventHandler

hallow mortar
#

If you want to change the position of an attached object, the typical method is to attach it again with new relative coordinates.

It is probably possible to calculate new coordinates that match the terrain surface height, but it's going to be a bit of a bastard to figure out how...so I'm not going to.

tough abyss
#

And you can't pass arguments to events either, because this game <blank>

hallow mortar
#

Point of interest, if these attached objects are units, it's worth keeping in mind that standing and crouching units do not actually rotate to match the angle of the surface they're standing on. Regular vehicles do (affected by their suspension as well) but Man units don't. They adjust their leg IK to account for it, but their actual object orientation remains perfectly upright. Prone units might be a bit different but I'm not totally sure.

agile pumice
indigo snow
#

you cant use local functions in a handler

tough abyss
#

Make it a global variable/function?

indigo snow
#

they only exist in the original scope

agile pumice
#

its global now

#

still wont run the foreach

tough abyss
#

Ohh. I mis read the code.

#
        if (str _x find ": net_fence" > -1) then {_x setDammage 0};
    } forEach (nearestObjects [_kart, [], 10]);
#

I don't think this is the correct way of doing this

#

try: if (_x isKindOf "House")

#

or: if (toLower typeOf _x in [<list of class names>])

#

nearestObjects will also not work on map objects iirc

#

They have to be editor placed

agile pumice
#

okay well I got it to work, changed from call to spawn and put a sleep in before the forEach. The code DOES work with map objects

tough abyss
#

ahh

mortal pelican
#

Anybody got a script to detect if an explosion goes off within a trigger, and do something when it does?

agile pumice
#

basically I made the code wait for the object to be destroyed

tough abyss
#

Are you testing this on a server?

agile pumice
#

editor

indigo snow
#

the return of the damage EH sets the damage

tough abyss
#

The reason for this is that the objects are probably damaged after the handleDamage from the vehicle runs

indigo snow
#

you dont setDamage inside the handler

tough abyss
#

He setDamages other objects

#

Ahh, yes. If your kart got damaged, then don't use setDamage on the kart, but return 0 for the handle damage script

#

You could also simply use allowDamage false instead.

agile pumice
#

if I did that, the handledammage could wouldnt fire, would it?

tough abyss
#

It would not.

#

...probably

dire island
#

I am trying to run a piece of code whenever a player changes his weapon. I am using the "WeaponChanged" event handler, but it doesn't fire. the "EH loaded" systemChat below is shown, but when I change weapon, nothing happens.

player addEventHandler [
    "WeaponChanged", { 
        params ["_object", "_oldWeapon", "_newWeapon", "_oldMode", "_newMode", "_oldMuzzle", "_newMuzzle", "_turretIndex"];
        systemChat "EH fired!";
        if ("_newWeapon" == "sfp_ksp58B2") then {systemChat "till ksp!"};
        if ("_oldWeapon" == "sfp_ksp58B2") then {systemChat "frรฅn ksp!"};
}];```
* Am I using the eventHandler wrong?
* Is there some other method that could accomplish the same effect?
agile pumice
#

hmmm, apparantly it still does

proven charm
#

where is the code run?

dire island
#

I am just testing it with execvm on a character's init field. None of the effects I'm after need to be global so I'm thinking I'll initialise it from initPlayerLocal.

proven charm
#

was just thinking that maybe player is null there

stable dune
#

You need use your variables without quotes.
In params those are defined with quotes, but those are used without.

If (_newWeapon ==...
If (_oldWeapon ==...
dire island
stable dune
#

Try add in initPlayerLocal.sqf

thin fox
#

I tested this EH a couple of days ago and it's working fine

drifting badge
#

@little raptor & @hallow mortar - Thank you for your input guys, you are once again very helpful with your experience and insight. I am still testing so I am using a normal trigger that is attached to a leader that the player can control.

In the tigger condition I have ```Sqf
this && round (time %5) ==5


And on activation & deactivation I have:
```sqf
{ 
_x spawn { 
  sleep 1; 
 _x setVectorUp surfaceNormal getPosASL _x;
};  
} forEach units group this;```

My probably very naive reasoning was that this would recalculate the **Z value** for each of the attached units and set them accordingly, but sadly things are not as simple as I hoped.

Is there a way to address/access each individual unit in a group (i.e. like the unit at group position 1, 2, 3, etc.) without giving it a unique name in the Editor? This way one could probably reset the attachement with the corrected z value? (like:  ```sqf
*unit at position 1* attachTo [LEADER, [1, 0, 0]]; ```
Or maybe I am still seeing this a bit oversimplyfied again (am not really a big math genious).
dire island
hallow mortar
# drifting badge <@360154905148653568> & <@137672072821211136> - Thank you for your input guys, y...

forEach units _leader (possibly (units _leader) - [_leader], if the leader is included in the returned array)

Because attachTo uses relative coordinates, not AGL or ATL, 0 Z means the same Z as the parent object - and if you only want to change the Z, you also need to know the child object's current relative position. You'd need to do some vector maths.
See: getRelPos, worldToModelVisual, vectorAdd

drifting badge
#

thanks, that puts me on the right path again, will see what I can cobble together :)

agile pumice
#

I would have used EpeContactStart, but it wasnt triggering for some items I wanted to undo dammage to

tough abyss
#

Tbh, I would just allowDamage false on everything you don't want to get destroyed.

#

Also, "damage" with one m

granite sky
#

vectorWorldToModel to convert a direction to model space.

little raptor
#

at this point you're better off not using attachTo in the first place

#

just use setVelocityTransformation every frame

granite sky
#

setVelocityTransformation every frame does not appear to do anything different to setting pos/vel/dir every frame.

#

Unless you want the interpolation then I wouldn't bother with it.

little raptor
#

also I think if you do setPos dir up separately they generate separate messages?

#

anyway the point is, since he wants to set the position too, attachTo is not helpful anymore (also calling attachTo is relatively slow)

hallow mortar
#

I think the main reason to use attachTo here is that this is a relatively new scripter, and dynamically calculating the correct positions from scratch is a fairly tough problem. Saying "just" use setVelocityTransformation is kind of skimming over a pretty big chunk of understanding that you need in order to do it.

warm hare
#

how to write a script so an engineer can build fortifications similarly ace fortify?

shut flower
#

Is there a possibility to trigger freelook per command?

tough abyss
#

no

shut flower
#

Meh... kk, thanks

tropic nimbus
#

Question for those who may know, what causes units to die underwater without a SCUBA/Rebreather?
And is there any way i can disable that?

rugged coral
# drifting badge hey guys, hope everyone is doing fine! I have run into an issue that I can not s...

I just made a custom buillding feature where you can freely build all kind of objects in game (with persistence and functionalities โค๏ธ ๐Ÿ˜„ )
where I do kinda have a function which checks for stuff like auto level ground or then is the obj in the ground or too far above it (can be set up per part in a cfg).
Since I do also work with attach to when placing stuff, I could maybe help you out there, if you haven't already done it ๐Ÿ˜‰

split ruin
#

how can I make all blue forces to be known?

#

to see them on the map

fleet sand
# split ruin how can I make all blue forces to be known?

IF you are using mods like ACE just enable BTF or blue force tracker in addon settings. If not then you will need to make a script that will get all of the units from side of bluefor and create marker on their position. But to update each marker you will need to have logic that would either update after x amount of seconds those markers or each frame. I wouldnt recommend updateing markers each frame tho.

warm hedge
#

reveal

fleet sand
# warm hedge `reveal`

Dosent that depend also on difficulty setting. If you are playing in Veteran dificulty isnt that just rendundend ?

split ruin
#

I want to use the vanilla map extended content to blue force units, same as ACE blue force tracking, but the problem is the player doesn't know about all friendly units and they do not show all on the map ...

warm hedge
#

units blufor

fleet sand
mystic rose
#

Iโ€™m using the UPS and JEBUS i am trying to get them to work together but it seems impossible i want the units to repspwn with the same load out and have a delay and chance distant but canโ€™t figure it out can someone please help me

mystic rose
#

I remember a while ago that he had all the files combined but i canโ€™t find it any where now

wooden grail
#

Hey guys, I'm having trouble trying to rework this function in 3DEN:

https://community.bistudio.com/wiki/BIS_fnc_ambientAnimCombat

I wanna place this in a BLUFOR's INIT so I'm trying to change the anim-termination condition to be detecting OPFOR but ChatGPT ain't providing anything that does this. Would love ya'lls input if anyone has any ideas

proven charm
#

what is exactly that you are trying to do?

wooden grail
#

Hey @proven charm, I wanna setup a few BLUFOR NPC's in a command tent to do ambient anim SIT_AT_Table perpetually until OPFOR gets within say 5 meters distance in which they will cancel animation and enter combat

#

Normally I used 3DEN enhanced and it's exit-combat ambient anim but when used next to friendly artillery, NPC's tend to exit ambient-anim

#

TLDR is I want an INIT script that forces ambient anim for a BLUFOR NPC that terminates when OPFOR is within 5 meters proximity

mystic rose
#

@proven charm can you help out next

proven charm
#

well you can create condition like this for cancelling the anim```sqf
({ _x distance sittingGuy < 5 } count (units opfor)) > 0

proven charm
mystic rose
#

Got any codes to make jebus and and ups script work together into the init field of the squad leader

proven charm
#

nope sorry

mystic rose
#

Ahh okay thank you

proven charm
#

they either work with each other or they wont...... scripts here probably wont help

#

unless you can like toggle their features on/off

split ruin
#

I have nice info panel when select HC group icon on map, the problem is it stays when I close the map, I searched for even handler to fire when map is closed or group unselected but didn't find anything. This is the script (it is from biki)

addMissionEventHandler ["GroupIconClick", {
    params [
        "_is3D", "_group", "_waypointId",
        "_mouseButton", "_posX", "_posY",
        "_shift", "_control", "_alt"
    ];
    hintSilent parseText format
    [
        "<t align='left' font='EtelkaMonospacePro'><br/><t size='1.2'>General Information:</t><br/>Callsign: %1<br/>Leader: %2<br/>No. of Units: %3<br/>Delete when Empty: %4<br/><br/><t size='1.2'>Group Status:</t><br/>Health: %5<br/>Fleeing: %6<br/>Attack Enabled: %7<br/>Combat Behaviour: %8<br/>Combat Mode: %9<br/>Formation: %10<br/>Speed: %11<br/><br/><t size='1.2'>Waypoints:</t><br/>No. of Waypoints: %12<br/>Current Waypoint: %13<br/>Speed: %14</t>",
        format ["%1 (%2)",groupID _group, if (vehicle leader _group isNotEqualTo leader _group) then {[configFile >> "CfgVehicles" >> typeOf vehicle leader _group] call BIS_fnc_displayName} else {"-"}],
        name leader _group,
        count units _group,
        isGroupDeletedWhenEmpty _group,
        units _group apply {str round ((1 - damage _x)* 100) + " %"},
        fleeing leader _x,
        attackEnabled _group,
        combatBehaviour _group,
        combatMode _group,
        formation _group,
        speedMode _group,
        count waypoints _group,
        waypointType [_group, currentWaypoint _group],
        units _group apply {str round speed _x + " km/h"}
    ];
}];
wooden grail
proven charm
split ruin
#

@proven charm thanks !

proven charm
# wooden grail Hey <@499851213638991873> , how would you combine this with [player, "SIT_AT_TAB...
[] spawn
{
[sittingGuy , "SIT_AT_TABLE", "ASIS"] call BIS_fnc_ambientAnim; // Start the anim

sittingGuy attachTo [thechair, [0, 0, -0.5]]; // Attach to chair
sittingGuy setdir 180;

waituntil { sleep 0.1; ({ _x distance sittingGuy < 5 } count (units opfor)) > 0 }; // Wait enemies near

detach sittingGuy; // Get off the chair

sittingGuy call BIS_fnc_ambientAnim__terminate; // end the anim
};
``` something like that
#

gotta run ๐Ÿ™‚

wooden grail
#

Couldn't get it to work unfortunately @proven charm, thanks for trying though ๐Ÿ™‚

split ruin
#

how to get if the group is infantry, motorized, mechanized?

warm hedge
#

There is no such definition

stable dune
agile pumice
#

there's equal commands for "dammage"

proven charm
proven charm
wooden grail
#

Honestly? I legit don't know what I'm doing so chances are I'm implementing it wrong

#

Any chance you can dumb it down completely for me if you're not busy?

proven charm
#

i added comments. not sure what else i can say ๐Ÿ˜

wooden grail
#

Tried to look into some BIS forums on how to attach an NPC to a chair and can't find anything

proven charm
wooden grail
proven charm
#

to make sit: ```sqf
sittingGuy attachTo [thechair, [0, 0, -0.5]];
sittingGuy setdir 180;

#

oops my bad, updated the code

#

but you cant probably wait in init anyhow

#

updated code again (and again)

wooden grail
#

Hey @proven charm , it sorta works now

vestal parcel
#

might not be the correct channel, however im curious on how id make a faction Redux as ive researched into it but not found anything, i know about the ALIVE faction system, but im interested in if there is a way to have them replace Vanilla unit say in the Campaign

wooden grail
proven charm
# wooden grail Any idea on how I can get the BLUFOR to sit properly haha?
[] spawn 
{ 

[sittingGuy , "SIT_AT_TABLE", "ASIS"] call BIS_fnc_ambientAnim;  

sittingGuy attachTo [thechair, [0, 0, 0]];  
sittingGuy setdir 180;

waituntil { sleep 0.1; ({ _x distance sittingGuy < 5 } count (units opfor)) > 0 };  

detach sittingGuy;
 
sittingGuy call BIS_fnc_ambientAnim__terminate;

};
``` this works for me, had to get rid of the comments (Because init field doesnt like them)
wooden grail
#

Holy Sh*t, it works pretty good thanks!

I had to change the setdir to 0 though

[] spawn
{

[sittingGuy , "SIT_AT_TABLE", "ASIS"] call BIS_fnc_ambientAnim;

sittingGuy attachTo [thechair, [0, 0, 0]];
sittingGuy setdir 0;

waituntil { sleep 0.1; ({ _x distance sittingGuy < 5 } count (units opfor)) > 0 };

detach sittingGuy;

sittingGuy call BIS_fnc_ambientAnim__terminate;

};

One weird thing is the SIT_AT_TABLE anim keeps deleting the NPC's primary weapon. I hate to ask for more help but do you know how I can get BLUFOR to keep his rifle?

proven charm
#

it shouldnt remove his weapon.. maybe it just doesnt show up? ๐Ÿค”

wooden grail
#

Yeah I made sure it keep the anim on ASIS but it keeps removing the rifle

proven charm
#

you know you dont have to place him at the chair in editor, the script does that

wooden grail
#

Yeah force of habit using the 3DEN Enhanced editor haha

#

Also, I plan to use this script excessively cause for my composition builds

#

So thanks again haha, you're amazing

proven charm
#

np

stable dune
#

Are creating to MP,
Your code will be executed for every client and every JIP etc if on MP.
You should add is server check to make it sure it is only called once

proven charm
#

totally forgot that stuff

wooden grail
#

Just to confirm though, if I wanna use this for a non-furniture based anim, I'd write it like this right @proven charm ?

[] spawn
{

[standingGuy , "LEAN_ON_TABLE", "ASIS"] call BIS_fnc_ambientAnim;

waituntil { sleep 0.1; ({ _x distance standingGuy < 5 } count (units opfor)) > 0 };

detach standingGuy;

sittingGuy call BIS_fnc_ambientAnim__terminate;

};

#

Do I keep the detach standingGuy; line?

proven charm
#

if theres no attachTo then it isnt needed

wooden grail
#

Ah gotcha, thanks man

dire island
#

I am running the following script via a vehicle's init field:

    ["_vic", objNull],
    ["_weaponTemplate", ["sfp_ksp58B2","","","ASE_optic_AimpointCS",["sfp_249Rnd_762x51_ksp58", 249],[],[]]]
];
_actionId = [
    _vic,                                                    // Object the action is attached to
    "Plocka lรถs KSP58 frรฅn lavetten",                        // Title of the action
    "\a3\data_f_destroyer\data\UI\IGUI\Cfg\holdactions\holdAction_loadVehicle_ca.paa",    // Idle icon shown on screen
    "\a3\data_f_destroyer\data\UI\IGUI\Cfg\holdactions\holdAction_loadVehicle_ca.paa",    // Progress icon shown on screen
    "_this distance _target < 3",                            // Condition for the action to be shown
    "_caller distance _target < 3",                            // Condition for the action to progress
    {},                                                        // Code executed when action starts
    {},                                                        // Code executed on every progress tick
    {
        params ["_target", "_caller", "_actionId", "_arguments", "_frame", "_maxFrame", "_weaponTemplate"];
        _playerWeapon = getUnitLoadout _caller select 0;
        [_target, _caller, _actionId, _playerWeapon, _weaponTemplate] execVM "scripts\ASE_tgb16\unloadVehicle.sqf";
    },                                                                // Code executed on completion
    {},                                                                // Code executed on interrupted
    [],                                                                // Arguments passed to the scripts as _this select 3
    3,                                                                // Action duration in seconds
    0,                                                                // Priority
    true,                                                            // Remove on completion
    false                                                            // Show in unconscious state
] call BIS_fnc_holdActionAdd;```

``_weaponTemplate`` is, in my mind, pretty obviously defined. However, when I trigger the hold action, I get the error below (line 20 is ``[_target, _caller, _actionId, _playerWeapon, _weaponTemplate] execVM "scripts\ASE_tgb16\unloadVehicle.sqf";``). What am I missing?
stable dune
#
    [],                                                                // Arguments passed to the scripts as _this select 3
params [
    ["_vic", objNull],
    ["_weaponTemplate", ["sfp_ksp58B2","","","ASE_optic_AimpointCS",["sfp_249Rnd_762x51_ksp58", 249],[],[]]]
];
_actionId = [
    _vic,
    "Plocka lรถs KSP58 frรฅn lavetten",                        
    "\a3\data_f_destroyer\data\UI\IGUI\Cfg\holdactions\holdAction_loadVehicle_ca.paa",
    "\a3\data_f_destroyer\data\UI\IGUI\Cfg\holdactions\holdAction_loadVehicle_ca.paa",
    "_this distance _target < 3",                           
    "_caller distance _target < 3",                           
    {},                                                       
    {},                                                       
    {
        params ["_target", "_caller", "_actionId", "_arguments", "_frame", "_maxFrame"];
        _arguments params ["_weaponTemplate"];
        _playerWeapon = getUnitLoadout _caller select 0;
        [_target, _caller, _actionId, _playerWeapon, _weaponTemplate] execVM "scripts\ASE_tgb16\unloadVehicle.sqf";
    },                                                                
    {},                                                                
    [_weaponTemplate],                                                                // Arguments passed to the scripts as _this select 3
    3,                                                                
    0,                                                               
    true,                                                            
    false                                                           
] call BIS_fnc_holdActionAdd;
#

@dire island โ˜๏ธ , you need pass your _weaponTemplate to holdaction.

split ruin
#

I am unsuccessfully trying to make the unit I switch to HC leader ๐Ÿค”

addMissionEventHandler ["TeamSwitch", {
    params ["_previousUnit", "_newUnit"];
    setGroupIconsVisible [true, false];

    _oldleadergrp = group _previousUnit;
    hcLeader _oldleadergrp hcRemoveGroup _oldleadergrp;
    _leadergrp = group _newUnit;
    hcLeader _leadergrp hcRemoveGroup _leadergrp;
    _newUnit hcSetGroup [_leadergrp];
}];
#

result is the new switched unit is HC leader and can give commands to his group but not the previous group (the group of the previous HC leader)

tough abyss
#

Yeah, but they are for backwards comp, because whoever made them in OFP couldn't write proper English.

split ruin
#

removing

_oldleadergrp = group _previousUnit;
hcLeader _oldleadergrp hcRemoveGroup _oldleadergrp;

have the same result, the old HC leader group cannot be commanded ...

dire island
stable dune
split ruin
#

@stable dune yes

agile pumice
#

"proper"

#

depends where in the world you are

#

some would argue commonwealth english is the "proper" english ๐Ÿ˜›

indigo snow
#

None of them would argue dammage is the way damage should be spelled.

#

Its a bit silly to use dammage

#

Doesnt really matter in the end

split ruin
#

I found old (A2) wind ballistics script, can it be changed to work in A3 or is complete trash?

player setVehicleInit "

BWS =
""
_info = _this;
_bullet = (_info select 0) select 6;
if((_info select 0) select 1 == 'Throw') exitWith {};
_wind = wind;
sleep 0.05;
while {alive _bullet} do
{

    _windX = wind select 0;
    _windY = wind select 1;
    _windZ = (wind select 2) + random (2) - random (2);
    _velX = velocity _bullet select 0;
    _velY = velocity _bullet select 1;
    _velZ = velocity _bullet select 2;
    _bullet setVelocity [_velX+(random _windX)/10, _velY + (random _windY)/10, _velZ + (random _windZ)/10];
    sleep 0.01 + random 1;
};
"";

bulletWindSimulation = compile BWS;


player addEventHandler [""Fired"", ""[_this] spawn bulletWindSimulation;""];

hint ""Bullet-Wind Interaction System Initialized..."";

";
processInitCommands;
hallow mortar
#

setVehicleInit and processInitCommands are disabled in Arma 3. This would probably go in init.sqf instead.

Otherwise it should work much the same as it did in A2. But I'm pretty sure it could be substantially optimised.

proven charm
#

because the script is running in scheduled it's affected by lag

granite sky
#

sleep 0.01 + random 1; is a precedence bug. The script would not work as intended.

tough abyss
#

"dammage" is neither AE nor BE

split ruin
#

with this its kinda working but bullets fly alongside wind like feathers

BWS =
"
_info = _this;
_bullet = (_info select 0) select 6;
if((_info select 0) select 1 == 'Throw') exitWith {};
_wind = wind;
sleep 0.05;
while {alive _bullet} do
{

    _windX = wind select 0;
    _windY = wind select 1;
    _windZ = (wind select 2) + random (2) - random (2);
    _velX = velocity _bullet select 0;
    _velY = velocity _bullet select 1;
    _velZ = velocity _bullet select 2;
    _bullet setVelocity [_velX+(random _windX)/10, _velY + (random _windY)/10, _velZ + (random _windZ)/10];
    sleep 0.01 + random 1;
};
";

bulletWindSimulation = compile BWS;


player addEventHandler ["Fired", "[_this] spawn bulletWindSimulation;"];

hint "Bullet-Wind Interaction System Initialized...";

(I set wind at maximum in eden and I am shooting at 90 degree crosswind)

granite sky
#

The velocity adjustment is triggering up to 50x as often as it's supposed to, so that would follow.

split ruin
#

@granite sky making

sleep 0.01;

makes it better but I think wind is influencing bullets too strong ...

granite sky
#

Nah, you want sleep (0.01 + random 1);. But it's a pretty daft method anyway.

#

best rewritten from scratch.

split ruin
#

its working well with windStr = 0.5 but with windStr = 1 is impossible to shoot at 400 m with 5.56 mm ...

cosmic lichen
#

This will fall apart anyway once the scheduler gets filled up and shots will become unpredictable.

#

ah well, it's unpredictable already since it's randomly applied

nova mortar
#

sup guys

#

I need help creating my first mod

#

like how do i even start with my mod?

#

how do i setup the files?

nova mortar
#

thats what i have been searching for

#

like

#

years

#

*2hours

granite sky
#

yeah it's a good article but it's hard to find.

nova mortar
#

yeah

#

oh and btw

#

uhm

#

Can I say Car.gearbox = {-18, 0, 10} in the following script: ```cpp
// ModFolder/Config.cpp
class CfgVehicles
{

class Car;

};```

#

i have no idea what i am doing lol

granite sky
#

No. Would be:

class CfgVehicles
{
  class LandVehicle;
  class Car : LandVehicle {
    gearbox[] = {-18, 0, 10};
  };
};

#arma3_config for config stuff

proven charm
#

isnt that with [] ?

granite sky
#

yeah this is why you should ask in the config channel :P

nova mortar
#

oh ty

nova mortar
#

I'm a bit confused.
I have a script:

// Config.cpp
class CfgPatches {
    class MyTestMod {
        units[] = {};              // Units added by this mod
        weapons[] = {};            // Weapons added by this mod
        requiredAddons[] = {};     // Dependencies on other addons
    };
};

class CfgUserActions {
    class MarlosEnhancedTransmissions_ChangeTransmissionMode {
        displayName = "Change transmission mode";
        tooltip = "Changes the current transmission mode of the vehicle";
        onActivate = "_this call IdkTheFunctionNameSinceImConfused"

    }
}

And want to have another SQF function/script(This is the part that I'm confused about) that gets called using onActivate.
Do I put all the functions I need for my mod into one SQF file, or spread them out? If I spread them out, then how am I gonna call them? Since the website says onActivate = "_this call TAG_fnc_MyHandler";(https://community.bistudio.com/wiki/Arma_3:_Modded_Keybinding#Adding_a_new_key).
Is the file called TAG_function and MyHandler is the function name?

#

this message might be a bit terrible

#

nvm got the great father of vibe coding to help me

nova mortar
hallow mortar
# nova mortar oh thanks this is actually more usefull than chatgpt

I would advise against using ChatGPT in general, but it's especially unhelpful for Arma SQF and config. In order to work somewhat acceptably, LLMs require a large body of (valid) source material to train on. SQF does not have this out in the wild - there's the wiki, and there's whatever code gets posted by random people on the internet, which is completely unreliable and often contextless. Understanding Arma code also requires understanding how the game works, which LLMs can't do.
LLMs are also not suitable for anything based in fact. They do not understand the concept of "fact"; the core principle of an LLM is to generate text that appears plausible, and generating text that is true is at best a secondary concern. They will happily make things up in order to provide a response that looks helpful. They do not actually understand the material they're generating.

spring needle
#

Moreover; if anyone else has noticed the BI forums being broken as heck due to 'overwhelming spam'

A part of me thinks AI trying to be helpful is causing problems with looking at forum posts by clogging BI forums network bandwidth with 'spam'.

So the same functionally useless generative programs are compoundingly eliminating availability of good or partially useful examples. It's a real pain.

fair drum
#

i don't think the forums are broken do to spam, i think its purposefully pulled down until they get something reliable after the attacks on reforger a few months ago

spring needle
#

You might be right - but at least Google's 'AI' cites BI forums as source material still.

Perhaps it's pulling archived webpages, but it looks like the bots have more access than I do to some of these old posts.

#

Also -

when obtaining a 'objectParent' on a player in SP - the return value is the name of the unit (identity i.e. "Private John Doe" the player is attached to.

I am trying to return the actual vehicle the player is piloting, but retutning the parent again on the unit ID is returning ObjNull as if they weren't in a vehicle.

Is this normal?

The actual context is a little more complex but for example if I wanted to refill the vehicle's ammo, I would want to use

(objectParent player) setVehicleAmmo 1;
// this would do nothing because it refers to a unit identity rather than an actual vehicle

(objectParent(objectParent player)) setVehicleAmmo 1;
// also does nothing because this returns a null value

digital hollow
#

check typeOf objectParent player

#

it shoudl return the vehicle type

spring needle
#

well what I want is:

if the player is piloting the A-164 Wipeout, a command pulls the ID of the specific vehicle the player is piloting

_plane = (command to return based on the thing the player is in the pilot seat of)

where

hint str (_plane);

should hint something like "e76048219482" because that's the specific object containing the player as a pilot

#

for example - if I wanted to add an instant takeoff for a player vehicle, the addAction would contain:

_pos = position player;

_pos set [2, (_pos select 2) + 1500];

_plane = cursorTarget;

_plane setPos _pos;

player moveInAny _plane;

#

But if I wanted to automatically teleport the plane into the air when a player gets in, I need to refer to the specific vehicle the player has gotten into.

digital hollow
#

_plane = objectParent player; is perfectly fine for that

#

or if you're using the getIn eventHandler that provides the vehicle directly.

spring needle
#

Huh

tender fossil
# hallow mortar I would advise against using ChatGPT in general, but it's especially unhelpful f...

Agree when it comes to SQF (so far), but I wouldn't call LLMs completely useless anymore. While they're not perfect, they've progressed a lot recently. I used to be a full luddite when it comes to LLMs, but not anymore.

How do we define "understanding" something? We don't even know how consciousness emerges in human body. And is the human way of consciousness the only way to be conscious? What if there are other "dimensions" of consciousness and because they don't remind the human way of being conscious, we don't recognize it? (Couldn't tag you in #offtopic_arma so idk where to possibly continue, or then just drop the topic)

hallow mortar
# tender fossil Agree when it comes to SQF (so far), but I wouldn't call LLMs completely useless...

I'm not going to get into this in too much depth, because it's a) offtopic and b) tedious, but the clue's in the name: it is a Large Language Model - not Large Sapience Model. It works by analysing its training data and determining the probabilities of words appearing together, and then producing something that seems probable. We know how they work, they were written by humans. And even without seeing the code, you can prove it doesn't understand by asking questions that require understanding and watching as it tries to bullshit its way to an answer.

tender fossil
#

Even CS staff up to professors at my uni are testing the LLMs and apparently based on their experience the models have progressed a lot recently, as they're solving complex programming challenges compared to what they were able to do just something like half a year ago. (They verify the results afterwards naturally.) The LLMs can do many other things too as we know. I agree that their success rate is far from 100 %, but it's improving quickly. But yeah, it's getting probably too offtopic so I'll let it be

kind wind
arctic bridge
#

I've been trying to get a script working that figures out the angle between the sun and the player, but I can't get it to work for some reason. I've lost count of all the ways I've tried lol

    _playerDirFor = vectorNormalized(vectorDir player);
    _playerDirUp = vectorNormalized(vectorUp player);    
    _sunDir = eyePos player vectorDiff ((getLighting#2));
    
    _angle = _playerDirFor vectorCos _sunDir;
    //_angle = _lookDirection vectorCrossProduct _sunDir;
    systemChat str _angle;
};
fair drum
arctic bridge
#

Oh, ok I'll keep that in mind, though I was only really using it for testing anyways
The problem is the return is always wrong - that code returns 0.63 when looking directly at the sun

warm hedge
#

getLighting doesn't return the "real" vector of sun IIRC, you might be able to see what I mean with draw a line

arctic bridge
#

Mm, but that shouldn't matter in this context no? The angle should still be the same?

granite sky
#

wiki says getLighting#2 is a direction but you're subtracting eyePos from it for some reason?

#

Yeah I don't know what anyone is trying to do here.

#

It's definitely a direction.

granite sky
arctic bridge
granite sky
#

you would want to be comparing getDir player with getLighting#2 then.

#

well, and player stance versus the Z value, I guess

arctic bridge
#

I've got the horizontal working, now I just need to get the Z working

nova mortar
#

Oh also why not use ChatGPT? It can be very helpfull when you're just stuck or don't know where to start. It saves hours sometimes.

#

And waiting for a response in StackOverflow or Discord takes hours, depending on the topic.

warm hedge
#

ChatGPT code takes hours to debug either. SQF is not something that ChatGPT can handle

nova mortar
#

i got a quick question

fair drum
#

I would advise the best thing you can do, especially with dynamically typed language like this, is to learn how to debug/log well. A lot of the problems that are posted here are issues that could be fixed with proper debugging. Seeing what your problem is is most of the battle when asking for help

nova mortar
#

uhm

#

I have a vehicle

#

and every vehicle has a gearbox array

#

how do i get the gearbox

fair drum
#

this sounds like a #arma3_config issue, but if you are asking how to get the numbers within script of whatever values you put in that config, you would use getArray in that instance.

nova mortar
#

idk but i cant find it on the wiki, but i think im too stupid

nova mortar
#

like a humvee or something

tulip ridge
#

Then pull it from a specific class, but that's kinda odd to do

nova mortar
#

to specify this: I have a variable with a vehicle instance

tulip ridge
#

So just grab the value from that vehicle's config

fair drum
#
private _gearboxArray = getArray (configFile >> "CfgVehicles" >> typeOf _myVehicleInstance >> "gearbox or whatever");
nova mortar
#

yes tysm

tulip ridge
#

getArray (configOf _someVehicle >> "gearbox") (or whatever the property is called)

nova mortar
#

ty guys

tulip ridge
#

Just note that you'll get an empty array if the value isn't defined, so you should add a default

nova mortar
#

around the getarray?

tulip ridge
#

E.g.

private _gearbox = getArray (configOf _someVehicle >> "gearbox");
if (_gearbox isEqualTo []) then {
    _gearbox = [1, 2, 3]; // or whatever works, haven't touched gearbox stuff in like two years
};
nova mortar
#

oh alright

#

and is it possible to overwrite the movement system of vehicles in general?

#

like instead of the automatic transmission from the game make my own?

tulip ridge
#

Doubtful, all of that is engine level which we can't access

nova mortar
#

well shit

#

imma try it anyways

hallow mortar
#

I guess you could use setCruiseControl to require the driver to press a button before they can go faster. The existing gears would still be there as well though, and it wouldn't account for downshifting.

nova mortar
#

hm

#

Any other possible way to get full control?

hallow mortar
#

No, not really

nova mortar
#

Well thats just sad

#

that kinda makes my whole mod obselete

#

Is there a way to disable just all of the vehicle's movement?

fair drum
#

sure, destroy it ๐Ÿ™‚

nova mortar
#

I could build mine above it?

fair drum
#

you want to disable the movement and preserve inertia? or just make it straight stop in a single frame

nova mortar
#

No like the AI part of the vehicle movement.

#

Also, doesn't this engine have just normal physics? If yes, then inertia should be preserved.

#

By default

hallow mortar
nova mortar
#

Well, to be honest, I only want to enable my mod for players

#

Since AI can't shift

hallow mortar
#

Then I don't know what you mean by "the AI part of vehicle movement"

nova mortar
#

The autmatic transmission.

hallow mortar
#

The automatic transmission is not really AI.

You could modify every vehicle in the game to only have one long gear, I suppose. This would require a massive config patch with a specific entry for almost every vehicle you want it to affect.

nova mortar
#

I know that it's not AI. I don't know what I was thinking saying AI

#

well i guess my mod is scrapped then

#

and have to live with that shit transmission that cant even get up a hill ๐Ÿ˜ญ

hallow mortar
#

Some things are just not really possible in this game, and we don't have direct access to the engine to modify it.

nova mortar
#

that sucks