#arma3_scripting
1 messages · Page 211 of 1
Good catch, cheers. And bugger, lmao
looking to bring liberation_RX arsenal we have saved over to a training mission is there a way to do this for noobs
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.
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?
you, and others above -please reply to your former questions with follow-up questions, and/or use quotes; that makes it easier to follow "threads" and intent of people asking 😉
aka a lil' StRuCtUrE please 🙂
We don't know how it is supposed to behave and how is your result, please do tell
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!
- 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
* the relevant config setting is zeusCompositionScriptLevel https://community.bistudio.com/wiki/Arma_3:_Server_Config_File
Yup my bad. It keeps me in the back of original aircraft
What is "original aircraft"?
will check this on the server as well
very much appreciated
heli_1
thanks, im pretty sure this was the issue
really saved me a headache, not sure why i didn't check that to start
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
Nor how is heli_1 involved on the situation
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. 🤷🏼♂️
maybe you just need to moveOut player before using that command
Helps if I knew how to read. Thanks for the suggestions guys, I appreciate it.
👍
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
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
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;
What that code is doing there is creating a code block (and not running it), and then delaying for 5 + random 10 seconds for each item in the list
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
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;
It'll stop, the code in the forEach runs once for each item in the _decoyArry
gotcha; ok I thoughts how it worked but wasnt sure
Also that will immediately destroy the first vehicle, and then have a delay for the 2nd and 3rd
Not sure if you want that
I would assume thats a easy fix of flipping the two codes around
Yep
also not to ignore this; just wanted to say will that still work with ACE enabled? because I've always set my stuff to 100 if that mod is enabled
Yes
10-4 thank you sir!
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
wiki is blocked link on this server XD
This is proving to be quite the headache I couldn't even get the Conversations to play any audio (followed entirely the example on the wiki)
I was able to get audio playing with BIS_fnc_kbTell but it's limited to CfgSentences config which is just all the voicelines in the game's singleplayer missions. Still interested in being able to script RadioProtocol audio at will
PAA, TGA, JPG are supported. OGV is also if you count it
BIKI is not blocked. Masked link is
that's fair
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.
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
What is editorPrewiev? Is that images when you connect to server?
It's what is displayed when hovering over an object in Eden/Zeus
k, thanx
I don't think a ruin is an entity
I could be wrong though, have you tried to return it using https://community.bistudio.com/wiki/nearEntities?
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
drawIcon3D if that's what you mean
Will the handler override the standard r keys?
Are you trying to get the ruins of a building that has been damaged or these kind of ruins http://images.akamai.steamusercontent.com/ugc/3332967995118551917/8F0319A6E3ECDC8DF254384A95B732F0F1816038/
It is a command, not a EventHandler, R also don't do such anything in vanilla
I spelled it wrong, I meant J
J does not also
Maybe try "Ruins_F"?
1.6k hours and had no idea that Arma has floating icons
3k hours and I'm still finding new hotkeys...
I realized after 7k+ hours, you can change zero with CTRL + mouse-wheel 😂
Can you get any buildings from entities? I don't think so
@native hemlock. You can't because entities are living things in the game. Try nearestBuilding, nearestObject or nearestObjects.
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.
Well, that's why I said "don't do such"
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.
The point is, it is not a vanilla feature
How to get classes from config of units who share same parent class?
or wait for 1.55
https://community.bistudio.com/wiki/cursorObject
isKindOf can help too
Anybody know how i can edit the default bases of the Invade & Annex by quicksiulver?
Can you call a function with spawn without any input parameters? For instance: spawn Tag_fnc_functionname
depends if the functions allows for it
What does that mean? The function doesnt require input parameters
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
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.
[] spawn Tag_fnc_functionname
It's better to use 0 because creating an array, even an empty one, is slightly more expensive than referencing a fixed number.
Sounds good, thanks
so we should do like this ```sqf
0 spawn Tag_fnc_functionname
it should be 0 spawn ...
Why would I say that creating an array with 0 inside it is better than...creating an array?
oh ok
i see: oh i did not say it was better: my friend: i was just trying to learn more
when you put [] you are creating array.
yes but dont the [] just mean this in this case
no [] means empty array. [0] this is array with element 0 at index 0
Also curious re: this as well
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
Just try to solve problems or create features via scripts….thats how I learned
call doesn't require a left argument. If you don't provide one, it will use whatever _this is in the parent scope as its own _this.
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.
_myVar = 5;
call {
_myVar = 6;
};
systemChat format ["%1",_myVar];
Like this.
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
Ah @tough abyss . Then nearestObject.
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 🙂
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.
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;
};
You mean for a separate client in MP, or localhost?
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).
When does the trigger activate?
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?
It's possible. I don't think there's any documented interaction between hide & animation.
I think it's quite likely that the Hide/Show module also disables simulation on the objects it hides
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.
hmm. My recollection is that it doesn't. But I only read it once.
Also I forgot how to find that code :P
If not simulation it definitely helps with performance. Now I need to figure out why flyInHeight works in SP but not local host/client.
There are an awful lot of cases where flyInHeight sucks regardless of locality.
but it does require a local argument.
module -> find in config viewer -> function -> function viewer -> find that function
BIS_fnc_moduleShowHide
It does disable simulation
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.
I've always wondered how to look that stuff up. Thanks, I'll definitely use that process in the future.
I wish there was a way to pin/favorite discord messages for future reference.
If a global variable is set to true within a CBA keybind scope, will the variable be useable in other functions?
global variable = global to everyone 🙂 ?
What useable, what other functions
Thats what i thought but the function thats called by the keybinds doesnt pickup the variable
Global scope variables are available to all scripts on the same machine. That's what makes them global.
What pickup
Could it be a timing issue? The variable is being set after the function is running?
If pickup mean the variable is useable in a function, almost always yes, because Global Variable is useable anywhere within a mission
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];
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.
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.
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
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
If someone doesn't answer you, I'll have to get to this tomorrow after work. Midnight here.
would greatly appreciate it
I'm figuring I'm gonna need to make my CfgRadioProtocol and maybe CfgVoice too and string together all the audio files in to my own CfgSentences too
but it would be really cool if I could just invoke the game's already existing Protocol easily by script
I would try it myself but I can't even get audio to play at all for some reason so I'm unmotivated atm
Is someone free to give me some insight to make a script for a instant hit bullet?
right off the top of my head that's easy just do a raycast collision and check if it intercepts units with lineIntersectsObjects
nice, i'll do some searching and try it, thanks dude
Note that, "instant hit" can be achieveable by having exteme bullet velocity, but will affect the damage value
for playsound you need to define the sound, description.ext
class CfgSounds
{
sounds[] = {};
class custom_alarm_1
{
sound[] = {"@A3\Sounds_F\sfx\alarm_independent.wss", 1, 1, 20};
titles[] = {};
};
};
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
the only thing different about mine is that I didn't have sounds[] = {}; in CfgSounds so I prob just have the wrong path of the sound (pretty sure I don't though so I don't know why it didn't work)
i tried that using a ct script i found, but indeed it affects the damage, so it's not exactly what i want to mess with
I'd pick lineIntersectsSurfaces, setPos, setVelocity to try it
Okay, i'll try it[
You can try with playSound3D ["A3\Sounds_F\sfx\blip1.wss", player]; and see, if it can find it at all xD
You have made some mistake, don't see why playSound wouldn't work for you. Or some weird bug with the sound files maybe? Wrong codec, bitrate whatever (can't imagine tho).
i just tried this and no audio happened
do it really work for u ?
oh it works nvm
don't know how to get the correct path for stuff from the pbo
addonFiles is a command for it
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
how would you use this command?
To find filepath?
yeah to find what specifically you want
it's funny cause at the top it says all the radioprotocol was removed from the page so XD
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
sound[] or sounds[] in this context it doesn't do anything with it. At all, it's a legacy something
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"};
sound[] within the sound class is required
Yes
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[] = {};
};
};
....and that's what they're talking about
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
Expansion: the pitch and volume properties within sound[] are not listed as optional, and are present in this working example. Same as the titles[] attribute
- CrgSounds is not related with playSound3D but playSound
- playSounds3D is not a command
I think playSounds3D is just a typo in the Discord message, since they said that version works
yeah it's a typo
More info here: https://community.bistudio.com/wiki/Description.ext#CfgSounds
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
Well, the parameters that are optional are described as optional. These are not.
Gotcha, I think I got it confused with speech[] in other Cfg
Alright for now my confusion is settled thanks for your help everyone
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).
This does bring me back to my original post im replying to, which is how does the game script together its words to make sentence audio
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)
this is an intended feature
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
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...
very low terrain quality right?
doesn't matter - its just distance
low terrain quality might make it happen at closer range
it does, i noticed it earlier when i was testing as well
also re: this, why not use https://community.bistudio.com/wiki/groupRadio
etc instead?
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
I want to use invoke the RadioProtocol the same way the engine does. What you are suggesting would be fine if all I wanted was to play custom sounds over a radio.
no that's literally what it does - it lets you use the radio protocol
Terrain 2
Oh does it?
wow didn't see this before
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
I'd love to be able to do this
strange that it's happening when using the visual command, does it still happen when you use simulation scope instead ?
The advanced forms of the Conversations section and the way the Radio Protocol configs are makes me think it is possible
ie. modelToWorldWorld
yeah it might be I just never tried it myself, I've just done it for single words etc
modelToWorldWorld - simulation scope ?
oh i see..
even if it does work it's probably not good as it'll lag behind a bit
modelToWorldWorld Same...
_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...
Bruhhhhh
AI smart... NO see me in road open space
It turns out that the vanilla IR laser has the same problem... lol
this is the laser from them right?
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'
drawLaser [_p1La, _v2La, _color, _color, 0.15, 0.15, -1, false];
this is cause the AI is not aiming from where their model appears to be cause of the grass and terrain LOD i presume?
again its a feature
you're a funny guy
Limni ground and Grass ground)))
yeah, the model is only shifted visually by the game, the laser position still starts where its actual position is
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
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.
yeah it has a whole lot of problems, it makes sense for someone prone in grass but falls apart after that
pretty sure you aim where the head is supposed to be but yeah
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
its been awhile sicne I had to 'deal' with this stuff
then that would make prone people basically invisible inside the ground but better for anyone crouch or standing
as i flew away from this tank, extra terrain is visually generated over it. in reality its just sitting in a field like normal
Mole tank
with terrain 2 (very hight)
setDetailMapBlendPars [1000, 1000]; //max 1000
wth is that lol
This is a setting to render a detailed texture instead of the satellite image texture. 
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.
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
oh dont get me wrong i know the difference but my wording was bad for sure
this i dont get. i thought its the same.
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
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.
cant notice much when the ai blasts me through the bushes and grass :)
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.
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
Yeah, you shoot above the head to hit the head. If you shoot where the head appears to be then you get a blood splat right on their face but it's a chest hit. So it does help to know the grass rule.
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 {};
https://community.bistudio.com/wiki/addForce
How would I run that in a script to ensure a player would be ragdolled in multiplayer?
Run it where the unit is local
the context window would be in a projectile's HitPart event handler
Apparently using simulation = "house" causes it to run on mission start, which makes sense. I had that since that's what the vanilla fire support module used
Doesn't change anything, just run it where unit is local
So remoteExec or CBA events
I'm just returning to scripting, iirc players are only local to themselves, so I'd need to remoteExec it with their machine as the target?
Minus a little bit of time when first joining a server and respawning, yes
No. If you can detect the condition where the unit is local run it there. Otherwise just run it oncefrom the detector.
You can just use a unit as the remoteExec target
ahh perfect
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.
For your, module? How did you get that, you inherited from something else than Module_F ?
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
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.
Is it possible to detect a headshot inside killed eventhandler?
targetKnowledge and knowsAbout information only get updated on the PC where this command was executed.
So best bet would be to run it whereleader _groupis local.
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
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.
Yes this is exactly what im doing but would be cool if we could check it directly within killed eventhandler
this addEventHandler ["Fired", {
_target = cursorObject;
if (isKindOf _target "Man") then {
_target setDamage 1;
};
deleteVehicle (_this select 6);
}];
i tried this too, but no luck
_target isKindOf "Man".
there is no other way as far as i know, you already do it right
but would a be nice addition if the engine would support that 
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
"CAManBase", otherwise you will catch rabbits and snakes 😂
Would be cool if we can get projectile and hitSelection inside killed eventhandler
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?
they have documentations about this, in the framework itself
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
dude, from what I remember, it's basically reading those documents, you don't need to "script" stuff up
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
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
so, make it better lol
I just need the default one to edit is and make it better
But without QS i cannot move the default buildings of the altis map
And i need the tower to be on a other location
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).
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?
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.
Why is _speaker on line 29 undefined as a variable?
Speaker is defined on lines 14 and 16.
indeed, but this local variable is deleted as the scope ends
declare it above, empty (private "_speaker";) then fill it L14/16 (_speaker = xyz;)
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.
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
like doing this
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
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.
In my case, the helicopter is spawned by the server and that PFH that contains the reveal command is also executed by the server (in the same function), so by just using the normal reveal syntax (without remoteExec) it would be fine in dedi?
Tomorrow gonna throw a diag_log command there to see what the results are
Probably, assuming there's no reason for the heli to change locality
what about HC?
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.
yeah the owner of the dedi server has HC set up
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
and part of those spawn units script get groups and throw at HC
I'm sure it does, just need to take a look at that in detail
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.
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
it depends what you mean by "using a marker"
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
There's a built in minefield module built in to the editor that has a condition check for when they are placed
it also can mark the map's lcoation for friendlies or whoever
Yeah well the problem is too many modules can cause fps issues
And they dont despawn everytime a server resets
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
For the modules i actually tried it. it “works” but not as i expected it to
Basically yeah
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
Hmm
Ur right
But they arent really dynamic
what's the implication of being dynamic what do you mean them to do
If dude steps on mine = mine gone for good even on server restarts
Thats what i meant
need your own mine placement script that creates individual mine objects that deletes itself on an event handler for when its stepped on (or otherwise destroyed)
Not really the brightest when it comes to scripting but where do you think I should start?
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
Oh placing it is no problem imo
Its just the scripting of it
More of a defensive pattern
well, if the ground was flat it's as easy as making a loop to place the mine on [X, Y, constant Z (the ground)] but because the terrain has varying elevations you'll need to find the correct position ATL
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
Ohhh i see what you mean
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
Now Im picturing it it all seems time consuming
nah it's a 30 min job if you know what to do I feel like
Oh good sir I have absolutely no clue what I’m doing
still not too hard I feel, maybe a couple hours learning some scripting functions
The wikipage for arma is the go to for the scripts and their functions right?
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
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
Thanks alot boss ill give it a read
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
Okay so how about spawning them?
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
Is there a way to intercept mouse wheel with blocking it like when using KeyDown and return true? 🤔
onMouseZChanged doesn't seem to mention that
UPD: I guess I found it
https://community.bistudio.com/wiki/inGameUISetEventHandler
oh you can do the map marker with this too
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
};
};
Thanks ill play around with this
i edited it i forgot to multiply by spacing
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
How do I implement these in a server?
if you just want to spawn a minefield you can just directly run that script code at some location i presume. i've never ran a server I don't know how they do stuff
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
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?
@maiden thicket Yeah I can't even get kbTell to say my own audio files
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.
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
I tried to use kbTell from the example provided in BISWiki but it failed apparently. Will look at your code though.
Oh yeah I think i remember it saying not to use that
but I think i tried BIS function as well but ill check shortly
Ok, I see a typo in description.ext - ""#inclue
it's fake typo, ignore
Advance.bikb - missing backslash before file name
Advance .bikb other than missing backslash looks fine, but you could use actor = "someGuy";
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
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
if you have big .oog files maybe it is some kind of problem with filling memory, but I don't know, I am a beginner in the editing, and not an IT guy ;p
i might be accidentally using a massive modpack or something ill have to check
this was actually the problem that's pretty cringe
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
;
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
what have You changed?
just added backslash so speech[]="\Advance.ogg";
oh, ok, it somehow flown over my head
there's a speaker array optional argument to replace defined actors
Now if I can just invoke to existing RadioProtocol words like this
speech[] = { Advance}; that would be cool
Thank you for all the info Nikko, so what are my options in this case? If I understand correctly, like in that PFH (#arma3_scripting message), remoteExec could work?
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

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;
};
};
😭
You should use a default value with getVariable to prevent an error if KIB_playerScore hasn't previously been set
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.
Poor AI
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.
Using a default value of 0 would be cleaner as it requires no special handling. The rest of the code could stay exactly the same.
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.
True, i still like to init my variables properly.
Cleaner to read etc
For saving: Technically you don't need to save at all for profileNamespace and missionProfileNamespace, since the game should do that, only in case of a crash the data could go missing.
So manually saving every 5 minutes or so is a good idea.
@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];
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;
In what way does it not work?
Seems reasonable
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;
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.
yeah I got that, thanks
@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. 😭
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 
You should still use a default value (and 0 is the most sensible one) because if the variable is not initially defined, the script error it causes could stop the loop from being started in the first place, which in turn causes the score to not be saved to the profile
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?!
addScore is server exec (see here https://community.bistudio.com/wiki/addScore)
@sharp grotto checked everywhere in code, and no score is added in any form ...
I will try to run it with remoteExec globally ...
"addScore is server exec" means "addScore must be executed on the server in order to have any effect". You are currently executing it on the player clients only. It needs to be executed on the server. You should use remoteExec to execute it on the server.
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;
};
};
Without additional context, if you want to send the score to the server repeatedly, then you need to move the remoteExec line to the while loop, right before the sleep 10;. As it is, it sends the score value only once.
Edit: I interpretted the snippet incorrectly.
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
but I need it only once at begining of mission, when it load the saved variable
I am not quite sure what you are trying to achieve exactly, but if you want to simply initialize the score for a newly connected player, then it is surely done better on the server side as @sharp grotto suggested.
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.
@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;
};
};
Initialization order quirks can make you question everything if you are not used to it xD
There is a slight problem that this is not a reliable solution for games with higher latency or higher CPU stress. You would be better to do the sleep on the server via waitUntil even when saving the score locally.
true, I can add to sleep time even more (20s lag is unlikely I hope 😆 ) or add
waitUntil{player == player};
More time will do fine, probably.
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
I think that the problem is actually not on the client, but on the server. The server may not be executing addScore in the remoteExec.
Doesn't the server itself not also track scores in MP over the same session?
its tracking all players score during mission, I wanted to save it between server sessions
Sure but with this solution wouldn't relogging allow doubling one's score repeatedly?
@errant jasper you know why this will happen? 🧐
Multiplayer:
Server execution only*
So your remoteExec should be 2, not 0
No, I am just inferring:
- Player A joins has 0 score zero set.
- Does stuff has score 20, 20 saved
- 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.
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?
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.
really clever, I will use it 👍
no i dont put them on the work shop
maybe private messages exist for this kind of stuff ...
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
for those emojis patterns, looks like an AI generated text lmao
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 🙂
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)
[
...
{ // codeCompleted
_lights = param [3, []];
{
_x setDamage 1;
} forEach _lights;
},
...
synchronizedObjects myTrigger // arguments
] call BIS_fnc_holdActionAdd;
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;
};
it seems totaly unnessery to have 2 loops here.
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;
oh nice really nice thx man
It's not necessarily faster though.
i only need it to run one time
Either works. First version is ugly because it's using the old style for-loop rather than just forEach over the classes.
copy that
I feel like I've seen that code before and it predates me playing Arma :P
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 🙂
Or just switch off every light without damage
{_x switchLight "OFF";} forEach (1 allObjects 0);
Needs to be remoteExec'd in MP though, unlike setDamage. Not sure which one is more network-efficient.
Sending the expression of the targeted objects just once would be a single message, so I imagine that would be way more network efficient.
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
And what's the question?
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;
};
};
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
Well a location is a kind of object, right? SetVariable works on objects, but isNil does not.
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
isNil syntax 3 does accept objects for its namespace parameter https://community.bistudio.com/wiki/isNil
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
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
yeah I had assumed that it would
at least there's a workaround
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?
Is the vehicle full? Are they able to path to the entry point?
ah you're right it was the pathing
they had plenty of room but not enough to convince the AI i guess
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?
However, when I try to call this function from console on Dedicated server it gets executed instantly.
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.
Might it be problem with the time of initializing .bikb. or .oog files or something like that?
Everything is set to zero
the only condition i have on those triggers is usually "player present"
Maybe if you have the mother of all files? But it would have to be like a full movie in one file to achieve a full minute of loading time. I've never heard of that happening.
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
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
Civilian Presence doesn't cause that much trouble on its own. You'd have to be really pushing it. A minute of slowdown is a lot.
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.
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
The actors aren't simulation disabled, or attached to a building, or something like that?
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"
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 🤷
Would I be able to check .rpt, would it show anything?
maybe™
Some problems can be logged in the RPT, but some problems aren't strictly "errors" and won't be logged. It's worth checking just in case (make sure you're checking the server's RPT, not the client's)
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
Yeah, sure, I get it. But I wonder if it would show when the function has run or something like that.
Not unless the function deliberately logs it, and most don't because that would result in a lot of spam in the RPT
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
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
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.
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
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);
}];
To quickly add a full ACE Arsenal to a box for all clients use the following code:
https://ace3.acemod.org/wiki/framework/arsenal-framework
[_box, true] call ace_arsenal_fnc_initBox;
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
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.
ok thx
i seem to be a skill issue😂 and cant get it to work still can i get some help plz im still new to the codeing part i stole this from a car spawner script
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
What is the problem? The crate is spawned by some code?
i was able to get a freind to help but i was adding ace to a spawned crate but it works now
Sorry for @ing , but I have some new news on my issue and You responded
I made the trigger - "non-server-only" and although it now runs N times [server + client] at least, the speaking executes immediately.
I guess that remoteExec would not help to make run code only once if this trigger is activated globally, but should if isserver help to run the code only once?
isServer==[✓] Server Only
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
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?
Yes.
Just create it once.
Otherwise it will create unit * clients N
BUT if You would like to addAction - then You would have to do it on every machine.
You can run createUnit on any machine
how can i make it so only certain roles can open an arsenal
oh no i'm super real and i also know well Mr. Scotty wich ignore me here becouse can't answers my questions 🙂 PiG
😂
For ACE, you can either immediately close the arsenal via a cba event, or you can make custom arsenals for each role. What you want?
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
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.
I would use https://community.bistudio.com/wiki/roleDescription to determine the role of the player (instead of using the class of the player unit), but that's more personal preference.
```sqf
// Copy text on all this and remove all the ( back slashes = \ ) and your code goes here
```
onPlayerKilled and the onPlayerRespawn Auto run in the game already don't they
Yes
i was just wondering why waflfr was doing a addEventHandler on them: but now i see they are diff: for what he's doing
Didn’t know sqf was supported by discord for the code blocks, would’ve used it otherwise
Yes I was debugging something else earlier
That fixed it! Thanks, I don’t know why I put true down
cool
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.
@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
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?
Via script? could you share you current content how you are trying chance type of marker
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
the 2nd param is the marker type but you pass in _pos
oh I figured out the problem, Its calling setMarkerShape on the backend rather than SetMarkerType
sorry I omitted the second layer cause this entire things being invoked in a MapSingleClick event handler, here are the args [_coordName,_markerType,_getApproachVector]
thanks for the input y'all!
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?
no, there is no all in one command
You can make a simple object of any model using the model path
Whether you can set selections on it, I'm not sure
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?
units spawned in a group different from their natural side are a bit buggy, you need to join or joinSilent the unit afterwards:
https://community.bistudio.com/wiki/createUnit#Example_6 sqf _unit1 = _group createUnit ["some_opfor_unit", ...]; _unit2 = _group createUnit ["another_opfor_unit", ...]; [_unit1, _unit2] joinSilent _group;
Ty works now
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.
Unfortunately you cant, needs to be created with the config class so the engine know about the selections
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
With and.
moveCompeled _unit1 && moveCompeled _unit2
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};
In what context is this code running? waitUntil requires a scheduled context because it needs to suspend.
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!!!
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;```
And what context is this being executed in? Object init field? Trigger activation field? Init.sqf? Has spawn or execVM been used?
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
Right, execVM creates a scheduled context so suspending is allowed
Basic checks, then: are you sure both those unit variable names are spelled correctly?
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?
I don't see anything that looks wrong 🤔
Anyone?!? (sorry if I am rushing, just very anxious) 😖
Would you mind if i send you the script to see if you find smthn?
Find the DIK for H
got the DIK for H
onKeyDown and onKeyUp will also return the state of shift, ctrl and al
and Shift, but how in displaySetEventHandler
look at the return of onKeyDown
k
Where and how do you set moveTo event on your units
filter onKeyDown for the H DIK and then check the state of shift
k
I use trigger when players secured area then trigger runs execVM myscript.sqf then script spawns units makes their loadout and some group commands and after all that goes _unit doMove [POS]
I've used different command waitUntil {(_unit distance _arty < 20)}; and now it works fine
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
What are the code breakpoint step through / into / over commands for Advanced Dev Tools? Or do they not exist and only breakpoints?
No idea what script you're running so could totally be talking out my butt but if it helps players that are unconscious side will be civilian. Maybe that's where your issue is?
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
Does anyone know a script that allows you to do undercover ops?
player setcaptive true;
@loud shard solution is side group _unit
Oh nice. Smart 🙂
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.
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?
Syntax error like having empty colon or array bracket not matched
still looking for an answer to this. atm i am just putting a breakpoint on every line so i can step through a script
doesn't the doc answer this?
i read their steam page and missed that there was a documentation
ill check
surpisingly, there's nothing there about breakpoints or debugging in the documentation
@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
i would just make the bullet start like a foot in front of the enemy, changing velocity will change the damage
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
he wants hitscan bullets in his arma 3
The objective is to make my player's bullets to hit instantly
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
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
Script is running in the fn_init.sqf in a working mod i made, no error message pops up, it seems the bullet doesn't show any tracers anymore as well
- Is
fn_init.sqfis actually running? - What is the code?
Yup the init is working, and the only code running along with it is the one i sent up there
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?
From what i found online, it's just this bit of code
Is that a yes or no?
yes
SomeKindOfBulletdoes not seem to be a proper ammo class to be spawned_unitis very likely undefined- The code only runs once if I understand correctly, not everytime you fire a weapon
- These above three will not throw an error because there is no syntax error
- And it basically does nothing due to there are a lot of undefined thing
Where do we begin to explain
from the start i guess
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
How did you try it?
gonna make a single mod for it, just a sec
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
execute it in the debug console
even running it on the console it has no effect
it works i just did it
if ur playing a mission not in editor
it worked, just launched the bomb far away from me
Are you saying it doesn't work, or it does work but you didn't die?
it's working now, i messed up when i pasted the code on my console
_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
I'll try it out as well maybe i'll need it later
okay, so no unit and no class of bullet was specified, so no way the game can understand it and run it
You understand it right
the rest of the code is weird cause it spawns the bullet on the same _unit that then aims for that _unit's head
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
Second point
_unit in your code is undefined. Very likely.
Due to:
paramscommand was supposed to define it- But due to lack of the context in the running code, it will not pass any variable to the identifier (
_unitin this context)
Yes
i'm new, but I would assume it's possible. they probably got needlers and stuff on halo mod
huh... okay nice, remember what the command is?
createVehicle
mhm, main problem so far is the core of the script itself, since basicaly everything has not been defined to begin with
So params must define those bits, before the code can do something to begin with
Halo Mod you don't need a Mod to have Halo Jump
what's a halo jump? parachute from high altitude?
Correct
yes
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
You probably don't know SQF fundamentals even, and my honest reaction to your concept is, it's too far away from your experience or knowledge
@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
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
... Not that this is a case I've ever encountered, but I wonder which one of those would "win" if there's same name classes
Hi
Is there a way to disable ground vics from targeting air assets?
Like tanks not being able to target planes
Writing your own custom AI to "forget" if it's something you don't want targeted.
This is what I do for custom turrets (I disable game AI targeting and do it all manually) to only target things I want them to, even if valid targets are in range.
ama see wut i can parse from this for my scenario, ty
Pretty sure there is an eventhandler that fires when a sector is captured. Anyone know what it is?
ownerChanged scripted EH on the sector https://community.bistudio.com/wiki/Arma_3:_Scripted_Event_Handlers#Module_Sector
there's also ignoreTarget that can be applied on a per-group basis to have them ignore specific units/objects:
https://community.bistudio.com/wiki/ignoreTarget
ty
Thank you. How can I use this in a script? I want to call a function everytime a sector is captured and i dont want to use the script call on the sector
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.
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.
are you using sector module?
Yes
there is an expression field on it 
Yah but i dont wanna use that
why?
Would require me to pass input on every sector
make a file for your script, and call it from there, ez
params
Would have to pass the spawn ai modules as input though
🤷
How can I save an original “starting postion” on an object via setvariabel?
the object gets deleted?
No
Need a location (original starting position) to use as a reference point for sorting things by distance
like this you mean?
_object setVariable ["TAG_myObjPos", getPosATL _object];
or use some namespace
I guess. Im not very scripty
you can either use the _object in setVariable or a namespace like missionNameSpace (acts like a virtual space so you can store variables) as a varspace (first parameter)
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)
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;
Ty bro
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?
If you are spawning the units manually in the Eden editor, you just name those objects and put these names (it's basically a variable that identifies the object) into those brackets, separated by commas.
There may be an issue in MP if the ignored target respawns. You may then need to call the command again.
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?
Yes, it works.
excellent thanks!
Just make sure your task IDs are unique because that can cause some broken shit.
yeah I've heard the horror stories lol
Just don't sync the Task editor modules with JIP player objects.
how to place or do anything with compositions via script?
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.
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.
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…?
initplayerlocal.sqf => executed once. Call the same init into onPlayerRespawn.sqf too if you want the same thing whenever the player respawns.
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...
"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;
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)
- Persistent functions are called
- ...
- initPlayerLocal.sqf is executed
based on those, the order should be:
- Players receive public variables first
- JIP'd remoteExec functions are called afterwards
- 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
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.
if it's meant to be a server-side mod though, not having anything in init*.sqf would be preferable
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)
NO. Broadcasting means network consumption for NO REASON.
Look... I have a full mission toolkit...
Just define them through CfgFunctions
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...
What carried you all away from my thoughts...
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?
wrong
RemoteExec executes whatever function that exists.
No need to send 'a function definition'.
just define it.
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)
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.
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.
given the previous order of execution, broadcasting all functions individually would ensure they're defined before JIP execution, but it'd still help to know the reason why it's a server-side mod and not part of the mission file
(possible XY problem: https://xyproblem.info/)
are you trying to reuse your code across multiple missions? do you want to protect your code?
, broadcasting all functions individually would ensure they're defined before JIP executio << it is total non-sens
^ docs referenced here
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.
Why not use CfgFunctions/Functions Library like suggested above?
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
Yeah CfgFunctions also does that
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?
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.
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)
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];
never know what functions exist on their client << 100% crazy
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.
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.
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.
You realize clients still download the mission files right?
So if you're trying to keep everything "secure", it needs to be a mod only loaded on the server
... You know you have to download the whole mission file to play a mission, right?
some great info imho
It's not, don't try and do this stupidity
jinx dart owes me a coke
Nuh uh I sent mine first
Already ...
Nuh
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?
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
Clients can't execute code in normal circumstances and if they can, you have bigger problems than them knowing what scripts you have
And broadcasting whatever as variable to all your players (=means putting something inside allVariables missionNamespace on all cli) is neither security nor obfuscation indeed.
security by obscurity is a great concept
Clearly this won't cause massive problems
I understand that I can’t find the right words to make it clear what, why, and for what purpose...
imho Dart knows: believe me: he's Awsome: He helped me with my Chopper Command Scripts: and it all works prefect
Dart is a good boy
yes the best: he's a real pro imho
he's very silly and only occasionally asks me for silly code
What I enjoyed the most was his "Cybersecurity is crying out for you" and this guy want to broadcast functions to all the cli 🤣
but there's lots of real pro's in here
that reminds me I should release my mod that has been done for a year and hasn't been released
and i should put my missions on the workshop: but well you know
If you feel like it's important, I guess you could just have all the possible functionality to take place on the server and use "dumb" clients that just trigger different actions via UI (within limits of Arma)
lol "dumb" clients lol hahaha
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.
Not to pile on but there are a number of built in security functionality, like disabled commands, that will not work well with a system where functions are stored on the server. The idea of maybe a couple server side functions for obscurity isn’t that crazy, but the idea of making that a majority of your mission seems a bit impractical.
true. But I never had this "code obfuscation" need so....
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.
i wish i knew how to make a func library: can some one show a Actual func library setup
Just declare specific files as 'lib' ; my screenshot displays an actual example.
It's on wiki
oh cool
This is unbelievably dumb
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"
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.
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.
You can queue up the JIP functions until they are received and ready to be executed. If you wrap all your JIP functions into a TAG_fnc_jip, on the client script you can store all those and wait to execute when… ahem when they get your server function update.
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.
wow the server is way down on the list 🙂
Everyone has different opinions. For some, comfort is important. Sometimes, loading speeds can be slow for others. I've experienced this myself more than once.
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.
Where is it not optimized and how does it load?
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.
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?
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.
The bots that are walking around your mission in JIP use much more traffic than what I send to the player once.
You can overcome that by manually implementing what the function library does and compile final them.
In MP, try to avoid network traffic as much as possible if you wabnt it to scale.
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?
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.
You have 1 MB of code transferred this way???
I mean the value is... almost nil.
This can be solved simply through compilefinal
You will also not be able to take advantage of some recent enhancements like being able to offload mission file download to another server.
Yes that is certainly possible. But there are some performance optimization done in function library you won’t have.
I can show the code that is called for the library of functions... there it is no different from my code, only there the description is checked for the ability to be recompiled
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.
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.
wow that's Awsome m8 thx woohoo
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.
Prefix your global variables and custom config properties
For scripted eventhandlers, can you provide arguments/input in addition to the arguments that are passed by default?
He doesn't even want his players to see his scripts. You think that he's sharing it with other devs as part of a library?!
That has nothing to do with that
No. You must store them on the namespace.
Dangerous if you have cheaters, they can just overwrite a function if you don't use compileFinal / compilescript.
^ They've apparently considered that already.
Hey , how i can setup lowrange or longrange frequence via trigger in mp mission ?
Changed with comment
_name = _x;
_function = _y; // Or _function = compilefinal _y; For non overwrite func
missionnamespace setvariable [_name,_function];
iam blind, sorry xD
i can somehow blend out comments since i never used them 😆
code = {adfg=124};
code1 = compilefinal code;
code1 = {afg};
code1
😄
Actually, you reminded me to make this comment.
I mean if there is given script access "cheaters-only" are the least of my concerns.
is there anyway i can change the amount of zombies in spawn insiyed of 256
No one knows what zombie thing you're using
JIP remoteExecs are specifically sent after other JIP queue entries. Not sure this is documented anywhere, but Dedmen said it :P
Sometimes I stop believing him. I won't believe it until I check it with my own hands. 
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.
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?
It's how it always is. Position updates on vehicles are lower than smooth over network.
There is no fix. It's part of the jank that makes arma arma.