#arma3_scripting

1 messages · Page 158 of 1

tough abyss
#

yup check

sharp grotto
#

did you create a initplayerlocal.sqf ?

tough abyss
#

yesir

proven charm
#

could the file you have be init.sqf.sqf ?

tough abyss
#

thats a damn good guess

#

one sec

#

nah looks good

sharp grotto
#
waitUntil{player == player};
uisleep 5;
hint "Test";
systemChat "Test";
diag_log "DEBUGGY: Test Call";

Maybe also check if the client rpt shows something.
Works for me, did it for years like that.

tough abyss
little raptor
#

Probably another OneDrive mess

tough abyss
#

bro

#

i bet you thats it

#

can I change the export file?

#

or like where it saves?

little raptor
#

Well you can put it somewhere else and put a symlink to it in the missions folder but not sure if that'll help

#

I always disable OneDrive when I install windows 😅

tough abyss
#

yo

#

i put it in the mission fold and wow

#

I hate onedrive

cosmic lichen
#

Never had issues with ondrive and all my mod stuff is on it

tough abyss
#

ya but thats why cuz all of it is on it

#

I try not to use it, and it got saved there

#

you guys are big brains thank you

tough abyss
#

Also, I clicked on something and move objective move on a grib how do I undo this?

supple hollow
#

Any idea why when signed in as admin on a dedi im not able to change the ACE settings?

fair drum
#

what ya mean you can't? like the menu is gray'd out?

open hollow
#

hello, im inicializing 2 functions one for serverside and one for player, both have the tag postinit =1
how i made that the local one waits until the server one is executed?

ive tryed to use waituntil, but for some reason it dont work

#

i have variables there i need to wait

#

ive tryed to use waituntil to one of that variables, but no luck

#

i dont want to use initplayerlocal.sqf / initserver.sqf

tough abyss
#

any reason this isnt working ```// init.sqf or debug console

_spawnPosition = getMarkerPos "EnemyBase";
_unit = createAgent ["O_Soldier_F", _spawnPosition, [], 0, "NONE"];

if (isNull _unit) then {
hint "Failed to create enemy unit!";
} else {
hint "Enemy unit spawned.";
};

#

these docs are awful, I am trying to make enemies spawn but in waves and increase pre wave, didnt it was going to be hard until I start on this train wreck on code.

#

so my hints arent even working? init.sqf waitUntil{player == player}; uisleep 5; hint "Test hint"; systemChat "Test systemChat"; diag_log "DEBUGGY: Test Call";

tough abyss
#

i don't.

#

well where would it be actually?

meager granite
#

%localappdata%\Arma 3\

#

.RPT file with latest timestamp

tough abyss
#

oh I dont see an .RPT fgile in the folder

#

only init.sqf and mission.sqm

meager granite
#

Press Windows+R, paste that and press Enter

#

You'll open logs directory

tough abyss
#

im also in the arma3 fiolder I dont see any .rpt

meager granite
#

You probably have extensions hidden or something

tough abyss
#

ah let me check

meager granite
#

Arma3_x64_2024-09-20_09-22-39 Typical log file name

#

Open one with latest date and search for DEBUGGY

tough abyss
#

oka i found it

#

dmn big ass file

#

okay found it

#

so copy and paste a few lines or what?

meager granite
#

Means your init.sqf is working fine

tough abyss
#

but i dont see a hint?

#

weird

meager granite
#

It probably fires during loading or non-playable state of the game

#

init.sqf executes fairly early

tough abyss
#

well i have waitUntil{player == player}; uisleep 5; hint "Test hint"; systemChat "Test systemChat"; diag_log "DEBUGGY: Test Call";

#

so it should wait ya?

meager granite
#

uiSleep sleeps during app operation, not gameplay so it can easily sleep through these 5 seconds while you're pressing menu buttons and loading

#

I think changing it to sleep should be fine?

#

The better threshold would be getClientStateNumber

tough abyss
#

Oh I just started this jornuy so you quick go over my head

meager granite
#
waitUntil {getClientStateNumber >= 10};
waitUntil {!isNull findDisplay 46};
```Try these waits instead of sleep
tough abyss
#

ah okay ill give it a try

meager granite
#

getClientStateNumber waits until you start the mission (briefing read, you press "continue")

tough abyss
#

ty for all the help so far

meager granite
#

Display 46 is mission display which gets loaded sometime during loading, I think you need it to display hints

#

10 years later and initial loading still confuses me too

#

12 even meowsweats

tough abyss
#

y a man this is like 30 times hard then teaching myself python

#

like its like wild...

#

so now i am getting this error? Ugh, okay man, thanks for the help but I need take a break for a while, two days in and I haven't gotta anywhere. imo, its not a good idea to have an in-game and out-game editing. just confusing even more, I do do everthing in the game with triggers and shit or just code it? but idk. all I want to do I make where wave spawn in a warlord game mode so its like a defnde your castle kinda deal but fuck me if this shit is convoluted

meager granite
#

My guess is that you're missing some module or object needed for Warlords game setup

#

No idea how it works to help you

#

By looks of it BIS_WL_base_EAST is not defined, I guess it needs OPFOR base or something

tough abyss
#

i tihnk you are right. i glad it aa while ago but delete trying to trouble shoot. ill look at it tomorrow, thank you.

supple hollow
#

i remmeber being able to just change on the fly as admin but doesnt seem to work anymore

spiral canyon
#

Is there a way to make AI wait to start their animation? I'm making a mission and have a "dance club" but I want to have the AI to start dancing at different intervals so they are not all in sync with each other. Is that possible?

meager granite
spiral canyon
meager granite
#

Post code

spiral canyon
#

Its the Ambient animation you can select in the Attributes

meager granite
#

🤔

#

Where? Its some kind of mod?

spiral canyon
#

I don't think its a mod. I thought this was part of Vanilla but I could be wrong.

meager granite
#

Its not

#

Maybe you can just add some simulation delay

#

Is your mission MP?

spiral canyon
#

Thats what I was going to try. Yes its MP

meager granite
#
if(isServer) then {this setVariable ["no_sim_until", serverTime + random 5, true]};
this enableSimulation false;
this spawn {
    waitUntil {_this getVariable ["no_sim_until", serverTime] < serverTime};
    _this enableSimulation true;
};
#

Something like this

spiral canyon
#

I will give that a try

meager granite
#

Fixed <

#

This is Init field code btw

spiral canyon
#

doesnt seem to work.

#

Code didn't work but if I sync some of the units to a unhide module and set a trigger for the players. I can at least make some of the units not be synced with some of the others.

meager granite
#

Might be other mods/scripts doing something with simulation

#

Try increasing random 5 to a bigger number

#

random 15 or something

#

maybe its just a fluke with low delay

royal quartz
#

maybe not one for here but worth an ask. Does anyone know the dialog name for the Vehicle Appreance dialog to chage vehicles textures? I want to open it from a GUI im making

meager granite
#

simulation should halt the dance to a random amount

royal quartz
#

I cant find the display name

meager granite
#

No idea if you can use it during gameplay 🤔

royal quartz
#

dam, I know Zues Enhanced made there own one, but theres a chance someone might not have it loaded so I cant rely on it and use theirs.

meager granite
#

Tried ["Open",[true, vehicle player]] call bis_fnc_garage;, nothing good

#

The display is RscDisplayGarage btw

#

Oh, createDialog "RscDisplayGarage" does work

royal quartz
#

ah it might not be virtual garage im looking for actually, its the Vehicle apperance window. Just where you can change the skins of the vehilce youve selected

meager granite
#

but it lets you swap vehicles, not just change the properties

royal quartz
#

not create vehicles like the virtual garage

meager granite
royal quartz
meager granite
#

hmm

royal quartz
#

example is this one but this is what zeus enhanced made, I thought there might have been a vanilla one but I guess im just too used to modded. I think their is only virtual garage

meager granite
#

no idea, can't find it

royal quartz
#

yeah I have a feeling it dosnt exsist in vanilla 😦

meager granite
#

I love hashmaps 🥹

    if!(server_vehicles_allTexturedObjects set [hashValue _vehicle, _vehicle]) then {
        _vehicle addEventHandler ["Deleted", {
            params ["_vehicle"];
            server_vehicles_allTexturedObjects deleteAt hashValue _vehicle;
        }];
    };
#

No more pushBackUnique, no more find and deleteAt by index

spiral canyon
#

Got another riddle. I got a radio that plays an audio clip when scroll wheel on it. But if you click play multiple times it restarts the audio and starts playing over its self. How can I tell it to stop the playing and then play again?
initplayerlocal
radio addAction ["Play Radio", {execVM "playRadio.sqf"}];
playRadio
[radio, [_sounds, 100, 1]] remoteExec ["say3D"];

meager granite
#

say3D returns object that emits the sound, you'll need to delete it before starting again

#

You'll need a function that takes _sounds and RE it

spiral canyon
meager granite
winged wing
# royal quartz

