#arma3_scripting

1 messages · Page 211 of 1

round hazel
#

Global how? I thought it ran only on clients?

round hazel
#

Good catch, cheers. And bugger, lmao

oak loom
#

looking to bring liberation_RX arsenal we have saved over to a training mission is there a way to do this for noobs

hoary saddle
#

trying to have players get in one vehicle, and teleported into the passenger seat of another. heres what i have, and idk what I'm doing wrong.

in the condition of a trigger:
private _players = allPlayers - entities "HeadlessClient_F";
count (_players select {alive _x && _x in heli_1}) isEqualTo count _players;

in act:
0 spawn {
[["", "BLACK OUT", 3]] remoteExec ["titleText", 0];
sleep 3;
player moveInCargo heli_2;
sleep 3;
[["", "BLACK IN", 3]] remoteExec ["titleText", 0];
};

#

the original script was move that same vehicle to an invisable marker, but i cant have the orginal vehicle TP somewhere else.

shut carbon
#

Yes

#

I've never done it, but i think it's possible

dark viper
#

I've found the Radio Protocol system that the game uses to send radio messages from AI or AI commands, and I wanna be able to send those sounds of my own choosing by a script, does someone know how?

gritty crane
warm hedge
bold shale
#

Hey all! I'm not sure if this is the right channel, but I’ve been having issues with compositions in Zeus lately.

Until recently, I could place compositions that use BIS_fnc_attachToRelative (such as the [KES] Tactical Toilet composition) without any problems. However, as of a week or two ago, any composition with attached objects now spawns with those objects seemingly detached — launching them into orbit and destroying them.

I’ve tested the same compositions in Eden, and they work fine if placed before mission start, so it seems specific to Zeus. I also tried re-saving the compositions with no luck. I haven’t seen other reports of this, so I’m wondering if it could be a recent update or more likely some setting I toggled (like terrain or surface snapping).

Has anyone else run into this, or have suggestions for debugging it?

Thanks in advance!

hallow mortar
#
  • Zeus-placed compositions rely on a server/mission config setting to be allowed to execute code in their init fields. If this setting is wrong, the code won't be executed.
  • compositions aren't necessarily guaranteed to be created in any particular order, so references to other objects in the composition (for example, to attach them) might not be available at the time any given object's init field is executed
#

A starting point might be to see if any code in the composition's init fields is being executed

hoary saddle
warm hedge
#

What is "original aircraft"?

bold shale
#

very much appreciated

hoary saddle
bold shale
#

really saved me a headache, not sure why i didn't check that to start

thin fox
# hoary saddle heli_1

what polpox is trying to say is basically what is the problem actually, we don't know how is your scenario set up, etc. you need to give us details so we can help you

#

think that we don't know what heli_1 is for instance

warm hedge
#

Nor how is heli_1 involved on the situation

hoary saddle
#

Dude my bad, long day lol

Heli_1 is just a vehicle sitting on the tarmac. It’s just the vehicle that players use to get into the passenger seat.

