#arma3_scripting

1 messages ยท Page 205 of 1

pallid palm
#

hello all: if i use createMarkerLocal does that mean the marker will be created on the server and all connected clients can see this marker

#

what the diff in createMarkerLocal createMarker

warm hedge
pallid palm
#

so if im a hosted server then that would mean all clients would see this marker is that correct

warm hedge
#

No

pallid palm
#

oh

#

oh hmmm ok

warm hedge
#

the marker only exists on the machine that created it
Means there is no networking about it

#

It is literally the point of createMarkerLocal being local

#

Same to other marker commands

pallid palm
#

i see ok thx m8

foggy pike
#

Yeah I started writing something similar. How did you get the ordering to go properly since using allGroups just has random ordering to each group. I've got atm a while loop and it basically has a current index it's working on and only when no other groups with the same index are left it moves up to the next index

indigo snow
#

i read the missionconfigfile

#

not allgroups

foggy pike
#

Ahh okay

indigo snow
#

grab the units in a group entity, grab the first one that exists, use that group

#

slightly JIP incompatible

split ruin
#

does this function save the "probability of presence" of objects?

BIS_fnc_objectsGrabber
foggy pike
#

Is there any BIS missions that are a good example of their ORBAT system?

indigo snow
#

some campaign missions

primal trench
#

Can I put event scripts (onPlayerRespawn.sqf) in a mod and have it affect every mission that's run with the mod loaded?

tulip ridge
#

Example using CBA's extended event handlers (this would just go in the config root):

class Extended_Respawn_EventHandlers {
    class CAManBase {
        class YourPrefix_yourAddon {
            respawn = "call YourPrefix_fnc_handleRespawn";
        };
    };
};
primal trench
#

Ok thanks. I'll have to look into the extended event handlers

tulip ridge
fair drum
# primal trench Can I put event scripts (`onPlayerRespawn.sqf`) in a mod and have it affect ever...

To expand on this, this is what preInit.sqf and postInit.sqf are for in CBA as well as the preInit and postInit tags in CfgFunctions.

https://community.bistudio.com/wiki/Arma_3:_Functions_Library#Attributes_3

the preInit attribute (formerly known as "forced") can be set to 1 to call the function upon mission start, before objects are initialized.

the postInit attribute can be set to 1 to call the function upon mission start, after objects are initialized.

the preStart attribute can be set to 1 to call the function upon game start, before title screen, but after all addons are loaded.

delicate hedge
#

how to make it work

#

just creating ppeffect and commiting it dont work

foggy pike
#

I'm looking at this ORBAT stuff and it's really cool, but the whole idea of having a tree view of the team is that you can see who is leading and stuff but there isn't a way to define player names in the class right?

split ruin
#

doesn't show any hint ... ๐Ÿคท

['tsk','SUCCEEDED', true] call BIS_fnc_taskSetState;
hallow mortar
#

Are you sure the task name is correct?

indigo snow
#

no but you can define their units

#

~

#

i dont think my thing exactly fits your solution

split ruin
#

yes its "tsk"

foggy pike
#

I mean the BIS orbat thing

indigo snow
#

yea thats static

foggy pike
#

That sucks

#

Okay I'll do the naming thingy then

primal trench
#

I'm seeing a lot of _this select 0 and so on in the examples

tulip ridge
#

It's the same, it's just passed as an array
I think vanilla has some cases where it's just the value

torn harbor
#
if (!isNil "remoteExecutedOwner" && { clientOwner != remoteExecutedOwner }) exitWith {};

that line of code at the top of my module script should ensure that the module only runs once and it will only run for the person who placed the module correct

torn harbor
#

but why though why would that fail

right now the its still passing and running globally I just need to be able to have the module run for the one person who placed it is all

granite sky
#

isNil "remoteExecutedOwner" checks whether the value of the variable remoteExecutedOwner in missionNamespace is nil.

#

This is unrelated to the remoteExecutedOwner command.

#

Most likely you don't have a variable remoteExecutedOwner in missionNamespace, so the exitWith won't be taken.

#

commands are not variables. Even commands with no parameters (nular commands).

torn harbor
#

alright so then in order for that to work I should do something like

private _reo = remoteExecutedOwner;
if (!isNil _reo && { clientOwner != _reo}) exitWith {};

granite sky
#

It's never nil.

torn harbor
#

so just drop that then

#

and should work how I am intending it to

finite bone
#

Cant you add an event handler with condition of checking the unit model to that of AAF?