BIS_fnc_garage3DEN is the vanilla version, but it only works in the editor.
["Open", [false, get3DENSelected "object"#0]] call BIS_fnc_garage3DEN

meager granite
#

Define this somewhere (init.sqf or something)

mySay3DFunction = {
    if(!isNil"radiosay") then {deleteVehicle radiosay};
    radiosay = radio say3D _this;
};

Have your play radio do this instead of RE'ing say3D directly

[_sounds, 100, 1] remoteExec ["mySay3DFunction"];
#

@spiral canyon

royal quartz
meager granite
#

No array lookup needed, super fast if you have 1000s of objects

royal quartz
#

deleting them from the virtual garage list?

#

or what list haha

meager granite
#

Otherwise you'd need something like:

private _index = arr find _vehicle;
if(_index >= 0) then {arr deleteAt _index};
#

unrelated to garages

royal quartz
#

I need to be more mindful of using them over arrays and array lookups 😅

meager granite
#

Practically speaking even looking up 1000 element array is a drop in an ocean for performance, unless you do that 100 times each frame

#

I just like how clean it is

royal quartz
#

truee haha yeah much cleaner on the readability

#

well I deicded as we always have zues enhanced in our mod pack to just use their created display for it, so I dont have to redefine another. I could just copy their display but that would be again the rules of steam 😄 and BI

#

more depencies yaaay 😦

royal quartz
# meager granite no idea, can't find it

Im not crazy! I found what I was thinking of, loaded arma with no mods. This is what im referencing, I was hoping I could launch this GUI for the vehicle the player is in.

meager granite
#

Well now you need to figure how to launch it independently

royal quartz
#

yeah haha

#

time to go on a hunt threw arma3s files to see how eden does it

royal quartz
#

ill keep at my deep dive but I wonder if any of the BI devs might be able to point me a rough direction of which PBO or section, im running threw the 3den and ui_f ones just hoping to find something 😄

cosmic lichen
#

It's bis_fnc_garage

#

And you can call it during mission.

royal quartz
# cosmic lichen It's bis_fnc_garage

thats the whole garage, if you see the screenshot im after just the vehicle apprance modification that you can get in eden. I dont want the user to be able to change the vehicle just the skin

#

I found this createDialog "BIS_fnc_initVehicleAppearance" and when running it is return fasle. So it is a resource display but just refuses to let you open it

cosmic lichen
#

I'd copy the function to the mission and then adjust it.

royal quartz
#

I havent found the function specially yet just a reference to it online

#

but no mention to where it is unfortunatly

#

and as is returned false not "error resource dosnt exsist" then its probably what im looking for.

hallow mortar
#

I'd suggest checking the config and functions viewers [with Advanced Developer Tools loaded] rather than manually searching the PBOs

terse tinsel
#

czesc, szukałem w internecie i znalazłem tylko eden skrypt ale on ma błąd, chodzi mi oto by freaze time script. I found one, but it doesn't work _initdate = date;
while {true} do
{
setdate _initdate;
sleep 60;
};

terse tinsel
cosmic lichen
#
_this setVariable ['BIS_EnableRandomization', false, true]; 
_this setVariable ['BIS_DisableRandomization', true, true];

Is there something else I have to do to disable unit/vehicle randomization, as this doesn't seem to work.

winter rose
#

(BIS_DisableRandomization seems not to be a thing)

cosmic lichen
#

Got it from the initVehicle function

tired cargo
#

Hi guys!

Do you know a way to disable "loadouts" button in ACE Arsenal?

raw vapor
#

this hasWeapon doesn't work

raw vapor
#

In hand, we'll say. Keep it simple.

#

Anything in backpacks or inventory I'd consider concealed but I may revisit that later.

hallow mortar
#
primaryWeapon _unit == ""```
#

(and secondaryWeapon, handgunWeapon)

tired cargo
#

keep in mind, that this command return the name of the weapon ( string )

raw vapor
#

So something like if (primaryWeapon this == "" && secondaryWeapon this == "" && handgunWeapon this == "") then {code goes here};

#

if this unit is unarmed, do stuff

hallow mortar
#

Yes, but I suspect that this will probably not be the correct reference to the unit. this would only be a unit reference if we're working in the unit's init field, which would mean the check only happens once on mission start.

raw vapor
#

That is the desire at this time, to have it in the init field.

#

Although it's rather clunky I'll admit.

#

I'll explain what I am trying to do in full.

I have a script I want to run to check if a unit is armed when a unit is spawned by Zeus as part of a composition, or when that unit is placed in 3den. The problem with init is that it fires every time someone joins the damn server which I fear will cause issues, making the script fire repeatedly when I don't want it to.

I also may have future applications checking if a unit is armed, so I wanted to ask about it. In those I would not use this.

#

if (isServer) works for preventing the script in init firing over and over and over for 3den placed units, I don't know if it's a problem for Zeus placed units, and I can't test it.

hallow mortar
#

use if (local this) then { ... }; to ensure the init only runs on one machine

raw vapor
#

Oooohh

hallow mortar
raw vapor
#

Yeah, so I still need a solution for that.

#

I don't know if players will see the weapons that got spawned in.

#

Or, if that will fuck up

hallow mortar
raw vapor
#

Oh!

tribal lark
#

Bit of a weird one; anyone know if it's possible to make an object visible only to a specific player?

hallow mortar
# tribal lark Bit of a weird one; anyone know if it's possible to make an object visible only ...

Depending on how you want this to work, you can either:

  • create the object with createVehicleLocal, running only on that machine
  • use hideObject on every other machine
    In Case A, the object will literally only exist on that machine, and you cannot change that later. If you do it on multiple machines, each local copy will be a separate object and not synchronised together.
    In Case B, the object will still exist on all machines, just hidden, which means you can change its visibility on any machine whenever you like. It's still the same object on all machines, too, so any change you make on the machine where it's visible will also synchronise to other machines as normal (though it will still be hidden).
tribal lark
#

Case B sounds like what I'm looking for, thanks

raw vapor
# hallow mortar `local this` is that solution

Unfortunately, my attempted testing doesn't seem to yield the desired results. The script doesn't fire at all whether I am spawning it with Zeus compositions or loading it in 3den as part of the mission.

if (isServer) then {...}; is the only thing that works and it doesn't fix my problem with the Zeus composition side of things.

stable dune
#

Zeus spawned is not a server if you aren't the hoste.
So you need remoteExec stuff (event) on server if you want it only to be executed on the server.
Because if you check the locality of an object that is spawned / created event it's local on client who (Zeus) does that

raw vapor
#

So, let me understand this then. If I make a composition, and I save code in the init field, then I spawn that thing with Zeus, assuming I am using remoteExec correctly; assuming the script work as intended, is that init field still going to fire every time someone joins the server, or no?

#

Is it different in that regard for people joining later?

#

That's the primary issue. I don't want the script to fire more than once. It doesn't need to and doing so will create problems.

#

I had this problem previously where I used an attachTo command to anchor something at game start, but then later detatched the item. However, when a player joined, it got re-attached no matter where it was on the map, which froze the object. Very annoying.

I wish there was init-field-but-only-activates-when-first-spawned

#

The problem with my current application is I have a script to generate weapons randomly on militants but if a player joins mid-game I don't want the script trying to suddenly respawn their randomly chosen weapon because it'll end up with something else.

cobalt path
#

Hey does anyone know why when I executed

[[], {selectPlayer mf_diver1;}] remoteExecCall ["call", Player_Ober];
[[], {selectPlayer mf_diver2;}] remoteExecCall ["call", Player_Hans];
[[], {selectPlayer mf_diver3;}] remoteExecCall ["call", Player_Jak];
[[], {selectPlayer mf_diver4;}] remoteExecCall ["call", Player_Sanish];
[[], {selectPlayer mf_diver5;}] remoteExecCall ["call", Player_Hannes];
[[], {selectPlayer mf_diver6;}] remoteExecCall ["call", Player_Alpha];
[[], {selectPlayer mf_diver7;}] remoteExecCall ["call", Player_Vudu];

it didnt work.
But when I executed it line by line, it did

manic kettle
#

So odd request. I want to make the character invisible except for the vest (or backpack i guess). Its a joke thing.

_this setObjectTexture [0, ""]; _this setObjectTexture [1, ""];

This sets the uniform texture, but its left with the characters head and hands. any thoughts?

meager granite
#

Vr suit

#

And hide that

manic kettle
#

ok tried it, it doesnt get rid of the face unfortunately

little raptor
wind hedge
#

There is a uniform which will make you fully invisible, but since I consider it a sort of cheat I won't tell

meager granite
royal quartz
hallow mortar
# raw vapor So, let me understand this then. If I make a composition, and I save code in the...

The init field executing on JIP happens because for Editor objects, it is executed on every machine as soon as they load the mission. isServer or local checks prevent this by making every machine skip it except the server (can't JIP) or the machine where the object is local (there can only be one, and a joining machine won't be the owner of an existing object yet).
When a composition is placed with Zeus, the init field only runs on the machine that placed the composition. Other machines don't do it, and so subsequent JIPs don't execute it again.
However, this also means that isServer is not a useful check for Zeus-placed compositions, because on a dedicated server, the server won't be the machine that placed the composition - meaning the init will never run in a place where isServer is true, and so it will always be skipped.

last cave
# cobalt path Hey does anyone know why when I executed ```sqf [[], {selectPlayer mf_diver1;}] ...

Use simple.

mf_diver1 remoteexecCall ["selectPlayer", Player_Ober]
/*
result for Ober "selectplayer link object" same "selectplayer mf_diver1"

Don't worry if in the game the variables have the same information.
*/

As a result, a link to this object from the executor will be sent to the player in the form of a right argument since there is only one. If there should be an array to the right of the command, then you need to cheat a little, but I don't remember how.
maybe
[nil,[num, num] ] remoteExec ["setviewdistanceobject",target]

gilded ferry
#

quick question
in a LAN server
anyway to add a player to an existing group in the console? The U menu isn't available here.

#

or, where in the PBO can I activate that function or add it

hallow mortar
# gilded ferry quick question in a LAN server anyway to add a player to an existing group in th...

This page has info on the Dynamic Groups system, including how to turn it on: https://community.bistudio.com/wiki/Arma_3:_Dynamic_Groups
To move people between groups with the console you can use the join command, but be aware you'll need to have a reference to both people involved. If one of them is you, then cursorObject and player will cover you, but if not it gets a bit trickier.
If you have access to Zeus, you can use ctrl+drag to connect a unit to the group you want to move it to.

gilded ferry
#

CTRL Drag is perfect lmao. Thank you for the detailed explanation Nikko

fair drum
raw vapor
stray flame
#

Hello, so I found this composition that adds an action to animates the newer terminals. I would like to know how I could make it execute the same stuff but from within a script. Basically I want it to do the animation and sound n all that when I call the script. How can I do that?

Term1 addAction ["Open", {
_term = _this select 0;
[_term,['Terminal_source','Terminal_source_sound'],100,1] call bis_fnc_LinkTerminal_Animations},nil,1.5,true,true,"","_target animationSourcePhase 'Terminal_source' == 0",5,false,"",""];```
#

basically I want to do everything that is done following addaction when I do
execVM "Events\Box_Open.sqf";

#

Also how do I animate the progress bar

open fractal
#

been a while since I've written sqf, are there any well maintained vscode extensions anyone can recommend

queen cargo
#

@tough abyss nothing else to say here
you covered the whole nonsense of this "PFHs over loops" shit

fleet sand
# stray flame Hello, so I found this composition that adds an action to animates the newer ter...

So i beleave that progress bar is a animation witch you can control with Animate:
https://community.bistudio.com/wiki/animate
to find all animation names of object you can run this code in debug console while looking at the object:
and then paste it in notepad with ctrl+V

private _anim = animationNames cursorTarget;
copyToClipboard str _anim;

and here is a super simple code for animating progression on object note you need to put correct animation name:

this addAction
[
    "Terminal",
    {
        params ["_target", "_caller", "_actionId", "_arguments"];
        
        [_target,_caller] spawn {
            params ["_terminal","_unit"];
            hintSilent format ["Termial Started by %1", _unit];
            _terminal animate ["MyAnimation", 0, false];
            sleep 2;
            _terminal animate ["MyAnimation", 0.2, false];
            sleep 2;
            _terminal animate ["MyAnimation", 0.4, false];
            sleep 2;
            _terminal animate ["MyAnimation", 0.6, false];
            sleep 2;
            _terminal animate ["MyAnimation", 0.8, false];
            sleep 2;
            _terminal animate ["MyAnimation", 1, false];
            sleep 2;
            hintSilent "Done";
        };
    },
    nil,
    1.5,
    true,
    true,
    "",
    "driver _caller == player",
    5,
    false,
    "",
    ""
];
open fractal
jolly sierra
#

hey, does anyone have any idea why this isn't returning anything? I have a listbox of maps, which players can vote after each game. It's just a standard list, nothing fancy. After double clicking, a map is voted, and number next to map's name incerases by each vote. Now, I'm trying to kinda change that system, since previously it was 2 columns, one for OFPS mode for a map, and second for Low Tech mode, for the same map set. I want to change it so on the left column player first selects a map, and then right pane appears, and a mode can be selected. This code executes when player double clicks a map. The script correctly outputs the _index which player selected, but rest of the code doesn't return the _map, it's just empty

meager granite
#

Old syntaxes by IDCs could be unreliable, try using alt syntax

#

_ctrl lbData _index

granite sky
#

IIRC the direct-IDC syntaxes look up the control in the topmost dialog, which can be problematic.

jolly sierra
#

yeah the code is pretty old and it's not me who made it, just adding new stuff. Also, I love your KOTH server, Sa-Matra speaks by himself!

#

ok thanks, ill try without the IDs

ruby turtle
#

how I call this in arma3diag_x64.exe? :

diag_exportTerrainSVG ["C:\Users\Walzmine\Desktop\Lythium_Map.svg", true, true, true, true, true, false];

Thanks for the help

fleet sand
zinc musk
#

Saw that it was a guy who talked about a cool reinforcements scripts a few days ago but can't seem to find the finished product, anyone know how to create the script?
Spawn in friendly guys as close as me as possible, either one at a time or as a group. That would be frikkin awesomeness

abstract bay
#

I tested the mission, vanilla without mods, with the same scripts. I played for 35 hours and the game was smooth, fps normal. Apparently this is just because of mods. If I'm correct, is there a way to find out exactly which mod is causing it?

pallid palm
#

thats why i never use mods

#

there is a way; set 1 mod at a time then run game and see what happends

#

if i ran mods i would try each mod by itself, then stack 1 then 2 then 3 and so on

granite sky
#

There's only a subset of mods that are liable to cause perf issues too, so there's not usually much to test.

drifting spire
#

Hello script wizards
I'm trying to use GetRelPos with an add action to get a relative position to a sign. It seems very very off. I tried with math aswell and it seems like it's exactly in the same spot.
Sign Position : [12022.2,17641.3,0]
Sign Direction : 45.517

logiSign getRelPos [5, 90]
[12025.7,17637.8,0]

I'm expecting 12018.64,17644.81

#

I feel like I'm losing my mind

warm hedge
#

Not really sure what is your goal but getRelPos also takes the object direction into the count IIRC. If that's what you mean

drifting spire
#

My goal is to spawn a box 5 meters to the left of the sign.
The box that does spawn (or rather the position that getRelPos outputs) is several meters off

warm hedge
#

Show your entire code

drifting spire
#
_crate = "Land_WoodenCrate_01_F";
_crateSpawnPoint = this getRelDir [5, 90]
_spawnMedicalCrate = {
    params ["_target", "_caller", "_actionId", "_arguments"];
    _crate = _arguments select 0;
    _crateSpawnPoint = _arguments select 1;
    _spawnedCrate = createVehicle [_crate, _crateSpawnPoint, [], 0, "CAN_COLLIDE"];
    clearItemCargoGlobal _spawnedCrate;
    _spawnedCrate addItemCargoGlobal ["ACE_elasticBandage", 10];
};
_spawnAmmoCrate = {
    params ["_target", "_caller", "_actionId", "_arguments"];
    _crate = _arguments select 0;
    _crateSpawnPoint = _arguments select 1;
    _spawnedCrate = createVehicle [_crate, _crateSpawnPoint, [], 0, "CAN_COLLIDE"];
    clearItemCargoGlobal _spawnedCrate;
    _spawnedCrate addItemCargoGlobal ["CUP_30Rnd_556x45_Stanag", 10];
};
this addAction ["Spawn Medical Crate", _spawnMedicalCrate, [_crate, _crateSpawnPoint]];
this addAction ["Spawn Ammo Crate", _spawnAmmoCrate, [_crate, _crateSpawnPoint]];
#

Expected destination is slightly off, I manually dragged it over using the eden editor drag function, but it's far closer than the actual destination

warm hedge
#

Are you REALLY sure 90 deg is the dir you want to place it

drifting spire
#

If I'm using a cardinal direction like 0, 90, 180, and 270, shouldn't the output be along the lines shown?

warm hedge
#

Your assumption doesn't really matter. Try it out

drifting spire
#

135 is significantly closer, but this doesn't help as to why

warm hedge
#

It does mean 135 is the answer

drifting spire
#

right

#

yeah, but i'm not learning anything

south swan
#

Because 90 is straight to East and has nothing to do with object's left?

drifting spire
#

getrelpos IS the objects relative left

#

if you are facing north, and turn 90 degrees to the left, you're facing east

south swan
#

🤔

drifting spire
#

And you're right "you shouldn't be turning 90 degrees to the left" I'd expect the number you want to be 270

#

135?

#

doesn't make sense

south swan
drifting spire
#

wrong wiki

warm hedge
#

Okay one thing. What about other object like a car etc

drifting spire
#

like, instead of a sign, you want me to try on a car?

warm hedge
#

...Your code uses getRelDir

drifting spire
#

I'm cooked

#

Appreciate it thanks

#

Good call, I imagine I hit tab as I was typing and it autocompleted dir instead of pos. Rough

ruby turtle
warm hedge
#

Are you sure you're running Diag exe

ruby turtle
#

yep. installed development branch und started arma3diag_64x.exe with needed Maps to Export Map SVG. but ingame console Missing a ";"

warm hedge
#

What exactly is your error

meager granite
cerulean cave
#

So I have been trying to get a dynamic group marker to work in multiplayer. At first I thought it was as easy as just enabling the "composition: group marker" feature. Though the problem with that and multiplayer respawning is that the group gets deleted as people load in because they get "killed" leaving an empty group which gets deleted.

I then came up with this in the player slots ini and that works. This however only makes the marker work for that specific player slot.

[]spawn {
         while {true} do {

                          "marker_01" setMarkerPos getPos unit_01;  

                         };
         };

So what I would like to do is attach the marker to the group leader of a squad and make it move to whoever is leading the group in case someone disconnects dies etc.

cerulean cave
meager granite
#

There must be some kind of module that already does that or something

#

But otherwise I'd just script the whole thing

cerulean cave
cosmic lichen
meager granite
#
    addMissionEventHandler ["EachFrame", {
        {
            if(leader _x != _x) then {continue;};

            private _group = group _x;
            private _marker_name = _group getVariable "my_group_marker";

            // First time marker creation for the group
            if(isNil"_marker_name") then {
                _marker_name = createMarkerLocal [format ["group_%1", hashValue _group], getPosWorld _x];
                _marker_name setMarkerShapeLocal "ICON";
                _marker_name setMarkerTypeLocal "b_inf";
                _marker_name setMarkerSizeLocal [1, 1];

                _group setVariable ["my_group_marker", _marker_name];
                _group setVariable ["my_group_leader", objNull]; // To trigger leader change below
                _group addEventHandler ["Empty", {
                    params ["_group"];
                    deleteMarkerLocal (_group getVariable "my_group_marker");
                }];
            };

            // If leader changed
            if(_group getVariable "my_group_leader" != _x) then {
                _group setVariable ["my_group_leader", _x];
                _group getVariable "my_group_marker" setMarkerTextLocal format ["Group by %1", name _x];
            };

            _marker_name setMarkerPosLocal getPosWorld _x;
        } forEach allUnits;
    }];
#

here you go, wrote a small script to dynamically create and name group markers

#

put into init.sqf

#

@cerulean cave

#

Change allUnits to allPlayers to not care about AIs

#

Won't show the marker for AI-led groups with players though

crisp sonnet
#

Hiya, I'm trying to diable the ACE3 advanced fatigue for only two Player units in a mission. I have tried the following:

Adding this setVariable ["ACE_isUnconscious", false, true]; this setVariable ["ACE_noStamina", true, true]; this setVariable ["ACE_noFatigue", true, true]; this setVariable ["ACE_Fatigue_enable", false, true]; to the init of each unit

Adding a custom script called "disableFatigue.sqf" and adding _unit = _this select 0; _unit setVariable ["ACE_isUnconscious", false, true]; _unit setVariable ["ACE_noStamina", true, true]; _unit setVariable ["ACE_noFatigue", true, true]; _unit setVariable ["ACE_Fatigue_enable", false, true]; to the script, then ```null = [this] execVM "disableFatigue.sqf";


So far, neither of these have worked.

Any ideas?
#

I don't want to disable ACE Advanced Fatigue for any other unit. Just these two player units. This means I can't remove the ACE Fatigue .pbo file, or turn it off in the mission settings.

cerulean cave
meager granite
#

Since its init field, each client including JIP will execute these lines

#

and set the variable on their client for that unit

#

But if you say it didn't work, its probably something in ACE (overwrites init field values, wrong variable names), I have no experience with it

crisp sonnet
#

I'm talking with some peeps over in the ACE discord too and the first reaction of one guy was "Wtf is that even referencing" so 🥹

meager granite
crisp sonnet
#

Gotcha. But wouldn't it just repeatedly disable stamina that's already turned off in that case?

meager granite
#

Yes it would, will just set the values over and over each time new player joins

crisp sonnet
#

Which I get is probably not very effecient tbh

meager granite
#

But since you say it doesn't work, it must be wrong variable names or wrong way to do it

crisp sonnet
#

One of the devs over in the other server say you can't disable it on a per-unit basis

#

🥹

meager granite
#

🤔

#

I did a fast google and there are mentions of doing enableFatigue false on a unit

crisp sonnet
#

Yeah it doesn't work, I already tried it

meager granite
#

Dig into PBOs to find the vars then

crisp sonnet
#

I can't seem to find the variable that enables stamina

cobalt path
# last cave Use simple. ```sqf mf_diver1 remoteexecCall ["selectPlayer", Player_Ober] /* re...

Sooooo than doing

mf_diver1 remoteexecCall ["selectPlayer", Player_Ober];
mf_diver2 remoteexecCall ["selectPlayer", Player_Hans];
mf_diver3 remoteexecCall ["selectPlayer", Player_Vudu];
mf_diver4 remoteexecCall ["selectPlayer", Player_Sanich];

will work? Because

[[], {selectPlayer mf_diver1;}] remoteExecCall ["call", Player_Ober];

also worked, but not

[[], {selectPlayer mf_diver1;}] remoteExecCall ["call", Player_Ober];
[[], {selectPlayer mf_diver2;}] remoteExecCall ["call", Player_Hans];
[[], {selectPlayer mf_diver3;}] remoteExecCall ["call", Player_Vudu];
[[], {selectPlayer mf_diver4;}] remoteExecCall ["call", Player_Sanich];
gaunt patio
#

Hey @queen cargo, I noticed you commented on Killzone's getNumberPlate.dll page about potentially setting the plate. Did you ever get a chance to look into that at all?

cobalt path
# meager granite When do you execute this?

Zeus, during the op.
I am doing the whole "change perspective" thingy when you start playing as different body

Executed the 4 lines above at the same time like its written and nothing happened. (was awkward)
But when I executed them one by one, than it worked perfectly

last cave
meager granite
cobalt path
#

My main question is why it works when I execute line by line, but not when I execute at the same time

cobalt path
# last cave

Not really sure what your photos mean, did it work with your script? Its hard to know if you switched bodies when the map is all grey

meager granite
last cave
#

I just wrote 2 lines in the console for each client. I literally did the same thing as you.

meager granite
#

Player_* and mf_* ones

cobalt path
cobalt path
#

It is still confusing why original code didnt work

meager granite
#

it looks proper, likely you didn't have some/all Player_ variables pointing to right players

#

Or players didn't have mf_diver* vars they supposed to switch to right

cobalt path
last cave
#

Use remoteexec ["call"] This is very stupid because instead of call it executes the function that you wrote in the arguments. And instead of call you can write the function itself.

A function is something else. An example for just one command.

selectFunction = {params ["_unit"];
selectPlayer _unit
};

[ [["Open", [true]], BIS_fnc_arsenal] remoteexec ["call",allplayers];
//same
["Open", [true]] remoteExec ["BIS_fnc_arsenal",allplayers];


//your original as fucntion
[ [mf_diver1], selectFunction ] remoteexec ["call",Player_Ober];//not bad but look bad
//same but no have args
[[], {selectPlayer mf_diver1;}] remoteExecCall ["call", Player_Ober];//very very bad for MP


//Using it as a function is much more convenient than just code.

mf_diver1 remoteExec ["selectFunction",Player_Ober];//not bad look and work good
//same but no function. You just send command and link on NetObject.
mf_diver1 remoteexecCall ["selectPlayer", Player_Ober];//good and work good

inner flicker
#

Hey I created a sector control mode and when I put it in multi-player, my unit respawns before I even spawn in. Can someone help me?

#

How do I make it so he doesn't respawn at the spawn screen? Cause I put him as playable but it makes the death sound when I get to the spawn screen and he starts with default loadout. Help

proven charm
#

spawn screen?

hallow mortar
#

You probably have "respawn on start" turned on in your mission respawn settings. It'll be either in the Editor mission attributes, probably under Multiplayer, or in the mission description.ext

abstract bay
eternal spruce
#

Looking at this runway lights script by AUSTINATST, I understand that its creating this object Land_Flush_Light_green_F for example I know it's creating a green navigation light but can i change the the color of the object that's being created for example white? Here's the script

faint burrow
#

Find appropriate class name and, if it exists, add new option.

eternal spruce
#

yea the class name exist but its for another object similar to it

faint burrow
#

And what is the name of this class?

eternal spruce
#

Land_runway_edgelight this is the white one but its the edge light variant

faint burrow
#

I meant Land_Flush_Light, but white. Most likely it exists, and most likely its name is Land_Flush_Light_white_F, but you should confirm that.

eternal spruce
#

oh, ok i'll look into that

jolly sierra
jolly sierra
#

data is set like this:

blissful current
#

I'm getting an error that Class Conversations not found in CfgSentences, but it is clearly defined in description.ext :

class CfgSentences
{
    class Conversations //See? It's right here.
    {
        class Intro1
        {
            file = "Intro1.bikb";
            #include "Intro1.bikb"
        };
    };
};
#

I double checked the wiki. I don't see any difference.

winter rose
#

description.ext.txt perhaps?

blissful current
jolly sierra
#

with file extensions turned on?

blissful current
#

The property tab shows this as well.

#

When I right click on the file.

#

Just verified file name extensions turned on in Windows.

winter rose
blissful current
winter rose
#

I wrote this guide 😄

blissful current
winter rose
#

see the number of levels, the Conversations should not be there iirc

blissful current
#

I un-PBO a mission off the workshop (with permission) and his is the same structure as mine but it work on his mission. I must be missiong something stupid.

velvet knoll
#

I would be amazed if this dosent exist already and im hoping someone has a lead on where i can find it.

Looking to script a helicopter transport my players can use to move between specific pre-designated landing points (between fobs), but no where else.

winter rose
winter rose
velvet knoll
blissful current
winter rose
#

I would say you can copy-paste the function from in-game and edit it for it to grab on click's closest location from previously-defined ones?

blissful current
# velvet knoll Totally get that, I just wasnt sure if smeone happened to know of one already ex...
player addAction [
    "<t color='#FFFF00'>Radio for Extraction</t>", 
    { 
    _group = HeliGroup2; 
    _markerName = "marker1"; 
    _waypointPosition = getMarkerPos _markerName;
    _waypoint = _group addWaypoint [_waypointPosition, 0];
    _waypoint setWaypointType "LOITER";
    _waypoint setWaypointLoiterRadius 100; 
    _waypoint setWaypointLoiterType "CIRCLE_L";
    }, 
    nil, 
    8, 
    false, 
    true, 
    "", 
    "ActionExtraction"
];

player addAction [
    "<t color='#FFFF00'>Clear to Land</t>", 
    { 
    _group = HeliGroup2;
    deleteWaypoint [_group, 0];
    deleteWaypoint [_group, 1];
    heli_2 land "LAND";        
    }, 
    nil, 
    8, 
    false, 
    true, 
    "", 
    ""
];```
#

This is an addaction that calls the heli to a marker and has it loiter. Then you tell it to land. Took me like 8 hours to get it to work.

blissful current
velvet knoll
#

So in theory I could just create several markers, and create several add actions, which would create a "land" waypoint at the markers position

velvet knoll
#

Awsome, Thanks for this

blissful current
blissful current
velvet knoll
blissful current
velvet knoll
blissful current
velvet knoll
#
this addAction [ 
    "Call For Transport",  
    {  
    _group = HeliGroup2;  
    _markerName = "marker1";  
    _waypointPosition = getMarkerPos _markerName; 
    _waypoint = _group addWaypoint [_waypointPosition, 0]; 
    _waypoint setWaypointType "LAND"; 
    },  
    nil,  
    8,  
    false,  
    true,  
    "",  
];
blissful current
#

remove the last comma

#

Notice how in mine the condition field is not followed by a comma. However in yours it is.

granite sky
#

SQF parser error messages are not great

#

Also most languages will allow trailing commas in arrays.

#

(SQF does not)

#

What it usually does get right is the position of the error.

hallow mortar
#

I don't think you should set the condition to ""

blissful current
#

Actually funny timing because John is the one who actually helped me in doing those waypoint's I'm helping Sandman with. ITS COME FULL CIRCLE.

velvet knoll
granite sky
#

LAND isn't a valid waypoint type.

velvet knoll
#

Also thinking it would be good to add a "clear all waypoints" command before creating a new one to prevent multiple waypoints stacking

granite sky
#

wait, there is one...

#

Maybe try giving it a move waypoint first anyway.

hallow mortar
#

I'm not sure that advanced waypoints are actual unique waypoint types. I think they're just "SCRIPTED" with a prefilled script.

velvet knoll
#

I think that did it

#

oh you know what, I found the issue, the advancd waypoint isnt being called properly with "LAND" @blissful current @granite sky

#

so it just stays as a blank waypoint with no order attached

granite sky
#

well, it's a fancy scripted waypoint so that's probably normal?

velvet knoll
blissful current
granite sky
#

I vaguely remember reading that function and it was bad :P

velvet knoll
blissful current
velvet knoll
#

The blank way point changed to a "move" waypoint

#

But it's flying 180 degrees in the wrong direction

#

I'm so confused 😂

blissful current
#

How do you see what the waypoints are doing in real time anyway? I don't know that one.

velvet knoll
blissful current
velvet knoll
#

i set the location to 0,0,0

#

so it tried to go to those coords... i think

#

hmm, still not landing

winter rose
blissful current
# winter rose and do you have `Sentences` defined _in_ `kb\event1.bikb`?

Yes. I copy/pasted this:
`class Sentences
{
class Sentence1
{
text = "This is sentence ONE";
speech[] = { "\Sound\hello.ogg" };
class Arguments {};
actor = "soldier1";
};
class Sentence2
{
text = "This is sentence TWO";
speech[] = { "Sound\gk.ogg" };
class Arguments {};
actor = "soldier1";
};
class Sentence3
{
text = "This is sentence THREE";
speech[] = { "Sound\bold.ogg" };
class Arguments {};
actor = "soldier1";
};
};

class Arguments {};
class Special {};
startWithVocal[] = { hour };
startWithConsonant[] = { europe, university };`

winter rose
blissful current
winter rose
#

["Event1", "MissionName"] call BIS_fnc_kbTell;?

blissful current
winter rose
#

now I'm curious, starting A3 to check

blissful current
winter rose
#

hopefully not yeah

hallow mortar
#

Should be missionName not "MissionName"

#

Unless your mission's name is "MissionName", I suppose

#

Actually, no

#

"MissionName" would be fine EXCEPT that the MissionName (category) layer is missing from your CfgSentences

#

Yours:

class CfgSentences
{
  class Sentence1
    {

Correct:

class CfgSentences
{
  class MissionName
  {
    class Sentence1```
winter rose
#

no, that's the bikb / Sentences vs CfgSentences

#

@blissful current do you have that in the mission's config viewer?

blissful current
winter rose
#

the ` key, Config Viewer

#

(works well on my end 😬)

#

or here, in-mission

blissful current
velvet knoll
# granite sky I vaguely remember reading that function and it was bad :P

Sorry to ping you, but quick question - any idea why the helo is still not landing?

    "Call For Transport",  
    {  
    _group = HeliGroup2;  
    _markerName = "marker1";  
    _waypointPosition = getMarkerPos _markerName; 
    _waypoint = _group addWaypoint [_waypointPosition, 0]; 
    _waypoint setWaypointType "MOVE"; 
    _waypoint setWaypointType "MOVE"; 
    _group setCurrentWaypoint [_group, 2]; 
 [HeliGroup2, [2824.13,6231.93,0], transportheli] spawn BIS_fnc_wpLand; 
    },  
    nil,  
    8,  
    false,  
    true,  
    ""
];```
#

Oh i do see im calling the waypoint set type twice

granite sky
#

Well, that won't hurt but it's obviously unnecessary

velvet knoll
#

yeah, extra call that just adds excess load

granite sky
#

I don't know what's going on with your setCurrentWaypoint.

#

2 is the third waypoint and it's not clear that it has a third waypoint.

#

On the wpLand line, transportheli is probably the wrong object unless you called a landing pad transportheli.

velvet knoll
#

No i referenced the helicopter itself

granite sky
#

I don't think that's what it's for.

velvet knoll
#

do I need to reference the marker itself again?

granite sky
#

But it's undocumented so I'd need to read the function.

#

It's expecting a target object so I'm guessing it's supposed to be a landing pad.

velvet knoll
#

It seems after rre-reading you may be correct

#

that the object the waypoint should be attached to is the landing pad, not the helo itself

granite sky
#

You're using it without a waypoint anyway. The function is really there for internal usage.

hallow mortar
#

Wait for 2.18 and use landAt :D

velvet knoll
granite sky
#

Well, land works, it just picks whatever landing pad it wants to.

velvet knoll
#

Ah end of summer

velvet knoll
#

interesting

#

let me try

granite sky
#

Difficulty is scripting it in combination with waypoints.

hallow mortar
velvet knoll
#

So in theory if there is a helipad at the LZ

this addAction [  
    "Call For Transport",   
    {   
    _group = HeliGroup2;   
    _markerName = "marker1";   
    _waypointPosition = getMarkerPos _markerName;  
    _waypoint = _group addWaypoint [_waypointPosition, 0];  
    _waypoint setWaypointType "MOVE";
    _waypoint setWaypointType "LAND";

    },   
    nil,   
    8,   
    false,   
    true,   
    "" 
];```

Should do the trick
#

let me go try it

#

Nope

granite sky
#

uh, you need to create each waypoint. So if you wanted to move and then land, you'd do something like this:

_wp1 = _group addWaypoint [_waypointPosition, 0];
_wp1 setWaypointType "MOVE";
_wp2 = _group addWaypoint [_waypointPosition, 0];
_wp2 setWaypointType "LAND";
#

I don't know if the LAND waypoint type actually works though. I was referring to the land command.

velvet knoll
#

AH gotcha

#

hmm... so this is the closest ive gotten

#

he just sits there and hovers

#

so im assuming the "MOVE" waypoint doesn't function like I was hoping

granite sky
#

Waypoints complete some distance before the target is actually reached.

#

Something like 100m for helis? I forget.

#

Try this:

_wp1 = _group addWaypoint [_waypointPosition, 0];
_wp1 setWaypointType "MOVE";
_wp1 setWaypointStatements ["true", "(vehicle this) land 'LAND'"];
velvet knoll
#
    "<t color='#FFFF00'>Request Transport</t>",  
    {  
 _group = transportcrew; 
 _markerName = "LZ1";  
 _waypointPosition = getMarkerPos _markerName; 
 _waypoint = _group addWaypoint [_waypointPosition, 0]; 
 _waypoint setWaypointType "SCRIPTED";
 _waypoint setWaypointScript "A3\functions_f\waypoints\fn_wpLand.sqf"; 
 },  
    nil,  
    8,  
    false,  
    true,  
    "",  
    "" 
]; 
#

will try your script now

#

@granite sky @blissful current @tribal lark thanks for your help guys, finally got it working

    "<t color='#FFFF00'>Request Transport</t>",   
    {   
 _group = transportcrew;  
 _markerName = "LZ1";   
 _waypointPosition = getMarkerPos _markerName;  
_wp1 = _group addWaypoint [_waypointPosition, 0]; 
_wp1 setWaypointType "MOVE"; 
_wp2 = _group addWaypoint [_waypointPosition, 0]; 
_wp2 setWaypointType "SCRIPTED";
_wp2 setWaypointScript "A3\functions_f\waypoints\fn_wpLand.sqf";  
 },   
    nil,   
    8,   
    false,   
    true,   
    "",   
    ""  
];  
inner flicker
#

Wow. I figures someone would have read my post by now.

tulip ridge
#

They did

tulip ridge
tardy osprey
#

So i have a tiny thing that triggers me a bit. Basically im creating tasks, and I've set up the triggers and sync so that Obj2 gets given after obj1. There is a slight issue where the popup "Task Created" Appears before "Task Completed". How can i delay obj2 just a few seconds, to allow Obj1 to pop up as completed first?

fair drum
#

either use the delays at the bottom of the trigger, or write your own script that has a delay and utilizes the task framework functions to make your next task.

tardy osprey
#

i tried to find the delays at the bottom of the create task not the trigger..... argh...

zinc musk
#

Sorry to probably ask a question that's been up before 😄
I wrote a message some time ago about a reinforcements script. Hope anyone knows what I'm looking fo:

"Saw that it was a guy who talked about a cool reinforcements scripts a few days ago but can't seem to find the finished product, anyone know how to create the script?
Spawn in friendly guys as close as me as possible, either one at a time or as a group. That would be frikkin awesomeness"

meager granite
#

Also you set value but get data

#

I think some lb commands work with lnb?

jolly sierra
#

Ah

meager granite
#

Still, use correct set of commands

jolly sierra
#

Ok I'll try it soon and let you know

meager granite
#

value -> Number
data -> String

warm hedge
#

It actually does. But very messy to work with, so just use lnb

jolly sierra
#

Ok so change all lb related commands to their lnb variant?

#

And don't get data but get value?

meager granite
#

Depends on what you store. Data is string, value is number, they're stored separately

#

Also I think you're missing column when you set your value, idk if its allowed

#

lnb stores both data and value in each cell (row+column), not just row

jolly sierra
#
lnbAddRow[300011, [_x, "0"]];
    lnbSetValue[300011, [_u1, 0], _forEachIndex];
``` this is the way it was previously
jade abyss
#

_Bla setOwner 2; <- Server, right?

jolly sierra
#

so that one was correct in terms of syntax?

#

changed that to this:

#

but still same result

#

and with this syntax same

tough abyss
#

yes

meager granite
#

You're missing column index in your lnbValue

jolly sierra
#

ok, then I did "lnbText" it kiiinda works, outputs the text

#

but yeah thats not the thing I want, since it displays map names in pretty way, while their real file name is different

jade abyss
#

Thx. Wasn't sure 😃

meager granite
#
private _lnb = _dialog displayCtrl 300011;
private _row = lnbCurSelRow _lnb;
private _val = _lnb lnbValue [_row, 0];
#

Change lnbSetValue to proper syntax too to be sure

jolly sierra
#

ok

jolly sierra
#

ok I think I got it to work! Thanks for explaining how this works

inner flicker
#

hey does someone know how a work around for the vehicle respawn?

#

i used to have the script, but i lost it when i formatted my computer

#

it was something like newvehicle,oldvehicle or something

#

anyone? no?

meager granite
#

work around what?

inner flicker
#

the vehicle respawn

#

its broken

#

ai doesn't respawn with the vehicle

#

i used to have a scipt that was something like oldvehicle,newvehicle

#

i don't rememeber what it entailed because its been about a year since i used it and i formatted my computer

tulip ridge
#

Just use createVehicleCrew on the new vehicle

inner flicker
#

will that stick if its been destroyed?

#

its not working

#

maybe im not using it correctly

glass nest
#

did you know that this can only be done with scripts?

inner flicker
#

ok looked up vehicleRespawn on bohemia's site. this is what im seeing

#

vehicle respawnVehicle [respawnDelay, respawnCount, deleteOldWreck, respawnOnServer, respawnFlying, respawnUnit, respawnMode, respawnSide, useRespawnMarkerDir]

#

so how would i use that to respawn my vehicle with crew and follow preset wapoints after being destroyed?

#

im trying to make a battlefieldesque sector control game.

#

i got the vehicle to respawn per the command, but the delay doesnt seem to work and ive changed vehicle from "car" to "Helicopter" and "heli"

#

and "veh"

thin fox
inner flicker
#

its broken

thin fox
#

why?

inner flicker
#

it wont respawn the vehicles with crew after being destroyed

#

i remember having to use a workaround because of it

thin fox
#

yes, you need to create the crew

inner flicker
#

i tried that

#

it didn't work at the time

thin fox
#

simply put in the expression createVehicleCrew (_this select 0)

inner flicker
#

let me try tht

#

give me a sec.

#

it seems to work! thank you. But one other question, the waypoints go away after respawn

thin fox
#

the old group of that vehicle got killed, so the new group created by the command doesn't have waypoints

hallow mortar
#

The vehicle respawn system is a bit broken/limited. KK has been working on some improvements to it - I think those are supposed to be in 2.18, so watch out for that.

inner flicker
#

ok so in the expression field i have this

#

createVehicleCrew (_this select 0); _wp= _grp addWaypoint [GetPosASL Player, 100, "SAD"]

#

this is for the vehicle respawn

#

i want it to respawn with the same Seek and destroy waypoint

#

but it gives an error of _grp

thin fox
inner flicker
#

so what do i put there then?

#

because according to the site grp is defined as either both linked units or individual units.

thin fox
#

try (group _this select 0), dunno if it will work

south swan
#

Return Value:
Group - the group of the created crew (since
Arma 3 logo black.png
1.94
; before that returned Nothing)

thin fox
#

oh yes

#

@inner flicker
_grp = createVehicleCrew (_this select 0); _wp= _grp addWaypoint [GetPosASL Player, 100, "SAD"]
try this

formal stirrup
#

Why does the ammoHit eventhandler always return objNull as the hit object?

#

Is there some magical thing I need to do in the config

proven charm
formal stirrup
#

god damnit

#

any other way to detect what bullet hits?

#

Just add a hitPart to it when its fired?

proven charm
#

HitPart EH goes to the target

formal stirrup
proven charm
#

ah i didnt know there was two HitPart EHs one for target and one for projectile

formal stirrup
#

Figured you meant the one listed under basic, yeah

proven charm
#

which also is bit buggy... fix coming in next release i believe

swift lynx
#

does anyone have an easy paradrop script this one doesn't work on the server. parachutes are spawn but players arent put in the driver seat on the server

if (!isServer) exitWith {};
params ["_vehicle", ["_delay", -1, [0]], ["_parachuteType", "rhs_d6_Parachute", ["string"]]];
private ["_paras", "_crew", "_dir"];

_paras = [];
_crew = crew _vehicle;

// Calculate ejection delay based on speed if no custom value was provided
if (_delay isEqualTo -1) then {
    _delay = (1 / (((speed _vehicle) max 55) / 150));
};

{
    _isCrew = assignedVehicleRole _x;
    if (count _isCrew > 0) then {
        if ((_isCrew select 0) == "Cargo") then {
            _paras pushBack _x
        };
    };
} forEach _crew;

_vehicle allowDamage false;
_dir = direction _vehicle;

#

ParaLandSafe = {
    params ["_unit", "_parachuteType"];

    (vehicle _unit) allowDamage false;

    private _type = getText (configFile >> "cfgVehicles" >> backpack _unit >> "ParachuteClass");
    if (!(_type isKindOf "ParachuteBase")) then {
        private _para = createVehicle [_parachuteType, getPosATL _unit, [], 0, "NONE"];
        _para setPosASL (getPosASLVisual _unit);
        // _para setVectorDirAndUp [vectorDirVisual _unit, vectorUpVisual _unit];
        [_para, [vectorDirVisual _unit, vectorUpVisual _unit]] remoteExecCall ["setVectorDirAndUp", _unit, true];
        _unit moveInDriver _para;
        // _unit assignAsDriver _para;
        [_unit] remoteExecCall ["assignAsDriver", _unit, true];
        [_unit] allowGetIn true;
        // [_unit] orderGetIn true;
        [_unit] remoteExecCall ["orderGetIn", _unit, true];
    };

    waitUntil {
        isTouchingGround _unit || (position _unit select 2) < 1
    };
    _unit action ["eject", vehicle _unit];
    sleep 1;
    _unit setUnitLoadout (_unit getVariable ["Saved_Loadout", []]);
    _unit allowDamage true;
};

{
    _x setVariable ["Saved_Loadout", getUnitLoadout _x];
    removeBackpack _x;
    _x disableCollisionWith _vehicle;
    _x allowDamage false;
    _x disableAI "MOVE";
    // unassignVehicle _x;
    [_x] remoteExecCall ["unassignVehicle", _x, true];
    moveOut _x;
    // _x setDir (_dir + 90);
    [_x, _dir + 90] remoteExecCall ["setDir", _x, true];
    // _x setVelocity [0, 0, -5];
    [_x, [0, 0, -5]] remoteExecCall ["setVelocity", _x, true];
    [_x, _parachuteType] spawn ParaLandSafe;

    sleep _delay;

    _x enableAI "MOVE";
} forEach _paras;

_vehicle allowDamage true;

{
    (group _x) leaveVehicle _vehicle;
    _x enableCollisionWith _vehicle;
} forEach _paras;
proven charm
#
_unit moveInDriver _para;
``` https://community.bistudio.com/wiki/moveInDriver needs local argument, so if thats run on server it wont work
next arrow
#

Hello, is there a video tutorial or a web site that can guide me to making a vehicle mod from 0

fair drum
#

Other than the wiki, probably not. And it's not going to be in a hand holding format.

inner flicker
cloud valley
#

Hello guys
Please help me get the following scripts for the "Rocket" model.
I need the script for the effect of smoke and fire emanating from the missile, and the script for the explosion and destruction

inner flicker
thin fox
#

_grp = createVehicleCrew (_this select 0); _wp= _grp addWaypoint [GetPosAGL Player, 100, -1, "SAD"]

frigid spade
#

is there a function that will return a bool or something if an object is in motion or not?

inner flicker
inner flicker
tulip ridge
#

Or velocity

frigid spade
#

ah there it is, idk why i was looking through all the "getX" commands and didnt see a speed one

thin fox
inner flicker
#

currently, im using a AT missile specialist for my character. it wont let me select the loadout at the mission start

swift lynx
inner flicker
thin fox
# inner flicker yeah

You can add Virtual Arsenal in a box, cuz for that kind of loadout, you need to configurate the loadout templates in the description.ext, something like that.

inner flicker
#

@thin fox ok thank you again for your help!!!

inner flicker
#

@fair drum thank you! i do appreciate all the help you guys have given me!

tough abyss
#

Trying to use the "gear scan" script to get info of all gears on placed playable units, but it won't capture all gear. alot is missing when I paste it to whitelisting

AllPlayableUnitsItens = [];
{AllPlayableUnitsItens = AllPlayableUnitsItens + [(headgear _x)] + [(goggles _x)] + (assignedItems _x) + (backpackitems _x)+ [(backpack _x)] + (uniformItems _x) + [(uniform _x)] + (vestItems _x) + [(vest _x)] + (magazines _x) + (weapons _x) + (primaryWeaponItems _x)+ (primaryWeaponMagazine _x) + (handgunMagazine _x) + (handgunItems _x) + (secondaryWeaponItems _x) + (secondaryWeaponMagazine _x)} forEach (playableUnits + switchableUnits);
AllPlayableUnitsItens = AllPlayableUnitsItens select {count _x > 0};
AllPlayableUnitsItens = AllPlayableUnitsItens arrayIntersect AllPlayableUnitsItens;
copyToClipboard str AllPlayableUnitsItens;

timber bough
#

Is there a way to force the AI to turn out without using SAFE/CARELESS setBehaviour?
There is a vehicle that has a machine gun at top but for the AI to use it they need to turn out.
I think this is similar to how on hilux trucks the AI "turns out" when they're sitting in the truck bed and stand up to shoot.

fleet sand
warm hedge
tough abyss
#

I also need some help to create a script that makes a marker have the same position as my player. it is for the spyder addon "vehicle spawner" and since it only spawns on a marker I don't want to run and get the new vehicle, I want it to spawn on my position. hope its clear haha

timber bough
#

BUT

#

setting that specific unit to careless works, and they still fire their weapon so... 😂

unkempt marsh
#

are there any commands along the lines of "Fetch all entities" to grab all the editor objects and put them into an array? i thought i remembered something along the lines of "findAllOfType" but can't find anything on the wiki

harsh vine
#

allMissionObjects ?

unkempt marsh
harsh vine
#
  • entities
unkempt marsh
#

it worked perfectly thanks alot

little raptor
#

The better way is creating layers in editor and using getMissionLayerEntities

eternal spruce
#

I came across this video and wondering how to get or replicate ALS Lights seen in the video. I can’t find a mod for it, can someone please explain to me how I can make this

fleet sand
# eternal spruce I came across this video and wondering how to get or replicate ALS Lights seen i...

That seams simple all you need to do is create lights in a row and turn them on off with a delay. Here is a sample code for you that i made you can play with this and make it how ever you need it:

0 spawn {
    private _numOfLights = 20;
    private _currentPos = getPosASL player;
    _currentPos params ["_currentX","_currentY","_currentZ"];
    private _offset = 5;

    private _lights = [];
    for "_i" from 0 to _numOfLights do {
        private _light = "#lightpoint" createVehicleLocal [(_offset * _i) + _currentX,_currentY,_currentZ];
        _light setLightColor [1,1,1];
        _light setLightAmbient [1,1,1];
        _light setLightBrightness 1;
        _light setLightUseFlare true;
        _lights pushBack _light;
    };

    waitUntil {
        {
            _x setLightBrightness 0;
            sleep 0.2;
        }foreach _lights;
        sleep 5;
        {
            _x setLightBrightness 1;
            sleep 0.2;
        }foreach _lights;
        false;
    };
};
fleet sand
#

I have a quick question about lights is there a limit how close lightpoints can be to each other ?
So have this code that i executed:

0 spawn {
    private _currentPos = getPosASL player;
    _currentPos params ["_currentX","_currentY","_currentZ"];
    private _num = 20;
    private _offset = 5;
    for "_i" from 1 to _num+1 do {
        private _ball = "Sign_Sphere10cm_Geometry_F" createVehicle [(_offset * _i) + _currentX,_currentY,_currentZ];
    };
};

0 spawn {
    private _currentPos = getPosASL player;
    _currentPos params ["_currentX","_currentY","_currentZ"];
    private _num = 20;
    private _offset = 5;
    for "_i" from 1 to _num+1 do {
        private _light = "#lightpoint" createVehicleLocal [(_offset * _i) + _currentX,_currentY,_currentZ];
        _light setLightColor [1,1,1];
        _light setLightAmbient [1,1,1];
        _light setLightBrightness 1;
        _light setLightUseFlare true;
    };
};

And this picture is the result. Or am i doing the offset wrong ?

winter rose
#

I don't remember the limit though

still forum
#

If you are further away, multiple close by lights can be combined into a single one

#

The limit also depends on video settings

fleet sand
#

I think i got it to work i change getposASL to getposATL it seems that CreateVehicleLocal can only have AGL position.

winter rose
#

you can still setPosWorld it later 🙂

eternal spruce
#

@fleet sand thank you I’ll test this out when I get home

sullen fulcrum
#

So
Random question
Trying to set up a multiplayer campaign that uses the Chemical detector
I had an old script that used to work back in 2022, but got broken after the 2.0 update if I had to guess

cutRsc ["RscWeaponChemicalDetector", "PLAIN", 1, false];   
0=[] spawn {   
 while {true} do {   
  sleep .5;   
  private _ui = uiNamespace getVariable ["RscWeaponChemicalDetector", displayNull];    
  if !(isNull _ui) then {    
   private _obj = _ui displayCtrl 101;        
   _obj ctrlAnimateModel ["Threat_Level_Source", parseNumber ((player distance threat)/10 + random [-.25,0,.25] min 0 max 9.99 toFixed 2), true];    
  };   
 };   
};```

Second Half
```sqf
params["_unit", "_isJIP"];

if (!_isJIP) then
{
    [_unit] call exp_fnc_playerSpawn;
//    [object, maxDistance, minDistance, condition] execVM "chemicalDetector.sqf";
    [test, 150, 15] execVM "chemicalDetector.sqf";
    
};

if (_isJIP) then
{

};```
I was hoping someone else has tried to update this script, or could at least make a guess as to what's wrong with it?
last pike
#

hello friends, I would like to know the best way to learn how to learn scripting
I know a very basic level but I do not understand a lot of thing that go on, nor do I know how to write my own script

#

just wanted to know where I should go to learn how to script

sullen fulcrum
dry cradle
#

I am looking for a mod or script that will punish players for damaging friendly units or flashbanging them or whatever. I really like the Antistasi "watch the turtles" thing but I can't quite figure out how to pull that specific thing out of their mod. Does anyone know of anything that does this?

fair drum
#

nothing plug and play for you. its not difficult though to make one yourself. just use an event handler(s) to track the teamdamage/kill then execute your teleport + disabling unit simulation so they have to sit there. wait a bit, then send them back and reenable

dry cradle
#

Okay I am looking at the event handlers thing on the wiki. How would I write it so also account for flashbangs? Do I need to put this in the init for every player role?

fair drum
#

i'm assuming you are using ace for the flashbang system?

dry cradle
#

yes sir

fair drum
#

if so, you have a cba event handler that fires when someone is flashbanged:

[QGVAR(flashbangedPlayer), [_strength, _grenadePosASL]] call CBA_fnc_localEvent;

you'll have to hook into that using the CBA event handler system (it functions similar to the vanilla scripted event handler system)

#

tell me when we are in over your head

dry cradle
#

Due to me not knowing scripting except for basic I'm tryin to run it by ChatGPT to see if it puts out something worthwhile lol, I'll put it in here and if you're curious if it sucks or not lol

fair drum
#

chatgpt wont give you anything. it sucks at sqf

#

and doesn't know frameworks like cba

#

and the code it learns on is crap and outdated

dry cradle
#

what about the Arma 3 script GPT that some dude made? havent had a need to try it out yet until now.

fair drum
#

you can try it, but none of us are going to troubleshoot it for you when it causes problems/doesn't work

#

we don't troubleshoot GPT here

dry cradle
#

fair enough

fair drum
#

instead, just try making something that fires when someone is killed

#

would be a good starting point. the flash stuff is going to be over your head

dry cradle
#

the problem I'm trying to solve is players trolling at inconvenient times, and a slap on the wrist when the one or two decide to be dumb

fair drum
#

if there is a big enough desire for something of a teamdamage/teamkill/anti troll thing, I can write one for modules enhanced in the upcoming month. but nothing immediate. I don't have too much time atm.

fair drum
#

@dry cradle actually, I'll start working on it now. seems like a good addition to the mod. might come out in parts though.

dry cradle
#

Welp, that mods going into the modpack now lol

eternal spruce
#

Hey everyone i created a light source:

light setlightcolor [1,1,1]; 
light setlightambient [255,255,255]; 
light setlightintensity 10;}```
how do i make it flicker indefinately after i created it?
fair drum
eternal spruce
#

Thank you

eternal spruce
#

@fair drum I did this but the light still remains there even with the intensity being 0

 
call{light = "#lightpoint" createVehicleLocal position ASL_1;  
light setlightcolor [1,1,1];  
light setlightambient [255,255,255];  
light setlightintensity 10;}; 
 
sleep 0.5; 
 
call{light = "#lightpoint" createVehicleLocal position ASL_1;  
light setlightcolor [1,1,1];  
light setlightambient [255,255,255];  
light setlightintensity 0;}; 
 
sleep 0.5; 
 
call{light = "#lightpoint" createVehicleLocal position ASL_1;  
light setlightcolor [1,1,1];  
light setlightambient [255,255,255];  
light setlightintensity 10;}; 
 
};```
fair drum
eternal spruce
fair drum
eternal spruce
#

Ok understood on that point

fair drum
#

light cone params don't use a #lightpoint, they use #lightreflector

eternal spruce
#

So then how do i alter the direction of the light

fair drum
#

you use a lightreflector, but you won't have a "flare" unless you ALSO use a lightpoint, but that lightpoint will be 360*

#

do you have my mod modules enhanced? if so, use my lightpoint module. it will update in the editor. gives you a sense of what things look like and the differences between a light point, a light cone/reflector, with either or enabled

eternal spruce
#

Its called lightpoint module

fair drum
#

remember to turn it dark out, use backspace to turn off the hud too

eternal spruce
#

OK @fair drum i'll give this a try

fair drum
#

lightcone only

#

vs

#

lightpoint (super low intensity) + lightcone + flare

#

vs

#

lightpoint + lightcone + flare

unkempt marsh
#

Are there any commands that i can use to induce ragdoll physics on MP bodies? i've noticed that if there are dead bodies in MP they don't ragdoll but instead play the default die animation. leaving alot of my decorations ruined.

eternal spruce
#

@fair drum Can i make the light strobe with the module

fair drum
eternal spruce
#

Ok thanks @fair drum. check your DM

fair drum
unkempt marsh
fair drum
# unkempt marsh thanks for the help but i can't get it to work

what is the code you are using, and where are you using it? also, do you mean you are setting the units dead at mission init? if so, you might have to set a specific animation before they die so they die in a certain way. unable to tell without some picture examples of what you want.

granite sky
eternal spruce
#

@fair drum to delete the light created should i just use deleteVehicle in this:

 
call{light = "#lightpoint" createVehicleLocal position ASL_1;  
light setlightcolor [1,1,1];  
light setlightambient [255,255,255];  
light setlightintensity 10;}; 
 
sleep 0.5;

call{light2 = "#lightpoint" createVehicleLocal position ASL_2;  
light2 setlightcolor [1,1,1];  
light2 setlightambient [255,255,255];  
light2 setlightintensity 10;};

sleep 0.5;

call{light3 = "#lightpoint" createVehicleLocal position ASL_3;  
light3 setlightcolor [1,1,1];  
light3 setlightambient [255,255,255];  
light3 setlightintensity 10;};

sleep 0.5;

call{light4 = "#lightpoint" createVehicleLocal position ASL_4;  
light4 setlightcolor [1,1,1];  
light4 setlightambient [255,255,255];  
light4 setlightintensity 10;};

};```
unkempt marsh
# fair drum what is the code you are using, and where are you using it? also, do you mean yo...

pretty much i've got some dead civilians to make a very grim scene. and it's just the slider from the editor set to 0 for health. problem is in MP instead of ragdolling into positions that make them look like they died where they're sitting they play the default death static pose. i tried the init files of the units to set them awake at game start. even tried setting them awake using spawn and then setDamage 1 to see if that would make them ragdoll. but every time they use the same default death pose. i tried the initServer.sqf file too where i put the code "{_x awake true;} forEach allDeadMen;". still did nothing

#

pretty much i've got some dead civilians

spiral canyon
#

I got a set of fuel tanks as targets for a task. What is the code for the trigger so if any one of the tanks is destroyed you complete the task?

#

I know its not && but what is it for a "or" command?

fair drum
#

[tank_0, tank_1, tank_2] findIf {!alive _x} != -1; for any dead
[tank_0, tank_1, tank_2] findIf {alive _x} == -1; for all dead

eternal spruce
spiral canyon
#

might be pointed down instead of up

eternal spruce
#

yes it might but what does this mean _light setLightConePars [90, 45, 1]; for example, its says [outerAngle, innerAngle, fadeCoef] but i don't understand

spiral canyon
#

I believe the outerAngel is where the light fades to, the innerAgle is the bright cone, the fadeCoef is the percentage of how quickly the light fades between the outerAngle and InnerAngle. Did you place the light cones your self?

eternal spruce
#

No I did not. I just create a light source

light setlightcolor [1,1,1];  
light setlightambient [255,255,255];  
light setlightintensity 10;};```
spiral canyon
#

you could try call{light = "#lightpoint" createVehicleLocal position [ASL_1, [-0.5,-0.25,1]]; then play with the numbers which are I believe are the x,y,z coordinates.

eternal spruce
#

I’ll give it a try

bold comet
#

when you guys reach an agreement on the whole pfh vs loop thing, feel free to let us know

#

i'll keep my whiles for now

tulip ridge
graceful stone
#

Hi. I want to use BIS_fnc_scriptedMove but have the issue that sometime Units get stuck and run on place. I wanted to write an exitcondition but I fear there is no way to exit BIS_fnc_scriptedMove when a unit is stuck for example. I tried to put code in the Code parameter which gets executed on each waypoint but there is now way of terminating BIS_fnc_scriptedMove. Any Ideas?

graceful stone
graceful stone
# fleet sand Why cant you use doMove ?

If Units are in combat domove is not working allways...especially with mods Like LambsDanger which do their own domove´s. I need Units to move at all cost.....the only way i found is to use BIS_fnc_scriptedMove.

fleet sand
graceful stone
fleet sand
# graceful stone Yeah I know..this does not help unfortunatly.. I tried that already...but I will...

Here is a nice script from Jonnyboy for CQB movemnt you can open it and see how he did it with makeing units to go to a posision array.
https://forums.bohemia.net/forums/topic/222844-jboy-ai-cqb-movement-scripts/
So what you can do is have a group of units disable Lambs when you want them to do specific movemnt and when they are done re enable lambs.

graceful stone
stable dune
#

Hello,
Way to get true/ false if Zeus is remote control unit x, and if it's,
Way to get unit that Zeus is remote controlling?

humble tundra
#

Without plotted waypoints: when AI is requested to move on a map location with a single click.
Bar gates, are obviouksy considered as obstacles even with a trigger to open them.
Is there a way to tell AI it is safe to move through?

And, in a similar way, what is the best way to restrict AI to move through a location (map bounds, or breaching through walls to connect with a road)?

stable dune
#

Awesome, thanks.

queen cargo
#

@gaunt patio nope

#

@bold comet simple thing:
you got something that NEEDS to be evaluated every frame or all two? --> PFH is your friend
is your evaluation irrelevant and it is totally OK for it to take longer from time to time? --> spawned while loop

more PFHs = less performance per frame thx to the evaluation
whilst the while {true} do {... sleep 1;} loop is handled by the engine --> like 2k times faster

cloud valley
#

_targetPos = [32097.8, 25496.5, -0.0273666];
_missileObject = b;
_missilePos = getPosASL _missileObject;
_dirVector = _targetPos vectorDiff _missilePos; _dirVectorNormalized = _dirVector vectorNormalize;
_missileSpeed = 100;
_missileVelocity = _dirVectorNormalized vectorMultiply _missileSpeed;
_missileObject setVelocity _missileVelocity;

cloud valley
faint burrow
#

There is no such command.

proven charm
#

_dirVector vectorNormalize; -> vectorNormalized _dirVector;

cloud valley
#

this chat GPT hmmyes

#

Hello everyone

#

I'm working on a custom missile object in Arma 3 and I'm having some issues with the scripting. I need help to create a script that allows the missile to be guided towards a target using laser targeting or GPS coordinates.

#

I have tried a few scripts, but they haven't worked as expected. If anyone has experience with missile guidance scripts or knows of any existing scripts that could be adapted to my missile object, I would greatly appreciate your assistance.

#

Thank you!

open hollow
#

dont use chatGPT for sqf

cloud valley
#

you are right friend

cloud valley
open hollow
cloud valley
#

💯 💯

open hollow
#

since you can copy the propieties of tomahawks

cloud valley
#

I created it and brought it into the game and it worked fine

The script of fire, smoke and explosion was introduced into it

The guidance and launch script remained

open hollow
#

use the Tomahawk config then, you can use them to send misiles with laser targets.

to a GPS guided one, just create a laser target and assign the launcher to fire at that target, and thats it

cloud valley
#

Now all that remains is the guidance scriptand adjusting the missile head's direction towards the target.

cloud valley
#

?

tulip ridge
#

Oh that was a really old message

#

None of the other messages after that loaded for me

cloud valley
thin fox
# cloud valley I don't understand how to use it

Maybe, start with this.

this addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];

_projectile setMissileTarget some_target
}];
eternal spruce
#

