#arma3_scripting

1 messages ยท Page 189 of 1

granite sky
#

Most of those event handlers are global-argument, but the EH often only fires where the object is local.

azure portal
#

And people wonder why I get a headache maintaining my community's mods ๐Ÿ˜‚

#

Locality is the one thing that has always hurt my brain

meager granite
loud totem
#

yo, im making a mission revolving around CSAT and taking them down, and i want the riflemen on the CSAT side to attack civilians to show how brutal they are, is there a script to do this????

granite sky
#

You can join the civilians to a blufor group, and then redfor will shoot at them.

loud totem
granite sky
#

In script it's just joinSilent. Can be done in the editor too, IIRC.

loud totem
#

ty!

#

okay so dumb question what would i type in ive never scripted beforre

#

i did

#

this joinSilent blufor; and its telling me joinSilent needs to be in an array

lyric gulch
#

Would this be the correct place to ask for a walk through on making a mod. I already have the code needed I just need to know how I need to package it to upload to steam so people can subscribe and it will work

steel hollow
#

I'm creating a scenario where the player is a police officer and they get dispatched to a warehouse. There are 2 suspects at the warehouse and I've been trying to write a script that makes the 2 suspects shoot the player if the player draws their weapon 15 meters near the suspects. How can I make this happen?

icy ridge
icy ridge
icy ridge
# steel hollow I'm creating a scenario where the player is a police officer and they get dispat...

You can make a trigger which changes the suspect's side to an opposing side when the player enters it, or performs a certain action etc. That should make them hostile towards the player and engage him.

Side swaps can be achieved by having them join a group on a different side. For example, given they start out as civilian and the player Blufor, you can have the suspects join an opfor group, making them be considered opfor and thus hostile to the player.

cedar bay
#

tnx guys

#

i'm glad the script works, just report syntax is wrong ๐Ÿ˜ƒ

still forum
#

That is because, it doesn't use simpleVM.
Because its too large.
&& {_x} would fit

#

__EVAL is NOT preprocessor.
Why do you want to do that? Detect if a mod is present?

proven charm
cosmic lichen
#

I feel like there are better ways these days.

#

We have hasInclude for config, fileExists for script.

#

What tool are you using to build your addon?

proven charm
#

the official addon builder

cosmic lichen
drifting badge
#

Still - unsuccessfully - trying to find a way to somehow get the dropoff/pickup location of the "virtual heli transport support" module that is available in vanilla ARMA 3. There has to be a way the AI knows where to go (the player does in fact tell the module where to pick him up and where to drop him off), so the position info MUST be there somewhere and so one should be able to get/grab that info? But how best to do that?

little raptor
#

if you've already tried that but failed, explain your setup/code

drifting badge
#

@little raptor - Oh that one I did not try.

So far I have the following, with works nicely (put in the INIT field of the platoon leader player). To explain the code below: If you call the virtual AI support transport heli, you can pop a green smoke grenade if you see it coming and this will move an invisible helipad to the location of the green smoke and thus force the AI to land there (effectively helping it to land at a good spot -> before the AI sometimes decided to land elsewhere, either too far away or in a bad spot, leading to its destruction). The invisible helipad then also gets moved back to its original position "off the map" after 30 seconds.

This got me thinking that it would be easier if what I am doing with the smoke grenade would happen right away, when the player calls up and selects the pickup and then after getting on the heli the dropoff position for the virtual transport heli. Because with the above one you still encounter the issue that the heli does not want to drop you off at the location where you ask him to, but looks for a different spot. (Might be that all this is due to the AI having issues with the custom map - so could be it needs this little bit of extra help.)

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

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

// your code here
hint "good!";
granite moat
#

I hesitated to post this here but I think it can help someone create its own version of the script. And I did not find a similar implementation online so here it is

New little script to clear LZ using hatchets (cut tall grass, small trees, etc.) or C-4 for bigger trees.

https://youtu.be/JCx0XhzJ0A8

the link to the git is in the video description. And if you have suggestion to improve it feel free to ping me ๐Ÿ‘

Short video showcasing How to clear an LZ using hatchets and C-4 via one of my script. Works on dedicated server !

For installation and how to use, see documentation & implementation on Git: https://github.com/gerard-sog/arma3-macvsog-columbia-scripts

Arma 3 Vietnam unit: https://discord.gg/dyeUNXHFqS

โ–ถ Play video
drifting badge
#

@granite moat - Oh that is a very cool idea!

digital hollow
#

FYI You can set the direction of the tree fall with alt syntax of setDamage

fierce marlin
#

Anyone have a method to force AI (in parachutes) to come toward ground with some speed / motivation?
On spawn each one gets; addWaypoint ("MOVE"); setWaypointSpeed "FULL"; setBehaviourStrong "CARELESS"; (Did try without setting behaviour, no difference)
They all just float down slowly / aimlessly.
CODE = https://pastebin.com/ZkBZwvKv (WP stuff @ line 100).
VIDEO = https://www.youtube.com/watch?v=IIVK11YhP3g&t=447s (~20-30 sec of relevance).
I'm sure I knew the answer here, but I don't work with AI as much as years ago. A friend however wanted me to build him a mission for practicing shooting parachutes, but it's essentially useless if they behave like this :(. Sorry for the long message!

I didn't want to make this vid so damn long :X
99% done just gotta finish a secret, and hope someone knows how to make the parachutes fall faster, then I'll release a compiled (Playable) version and Editor version of the mission for anyone else if wanted.

โ–ถ Play video
tulip ridge
#

Just setVelocity / addForce

fierce marlin
#

o.O that is temporary / doesn't affect how they move in the parachute, they'd just come down like a cannon :D

#

I'll try it but I don't see that being beneficial for practicing shooting them

fierce marlin
#

Tried both, setVel is too absolute / non adjustable for the purpose, I tried using a loop of addForce on the parachutes (world & model space), but no matter how strong (10k newtons) I make it they seem to negate it after about 0.25 sec :/

tulip ridge
#

setVel is too absolute
Well sounds like you're just doing a straight setVelocity which would obviously remove their existing velocity. You'd want to add whatever values you want to their current velocity

fierce marlin
#

that's a lot of calc for constant parachuters falling tho

#

I'm pretty sure the issue here / fix is AI behaviour

tulip ridge
#

It's like three lines

fierce marlin
#

to do it once....

#

but like I said before, that's a straight line

#

that's not what I want for practice lol

#

that's why I tried a loop with addForce, so they'd change direction speed etc constantly

tulip ridge
#

You can also just increase velocity in whatever direction the parachute is facing

quaint oyster
drifting badge
#

@little raptor I was thinking that this might be useful and could be utilized somehow:
[caller, vehicle, position, mainScope, secopScope] call BIS_fnc_transportService

since it has the "position" in there that is passed for pickup/landing

(or alternatively the addMissionEventHandler -> "MapSingleClick")

crystal marlin
#

Is it a bug if you spawn a drone and not get the AI crew along with it? Somebody posted on my Steam workshop item that he's spawning via script a couple of UAVs and the crew is not showing up, so is that something on the mods end? Or is it Arma being Arma?

cyan thunder
#

depends how hes creating the vehicle, you can create them with and without crew

crystal marlin
#

Okay, I don't know what he's doing, all he said is that the crew aren't spawning, so it might be on his end

cyan thunder
#

createVehicle on its own wont create crew

#

youd need createVehicleCrew, not sure there is a built in way to it in one pass, i rarely use createvehiclecrew tbh, I prefer to have more control since I like to be able to swap troops/crew out as I want

crystal marlin
#

Okay

granite sky
#

I remember specifically having trouble putting AIs in a drone manually. Like if you spawn them outside then they don't work.

#

So that's about the one thing we use createVehicleCrew for.

crystal marlin
#

Okay

cyan thunder
#

not at pc but as long as its B_UAV_AI or whatnot its never caused me issues and i use a lot of drones ๐Ÿ˜„

crystal marlin
#

Yeah I use that all the time, so that's not the issue.

cyan thunder
#

Possibly hes not not creating the crew or hes trying to use createVehicleCrew and thats failing somehow, config maybe but if you can place the unit in eden or zeus with crew checked i dont know how itd fail since afaik they do that internally

crystal marlin
#

Yeah as said I don't know the specifics as I don't script and didn't ask either. I'll pass this along though, and maybe that'll fix the problem.

split scarab
#

Can you overwrite settings from Description.ext on the fly? Like switching between vanilla revive system's basic/advanced incapacitate settings?

native harness
granite sky
#

Last I checked it was 100m, but I don't know where that comes from.

fierce marlin
topaz apex
#

hello friends :)
i come with another issue, much simpler this time thankfully

I need an AI jet's radar to be forced on to make player targeting easier. So, I put this setVehicleRadar 1; into the vehicle's init.

But I still had trouble getting a lock. So in the debug menu, I ran isVehicleRadarOn jet;, and it returned false.

...I don't see anything in the documentation that says anything about that kind of behavior. The command doesn't work on player-driven vehicles, but should function on AI vehicles. Yet, again, it doesn't seem to be?

#

...hold on i might be stupid, I don't think I'm using a vehicle that has radar capabilities.

#

that was the issue ๐Ÿ˜ญ ignore me.

ornate whale
ornate whale
drifting badge
#

Got another question, as I have been using the vanilla minefield module so far, but that has two issues: The first is that it does only place the vanilla mines/tripwires; the second is that the mine placement (at least for the trip wires) is less then ideal when random. So I rather place some myself at "good" locations and put in different presence percentages in regards to them being there. The problem I have is how to tell the enemy (and maybe also the civilians) where the mines are, so they do not accidentally run into them.

warm hedge
drifting badge
#

Ah so just "East revealMine _mine;" in the init field of the mine? Thanks @warm hedge !

warm hedge
#

this instead of _mine if you're putting it into the init

drifting badge
#

got it! much appreciated

little raptor
#

anyway I looked at the code but it seems that the position is registered via the FSMs which I can't open rn

drifting badge
#

@little raptor - Thank you for looking into this. Seems such a simple issue to get the position, but it really looks like there is no simple, straight-forward way to get it. Maybe to go the eventhandler and onmapclick is the better way to do it?

pallid palm
#

@drifting badge i made a complete chopper command useing radio triggers, did you try that at all

#

my radio triggers call scripts for 5 diff chopper commands

little raptor
pallid palm
#

also for water insertion and extraction

#

yes Dart helped me with this onMapSingleClick EH works awsome

#

i like it that you can just open the map and click on the map and the chopper lands right where you clicked so you must make sure its clear where you click

drifting badge
#

yes this is the only downside, that a player has to make sure the area is really suitable for the heli to land if one puts down invisible helipads in any form - another way to get round all of it is to put down preplaced LZs for the AI transport heli to use as the AI heli will prioritize those. Essentially the heli transport is only meant for those players that really do not want to pilot helis and rather have the AI do that work (they sure are missing out as piloting helis is lots of fun).

cyan thunder
#

given the way AI pilots in helo's land "Let me just hold stationary here and slowly descend at a speed that makes an arthritic old man look speedy" doing that anywhere near PVP is a recipe for an RPG7 enema anyway - even PVE LandVehicles will shred AI piloted choppers trying to land by default

