#arma3_scripting
1 messages Β· Page 134 of 1
I'm having trouble making the AI man some guns, this is the code i use : _unit assignAsGunner _gun; [_unit] orderGetIn true; but for some reason the AI doesnt always go to the gun and man it, sometimes it just moves a little then stops. idk why it doesnt always work, maybe because there is enemy near or something that confuses the AI. any ideas?
i tried these too but no luck: ```
_baseGroup setBehaviour "CARELESS";
_baseGroup setCombatMode "BLUE";
_baseGroup enableAttack false;
Vanilla, SP?
vanilla MP but not dedi just run MP from editor
yeah all in one group
No, I mean are they individuals with their own group, or do they have a leader?
they have leader (AI leader)
whats the vehicle?
static weapons
which static?
vanilla such as "B_HMG_01_high_F"
test with disabling the unit in questions visibility check,then reenable once manned
rule out if its enemy thats causing it(actually for whole group)
as leader will share contacts
yeah i was thinking the same. do you have some command in mind that I could try? (already tried something like this)
this disableAI "CHECKVISIBLE" in the group init
im not certain this checks for vehicles or just enemy though i havent tested. if includes vehicles then might not work UNLESS wp is given right on top of static as that check starts after a meter i think or so of distance
tried that with all units but no luck
two guys ran to man the guns but like 5 just stands there
im not sure if its related, but might be a bug and related to this i found the other day
as it relates to turrets specifically
hmm
as the behaviour of AI moving then stopping indicates its trying to complete the action, then doesnt,isnt normal unless a pathing issue
im sure you ruled out pathing issue right?
waitUntil _unit distance _turret < 2
_unit moveInGunner _turret
boom π
lol
was thinking this too but didnt consider the hacky waituntil
seemless solution
being on a static anyway means youve a short life expectency anyway
yes i did remove lot of stuff out of the way but that didnt help
another solution if the function exists would be to set his position,then have him "assemble" a static weapon
Use the getInGunner action so they do the animation
the weapons are already in the base just waiting to be manned
they dont react to domove either...
i think domove is just to follow leader right?
No.
nope you can give the move position
doMove has them move to an arbitrary position. If they're not the group leader, they will move back to the leader after completing the move, but they should still do the move to begin with.
sorry to derail you, i just noticed my init and playerlocalinit, wasnt working correctly, and realised its because this line was being called:
while {true} do
{
if (player != vehicle player) then
{
playmusic format ["RadioAmbient%1",floor (random 31)];
};
sleep random 60;
};
if i move it to bottom of the init everything works ok. why is that?
The while loop never finishes, so everything after that is never executed.
wow i didnt know that.
If you want to have the while loop start earlier but not delay everything else until it's finished, you need to spawn it into a separate thread.
such as a player init?
Did I say "player init" or did I say spawn?
spawn π
could you give small example?
im not sure how to spawn sth into a seperate thread
https://community.bistudio.com/wiki/spawn
0 spawn {
while {true} do {
if (!isNull objectParent player) then {
playMusic format ["RadioAmbient%1",floor (random 31)];
};
sleep random 60;
};
};```
thanks
Did you try working with the music eh yet?
haha yes iv got a list of things i am trying to impliment,as i polish i just keep getting sidetracked because theres just too much stuff were able to do here
ontop of that theres so many errors..errors for days and im tryna understand all
i found out what the problem was π the ai got stuck because of those grass cutter objects (Land_ClutterCutter_large_F) which are invisible though
now how Im supposed to mow the lawn π²
huh, weird that it has any impact on pathfinding!
a helipad should mow the lawn i think(try an invisible one)
exactly
the problem is the grass cutters have to be there for a moment for all clients clear the crass (creating cutters locally). would just have same result with helipad if it worked
maybe creating grass cutter only on clients and not server avoids the path finding problem (which im doing right now)
but with server and client on same machine it definitely doesnt work
then again player's AI probably has the same problem
what type of scenarios do you create?
in general i mean
CTI, using cutters to remove grass from base
It would be cool if there was a command for grass cutting rather than having to rely on objects
is it possible to use a chat type other than systemChat for the "connected/disconnected" message?
or change its position?
Turn off the base system and make your own UI element and system?
just found out you can disable systemChat with disableChannels via description.ext
but there is no channel ID for systemChat does that mean its not possible?
System chat is for system messages, including important ones. You can't disable it.
cant change its position too?
It's displayed in the normal chat panel. You can change its position to the same extent that you can change the position of the entire chat panel.
i mean change it by script in mp
The answer is the same. It's still displayed in the normal chat log in the normal chat panel. It's not a separate element. If you can move the chat panel then that will move where system chat is displayed; otherwise no.
According to the handleChatMessage documentation, the channel ID for systemChat is 16. https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#HandleDisconnect
You could try using that with disableChannels, or using handleChatMessage to intercept messages on that channel. However, it's not mentioned anywhere else, so it might not be actually true.
Well, I linked to handleDisconnect there by accident, just scroll up
ok thanks a lot,i'll take a look
Please let us know if you find out that 16 really is the channel ID for systemChat. It should be added to other lists of channel IDs if it's true, not hidden away in the handleChatMessage entry.
It is
I made something recently that uses handleChatMessage and when I was hinting what params were provided it did say 16 for systemChat messages
That'll be awkward if that ticket for more custom channels ever goes through :U
Disabled channels config, only disables the UI afaik.
It wouldn't hide messages in these channels
Channel 16 is indeed for systemChat
I used it to hide connect messages etc.
params ["_channel", "", "", "_text", "_person"];
private _senderUID = getplayerUID _person;
if(_senderUID in ExileCLientMutedPlayers) exitWith{true};
if(_channel == 16) then
{
_ltxt = toLower _text;
{
if(_ltxt find _x > -1)exitWith{true};
} forEach [
[localize "STR_MP_CONNECTION_LOOSING", " "] call BIS_fnc_splitString select 3,
[localize "STR_MP_VALIDERROR_2", " "] call BIS_fnc_splitString select 2,
[localize "str_mp_connect", " "] call BIS_fnc_splitString select 2,
[localize "str_mp_connecting", " "] call BIS_fnc_splitString select 2,
[localize "str_mp_disconnect", " "] call BIS_fnc_splitString select 2,
"modified",
"requirements",
"signed",
"allowed",
"query",
"publicvariable",
"signature",
"required",
"got scared"
];
};
I take it there's no way to apply post-processing to ui controls?
playing around with vfx/sfx now, easer to use than I thought it would be although i havent reached the level I want to yet
tl;dr of how it works is just a few of these π
_pie_pp_roof_smoke_helper_2_emitter = "#particlesource" createVehicleLocal getPos pie_pp_roof_smoke_helper_2;
_pie_pp_roof_smoke_helper_2_emitter setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal",16,12,13,0],"","Billboard",1,10,[0,0,0],[0,0,0],1,1.35,1,0.1,[3,6],[[0.5,0.4,0.3,0],[0.4,0.4,0.3,0.1],[0.5,0.4,0.3,0.08],[0.5,0.4,0.3,0.04],[0.5,0.4,0.3,0]],[1000],0.1,0.15,"","","",0,false,0,[[0,0,0,0]]];
_pie_pp_roof_smoke_helper_2_emitter setParticleRandom [4,[1.5,1.5,0.5],[0.9,0.9,0.9],20,1.5,[0,0,0,0],0,0,1,0];
_pie_pp_roof_smoke_helper_2_emitter setParticleCircle [0,[0,0,0]];
_pie_pp_roof_smoke_helper_2_emitter setParticleFire [0,0,0];
_pie_pp_roof_smoke_helper_2_emitter setDropInterval 0.022;
Correct
:'(
PP only works on normal vision, plus in nvgs these days. Doesn't even work if you have thermal sights open
Or at least not colorCorrections
i guess it's the same with 3D control models too?
Anyone know a way through which I can cancel combat pace? Switching from combat pace to the dragging anim gets you stuck in place
@candid sun I think so, not sure
that's a damn shame
Nice one, used a similar setup to disable a CIWS system for a huge mission i had on my Exile server.
Hey y'all. Trying to make an ACE Arsenal Extended compat mod for a group. However I get an error when I launch it. When I go into the file itself the line it says there's an error on doesn't even have an "A" in it for it to read so I am not sure what to do here. It's breaking the mod but I can't seem to fix it.
Here's the associated code lines.
class Rogue_MarineArmour1
{
options[] = { "Lower Armour", "Pouches", "Upper Armour" }; // Always computed, do not edit
label = "[150th]";
class Lower Armour
{
label = "Lower Armour";
alwaysSelectable = 1;
values[] = { "Green", "Marine", "Mixed", "ODST", "Tan" }; // Always computed, do not edit
};
class Pouches
{
label = "Pouches";
alwaysSelectable = 1;
values[] = { "Grey", "Tan" }; // Always computed, do not edit
};
class Upper Armour
{
label = "Upper Armour";
alwaysSelectable = 1;
values[] = { "Green", "Marine", "Mixed", "ODST", "Tan" }; // Always computed, do not edit
};
};
Okay, that's an issue on the way I configured the other app that generated this. It's not clearly labled it's for a classname so I had no idea that's what it was asking for. Much appreciated! I'll fix it and see if it works
This is really a #arma3_config thing btw, so if you have further issues you should ask there.
My bad. I didn't see that at first, noted for the future though! Thanks
Does anyone know of a way to return the memory points that control a specific selection in an object?
I don't think there's any way to get all the points. selectionPosition gives you the options of first point, average point or bounding box.
I think there's a 2.18 command that gets you the bones associated with a selection
yup. getselectionbones. Which is exactly what I need, but I don't want to have to wait, 3, 6, 9 months, a year plus even for it to be added.
But it looks like I have to so...
2.18 is expected to be relatively soon; it was reported as being spring-summer 2024
Might be the wrong channel but does anyone know why my inf loadout isnt changing? I exported from the ace arsenal and dont recall what I have to do but I thought I just threw the info into the units init
[[[],[],[],["rhs_uniform_gorka_r_g_gloves",[]],["MBSS_Ranger_v2_1",[]],["TFL_Drybag",[]],"airframe_cover_4_ComtacIII_Arc","clary_avonfm53_black",[],["ItemMap","ItemGPS","TFAR_anprc152","ItemCompass","TFAR_microdagr",""]],[["ace_arsenal_voice","ACE_NoVoice"],["ace_arsenal_face","WhiteHead_11"],["aceax_textureOptions",[]]]]
If it's a unit loadout array then this setUnitLoadout [array goes here]. I'm not sure if ACE exports normal unit loadout arrays though.
so im trying to figure out a script for mp for when a player goes through a trigger it fades to black and removes their gear then fades back in, I have the fade script figured out (dont know how to do the script boxes yall do) but how would I remove the gear on a trigger?
Easy way to make a player completely naked
_unit setUnitLoadout (configFile >> "EmptyLoadout");
Otherwise
https://community.bistudio.com/wiki/removeVest
https://community.bistudio.com/wiki/removeBackpackGlobal
https://community.bistudio.com/wiki/removeUniform
https://community.bistudio.com/wiki/removeAllWeapons
Find more commands here -> https://community.bistudio.com/wiki/Category:Command_Group:_Unit_Inventory
Getting "missing }" on this block and i have no idea where its supposed to sit at
removeLoadout = {
_unit = _this select 0; // Get the player entering the trigger
removeAllItems _unit; // Remove all items from the player's inventory
removeAllAssignedItems _unit; // Remove all assigned items (uniform, vest, backpack)
};
Mh try without the comments π€
All good, sometimes it happens π
and still isnt doing what i need fuuck
so would i make a empty loadout and export it and put it in the mission scenario folder?
Depends on what you want exactly, if want them completely naked without anything that's already enough.
_unit setUnitLoadout (configFile >> "EmptyLoadout");
so just put that on a trigger that activates when a player walks through? I dont gotta make a file for the "EmptyLoadout" to point to?
Yes, no extra "file" needed
See https://community.bistudio.com/wiki/setUnitLoadout
ok
sorry for all the questions, i dont to scripting a lot
still nothin
no idea what im missing
try something like this note not tested:
{
if(_x isKindOf "CAManBase" || isPlayer _x) then {
[_x] spawn {
params ["_unit"];
1 fadesound 0;
private _layer1 = "normal" cutText ["", "BLACK OUT"];
sleep 1;
_unit setUnitLoadout (configFile >> "EmptyLoadout");
2 fadesound 1;
sleep 1;
_layer1 = "normal" cutText ["", "BLACK IN", 1];
};
};
}foreach thisList;
I got something figured out that works as crude as it is but I will test this in the morning
I wish there was a way to known when the grass cutters (Land_ClutterCutter_large_F) have done their job. then you could delete them.
does it not fix the issue if you create them as simple objects?
have to try that
If you delete the grass cutter, you'll have the grass back as soon as camera moves away and back
hey that actually works π Thx Lou
I teleported away and back but the grass remained flat (Editor SP)
- You didn't delete it or had another one.
- You wasn't away long enough
you didn't move far away enough
Or far enough, yes
near, far, whereeever you areβ¦ π΅
the grass cutters don't "cut" the grass. they prevent the clutter generator from generating the clutter there
and clutter information is not stored for the entire terrain. only a small area around the camera is stored in cache
when you move away the cache gets overwritten
hmm havent yet been able to repro that. I have the cutters on one side of island (Malden) and teleported to other side
ill try altis
seems to work. im using deleteVehicle to delete the cutters (simpleObject)
yep im seeing it now, with enough cutters the grass comes back
so i just leave the cutters there π
I wonder if its possible to create own grass cutter model of custom size to use with createSimpleObjects, to avoid creating lots of small ones?
a very good idea, maybe inherit from one of the existing cutters. no clue what determines the size though
you just need a roadway lod iirc
Searching 888 files for "bullshit"
40 matches across 14 files
anyone worked with hashMapObjects before?
trying to confirm the observation:
_self = nil; doesnt work from inside a hmo's method, right?
"doesn't work" as in what? it undefines the variable if that's what you're trying to do
im trying to trigger the #delete deconstructor
setting something to nil doesn't destroy it
it gets destroyed when it's no longer being referenced
so i would need to remove the reference from the GVAR i referenced it in?
anywhere it's referenced
yea
would _self call ["#delete",[]]; work?
Or would that just execute the deconstructor while keeping the hmo alive?
And if I remove the remaining references from the #delete, it would re-call the deconstructor?
_self call ["#delete",[]]; work?
it should. it's just a method
Or would that just execute the deconstructor while keeping the hmo alive?
yes
if I remove the remaining references from the #delete, it would re-call the deconstructor?
I don't understand what you mean
sry
i have that HMO inside a gvar, nowhere else.
if i would just manually call #delete,
and inside #delete i do missionNamespace setVariable [GVAR(xyz), nil];
that would call #delete again "by default", right?
it doesn't call #delete by itself, but it will get called afterwards I think
Oke, i see what i can achieve.
There isnt much info about hmObjects on the wiki, so thanks alot! π
I don't know why you're trying to delete a var like that tho. #delete is meant for cleaning up the resources created by the hmo
if you're trying to delete the hmo, just remove its references (like that missionNamespace setVariable [GVAR(xyz), nil];)
What was the preferred method of posting large texts? Dropbox?
pastebin
pastebin or github gist would be suitable i guess
thanks alot, thats what i needed to know mainly. the #delete stuff was more curiosity if it would be an alternative way to achieve the same.
hello,
i have a helicopter "h1" and want it to lift a supply crate "c1", wut do i write in the trigger condition that detects if the cargo has been lifted successfully?
getSlingLoad h1 == c1
So, if you guru's would have a peek on this and tell me how to make it MP compatible if it isn't good as is already. Much appreciated.
https://pastebin.com/S48s6LhH
With the amount of instructions, why don't you just turn this into a composition?
Because I don't know how to?
Look, consider me a total noob. I used to be half decent in A1 and A2, but been out of the game and editing stuff for about 10 years or so....
The instructions are basically for others, and a text file is so much easier to share and send about than special files. I like simplicity.. π
Just something to consider. If you are going to use a bunch of editor objects like that, you could make a composition and write the code in the inits of that composition. Then to share it, they just subscribe to it and they just place it down in the editor.
lol sounds so easy, but it's all new to me.
The composition also brings over trigger code too
cool
I'll have a look at it whenever time allows. This adulting shit is a trap. Don't do it!
32 y/o in the world of cardiac. I get it lol.
Compositions are meh for sharing with experienced people but great for sharing with laymen.
Hum, i think there is a glitch that needs to be reported:
params ["_entity"];
}];```Why does this code return an unknown enum value: EntityDeleted ?
2.18
Holy shit, i didn't see that
Is there anywhere to get more info on BIS_fnc_counter? The biki is woefully lacking
You can open it in the Functions Viewer and see what it actually does. But it looks like it's pretty simple - increment the value of variable x by number y.
Hazard a guess it essentially does
private _oldCount = missionNamespace getVariable [_givenVarName, 0];
private _newCount = _oldCount + _givenValue;
missionNamespace setVariable [_givenVarName, _newCount];
Not sure if global but that should be easy to see from looking at the code
well, what I'm looking to achieve is a counter that keeps track of x amount of evidence objectsa collected
so basicallay, in a trigger I set the condition !alive ev1 (example)
What I need is te counter to trigger when the ammount of ev has reached say 6 objects (named ev1....ev6)
How would I then configure the onAct of the corresponding trigger?
sqf evicount=[0,1,0] call BIS_fnc_counter; or something else?
The counter is just a variable containing a number. You can call the function to update the number or retrieve its current value. It does not "trigger" at a certain threshold - it's up to you to check the counter's value and detect when it's over the value you want, using maths operators like >=
Also, the wiki page does describe the syntax for using the function and it's not close to what you've written there
The function is almost certainly literally just a convenience wrapper for getting a variable and adding y to its value, as I showed before. Simply imagine that the text BIS_fnc_counter is replaced with the code example I posted, and you should figure out how to use it.
I've checked the code and it is essentially Local Effect - non-broadcasting syntax of setVariable is used. Probably worth adding.
Also, the modulo value is used after adding the main value:
private _var = (_varSpace getVariable [_varName, 0]) + _add;
if (_mod > 0) then {_var = _var % mod};```
I think it'd be good to describe that more specifically than "counter cycle", but I'm not sure how because I don't really understand what it's meant to be for
Hello, I'm quite new to Eden, scripting itself and I'm wondering if there would be any sort of script where I'd be able to apply certain attributes to specific slots and from their making them able to access a specific arsenal, different for each slot, I know there's some game modes with this and I'm wondering if there would be any guides/resources or even a script I'd be able to modify myself to achieve this.
Well, I got it working, I am very grateful for your help. I'm using onmap triggers. Superthanks guys!!
Is there any way to get data from the existing CCIP calculation for bombs?
Specifically getting the impact point coordinates
{ removeAllWeapons _x } forEach thislist;
{ removeAllAssignedItems _x } forEach thislist;
{ removeUniform _x } forEach thislist;
{ removeHeadgear _x } forEach thislist;
{ removeVest _x } forEach thislist;
{ removeBackpack _x } forEach thislist;
{ removeGoggles _x } forEach thislist;
hint "it worked!";
so this works for removing gear from a unit but its only one unit even with repeatable set for the trigger. How would I go about having it do it to each player that passes through?
would I have to give each unit a name and list them down or something?
nevermind, just need to space out the timing on the units passing through
can i detect if a zeus is controlling an AI? is there a variable or a function?
_remoteControlledUnit getVariable ["BIS_fnc_moduleRemoteControl_owner", objNull];
I'm spawning in 2-4 random items (basically clutter around an IED object) and want them to be as close as they can be to the IED object but obviously without clipping and sending the object to orbit. Spawning them in with "NONE" instead of "CAN_COLLIDE" puts them too far apart I assume due to their bounding box.
I know I can try some shenanigans with the bounding box but I was wondering if anyone has done something similar before
This is basically what I have https://imgur.com/XqKlPFW but I would like everything bunched up a lot more
that reminds me, I don't think we have an engine command that gets the relative position compared to another object WITHOUT having it attached
anyone know a script to ace interact an object and allows players to restart the server?
letting people restart the server via ace interact seems rather dangerous π
this would props be the right command to use for the restarting though
https://forums.bohemia.net/forums/topic/205820-solved-server-restart-via-script-on-low-fps/
Hey guys I do like to know if it possible to restart the server or just the mission with scripting commands. I want to write a scipt which restarts server/mission when it detects constant low fps but Idk if that is possible.
its a close friend group just need a script for when i cant log in
Ah fair
Is it possible to catch the event of a bullet hitting a surface/ground and its impact position?
And is it possible to calculate how close the bullet flown by a target? Thanks
I was checking these, but I am not sure which one can I use to find the impact point.
hitpart
Oh, now I see, thanks.
Is there any other way to work with the ballistic curve other than via suppressed event or doing some heavy computation on every frame?
Is it at all possible to find the classnames of all vehicles available to a side?
Including modded?
Use configClasses and filter out by side number
When you spawn a unit is the name not randomized?
I'm using ```SQF
_groupTarget = createGroup east;
_target = _groupTarget createUnit ["O_Soldier_unarmed_F", _targetHome, [], 0, "FORM"];
Does anyone knows how to get a list of all βAnimationSourcesβ of any object?
"true" configClasses (configOf cursorTarget >> "AnimationSources") apply {configName _x}
That random naming is flawed, its same seed or seed changes after game restart or something like that
Ok yeah I was just about to say I just saved and reloaded the mission and it changed for the first time in ages.
Is there a way to access the name list for the different races so you can set it yourself?
Its all in the config
Ok sweet thanks as always
// Params: Side
// Returns: String
client_func_killFeed_getRandomNameBySide = {
private _cfg = configFile >> "CfgWorlds" >> "GenericNames" >> (switch(_this) do {
case blufor: {"NATOMen"};
case opfor: {"TakistaniMen"};
case independent: {"GreekMen"};
});
format ["%1 %2", getText selectRandom configProperties [_cfg >> "FirstNames", "true"], getText selectRandom configProperties [_cfg >> "LastNames", "true"]]
};
```Here is a simple function I used to quickly generate names for 3 main sides
You can get an idea from it
I hate this new font for code blocks in Discord π
Oh awesome, thanks for that, it'll save me some work
Thanks king
Anyone have any input on the most reliable way to determine who destroyed a building? Unfortunately it seems entity killed doesn't always trigger
Do you mean Killed entity EH or EntityKilled mission EH?
If first then you need to add event handlers again in https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#BuildingChanged
If you had Killed on alive building and then it got swapped to ruins or damaged version your EHs wont be on it
you'll need to add them again on BuildingChanged
So my current iteration i used entitykilled mission EH and it does trigger but not really consistently, very low trigger chance.
If i use buildingchanged that does trigger every time as desired, but then i don't know who destroyed it
I'm not 100% sure when and hwat triggers but Killed should only trigger on final destruction when building sinks and spawns ruins, I think?
There is https://community.bistudio.com/wiki/getEntityInfo lastEntityCausingDamage, if you're on dev branch maybe you can use that as instigator during BuildingChanged
Alternatively, add HandleDamage and store last source/instigator in a setVariable and then getVariable it when needed
well i imagine a simple killed EH would work fine too... maybe? but i hesitate adding EH to several thousand buildings on the map...
lmk if i shouldnt be
Yeah, adding EHs to lots of buildings doesn't sound like a good idea π€
I guess checking lastEntityCausingDamage inside BuildingChanged wouldn't been perfect for you
Also there is much less heavy EH Hit which should not trigger for every single little thing
i think that should be fine in theory, but i'd have to wait until 2.18 haha. Which if thats the only way so be it.
Other option is if i could run the code from the players end rather than every building
Still you'll have to add it to all buildings everywhere
You want map-placed buildings, right?
yeah
Wild idea, start from shooter side:
- Add
FiredManto all your units. - Add
HitPartandHitExplosionto each fired projectile. - Add
SubmunitionCreatedto each projectile which also addsHitPartandHitExplosionto each new projectile created. - Then on
HitPartandHitExplosioncheck if target is a building withisKindOf,getObjectType, etc. - If its a building, add
HandleDamageto it (check if its not already there). - Since projectile
HitPartandHitExplosiontriggers BEFOREHandleDamage, it might also instantly trigger newly addedHandleDamageand you can properly determine the shooter (and alsosetVariableit)
With HandleDamage you get much finer control over damage, you'd even able to detect when somebody breaks a single window
But also get source/instigator from HandleDamage on BuildingChanged
All in this, this method should work, but there are 3 nuances:
- I did not test step 6, it should work in theory but needs checking if it actually works, can you add
HandleDamagefromHitPartand have it also instantly trigger? - This
HitPart->HandleDamagetrick will only work for map-placed objects (getObjectType = 1) becuase they're local to each client at the same time. For editor-placed/spawned objects (getObjectType = 8) you'll need to haveHandleDamageadded right away for this method to work. - Never change damage of map-placed objects with
HandleDamage, make sure event always returns nil, this damage change is not JIP compatible and desyncs the game
This method is difficult, but if step 6 works, its doable and will cover damage handling of entire map without having to scan whole island and add shitton of EHs
You can trigger FiredMan addition to all units from EntityCreated on server side, check if newly created object is a unit (simulation=man/uavpilot), then broadcast something so all clients and JIPs add their own FiredMan
big brain but many parts to this. I'll have to think on it
But thanks for the idea
(I already do pretty much all this except HandleDamage to buildings btw)
Tested step 6, it works
With this method you can add HandleDamage to buildings that were ever hit
Chat shows FiredMan and subsequent HandleDamage that was added from inside of projectile's HitPart
Code bit to hint all task icons since wiki page doesn't have all listed:
_compose = [];
{
_compose pushBack (composeText [formatText [if(_forEachIndex % 2 == 0) then {"%2 %1"} else {"%1 %2"}
,configName _x
,image getText(_x >> "icon")
]] setAttributes [
"align", if(_forEachIndex % 2 == 0) then {"left"} else {"right"}
]);
if(_forEachIndex % 2 == 1) then {_compose pushBack lineBreak};
} forEach ("true" configClasses (configFile >> "CfgTaskTypes"));
hint composeText _compose;
export script?
I'm trying to create a mod or script that allows you to attach a Map Marker to a person, vehicle, or object and will move the map marker according to the position of that object. My intent for this is such that you can walk up to a vehicle (hostile, friendly, etc), ACE-Interact with said vehicle, and create a marker or attach an item to it, and then edit that marker (either in that menu or on the map after attaching the item) to change its icon, name, and channel.
Does anyone know if this has already been done? If it's possible? And, if so, can anyone help me out or point me in the right direction for how to do something like that?
Hey guys, I'm looking for some script to mark on the map the location of a backpack even when it's being worn or in a vehicle
Is this something that is possible?
not trivially
I would use an addaction and then simply reposition the marker in set intervals, say 5 sec or so. Easy enough with setMarkerPos. For the modification part I can't help you
anyone know why ragdoll mods conflict with ace
i shoot a guy
he is stuck in unconcious pose
even when dead he spins around and stuff
how can i solve this?
wdym man the game ragdoll sucks a lot
i mean yes dont use ragdoll mods
Hi, i have a question ? Is it possible to get the group stance ? because i'm not able to find a command that does like what i'm doing inside the zeus. I mean when you change the stance of the group, all the units inside that group will go in the position you said. Maybe it is doing "setunitpos" for all of them but i'm not sure.
best way is probably to use the take and put event handlers and save a reference to the carrying player that way
or use a unique backpack (unique classname) and keep scanning for that
@faint oasis you could get the group leaders animation instead. That might work.
it's what i did actually, i'm using "unitpos" on the leader to get the pos but when i need to change the stance of everyone, i need to foreach all units inside the group otherwise, even if the leader is set to "DOWN" for example, the remaining units will stay in their pos
Quick question, I have a feeling the answer is yes.
Is it bad that I'm using this many remoteExecs for a script from the server?
if (AET_inRange) then {
deleteVehicle CNSL_1;
CNSL_2 hideObjectGlobal false;
["Layer_Elevator_Background", ["", "BLACK OUT", -1, true, false]] remoteExec ["cutText", -2];
[0, 0] remoteExec ["fadeRadio", -2];
[0, 0] remoteExec ["fadeSound", -2];
[] spawn {
sleep 5;
["Layer_Elevator_Text", ["<t size='2'>Demons, Monsters. One way Ticket.</t>", "PLAIN", 5, true, true]] remoteExec ["cutText", -2];
["elevator"] remoteExec ["cutText", -2]
private _tplist = ["P_1", "P_2", "P_3", "P_4", "P_5", "P_6", "P_7", "P_8", "P_9", "P_10"] call HR_fnc_ValidateObjects;
private _poslist = [PTP_1, PTP_2, PTP_3, PTP_4, PTP_5, PTP_6, PTP_7, PTP_8, PTP_9, PTP_10];
private _playerCount = count _tplist;
for "_i" from 0 to _playerCount do {
private _currentPlayer = _tplist select _i;
private _currentPos = _poslist select _i;
_currentPlayer setPos (getPos _currentPos vectorAdd [0, 0, 0]);
};
sleep 20;
["Layer_Elevator_Background", 5] remoteExec ["cutFadeout", -2];
["Layer_Elevator_Text", 1] remoteExec ["cutFadeout", -2];
["dynamicBlur", true] remoteExec ["ppEffectEnable", -2];
["dynamicBlur", [6]] remoteExec ["ppEffectAdjust", -2];
["dynamicBlur", 0] remoteExec ["ppEffectCommit", -2];
["dynamicBlur", [0.0]] remoteExec ["ppEffectAdjust", -2];
["dynamicBlur", 5] remoteExec ["ppEffectCommit", -2];
[5, 1] remoteExec ["fadeRadio", -2];
[5, 1] remoteExec ["fadeSound", -2];
sleep 5;
[missionNamespace, "AET_ElevatorDone", []] call BIS_fnc_callScriptedEventHandler;
};
[missionNamespace, "AET_ElevatorDone", {["dynamicBlur", false] remoteExec [ppEffectEnable, -2];}] call BIS_fnc_addScriptedEventHandler;
} else {
["All players must be on the elevator!"] remoteExec ["hint", -2];
};
Normal vanilla ragdolls look fine bar the twitching when shot aspect. However most,not just ACE revive system will not work with any ragdolls mod,including things like TPW FALL
Revive mods add their own handling of animation
obviously will conflict
Yeah, I thought that it wouldn't be a trivial thing :/
It would be better to put everything that has to be run locally into a function, and then remoteExec that function, rather than doing all the remoteExecs one by one
turn this into a function and then remote execute the function. do this for any ui/sound/particle effects stuff
Alrighty, my main issue would be making sure the player teleportation does not start until the desclaimer has kicked in, I can prob add a check for that.
Hmm.
Just make the teleport operate locally too. No particular reason it has to be server side.
Generate the list of players in the TP zone on the server as before, then use that array as the remoteExec target parameter for the function, instead of -2. Then you can use player in the local function to teleport the appropriate players.
Hmm, that could work yea, only thing left would be how to make sure each player ends up with their designated PTP (the specific position they need to be teleported to).
1 min
Couple of small items:
- it's recommended to use the ATL/ASL versions of setPos and getPos, not the "plain" ones. They are faster and have consistent position formats with no loss in translation.
- you're doing
vectorAdd [0, 0, 0]on a position, which is genuinely completely pointless.
Noted, thanks
If you have a moment to give me your opinion it would be appreciated :D
Initial Script to be called from action
if (AET_inRange) then {
deleteVehicle CNSL_1;
CNSL_2 hideObjectGlobal false;
[] spawn {
private _tplist = ["P_1", "P_2", "P_3", "P_4", "P_5", "P_6", "P_7", "P_8", "P_9", "P_10"] call HR_fnc_ValidateObjects;
["Layer_Elevator_Background", ["", "BLACK OUT", -1, true, false]] remoteExec ["cutText", _tplist];
sleep 5;
["Scripts\elevatorscreen.sqf"] remoteExec ["BIS_fnc_execVM", _tplist];
private _poslist = [PTP_1, PTP_2, PTP_3, PTP_4, PTP_5, PTP_6, PTP_7, PTP_8, PTP_9, PTP_10];
private _playerCount = count _tplist;
for "_i" from 0 to (_playerCount - 1) do {
private _currentPlayer = _tplist select _i;
private _currentPos = _poslist select _i;
_currentPlayer setPosATL (getPosATL _currentPos);
};
};
} else {
["All players must be on the elevator!"] remoteExec ["hint", -2];
};
The effects and Transition script:
if (hasInterface) then {
[] spawn {
0 fadeRadio 0;
0 fadeSound 0;
sleep 5;
"Layer_Elevator_Text" cutText ["<t size='2'>Demons, Monsters. One way Ticket.</t>", "PLAIN", 5, true, true];
playSound "elevator";
sleep 20;
"Layer_Elevator_Background" cutFadeout 5;
"Layer_Elevator_Text" cutFadeout 1;
"dynamicBlur" ppEffectEnable true;
"dynamicBlur" ppEffectAdjust [6];
"dynamicBlur" ppEffectCommit 0;
"dynamicBlur" ppEffectAdjust [0.0];
"dynamicBlur" ppEffectCommit 5;
5 fadeSound 1;
5 fadeRadio 1;
sleep 5;
[missionNamespace, "AET_ElevatorDone", []] call BIS_fnc_callScriptedEventHandler;
};
[missionNamespace, "AET_ElevatorDone", {"dynamicBlur" ppEffectEnable false;}] call BIS_fnc_addScriptedEventHandler;
};
What should it export? Class names and file paths?
is there any possible way that you can add a repair function(exactly like is on the Huron repair container) to any random supply crate/box? in my scenario, iv just discovered the Mowhawk isnt able to sling load the huron repair crate,so i was hoping it could be as simple as adding the hurons repair functionality to a smaller crate in the editor
for vanilla functionality, you have to create the config property transportRepair aka, making a mod
honestly i thought it would be simpler. not to worry the mowhawk can carry a Taru repair pod
il retexture it
damn it
seems AI of NATO wont use an East side repair pod
odd as the player automatically repairs at it
i would think thats an oversight by bohemia. why is independant out of options to slingload vital supplies?
if possible yes
Actually i just found another bug regarding Resupply crates. before i make a ticket,could you or anyone more knowledgable help me identify it as an actual bug?
so it seems that resupply crates(NATO vehicle ammo) if having its simulation disabled at mission start/hidden then shown,then simulation enables/shown , looses its ability for AI to rearm at
im not sure if this is somehow engine limitation,intentional or actual bug
this issue isnt present on repair / resupply vehicles by contrast
mod or mission @marsh storm
Mission, @spiral trench
pardon me, my head is spinning from the damn AI today. infact,the error i described is innacurate, the actual issue isnt that the ressuply crate doesnt work,its simply that the AI wont recognise it after simulating. im using the show/hide module which visibly hides the object and makes invisible and disables its simulation, so ,at mission start have it hidden,then it shows via a condition,reenabling its simulation. But evidently because it wasnt available at mission start AI doesnt seem to recognise it anymore
id still call it a bug, but considering typical AI and AI vehicle behaviour..id say par for the course
so since its hidden at start due to the module firing before the mission simulation starts, can you try hiding it a frame or two later? then see when you show it again if the AI pick it up?
i believe once you hide it,then show it,it cant be hidden again
was the case before but good point, il try now
ahhh good enough, your right it can work that way
few years ago for whatever reason that was not working,but it seems you can now swing back and forth with those modules and conditions
general performance question. is using attachto,with triggers heavy on the cpu?
Is it just one backpack to be tracked? So say the backpack starts on the ground at mission start, it is shown on the map. If a player were to pick up said backpack the marker would now update as the player moves, again if they were to then place it in a vehicle the marker would update?
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
iv got:
{if(_x iskindof"car") then {_x setfuel 1;
_x setvehicleArmor 1; _x setvehicleAmmo 1;};} foreach thislist;
{if(_x iskindof"tank") then {_x setfuel 1;
_x setvehicleArmor 1; _x setvehicleAmmo 1;};} foreach thislist;
[west,"HQ"] sidechat "Vic Resupplied" ;
and
resup3 attachTo [this, [0,0,0]];
resup is a crate, il need to have many of them. they have multiple repeating triggers attached to them
trigger area 25x25
yeah I even made a note for myself earlier for simulation issues in regards to something similar. that's what promted me to ask if you delayed it
not sure I'm following what you are doing
i have in the scenario a need to slingload many resupply crates for friendly AI vehicles to use. issue is,the AI behaviour around those crates is bad. normally if they rearm or refuel with a truck,its a two part system where the AI truck/logi driver moves to support,and the vic needing support also moves..well crates have no drivers and i think its what causes AI vehicles needing resupply to bug out with crates... to get around this, iv created a tigger to detect the vehicles within its radius,and as on activation above,set the vics to refuel,repair,rearm.
The idea is a player will slingload these crates(with the triggers attached to them) to the vehicles in question. dropping them,making the vic in need be in trigger area,and forcing the on activation(ressuply)
you are starting to enter the zone of not using triggers and starting to do everything in code.
i thought about that but its not a very linear script based scenario, its very dynamic.
hence why code is better
positions,units,all that can be random
iv been looking for weeks now for a coded way to do this: tell me if its possible: player flies helo,activates some kind of add action to pick up the nearest friendly AI group,and has another add action to disembark them without affecting their current waypoint system. stuff like that even possible?
believe me iv been reading up alot lately,its so complex,so iv stuck with editor and used scripts as much as im knowledgable in it which isnt much
yes. involves finding the nearest AI group the heli upon activation, gathering their waypoints, inserting a get in waypoint behind the current active waypoint. you can then track the heli, find out when it lands, insert a get out waypoint behind the current active, then it resumes
addWaypoint allows you to insert a waypoint at a given index of existing waypoints
i didnt even know i could insert dynamically
heres a wp systm thats run per zone(AO, which is a marker,which moves as mission progresses) . your saying i could dynamically say through an addaction,when near a group(any group) cause them to enter helo,then exit later on an acction?
randomPoint= selectRandom ["AO", "AO"];
{ deleteWaypoint _x } forEachReversed waypoints Alpha1;
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "GETOUT";
_wp setWaypointSpeed "NORMAL";
Alpha1 setBehaviour "Aware";
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "SAD";
_wp setWaypointTimeout [60, 90, 120];
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "SAD";
_wp setWaypointTimeout [60, 90, 120];
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "SAD";
_wp setWaypointTimeout [60, 90, 120];
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "CYCLE";
and continue this abov syntax?
yes. it will take a while to write you an example
i mean this is great, youve given me the conditions to go off,and it makes more sense to me now
chances are whatever i throw together wont work,usually learning code here is a bit of this and that then trying to combine. actually understanding takes so long. But when u do understand it it really opens up the things you can do
thanks for all the examples,if you do manage to write an example id love to read it and go over it in the steps youve mentioned
clean this up and make it expandable to any group:
private _buildWaypoints = {
params ["_group"];
private _getRandomPointPos = {
private _randomPoint = selectRandom ["AO1", "AO2"];
AGLToASL (_randomPoint call BIS_fnc_randomPosTrigger);
};
// SAD
for "_i" from 1 to 3 do {
private _pos = call _getRandomPointPos;
private _type = "SAD";
private _wp = _group addWaypoint [_pos, -1];
_wp setWaypointType _type;
};
// Cycle
private _pos = call _getRandomPointPos;
private _wp = _group addWaypoint [_pos, -1];
_wp setWaypointType "CYCLE";
};
[Alpha1 /*add more groups to this array if you want*/] call _buildWaypoints;
cheers, i was recently looking at this way to get the wp's and condense the code. the syntax is run after a Platoon embarks so il edit your code here and add the get out wp before the SAD
Try lowing its weight?
setMass something
i did it didnt work
didnt try to set the mass though wasnt aware i could
wow. yes this did work
sometimes its the simplest way to do things.
unfortunately the AI behaviour is terrible with them completing rearming orders on crates,they get stuck for silly reasons if more than one vic goes for same crate.
Ideally several backpacks. Backpacks start on ground. So far I have a VM sqf that follows the backpack while worn if the bearer is on foot but any time the wearer gets in a vehicle or puts the bag in a vehicle the marker stops updating. If they get out again, the marker reupdates
I want the marker to track the location of the bag regardless of where it is
is there a way to get any inventory classname? conifg viewer doesnt give me all the info i need
What inventory classname you mean?
for inventory classnames of mods\addons. example: survival items like beans\water bottles\shovel. items that i can pick to keep in my inventory in game. i need their classnames so i can random spawn them around the map
Does anyone know how to simply create a array from a string? I know sounds simple but my problem here is that a command like parseSimpleArray does not work due to it requiring to be a type for the elements to work. Here to make it more easy to understand:
I want:
"[Carter, Carter_Tactical], [Medrano, Medrano_Tactical]"
to this:
["Carter", "Carter_Tactical"], ["Medrano", "Medrano_Tactical"]
If I would use parseSimpleArray it puts out a error cause the elements are not in a 'here'. I especially do not want to do that cause it would be more easy for users to mess something up. (it's a edit box in cba) My Idea was it to simply make the string into an array and then for each element use str to make it a string so I can use it in a function without a users need to input ' into the actual entry in settings.
So any Idea how I can simply remove the "" from this string?
Why is it so hard to find an inventory classname, to make it simple, you can easily find weapons classnames when u hover the mouse over them, but doesnt work with inventory items. And the funny thing most of them are not in the config viewer! Then where are they? Somewhere in the void? XD
getUnitLoadout is one way
cheers, that gives me something to work with
Use this:
private _items = str (items player);
systemChat _items;
copyToClipboard _items;
cant be more simple, many thanks!!!
I'm confused. Parse simple array works just fine for your example
it only works if you put the entries in ''
In case you where gonna point out that it only works in one big array with sub arrays.
Ah I see your issue
Why not just search the string for open/close brackets and commas and put in ' as necessary?
Every time you find a open bracket [ add a '
If you find a , then make it a ','
Etc
People have definitely solved this parsing issue,I recall some mods doing as you want...but I don't know any more sophisticated solutions. Good luck!
I guess regular expressions are an option if you want to do it the fancy way https://community.bistudio.com/wiki/Arma_3:_Regular_Expressions
for anyone intrested in thos convo, I figured out a way that works:
private _string = "[Carter, Carter_Tactical], [Medrano, Medrano_Tactical]" ;
private _array = _string call CBA_fnc_removeWhitespace;
//systemChat (str _array);
_array = [_array, "[", "['"] call CBA_fnc_replace;
_array = [_array, ",", "','"] call CBA_fnc_replace;
_array = [_array, "]", "']"] call CBA_fnc_replace;
_array = [_array, "]','[", "],["] call CBA_fnc_replace;
_array = "[" + _array + "]";
//systemChat (str _array);
_array = parseSimpleArray _array;
//systemChat (str _array);
@manic kettle @tender fossil Thanks for the help. <3
Hello,
I'm trying to integrate the functionality of ACE Arsenal into the Supply Drop Module's(virtual) supply box so that players can open ACE Arsenal when calling for support in the game. I've tried the following solutions to put into the Init Box, but it still doesn't work:
_this addAction ["Open ACE Arsenal", {["Open",true] spawn ace_arsenal_fnc_openMenu}];
_this addAction ["Open ACE Arsenal", {["Open",true] spawn ace_arsenal_open}];
_this addAction ["Open ACE Arsenal", {["Open",true] call ace_arsenal_fnc_openBox}];
Does anyone know how I can adjust this? Any tips would be greatly appreciated. Thank you.
For that example you can just do this:
parseSimpleArray (_str regexReplace ["(\w+)", """$1"""])
You can also make it more advanced to detect if something is already quoted
In init boxes you should use this instead of _this (also I'm not sure if you're talking about the module's init box or if the module has an init box for the supply drop; I'm assuming the latter; the former won't do what you intend)
Not gonna lie I'd really like to use this but I don't understand anything you did there. regex is hella confusing even with the documentation.
I mean I could use it yes, but in the end it sucks when you don't understand code that you are using. Speaking from experiance here. π
\w+ means find a word (bunch of letters next to each other, including digits and _)
(\w+) means find a word, and capture it (which becomes capture group 1)
"""$1""" is captured group 1 wrapped in quotes. (Which is already a string so I put double double quotes in there; it's really just "$1")
It's a very basic regex
I entered it here.
Ah ok. So try replacing _this with this
Hmm that makes sense, thanks for the explanation.
It could be a lot of things on its own, but I see from your code that you have an array that goes [350, ], which is wrong and probably causing it
It was my mistake, I managed to resolve it.
There any way to pass a variable reference to a function?
In my case, I want to be passing a scalar to a function, that then adds one to the scalar, modifying the original value. I feel I'll probably need to pass an object that holds the scalar, but I'm not sure what would be the best one to pass. An array? A hashmap? A vehicle?
pass a variable reference to a function?
all variables are passed by reference in SQF
but you can't modify all types by reference (also depends if the command returns a copy or modifies by ref, e.g. append vs +)
Huh, weird
Passing in an array or hashmap is fine.
one way I was doing it before was using an array
(the downside is you always have to use _arr#0 to use your number, but it's the fastest option among hashmap/obj/loc/array)
Wait, so I can use _arr#0 = _newvalue to set a new value? Or would _arr set [0, _newvalue] be preferable? I was under the impression that select and # just returned a copy of the value, not a reference to it
set. the former is not valid SQF syntax
select and # just returned a copy of the value
they return references
Right, figured as much, thanks!
Any way i can have game master/zeus available in my mission but stop people from using/having the annoying ass zeus ping?
Pass a string of variable name and then get value using 'missionNamespace getVariable'
intercept can be easily used for hacking, so why woudn't BI prevent its functionality?
Does playMove requires remote exec to work like in switchMove? They have efect global but switchMove need to do remoteexec
Both of them are Local Argument, which means they must be executed where the unit in question is local. You may need remoteExec to accomplish this.
switchMove does not require remoteExec to work. If you read the note on its wiki page, it says that doing it with only correct locality simply means the effect on remote machines won't necessarily be instant. In some cases, this is fine.
Adding more maps is more of a #server_admins question.
You can change AI accuracy through the server-level Skill and Precision difficulty config (https://community.bistudio.com/wiki/server.armaprofile#Arma_3) or by using the setSkill script command to apply more specific values to AI units. (If you're making your own missions, you can also change the skill of the AI units you place in their Editor Attributes.)
ah thanks man
CONFIG select NUMBER produced weird error message
To be honest I wish it wasn't producing any, other config commands simply return null config without any errors
configFile >> "ThisDoesNotExist" => <NULL-config>
Selecting one after last array element ([] select 0) doesn't produce any errors and just returns nil
Sure configs are not really arrays, but maybe that error message could be adjusted
Hi, is there a script to enable and disable third person for all players at different times, outside of difficulty?
Hello, I would like to ask more experienced people how to do the following:
I would like to implement one thing, but there is only one thing stopping me, when writing cursorObject on terrein objects they give the following limestone_01_02_lc_f.p3d, if you write typeOf before it they give an empty line without object class and I really want to understand how to get the object class knowing its p3d, but I couldn't figure out how to use configFile >> (if of course you need to do it through it), help anyone who is not difficult! (I don't want to do it through nearest, I want to try it this way first).
There is no solution to this.
Not all terrain objects have classes at all. They can be a model that only exists in the terrain and has absolutely no representation in config. And even for objects where there is a class with that model but the terrain object instance doesn't have that info, it's difficult to try to reverse-associate the model to a class, because multiple classes could use that model.
Also, what exactly you want to achieve by trying to fetch it?
I was thinking of trying to implement a telekinesis system, but one that could grab almost any object and move it or even throw it.
So basically hide the terrain object and spawn one, do something with it?
Yeah, that's right.
Then you don't need a className anyways. createSimpleObject is the way to go. It is not going to have a physics anyways
Thank you.
Very much depends on what you really want. In general, check each frame if they're in third person, if they are, switch them back to previous view if they aren't allowed to be in third person
looks like LA / GE damit, just wasted time lol
Code snippet to cut out crap out of object names:
trim(_this regexReplace ["(\[.*\]|\(.*\))", ""] regexReplace ["\s+", " "])
Stack of Planks (Pine, Unfinished) [v2] Blabla => Stack of Planks Blabla
\((.*?)\), no ?
(if .*? is supported, ofc)
"Stack of Planks (Pine, Unfinished) [v2] Blabla" regexReplace ["\((.*?)\)", ""] => "Stack of Planks [v2] Blabla"
"\((.*?)\)|\[(.*?)\]"?
yuss
your version would kill what's between two parenthese groups I believe
e.g in abc (123) mno (456) xyz
(.*? = ungreedy version, stop at first)
I understand, it would be for specific moments, such as when they are inside buildings, helicopters and airplanes, the third person is deactivated.
some example?
Check wiki for cameraView, switchCamera
Thanks for the variable.
These are commands
Tested it, ungreedy version produces better result when there is a mess with parentheses
Right, thanks.
"Stack of Planks (Pine, Unfinished) [ 111 (] 222 [) 333 ] [v2] Blabla" call {trim(_this regexReplace ["(\[.*?\]|\(.*?\))", ""] regexReplace ["\s+", " "])}
``` => `"Stack of Planks 222 Blabla"`
```sqf
"Stack of Planks (Pine, Unfinished) [ 111 (] 222 [) 333 ] [v2] Blabla" call {trim(_this regexReplace ["(\[.*\]|\(.*\))", ""] regexReplace ["\s+", " "])}
``` => `"Stack of Planks 333 ] Blabla"`
I am even surprised that 333 survives here
I would have assumed that it would take from [ 111 to v2], but maybe it is confused due to (] 222 [) inside
Intercept is supposed to run inside Battleye, and everything that plugs into it will as well
i'm bad at maths...what would be a good way to make something (in this case, a camera) move in a figure of 8 pattern?
Hey guys. Is there any way to make the AI patrol and on each waypoint completion, they go in into a random near building then move to the next waypoint? Without being stuck, clipping into building and all of the subordinate AI not lagging behind doing this.
So in my current script, they sometimes just stuck in the building, BUT they are completing the patrol waypoints for some reason (they are not even close).
What I do is basically to add the waypoints with the setWaypointStatements, which calling a script on completion which does a commandmove on each unit for a random near building at random building positions.
Where can I find the list of waypoints other then Waypoints [on bi wiki] I'm looking for something like Get In Nearest.
Get In Nearest is a thing all the time...?
I'm trying to get a spawned group in a helicopter with something like:
{
_x action ["GetIn", kulen1];
private _wp = group _x addWaypoint [getPos helipad1, 0];
_wp setWaypointType "GetIn";
_wp setWaypointBehaviour "AWARE";
} forEach units _squad1;
hint "Crew coming";
And I can't get this to work
Is it just me, or is there no bus in vanilla Arma?
No, Arma 3 has none of such bigger civilian car
sigh
So Arma gets the same trouble every "big" game has. Memory hooking vs cheat protection. I dont know any cheat protection which wins that battle :(
how on earth do i play an already existing sound from CfgSounds?
@lunar mountain
that is possible but not without scripting
I would need to put in a lot of failsafes, right? :D
Hi there, I'm trying to make map markers local only (nobody but marker creator can see it). I found that this can be done with local markers, but to make it work I need to override vanilla marker creation dialog from global marker to local (or create my own). Help me find an entry point to this, please. I'm new to arma scripting and I'm a bit lost in it's structure.
I mean, if I setpos them out of the stuck position, they continue the patrol. The funny thing is that they get stuck in the building even with a simple Seek and destroy WP :D
You could use a markerCreated mission EH and deleteMarkerLocal to intercept markers being created by remote players
hey, how would i go about fixing this? heres my code:
class USMC
{
id = 0;
idType = 0;
side = "West";
size = "Corps";
type = "HQ";
commander = "Armstrong";
commanderRank = "General";
text = "United States Marine Corps";
textShort = "USMC";
texture = __EVAL(getMissionPath "images\usmc.paa");
};
the image itself looks like this
i gotta go out somewhere for about 30 or so mins so ping me and ill reply when im back o7
I tried this way and it doesn't work properly. It either deletes your markers too, or it just doesn't delete any markers. (I changed deleteMarker to local)
https://www.reddit.com/r/armadev/comments/mkvj90/disable_map_drawing_channels/
Post your code
- Improperly converted to PAA (use command line
pal2paceinstead ofTexView2) - Looks like ORBAT requires flags to be square
You need to use the information provided by the EH (specifically the _local parameter) to determine where the marker is coming from and act accordingly. If you don't, then yes it will delete all markers.
addMissionEventHandler ["MarkerCreated", {
params ["_marker", "_channelNumber", "_owner", "_local"];
if _local exitWith{}; // don't delete your own markers
if (isNull _owner) exitWith{}; // don't delete script-created markers
deleteMarkerLocal _marker;
}];```
move, buildingPos and a ton of other commands will be your friend on this journey
I also tired !(isPlayer _owner)
// File: initServer.sqf
addMissionEventHandler ["MarkerCreated",
{
params ["_marker", "_channelNumber", "_owner", "_local"];
if
(
!_local &&
{ isPlayer _owner } &&
{ _channelNumber in [0,1] }
)
then
{
deleteMarkerLocal _marker;
};
}];
Move it into initPlayerLocal or whatever it is called
Hmm, I guess this wont work for JIPs
Gonna need to walk through existing markers on join and locally delete them
initServer.sqf is the wrong place to do this, because all player-created markers will be not local to the server, and also deleteMarkerLocal is then only operating on the server. Server handling is acceptable for global channel filtering (though probably should be handled locally anyway to improve response time) but it doesn't have the information needed to do player-specific filtering.
make sure the image size is power of two
I used gruppe adlers online paa converter.
Try TexView2 from official tools
I believe it is but ill check when im home
Got it
Will do
Ok, thank you, I'll test it when I'll have someone to test with
Any particular reason why not the Image2PAA tool?
Isn't it just a wrapper for it?
It looks quite different to me but π€·
Not sure about it being a wrapper, just basing off ImageToPAA mentioning it
use pal2pace
im not sure what that is sorry
commandline app from arma 3 tools
so, how do i use that?
Arma 3 Tools directory, TexView2 and its there
C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\TexView2
ah found it, thanks
and how do i use pal2pace?
Open console, pal2pace "your_file.png"
got it
Change directory to where the file is
it is,
its your users directory
yea?
there is no pal2pace in it, cd to TexView 2 directory
Or specify full path to file
i have no clue what that means
cd C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\TexView2
got it
Oh actually pal2pace works with drag&drop, so you can just do that
ah, so drag and drop where?
find where arma 3 tools are and check there
cd did nothing
agh whatever theres too much faffing around for this to be worthwhile lol. ill just have some generic like HQ symbol instead
That path was my local path, you need to use yours
But you can just open TexView2 in file explorer and drag your png into pal2pace
The path they used is correct. The problem is that cd doesn't, by default, let you switch directly to another drive like that. You need the /d argument as well. (and possibly quotes because the path has spaces in it, but not totally sure on that)
i did and it still didnt work
Nevermind the console, just drag and drop your PNG into the exe
Β―_(γ)_/Β―
its whatever im just going to use this now
ah, how would i make it 24bit?
Check save settings with whatever software you save it with
i literally just downloaded it from the arma wiki lol
You'll need to re-save it as 24bit PNG
MS Paint always saves as 24 bit PNG it seems
I was just checking that, neat π
Honestly your original conversion method will probably now work too
Oh yeah, didn't notice the D:
that's what she said :(
still broken 
idk why its turning blue
but maybe the orbat viewer only allows 1:1?
If you haven't restarted the game since the last time you tried with the original broken file, do that
Arma caches assets and won't refresh the loaded copy if you replace it with the same name
righty, lemme restart then
Is there a way to use remoteExecCall or remoteExec using the player's session ID? I have the following on a server-side request, like this:
["BSF_AssetManagement_Dialog"] remoteExecCall ["createDialog", _sessionID];
There's no response in this configuration. The session ID is correct as I use it in the same script to trigger response scripts on the client. So I assume that session IDs can't be used in this way. If I pass the player's netID to the server request, I can use objectFromNetId and send the message like this:
params ["_sessionID", "_data"];
_data params ["_vehObject", "_playerNetID"];
_playerObj = objectFromNetID _playerNetID;
["BSF_AssetManagement_Dialog"] remoteExecCall ["createDialog", _playerObj];
This works fine but is a bit clunky IMO. Can an object or netID be retrieved from the session ID?
yea restarting still didnt work. ima just use a different image. a 1:1 ratio image thats all black lol
It might be ORBAT modifying the colors
potentially, i just wouldnt know why or how to change it
Try in game in debug console:
hint composeText [" ", image "images\usmc.paa" setAttributes ["size", "5"]];
What's a session ID? You mean this thing? https://community.bistudio.com/wiki/getPlayerID
Bad idea to use it for client identification, use owner instead, you have is inside all client event handlers
Otherwise you can build id-owner hashmap on the server and broadcast it with each client change
this works better imo. just gotta figure out how to scale it down a little bit now lmao
i am from Gruppe Adler, if you found a bug pls create an issue at paa.gruppe-adler.de github and provide the file in question. If the source is not convertable we should show this in the interface.
i dont think its an issue with the converter, more so the ORBAT viewer lol
alright, didnt follow all messages π
is there a simple and nift way to convert a string in a script to a variable? Like, I add pices together with joinString, but I need the result to be used as a variable. Some neat magic here, or is it a 50 line script?
If you mean global var, you can use setVariable/getVariable
But you usually don't need to create var names (reading is ok tho). If you do you're typically going about it wrong
it's more like I'm trying to make flexible scripts....
I just meant as a rule of thumb. If you know what you're doing it's all good
private _loc = selectRandom [pat1,pat2,pat3,pat4,pat5,pat6];
private _tgt = position _loc;
private _obj = [_loc,"tgt"] joinString "_";
// I want that o be something like
private _act = selectRandom [1,2,3,4,5,6......etc];
private _loc = ["pat",_act] joinString "";
private _obj = [_loc,"tgt"] joinString "_";
private _tgt = position _obj;
// and so on as needed
I have 3+ points that make up one site, and they're all called the same except the number. pat1, pat1_tgt and they are all referenced to invisible H's on the map. I want the one script to dynamically select one of the sites, and so also get the proper positions, also, this would make the script versatile and easy to adapt to all kinds of maps.
Therefor, I'm thining to bild strings, but then need to convert them into variables.
Not sure I make any sense....
Or maybe I'm reinventing the wheel?
You can probably do this all with one format in a much more compact way
private _varName = format ["pat%1_tgt",_act];```
Neat! But won't that still be a string?
don't i need like a call compile or something?
It will still be a string. You then use getVariable, which takes a string and uses that to look for a variable by that name.
Maybe then check for both conditions using conditional operator "OR" with lazy evaluation.
Put the rarest condition to be evaluated last so that the majority of the time evaluation stops at the first and most common.
Something like:
if (!isNull objectParent _shooter || { ((vehicle _shooter) isEqualTo _shooter) }) then {};
I know I'm not actually giving you a proper answer but a workaround, which may be not optimal. That's just what I can come up from my phone π«£
Thankyou, that is the direction I took and it solved all issues π
It works, thank you.
But I'm a bit confused. If marker is sent via network and added with script, what is stored in creator? Player, client ID, null or whatever else?
Hello everyone, I would like to modify a mod but I don't know how to do it and I don't have any experience in coding..
https://community.bistudio.com/wiki/createMarker
https://community.bistudio.com/wiki/Arma_3:_Mission_Event_Handlers#MarkerCreated
The marker creator is either a player object (if it was created by a player or a creator was assigned in createMarker) or objNull (if no creator was assigned in createMarker, and presumably if the player object no longer exists)
That's why my example used isNull to check if it was a script-created marker.
There any way to, in one line only, get terrain objects based on their model? For example, finding all t_OleaE1s_F.p3d near the player. I know I can just get all objects and filter out ones that have a different model, but I need to do this in a holdAction, so it has to be one line only. Could make a function, I guess.. but do I have to, is the question? Or is there a built-in solution for this?
Nvm made a function for it
Thank you for explanation.
Nothing in addAction or holdActionAdd requires to do in one line. As long as you don't break a line within something crucial, it should work
Say I synced a couple of units to a game logic. How would I access the units from the game logic?
synchronizedObjects, I think
That command somewhat broken (or working intended but) even if you sync in Eden sometimes it doesn't even detect it in game
how the hell do modules work if it sometimes doesn't work?
Depends on the module and setup
How would one create a map marker that is like Air Control where it displays the supplies at that location. Just the display mechanism for onMapSingleClick resupplyPoint (marker name).
modules can be local, global, persistent. within the guts of the module is usually a function call. that function determines its functionality. many of the vanilla modules were created before 3den, so they also don't have functionality in 3den itself
do we have an engine getter for muzzles?
currentMuzzle, weaponState, and weaponsInfo, depending on what you want
Check #reaction_forces pinned functions
thank you!
I haven't heard any feedback about it, although it's very made for AC specifically but it can do much than showing something. Let me know if it's good or bad
Guys, is there a way to have the "scroll wheel" action menu permanently open (even if it currently has no action to show)?. I don't care if I has on a while loop
In other words it should be like if the player is constantly moving his mouse's scroll wheel
Are there any props that have attributes to enter a number and it appear on a screen, Similar to the progress slider on the rugged terminal
had a question about "isTouchingGround" . if i have it as a condition for a group,and the group to be touching ground.is embarked in a helo that has landed,are they considered as touching ground therefor satisfying the condition or do they need to get out of the helo and physically touch the ground?
Just a guess here, you may not be able to do this, but if you could get the helo maybe you could do isTouchingGround on it (may not work Iβm still a script noob)
embarked as passengers i might add
i dont want the helos con to be touching ground though,just the groups
description only says :"Returns true if object is touching the ground". i assume the con is satisfied in that case,just wana double check
Is there a way to have ai target civillian players? I've searched Google and found nothing
use setside
Hey redarmy
Make a small trigger box that will only be satisfied when SIDE is present
But make the Z small
And that could work
If you want to do it fully scripted, idk
Well looking for something I can use in a AI's int field
from editor? there might be modules that set side, but a trigger is probably safest bet. from the init it should happen at mission start
you want it to happen later right?
actually im unsure about set side its something different
if (local this) then {
this addRating -1e6
};
severe negative ratings cause all AI to attack the unit, no matter what side
to find if a group is fully disembarked:
units _group findIf {alive _x && (_x in _vehicle)} == -1;
embarked:
units _group findIf {alive _x && !(_x in _vehicle)} == -1;
What if I just want to make civilian hostile to one faction only?
you make the civilian join a hostile group
Okay, because I couldn't get this to work
resistance setFriend [civilian, 0];
civilian setFriend [resistance, 0];
you want the unit to be targeted by independents? what sides are currently hostile to independents?
@devout geode actually, since I'm going to bed, I'll write you something generic. Just use this and change the value of _makeHostileTo to the side you want the civilian to be an enemy of:
// civilian unit init box
// make a single civilian unit hostile to a given side
if (isServer) then {
private _makeHostileTo = independent;
private _hostileSides = (_makeHostileTo call BIS_fnc_enemySides) - [sideEnemy];
private _group = createGroup [selectRandom _hostileSides, true];
[this] joinSilent _group;
};
This extension keeps crashing arma 3 https://gist.github.com/Benargee/06d8b9800536a1fa85b9#file-flash-r-led-key-cpp-L31 with Arma 3 error message: "buffer overrun detected"
It's using a special library so I don't know if anyone can spot anything obvious here. Even without using <thread> I have issues.
Has anyone had that message before when developing extensions?
a trigger that remote executes for trigger activators and only for the trigger activators any clue how I can go about doing that
it shows a text on screen "Get back to Mission Area"
this what Im doing
_code = {
private _player = _this select 0; // Get the player who triggered the code
hint "Get back to Mission Area"; // Display the message to the player
};
_triggers = [border_1, border_2, border_3, border_4];
{
_x addEventHandler ["Activation", {[_this select 0, _code] remoteExec ["call", 0, true];}];
} forEach _triggers;
this is what I did for now in the init.sqf
maybe you could simple use condition "this && vehicle player in thisList" rather than your so called ( addEventHandler ["Activation" ) ... unedit your comment π€
im a bit lazy pls provide additional context ;-;
also hello lou I see you lurking in here
also @harsh vine making a zeus template so was hoping this works but its not working I tried diffrent appraoches none worked
thus finally here
- _code is a local func so if you are gonna try to call that fnc from a EH it wont work becouse of the scope.
- Activation EH dosent exist so i dont know how you got that.
- If you are remoteExec then call you can just use remoteExecCall command.
- And if you just want to warn player to get back to playable area its been done x amount of times simple google search you could found the resoult but here is one for you:
https://forums.bohemia.net/forums/topic/202380-solvedmp-if-players-leaves-area-kill-them/?tab=comments#comment-3156787 - Dont use ChatGPT for coding.
Hey everyone, I have a trigger 20 x 20 that acts as an area where the players are restricted to stay inside (Note players as it is for multiple playable units). The intention is to check if any of the players on lets say Independent team leave the area, then kill that specific player who left the...
Dont use ChatGPT for coding.
yeah i do that when im stuck in something for functions but thanksies
And if you just want to warn player to get back to playable area its been done x amount of times simple google search you could found the resoult but here is one for you:
https://forums.bohemia.net/forums/topic/202380-solvedmp-if-players-leaves-area-kill-them/?tab=comments#comment-3156787
yeah I this one did not show up for me thanksies (2)
also legion thanks for that
thanks man i was actually just thinking my touching ground way would suffice,but im trying both your way and my way and in this syntax the condition is being met before all conditions are met:
units _group findIf {alive _x && (_x in _vehicle)} == -1 && (triggeractivated auto1 or triggeractivated manual1)
basically when either trigger manual1 or auto1 fire, the condition completes as is shown by a hint
seemingly ignoring your synatx and my other one
units Alpha2 findIf {!isTouchingGround _x} isEqualTo -1 && (triggeractivated auto1 or triggeractivated manual1)
does either syntax look correct? im not getting any errors and to best of my knowledge this is how i should use "OR"
AND &&
pardon me, for what im doing here is quite specific,anytime after auto or manual trigger have been activated,and the group(Alpha2) disembark my helo,i want them to then follow the info on the activation box. After testing at least with my touching ground way,its working as is supposed to and touching ground is actually applying when they leave the chopper even if the chopper is grounded(hence my initial question earlier) its weird however that even though the two conditions above need to be met for the activation to kick in, the triggeractivated condition alone is enough to trigger a hint in the on activation box, which made me think it isnt working
correction,touching ground counts even if they are in a helo. il try your method,thanks.
Is it possible to detect every (map) object that's partially or completely underwater? I'd need the type and location of stuff like rocks and water plants
might work to select them based on getposASL under 0?
IIRC there was some discussion that not all map objects have classnames. Or am I wrong here?
I'm not sure π€
I'd be both surprised and not surprised
this is arma after all π
nearestTerrainObjects?
There's a mention on biki that terrain rocks and boulders are of type "HIDE" instead of "ROCKS" or "ROCK", I wonder if there are other such special object types?
try & see
Alright, let's see indeed
Thanks! It's working well. Lots of data to play with
Quick question, is there a way to make a unit invisible but still be able to receive damage through bullets?
AFAIK no
Duck, any scripts or way you think I would be able to achieve that with? Even if it's detecting something else invisible getting hit and then possibly applying damage based on that?
Well... what exactly is the goal?
I am trying to find a way to fix a current limitation of the mod where cloaked units are practically invincible to bullets.
https://steamcommunity.com/sharedfiles/filedetails/?id=2544778197
Hm π€
I guess you could try using an invisible wall and if see if you can detect hits on that? maybe?
You may want to use setObjectTexture [0,""]
So when a unit is hidden the players/AI can still be killed or damaged
Will give it a shot, I have a slight feeling that it might be more problematic with ACE but that's a problem if this works.
Been trying that, it doesn't work sadly.
Someone told me it might work on VR entities, but it doesn't either.
It should. Or, at least other numbers do
Has to be wearing some uniform to work, I'm currently looking into if any uniform can be fully hidden, the can't seem to be hidden.
Closest I got so far was the ghillie suit, but it still has a tiny bit of arm and the head showing
π€ You're out of luck then
Might help to set textures other than 0
but I guess it only touches the customizable textures.
Viper Suit works with everything but the head β
Yea I am trying up to 5
If I can find a way to hide the head/face then I think I'm good but not sure if that's possible.
What if you put a full-cover helmet on them, like that one from Apex?
oh, you already tried the viper suit.
Yea, the head is still the problem, both the Viper Suit and CBRN suit from contact work but with the head problem
I don't think you can change vest and helmet textures with commands, only uniforms iirc
@wild canyon
hi
Hello, I installed the "MarXet" mod and everything works correctly, with the database, ect...
but I have my server on the chernarus_A3 map
The problem is that the trader does not appear, and I use this way:
class CfgTraders
{
#include "TRADERS\CfgTraders.hpp"
};
Does anyone know how to adapt the MarXet trader file to this type of trader that I use?
hi, that's unfortunately not related to scripting. have you checked this mod's documentation?
I really checked the entire configuration, I have no error, just the trader which is displayed, but without the option
and for info I am on chernarus A3
try #arma3_config perhaps, with a doc link
Hey guys. I have trouble, im making mp missions, and i got there script for adding medicine into boxes, so i add item via "addItemGlobal" command in sqf script, and call that script in init of the object. The problem is that sometimes it gives medicine ok, but sometimes it can give like few thousand of items. As i understand it executes this script for every player (there like 100 players), and only thing i cant get, is how that happens? As i look in initialisation order in arma 3 documentation, there written that "Object initialisation fields are called" applies for "all" (as i understand for server and clients), and sometimes it does...
the init field is run by the server, and by connecting or connected clients
if you only want to run it on the server, (1: don't use the init field, and 2:) you can wrap it with```sqf
if (isServer) then
{
// do stuff once at the beginning
}
Or i can execute the script in initserver right?
that would be perfect if you have reference to these objects yes π
whats the common way around this issue: i have a repeatable trigger that i need called throughout the scenario. problem is one of the 2 conditions. they task complete needs to be counted each time for the condition to be satisfied
units Alpha1 findIf {!isTouchingGround _x} isEqualTo -1 && ["1"] call BIS_fnc_taskCompleted
Did you define what _group was?
And i have one question: does selectRandom works different on each client?
the first con(touching ground) works over and over yet the task complete or trigger activated can only be done once in mission yet the condition expects them everytime
in your syntax earlier yes
it didtn work but maybe you misunderstood my goal
Probably. I was just giving the general format for doing it on the script side. Modification has to be done for triggers.
im the pilot(any AI can be actually) A group boards my helo,i land,they get out,and follow code that was on the activation...let me just give you the full on act and con:
Wait, is script executes when mission is starting by the server, and every player?
units Alpha1 findIf {!isTouchingGround _x} isEqualTo -1 && ["1"] call BIS_fnc_taskCompleted
randomPoint= selectRandom ["AO", "AO"];
{ deleteWaypoint _x } forEachReversed waypoints Alpha1;
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "GETOUT";
_wp setWaypointSpeed "NORMAL";
Alpha1 setBehaviour "Aware";
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "SAD";
_wp setWaypointTimeout [60, 90, 120];
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "SAD";
_wp setWaypointTimeout [60, 90, 120];
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "SAD";
_wp setWaypointTimeout [60, 90, 120];
_wp = Alpha1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "CYCLE"; d
you see intention? con is task has been completed(but it seems to need it to happen each time)
and on act is the patrol script executed with a 22 second delay after the group exit the helo
init field? yes
Oh I guess I never did get back to you on building it fully from script. Just got busy over the weekend
So, i 100 times globaly adding items?
no no worries at all,im tryna learn but honestly its been 6 hours im at this one thing now
each machine would trigger a run, yes.
i use my old messy syntax instead of yours for familiarity for moment too
"add 10 mags"
one dedicated server + 3 players = 40 mags
finally witnessed limitations of triggers
But why do it sometimes executes only once? Like i had this fr
Move onto something else in the mean time, then return to it. When you get stuck, make a comment in your code, then move on to something else. When you return, you have a better chance of seeing it.
Server lag?
no - it only depends on the command's locality or if it is server-only for example
like it still runs on the client but does nothing
yeah but its a template im making,these past two weeks,this is the last obstacle
is there a way i can make the trigger happy with the task condition being completed just once?
or create the trigger after task1 was complete?
Ok, i have other example, i had setVariable in init of object, and it sets for server or host, but not other clients, but as you said, it had to run on each client and set var for them too, but it doesn't , but if i set var publicly other client get it
please provide code
i think what i might do is check if group is in the AO and(after drop off) just execute the patrol on them at that point
so alpha1 in marker area or something like that
run code..
is there an alternative way to "in thisList " for markers?
I dont have one right now. It was just: this setVariable [name, value]
OR maybe, i forgot, there was call with some arguments.
And when i tried to get this var/args in script which was in description.ext -> cfgFunctions, only server/host was getting it
I think it was setVariable
setVariable works (locally, unless you used this setVariable [name, value, 2] where 2 = server)
Yes, but then i localy executed script
are any conditions in triggers actually repaetable?
iv tried !Alive, ISNUL and so many others. nothing work
conditions don't repeat, triggers do?
im about to pull my hair out
iv decided to abandon it and come at it from a totally different angle.
if you put a condition in a trigger
it will loop itself
side kind of how my brain feels RN. Yeah i understand
until the condition is met
changing the trigger state
iv abandoned the complex way and opted simply to detect if the group is within a trigger area(that encompases the entire AO) and within that trigger area the conditon:
units Alpha2 findIf {!isTouchingGround _x} isEqualTo -1 && {_x in thislist} count units Alpha2 == count units Alpha2
it meets the needs of what i want,just means il have 9 ugly large repeating triggers for 9 squads encompassing the entire area
im open to critisism of the above code though
im sure as always theres a better way of doing this.
I've been searching for the past 2 hours on every forum thread I could find, but no luck .... my question is so simple I'm kinda ashamed to ask for help here
So
I use a composition that returns "SMINI_password_correct" true when completed
When completed, I want a specific effect to turn off. So I set a trigger. But I can't find what to put in the condition box.
I tried "SMINI_password_correct isEqualTo true" (and many others) but to no avail.
Can please someone help me with this one ? (I've added sound to my trigger so I'm sure it doesn't work, it's not just the activation part that is at fault)
I'm assuming the composition just does SMINI_password_correct = true or something very similar to that.
If that's the case, then your trigger condition should probably be:
missionNamespace getVariable ["SMINI_password_correct",false];```
Because the trigger is evaluating constantly from mission start, you can't just check for `SMINI_password_correct`, because the variable won't exist and the trigger will get confused. You have to use a command that doesn't fail if the variable doesn't exist, which is what `getVariable` is for - it checks whether the variable exists, and returns a default value (in this case, `false`) if it doesn't.
You _don't_ need to do things like `varname isEqualTo true`. That's like "return true if this returns true", which is redundant. The variable is already a true/false boolean, you don't need to add another layer. Just return the value of variable itself.
thanks a lot
tried your solution just before, and it's not working, so I'm reading more closely
why would getVariable ["SMINI_password_correct",false]; return false ? The variable does exist when the trigger needs to be set off ?
That would return false if:
- the variable is not defined (yet), i.e. any time before the composition does its thing
- the variable exists but its value is set to
false
It would returntrueif: - the variable exists and is set to
true
Triggers constantly evaluate their condition, so the condition initially returning false is fine and expected. When the condition becomes true, the trigger will notice and activate.
If you made the trigger condition missionNamespace getVariable ["SMINI_password_correct",false] and nothing else, and the trigger still isn't activating, then whatever the composition is doing is more complex and it isn't actually setting a global variable with that name to true. More details would be needed to figure that out.
I guess it is then (fyi, I'm using this one : https://steamcommunity.com/sharedfiles/filedetails/?id=2961943348&searchtext=switch)
I have another problem, when I set missionNamespace getVariable ["SMINI_password_correct",true] the sound played on mission start but the effect was still there, so the code on activation I use is also wrong (_nObject = [0,0,0] nearestObject 1953; _nObject hideObjectGlobal true;), so I have some work and testing to do, and even more research
what kind of effect are you trying to remove?
on the Cytech map there is a device with a beam, I just wanted to try to remove that beam
I saw on their discord that somebody tried that before me, and did find the id and shared that code
Ah, it might not work if you just hide it, might need to delete it?
Depends on how the effect is done I guess
guy said it worked, but one of the modders also gave a code to use, so I'm gonna try it as well
@bleak valley this is my workshop. Give me 20 min and I can help.
It's been a few years but I can look up the code and see what's going wrong
thanks a lot
Any idea why this works
params ["_unit", "_weapon", "_muzzle", "_newMagazine", "_oldMagazine"];
_oldMagazine call DNT_onReload;
}];
```
but this throws error?
```_newUnit addEventHandler ["Reloaded", {
params ["_unit", "_weapon", "_muzzle", "_newMagazine", "_oldMagazine"];
[_oldMagazine] remoteExec ["DNT_onReload",0,false];
}];
```
Function that is executed from EH is:
```DNT_onReload = {
params ["_oldMagazine"];
private _suppliesStatus = call DNT_readFromDb;
private _currentAmmoStatus = _suppliesStatus select 0;
private _oldMagClass = _oldMagazine select 0;
private _oldMagAmmoLeft = _oldMagazine select 1;
private _oldMagCapacity = getNumber (configfile >> "CfgMagazines" >> _oldMagClass >> "count");
private _ammoLeftPercent = round((_oldMagAmmoLeft/_oldMagCapacity) * 100);
if(_ammoLeftPercent<=25) then {
if(_currentAmmoStatus>0) then {
["ammo", -1] call DNT_writeToDb;
remoteExec ["DNT_updateSupplyTrackerTasks",0,true];
};
};
};```
@hallow mortar so looking back at that code, and also looking on the documentation that I put, you need to actually be using:
waitUntil { !isNil { missionNamespace getVariable "SMINI_password_correct" } };
or if in trigger:
!isNil { missionNamespace getVariable "SMINI_password_correct" };
edit: actually, it probably doesn't matter if you check for nil since you are returning false anyways.
@bleak valley
thanks I'm trying that
[[_oldMagazine]] remoteExec?
yeah thats what I saw too but I wasnt sure so I removed it xD
let me know
Okay, that done something, though now I'm having this error. I'm a bit confused what is being passed into the function? Is the _oldMagazine nested array? Seems like those are not assigning correctly
private _oldMagAmmoLeft = _oldMagazine select 1;
private _oldMagCapacity = getNumber (configfile >> "CfgMagazines" >> _oldMagClass >> "count");```
result is kinda strange
so I put in my trigger the code you gave !isNil { missionNamespace getVariable "SMINI_password_correct" }; ; replaced the activation code by a simple hint command, and tried 3 times
first time, turn all 4 boxes green, nothing happened
second time, turn the 1st box green, all went green at the same time and the hint showed
third time, same as the first (in both 1st and 3rd try, I manually turned every box green one by one and checked they were all green at the end)
I'm using your comp "vanilla", didn't modify anything
if its correct, it should force all of them to green
the password is randomized
so in your second iteration, you got the password right by switching only one switch
first time, you set all green, but all green wasn't the password
does that make sense?
yeah I get it, I misunderstood your comp, my bad, I'm gonna run more test then
do I need to change its description at all? you are the first person so far to state an issue (though most people don't even give feedback. i guess no feedback is good feedback)
now that I know it, it makes sense
the "To win, players must get the correct amount of switches in the "On" position." says it (the correct number can be not all), I guess I've read it a bit fast
I'm gonna change the password so all need to be green, 16 possibilities is a bit much to my taste ^^
but yeah it does work, thanks for your help
I'm fairly confident that the code I put is correct for a trigger waiting for a var to be true.
@fair drum sorry to bother you again
I'm trying to change the password to all green
according to your last comment in your comp, you need to modify the variable SMINI_password with an array of numbers (four 1s in this case)
I tried with missionNamespace setVariable ["SMINI_password", [1, 1, 1, 1]]; in init.sqf but it doesn't work (and I'd rather ask you before I spend the night on the setVariable and Array pages of the wiki, 1 hour is already enough)
can you help me out (again), please ?
no it was good. was just tagging you to continue to conversation between 3 of you. it was actually aimed at @bleak valley
so @bleak valley , that would be correct, just make sure you are changing that variable after the composition creates it. so either wait for SMINI_password to be created by checking for nil first, or wait a couple of seconds after mission start. its probably just being overwritten when the composition script runs
so not in init.sqf but rather initPlayerServer.sqf I guess ?
try this in init.sqf
if (isServer) then {
[] spawn {
waitUntil {!isNil "SMINI_password"};
missionNamespace setVariable ["SMINI_password", [1,1,1,1], true];
};
};
gosh just tested and it works ... finally
thank you a lot, I'm not very experienced in sqf but I learnt a lot tonight, so thank you
its pretty old but heres the code:
https://github.com/hypoxia125/Switch-Minigame/blob/main/switchMinigame.sqf
Does anyone have any idea on if its possible to attach a circle to a screen then use a line to show a number from 0 to 360?
what do you mean circle? what do you mean screen?
A circle..? Not sure how else to describe it. But like a computer screen.doesnt have to be a texture on it, Could just be a circle object thats close to the screen
And on that note, Does the texture on the rugged terminal allow the slider, Or is tied to the object itself
Anyone know how to find the PBO file path for an item? I know the class name of the item and I know it belongs to CfgMagazines, but I have no idea which PBO it comes from lol. The item is ButaneCanister if anyone has any experience with it already.
Why you need to check PBO to see className? You can always rely to a config viewer
I already know the class name. I want to modify it in my mod
but I cannot find where it exists natively so I don't know what to import
Still, you don't need anything within PBO
Just config viewer and use your config to inherit properly
I'll try to see if I can find it in config viewer
Found it. Thank you!
I've been trying to use the "CombatModeChanged" event Handler but I can't seem to be able to get it working. Is it deprecated? What sort of alternative should I use?
From the init.sqf:
mourners addEventHandler ["CombatModeChanged", {params ["_group", "_newMode"],
hint "EH triggered!";
deleteWaypoint [_group, (currentWaypoint _group)];
_group removeEventHandler [_thisEvent, _thisEventHandler];
{_x enableAI "ALL"; _x switchMove "";} forEach units _group;
}];```
I have two civilians in a group. I assigned the EH to the group. The intent is for them to leave the ambient animation they're in, and skip a hold waypoint to get them to flee when combat starts.
I tested the group'S behaviour with the "behaviour" state, and I can confirm it gets switched when shots get fired. However, I can't get the EH to trigger
what's their original group behaviour?
"safe"
When they get shot at, it swaps to "danger" or whatever the red state is "COMBAT"
Greetings fellow programmers!
Iβm trying to ad radios to a couple of vehicles in the game. And since Iβm not a programmer I only got a code βthat works, you just have to paste it in the vehicles init fieldβ and pasted it in the vehicles init field.
Testing the mission in Eden it works fine. On the dedicated server it does not. Well it worked once or twice, but not consistently.
Anyway here is the code, how would I get this to work?
[
{
private _vehicle = _this select 0;
[_vehicle, "ODIN"] call acre_api_fnc_setVehicleRacksPreset;
[_vehicle, {}] call acre_api_fnc_initVehicleRacks;
private _vehicleRacks = [_vehicle] call acre_api_fnc_getVehicleRacks;
for "_i" from (count _vehicleRacks) - 1 to 0 step -1 do {
[_vehicle, _vehicleRacks select _i] call acre_api_fnc_removeRackFromVehicle;
};
[_vehicle, ["ACRE_VRC110", "Upper Dash", "Dash", true, ["inside","external"], [], "", [], []], true] call acre_api_fnc_addRackToVehicle;
[_vehicle, ["ACRE_VRC103", "Lower Dash", "Dash", false, ["inside","external"], [], "ACRE_PRC117F", [], []], true] call acre_api_fnc_addRackToVehicle;
_vehicle setVariable ["Dro_customRacksAdded", true, true];
},
[this],
0.1
] call CBA_fnc_waitAndExecute;
[
{(_this select 0) getVariable ["Dro_customRacksAdded", false]},
{[(_this select 0), {}] call acre_api_fnc_initVehicleRacks},
[this]
] call CBA_fnc_waitUntilAndExecute;
};```
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
Sorry
I have issues with our loadout system we used on first loadin to a mission.
The system we use is rather big and can be found here: https://github.com/7Cav/cScripts/tree/main/cScripts/functions/gear
But i will try to simplify and narrow down and explain the parts that is important to get a grasp.
What we have discoverd is that function calls within the fn_gear_applyLoadout script (https://github.com/7Cav/cScripts/blob/main/cScripts/functions/gear/fn_gear_applyLoadout.sqf) during first loadin never gets executed properly.
The fn_gear_applyLoadout in applied via cfgFunctions preInit = 1 and uses CBA_fnc_addClassEventHandler that is added to the CAManBase class and 3 calsl are done for InitPost, Respawn and Local.
(The entire function can be found here: https://github.com/7Cav/cScripts/blob/main/cScripts/functions/gear/fn_gear_preInit.sqf)
To simplify fn_gear_applyLoadout:
params [
["_unit", objNull, [objNull]],
"_loadout"
];
[_unit, _loadout] call CBA_fnc_setLoadout;
// Nothing inside of this if works
if (hasInterface || {isPlayer player}) then {
[_unit] call ace_hearing_fnc_putInEarplugs;
["cScripts_StagingArsenal_SaveWhitelist"] call CBA_fnc_localEvent;
};
We noticed is that ace_hearing_fnc_putInEarplugs and the local event never properly run first time you loadin but if you respawn OR re run fn_gear_applyLoadout the functions. Is there a way to make sure they run more reliable on initial loadin and not just on respawn?
We have also removed the player checks but it does not have any effect.
are you adding the radios to the inventory or are you trying to make it useable
Iβm trying to ad useable radio racks to vehicles.
can you guys tell me the Indonesian flag script to put on the vehicle because I'm a new player
Yeah its wrong. It throws error AND returns configNull.
I don't see any purpose I'll remove it, it also doesn't match any of the other select commands
was there a change to this command recently? i used to use this but it doesnt seem to work
this removeMagazinesTurret ["4Rnd_Titan_long_missiles",[0]]
trying to remove titan missiles on Tigris
retyped it thinking maybe theres a hidden character but no,just doesnt do anything in a vehicle init
Nothing's changed about the command.
When you have issues with something involving a classname, always make sure you've got the right classname.
thanks man im on the classnames page i was sure it wasnt the _o version
non o is NATO i see
isn't it a 0?
I'm pretty sure it's O for OPFOR
ok - the font made me question it
yeah i thought it was referencing new faction as for some reason i forgot the magazine was both Nato and opfor
so im guessing this can work in reverse...i can add ammo to vehicles
Literally the only difference between the two is the display name used on MFDs (not even the game HUD). For the non-O it's MISSILE and for O it's Π-Π Π ΠΠΠΠ’Π.
yeah iv been staring at that word Raketa for an hour now wondering why the 0 wasnt beside it
nice i can fly relatively free now
gona try ADD ammo for the stomper drone as it only gets a single belt,such a fun vehicle
Incidentally, you can make a script that doesn't care about which mag type a vehicle comes with by removing the weapon instead
im changing the mass of them,and slingloading one in a hot AO as extra undercarriage fire power
i read up on that
i heard reports that doing that was causing CTD's when AI tried to use the vehicle
That seems highly unlikely
i got that info from a wiki page, not "removeturret" but similar i cant remember
scratch that it was an old Arma2 issue and related to "removeweapon"
You can only read the group behaviour with combatBehaviour, not behaviour. I have your example working although in one case the unit behaviour changed but not the group behaviour, so the EH didn't trigger. Not sure if Arma bug.
Ok, looks like the group and unit behaviour changes are completely separate for civs. If you plonk a CSAT guy in front of them, they'll shout "enemy" and group behaviour switches, but they don't move. If you fire shots near them then they'll scatter but their group behaviour remains on "safe".
if i used something like
private _unitType = typeOf _artillery;
_dummy = _unitType createVehicle _lastPositionX;
_dummy hideObjectGlobal true;
to create a dummy unit then revealed it to the enemy, will it shows a map marker to them or no, since its been hidden?
@inland iris thx you so much
Is it possible to defined a variable with code block data type (funciton) as a constant?
You mean immutable?
Yes.
compileFinal, I guess.
I am trying to structure my code, so that I donΒ΄t have so many separate files for every function.
compileFinal is the answer to that, but keep in mind that not using cfgFunctions does affect when the functions become available.
Separate file per global function is normal. Even if the functions are tiny.
To add on, if using CBA, their pre post compileFinal (using PREP) system gets around the timing availability.
What if I just use a normal variable for some of my functions? Is there any major downside?
I saw this pattern in some scripts even though I didnΒ΄t like it, it seemed like a pragmatic approach.
Well, it could be overwritten.
Since I already use cfgFunctions for everything, I will probably keep it like that, but I think that people might get lost in my code. π
So at least, I will try to name it clearly and separate it in different folders.
Functions that don't have their own file names and don't appear in CfgFunctions are generally more confusing rather than less
When I declare a var without the private keyword inside if-then block, will it still be global?
A global variable (no _) will be available to all scripts on the current machine.
A local variable (starts with _) is only available to the current scope and its sub-scopes, and will be destroyed when the scope it was created in ends, regardless of whether it's private or not.
Thanks for clarification.
I used it for a small function to prevent it being redefined over and over again.
fnc =
{
.....
};
};```
would
_dummy hideObjectGlobal true;
hide a revealed map marker for the unit? ie when showing to the enemy for support calls?
im trying to use a dummy unit to create a last known position type thing
I forgot different units can have different behaviours. If I understand right, this was the problem?
Not exactly. Read the second part.
Group behaviour isn't necessarily representative of unit behaviour or triggered in sensible circumstances, so that EH may not be useful.
The EH correctly triggers when the group behaviour changes, but the group behaviour change logic is garbage.
no, markers are not objects. you can try e.g setMarkerAlphaLocal
I see. What if I was using a dummy vehicle, something like:
Its an antistasi ultimate thing, the enemy can call in support and the enemy commander is given the position of the actual artillery unit if detected, even if you move. Im trying to give it a last known position such that counter battery is less accurate, especially if you move or are moving while firing.
and the best I could come up with was a dummy unit xD
Its kinda janky tbh.
Are you sure? Community Antistasi only cares about the original position (plus some added inaccuracy), and I'd be surprised if Ultimate changed that code.
I guess with artillery you'd get a delay, because the position is recorded at the point the support call is made, which might be ~40 seconds after you fired.
That's easy to work around though. Just don't bother moving until the shells land.
hmm Ill have to double check, but I think the artillery code was refactored at some point.
but yeah that makes sense. Ill look into it again.
Could someone scrutinize my .sqf and perhaps make some suggestions, it's a a function for a holdaction that is used for AI transport, the variable names are badly configured:
FN_GetCrew = {
private _helipads = nearestObjects [player, ["Land_HelipadSquare_F"], 50];
private _helipad1 = if (count _helipads > 0) then { _helipads select 0 } else { nil };
private _player = player;
private _helicopter = vehicle _player;
if (!isNil "_helipad1") then {
private _squad1 = [getMarkerPos "uslessAIflesh", west, ["B_G_Soldier_SL_F", "B_G_Soldier_F", "B_G_Soldier_LAT_F", "B_G_Soldier_M_F", "B_G_Soldier_TL_F","B_G_medic_F"]] call BIS_fnc_SpawnGroup;
_squad1 setSpeedMode "FULL";
{
_x assignAsCargo _helicopter;
_x action ["GETIN NEAREST", _helicopter];
private _wp = group _x addWaypoint [getPos _helipad1, 0];
_wp setWaypointType "GETIN NEAREST";
_wp setWaypointBehaviour "AWARE";
} forEach units _squad1;
hint "Crew coming";
sleep 35;
{
if (!(_x in _helicopter)) then {
_x moveInCargo _helicopter;
};
} forEach units _squad1;
} else {
hint "No helipad found";
};
};
FN_DismountCrew = {
private _helicopter = vehicle player;
{
if (isPlayer _x) then {
nil
} else {
_x action ["EJECT", _helicopter];
_x enableAI "move";
_x setUnitPos "auto";
unassignVehicle _x;
doGetOut _x;
private _playerPos = getPos player;
private _randomPos = [_playerPos, 50, 50, 0] call BIS_fnc_findSafePos;
_x move _randomPos;
};
} forEach Crew _helicopter;
};
Not looked at the code, but that message comes when none of the (outputsize) characters are a zero byte aka null terminator. In effect this means that can only return outputsize-1 bytes to the game.
if (count _helipads > 0) then { _helipads select 0 } else { nil };
you don't really need to write this
also when something doesn't exist the better practice is to set it to a default value. the default for objects isobjNull(checked withisNull)
so at the top you just need:
if (count _helipads > 0) theninstead of the isNil check
_x action ["GETIN NEAREST", _helicopter];
there is not such action
_x move _randomPos;
moveis for groups not units. instead of issuing move to each unit, just issue the move order to the leader of each group and let the rest follow
Is it even possible to return somehow the charater's name? I am talking about the name when you right click the attributes on a player unit and set a Character Name to it.
name _unit?
only if it is an AI, otherwise it returns profileName
No, it's not an AI, it's a playable character
then if it is at that moment a player, nope
dang it π¦
perhaps you could use in init script if (isServer) then { this setVariable ["MARC_unitName", name this] }; but no guarantee
Yeah, nope :/
you can set it manually and stick to it, no need to depend on name autogeneration?
True, I just thought you can get it based on the player Unit's variable easily
@candid sun look into lissajous figures for the figure 8 pattern
Anyone know if INCONTINENTIA'S UNDERCOVER script is still functional?
How do you deal with a common resource access among parallel executed functions?
I have a function that can be called from different event handlers, and it creates a unique entry in a table for the related unit. But I suspect that the nature of script execution might cause that two functions will blindly write duplicate entries even though I do check few lines before.
Shoud I use some kind of semaphores or queues? Or something else entirely.
A form of Mutex for example or queues yea
That means the involvement of WaitUntil or something, in case of Mutex. But this might get out of hand performance wise with events like suppress or hit.
I don't think you need to go that far in depth. Sqf is great because it's made for the layman, not for actual game development. I think you don't need to worry about this as I think this is covered on the back end for us. Like for 2 event handlers that call the same function, have you tested to see if the conflict you suggest even exists? I bet one event handler always has priority over the other
I kinda assumed that they can be executed in parallel (on the back end), and that one can not say if they will be finished in FIFO order. Based on what I read on BIKI.
I am just at the prototyping stage, so I did no testing and I think I might not even catch such condition. π
I think you'll be pleasantly surprised that you won't have problems. But this issue probably is best answered by @still forum
Nothing gets executed in parallel from an SQF perspective. If your code is called in an EH, Arma will wait until you exit the EH before doing anything else.
Scheduled code (eg. spawned threads) can be interrupted though.
OK, now I am getting a bit smarter.
As far as I can tell remoteExecCall gives you a remote FIFO but this isn't documented behaviour.
And normal FNC (cfg defined) call in init.sqf is also scheduled?
In scheduled code you can wrap sections in isNil { } if you need them not to be interrupted.
init.sqf is a bit weird, see https://community.bistudio.com/wiki/Initialisation_Order
does anyone know how to add flame to an object that will be placed on the map? Is that actually possible to such object to have particles?
wouldn't some config init scripts work?
hmmm will have to try
i remember one island / terrain used some shady stuff like loading a config up when the "island started" but cant find it anymore
for example I need to add two waterfalls too
I would say postInit function and check if it is the desired terrain and do a script
simulation = "fire"; object?
Thought it also adds actions to it π€
every instance I've seen it done (particles on a map object) required scripted solutions and not nice ones at that
(loop iterating through every map object to find the specific ones)
Will an EH created on a server detect a client's fired event?
It says GA, so I assume it will.
i have the following as a wp statement
{deleteVehicle _x} forEach thisList
and the exact same in a trigger on activation
yet they have different results
in the wp statement the crew of a vehicle get deleted but not the vehicle
in a trigger zone,vehicles and infantry both get deleted
EHs fire on the machine where they were created
I get that, but will it catch client's player unit event fast enough, like animStateChanged?
i dont think there's any delay. havent you tested it?
Not now, I did some tests long ago, but it was the other way around, EH on a client catching the event and setting some public values (unitTrait), and it was damn slow.
#arma3_scripting message
can you delete this "lead indicator" in anti airs? ive tried
showHUD [
false, // scriptedHUD
false, // info
false, // radar
false, // compass
false, // direction
false, // menu
false, // group
false, // cursors
false, // panels
false, // kills
false // showIcon3D
];
and difficuly settings, but doesnt work
yep, after alot search i found this feature is introduced in 1.60, but i couldnt find any code about it yet
can possibly disable it using https://community.bistudio.com/wiki/enableVehicleSensor
In Arma 3 both soldiers and cars are objects of a type vehicle, I think. The difference is probably that a trigger registers not only units, but also cars, whereas a WP does register only units.
vehicle player enableVehicleSensor ["ActiveRadarSensorComponent", false]works!
but cant use radar anymore
yeah i see that now
in testing something i also just realised if i set behaviour to careless but speed to gull,it seems to overwrite careless and changes to aware
this is concerning a helo. does full speed even apply to helicopters or jets?
_wp setWaypointSpeed "FULL"; (for air unit) not seeing a noticable difference but hard to measure
ahh wait maybe i saw a behaviour change..as helo came into area he is dropping off troops,he banked higher, than normal,meaning he was probably doing it to bleed air speed.
Speed should change after it reaches the WP, not before. Also speed should not interfere with the behavior mode, but I think that AI squad commander might change it back, if you set it only on some units in that squad.
no i can confirm speed is being applied right away with as follows:
randomPoint= selectRandom ["AO", "AO"];
_wp = HQRF1 addWaypoint [AGLToASL (randomPoint call BIS_fnc_randomPosTrigger), -1];
_wp setwaypointtype "TR UNLOAD";
_wp setWaypointSpeed "FULL";
heliGroup setBehaviour "CARELESS";
_wp = HQRF1 addWaypoint [position del, 0];
_wp setWaypointStatements ["true", "{ deleteVehicle _x} forEach thisList;" ];
but yes for example in high command if i change speed,they need to complete the wp for it to apply. seems different rules for different wp assignement types
You are setting the speed for the WP but not the unit, so it will affect the unit once it reaches the WP. In your case, once it finishes unloading, as I interpret the provided snippet.
im testing it now and looking at the vehicles attributes in real time and it is indeed full speed
its started on the ground so hasnt completed the wp which is over a km away
current wp perharps?
or are you saying the current shown speed is infact not what the vehicle is currently doing?
even in above syntax,when i check at execution start, "careless" is automatically changing to aware(maybe BECAUSE speed is higher than limited)
You can set speed directly on the vehicle itself - immediate effect, or change it through the WP - effect when WP is reached.
Try using setBehaviourStrong for the mode.
if (isPlayer _x) then {
nil
} else {
_x action ["EJECT", _helicopter];
Just write
if (!isPlayer _x) then {
_x action ["EJECT", _helicopter];
private _player = player; But why. The only reason I can see is performance. But even that doesn't apply here where you only use that variable once.
private _wp = group _x addWaypoint [getPos _helipad1, 0];
That group _x call isn't needed.
You are iterating through units in _squad1 , so the group of every unit will be _squad1
So just add the waypoint to _squad1
Also in general that loop there doesn't really make sense. Waypoints are per-group. So why are you adding the same waypoint for every group member.
The group will end up with a dozen times the same waypoint.
You need to do the assignAsCargo for every unit, but the waypoint only once.
There cannot currently be parallel execution in SQF.
The only thing that can happen is for scheduled scripts to be suspended, they then sleep while other scripts run. So that way you could get another script into the middle of your execution.
You would also need to consider that when creating a mutex.
But that is only for scheduled scripts that can suspend (spawn/execVM commands).
Not for unscheduled scripts, such as EventHandlers (unless you implemented your own scripted eventhandling system and call that from a scheduled script)
You can force your code to run unscheduled, by wrapping a isNil{} around it. That way nothing can interrupt it (the game will freeze while it runs).
You can check with the canSuspend script command, if your execution can be suspended.
Where does init.sqf run in a multiplayer game? Both server and client? Could not find it on BIKI.
Seems there is just an order.
Not mentioned where.
i have a really dumb question.
onflare.sqs the code need to be in sqs or can be sqf?
I think it's sqs but you can call an SQF code from it anyway so it won't matter
Can I replace the default value with function call in getOrDefault? E.g. sqf private _myValue = _hashMap getOrDefault ["a", ([0, 4, 10] call LEAF_fnc_calculateScore), true];
something like execvm? i dont know anythin in sqs π π
Oh, I managed to miss that π Thanks!
Can I track player's projectile from the server, or is it a local argument only? BIKI says Local Argument.
_projectile addEventHandler ["Explode", { ... }; //on server for player's projectile