I'm having trouble stopping a script.

while {true} do {};``` 
I thought change `true` to `false` would solve this, how do you stop the loop
granite sky
#

uh, if you change true to false in that snippet then the loop never runs at all.

#

So I don't know what you're trying to achieve. Need a more concrete example.

tulip ridge
proven charm
granite falcon
#

does anyone know if theres a way to get exile dynamic missions to spawn in editor ??

#

basically for when servers are dead i want a SP scenario with missions that act the way they do on exile servers? also a way to save character progress maybe??

#

ive tried doing it with ravage but i can never load my save

tough abyss
#

Alright so ive been struggeling with trying to add a ACEX arsenal integration. Like multiple different variants of a similar type rifle.

class CfgVehicles {
class Weapon_Base_F {
// Base weapon class
};

class Weapon_Rifle_Base_F {
    // Rifle variant 1
    class TextureVariants {
        camo = "path/to/camo1.rvmat";
        camo1 = "path/to/camo2.rvmat";
        camo2 = "path/to/camo3.rvmat";
    };
};

class Weapon_SMG_Base_F {
    // SMG variant 1
    class TextureVariants {
        camo = "path/to/camo1.rvmat";
        camo1 = "path/to/camo2.rvmat";
        camo2 = "path/to/camo3.rvmat";
    };
};

};

This is the base ive been going off of. Where am i going wrong?

#

hey guys, I have a loop that spawn enemies. I'd like them to walk near a object with the varible name "EnemyObject" but they aren't moving. I figured maybe it's beause its in the loop, but I moved it outside the loop and nothing.
```sqf
waveCount = 1; // Start with one unit
spawnPosition = getPos EnemyBase; // Get the spawn position

