#arma3_scripting
1 messages · Page 571 of 1
yep i think your right ,thanks for the help .
I'm trying to prevent an ai helicopter from deploying its landing gear when dropping off / picking up troops. Is this possible?
you can try force animating them
but that might not work
since the gears are usually deployed by engine animationSource that triggers at certain altitude and speed if I remember right
Hello! I'm having a problem here. When I use UnitCapture and UnitPlay, everything goes fine except for the UnitCapture not recording the engine being turned on/off, or helicopter gears being deployed. How can I fix this?
"Plays back input movement data on input unit. Simplified." says nothing about tracking a unit's settings.
reading both functions only thing that is tracked is if its 'firing' (Capture) or living/dead (playback) other then movement
I never dealt with this but given its letting you set the time (frames) total. playback to (x) then issue the lower gear command possibly?, then continue playback? thats purely a stab in the dark.
@tough abyss does the issue appear in Eden Editor or in MP?
that or you do the playback and cacluate when you want gear down and issue the command after (x) amount of time gone by in the playback
lou btw is this the underpinning of how ambient flybys are done etc?
Hey.
I am using a snow script.
When I get in the car, the snow does not follow me, but remains in place, and when I get out of the car, it follows me again. How to solve this problem?
MKY_fnc_create_Emitter_Host = { objEmitterHost = "Land_Bucket_F" createVehicleLocal (position player); objEmitterHost attachTo [player,[0,0,0]]; objEmitterHost hideObject true; objEmitterHost allowDamage false; objEmitterHost enableSimulation false; (true);
I did not fully understand this script, I can send it to you if you have a desire to help me.
lou btw is this the underpinning of how ambient flybys are done etc?
no, it's spawned units that fly around @bright flume
the snow script
maybe an attached object is not following once a unit gets in a vehicle, but gets reattached when exiting it
ah okay thought maybe it was a recorded one then using playback to recreate it easy. rgr that ty
goes back to staring at vcom scripts and why globals just randomly not found...
omg so wish bi had a fnc that just did a simple exists() so one can verify variables even exist without dumping errors...
like, isNil?
thought even isNil errors out if you call it for something that doesnt exist vs 'not defined' for its value
isNil doesn't error if you use it properly
@winter rose
Can you help me fix this?
MKY_fnc_create_Emitter_Host = {
objEmitterHost = "Land_Bucket_F" createVehicleLocal (position player);
[objEmitterHost] spawn {
params ["_emitter"];
private _camOn = objNull;
while { true } do {
waitUntil { sleep 1 ; _camOn != cameraOn };
_camOn = cameraOn;
_emitter attachTo [_camOn, [0,0,0]];
};
};
objEmitterHost hideObject true;
objEmitterHost allowDamage false;
objEmitterHost enableSimulation false;
(true);
``` @lapis ivy
wow colors and all... Kami-sama has landed ^_^
Kami-sama?
So, did you find your issue with isNil?
@winter rose
Thanks, I’ll check it now.
yeah and Im now betting somewhere this is happening <bla> = nil;
ie the value its nil (not intended...);
Code example of isNil usage please
cant this reverse debugging. trying to find out why globals are randomly 'poof''
you said you wanted some
exists()
isNildoes what you want.
@winter rose I am testing my mission from the Eden Editor in a LAN MP server
@winter rose
Thank you very much! It works! It remains to check on a dedicated server!
Nothing happens in Eden because I need to use the radio command to trigger the UnitPlay
@lapis ivy should still work 😉
Can't have the helicopter fly around in Eden Editor
Will there be any difference? I mean, my mission is a multiplayer event, so I thought I'd test it in a multiplayer setting
test in single player
if it works, test in multiplayer
if multiplayer doesn't work, you have a locality issue
because so far that's what it seems to be to me
What I mean by "doesn't work" is that the helicopter can fly and go around BUT the UnitCapture command doesn't record turning engine on/off or deploying helicopter gears
@winter rose
Can you still help me? :)
I add 56 backpacks to the box, but the backpacks are not empty, there are 2 mines in each backpack. How can I clean the backpack that I added to my drawer?
blufor_box_backpack addBackpackCargoGlobal ["B_mas_usl_Kitbag_w", 56];
@tough abyss
place an AI for the landing gear (unsure)
use engineOn to turn the engine on
@lapis ivy use https://community.bistudio.com/wiki/BIS_fnc_basicBackpack to get the base, empty backpack
AI for the landing gear?
a driver
then maybe just engine on should do
do ai even know what they doing in that?
Okay, and what about the landing gear? When UnitPlay is being executed the AI will follow exactly what's been recorded, and since landing gear deploying/pulling back up isn't recorded, it doesn't do it.
And, as the wiki says, UnitCapture and UnitPlay only follows movements, not interactions like the engine and gears. So...
that's what I said, maybe engineOn will make the AI use landing gear - try
@winter rose
I do not get you. This backpack is from a modification. There are items in the backpack as standard.
Maybe I'm not using BIS_fnc_basicBackpack correctly?
@lapis ivy wait, didn't you want to add empty backpacks?
No, that's right. I need to add empty backpacks to the box, and this “B_mas_usl_Kitbag_w” is added with two mines.
then basicBackpack returns the root, empty class of the backpack, without the items
Like this?
USSLibertyHeliPath =engineOn[insert big blob of movement recording here];
[USSLibertyHeli, USSLibertyHeliPath] spawn BIS_fnc_UnitPlay;
It looks like the class of this backpack comes with items.
Maybe I do not use this function correctly? How do I use it correctly?
@tough abyss no
@lapis ivy then maybe there is no class where it is empty
let me look at something
trying to make a foreach loop to empty it easily if possible you might beat me out on that
Excuse me because, evidently, my knowledge of SQF is in embryonic form. How can I do the engineOn command?
see https://community.bistudio.com/wiki/engineOn @tough abyss
@lapis ivy try
https://community.bistudio.com/wiki/everyBackpack
and
https://community.bistudio.com/wiki/clearMagazineCargo maybe
USSLibertyHeliPath =USSLibertyHeli engineOn true[insert big blob of recorded heli movement here];
[USSLibertyHeli, USSLibertyHeliPath] spawn BIS_fnc_UnitPlay;
Like this?
no.
USSLibertyHeli engineOn true;
/* the rest of your usual code */
``` like this ^
ComboTombo @lapis ivy ```sqf
{ clearMagazineCargo _x } forEach everyBackpack _myAmmoBox;
@lapis ivy ^
heh knew it... basically what I just verified was jumping in and out of the editor
Wooow! Thanks!
blufor_box_backpack addBackpackCargoGlobal ["B_mas_usl_Kitbag_w", 56];
How do I write correctly?
insert my code after this ^ addBackpack thing
I'm really doing something wrong 😄 😄 :D
blufor_box_backpack addBackpackCargoGlobal { clearMagazineCargo _x } forEach everyBackpack _myAmmoBox ["B_mas_usl_Kitbag_w", 56];
Sorry, I really don’t understand, I started 😄
…indeed ^^
blufor_box_backpack addBackpackCargoGlobal ["B_mas_usl_Kitbag_w", 56];
{ clearMagazineCargoGlobal _x } forEach everyBackpack blufor_box_backpack;
Now I understand.
Sorry, I need to poke my finger: D
Thaaaaanks!!!!
@winter rose
@bright flume
I love you
@tough abyss did it work?
When I tried it, the AI took off and almost immediately pulled up gears. Great! Then, when it reached the LZ and was about to touch down, it didn't put down gears. And when it went back to the ship to land, it landed on the helipad without gears, and when the UnitPlay command was finally done, it put down the gears while it was on the helipad (so it just bounced a meter up, gears down, and straight back)
weird flex but ok
Also, the engine didn't turn off once it landed
engineOn false, yep
Right, now what about placing down gears on touchdown on the LZ + on touchdown on the helipad?
since the ai reacting, maybe put the land WP there since you force controlling the flight of the vic? so they know they landing? maybe thats what was missing?
ah
@winter rose
USSLibertyHeli engineOn true;
USSLibertyHeliPath =[insert big blob of recorded flight movement here];
[USSLibertyHeli, USSLibertyHeliPath] spawn BIS_fnc_UnitPlay;
USSLibertyHeli engineOn false;
This?
the AI is not performing anything at all actually; you could use unitPlay on an empty helicopter with its engine off it would still play
yeah why I thought this was a static movement thing, and the ai well since they not flying really dont know where they were going..
@tough abyss kind of, you would have to wait for the play to stop
sleep 120; // seconds of flight
Hmm, okay. I'll have to record the exact flight time for that.
btw Lou does A3 support short circuit boolean logic?
you can short-circuit your motherboard while playing Arma 3, if this is what you are asking
no when a boolean eval, if the first element is false automatically nothing else is evaluated.. or true evals the other half of the logic like || && etc
yes, but the second one has to be wrapped with Code
e.g ```sqf
if (not isNull player && { alive player && { damage player > 0.9 } }) then {
player setDamage 1;
};
actually dude you are a kami-sama thats exactly the situation I was looking at using it for or trying to so I can hunt problem children down.
or isNill in this case.
Kami-sama?
god...
oh
me no speak Japanese; me barely speak Engrish
I dont speak japanese either lol
actualyl given how much I listen to subs I prob if forced could atleast understand some things verbally
btw if you can think of how I could do what i mentioned in sound_music_makers I would be floored.
Right so my timer says from the time the trigger is issued till the helicopter almost touches the helipad is 358 seconds. I'll put on a sleep 358; followed by an USSLibertyHeli engineOn false;
yep
Absolutely perfect! Thank you very much @winter rose
Hey iirc we had a solution here some months ago after a big discussion:
Is there a way to automatically correctly offset crates etc. -> read out how far the objects center is from the actual edges of the object
iirc the problem was correct offset for attachTo and the solution was to not give it any parameters so it automatically offsets?
doesnt solve my problem since i want to stack crates of diffeent sizes automatically
Is exists command which can "commit" changes in 3DEN Editor for returning these back? If I change something by scripts (i.g. create entities or delete it) I cannot do UNDO command
@rustic plover collect3denHistory
@distant oyster u awesome. Thx :)
@spark turret have you tried boundingBoxReal?
is the object center always the perfect center of the bounding box?
or can the objectcenter be offset from it?
delete3DENEntities not history recorded. Is no way to record deleting entities?
@rustic plover ```sqf
collect3denHistory {delete3denEntities _entities};
Is not working?
Can confirm not working. Dont know why though.
how do i convert the BBR positionRelative coordinates into posAGL coords? i tried modeltoworld and modeltoWorldWorld but the points are always offset on x and y axis by magnitude ~ 2
according to the biki the BBR points are "the extreme points of the model in format PositionRelative" and modeltoWorld "Translates relative position from object model space into world position." with the parameters " [x,y,z] offset relative to the model centre, format PositionRelative".
but if i convert it back into positionRelative with worldToModel, x and y are offset. i also created helpercircles at the points and the are way off on 2 axis.
in conclusion, modeltoworld seems to be broken
how can i add all friendly groups to HC bar?
@spark turret got pictures of that? Some models have invisible parts that make the bounds larger than what the model looks like
give me some time, ill present what i mean
@young current which clippingtype would you recommend for best results?
another thing i noticed is, my handplaced helpers tell me the object center is at the bottom of the crate but bounding center tells me its at 0.8m height.
land contact center is probably at the bottom
bounds are the "physical" measurements of the object but objects model can (and for things placed on ground usually is) made so that modelspace [0,0,0] origin is at the bottom so that the object sits on surface and does not sink into it.
you could try the other modelToWorld commands @spark turret the modelToWorld as you said is calulcated from the model center which is as you say usually different than boundingbox center
or you need to get the model center, and boundingbox center offset and apply that to your BB coordinates to make it relative to the model center
What is going on with preprocessFileLineNumbers, and how to I make it work properly?
https://imgur.com/a/rE675w9
cos right now it looks like i have to add manual #line after every single preprocessor block to correct further lines?
@spark turret
https://steamcommunity.com/sharedfiles/filedetails/?id=954149033
Does anyone have experience with this mod/script? I am attempting to get it set up in some missions and found the google link provided on all the links doesn't work anymore and am unsure how to config it within the mission.sqm if someone could provide some direction or has a copy of the original doc that would be awesome! Apologies if this isn't the right place to ask
hmm yeah i integrated this with antistasi at one point
you can see the code it might help
Yeah so would the code go above or below the }; ?
sorry am very new to these things
nah i mean i will point you at my code on github and you might be able to work it out
i don't remember
it was years ago
Oh ty!
sorry i can't find it, maybe i only integrated it on my server or something i don't remember 😦
Yeah all good not sure what happened to the link am sad 😦
likely the author deleted it or the whole account it was on.
from the forum posts it looks like he stopped developing it
@ebon ridge Can you link your github kind sir
i can but its not in there i don't think, i can't remember where i did it
tarnation
found a the documentation in the pdf of Gdrive version Idk why I didn't look sooner haha
but for future reference with A3 Wounding System - AIS Revive
sqf files are not started by themselves; how do you call the scripts?
Any idea why the scripts on my mission would run on singleplayer, but not on multiplayer? when using the exact same mission files?
Having trouble getting both the killhouse and range to run properly, its asif not all the triggers are being activated, and im struggling to get the _add actions to work
player usage and locality are what make the difference between SP and MP scripting yes
Do you mean having any unit set to player?
Ill see if that fixes anything, thanks 🙂
no, I mean doing something like [player] joinGroup _unit
random example but is what I mean
you basically should be using private variables
@stark granite https://community.bistudio.com/wiki/Multiplayer_Scripting
@stark granite pastebin your scripts and link here
Im unsure on that, Would this require me to edit the script itself to change who is being called? 😦
is it coming from the: player addAction , is that different for mp than sp?
use pastebin.com pls. for easier access
so that we can read the scripts instead of having to unpack your pbo
Thats the init, which I assume is what adds the actions to controll the script, they show up in singleplayer, but not multiplayer
// Add Player Actions
player addAction ["[CQC] Start New Round", {[1] execVM "scripts\new_round.sqf";}, [], 2, false, true];
player addAction ["[CQC] Toggle Day/Night", {execVM "scripts\toggle_day_night.sqf";}, [], 2, false, true];
player addAction ["[CQC] Show Enemies", {execVM "scripts\toggle_show_enemies.sqf";}, [], 2, false, true];
player addAction ["[CQC] Refill Ammo", {execVM "scripts\refill_ammo.sqf";}, [], 2, false, true];
player addAction ["[CQC] Infinite Ammo", {execVM "scripts\toggle_infinite_ammo.sqf";}, [], 2, false, true];
// Remove ACE medical event handlers
if (ace_is_loaded) then {
player removeAllEventHandlers "hit";
player removeAllEventHandlers "hitpart";
player removeAllEventHandlers "handledamage";
player removeAllEventHandlers "killed";
player removeAllEventHandlers "explosion";
player removeAllEventHandlers "dammaged";
};
is a glaring issue
How so?
if its in init then it will only really work in single player IIRC
because player is only one person
doing something like
{ _x addAction ["[CQC] Start New Round", {[1] execVM "scripts\new_round.sqf";}, [], 2, false, true];} forEach playableUnits;
should work
https://community.bistudio.com/wiki/Event_Scripts <- is probably something you should read
Im sorry if im being dumb, just inexsperienced, i still dont understand what it is that ill need to change, is it just that line, do I need to modify all player referenced lines to work, is it worth the effort at all? Theres a bunch of scripts running that came with the fairly small basic assets I added to our training map, and I have no idea what most of them do unfortunately. 😦
Is there anywhere I can find an error file after running it on the server for a better idea on which scritps ar'nt working?
when you say
it's the init
is itinit.sqf?
The Init.sqf is whats in the pastebin above yes
Also when you say on multipolaer, is it a dedicated server or are you hosting?
if you have respawn on start, the addActions remain on "old" bodies iirc
@winter rose doesn't player just reference the host?
init.sqf runs on all machines
what is respawn on start? I have used playable units to place the spawn points, and theres respawn point to get to other parts lf the map
it is a description.ext or Eden MP settings
where you "respawn on start" (and for example get to choose your equipment)
as far as I know,, just placed the playable units using the 3den editior
without the scripts, respawn works just from the mission.sqm
where is the respawn configured?
the only scripts added are - A killhouse, a range, a medical practice script, and a vehicle spawner
the respawn should just be configured in eden?
I havnt done anything to the respawns from the basic map we made without any mods or scripts or anything
if you don't configure the respawn, you don't respawn (or as a seagull maybe)
so I believe there are shenanigans, either in Eden settings or in description.ext
The respawn on the server works fine, it respawns you as it would in public zeus for example, on one of two points, after initially spawning you where the unit is placed in the mission
useful links:
https://community.bistudio.com/wiki/Event_Scripts
https://community.bistudio.com/wiki/Initialization_Order
https://community.bistudio.com/wiki/Multiplayer_Scripting
and what @surreal peak posted, Description.ext
@stark granite I am not asking you whether it works fine or not, I am asking where it is configured, who configured it
Right, I see what you mean about the description.ext, however the respawn details are not covered there currently?
so this is the entirety of description.ext?
if so, then respawn is configured in Eden MP settings
so I should be able to find it in the mission.sqm right?
Which is that bit in the sqm?
If I change the respawn settings/add them to the discription.ext will this over write them or cause problems?
also is it the respawn which is causing the scripts to fail, such as the units not spawning in the killhouse
1/ shouldn't
2/ your init script gives all the actions to everyone, and starts "new_round.sqf" (number of players) times, which… is wrong?
try adding respawnOnStart = -1 in description.ext
@young current are you for real you fixed the damn thing i was fighting with all afternoon?? awesome!!!!!!!!
feel kissed
Where should I add that? just right at the top? @winter rose
Thats just the vehicle spawn menu, its a virtual garage, that script is working perfectly fine as far as I can tell
yeah but check in every include that there isn't any respawn setting
in the description?
in every include
_me = _this select 0;
_killer = _this select 1;
_instigator = _this select 2;
// Stop system mesages covering up restart button
sleep 3;
clearRadio;
nothing wrong in there
So it seems that adding ' respawnOnStart = -1 ' to the description.ext disabled both scripts from working, unsure why that would happen
Is -1 an actual value for that? I imagined that only 0 for no and 1 for yes work
respawn=3; in the mission.sqm too, does that correlate
@oblique arrow -1, 0 & 1
huh neat, what does -1 do?
wiki 👀
https://community.bistudio.com/wiki/Description.ext#respawnOnStart
-1 - Dont respawn on start. Don't run respawn script on start.
0 - Dont respawn on start. Run respawn script on start.
1 - Respawn on start. Run respawn script on start.
Thanks
@stark granite no problem with respawn 3 being declared in multiple locations but there is a priority: description.ext > Eden settings
I dont have any of the cfg3den settings in my mission.sqm or my description.ext do I need to add them, otherwise where are the 3den settings being saved in the mission.sqm?
I see the respawn template being ran at the top of the SQM
Can I just re-open the mission in singleplayer editor again, and set the 3den settings in there, because this is somthing I hadnt done previously'/
when i did Maintenance work and load the new mission file, are my server logs cleared?
@tough abyss that's #server_admins
sorry
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#GroupIconOverEnter
Im trying to display (something ) when hover over (sector control mission icon) .does anyone knw how to make this work? 😀
is engineon a local command? Does it need to be run through the server?
It has to be executed by the machine where the vehicle is local, which could or could not be the server
I don't quite understand how a vehicle could be local to anything besides the server, but if i just remote execute to all machines that would be the safest bet?
@surreal peak Your profanity was removed. Zero tolerance policy regarding offensive behaviour, this includes harassment, name calling, racism, sexism, homophobia, other derogatory remarks (profanity) or any insults.
@ornate prairie an empty vehicle should be local to the server yes
Anyone know a script that saves game progress similar to antstazi? Trying to add it to a warlords mission
Hey.
How can I make sure that a player without a long-range walkie-talkie could not create marks on the map in an additional channel?
So something I'm not quite getting; I have an object that I created in the editor with a variable name. According the initialization order page, that should be created prior to serverInit.sqf, so why can I not access it? What am I missing?
Mabye initServer.sqf?
"initServer.sqf" = Executed only on server when mission is started. See Initialization Order for details about when the script is exactly executed.
I have that already, and I read the init order page, but it says that initialization fields should be done before that script is run. I'm asking why I can't access a variable created in the editor in initServer
is the variable name not part of the init field for that object? (edit: wrong terms, its an attribute which should exist even before the object init is called)
Object init or object varname?
varname, sorry still learning.
According to the init order page; it should be "object created -> varname (+ other attributes) -> object init called -> initServer.sqf called".
So the variable name should be accessible in initServer right?
Yes
it gives me an 'undefined variable' error
then something is done wrong
after changing nothing, it works? eden is seriously a pita sometimes. Thanks for trying I guess.
Eden is not a pain about this; my guess is you tried something in Eden Multiplayer Server or something like that - either that or you did not save the file you were editing
I hosted via server browser on LAN, but why would eden MP be different out of curiosity?
Also it wasn't a saving issue. Literally the first thing I checked before posting lol.
ok, better check than be sorry indeed
sometimes (from my experience some time ago) exporting to MP would not override the mission file; playing from Eden MP (and not exporting to mission -then- playing) helps avoiding this behaviour
No I get it, PEBCAK is my usual go to as well lol. Hm, that actually explains a couple things I ran into the other day. Ah well, working now. Thanks for rubber ducking at least.
it seems I am quite good at that actually
just, from my POV, make sure it works in SP first then test in MP - it avoids the hassle of Eden MP Server and allows for quick, repeated tests
Relic, perhaps post the code you are trying to run?
So, people's opinion: what's better between the two code approaches. Use case: when player connects, update them with variables they need that are maintained by the server.
Approach #1: from client's initPlayerLocal.sqf, run [player, "theNecessaryVariable"] remoteExecCall ["publicVariableClient", 2];
Approach #2: on server,
addMissionEventHandler ["PlayerConnected", {
params ["_id", "_uid", "_name", "_jip", "_owner"];
_owner publicVariableClient "theNecessaryVariable";
}];```
I would go with the later, I find more organized.
ryko, its not an issue anymore, but I will in the future.
Heyoxe I'm leaning that way as well. My initPlayerLocal is also 1400+ lines so I could afford to make it a bit leaner 😛
Put everything in functions, far more easier like that (and use the function library so you can set postInit = 1) 😄
My initPlayerLocal is also 1400+ ಠ_ಠ
I don't even have one on my mission 😄
Next question: better to send 20 publicVariableClient lines with individual variables, or send one publicVariableClient line with an array and then have the client unpack it back into individual variables?
Sending only one should be better and wil probably put less stress (?) on the network
That's what I'm thinking, I'm just worried about the variable getting to big and exceeding the message size.
There is a message size limit?
Though for the most part the variables I'm sending are basically single-digit integers. Man it's easy to get paranoid and stressed about what the engine can handle.
I think so - I get this error in the server rpt when the server gets under stress:
2020/02/21, 20:23:38 NetServer: trying to send a too large non-guaranteed message (len=1348/1353) to 186850323
To hit that limit you must sent a really really large publicVariable, and maybe it get sent anyway?
It might not even be related to my code as there's no reference - could be something internal to the mission. And I'm pretty stingy with the data I send.
Then there shouldn't be any issue with sending just one variable, and if one day it hits some sort of limit, if there is any, just split it in 2, always better than sending each variable individually
@worn forge just so you know, publicVariable'd variables are automatically synchronised to JIP players
Yeah, that would be the easy way, wouldn't it. Some of my values change during the life of the mission, however.
Then you can just rebroadcast it to update on everyclient?
call publicVariable again then, the thing is, with both solutions you provided, players who are currently in the game will not get the value synchronized
Eh, I like the control of sending the right variable at the right time rather than spamming the JIP queue.
it replaces the previous entry though
Hmm, I didn't know that. I thought it parsed all the entries in order.
it's somewhat optimised I believe 😉
That would create some awfull bugs if it was the case 😄
I believe it might have been the case in Armed Assault though 👀
Wasn't there a thing were you could juste do true = false in that game too ?
black = white
and in Arma 2 too 😄
(the true = false)
until a certain patch that protected commands and keywords. Before that you could do player = "hello"
anywho, thanks for the input folks, I'll dial back my OCD and go with publicVariable
I strongly believe this is the way to go yes!
At least we cannot do that in Arma 3 anymore, I would have broken the game much more than I already do 😄
is anyone here good with sector control scripting ??
Just ask your question
not me
Lou knowns everything... he wrote the wiki!
He is the wiki!
😱
sometimes I daydream, therefore you have a 502
we are an AI of multiple users… bewaaare!
FATAL ERROR: maximum AI count reached
{ if !(isPlayer _x) then { deleteVehicle _x } } forEach _wikiContributor
anyway... I'm only familiar with the Sector modules, although it should be possible to use BIS_fnc_moduleSector and BIS_fnc_bleedTickets to get the same results in a scripted version
although the wiki doesn't have any details about them, so I suggest checking the code of those scripts to see how they work exactly
https://community.bistudio.com/wiki/Arma_3_Module:_Sector
there is some doc here
@harsh vine ^
that feeling when you find code that explains why something has been working all along
sorry which feeling?
which code are you talking about?
(unrelated. Just feeling pretty wise right now)
(oh)
is there an easier way to make a marker (on map) on each sector when an enemy has enter the area, rather than having 10 different trigger and mapmarkers?? for example if blufor enters sectorA it should dispaly a map marker to opfor side saying sectorA is under attack.
What kind of stuff you put into initPlayerLocal.sqf that makest it 1400 lines long 🤔 🙂
eventHandlers mostly
or, is 1400 lines that much after all 🙂
1400 lines is nothing... but it's a death trap when it's in a single file
any way to convert a string into an object name? trying to loop over multiple objectnames without having to type in each of them:
//not working code:
for "_i" from 0 to 7 do {
_crate = ("crate_" + str _i);
_success = lkw setVehicleCargo _crate; //_crate has to be an object
hint str ["was loaded:",_success];
};
missionNameSpace getVariable format ["crate_%1", str _i]
thanks man (y)
Looking for advice;
In an MP mission I have several squads, each that can "request evac" using a specific smoke color.
I want to notify a group of pilots on their side of the request. Would tasks or 3d markers be more suited to the job?
(side question; can you have multiple tasks assigned at once)
You can have multiple tasks, but only one can be "assigned" at one time - this is the one that will show up in the player's GUI
If you need all the "tasks" to be shown on the GUI you'll have to use drawIcon3d
Hm. drawIcon3d is pretty performance heavy though right?
I haven't found that. And it's client-side, so who cares 😛
Fair enough lol. I'll try both and see which one seems more intuitive, thanks!
Does
postInit = 1;
work when used in the cfgFunctions of a function inside a description.ext of a mission?
Basically I can spawn my function correctly in a mission (when for example adding it to a unit init) but I cannot have it autostart with init =1.
Thanks
https://community.bistudio.com/wiki/Arma_3_Functions_Library#Attributes
So postInit will trigger during mission start and after objects are placed.
my function is simply displaying a systemChat "OK" and I can see that working when I spawn it from an init, but if I use postInit = 1 it does not auto-start
I am trying to create a template that allows my scripts to become stand-alone mods so mission makers can avoid adding them manually to missions
it's most likely because the mission isn't fully loaded yet, but the objects are already placed
it's an empty virtual reality scene with just me as the player?
most likely, the systemChat is not displayed
try player setDamage 1 for example
thanks @exotic flax and @winter rose trying now!
or use diag_log to print stuff in the log file 😉
setDamage is more fun 😛
preInit is the only attribute that has to be ran in an addon.
Neither work anyway..
but I can call the function manually from the editor and I do get killed
preStart won't work, since it will trigger on game start (so before the mission is even selected)
Prestart = addon
preInit before object
post after object
postInit is still what I need as I need player setDamage 1
You'll likely want to use postInit for anything that you want the players to see after the mission start. Preinit would be for background systems.
I can do [] call PREFIX_fnc_killplayer and it works in the editor
Try suspending a few seconds.
e.g. sleep 3?
Yes, has to be scheduled.
no luck (still works when called in local)
my only thinking was that because this cfgFunctions is in my description.ext it .. was not working..
it only works in config.cpp maybe? <--makes no sense
I tried to put it in the description.ext to test if it was ok in a mission environment before I moved full binarize PBO etc. etc.
I see no diag_log either (which is also there..)
I also noticed some write:
class init { postInit = 1 };
};
and others
Anyway neither work, (also checking that it is case-sensitive).
So weird! Hitting a wall for sure.
so you CfgFunctions looks like this:
class CfgFunctions {
class myTag {
class myCategory {
class myFunction {
postInit = 1;
};
};
};
};
And the file is located at: %MISSIONS_ROOT%\functions\myCategory\fn_myFunction.sqf
Yes, I have this:
{
tag ="VTO";
class clients
{
file = "functions\clients";
class namePLACEHOLDER
{
postInit = 1;
};
};
};```
and it's in %MISSION_ROOTFOLDER*\functions\clients\fn_namePLACEHOLDER.sqf
in fact when I do [] spawn "VTO_fnc_namePLACEHOLDER" it works
(player dies instantly)
hmm... need to go out for a moment, but will then test this out... because it SHOULD work
and otherwise the wiki is incorrect 🤣
Can anyone help with a DMS Mission question? I’m looking to add pop tabs to the loot boxes once a mission is completed. I’d like to add different amounts of pop tabs depending on the mission difficulty. I can’t seem to find the script to edit to make the change. Do I need to create/add a new script or is there one to edit?
DMS = ?
In exile. Sorry wasn’t sure if normal Arma had missions too
hi to everyone i'm trying to create my first extension for arma in c# but i cant make it work i followed the official wiki page and also the Maca134 tutorial but in game i can't get any responde the game doesnt crash and there are no errors in the rpt file suggestions. (ps tell me if u need the source code 🙂 )
Confirm battleeye is off and not blocking the extension?
yep disabled
Reezo is doing something wrong, postInit, preInit work in missions just fine.
@coral owl I created a very basic mission (single unit in VR, and only CfgFunctions), and I can see them all running correctly.
preStart gives an error (since it's in a mission)
preInit runs after server start
unit init (aka init field of object) runs right after that
postInit runs after mission has been setup
the only thing I can image is that on preInit the unit object exists, but is not initialized yet, and therefor no scripts can target it
however it should exist and work on postInit
since all the init scripts (server, playerLocal and playerServer) are also executed
Having the source file would be great @woeful sundial
it is more of a #arma3_tools topic though
ok
@hollow thistle @exotic flax thanks guys. I am embarrassed that this does not work, I confirm this feels to me as a blatant easy overlook and rookie mistake somewhere... which is ultimately the type of issue that has granted me the most hours of troubleshooting in Arma eheheh
@exotic flax if you feel like it is not stealing too much of your time, I would love to read your code to find out where I went wrong..
@coral owl this is the "full" mission: https://file.io/EP13AS
Thanks @exotic flax really thanks - anyone who got stuck in scripting/programming (on trivial things like mine, for example ;)) knows how helpful this is. 🤝
Yours work and I cannot for the life of me find out why mine does not ahah this is the beauty of programming ahah
The only thing that I was doing different is I had an include into the CfgFunctions
#include 'functions\includeThis.hpp'
};```
Ok it seems it did not like my #include - the rest was written correctly. I am not sure why I wanted to be so anal with the #include thing.. I can ditch it easily
the simplest the bettest!
Hmm... Will test it, but CfgFunctions should work correctly through an include, and the path it's searching in should always be mission/add-on/Arma root
the only idea of having an include was to keep my "shell" the more "template-oriented" and go change stuff only in specific places. But anyway, it works this way..
Now, I have a rather appealing question of something I totally forgot from my Arma 2 days of modding..
in an MP game, if a script runs on a client and adds damage to a unit.. will the damage broadcast over the net to all clients/server?
This simple script I have adds a bit more damage to vanilla hand grenades, through a simple FiredMan EH.. once it gathers the entities in the blast radius etc. etc. it just setDamage on them according to their proximity to the blast and their possible proximity to buildings that can emphasize the blast/shrapnel.
I wonder if I should call a server script for adding the damage to those units, maybe using NetIds etc. etc.
https://community.bistudio.com/wiki/setDamage
Argument is global, Effect is global
I just realized what those icons are. Sorry @winter rose and thanks!
looks down in shame 😉
My last step is moving this "script" to a "Script-in-a-mod".. using config.cpp and retouching the paths as I am afraid %ROOT% and such will come into play and try to haunt my night XD
I think in the case of a mod, this:
class CfgFunctions {
class VTO {
tag = "VTO";
class VTO_modCategory {
file = "functions\clients";
class preStart {
preStart = 0; // returns error, since it's in a mission
};
class preInit {
preInit = 0; // runs after server/mission is loaded, but before objects are placed and initialized
};
class postInit {
postInit = 1; // runs after mission configuration and after object initializing
};
class tougherVanillaGrenades {
preStart = 0;
preInit = 0;
postInit = 0;
};
};
};
};```
will have to be put in a config.cpp ... mhhhhhh.,........
@coral owl
```cpp
/* config */
```
plz
actually, the root of the files is always mission root, or addon root, so no need to write a full path (not even sure if it would technically be possible to call a script from another addon)
ah @exotic flax ok!
@winter rose sorry I am not sure I get that?
Lou is just being really anal
@worn forge in u
burned
@coral owl if you add "cpp" and a line return after the first ``` , it colours the config, enhancing readability
uh, got it, trying now, thanks!
nice!!
looks better than my Notepad++, I want those colors lol
Looks like MONOKAI to me
Get the sqf language plugin for notepad++ http://www.armaholic.com/page.php?id=8680
Thanks @worn forge I have it but it looks hard to read on darker themes, by default
I had found this but OHNOES 404'd - https://forums.bohemia.net/forums/topic/165754-notepad-sqf-syntax-highlighting-dark-theme/
nice thanks! - I did have the SQF plugin for Notepad++ but it forced me to go for a lighter theme, I was more of a dark type. But anyway it works well, I was using C++ before and it kinda worked too
same, I went to Visual Studio Code a bit due to that (light theme… UGH)
One question on the config.cpp - as I might be making my first mistake of the night -
is this the correct structure?
config.cpp
addons \
modname.pbo
and inside modname.pbo essentially there is what used to be the functions folder I had in the mission..
and note: I've searched for info on "scripts turned to mods" all day yesterday and could only find very little definitive information, sorry if I keep asking!
each addon (aka pbo) needs a config.cpp file with CfgPatches
even if I open and close it cpp CfgPatches {};
in that case nothing will work 😉
ahah lol omg sorry
All of the forums posts that talk about config.cpp for CfgFunctions start right in with
CfgFunctions {
// stuff in here
};```
the only ones that had CfgPatches were related to mods doing re-textures etc. etc. so I thought for scripts I only needed to create a config.cpp that looked exactly like my description.ext (basically had only the CfgFunctions thing)
I might annoy Lou to make a page about basic mod strucctures, since I can't find one
I am at a total loss and I totally understand I look like I am harassing this channel lol
The more videos I watch and threads I read the more different methods I get and this is definitely meaning none of them will work 🙂
y mi
Even something like Addon Builder is not totally sure for me after I've watched people PBO the addons folder, PBO the @MYMOD folder, PBO the folder inside addons folder etc. etc. etc.
I thought I had become finally a man with my Skyrim modding but no lol
Surprisingly there is very little info on how to turn a mission script into a mod.. I thought more was there. I promise I'll make a video of my own once I get out of this alive
well, missions are more simple since you can submit them to the Workshop directly from the editor
For example this script I've done that makes hand grenades just a little more powerful especially in close quarters.. I had it as a mission script then lots of friends started asking me to "make it a mod" so they load it in and go.. and there it started..
They basically wanted grenades to be a bit more powerful regardless of a mission that needed an init call in it.. makes sense I mean the request is legit.. and off I went to Google thinking it was a simple step!
the moment you know how it works it is simple 😉
ahah true!!
After 7 years the amount of info if you search for YouTube: "arma 3" "addon builder" is scary low:
https://www.youtube.com/results?search_query="arma+3"+"addon+builder"
because no one uses it, we all use Mikero's Tools 😉
the only difference between the two on YouTube is that the former gives Portuguese people speaking, the latter russian lol
I really don't want to ask my wives to translate that lol, I divorced from both XD
I'll start from the basics:
❓ "Addon source directory" in Addon Builder, means the ROOT folder of the mod, e.g. e:@MYMOD
🔲 true 🔲 false
lol
both 😛
ahah ok MAME32.exe here I come
STUNT.exe here I come, make room for MS-DOS 6.22
I get that you use SOURCE: your root folder mod and you use DESTINATION: the addons folder inside your root mod
then you delete everything but the pbos stuff in the addons subfolder, as you have the pbo that basically replaces it
negative
SOURCE: is the location where the mod starts (parent directory with addons folder)
DESTINATION: is a new folder (aka @modname) where the contents of source are being placed after packing
ah got it. Thanks. That's my milestone now.
Interrogative: will DESTINATION have an addons subfolder with the pbo inside? or does the pbo generated by the Addon Builder go straight in the root?
Before packing
---
- \myAddon
- \addons
- \myAddon
- \config.cpp
After packing
---
- \@myMod
- \addons
- \myAddon.pbbo
and you should always use the P drive to ensure proper naming inside the pbo's
Thanks for taking the time to help me out
Got it on the P Drive, mounted now
ok off I go, I am renewed in the blessing of this new information
Ok I got it, let's see if it works in A3
sips tea
ok it all loads but the function/script does not, and I suspect now the problem is my config.cpp
although it's more for #arma3_config, here's a basic structure for config.cpp:
class CfgPatches {
class myAddon {
name = "My Addon";
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {};
author = "My Fabulous Name";
url = "My Website or Discord";
version = "1.0.0";
};
};
#include "CfgFunctions.hpp"
// other includes
HEAD RE-EXPLODES
Many thanks! I am devouring the info as we speak (we don't speak)
for me the best way to figure out how it works is by looking at other mods and try (and fail)
I thought about it, I should probably unPBO some mods and take a look in there...
I hate that A3 is so silent when having errors in mods that use scripts, at least in missions it spits errors like crazy
although I suggest not to start with CBA or ACE as a starting point, since they do a lot of things "smart" which can be even more intimidating...
yeah something simple ofc
OH YES, at least it works now, it says it cannot find functions\clients\fn_preStart.sqf
A sign of life!
The Arma 3 samples on Steam are ok startingpoint
which means the path is wrong, but still, I am there
as well as the wiki pages about configs
you should have a Reezo_Addonname folder where you put the config at its root and the rest of the stuff
also if you want debugging at packing, you should use pboProject
it can catch quite a lot of common mistakes and missing files
nice thanks! Took note of this. The configs Iooked for but could not find and then when I did they were always tailored to some specific need of a modder (e.g. soldier classes etc)
but it makes sense
Does anyone know what type of ID is used for player created markers?
Their names are like "_USER_DEFINED #2/0/2", "_USER_DEFINED #2004492438/3/0" first one is player-server, second one is client. I'm not sure how to get player id for that. (format seems to be "_USER_DEFINED #<owner_id>/<marker_id>/<channel>")
Quote:
Where %ROOT% is either mission root (where mission.sqm file is), or the game root (path to an addon is not included and has to be part of the file path, e.g., myAddon\myFile.sqf).
this probably means I have to add the mod root to it..
@hollow thistle https://community.bistudio.com/wiki/allMapMarkers explains the structure
thx, I've checked only createMarker page.
eh, It seems you can only get the ID from server via the EH
hoped for some command
Also, is it recommended for mods to be always in the game root? e:\Arma 3\ @MYMOD ?
never do that!
At the moment I have them somewhere totally different
e:\ArmA 3 Mods
the last A is intentional lol eheheh ducks for cover
since Arma will always load mods/addons in the root, so you won't be able to disable them
I basically added my e:\Arma 3 Mods as a watched folder and off I go from there
I am getting close, I just gotta find the right path and I am on it. https://i.imgur.com/e2jyDbF.png
eh_killed = {
systemChat format["%1 killed", _this];
};
private _hG = createGroup independent;
private _hO = _hG createUnit ["I_Protagonist_VR_F", position player, [], 10, "FORM"];
private _ehid = _hO addEventHandler ["Killed", eh_killed];
systemChat str _ehid;
This prints the killed message twice. Why is killed getting called twice?!
arma bug triggered by rewrite of ACE Medical
thanks, and sigh!
CBA XEH events are not having this bug as it's fixed in there.
yeah i will switch to that now
... and ACE uses CBA EH's
not everywhere
and how can a mod cause a bug in a game?
yeah that is an arma bug, they should have thought of it
its classic event handler error to retrigger
Killed event handler double execution bug fix:
params ["_unit"];
if (_unit getVariable [QGVAR(killedBody), objNull] != _unit) exitWith {};
_unit setVariable [QGVAR(killedBody), _unit];
// do your stuff
as well as CBA EH?
CBA XEH does need it as it's guarded from that
in the meantime AH https://community.bistudio.com/wiki/PBOPREFIX
as you can see in the linked code.
yeah i just noticed thanks
i will just use CBA we intended to do that anyway cos other mods keep removing our event handlers and suchlike
so is it CBA_fnc_addEventHandler or CBA_fnc_addBISEventHandler?
whelp CBA_fnc_addBISEventHandler doesn't work it still fires twice
why do you have a x\ folder?
I no longer have
also best to continue about config stuff at #arma3_config
True, sorry. I am done with it zipties mouth 🙂
going to sleep, thanks everyone!!
zzzz
hey im trying to play a custom sound effect from an aircraft, and i cant seem to get it loud enough to be heard over the sound of the engines
if i set the fade distance to 1000 meters, will the sound play at 50% volume at 500 meters or is that not how it works?
Is there an easy way to count the number of seats in a vehicle? I'm trying to make sure a vehicle has between 1 and the max number of occupants in it
@leaden summit something like (count (crew vehiclenamehere)) == _maxseats?
https://community.bistudio.com/wiki/CfgVehicles_Config_Reference#transportSoldier ?
Does not include crew, but you should be able to retrieve those more easily
crew doesn't count empty seats does it?3
wait, fullcrew does
Ok thanks for pointing me in the right direction guys ❤️
so how can i Place a weapon that can't be picked up to make it like an object so to speak in the editor
@leaden summit
This is what I use for cargo seat counting for a civilian traffic script I wrote:
https://community.bistudio.com/wiki/emptyPositions
private _seats=_veh emptyPositions"cargo"; //Number of empty passenger seats
Awesome thanks phronk, ❤️ your work
@ornate prairie I've always thought that if maxDistance = 100 then at 50 you have 50% power or something like that. Maybe it's not like y/x=k but it should smoothly decrease with distance.
First off, is your custom sound normalized close to 0 dBfs? I'd stay a bit lower just because when turned to ogg, as any other encoding, being close to full scale might introduce slight distortion.
Then I would try to attach that sound to something like a soldier, just to make sure I can hear it in absence of stronger sounds.. and test how easy it easy to listen to it at various distances.
Worst case you can create an invisible particle between the source and you and have your sound be played on that invisible source, so it's actually closer than the main engine sound.. but I'd prefer it to be exactly where the item is.. Maybe also double check how the entry is in description.ext or config.. to make sure you have full volume (not sure you can go over 1.0 though)
@ebon ridge none of them is XEH
addEventHandler is handler for CBA triggered events
addBISEventHandler allows you to use vanilla EH with additional arguments tied to it.
This is XEH (config or script)
Okay thanks, that will be useful. I got the behavior I wanted by using the CBA_fnc_addBISEventHandler provided event handle id to remove it again so it only fires once.
i want to add all groups to players HC. i found this command: player hcsetgroup [Razor_team,""]; how can i set it to all groups without naming them?
looks like i have a different problem. in this sp scenario i cant set wp's for later added hc groups.
so looks like i have to enable some major hc function for the player first
forEach allGroups
ok.. i will fiddle this together, thx.
still i cant issue waypoints for hc squads, i can on the map, but they wont move. no line. in fps view they also dont move.
If you've moved them to the HC, then the HC is the owner
@worn forge HC means High Command here (not Headless Client)
yeah high command.
Ah.
Is there a way to determine if a littlebird can land in an area? Working on a pilot tasking system but I don't want to spam them with impossible LZs
selectBestPlaces 😉
although findEmptyPosition works better to find empty spots (instead of occupied)
Whew, I was expecting to have to do the area calculation myself, thats awesome, thank you!
there are a lot of functions which you can use to find locations on terrains, and they all have their uses.
Other than bestplace "meadow", do these commands check that the area above the pos is clear, or would something like a hangar tent be considered a valid area?
You can "calculate" the area, so for example: meadow - trees - houses - sea - hills
selectBestPlaces is good, but in no way perfect.
Hm, didn't see the "ambient parameters" page there. RTFM 🙄
Thanks a ton, just saved me probably a couple hours of digging through the wiki lol
Combine findEmptyPosition with https://community.bistudio.com/wiki/isFlatEmpty and you should be golden 🙂
Good morning.
In order to provide an easier way for mission makers to configure my script, I want to use .hpp "config" files. I am, however, having trouble finding information about how to read them in SQF. Using _content = preprocessFile "myfile.hpp"; returns a String of the file's contents - with which I remain unsure what to do.
Although the file has been "pre-processed", I am unable to access its contents using configProperties. In facts, "true" configClasses (missionConfigFile); returns an empty array ([]) - whereas I would expect it to return my file's top class.
I believe you'll have to #include the files in description.ext
- what is in those config files?
- how do you include those config files?
- what/how do you want to read the config files?
I believe you'll have to #include the files in description.ext
That might be the easiest option, although one I would not be keen on implementing.
- what is in those config files?
Let me copy the one I just did to test that out:
class Users {
class root {
password = "password";
clearance = 7;
};
};
class Files {
class welcome {
text = "success";
};
};
- how do you include those config files?
I currently don't. I consider#includeto be a "static" way of doing that, and I would like to avoid this.
configs are static as far as I know
Scripts don't read files like that on the fly
Configs are required to load when the game starts, so must be included with #include and must be inside a mission or mod to function.
There is one exception though: https://community.bistudio.com/wiki/userconfig
If you want mission makers to configure the script, have them subclass a config class that you've supplied
class BaseConfig { foo = "xyz"; };
class MissionMakerConfig : BaseConfig { foo = "abc"; };
something along those lines
configs are static as far as I know
And I don't need them to be dynamic. I need a way to load as many of them as I can without worrying about having to add them all to the description.ext.
What is the actual purpose of the configs?
It sounds like you're trying to fight the framework, honestly. If you're trying to keep description.ext clean, you can #include a file that #includes all of your headers
Scripts don't read files like that on the fly
That costs me dear to admit it. I guess I will have to find another way around that issue.
CBA Settings framework? 🤔
It sounds like you're trying to fight the framework, honestly.
I probably am. I am still learning all that scripting stuff and I am mostly unaware of the limitations of the framework so far.
CBA Settings framework?
Wouldn't that require the mission makers to use CBA as well?
well.... if it's just mission settings, why not use https://community.bistudio.com/wiki/Arma_3_Mission_Parameters ?
What is the actual purpose of the configs?
Sorry for the xyproblem here.
Those configs are to be the "init values" of electronic devices (computers, tablets...). Those electronic devices (which are actual "objects" in Arma 3) have an ID (like the ones you can give to triggers or units) that I planned to use to read the corresponding config file and populate these electronic devices with the content of these config files (i.e. users, files...)
As a result, I am unable to predict how many config files there would be.
There could be dozens of config files (for dozens of devices) with different users or files in them.
Maybe I'm a C++ dev with a hammer, but that sounds more like a job of an extension rather than configs
What's the difference? An extension would also need those config files.
what you can do is an include of a single file, and in there have one entry "id" "values" per object
+1 item = +1 entry
Something like that ?
class Devices {
class Device1 {
value1 = "abc";
text = "blabla";
};
};
That might work then... I am sorry I didn't get to see the broader picture before.
You can even make a macro for this
While I know what a macro is, I'm not sure to understand how I could do that.
don't worry, we can help on this one
Thanks Relic, Grezvany13, HorribleGoat and LouMontana for helping me on my first newbie question 🙂
I think I will go with what Lou Montana suggested.
to be fair; I wouldn't even touch config files in this case, but create functions to dynamically create objects for a mission, instead of pre-defining them.
Of course, having a set of pre-made objects can be done as well.
create functions to dynamically create objects for a mission, instead of pre-defining them.
I already had a take at that thing. The mission makers I am collaborating with had some... issues using said functions. That's why I decided to try something else, i.e. the configs.
Lou Montana, I just read the wiki page about preprocessor commands and macros. Did you mean I should use one of the command other than #include?
@vocal agate maybe use XML instead for a Config
you'd be looking for #define
😮
I think XML can do the job, honestly. Although I have some... bad memories with it.
I will try to find parsers for the file formats I believe are a bit more user-friendly.
You're all amazing here ❤️
Tell me, how can I do that except for the commanders, no one could put tags on the map in an additional channel?
Do they have an assigned role? if so, just delete any markers made by players that don't have that role
Is it possible to combine this with TFAR?
If the player has a long-distance radio, he can put tags in an additional channel. And if there's no radio, he can't.
sounds like if !( backpack player in ["classname", "classname2", "etc"] ) then { deleteMarker "marker"; };
Pity there's no eventhandler for when the player places a marker
There really should be honestly. You could probably hack one together using UI events & publicVariableServer & addPublicVariableEventHandler, but it'd be ugly
Though I suppose you could add a ButtonDblClick ctrl event handler, combining it with currentChannel
not sure what you mean by additional channel
probably a custom channel that isn't standard
sideChannel
Question on MP scripting; if I want to call a function file do I have to compile preprocessFile 'path' in both initServer & initPlayerLocal?
kind of, I know how to do that; just wondering if "funcA" that I compiled in initServer is accessible in a client local script
still wrapping my head around locality lol
I think the filename initServer will probalby tell you all you need to know about that. If you want it accessible to both, you'd use init.sqf
lol good point
@lapis ivy not tested, but this is what I'd do... just replace the classnames below with TFAR classes. Disables double-click action for placing markers if you are in side channel and aren't wearing the proper radio backpack
mapEventHandler = (findDisplay 12) displayAddEventHandler ["ButtonDblClick", {
params ["_control", "_button", "_xPos", "_yPos", "_shift", "_ctrl", "_alt"];
if ( _button == 0 && {currentChannel == 1} && {!( backpack player in ["classname", "classname2", "etc"])} ) exitWith { true };
}];```
Thanks, I will check back later.
Anyone around here ever attempted to create a unit caching system for use with HCs and Zeus?
TMZulu Headless Client or High Command? Not gonna get burned again
Headless. I’ve been making my own system based off a mix of werthless and acex
define unit caching? Do you mean using enableSimulation in some way?
Essential either fully or partially removing or disabling simulation on ai units not within a certain distance of players
And then respawning them or enabling simulation once they are
There are a few script out there for editor or spawn scripts style of unit spawning but I don’t think there is one for Zeus.
You may want to review dynamic simulation as arma has already got some good functionality baked in as you are describing: https://community.bistudio.com/wiki/Arma_3_Dynamic_Simulation
It seems to apply to mission spawned units, as when I'm viewing my MP mission in Zeus, AI units that aren't close to players aren't moving until players (or the zeus curatorCamera) gets close
is there a list of icons used with drawIcon3d somewhere?
Yeah I’m aware of dynamic simulation however that doesn’t seem to function in the way we intend it.
Relic, you can use pretty much and .paa with it. There are a bunch of icons in the Arma source folders you can use though. I can’t remember the location hopefully someone can give you it. I don’t think there is a list anywhere though as the icons are spread out across multiple pbos.
ah ok, yeah that seems to be the theme for any assets lol. I'll probably just throw something together using ImageToPAA
I would try looking through the arma folders there are more icons for things than you’d think. You just gotta find them.
@austere sentinel I've been using drawIcon3d lately, here's what's useful for me:
- You can use any of the task icons, ie.,
taskVariable call BIS_fnc_taskTypeIcon - Rank params will work, ie.,
[_unit,"texture"] call BIS_fnc_rankParams - As Zulu says, any .paa will work, ie.,
"\A3\ui_f\data\igui\cfg\simpleTasks\types\target_ca.paa",
Ah yeah ui_f has most of them
You guys are awesome, thanks again
When placing the icons if you're sync'ing it to a unit, use visiblePosition instead of getPos, per Killzone Kid's blog - http://killzonekid.com/arma-scripting-tutorials-boundingbox-boundingboxreal-composetext-formattext-visibleposition-visiblepositionasl/
Using it to mark LZs/Bases for pilots. The icons won't be moving at all (in world space at least), was using tasks but it doesn't show the icon in the UI, just the 3d waypoint icon
@coral owl my custom sounds being used I balanced myself just by testing in game. What is dBfs? I’ve been working off the official wiki which makes no mention of this in the sounds configs.
I have more or less solved my original problem, right now I’m trying to figure out how to stop an sfx from looping after starting it. (setting it to nothing and deleting the trigger don’t seem to work)
oh sorry @ornate prairie for dBfs I meant the peak amplitude value in an audio software, just to make sure the audio file itself is not "weak" so to speak. Basically 0 dBfs is the point at which your typical red light that is "OVER" or "PEAK" turns on and the sound, from there up, starts distorting.
I basically only meant: you obviously made sure the sound file is not "weak" in volume by itself (hence I usually normalize audio files at around -3 or -1 dBfs maximum peak level in an audio application).
ahh ok
i have also notice when searching through people's sound configs online that they use "db+10" to set the volume of a sound, though the wiki doesn't explain this at all. Do you know what that means or how it works? (currently just setting the volume to 100 - 300 depending on how loud i need a sound to be
Q: when working with the particle source stuff and a target object, with its own position... can I adjust the position of the spawning particles using the particle array position input? In other words, if I want particles to spawn 200m above the target object, then that is something like [x, y, 200]? Seems straightforward enough, I just wanted to clarify... Thanks!
yes it should work like that
so how can i Place a weapon that can't be picked up to make it like an object so to speak in the editor
#arma3_editor or #arma3_scenario would be the right channel for such topics in the future. But it could work if you make it a simple object
@young current so when i set it as an object i can pick it up but i dont want to have anyone pick it up
probably not
for that I dont know an answer
from your initial question I though you just wanted it to be a prop, not something only you can use
no worries i appriciate you giving me some advise to find some answers
what is the usecase?
i dont want anyone to be able to use it i just want it as an object i dont want anyone to be able to interact with it
but when i start server i can pick it up
perhaps you could tie an addaction to it that only shows to you
so that it checks the player has your steamid or something like that
it sounds a bit cheaty though 😛
yea i rather not do it that way lol
^this would be the easiest. I thought there was an event handler for taking stuff off the ground, but it seems it only handles containers
yea
you could just put it in a box, delete from anyone's inventory but your own (using the Take EH) then replace it in the box
The Take EH triggers for GroundWeaponHolder as well
well i dont want myself our anyone to be able to pick it up
when you place the object in the editor; check the simple object checkbox
ok ill try that and see
if that option doesn't exist, disable simulation on it. You'll still be able to "interact" with it (i.e. the 'take' option shows up), but it doesn't do anything.
you will just keep attempting to pick up but it wount pick up correct
yep
How would I make an event handler that automatically applies to all units in the mission of a certain class?
It would take forever to add them to each unit's init
@austere sentinel so i was still able to pick up the weapon
😦
oh i figured it out but know i need to figure out how to get it to not fall of the object i have it sitting on lol
{if (_this isKindOf "placeholder_1" OR _this isKindOf "placeholder_2") then {
_unit addEventHandler ["Killed", {
[_this, {
params ["_corpse"];
private _dummy = "#particlesource" createVehicleLocal [0,0,0];
_dummy setPosWorld getPosWorld _corpse;
_dummy say3D "placeholder_death_sound";
}] remoteExec ["call"];
}];
}
} forEach allUnits;
would this work for adding death sounds to specific classnames?
it would be executed at mission start
Hello there guys... I am a super noob on scripting and I would like to just start learning. I tried to set a holdAction on an .sqf file to run it on MP and multiple "objects"/units. But I keep getting a "generic error" message. Does anyone would like to help a bit? If yes please DM me (I do not want to spam here and possibly scroll up and down to get all the pieces of the conversations!) Cheers.
if you post at least the concerned line people here could help here @rugged acorn
its showing its set in CBA settings?
a simple yes or no would have done... its kinda built into ace didnt need to see the script.
i play a sp scenario with team switch. when i switch, i become squad leader. but when i switch to the next unit i want the unit to have a stop command issued, or hold position
this is what i got so far: onTeamSwitch commandStop;
Hey all, I am looking to create a script which will be executed by a Zeus Module. I have no idea how to do this but I am at first needing to get the object that the module has been placed on. Does anyone know how I can do this?
i rephrase my question: i want onteamswitch the last controlled unit to get commandStop, but i cant get the syntax together.
well maybe like this. onTeamSwitch {_oldUnit commandStop};
or like this onTeamSwitch _oldUnit commandStop;
it makes me crazy.
Replace _oldunit with _from and it should work
Dedmen, could I hint "logic" then to see what the module is placed on?
If i understand the biki correctly _from and _to are automatically assigned in in onTeamSwitch for the old and new unit.
My name is Dedmen
or the fact when you release the AI as SQL, it starts issuing orders again.. try making it so when you switch order to move where you are already.
you can hint or systemChat or diag_log or remtoeExec whatever you want
Also: When player switches and leaves behind AI unit, you need to enable "TeamSwitch" AI on it (with onTeamSwitch { _from enableAI "TeamSwitch" };) so that the unit continues with waypoints.
@Helltiger
If ai is disabled it wont do anything.
thx. i dont want the ai to move. when i switch away from a unit (its in the same squad) i want the last played unit to get a stop command.
So logic is the item under the module?
i play every role in a squad, when i switch, i become team leader, but the unit loose its stop command.
@sacred slate
https://community.bistudio.com/wiki/disableAI "TEAMSWITCH"
Ai tends to ignore stop orders. Better to just disable pathing
(they won't defend themselves)
else ```sqf
onTeamSwitch { doStop _from };
can you get rotation values from getpos?
I'm loading a script in a sec
basically trying to spawn some things inside others with setpos get pos but they spawn rotated at 0°
getDir/setDir should do the trick yes
should it be in another line or can I put it inside the setPos?
createVehicle ["Land_pond_01", getPosASL p2, [], 0, "NONE"];
@winter rose
not sure how to phrase it since the spawned objects will not have variable names
another line; no "direction" in https://community.bistudio.com/wiki/createVehicle
but how can I set the direction of an object I have no variable name?
could use the way people use to manage terrain object but forgot how it was called
look again, createVehicle returns the object
private _james = createVehicle ["Land_pond_01", getPosASL p2, [], 0, "NONE"];
_james setDir 225;
also, you should use → getPosATL ←
I need them all at a specific ASL height(even though it doesnt seem to work
I'll show you why
Subtle joke lou
@smoky verge the createVehicle command specifically takes ATL position; hence why it won't work
you can still setPosASL after creating it
Which is quasi instant so you wont notice it
yeah istantaneusness is not a problem thankfully
ok think I got it
if you were wondering, yeah its for that thing
https://imgur.com/a/eVsAVII
working then?
with pleasure
that's sexy looking!
the reason behind this messy script is because ponds have infinite depth so you'll be underwater no matter how under them you are
so I made so players can walk inside the Dam before they get outside and then spawn the pieces for when they surface on top
vehicles exist globally, but their locality is weird if created on the server I believe
I defer to lou though, he's the living wiki here 😛
you would be strongly disappointed with me as a wiki, even against a 502 one 😁
so is that a yes or a no?
if you createVehicle, the pond would exist for everyone
if you createVehicle_Local_, it only exists for the current player - which is what you want
you don't want to have a playerA walking under it then, because another playerB is out of your structure, playerA having to swim
but I need it for everyone, there wont be any playerB luckly
plus pilots who come afterwards would need to see the hole filled
all the players will run this script
so locally, if they go under it, it's not there
but others outside will have it
if you create it globally so the pilots see it, then all players walking under it will swim
because it would be one state for everyone
the players will activate it only when everyone is above it
and the pilots will not pass until they are above
its all conveniently organized
okay then, your call on mission design
thanks for the help, was getting desperate
pleasure
i'm trying to create an objective that will trigger when the player knowsAbout a static object placed randomly on the map
however, it seems that the moment the mission starts, my knowsAbout of said object is immediately set to 4
anyone have any possible workarounds?
create item after mission start
tried that, still 4 when it spawns
then just issue forgetTarget?
tried that too, it kinda does what i want it to, but it means the player then has to manually mark the object with T even if they're looking directly at it
weirdly doing it that way doesn't return 4 on knowsAbout, but 1.5 instead 
knowsAbout is also more useful for AI, since the engine can never know what a player knows 😉
spawn it in the middle of nowhere, then teleport the object back into view distance
knows about says its reset to zero normally if goes out of view distance?
Note: neither fog nor daylight affect this behaviour ```
no joy, now i apparently have no knowledge of it even when standing right next to it 
is automatic reporting off?
nop, but even if it was when i was manually marking it with T it was still returning 0
you got an HQ for that side?
a what 
is the unit you are spawning the first unit of that faction in the game?
and you are placing that unit using a script? or 3den?
hold on who are we talking about
atm i'm just in a test mission where i'm the only soldier on the map, with an object randomly placed somewhere
done via 3den atm
then ignore what i said
HQ is automatically created if you place everything via 3den
what is the static object in question atm just wondering
based on the discussion in #arma3_ai it seems that all the functions like knowsAbout, targets*, etc. are not predictable, even for AI usage.
Quiksilvers I&A tanoa does basically what you trying to do but where in all that code I cant say nor know so know its possible.
weirdly if i swap the generator out for an opfor soldier, it functions as expected
usually there's a trigger which works by range (eg. if target range < 100 = trigger action)
its likely cuz its a static.
that's what i'm starting to think too...
mby player always knows where all statics are?
could i have an opfor static?
place a empty tank see if you get the same result as a static or like a soldier
placed 4 units and here's their knowsAbout at mission start
csat soldier - 0
full angara - 0
empty angara - 0
static generator - 4
interesting
urgh, even manually changing the generators side to east in the sqm doesn't work
well the static is civ by default trying to change its side see if that helps but not a specific one trying 'enemy' 🙂
knowsAbout most likely only deals about AI knowledge yes, not objects
must've changed it for arma 3; i remember this working just fine in arma 2
Lou, what about some trickery and use a invisible unarmed AI?
I know I did some player-side trickery with checking if an object was on screen…
BI does with distance…
invisible AI would be, well, invisible
CBA_*_invisibleTarget refering to
this could work 
hmm.... currently testing it on Altis, where I have a unit about 11km from a static object (ammo crate), and knowsAbout returns 0
yeah when they're on the other side of the map it's fine
CBA invis targets seem to be close to what i want it seems - doesn't instantly hit 4 at a glance so that's good 
doesn't build up very quickly either 
could be one of the reasons they even made invisible AIs
can make static map objects have proper spotting/knowledge like if its manned by AI but dont need to be?
hell could be a miarad of factors that generator has cammo value also
It seems that knowsAbout is always 4(?) for objects within viewDistance, but goes down again depending if it is allowed to see it.
Because targetKnowledge says it "knows" the object (even has a position), but still returns false for "knowing" it
yeah the error factor is what goes up I believe over time? honestly I have no clue how the real underpinnings of this stuff is.
I would come back to "why do you need that?"
mission objective to trigger a event I believe is the end game
kinda like how I was saying QS's I&A has laser designating vics for CAS strikes. otherwise cas cant engage ground with how its set up
you can put a civilian close to the generator 😄
gotta look at it hold space, then it marks the target and reveals it for cas
or do what I did, a client-side script that will check that said generator is on screen and generatorHeight > x% of screen's height
that's a bit of a roundabout way to do it, lol
I was thinking cursor look at
hmm, that could work i guess
btw what is that script/module that does the new 'hold enter/space' thing to interact you see like in Oldman and Contact
cursorTarget + time > _t + 5 or something
the interact spin wheel cant even think of a name accurately to describe it
holdAction
ty thats likely it

cursorTarget and a timeout trigger works well enough i think
thank for patience everyone 
brainstorming FTW
i quite like the idea of that hold space thing now that you mention it 
wonder if i could get it to do the same thing but without hold a key just as a visual feedback that stuff is happening for the player
well you could derp it with a addaction with a insane distance 😛
perfs-- 😄
could do, but i'd rather the player not have to press anything if i'm gonna go down that route 
now ya just asking for like raytracing detection with object occlusion....
make it so, number one
sadly if this was second life I could hand you the script over cuz I wrote it
creates AI with Machine Learning which is capable of writing scripts to do anything I want
@bright flume lineIntersectsWith
down side being "a tree? a bush? a window? can't see through"
yeah but the whole wrapper is where I'd be hung on. making a raytracing gun was hard enough.
I did a proof of concept Slenderman once in A2 😄
if he was on screen (and not hidden by objects), the screen would shake
nice
yeah arma has poor object occlusion to rely on trace rays
why ai shoot at you thru everything.... perfect eg. tanoa
spends millions of dollars inventing an AI that will automatically put a ; at the end of your lines so you don't keep testing the mission and get hit with error missing ; every time you start honestly stupid machine what is your problem youre smart enough to tell me its not there but not smart enough to put it on yourself
that would be a text editor rule, and it already exists 😄
or you learn the right way and start only in VI as your editor...
I still use VI for my git commits lol
"how do you generate a random string with VI?"
"you place a new user in front of it and ask him to exit the editor"
Word!
but thats only if they randomly hit i or a otherwise who knows what will happen.
wq! the god all power
#offtopic_editors?
yes, I'm dropping the topic already 😄
Well I mean if you mispell a command or just not recognized as anything it'll throw "missing ;"
player enableMoarFps false;
for example.
player enableMoarFps false;for example.
@high marsh
Ultimate hacker command lol
Can you help me? The map label mod doesn't work well with the ace mod
I certainly cant. But maybe others. Give more info pls
This mod works together with TFAR, it changes the interface of map labels. It has everything I need, but if I run it with the ACE mod, the interface doesn't change.
what are map labels
I'm sorry, I can't Express myself correctly, I use a translator myself from Russia.
Double-click on the map = tags. Em... how to say it correctly.
You can identify yourself and write something on the map. For example, your nickname and put a point where you are on the map.
A, thanks
Markers
I can send the mod in the archive, can anyone see what's wrong with it?
I think perhaps you want to post on the bohemia forums, or in another discord channel that deals with mods... if you don't have specific scripting issues to sort out, not sure this is the channel to discuss it
Ok, thanks
Not sure how TFAR and ACE are connected to map markers and scripting
Through eldritch magic
This is because if you don't have a long-distance radio, you can't set a marker on the map in the side channel
Ah! Nice idea
If you suspect its a scripting problem, have you tried putting diag_log everywhere, and seeing what doesn't get log that should get logged?
No, I don't really understand it.
How do I do this?
Oh, I still don't understand how to do it correctly 😄
Hello, how do we recompile functions added with config?
https://community.bistudio.com/wiki/BIS_fnc_recompile
But recompiling needs to be enabled in CfgFunctions
Oh, I still don't understand how to do it correctly
Just add logging everywhere, if you don't understand how to add logging to your script and the wiki page doesn't help then I can't help further either
I have added recompile = 1; to cfgFunctions but it doesnt load edited sqf. Maybe I understand it incorrectly?
and then with BIS_fnc_recompile you trigger a recompile
it ofc can only see updates if it even has access to them. meaning filepatching and files in correct place
I tried this from wiki: 1 call BIS_fnc_recompile; and it doesnt recompiled it. All files are on P drive
All files are on P drive
Arma doesn't know what a p drive is
they have to be in your arma directory, in the correct pboprefix path
for example
SteamApps/common/Arma 3/z/ace/addons/common/functions/fnc_test.sqf
ok great, thanks will try it
There were some questions lately related to particle effects. Is anyone able to share some insight into how to create a decent smoke artillery explosion? Right now you can spawn all manner of smoke shells, but they basically land and then lazily generate smoke. I want serious smoke!
most methods are client side mods. and a few server based ones like splendid smoke.
So not sure whether ask it here
I tried following the setup on wiki for files loading using FilePatching but got nothing.
Is it supposed to be like that:
ARMA 3/VTX_FLIR/addons/vtx_uh60_flir.pbo and file $PBOPREFIX$ in Arma 3\VTX_FLIR with this line inside: x\VTX_FLIR\addons\vtx_uh60_flir ?
I also have to have pbo file in there becouse Arma3 Launcher does not add this folder without pbo file in it
I feel stupid.
big problem is fx tend to be client side limitations/settings and unpredictable
$PBOPREFIX$ in Arma 3\VTX_FLIR
No, the pboprefix is inside the pbo
I also have to have pbo file in there becouse Arma3 Launcher does not add this folder without pbo file in it
You load the pbo as mod, and if the file inside the pbo, is also unpacked in arma folder, it'll load the unpacked file instead
I'm fine with it being client-side, it's atmospheric more than anything
so, you load -mod=VTX_FLIR (btw mod folder usually start with @)
and then you have
Arma 3/x/VTX_FLIR/addons/vtx_uh60_flir directory, with your files inside
I dont quite understand the reason for x folder, I added it like you said now
Launching game with -mod=VTX_FLIR doesnt seem to locate the mod, shouldnt it be -mod=x/VTX_FLIR?
no
I dont quite understand the reason for x folder, I added it like you said now
Its in your pboprefix, you need to have the same folder structure as in the pbo, which means with pboprefix
assuming that is actually the pboprefix of your pbo, and not some random file that is laying around nearby
hello i have question, what is the variable that declares v_item space ?
v_item? what's that?
is the life server item virtual
okay is framework tonic 🙂
I don't know because it's a burden and I want the place
Yeah that code is a real burden to read, so outdated and messy.
I don't know life well enough to be of any help
is it possible to create a task for a spectic unit?? For example ```sqf
[_hvt, ["task1"], ["GET TO THE POINT ALIVE AND RECIEVE A REWARD", "Get to the point! ", "pen"],pen,"assigned",99 ,true, "run", true] call BIS_fnc_taskCreate;
just replace _hvt with whoever you want to have the task
@worn forge have you figured out smoke artillery?
i recommend you take a look at goon dust for an example of nice particle effects. They run clientside and are spawned in a donut around the player to simulate far away dust and restrict view distance.:
http://www.armaholic.com/page.php?id=29026
Also you will need to deeply test AI behaviour with these particles. i dont know if they can see through it or not, so if the players use your artillery but ai can just see through it.. suboptimal
but im very interested if you can come up with a solution. smoke artillery in arma sucks.
I think you selected wrong nick 🙂
sorry river
Yeah, I found a lovely script and I've learned much from it.
script for smoke art?
not specifically, but it had a great example that pointed me in the right direction.
alright. tag me if you produce something usable
also if you find out how AI reacts to it
It's client-side, so AI won't react at all. Well, at least, theoretically it's client side, though the effect is createVehicleLocal'd via remoteExecCall to all clients, which would include the server, so... who knows?
My implementation is that AI OPFOR fire a volley of smoke rounds before they assault, so it's only meant to cover an advance anyway.
you can exclude the server for that with -2 (iirc)
ah so its used against the player.
also if you also execute on the server, why execute on the clients too?
my understanding is that particle effects are local.
^ yep
Better to use BI GC or make my own?
I feel like it could be easier to just use the BI one as I can just "add to" the GC at any time.
yep, BI GC is fine
you can still have yours and the BI one as backup, it depends on what you want to do really
how do smoke grenades restrict AI view? are they not particles?
They are, I believe it has some geometry that provides blocking.
^
Do you have further info i can look into?
Or is there an option to add geometry to a particle
I think this applies to models like trees and buildings though. So I don't think that's right.
see https://community.bistudio.com/wiki/Arma_3_Particle_Effects , that's the best I have (so far)
blockAIVisibility = true;
@spark turret ^
^^
Interesting. I need to tesr if it works for big clouds too
well, sure thing
just that it will eat some more CPU, but not that much - I believe it's better to have one big cloud than many small ones
Does the particle need to run on the server to be Ai blocking then?
I would say yes