#arma3_scripting
1 messages · Page 130 of 1
speaking of... im about to set my project to public on github because im just too excited about it
:D
then ima take a nap
because my head hurts
the SQF wrapper thingy?
yah
its pretty much done except for writing you know, hundreds of wrapper functions
haha
but a lot of those can be auto generated
maybe i will check it out
and macroized
i started that stuff with C#
Then in the group attributes panel by clicking the flag, post the code, but change units group player to units this
Sorry in and out of sleep lol, rough night
Fellas, I have returned with a quick question - to remove addaction, I have put this in the item init
this addAction ["<t color='#880808'>Read the Liber Maleficarum</t>",{ [[],"chaos.sqf"] remoteExec ["BIS_fnc_execVM",[0,-2] select isDedicated,false]; }, [],1,false,true,"","_this distance _target < 2"];
I am wanting to remove the addaction for all clients once activated, would I need to do this in the chaos.sqf or can I do this on the item itself? Basically I am trying to activate this script for everyone on the server but have it done locally since its particals (if that makes sense sorry)
You want it removed on all clients after one person executed it?
Yes
So one person activates it - script plays for everyone but locally - then no one can use the addaction after someone already activated it
Ok, let me hop on pc to type an explanation.
Thanks mate
BIS_fnc_execVM is outdated. You can just remoteExec execVM (or make the file into a function and remoteExec that)
Option one, (preferred) changing a variable so that the action won't show to anyone after one person executes it:
this addAction [
"myAction",
{
[] remoteExec ["myLocalFunctionInsteadOfFile", [0, -2] select isDedicated];
missionNamespace setVariable ["myFunctionActivated", true, true];
},
[], 1, false, true, "",
toString {
!(missionNamespace getVariable ["myFunctionActivated", false]) &&
{_this distance _target < 2};
}
];
Option two, save the actions handle on the object itself locally when you add the action, then grab it and remove it. This is because if you add actions in different ways for different clients, the action stack number will be different:
private _handle = this addAction [
"myAction",
{
params ["_target", "_caller"];
[] remoteExec ["myLocalFunctionInsteadOfFile", [0, -2] select isDedicated];
[[_target], {
params ["_target"];
private _handle = _target getVariable ["myActionHandle", -1];
_target removeAction _handle
}] remoteExec ["call"]; // Or you make this section a file as well and remoteExec that instead
},
[], 1, false, true, "",
toString {
_this distance _target < 2;
}
];
this setVariable ["myActionHandle", _handle];
Thank you heaps mate, I am reading through and looking things up to make sure I understand it
just start using the CfgFunction library when you need to start executing code for remoteExec instead of writing in line stuff
there is your chance! :)
or if you are using CBA, their event system is preferred to using remoteExec all together
fyi it was that and the waituntil worked, thanku 
forked
haha
re myLocalFunctionInsteadOfFile - does this mean I need to have
chaos = compile preprocessFile "chaos.sqf";
Somewhere in my mission file? Im trying to understand this while reading the wiki I might be messing up
Im attempting to make Option one work for me
You could do it like that, though you should use compileScript and a more unique name to prevent conflicts. The recommended method is to use CfgFunctions: https://community.bistudio.com/wiki/Arma_3:_Functions_Library
lets see how fast this gets on unknowncheats lmao
If you did it like that, "somewhere in your mission file" would have to be, specifically, a context that's executed before the function actually needs to be used, and on all machines that need to use it. (CfgFunctions takes care of this for you)
depends
the two preferred methods are CfgFunctions for vanilla, and PREP in pre & post init for CBA
some here might post it
I see, thank you for the explanation, I am using CBA so I yeah ill have to do it in a config.cpp located in the mission file, right? (I will use method 2 provided)
didnt expect to spend the better part of an hour fiddling with commands to get this working but now I know how to attach lights to fences with custom light sources and have them be destroyed when the fence is destroyed
https://cdn.discordapp.com/attachments/801143855273214005/1217869644237373473/2024-03-14_17-16-31.mp4?ex=6605987e&is=65f3237e&hm=2321b7b1c0d216b2690b891b222045bc211bcc4d9611cb9ca546de18291f8120&
but well ...
there was some sort of simmilar project up already
which i checked out last time i thought about writing an arma mod just in c/c++
so ...
nothing rly new ther
no, i was mentioning that stuff for when you get more advanced. use cfgfunctions for now
yah, though this is intended to be stable and easily usable (and legitimate)
so i imagine it'll be fairly popular
all things can be used for both sides
Got it, thank you heaps
lets keep it in theory
Okay, i am having a minor problem
I am basically as Newb when it comes to arma scripting as you can get but I am attempting to make a custom ORBAT group (the ones from the east wind campaign) For a AAF remnants campaign im running
From what ive read i needed to make a custom missionconfigfile
which i attempted to do by making a Description.ext file in the mission root folder (which i believe is just the mission folder where you place img's for ops n such and where the sqm is). I then copied the example CfgOrbat slightly changed it to match a bit more to what my group is playing as.
Whenever i launch the mission file in singleplayer with These settings for the Orbat group module (first linked image) I get this error (second linked image)
I genuinly dont know whats causing this. Mainly because i dont know how to setup any of this in the first place
And to edit/make the "description.ext" file I renamed a Txt file to description.ext because on the Wiki it says you can bypass notpads automatic addition of the .txt extention by wrapping the name in quotes but i couldnt seem to get that to work
So i just made the file a .ext and then opened it in notepad
back to scripting:
fastest way to find minimun number in an array of numbers?
Ceiling path i just realised what was wrong there
but the classes are those the ones after the CFG orbat?
so would i change the "BIS" and "B_1_A_1_2"?
depends
is it pre-sorted at least a little?
or is it completly random?
because in second case you have to check every spot
missionConfigFile >> "CfgORBAT" >> "7thInfantry"
Okay, that got it working on the map
But the icon is invisible and there are no squads under it
Correct me if im wrong, but i believe the way to fix the squads would be a new Orbat group module, and creating a sub-class in the Description.ext file?
and it would be similar in look the the 1st BCT that is in there currently?
And removing all the helicopters from there would be removing all the assets from the asset page
not pre-sorted
The wiki has basically what i have in my file but it doesnt really explain what any of it does or is and so ive been kinda winging it up until asking here
im starting to figure it out now though hopefully
or I may just be a muppet who fails at reading comprehension
yeah, thats the one I have open
I'll update that page with a working example.
however, if you know the minimum you can stop at the absolut minimum
C++11 is honestly like the best language out there in terms of hitting all the marks
14 is even better
and 17 is looking really good
seriously if you know the "right" way of doing things
you get all the benefits of a "managed" language with no speed drawbacks
well ... c++ not suits for every purpose
small applications for example benefit more from c#
as most stuff is already available in one of the default libraries
Okay, ive gotten everything working now
and gotten subbordinates working correctly
but whenever I'm in the orbat menu and click on a unit such as my Platoon HQ I get an error. I believe its an error trying to zoom onto the map marker but im not too sure.
on the same note as the map marker though is there a way to move the marker to a specific spot, or is it just stuck where the unit you attach the module to is?
https://community.bistudio.com/wiki/copyToClipboard
is there a length limit?
as far as i can tell, no realistic one
Weird.
The marker will be were the module is. If changing the modules position also ch anges the marker position I don' t know.
BTW if anyone is interested in or needs to write wrappers for functions, here is the file with the three example ones implemented: https://github.com/NouberNou/intercept/blob/master/src/client/intercept/client/client.cpp
Been a while since I messed with ORBAT, but I distinctly remember that a script in the ORBAT system contained an unavoidable error (i.e. the script would throw an error even with a correctly configured ORBAT). I'm around 51% sure that it's the same error you have here (Error 1 elements provided, 3 expected with ctrlMapAnimAdd).
feel free to find it using this here eg.
_s = " ";
while {true} do {
_s = _s + " ";
};```
as said @grizzled cliff
will check it out right now (dota done, won the game :3)
Intercept factory generated RStrings are currently limited to 2kb
Dang, hopefully since i local host all my ops i'll be the only one who gets the error and i can just tell my players "dont click on stuff in the orbat menu"
eventually will make it so they can dynamically allocate more
Anyone know which server property resets the mission to the default mission without giving people a chance to read the end screen / description?
It just needs like, 3 extra seconds.
By default (if the -showScriptErrors startup parameter is not used), script errors are not shown outside of the Editor. The error will still occur, but most players are not going to see the error message.
ouch
looks like a hell lot of work to put all 2k commands into that cpp file ...
Yeah, then i should be good
of course it will be broken up a bit
thought the same
well XD
Nou now has the same problem like i have but at a different topic
cause they are all standardized
all math functions wont be needed either
yup
yah
Hey! Do you have a tip on how to disable incoming voice in a multiplayer mission from sqf (need to control it from sqf and only conditionally disable it)?
https://community.bistudio.com/wiki/enableChannel
clearly states: This command: does not disable incoming text or voice
not even + - * / etc. are needed
mimimi
you always have to drag the simplicity out right ...
yah no math operators, no arrays
what about callExtension ;)
technically i might keep it
You could use fadeRadio to mute all incoming voice. There isn't really a way to do it per-channel though, other than removing the player from the channel (for custom channels only) or removing other players' ability to transmit.
i mean nothing stopping it from working lol
compile and call are more interesting
for test automatization
yah, those are going to stay in
Is there a way to make a player incognito to AI so that they could sneak past a checkpoint but if they draw their weapons then they will be shot at?
cause in ACRE2 i want to port some loops over to this, but they call dynamic functions in other pbos, and i want to keep those in SQF for now
so you can mix SQF and C++
pretty easily
The usual approach is to use setCaptive so that enemies consider them civilian-side.
Making a unit invisible to AIs, or even making an AI blind is not really an option.
You need various event handlers or monitor functions to detect when the players should be detected and remove the setCaptive.
Okay. Thanks. Are trigger’s acceptable to detect that? Would I have to work out how to detect if the player has their weapon drawn?
Turns out it is less unavoidable
If you have the OrbatGroup module synced to a unit it will throw the error that it cannot jump to the unit. If its not synced to a unit than it works just like it does in the Campaign where it moves your map the the modules location
atleast thats what ive just tested
was for many of us @candid sun
mcc save sqm is broken - nothin i didnt expect
now that we have C++ access, who is going to port Qt to Arma's UI system? :D
Qt?
Hi, Ive got a condition trying to make sure that player is currently wearing and using nightvision goggles. I'm checking for hmd player and also currentVisionMode != 0 but that condition is also true when player is operating a vehicle turret in full-screen (I assume using a night vision scope/binoculars is going to be the same). Is there a way to eliminate these two cases?
enableRadio false;
enableSentences false;
0 fadeSpeech 0;
0 fadeRadio 0;
{_x enableChannel [false, false]} forEach [0,1,2,3,4,5];
This is all atm but doesnt seem to work
the GUI library
even with the player stuck in global they can hear the incoming vc ongoing in sidechannel(1)
then perhaps setPlayerVoNVolume foreach allplayers
jk, its actually easier to just render it into the Arma pipeline
can make sure the player is on foot with objectParent player == playerisNull objectParent player
jaynus had a demo of that
isNull objectParent player
well that would mean global muting everyone. I need to disable a selected player's ability to listen to others: while those can still speak
was pretty cool
setPlayerVoNVolume is Local Effect, meaning their volume is only adjusted on the machine where the command is executed
thx for clarification should work then. Awesome! Thank you!
yeah but at the same time I want to be able to run my code while in a vehicle; now that I think about it, somehow excluding "is aiming" in my condition would work, regardless if in a vehicle, or using a scope/item with such parameters. Just not sure how to do that 
roughly how would one "render it into the Arma pipeline"?
hook the directx functions
just one question is left
yep
interactions
mouse clicks etc.
its cool you can render it in
but if you cannot interact with it then it is rather useless
you can intercept interaction tpp
apparently you can
Qt recognizes the window space
and will take clicks and events
found it: for reference / anyone who's curious, cameraView == "GUNNER" is what I was looking for
and intercept them if they interact with its known coordinates
or hook wm messages
well ... never used Qt
yah, dont, its huge and horrible
BUT
its still the best cross platform GUI toolkit
hell KDE is written in it
or was
haha
ok, i need to take a nap, or ima have no time tonight that is productive
bbl
gn8
same here gn8
Is there a way to disable ai collision detection?
I have an aircraft (heli). I want to attach a large 3d object to it to make it seem like that large 3d object is flying.
Issue, heli just keeps flying up and up and up. Apparently AI thinks it needs to avoid that object or smth. Any way to make AI completely ignore that object?
Possibly not without overriding the AI entirely.
is there maybe a way to make an object completely non register for AI? I just need ai to ignore it like it doesnt exit
Nah, otherwise I could fix the stupid bridge bug.
Some vehicles can't cross bridges because the AI detects incoming collisions with the bridge supports. Similar issue.
Detecting collisions with attached objects makes even less sense and is likely wasting a ton of CPU, but there we go.
BI are terrified of their AI code and won't touch it :P
Damn thats a shame
I tried attaching heli to an object that is far away than attaching the large model to the object thats far away, doesnt seem to work either
Depending on what you want to do, you could use flyInHeight
Dont work
Ah ok. Does it think the object is the ground then?
could be
Here, the moment object gets close, it starts increasing altitude, and continues to do so indefinitely
Ideally, that object would be on top of the aircraft and hide it. Thats the goal. Short video above
And the helicopter is just there as a anchor? And has no other purposes? If so why not make a simple helicopter out of the object?
What do you mean simple helicopter? It still needs to fly to places.
Yes but without rotors and stuff. Just basic XYZ movement like a box 😅. Similar to those Santa sleigh mods.
The helicopter is there to provide aircraft-like motion to the object
yes that, issue is that AI reacts to an object that is attached to it, which I have no idea why it would. There is no logical reason why. I always thought AI would ignore it and all collisions would be off
I dunno if it's a collision thing. I think the object might have a roadway on it (engine/model thing that determines whether a surface is walkable and how AI path on it) and the AI thinks "oh a roadway, I'm supposed to be above those"
shouldnt. I uploaded the model myself, it only has 0 and Geometry. And nothing else. It has no collisions at all. Not even shadows
then it is a mystery. AI doing AI things
Geometry is a collision LOD, right
See it doesnt even have shadows https://i.ibb.co/3CSgy6c/arma-3-bs.png
Isnt it Geometry Phys?
Geometry PhysX? That means collisions would be done with PhysX instead, but Arma has multiple physics/collision systems.
Could you try using an empty geometry LOD, or is that disallowed?
Not sure if that's an acceptable solution but it'd be an interesting test at least.
As long as it displays the texture, thats all I care about
So what do you mean, just delete the geometry and leave the "1"?
You should ask a modeller really.
copy that
@deft zealot did you write that function you pastebin'd?
is there a script to turn on beacon lights only for cop cars ect?
check what the actions point to in the config for the vehicle
Quick question re BIS_fnc_replaceWithSimpleObject, I read on the wiki that it shouldn't be used in multiplayer, I just wanted to know why it shouldn't be?
Additionally, I saw I can use createSimpleObject, would I put this code in the init of the mission file or would I do this on the object init? Thanks!
It says in the wiki, scroll down
https://community.bistudio.com/wiki/Arma_3:_Simple_Objects
Oohhh shit okay thank you I was just looking at the snippets from the individual scripts
gave me an error "Type group, expect object"
units group this -> units this
What's the rationale/advantage of an extension DLL from that of a text sqf script? Can all the script statements in an sqf be also possible in a C++ dll in a faster way?
dlls best for interactions with external software. I would hazard a guess that no it's not possible for ALL the script statements to be faster as there are bound to be engine functions that will always be faster in the sqf than in something external. In fact my guess would be that there are very few things that sqf can do that a dll would be faster at. That said I don't know specifics. I know that things like pythia have been used to implement scripts like those in the Frontline mod. I am going to again take a shot in the dark and say that is likely because the computation was easier or more efficient to implement in python and it's libraries than in sfq.
I use Pythia for example to get access to the file system which sqf can't (for good reason).
If you don't mind me asking, what use sort of case do you have for fetching from the file system?
Creating missing.sqm backups on eden editor auto saves and manual ones.
Oh interesting. Never would have thought about that.
@meager granite speaking of using externals, what do you use to save player stats to external server without mod dependency (That's at least what I think you do)? How could I go about getting started for use in my own projects?
Stats are sent to server, server sends them to hive through extension
the other way around when player joins, server requests stats from hive, sends them to player
So client -> arma server -> external server (hive)
I'll try to mess around with something. I'll try in c# unless there is a superior choice.
Yes
If you don't care about global stats, just save locally somewhere through extension
use local sql server or something like that
Yeah I wish servernamespace was persistent beyond restarts.
Server-side profileNamespace is
And missionProfileNamespace
you can use that as easy storage
I guess I could do that. And if it becomes popular enough to have global stats, then I'll mess with an extension
you have to send entire namespace each time though, which can get troublesome if you have lots of data
serialization takes a long time
Referring to the global extension, or the profilenamespaces?
profile namespace
with extensions you can only save needed piece of data, namespaces are saved whole
If player is in vehicle how to get his turret current optic and optic mode ?
getTurretOpticsMode could help to understand which optic he using right now, but how to find out is it NV or TI or normal?
I believe there is a command for vision mode
vehicle currentVisionMode turretPath;
this one
Much appreciate !
more info on it here:
https://community.bistudio.com/wiki/currentVisionMode
I need an expert - my mission has these random hiccups that I'm trying to investigate using diag_captureSlowFrame. However upon closer inspection, I'm noticing there are gaps in the profiling tree (~50ms and ~60ms respectively, which is a lot). What could be causing this?
(fwiw, I'm on dev build 2.17.151510)
If iam not mistaken that has something to do with ragdolls
hmm, I don't think that's what I'm experiencing - I do have 4 AI units (each sat in a vehicle driver seat, not driving), but no corpses
I guess so then. Sadly these names are not documented 
Something is happening between these steps, that has not been given a name 🤔
Weird
Epe is physics yeah
Physx scene init something-something?
anything I can do to narrow it down?
probably not
try and make it crash then get the mdmp 😄
no
Is there some way to run createSimpleObject on, say, a rock that just recreates the same rock in the same position and rotation but at a different scale
and if I do that, will AI walk through the rock?
I was reading createSimpleObject's wiki page and it says Supported features include collision, texturing, animation, penetration, AI spotting occlusion, and surface specific sounds (like footsteps). Unsupported features include PhysX, damage, AI pathfinding (causes walking through walls),
[book, ["book", 1000, 1] ] remoteExec ["say3D"];
Trying to play this audio in a script - when executing globally the audio plays multiple times for each player that is on the server, for some reason? Not sure what im doing wrong here.
Thats what I mean
Im using execVM "chaos.sqf" - to execute the script, would this be the issue?
post everything, and I mean everything related to this and where you are calling each thing
use pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Yeah so you are already executing chaos globally which means you don't need to remote exec that say3d command
Everything inside of chaos is local because chaos was called globally before.
Basically what you have right now is every client telling every client to play that sound. And it stacks.
I see, that might be the issue, so I should instead do
book say3D ["book", 500, 1, 0, 0, true];
Yes
Ill give that a try, I appreciate your help Hypoxic
That worked like a charm, fuck me I was overthinking something so simple
Thought I had to do so much just for that simple command
Quick question, I'm using a trigger to summon the hide terrain module, the code I have currently is
sqf [11355.474, 5513.634, 1.896] call BIS_fnc_moduleHideTerrainObjects;
in a trigger set to activate on radio alpha. when I use it, it throws up this error message:
File A3\Modules_F\Environment\HideTerainObjects\init.sqf..., line 15
Private _mode = |#|param [0,"",[""]];
private _input = para...'
Error Type Number, expected String.
I assume this means that the code expects the location data in the last set of square brackets, making the correct code
sqf [0, " ", [11355.474, 5513.634, 1.896]] call BIS_fnc_moduleHideTerrainObjects;
Is this correct? Or will this cause issues
That's showing you a piece of the internal code of the function, which is where the error occurred.
The function is trying to interpret the parameters passed to it by using the param command. It's trying to define its internal variable _mode as the contents of the first (0-index) parameter in the array of parameters passed to it, and it expects that parameter to be a string.
https://community.bistudio.com/wiki/param
If you look at the function's code in the Function Viewer (Tools > Function Viewer), you can see that it wants a "string" as parameter 0, and an [array, of, things] as parameter 1. Parameter 1's element 0 is expected to be the module object, then there's some other information in the other elements of parameter 1.
It looks like the function can be called with several modes, depending on what's happening to the module (e.g. Editor attributes changed, mission init, etc) and the expected parameters can change based on that. Also, some of the important information is stored as variables on the module object itself.
It's a complex function, and it seems to be pretty specifically designed to work with the module. Trying to use it independently might be a pain.
Gotcha, so I would have to place the module object itself and create a trigger which would place it on the radio alph afunction?
I don't think the affected area is updated if the module is moved after mission start. It looks like a one-and-done.
Shoot. I'm trying to hide a baked asset on a trigger activation, looks like I might just have to use the zeus module
Thanks for the help
The module isn't the only way to do this. Fundamentally, it's just an Editor-convenient interface. Everything it does uses script commands which are also available to you.
The important ones are nearestTerrainObjects, hideObject/Global, allowDamage, and inAreaArray.
(and forEach)
For example, you could do this:
private _nearTerrainObjects = nearestTerrainObjects [thisTrigger, ["HOUSE"], 100]
{
[_x,true] remoteExec ["hideObjectGlobal",2];
[_x,false] remoteExec ["allowDamage",0,true];
} forEach _nearTerrainObjects;```
Thank you! I'll tinker around and see what works. I appreciate the help so much ❤️
Is there a convenient way to make an AI unit face in a certain direction, with its whole body, using normal turning animations? lookAt and doWatch only control the head (unless the target is outside of head arc), and setDir gives an obvious snap.
setFormDir if the unit is alone?
Hello everyone!
I would like to create something new but i got stuck on one thing. When i use sqf object1 attachTo [object2, [0, 0, 0]]; i can define the coordinates where the object should be fixed relative to the object it is being fixed to. I also know i can use ```sqf
object1 setVectorDirAndUp [[0,1,0],[0,0,1]];
While in game, i get two objects close to each other (for example i bring an ammo crate near a vehicle) and now i want to use `attachTo` to attach the ammo box to the vehicle. But i need it to be attached in that specific place it is currently positioned. Therefore i don't know the coordinates in advance but i need to somehow obtain them from the current position of those objects. Any suggestions how can i do this?
Works, thanks 👍
You can use worldToModel and vectorWorldToModel to convert the object's initial position and orientation into coordinates relative to the parent object.
Or, you can use BIS_fnc_attachToRelative, which does the calculations for you. However, BIS_fnc_attachToRelative doesn't give access to some of attachTo's advanced features, like attaching to bones, so if you need that then you'll have to get and convert the data yourself.
I want to try to create something like a boot for a vehicle. My idea was to spawn a noticeboard, give that a texture so the noticeboard will be displaying like this vehicle has been immobilized or something like that and then use attachTo to attach the nearest vehicle to the noticeboard. This way the vehicle can still be accessed, players can get in, open inventory, even start the engine or turn on light, but won't be able to drive it away. I find this approach better than my original idea where i was thinking about giving the vehicle a certain damage.
I just tested it, it's absolutely wonderfull i wish i knew about this script sooner, thank you very much!
But can i use detach after applying BIS_fnc_attachToRelative ?
Yes. Like all functions, BIS_fnc_attachToRelative is composed of commands. Internally, it uses the same commands you would have, to determine the relative position and then attach the object. So internally, it uses attachTo, so you can detach the things it attached.
Great, thank you ❤️
So, when you crash a helicopter you can get 3 different outcomes in terms of damage source (HandleDamage and Killed).
- EPE damage: No damage source
- Crash damage: Source = Pilot
- Crash damage: Source = Heli itself
Apparently there is some kind of race condition between classic helicopter crash logic (pre A3) which instakills you VS physx collision damage
I guess this is why you can randomly survive crashes into buildings/ground/trees/water with little to no damage?
EPE/PhysX crash death (source=null)
9:23:40 =========================================================
9:23:40 "Frame 404619: HandleDamageVehicle: B_Heli_Transport_03_F (ALIVE=true)"
9:23:40 ["B Alpha 1-2:1 (Sa-Matra) (B_Heli_Transport_03_F)","",23.781,"<NULL-object> ()","",-1,"<NULL-object> ()","",true]
9:23:40 ---------------------------------------------------------
9:23:40 "Frame 404619: HandleDamageVehicle: B_Heli_Transport_03_F (ALIVE=false)"
9:23:40 ["B Alpha 1-2:1 (Sa-Matra) (B_Heli_Transport_03_F)","fuel_hit",103.463,"<NULL-object> ()","",1,"<NULL-object> ()","hitfuel",true]
9:23:40 ---------------------------------------------------------
9:23:40 "Frame 404619: Killed Both: B_Heli_Transport_03_F"
9:23:40 ["B Alpha 1-2:1 (Sa-Matra) (B_Heli_Transport_03_F)","<NULL-object> ()","<NULL-object> ()",true]
Engine crash with pilot (source=pilot)
9:30:12 =========================================================
9:30:12 "Frame 460568: HandleDamageVehicle: B_Heli_Transport_03_F (ALIVE=true)"
9:30:12 ["B Alpha 1-2:1 (Sa-Matra) (B_Heli_Transport_03_F)","",234.677,"B Alpha 1-2:1 (Sa-Matra) (B_Soldier_F)","",-1,"<NULL-object> ()","",false]
9:30:12 ---------------------------------------------------------
9:30:12 "Frame 460568: HandleDamageVehicle: B_Heli_Transport_03_F (ALIVE=false)"
9:30:12 ["B Alpha 1-2:1 (Sa-Matra) (B_Heli_Transport_03_F)","fuel_hit",1132.07,"B Alpha 1-2:1 (Sa-Matra) (B_Soldier_F)","",1,"<NULL-object> ()","hitfuel",false]
9:30:12 ---------------------------------------------------------
9:30:12 "Frame 460568: Killed Both: B_Heli_Transport_03_F"
9:30:12 ["B Alpha 1-2:1 (Sa-Matra) (B_Heli_Transport_03_F)","B Alpha 1-2:1 (Sa-Matra) (B_Soldier_F)","<NULL-object> ()",true]
Engine crash with no pilot (source=itself)
9:32:15 =========================================================
9:32:15 "Frame 476963: HandleDamageVehicle: B_Heli_Transport_03_F (ALIVE=true)"
9:32:15 ["B Alpha 1-2:2 (B_Heli_Transport_03_F)","",275.244,"B Alpha 1-2:2 (B_Heli_Transport_03_F)","",-1,"<NULL-object> ()","",false]
9:32:15 ---------------------------------------------------------
9:32:15 "Frame 476963: HandleDamageVehicle: B_Heli_Transport_03_F (ALIVE=false)"
9:32:15 ["B Alpha 1-2:2 (B_Heli_Transport_03_F)","fuel_hit",1324.12,"B Alpha 1-2:2 (B_Heli_Transport_03_F)","",1,"<NULL-object> ()","hitfuel",false]
9:32:15 ---------------------------------------------------------
9:32:15 "Frame 476963: Killed Both: B_Heli_Transport_03_F"
9:32:15 ["B Alpha 1-2:2 (B_Heli_Transport_03_F)","B Alpha 1-2:2 (B_Heli_Transport_03_F)","<NULL-object> ()",true]
All this is done by vehicle player setVelocity [0,0,-100] from "FLY" spawned helicopter into dried lake flat ground
This is also why players crashing helis\planes score is so random, you can end up with pilot being credited for teamkills of the crew but then sometimes everyone just dies (was killed)
tl;dr; a complete mess
What's curious is that non-EPE damage does on average x10 more damage than EPE damage
23.781 vs 234.677 vs 275.244
@meager granite im curious why you've been so focused on handle damage for the past few months. what are you working on?
Trying to make sense of engine damage for precise damage tracking
I just want to properly attribute players for the damage they make and be able to tell a story of what happened
Already have some cool stuff like chain damage attribution, including full info to show in the kill feed
Damaging a helicopter and having a pilot jump out still attributes the kill to AA shot
And most importantly having all this MP-compatible
If you think that is a long time focusing on handle damage? Ask the ACE devs about it 😅
Am I going insane, or is this [orange sphere] not anywhere near where you'd expect either of the display_* selections on this terminal to be? Trying to figure out if this is a model problem or a me problem (RuggedTerminal_01_communications_hub_F)
{
private _proxy = "Land_InvisibleBarrier_F" createVehicleLocal (_terminal modelToWorld (_terminal selectionPosition _x));
private _proxyProxy = "Sign_Sphere200cm_F" createVehicleLocal getPosATL _proxy;
} forEach ["display_1","display_2"];```
I'm pretty sure those selections are used for stuff in the model animations, so I kinda expected them to be....near the displays
I think createVehicleLocal acts like createVehicle without "CAN_COLLIDE" argument
Do a setPos after creation
I'll test, but I've been using createVehicleLocal to do particle sources and stuff and they always get created precisely regardless of collision 🤔
Probably has to do with model size of the object you create?
My guess would be particle sources have no models and engine does no space checks but does for spheres
Some ancient spawn logic magic nobody asked for
private _proxy = "Land_InvisibleBarrier_F" createVehicleLocal (_terminal modelToWorld (_terminal selectionPosition _x));
_proxy setPosASL (_terminal modelToWorldWorld (_terminal selectionPosition _x));
private _proxyProxy = "Sign_Sphere200cm_F" createVehicleLocal getPosATL _proxy;
_proxyProxy attachTo [_proxy];```
the position is now slightly different (more centred relative to the overall model) but still definitely wrong
attachTo without offset does relative attach
oh it does, I thought it was [0,0,0] by default for some reason
Do _proxyProxy attachTo [_proxy, [0,0,0]]
🤔
Another thing here, you do setPosASL which uses land contact Z, while attachTo uses origin\world
Try setPosWorld instead?
Okay, but I'm pretty sure the difference isn't that severe
It is on lots of objects, maybe not in invisible barrier though, why would it have land contact points
Just checked, Land_InvisibleBarrier_F has no land contact points and getPosASL equals to getPosWorld
I mean if I place both of them the appropriate places in the Editor, there's like a metre of vertical separation between their outer bounding boxes...not to mention the horizontal difference between expected/actual position
I tried a different selection name "display_mid" and got the same result
testobj = _terminal;
onEachFrame {
{
private _sel = testobj selectionPosition _x;
drawIcon3D ["\A3\ui_f\data\map\groupicons\selector_selected_ca.paa", [0,0,1,1], ASLtoAGL (testobj modelToWorldWorld _sel), 0.4, 0.4, 0, format ["%1 %2", _x, _sel], 2];
} forEach ["display_1","display_2"];
};
Try this debug bit
My bet is that selectionPosition is [0,0,0] and that position is center of the object
"display_1","display_2","display_mid" and their off counterparts all seem to be in that same position up on the antenna (verified with your code)
Is it [0,0,0]?
Yes it is
So you either have wrong selection names or they're in another LOD
These names came from selectionNames so I'm pretty confident in them
The first syntax of selectionPosition, which I'm using, is supposed to automatically go through all the LODs until it gets a hit
Hmm, selectionPosition is supposed to check lots of LODs
yeah, just checked the wiki
There are some other selections on this model that are where they're supposed to be, and are...close enough, I guess...to what I need. But like, wtf BI, over
Maybe selections are named but just empty?
so its a model issue
Try selectionNames from different LODs
The display_ selections aren't in any of the named LODs 🤔
Wiki says it checks in first LOD in the model, maybe its some odd LOD like resolution or shadow
@ selectionNames
Check allLODs to see which is first
and use selectionPosition with Syntax 3
Not sure if allLODs indicates which is really first or its ordered somehow
Well, that tells me they're in LOD 0, which is one of the visual (distance, I assume) LODs with a sequential resolution and no name
You specify LOD index in Syntax 3
The debug marker appears in the same place (on the antenna) with all LOD indexes
So they're just useless selections 👍
https://community.bistudio.com/wiki/createVehicleLocal has alt syntax now for can_collide etc so can skip the setpos
impressive! I'm still struggling to get accurate headshot detection to work in my damage EH - sometimes shooting a .50 cal at someone's pelvis still causes more damage to the head/face than any other hitpart. Do you have any tips on how to work around this?
You can check how ACE does it:
https://github.com/acemod/ACE3/blob/0e2c7167a5f83026e9407a77fa2043bc46daabb7/addons/medical_engine/functions/fnc_handleDamage.sqf#L38
I was always under the impression that ACE modified the armor values on units via config
As for my implementation, I send HitPart to the server and then compare it against final damage that resulted in kill to determine exact kill means
There are some optimizations in place that condense HitPart blocks into useful data and avoid sending repeated same-y info
right, that's a thing, but I now remember why I ditched that option
I combine ammo type, source and instigator into array and then do hashValue look up in hash map for quick check
my problem with hitPart was that it didn't trigger for the unit that got hit (though maybe I just did it wrong?) - meaning I would've had to have the shooter and the victim send data to the server for validation, which is a recipe for disaster with networking in mind
As you have all these in both HitPart and HandleDamage
HitPart is triggered on shooter client, you need to add it to all targets you care about beforehand
There are also quirks like hits resulting in damage but only Explosion is triggered and not HitPart
I'm losing my sanity being deep into this for months already
yep, what I mean was I would've liked for the victim to also get the EH, as HitPart is generally more accurate at detecting the body part that a bullet impacted than HandleDamage
But it seems to work in the end, I know everything about the kill when it happens
obviously that isn't an option though as it turns out, since HitPart only triggers on the shooter...
this is using your hashed shooter data you mentioned before, correct?
Yes, HitPart sends [ammo, source, instigator] to server, then HandleDamage also does that
You'll need to figure which ammo caused the kill though, it is also complex issue in itself
oh, hold up -- you've got two machines sending data to the server, and deferring the kill feed entry until the server has received both?
Yes, so it is MP compatible
In general if you send HitPart right when it happens it should be sent to the server alongside engine damage that ends up triggering HandleDamage on victim client
So HitPart always arrives on server before HandleDamage in all cases
Shooter: HitPart and Damage -> Server
Server: Saves HitPart, Damage -> Victim
Victim: HandleDamage -> Server
Server: Has HitPart already, now got HandleDamage summary from victim
If you wish to same more info about the shot you'll also need to track it all through Fired and SubmunitionCreated
I'm already doing the latter to some extent (to handle mines and artillery submunitions), but having the server collect data from two clients for one kill was the one solution I immediately crossed out for being too complex ("surely there's got to be a better way, right?")
your solution is very clever, but I'm bummed (albeit not surprised) that it's what it takes
I was trying to collect HitPart and Fired summary for EACH instance of HandleDamage cycle but its ultra nightmare difficulty, I abandoned it half through
Right now I only send HitPart for [ammo, source, instigator] hash if it different enough to be worth sending, like new HitPart was a headshot or distance changed significantly
Same for HandleDamage, I only send it to server once, when significant amount of damage was done
Dying mid HandleDamage or on the same frame after HandleDamage also triggers this send
I can only imagine the amount of variables you've got to track for all of this
truth be told, I'm now having second thoughts about fixing my implementation
Its mostly hashmaps where keys are these ammo-source-instigator triplets
This approach of saving hit and damage summaries on server also lets attibute them to scripted identities rather than entities
So if player respawns or leaves the server you can still attribute say a mine kill to them
hmm, I see the potential for stats tracking, but that would be far beyond the scope of my project
in any case, thank you for all the insight into your damage tracking system - I thought I had a good grasp on how to do it in ArmA but clearly I've got a long way to go still, heh
👌
Fellas, I want to know how I would get the following code to work for only certain players, and they keep this when they respawn. I inted to use the following code :
player setAnimSpeedCoef 0.75;
With this, would I have to make an array for all players within the squad, and have that code execute? Would I put this in onPlayerRespawn.sqf ?
you probably need to put the code in both files: initPlayerLocal.sqf & onPlayerRespawn.sqf
Gottcha
Would it be better to apply it as an array or just have the group variable instead?
array
Appreciate it, ill get er done
Having issues with this -
private _khorne = [k_1, k_2, k_3, k_4, k_5, k_6, k_7, k_8, k_9, k_10, k_11, k_12, k_13, k_14];
{
_x setAnimSpeedCoef 1.5;
}
foreach _khorne;
When launching - it is giving me the following error
k_ is each units variable name
looks like k_2 is not defined
But he has a variable name, or am I doing this wrong
Is there perhaps an issue with it initializing too fast ? Should I add a sleep at the start?
i think the scripts should run after objects init is processed, so i dont see a problem
yeah im not sure whats going on here, it looks like k_1 which is the sl is fine, but k_2 is not
and when I delete k_2 then k_3 becomes an issue
what are those k_ objects anyway?
ok
BUT because its multiplayer, and not all objects are present because theyre not slotted
its giving an error
ah makes sense
but if you want to run that for each player you should just set that for each player in the init scripts
I only want it for a squad of players is the thing
putting foreach in player init scripts processes all players every time someone joins
in initPlayerLocal.sqf & onPlayerRespawn.sqf you could just do ```sqf
if(group player == theSpecialGroup) then
{
player setAnimSpeedCoef 1.5;
};
I was looking at group player just now - ill give it a try and see thank you for your advise
Amazing stuff with the Intercept, @grizzled cliff!
danka :)
I just want to clarify something: Arma3 does not expose C++ API, in the same way that they expose stuff using via SQF API. So, these few DLL APIs that must be present, be made exported, and non-mangled in their names is all there is, and nothing more. Which means, the DLL must be driven from an SQF script and the SQF script is the main control logic
Not unless you use Intercept
Since 2.17 (last dev branch) it does expose a tiny bit of C++ API. But its just for use with extensions and doesn't really do anything more
With extension callbacks you can have the main control logic be inside your extension and trigger SQF code at will
I used that model with TacControl where the SQF code does basically nothing by itself. But the extension will trigger a callback that will run SQF code, whenever the extension feels like it wants an update
for future reference, you can build arrays of objects that might be nil cleaner using: missionNamespace and getVariable + insert or pushBack/pushBackUnique:
private _khorne = [];
for "_i" from 1 to 14 do {
_khorne insert [-1, [missionNamespace getVariable [format["k_%1", i], objNull]]];
};
Then either filter out the null objects, or in many cases, commands for objects that are run on null objects simply are skipped and don't throw errors
What I meant is, a C++ API direct from Bohemia Arma3 itself and not some user made C++ made API. Does intercept have direct access to Arma3 events directly in C++ without going through SQF layer?
Hey, can someone confirm if "MPEnded" EH fires also when mission is changed using #missions command?
Reading BIki entry about it my understanding is that the answer is "yes" but wanted to make sure
I've ran into a pretty annoying problem. I've got an AI group that's meant to take position on static HMGs, but since they arrived via a vehicle and passed a "GET OUT" waypoint earlier, the group members keep trying to dismount the HMGs.
At least I assume this is what's happening, since I tested them in isolation, and it worked out fine. Anyone struggled with this in the past?
How are you putting them into the HMGs?
I'm using BIS_fnc_unpackStaticWeapon to get them assembled at a specific location
The HMGs aren't there at the start of the scenario, I want the AI to assemble them themselves
Yes, but how are you putting the units into the HMGs?
The function does it with
_group addVehicle _weapon; _gunner assignAsGunner _weapon; _gunner moveInGunner _weapon;
And the rest of the group doesn't get any subsequent orders?
They do.
_leader doWatch _targetPos; _leader doMove _leaderPos;
Can you check the contents of assignedVehicles for the group?
probably need apply { typeof _x } to make it useful.
I forget the default behaviour for groups with partial static occupancy though. We don't use it much.
"Partial static occupancy"?
Tried to fast forward it but ended up breaking it, hang on...
...seems like the only vehicle they've got is the static MG itself.
I'll probably end up cheesing it by giving them a "get in" waypoint once the thing's built
Only part of the group being in a vehicle (which is a static)
Are the group and static both local to the code?
If that question's directed at me, I have no idea where I'd find that out.
I see, thanks
What's your test environment? Localhost or DS+client?
Everything's local then. No mods?
Would be surprised. Main LAMBS might though.
LAMBS usually makes the AI more likely to get into statics tbh
But you could check the LAMBS settings in addon options and see if there's a "don't get in statics" toggle or something
I'll try it without any mods just to be sure
imo This is almost certainly some weird interaction between partial occupancy and being previously in a "GET OUT" waypoint
I might have a poke at it later tonight. Will let you know if I can replicate anything.
Thanks a lot! I could probably dump the whole scenario here, it isn't too complex
yeah could be useful.
I... don't know what mod caused it, but the vanilla AI is now consistently running each other over.
Sounds about right for Arma ai lol
Also hitting the single tree in a wide open field xD
Here, I can't keep troubleshooting this
Every change I try to make fucks things up even more, now the vehicle won't even depart...
Math question:
I have a hashmap with the following data:
GVAR(compositions) = createHashMapFromArray [
/* STUFF */
["carrier", createHashMapFromArray [
["missiletarget", [24.9297,66.3911,-0.0245016]],
["turretclass", "B_AAA_System_01_F"],
["turret_0", [[47.6841,-0.00439453,19.0834],216.866]],
["turret_1", [[25.5493,-114.821,16.6596],215.628]],
["turret_2", [[-30.1289,-105.404,17.5575],36.7085]],
["turret_3", [[-39.8408,179.097,19.9095],84.0869]],
["turret_4", [[30.917,175.103,19.6474],186.955]],
["turret_5", [[-16.8071,188.767,11.2129],125.788]]
]],
/* STUFF */
]
each turret has the relative position on the carrier model and their direction from north. my goal is to have these turrets face their relative positions no matter which way the carrier is rotated.
I have tried two following functions but I can't seem to get the math right:
params ["_child", "_parent"];
private _childDir = getDir _child;
private _parentDir = getDir _parent;
private _difference = _parentDir - _childDir;
_child setDir (_parentDir + _difference);
params ["_child", "_parent"];
private _childDir = getDir _child;
private _parentDir = getDir _parent;
private _relDir = _child getRelDir _parent;
private _worldDir = _parentDir - _relDir;
_child setDir _worldDir;
_child setDir (_parentDir + _childDir) ?
Assuming the carrier was pointed north when the first directions were taken
it looks like i have made a mistake with that now that you point it out. the carriers initial direction when i was exporting the data was 126.119 so I guess I need to subtract 126.119 from all of my values in the hash?
What is the main difference between Server Execution and Global Execution?
Server Execution is when something is executed on the server. Global Execution is when something is executed on all machines.
Note that the SE and GE tags on the wiki don't stand for Server Execution and Global Execution, they stand for Server Execution and Global Effect. The SE tag means that the command must be executed on the server in order to take effect. The GE tag means that the command's effects are applied on all machines, even if it was only executed on one machine.
Would GE be intended if I wanted something that was intended to be clientside to reflect across all clients?
It...depends on what commands you're using?
Different commands have different effects and requirements. We'd need a better explanation of what you're trying to do, to give a full answer.
Fair enough, I'll check the documentation thoroughly
if you run a SE command from a client, nothing will happen
if you run a GE command from the dedi, everyone will see it.
if you run a GE command from each of the clients, everyone will see it multiplied by the number of clients
if you run a local command on the dedi, no one will see it
if you run a local argument command on a remote unit (meaning AL commands should be remoteExec to where the unit is local), the command will probably not have intended effects
Which map is this for?
remoteExec executes twice if you provide two entities of same client as target? Is this intended?
I was kinda expecting it to only RE on unique clients
testf = {diag_log _this}; 123 remoteExecCall ["testf", [player, player]];
```=>
10:27:38 123
10:27:38 123
Sad, could've been useful to have engine handle this, no way to determine if two entities belong to same client from client side
Wish there was comment ANY so you can add
#define diag_log comment
```to quickly mute all logs inside a script
Encasing diag stuff in #ifdef #endif is so clunky
[typeOf car, driver car, alive car, local car, lockedDriver car]
```=>
`["I_C_Offroad_02_unarmed_F",<NULL-object>,true,true,false]`
yet `player moveInDriver car` doesn't work 
lock => 1 so its not locked either
Manually getting into driver seat fixed it, then moveInDriver started working again
Is there a script or zeus module that lets you create a Task(found in the map area for players, along with an assignable map objective) mid-game?
does anyone have experience doing 3D world text scripting, i've been scratching my head for like three hours trying to get it to work where you can add names (or whatever) above players and i can't seem to get it right, any help would be appreciated
addMissionEventHandler ["Draw3D", {}], iterate through all friendly players, do drawIcon3d above them
would that be going in an init.sqf? im still pretty new to scripting
Stratis
Yeah, can work there
don't i need to create a fnc_Draw3D.sqf then as well? since itll need a function to run the init?
or something to that nature
You can have it all right in the init.sqf
Functions are for your convenience and reusability
Got this again, happens when you delete driver corpse with deleteVehicle
both vehicle and driver were local, they end up deleting on server but not on your client
car deleteVehicleCrew body does not fix it
moveOut body does not fix it either
both cases you end up with seemingly empty seat and you can't get into it
And lots of
14:00:49 Server: Object 3:66 not found (message Type_125)
14:00:49 Server: Object 3:67 not found (message Type_125)
14:01:07 Server: Object 3:67 not found (message Type_97)
14:01:07 Server: Object 3:66 not found (message Type_97)
```spam
for the "iterate through all friendly players, do drawIcon3d above them", what do you mean by that?
like would that be a zeus thing in the Initialization tab?
units to get all units of needed side or group, forEach to iterate through them
Check wiki for these commands to see how they work
thanks brother, sorry if i caused a bit of a headache
setOwner to server and/or back doesn't help, assignAsDriver doesn't help
player action ["GetInDriver", car]
``` doesn't work, animation plays and you drop back out
player moveInAny car works fine and finally fixes driver seat
There is some kind of condition check that fails for scripted get in driver actions
Yet getting in through mousewheel menu and with moveInAny works
why would this not work? _items = primaryWeaponItems player; if (count _items == 0) then { hint "no items" };
if hint str primaryWeaponItems player; gives https://i.gyazo.com/79f857abe2fb70ee6c1b39ed85e9874a.png
thoughts of future expansion iirc
Anyone know if it's possible to get the back door of a prowler open?
no
because there is three empty strings in it
Any ideas if it is possible to change locations of barrels created with addWeaponTurret? Like having dual miniguns under wings firing at same time
If its a vehicle with pylons you can control that with setPylonsPriority
oitherwise no, barrel depends on weapon simulation and memory points in the model
okay, so no mounting 2x miniguns under civilian plane wings?
Maybe with ton of scripting
As in creating fake miniguns, then moving bullets to their positions on Fired on all clients (bullets are local to each client)
Alright, i was thinking first if the weapon could be created as a seperate entity and attached to the plane, and then fired all at once with fired but apparently thats not possible either?
Nope
weird that when I call saveMissionProfileNamespace in my mission I can no longer open the game menu (ESC). anyone got similar problems? (SOLVED bad return in "KeyDown" EH)
Anyone know of a function to use "hasItem" on a player, and also check "isKindOf"
we can write a quick one for you. what do you need it to do?
I can write one, just wanted to be sure there wasn't anything pre-existing before I started
Thanks though
BIS_fnc_itemType ?
fixed, was because saveMissionProfileNamespace returns true (boolean) while wiki says it returns nothing. That messed up the KeyDown EH (could use a fix, somewhere)
plz report such wiki fixes in #community_wiki thonks ❤️
Hi, does anyone know how to execute 'Engage' for an AI unit command using SQF? (the one from commanding menu)
sure can but last time I posted something there my message was ignored 🙂
https://community.bistudio.com/wiki/commandTarget maybe, with perhaps some additional commands
it's not
Best way to get started/learn how to code arma?
if you guys could go ahead and get 2.18 out for ignoreTarget that would be greeeeaaaaat
does arma use C++ or SQF? Kind of confused on it
User-side scripting is done in SQF. The game's internal code, which we don't touch, is C++. Extensions use C++ or a couple of other languages, I think.
So eden would be sqf?
yes
My father knows how to code. He says that SQF is related to C++ but are different. Like siblings, they are the same family but are different people with personality and such
sqf is not object oriented. its functional. not that related imo.
K
SQF is only used in Arma. I'd be surprised if he's heard of it unless he plays Arma himself. Maybe he was thinking of SQL
still would not match the "same family" description though
Idk I'm an idiot
nay, just "newbie" as in "not knowing", no trouble!
anyway, if you need help about SQF, this is the channel to be
Hello gents, someone had maybe the luck to get AI to fast rope from the chopper via EDEN Ace Fast Rope waypoint? For me the AI heli pilot is just stuck and does nothing when waypoint is reached.
However, the Fast Rappeling waypoint added via Zeus does work perfectly fine, with the pilot going down to 15m to drop the guys off via fast rope.
Or maybe is there some option to view the inside of the fast rappeling waypoint which Zeus is using? I dont have a clue anymore. 5h wasted so far to get this done.
also flyInHeight and flyInHeight ASL don't seem to work on lower altitudes.
Thank god there is isPlayer ARRAY which doesn't return true on vehicles with players in them
So you can both check if entity is a unit AND a player
have you tried with a player tank commander / car driver?
Checked it closer, isPlayer ENTITY checks if effectiveCommander is a player which often the case especially with AI units under player's command
isPlayer ARRAY still always returns false on vehicles thankfully
Warning could be updated to say that alt syntax is reliable to also check that entity is a unit
or fixed to behave like the main syntax 😛
Sqf has so many quirks like this you could fill as many books as the Warhammer universe
"say, what's the lore behind this discrepancy?"
I'd like to know lore behind https://community.bistudio.com/wiki/WFSideText
I just recalled Warfare was a thing 😅
I remember playing it for quite a bit in A2 Free
It was so buggy though, if you pressed "Unpack MHQ" or whatever action was called twice, it teleported to [0,0,0]
Action didn't disappear right away due to scheduled scripts lag
How can i retrieve the key used for a specific action using scripting commands ?
For example, how can i know what key the player is using to talk in the radio ?
I think this is it, thank you 🙂
If you want to detect when the player is doing a particular action, you can use a UserActionEventHandler. This sort of EH will pick up the action regardless of what keys are bound to it, so you don't have to worry about detecting multiple keybinds. It's much simpler if that's what you're trying to do. (If not, then do continue)
sounds better
the problem is i can't intercept the action with UserActionEventHandler
Intercept as in stop the input?
yes
You can also use inputAction to check when an action is being done, by its action name rather than by its keybinds. This works OK with a keyDown EH (the type used to intercept actions), at least as long as it's not something they're likely to press at the same time as doing another action
🤔 So the intention is to stop one to use ingame PTT?
If it's turning off the ability to speak that you're after, specifically, you can use enableChannel to lock the VON system itself
I'm creating a new audio engine, so i'll need to prevent default process
As i'm working on connecting multiple servers together, i'll need a new audio engine for communication in order to transfer communications in between servers
But i need this audio engine to use user's predefined keys so you don't need to reconfigure it
Maybe setPlayerVoNvolume then?
Hmm, i just need to use Keydown to intercept the pushToTalk action an replace it with mine
@timber shore {_x != ""} count _items == 0
inputAction "PushToTalk"
inputAction "VoiceOverNet"
?
Though these will probably change after KeyDown
I will also disable all channels so there won'tbe any problem for VoiceOverNet
Anyone know how to implement a live procedural texture for the map? I can get a still image of the map using "ui(RscMap", but for the life of me I can't figure out how to get it to stay live
Trying to get it onto a rugged tablet
What do you mean stay live
Probably. Cannot tell without your actual code
I tried that but I had two issues;
A: I can't find the display name
B: Ideally I'm trying to run this in the unscheduled environment and uiSleep doesn't work I think.
private _tabletr = createSimpleObject ["Land_tablet_02_F", position this];
_tabletr attachTo [this, [0.635986,-0.0993652,-0.474988]];
[_tabletr, this] call BIS_fnc_attachToRelative;
_tabletr setVectorDirAndUp [[-8.74228e-008,0.0871557,-0.996195], [0,-0.996195,-0.0871557]];
_tabletr setObjectTexture [0,"#(rgb,1024,1024,1)ui(RscMap ,abc)"];```
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
That's amazing, do you think you can help me set up the event handler? I've never used one before..
https://community.bistudio.com/wiki/User_Interface_Event_Handlers
https://community.bistudio.com/wiki/ctrlAddEventHandler
(findDisplay "abc" displayCtrl 51) ctrlAddEventHandler ["draw", { hintSilent str time}];```or```sqf
(findDisplay "abc") displayAddEventHandler ["draw", { hintSilent str time}];```This can tell your idea I guess
what does "draw" do?
so is it an event that triggers on every frame the map is being drawn?
Yes
what is the { hintSilent str time} bit for?
It does nothing. Just to tell the idea
(findDisplay "abc") displayAddEventHandler ["draw", {}];
so this would work too or I am a moron?
I don't think it does work. Your code does nothing
Use this too in order to do something you want I guess
ah okay
so
(findDisplay "abc") displayAddEventHandler ["draw", {displayUpdate findDisplay "abc"}];
?
Basically
Why not just
#define diag_log
to nothing, to just null them all out?
just make your own DEBUG_LOG macro that either goes to diag_log or you can null it out?
No
No. Eden code is in engine
Part of 3den are SQF, but core is not, yeah
I considered the question being "scripting in Eden", thx for clarifying
Good idea. I feel dumb now.
private _tabletr = createSimpleObject ["Land_tablet_02_F", position this];
_tabletr attachTo [this, [0.635986,-0.0993652,-0.474988]];
[_tabletr, this] call BIS_fnc_attachToRelative;
_tabletr setVectorDirAndUp [[-8.74228e-008,0.0871557,-0.996195], [0,-0.996195,-0.0871557]];
_tabletr setObjectTexture [0,"#(rgb,1024,1024,1)ui(RscMap ,abc)"];
_tabletrdisplay = findDisplay "abc";
(_tabletrdisplay) displayAddEventHandler ["draw", {displayUpdate _tabletrdisplay}];
I'm a bit stuck now, it's not working but there is no error messages so I'm just fiddling around but I don't know what is wrong
fixed that order issue but still not working
_tabletrdisplay variable is undefined inside the eventhandler
displayUpdate (_this select 0) should give you the display
Nah actually the script version strips the "on" prefix
I was about to tell you to read the big red infobox 👀 😄
_tabletr setObjectTexture [0,"#(rgb,1024,1024,1)ui(RscMap ,abc)"];
_tabletrdisplay = findDisplay "abc";
(_tabletrdisplay) displayAddEventHandler ["draw", {displayUpdate (_this select 0)}];
still not working unfortunately
You can't findDisplay right away, display will be created once you see the texture for the first time
so where does that leave me?
You can make your own display in config. Either in mod or missions description.ext
And add the eventhandler via there, its onLoad handler will be called when created. Maybe you can even put onDraw directly into there too
if that's the only way to do it then that's fine and I'll start working on it, but is there any way to implement it without using scripts, just using the 'init' box in 3den/zeus alone?
Without scripts? What you do is some scripts already. Or rather, init you call already is
I mean without any .sqf files
so that it can just be run on any mission at any time
Atm everything runs out of 3den
Hello, i hope some of you can help me with this script i made. I works fine until the end of it where i wont my player and the other ai to leave the animation i et them to leave the animatiob, but when they leave it they are like stuck. They are stuck to the Z,X,Y when i try mov he does the move animation but cant move and his ehad cant turn at all, why?
!code
```sqf
// your code here
hint "good!";
```
↓
// your code here
hint "good!";
please use pastebin or alike, thanks 🙂
also: do not use ChatGPT to write code: enablePlayerControl is not a command
Stupid Ai can't read wiki. We are all doomed
why this simple line doesnt work (with dedi run from client) [spot] join player; doesn't join
player is null on dedi?
running from client , debug console
the player is supposed to have one AI in his group from start but from some reason it isnt
nevermind, persistent bf and auto init was on which broke the whole thing. still wonder why join didnt work but atleast got my group member
@meager granite @edgy nimbus 👋
Init fields in Zeus (either when placing a saved composition or when selecting an object with ZEN/Achilles) are only executed on the Zeus client, so on DS an isServer check will automatically fail
#arma3_feedback_tracker message
@edgy nimbus Latest date
Good idea to change channel. 😅
Would adv dev tools also be usefull or not?
It's always useful
Just paste the code into vehicle init field
This code bit assumes you use it on a UAV that has both driver and gunner (driver locked\unvailable\etc)
otherwise it will do setOwner 0
Like that or do i have to change everything to this without _```sqf
if (isServer) then
{
this spawn {while {true} do
{
waitUntil {sleep 1; owner gunner _this != owner driver _this;};
(group (driver _this)) setGroupOwner (owner (gunner _this));
_this setEffectiveCommander (gunner _this);
_this setOwner (owner (gunner _this)); sleep 1;
};
};
};
Yeah that was for something else, supposedly transfers locality in mp.
it doesn't
Should i put diag_log []; in in the init and where,
or in devtools console?
You need to log ownership states and stuff like this
Don't bother if you don't get what code does
I really want to learn it, im trying to make the local switch work. :o
By [] I meant an array with anything related to whatever script is doing
Ahh ok, so values of the script right? 👍
Yes
Ok, gonna take a moment. 😊🫡
Just try the code and see if it solves the issue of not being able to drive from gunner seat as non-server
Your 100% sure you got it to work before in multiplayer with other people, in a similar way like this?
I didn't test it
Yes not this one, but you said a few days ago, you fixed this UGV problem once before. So did that work in multiplayer with other people?
It worked in local test server setup, I didn't get complaints when it was used live.
With which vehicles?
Vanilla armed UGV with driver seat locked
Hello, is it possible to make a unit change factions when in proximity of a player?
so you can only control gunner
Ahh ok yeah, that fits then.
And you say the zeus spawned it, and another player controlled it from the gunner?
If by factions you mean side then yes, check distance to player, have unit join different group (of needed side)
No, I don't use Zeus at all
So eden?
No, it was script spawned
you'll need to RE server to run that code from Zeus side for each vehicle you spawn
or add it CfgVehicles init field
having that addon only on server will also suffice
How to use RE in this case, i looked at the wiki but im not sure how to apply it to this code?
[_this, {while {true} do {
waitUntil {sleep 1; owner gunner _this != owner driver _this;};
(group (driver _this)) setGroupOwner (owner (gunner _this));
_this setEffectiveCommander (gunner _this);
_this setOwner (owner (gunner _this)); sleep 1;
}}] remoteExec ["spawn", 2];
no idea if it is _this or this or even array in Zeus
maybe @hallow mortar can tell
I believe it's this (object), but I only use Achilles so ZEN could be different
For logging, roughly like this?
if (isServer) then
{
this spawn {while {true} do
{
_driver = driver _this; //or this?
_gunner = gunner _this;
_driverID = owner _driver;
_gunnerID = owner _gunner;
_driverGroup = group _driver;
_gunnerGroup = group _gunner;
diag_log [_this, _driver, _gunner, _driverID, _gunnerID, _driverGroup, _gunnerGroup];
waitUntil {sleep 1; owner gunner _this != owner driver _this;};
(group (driver _this)) setGroupOwner (owner (gunner _this));
_this setOwner (owner (gunner _this)); sleep 1;
};
};
};
Can i use systemchat for it? Propably?
diag_log doesn't create a new file.
One RPT file is created per session (game launch to game exit) and updated as things happen. If you have the file open when things happen, you'll need to reload it.
You can often use systemChat for debug logging, but be aware that it is a Local Effect command, so if used on a DS it won't be displayed to the players. You would need to remoteExec it to see it.
I opened the newest one with notepad++, and it had some general information in it, non of those values. So i likely used the diag_log incorrectly?
Thats super helpfull info! 😊
Also you can't copy/paste from systemChat so it's not always convenient
Really stupid question, but how to i use variables in systemchat? I thought so far its custom text only.
Use format to embed variables into a string
Wrong reply but oh well
that was about using systemchat
Thats should be an example in the wiki. 🫣
The diag_log itself looks OK. The big possibilities are that the code didn't run (error or was run on not-server and instantly bailed) or the waitUntil never finished. You can add more simple checkpoint diag_log at various points to see what's running and what's not.
The other possibility is you looked in the wrong file. You need the one dated for the start of the session where the code was run. If the game's been restarted since, the newest file won't be the right one.
Try including a keyword in your diag_log so you can ctrl+f for it
Also make sure you're looking at the server's RPT, not your client's
All the variables in the diag_log are undefined
Do you think, this will have the desired results of when the ugv/uav driver is not reacting to the player from the gunner seat, this fixes it?
(group (driver _this)) setGroupOwner (owner (gunner _this));
_this setOwner (owner (gunner _this));
As its quite the major issue i have with a mod in multiplayer.
UGV's when spawned by zeus and player controls gunner, are not made local / grouped to the player correctly.
for scripting, sqf
Thank you
Propably used the wrong this? Which is what i asked earlier as i wasnt sure. Thx for pointing it out, gonna fix it. 😊
Please just make hasDriver=-1; also work for wheeled vehicles,
and fix multiplayer locality/grouping when connecting to unmanned vehicles, im begging you. 😭😂
no its in the wrong spot.
It gets executed before the variables inside the spawn are even assigned
Ohhhh yes thx! 🫡
Is it possible to spawn 3d model of pylons (lets say a 4x scalpel rack) with scripts and attach it?
Or do they exist as objects?
You can createSimpleObject its model and attach it
thanks!
hey. I'm looking for the animation/ move to have an AI sit on tjheir knees and hands tied behind back. Help?
try _man switchMove "Acts_AidlPsitMstpSsurWnonDnon_loop";
close, but I was more looking for the animation where they sit on their knees
But thanks anyways
I thought it might be close 😉
there was this part in the contact capaign where there was a couple of soldiers held hostage... Trying to find that particular move
Try "Acts_ExecutionVictim_Loop"
there's anim viewer in the editor
yeah, but not very user friendly
That's it! Superthanks!!!!
wouldn't it be != instead of ==, now it returns true if no slots are empty. unless my brain is acting up on me
So, broadly, I were to run, like
(pseudocode)
private _v = createSimpleObject[typeOf this, getPosASL this]
_v setDir (getDir this);
deleteVehicle this;
in the init field of every bunker in my mission.
Would these objects be properly available to JIP, since the simpleobject code is in a now-deleted object?
That's a very bad idea as you would be creating N+1 objects due to locality. Recommend you only run this code for the server.
hey im using this script:
_MapSize = WorldSize;
_HalfMapSize = WorldSize / 2;
_CivilianWeapons = ["Weapon_hgun_Pistol_heavy_02_F", "Weapon_hgun_PDW2000_F", "Weapon_sgun_HunterShotgun_01_sawedoff_F", "Weapon_srifle_DMR_06_hunter_F", "Weapon_arifle_AKS_F", "Weapon_launch_RPG7_F"];
_CivWeaponsMax = count _CivilianWeapons;
_BungalowHouses = [_HalfMapSize ,_HalfMapSize ,_HalfMapSize] nearobjects ["Land_i_House_Small_03_V1_F",worldsize];
{
_BuildingPositions = _x call BIS_fnc_buildingPositions;
{
_RandomWeapon = _CivilianWeapons select random _CivWeaponsMax;
_CreatedWeapon = createVehicle [_RandomWeapon, _x];
} forEach _BuildingPositions;
} forEach _BungalowHouses;
to spawn weapons in houses around the map. the only problem is the weapons are spawning about a meter off of the ground (see attached image). is there any way i can just snap the weapons to the ground?
Try this i havent tested it:
private _MapSize = WorldSize;
private _HalfMapSize = WorldSize / 2;
private _CivilianWeapons = ["Weapon_hgun_Pistol_heavy_02_F", "Weapon_hgun_PDW2000_F", "Weapon_sgun_HunterShotgun_01_sawedoff_F", "Weapon_srifle_DMR_06_hunter_F", "Weapon_arifle_AKS_F", "Weapon_launch_RPG7_F"];
private _CivWeaponsMax = count _CivilianWeapons;
private _BungalowHouses = [_HalfMapSize ,_HalfMapSize ,_HalfMapSize] nearobjects ["Land_i_House_Small_03_V1_F",worldsize];
{
private _BuildingPositions = _x buildingPos -1;
{
private _RandomWeapon = _CivilianWeapons select random _CivWeaponsMax;
private _CreatedWeapon = createVehicle [_RandomWeapon, _x];
} forEach _BuildingPositions;
} forEach _BungalowHouses;
same issue. the issue isnt that the weapons wont spawn. its just that they spawn a meter in the air.
All you need is to play with the position myb you can do something like this:
private _BuildingPositions = _x buildingPos -1;
{
private _pos = _x vectorAdd [0,0,-0.2];
private _RandomWeapon = _CivilianWeapons select random _CivWeaponsMax;
private _CreatedWeapon = createVehicle [_RandomWeapon, _pos];
} forEach _BuildingPositions;
Where do you guys usually script? Is this the debug menu or is it something else?
in .sqf files in the mission directory
Can someone skilled with vectors let me know - is there a way to convert compass-direction to VectorDirAndUp?
should i be able to find that in the Eden Editor?
should look like this, but only mission.sqm
https://community.bistudio.com/wiki/vectorDir
Use Vector Dir.
@scarlet phoenix incase youre unaware. there is an advanced form of mission editing where you script your missions using code in .sqf files instead of doing it in the eden editor. alot of the more advanced missions (Antistasi, Wasteland, etc) are made in this way as theyre too complicated to replicate using only modules and eden editor stuff
is there a version of this that gets the angle from the current object to a target object
So as a beginner trying to learn how to code arma, should I touch this?
code arma as in mods? or for missions? if for missions then absolutely yes. it opens up many avenues for mission creation not avalible using the eden editor
Missions let's say
just like this:
private _obj1Dir = vectorDir obj1;
obj2 setVectorDir _obj1Dir;
go for it. its not too complicated to learn. esspecially if you already know other coding languages such as python. i myself, managed to learn most of the essentials to get started coding stuff in like, 2-3 days
but at the current moment, i'm trying to figure out how to make an npc play a whole animation then continue that animation or change to a new one
you can do that via scripting yea. my best advice for you is use the community wiki. it holds ever single function you can use and examples on how to use them
https://www.youtube.com/watch?v=1Y7RsNuFHz0 using this for help btw
Introduction into Variables,
Music provided by TeknoAXE Royalty Free Music
Song: Battle of the Fuzz.
http://teknoaxe.com/Link_Code_3.php?q=907
Keep me motivated
https://streamlabs.com/devteampaxton#/
Also if you want to 1 object point to another you could also use this:
https://community.bistudio.com/wiki/BIS_fnc_vectorDirAndUpRelative
And this acts like
_v = obj1 getDir obj2;
obj1 setDir _v;```
Oh
this is what I need, thanks
trust me, you will eventually fall on the community wiki for help lol. but yea, use whatever video tutorial you need to learn the basics
very much thank you 👍
no worries, best of luck o7
Quick ol' question, know any information on cinematics?
if youre making a video youre going to upload to youtube or some other service just use the gcam mod. if you want like a cutscene in your mission. im not 100% sure when it comes to scripting but in the eden editor there is the keyframe system which can be used for a lot of cool stuff including having a camera follow a path
you could probably combine the keyframe animation stuff with scripting for the best result
taking a look through Arma rn, seems that my Open Scenario Folder cannot be opened
you need to have the mission saved first :)
just save it with nothing in it or just a player character
okie
just a quick tip btw
coding for singleplayer and coding for multiplayer are very much different. so make sure you do research into which mode you want to make your mission for
okay saved it so now I presume i code in the notepad and as I do that, the game should change?
I feel like this should be working. But it isn't.
[submarine,wp_0] spawn {
params ["_src","_target"];
_v = "ammo_Missile_Cruise_01" createVehicle [0,0,1000];
_v attachto [_src,[0,16,5]];
_v setVectorDirandUp [[0,0,1],[-1, 0, -1]];
sleep 0.2; detach _v; sleep 6;
_v setVectorDirandUp ([_v, _target] call BIS_fnc_vectorDirAndUpRelative);
}; ```
Spawn the missile (works fine)
Fire it straight up (works fine)
Change the direction to the location of a gamelogic (doesn't)
The game automatically recognises certain files, like description.ext, init.sqf, initServer.sqf (look those up, and there are others) and executes the code (or interprets the config, in the case of description.ext) at the start of the mission.
You won't see observable changes in the Editor, but things will happen when you run the mission.
Although the Editor itself can't interact with external scripts, the code all operates in the same environment, so variable names etc. are all shared.
Note that not everything in the game can be changed through mission config and scripting. Some config types can't be overridden by missions, and anything outside the mission, like main menus, is out of reach. And some things don't have commands for changing them.
I'm pretty sure BIS_fnc_vectorDirAndUpRelative is for determining the relative orientation, i.e. the vectorDirAndUp in the coordinate space of the other object, as opposed to in world space. You might be thinking of vectorFromTo.
So, yes?
Yes, sort of, and not literally immediately as you type.
Thanks, I'll try that
still having issues with this script lol it just does not want to work at all.
_MapSize = WorldSize;
_HalfMapSize = WorldSize / 2;
_CivilianWeapons = [
"Weapon_hgun_Pistol_heavy_02_F",
"Weapon_sgun_HunterShotgun_01_sawedoff_F",
"Weapon_srifle_DMR_06_hunter_F"
];
_CivilianBuildings = [
"Land_i_House_Small_03_V1_F",
"Land_i_House_Big_02_V1_F",
"Land_i_Shop_02_V1_F",
"Land_u_Addon_02_V1_F",
"Land_i_House_Big_01_V1_F",
"Land_i_Shop_01_V1_F",
"Land_i_House_Small_01_V2_F",
"Land_u_House_Small_02_V1_F",
"Land_i_Addon_03_V1_F",
"Land_i_Addon_03mid_V1_F",
"Land_i_Stone_HouseSmall_V1_F",
"Land_Metal_Shed_F",
"Land_i_Stone_Shed_V1_F",
"Land_i_Stone_HouseBig_V1_F"
];
_CivWeaponsMax = count _CivilianWeapons;
{
_Houses = [_HalfMapSize ,_HalfMapSize ,_HalfMapSize] nearobjects ["_x", worldsize];
hint _x;
sleep 1;
{
_BuildingPositions = _x buildingPos -1;
hint "BuildingPositions";
sleep 1;
{
_RandomWeapon = _CivilianWeapons select random _CivWeaponsMax;
_CreatedWeapon = createVehicle [_RandomWeapon, _x];
hint "CreatedWeapon";
sleep 1;
} forEach _BuildingPositions;
} forEach _Houses;
} forEach _CivilianBuildings;
hint "Finished Script";
it never seems to get to the:
_BuildingPositions = _x buildingPos -1;
hint "BuildingPositions";
sleep 1;
{
_RandomWeapon = _CivilianWeapons select random _CivWeaponsMax;
_CreatedWeapon = createVehicle [_RandomWeapon, _x];
hint "CreatedWeapon";
sleep 1;
} forEach _BuildingPositions;
part
You can't create weapons using createVehicle. They're not real objects, just proxies.
Unless you want to just create the model using createSimpleObject, you need to create a weapon holder (a sort of invisible fake crate that's used to hold anything "on the ground") and add the weapon to its inventory
i literally did. and it worked. but then i tried making it in multiple houses and it stopped working
refer to this
oh, hold on, I see you're using the preloaded holders for those weapons, not the actual weapon classes. That makes sense now
yup!
my old code worked, but only on one specfic type of house. i tried to adapt it for most of the common houses found on altis and stratis and its no longer working and i get no error message
do you have any clue why it might be skipping a portion of code?
im such an idiot
i figured it out
this has "" around it
Someone does maybe know the issue with flyInHeight don't working properly at low altitudes?
Any help would be appreciated
What's your code
The "dead zone" below ~10 metres for flyInHeight is a long-standing issue with the command itself. Using the alt syntax with the true to force it is supposed to be the solution. If that's not working, then ???
Anyone know what kind of "iskindof" fish and other sea creatures fall under?
Look at the config
so, what you think about Nou's effort ?
https://www.reddit.com/r/arma/comments/3v86dc/i_want_to_change_addon_making_in_arma_forever/
https://github.com/NouberNou/intercept
"Fish_Base_F" it seems, ty
Greetings, I am trying to learn how to use param atm and am wondering how to assign expected DataTypes.
_VCrew = param[2, "C_Marshal_F", [objNull, ],[]];
What´s to be put in there for Strings? Code? Numbers? etc.
I know it looks like this:
_arr = param [0,[0,0,0],[objNull, []], [2,3]];
For Arrays.
What string you mean? The third argument?
definately interested to see where it leads.
Yes. But the question extents to classes, code etc etc. I Want to have an expected Datatype for my parameters of my future functions.
/*
Pseudo stuff
*/
_ShouldBeString = param [0, "hi", /*what to put here*/, []];
_ShouldBeArray = param [1, [0,0], /*what to put here*/, []];
_ShouldBeCode = param [2, {_fnc_}, /*what to put here*/, []];
_ShouldBeGroup = param [3, _myGroup, /*what to put here*/, []];
^^ Like this stuff.
If that makes my question clearer
bcs i do not quite get the full picture from this https://community.bistudio.com/wiki/param
Weird one here. I'm trying to get SCBACylinder_01_F to start leaking upon completing a hold action. It does this when shot at, so I tried using setDamage, which did not work. I then looked through the config to see if I could find anything relating to this behavior, which I did not, and animationNames returned an empty array. I'm not sure what else to try going forward.
To declare a sting there, "" is enough
Thx!
And for the other DataTypes?
Do you mean a vanilla SCBA backpack? It does not such feature in the first place
Here's a screenshot of the leaking taking place. Unmodded game build. It comes from wherever the bullet impacts. It persists for a few seconds then stops.
Good question actually. We may need a comprehensive list which I've never seen
Ah the prop you mean. It should be a scripted feature. I don't know if it does it in vanilla (aka without any external script)
Lmao so I am asking a question way above my paygrade xD
Ty anyways and I will keep asking around and see if I can find something
You could look at its config and see if it has any event handlers or special surface hit effects
* this is about the SCBA cylinder
It is not a hard question to answer though. An empty array is [] empty code is {} empty group is grpNull
It launches itself away when not frozen in place. There is nothing changed about this object, it is freshly spawned from the menu.
I'll take another dig through it. I probably just missed something.
If it actually gets propelled and isn't just super light and being moved by the force of the bullet, then that really feels like a Hit event handler. In the config viewer, event handlers can be found by expanding the item's entry in the left panel and selecting the event handlers sub-entry
I knew I skipped over something! Thank you so much, I'll figure it out from here. I'm new to using the config viewer so I'm still figuring things out
Definitely recommend picking up Advanced Developer Tools from the Workshop. It makes the config viewer much easier to use, amongst other things
Will look into it!
whats an empty class and empty number?
and this would have an expected datatype of "code" right?
_shouldBeCode = param [0,{_fnc_}, {}, []];
param [index, defaultValue, expectedDataTypes, expectedArrayCount]
^^This is how it is described on the wiki.
expectedDataTypes: Array of direct Data Types - (Optional) checks if passed value is one of listed Data Types. If not, default value is used instead. Empty array [] means every data type is accepted.
So this should function just like that?
I am having difficulty wrapping my head around this for some reason.
The thing about the param expected data type is that it doesn't actually matter what the content of the data type is. It doesn't actually have to be empty/null etc, that's just used for convenience. It can be anything as long as it's the right type.
There is no "empty number" because all that defines a Number type is...being a number. Just use any number.
@candid sun yes i wrote the function that i pastebind'd. WHy do you ask?
good to know, but how do i tell it that the type should be Numberor String ? Can i input {} for code, "" for String and so on then?
The expected data types argument is an array of expected data types
So param [index, defaultvalue, [datatype1, datatype2], arraycount]
It kinda would be nice if it was like
if (int_thing)
if (Array_thing)
...
and not something like ObjNull.
Do we know the datatype names for param ? Or is the previous approach the only one and sufficient?
It literally works by "show me an example of a thing of the data type you want"
okay this actually helps alot, ty!
And "yeah it looks similar, Imma accept your input"
this too xD
does anybody know how to make a trigger condition "squad A detects an enemy"
Btw, if you're splitting up a whole array of params, you don't need to do it one manually-indexed param at a time. There is params to do several in one command
I planned on doing param first and then "upgrading" it to params after my current project is done. But that also means learning params later haha.
I´m also trying to keep everything as readable, understandable and fully commented as possible because some functions will be used by other people too and they need to understand xD
and from what I imagined and saw param seems to be more readable to beginners
Or people that are even newer to this than me
params is very similar to param. The structure is essentially "several param in a trench coat".
To help with keeping it readable, here's a tip - line breaks and indentation are free and you can put them almost anywhere.
@lavish ocean been discussed here, its nice
params [
["_zero", objNull],
"_one",
["_two", ["string array element", "another!"], [[]], 2]
];```
thx!
I shall upgrade after a nap
params [
["_zero", objNull]
,"_one"
,["_two", ["string array element", "another!"], [[]], 2]
];

Barbaric
efficient
Is there a away to keep flashlights on AI on when they die?
Now when a unit dies, the flashlight dies with them (asif it is neurally powered or something).
what is the best way to make an overlay like the cbrn facemask overlay and what is the recommended filetype?
https://community.bistudio.com/wiki/Arma_3:_CBRN#Facewear_Overlays
Do you mean you need this
yes
i understand cutrsc and igui / gui elements just dont know how to import a 2d ui element into arma and what is the filetype i should use
Urm, why you need to make an image when there already is?
i want to make a custom overlay sorry if i didnt give that detail
- Only acceptable image format is PAA (well that is the only alpha-able image)
- You need to make a GUI element for it
thanks
so, what you think about Nou's effort ?
My first thought: I need to start learning C
@grizzled cliff will you include the API to create own scriptFunctions? I implemented my first own function yesterday because your project pushed my interest.
already told @grizzled cliff that i most likely will add a new printOut to OOS so that you can deploy addons in c++ AND SQF with the same source code
only thing the folks here then would need to do is following some howTo about the compiling of the c++ code if they have no idea about that and the rest is just writing it in OOS then
the good about it: one lang two targets
the bad: why would you want to write OOS if you can use directly c++?
Because OOS provides a better overview and standartization? ^^
then SQF? yes
Or OOS generates some type like an intermediary language which gets parsed by a premade extension.. Like Java kinda does it. That way people dont need a c compiler
more: OOS code gets translated to c++ code (instead of SQF, you would just choose your target lang)
no offense but if you can write c++ why write oos :D
as said
the benefit is that you also can deploy your stuff in SQF then
((its also added to the "the bad" 'list' of mine @pliant stream :P))
Ouhhhh that will be awesome... When Nous Lib doesnt support Battleye the OOS code can still be executed in slow sqf instead of fast c++ ^^
exactly (+ you also could deploy whatever you have been writing in a mission only instead of an addon)
thats the rough idea behind it
however, till that happens a lot of shit still has to be done in OOS
but im working constantly on it
and fixed a gigantic bunch of issues OOS had by starting an actual project in it
Where can I find a good tutorial about eventhandlers? I need to learn how to register a player killing a civilian in MP as well as SP.
I can walk you through it in voice if you want later when I get home if you want to learn real fast.
appreciated, but I don't really have the time. Getting lat here and life calls... :/
i have this code:
_HalfWorldSize = WorldSize / 2;
createCenter east;
"group" setDynamicSimulationDistance 500;
_MilitaryBuildings = [
"Land_i_Barracks_V2_F",
"Land_Cargo_HQ_V1_F",
"Land_Cargo_House_V1_F",
"Land_Cargo_Patrol_V1_F",
"Land_Cargo_Tower_V1_F",
"Land_MilOffices_V1_F"
];
_InfantryUnits = [
"I_Soldier_lite_F"
];
{
_Houses = [_HalfWorldSize ,_HalfWorldSize ,_HalfWorldSize] nearobjects [_x, worldsize];
{
_BuildingPositions = _x buildingPos -1;
_BuildingGroup = createGroup [east, true];
_BuildingGroup enableDynamicSimulation true;
{
_RandomInfantryUnit = selectRandom _InfantryUnits;
_CreatedInfantryUnit = _BuildingGroup createUnit [_RandomInfantryUnit, _x, [], 0, ""];
} forEach _BuildingPositions;
} forEach _Houses;
} forEach _MilitaryBuildings;
which should create a unit in every military building of the types specified (ik about the performance, im going to do that later) which works but im also trying to enable dynamic simulation for units that are far away but it doesnt seem to do anything and i get no errors. how would i fix this?
This bit seems the key! 🥳 This fixes the mentioned UGV bug.
(group (driver _this)) setGroupOwner (owner (gunner _this));
Absolute legend. 🏅🔥
Didnt find a difference with setowner so far, is it needed?
Also im working on some semi unmanned vehicles,
and sadly the "it works on whoever got in first" issue (for a lack of better words) still exists,
so when someone else got in the vehicle, like passenger, it doesnt work if the gunner gets in second,
which i thought was effectiveCommander related, as the wiki says:
Returns the effective commander of the vehicle. Effective commander is the player whom driver AI will listen to. So if in a tank there is a gunner and a commander and AI driver, if the effectiveCommander is gunner, then gunner pressing WASD will give AI orders to move. If gunner jumps out and then enters tank again, the effectiveCommander role most likely has changed to commander that remained in tank. Also the assignment seems to work on first come first served basis.
Despite setGroupOwner / setOwner / setEffectiveCommander, the UGV AI is not reacting to gunner driving in this case (other playing gotten in as passenger first).
Any idea on that? 🤔
Is it possible to set addEventHandler for "Take" & "Put" on server ? I would like to let server handle inventory actions made by clients. Trying to add from the server side this EHs for containers with no success. Clients take & put items and server not catching that
if (isServer) then {
addMissionEventHandler ["EntityKilled", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
if (side group _unit isNotEqualTo civilian) exitWith {};
if (!isPlayer _instigator) exitWith {};
// Do something here
}];
};
what do you have written so far
this code runs from server addon at postInit stage
{
_x addEventHandler ["Put", {
params ["_unit", "_container", "_item"];
_containerName = getText(configFile >> "CfgVehicles" >> typeof _container >> "displayName");
_itemConfig = _item call CBA_fnc_getItemConfig;
if (isNull _itemConfig) exitWith {};
_itemName =[_itemConfig >> "displayName", "STRING", str _itemConfig] call CBA_fnc_getConfigEntry;
[QGVAR(SyncLogData), [format["%1 put %2 in %3\n", name _unit, _itemName, _containerName]]] call CBA_fnc_serverEvent;
}];
} forEach vehicles;
invert it, put the handler on a unit, then do a container check instead. I believe put has to be on a unit, not a vehicle/container.
but unit is kind of vehicle too, on arma language )
Also my idea was based on this:
This event handler can be added to a container. 2.14
UPD:
tried to put this events on server from container to units - doesn't help
{_x setPosASL _infWp} foreach (units _infGrp);
For some reason this is giving me the error about expecting 3 elements and that i only provided 2
I'm not sure which elements I'm missing for any of these functions
setPosASL just needs an object itself and a pos
units just needs itself and a group
_infWp, it may be [x,y] without z
So you may need add z to position
They do. The AI sometimes doesn't care about it, but waypoints are 3D.
The issue you're having is that you're not giving setPosASL the waypoint's position, you're giving it the waypoint. And waypoints aren't objects - they're represented as an array of [group, waypointIndex].
So what you're giving is _x setPosASL [someGroupID, 0], which is not a valid position array.
You could use waypointPosition _infWp and that would work, although waypointPosition returns AGL, not ASL, so you'd want to use setPosATL or convert the position first.
I don't think setOwner does anything if the vehicle has a driver, because vehicles get their ownership moved to the driver's machine anyway. Hence setGroupOwner will move the vehicle too, in this case.
To clarify, it is an AI driver, B_UAV_AI.
Do you know more about the issue of another player being in first breaking it?
Is it because the vehicle is "local" to the first player?
I heard an read going into driver seat changes locality.
- Is this correct.
- Is there any way to recreate that effect per script etc?
🤔
If it wasn't an AI driver then you couldn't do setGroupOwner.
Players can't have their locality switched.
I'm not following your second point. The players aren't in the vehicle at all in this case, are they? It's remote control.
I had two problems.
The first was about fully remote controlled vehicles, setGroupOwner to gunner fully fixed that.
The second problem is more tricky:
Its an IFV, with a seperate driver compartment (so players cant switch to it), it has a B_UAV_AI driver.
setGroupOwner works if the gunner is the first person entering the IFV.
If another player, goes into passenger seat first.
And after that the gunner enters and is set as groupOwner of the driver AI.
It doesnt react to driving inputs...
I am wondering why thats the case, and if its in any way fixable. (Maybe not, but hopefully.) 
Well, the commander is probably the effective commander for a start.
If you're saying you switched that too, and it still doesn't work, then I'm not sure what's happening.
Thank you! 🤝
Maybe someone here knows. :/
anybody using CBA task patrol?
im finding calling it via unit init and syncing unit to a CBA module produces very different results
can someone help me reduce vehichle weight to make them faster
or reduce health loss when crashing a car
or increase player run speed
- setMass
- handleDamage event handler
- setAnimSpeedCoef
@haughty sand If you have a question about my answer just ask here. I offer no such "private" QnAs that has to be public. As I stated in my bio
oh sorry
how do i 1)set mass
im still new to editor but i managed to make spawn points and my map
ty
Wiki is ALWAYS your friend
i thought i had no friends until i discovered the wiki..... since then my life has changed
You've only wrote something that is not going to run
Do it one by one. Read BIKI carefully
do you have any coding experience at all or are you completely green