lost leaf
#
{  
 _this spawn  
 {  
playSound "AlarmCar";
 };  
}]; ```
#

So, dumb question. I've been stumped on this for a while. I'm currently making a custom grenade that I'd like to have play a sound once it's thrown. The above script works, but of course it triggers when "any" weapon fires.

#

Is there any way to have the above script trigger, but only for the class my grenade is? Not really familiar with scripting stuff like this.

tulip ridge
#

You get a bunch of stuff passed to the EH, just read the variables

#

Also please for the love of god do not spawn a new thread on every weapon fire

#
this addEventHandler ["Fired", {
    params ["", "", "", "", "", "_magazine"];
    switch (_magazine) do {
        case "TAG_yourMagHere": {
            playSound "AlarmCar";
        };
    };
}];
lost leaf
#

The last part of my question would be, so the above script does work in-game running it with the console, but is there any way to plug the SQF file I can make with that into my weapons actual config file? Would something like that be bad for performance since I'm assuming it'd check for that specific magazine class any time something is fired?

tulip ridge
#

You'd make a function that would be called that would run that

#

Is your mod dependent on CBA?
Makes that a bit easier if it is

lost leaf
#

it is yeah actually

tulip ridge
#
// config.cpp
class CfgFunctions {
    class TAG {
        class Weapons {
            file = "TAG_addon\functions"; // Set where your function files will be placed
            class fired {}; // Compiles your function into a function named TAG_fnc_fired
        };
    };
};

class Extended_FiredBIS_EventHandlers {
    class CAManBase {
        TAG_yourAddon = "call TAG_fnc_fired"; // This runs your function whenever a unit fires
    };
};
// \functions\fn_fired.sqf
// This is an example of a function header, telling you what parameters it recieves, who made it, and what it returns
// These aren't mandatory, but make development much easier
/*
 * Authors: Your Name
 * Plays a sound when a grenade is thrown.
 *
 * Arguments:
 * 0: Shooter (unit or vehicle) (unused) <OBJECT>
 * 1: Weapon (unused) <STRING>
 * 2: Muzzle (unused) <STRING>
 * 3: Mode (unused) <STRING>
 * 4: Ammo (Unused) <STRING>
 * 5: Magazine <STRING>
 * 6: Projectile (unused) <OBJECT>
 * 7: Gunner (unused) <OBJECT>
 *
 * Return Value:
 * None
 */

params ["", "", "", "", "", "_magazine"];

private _sound = switch (_magazine) do {
    case "TAG_yourMagHere": {
        "AlarmCar";
    };
    case "TAG_yourOtherMagazine": {
        "SomeOtherSound";
    };
};

playSound _sound;
#

There's a quick little example

lost leaf
#

Geez that's insanely useful, Thanks a bunch for this! I'd been stumped on it for a while and couldn't seem to find much information, really appreciate it.

#

Oh wait, that actually brings me back to my other question though. Is it a bad thing to have a script like this optimization-wise, given that it seems like it'd be checking for my mod's grenade magazine class every time a unit fires, or is it a negligible difference?

little raptor
#

it's negligible for this
you can measure the code performance using the speedometer button

#

(you need to pass the args too because it's a function)

lost leaf
#

Cheers you guys, appreciate all the help. First time I've had to mess with SQF like this so I'm glad it can be implemented without bombing performance.

little raptor
#

instead of playSound you should use say3d btw

#

also since it's a man fired weapon you should use FiredMan

static arch
#

I'm trying to use the Animation Player in the Init category in the Eden Editor, but I can't figure it out, does anyone know how to use this?

little raptor
#

Animation Player?

static arch
#

I'm assuming its a part of a mod I have as it's not in the base game. I've tried googling it and using AI, neither work.

proud dome
#

Is there any functions to support connectToServer and allow me to first ping a server/check its online? Would be nice to add a little online icon to our community's servers.

little raptor
little raptor
#

if that mod is for playing anims itself you should read its docs (or get AI to summarize it for you or something)

little raptor
static arch
tulip ridge
little raptor
#

that's not the point

#

Fired EH doesn't work correctly for soldiers in vehicles

tulip ridge
#

It does, or at least every single time I've used it
I copy/pasted that same setup from a flamethrower

little raptor
#

This EH will not trigger if a unit fires out of a vehicle

tulip ridge
#

Oh that
Yeah forgot you can throw grenades out of vehicles

static arch
#

Nevermind, I got it^^

shrewd stratus
#

Anyone know if its possible to disable aim down sights? I want my players to not be able to aim down sights when wearing a gas mask.

spiral canyon
#

Is it possible to switch a players model to a different one while playing? Im trying to see if it possible to have a opfor player turn into a webknight opfor zombie when they reach a certain amount of damage.

tulip ridge
#

You could spawn a new unit and make the player remote control the unit though

And then maybe move their original unit somewhere else

spiral canyon
#

Ok, can I do it with AI units then?

tulip ridge
#

No

#

You can't change the model of any object on the fly

crimson lion
#

Are there any known issues with add3DENConnection currently? Running profiling atm. This code will not group the units together. I've spent a lot of time trying different variations, explicitly fetching Eden Entity and IDs instead, using syntax 1 for create3DENEntity, etc, but nothing: https://pastebin.com/apRcX0Gw

granite sky
#

Is edenList defined somewhere?

crimson lion
#

Yes before the start of that snippet

#

And then line 10 fills it

cyan thunder
#

if any of my players ever make it that far off map they are going to see some weird things happening ๐Ÿ˜„

digital hollow
#

Rediscovering that _v setPosASL getPosASL _v; moves the object if its vectorUp is not [0,0,1]. The biki doesn't seem to say which position types change value with orientation right?

static thunder
#

hi guys,
is there a way to force an AI jet to use full throttle on take off?

little raptor
static thunder
#

so in essence this will make the object move faster, but there is no way to manipulate the vehicles engine?

cyan thunder
pallid palm
#

hello Arma 3: Awesome people:

So if i have 10 playableUnits on my team (West side)
and only 5 of units are players, and the other playableUnits are Removed

How do i get a count, of the player units, that are still alive, and, select one player at Random

winter rose
pallid palm
#

wow holy cow Awsome Lou

#

that was fast as lightning

#

Love you man

#

im so glad i asked, cuz i would of had that all F-ed Up lol

proven charm
#

to get players you still need isPlayer check there

#

like: ```sqf
private _westUnits = units west select { alive _x && isPlayer _x };

winter rose
#

not exactly as "the other playableUnits are Removed", but always a good check - especially if more west units are added later

pallid palm
#

roger that m8s

proven charm
#

yea i may have misunderstood

pallid palm
#

you all did awsome imo

#

like he said its a good idea to check that anyway

#

thx you guys @winter rose @proven charm

#

really helpful, you guys are my ChatGODs

cyan thunder
#

I just use CBA_fnc_players ๐Ÿคทโ€โ™‚๏ธ - got bit by a HC once and that negates that happening ๐Ÿ™‚

winter rose
#

doesn't BIS_fnc_listPlayers cover that too?

pallid palm
#

i don't use any mods like CBA or ACE im Mod free WooHoo

#

i used to be a Mod addict, but i whent to mod rehab, and now i kicked the Mod Habit, lol

thin fox
#

it's very rare that I use something from CBA, but it has some very useful functions

cyan thunder
# thin fox Yeah, I've always try to make scripts without the need for mods

it really depends on the use case for me - nothing I do doesn't have ACE and CBA is a dependency of ACE so at that point I'd have to be crazy not to rely on the battle tested library built by much better sqf programmers than me ๐Ÿ™‚ - I take the view "why re-invent the wheel as long as you understand how the wheel works* ๐Ÿ˜‰

pallid palm
#

yeah i used to meet this friend on the street corner, and get Mods from him, but i don't go there any more, lol

thin fox
hallow mortar
pallid palm
#

do you guys remember Sickboy he helped start CBA way bak in Arma 2

cyan thunder
# thin fox I battle myself to see if I can make a script work without cba ๐Ÿ˜‚

๐Ÿ˜„ - suspect it's just attitudes from day job seeping in - in my world (enterprise dev) we are paid to solve problems first, program second - so the idea of not using existing good/widely used libraries is just weird - can I write a framework from scratch sure, is it a good use of my time probably not - it's an eternal debate in software development generally and I don't think there is a solution beyond "it depends" ๐Ÿ™‚

pallid palm
#

it should not effect non-playableunits right ? @hallow mortar

#

@cyan thunder i agree to your point, but see, im retired, and i have all day to do anything i want, like play golf, or learn from the Awsome people in discord, or play Arma 3, all day long, or well you know anything,

hallow mortar
pallid palm
#

ok rgr that m8

#

if its easy then im all about that lol

#

yeah it wont effect non-player units, cuz of { alive _x && isPlayer _x };

unborn rivet
#

I'm looking for a script that I could put into vehicle int field to make it unlocked only to specific player by Variable Name. I have 10 players slots and one of them is Pilot that has its Variable Name and would like only Pilot to be able to get into a helicopter. I want to limit who can fly.

hallow mortar
#

You can't do player-specific locking because all the lock commands are global effect.
What you can do is use a GetIn event handler on the vehicle to instantly kick out anyone who's not authorised.

pallid palm
#

i think the best way would be to eject out the people you dont want in the chopper