finite bone
#
addMissionEventHandler ["EntityCreated", {
    params ["_entity"];
    private _classnames = [
        "I_TargetSoldier", "I_soldier_F", "I_Soldier_lite_F", "I_Soldier_A_F", 
        "I_Soldier_GL_F", "I_Soldier_AR_F", "I_Soldier_SL_F", "I_Soldier_TL_F", 
        "I_Soldier_M_F", "I_Soldier_LAT_F", "I_Soldier_AT_F", "I_Soldier_AA_F", 
        "I_medic_F", "I_Soldier_repair_F", "I_Soldier_exp_F", "I_engineer_F", 
        "I_crew_F", "I_helipilot_F", "I_pilot_F", "I_helicrew_F", "I_officer_F", 
        "I_Story_Colonel_F", "I_soldier_UAV_F", "I_Soldier_universal_F", 
        "I_Survivor_F", "I_Soldier_unarmed_F", "I_diver_F", "I_diver_exp_F", 
        "I_diver_TL_F", "I_Spotter_F", "I_Sniper_F", "I_Soldier_AAR_F", 
        "I_Soldier_AAT_F", "I_Soldier_AAA_F", "I_support_MG_F", "I_support_GMG_F", 
        "I_support_Mort_F", "I_support_AMG_F", "I_support_AMort_F", "I_Soldier_VR_F", 
        "I_Protagonist_VR_F", "I_ghillie_lsh_F", "I_ghillie_sard_F", "I_ghillie_ard_F", 
        "I_Captain_Hladas_F", "I_UAV_AI", "I_UAV_AI_F", "I_Fighter_Pilot_F", 
        "I_soldier_UAV_06_F", "I_soldier_UAV_06_medical_F", "I_soldier_mine_F", 
        "I_Story_Officer_01_F", "I_Soldier_LAT2_F", "I_Story_Crew_F", 
        "I_Officer_Parade_F", "I_Officer_Parade_Veteran_F", "I_E_Uniform_01_F", 
        "I_E_Uniform_01_tanktop_F", "I_E_Uniform_01_shortsleeve_F", 
        "I_E_Uniform_01_officer_F", "I_E_Uniform_01_sweater_F", 
        "I_E_Uniform_01_coveralls_F", "I_HMG_01_F", "I_HMG_01_high_F", 
        "I_HMG_01_A_F", "I_GMG_01_F", "I_GMG_01_high_F", "I_GMG_01_A_F", 
        "I_HMG_02_F", "I_HMG_02_high_F", "I_Mortar_01_F", "I_static_AA_F", 
        "I_static_AT_F", "I_Heli_Transport_02_F", "I_Parachute_02_F", 
        "I_Plane_Fighter_03_CAS_F", "I_Plane_Fighter_03_AA_F", 
        "I_Plane_Fighter_03_dynamicLoadout_F", "I_Heli_light_03_F", 
        "I_Heli_light_03_dynamicLoadout_F", "I_Heli_light_03_unarmed_F", 
        "I_Plane_Fighter_04_F", "I_Ejection_Seat_Plane_Fighter_04_F", 
        "I_Plane_Fighter_03_Cluster_F", "I_Plane_Fighter_04_Cluster_F", 
        "I_UAV_06_F", "I_UAV_06_medical_F", "I_Quadbike_01_F", "I_MRAP_03_F", 
        "I_MRAP_03_hmg_F", "I_MRAP_03_gmg_F", "I_Truck_02_covered_F", 
        "I_Truck_02_transport_F", "I_Truck_02_ammo_F", "I_Truck_02_box_F", 
        "I_Truck_02_medical_F", "I_Truck_02_fuel_F", "I_Truck_02_MRL_F", 
        "I_APC_tracked_03_cannon_F", "I_MBT_03_cannon_F", 
        "I_APC_Wheeled_03_cannon_F", "I_LT_01_AT_F", "I_LT_01_scout_F", 
        "I_LT_01_AA_F", "I_LT_01_cannon_F", "I_Boat_Armed_01_minigun_F", 
        "I_Boat_Transport_01_F", "I_SDV_01_F", "I_UAV_01_F", "I_UAV_02_F", 
        "I_UAV_02_CAS_F", "I_UAV_02_dynamicLoadout_F", "I_UGV_01_F", 
        "I_UGV_01_rcws_F", "I_UGV_02_Science_F", "I_UGV_02_Demining_F"
    ];

    if (typeOf _entity in _classnames) then {
        _entity joinSilent createGroup west;
    };
}];```
#

(next time just @ me to respond quicker lmao)

hallow mortar
# finite bone ```sqf addMissionEventHandler ["EntityCreated", { params ["_entity"]; pr...
  • I wouldn't recommend checking for actual vehicle types, they can't join groups
  • checking for unit types that exist solely to support uniforms and will not actually be spawned is pointless
  • rather than prescribing specific classnames, you could use isKindOf and just check if they inherit from the base AAF unit that all AAF units inherit from
  • you could also check for the unit's faction
finite bone
#

true i just typed this from mobile

#

Don't copy paste my code exact, as NikkoJT stated above, you are better off using isKindOf in lieu of typeOf - That way you dont need to use classnames exclusively.

hallow mortar
#

It might also be better to handle full groups together, rather than units, otherwise you'll end up with a lot of single-unit groups

finite bone
#

Yea my haphazard implementation is just for a PoC/Idea. There are more optimized way of doing this. As for where to put it, @burnt matrix, you place them in the init field in the mission file (or just create an init.sqf and place it in the mission foldeR)

hallow mortar
#

Something like this shouldโ„ข do it:

addMissionEventHandler ["GroupCreated", {
  params ["_group"];
  if !(local _group) exitWith {};
  if (side _group != independent) exitWith {};
  private _newGroup = createGroup west;
  _group setVariable ["jax_switchedGroup", _newGroup, true];
  _group addEventHandler ["UnitJoined", {
    params ["_group", "_newUnit"];
    if (faction _newUnit == "ind_f") then {
      _newUnit joinSilent (_group getVariable ["jax_switchedGroup", _group]);
    };
  }];
}];```
โ›ณ
hollow lintel
#

is there a script for d-day type pillbox fire because im doing "shooter suppressFor 100;
shooter doSuppressiveFire player;" on an enemy unit and its not giving me the results i like

warped thicket
#

@tranquil nymph there is a PR open to ACE for automatic AI to HC transferring, includes HC detection, it's pretty straightforward

foggy pike
#

Link @warped thicket ?

warped thicket
#

basically just using postInit with isServer/hasInterface checks

warm hedge
#

What do you really mean by the results you do like

#

And what is the current result

warped thicket
#

on HC it will notify all other machines that an HC has joined

#

in ACE that event simply adds it to the connected HCs array which is then used for AI passing

foggy pike
#

Does it copy things like init fields, waypoints etc.?

warped thicket
#

it's using setGroupOwner, so yes

#

that command was designed to be HC compatible

foggy pike
#

Really?! Is it new?

warped thicket
#

there are edge cases like support modules not functioning after move, but I added a blacklist variable that can be used on the group using that

#

no it's not new

#

from 1.40

#

there have been some scripts poking around using it for some time now, but they were all in one giant loop

#

I decided to make it fully event-based, nothing runs in a constant loop anymore

foggy pike
#

Hmm how come I haven't seen this before. Our group uses WerthlesHeadlessKit atm, is this PR a better solution do you think?

warped thicket
#

I am not sure what all WHK does

foggy pike
#

Oh sorry, just read your message, it is. WHK is loop based

hollow lintel
warped thicket
#

basically if nothing spawns, rebalancing of AI won't happen at all

#

it only does it on spawn of a unit (or player connect because at that point isPlayer check doesn't appear to work, not sure why exactly though), and even then there is a minimal delay you can specify

#

default 15s I think

foggy pike
#

So say for example I place units in the editor and the mission plays on the server, then a zeus joins and places units, it all goes to HC as soon as those units spawn?

warped thicket
#

after minimal delay yes

foggy pike
#

Awesome

warped thicket
#

delay is there because you never spawn all units at once

#

so you spawn one here, one there... etc, it makes sure everything stays in sync and no lag happens

warm hedge
#

Are you saying you want them to fire some MGs constantly and hrash, not burst?

foggy pike
#

I'm a bit of a newb when it comes to ACE, but do I just merge this PR with our version of ACE and it does the rest of is there some more configuration to be done?

warped thicket
#

you should be able to merge it if you want yeah, you'd have to rebuild the mod

#

milestone is set for 3.5.0 currently so I guess it'll be released with 3.5.0 ๐Ÿ˜›

foggy pike
#

Damn I can't wait that long

warped thicket
#

heh

#

just remove all PBOs except main and headless

#

it's identical to the ACE PR actually

#

just under different namespace

foggy pike
#

Is it only required server side?

#

/HC

warped thicket
#

no

#

because Zeus

foggy pike
#

Ah yeha

warped thicket
#

Zeus spawns units locally, and event handler for spawn is local to the machine

foggy pike
#

Okay that makes sense

#

Awesome, downloading it now

warped thicket
#

hopefully it works, we've only tested it on one session so far

#

with logging enabled, and the only problem is that it also does rebalance on player connects, isPlayer is failing for some reason

foggy pike
#

Well it's certainly miles better than our current HC support

#

We've had sooo many problems with UPSMON breaking

warped thicket
#

I wrote it just because I wanted 0 performance impact for AI transferring and because I had too much time ๐Ÿ˜›

#

AI scripts may still break with this one

#

it's totally up to how the script works

pallid palm
#

Hello All: i'm still not sure: if i place a marker in the editer: and Host server the mission, would all clients see the marker

foggy pike
#

Well the problem we had was the minute HC took control, any init field stuff was lost

warm hedge
#

Yes

pallid palm
#

oh nice Awsome

#

thax so much @warm hedge

warped thicket
#

did it recreate the unit?

foggy pike
#

Not sure

warped thicket
#

don't know, setGroupOwner hasn't failed me so far

foggy pike
#

Yeah I don't even think WHK uses it, seems like it's all manual

#

Anyway, thanks tons dude, this has/will change a lot for us!

warped thicket
#

I haven't looked that closely at other scripts to know, all I saw is a constant loop

#

have fun, make sure to report bugs ๐Ÿ˜›

foggy pike
#

Will do ๐Ÿ˜ƒ

warped thicket
#

๐Ÿ‘

warm hedge
# hollow lintel yes

You actually need to script it. Let's say using while command and BIS_fnc_fire function to force them fire every once in a while (0.02 ish seconds)

hollow lintel
warm hedge
#

I don't think that's a useful command in this context

fossil hamlet
#

@foggy pike Thank you for asking all the right questions tonight. I've been looking at the exact same things for our group, but luckily you beat me to the punch, when it came to asking questions here. So just being away for a couple of hours, and coming back to see all this info, it's sweet. Naturally @warped thicket and @cptnnick deserve credit too, for providing good answers and feedback ๐Ÿ˜ƒ

split ruin
#

I want to save score to every player profile but no luck ... ๐Ÿ˜”

//initPlayerLocal.sqf
private _pScore = profileNamespace getVariable "KIB_PlayerScore";
[_pScore] remoteExec ["addScore",2];
//initPlayerLocal.sqf
sleep 60;
while {true} do
{
    private _pScore = (getPlayerScores player) select 5;
    profileNamespace setVariable ["KIB_PlayerScore", _pScore];
    sleep 120;
};

maybe I have to spawn the loop? ๐Ÿค”

hallow mortar
#
  • Actually this is guaranteed to fail because the syntax for addScore is wrong
split ruin
#
_pScore remoteExec ["addScore",2];

??? as far as I know it should be executed on server

#

and first session fail is normal as it is defined later, some player score added and then the second session it will load from profileNamespace, right?

fair furnace
#

does anyoneknow what respawn template "TicketsSpawn" does

#

does it remove tickets on respawn

#

instead of on death

hallow mortar
hallow mortar
split ruin
#

@hallow mortar oh, I see my mistake should be, right?

[player, _pScore] remoteExec ["addScore",2];
stable dune
#

Yes. That looks correct.

last cave
#

I am making a structured text editor. And I need to get the cursor position in the current text and also get the range of the selected text. We don't have any commands for this? I searched in CT_EDIT and through other pages on BIKI but I still didn't find anything useful.

I also want to add buttons to add all kinds of markup text and place them at the cursor position or if a range is selected then the markup will wrap around that text.

#

Ok i find command for this...... how i miss this no know....
ctrlTextSelection

pallid palm
#

Manage respawn tickets used by Tickets respawn template.
When player dies, number of tickets is decreased by 1

fair furnace
#

that isn't what I asked but I figured it out

pallid palm
#

ok

fair furnace
#

I was asking how that specific template worked

#

and if it removed the ticket AFTER the player respawns, instead of before

#

which it infact, does; it's just NOT written on the wiki

#

for some reason

pallid palm
#

ok what ever you say m8

fair furnace
#

???

pallid palm
#

yeah ok its all good

tough abyss
#

Can someone point me a wiki or tutorial for the variables to create weather changes? I am sure I can get started after familiarizing with the basics of how it works.

tough abyss
thin fox
split ruin
#

how to get the unit using a radio trigger ? ๐Ÿค”

thin fox
split ruin
#

I already achieved it, I wanted a radio trigger to be activated only by certain player

//radio trigger condition
this && ((str player) == "lynx1")
//player unit is called lynx1
radiant lark
#

I wanna make a nice little admin tool for my admins, for this, I am getting inspiration from cheats because I like the visualization on cheats.
I wanna make BOX ESP, (Bounding Box Outline wallhacks) don't ask me why, I just want to.

Would drawIcon3D run faster than drawLine3D 4 lines around the player's bounding box?

alpine hamlet
#

Is there a way to control weapon resting/deploy for AI via script? I would like to create a script to order an MG gunner to deploy/rest itโ€™s weapon (with bipod) on the nearest object (and stay there to provide suppressing fire)

fair drum
#

No need for 4 different icons

pallid palm
#

@split ruin

#
//script Activated by a radio trigger
// [] execVM allowedPlayer.sqf
private _allowedPlayers = [lynx1, lynx2]; 

if (player in _allowedPlayers) then 
{
   //==========================================
};
fair drum
spare depot
#

How would I, theoretically, display a countdown to all players in a server leading up to a certain trigger firing?

#

Since I want to create a scenario with a time limit before a certain action occurs

tulip ridge
#

Could use a hint(Silent) in a loop for something basic, if you want it to look nicer you can use a custom display (you can use some vanilla displays, I don't have the names on hand though)

#

Really basic example:

YourPrefix_timeRemaining = 30;
[{
    params ["_args", "_handle"];
    if (YourPrefix_timeRemaining == 0) exitWith {
        hintSilent "Times up";
        _handle call CBA_fnc_removePerFrameHandler;
    };
    hintSilent format ["%1 seconds left", YourPrefix_timeRemaining];
    YourPrefix_timeRemaining = YourPrefix_timeRemaining - 1;
}, [], 1] call CBA_fnc_addPerFrameHandler;

If you're on a vanilla server you can use a scheduled (spawn) while loop instead, but you'll get inconsistent timings with it

#

(Wrote that on mobile, should be mostly fine though)

thin fox
tulip ridge
#

Well there ya go

#

Figured there was something in vanilla

spare depot
#

Sweet! Thank you both, I'll try it out when I get home ๐Ÿซก

radiant lark
#

Will try 2day

atomic niche
# radiant lark Will try 2day

Also keep in mind players can switch stances, so you'll have to account for different player heights/widths as well :D

radiant lark
#

Is that on the bounding box?

atomic niche
#

it shouldโ„ข
idk mine doesn't use boundingBox

radiant lark
atomic niche
#

Can't remember, it was a long time ago

radiant lark
#

Multiple ways to do it but W2S right?

#

W2S will be laggy as hell right?

#

World To Screen

hallow mortar
#

You can also use selectionPosition to find out where the head and feet are and draw appropriately. Best method depends on your specific implementation though

ancient gull
#

Hello, how can I extract all the class names from a specific category, for example vests, sights, silencers, backpacks, etc.?

meager granite
ancient gull
meager granite
#

No its just to get type for single classname

#

If you want to scan entire config you'll need something like configClasses command

real tartan
#

anybody got suggestions on reliable convoy script ?

radiant lark
#

Just get feet position and sum a fixed amount of meters to it for width & height

#

I guess getPos already returns feet position on a player?

hallow mortar
#

Also, use getPosASL or getPosATL, they're faster than getPos.

#

*actually, modelToWorldVisual is recommended for drawIcon3D

radiant lark
#

Shit aight

#

drawIcon3D won't draw thru the map it seems like, so I guess I kinda have to draw it in front of my player for it to show

split ruin
proud dome
#

Is there any AnimDone like event for vehicles rather than units? I'm looking to enable/disable sensors based on a vehicles animation sources

split ruin
#

desperately trying to save player score in profielNamespace ๐Ÿ˜ตโ€๐Ÿ’ซ

player addEventHandler ["HandleScore", {
    params ["_unit", "_object", "_score"];
    profileNamespace setVariable ["KIB_PlayerScore", _score];
}];

this is not working ...

granite sky
#

Unless it's SP or solo localhost then it won't. The documentation specifies that HandleScore only fires on the server.

blissful current
#

I have an issue that just started today. If I alt+tab and go to the launcher to open another client (for MP testing), it will close my first session, then launch the new one, effectively preventing me from having two ARMA apps open at once. Has this happened to anyone?

split ruin
#

@granite sky but his event handler must be applied every time after respawn, how to do it in initServer.sqf ?

granite sky
#

Probably easiest to just remoteExec it back to the server.

#

Tracking players from the server side sucks.

#

That one looks like particularly dumb design. If you care about the score of one unit then you likely care about most or all of them, so a mission event handler would have made more sense.

hallow mortar
granite sky
#

Given that it's a server EH rather than a local one, it could well be non-persistent.

#

It looks like an extremely stupid EH though, so who knows :P

hallow mortar
split ruin
#

yeah but does exactly what I need ๐Ÿ™‚

#

I mean it theory ๐Ÿ™‚

tender fossil
blissful current
tough abyss
#

How would I script a trigger in the editor to display a short message in the vanilla notification UI?

#

I would need the trigger to be repeatable, and for the message to go to the detected player, not server wide.

thin fox
hallow mortar
#

Have you tried restarting the server...again?

tough abyss
tough abyss
#

I am not sure exactly what I am looking for. I need the message to display in the black box with white text (appears to the right of the player screen). Basically a simple hint system using the default UI.

thorn saffron
#

@tough abyss That's hint and hintSilent

#

systemchat puts text in chat window. Useful for debugging as you can se multiple previous lines, while the hint will replace the old message with new one.
Note that hint window takes sometime to fade off.

tough abyss
thorn saffron
#

No, as far as I know, the hint has a set fade off time, with is very long. Other mods like ACE have their own custom hint system, basically a custom dialogue, that gives them more control.

thin fox
#

[] spawn {hint "something"; sleep 3; hint ""}

#

just careful with scheduler, it can overwrite other hint

tough abyss
#

I have only been scripting for a little while so bear with me, lol. In your example line is the second hint ""} what closes that?

tough abyss
#

perfect

thin fox
tough abyss
thin fox
tough abyss
#

Ok I finally get it, and what @thorn saffron was trying to say. I need to explain steps of things, or lists of info to players. systemChat will work great. I already have custom color coded side chats, I will just make a "hint channel." Thanks guys ๐Ÿป

granite sky
#

Have you proven that the clients are running the same mods as the host, or are you working on trust?

#

Usually the trouble with localhost is that anyone can join with any mods. Your friends will swear blind to you that they're running the correct mods when they're not.

spare depot
#

Question,

How do I go about enabling/disabling a particle effect? I want to use it alongside my CBRN script so that when a certain trigger is met the gas is "deployed" so to speak, ideally with an acompanying sound effect for the smoke particle emitter

#

Nevermind, I think I figured out a solution ๐Ÿ‘
Still need to figure out how to get the sound effect script thing to work nicely

still forum
warm hedge
#

What's up with it

scenic shard
#

I want my addon (server side) to ask the player to send it some information (available locally only) when they join the server.

what is the most appropriate / efficient way to do this?

remoteExec from server to client, then remoteExec back again?

remoteExec from server to client, then publicVariableServer with a eventHandler on server?

something else? I also have CBA as a dependency already if that helps

still forum
#

remoteExecutedOwner to easily reply

scenic shard
#

thank you, had not seen remoteExecutedOwner before either. very nice

hallow mortar
broken pivot
granite sky
granite sky
#

wiki says it's a feature :P

#

I say it's a pain in the arse.

scenic shard
#

is there any performance difference between these?

[{code}] remoteExec ["call", _target];
[] remoteExec ["myFunc", _target];
scenic shard
granite sky
scenic shard
#

ah, yea that makes sense. might as well make it a func then even if its small

granite sky
#

Sometimes I get lazy and do the first one. But not for anything that's used frequently.

#

Second one is also necessary for CfgRemoteExec restrictions, if you ever start caring about security.

pallid palm
#

hello all: is it posiable to Send Structured Text over the network, like this

#
[format ["Remaining Lives:  %1", _playerTickets]] remoteExec ["systemChat", TO_ALL_PLAYERS];
granite sky
#

That's not structured text, that's just a string.

pallid palm
#

oh cool awsome thx m8

scenic shard
#

yea, i have used if for infrequent mission specific scripts before. and this would be infrequent as well, but since it is a addon i want try try and be as proper as possible

granite sky
#

IIRC it does bitch about performance if you do attempt to send structured text.

#

I may be misremembering. Strings are fine anyway.

pallid palm
#

copy that thx man love you lots

scenic shard
granite sky
#

It's for remoteExec and remoteExecCall from clients. If you were using it properly, call would not be in your whitelist.

scenic shard
#

if i add this to a addon and whitelist a few functions, would that only blacklist the non-listed ones from that addon or any other addon + vanilla stuff as well? the wiki makes it sound like the latter

tough abyss
#

When using a trigger to exec an SQF, and it is set to run player side and not server side, is the trigger activated once per session, or per respawn within a session?

thin fox
tough abyss
# thin fox every client gets a copy, so the trigger will activated on each client, but it d...

I wanted to know whether a hint string would be triggered the first time a player encounters it or if it would be triggered at every manual or death respawn. I will be adding some "dialog slideshows" as well for some things in place of hint or system chat. We just wanted to know how often a player would see it pop up. A repeated hint is a bit less cumbersome than having to go through clicking a dialog until it exits. We can work with whatever the constraints may be.

thin fox
tough abyss
pallid palm
#

Hello All: hay i just want thank all the great guys, that helped me with my scripting in Arma 3,
my missions are working so perfect im having so much fun : i just love it
im so happy i can't name all the people that helped me there's so many
thxs So Much guys im having So much Fun: its off the Hook WooHoo Arma 3 and WooHoo Discord

restive hinge
#

TLDR: Arma can't keep up with local script edits

Hey guys, I've been struggling with a weird issue recently - whenever I make edits to the mission scripts they're not recompiled at runtime for whatever reason. Whenever this happens i check with loadFile and as suspected the contents are different - Arma sees only the previous version of the script.

I tried saving multiple times, but the only thing that could help - resaving missions with a different name, copying all the scripts and running it in 3den. I'm not sure if it's a bug with Arma or some mod. Restarting the games also helps, but this is obviously not an option as well as copying the entire mission each time. Did anyone happen to have this kind of issue?

I've already asked around, but no one seemed to suggest anything of interest: #arma3_scripting message

pallid palm
#

so are you using mods /

restive hinge
#

I am, yes

pallid palm
#

have you had a look at the RPT file

restive hinge
#

Yep, nothing of interest there, no errors, nothing

pallid palm
#

what mods are you using

restive hinge
#

I tried adding diag_log to my scripts, but the edited scripts aren't still refreshed in Arma

#

One sec

pallid palm
#

what you said realy seems like it cant happend i never had anything like that happend did you check you game files i forget what it called

restive hinge
#

Verify game you mean? Nope, didn't resort to that

pallid palm
#

yes did you try that

restive hinge
#

I'll try

pallid palm
#

ok that may do it

restive hinge
#

This more looks like a shot in the dark, but I'll get back when I'll verify

pallid palm
#

no no that will really help

#

what text editor are you using also

restive hinge
#

VSCodium

pallid palm
#

ok cool

warm hedge
#
  1. Unload Mods
  2. Make sure you load the right mission and script
  3. Make sure your script is not actually updated
  4. Post your code that runs the script
pallid palm
#

i know some times i think the game is messing up but then i find it was me the hole time

restive hinge
#

The scripts are not much of a deal, just a bunch of execVMed sqf files through triggers

pallid palm
#

execVM you say hmmmmm

#

that could be it there if your running to many execVM it may be trying to compile all that stuff every time you run the game

restive hinge
#

I've just captured this:

#

Unloaded all mods except CBA, IMS, IMS:Warhammer, The Empires of Old and the map itself

#

Same stuff

#

Note: I've verified the game files

warm hedge
#

Unload all literally means unload all, at least you need to try

#

Even though it is very doubtful that a Mod can do such

restive hinge
#

Unloaded all mods, created a blank mission

warm hedge
#

Just, just actually in case. Which is the full path of your script? Absolute one, on Windows

pallid palm
#

about how many scripts are you running with execVM

warm hedge
#

Does it have a Cyrillic character?

restive hinge
#

I'm not on Windows, I'm using Arch Linux, running Arma 3 through Proton
The directory is a symlink to:

mpmissions -> '/home/homelessmage/.local/share/Steam/steamapps/compatdata/107410/pfx/drive_c/users/steamuser/My Documents/Arma 3 - Other Profiles/HomelessMage/mpmissions'
warm hedge
#

I see

restive hinge
#

No, I don't have Cyrillic characters

#

I've tried also editing directly the files in the full path

#

Same thing

pallid palm
#

shouldnt that be ---> Profiles/HomelessMage/missions

restive hinge
pallid palm
#

are thay pbo-ed as it were

restive hinge
#

Nope, they're not PBOed

pallid palm
#

you should save your missions in missions not MPmissions

#

MPmissions is for PBO-ed missions

restive hinge
#

Uhhhh, what the actual fuck, you're right, it works

pallid palm
#

ahh haaa yes

restive hinge
#

How is this possible lol, it's just a dir

#

I mean

winter rose
pallid palm
#

well the game looks for PBO-ed missions in the MPmission folder

restive hinge
#

Hold on

#

I think

#

Uh, I can't figure out whether it works cause i saved it as a different one or not

pallid palm
#

yeah if you export your mission form missions to MPmissions then game will PBO the mission

restive hinge
#

Yeah, it works fine

pallid palm
#

yes put all your user saved missions in missions not MPmissions

restive hinge
#

Thank you, you're a legend

pallid palm
#

๐Ÿ™‚

restive hinge
#

I've just always thought the missions and mpmission is just a way for user to distinguish actual singleplayer or multiplayer missions

winter rose
#

in your user profile directory, yes
but if you "save as"/"export" (I don't remember), then yes it's PBO'd

pallid palm
#

yup yes

#

it gets PBO-ed when you export the mission from missions to MPmissions

#

then you can host it and what ever

restive hinge
#

The game has a built-in PBOer?

pallid palm
#

yes it does the user mission in missions will remain in there for later use

restive hinge
#

The longer I live the more I know

pallid palm
#

hell yes whooo

restive hinge
#

I've always used a third party CLI tool for that, to pack my missions

#

Ffs

pallid palm
#

i do some times also

pallid palm
#

so its all fixed now correct ?

restive hinge
#

I'm loading it up with the mods and stuff, but in vanilla Arma it works 100% when eediting scripts in missions dir

pallid palm
#

nice yes thats it yes keep all your user made missions in missions

restive hinge
#

Cheers

pallid palm
#

roger that mate

#

you can PBO them in missions folder and you can drag and drop to MPmissions or copy and past

#

i do that some time also

restive hinge
#

It works fine

pallid palm
#

Awsome cool

pallid palm
#

im so glad i could help you m8

restive hinge
#

I'm so glad you did it's the end of my psychological torment

#

With trying to figure out whether i'm overloading the engine of some other fuck up

pallid palm
#

lol it was a easy fix m8 ๐Ÿ™‚

restive hinge
#

It's just that I've all the time used the mpmissions and never ever had anything like this

#

Both on Win and Linux

pallid palm
#

copy that

#

yes Arma is epic

#

you made me happy by allowing me to help you

#

i guess im just a happy guy lol ๐Ÿ™‚

still forum
#

Openna dialog that captures input.
Afaik opening chat is enough

pallid palm
#

ok now what was i working on lol ๐Ÿ™‚

#

hahahahaha

#

i remember ๐Ÿ™‚

stable dune
#

If a function has postInit 1 defined, and a player joins JIP, it will only be executed locally on the client machine? right?

still forum
stable dune
tough abyss
#

@thin fox thanks for the help yesterday, and excuse the confusion earlier. My issue was major user error. Everything is running now, due to your help ๐Ÿป

tough abyss
#

Can hint or systemChat be triggered with a simple add action? I want to make NPCs, or an object have a simple scroll option to set the script in motion.

hallow mortar
tough abyss
tough abyss
#

Can somebody tell me what is wrong with this init? Meant to trigger a systemChat. It glitches out and shows parts of the text, gives an error related to string. I am sure I did something incorrectly:

this enableSimulation false; this allowDamage false; this addAction[localize "STR_Guru_Welcome",execVM "WelcomeGuide.sqf"];

jade acorn
#

code has to be in {} brackets, as in examples on wiki

tough abyss
jade acorn
#
this addAction
[
localize "STR_Guru_Welcome",
{ execVM "WelcomeGuide.sqf"; }
];```
#
this addAction
[
    "title",    // title
    {
        params ["_target", "_caller", "_actionId", "_arguments"]; // script
    },
    nil,        // arguments
    1.5,        // priority
    true,        // showWindow
    true,        // hideOnUse
    "",            // shortcut
    "true",        // condition
    50,            // radius
    false,        // unconscious
    "",            // selection
    ""            // memoryPoint
];``` this is the example on wiki.
hallow hound
#

Hey, im unsure if this is the place to look for help on this subject however- is there any intel i can read to find out how to make a aux mod, like use a bunch of steam mods and put them into one big mod like a compilation

jade acorn
#

why not just make a mod preset?

tough abyss
thin fox
hallow hound
#

Because- we need one mod that can support a general set of mods as the plan might be to make multiple modpacks- it would be nice to have one mod which has like the general amount of mods that all the modpacks share if that makes sense- so it would be easier to made new modpacks or alter them.

tough abyss
jade acorn
#

having presets is more convenient and easier to debug.

hallow hound
#

Word,thanks

kindred zephyr
#

are Scripted Event Handlers able to intercept inputActions?
Or should the be listened using other method?

pallid palm
#

Do you mean addActions ?

crimson lion
#

I'm poking around at the Play Sound module in Zeus because I was wondering why my game freezes for SO long when first placed down and running my modpack, and I learned that if uinamespace getvariable "RscAttributeSound_objects"; is not there (for some reason its there when I dont have all or as many mods loaded ) then it queries all of cfgvehicles instead with this:

{
    if (gettext (_x >> "sound") != "" && getnumber (_x >> "scope") > 1 && gettext (_x >> "simulation") == "") then {
        _sounds set [count _sounds,_x];
    };
} foreach ((configfile >> "cfgvehicles") call bis_fnc_returnchildren);```
Is there any faster way to have sounds cached? With the full modset I have loaded, the code performance says it takes about 18.5 seconds to run and the game fully freezes that whole time since this runs unscheduled. I am not a coding expert or anything so this might just be the best that can be done anyway but I'm wondering if this could be old code and there are more efficient ways to build this array by sifting through so much data.
#

Or maybe I could just uinamespace setvariable ["RscAttributeSound_objects",_sounds] with this somewhere before they get in-game so it just freezes when its more convenient, instead of at the time of placing the module. Although now that I copied it to clipboard I see that I have 77,572 elements in this array so.. I guess there's not much else to be done besides loading less mods lol

torn harbor
#

is there a way to have a zeus module display a like text box or a slider bar within arma. I know about zen but I am having trouble with it when it comes to the module. The slider box apears for everyone on the server not just the person placing it. IDK if there is something I can do in the config as right now I have it in the script section of the module so yeah.

ps sorry if this is the wrong chat for this question

fair drum
#

And function

torn harbor
#
class CfgVehicles
{
    class Logic;
    class Module_F: Logic
    {
        class ModuleDescription { class Anything; };
    };

    class IC51_Module_SpreadGroup : Module_F
    {
        SCOPE_PUBLIC;
        displayName = "Group Dispersion";
        category = "ic51_modules";
        icon = "iconModule";
        function = "ic51_fnc_moduleSpreadGroup";
        functionPriority = 1;
        isGlobal = 1;
        isTriggerActivated = 0;
        curatorCanAttach = 1;

        class ModuleDescription: ModuleDescription
        {
            description = "Place on an AI unit to spread its group randomly within the chosen radius around that unit.";
            position = 1;
        };
    };
};

config for the module above

#
params ["_logic", "_units", "_activated"];
if (!_activated) exitWith {};

_module = _this select 0;
// Get the player who placed the module (the Curator).
_curatorOwner = _module getVariable ["curatorOwner", objNull];

// Check if the current client is the one who owns the module.
if (_curatorOwner == player) then{

// Slider bounds and default (meters)
private _R_MIN = 10;
private _R_MAX = 1000;
private _R_DEF = 150;

private _center = objNull;

// Resolve from provided units
{
    if (_x isEqualType objNull && {!isNull _x} && {_x isKindOf "CAManBase"} && {alive _x}) exitWith { _center = _x };
} forEach (_units param [0, []]);

// Fallback to nearest AI
if (isNull _center) then {
    private _near = nearestObjects [getPosATL _logic, ["CAManBase"], 10, true];
    if ((count _near) > 0) then { _center = _near#0; };   // <-- fix
};
if (isNull _center) exitWith {
    ["Place module directly ON an AI unit."] remoteExec ["hintSilent", remoteExecutedOwner];
};

private _members = units (group _center) select { alive _x };

if (!isNil "zen_dialog_fnc_create") then {
    // ZEN signature: [type, label, default, conditionBool, args[min,max,decimals]]
    private _controls = [
        ["SLIDER:RANGE", format ["Radius (m) [%1..%2]", _R_MIN, _R_MAX], [_R_MIN, _R_MAX, _R_DEF, 0]]
    ];

    [
        "Spread Group",
        _controls,
        // onConfirm
        {
            params ["_results", "_args"];
            _args params ["_center","_members","_R_MIN","_R_MAX","_logic"];
            private _val = _results#0;

            // Guard for very old ZEN that reports 0..1
            private _radius = (
                if (_val <= 1 && {_val >= 0} && {_R_MAX > _R_MIN}) then {
                    _R_MIN + (_R_MAX - _R_MIN) * _val
                } else {
                    _val
                }
            );
            _radius = (round _radius) max _R_MIN min _R_MAX;

            // Do the spread on server
            [_center, _members, _radius] remoteExec ["ic51_fnc_doSpreadGroup", 2];

            // Delete the module (server deletes; replicates)
            if (!isNull _logic) then { [_logic] remoteExecCall ["deleteVehicle", 2]; };
        },
        // onCancel
        {
            params ["_results", "_args"];
            _args params ["", "", "", "", "_logic"];
            if (!isNull _logic) then { [_logic] remoteExecCall ["deleteVehicle", 2]; };
        },
        [_center, _members, _R_MIN, _R_MAX, _logic]
    ] call zen_dialog_fnc_create;

} else {
    // No ZEN: default radius, then delete module
    [_center, _members, _R_DEF] remoteExec ["ic51_fnc_doSpreadGroup", 2];
    ["ZEN not detected. Using default radius 150 m."] remoteExec ["hintSilent", remoteExecutedOwner];
    if (!isNull _logic) then { [_logic] remoteExecCall ["deleteVehicle", 2]; };
};
};

current test code for the module text box function

#

if there was a way for it to be in the config file then that would be great or if there was a guard in place like ive been trying at the top of the module code that would also work for me

#

please ping with any info yall have

pallid palm
#

omg i helped so many people today i'm tyred

spare depot
#

Is there any way to add a delay to a forEach loop? sleep doesn't work

thin fox
#

ah, forEach, never tried, what are you trying to achieve?

wintry citrus
#

Hi i am a new guy here . Soon i will learn arma 3 scripting . Do you folks knew a good source/video to learn scripting

wintry citrus
#

And was there anyone who worked on missile to missile anti air

#

Locking. I am trying to do iron dome in arma

wintry citrus
spare depot
#

@thin fox Works like an absolute charm, now rather than shotgunning soldiers everywhere over the battlefield they actually step out one at a time

spare depot
#

Here's the script, for use in the plane's waypoint

#

VDV_DROP being the unit group name

wintry citrus
#

And record it like 10 hours from (maybe multiple) an angle to make it a desktop background

spare depot
hallow mortar
spare depot
#

I'm sure I could make some sort of script to return a loadout when they land but I am just happy it Worksโ„ข for now

#

Also it's for AI, not players, so there's that too

wintry citrus
wintry citrus
#

So anyways my uni starts in monday and i am going too try this by sunday

fair drum
#

zen_dialog_fnc_create

can you tell me what is in this function?

torn harbor
#

noted

torn harbor
fair drum
#

i'm going to have to look it up on github to see what is in it. I'm not seeing any standing out problems so far, but I wonder if that function is doing something globally

torn harbor
#

I know its running for every client currently cause every person gets the slider box so would just removing isGlobal a fix for that?

fair drum
#

well if you do isGlobal = 0, it will be only run on the server, not clients. you want it on a client right? just the correct client.

torn harbor
#

I think not sure honestly cause the box would need to be on the client

#

alright I will know more tomorrow sadly person I test with is offline currently so

#

I coudl only test in singleplayer

#

alright so then yea that should fix it

fair drum
#

to test it yourself, you can start multiple instances of arma if you have battleeye turned off

torn harbor
#

keyword should fix it

fair drum
#

you then join client 2 to client 1

torn harbor
#

?

fair drum
#

no need for a dedi

#

turn off battleeye and click play twice. you'll get two clients

#

client 2 will be your client, client 1 will be your server (listen server).

torn harbor
#

alright and then in eden just start a multiplayer and have two slots

fair drum
#

yeah

#

test your results on client 2 since client 1 will be the server

kindred zephyr
torn harbor
# fair drum test your results on client 2 since client 1 will be the server

so didnt come up for client 2 but came up for client 1 even though client 2 placed it

I did also comment out this part of the code

_module = _this select 0;
// Get the player who placed the module (the Curator).
_curatorOwner = _module getVariable ["curatorOwner", objNull];

// Check if the current client is the one who owns the module.
if (_curatorOwner == player) then{

as it was a check so

#

I dont know if there is a way to have maybe the slider stuff be apart of the module config I think I have seen that done but I dont remember

fair drum
#

I'm assuming SCOPE_PUBLIC is scopeCurator = 2;?

torn harbor
#

just scope=2 I think let me double check

#

or better yet let me back that macro out and put in both scope =2 and scopeCurator =2

torn harbor
fair drum
#

_curatorOwner = _module getVariable ["curatorOwner", objNull];

this will never exist with your current config

#

you dont have the attribute

#
class Attributes: AttributeBase {
    class curatorOwner: Edit {
        property = "myProperty";
        displayName = "Curator Owner";
        tooltip = "Stuff";
        defaultValue = "";
    };
};
#

well sorry I keep going back to standard modules since thats what I write

torn harbor
#

no hey if it works it works im still trying to learn stuff as I go so yeah

#

but if you have a way to basically just even if its a text box that you enter a vaule in that can be passed to have it be the radius that would work for me

fair drum
#

people keep asking to make Modules Enhanced into a zeus set but because of UI I haven't gotten around to really testing the zeus side of things

cursive tundra
#
/// Call for Fire
private _mortars = [["rhsusf_m109d_usarmy","rhsusf_m109_usarmy"], [], false, true]; 
if (!isNil "_mortars") then {
    _mortarGun = _mortars select {side _x == west && _posOBJ distance _x > 400 && _posOBJ distance _x < 4000} select 0;
    _artTrg1 = createTrigger ["EmptyDetector", _posAssault2WP0];
    _artTrg1 setTriggerArea [100, 100, 10, false];
    _artTrg1 setTriggerActivation ["WEST", "PRESENT", false];
    _artTrg1 setVariable ["FireMisionParams", [_mortarGun, _posOBJ]];
    _artTrg1 setTriggerStatements ["this",thisTrigger getVariable 'FireMisionParams' params ['_mortarGun', '_posOBJ']; [_mortarGun, _posOBJ, 25] execVM 'NatoMortarFFE.sqf'; deleteVehicle _artTrg1;", ""];
};

why does this give me the error "if (!isNil "_mortars") then {#
_mortarGun = _mortars... Error Missing } ? im closing the then with the last "}" am i not? am i overlooking something?

torn harbor
#

you arent your Then statement is missing the }

#

so somewhere in your code there is a missing }

fair drum
#

notice the color of your code here, you are missing a "

#

look at last two lines

torn harbor
#

yeah you have an extra " at the end

#

_posOBJ, 25] execVM 'NatoMortarFFE.sqf'; deleteVehicle _artTrg1;", ""];

#

that line at the end you have a "

#
private _mortars = [["rhsusf_m109d_usarmy","rhsusf_m109_usarmy"], [], false, true]; 
if (!isNil "_mortars") then {
    _mortarGun = _mortars select {side _x == west && _posOBJ distance _x > 400 && _posOBJ distance _x < 4000} select 0;
    _artTrg1 = createTrigger ["EmptyDetector", _posAssault2WP0];
    _artTrg1 setTriggerArea [100, 100, 10, false];
    _artTrg1 setTriggerActivation ["WEST", "PRESENT", false];
    _artTrg1 setVariable ["FireMisionParams", [_mortarGun, _posOBJ]];
    _artTrg1 setTriggerStatements ["this",thisTrigger getVariable 'FireMisionParams' params ['_mortarGun', '_posOBJ']; [_mortarGun, _posOBJ, 25] execVM 'NatoMortarFFE.sqf'; deleteVehicle _artTrg1;, ""];
};
#

that should work for you now

fair drum
#

2nd to last line has a lot of errors, just redo that line

kindred zephyr
#

he is actually missing the quotes in the trigger statements, everything in the statements is done via stringified code

torn harbor
fair drum
#

oh i see that now. I would use toString instead for the set trigger statements. Make it so much easier.

fair drum
torn harbor
#

ah got ya

#
 private _controls = [
        ["SLIDER:RANGE", format ["Radius (m) [%1..%2]", _R_MIN, _R_MAX], [_R_MIN, _R_MAX, _R_DEF, 0]]
    ];

    [
        "Spread Group",
        _controls,
        // onConfirm
        {
            params ["_results", "_args"];
            _args params ["_center","_members","_R_MIN","_R_MAX","_logic"];
            private _val = _results#0;

            // Guard for very old ZEN that reports 0..1
            private _radius = (
                if (_val <= 1 && {_val >= 0} && {_R_MAX > _R_MIN}) then {
                    _R_MIN + (_R_MAX - _R_MIN) * _val
                } else {
                    _val
                }
            );
            _radius = (round _radius) max _R_MIN min _R_MAX;

            // Do the spread on server
            [_center, _members, _radius] remoteExec ["ic51_fnc_doSpreadGroup", 2];

            // Delete the module (server deletes; replicates)
            if (!isNull _logic) then { [_logic] remoteExecCall ["deleteVehicle", 2]; };
        },
        // onCancel
        {
            params ["_results", "_args"];
            _args params ["", "", "", "", "_logic"];
            if (!isNull _logic) then { [_logic] remoteExecCall ["deleteVehicle", 2]; };
        },
        [_center, _members, _R_MIN, _R_MAX, _logic]
    ] call zen_dialog_fnc_create;

that code is basically all for the zeus enhanced slider box to appear and pass the number the slider is set to over to my other function that actually does the work idk if there is a way to just link this to the module config but at the end of the day its either that or I need a guard in place that ensures the person who placed it down and the server are the only two places it is running at least for the slider pop up

fair drum
# torn harbor ``` private _controls = [ ["SLIDER:RANGE", format ["Radius (m) [%1..%2]...

try this:

changeisGlobal = 1

params ["_logic", "_units", "_activated"];
if (!_activated) exitWith {};

- _module = _this select 0;
- // Get the player who placed the module (the Curator).
- _curatorOwner = _module getVariable ["curatorOwner", objNull];

- // Check if the current client is the one who owns the module.
- if (_curatorOwner == player) then{
+ if (local _logic) then {
torn harbor
#

alright lets see

torn harbor
cursive tundra
#

i am an idiot and forget the "entities" in private _mortars = [["rhsusf_m109d_usarmy","rhsusf_m109_usarmy"], [], false, true]; , must have SOMEHOW deleted it while copying it from another script i made. Stared at this for like 30mins and didnt notice... no wonder it wont work

#

wokrs now, fixed the " issue too tho, thx for helping

fair drum
torn harbor
fair drum
#

only showing on client 2 right?

torn harbor
#

yes

#

I have a few things to fix like you have to click thru the box twice and making sure the AI stay in place but its working how I was wanting it to by the looks of it

fair drum
# torn harbor yes

I would try one more time with 3 clients. test to see if it shows on client 3 while placing on client 2

torn harbor
#

fair

#

doing that now

fair drum
#

good you are probably safe then

torn harbor
#

so now its just figure out why it requires me to click ok twice when the slider box comes up and why the AI still move even though they shouldn't be

fair drum
#

for future,

isGlobal = 1 fires everywhere, but the client that places the zeus module actually is the local owner therefore local will filter out the others

torn harbor
#

ah got ya alright cool thank you

torn harbor
#

?

#

_members meaning for the AI movement thing

fair drum
#

private _members = units (group _center) select { alive _x };

is this being populated, or is it silently failing and returning an empty array

#

also, for constants, I would use define

private _R_MIN = 10;
private _R_MAX = 1000;
private _R_DEF = 150;
#define R_MIN    10
#define R_MAX    1000
#define R_DEF    150

now you don't need to pass them to the function as they are autofilled at compile

torn harbor
fair drum
torn harbor
#

so its funny cause this problem of the AI moving only just became a problem

fair drum
#

then its most likely a locality problem now. remember, we just took away the server.

torn harbor
#

so this was working like in a single player setting then when tested in multiplayer it was then found to have the problem that was just fixed but then today we found while trying to fix the problem that now AI were moving

torn harbor
fair drum
#

this one is probably going to be on you to find. do some logging, find out where the failure is first

#

if you are beyond the script error stage, its now deeper and you'll need logging

torn harbor
#

fair enough I really do appreaciate the help though with everything

tardy osprey
#

Is there a way to use the civilian presence module with custom units? (CUP - Takistan) It only shows vanilla units.

fair drum
#

change the loadout of the spawned unit

tardy osprey
#

Yeah i tried to figure out how to do that, but im too stupid.

fair drum
# tardy osprey Yeah i tried to figure out how to do that, but im too stupid.

so if you read the tooltip on Code On Unit Created you can see that the unit that spawns can be referenced by using _this.

if you read https://community.bistudio.com/wiki/setUnitLoadout

you'll see that under syntax 4, you can use the config class of a unit to grab a loadout. This would be your cup unit class name.

so this example we will use the class "CUP_C_TK_Man_05_Jack" from CUP civilians

_this setUnitLoadout (configFile >> "CfgVehicles" >> "CUP_C_TK_Man_05_Jack");

now say you have a bunch of different loadouts you want to use; we can use an array of classnames:

private _loadoutClassnames = [
    "CUP_C_TK_Man_04", 
    "CUP_C_TK_Man_07", 
    "CUP_C_TK_Man_08", 
    "CUP_C_TK_Man_02"
];

_this setUnitLoadout (configFile >> "CfgVehicles" >> selectRandom _loadoutClassnames);
pallid palm
#

hello all: because i like Team Respawn So much i had to Disable the Respawn Button in the Esc Menu

#
respawnButton = 0; // 0=Disabled  1=Enabled
#

i'll let you guys guess why i had to do it ๐Ÿ™‚

thin fox
pallid palm
#

yeah it was because people were just hitting Esc and then hitting Respawn after the tickets ran out and there were dead ๐Ÿ™‚

#

but i some times kill myself if all other players are dead so we can all respawn

tough abyss
#

I have set up some "text NPCs" using systemChat, a unit or object, and addAction. It is working fine so far. I needed help with a couple things:

-Is the systemchat stream I am seeing for me as the player or is it displayed to the server?

-Is there a way to make the text stream end upon death? Our spawn areas have a welcome guide NPC. If you start her chat dialogue and respawn before it is finished, it will repeat at respawn if selected. Makes the system chat a duplicate chaotic mess. Open to any work arounds.

#

The format is terribly simple:

systemchat, sleep, systemchat, sleep, etc.

pallid palm
#

wow let me read what you texted so i can get what your saying

kindred zephyr
hallow mortar
spare depot
#

I feel stupid because I was wondering why a script in a trigger wasn't working, only to find out I forgot to set the countdown to 0

pallid palm
#

Don't feel stupid because we all do dumb things ๐Ÿ™‚

hallow mortar
tough abyss
spare depot
pallid palm
#

he he lol

#

i do the same stuff sometimes

spare depot
pallid palm
#

that's why we have great peolpe in discord to help us

spare depot
#

For sure!

hallow mortar
#

You can get better at understanding how things work but you'll never be safe from Error: missing ;

pallid palm
#

all the time when i think the game is messing up it was me the hole time ๐Ÿ™‚

tough abyss
#

I want to to take the above mentioned NPCs and link that text to color coded custom side channels. I have the channels working already. My issue is that we have two identical factions (civilian and independent), so there will an "NPC channel" for each. Can someone help me to correctly add a second channel with an "or" with the following? One NPC to chat to one of the two factions.

customChat [1, "customChat"]; (wiki example)

hallow mortar
#

I'm a little unclear on what you're asking about. Do you want the script to select which channel to send the message to, depending on the player's side?

tough abyss
#

Yes, sorry a bit fuzzy headed.

hallow mortar
#

There are a few ways to approach it, this is just one possible way:

private _channelID = switch (side player) do {
  case west: {1};
  case east: {2};
  case independent: {3};
  case civilian: {4};
};
_unit customChat [_channelID, "text"];```
pallid palm
#

wow that's Awsome Nikko

tough abyss
hallow mortar
#

One thing I would add is that since this is local effect, you don't necessarily need to split the channels. You could have one channel that's just used for local NPC chatter, which all players have access to. Because only the executing machine sees the message, there's no risk of "cross-contamination" even though it's all in the same channel.

tough abyss
tough abyss
hallow mortar
#

You've misunderstood what's happening in that switch statement

#

The switch is checking side player and seeing if it matches each case's condition. If the player's side is independent then it returns 3, which is stored in the _channelID variable

#

west, east etc. are not channels but Sides, being used for comparison against the player's side

tough abyss
#

Jumped staight into the wrong file, that is a channel mute function for our player menu. I will go grab some coffee, have a smoke, and come back with fresh eyes, lol.

#

I instincively went into my DB folder. Need a break ๐Ÿ˜…

#

I am curious as to how I would disable player text input on the new NPC channel? I want it to be an NPC stream only, if possible.

hallow mortar
#

enableChannel

tough abyss
#

Ok, had to fix that before the final question I had deleted. Which file does the radiochannelcreate go in?

hallow mortar
#

I would put it in initServer.sqf, but there are other options depending on how exactly you want to do it

tough abyss
scenic shard
hallow mortar
#

You could use toFixed to convert it to string, which never uses scientific notation

clever ginkgo
#

does anyone know how to fix "Receiving mission file (0 KB/ 0KB)"?

hallow mortar
tough abyss
#

_unit customChat [1, "Hi, I am a custom chat message"];

I had an NPC working great with the systemchat. I now have a player input disabled side channel, but I cannot get the custom channel to work the same.

I know the number is the channel ID (14 in this case). I think I am unclear what the _unit variable would be here?

hallow mortar
#

The unit that should be attributed as the speaker

#

The speaking unit must be in the channel (and they may need a radio item). The receiving unit must be in the channel (and they may need a radio item). The code must be executed on machines that need to display it (Local Effect).
Note that for the purposes of customChat, the channel ID used is the ID within the range of custom channels, not the overall ID. So custom channel ID 1 is the same as overall ID 6. (see https://community.bistudio.com/wiki/Channel_IDs)

#

If you have the overall channel ID, you can subtract 5 from it to get the ID within the custom channel range

tough abyss
hallow mortar
#

If the code is being executed on a player client, and you want the message to appear to be sent by the player unit, then yes

#

I mentioned the difference in channel IDs because you mentioned you were using ID 14, which would be invalid for use with customChat, since it expects a number from 1 to 10

tough abyss
#

Oh that is the error! I misunderstood how it worked. My total list has 14 because of the default direct, group, vehicle, etc. I will try that now.

tough abyss
cedar kindle
#

@warped thicket does it transfer zeus units aswell?

spark turret
#

i cant seem to figure out how to get the data created by BIS_fnc_unitCapture

it doesnt appear in the clipboard

#

the menu pops up with f1 / f2 to copy data, but it just opens the unit command menu (like report status etc) and doesnt copy the data

ornate whale
spark turret
#

i get both messages, but it seems to just not register the F1 press

i did manage to get it one time, then it said "savign data to clipboard"

ornate whale
#

Have you tried to press F1 while the game is still paused, right after the ESC?

#

I have never really had any issues with it, except for when I somehow dismissed the dialogue that propmts you to copy the data.

spark turret
#

this is a guess, but possibly its because i started unitcapture via vehicle init

#

via admin command interface, it seems to work

ornate whale
#

Well, what I woud try first is to call the unitCapture function from the debug console.

#

There might be some issue causing no data being recorded.

#

At the time you are calling the function from the init field, all the necessary objects might not be fully loaded and ready yet.

pallid palm
#

that's a cool name you have @ornate whale

spark turret
#

alr, admin console resolved that issue

pallid palm
#

man i don't even know how to use that unitCapture stuff

#

@ornate whale your name is like Rambo but with friend at the end

plush jolt
#

Does anyone know a good way to combine the respawn options of member of same group and same side

I'm looking to do something to the effect of

If you die you take over an AI in the same group as you, if the group is wiped then a new group is made available (spawned) idea being players that start in the same group must always be in the same group

limber panther
#

Hello, i wrote a script few years ago and it used to work fine. Now it doesn't. Here's the problematic section: ```sqf
_ship addAction ["Deploy lifeboat", {
params ["_target", "_caller", "_actionId"];
private _lifeboat = createVehicle ["C_Rubberboat", _target];

old owl
# limber panther Hello, i wrote a script few years ago and it used to work fine. Now it doesn't. ...

Can't write out code since on mobile but could probably just either use a predefined set of coordinates using getPosASL where you would like it to be and that you could use in place of _target for createVehicle. Or alternatively if you use the addAction in multiple places and would prefer a more dynamic solution, you could save getPosASL _target to a variable then use set to change it's coordinates to increment a predefined offset. I think there are also some BI functions for relative position as well you could use if preferred but can't find those since yapping on my phone. Hopefully that's helpful tho ๐Ÿ™‚yap

limber panther
# old owl Can't write out code since on mobile but could probably just either use a predef...

Thank you, the addaction is on a ship so it's moving all arond, in case the ship gets damaged or destroyed and begins to sink, player can use the action to spawn the rubber boat and therefore it needs to spawn whereever the main boat currently is. On the wiki i just found model modelToWorld position where position seems to be some kind of parameter where i could actually set an offset? I don't really understand that. But i'm curious what's gonna happen so i'll try

limber panther
spare depot
#

Is there a way to get an AI helicopter to ignore all other input (ignore being shot at, moving itself automatically, etc) / force it to land at a specific location?

tulip ridge
#

Setting the group to careless and telling it to land at a helipad should do that

spare depot
#

I see I see, I'll see what I can figure out with that, thanks!

spare depot
#

Oh wait there's already an invisible one, oops. Either way, I got it working

buoyant hound
#

Hey,
I need to count ai and vehicles of enemy team
Then act when killed ai or vehicle count is certain number
Any chanse for use killed eh for both at once?

pallid palm
#

Hello All: So i have this Briefing.sqf in my Scripts Folder
and in The init.sqf i have [] execVM "Scripts\briefing.sqf";
is there a better way to exec this Briefing.sqf
to make sure all players can see the Briefing
i noticed some people didn't see the briefing and i didn't know why
on a hosted server

#

maybe i need to exec in the initPlayerLocal.sqf also

blissful current
pallid palm
#

oh nice thankx m8

#

so do you have this in the init.sqf ?

blissful current
#

I have it in initPlayerLocal.sqf.

#

at the top

pallid palm
#

oh ok thats what i was thinking

#

thx again m8

#

i wounder if i just put this at the top of the script

#
if (!hasInterface) exitWith {};
#

maybe that would do it too

thin fox
pallid palm
#

ok thx m8 cool oh btw why do you have _null befor the [] execVM this is not needed

blissful current
spiral canyon
#

I was trying to do the UnitCapture on the KeyFrame animation I did of the TV Tower falling but the data doesnt seem to have any movement. The KeyFrame animation moves but the record data is just the same position for the 6 seconds I recorded. Anyone else have any problems doing this?

tardy osprey
cosmic lichen
#

You can put the code directly into the edit field. However, using an sqf will be easier if you need to adjust the code later.

inner umbra
#

Speaking of the civilian presence module, are there any scripts to dynamically place spawnpoints+waypoints in buildings, within, say, a marker area?

winter rose
pallid palm
#

yes sir

#

thx Lou

#

plus No _null befor the [] execVM

pallid palm
#

@inner umbra yes: all i can say is Civilian Occupation System (COS) its a bunch of scripts you can edit the to your liking

#

@blissful current yes its all working Now i just had to exec the Briefing in the initPlayerLocal.sqf

#

but now i'm wondering if my mission gets hosted on a Dedicated Server will the briefing show 2x, cuz im exec-ing it in the init.sqf and the initPlayerLocal.sqf

#

i mostly just player host the mission

pallid palm
#

so can i just remoteExec the briefing from the init.sqf and that would cover it all

thin fox
#

remove it from init.sqf

inner umbra
#

nice ty

pallid palm
#

but if i remove it from the init.sqf then the host of a player hosted server wont see the briefing

#

cuz the host is the server

#

there must be away to cover all the bases

#

i guess it must be exec both places to cover all base's

#

yeah see i want the briefing to show in all cases like SP MP and DED server

pallid palm
#

oh nice i was looking for this

#

thx man

ivory lake
#

initPlayerLocal runs on everything that is a client, including self-hosted

pallid palm
#

really

#

ok ill take your word for it

ivory lake
#

i mean the wiki page I linked says that too

pallid palm
#

thats kinda funny cuz when i took the briefing exec out of the init.sqf the briefing did not show for my player on a hosted server but it did show for the clients cuz i had it in the initPlayerLocal.sqf

pallid palm
#

lol @winter rose

#

well it all seems to work good with the briefing.sqf exec-ed in both the init.sqf and the initPlayerLocal.sqf

#

so only the host see's the briefing from the init.sqf and the client see's the briefing from the initPlayerLocal.sqf

#

that seems to be the only way i could get it to work like i want

#

of corse you know i have custom briefing.sqf

fair drum
tardy osprey
# pallid palm so only the host see's the briefing from the init.sqf and the client see's the ...

What kind of briefing have you made, and how do you fire it? I either use a CfgRadio, for a quick briefing over comms, or a video with this script, triggered by putting a side-specific unit inside a trigger to fire it. It shows for everyone at the same time.


["briefingvid.ogv", [10,10]] remoteExec ["BIS_fnc_playVideo", ([0, -2] select isDedicated), true];```
Video file located in mission folder.

The issue is if someone crashes or for whatever reason gets disconnected and then reconnects to the server, they are being subjected to the briefing again. (So if anyone knows how to make a "kill video" script when it has been completed to avoid this issue, i'd be thankful.)
tardy osprey
thin fox
#

by just letting it fire once

#

and server sided

tardy osprey
thin fox
tardy osprey
#

I use an in game trigger with the aforementioned script, to play a video file.

thin fox
#

how is your trigger set up?

tardy osprey
#

Blufor present, trigger fires only once. I cant look at the mission im outside.

thin fox
#

when you get home, check that

tardy osprey
#

I believe so. But i dont recall. Would ticking it as server only potentially fix the issue?

thin fox
#

if the server only is unticked, when the players comes back, he will load the mission again and load that trigger again to its machine

#

and for that player, the new loaded trigger on his machine wasn't fired

tardy osprey
#

That makes sense, yeah. Ill take a look when i can.

versed trail
#

is there a specific benefit to using FSMs over scripting normally? It doesnt seem like there's anything special with FSMs you cant do with scripting, its just more easily visible what's going on, so I was curious

fair drum
versed trail
#

Fair enough. But it doesnt grant any additional functionality you can't just hash out with enough switch cases in SQF, right? (metaphorically, theres obviously more things you need to touch, but its all doable in SQF)

fair drum
#

Yeah it's basically doing sqf itself on the backend, I believe they are scheduled and attempt to run at the fastest speed it can within scheduled environment.

granite sky
#

Which is their main weakness. They fire every frame even if it's something that only needs to run, say, once per 5 seconds.

#

I kinda enjoyed writing them but they're a drain on performance.

versed trail
#

Yeah, I mean you're just making an overly complicated flow chart, seems more fun than writing it by hand :P

fair drum
#

It also has the lack of script macros. So for instance, LAMBS does function calls instead of inline code in the fsm so they can utilize macros.

granite sky
#

hmm. Isn't LAMBS working from a native rather than scripted FSM anyway, so it's not really SQF until it calls?

open flume
#

so im trying to use titletext with valign to have text on the top of the screen, but i cant see to get it to work and the wiki said its broken. Is there a work around or just gotta wait for it to get fixed?

granite sky
#

structured text?

hallow mortar
#

Alignment is for alignment within the text control, not within the overall screen. titleText doesn't give you control of the text position.
If you want to put your text in a specific place on the screen, you might need to create a UI control (ctrlCreate) so you can directly manage its position.

tidal idol
#

Is there a way to disable rotation of or otherwise "lock" an aircraft's pilotcamera via script that doesn't involve something like looping every second and zeroing rotation?
Or disable it altogether

finite bone
#

Lets say I have a function PEPE_someFunction - If remoteExec this entire function will it work on the server?
i.e.

remoteExec ["PEPE_someFunction", 2];``` will this actually work in the server or does it need it to be broadcasted first?
#

No the function is local - I am wondering if it is passed as is or the remoteExec only passes the reference which then instructs its client (in this case the server) to execute a function that corresponds to the one that is passsed.

#

I'm thinking of avoidingpublicVariableServer

errant iron
# finite bone Lets say I have a function ``PEPE_someFunction`` - If remoteExec this entire fun...

yes, it requires the function to be defined on the client where it's executed:
https://community.bistudio.com/wiki/remoteExec

7erra
The remoteExec'ed function only has to exist on the target machine. For example:

// initPlayerLocal.sqf
TAG_fnc_testRemote = {
    hint "Remote Exec Received";
};
// executed on a DEDICATED server
remoteExec ["TAG_fnc_testRemote", -2];``` Will display a hint for every client. This is especially useful for when the server is running a mod that is not required by clients.
finite bone
#

But what if its reverse - the function exists locally in the client system and I want to run in the server

errant iron
finite bone
#

So in theory, even if being remote executed, two clients (in this case, a server and client) can have different functions but under the same function name and execute different things.

errant iron
#

that sounds about right

finite bone
#

What I assumed is when you remoteExec with a function defined, it will pass the value (in this case the whole function) to the remote client / server and execute it. But what actually happens is that the function name is passed as a reference for the remote system to fetch from its pool and execute it as is.

errant iron
#

yep, if you wanted the code to be sent as a value each time, you'd write [args, {code}] remoteExec ["call", 2]instead

#

of course that's more bandwidth-intensive, and also doesn't play well with CfgRemoteExec function whitelisting

finite bone
#

Thought as much. Thanks for clarifying anyways.

foggy pike
#

It does @cedar kindle

stable dune
fair drum
#

if hes making a mod, then the function will exist on the server. what it sounds like he is asking is how to do a function on the server in a zeus execution because he states that the function only exists on the client

small gyro
#

Is it possible to force player controlled unit in vehicle to move forward without setPos or setVelocity? I just need to let unit move his car forward while he is a driver of vehicle

sharp grotto
hallow mortar
#

If you only need straight forward you can use setCruiseControl, but if the driver applies the brakes, the cruise control will be turned off

pine garnet
#

Hello!
Are there any vector commandsโ€” or method for setting the pitch of a player unit's view angle?

For demonstration purposes, I have created a trigger that will kill a player and have them respawn instantly when triggered.
There is a 'Killed' and 'Respawn' EH on the player, whereas the player's current view direction vector is saved and creates a sphere on the desired "look" position when 'Killed' fires.
The goal is to have the player look at said position (ideally same camera view direction) after respawning, but I am not finding any command that would accomplish this together with setting the pitch.

Thank you in advance!

winter rose
pine garnet
#

I was afraid that would be

winter rose
#

perhaps by setting the unit's pitch then let the game reset its up vector, keeping the camera

#

however, you can absolutely create a camera and manipulate it ๐Ÿ˜Š

tall linden
#

is it at all possible to make individual players have night time while other players have daytime?
I want it to when a player uses a teleport to enter a tunnel, it also sets their time to night time so its dark like a tunnel should be instead setting everyone to night time.

hushed turtle
#

Arma 3 synchronizes time automatically every 5 secs or so

#

Question is, can we disable time synchronization?

tall linden
#

i didnt know that. i will see if i can look into it

errant jasper
#

Back in the old days the time commands were local, but it caused lots of problems for people not accustomed to multiplayer scripting and locality. Also a server with low fps could literally fall behind, so you might have reached night time but the server ai thought it was just getting dark.

winter rose
hallow mortar
#

Just because of the spam removal I think

winter rose
#

ah, fair

hushed turtle
wintry wolf
#

I have made 2 scripts and want to make them into a mod, they depend on ACE and CBA, can someone please help? I have never made a mod before

tulip ridge
#

You'd need to give more context on how they're written

wintry wolf
tulip ridge
#

The event scripts are only for missions, they won't automatically be called from pbos

#

You can also add ace actions through config

wintry wolf
tulip ridge
#

Just add the action through config and have the action call your digging function

wintry wolf
thorn charm
#

Hello. I would like to be able to enable/disable a change made in the cfg configuration (a value parameter). My idea is to let my editors decide whether to enable it or not. I don't mind if the mission has to be restarted.

thorn charm
# fair drum Elaborate more.

I am new developer.. Let me give you a simple example: I want to allow the editors to change the fuel capacity of a vehicle between 20 or 40 (only two values). If the "setting" is enabled the fuel capacity is 20, otherwise it will be 40. How the editors makes that change is not what I'm primarily looking for. I'll figure out how to do it myself, whether with a module, cba settings.... (without modifying the addon, of couse). What I want to know is whether it's possible to enable/disable this by chaging from one value to another. And as I said, I don't mind if a restart is requiered for the change to take effect.

class CfgVehicles {
    class Vehicle1 {
       fuelCapacity = enabled? > 20; not enabled > 40;
    };
};
#

Thank you

errant jasper
#

Don't think you can overwrite fuelCapacity from a mission itself. But you might look into setFuelConsumptionCoef. Perhaps then you could examine the mission parameter and whether to vehicle setFuelConsumptionCoef 0.5 to double the range.

thorn charm
errant jasper
#

Okay, but in that case, if the properties you want to adjust are of say vehicle entries, then I don't belive those can be changed from a mission.

jade acorn
#

the sound distortion when you pass by the sound source (or it passes you) fast, is this something I can control via scripting? As in changing the sound's/music's pitch without playing it from the start.

fair drum
thorn charm
thin fox
spiral canyon
#

If I have a checkbox in a vic attributes in Eden that will add event handlers to the vic, how do I get it to actually work? Is there an order of operations that needs to be done? If I add the event handler normaly to the init box, it works fine but I cant get my mod to do the same. Is it not basically the same thing?

cyan dust
#

Good day. I use waypoints to move enemies around and/or attack players, but sometimes I see them just standing there and not moving ๐Ÿค”
Is there a way to debug this? What may be causing AI units to get stuck like that?

warm hedge
#

Would suggest to remove Mods first

cyan dust
hallow mortar
#

Wait 'til you find out what those patrol scripts use to control the AI

#

So what did you use instead of waypoints?

#

I would like to know what you are using inside the patrol script, to control where the AI move to, that is not a waypoint

#

I was thinking more about patrols outside of buildings. Waypoints are usually not used for precision movement inside buildings, for any purpose, since they're not very precise and can't control individual units within a group.

#

You keep saying "oh I just use scripts". My dude, scripts are a set of commands, not a magical thing that has its own inherent functionality. What commands are being used?

#

I actually don't feel like doing this for another 30 minutes so I'll skip to it: the thing I am getting at is that most group-level patrol scripts use waypoints internally.

#

If you understand the script, you should be able to tell me what commands are controlling the AI movement, without just pasting the whole thing.

#

Well, fair enough. I'm genuinely surprised it's using commandMove and doMove rather than waypoints.
I'm a bit surprised it works properly as well, I would've expected that using direct movement commands would prevent the AI from switching to combat maneuvers upon encountering the enemy.

old owl
#

Is there any known solution out there to prevent players from utilizing map functions like "Vote Kick" and "Vote Admin"?

I attempted to find the corresponding controls by checking ctrlText of allControls across allDisplays with no luck. Does anyone know if there is a way to access these controls? Alternatively and perhaps the better question- is there a way that I can prevent #vote from being available to the client?

hallow mortar
old owl
#

Thanks so much you guys, I was losing my mind haha. Kind of crazy that we haven't done that after all these years- knew there had to be some way...

#

This was currently our server today ๐Ÿ™ƒ

split ruin
#

what is wrong with this landing waypoint ? heli just sits forever on the previous waypoint ๐Ÿค”

//first wp works fine
 private _movepos = [[6497.84,6497.37,0], 0, 7000] call BIS_fnc_findSafePos;
 private _wp1 = _qrfpltgrp addWaypoint [_movepos, 50];
 _wp1 setWaypointType "MOVE";
//second waypoint doesn't work 
private _landpos = [(leader lynx), 300, 500] call BIS_fnc_findSafePos;
private _wp2 = _qrfpltgrp addWaypoint [_landpos, 50];
_wp2 setWaypointType "LAND";
 [_qrfpltgrp, 2] setWaypointScript "A3\functions_f\waypoints\fn_wpLand.sqf";
#

the line is

[_qrfpltgrp, 2] setWaypointScript "A3\functions_f\waypoints\fn_wpLand.sqf"; 

landing waypoint ?

hallow mortar
split ruin
#

omg it should be "SCRIPTED" lol ๐Ÿ™‚ the waypoint type

hallow mortar
tough parcel
#

dear, i try to change maxgroup by side (144) to more. someone know how to?

split ruin
#

same behavior ๐Ÿ˜” the heli just hover on the previous waypoint and that's it ...

silk hill
#

didn't know that was possible

split ruin
#

it says qrfheli is array not object ๐Ÿคท

private _rpos = [["ao_mrk"], ["ru_base"], {}] call BIS_fnc_randomPos;
arr = [_rpos, 180, "B_Heli_Light_01_F", west] call BIS_fnc_spawnVehicle;
qrfheli = arr select 0;
qrfpltgrp = arr select 2;
qrfpltgrp deleteGroupWhenEmpty true;
qrfpltgrp setBehaviourStrong "CARELESS";
[qrfheli, 500] call BIS_fnc_setHeight;

 private _movepos = [[6497.84,6497.37,0], 0, 7000] call BIS_fnc_findSafePos;
 private _wp1 = qrfpltgrp addWaypoint [_movepos, 50];
 _wp1 setWaypointType "MOVE";

 landpos = [(leader lynx), 300, 500] call BIS_fnc_findSafePos;
 private _wp2 = qrfpltgrp addWaypoint [landpos, 50];
 _wp2 setWaypointType "SCRIPTED";
[qrfpltgrp, 2] setWaypointScript "qrfheli landAt [landpos, 'GetOut', 10, true]";

landAt doesn't want local vars it says its global space etc. ...

thin fox
#

this script I did for my own qrf setup

#

can land or drop units in air

split ruin
#

@thin fox thanks I will look at it, the script I made works except the landing part

thin fox
#

it's always tricky

tough parcel
#

@silk hill dwarden say it can. I find some group info in CfgWorlds. but not sure how

granite sky
#

Not sure how qrfheli would become an array unless you're setting it somewhere else too.

split ruin
#

@granite sky nope, its just what I posted, its weird

granite sky
#

Oh, you have the wrong syntax for setWaypointScript though?

#

It's not a standard SQF string.

#

If you want that instead, put the waypoint a bit further away and then use setWaypointStatements instead.

split ruin
#

@granite sky got it working

_landpos = [(leader lynx), 300, 500] call BIS_fnc_findSafePos;
private _wp2 = _qrfpltgrp addWaypoint [_landpos, 50];
_wp2 setWaypointType "SCRIPTED";
[_qrfpltgrp, 2] setWaypointScript "A3\functions_f\waypoints\fn_wpLand.sqf";
[_qrfpltgrp, 2] setWaypointTimeout [10, 10, 10];
#

I wonder if waypoint type "GET OUT" will do better ...

granite sky
#

GET OUT is broken.

#

Might work ok for this case but I have zero trust for it.

split ruin
#

and there is another type of waypoint mentioned "Transport Unload" ...

#

is this waypoint type even existing?

granite sky
#

Yeah, that one's not bad.

#

With TR UNLOAD the crew group doesn't leave, only the cargo group. I'm not sure what it does if you don't have a 2-group split.

split ruin
#

@granite sky I have two groups - pilots and troops in cargo

buoyant hound
#

Hey
Any guide for trigger that count tanks in area?

tulip ridge
#

Or whatever list of objects you want to check, thisList will be whatever matches the trigger's condition

indigo snow
#

Its not in any configs i know of

#

I would be very surprised if its actually possible

#

Unless you count sneaky ways like alive virtualizing groups...

silk hill
#

it's a trick.. get an axe

indigo snow
#

Or store them in a separate side while theyre not used, like sideLogic :D

sweet vine
#

If you changed loadouts of units in 3DEN using setUnitLoadout like so for example playableUnits apply { _x setUnitLoadout "B_Soldier_F" };

Changes aren't applied either to preview or even if scenario was saved, any solution for this?

warm hedge
#

save3DENInventory

sweet vine
#

Ahh tysm

split ruin
#

@thin fox your script works perfectly and do the job, the only thing I couldn't figure out is to tell qrf troops to stalk player group after they left the heli

//these are the params I pass to your function 
[
        _rpos,
        "B_Heli_Light_01_F",
        west,
        KIB_specOps,
        _landpos,
        [10,100],
        120,
        false,
        "
        params ["_groupTroops"];
        private stalking = [_groupTroops, lynx] spawn BIS_fnc_stalk;
        ",
        ""
    ] call PIG_fnc_heliDropTroops;

I suggest you add number of troops for the qrf group because they spawn two additional guys when little bird is used, thank you again for this script ๐Ÿค˜ ๐Ÿป

still forum
warped thicket
#

@cedar kindle yes it does, it uses InitPost extended event handler on CAManBase class attached on each machine, this automatically includes units in vehicles as well, then it starts the 15 second delay to prevent desync, then just goes through all groups, passes them to HCs and flags them with "passed" variable, those are not checked again next time unless full rebalance is forced (when an HC connects or disconnects)

thin fox
thin fox
tough abyss
#

Hello all. I want to make a jukebox for admins to use in my server. To keep the mission file reasonable, I will make a simple mod and use the path from there. I should be able to do that with this: Use CfgSFX to make a sound pack mod, of ogg music.

My question on the script side, is if this will suffice, or are there things I am not thinking of yet?
addAction > setMusicEffect + sleep and/or !alive, etc.

I have never used setMusicEffect, so I am open to any ideas.

split ruin
#

@thin fox whatever I write in the troops script I got "Script not found" ๐Ÿ˜”

[
        _spos,
        "B_Heli_Light_01_F",
        west,
        KIB_specOps,
        _uberPos,
        [20,50],
        100,
        false,
        "",
        "
        params ['_groupTroops'];
        private _stalking = [_groupTroops, lynx] spawn BIS_fnc_stalk;
        "
    ] call PIG_fnc_heliDropTroops;
tulip ridge
#

I assume that's what you're wanting at least, since it's for a jukebox

tough abyss
tulip ridge
#

Haven't used it before, but it seemingly just lets you set the music track to play on the trigger / waypoint rather than having it in the waypoint / trigger code itself

#

I don't know about any specific pros/cons to it over using playMusic in the waypoint / trigger code itself

tough abyss
tulip ridge
#

I guess it's maybe intended for if you're creating waypoints or triggers from a script, but for triggers you can still customize the statement so not sure there

tough abyss
#

I have a virtual item system, and could make tokens for the jukeboxes, add a longer sleep to prevent spamming, and let players use them. How would I make the addAction only work with a set of requirements?

tulip ridge
#

You'd set the condition

tough abyss
tulip ridge
#

For any complex condition, I'd strongly reccomend using toString and a code block so you can read the code easier. E.g.

this addAction ["title", {
        params ["_target", "_caller", "_actionId", "_arguments"];
    }, nil, 1.5, true, true, "", toString {
        // Your condition here, e.g. checking if the player has a coin
        "YourPrefix_coin" in items _this
    }, 5
];
tough abyss
#

Wow, that will make things WAY easier. I am not ashamed to admit, I started with notepad for my first month, haha. That formatting will be helpful for just about everything.

thin fox
split ruin
#

@thin fox I packed it as sqf, no errors but heli just hover over player group

//this is in the file
params ["_qrfgrp"];

private _qrfstalking = [_qrfgrp, lynx] spawn BIS_fnc_stalk;
//arguments to the function  
 [
        _spos,
        "B_Heli_Light_01_F",
        west,
        KIB_specOps,
        _uberPos,
        [20,50],
        100,
        false,
        "",
        "stalk.sqf"
    ] call PIG_fnc_heliDropTroops;
thin fox
split ruin
#
params ["_qrfgrp"];
private _qrfstalking = [_qrfgrp, lynx] spawn BIS_fnc_stalk;
thin fox
winter rose
jagged girder
#

Hi I have a scripted WP to make vehicles follow a straight-line path, and I'm wondering why after they get there they just spin in circles? What causes this behavior?

blissful current
#

I'm getting an error for undefined variable _firstUnit here. But it only happens in SP when switching to a unit out of the trigger area. Any idea what is going on?

thisList spawn {

  private _firstUnit = _this#0;
  _scout = missionNamespace getVariable ["scout", objNull];
  
  if (_firstUnit == _scout) then {
  //code
  } else {
  //code
  };
};
#

This is placed in a trigger set to fire when players are in the area.

pallid palm
#

i never saw this before ------->_this#0;

granite sky
#

It's not incorrect in isolation but it's wrong here.

pallid palm
#

maybe it should be private _firstUnit = _this;

granite sky
#

well, not wrong unless the list is empty...

#

so that's probably what happened.

#

Is this activation code or deactivation code or both?

blissful current
#

Activation code.
So by using U to switch units it thinks the list is empty? But the trigger only fires once right? And when I does the list can't be empty because it wouldn't be able to fire in the first place.

fair drum
#

this is why we use params

blissful current
#

Sounds like this is the moment to learn what they actually do.

#

Mostly they seem to behave like variables to me.

#

Reading the wiki now.

fair drum
#

it has a default value, just like your getVariable. you can use that to do checks with. abort if things are undefined, or make it use a default value, etc

#

but you should use diag_log more often. I notice you don't use it much when you ask questions. It will tell you what is in the variables you are passing.

params [["_firstUnit", objNull]];
diag_log format["First Unit: %1", _firstUnit];
blissful current
#

Thats for debugging right?

blissful current
#

Where would I see the diag? I'm looking for it in systemChat but I haven't noticed it yet.

fair drum
#

in the arma log file

#

if you are using vscode, theres an extension to open it up using a shortcut, otherwise you have to go to your profile to find it

blissful current
#

The rpt. Oh yeah I never look at that file because its like a foreign language. Any tutorials on what to look for in there? It's hard to parse what is important or not.

fair drum
#

you would ctrl f your diag line, such as "First Unit"

granite sky
#

A good general one is "error in" which will pick up all the SQF errors so you can read them at leisure.

#

But if you're not using diag_log already then they're probably at the bottom.

thin fox
fair drum
#

you can also use a watcher extension that will follow the lowest line in the file as they are created

#

and you can see stuff in real time

#

berublan.vscode-log-viewer

tulip ridge
#

Hemtt vs code extension also does that, with a keybind to open your latest rpt

blissful current
#

Thanks yall ill dive into this tomorrow

honest lichen
#

is there any way to prevent bots from discharging 8 mags into unconscious players? maybe script or dedicated mod?

rigid girder
#

how

honest lichen
#

i don't know, but we are playing a lot of pve cqb scenarios with my friends, and when they are losing conscious (ace medicine mod), closest bots just dump all of their mags into that poor player, who end up with 1000 traumas. I personally saw that while was zeusing

pallid palm
#

lol that seems funny

pallid palm
#

Hello All again: i want to addaction to one of the (spawned enemy soldiers)
where He has a (key) or a (jump drive) in his inventory: that you can take from His Dead Body:
and then if you have this key in your inventory: you can unlock the labtop:

I have the labtop set to unlock: if all enemy are dead at that location ATM:

stable dune
pallid palm
#

yes

stable dune
#
"'youItem' in items _this"

or if multiple item

items _this findIf {"firstItem" in _x || "otherItem" in _x} != -1
pallid palm
#

oh wow cool man

#

very nice thx @stable dune

buoyant hound
tulip ridge
#

?
You'd just do { _x isKindOf "Tank_F" } count <your list of objects>

buoyant hound
tulip ridge
#

I'm not sure what you're asking there

buoyant hound
tulip ridge
#

Yeah so just have that as the condition

#

Might need parenthesis around the left side of the >

buoyant hound
tulip ridge
#

That's it

buoyant hound
# tulip ridge That's it

I set this condition and a hint for test , condition not work cause no tank detected in zeus when i place them at trigge.

hallow mortar
#

You need activation:Anybody/Present otherwise thisList is not populated

#

thisList is generated based on the type/activation settings of the trigger, e.g. with BLUFOR/Present, thisList will only contain BLUFOR units that are in the trigger. If everything is set to None, thisList is empty.

pure hare
#

Hey everyone, I'm new to scripting, an i think i miss something here:

...
private _escapeSuccess = false;

while {true} do {
    sleep 4;
    if (!(alive _boat1) && !(alive _boat2)) then {
        break; // We lost our escape vehicles!
    };
        ...
    if (_onBoard && _allDistant) then {
        _escapeSuccess  = true; // Hurray!
        break;
    };
};

sleep 5;

if _escapeSuccess then { ...```
#

Language server says "Value of private _escapeSuccess = false; is never used"

granite sky
#

Language server, lol

#

Your code is correct. Whatever generates that warning message is not.

pure hare
granite sky
#

Even if the loop always wrote the value, it'd still be an incorrect warning. So more likely the VM isn't registering the use in the if statement for some reason.

arctic yoke
#

hey there, does anyone know if there exists a command for tfar to mute players? (eg. for a cutscene)

granite sky
#

There are a couple of variables you can set on players.

arctic yoke
#

got it, thanks a lot! ^^

jade acorn
#

does setHitPointDamage influence the actual damage to the unit? As in, if I set it on player's legs, does it increase the chance of killing player if actually shot in the legs?

granite sky
#

In that specific case it wouldn't.

#

Assuming that you're talking about the vanilla damage system.

#

Limb damage is non-fatal but limb hits also add a quantity of general damage, which is fatal when it exceeds 1. If you set the hit point damage directly then it doesn't change the general damage.

#

Note that there is no randomness in the calculations.

pure hare
#
private _weaponItem = selectRandom a3e_arr_CivilianCarWeapons;
    if !(isNil _weaponItem) then {```

I have a question for this piece of code: `_weaponItem` can become either `nil` or sth like `[x,y,z]`. If it is nil, i get an issue later, but if i check for nil, it says 
`22:02:38   Error isnil: Type Array, expected String,code`

So how do i check for either array or nil?
granite sky
#

isNil "_weaponItem"

cursive tundra
granite sky
#

Yes, but probably only a slow way.

#

Maybe if you chain enough tiny chunks of simpleVM code together with apply and select then you can get it nearly as fast as the engine methods.

#

hmm, unless waterDepth returns negative values. I forget.

cursive tundra
#

Ambient Parameters: waterDepth 0..M where M is the actual water depth, and 0 on land. :/

granite sky
#

sucks

thin fox
granite sky
#

uh

#

getting terrain altitude at a point is just ATLtoASL [_x, _y, 0] select 2

#

but having to iterate over a lot of positions yourself in SQF is not good.

blissful current
#

I have an interesting issue I just found. My helicopter lands like this:

[ExtractHeliGroup, [8584.56,8187.52,0], ExtractHeli] spawn BIS_fnc_wpLand;

But I must have been accidentally standing on that exact spot because the heli tried to land but then gave up and flew a few hundred meters north. I've been able to recreate this situation a few times now. Any ideas on a fix?

granite sky
#

uh, what behaviour would you want? The heli to land on your head regardless?

cursive tundra
#

im having a weird situation going on now - i get an error message saying "Error Type Any; Expected Number" when i call my function like this sqf private _mediumHillsInArea = [position player,1500,100] call AWP_fnc_findMediumHills; however when i call my other function sqf private _forestsInArea = [position player,1500,400] call AWP_fnc_findForests; there is no Error - the thing is those 2 functions are basically completely identical, the line that i get the complaint about is ```sqf
private _selectMediumHillsInArea = selectBestPlaces [_position, _radius, "hills", 50, 300]; /// throws Error about wrong Type

private _selectDenseForestsInArea = selectBestPlaces [_position, _radius, "(forest)* (1 - sea) * (1 - houses)", 50, 70];  /// no Error
```
#

im assuming its about the _radius but like why?

granite sky
#

You'd have to show the rest of your function.

pallid palm
#

lol i remember setting up chopper stuff way back in The Unsung Mod omg im so glad we have Arma 3 now woohoo

arctic bridge
#

Figured I'd ask about this; run into a really odd bug where the icons (using drawIcon3D) will just disappear for no apparent reason. Sometimes it happens when using a scope, sometimes when going to third person, I've even had it happen when I've pressed R to reload.
The function is still running perfectly fine in the background, all the conditions are firing and none of the variables are undefined or anything like that. Even reinitializing the event handler doesn't fix it.
The weird thing is it only happens to enemy units, friendly units seem completely unaffected.

Apologies for the spaghetti code in advance

GVAR(fireControlHandlerAdded) = true;

GVAR(fireControl_handler) = [{

    [call FUNC(nearUnits)] call FUNC(IFF);
    call FUNC(weaponCrosshair);
    call FUNC(nametags);

    }, 0.01, []
] call CBA_fnc_addPerFrameHandler;```
granite sky
#

Do weaponcrosshair and nametags also stop rendering? Does it stop for all units at once or just some? Does it ever come back?

arctic bridge
#

Only enemy IFF tags, everything else including friendly IFF stays
I tried adding a systemchat to the enemy condition of the IFF function and everything is working just fine even after the tags disappear. Also tried checking just before the drawIcon3D command, still fine

granite sky
#

You're saying that the units in the clip are alive? I can't tell.

arctic bridge
#

They are

#

I thought maybe the dead/uncon check might've been overwriting the later check but that wasn't the case either

granite sky
#

which datalink mode?

arctic bridge
#

Side, case 0

granite sky
#

I would guess that the knowsAbout is dropping to 0.

#

You're quite far away.

arctic bridge
#

It isn't, checked that too

#

And if I press T it does nothing (when working it'll reveal the enemy)

granite sky
#

Did you check getFriend too?

arctic bridge
#

I think? I've still got the mission open, I'll double check

#

Yeah they're still enemies

granite sky
#

Dunno then. That seems to account for everything. You'd need to add some brutally spammy logging to figure out what's falling through.

arctic bridge
#

Mm. I'm wondering if it might be some kind of weird issue with the game itself? I tried increasing the sleep time on the handler just to see if that might've been the issue

granite sky
#

Can't say until you did the logging. Your function is too complex to be sure otherwise.

#

Sleep time on the handler doesn't make sense because you said friendly IFF tags were still rendering.

#

Which means it's clearly running the code.

#

Unless you accidentally have a second copy that's actually what's rendering the friendly IFF tags.

arctic bridge
#

Or maybe the handler init is being recalled constantly? The IFF function is definitely only called in one place in the entire mod

#

Nope it's not that either, just tested it

granite sky
#

printf debugging anyway. Add like 10 diag_logs to that function that print if a global var is set, then clear the var afterwards.

arctic bridge
#

Huh, my original suspicion turns out to be correct lol
It was the icon colour alpha all along lol

#

Ok now I'm even more confused, how the hell is this even happening?
It's not like it's being completely overwritten, it's just the alpha channel that's being overwritten

granite sky
#

Wouldn't be surprised if that was an engine bug.

#

hmm. It's drawing a one-pixel icon?

arctic bridge
#

The size is fine, 1 is an expected value

#

Well shit lol
How am I gonna fix this

#

Thanks for the help man

granite sky
#

I assume you're setting GVAR(fireControl_enemyColor) in literally one place?

#

I guess 1 isn't one pixel:

The width and height parameters are multipliers for activeWidth and activeHeight set in config

arctic bridge
granite sky
#

hmm. Does CBA settings actually support alpha for colour? I've never used it.

#

Their example is just RGB.

tulip ridge
#

It's just rgb

arctic bridge
#

It does support alpha

tulip ridge
#

Message was delayed, but yeah never knew that. Only used color specially like once

pure hare
#

Idk if this is helpful at all to arma modding, but in graphics programming, textures and the backbuffer are stored in 32 bits, as R8G8B8A8. When you want to overwrite only one channel, you have to activate a render target write mask or specific blend instructions, otherwise it will replace all channels. So have you tried not just changing alpha but all channels (basically copy-paste the rgb values)?

arctic bridge
#

In the function it should be overwriting every channel

steel spoke
#

alright

#

here's one for you chat

#
class EventHandlers
{
   init = "params ['_entity']; [_entity, 'Imperial Command Post', 'I', 1, 10, true] call AWR_fnc_commandPostInit;";
};

i do this. my function works fine! except for the fact that if i place my object down in eden editor it will initialize, which will cause eden to explode, or make it init twice on maps

how do i get it to stop doing... that.

tldr; i want the init eventhandler to not run in eden editor

rn i have this inside my init function

if (!isServer) exitWith {};
but this obviously is so it doesn't run on clients

anything else i could add? bc i've been looking and i can't find anything on this

warm hedge
#

is3DEN

steel spoke
#

i love you

steel spoke
#

ok part 2

#

nvm i fixed it <3

tardy osprey
#

Has anyone used these animations before?
BRIEFING
BRIEFING_POINT_LEFT
BRIEFING_POINT_RIGHT
BRIEFING_POINT_TABLE

Basically, I wanted to do a thing in multiplayer where an officer walks over to start the briefing, i've forced him to dowatch a chair, sleep for a moment to make sure he completes the turn, I then used the point right animation to test it out. Problem is he just uses the default briefing animation, hands on his hips. But also the game strips his character of hats and clothing?

warm hedge
tardy osprey
thin fox
#

sometimes just works and sometimes doesn't (when it doesn't work, from the client perspective, restarting the mission gets the function to work), sometimes just rotate the unit to 0ยบ even though it's attached to a object, using the parameter option, I just gave up on using that

bold rivet
#

Someone knows where I can find a list of the vehicle "bases"? Like UAV_01_base_F.
Not the individual vehicles like B_UAV_01_F or O_UAV_01_F. But the "base", idk how to call it.

fair drum
#

Use the config viewer, it lists the entire hierarchy.

bold rivet
#

In CfgVehicles ?