Once they get in, they are supposed to be moved into the passenger seat of heli_2 which is a static plane in the air (still need to figure that part out.

What’s happening is the player is just staying in the back of the plane on the tarmac, not being moved to heli_2 in the air.

The posted script doesn’t have the EH, but I couldn’t figure out how to write that anyway as I’m absolutely horrible with this stuff.

#

For some reason the “player moveInCargo” isn’t working.

#

I also read that version that uses the EH getIn was used for SP, what’s posted is MP compatible. 🤷🏼‍♂️

thin fox
#

maybe you just need to moveOut player before using that command

tulip ridge
#

You do, most if not all moveInX commands are like that

hoary saddle
#

Helps if I knew how to read. Thanks for the suggestions guys, I appreciate it.

tulip ridge
#

👍

#

For the teleporting part, you can just use a "GetIn" event handler on the helicopter.

Alternatively you could use a GetInMan event handler on each player, which would be easier networking since it'd already be running local to the player

hoary saddle
#

I couldn't get that one to work either, I was trying to write that one out myself though so thats my issue #1 lol

latent ridge
#

Good afternoon gentlemen, I dont mean to interrupt so whenever y'all got a second, I gotta question here. I am trying to "randomly" destroy 3 vehicles I thought I had the coding right since it did not throw any errors, however nothing happens at all; (this is inside of a .sqf file if you need to know lol)

private _decoyarry = [decoy_1, decoy_2, decoy_3];

{
   {_x setDamage 100};
   sleep (5 + random 10);
}forEach _decoyarry;
tulip ridge
#

Remove the braces around the _x setDamage line and it'll actually destroy it.

Damage is also 0-1, anything above 1 is treated as 1

latent ridge
#

oh lol, so something like this?
also once they are all destroyed will it automatically stop running this code or do I need to add a if then type thing?

private _decoyarry = [decoy_1, decoy_2, decoy_3];

{
    _x setDamage 100;
    sleep (5 + random 10);
}forEach _decoyarry;
tulip ridge
#

It'll stop, the code in the forEach runs once for each item in the _decoyArry

latent ridge
#

gotcha; ok I thoughts how it worked but wasnt sure

tulip ridge
#

Also that will immediately destroy the first vehicle, and then have a delay for the 2nd and 3rd

Not sure if you want that

latent ridge
#

I would assume thats a easy fix of flipping the two codes around

tulip ridge
#

Yep

latent ridge
tulip ridge
#

Yes

latent ridge
#

10-4 thank you sir!

keen crag
#

What types of images can I use in arma and for what? I know about paa and jpg, but I'm curious about anything else

dark viper
#

wiki is blocked link on this server XD

dark viper
warm hedge
warm hedge
dark viper
hallow mortar
# keen crag What types of images can I use in arma and for what? I know about paa and jpg, b...

PAA is pretty much always the right choice. You can get away with the others in certain cases (mostly UI/briefing), but only PAA can contain all the information needed for a properly optimised texture on a model. Other formats can cause rendering oddities. So PAA is the only one you should use for textures, and since it's also a valid option for all other cases, there's really no reason to use anything else.

tulip ridge
#

editorPreviews are traditionally 455x256, which cannot be converted to paa and are thus jpgs

#

You can still use other formats though, for decal objects I just the texture

keen crag
tulip ridge
native hemlock
#

I don't think a ruin is an entity

keen crag
#

Does anyone know how to implement markers that are displayed in 3D when you hold down J?

#

At the same time, the main functionality of the J button remains

warm hedge
#

drawIcon3D if that's what you mean

keen crag
native hemlock
warm hedge
#

It is a command, not a EventHandler, R also don't do such anything in vanilla

keen crag
#

I spelled it wrong, I meant J

warm hedge
#

J does not also

native hemlock
#

Maybe try "Ruins_F"?

hushed turtle
keen crag
sharp grotto
#

I realized after 7k+ hours, you can change zero with CTRL + mouse-wheel 😂

native hemlock
#

Can you get any buildings from entities? I don't think so

earnest valve
#

@native hemlock. You can't because entities are living things in the game. Try nearestBuilding, nearestObject or nearestObjects.

hallow mortar
# warm hedge J does not also

R and J both have default functions in vanilla Arma. R is for Reload and also uhhh Reveal Target for lock-ons; J (double-tap) opens the Journal (briefing). And there is, of course, the ability to rebind keys.

warm hedge
#

Well, that's why I said "don't do such"

hallow mortar
#

They're not worried that those buttons already do the same thing they want. They're worried about blocking whatever the default action is from those keys. Some methods of adding scripted keybinds can stop the original keybind on that key from being detected.

warm hedge
#

The point is, it is not a vanilla feature

hushed turtle
#

How to get classes from config of units who share same parent class?

jade abyss
winter rose
#

isKindOf can help too

trim atlas
#

Anybody know how i can edit the default bases of the Invade & Annex by quicksiulver?

earnest valve
#

lol

#

Wait, @jade abyss. Does that command actually returns classless objects?!? 😮

delicate tangle
#

Can you call a function with spawn without any input parameters? For instance: spawn Tag_fnc_functionname

winter rose
#

depends if the functions allows for it

delicate tangle
hallow mortar
#

Until 2.22, the spawn command requires something on the left side. If you're not going to actually use the passed argument, just make it something small and unimportant, typically 0

hushed turtle
#

I was able to get array of config entries and not classes, but it doesn't matter since these units have classes like "some_class_XX" where XX is number, which means I can easily target them with random number.

Looks like new configClasses alternative syntax is coming in 2.22 making it easy to get children classes by their parent class.

pallid palm
#
[] spawn Tag_fnc_functionname
hallow mortar
delicate tangle
#

Sounds good, thanks

pallid palm
#

so we should do like this ```sqf
0 spawn Tag_fnc_functionname

fleet sand
hallow mortar
#

Why would I say that creating an array with 0 inside it is better than...creating an array?

pallid palm
#

oh ok

#

i see: oh i did not say it was better: my friend: i was just trying to learn more

fleet sand
pallid palm
#

yes but dont the [] just mean this in this case

fleet sand
pallid palm
#

ahh i see ok thx m8 good info

#

@ anyone 🙂 oh hay is it the same for call ?

delicate tangle
pallid palm
#

yeah im just learning after over 20 years of playing 🙂

#

i learned so much in the last year my head is almost full 🙂

#

all the guys in here helped me so much: they may be getting tired of my hard to remembering mind 🙂

#

iv been keeping a huge .sqf file for when i learn something: i put it in that sqf file with a explanation of what the code does: so i can go back and re-read it 🙂

#

actually i have like 5 huge .sqf files like that 🙂

#

i wish my brain was like a .sqf file 🙂

#

or maybe it is and we just don't know it is 🙂 lol

delicate tangle
#

Just try to solve problems or create features via scripts….thats how I learned

pallid palm
#

yup yes sir

#

and i only use vanilla so its Awsome

hallow mortar
#

In fact, called code is a subscope of the parent scope, not a new thread like spawn is, so it can access any variable from the parent scope. That's why using private is important, to prevent accidentally overwriting variables in the parent scope if you happen to use the same name.

fleet sand
pallid palm
#

nice thx you @hallow mortar and @fleet sand

#

so i was incorrect when i was thinking that: spawn can have sleeps in it: and call can't

#

or how does that work

sharp grotto
#

you can read it here

pallid palm
#

ahh nice

#

wow that was fast 🙂

#

oh nice bookmark that woohoo

jade abyss
#

Ah @tough abyss . Then nearestObject.

pallid palm
#

lol i was thinking Subscope was a diff thing 🙂

#

cuz i always make U-boat missions 🙂

#

just a little joke 🙂

#

man its the little things that makes a big deal 🙂

#

the more i do stuff: the more i think everything is like Golf 🙂

fleet sand
# pallid palm so i was incorrect when i was thinking that: spawn can have sleeps in it: ...

no you are right. Spawn can and is meant to have sleep in it while call isnt.
Contrary to a widespread misconception in the community, call doesn't necessarily execute the code in the Unscheduled Environment. Call simply means: "execute the code here".

Example:

Debug Console:

0 spawn {
    call {
        systemChat "Test";
    };
};

this call in spawn is in Scheduled Enviormente it means you can call sleep in it.

But in here:

Debug Console:

call {
    systemChat "Test";
};

This call is in Unscheduled Enviormente so you cant suspend the script.

pallid palm
#

copy that my friend cool

#

it feels good to be correct thx m8

blissful current
#

Any idea why these animations are exactly in sync despite the sleep? The sleep seems to be working in SP but not MP.

[] spawn {
[ptunit1, "AmovPercMstpSnonWnonDnon_exercisePushup"] call foxClub_fnc_loopAnimation2;
Sleep 3;
[ptunit2, "AmovPercMstpSnonWnonDnon_exercisePushup"] call foxClub_fnc_loopAnimation2;
Sleep 1;
[ptunit3, "AmovPercMstpSnonWnonDnon_exercisePushup"] call foxClub_fnc_loopAnimation2;
};
granite sky
#

You mean for a separate client in MP, or localhost?

blissful current
#

It always works as written in SP, and also MP on the local host and client if I execute it with ADT mod from the scheduled play button.

If I put this where I want it; a server-only trigger in the activation field it doesn't work on local host or the client (animation is synced).

granite sky
#

When does the trigger activate?

blissful current
#

When a player is present inside a specific helicopter.

#

Roughly at the end of the mission.

#

I'm gonna set up a separate trigger and see if I can reproduce the behavior from that.

#

The issue is caused because the units are synced to a hide/show module which unhides them on trigger activation. 🤔

#

I guess the code gets ran but if they are hidden they must be "frozen" in place. So when they are unhidden they all play the animation at once?

granite sky
#

It's possible. I don't think there's any documented interaction between hide & animation.

hallow mortar
#

I think it's quite likely that the Hide/Show module also disables simulation on the objects it hides

blissful current
#

Yeah, this would make sense because I did a test where I put down 100 AI that where hidden with the module, then showed them with a trigger. It impacted my performance quite a bit; I lost around 20fps.

granite sky
#

hmm. My recollection is that it doesn't. But I only read it once.

#

Also I forgot how to find that code :P

blissful current
#

If not simulation it definitely helps with performance. Now I need to figure out why flyInHeight works in SP but not local host/client.

granite sky
#

There are an awful lot of cases where flyInHeight sucks regardless of locality.

#

but it does require a local argument.

hallow mortar
blissful current
#

It's pretty frustrating for sure. It's the only way I've found to keep the heli from skimming the tree tops. When it does this it bobs back and forth and makes me motion sick.

Right now it's in a sqf that gets remoteExec to server and clients. Maybe that's an issue.

blissful current
#

I wish there was a way to pin/favorite discord messages for future reference.

delicate tangle
#

If a global variable is set to true within a CBA keybind scope, will the variable be useable in other functions?

winter rose
warm hedge
#

What useable, what other functions

delicate tangle
#

Thats what i thought but the function thats called by the keybinds doesnt pickup the variable

hallow mortar
#

Global scope variables are available to all scripts on the same machine. That's what makes them global.

warm hedge
#

What pickup

hallow mortar
warm hedge
#

If pickup mean the variable is useable in a function, almost always yes, because Global Variable is useable anywhere within a mission

blissful current
#

Is this correct syntax? I'm trying to remoteExec this switchMove.

testUnit switchMove ["HubStandingUA_idle2", 0.8, 0, false];

[testUnit, "HubStandingUA_idle2", 0.8, 0, false] remoteExec ["switchMove", 0];
granite sky
#

No, would be:

[testUnit, ["HubStandingUA_idle2", 0.8, 0, false]] remoteExec ["switchMove", 0];

Whether remoteExecing the switchMove is a sensible thing to do is another matter.

blissful current
#

Yeah I need the brackets thanks. It's weird. Some animations I've come across need it. I've tried so many ways to get them to show up on the client but only remoteExec works. Others I don't need it. I have no idea why.

dark viper
#

Day 2 of wondering if anyone knows how to script Radio Protocol messages on demand.

#

If you know about it and if it involves a config like a custom CfgRadioProtocol give me the details

fair drum
dark viper
# fair drum How about you post what you have so far, and we can start there

Well I've followed and read the wiki about Conversations and Sentences

here's the example

class Sentences
{
    class AirstrikeRequest 
    {
        text = "%team requesting close air support at grid %location ";

        speech[] = { %Team, RequestingCloseAirSupportAtGrid, %Location };

        class Arguments 
        {
            class Team { type = "simple";};    
            // "RequestingCloseAirSupportAtGrid" is part of Radio Protocol
            class Location { type = "simple"; };    // refers to %Location, last element of speech[]
        };
    };
};

I thought the speech part with RequestingCloseAirSupportAtGrid would play a built in radio protocol message from the game's config but there is no audio. After reading RadioProtocol wiki I think it is implying that I'm supposed to have a custom config already with a RequestingCloseAirSupportAtGrid defined with an audio file.

For some reason I can't even get sounds to play at all with any method I try though. Everything is ignoring my audio files in my mission path.

I have an audio file in the mission root "sample1.ogg" and it does not play any audio via functions such as
playSound "radio1"; or player say "radio1"
(

and the convoluted
["StrikeMoveRequest", "MissionName", nil, "SIDE", nil, [testPlayer], 1, false] spawn BIS_fnc_kbTell;

This displays the conversation UI correctly with the text and everything, but no audio either. I'm trying to do play the engine's RadioProtocol but I can't even get my own audio to player directly with the basic functions for them, not sure why.

The only audio I've managed to play is via built in CfgSentences from the default game config, which contains all the voicelines from the game's campaigns. So I've got the example: ["01_Wave", "A_in", nil, "SIDE", nil, [player], 1, false] spawn BIS_fnc_kbTell; which will play audio from the player saying like "Come over here, Kerry"

#

Oh and I'd be somewhat satisfied if I could just pull out the words from the default config from CfgRadioProtocolEng >> Words but couldn't / don't know how to access the game's base root from my mission, cause it looks in its own root.

class CfgSounds {
    class radio1
    {
        name="radio1";
        //sound[]={"@A3\Dubbing_Radio_F\RADIO\ENG\Male04ENG\Combat\Advance.ogg"};
        sound[]={"sample1.ogg"};
        titles[] = {0, "TEST RADIO"};
    };
};

the commented out portion i have tried similar to that

fair drum
dark viper
#

I would try it myself but I can't even get audio to play at all for some reason so I'm unmotivated atm

buoyant cairn
#

Is someone free to give me some insight to make a script for a instant hit bullet?

dark viper
buoyant cairn
#

nice, i'll do some searching and try it, thanks dude

warm hedge
#

Note that, "instant hit" can be achieveable by having exteme bullet velocity, but will affect the damage value

sharp grotto
dark viper
# buoyant cairn nice, i'll do some searching and try it, thanks dude

make starting position from the player camera and the direction their view direction and if you don't want your bullets going through the ground probably set the end of the raycast at the return value of terainIntersectAtAsl [start, end]
and that'll be your end position for lineIntersectsObjs

dark viper
buoyant cairn
warm hedge
#

I'd pick lineIntersectsSurfaces, setPos, setVelocity to try it

buoyant cairn
#

Okay, i'll try it[

sharp grotto
dark viper
#

do it really work for u ?

#

oh it works nvm

#

don't know how to get the correct path for stuff from the pbo

warm hedge
#

addonFiles is a command for it

dark viper
#

I just got one of the radio protocol sounds to play, thank you. A3\Dubbing_Radio_F\data\eng\Male04ENG\RadioProtocolENG\Normal\100_Commands\Advance.ogg

#

it would still be cool to know if stringing them together like the engine does it is possible via script

dark viper
warm hedge
#

To find filepath?

dark viper
sharp grotto
#

Not sure if everything is listed, but alot is

dark viper
dark viper
#

I have the file Advance.ogg in my mission root. I got no idea why it acts like this

// inside CfgSounds
sound[]={"Advance.ogg"}; // doesn't work
sound[]={"\Advance.ogg"}; // doesn't work
sound[]={getMissionPath "Advance.ogg"}; //doesn't work

// inside script / debug
playSound3D["Advance.ogg", player]; // doesn't work

playSounds3D[getMissionPath "Advance.ogg", player]
 // works
warm hedge
#

sound[] or sounds[] in this context it doesn't do anything with it. At all, it's a legacy something

dark viper
#

you can define something in CfgSounds and do like this

    class radio1
    {
        name="radio1";
        sound[]={"@A3\Dubbing_Radio_F\data\eng\Male04ENG\RadioProtocolENG\Normal\100_Commands\Advance.ogg"};

hallow mortar
warm hedge
#

Yes

sharp grotto
#

Shortened example from my old mission

{
    sounds[] = {}; // this can be removed the wiki says (legacy)
    
    class custom_alarm_1
    {
        sound[] = {"@A3\Sounds_F\sfx\alarm_independent.wss", 1, 1, 20};
        titles[] = {};
    };
    class custom_notif_1
    {
        sound[] = {"a3\sounds_f\missions\invalidcoords.ogg", 1, 1, 20};
        titles[] = {};
    };
    class cough_custom_1
    {
        sound[] = {"@RW_assets\sfx\cough_custom_1.ogg", 1, 1, 20};
        titles[] = {};
    };
};
hallow mortar
dark viper
#

yeah im just showing different ways to play sound related to what im doing and idk why its not working for my root mission relative files

hallow mortar
warm hedge
#
  • CrgSounds is not related with playSound3D but playSound
  • playSounds3D is not a command
hallow mortar
dark viper
#

yeah it's a typo

sharp grotto
dark viper
#

i can't get player say "radio1" to work for example with this

    class radio1
    {
        name="radio1";
        sound[]={"@A3\Dubbing_Radio_F\data\eng\Male04ENG\RadioProtocolENG\Normal\100_Commands\Advance.ogg"}; // or remove the @ same thing
};
player say "radio1";
playSound "radio1";

these don't work but I can do for example playSound3D [ "A3\Dubbing_Radio_F\data\eng\Male04ENG\RadioProtocolENG\Normal\100_Commands\Advance.ogg", player]; and it works, and it also doesn't work with an audio file in my mission root/relative paths

#

ah yes but I got it working like this

sound[]={"@A3\Dubbing_Radio_F\data\eng\Male04ENG\RadioProtocolENG\Normal\100_Commands\Advance.ogg", 1, 1, 10};

the options in the array seem mandatory (i guess it maybe plays at 0 volume default)

#

yeah now the audio files in root are working

#

the wiki in other sections does not show these array parameters being put in the Cfg file or mentions it being mandatory so tbh im right to be confused

hallow mortar
dark viper
#

Alright for now my confusion is settled thanks for your help everyone

harsh nebula
#

Hi everyone, I wanted to know if it's possible to display what's framed through the laser designator on the monitor.
I'm writing a script that allows me to display the helmet cams of the operators and the UAV turrets on monitors (at Headquarters).
I wanted to know if you think it's possible to do the same for binoculars (I'd like to set up only the laser designator and other suitable binoculars from another MOD).

dark viper
last cave
#

I noticed that the soldier models are moving downwards as the camera position moves away. This can happen even 10 meters away from the player (a fact I saw through the laser exit point). The position is taken modelToWorldVisualWorld. Could this be why the laser point doesn't move behind the model? (The laser doesn't move downwards as the model descends.)
The model is lowered only when the landscape quality is low and where there are no roads (This only happens where there is grass)

ivory lake
#

it's to simulate the lack of grass by moving the units slightly underground

#

makes more sense when they're prone

#

it obviously has its limitations tho

last cave
#

Of course, because in the normal game there's nothing to base the shot on. But my laser comes straight out of the device. And the height difference is visually visible as the camera zooms out from the soldier. You wouldn't see that in a normal game because there's no laser...

dark viper
ivory lake
#

doesn't matter - its just distance

#

low terrain quality might make it happen at closer range

dark viper
last cave
#

It amuses me that sometimes it takes soldiers about 10-15 seconds to realize that there is someone standing next to them who is not from their side... ))

#

terrain 48

dark viper
ivory lake
last cave
dark viper
#

wow didn't see this before

ivory lake
#

something like _unit groupRadio "SentFormPosAdvance" should do what you listed

#

the only problem is I don't think you can string words together like the game does

#

at least im not aware of it being possible

dark viper
ivory lake
# last cave Terrain 2

strange that it's happening when using the visual command, does it still happen when you use simulation scope instead ?

dark viper
ivory lake
#

ie. modelToWorldWorld

ivory lake
last cave
last cave
ivory lake
#

even if it does work it's probably not good as it'll lag behind a bit

last cave
#
_proxy = format ["proxy:\a3\characters_f\proxies\%1.001",_type]; 
_datal=_hashArray#_Id#1; 
 
_unit selectionVectorDirAndUp [_proxy, 1] params ["_vy", "_vz"]; 
private _pos = selectionPosition [_unit,_proxy,0,true,"FirstPoint"]; 

anyway selectionPosition no check visual position from ground...

#

AI smart... NO see me in road open space

#

It turns out that the vanilla IR laser has the same problem... lol

dark viper
#

this is the laser from them right?

ivory lake
#

thats interesting I was wondering about that and was checking the visible lasers in ace etc

#

I don't think there's a way around it without finding a script command that actually accounts for the 'sinking'

last cave
#

drawLaser [_p1La, _v2La, _color, _color, 0.15, 0.15, -1, false];

dark viper
#

this is cause the AI is not aiming from where their model appears to be cause of the grass and terrain LOD i presume?

ivory lake
#

again its a feature

dark viper
#

you're a funny guy

last cave
#

Limni ground and Grass ground)))

dark viper
#

yeah, the model is only shifted visually by the game, the laser position still starts where its actual position is

ivory lake
#

yeah

#

and the problem is if the laser is shifted it'd be technically incorrect

#

like say they're pointing at something over an object, now that theyre sunk into the ground the laser is now hitting the object

#

when in 'reality' it's supposed to be going over it

#

its only noticeble if you're looking at things at long distances, it's more noticeble here because the picture is zoomed

last cave
#

What's funny... If you think about it, where should you shoot if you want to hit the head?
As we can see from the laser dot, the character drops about one head. This means that if an enemy stands behind a fence with only their head sticking out, their model will visually drop down on the grass, but in reality, they can see over the fence, even though we can't see their head.

ivory lake
#

yeah it has a whole lot of problems, it makes sense for someone prone in grass but falls apart after that

ivory lake
dark viper
#

in my short observation i noticed in my game on very low terrain, there was extra terrain visually generated instead and the enemies stayed still

ivory lake
#

its been awhile sicne I had to 'deal' with this stuff

dark viper
#

then that would make prone people basically invisible inside the ground but better for anyone crouch or standing

last cave
#

Balance? BALANCE!

dark viper
#

as i flew away from this tank, extra terrain is visually generated over it. in reality its just sitting in a field like normal

last cave
#

Mole tank

dark viper
last cave
#

This is a setting to render a detailed texture instead of the satellite image texture. coolfrog

hallow mortar
#

The texture of terrain in Arma is composed of several layers, including a satellite image (usually made with actual satellite photos of the template location, but can be completely synthetic if you're willing to put in the work) as well as various higher-detail textures of different surface types. The different textures are blended together based on distance to let up-close terrain have good detail, without wasting resources on distant terrain.

hallow mortar
# dark viper in my short observation i noticed in my game on very low terrain, there was extr...

It's not "extra" terrain, it's simplification of the terrain mesh at distance. Less polygons means some accuracy and detail is lost. Sometimes this results in the rendered terrain being higher, and sometimes it results in it appearing lower. For example, if a dip is smoothed out then it can "submerge" objects like this, while if a peak is smoothed out then it can cause "floating" objects (real annoying in tank battles where you think you can see a tank over a crest, but your shots still get blocked by the actual physical presence of the crest)

#

Units sinking to simulate grass camouflage is a separate mechanic

dark viper
dark viper
#

if you see what i mean, i thought the terrains grass would render as low lod flat terrain and it would visually cover more of an enemy

#

i understand that the reason is NOT a replacement of grass camouflage by design but thats it the LOD level shifting as distance increases

i dont understand where the grass sinking comes, i personally also havent seen the AI sink like that but i am new to ARMA

hallow mortar
#

It's tough to notice it happening in motion; units generally don't move fast enough to make an obvious change in elevation while you're looking at them. But it does indeed happen. At longer ranges you can see prone units being partially submerged, and you have to aim higher than you think to hit them because their physical model hasn't moved.

dark viper
#

cant notice much when the ai blasts me through the bushes and grass :)

hallow mortar
#

It's not just AI, btw. It's also a fairness mechanism for players in multiplayer. On your client, you may be well-hidden in grass, but the other guy 500 metres away isn't rendering that grass, so you stand out as an obvious soldier shape on a lower-detail texture. The sinking mechanism compensates to give you some of the camouflage you think you have.
It's not a perfect solution, but it is the one we have.

buoyant cairn
#

Tried a script muzzle velocity to make the bullet hit instantly, but it creates more spread, for some reason, also as predicted, the damage is hugely increased, which is not something needed

granite sky
tulip ridge
#

Running into an issue where my module that has isTriggerActivated = 1 is being run on mission start for some reason. I don't think the module function should matter for this since iirc the function isn't supposed to be called at all until the trigger activates it, but I also check for the _activated variable being true

if (canSuspend) exitWith {
    [<this function>, _this] call CBA_fnc_directCall;
};

params ["_logic", "", "_activated"];

// Only show circle to Zeuses
if (isObjectHidden _logic && {{ local _x } count (objectCurators _logic) > 0}) then {
    _logic hideObject false;
};

if !(isServer && _activated) exitWith {};
median nimbus
tulip ridge
#

Run it where the unit is local

median nimbus
#

the context window would be in a projectile's HitPart event handler

tulip ridge
tulip ridge
#

So remoteExec or CBA events

median nimbus
tulip ridge
#

Minus a little bit of time when first joining a server and respawning, yes

errant jasper
tulip ridge
#

You can just use a unit as the remoteExec target

median nimbus
errant jasper
#

No need to remoteExec unless there is a detection collision

#

Ah, see there is a specific note for units.. Yeah nvm then.. These binary locality icons are too coarse.

errant jasper
tulip ridge
#

I was looking at how the fire support module did its ring, saw it changed the simulation / model

#

I have separate modules for Eden / Zeus, so I just removed it from the Eden one so the Zeus one still has the ring

thin fox
#

I have a question related to reveal command https://community.bistudio.com/wiki/reveal, I don't understand the Local Effect on this.
I want the AI (created by the server) to knowAbout players in some area, I already have this set up. But I'm not sure how it handles on dedi, Do I need to remoteExec this command to see its effects on IA?
Ik there's a description about mp, but I still don't understand.

drowsy geyser
#

Is it possible to detect a headshot inside killed eventhandler?

errant jasper
drowsy geyser
#

Im using hitpart eventhandler for headshot but it would be easier if its possible inside killed eventhandler

#

I need to know if a kill was due to headshot

errant jasper
#

Not sure, seems like you might store the last hit locally on the target on the shooter's machine. Then on kill you query a check to run on the instigators machine. If the instigator last hit was a headshot your condition is met.

drowsy geyser
#

Yes this is exactly what im doing but would be cool if we could check it directly within killed eventhandler

buoyant cairn
errant jasper
#

_target isKindOf "Man".

sharp grotto
hallow mortar
#

One of the CDLCs has a setting for headshot sounds, I think it's Reaction Forces? You could look at their functions and see if they've found a neater way of doing it

winter rose
drowsy geyser
#

Would be cool if we can get projectile and hitSelection inside killed eventhandler

trim atlas
#

Does anybody know how i can edit the default bases of Invade & Annex Apex Edition by quicksilver? When i extract the mission.sqm file out of the normal apex framework mission the .pbo file (wich is active now on my server) I get a clean base for like how to make one but the default base?

thin fox
trim atlas
#

Yeah i know its fk scripted and the docs are not enough for me otherwise i didnt had this question

#

And i just want to edit it in eden editor and use it in the server

thin fox
#

it's something to do with the parameters as well

#

they have like a default base on their scripts

#

but you can do your base

trim atlas
#

I want to edit the default baze

#

Base

#

Thats the whole point

#

I know i can make my own and use it

#

But i need the default one in my editor

thin fox
#

so, make it better lol

trim atlas
#

I just need the default one to edit is and make it better

thin fox
#

💀

#

if you build your own, it will be faster than trying to understand QS script

trim atlas
#

But without QS i cannot move the default buildings of the altis map

#

And i need the tower to be on a other location

errant jasper
#

Yeah this. Compared to Java, Scripted event handlers is more like the Observer pattern. By "existing events" I meant like engine provided one (more like VM events/IO in Java).

umbral blaze
#

could I hook into it somehow? Or write one single monitoring/looping script that gathers custom events published to it and notifies the interested/subscribed scripts or classes that it happened and react to it?

errant jasper
#

You just listen to it, and will be notified automatically. Engine based events you handler is run directly, for "scripted events" the event machinery notifies you; you don't need your own monitoring:

// Engine event - the engine will raise this event
theKing addEventHandler ["Killed", {
    params ["_unit", "_killer", "_instigator", "_useEffects"];
    systemChat format ["Oh, no the king, %1, has died", name _unit];
}];

// Scripted event raised from script code
[missionNamespace, "CustomKilled", {
    params ["_unit"];
    if (_unit == theKing) then {
        systemChat format ["Oh, no the king, %1, has died", name _unit];
    };
}] call BIS_fnc_addScriptedEventHandler;

// Above event may be triggered from some BIS code or else, or like this (but don't loop for a killed event, just demonstration
theKing spawn {
   private _unit = _this;
   waitUntil {sleep 1; not alive _unit};
   [missionNamespace, "CustomKilled", [_unit]] call BIS_fnc_callScriptedEventHandler;
};
#

Though personally I don't use BIS event system, but rather CBA events.

#

To be clear, there can be more handlers for the same event; both return a handle index which can also be used to remove the handler.

blissful current
#

Why is _speaker on line 29 undefined as a variable?

#

Speaker is defined on lines 14 and 16.

winter rose
#

declare it above, empty (private "_speaker";) then fill it L14/16 (_speaker = xyz;)

blissful current
#

Thanks Lou, I didn't know that variables get deleted with scope. I initially tried to remove the _private thinking that it was a scope issue but that didn't work.

winter rose
thin fox
#

too many commands that do the same thing, what you want to do? besides the obvious

#

so it works, why did you ask then?

#

scratch that

#

now I get it

#

you need to learn to answer ppl in discord

thin fox
#

I ask this question like 12h ago lol

#

Now I get it what you trying to say

#

hover you mouse in the conversation, then you will see a "answer" arrow (it's portuguese for me so Idk what would be in english)

#

My question was related to the locality of the reveal command
I have already this set up, it's for Liberation gamemode

// Reveal targets inside the sector
[{
    params["_args", "_handle"];
    _args params ["_targetPos", "_helicopter"];

    if (!alive _helicopter || {!alive (driver _helicopter)}) exitWith {[_handle] call CBA_fnc_removePerFrameHandler;};

    private _bluforEntities = ([_targetPos, 150, 150, 0, false] nearEntities [["CAManBase", "Landvehicle", "Helicopter"], false, true, true]) select {(side _x) == KPLIB_side_player};
    
    {
        private _target = _x;
        {
            if (local _x) then {
                _x reveal [_target, 2.5];
            } else {
                [_x, [_target, 2.5]] reveal ["reveal", owner _x];
            };
        }forEach (crew _helicopter);
        
    }forEach _bluforEntities;

}, 60, [_targetPos, _attackHeli]] call CBA_fnc_addPerFrameHandler;
#

it's kinda hard to test this in dedi, I mean, to see its effects

#

maybe, once the enemy has knowsAbout > 2.5 more or less, they know that you "exists", they just need to have line of sight to fire

#

but since I have different players coming into the sector pos that I'm aiming here

#

yeah, in your case you're using a variable

#

in my case I need to make it more dynamically

#

so just revealing all the targets in area works

#

in other way, I could just select a random target, but dealing with AI air assets is horrible

#

that's why I've made my own CAS Menu that the AI planes take off, etc

#

hoping that Nikko is answering my question

hallow mortar
# thin fox like doing this

GA/LE means you can target an entity that's local to any machine, but the effect only happens on the executing machine.
There are a few parts of the AI's properties that are stored separately on every machine, and only the version on the machine that's currently hosting them takes effect. If the AI switch locality (e.g. group leader changes) then their new host's properties will start taking effect, even if they're different from the old host's. disableAI is another example of this.

If you're certain the AI will never change locality, or the change doesn't need to last forever, then you can safely target only the machine they're currently on (in this case, the server). If they could change locality, and you need the command to persist, then you should target all machines so they have the right settings ready when the AI switch to them.

#

Let's say you execute disableAI "PATH" on the AI's current host only, and disableAI "FIREWEAPON" on some other machine only. The AI will stop moving but will keep shooting. Then you change the AI's locality to the other machine. Now the AI will start moving and stop shooting.

#

For target knowledge data, syncing it persistently across machines probably doesn't matter too much because that data tends to become obsolete quickly anyway. But you do need to make sure it gets updated on the machine that's currently hosting the AI if you want it to have immediate effect.

thin fox
#

Tomorrow gonna throw a diag_log command there to see what the results are

hallow mortar
#

Probably, assuming there's no reason for the heli to change locality

hallow mortar
#

If you have a system in place that moves server-owned AI to the HC, then that is a reason for the AI to change locality.

thin fox
#

yeah the owner of the dedi server has HC set up

hallow mortar
#

HC doesn't automatically take ownership of AI, so it depends whether you have a system to do that, not just whether HC is present at all

thin fox
#

and part of those spawn units script get groups and throw at HC

thin fox
hallow mortar
#

HC is just a client with no player, so all the normal rules about locality and AI ownership apply to it just like any other machine. If you move AI to it, they are now local to it, and LE commands still need to be executed where the AI are local

#

Aside from the technical details of locality, revealing the target is only part of the puzzle. Aircraft AI can be weirdly reluctant to engage ground targets, or weirdly incompetent at lining up to attack. It's all a bit variable and situational.

flat stratus
#

Hello, question how do I implement landmines using a marker in a mission? I looked it up and it requires some scripting so I thought this might be the best channel to ask

dark viper
flat stratus
#

Sorry didnt clarify that I meant empty markers

#

The idea is that I want them dynamic so that it doesnt drag the server fps down

dark viper
#

it also can mark the map's lcoation for friendlies or whoever

flat stratus
#

Yeah well the problem is too many modules can cause fps issues

#

And they dont despawn everytime a server resets

dark viper
#

dunno anything about the performance implications of having too many modules as I am new to arma scripting

I don't see how this specific module would cause performance problems, and I also don't understand how they wouldn't despawn when a server resets

doesn't a server just reload the mission when the server resets ?

#

i can see having a lot of minefields might be laggy due to how they work in arma 3, but I don't see how them just existing in the module before being placed would cause lag

#

thwy would be "empty" before the condition trigger is met which probably polls at 2 per second like a default trigger

flat stratus
#

For the modules i actually tried it. it “works” but not as i expected it to

dark viper
#

I just checked the editor, there's no performance problems until you actually make the mines spawn by making condition = true

#

dunno how much the lag scales with player population in online

flat stratus
#

Around maybe 8 dudes

#

Though accounting for ai and ai logic aswell

flat stratus
#

Ur right

#

But they arent really dynamic

dark viper
#

what's the implication of being dynamic what do you mean them to do

flat stratus
#

If dude steps on mine = mine gone for good even on server restarts

#

Thats what i meant

dark viper
flat stratus
#

Not really the brightest when it comes to scripting but where do you think I should start?

dark viper
#

it's a little hard depending on how sophisticated your mine pattern needs to be, but if you wanna make like an X by Y square (each square being 3mx3m) and place a mine in each square as the script that could be pretty easy

if you want a circular or elliptical mine pattern with an even spread that adjust to the amount of mines being placed itll be a lot harder

flat stratus
#

Oh placing it is no problem imo

#

Its just the scripting of it

#

More of a defensive pattern

dark viper
#

for N amount of mines i would do a bunch of straight down raycasts from higher than the highest elevation on the map and check where it intersects terrain for each mine position, but there might be an easier way depending on how the game lets us get the Position values for X and Y

flat stratus
#

Ohhh i see what you mean

dark viper
#

you might be able to just query the X Y and the game will give the Z for the terrain level at that for the map

flat stratus
#

Now Im picturing it it all seems time consuming

dark viper
#

nah it's a 30 min job if you know what to do I feel like

flat stratus
#

Oh good sir I have absolutely no clue what I’m doing

dark viper
#

still not too hard I feel, maybe a couple hours learning some scripting functions

flat stratus
#

The wikipage for arma is the go to for the scripts and their functions right?

dark viper
#

yeah it's kind of a mess of spaghetti links sometimes and the search function can be somewhat bad

#

I'll tell you what to look at

flat stratus
#

I’ve seen some people have custom scripts

#

Appreciate it!

dark viper
#

I would read this for a minute while i look some stuff on it to help you

#

explains the different types of Position in arma 3 engine

flat stratus
dark viper
#

yeah this is a lot simpler cause you can just give the X Y positions and the game will give the Z for being at ground/terrain level

flat stratus
#

Okay so how about spawning them?

dark viper
#

well for performance i guess you dont wanna spawn the mines until people get close

#

you'll need to save some sort of data on the server side if you wanna replace the unexploded mines later (if you're unloading them in some way that isn't a server restart)

#

but just spawning the mines, it'll just be a script with a loop that has a starting point and places a grid of mines

cyan dust
dark viper
dark viper
# flat stratus Okay so how about spawning them?

there's a built in createMine function:

private _startPos = (getPosATL player) // just for example

private _length = 10;
private _width = 10;
private _spacing = 3;

for "_i" from 1 to _width do {
  for "_y" from 1 to _length do {
   private _mine = createMine["APERSMine", (_startPos vectorAdd [_i * _spacing * _width, _y * _spacing * _length, 0]),[],0];
playerSide revealMine _mine; //for testing
  };
}; 


flat stratus
#

Thanks ill play around with this

dark viper
#

it works pretty well

#

the last variable of for createMine is the placement radius and can be used to create randomness to the placement pattern
radius = 3 here

#

idk why "APERSMine" createVehicle pos places a mine but it is not armed, had to learn createMine for it

flat stratus
#

How do I implement these in a server?

dark viper
flat stratus
#

Oh okay

#

Thanks boss

dark viper
#

but yeah you can do stuff like setting triggers in the editor that run the script as well

it's like the built in MINEFIELD module mentioned at the beginning of our conversation but it's now your own script you made

#

If you want to have LOTS of minefields and you want to deload mines and regenerate them by proximity again AND save the status of what mines have been detonated, it gets more complicated

cedar bay
#

Can someone help me out with the script that would enable only BLUFOR players to remain on team if they punch in a special code into a laptop in first minute when joining a server, otherwise they would get teleported to enemy base and change sides to OPFOR? We would like to host public events where only our members can play as blufor and rest act as ofpor?

dark viper
#

@maiden thicket Yeah I can't even get kbTell to say my own audio files

maiden thicket
#

Considering CfgConversations, I gotta admit, I have just did everything as in youtube tutorials and I use bis_fnc_kbtell, that is slightly different function, but this should not be a problem.
Could You show Your code from .bikb files?
Also, You need some kind of trigger to use the function.

dark viper
#

Advance.bikb

class CfgSentences {
class Sentence1 
    {
        text = "ADVANCE";
        speech[]= {"Advance.ogg"};
        class Arguments
        {
        };

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


Description.ext
```cpp
class CfgSentences {
      class MissionName {
            class Advance
            {
                file="Advance.bikb";
                #include "Advance.bikb"
            };
    };
};
player kbAddTopic["Advance", "Advance.bikb"]
;
player kbTell [
(leader testSq),
"Advance",
"Sentence1"];

among other variations, this

maiden thicket
#

I tried to use kbTell from the example provided in BISWiki but it failed apparently. Will look at your code though.

dark viper
#

but I think i tried BIS function as well but ill check shortly

maiden thicket
#

Ok, I see a typo in description.ext - ""#inclue

dark viper
maiden thicket
#

Advance.bikb - missing backslash before file name

#

Advance .bikb other than missing backslash looks fine, but you could use actor = "someGuy";

dark viper
#

yo this is off topic but my load times for playing my mission in the editor right now is insanely long and I don't know why. it was instantaneous before

maiden thicket
#

It should not be an issue when using kbTell, where You point to some object talking, but I guess that it is needed when using BIS_fnc_kbtell

maiden thicket
dark viper
#

i might be accidentally using a massive modpack or something ill have to check

dark viper
#

lol

#

for sound[] in CfgSounds you don't need backslash so I did same way here

#

kbTell works too now

#

i had tested the backslash before I think but I prob had something else wrong during those times or had the wrong arguments to the functions

maiden thicket
#
;
player kbTell [
(leader testSq),
"Advance",
"Sentence1"];```

I guess that You could add that "actor" in bikb. and use instead:
```["Advance","MissionName"] call BIS_fnc_kbTell;```
And it would work fine
maiden thicket
dark viper
maiden thicket
#

oh, ok, it somehow flown over my head

dark viper
#

Now if I can just invoke to existing RadioProtocol words like this
speech[] = { Advance}; that would be cool

thin fox
hallow mortar
#

If the AI are local to a different machine, you need to make your reveal command be executed on that other machine. remoteExec is the normal way of making another machine execute a command.

#

It looks like you collect a number of targets to reveal in each pass. You should make a function that can handle an array of targets, and remoteExec that function once per pass, rather than remoteExec ing every reveal individually

thin fox
split ruin
#

I am trying to save player's score in profileNamespace but no avail ...

//initPlayerLocal.sqf
private _pscore = profileNamespace getVariable "KIB_playerScore";
player addScore _pscore;
private _scoreHandle = 0 spawn
{
    while {true} do
    {
        private _pScore = (getPlayerScores player) select 5;
        profileNamespace setVariable ["KIB_playerScore", _pScore];
        saveProfileNamespace;
        sleep 10;
    };
};

😭

hallow mortar
#

You should use a default value with getVariable to prevent an error if KIB_playerScore hasn't previously been set

jade tendon
#

Why do i even bother to ask for help in here when morons come out of the woodworks to put ppl down who are trying to learn in their own way.

hushed turtle
#

Poor AI

sharp grotto
#

You can also make sure that the variables exist like that, in your projects "init" function.

if(isNil {profileNamespace getVariable "KIB_playerScore"}) then
{
    profileNamespace setVariable ["KIB_playerScore", 0];
    saveProfileNamespace;
};

And you might also want to use https://community.bistudio.com/wiki/missionProfileNamespace instead of profileNamespace.

hallow mortar
errant jasper
#

Yeah, use missionProfileNameSpace if going to save it every 10s. On my last install people dumping into profile name space had made it become larger than 5 MB in size.. Dumping that every 10s is 2 GB of wasted SSD lifetime each hour of play.

#

But also don't save every 10s if nothing changed.

sharp grotto
split ruin
#

@errant jasper I have set it to 10s for testing puposes, 10 min otherwise ...

#

unfortunately it doesn't work with default value of 0, like @hallow mortar suggested 😔

#
private _pscore = profileNamespace getVariable ["KIB_playerScore", 0];
thin fox
# hallow mortar It looks like you collect a number of targets to reveal in each pass. You should...

Am I in the right track for dealing with units owned by HC?

KPLIB_fnc_findTargetsInSector = {
    params["_targets", "_heliGrp"];
    // Reveal targets inside the sector
    {
        if ((_heliGrp knowsAbout _x) >= 2.5) then {continue};
        _heliGrp reveal [_x, 2.5];
    }forEach _targets;
};

[{
    params["_args", "_handle"];
    _args params ["_targetPos", "_helicopter"];

    if (!alive _helicopter || {!alive (driver _helicopter)}) exitWith {[_handle] call CBA_fnc_removePerFrameHandler;};

    private _bluforEntities = ([_targetPos, 150, 150, 0, false] nearEntities [["CAManBase", "Landvehicle", "Helicopter"], false, true, true]) select {(side _x) == KPLIB_side_player};

    private _heliGroup = (group (driver _helicopter));

    [_bluforEntities, _heliGroup] remoteExecCall ["KPLIB_fnc_findTargetsInSector", groupOwner _heliGroup];

}, 60, [_targetPos, _attackHeli]] call CBA_fnc_addPerFrameHandler;
hallow mortar
thin fox
#

just fyi, this is where the groups gets owned by HC, every spawns it calls this CBA event handler (server event)

    ["KPLIB_battlegroupSpawn", {
        params["_group"];

        if (local _group) then {
            _headless_client = [] call KPLIB_fnc_getLessLoadedHC;
            if (!isNull _headless_client) then {
                _group setGroupOwner (owner _headless_client);
            };
        };

        KPLIB_enemyReadiness = (KPLIB_enemyReadiness - (round (1 + (random 1)))) max 0;
        stats_hostile_battlegroups = stats_hostile_battlegroups + 1;
    }] call CBA_fnc_addEventHandler;
hallow mortar
# hallow mortar Seems reasonable

I just want to reiterate that "units owned by HC" is not a unique special case. It's exactly the same as for units being owned by any machine other than the current one, whether that's because they're in a player group, because Zeus spawned them, or for any other reason.

split ruin
#

@hallow mortar I make a server, join in, give player 30 score, wait 2-3 min, get out from server, get out from A3, then start again, make a server, load the mission and player has 0 score instead of 30. Missions failed. 😭

thin fox
#

It's because I always make sure that the spawned AI stays owned by the same machine in my ops, but since I'm dealing with a large scale mission like Lib with HC, I need to learn something more about locality

#

thanks for all the info Nikko coolfrog

hallow mortar
sharp grotto
#

could be also a logic error, hard to say without seeing the code/functions etc.
like it gets instantly updated after joining before the old score value is even set, of course it would be zero then?!

split ruin
#

@sharp grotto checked everywhere in code, and no score is added in any form ...
I will try to run it with remoteExec globally ...

hallow mortar
split ruin
#

I tried this but still not working

private _pscore = profileNamespace getVariable ["KIB_playerScore", 0];
[player,_pscore] remoteExec ["addScore", 0];
private _scoreHandle = 0 spawn
{
    while {true} do
    {
        private _pScore = (getPlayerScores player) select 5;
        profileNamespace setVariable ["KIB_playerScore", _pScore];
        saveProfileNamespace;
        sleep 10;
    };
};
ornate whale
sharp grotto
#

server handles the values (scores) already, either save everything on the server, makes it a bit easier to script & manage.
or just save on the client in intervals, and request the server to set it on join, might be some timing issues when insta setting the values, so just add some generous sleep or some waitUntil{player == player}; before setting the value.
for debug purpose i would execute each step in debug console so you can verify the flow better and check all the values with systemchat's or diag_log's

split ruin
ornate whale
ornate whale
# split ruin this

I would probably try to place sleep 10; before the first addScore, to make sure the server is ready for your request. Otherwise, I would suggest to go the route @sharp grotto suggested.

split ruin
#

@sharp grotto bro, you found the culprit, I just added 5 s and now everything works, looks like player wasn't initiated until then, big thanks to @ornate whale and @hallow mortar too 🥳

sleep 5;
private _pscore = profileNamespace getVariable ["KIB_playerScore", 0];
[player,_pscore] remoteExec ["addScore", 0];

private _scoreHandle = 0 spawn
{
    while {true} do
    {
        private _pScore = (getPlayerScores player) select 5;
        profileNamespace setVariable ["KIB_playerScore", _pScore];
        saveProfileNamespace;
        sleep 10;
    };
};
sharp grotto
#

Initialization order quirks can make you question everything if you are not used to it xD

ornate whale
split ruin
#

true, I can add to sleep time even more (20s lag is unlikely I hope 😆 ) or add

waitUntil{player == player};
ornate whale
sharp grotto
#

For some "init timing sensitive" stuff on the client i slapped that at the end of initplayerlocal.sqf

0 spawn XYZ_Client_DelayedLoading;
//XYZ_Client_DelayedLoading
waitUntil{player == player};
sleep 5;
// "init sensitive" function calls etc 
ornate whale
errant jasper
#

Doesn't the server itself not also track scores in MP over the same session?

split ruin
#

its tracking all players score during mission, I wanted to save it between server sessions

errant jasper
#

Sure but with this solution wouldn't relogging allow doubling one's score repeatedly?

split ruin
#

@errant jasper you know why this will happen? 🧐

stable dune
errant jasper
# split ruin <@99871942399504384> you know why this will happen? 🧐

No, I am just inferring:

  1. Player A joins has 0 score zero set.
  2. Does stuff has score 20, 20 saved
  3. Relogs. Server sees same player from session sets (engine) score to 20. Your code runs see has 20 in score runs addScore 20, player now has 40.

But as I said I don't know if (human/steamid) scores are tracked over a session.

split ruin
#

but code do not add any additional score, even at the end of players session
when he quits and re-logs he gains nothing I think ...

#

it just saves whatever the player has gained by killing enemies, vehicles, doing tasks, etc.

#

@errant jasper my little brain finally understood what you said, I didn't know the engine will add score to the same player persistently if he rejoins, I will test it right now

#

is there a way to check if the same player rejoins the same session?

errant jasper
#

Yes, but at this point you are just layering on complexity.

#

If this is indeed the case, there is a simpler solution if your KIB_playerScore is kept up to date is always accurate (enough).

#
// Wait until player unit initializes, but not so long he might validly start gaining points.
// Then
// Engine doesn't allow you to "set" score, but rather to "change" score. So find the error.
private _targetScore = profileNamespace getVariable ["KIB_playerScore", 0];
private _engineScore = (getPlayerScores player) select 5;
// For a "fresh" server start the player has not been on _engineScore=0. Otherwise we correct.
private _error = _targetScore - _engineScore;
[player, _error] remoteExec ["addScore", 2];

Something like above.

#

But again I have no idea whether scores are player-persistent across the same server session or not. If not, then _engineScore above will always be 0 so I guess it doesn't hurt.

split ruin
pallid palm
#

no i dont put them on the work shop

split ruin
#

maybe private messages exist for this kind of stuff ...

pallid palm
#

agree

#

he just wants to try to make me look and sound bad: is what it looks like to me:

#

i guess there's another one for the ignore butten 🙂 wth is it a full moon out there or what 🙂 i should know better then to come in chat rooms when there's a full moon

thin fox
#

for those emojis patterns, looks like an AI generated text lmao

pallid palm
#

no no he's real i play another game with him:

#

called vietcong 1: all free game Awsome game

#

i already asked him plz not to reply to my post's in discord: cuz his posts are always derogatory

#

as you can see

#

so i can't see his post anymore so there you go 🙂

#

i love discord 🙂

vague bane
#

There any form of script to destroy everything synced to a trigger? Example, Hold action on a power box to destroy lights in an area (All synced to that action)

faint burrow
#
[
    ...
    { // codeCompleted
        _lights = param [3, []];

        {
            _x setDamage 1;
        } forEach _lights;
    },
    ...
    synchronizedObjects myTrigger // arguments
] call BIS_fnc_holdActionAdd;
pallid palm
#

or if you want them off right away in the initServer.sqf

#
// Turning off some lights============================================
_lampClasses = [
    "Land_LampAirport_F",
    "Land_LampDecor_F",
    "Land_LampHalogen_F",
    "Land_LampHarbour_F",
    "Land_LampShabby_F",
    "Land_LampSolar_F",
    "Land_LampStadium_F",
    "Land_LampStreet_F",
    "Land_LampStreet_small_F",
    "Land_PowerPoleWooden_F",
    "Land_PowerPoleWooden_L_F",
    "Land_PowerPoleWooden_small_F"
];
for [{_i=0},{_i < (count _lampClasses)},{_i=_i+1}] do
{
    _lamps = getMarkerPos "HQ" nearObjects [_lampClasses select _i, 1000];
    {If (random 1 > 0.5) Then {_x setDamage 0.95}} forEach _lamps;
};
fleet sand
pallid palm
#

rgr that can you make it better ?

fleet sand
# pallid palm rgr that can you make it better ?

something like this:

private _pos = getmarkerPos "HQ";
private _radius = 1000;
private _lampClasses = [
    "Land_LampAirport_F",
    "Land_LampDecor_F",
    "Land_LampHalogen_F",
    "Land_LampHarbour_F",
    "Land_LampShabby_F",
    "Land_LampSolar_F",
    "Land_LampStadium_F",
    "Land_LampStreet_F",
    "Land_LampStreet_small_F",
    "Land_PowerPoleWooden_F",
    "Land_PowerPoleWooden_L_F",
    "Land_PowerPoleWooden_small_F"
];

private _data = nearestObjects [_pos,_lampClasses,_radius,true];

{
    _x setDamage 1;
}foreach _data;
pallid palm
#

oh nice really nice thx man

granite sky
#

It's not necessarily faster though.

pallid palm
#

i only need it to run one time

granite sky
#

Either works. First version is ugly because it's using the old style for-loop rather than just forEach over the classes.

pallid palm
#

copy that

granite sky
#

I feel like I've seen that code before and it predates me playing Arma :P

pallid palm
#

oh shit 🙂

#

i started Arma games way back in OFP if you will

#

well OFP was not Arma but well you know

#

and i still don't know much 🙂 thats why i need you guys so bad 🙂

#

i love you guys 🙂

drowsy geyser
#

Or just switch off every light without damage

{_x switchLight "OFF";} forEach (1 allObjects 0);
granite sky
#

Needs to be remoteExec'd in MP though, unlike setDamage. Not sure which one is more network-efficient.

errant jasper
#

Sending the expression of the targeted objects just once would be a single message, so I imagine that would be way more network efficient.

buoyant cairn
#

Sup guys, so i tried a script i found online, it was supposed to delete the bullet you shoot and "spawn" it on the target, making the shot instant and flat, but it doesn't seem to be working anymore

warm hedge
#

And what's the question?

split ruin
#

is it possible to have multiple submenus for the support menu (0-8-)?

class CfgCommunicationMenu
{
  class sqaction
  {
    text = "Squad Actions";        
    submenu = "Move Respawn";                    
    expression = "systemChat 'banana';";    
    icon = "\a3\Ui_f\data\GUI\Cfg\CommunicationMenu\call_ca.paa";            cursor = "\a3\Ui_f\data\IGUI\Cfg\Cursors\iconCursorSupport_ca.paa";            enable = "IsLeader";                                    removeAfterExpressionCall = 0;    
  };
};
grim pasture
#
private _bool1 = _namespace isNil "var";
private _bool2 = isNil {_namespace getVariable "var"};

These 2 lines should generally return the same value, right?
I've just had a headache for 20 minutes because the first line doesn't work for scripted locations which is a valid namespace for setVariable but not for Syntax 3 of isNil.
So this code will work

private _location = createLocation ["NameVillage", [4035,2151,10], 100, 100];
_location setVariable ["var","val"];
private _isNil = isNil {_location getVariable "var"};

while this will give you an error since _location is not an accepted namespace for isNil Syntax 3

private _location = createLocation ["NameVillage", [4035,2151,10], 100, 100];
_location setVariable ["var","val"];
private _isNil = _location isNil "var";
#

The wiki does reflect that correctly as it is but it took me a while to realize

errant jasper
#

Well a location is a kind of object, right? SetVariable works on objects, but isNil does not.

grim pasture
#

regular locations are not valid for any commands related to variables
createLocation creates a "scripted location" which is a valid parameter type for setVariable and getVariable but not for isNil Syntax 3 for some reason

hallow mortar
grim pasture
#

locations, scripted locations and objects are 3 different types as far as I'm aware
it just seems a little inconsistent that setVariable and getVariable work for scripted location but isNil does not

hallow mortar
#

I'm surprised it doesn't just support every kind of namespace that can have variables set in it, but it is what it is

grim pasture
#

yeah I had assumed that it would
at least there's a workaround

dark viper
#

i've got a squad with a get in waypoint, and when it activates, the SL tells one person to get in, they get in. then the rest refuse to get in. the SL continuously orders more squaddies to get in the vehicle but they keep refusing, anyone know why this would happen?

hallow mortar
#

Is the vehicle full? Are they able to path to the entry point?

dark viper
#

they had plenty of room but not enough to convince the AI i guess

maiden thicket
#

I have a question about "fnc_kb_Tell" in Multiplayer.

I made characters talk once and be heard by all players work in MP by using [args]call fnc_kb_tell as action done when server-only trigger is activated.
I tested it on dedicated server with small mission file it works fine, every player hears bot talk (directChat + .ogg sound).

But in other mission, between a trigger activation and AI starting to talk it takes about a minute or more. Tasks checked by those triggers apparently work fine.

What might be the problem that cause so much wait time? Might this be a problem with a scheduled/unscheduled environment and I should use spawn instead? Or might this be problem with server/global/local exec?

maiden thicket
#

However, when I try to call this function from console on Dedicated server it gets executed instantly.

hallow mortar
#

scheduled/unscheduled isn't a problem, at least within the function; it automatically uses spawn inside itself if it's run unscheduled. It might be an issue if the script containing the function is unscheduled and tries to sleep, but usually that has the opposite effect - the sleep gets skipped.

#

You should check the trigger settings. Triggers can have delays set, meaning the trigger either waits after its conditions are completed, or requires its conditions to be met for a certain amount of time. They can also have their check frequency changed, which can mean a delay in detecting when the conditions are met.

maiden thicket
#

Might it be problem with the time of initializing .bikb. or .oog files or something like that?

maiden thicket
#

the only condition i have on those triggers is usually "player present"

hallow mortar
#

Execution locality shouldn't be a problem as the function is GA/GE

#

If it's different mission-to-mission, then I would look and see if there's anything else going on in that mission

maiden thicket
#

Can modules like civilian presence be of trouble? Like a heavy loading of functions that slows everything else?

#

I do not have any massive files, all .oggs are less than 1,5 MB

hallow mortar
#

Also, you said it works instantly when executed from the console. Is that using Server Exec from the console, or executing it locally on your machine?

#

If it's Server Exec, then I think you should double-check the triggers, because that implies the server is in fact capable of delivering instantly. If it's Local Exec, then that's not giving us any useful information about how the server is handling it - the server could be struggling horribly, but you're just running it on your machine which might be fine.

maiden thicket
#

I tried to do ["TalkActor", "Talk_Task"] call BIS_fnc_kbtell; on dedicated server with:
-server side trigger - on one mission works instantly, in other needs a lot of time to run
-consoles server exec - runs immediately, once
-local exec - this also runs fast, but i hear it twice (local machine and server I guess), since BIS_fnc_kbTell is global, so it propagates

#

Triggres work instantly, some cod that is spawn on server runs waypoints. But for actors to start to speawk I have to wait like a minute or more

hallow mortar
#

The actors aren't simulation disabled, or attached to a building, or something like that?

maiden thicket
#

no, not at all

#

just eferything set to default, no fancy stuff

#

Typical trigger looks like this.
the exact same On Activation works instantly when I run it by console "server Exec"

hallow mortar
#

Well, I don't really know then. This seems very weird. If there's a performance issue it should be crunching other scripts too. If there was a problem with the function or with the sentences config, it would be a problem in all contexts.

#

Verify your game files through Steam I guess, otherwise good luck and hope someone else thinks of something 🤷

maiden thicket
#

Would I be able to check .rpt, would it show anything?

hallow mortar
#

Keep in mind that the RPT can also show a lot of log entries that aren't errors, or are errors but aren't really problems or related to the issue at hand

maiden thicket
#

Yeah, sure, I get it. But I wonder if it would show when the function has run or something like that.

hallow mortar
maiden thicket
#

I also tried to do one thing - first, I called the function by console server exec, and THAN I just walked to the character to run the trigger. And it worked almost instantly

#

like it was already in the memory or something like that

hallow mortar
#

That's odd

#

Are the sound files different between the working/not working missions? If they are, try using one of the working files in the non-working mission, as a test

maiden thicket
#

I will try that, but the sound files were all created the same way. I used Reaper, voice acted them and rendered to .ogg.
I have read somewhere, that kbps setting might be important ad should be constant, which might not be true in all those files, but I am not sure if this would change a thing.

#

Thanks for help.

maiden thicket
#

I have found something like that in .rpt

13:21:56 Sound: Error: rozmowaorganista1.ogg: sSize 0```

What is weird, is that after SOME time, those sounds are being played.
Other thing - I wonder why it is all in small caps. Does it mean much if those files are named with capital letters?
#

one way to find out

stable gazelle
#

hey im trying to make a spawn able arsenal crate i have it were i can spawn the crate but how do i make it a ace arsenal when spawned?

this addAction ["Ace Crate", {
_pos = [(getPosATL MGV_SPWNP_L) # 0, (getPosATL MGV_SPWNP_L) # 1, (getPosATL MGV_SPWNP_L) #2 + 0.5];
_vehicle = createVehicle ["B_CargoNet_01_ammo_F", _pos,[],0,"NONE"];
{ _x addCuratorEditableObjects [[_vehicle], true] } forEach allCurators;
_vehicle setDir (getDir MGV_SPWNP_L);
}];

stable dune
stable gazelle
#

i know that but i was trying to make it were they can spawn them from a menu for logi guys to re arm troops

#

i can get the box to spawn normally but trying to make it spawn as a arsenal is were im having issues

hallow mortar
#

You have the action to create the crate. Just....put the code to make it an arsenal in there. It's not different.

#

You're already using the reference to the crate to change its direction and add it to the curators. Use it again with the arsenal init function.

stable gazelle
#

ok thx

stable gazelle
opal zephyr
#

Hey all, does anyone know if its possible to create a simple object that isnt of type cfgVehicles? Like one of cfgWeapons for example? I need it to be a simple object, not super-simple, so that I can texture it

thin fox
stable gazelle
#

i was able to get a freind to help but i was adding ace to a spawned crate but it works now

maiden thicket
maiden thicket
#

Yes, but it should not be a problem when I run global functin

#

annnd... apparently it is! the lag in fnc_kb_tell is apparentyl happening because of doing this function on the server, doing it client side works fine (as in no lag, it still happens on every machine)
I do not know what to do now.

#

If I would run a trigger that is global (as in not-server-only) but want to execute code only once, on one machine, and NOT on a server (so on a client) would that be ok? I would have to select a specific client, which seems like a VERY bad idea

drowsy geyser
#

If i have a script using createUnit to create a unit should i run this in an if isServer condition and then inside it remoteexec the part i want to run on clients? I think createUnit should be on the server only right?

stable dune
maiden thicket
#

BUT if You would like to addAction - then You would have to do it on every machine.

tulip ridge
restive ocean
#

how can i make it so only certain roles can open an arsenal

hot sapphire
fair drum
restive ocean
# fair drum For ACE, you can either immediately close the arsenal via a cba event, or you ca...

i ended up doing this

private _medicType = "rhsusf_army_ocp_medic";
private _tankType = "rhsusf_army_ocp_grenadier";
private _autoType = "rhsusf_army_ocp_autorifleman";

player addEventHandler ["Killed", { _this spawn onPlayerKilled; }];
player addEventHandler ["Respawn", { _this spawn onPlayerRespawn; }];


if (typeOf player != _medicType) then {
    [medic_arsenal, true] call ace_arsenal_fnc_removeBox;
};

if (typeOf player != _tankType) then {
    [gren_arsenal,true] call ace_arsenal_fnc_removeBox;
};

if (typeOf player != _autoType) then {
    [auto_arsenal,true] call ace_arsenal_fnc_removeBox;
};

probably a cleaner way, but i cant truely be bothered to learn sqf that much

#

it worked in lan, apparently doesnt want to wrok on a dedicated right now though

willow hound
#

According to https://ace3.acemod.org/wiki/functions/arsenal#ace_arsenal_fnc_removebox, the combination of parameters you are using means that the ACE Arsenal is removed globally (i.e. on all machines). I don't think that's what you want; I'm pretty sure that you only want to remove the Arsenal locally (i.e. on the current machine).
Try using [Arsenal, false] call ace_arsenal_fnc_removeBox instead of [Arsenal, true] call ace_arsenal_fnc_removeBox.

pallid palm
#

```sqf
// Copy text on all this and remove all the ( back slashes = \ ) and your code goes here
```

pallid palm
#

onPlayerKilled and the onPlayerRespawn Auto run in the game already don't they

pallid palm
#

i was just wondering why waflfr was doing a addEventHandler on them: but now i see they are diff: for what he's doing

restive ocean
restive ocean
restive ocean
pallid palm
#

cool

long hatch
#

Hi, i was searching the Ace3 Wiki back and forward but i don't find a solution. I want to add a script snippet in my loadout scripts, which enable or disable a Unit as medic. So when a Unit took the Medic Loadout, he will be assigned as medic, but when he choose another Loadout he loose the abilitiy to be a Medic.

warped thicket
#

@agile pumice Intercept is basically a library, you will be able to bind any other language on top of it, or just use c++ directly

azure mural
#

hey guys, getting an error for "Unknown Enum Value" when trying to set a marker type to pretty much anything ("hd_dot" currently) any ideas on what might be going wrong?

stable dune
azure mural
#

Sure! heres the snippet where its currently happening

private _marker = [
            _markerName,
            _pos,
            _markerType,
            [1,1],
            "TEXT:",_markerName,
            (if (_global) then {"PERSIST"} else {})
        ] call CBA_fnc_createMarker;

params on function entrypoint

params ["_coordName",["_markerType","hd_dot"],["_getApproachVector",false],["_global",false]];

i know its being invoked within a CBA function but this problem also occured before I ported it over to CBA, for example here:

private _marker = createMarker ["_approachVector",_approachVector];
        _marker setMarkerType "mil_arrow";
        _marker setMarkerText "Approach Vector";
#

sothe problem lies within how I'm passing the string in... somehow

dark viper
#

the 2nd param is the marker type but you pass in _pos

azure mural
#

oh I figured out the problem, Its calling setMarkerShape on the backend rather than SetMarkerType

azure mural
#

thanks for the input y'all!

modern plank
#

Hi all, small question surely asked already, but fail to find a clear answer in my first search results.
I would like to save the initial weather conditions to reset them via an Ace Menu (to go along with a time reset).
I know that I can store as a mission variable an array of params filled with ambientTemperature, overcast, humidity, wind, rainParams and so on....manually. But is there any all-in-one weather command to save/restore?

sharp grotto
exotic gyro
#

Whether you can set selections on it, I'm not sure

dire star
#

Anyone knows why when i spawn OPFOR (classname is from opfor section) unit like this

loyalists_arty_grp_1 setBehaviour "CARELESS";
loyalists_arty_grp_1 setCombatMode "BLUE";
loyalists_arty_grp_1 setFormation "DIAMOND";
loyalists_arty_grp_1 setSpeedMode "FULL";

loy_arty_u_1 = loyalists_arty_grp_1 createunit ["rhs_vmf_emr_rifleman", [4510.18,5271.05,-3.05176e-05], [], 0, "CAN_COLLIDE"];```
They still spawn as Opfor side and i want it to be blufor side and also setformation dont work?
errant iron
errant jasper
#

That is so annoying. And strangely if you put a OPFOR unit inside a BLUFOR group in the editor it has the side of the group without needing to do that.

opal zephyr
dire star
#

How do i make waitUntil {moveToCompleted _unit}; for two units?
so example i have doMove for two units and i want my script to run after they both completed their doMove

stable dune
dire star
#

Hm, i've tried that i tought it was going like this but whenever they finish their move nothing happens i even put a hint on end of script to see if its gonna work and i didnt see a hint :/

#

like this right? waitUntil {moveToCompleted loy_arty_u_1 && moveToCompleted loy_arty_u_2};

hallow mortar
#

In what context is this code running? waitUntil requires a scheduled context because it needs to suspend.

earnest valve
#

Hey guys, in an emergency at the moment (need to help someone in live chat with script). How can I have a Shift+H combination for the displaySetEventHandler? Thanks!!!

dire star
#

Here's a full script after doMove


how_1 setVehicleLock "LOCKEDPLAYER";

sleep 1;

loyalists_arty_grp_1 addVehicle how_1;

sleep 1;

loy_arty_u_1 assignAsDriver how_1;
loy_arty_u_2 assignAsGunner how_1;

sleep 1;

[loy_arty_u_1, loy_arty_u_2] allowGetIn true;

[loy_arty_u_1, loy_arty_u_2] orderGetIn true;```
hallow mortar
#

And what context is this being executed in? Object init field? Trigger activation field? Init.sqf? Has spawn or execVM been used?

dire star
#

So it's in trigger when players secure arty area two units spawn and move in to get into howitzer so they have support, in trigger i've put server only and execVM

hallow mortar
#

Right, execVM creates a scheduled context so suspending is allowed

#

Basic checks, then: are you sure both those unit variable names are spelled correctly?

dire star
#

yes

#

Do i gotta add any command after doMove or? my units move to pos where i ordered them but when they have to get in they just sit there?

hallow mortar
#

I don't see anything that looks wrong 🤔

earnest valve
#

Anyone?!? (sorry if I am rushing, just very anxious) 😖

dire star
#

Would you mind if i send you the script to see if you find smthn?

indigo snow
#

Find the DIK for H

earnest valve
#

got the DIK for H

indigo snow
#

onKeyDown and onKeyUp will also return the state of shift, ctrl and al

earnest valve
#

and Shift, but how in displaySetEventHandler

indigo snow
#

look at the return of onKeyDown

earnest valve
#

k

stable dune
indigo snow
#

filter onKeyDown for the H DIK and then check the state of shift

earnest valve
#

k

dire star
#

I've used different command waitUntil {(_unit distance _arty < 20)}; and now it works fine

loud shard
#

Helllo, im trying to put** Incon-Undercover ** script to work and I keep getting this error but the side is correct in the UCR_setup,sqf

#

Can someone help? And if someone knows a better undercover script or mod I apreciatte

dark viper
#

What are the code breakpoint step through / into / over commands for Advanced Dev Tools? Or do they not exist and only breakpoints?

old owl
#

Remember being really blown away by that. Iirc it was done that way so enemy units don't target downed players or something.

#

To offer a solution though (assuming that's it) you'd probably wanna use faction instead

loud shard
#

Does anyone know a script that allows you to do undercover ops?

quaint oyster
fair drum
old owl
tender sable
# dire star Here's a full script after doMove ```waitUntil {moveToCompleted loy_arty_u_1 && ...

I know you solved it but, I think the sqf command you were looking for is unitReady. DoMove is a command given to a unit to move and is typically coupled with unitReady to get the command is complete (failure or not). moveToCompleted is typically coupled with moveTo, a lower level movement you call when you are in script control of a command given to a unit such as with doFSM. When using doFSM, moveToCompleted is true after a successful moveTo and when the underlying FSM run by doFSM exits then unitReady is also true. They are fundamentally two different sets of SQF commands. In any case, what you have arrived at works as well.

nocturne iron
#

Getting a GIAS pre-stack size violation when attempting to execute an FSM I have come up with. Are there any obvious no-nos that can cause this?

warm hedge
#

Syntax error like having empty colon or array bracket not matched

dark viper
dark viper
#

ill check

#

surpisingly, there's nothing there about breakpoints or debugging in the documentation

buoyant cairn
#

@warm hedge sorry for the ping, i found a script online that was intended to make the bullets instantly hit things

#

params ["_unit"];
_bullet = createVehicle ["SomeKindOfBullet", (_unit modelToWorldVisual [1,0,1]), [], 0, "NONE"];
_vector = vectorNormalized ((getPosATL _bullet) vectorFromTo (_unit modelToWorldVisual (_unit selectionPosition "head")));
_bullet setVelocity (_vector vectorMultiply 500);

#

also found some forums talking about a CoefGravity and airfrictioncoef

dark viper
#

i would just make the bullet start like a foot in front of the enemy, changing velocity will change the damage

warm hedge
#

Okay, it takes me a few to understand what are you talking about. The question is, I still don't know what are you trying to say, because I don't know what is the question

#

If there is an error message, do tell. If it's not working anyhow not "correctly", do tell. We don't have a magical glass ball to see through your Arma 3

dark viper
#

he wants hitscan bullets in his arma 3

buoyant cairn
#

The objective is to make my player's bullets to hit instantly

dark viper
#

just teleport the bullet in front of the enemy like a foot, and if you want the correct damage falloff that would be realistic you can go a step farther and calculate the correct velocity it would be (instead of the velocity it would be leaving the barrel)

#

you can get the direction the player is looking (center of screen like crosshair and scope when aiming) and then do a built in lineIntersects function

iirc it has a max distane of 1000m though. it will return an array of all the objects hit in order from first to last

warm hedge
#

No, I know the intention. I don't make any question about intention. I am trying to make the situation clear. We don't know what is the context about how the script is running, we don't know what exactly is the script, we don't know what is the error message, we don't know how it is not behaving intentionally

buoyant cairn
warm hedge
#
  • Is fn_init.sqf is actually running?
  • What is the code?
buoyant cairn
#

Yup the init is working, and the only code running along with it is the one i sent up there

warm hedge
#
params ["_unit"];
_bullet = createVehicle ["SomeKindOfBullet", (_unit modelToWorldVisual [1,0,1]), [], 0, "NONE"];
_vector = vectorNormalized ((getPosATL _bullet) vectorFromTo (_unit modelToWorldVisual (_unit selectionPosition "head")));
_bullet setVelocity (_vector vectorMultiply 500);```Is this really the entire code that seems to be relevant, do I understand correctly?
buoyant cairn
#

From what i found online, it's just this bit of code

warm hedge
#

Is that a yes or no?

buoyant cairn
#

yes

warm hedge
#
  1. SomeKindOfBullet does not seem to be a proper ammo class to be spawned
  2. _unit is very likely undefined
  3. The code only runs once if I understand correctly, not everytime you fire a weapon
  4. These above three will not throw an error because there is no syntax error
  5. And it basically does nothing due to there are a lot of undefined thing
#

Where do we begin to explain

buoyant cairn
#

from the start i guess

warm hedge
#
private _bomb = createVehicle ["Bo_GBU12_LGB",getPosWorld player,[],0,"CAN_COLLIDE"];```
This will spawn a bomb on a player unit and you will die. But you will know it is working. Try it
buoyant cairn
#

kay, one sec

#

nothing

warm hedge
#

How did you try it?

buoyant cairn
#

gonna make a single mod for it, just a sec

warm hedge
#

Why?

#

You don't need a Mod. You are really not supposed to make a Mod just for a few lines of code you are actively modifying

dark viper
#

execute it in the debug console

buoyant cairn
#

even running it on the console it has no effect

dark viper
#

if ur playing a mission not in editor

buoyant cairn
#

it worked, just launched the bomb far away from me

warm hedge
#

Are you saying it doesn't work, or it does work but you didn't die?

buoyant cairn
#

it's working now, i messed up when i pasted the code on my console

warm hedge
#
_bullet = createVehicle ["SomeKindOfBullet", (_unit modelToWorldVisual [1,0,1]), [], 0, "NONE"];```
1. `SomeKindOfBullet` was a placeholder, and you were supposed to change to an existed class (aka an asset that is available on Arma 3)
2. Due to `_unit` is undefined, it will spawn it in `[0,0,0]`
3. But due to the first point, it will not spawn at all
```sqf
private _bomb = createVehicle ["Bo_GBU12_LGB",getPosWorld player,[],0,"CAN_COLLIDE"];```
1. `Bo_GBU_12_LGB` is an existed class, so it can spawn
2. `player` is a command to get a player unit, and `getPosWorld` to *convert* it to a position
3. So it can spawn, and eventually fall to the ground

First point is here
dire star
buoyant cairn
warm hedge
#

You understand it right

dark viper
mortal folio
#

just observing this conversation actually reminded me of something i've been wanting every few ops but never had the chance to truly attempt it - is it actually possible to spawn projectiles (bullets, not bombs)? I recall the apex dlc campaign had a scripted sequence but that was an RPG hitting a boat and missiles/bombs are included in cfgvehicles if im not mistaken; otherwise having to spawn an AI, make him fire, and redirect the ammo feels clunky

warm hedge
#

Second point
_unit in your code is undefined. Very likely.
Due to:

  1. params command was supposed to define it
  2. But due to lack of the context in the running code, it will not pass any variable to the identifier (_unit in this context)
dark viper
mortal folio
warm hedge
#

createVehicle

mortal folio
#

... oh

#

i thought createVehicle only reads cfgvehicles for classes?

warm hedge
#

No

#

It can read CfgVehicles CfgAmmo CfgNonAIVehicles and a bit more

mortal folio
#

learn something new every day, alright!

#

cheers

buoyant cairn
#

So params must define those bits, before the code can do something to begin with

pallid palm
#

Halo Mod you don't need a Mod to have Halo Jump

dark viper
#

what's a halo jump? parachute from high altitude?

warm hedge
#

Correct

mortal folio
#

high-altitude-low-opening to be exact

#

i.e you might splat and die if it's dark and dont have an altimeter - happened one too many times in my unit

pallid palm
#

lol

#

my chut opends Auto

#

at 75m

warm hedge
queen cargo
#

@warped thicket using C++ libraries with C# requires you still to do c++
thus unless Intercept is not yet created with CLR in mind, you will have to do it yourself:
https://msdn.microsoft.com/en-us/library/ms235281(VS.80).aspx

at least if i did understood that part correct ... feel free to proove me wrong on this topic :)
not like i would be much into c++ c# interop

warped thicket
#

no, all I was saying is that it's designed so users can create bindings for other languages (or however that's called)

#

which means people can do it and other people will then be able to use intercept in that language, it's basically another abstraction layer on top of intercept, but compared to SQF-RVEngine parsing speed it would still be a lot faster

#

which is the whole point of intercept after-all

exotic gyro
analog mulch
#

Hi
Is there a way to disable ground vics from targeting air assets?
Like tanks not being able to target planes

fair drum
analog mulch
delicate tangle
#

Pretty sure there is an eventhandler that fires when a sector is captured. Anyone know what it is?

errant iron
analog mulch
#

ty

delicate tangle
hallow mortar
#

There is no global "some sector was captured" EH, at least no documented one. There is only that sector-specific one. Your only option is to add that scripted EH to every sector.

delicate tangle
#

How can I do that? Basically I want to move spawn Ai modules to friendly sectors. I need something to tie into to determine when a sector has been captured so I can then run the “move spawn module” function.

delicate tangle
#

Yes

thin fox
#

there is an expression field on it blobcloseenjoy

delicate tangle
#

Yah but i dont wanna use that

thin fox
#

why?

delicate tangle
#

Would require me to pass input on every sector

thin fox
#

make a file for your script, and call it from there, ez

delicate tangle
#

Would have to pass the spawn ai modules as input though

thin fox
#

🤷

delicate tangle
#

How can I save an original “starting postion” on an object via setvariabel?

delicate tangle
#

No

#

Need a location (original starting position) to use as a reference point for sorting things by distance

thin fox
#

like this you mean?
_object setVariable ["TAG_myObjPos", getPosATL _object];

#

or use some namespace

delicate tangle
#

I guess. Im not very scripty

thin fox
#

and then you use getVariable to get the position again

#

but always respecting the varspace so you get the right variable

#

I think in your case you can use missionNameSpace or just a global variable (don't forget to put your TAG on it TAG_myVariable)

ornate whale
# analog mulch Hi Is there a way to disable ground vics from targeting air assets? Like tanks n...

You may also use the ignoreTarget command. It prevents a group from attacking a specific unit. So if you manage to make a set of all ground AA units and all air units, you can do a forEach loop to disable the combat interaction between them permanently with a single command.

Example:

airUnits = [...];
groundUnits = [...];

{
  private _groundUnitGroup = group _x;
  airUnits apply {_groundUnitGroup ignoreTarget _x};
}
forEach groundUnits;

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

analog mulch
#

My unit facing an issue where WW2 tanks are shooting down our IL-2s

#

So in the square brackets I put in the class names of the air and ground vics to be used?

ornate whale
#

There may be an issue in MP if the ignored target respawns. You may then need to call the command again.

azure mural
#

does anyone know if the task framework accounts for JIP players? like if you create and assign a task to a side will it also be inherited by them?

granite sky
#

Yes, it works.

azure mural
#

excellent thanks!

granite sky
#

Just make sure your task IDs are unique because that can cause some broken shit.

azure mural
errant jasper
#

Just don't sync the Task editor modules with JIP player objects.

dark viper
#

how to place or do anything with compositions via script?

last cave
#

How can I find out which queue a created JIP is running in?
I have a function that creates other functions for the player.
If I execute servariable["fnc1",_code,true];
And then call remoteexec["fnc1",-2,true];
Will the player first receive the function from servariable and then execute the function code from remoteexec?
The situation is this.
I had this question because during a mission, I configured the player to receive functions as an array and then create them for themselves from initplayerlocal. But because of this, if I sent remoteexec to the JIP version from the server, the player didn't have this function when the remoteexec was executed. Because of this, the JIP could never execute with the assigned function.

modern plank
#

You should not care about this JIP queue content.

#

I mean, make a condition at the top of your function based on a shared variable, like a missionNamespace setVariable ["TAG_DO_THIS", _default, true]; and use this into your func implementation to exit if you don't need to proceed. Because yes, the broadcast of the variable is quite immediate even for JIP.

#

This way, your "late JIP but you don't know when exactly" execution will depend on a state variable that you update during your mission. This way, you don't care if the func execution is planned into the JIP queue or not.

delicate tangle
#

Can you use the teamswitch eventhandler to switch artillery support module (and other modules) from the “old” unit to the “new” unit…? I feel like you should be able to but a part of me thinks I looked this up in the past and it was a no-go…?

modern plank
#

initplayerlocal.sqf => executed once. Call the same init into onPlayerRespawn.sqf too if you want the same thing whenever the player respawns.

last cave
# modern plank You should not care about this JIP queue content.

I need to know explicitly whether the player will have this function when calling remotexec from the server.
My server creates NPC agents that need addactions. After creating the NPCs, I set each one to remoteexec ["fnc_arsenal",0,true];
But when I enter a mission, the "fnc_Actions_arsenal" function doesn't exist when the JIP is executed. And after 1-2 seconds, it appears because the player created these functions from a variable I previously created in the JIP via setvariable. As a result, remoteexec ends up in the execution queue before the player executes the "initplayerlocal.sqf" code.
Therefore, I'm thinking of using a function call that will be executed immediately upon player entry and creating functions received from the server. In short, I'm not sure what to ask someone who doesn't only deal with ServerSide functions. I'm starting to get confused about the best way to explain my situation.

#
//Only server addon (mod) Fucntion with postInit=1;
_cl="getnumber (_x >> 'clientfunction') == 1" configClasses (configfile >>"CfgFunctions");
_func=[];
{

    _tag = getText (_x >> "tag");
    if (_tag == "") then {_tag = configName _x};
    
    _tag = toUpperANSI _tag;
{
    {
    _func pushBack (_tag+"_fnc_" + configname _x)
    }foreach ("true" configClasses _x);
}forEach ("true" configClasses _x);
}forEach _cl;
_hashmap = createHashMapFromArray (_func apply {[_x,missionnamespace getvariable _x]});

missionNamespace setVariable ["CFGFUNCTIONSLOADED",_hashmap,true];
true;
//Only client in mission files Called in initplayerlocal.sqf

_hashmap=(missionNamespace getVariable ["CFGFUNCTIONSLOADED",createHashMap]);
{
    _name = _x;
    _function = _y;
    missionnamespace setvariable [_name,_function];
}forEach _hashmap; 
#

This approach works well, but not when there is a JIP with functions that are sent this way...

modern plank
#

"fnc_Actions_arsenal" function doesn't exist << why not just defining a function for everybody?

#

Just put

     // whatever
};```

inside *init.sqf*,  or inside another file inserted by init.sqf, and all your clients will know then function my_function and call it;
errant iron
# last cave How can I find out which queue a created JIP is running in? I have a function th...

from what i can tell, these are the relevant docs:
https://community.bistudio.com/wiki/Multiplayer_Scripting#PublicVariable_commands

A JIP player will synchronise server's publicVariable'd variables before executing init.sqf. See Initialisation Order for more information.
https://community.bistudio.com/wiki/Initialisation_Order
Order of Initialisation (From First to Last)

  1. Persistent functions are called
  2. ...
  3. initPlayerLocal.sqf is executed

based on those, the order should be:

  1. Players receive public variables first
  2. JIP'd remoteExec functions are called afterwards
  3. init*.sqf scripts are called last

since your functions aren't broadcasted under their names directly, but instead assigned by initPlayerLocal.sqf later in the initialization order, the functions won't be ready by the time your client starts executing the JIP queue

#

i'd probably recommend the same suggestion from a while ago, which is to broadcast a single function and call it in JIP queue to initialize the rest of your functions, but that may not be sufficient here since you need those functions in other JIP calls, and i don't think the order of JIP execution is guaranteed

modern plank
#

What you should do:

define + execute functions into init.sqf (and onPlayerRespawn.sqf if needed)

#

and skip the execution based on synchronized variables. This is it.

#

the simplest thing to do. But synchronizing functions definitions instead of just defining it into either a library of init.sqf is crasy.

errant iron
#

if it's meant to be a server-side mod though, not having anything in init*.sqf would be preferable

last cave
#

Considering that I have more than 139 functions created locally for the player, should I broadcast each one through a public variable?
Or is it better to create an installation function in which the creation of each function would be written in one continuous code? (reference Advanced_Sling_Loading)

modern plank
#

NO. Broadcasting means network consumption for NO REASON.

#

Look... I have a full mission toolkit...

tulip ridge
#

Just define them through CfgFunctions

modern plank
#

Tons of features, depending on missions Parameters, JIP, server-only, and so on

#

all are defined statically into the PBO

#

no need to share them on the network for nothing, since everybody have them in the PBO.

#

All clients + server has the function definition

#

Then, I drive the "shoudl I execute this?" by a mix of enabled features thanks to mission Parameters, synchronized varaiables, and so on...

last cave
#

What carried you all away from my thoughts...

modern plank
#

And I have hundreds of functions....

#

but network optimized.

last cave
#

Remoteexec only executes the functions defined by the player... If they aren't sent to it, how does it know what to execute? I'm only telling it which variable to call with its arguments. What's the network issue?

modern plank
#

wrong

#

RemoteExec executes whatever function that exists.

#

No need to send 'a function definition'.

#

just define it.

errant iron
#

what they're questioning is whether you need it to be a server-side mod vs. built into the mission file or as a required mod, since writing for the latter, CfgFunctions or similar, does reduce network traffic for each player that connects (assuming mission file was cached once)

last cave
#

I need to ensure that when a player joins a mission, they receive definitions of the function variables stored on the server. This can be done either by making publicvariable "var" or missionnamespace servariable ["var,_code,true];
By the way, I have a way to determine which functions should be on the server using a class config parameter. The code is above.
The main thing I need is for these functions to be DEFINITELY AVAILABLE TO THE PLAYER WHEN THE SERVER MAKES JIP FUNCTION CALLS.

modern plank
#

if I put inside my init.sqf the function :

my_func = {
 hint "Hello guys"!
};

every computer (server+all clients) who loads the mission PBO will know this my_func.
Then, if one player computer (or the server) executes this:

 remoteExecCall ["my_func", 0, true];  // execute on all players including the server
 remoteExecCall ["my_func", -2, true];  // execute on all players but the server
 remoteExecCall ["my_func", 2, true];  // execute on the server only

it will just work. Well, for a 'hint', it has no effect on a server, should be done on players side.

#

Even JIP will have the hint display.

errant iron
#

are you trying to reuse your code across multiple missions? do you want to protect your code?

modern plank
#

, broadcasting all functions individually would ensure they're defined before JIP executio << it is total non-sens

modern plank
#

they load the PBO first, so put the func definition inside the PBO 🤷‍♂️

#

No need to share a funtion definition. Just trigger the execution via the network.

#

even if it is possible, it looks weird and not optimized.

tender fossil
#

Why not use CfgFunctions/Functions Library like suggested above?

modern plank
#

You can also. If you want to ensure that your fuctions definitions will be loaded first (and before you call them), just load them as lib into the description.ext.

#

but again, nothing related with sharing the function definition on the network, will be loaded with the PBO.

#

I have a bunch of core functions stored into several lib, I do this:

#

This way, I am ensuring that all functions defined into these files are known right from the beginning.

#

then, I don't care if I am using them inside playerinit or init or whatever, no need to take care of who is first: function def or exec

tulip ridge
#

Yeah CfgFunctions also does that

last cave
#

cfgFunctions on server (screenshot 1)
and
cfgFunctions on client (screenshot 2)
How look on game with dedicated server

If I need to send a function from a server addon to a player, I write such a parameter in the class (screenshot 3)
clientfunction = 1;

Now I need to send these functions to the player in JIP mode when the server starts.
this code
#arma3_scripting message

!!!
I need these collected functions to be defined for the player before any other JIP is executed.
So, should I use Setvariable or publicvariable, or create a function that will define functions from this array (or hashmap) in one continuous piece of code?

modern plank
#

If I need to send a function from a server addon to a player, I write such a parameter in the class (screenshot 3)
clientfunction = 1; << you never need this

#

You don't "send definition"

#

You trigger their execution.

#

And you protect the function execution.

last cave
#

The player should never know what functions exist on their client, as this is determined by the server addon, which sends ready-made functions from cfgfuctions.

This way, our code will never fall into the hands of a client without access to the allvariable missionnamespace with subsequent processing by getvariable. (hack admin console)

modern plank
#

Example: I have a function that exists everywhere (so define into init.sqf or as a CfgFunction lib if needed), here is my function implem:

do_stuff_on_server_and_cli = {

 if (hasInterface) then {
   hint 'Server is processing it';
   // do other stuff that has to be local to cli computer
 };

  if (isServer) then {
    // do the stuff with global functions
  };
};

This way it is 100% safe to execute it EVERYWHERE, with remoteExecCall ["do_stuff_on_server_and_cli ", 0, true_or_false_if_JIP];

modern plank
last cave
#

A player's files shouldn't contain anything other than configs. And you're suggesting I give them my code, with all the data hidden from the user, in mission files.. Cybersecurity is crying out for you.

modern plank
#

ahahahah

#

Guy, you want to execute something by someone else, and it is interpreted script, so ya, you have no choice: send it and let them execute, or do not share and thay wont, as simple as that. SQF script is not compiled stuff.

#

got it now, I was wondering why you were stuck about just defining your script function properly.

last cave
#

All that was useful was just this.
#arma3_scripting message
The rest of the discussion is just empty talk and not related to my case.

tulip ridge
exotic gyro
pallid palm
#

some great info imho

tulip ridge
#

It's not, don't try and do this stupidity

exotic gyro
#

jinx dart owes me a coke

tulip ridge
exotic gyro
#

There also uh, isn't really a reason to obfuscate scripts from clients ever

#

Unless you're stealing them and want to hide it, I guess?

tulip ridge
# last cave Already ...

I'm basing that off of "with all the data hidden from the user, in mission files" from your message

If that's incorrect, then the message didn't really make that clear

exotic gyro
#

Clients can't execute code in normal circumstances and if they can, you have bigger problems than them knowing what scripts you have

modern plank
#

And broadcasting whatever as variable to all your players (=means putting something inside allVariables missionNamespace on all cli) is neither security nor obfuscation indeed.

next gust
#

security by obscurity is a great concept

exotic gyro
last cave
#

I understand that I can’t find the right words to make it clear what, why, and for what purpose...

pallid palm
#

imho Dart knows: believe me: he's Awsome: He helped me with my Chopper Command Scripts: and it all works prefect

exotic gyro
#

Dart is a good boy

pallid palm
#

yes the best: he's a real pro imho

exotic gyro
#

he's very silly and only occasionally asks me for silly code

modern plank
#

What I enjoyed the most was his "Cybersecurity is crying out for you" and this guy want to broadcast functions to all the cli 🤣

pallid palm
#

but there's lots of real pro's in here

exotic gyro
#

that reminds me I should release my mod that has been done for a year and hasn't been released

pallid palm
#

and i should put my missions on the workshop: but well you know

tender fossil
pallid palm
#

lol "dumb" clients lol hahaha

modern plank
#

Looks like he wants to sell/keep private some functions. But put them server-side, and these functions will play with basic remoteExec on the cli, this is it.

formal grail
modern plank
#

true. But I never had this "code obfuscation" need so....

last cave
#

cfgFunction in mission files.
class CfgFunctions {

#if __has_include("..\Addons\AddonFunctions.hpp") //for EDEN edit
#include "..\Addons\AddonFunctions.hpp" //During the build in PBO this addons file is missing because it is loaded via servermod="@MyAddon"
#endif

#include "..\LocalAddons\FNC_Client.hpp"

};
Screenshot 1 pbo file in dedicated server.
ScreenShot 2 servermod

We've been playing like this for more than half a year now.
But when I needed to execute a function in JIP, it didn't exist... So, I'm thinking about how best to convey them to players. Ultimately, I'll just create functions either via publicvariable or servariable when the mission starts.

pallid palm
#

i wish i knew how to make a func library: can some one show a Actual func library setup

modern plank
hushed turtle
#

It's on wiki

pallid palm
#

oh cool

hushed turtle
#

@pallid palm

pallid palm
#

thx m8 Awsome @hushed turtle

#

wow thats Awsome

exotic gyro
#

Literally the only reason to ever obscure stuff like that is because you have shit to hide lmao

#

Doesn't help performance, doesn't help "security"

modern plank
#

When your code base becomes big enough, you need to get some "core functions" available everywhere (whatever the *init.sqf and so on), so you define them as lib with preinit=1 to get them loaded right from the beginning: no need to put everything, would be overkill, but very usefull.

last cave
#

My approach allows for quick editing of client functions in the editor, and often the player doesn't need to download new mission files because it only requires changing the server mod file. I even save mission file size. If I need to fix a bug discovered on a dedicated server, I quickly launch the editor and change the code. I use addonbuilder. I send the new PBO mod file to the server, and that's it. Then I restart the server. Players instantly enter the mission and don't even notice there was a server update.

formal grail
last cave
#

If my mission weighed 20 MB, then in order to change one line of the file, players would not have to download those 20 MB again.

pallid palm
#

wow the server is way down on the list 🙂

exotic gyro
#

omg tragedy players need to download 20mb

#

how will their bandwidth ever recover

last cave
modern plank
#

I even save mission file size. << ya, to then stress your server bandwith sharing 15MB to all cli in-game instead of DLing them at the beginning while not playing.
This is what we call unoptimized networking.

last cave
modern plank
#

If you have 15MB of functions (a lot but why not.)

#

DL them while not playing, before the game starts (from cli POV at least).

#

Do not have the server send 15MB x the number of cli in-game. For obvious reasons.

last cave
#

What's the problem with the fact that when a player connects to a server, it receives a single, large chunk of code, which is then processed to handle the player's user functions? Even if it's not just one chunk of code, but multiple variables that the player receives from the server upon connecting?

formal grail
#

Security wise you should know that this approach has one major defect in that your global functions are not automatically final and script kiddies may be able to override them after receiving them.

last cave
#

The bots that are walking around your mission in JIP use much more traffic than what I send to the player once.

formal grail
#

You can overcome that by manually implementing what the function library does and compile final them.

modern plank
#

In MP, try to avoid network traffic as much as possible if you wabnt it to scale.

last cave
#

My server mod is 2.3 MB (server and client functions). Only part of it is sent to the player in the form of variables with the code. What's the problem with getting the player 1 MB of code at the start of the mission?

modern plank
#

The game (and the server) is very loaded by tons of events, so the less the better.

#

Well you can, but brings nothing than just sharing it the DLed PBO.

formal grail
#

You have 1 MB of code transferred this way???

modern plank
#

I mean the value is... almost nil.

last cave
formal grail
#

You will also not be able to take advantage of some recent enhancements like being able to offload mission file download to another server.

formal grail
last cave
#

I just don't remember where the game function is stored... I'd have to make a compilation error to get the file path. I'm not too lazy to do that, so I'll just forget about it.

formal grail
#

For your unique JIP problem, you should queue the commands yourself until the scripts are fully present. I think setVariable and publicVariable are executed before but if the variables are large, I don’t know if the JIP step will wait until they are fully received? Not completely sure, will need to test. My impression is the reliable way is some mechanism to ensure your “scripts” are all there before you allow JIP to execute them. For that you need a custom JIP queue.

pallid palm
last cave
#

I tested it. It seems to work as expected. On a dedicated server, in the editor. Everything works fine.

_cl="getnumber (_x >> 'clientfunction') == 1" configClasses (configfile >>"CfgFunctions");
_func=[];
{

    _tag = getText (_x >> "tag");
    if (_tag == "") then {_tag = configName _x};
    
    _tag = toUpperANSI _tag;
{
    {
    _func pushBack (_tag+"_fnc_" + configname _x)
    }foreach ("true" configClasses _x);
}forEach ("true" configClasses _x);
}forEach _cl;
_hashmap = createHashMapFromArray (_func apply {[_x,missionnamespace getvariable _x]});




CFGFUNCTIONS_Install = {
    params ["_hashmap"];
    //_hashmap=(missionNamespace getVariable ["CFGFUNCTIONSLOADED",createHashMap]);
    {
        _name = _x;
        _function = _y; // Or  _function = compilefinal _y; For non overwrite func
        missionnamespace setvariable [_name,_function];
    }forEach _hashmap; //Create Functions
    diag_log FormatText ["Functions Installed %1",count _hashmap];
};
publicvariable "CFGFUNCTIONS_Install";
[_hashmap] remoteExecCall ["CFGFUNCTIONS_Install", -2,true];

missionNamespace setVariable ["CFGFUNCTIONSLOADED",_hashmap,true];

CFGFUNCTIONSLOADED need for my custom loadins screen
logs ->
18:35:23 "Advanced Sling Loading Loading..."
18:35:23 "Advanced Sling Loading Loaded"
18:35:25 Functions Installed 140

Loading into the mission took less than 5 seconds.

#

During the mission, I created an NPC through the server.

When executing the code, the JIP created a call to the client function

[[_NPC]] remoteexeccall ["CARSENAL_fnc_Actions",0,true];

I reconnect into the server. The actions were still available. With my previous code, there were no actions on NPCs.

tulip ridge
#

Prefix your global variables and custom config properties

delicate tangle
#

For scripted eventhandlers, can you provide arguments/input in addition to the arguments that are passed by default?

formal grail
tulip ridge
#

That has nothing to do with that

formal grail
sharp grotto
#

Dangerous if you have cheaters, they can just overwrite a function if you don't use compileFinal / compilescript.

formal grail
#

^ They've apparently considered that already.

buoyant hound
#

Hey , how i can setup lowrange or longrange frequence via trigger in mp mission ?

last cave
sharp grotto
#

iam blind, sorry xD
i can somehow blend out comments since i never used them 😆

last cave
#
code = {adfg=124};
code1 = compilefinal code;
code1 = {afg};
code1

😄

#

Actually, you reminded me to make this comment.

errant jasper
#

I mean if there is given script access "cheaters-only" are the least of my concerns.

dry lava
#

is there anyway i can change the amount of zombies in spawn insiyed of 256

tulip ridge
#

No one knows what zombie thing you're using

granite sky
last cave
#

Sometimes I stop believing him. I won't believe it until I check it with my own hands. hmmyes

errant jasper
#

The real question is why we keep calling it the JIP queue when it is not.

#

Not that it would even matter since folks remoteExec functions with JIP flag thus not preventing races anyway.

blissful current
#

I've found the source of my issue! My AI helicopter transport hitches and bobs back and forth during transport. Except on the localhost and in SP, where it's smooth as butter.

This gave me the idea to use setGroupOwner and take it away from the server and give it to a client. Doing this eliminated the hitching/bobbing of the helicopter. It's as smooth as SP!

But there's a caveat. It's only smooth for the client that I gave the group ownership to. So all the other clients still have it. Effectively, I've just migrated the issue.

I'm guessing you can't give ownership to more than one client/server at a time, so I'm not sure what to try next. I know it's possible for heli to fly smoothly for everyone because if I fly with humans as the pilots, it's smooth for all clients in that situation.

Any ideas?

fair drum
#

There is no fix. It's part of the jank that makes arma arma.