[] spawn {
while {true} do {
// Notify the player that a new wave is starting
hint format ["Wave %1 is starting!", waveCount];
systemChat format ["Wave %1 is starting!", waveCount];

// Spawn units for the current wave
for "i" from 1 to waveCount do {
unit = createGroup east createUnit ["O_Soldier_F", spawnPosition, [], 0, "NONE"];
unit move (getMarkerPos "EnemyObject");
};

    // Wait until all OPFOR units are dead before proceeding to the next wave
    waitUntil {({alive unit} count (allUnits select {side unit == east})) == 0};

    // Display "Wave defeated!" message
    hint "Wave defeated!";
    systemChat "Wave defeated!";

    // Increment wave count to spawn one additional unit in the next wave
    waveCount = waveCount + 1;

    // Delay before starting the next wave
    sleep 10;
};

};```

hardy timber
#

Greetings I'm looking forward to create arma 3 scenarios kindly let me know if interested on this project

tender sable
meager granite
#

Somehow Steerable_Parachute_F are killable during gameplay in KotH and what's even more bizzare they keep firing Killed event handler every few seconds until deleted thonk

#

Can't reproduce this at all, but I've seen it happen several times already

fair drum
hardy timber
#

Okay

ornate whale
ornate whale
# meager granite What about it?

I thought I will get some inspiration from it, but it's so huge and without any comments, that it's very difficult to understand the dots between all the functions.

meager granite
#

Yeah, variable names are mostly acronyms, not very readable

#

but otherwise it is alright

ornate whale
#

I am baffled that anyone is even willing to create something so complicated in a single person. 😄 Debugging and testing it must have been a hell. Since the evaluation rate of the AI commanders is in minutes.

meager granite
#

Not sure if there is some debugging stuff left, but the code is indeed will be hell to get back into

#

15 nested ifs are common occurence

#

Okay, can't really call it a mess, considering he's trying to control Arma AI which is already black magic by itself

#

But turning nested ifs into something neater could've helped readability

tulip ridge
# tough abyss Alright so ive been struggeling with trying to add a ACEX arsenal integration. L...

Going to be honest, not even close to correct, but also:

  1. This channel is for scripting, not config. Check out #arma3_config or better, the ACEAX discord, which should be linked on their GitHub
  2. Look at the ACEAX GitHub https://github.com/jetelain/AceArsenalExtended/tree/main?tab=readme-ov-file#sample

Their documentation will help you get it set up, it's not too bad, but can be tedious

GitHub

Find easily your favorite gear within ACE3 Arsenal - jetelain/AceArsenalExtended

austere hawk
#

what's a pfh? (sry, noob)

ivory lake
#

per framehandler

austere hawk
#

ah ok

meager granite
#

fileExists doesn't work with system paths, any way to check if squadParams picture exists?

#

I've seen few cases where squadParams returned path to the picture but when you used it, it errored out with file not found

#

Any ideas how to validate the squad picture before using it? 🤔

lucid junco
#

Im having small trouble to get rid of one thing when using selectPlayer command in SP. Everytime when switching from old player (always squad leader) to another squad member who become new squad leader (and he is "away" - far away) at the point of switch and after, "away" tag new under player icon simply remains there forever . Im not able to get rid of this tag via all sort of related formation/Move/group/etc type of commands even when tried bunch of different timing and sequences. Does anybody came across this issue and best case does anybody know a solution for this?

to reproduce do just:

  1. Place two units in one squad into the map far away from each other where player is squad leader
  2. Use selectPlayer to switch to no.2

You should and up with infinite "away tag" under player icon.

(in picture no.1 was old player = dead. No.2 is new player)

tough abyss
faint burrow
sharp torrent
ornate whale
sharp torrent
eternal spruce
#

Is there an Event Handler that I can trigger right after a unitCapture/Play scheduled event?

sharp torrent
#

affected code fragment:

diag_log result of the to be created:

22:05:42 
["B_soldier_LAT_F",[["arifle_MX_ACO_pointer_F","","acc_pointer_IR","optic_Aco",["30Rnd_65x39_caseless_mag",30],[],""],
["launch_NLAW_F","","","",[],[],""],
["hgun_P07_F","","","",["16Rnd_9x21_Mag",17],[],""],
["U_B_CombatUniform_mcam",[["FirstAidKit",1],["30Rnd_65x39_caseless_mag",2,30]]],
["V_PlateCarrier2_rgr",[["30Rnd_65x39_caseless_mag",3,30],["16Rnd_9x21_Mag",2,17],
["SmokeShell",1,1],["SmokeShellGreen",1,1],["Chemlight_green",2,1]]],["B_AssaultPack_rgr_LAT",[["NLAW_F",2,1]]],
"H_HelmetB_sand","G_Tactical_Clear",[],["ItemMap","","ItemRadio","ItemCompass","ItemWatch","NVGoggles"]]]

Error:

22:05:42 soldier[B_soldier_LAT_F]:Some of magazines weren't stored in soldier Vest or Uniform?

Problem is that everything is inside inventory, nothing is full. Unit not modified straight from the editor.
Ace - error shown with and without it.

fair drum
#

so essentially, you make your own handler from it.

blissful current
#

So I'm trying to learn the KBTell Conversation system. Nothing happens when I enter the trigger area, does this formatting look correct?
Marcinko kbTell [player, "Intro1", "StagingArea"];

fair drum
#

did you add the topic first?

blissful current
#

Topic is in a .bikb. And it is defined in description.ext, like on the wiki page.

winter rose
#

You need to use kbAddTopic on both units, too

fair drum
#

which is why the functions are better to use as they do it all for you (imo)

blissful current
blissful current
winter rose
blissful current
fair drum
#

you can choose a starting sentence and ending sentence, thats how you pull out single lines

#
[true, true] call HYP_fnc_disableACEVolumeUpdate;
private _speech = ["intro", "IFA_UK_DES_M01", ["intro_1", "intro_1"], "SIDE"] spawn BIS_fnc_kbTell;
waitUntil {scriptDone _speech};
//stuff
[true, true] call HYP_fnc_disableACEVolumeUpdate;
private _speech = ["intro", "IFA_UK_DES_M01", ["intro_2", "intro_4"], "SIDE"] spawn BIS_fnc_kbTell;
waitUntil {scriptDone _speech};
winter rose
blissful current
blissful current
fair drum
#

its the radio mode. I'm forcing over side channel

fair drum
winter rose
blissful current
#

Ahh so that would go in the on activation field of the trigger then?

fair drum
#

better to keep it external and execute that script from the trigger instead

winter rose
#

ideally in a sqf file you then call from the server's init (for intro)

blissful current
#

I guess that's because the server will keep all the audio in sync for the clients?

fair drum
#

you'll run into more problems due to JIP if you do it that way. server can load faster than clients, and even the first client can miss the intro (on dedi)

#

its partially why I created the multiplayer sync module (it sort of runs like a unscheduled version of APEX campaign's intro sync)

blissful current
celest plover
#

are players counted in _Units

fair drum
# blissful current Why does yours says spawn but the wiki example says call?

it really should be changed as internally, its making itself scheduled when you call it:

// BIS_fnc_kbTell
// This script needs to run on scheduled env, so make sure we can suspend
// Otherwise spawn function
if (!canSuspend) exitWith
{
    _this spawn BIS_fnc_kbTell;
};

but if you call it, you lose the ability to grab the scripts handle so you can check if it is done later. So you should always spawn it IMO.

fair drum
buoyant cairn
#

guys, im sorry to ask it here, but is there any tutorial videos on how to begin modding? like a step by step?

fair drum
buoyant cairn
#

im just extremely confused on how to make it work

#

i tried to change a few bits on open source mods

#

just to learn

fair drum
#

if you tell me what you want to do, I can point you in the right direction

buoyant cairn
#

but always gives me a error like not finding the init.

buoyant cairn
tough abyss
buoyant cairn
#

everytime i start it, it says that the preinit.sqf is not found

#

maybe im building it wrong

#

or just missing something

fair drum
#

you kind of have to know how CBA works in order to do that

buoyant cairn
#

cba framework?

fair drum
#

and use HEMTT to pack it

tough abyss
#

Hey guys, this move function isn't working, and the variable name is correct? Is it an issue that it is inside the loop? I moved it outside the loop and no change```sqf
waveCount = 1; // Start with one unit
spawnPosition = getPos EnemyBase; // Get the spawn position