proven charm
#
this addEventHandler ["GetIn", {
    params ["_vehicle", "_role", "_unit", "_turret"];
}];
``` that ๐Ÿ™‚
pallid palm
#

wow thats Awsome @proven charm

cyan thunder
# proven charm ```sqf this addEventHandler ["GetIn", { params ["_vehicle", "_role", "_unit"...

aye and stick a this setVariable ["isPilot", true]; before that (on the actual pilot player unit) then can do if!(_unit getVariable["isPilot", false]) then { //yeet them } and that's about all you'd need to do (not how I'd do it personally but I avoid init fields entirely except for setVariable since I want to be able to move my mission code from mission to mission more easily (I'm lazy and init fields while great are pain when it comes time to change map)

pallid palm
#

init field what initfield theres no init field there what do you mean ?

cyan thunder
#

He answered a question from someone who specifically asked for an init field script and he's using this in exactly the way that you would typically see it used in an init field - so it's a reasonable assumption that that was the intended use case

pallid palm
#

o i see ok thx m8

#

yes i aviod init fields also i agree

cyan thunder
#

I do use them but for stuff like this setVariable ["isAggressorPilot", true] and what not though for specific things I also lock stuff off by steam UID because there is a couple of players who always do the thing I don't want them to ๐Ÿ˜„

pallid palm
#

i mostly use initfield for group id stuff

unborn rivet
#

Thank you guys, I will test it. And yes, I want to do it in init Field of an object like helicopter.

cyan thunder
pallid palm
#

lol awsome lol

cyan thunder
#

final version, I broke both their legs (via ace medical) and then had 2 smashers, took 2 mins to do but they listen more weirdly ๐Ÿคทโ€โ™‚๏ธ players am I right ๐Ÿ˜„

pallid palm
#

yes lol Awsome

#

i had this one friend all he did was try to mess up anything he could or blow up anything he could, i did learn alot trying to stop him from doing that but yeah your right

#

ouch that sounds painful " broke both their legs" ouch

#

lol

crimson lion
stable dune
pallid palm
#

@unborn rivet btw you don't have to exec the addEventHandler GetIn from the init of the chopper , you can execVM it from the initServer.sqf

#

but you would have to change the word this, to whatever or just addMissionEventHandler

stable dune
#

On just

If (isServer) then {
   this ...
}
pallid palm
#

rgr that my friend

#

i like the word "authorised" its a Awsome word

crimson lion
pallid palm
#

you should use "Group" and not "Sync" to group the team

crimson lion
#

I did, the 2nd image is that case: No connection is made. The others were just demonstrating that the connection works for other types

pallid palm
#

are you useing "Group" on playable units or what are you grouping

#

you should use "Group" from the units in the team to the leader of that team

crimson lion
#

Grouping the 3DEN Entity ID's for all the opfor soldiers being spawned by the script, to the first one in the full array of all the soldiers spawned

pallid palm
#

hmmm

#

i kinda do the same i spawn all opfor units in one team

crimson lion
#

Unfortunately this is using create3DENEntity so it doesn't use the same parameters

pallid palm
#

oh shit yes Unfortunately

hallow mortar
#

Also, be careful with your use of global variables. You don't need to use them to make this script work, and they could conflict with other scripts (and other instances of this script)

cosmic lichen
analog mulch
#

hello
i wanted to use a soundtrack using playMusic but wanted it to play on a repeating loop

tulip ridge
#

Could just be something like:

addMusicEventHandler ["MusicStop", {
    playMusic (_this select 0);
}];
playMusic "whatever";

Never used it before, so not sure if there's any issues with playing new music right as it stops

analog mulch
#
addMusicEventHandler ["MusicStop", {
    playMusic (_this select 0);
}];
playMusic "bgm1";
    
 
playMusic "bgm1";
tulip ridge
#

Oh is it separate music classes?

fair drum
#

when broadcasting a hashmap over the same hashmap, does it resend the whole hashmap or just the changes? I'm thinking it probably resends the whole thing.

analog mulch
#

no just 1 music file i want to use as background soundtrack on a loop

tulip ridge
#

Okay then yeah just do what I had sent then
That'll just replay whatever music was playing last

#

If you want, you could check the class name so only your thing repeats if you want

#
params ["_musicClass"];
if (_musicClass == "...") then { playMusic _musicClass };
analog mulch
tulip ridge
#

Are you using multiple classes in CfgMusic or just a single one with the whole sound track

analog mulch
#

single one for now, but was curious to confirm how to do the same with multiple tracks as well

tulip ridge
#

You'd need to track all the songs so it knows what one to play next and when to repeat from the beginning

#

Probably something like this:

TAG_musicTracks = ["music1", "music2", "music3", "music4"];
addMusicEventHandler ["MusicStop", {
    params ["_musicClass"];
    // If its the last song, repeat from the beginning
    if (_musicClass == (TAG_musicTracks select -1)) exitWith {
        playMusic (TAG_musicTracks select 0);
    };

    // Play next song in sequence
    private _index = TAG_musicTracks find _musicClass;
    playMusic (TAG_musicTracks select (_index + 1));
}];
crimson lion
granite sky
fair drum
# granite sky It'll send the whole thing. If you want to do partial network updates then there...

you mean just using a "logic" object's var namespace? I'm current using a struct system (using a hash) within a object's var namespace and broadcasting that struct.

private _siloData = _silo getVariable ["CarrierStrike_SiloData", +CarrierStrike_Structs_SiloData];
// modify stuff in the struct
_silo setVariable ["CarrierStrike_SiloData", _siloData, true];

This probably sends the whole thing if I do it this way won't it.

granite sky
#

The whole of whatever _siloData is, yes.

fair drum
#

boogers. i like the organization provided by just setting up a hashmap for the data when managing a lot of it rather than the object's var namespace.

#

i'll just send the data to change to the client's local hash and let it handle it locally then

tulip ridge
#

They were saying to essentially use the object as the hashmap itself, which was what CBA_fnc_createNamespace does too, since it was made before native hashmaps

upbeat sentinel
#

Hi all, I'm hoping to get some advice on how to proceed with a script I'm using. Following Sneaky Kitty Game Dev's guide on making a music radio, here (https://youtu.be/ql3Mb0Cnetk?si=r1-PY07OxYPrzjSY&t=1115) they mention how you can delete an audio track from the array in order to prevent them from playing back-to-back. Then, when the array is empty, you can fill the array again with the same audio tracks. Here is my script so far (it is otherwise functional):

_songList = selectRandom [["songA", 535], ["songB", 284], ["songC", 118], ["songD", 161], ["songF", 152], ["songG", 420], ["songH", 193], ["songI", 151]];
_song = (_songList select 0);
_songLength = (_songList select 1);

[radio, [_song, 100, 1]] remoteExec ["say3D"];

radio remoteExec ["removeAllActions"];

[radio, ["Turn Off Radio",
{
    _pos = getPosATL (_this select 0);
    _dir = getDir (_this select 0);
    deleteVehicle (_this select 0);

    radio = "Land_FMradio_F" createVehicle [0, 0, 0];
    radio setPosATL [_pos select 0, _pos select 1, _pos select 2];
    radio setDir _dir;
    radioH remoteExec ["terminate"];

    [radio, ["Play Radio", {radioH = [] execVM "playRadio.sqf"}]] remoteExec ["addAction"];
}, [], 6, false, true, "", "_target distance _this < 2"]] remoteExec ["addAction"];

_waitTime = time + _songLength;
waitUntil{time >= _waitTime};
radio remoteExec ["removeAllActions"];

radioH = [] execVM "playRadio.sqf";```

tldr: How can I use **deleteAt**, **find**, **count**, etc. commands for my purpose?

This video will be improved again, first we just got it working in video 18, now we have it running smoothly on all clients so they have the ability to toggle it on and off without problems. However it is running on the clients and that is not what we want to happen, we are going to make it all run on the server so were not wasting any resources...

โ–ถ Play video
fair drum
upbeat sentinel
pallid palm
#

@granite sky Hay John Jordan you helped me make my Chopper command better after we texted the other day thx alot m8 you gave me some cool ideas about how to moveOut or eject players and Ai so it does not effect the chopper Woohoo thx m8

#

now my chopper command works even better woohoo

#

even over water insertion

manic kettle
#

What do people think is the best way to check if a player has stepped on a custom trap? I want it to execute some code if a player is on top of an object, like a mine i suppose. Obviously i could do a check for nearby players every second (or faster), but is there a better way? createTrigger maybe could work?

tulip ridge
old owl
# manic kettle What do people think is the best way to check if a player has stepped on a custo...

Yep imo a trigger is definitely the way to go. Although you could just keep checking the condition within an already scheduled script, there would be a lot of nicer benefits you would get out of using a trigger. For example:

  • With setTriggerArea you could make this small so it only checks when they are nearby the trap.
  • With setTriggerInterval you could reduce the interval to every second or faster as you were wanting.

Don't quote me but pretty sure you could even used thisTrigger within the setTriggerStatements to automatically delete the trigger upon your traps activation too ๐Ÿ™‚

tulip ridge
# old owl Yep imo a trigger is definitely the way to go. Although you could just keep chec...

With setTriggerArea you could make this small so it only checks when they are nearby the trap.
Same thing as just getting objects within the same distance

With setTriggerInterval you could reduce the interval to every second or faster as you were wanting.
Not any different than making a delay yourself

Don't quote me but pretty sure you could even used thisTrigger within the setTriggerStatements to automatically delete the trigger upon your traps activation too
Just stop when the trap is triggered

I could be wrong, but I vaguely remember a trigger running slower than just something like a pfh checking the same stuff

old owl
# tulip ridge > With setTriggerArea you could make this small so it only checks when they are ...

I don't use them too often in our mission but I think how situational they are just kinda depends on the mission.

In the mission that I work on we have taken a lot of steps to ensure that we are being conscious of network and performance. If I remember correctly the objects created with createTrigger are global and added to the JIP queue so we tend to steer away from them. Running those conditions within an already scheduled script would likely be more performant, although I imagine that also depends on what the task is.

I think in SP missions or scenarios where optimization isn't as much of a concern, there is a lot of really convenient usages you can get out of them. Also will keep a lot of those scheduled scripts cleaner and you won't be reinventing the wheel so much.

@manic kettle dropping your @ since I expanded and added some additional information popcat

tulip ridge
#

You don't have to run that code scheduled, you can very easily run it unscheduled

old owl
#

True. I was more just referring to it in the context of suspension as he would likely need some sort of loop to check the condition.

tulip ridge
#

You can unscheduled delays, most commonly with cba functions

old owl
manic kettle
#

you can pass arguments through them

old owl
#

Ah cheers thanks ๐Ÿ™‚

tulip ridge
#

Especially since mission makers like to fill the scheduler

granite sky
#

It's not really for the performance impact.

#

More for replicability. Unscheduled functions aren't gonna get interrupted halfway with some other code that might touch the same data.

split nebula
#

I can't launch arma atm to test, but does anyone know the locality for the arguments on getPlayerUID? The wiki doesn't specify

cosmic lichen
crimson lion
#

Okay so I'm not going crazy cryingblood Thank you for checking

cosmic lichen
#

lol

#

because its "groupTo" instead of "Group" @crimson lion

#

ffs

crimson lion
#

thank you

cosmic lichen
#

You're welcome.

crimson lion
#

Well, it actually seems to only be doing the cursor effect when dragging the groups, similar to when I tried 3DENConnectGroup instead of Group

#

The units are not actually grouped into one

cosmic lichen
#

You are right. It says missing config.

#

For some reason, GroupTo is now no longer being recognized as well for me

#

At this point I'd say it's broken. Maybe dedmen can have a look when he has time.

crimson lion
#

Are you on profiling btw? I am on profiling when I tested this

cosmic lichen
#

I am

crimson lion
#

I'll revert to normal and test too just to double check

#

No luck on normal branch either so indeed this seems to be broken

cosmic lichen
#

It seems that get3DENConnections is also broken for grouping

digital hollow
#

Is _group create3DENEntity [...] not suitable for your use?

cosmic lichen
#

No for my use case

crimson lion
still forum
#

need repro I don't know editor scripting

rough summit
#

Does anyone know how I can handle the opening of the UAV terminal?
This way don't work

 params ["_activated"];

systemChat "123" 
}];``` 

Via infinite loop with isNull display 160 is very bad i think
cosmic lichen
proven charm
hallow mortar
#

It isn't those. Those are for opening the UAV camera side panel, not the UAV terminal.

proven charm
#

ok the addUserActionEventHandler wiki page seems to have wrong link

hallow mortar
proven charm
#

k

rough summit
#

Know nothing about this EH

hallow mortar
#

https://community.bistudio.com/wiki/Arma_3:_Scripted_Event_Handlers
BIS_fnc_initDisplay is used to load BI displays. It calls the OnDisplayRegistered scripted EH when it does that. The UAV terminal is a BI display, so it should, in theory, cause that scripted EH to be called. You can attempt to use that EH to detect when the UI terminal display is opened.

tough abyss
#

why dosent this work: this attachTo [natohunter, [1,1,1]];

proven charm
#

that in the init field?

tough abyss
proven charm
#

natohunter defined?

tough abyss
#

i wanna add a flag to the hunter

tough abyss
proven charm
#

hmm

tough abyss
#

its varabile is natohunter

#

exactly the same

proven charm
#

make sure natohunter is vehicle and not group for example

tough abyss
#

wdym

proven charm
#

groups got init fields too. make sure its in right init field

tough abyss
#

i spawned in the vehicle by itself

rough summit
proven charm
#

if you spawned it later then thats why the flag failed to attach at start

proven charm
#

init field runs at mission start, you created the vehicle after that?

tough abyss
#

i did click play scenario a few times

#

and then bakced to editor

proven charm
#

can you post the natohunter creating code?

tough abyss
#

i jsut reset my game and went in a fresh editor

#

im spawnign the object and hunter at the same time

icy ridge
tough abyss
#

im sorry im new to this

#

i only started using code in amra today

proven charm
#

so whats your full code like ?

tough abyss
#

this attachTo [natohunter, [1,1,1]];

#

just this on the object

#

and then the hunter is named natohunter

proven charm
#

you placed natohunter in the editor?

tough abyss
#

yes

rough summit
#

Found solution. So class of terminal display is

if (_class == "RscDisplayAVTerminal") then {
};
proven charm
#

ok then it should work

tough abyss
#

i can send a video

icy ridge
hallow mortar
proven charm
#

and when you start the mission the flag doesnt attach?

hallow mortar
tough abyss
rough summit
tough abyss
proven charm
tough abyss
#

5

proven charm
#

ok

tough abyss
#

-5

#

all types

icy ridge
proven charm
hallow mortar
proven charm
#

im out of ideas, maybe flags cant be attached

tough abyss
proven charm
#

hmm

hallow mortar
granite sky
#

Yeah, 1,1,1 might not be easily visible.

hallow mortar
tough abyss
#

even tho i alr did try it before

little raptor
#

at that moment

tough abyss
little raptor
#

I said at that moment (when the init runs)

tough abyss
#

im testing it in the scenario

little raptor
#

eden objects are created one by one

hallow mortar
icy ridge
# hallow mortar Actually it was a continuation of the same issue: they were trying to check, _in...

Generally I don't quite understand why you're passive aggressively stating that reading the whole discussion is helpful. Like no shit sherlock. I did read the entire chat, it just wasn't immediately obvious what he wanted to achieve with the code he posted. Especially since you had already given him the solution to his original question and because the check statement made no sense, which is why I asked him what he wanted to do.

I gave him the answer to what I assumed he wanted to do, before he fully replied.

granite sky
#

Given how many people write stuff this way, I would guess that objects are all created and variables assigned before any init runs. But the behaviour isn't documented.

#

(and I could never be bothered to test it personally)

tough abyss
#

still dont show

icy ridge
rough summit
#

One more question. How can i handle mine or explosives placed by player?

hallow mortar
rough summit
#

I have CBA, but this way looks wrong because i can't check players actions

["TimeBombCore", "init", {
    systemChat "1"
}] call CBA_fnc_addClassEventHandler;
icy ridge
rough summit
#

And thats not compatible with ace

hallow mortar
#

For vanilla mine placement, you could use a FiredMan EH to detect the "Put" weapon. But ACE is a whole different animal, I don't even know how they do it.

granite sky
rough summit
icy ridge
#

As stated above, you can detect the action of placing a mine, explosive etc. with Fired or FiredMan (FiredMan being more appopriate). However, this only really works in the confines of the vanilla action menu.

granite sky
#

Also works in MP but I'm not gonna test DS/client.

hallow mortar
#

Actually, CBA EHs, not regular scripted

granite sky
#

Yeah, we use ace_explosives_place and I'm fairly sure that works.

#

There is also ace_throwableThrown for their special grenade throwing. Not sure if relevant.

tough abyss
#

anyone know how i can add a russian flag on the shoulder patch

pale glacier
#

Save load out

tough abyss
tulip ridge
#

Yes, you make a mod that adds the patch

tough abyss
tulip ridge
#

You can't then

#

You can set a texture on the insignia part, but you wouldn't be able to add the texture file

tough abyss
#

the vanilla russian flag

lean kernel
#

Sorry, I've been trying to code a way for objects and units to disappear when a player isn't looking at them, but it doesn't seem to work. Has anyone been able to achieve something similar?

tulip ridge
tulip ridge
lean kernel
#

:'c

tulip ridge
#

Forgot to push stuff when I reinstalled windows :p

tough abyss
#

_someUnit setObjectTextureGlobal ["insignia", "\A3\Data_F_Enoch\Flags\flag_rus_co.paa"]

tulip ridge
#

Yeah _someUnit isn't some magic variable

#

You need to use an actual unit

tough abyss
#

idk what to replace there

#

will this work?

#

_this

tough abyss
#

invalid number in experssion

#

wait this worked this setObjectTextureGlobal ["insignia", "\A3\Data_F_Enoch\Flags\flag_rus_co.paa"]

#

@tulip ridge ty

lean kernel
#

One question: Does anyone know how to add OPEX to a new map?

I'm trying to integrate OPEX into the Archipelago map, placing markers, buildings, and everything else, but it doesn't seem to be working. I also created a file with the map name and placed it in the game folder where all the maps go. But I still can't get any missions or AI to appear.

brittle badge
#

(DATA-UPLOAD is blocked)

โš ๏ธ Subject: Help with global initialization of my extended NVG script (similar to EZM/EP module โ€“ incl. menu attempt)

Hello, I'm currently scripting an extended NVG module for Arma 3 โ€“ similar to EZM or EP, but purely script-based, without dependencies on CBA/ACE.

The script works locally via a helipad object (init field), activates 3/4-6 switchable night vision modes via the "N" key, runs in a loop with ppEffects, includes safeguards against invalid states (e.g., VisionModeChanged, respawn), and regularly outputs system messages to confirm activity.

(- Normal โ†’ Blue โ†’ Thermal โ†’ Normal โ†’ Green โ†’ Thermal โ†’ Normal)

Working version (Helipad Init โ€“ Global via Debug Console):

[believe this is the correct one (I've made too many files/prototypes by now)] TXT FILE 1:

โ€ผ๏ธ Problems:

The script only runs locally on the player who placed the object.
Joining players do not receive the script โ€“ even using missionNamespace or publicVariable has no effect.
Testing with remoteExec in the debug console (e.g., global execution) results in getting kicked by BattleEye with errors like:
remoteExec restriction #(random)
or Script restriction #/
A global solution via a menu should be implemented through a UI like in Simple Spot System or Crubโ€™s Competitions.
The attempt using the Steam Workshop code under this link: https://steamcommunity.com/sharedfiles/filedetails/?id=3472082945 failed.
The attempt included the following script with UI menu (ENABLE / DISABLE):

[TXT DOCUMENT 2]:

Even with this menu attempt, the script could not be activated globally.
It responds locally, but not for JIP players
The server seems to ignore the global variables or they donโ€™t get through
Despite using missionNamespace with setVariable [..., true], thereโ€™s no effect for new players

I need help.๐Ÿ™๐Ÿป -Contact me

FinalBiologic โค๏ธ

torn basin
#

Hello guys, i got a short question.
What happens if i iterate over a group and do something like this:
blueUnit3 = (units grpPlayers) select _y;
But because units of the group suddenly die _y is now out of bound.
I assume i would get an error and the script stops doesn't it? So i guess you should always befor itterating save all the units in an new array first and iterate over that one instead?

thick tide
#

Hey y'all I've been trying to make my own fixes for ITC air weapon systems. I'm having a problem though. In vanilla ITC night vision with the TGP or Mavrik Pip open causes screen overaly glitching. However, in the dev branch this is not the case. Anyone know the code in the dev branch that is stopping this glitch or how to fix it in vanilla ITC?

granite sky
#

This sort of thing is an argument in favour of doing everything in unscheduled though.

little raptor
#

(it doesn't cause errors but the results are "defaults", e.g getPosWorld _x will give [0,0,0])

nocturne bluff
#

seems global

lean kernel
#

:c

fair drum
#

can't help if we don't see the code

brittle badge
fair drum
#

do a quick review of how github works first

brittle badge
fair drum
#

you just have an issue page

brittle badge
#

What? I have

fair drum
#

did you do a commit?

brittle badge
fair drum
#

thats an issue

#

not the editable code

brittle badge
#

The massage is to long for another theme

fair drum
#

even though I can just go through and look at it, this is important for you to learn git if you want to get further into the code world

#

its currently empty. go watch some short youtube videos on how github works

#

you can use GitHub Desktop if you don't want to mess with the command line

brittle badge
brittle badge
#

(1)

#

For Code the Code was to long

#

Character limit

fair drum
#

are you intending on adding these event handlers every frame? I see no removals of them, so they are going to stack infinitely

#

well i guess you have an init check

#

pull those out of the frame handler and put them somewhere else

brittle badge
brittle badge
fair drum
#

what you are doing is not going to be fun for the network on a public zeus. idealy, you would have this written as a function on every machine, then you as the zues, would remote tell every client to run that function that exists on their machine. Since its public zeus, you cannot define the function on everyones machine ahead of time. So now you are forced to remote send the entire code as a string which is going to nuke everyone's connection for a couple of seconds. if you go the route of remoteExec each command, now you just bogged down the network with EachFrame sends.

brittle badge
#

Public zeus lives on EZM and EP. These scripts do nothing else

fair drum
#

I don't use EZM, but I bet they are not handing the UI (what you are trying to do) on the clients. All of their scripts probably use the zeus as the makeshift "server". You want to handle the UI locally on the client, especially when you are doing EachFrame stuff. Your option as I see it now, is to wrap all of this code up, then [myCodeInVariable] remoteExec ["call", 0];. Players might notice a lag spike though until its all sent.

brittle badge
#

The script can be disabled during training by pressing L-Alt+Esc, Esc+L-Alt. (arma once into screen mode and back to full screen)

fair drum
#

Whatever you decide to do, you still should handle the PPEffects on the client, meaning you have to get the code to the client in the first place since zeus placed object inits only fire local to the zeus.

brittle badge
#

(what i want to do)

brittle badge
fair drum
brittle badge
gleaming onyx
#

Dont know if it this thread or editor...
I have a few scripts that makes so I can call for: reinforcements, mortar, LMG, medic supplies etc.
Is it possible to create a object that has all these scripts? instead of having them in the scroll wheel menu as I have now
an object so I can walk to it and activate the scriptrs

#

this is how its set up for now

pallid palm
#

well triggers can do that m8

#

like i walk in to a trigger and it spawns in 7 soldiers on my team

#

but then you must mark the trigger so you can see where it is on the map

#

or just you can know where the trigger is

#

is that what you were thinking ? @gleaming onyx

#

i like the way you have it set up now,,,,,,,

gleaming onyx
#

Hmm, a trigger should work, the problem is that I'm not sure if I can move a trigger when playing the mission?
Im looking for a solution to have a "movable" FOB that I can move depending on how the frontline is. Cause if I somehow connect the scripts to a object, I'll be able to move take it with me in game

pallid palm
#

yes you can move a trigger any time you want to

#

you just must make sure it size is high enough and wide enough to fit all positions like up a side hill and stuff

gleaming onyx
#

hmm, more of a truck I think

pallid palm
#

oh cool you can make a Mobile Respawn truck

#

there so many ways to do this

warm hedge
#

What do you mean by "create a object that has all these scripts" in this context?

pallid palm
#

i think he or she means addaction

gleaming onyx
#

haha, pretty hard to explain but here we go
I have a few scripts that I active through the mouse wheel menu, the thing Im looking for now is to have that function (ability to call for reinforcements for example) on a radio. so when I'm standing nearr this radio, I have all the options from my mouse wheel menu (picture)

warm hedge
#

So stay within N meters of the radio instead of looking at the radio?

pallid palm
#

i think all he or she needs is a Mobile Respawn truck with 3 addactions in the init of the truck

#

to activate the scripts

#

im guessing

#

but i dont know unless he or she says something else

gleaming onyx
#

both ways can work, dont know whats easiest to fix. so either look at the radio and stand near it or use mouse wheel menu

pallid palm
#

i like the mouse wheel way myself

#

but i also have Mobile Respawn trucks and choppers

warm hedge
#

What I don't get is what is your current blocker, I assume your current script is lacking something but it really seemed what you want to achieve is already done in the pic?

pallid palm
#

agree

#

so it seems he or she dont like the mouse wheel way

gleaming onyx
#

Haha, scratch that, it's hard to explain ๐Ÿ˜…

pallid palm
#

i think i get you m8, i would just make a Mobile Respawn truck with 3 addactions in the init of the truck

#

so you can drive the truck in to any loaction and activate the scripts from the truck

#

then you would have to set up the respawn of the truck to get the addactions back also witch can be done though respawn modual

gleaming onyx
#

Yes, correct! Cause for now I have 5 or 6 scripts in my actions menu and I can't choose the right one when stressed out to it's always fuckup. So if I have all those action menu options on a truck, my action menu is more cleaner when I play

warm hedge
#

So the issue is having a lot of options in Action Menu?

gleaming onyx
#

Correct. And to make it more clean I want them only to be visual from a truck/radio/box or something

warm hedge
#

So the goal is apply less actions into an object, and have more objects to activate a script, so your mosue wheel less likely to confuse which to choose?

pallid palm
#

he or she wants to remove most of the mouse wheel Action Menu and move them to a truck/radio/box or something

#

imho

gleaming onyx
#

Not necessarily, this is how I think and I apologize for the poor explanation, English is not my native language
Currently my action menu looks like this:
-Heal yourself

  • Get out
  • Engine off
    -Call for reinforcements
  • Call for ammo box
  • Call for medic supplies
  • Call for Mortar

For example.

What I want is that these are NOT tied to a player but you have to go to a radio (for example) to use them

  • Call for reinforcements
  • Call for ammo box
  • Call for medic supplies
  • Call for Mortar
warm hedge
#

And how is your current script?

gleaming onyx
#

its probably a total mess, got it from some guy haha

warm hedge
#

It is. Remove the second and third chunk of the code so it will run one addAction. The first addAction should go to an object (radio?) instead of player

gleaming onyx
#

Okok, will test, thanks!

next gust
#

Im trying to add our counter-artillery script to our mod for convienice but I have a problem:

// this addeventhandler ["fired",
     {
         [_this select 0,
         _this select 5,
         100,
         selectRandom [3,4,5],
         true,
        [enemyAri_1,enemyAri_2,enemyAri_3,enemyAri_4],[],0] remoteExec ["Redd_fnc_AriCounterFire",2]
     }
 ];

in the past we used this eventhandler in the friendly artillerys init, with static variables for the enemy artillery pieces. Im looking for a better way for missionsmakers with less scripting experience.

can i (and if so how) have a module that assigns the eventhandler to my own artillery and a second module that gathers the enemy artillery?

im thinking of something like

statement = {pusback missionnamespace friendlyartillerylist } foreach [syncedbject]

Would that work?

warm hedge
#

Not sure what really you want to "assign" in this context. Do you want to assign eventhandlers to more objects or?

next gust
#

2 things
friendly artillery need to be assigend the eventhandler above
inside that eventhandler i need to list the enemy artillery

warm hedge
#
  1. Use forEach
  2. Store enemy arties into an array and use it in the EH
proven charm
#

i think you could use something like this: ```sqf
{
// do something with the friendly arty (_x) here
} foreach (synchronizedObjects friendlyArties);

#

game logic is better option imo, assuming it can have synchronized objects

warm hedge
#

Ja, that would be "script free setup"

nocturne bluff
#

?

empty pilot
#

for eden editor.

is there is any way i can view markers that has no markerclass ?

pallid palm
#

im not sure what you mean no marker class

#

do you mean like view the marker from the briefing ?

#

you can see all markers in the eden editor. after you place them down on the map

empty pilot
#

there are some markers in cfgmarkers that are not displayed in arma 3 eden editor

#

the one that are not displayed has no markerclass

warm hedge
#

"no markerclass" does mean the marker does not even exist so you cannot see, place, anything. So what you say is not possible to say. If you're just trying to place a hidden marker, yes. Use create3DENEntity

pallid palm
#

agree

cosmic lichen
pallid palm
#

like witch marker is not viewable is there a name of this maker or markers ?

cosmic lichen
#

configFile >> "CfgMarkers" >> "Contact_art1"

#

For example.

pallid palm
#

oh i see ok thx m8

cosmic lichen
pallid palm
#

ahh ok yes got ya

#

man i was woundering big time lol

#

so basicly you are creating a marker Entity

#

so that would mean this marker is alive em i right

cosmic lichen
#

No, a marker cannot be alive

pallid palm
#

oh ok good shoooo lol

empty pilot
#

thanks

earnest ether
#

is there any All-in-one_Config up to date file online like on a webpage to download?

#

i dont want to download dev branch to get arma3diag_x64.exe

cosmic lichen
#

There has been one on the forums but we all know what happend to the forums

earnest ether
#

with wayBackMachine i found the link in the forum to dropbox

digital hollow
#

If you want to config dump, you can do that on non diag. Ofc config dump script is also on forums...

tough abyss
#

whats the .paa code for the deset camo

#

its like just 1 color of a tan color

digital hollow
#

If you see it on an object you can check the textures on that object.

tough abyss
#

dosent say the texcture

digital hollow
#

Set variable name for the tank and run getObjectTextures tank

tough abyss
proven charm
#

press ESC

#

(in game) or open it in editor

tough abyss
#

thanks

drifting badge
#

@cosmic lichen - Since you mentioned it above... - ...what DID happen to the forums, why are they still down?!? Do we ever get them back or are they now lost?

winter rose
thin fox
#

you can use web archive

drifting badge
#

I see - but that has been going on for quite a long time, so one keeps wondering (also it would be such a shame if all the info on the forums would be lost to us)

#

yeah, been using web archive as well (a bit tedious but better than nothing and of course coming here and pestering you guys with questions ;) )

silent cargo
#

Is it possible to set shot parents for a particle effect such as fire

little raptor
#

they're not shots so no

#

if you create an explosive that uses that particle effect maybe

royal quartz
proven charm
royal quartz
little raptor
royal quartz
#

I used this for an Iron Dome system in working in to create your own linked networks of radars, Battle management control stations and launchers. As well as an in-game UI that lets you manage the network and link them there too.

royal quartz
little raptor
#

only works in 3den afaik

royal quartz
#

Amazing I'm glad I asked! I'll change my code over and that will work much better.

cosmic lichen
royal quartz
#

Not sure if it will return it on init, I'd guess not as that's game start?

little raptor
#

well synchronizedObjects only works with triggers and AI (logics too because they have AI)

royal quartz
#

Ofcourse will do just wasn't sure if you knew before. I'm on my phone ATM I'll test later thanks for the info on that command.

silent cargo
dry cliff
#

Looking for a script for "hacking" something like an enemy radar or a computer that controls it. Have a very rudimentary one that is just stand close and wait for x amount of time but wanted to see if anyone has something more interactive that they are willing to share. Appreciate any help out there

dawn oriole
#

Hey guys, im working on a script for my thesis, but i am encountering some issues in the way the bounding box is being calculated/displayed on screen. Since i dont really have experience im not sure what the issue is and i am somewhat running low on time.
So if some of you have dealt with that topic before, i would greatly appreciate any help. Feel free to dm me if that makes it easier, else i will check here for responses ๐Ÿ™‚

dry cliff
digital hollow
lean kernel
#

Hi, sorry for the inconvenience. Does anyone have a script I can use to improve performance? We have a base, but something's going wrong with it. I don't know if there's anything that can hide the AI โ€‹โ€‹and map objects when you can't see them. I tried doing something like that with Chatgpt, but it didn't work. :c

fair drum
fair drum
brittle badge
#

what is so hevy on this

fair drum
#

you have areas of code that are not even in a code block, so copy paste is a pain

brittle badge
#

okey

#

wehre to upload?

fair drum
brittle badge
brittle badge
slender turtle
#

what was the command that you put in the init of like the naval turrets to make them opfor?

fair drum
#

otherwise, you can do:

if (local this) then {
  crew this joinSilent group opforUnitHere
};

or

if (local this) then {
  private _group = createGroup [east, true];
  crew this joinSilent _group;
};
dawn oriole
# digital hollow Try to describe in more detail

@digital hollow so when the bounding box is being drawn the box is not aligning at all with the Position on the vehicle on Screen. Sometimes its like 10 Meters off. Im running a vehicle spawning Script to Generate Synthetic images and my .rpt file gives me the coordinates of the box but it just doesn't match. You want the script snippet to have a look?

dawn oriole
fleet sand
gleaming onyx
#

I have a script that should make the days far more longer than the nights, but it feels like its going super duper fast...
Have I done something wrong in the script?`

[] spawn {
while {true} do {
_hour = daytime;

    if (_hour >= 21 || _hour < 3) then {
        setTimeMultiplier 180;
    } else {
        setTimeMultiplier 40
    };

    sleep 5;
};

};

warm hedge
#

Adjust 180 and 40 to desired number

dawn oriole
cosmic lichen
dawn oriole
#

this is the full thing
its probably not very elegant because most is with Chatgpt as i h ave no clue. i would greatly appreciate any help

fleet sand
dawn oriole
#

thats one example of what happens

hallow mortar
#

Is that a horizontal or vertical offset? I can't tell from the picture.
If it's vertical then it could be an ATL/ASL mismatch issue.

dawn oriole
#

i have tried both asl and atl before, the bounding box still wasnt accurate

hallow mortar
#

Also don't use ChatGPT (in general, but particularly for SQF). It will absolutely make up complete garbage. It does not have an actual understanding of functional code, it just tries to come up with something that "looks real" - and SQF is a particularly niche language with a relative shortage of examples of good code.

dawn oriole
#

it was able to do everything else quite good, but i agree otherwise. its just that i need to get it done for my thesis and this is the last issue im having, the rest works as its supposed to

cyan thunder
little raptor
# dawn oriole https://pastebin.com/aN6ncYYe

fnc_getModelCenterTarget
getPosWorld already does that

_centerModel = [
        ((_min select 0) + (_max select 0)) / 2,
        ((_min select 1) + (_max select 1)) / 2,
        ((_min select 2) + (_max select 2)) / 2
    ];

we have vector commands. use those instead:

(_min vectorAdd _max) vectorMulitply 0.5

_vehicleType createVehicle _spawnPos

  1. spawnPos is ASL. createVehicle needs AGL
  2. createVehicle is unreliable and you must always use setPosXXX after it anyway
little raptor
dawn oriole
#

Ye I know, I said that I cant do it alone. Which is why I am asking for help to fix it

cosmic lichen
#

I have a bit of a dilemma here. I wanna check if the cursor is inside the bounding box of the nearest object in Eden Editor.

I can do that fine as long as it's close to the surface ASL or AGL but if the nearest building is floating (ASL Z=20) I cannot properly do that as I don't have a Z height of the cursor.

So either I just ignore the cases where a building is floating or I use the Z height of the closest building and assume that is my cursor height. It works but doesn't look right.

Any other ideas?

#

Actually, I think I rubber ducked my self out of that lol.

#

It only looks weird if the building is floating but looks fine for all other cases. So I guess I'll roll with it as floating building should be rare anyway.

little raptor
#

after that you can just intersect the line with the bounding box

#

if you need help with it let me know

cosmic lichen
#

But that would only tell me if the bounding box is between camera and mouse, no?

little raptor
#

well it tells you if the mouse is inside the bounding box

#

but it doesn't consider other objects (i.e blocked and not in view)

cosmic lichen
#

That doesn't matter

#

I think eden editor even intersects it with model geometry.

#

Let me implement hat and check the results.

#

Now I wonder why we don't have an intersect variant that checks if a ray passes through an area.

little raptor
# cosmic lichen Let me implement hat and check the results.

here's the bb intersection in case you need it:

private _dir = screenToWorldDirection getMousePosition;
private _p1 = positionCameraToWorld [0,0,0];
private _obj = get3denSelected "Object" select 0;

pp = [AGLToASL _p1, AGLToASL _p1 vectorAdd (_dir vectorMultiply 100)];

_p1 = _obj worldToModel _p1;
_dir = _obj vectorWorldToModel _dir;


call
{
    scopeName "Inter";
    
    // you can also use geometry BB which is more accurate
    boundingBoxReal _obj params ["_min", "_max"];
    
    private _tmin = 0;
    private _tmax = 1e9;

    private _entry =
    {
        params ["_t"];
        
        if (_t > _tmin) then
        {
            if (_t > _tmax) then
            {
                false breakOut "Inter";
            };
            _tmin = _t;
        };
    };
    private _exit =
    {
        params ["_t"];
        
        if (_t < _tmax) then
        {
            if (_t < _tmin) then
            {
                false breakOut "Inter";
            };
            _tmax = _t;
        };
    };
    _max = _max vectorDiff _p1;
    _min = _min vectorDiff _p1;
    {
        private _d = _dir#_x;
        if (abs(_d) > 1e-6) then
        {
            private _t1 = _min#_x / _d;
            private _t2 = _max#_x / _d;
            if (_d > 0) then // positive on max negative on min
            {
                _t1 call _entry;
                _t2 call _exit;
            }
            else // negative on max positive on min
            {
                _t2 call _entry;
                _t1 call _exit;
            };
        };
    } forEach [0, 1, 2];
    true;
};
#

didn't test it but it should work ๐Ÿคž

cosmic lichen
#

And here I am already asking myself if I am too stupid to draw a line from point1 to point2

#

Sqf can be an ass sometimes.

cyan thunder
little raptor
#

@cosmic lichen btw that script had a bug which I just fixed (+ some cleanup)

winter rose
next gust
#

expectedDataTypes: Array of direct Data Types - (Optional) checks if passed value is one of listed Data Types. If not, default value is used instead. Empty array [] means every data type is accepted.
this line is lying, right? if i put Boolean as expected data type its not working, if i put true its working same thing with Numbers,

tulip ridge
next gust
#
params [
    "_ownArty",
    "_magazine",
    "_enemyArtyArray",
    ["_radius", 100, ["NUMBER"]],
    ["_rounds", (selectRandom [3,4,5]), ["NUMBER"]],
    ["_decrementRadius", true, ["BOOLEAN"]],
    ["_counterTime", 0, ["NUMBER"]],
    ["_enemyArtyRadarArray", [], ["ARRAY"]]
];
proven charm
#

wiki gone crazy

tulip ridge
#

You put a literal value there

#

E.g. params [["_someVar", 0, [0]] only accepts numbers

winter rose
#

yep

next gust
#

Array of direct Data Types
sounds like it need a thing fron the linked wiki page

winter rose
#

you do not type the data type in string, you provide any data of the wanted type

tulip ridge
#

Can also just scroll down and look at the examples though

winter rose
#

e.g ["_someVar", _defValue, [0, ""]] accepts numbers and strings

next gust
#

anyway now i know

winter rose
#

Array of direct Data Types
does not mean "array of strings" ^^

#

but I will see if I can make it more understandable

proven charm
#

wiki back again

winter rose
#

(I hope)

proven charm
#

it got buggy (unreadable)

hushed turtle
#

I think I did similar mistake the first time. I was expecting that keywords should be used like bool rather than any value of datatype. When you want to do stuff with datatype and not it's values

#

Bit of weird thing in SQF

proven charm
#

yea wish we could just type [boolean,scalar, etc]

winter rose
#

#define boolean false :p

hushed turtle
#

I might have done same mistake with both params and isEqualType commands ๐Ÿ˜†

proven charm
cosmic lichen
#

just have a script_component.hpp and include it there

proven charm
#

or boolean = true; then its global

hushed turtle
#

That's good tip. I might do datatypes file and include that in every future script ๐Ÿ˜€

proven charm
hushed turtle
#

I miss that one too

#

You can still put your constants in final hashmap though

shut flower
#

@grizzled cliff Would it be possible to make a kind of player tags with intercept? Meaning the dll is creating a thread and doing all that stuff directly in the background?

open marsh
#

How do you make AI with RPG move to target and fire with line of sight, with script

i tried so much and he just doesnt move, get stuck, fires int oa tree kills himself, misses a lot

pliant dagger
#

I just got arma three and I'm recrating some of my old arma 2 missions, things were going pretty well with my intel task and until i open arma the next day and it doesn't work.

#

Does anyone have a method of making intel missions/tasks that they prefer?

pliant dagger
#

2 triggers - one normal and the other attached to a set task state with !alive varintel as it's expression and just a normal create task

#

the !alive varintel trigger was synced to the intel

little raptor
# open marsh How do you make AI with RPG move to target and fire with line of sight, with scr...

something like this (define _dir, _ai, and _target yourself)

_ai setDir _dir;
_ai disableAI "ALL";
// run forward with launcher
_ai switchMove "amovpercmrunsraswlnrdf";
_ai playMoveNow "amovpercmrunsraswlnrdf";
_ai selectWeapon secondaryWeapon _ai;

_ai setVariable ["my_target", _target];
_ai addEventHandler ["FiredMan", {
    private _ai = _this#0;
    private _target = _ai getVariable ["my_target", objNull];
    if (!isNull _target) then
    {
        // throw the projectile towards target
        private _shot = _this#6;
        
        private _speed = vectorMagnitude velocity _shot;
        private _dir = getPosWorld _shot vectorFromTo aimPos _target;
        _shot setVectorDirAndUp [_dir, vectorNormalized([_dir#1, _dir#0 * -1, 0] vectorCrossProduct _dir)];
        _shot setVelocity (_dir vectorMultiply _speed);
    };
    
    _ai removeEventHandler ["FiredMan", _thisEventHandler];
}];
// wait for LOS
waitUntil {
    sleep 1;
    lineIntersectsSurfaces [eyePos _ai, aimPos _target, _ai, _target, true, 1, "VIEW", "FIRE"] isEqualTo [];
};

// stop
_ai switchMove ["amovpercmstpsraswlnrdnon", 0, 0];
isNil
{
  // fire launcher
  _ai selectWeapon secondaryWeapon _ai;
  _ai forceWeaponFire [secondaryWeapon _ai, "single"];
};

_ai enableAI "ALL";
#

it doesn't account for drop tho. so it only works if the RPG shot is really fast

little raptor
little raptor
#

what is the issue with it?

pliant dagger
little raptor
#

ah. well you can use the Take event handler

#
this addEventHandler ["Take", {
  params ["_unit", "_container", "_item"];
  if (_item == "class of item") then {
    ["pvt_pickUpIntelTask", "SUCCEEDED"] call BIS_fnc_taskSetState
  };
}];
#

use that in the player init (if it's a SP mission)

#

and rename "class of item" and "pvt_pickUpIntelTask" ofc

pliant dagger
little raptor
#

how do you init the intel?

pliant dagger
#

what I just typed might be stupid nevermind on that

little raptor
#

well in any case it depends on the locality. I'm not sure if the Take EH works on remote units

#

if it doesn't you'll have to remote execute it on all players by making a function

pliant dagger
pallid palm
#

hay hi @pliant dagger

fierce marlin
#

Is there a way to make a camera orthographic in Arma3?
Kinda want to make a silly mission that works like Worms (Side view, turn based, etc).
Wasn't sure which channel to ask this in, I assume the answer is no, sorry for the dumb Q.

#

Can do it with perspective (Far + low FOV) but it won't be "the same" :P

little raptor
#

the "worms" can be 3D gui models or 2D static ones

fierce marlin
#

that's a really good idea haha

#

ty

#

not familiar with how that will work so a lot of learning (How physx & forces (gravity) affects UI models, if/how to get "world" objects in UI's collision working with them, rmt-ctrl & getting the "worms" to aim correctly...) but I'm in bc learning is fun :P.

tulip ridge
#

(How physx & forces (gravity) affects UI models)
They don't, they're gui

little raptor
#

you can simplify collisions using simple shapes (e.g circle, rectangle, etc.)

#

if you're familiar with web dev you can use javascript too (in dev branch)

tulip ridge
#

Look at the mission / mod and find out

fierce marlin
# hushed turtle On the topic of silly missions. How is this even possible I wonder? https://stea...

o m g, this is amazing LOL. He got everything in that working very smooth. I know how you'd get most of the things working, but he must be insanely familiar with almost every arma limitation / methodology :P ...duke nukem / cmdr keen vibes! more duke bc of the lore focus ;P
Closest things I've done (missions not mods);
https://www.youtube.com/watch?v=WeVl64KWTps
https://www.youtube.com/watch?v=IAb0vEGc1yc
I haven't done a lot with remote control / custom camera while controlling a player, but that's probably easier as a mod than mission.

modern plank
#

include another SQF script

open marsh
#

im trying to check if there's a fence (map fence) between path of 2 soldiers, which scritp can i use for this?

#

specifically to check for fence

manic kettle
#

Is it a specific type of fence? Or any fence

open marsh
#

its this fence

#

i dont know what the name or class is and im not abel to make simple script for it

#

its a fence belonging to the inherent map objects

open marsh
#

its not working

open marsh
manic kettle
open marsh
#

i just need it towork for this fence, for some reason it just not detectable

manic kettle
#

It's a terrain fence right? You didn't put it down?

open marsh
#

Land_Mil_WiredFence_F

#

Yes

#

It only detects it if i look at specific parts of the fence

#

wtf this is impossible

manic kettle
# open marsh wtf this is impossible

It's not impossible, but it is difficult to work with map objects like this.
I'm not at my pc to test things. But one, albeit inefficient, method i can think of is using nearestterrain objects to get a list of all terrain objects near your 2 guys...then check every object...
{
if (_x isKindOf _classname) then {do stuff}
} foreach _objects

#

Hopefully someone can give you a better answer.

open marsh
#

it has no class name

#

or its not giving me one

hushed turtle
charred monolith
#

Hi ! I have this script that create a unit. I set them to go to a point and load into a vehicle. The problem is that they just phase trought objects (classic arma) the problem is that it's map baked object, so It's not object without a path LOD. (+ it's arma 3 vanilla assets, so they shouldn't phase through them)

There is my code :

private _civCount = 10;
private _civType= "OPTRE_UEG_Civilian_Rural";


for [{_i = 0},{_i < _civCount} ,{_i = _i + 1}] do {
    private _group = createGroup west;
    _group createUnit [_civType,position civilSpawn,[], 0, "CAN_COLLIDE"];
    _waypoint = _group addWaypoint [extractionVehicle, 0,-1];
    _waypoint setWaypointType "LOAD";
    //_waypoint setWaypointBehaviour "CARELESS";
    sleep 10;
};
cosmic lichen
#

That's engine behaviour. If the AI can't go around an object it will go though it.

hollow robin
#

Hello, i want to make an unit do the 'scan horizon' command through code, how do i do that?

hushed turtle
#

Isn't that just a unit slowly turning around?

hollow robin
#

Problem is thats really important for some units that are blind to anything happening outside their fov

#

Like radars for example

proven charm
hushed turtle
#

Does these commands work with Game Logic object? One could move the game logic object every couple of seconds and let the unit keep looking at it

#

Since I don't think there is command to turn unit slowly and doing it using setDir would be weird

buoyant hound
#

Why the ships wont work with keyframes?

proven charm
hushed turtle
#

If they take position then there is no need to use game logic. You can just give it position and change it little bit later

proven charm
#

true

little raptor
little raptor
little raptor
# open marsh specifically to check for fence

get all terrain objects by using [] for filter
then filter them manually using select and instead of typeOf use getModelInfo and compare the models with fence model (or if you have many, create a hashmap of the models you want and search in them)

little raptor
hollow robin
#

Ig i can try to put an ai radar and steal the ai from that radar to put in mine

thin fox
#

does ignoreTarget (Added in 2.18) is causing crashes? ๐Ÿค”

little raptor
#

why?

#

did you get crashes when using the command? if so send the crash dumps to Dedmen

split scarab
#

Using vanilla revive system, anyone know a way to script it so if a unit is downed/unconscious that the next hit will execute them? I tried doing this but it insta kills instead of downing them first

this addMPEventHandler ["MPHit", { 
  params ["_unit", "_causedBy", "_damage", "_instigator"];
    if (incapacitatedState _unit == "UNCONSCIOUS" && side group _causedBy == west) then {
      _unit setDamage 1; 
    };
}];
thin fox
little raptor
#

yeah

thin fox
little raptor
thin fox
little raptor
#

mistyped ๐Ÿ˜…

#

so yeah anyway just send him the crash dumps

thin fox
#

Okay, thank you

little raptor
#

btw does it crash when you do both forgetTarget and ignoreTarget together?

thin fox
hollow robin
#

Does anyone know what code do the ai radars have to make them spin?

brittle badge
fair drum
median perch
#

could anyone help me out? there are two things i cant figure out how to do, restrict my zeus slot so only certain players can get into it and i would like to limit the arsenal based on role selected in my missions

thin fox
median perch
fair drum
median perch
#

i just made and named the roled in editor

#

roles*

fair drum
#

like you named the unit using the Variable Name in the unit attributes? Or are you using Role Description? or are you using the classname of the unit?

median perch
fair drum
#

just know that roleDescription does not work in single player. if you are trying to make it compatible with both

median perch
#

i can add variable names if i need to

fair drum
#

are you using the built in respawn menu at all?

median perch
median perch
brittle badge
# fair drum your final iteration starts at line 103 right?

yeah. thats the uploadet steam version with the orange menu (Enable/Disable Menu)

whats NOT working:

  • Switch massage for all players (green, blue, thermal,normal....), its not working for other players (just the enable masse, the 1/5min masse (hold n) and disable amssage work for all)
  • the nightvision not working for all players (the filters and colour correction ...)
  • not workign automaticly for rejoin players

(code from 103) @fair drum i activate the code for some time four u

fair drum
# median perch yes, select respawns with a timer

so there are a few ways to grab what unit is being used in your current situation:

  • Grabbing the string value of the UI that was selected in the respawn menu (hard)
  • Using the roleDescription string (easy - doesn't work in SP)
  • Classname comparison

then once you have that, you'll need to have to init your box globally (init of the arsenal) and add NO items to it:

// init box of arsenal
[this, false] call ace_arsenal_fnc_initBox;
//-------^ no items

then, locally on the client, you'll have to add the items locally, so each machine sees a different set of items to add to the box:

// locally
[_box, ["item1", "item2", "item3"], false] call ace_arsenal_fnc_addVirtualItems;
// -----------------------------------^ this is the arg that makes it so only the local machine has this set of items
median perch
fossil brook
#

Hello, I'm coming to you because I'm making a server on my machine arma 3 exile, here's what I've already done and where I'm stuck, I installed the server with steamcmd, installed the database that works with the server, I opened my ports via the admin panel of my internet box, I have a fixed IP,disabled windows firewall but the server remains local and I can't put it online, would someone know how to help me

reef granite
#

Hello, I created an A3 Exile server for myself and my colleagues. Now we're having a few small problems. Could someone perhaps help us? (We don't see the vehicle HUD on the top left and right) (The pylon manager can't be opened) (When a rocket is fired, the AI โ€‹โ€‹isn't killed, or it doesn't count respect in DMS missions)

fossil brook
fair drum
# brittle badge yeah. thats the uploadet steam version with the orange menu (Enable/Disable Menu...

so your functions don't exist on the other machines. and since zeus placed objects only fire locally, you need to send the function and store it locally on every machine:

private _sendFunctions = {
    GlobalFnc_01 = { /* stuff */ };
    GlobalFnc_02 = { /* stuff */ };
    GlobalFnc_03 = { /* stuff */ };
};

[_sendFunctions] remoteExec ["call", 0, "FB_SendFunctionJIP"]; // this will also make the functions available to joining late players

now you can use those functions using remoteExec to the client

median perch
reef granite
fossil brook
fair drum
# median perch so im going to guess i put the local items in the wrong place, i added the arsen...

could be initialization order of the objects if you are going the init box route. you want to make sure the arsenal is initialized first, then the character's init fires.

// box init - box also needs to have a variable name - set it to arsenal_01
[this, false, false] call ace_arsenal_fnc_initBox;
//------^ no items
//-------------^ initialize locally
// character init
if (local this) then {
    [] spawn {
        waitUntil {time > 0};
        [arsenal_01, ["arifle_AK12_F"], false] call ace_arsenal_fnc_addVirtualItems;
        //---^ box
        //------------------^ item array
        //--------------------------------^ do this locally
    };
};

note: it will bring in what the character is currently wearing. though its not actually in the arsenal. if they were to change, leave arsenal, and reopen, you won't see what they originally wore

median perch
fair drum
#

hopefully the comments kind of help you. know that inits in editor objects fire globally, which is why we have a local filter in it. so that when players join that don't control this object, nothing happens

#

same thing why we want the box to initialize locally. so that joining players don't globally overwrite it

median perch
split ruin
#

@median perch what you want exactly?

brittle badge
fair drum
#

oh i see this is the full script, not just that function

brittle badge
fair drum
#

yes, up until line 99 you are good

brittle badge
#

oh

fair drum
#

everything after line 99 is still only going to fire on the zeus client

#

you'll use the functions by

// if no arguments
[FinalBiologic_fnc_blahblah] remoteExec ["call", 0];

doing it like this goes against my nature of A3 scripting, but since you are trying to do public zeus stuff, and don't have access to the mission, gotta make the jank work

brittle badge
#

thank u for u help mate ๐Ÿ™‚

flint topaz
fair drum
median perch
# split ruin <@559115249731633155> what you want exactly?

at the moment im just trying to make it where when a player selects a role they can only pull role specific weapons and equipment from the arsenal, i however cannot make scripts and have limited understanding of scripts. i can alter them once they are created so if i can get somthing usable and put it into the right place i can add what i want to it.

median perch
#

its not that im not willing to learn how to do these things im just stuck in kind of a turorial hell that gives me no real usable information.

split ruin
#

@median perch you can make simple addAction and then choose and apply a loadout to the unit, does this fit your idea? I can give you the script

median perch
fair drum
fair drum
#

I see enough of this question I'm just gonna add a module into Modules Enhanced for it.

median perch
split ruin
#

@median perch you want to create limited arsenal for every role having only items this role can choose?

median perch
median perch
brittle badge
brittle badge
fair drum
#

Post what you changed...

brittle badge
fair drum
brittle badge
#

hmm okey i will chaned it now

split ruin
#

@median perch
you can easily use something like
make some box, call it "box" ๐Ÿ™‚
in initPlayer.sqf and onPlayerRespawn.sqf

if ((typeOf player) == "classname_assault") then {
[box, ["item1_for_assault_classname", "item2_for_assault_classname", "itemN_for_assault_classname"]] call ace_arsenal_fnc_addVirtualItems;
};

if ((typeOf player) == "classname_grenadier" then {
[box, ["item_for grenadier_classname", "item2_for_grenadier_classname", "itemN_for_grenadier_classname"]] call ace_arsenal_fnc_addVirtualItems;
};

and so on for every squad role ๐Ÿ™‚
player with different slots with proper clasnames will se different item in the arsenal

median perch
split ruin
#

@median perch just replace with the proper classnames of the units and the gear, nothing difficult. The long part will be to copy and paste every needed item classname from the full ACE arsenal ๐Ÿ™‚

#

to do this just hover the mouse over the item and press ctrl+c then ctrl+v to paste it in the script

median perch
split scarab
#

I don't get these dogs man, what I have here works for like 2-5 minutes and then suddenly they just start walking in a straight line until the end of the earth..

OB_resetDogTrigger = {
    params ["_trig"];
    detach _trig;
    _trig setPos (getPosATL gd_trigger_reset);
    systemChat format["reset dog trigger %1", _trig];
};

randomDogPos = {
    private _randomSafePos = [];
    while { count _randomSafePos == 0 } do {
        private _randomPos = [["dog_area"], ["water"]] call BIS_fnc_randomPos; 
        _randomSafePos = _randomPos findEmptyPosition [0, 20, "C_Quadbike_01_F"]; 
    };
    _randomSafePos;
};

[] spawn { 
    sleep 30;
    _dogArray = ["Fin_sand_F", "Fin_blackwhite_F", "Fin_ocherwhite_F", "Fin_tricolour_F", "Fin_random_F", "Alsatian_Sand_F", "Alsatian_Black_F", "Alsatian_Sandblack_F", "Alsatian_Random_F"];
    _dogs = [];
    for "_i" from 0 to 1 do {
        _grp = createGroup east;
        _dog = _grp createUnit [selectRandom _dogArray, ([] call randomDogPos), [], 0, "CAN_COLLIDE"];
        _dog setVariable ["BIS_fnc_animalBehaviour_disable", true];
        [_dog] joinSilent _grp;
        _dogs pushBack _dog;
    };
    [[sideLogic, "Base"], "Guard dogs spawned."] remoteExec ["sideChat", allCurators];
    
    sleep 2;
    
    trig_guard_dog1 attachTo [_dogs select 0, [0,0,0]];

    [_dogs select 0] spawn { 
        params ["_dog"]; 
        sleep 1;
        private _animMovement = ["Dog_Walk", "Dog_Run"];
        private _animStop = ["Dog_Stop", "Dog_Sit"];

        while { alive _dog } do {
            _randomPos = [] call randomDogPos;
            _dog doMove _randomPos;
            _dog playMoveNow (selectRandom _animMovement);
            waitUntil { sleep 0.5; (_dog distance2D _randomPos) <= 3};
            _dog playMoveNow (selectRandom _animStop);
            sleep ([15, 60] call BIS_fnc_randomNum);
        };
        [trig_guard_dog1] spawn OB_resetDogTrigger;
    };
};
#

My best guess is that the randomDogPos function is the thing that's breaking at some point because of a bad position or something? It tries to pick a marker from a specific square marker around a house and I want it to pick a random position outside the house

median perch
split ruin
#

@median perch I think no, first try with only 3 items for two roles to see if its working, I never tried this kind of "personal arsenal", I use loadout presets

median perch
split ruin
#

paste you code for initPlayer.sqf ...

median perch
split ruin
#

@median perch remove the variable name from the classname of the unit and the file should be named initPlayer.sqf, not initplayer.sqf

silent latch
split scarab
#

They don't stray in one specific direction, they'll just carry on walking straight in the direction they were facing when it breaks

silent latch
#

are the printouts giving values that seem expected?

split scarab
#

Yes, all coordinate printouts I've seen appear were around the house

median perch
#

thats where i put those files too

#

it worked!

#

i just need the arsenal fnc in the "box" and to remove the variable name

#

now how do i keep ppl out of my zues slot?

fair drum
#

After control of the unit is given to the player, do a steam64id check. Kick them back to lobby if it's not in the list.

brittle badge
little raptor
#

if they keep walking forever it's probably because the animation gets locked and they never get a chance to move towards the target

#

also that while loop for getting a position is bad and can get stuck forever

#

@split scarab

#

also you keep spawning new code (nvm I thought it was an infinite loop)

#

that could clog up the scheduler

split scarab
little raptor
#

yeah

split scarab
#

Even though it's just meant to find the _randomPos and then exit?

little raptor
#

is there any guarantee that it does find a pos?

split scarab
#

Eventually yeah, there should be plenty of clear space for it to find one but I suspect that it somehow breaks, no idea why though

little raptor
#

where does this code run from? (as in where does it get executed) and why do you keep using spawn?

split scarab
#

initServer.sqf and because there's meant to be two dogs but I cut one of them out due to character limit

little raptor
#

well in any case you can also not guarantee that the dog will ever reach its destination

#

so your waituntil loop with distance check is also another potential infinite loop

brittle badge
fair drum
# brittle badge I've tried a lot now, but it still doesn't work. In some cases, nothing happens ...

you aren't understanding at all the multiplayer locality. you only need to send the functions to the client once. this might be over your head at the moment. I've shown you the steps that are needed to do what you want, but the rest of it, you have to have an understanding.

For public zeus to run functions locally on clients (which you need because you are doing UI stuff) through object inits (which are local in zeus):

- send functions to the clients (by telling the client to save a function into a variable)
- treat local zeus as the server, he will be sending the remote calls of the functions to the client (telling the client to call the code in the variable)

Everything else is in the scripting logic. I can't, nor do I want to spend the time to go through everything in your script. So if someone else wants to take over, then go ahead. But as of now, I'm stepping away from it.

Your idea would do much better as a mod due to limitations of public zeus-ing.

lyric gulch
#

https://cdn.discordapp.com/attachments/105462984087728128/1368701797044191242/image.png?ex=68192e61&is=6817dce1&hm=c4ac97fe41a58421bc0a80f91a88ea87d181c39deec79541dae14f0a076e0596&

https://github.com/Sparker95/Vindicta/wiki/DEV-Setup
Hey so I'm trying to do the dev setup for this mission so I can edit one of the factions. And I don't even know if I'm doing the first step correctly. Is there supposed to be a confirmation or anything? I'm new to all of this. Also for the second step, I don't know how exactly to set up a repository. I've done factions for liberation so I now that part the setup for this one is just way more complicated then what I have done before.

GitHub

A guerrilla warfare mission for ARMA III. Contribute to Sparker95/Vindicta development by creating an account on GitHub.

fair drum
plain bramble
#

uh, hey there everyone. I don't come on here often as I can usually figure stuff out for myself, but i thought I would ask here.

How can I go about making intel in the editor like you can in Zeus? I've looked up videos, watched all of them, tried my own attempts, nothing's working. I would really love some guidance on how to add intel that can be picked up with a hold action command, with the item in question getting removed.

Additionally, I would like to know how I can make it apply to stationary NPCs as well like I can in Zeus Enhanced.
Obviously, without the NPCs disappearing.

lyric gulch
#

Could you recommend any videos idk if Iโ€™m going to get good results if I just search up โ€œwhat is GitHubโ€

fair drum
fair drum
fair drum
lyric gulch
#

Ig maybe I havenโ€™t used it in that way tho Iโ€™ve only just downloaded stuff from it

fair drum
# median perch where and how do i do that?

if you are just playing with friends, something like this will be fine:

// initPlayerLocal.sqf
private _whitelistZeus = [
    // obviously replace these
    "203958230589",
    "29385023598"
];

if (MyZeusUnitOrWhatever == player && !(getPlayerUID player in _whitelistZeus)) then {
    // boot back to lobby
    endMission;
};
old owl
lyric gulch
fair drum
lyric gulch
#

oh wait its just git right

#

he didnt explain that I downloaded github desktop

lyric gulch
fair drum
#

@lyric gulch use VSCode + github desktop

queen cargo
#

@tough abyss best ui for that is no ui (or better: no graphical)

plain bramble
#

Is there a way I can have a trigger activate when an object is deleted?

split scarab
#

Anyone able to help me script a way to instakill downed players on any hit by BLUFOR? I wrote this but instead of hits downing them first it just outright instakills them...

this addMPEventHandler ["MPHit", { 
  params ["_unit", "_causedBy", "_damage", "_instigator"];
    if (incapacitatedState _unit == "UNCONSCIOUS" && side group _causedBy == west) then {
      _unit setDamage 1; 
    };
}];
hallow mortar
#

It's possible the EH is firing after the damage has been processed and they've been set to unconscious.

#

This is a complex area to operate in because of all the interacting mechanics.
You might need a HandleDamage EH instead; it fires earlier in the damage process. But the medical system also uses HandleDamage EHs to do its work, and those will probably be added before yours - so if you want yours to be processed first, you'll need to remove the BI Revive EHs, add yours, and then re-add the BI ones. As I said, complex.

#

Working with damage processing is probably one of the most annoying and complicated scripting topics in the game.

split scarab
#

Damn, real shame because trying to execute people using the vanilla medical system is janky as hell

fair drum
split scarab
#

Sometimes it takes 1 bullet to the chest and other times it takes 3 to the head

plain bramble
#

Nevermind I've found it

#

This may work wonderfully, ty.

lyric gulch
#

@fair drum where do I go for commands?

fair drum
lyric gulch
#

okay the keybind worked

lyric gulch
fair drum
lyric gulch
#

Thank you so much

fair drum
#

you can change the environment on the top right bar of the terminal. can do powershell, cmd, etc

lyric gulch
#

Nicee

#

Itโ€™s in powershell by default at least for me

buoyant cairn
#

Guys, anyone here have a script that gives the player a new mag on the last fired shot? old one i have is no longer working

warm hedge
#
player addEventHandler ["Fired",{
  params ["_unit","","_muzzle","","","_magazine"];
  if (_unit ammo _muzzle == 0) then {
    _unit addMagazine _magazine;
  };
}];```not tested
buoyant cairn
#

Thanks, gonna test and come back with the results

buoyant cairn
buoyant cairn
#

What should be changed for it to have an effect on already spawned units and not just the new spawned ones?

fair drum
buoyant cairn
echo nebula
#

hey scripters anyone here know how to manipulate ace stuff? ive got some variables i want to change for all ace cargo and wanted to see what was possible

#

i want to take the utility of this image and be able to make it for a mission rather than config it for a pbo

fair drum
echo nebula
# fair drum what do you mean make it for a mission rather than a pbo? that menu right there ...

i understand that, for an individual object it will follow those rules but i want to make it so all of that same object follows those rules ie all barrel cargo net object follow the rule of cargo size = 2 this menu only allows manual change of that one and any duplicates, if i then load into the game and try to spawn or duplicate the object it doesn't follow the same ace principles and id like it to be consistent for the mission that all follow that rule set

#

i figured maybe on startup i could run a script or maybe a script for each individual object in the cargo framework i noticed im not 100% sure because im new to this stuff but that was where my head was at with i

fair drum
# echo nebula i understand that, for an individual object it will follow those rules but i wan...

Ah ok. So you'll want to use a class event handler with the init tag from CBA to execute code on everything new and old of a given class name. I'm not at my computer to give you the values to change, but in the meantime, you can look at the ACE GitHub under the addon that contains what you want to change. There are usually some public functions, if not, look in the code for specific variables to change.

echo nebula
#

ill get back to you in 30 minutes or so thx still unfamiliar with all of this but i will try

echo nebula
#

im running a gamemode where supplies lead to purchasing vehicles and equipment etc and so far ive had to do alot of it manually but i really would prefer to have some functions that allow for some load of ie: players can load and unload cargo, they can purchase items for certain price of supplies, and those items and vehicles and supply all are maintained by the mission itself so thank you this is a great start for me!

echo nebula
#

how would i go about using these functions do i put the code into the init of the mission id like to learn how this works so i can do it alot

#

im mostly asking how do i tell what to do i dont want to just copy paste id prefer to understand how for future ref

#

ty btw

modern plank
#

Hello guys, I am failing to assign LAMBS-dev tasks (WP) to AI group in vehicle, does somebody have some working examples to share?

open marsh
#

guys im spawning a sniper and making him aim and fire at a target, can u guys give me just the code to make him very accurate, good stance, right AI features disabled, enabled etc...

#

i need the sniper to be extremely accurate

warm hedge
#

setUnitPos to change unit's stance
setSkill to set skill

open marsh
#

@warm hedge Thank you

#

Do you have any idea how a .50cal m107 is injuring ai at first shot instead of always killing?

#

no ace medical, vanilla

warm hedge
#

"HandleDamage" Event Handler to instakill

open marsh
#

but is it realistic, im asking cuz i wont do it if its realistic

#

if there's a reason why it is like that in arma

warm hedge
#

Urm, are you asking is it possible in script or is it realistic

modern plank
#

Can we know how many "seats" are available in a vehicle? I would like to generate the right number of bots (random but not exceeding vl capa) before moveInAny all of them (vehicle class is chosen randomly).

warm hedge
warm hedge
#

I don't care. I will do it if it is necessary

open marsh
#

No i asked if its possible in reality that u dont get killed from this hit

warm hedge
#

I answered "I don't care"

open marsh
#

thats nice

open fractal
#

is it fun

open marsh
#

being very helpful

warm hedge
#

If it is anyways necessary to your situation, I do it

#

That's just about it

open marsh
#

yeah great help, bro

#

im gonna say that to other ppl too when they need help

#

guy thinks i msking his personal opinion whilst i literally asked if the arma devs had a reason for making it this way

#

the iq points are shining out of this one

open fractal
#

youre funny as hell for saying that to polpox of all people

warm hedge
#

Then you failed to ask your actual question

#

I thought you made a personal question

open marsh
#

Is there a reason why the arma devs made vanilla damage the way that a .50 cal can injure someone instead of directly kill

warm hedge
#

How does one understand that question with these three words: "is it realistic"

#

No, I'm not a developer

open marsh
#

Are we supposed to reverse engineer the code by using open source tools to understand this game, sicne the forums adn the docs are always so lackluster

lime rapids
#

also chances are the .50 cal is modded which can mean that it does anythign in damage depending on how it was made

open marsh
#

It's M107 though, isnt it basegame

warm hedge
#

It isn't

open marsh
#

So ur saying it's a CUP issue?

warm hedge
#

No?

lime rapids
open marsh
#

I have nothing but CUP weapons

warm hedge
#

"It is happening" is the answer

lime rapids
warm hedge
#

And is it the real question you want to make?

lime rapids
#

and how it relates to scripting