[] spawn {
while {true} do {
// Notify the player that a new wave is starting
hint format ["Wave %1 is starting!", waveCount];
systemChat format ["Wave %1 is starting!", waveCount];

    // Spawn units for the current wave
    for "i" from 1 to waveCount do {
        unit = createGroup east createUnit ["O_Soldier_F", spawnPosition, [], 0, "NONE"];
        unit move (getMarkerPos "EnemyObject");
    };

    // Wait until all OPFOR units are dead before proceeding to the next wave
    waitUntil {({alive unit} count (allUnits select {side unit == east})) == 0};

    // Display "Wave defeated!" message
    hint "Wave defeated!";
    systemChat "Wave defeated!";

    // Increment wave count to spawn one additional unit in the next wave
    waveCount = waveCount + 1;

    // Delay before starting the next wave
    sleep 10;
};

};```

fair drum
buoyant cairn
#

that is very interesting

#

how do i know if a mod is using such framework?

fair drum
tough abyss
#

also if I wanted to modify the asset list of warlords that's done by creating a "description.ext"?

tender sable
fair drum
#

@buoyant cairn now, they could just be doing their own preInit.sqf but you are trying to modify something without know how to to start, i would try to build your own mod first to learn the systems

tough abyss
buoyant cairn
fair drum
buoyant cairn
#

i guess i could start with a simple inf ammo and damage mult?

tender sable
fair drum
buoyant cairn
fair drum
tough abyss
#

bro, big brain

#

thank you.

buoyant cairn
#

maybe something that could work only for my player?

fair drum
blissful current
# fair drum ```sqf [true, true] call HYP_fnc_disableACEVolumeUpdate; private _speech = ["int...

Is it possible to use this for multiplayer? I've adapted your example for my mission. When a player enters the trigger area the NPC talks to the player. That all works.

Where I'm getting caught up is the players can ask this NPC questions with addActions. But I get an error saying I can't use player. I can't use a variable name for the actor because I won't know which player is actually asking the question.

class Question1 { text = "Could this be a trap?"; speech[] = { "\Sound\question1.ogg" }; class Arguments {}; actor = "player"; };

buoyant cairn
#

mind if i come ask for help if i have any questions?

fair drum
buoyant cairn
#

i appreciate the help

#

thanks

fair drum
#

give it a speaker that the game knows, then override it later

celest plover
#

ALso, would an edited SQF file only need to be server side?

#

for it to work

tough abyss
#

also any reason why everything seemly moves on a grid instead of free moving?

#

like i used to not have to use the wegits to move and rotate the objects and now I cant?

fair drum
tender sable
buoyant cairn
#

@fair drum if (localplayer) then
{
addEventHandler ["fired",{(_this select 0) setVehicleAmmo 1}]
}

#

like this?

#

i did it on the notepad ++

blissful current
fair drum
fair drum
fair drum
# buoyant cairn where exactly?

you need an object for the event handler:

player addEventHandler ["Fired", {
    // something
}]

and you should probalby do FiredMan instead of Fired.

buoyant cairn
#

ooooh

#

makes sense

#

do i need to set the "if (player) then" ?

#

or just call for the event handler by itself?

fair drum
#

no, because even if you run it globally, player points to the local player itself. If it is run on the dedi server, player is undefined and won't run anyways and is skipped

buoyant cairn
fair drum
#

if it is in init.sqf, then your machine will run it, and point to you, and his machine will run it and point to him.

buoyant cairn
#

where can i find this init.sqf?

#

i've seen some mentions about it before

fair drum
#

you make it. you put it in the mission folder along side the mission.sqm the game makes

buoyant cairn
#

and it will run on any missions?

fair drum
#

that specific mission

buoyant cairn
#

got it

fair drum
#

if you want it on any mission, then you will have to make a mod

buoyant cairn
#

okay okay

#

first let me begin with my own lan host server

#

then ill reach that point

#

i have to go step by step

#

just this? @fair drum

fair drum
#

try it and see if it gives you the results you want.

buoyant cairn
#

okay

#

do i need to place the file somewhere?

fair drum
#

in the mission folder, next to the mission.sqm that the game makes

buoyant cairn
#

okay

#

let me test it out

#

i can't find it anywhere

fair drum
#

did you make a mission?

open hollow
#

hello, there is a way to make the ai dont able to open doors?

fair drum
open hollow
#

yea... lets asume that problem dont happen lol

buoyant cairn
fair drum
buoyant cairn
#

yeah, found the pbo in dcuments folder

fair drum
#

so unpack it, and you'll find their init.sqf already in there, just ammend your stuff at the end of it.

buoyant cairn
#

then repack it?

#

also, i have no idea on how to use this hemtt thing @fair drum

#

downloaded it with winget

fair drum
#

that's for making mods which you are not doing atm

buoyant cairn
#

but i need to unpack the mission.pbo

#

right?

fair drum
#

use pbomanager or something for that

buoyant cairn
#

okay

#

nothing :/

#

unpacked it, placed the code line in the init.sqf

#

packed again and nothing lol

fair drum
#

so you need to learn debugging techniques. see if it is be added. maybe its not giving you the results because you need to use a different way, etc, etc. start using diag_log or systemChat or whatever to track things.

buoyant cairn
#

made it work!! @fair drum

#

now, is there any scripts like this one to remove the bullet drop or something?

fair drum
tough abyss
#

So I have this ```sqf
[] spawn {
while {true} do {
// Notify the player that a new wave is starting
hint format ["Wave %1 is starting!", waveCount];
systemChat format ["Wave %1 is starting!", waveCount];
sleep 15;
// Spawn units for the current wave
for "i" from 1 to waveCount do {
unit = createGroup east createUnit ["O_Soldier_F", spawnPosition, [], 0, "NONE"];
unit move (getPosASL EnemyObject);
};

    // Wait until all OPFOR units are dead before proceeding to the next wave
    waitUntil {({alive unit} count (allUnits select {side unit == east})) == 0};

abd I am trying to creat the group outside the loop so I can add other units to it. I am looking t the docs and it says I shoulsqf
EnemyGroup = creategroup east;
[] spawn {
while {true} do {
// Notify the player that a new wave is starting
hint format ["Wave %1 is starting!", waveCount];
systemChat format ["Wave %1 is starting!", waveCount];
sleep 15;
// Spawn units for the current wave
for "i" from 1 to waveCount do {
unit = createUnit ["O_Soldier_F", spawnPosition, [], 0, "NONE"];
unit move (getPosASL EnemyObject);
???
};

    // Wait until all OPFOR units are dead before proceeding to the next wave
    waitUntil {({alive unit} count (allUnits select {side unit == east})) == 0};
fair drum
#
waitUntil { units east findIf {alive _x} == -1 };
tough abyss
#

okay so we are waiting to find -1 alive?

fair drum
#

findIf goes through an entire array and returns the index of the first thing that meets the condition AND STOPS THERE

#

its useful for large arrays for performance

tough abyss
#

and that will add to the group?

#

what arry is it indexing?

#
EnemyGroup = creategroup east; 
[] spawn {
    while {true} do {
        // Notify the player that a new wave is starting
        hint format ["Wave %1 is starting!", waveCount];
        systemChat format ["Wave %1 is starting!", waveCount];
        sleep 15;
        // Spawn units for the current wave
        for "i" from 1 to waveCount do {
            unit = EnemyGroup createUnit ["O_Soldier_F", spawnPosition, [], 0, "NONE"];
            unit move (getPosASL EnemyObject);
        };

        // Wait until all OPFOR units are dead before proceeding to the next wave
        waitUntil {({alive unit} count (allUnits select {side unit == east})) == 0};```???
meager granite
#

move takes ATL position, not ASL

#

But I assume this was written by ChatGPT originally

tough abyss
#

Yes it works just fine without those corrections

#

and actually the ASL is recommened by someone on here the other day

meager granite
#

I never ever itrated to a global variable and wasn't even sure its possible 🤔

tough abyss
#

idk im just a noob

meager granite
#

which is shorter version of your allUnits select {side unit == east}

#

and faster too (though in this context its a drop in an ocean)

tough abyss
#

ah I see what you mean, thank you for the help guys

haughty sand
#

@young current can you help me write the time multiplier to stop the time im still a little new to this

young current
#

find its wikipage in the list I gave you earlier. it has examples.

#

I dont have time to get into it more deeply than this

haughty sand
young current
#

sounds correct yes

#

I recall it says whats the smallest it can go

#

use that

haughty sand
#

got it! thankyou

tough abyss
#

I wanted to add a truck spawning in every 5th wave (wave 5 has one truck, wave 10 two has two trucks) I figuered if a soldier is add like this on wave one then should be the same for adding wave 5? but it is not```sqf
[] spawn {
while {true} do {
// Notify the player that a new wave is starting
hint format ["Wave %1 start!", waveCount];
systemChat format ["Wave %1 start!", waveCount];
sleep 15;
// Spawn units for the current wave
for "i" from 1 to waveCount do {
unit = enemyGroup createUnit ["O_Soldier_F", spawnPosition, [], 0, "NONE"];
unit move (getPosASL EnemyObject);
};

    for "i" from 5 to waveCount do {
        truck1 = enemyGroup createUnit ["O_G_Offroad_01_armed_F", spawnPosition, [], 0, "NONE"];
        truck1 move (getPosASL EnemyObject);
    };```
meager granite
#

Vehicles aren't units, you need createVehicle

tough abyss
#

oh duh

#

appreciate that

meager granite
#

Try

if(waveCount % 5 == 0) then {
    for "_i" from 1 to floor(waveCount / 5) do {
        veh = createVehicle ...
        enemyGroup createVehicleCrew veh;
    };
};
tough abyss
#

oh dividing the wave by 5?

meager granite
#

oh wait this will create the truck each wave

tough abyss
#

can i do like python wear I can divid by 5 and get a remainder , if it equals 0 spawn truck?

meager granite
#

Fixed

#

Yeah, pretty much the same

#

add some position randomization for the vehicle so they dont spawn inside each other and blow up

#

check docs for createVehicle command

tough abyss
#

great idea

meager granite
#

alt syntax

#

also you might need move command for the truck too

haughty sand
#

does anyone know how to get cars to run into eachother full speed in editor? im trying to make a scenario where someone comes across the street cause both sides of cars to ram eachother. anytime i set waypoints they just come to the middle, slow down, then stop

meager granite
#

I'd start with disabling AI for units at some point and they applying setVelocity for some time