#arma3_scripting
1 messages ยท Page 57 of 1
@still forum The wrappers for Triggers don't seem to work properly in Intercept
This trigger will be created but the activation will not be registered
It seems to correctly evaluate the condition every .5 seconds, but this will never evaluate true, at least as much as I was able to test it. Overall the behavior is just unusual
what does setCombatBehaviour do for group and how its different from being used for units?
How can I get the coordinates of the location where the player's crosshair is currently pointing at?
Can I have macros in mission based functions? ie. functions that are in the mission folder.
I basically want to define a custom macro for a bit of code that I keep reusing, but I dont want to turn it into a full function.
There is actually almost no downside to make it into a function, but you can always use #define and #include and others
Its just about verbosity.
Thank you but it looks like that screenToWorl does not return an Array which could be used as coordinates for a missile strike. I am looking for a way to give the missile the coordinates of my crosshair but don't want to use a laser designator.
wiki says it gives "world position on surface [x,y,0]"
This gives the coordinates of the laser designator:
_primaryTarget = lasertarget _player;
But I am now looking for a way to assign the coordinates without a laser designator.
But it does not work
how so?
lasertarget and screetoworld return different things
does not work to guide a missile
oh you need to create the laser target via script then
but how?
copy from my code: _pos = screenToWorld [0.5, 0.5]; _laser = "LaserTargetE" createvehicle _pos; _laser setPosATL _pos;
use different LaserTargetX for each side
sorry, i am confused
this returns the coordinates of the player's crosshair to guide a missile?
Thanks, this works perfect!
Is there a way to get info about target selected on sensors screen?
I don't know if it's the right channel, but I've recently made a quick video on multiplayer scripting and even though it's barely scratching the surface, maybe it'll shed some light
https://youtu.be/-hz0SoS95VY
Join the discord!
https://discord.gg/wCUqFxs
Consider supporting me as a modder/creator
Paypal: thevestarr@gmail.com
This video is just an introduction to multiplayer scripting in ARMA 3.
It's a huge topic and it's barely scratching the surface.
Resources:
https://community.bistudio.com/wiki/Multiplayer_Scripting
https://community.bistudio.co...
it's not exactly "the good channel" but please keep it here
you said that https://community.bistudio.com/wiki/Multiplayer_Scripting was explaining things pretty well, so flattery earned you a spot ๐
Nice video. Sure it doesn't cover a lot of things, but might be an okay introduction to people who have little understanding about how multiplayer games work and Arma specifically.
Should've also mentioned turret locality and that it behaves differently to vehicle locality
Weapon/magazine changes on vehicles are one of the most popular changes people do with scripting and its pretty frustrating if you don't understand locality.
DiaryParser: <br/> without corresponding <br>
I'm getting this from using <br /> in creation/setting of diary records
The wiki does not mention anything of that sort. Is that just an overeager log message?
https://community.bistudio.com/wiki/createDiaryRecord
Try <br/>?
I regularly use <br/> on its own in diary records without any trouble
Even if you run the game with the script error flag?
Yes. Trust me, we're talking hundreds of missions over several years, no problems
๐คทโโ๏ธ
so no <br/> <br /> <br> work
it would be <br></br>
Is that just an overeager log message?
then most likely, unless you find cases where it doesn't trigger
I actually didn't realize that, but it makes a lot of sense now that you mentioned it
It's even more odd. I found a place where I had accidentally used </br>, but that was in loca table, so </br>
That seems to have been the thing it reacted to, cause since fixing that I don't seem to get the message anymore, no matter what combinations I used outside of the loca table.
gonna restart it one more time with that in the loca, just to make sure.
heh, weird message but "accurate" warning
are you using composeText for the diary record?
yeah, also kinda weird that it only seems to care when it comes from a loca string and not when it is directly in sqf
i thought it was a must
No, it has its own parser (the very one that is complaining)
See here, it has slightly different tags to e.g. parseText
okay, can confirm it, it only complains about </br> when it's in the stringtable.
Is that worth a comment in the wiki, does anyone care to fix this or will it just be left for the next person to marvel in that rare case?
maybe a note in the RPT thing
whats the diffrence between setCombatBehaviour group and unit? I just want the tanks to drive on road with "CARELESS" but im unsure if I need the group version of the command
also wondering setBehaviourStrong, why so many commands ๐ค
Twenty years worth of SQF commands ๐
groups rule over unit behaviour, strong behaviour rules over group
i dont understand , if I use setCombatBehaviour for tank, will group override that?
yes
if group setCombatBehaviour is not set?
is the driver the leader?
dunno
if so, group will be set to careless if you set the tank to careless, if not, leader is set to careless
It gets even more complicated if you have AI mods
hmmm well if combatBehaviour returns the "correct" value then it would be easy to test whats happening
Command Applies To
setBehaviour Every unit in the group, but not the group itself
setBehaviourStrong Every unit in the group, and the group itself
setCombatBehaviour If argument is Object, only that unit, and if argument is Group, the group itself (not its units)
yea saw that wiki page, still kinda wondering ๐
using behaviour strong is the best from what I've seen, its the most consistent one
ok but in mech group i want only tanks to careless
{
group _x setBehaviourStrong "CARELESS";
}forEach _tankArray
```?
that would apply to infantry as well
yes, the behaviours are managed using groups
i'm gona try using setCombatBehaviour see if they stay careless
gl
ty for the help ๐
Pretty sure it won't interpret these initializer lists correctly?
You can pass your thing to diag_log and see what falls out in RPT and if it looks correct.
I would build the arrays manually, not using initializer list to try get the compiler to do it
no, you are inside a SQF command, you don't need locks in main thread
no, not if you are in main thread
If you crash, attach a debugger and look
If you have to, that means i should update my intercept on workshop?
remoteExec is like taping a message to a rock and throwing it over a wall.
You don't get a result, unless someone on the other side of the wall throws you another stone back.
( you need to control the function on the receiving side, and remoteExec the result back to remoteExecutedOwner)
Thats nonsense, a variable being used in some place doesn't mean you're forbidden from using it.
The real issue here is missing private infront of the local vars.
There is no issue with using _y
no
intercept is "unscheduled", cannot sleep in unscheduled.
sqf::sleep shouldn't even be available to you to call ๐ค Except for quite advanced intercept usage it doesn't make sense to use
If you look at the code, the variable is not defined where its used, and it is destroyed before its used.
The variable only exists in the while scope, not outside of it
That is your only option. sqf::spawn
The water you mean? afaik thats detected on the heightmap
It is defined in the outer scope. We went over that before and added a definition at the start specifically to fix that.
Yeah, guessed so, figured I'll have to make a mask out of in-game height data to color the water.
Did a test, somehow having 1000 controls groups with 2 structured texts in each yields more FPS than having 2000 structured texts controls in the display root ๐ค
We have it, #arma3_tools
atleast that's where we've always done it in the past
Someone mentioned a bit ago that the syntax used for nearEntities was wrong. I don't think the other guy has reported back on whether fixing that solved it, but I've got a feeling that was the real problem. When reading it I assumed that it must be right because they said it mostly worked :U
you can also compile and define your functions from C++ side
sqf::set_variable("fnc_xxx", sqf::compile("sqf code"));
don't even need setVariable, you can store on C++ side no need to put into SQF side namespace
Make FT ticket please and ping me the link
If you want to talk to me, the best approach is to talk to me. Instead of asking if you can talk to me
Having one big batch in one command call is more efficient than having many smaller batches.
And when JIP happens, you cannot put sleep between the command executions, so while you can make sleep's inbetween for live play to lag less, the JIP's will be frozen/killed by it
You missunderstood that.
if you make repeat updates, you want to repeatedly update the WHOLE section, even if its hundreds of positions and you only actually changed a single one.
You don't want thousands of command calls for different sections
If you want to flood the terrain, its probably easier to adjust the water level (I think there was some way to do that)
@still forum Couldn't stop thinking about that flag that lets model faces to render with transparency. There is no easy way to make the engine force this flag on certain model draw instance, right?
You can enable tides as a terrain config thing, but there don't seem to be any script commands for it.
Make a FT ticket and attach crashdump
_y doesnt work when ive used it before outside of the context its used as a magic variable
You are correct.
https://github.com/intercept/intercept/blob/9783afea9706d800616a0847869a2fcde0aef65b/src/client/intercept/client/sqf/waypoint.cpp#L345
The type_ is never actually passed to the command, that's a bug in the command wrapper
Well you did something wrong then, _y is just a variable, same as _x and _this, you can use them if you want to use them
Ah I see.
I don't remember the last time someone had actual code above a functions "params" line. I saw the params and thought that was the first line
is it possible to be able to move your character while a dialog is active or is that just possible with rscTitles?
You can sort of move with createDisplay dialog, but only the keyboard
findDisplay 46 createDisplay "YourDialog"
Im assuming that it is because dialogs take the mouse focus from the camera display?
Pretty much
still better than nothing, thanks Sa-Matra
Well you're already locked in main thread... 
It was due to stack overflow tho
So?
We shouldn't fix game crashes just because we already know what's causing them
nah
so using forgetTarget in knowsAboutChanged EH
You can sorta expect it would cause infinite recursion
Or we could also just fix it
IME driving behaviour uses the group behaviour, not the unit behaviour. It's a bit of a pain when you want the driver to ignore enemies but not the gunner/commander.
By contrast, unit behaviour seems dominant when on foot.
The way I see it you can only fix it if you make something like forgetTarget and doTarget take place in the next frame
Which breaks other stuff ๐คท
We already fixed infinite recursion for a couple other EH's
I don't care what you see, I asked him to make a ticket so i can fix it
Good point. I don't care if you wanna waste time on that either, and whether it's fixed or not won't matter, as long as you don't break things
Am i understanding correctly, that there is now way that i can get sensor targets list from handheld weapon?
excuse me, what handheld weapon has sensor targets?
did some tests and it seems that driver must have the CARELESS for any change to happen in moving
Maybe i'm not understanding it fully but ammo in a weapon can have a sensor
I am afraid I have no idea what you are talking about
tracer?
They may be referencing this? https://community.bistudio.com/wiki/Arma_3:_Sensors_config_reference
that's not ammo in a weapon, hence my confusion
I'm not sure either
{
class MissileCore;
class MissileBase: MissileCore
{
class Components;
};
``` example on that very page
i just have a question in my head for a feature request ticket about command that will provide currently selected sensor target and while thinking what it should output found out that getSensorTargets only applicable to vehicles
But sensors could also be added to ammo
except i don't think the entity of CfgAmmo is ever created before the actual shot ๐ค
this shouldn't be true because otherwise how does something like a manpad locks it's target
weapon locks, then fires, then sets the target for freshly created munition iirc.
so the weapon checks for sensor config of it's ammo?
even iirc-er: missiles don't have a target set in the frame they're created, but do on the next frame.
Guys, any idea how to detect if the player was hit in the VEST but the vest alone... I tried sqf if (_part == "body") exitWith { if (_unitVest isNotEqualTo "") then {_dam = _dam * 1.5;}; // Ai Vest Nerf }; in addEventHandler "handledamage" but it also the condition also fires when the unit is hit on the hand, arm, legs and even head...
CfgWeapons
...
canLock
Determines if the weapon can lock onto targets allowed by the ammunition it uses.
https://community.bistudio.com/wiki/Arma_3:_Targeting_config_reference#canLock sounds like that ๐ค
FYI "HandleDamage" only provides the new damage value, not the added damage
Yeah I know, thanks, it is still possible to get the added damage but I am not trying to modify the added damage just the total damage, but my EH not only has the problem of not detecting vest impacts accurately but also it detects body impacts as hands and head impacts and therefore fires my "weapon drop" and "headgear drop" funcs, which should only happen if the impact was on those body part exclusively
here is the whole thing:
ok - just wanted to be sure because I see tons of people getting it wrong, better safe than sorry :)
wrapping something in call {} is useless (line 7)?
Added the call so it can exit if the hit is to the body and not even consider hits to the other parts
Yeah, I updated the code (also updated the link), it was defined in the code I used but then I just changed it to (vest _unit != "")
CRYING CEASED. GOD STATUS RE-ENABLED
Is it me or exitWith doesn't work AT ALL inside the damaged EH?
You are going to DIE of laughter! I added: sqf hint format ["PART: %1", _part]; and nothing else to the damaged EH. (btw, _part is the same as _selection).
And no matter where I shot, to the body or legs, the hint was PART: HEAD
WTF
no wonders why _part == "BODY" wasn't working!
I don't know what is the point of having all the other body parts if the EH only detects the _selection as HEAD...
Multiple selections can be damaged by a hit, and only the last one will show up if you use a hint, because new hints overwrite existing ones. Try it with systemChat.
I actually used a duplication prevention script so only the first selection would show... so head is always the first one
VAL_fn_handleDamageAiEH = {
params ["_unit"];
_unit addEventHandler ["handledamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint", "_directHit"];
if !(local _unit) exitWith {};
if (isNil {_unit getVariable "parts_handle"}) then {_unit setVariable ["parts_handle", true];};
if !(_unit getVariable ["parts_handle", true]) exitWith {}; // Duplication Prevention
hint format ["PART: %1", _selection];
_unit setVariable ["parts_handle", false];
_unit spawn {sleep 0.1; _this setVariable ["parts_handle", true];};
}];
};```
Okay, but you're still only showing one of the hits even if there are actually multiple. All you've proven is that the head damage always gets processed first, not necessarily that it's the only selection that gets damaged.
Correct. I have proven that _selection is not a reliable way to find out the REAL limb/location that the unit got shot/damaged at...
So now the question is... is there a reliable way to get the correct damaged location? including vest shots?
hint will only display the last hint indeed
The issue was that I was building the plugin with the most up-to-date Intercept sources, while using the Workshop-current host, which is about 2 years old. Any possibility that you could update the workshop plugin?
that's known that hitting the chest can also damage arms, head or "" too yes
"the one with the biggest damage in one frame"
The legs damage the head too!
What are my options for this? Can I manually call sqf::set_trigger_type? Right now I'm just creating it in a .sqf function and calling it from Intercept.
Ok so how do we figure the one with the biggest damage? (that is not just residual from previous damages)
you collect them all and you compare with >
Well, if "_directhit" was recently added, perhaps we could get a reliable way to get the REAL "big damage" location... something like "_impactedSelection" or whatever
It is mindblowing that there is no reliable way to just figuring out where a unit was originally hit without doing walls of scripted code workarounds in there
Reforger fixes that, buy it
The directHit param was just turning on an existing engine check. It also.....doesn't actually tell you if it's a direct hit, it can only tell whether it was fall damage or not.
(Note: the directHit param in HitPart does work as the name implies, it uses a different method that wasn't transferrable to HandleDamage)
Already bought, but my 5800X3D + RX6700XT runs Arma 3 at 200 FPS (Malden) and 120 in Reforger, but my main problem is that none of the players I play Arma 3 with likes Reforger
anyway
that's not available easily, "it is how it is"
Well, a new param would not be doing anything new either, just filtering the messed up damage ORDER of _selection, so that the Real Damaged limb shows exclusively instead of all the other sub damaged parts
Do you have any example on how to do it reliably?
no
That is something new, and it's impossible to say how easy that would be, because it relies on the engine internal damage processing. There is presumably a reason why it is the way it is now. Remember that HandleDamage firing cannot be delayed at all, otherwise it would be useless.
Fine, I guess I will just leave my Ai units pure vanilla
Thank you both for clearing this up
Now I understand why most knowledgeable guys here mostly keep quiet about the damaged EH...
It is a mess
speaking of, is there an actual reliable way to get physics based damage to the unit body?
Falling and crashes/bumps seems to always be a pain in the ass to detect, I've come to a solution to detect crashes, but falling damage so far has been unreliable
no idea
if damage is only "" without any instigator, then it's a fall damage afaik
Wasn't the new directHit param added to detect exactly that?
Yes. Projectile classname being "" is also a good indicator.
so: sqf if (_projectile isEqualTo "" && {isNull _source} && !(_directHit)) then {//fallDamage};
I thought that "_directHit" was added to detect explosion damage... since fall damage was already doable before...
Perhaps the wiki is wrong or I am wrong...
Because in the wiki it says: directHit: Boolean - false for fall damage
The request for it came from wanting to detect explosion damage. However, the check that does that in HitPart is complex in some mysterious way and it was not possible to copy it to HandleDamage. Instead, we got access to a less smart check that already existed in the engine, but can only detect fall damage.
"mysterious way" could be the key word definition of the whole damage system to be honest ๐ ... At least I am happy it is getting fixed for Arma 4... and we will be able to enjoy it in 4 years and if we survive WWIII
can be for blastwave too
directHit will deliver false but explosives iirc does return instigators and sources
Fun fact... 100% of the many mods on the WORKSHOP that claim to make the Ai drop their weapon on arms/hand damage and/or drop headgear on headshot are broken and will cause those two things even when shooting to the legs and the body!
๐คฃ
someone made a ticket last year regarding damages triggering for the head in random instances too now that you mention that
it was one of the blue names
but dont recall whom
Well, the whole thing works in such "mysterious ways" that no one has figured out a way to trully make it work for other purposes (not even the devs it seems)... And all who "think they do" they really don't... Maybe the guys at ACE do... or maybe they just scraped all the vanilla stuff and redid the whole thing from scratch
The one in HitPart detects explosive splash damage correctly, but according to Dedmen the one in HandleDamage doesn't. If that changed later in dev branch, that's awesome, but that's not the information I (or the wiki) have :U
I managed to make it work! It is not 100% reliable but every body part fires correctly eventually (after a few shots): https://sqfbin.com/orubeviteweqahanufam
Good evening. Can someone please tell me if there is a way to change the path calculation types for vehicles?
https://community.bistudio.com/wiki/calculatePath
I want some tanks to use "wheeled_APC" or "car" type
Maybe there is some parameter in CfgVehicles that I can edit ?
not from scripting
perhaps from config, but this is not guaranteed.
The preset types like "wheeled_APC" aren't real pathfinding types in their own right, they're just aliases for specific vehicle types to save you having to remember the exact classname when you want a vehicle of that rough category.
There isn't a pathfinding type specified in vehicle config; pathfinding is probably done by AI/FSM based on a variety of parameters like precision, terrain coefficient, tracked vs wheeled, etc., not using a defined type.
Yeah, ur right, I was approaching this problem incorrectly. I have since made it reasonably optimized for multiplayer, but yeah, a command for changing the water level would be much better ๐
Thank you all for the answers
the "random" command doesn't work inside EHs right? Because even if I set sqf If (random 100 < 1) then {}; it always fires as if it was sqf If (random 100 < 99) then {};
wut
if ((random 100) < 1) then {};
less1 = 0;
less99 = 0;
player addEventHandler ["Fired", {
if (random 100 < 1) then {less1 = less1 + 1;};
if (random 100 < 99) then {less99 = less99 + 1;};
systemChat str [less1, less99];
}];```the final output *after firing 100 times* is [1, 99] 
[1, 199] after 200 shots, [3, 249] after 250 shots. random 100 < 99 seems to be a bit too frequent, but whatever 
[4, 397] after 400 shots. All seems to work as intended 
Is there a way to receive the coordinates of a task location on the map?
Thank you, I'll have a look. Looking for a way to spawn enemies around task locations which are randomly generated.
The issue seems to happen with the handleDamage event handler... even thou there shouldn't be any difference, I will replicate your test to check it inside the handleDamage
If you're using exitWith instead of then in your EH, then you can't
So EHs have issues with exitWith...
If EH needs a return value, you can't use exitWith to return it.
That nails my problem then... thank you!
Wrong:
player addEventHandler ["HandleDamage", {
if(condition) exitWith {1}; // Instant death
0; // No damage
}];
```Correct:
```sqf
player addEventHandler ["HandleDamage", {
if(condition) then {
1; // Instant death
} else {
0; // No damage
};
}];
This is also correct:
player addEventHandler ["HandleDamage", {
private _final_damage = 0; // No damage
if(condition) then {_final_damage = 1;}; // Instant death
_final_damage;
}];
so sqf call {if (true) exitWith {}; if (false) exitWith {};}; won't work but sqf switch (true) do {}; would work just fine!?
My god if I knew that before I wouldn't have lost so many hours on it...
player addEventHandler ["HandleDamage", {
call {
if(condition) exitWith {1}; // Instant death
0; // No damage
};
}];
```will work fine
Event handler's code scope must have return value as last statement
return of the call is last statement in that example
All in all, don't use exitWith in root scope inside event handlers, if it supposed to return something to the engine
If event handler shouldn't return anything to the engine, it doesn't matter
player addEventHandler ["HandleDamage", {
call {
if(condition) exitWith {_unit spawn val_fn_x;}; // Instant death
if(condition) exitWith {_unit spawn val_fn_y;}; // Instant death
};
_damage
}]; ``` <--------------- That would also work right
Yes it will, but it won't return values of your functions because
I guess you meant _damage = call {...
In that case it won't work
because _damage will be script thread, not function result
player addEventHandler ["HandleDamage", {
private _damage = call {
if(condition) exitWith {_unit spawn val_fn_x;}; // Instant death
if(condition) exitWith {_unit spawn val_fn_y;}; // Instant death
};
_damage // Damage is SCRIPT return of spawn command here, invalid return
}];
player addEventHandler ["HandleDamage", {
private _damage = call {
if(condition) exitWith {_unit call val_fn_x;}; // Instant death
if(condition) exitWith {_unit call val_fn_y;}; // Instant death
};
_damage // Damage is now whatever these functions return
}];
But only if you had any conditions fire, otherwise it will be nil
player addEventHandler ["HandleDamage", {
private _damage = call {
if(condition) exitWith {_unit call val_fn_x;}; // Instant death
if(condition) exitWith {_unit call val_fn_y;}; // Instant death
0; // Some default value if neither condition fires
};
_damage // Damage is now whatever these functions return
}];
Well, however the case this function worked just fine for what I wanted (to differentiate the true _selection from the fake ones: https://sqfbin.com/apavagewurenuhafotid
player addEventHandler ["HandleDamage", {
call {
if(condition) exitWith {_unit call val_fn_x;}; // Instant death
if(condition) exitWith {_unit call val_fn_y;}; // Instant death
0; // Some default value if neither condition fires
};
}];
```same thing
You can't spawn your functions that should return EH result.
spawn command returns thread handle, not thread\function return
Can you please fix my current fnc then so it works better? https://sqfbin.com/apavagewurenuhafotid
(call returns the value
spawn returns the thread)
ab-so-lutely readable code
Your _newDamage is damage delta, not final damage.
you are right... it should be _damage instead
Also if your condition fails, EH returns nothing and engine uses default damage behaviour
So pretty much same as returning original _damage
Also why stack everything in one line, it makes it unreadable
Sorry, kinda noob here regarding proper readability
if !(local _unit) exitWith {0};
is the same as
if !(local _unit) exitWith {_damage};
because exitWith will not make EH return 0, but will make it return nothing and engine will default to original intended damage of _damage
But either way, HandleDamage on remote units does nothing when it fires errorously
So it doesn't matter
Ok so that is a complete waste, removed
My sole objective here was to isolate the REAL _selection rather than the "replicas" that the handledamage EH does with adjacent _selections...
When a particular REAL _selection is detected, the EH should make the AI drop its weapon (hand damage), its headgear (head damage) or if the Ai has a vest it should increase the damage a little bit (20%)
Ohhh and I added some force applied to ai units getting hit on the leg so they fall and then stand up again....
Believe it or not but that messy code I did was working quite well but I don't even know how ๐
What's with _handleInProgress?
It was my attempt to make the call EXITWITH instead of just going though all the conditions below, because I added the "BODY" first and the "HEAD" last and still the HEAD was firing when I was shooting the unit in the BODY....
So the result was me shooting the Ai unit in the body would trigger the Ai unit loosing its headhear 100% of the time and the HINT would say "HEAD", with that last code I posted it mostly posted BODY (The hint) but sometimes the correct _selection would fire and then the proper effect would trigger, unlike before when it was 100% HEAD or 100% body and never the other parts
I was just desperate and trying anything to make it work...
A shot in the dark if you will
if (vest _unit != "") then {_damage = _damage * 1.2;}; Why damage increase if unit has a vest? Did you mean it the other way around it?
Yes, I want the units with vests take more damage because I hate how bullet spongy the Ai can get when fully geared
So I want the same "one/two" shots kills in all my missions even if the enemy Ai have vests (and I know I could just remove their vest but then they don't look as dangerious...
And yes, I am weird like that, sorry ๐
I prefer adding more enemies that take one/two shots to take down rather than few enemies that require 4/5 pistol shots to take down...
Reorganized your code a little bit, I guess this is what you intended
It can be restructured even more to get rid of these exitWiths and some ifs
Another point I'd make is that checking by selection name might not always work because unit models change with uniforms and selection names change too
There was even an example of that with vanilla assets
Also _deltaDamage > 0.4 is a lot of damage, if unit has one of top vests you're very unlikely to pass more than 0.4 damage at once with a pistol shot
Thank you so much, you are a godsend! You will be one of my first credits when I release my first mission on the Workshop
Checked my statement, doesn't seem to be a case any longer with vanilla assets
CAManBase
["face_hub","neck","head","pelvis","spine1","spine2","spine3","body","arms","hands","legs","body"]
B_Soldier_VR_F
["face_hub","neck","head","pelvis","spine1","spine2","spine3","body","hand_l","hand_r","arms","hands","leg_l","leg_r","legs","body"]
```The only different one is VR costume, because it needs to highlight body parts thus has different selections and more hit parts
Might still be a case for modded units, they might still call selections differently
So I'd advise to check _hitPoint instead
But that's a minor edge case
Checked 1.14 configs and indeed there are czech named selection names:
class HitHead {
armor = 0.7;
material = -1;
name = "hlava_hit";
Ok, that is solid advice, my first mission will be full vanilla but the next one is full CUP...
I think these selection names leaked into some uniform models, underwear one for sure
But worst case scenario the only downside to the current implementation is that the effects won't trigger (weapon drop, headgear drop etc) so it is not such a big downside
just tried the code you optimized and it is just so good now... works like a dream
๐
May I ask which one is your latest project? I would love to try some stuff you made
I mostly work on King of the Hill mission
Join one of the servers with "King of the Hill by Sa-Matra" missions
There is also RHS version
Usually has plenty of players
better disable it again @grizzled cliff
i still see like a ton of shit that has to be changed in a kinda important project before you are allowed to name yourself as "SQF God"
hello to setup a headless client do you put SIDE: Game Logic, CLASS: Virtual Entities, UNIT: Headless Client, CONTROL: Playable, NAME: somename in the init box of the unit, description.ext or init.sqf? i cannot see it stated at https://community.bistudio.com/wiki/Arma_3:_Headless_Client
insert a Headless Client unit
although that seems tad outdated
current location
and give it a Variable Name after placing
thanks for the help
sunk cost, etc ๐คฃ
That would be Wasteland
Hello, I am testing a spawn script. In this case I want to spawn units at player position and initiate a patrol. Unfortunately nothing happens when I execute the script. What am I doing wrong?
fnc_SpawnOpUnits = {
_opUnitList = [
"B_recon_M_F",
"B_recon_M_F",
"B_recon_M_F",
"B_recon_M_F",
"B_recon_M_F",
"B_recon_M_F",
"B_recon_M_F",
"B_recon_M_F",
"B_recon_M_F",
"B_recon_M_F"
];
//hint "Spawning...";
amount = 5;
location = getPos player;
_selector = 0;
_pick = _opUnitList select _selector;
for [{_x = 1}, {_x < amount}, {_x = _x + 1}] do {
_grp = createGroup [west, true];
_grp allowFleeing 0;
_grp enableDynamicSimulation true;
_newOpUnit = _pick createUnit[(getPos location), _grp];
sleep 0.5;
[_grp, (getPos location), 60] call bis_fnc_taskPatrol;
if(_selector <= 11) then {
_selector = _selector + 1;
} else {
_selector = 0;
};
};
//hint "Done";
};
You're not running with -showScriptErrors parameter to see when your scripts error out.
Otherwise this script is really bad
if you've posted exactly what you're trying to run - you're not running any code at all, as all of posted is "assign this piece of code to this variable"
one problem I see is that you set the "location" with getpos and then later u use getpos "location" which isn't going work
and _pick = _opUnitList select _selector; outside of the actual loop, meaning the loop (when actually called) would only spawn the first unit in the list
Ok, thanks guys. Apologies, I have very basic scripting knowledge. I understand my errors with getpos "location" but not sure how to solve the other things.
My objective is to spawn a group of units patrolling around a coordinate on the map. In the example above I use the player as a reference point.
I know the code does not look pretty but at least I got it working in the end. Here is the code:
_opUnitList = [
"CUP_O_TK_INS_Soldier",
"CUP_O_TK_INS_Mechanic",
"CUP_O_TK_INS_Soldier_FNFAL",
"CUP_O_TK_INS_Bomber",
"CUP_O_TK_INS_Soldier_MG",
"CUP_O_TK_INS_Sniper",
"CUP_O_TK_INS_Soldier_TL",
"CUP_O_TK_INS_Commander",
"CUP_O_TK_INS_Soldier_AT",
"CUP_O_TK_INS_Guerilla_Medic"
];
opUnitSpawned = [];
_total = (count _opUnitList);
rnd = 1;
for "rnd" from 1 to _total do {
_pick = _opUnitList select rnd;
hint "Spawning Soldier";
sleep 0.5;
grp = createGroup west;
_myUnit = grp createUnit ["B_Soldier_F", [6219.83,5448.38,0.00161791],["myMarker1","myMarker2"], 50, "NONE"];
[grp, (getPos player), 60] call bis_fnc_taskPatrol;
rnd = rnd + 1;
hint "Done!";
};
I would like to use this code to spawn the units around multiple mission objectives which are assigned to the player so that the area around these objectives gets populated. Does anybody know how to do this?
why use for and not forEach?
rnd var will also exceed limits of array
and you don't need to increment rnd
Hello, I have a general scripting question:
Is there any advantage to having a conditional function call for e.g. different vehicle classes like Wheeled_APC_F, APC_Tracked_01_base_F, MBT_01_base_F, MBT_02_base_F, etc in the init (or caller, I'm not proficient in the jargon) file with layered if and elseifs, then have separate .sqf function files for each item, or is it better to have init check with all vehicle classes checked and applied at the same time and have a layered elseif conditionals for all class functions in a single file? For example:
init file
if (_veh isKindOf "Wheeled_APC_F") then {
_veh spawn lgm_fnc_VehicleFunction1;
};
elseif (_veh isKindOf "APC_Tracked_01_base_F") then {
_veh spawn lgm_fnc_VehicleFunction2;
};
elseif (_veh isKindOf "MBT_01_base_F") then {
_veh spawn lgm_fnc_VehicleFunction3;
};
else (_veh isKindOf "MBT_02_base_F") then {
_veh spawn lgm_fnc_VehicleFunction4;
};
with 4 different VehicleFunctionX.sqf files
or
init file
_veh spawn lgm_fnc_VehicleFunction;
};
with only 1 VehicleFunction.sqf file that has a similar conditinal layout to the example above.
Thank you.
There's no elseif
And your question doesn't really make sense. What you're doing in those scripts is completely different. So one doesn't have any advantage over the other, since they don't really compare
One does different things per vehicle type, other does one thing for several types
Depends on how different those functions are from one another i suppose. There's also a performance related argument to be made here, but that should probably be considered secondary.
Sorry if it didn't make sense. I'm not really a coder and sqf is even more of a challenge on my already lacking c knowledge. The main aim is to have the same function defined to apply different values to vehicles based on their classes. For example, I want to have x3 speed multiplier on an APC while x3 speed multiplier on a tank, when a player driver enters a vehicle.
i doubt performance really matters until you start spawning 50 vehicles per frame 
My question is to whether use class check on the caller function so it can call different function files depending on the vehicle class, or have the caller function call a single file and make the speed change distinctions based on class in that single file.
In that case you can just make a single function and do something like this:
params ["_veh"];
if (_veh isKindOf "Tank") exitWith {
....
};
if (_veh isKindOf "Car") exitWith {
...
};
...
If what you do is similar there's no need make more functions. Just use the "variations" as function parameters
Not calling any other file at all, but having both the class distinction and actual modifier function run in the same single file, if I understand correctly, right?
Either one is fine
If it's too long, or used frequently, you can move it to its own function
Is switch case faster or it's slower?
I mean does switch go to throught for each condition or does it stop when condition is met?
Switch is slower than if exitWith
According to biki
But it does stop when condition is met, yes
It's only marginally slower
But if you were to make that into a switch it would look like: switch (true) do { case (_veh isKindOf "tank"): ... } which I don't like
Awesome good to know ๐
is return an SQF keyword? i can find nothing about it on the wiki, but VScode highlights it red
There is no lineIntersectsASL that ignores sea level?
I wasn't aware that the host needed any update, as noone reported problems with it and I don't know of changes that would need it ๐ค
You could fix it in code and make a pull request
no
Easy way to check https://community.bistudio.com/wiki/return
and here I had hopes seeing you posting the link
SQF doesn't have functions so it's rather unclear what the semantics of a return command would be.
I'd expect same as if(true)exitWith{X}
Though you could easily enough pair it with a function command to disambiguate:
doSomething = function // Takes code, returns code. Sets a function flag.
{
if (_this) then
{
return 42; // Exits the nearest scope with a function flag.
};
0
};
Or alternatively:
doSomething =
{
function; // Marks this scope as a function scope, akin to scopeName naming a scope.
if (_this) then
{
return 42; // Exits the nearest scope with a function flag.
};
0
};
That would not be particularly useful, and would defy expectation. Such a command would probably be better named exitScope or something to that effect.
breakOut
Actually it would probably be entirely useless. If you're unconditionally exiting the current scope, you might as well just end the scope.
Does not return a value.
hate return commands fr
lineIntersectsSurfaces ignores water, if that's what you mean?
Checks for objects which I don't need though
Try terrainIntersectAtASL? It doesn't say whether it ignores water or not
should be terrain only (hopefully)
Nah, they're identical by results
One is bool, another is position
I sent @little raptor a stack trace from an issue I was getting involving sqf::call I think, and he suggested that my host might be out of date, after replacing the workshop version with the most recent build it was working fine
Well I'd love to know what is actually wrong in the old host then that needes to be updated
_myUnit = grp createUnit [pick, tasklocation,["myMarker1","myMarker2"], 50, "NONE"];
This sometimes spawns units in the water. Is there a way to avoid this and only spawn on terrain?
Look at BIS_fnc_randomPos, youll have to restructure the createUnit section but you can guarantee land locations.
or BIS_fnc_findSafePos
I haven't a clue
game_value mags = sqf::call(getVariable("BIS_fnc_compatibleMagazines"), {}); What is the correct way to treat this return value as a vector of game data? .get_as<>()?
I'm trying to override a BI function with my mod, but it fails when starting arma because it can't find commonDefinitions.inc include file (it's assuming my mod path). This is the first line of the function: #include "common_definitions.inc"
Can I put a more specific path in there so it finds the include file?
There are a few, all different
\a3\missions_f_oldman\Systems\scripts\ActionQueue\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\Checkpoint\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\Economy\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\FastTravel\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\Phone\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\Reputation\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\SmartMarkers\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\SyndikatAgent\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\SyndikatCommon\common_definitions.inc
\a3\missions_f_oldman\Systems\scripts\SyndikatTeam\common_definitions.inc
Perfect, thanks, its the phone one.
Thank you both. Works perfect.
Hey, everyone. Fairly new to Arma 3 scripting here but I'm no stranger to text code.
I'm trying to setup a Warlords mission - it's nearly complete but I'm at a near standstill after fighting with this for a hours on end...
Adding custom assets into the Request Menu through the description.ext & I've managed to get one unit to show up for BLUFOR and OPFPR.
I cannot add in more than one unit, I either get an error about my description.ext when loading this mission saying I'm missing a brace '}' or that '}' was encountered when '=' was expected.
OR, I get an error saying the unit is already used elsewhere in the script or just no error at all, making me assume it's working - but there's no additional units in the request menu, just the one unit(s) for each faction.
If you wish to see my script, I'll throw it in a text file and upload it here if I have perms or just DM.
Should I post this in #arma3_troubleshooting instead?
mags.to_array()
How silly of me.. Thank you
Yooooo I don't know what I did, but I did it
thanks for the help ya'll lmao 
Sometimes having to describe the problem is enough to help you solve it =)
That's literally me in a nutshell. I need to get it out of my head to get a better look at it 
aka rubber-ducking (to) the solution!
Can I use "initPlayerLocal.sqf" in an addon? It doesnt seem to be running for me
no
Is there a method thats equivalent?
functions with postInit and checking with waitUntil {!isNull player} maybe
(and making sure it's not dedicated, etc. so as not to cause an infinite loop)
Thanks
What are the limits to single callExtension call in Arma 2: OA v1.64? Input/output max length in bytes etc.?
I am having a headache and a half over trying to get custom audio to play over radio from a unit. Any suggestions?
in description.ext I have this:
class CfgSounds {
Sound[]={};
class Welcome_1
{
name = "Welcome_1";
sound[] = {"Sound\Welcome.ogg", +25, 1};
titles[] = {};
};
class Prisonner_Thanks
{
name = "Prisonner";
sound[] = {"Sound\Prisonner_Thanks2.ogg", +150, 1 };
titles[] = {Welcome to the station};
};
class CfgRadio{
sounds[] = {};
class Radio_Welcome
{
name = "";
sound[] = {"Sound\Welcome1.ogg", db - 5, 1.0 };
title = "Subtitles are said here";
};
};
};
in a trigger, I have
["Events\Commander_Hello.sqf"] remoteExec ["execVM",2];
Within this commander_hello.sqf, I have
[Com, "Radio_Welcome"] remoteExec ["sideRadio"];
Com = unit I want to talk
issue:
Nothing is happening. Even trying to do it
[Com, "Radio_Welcome"] remoteExec ["sideRadio"];
just directly via command console wont do anything.
In another place, I have a "Say 3D" command for a unit with a different voiceline, and it works fine.
sideRadio works with CfgRadio CfgSentences (pasted wrong thing, sorry)
This is a really good guide https://www.youtube.com/watch?v=giOpjIeoWEg
the example mission link works
okay this is a little bit helpful but
I dont see how that helps me get it transmitted over radio
and I dont want a conversation its just one unit talking to the players
hmmm
Is there a way to convert vectorDir to azimuth that I'm just entirely oblivious to?
much easier for me to work in azimuth then convert to vectorDir 
always works in vectors :P
[0,0,0] getDir _vector
Yo, anyone knows how do I make addaction to only be for a specific player to see? other players can see the action on that player
you can also do an arctan, but that getDir usage might be faster.
wouldnt have even thought of that thank you ๐
i would do so but this is incredibly difficult for my brain to understand as is
making it slightly more understandable in exchange for performance probably isnt the worst idea 
I was thinking of completely the wrong thing, sorry ๐
I am
mad
I went on such a tangent for that
at least I know how to get proper lipsync but holy hell
Using bezierInterpolation to get an approximation for the distance along that curve should be fine though, right? 
Okay anyone actually know anything helpful to me regarding this?
have you made it work using call first
where would I put call?
dont use remoteexec until youve figured out what you want it to do on one pc first.
Com sideRadio "Radio_Welcome";
i didnt mean call tf was i on about
just without remoteexec is what i meant
YEAH I feel like im having a stroke with hte awnsers im getting
mood
remoteexec is not what i have seen as an issue
does Com sideRadio "Radio_Welcome"; work
dont use remoteexec until you have it working properly for just your computer in sp first it will save you a lot of headache
I may try but I belive it worked on say3d but heck, may aswell
I never edit a MP mission in sp
I only lan host edit
thats uh
concerning
its simply the best way I have found to make sure as many things as possible work as reliably as they can
convert your thingies to remoteexec once youve got it sorted without first it saves you lots of headache in the long run
Remoteexec shouldnt be the issue unless I did it twice
I remoteExec an entire script with the stuff for dialogue inside
my point stands
you are remoteexec'ing an execvm that remoteexecs a command
is there any specific reason for this to be scheduled btw
Removing the remoteexec in the script does not work
but I do figure it wont hurt either cuz the script is already well
i refer you to this
Have you tried with some other db than -5
if that doesnt work then its an issue with the config
no a word form the man
"description.ext"?
yeah that
allowedFunctions[] = {"BIS_fnc_execVM"};
respawnOnStart = 0;
zeusCompositionScriptLevel=2;
class CfgSounds {
Sound[]={};
class Welcome_1
{
name = "Welcome_1";
sound[] = {"Sound\Welcome.ogg", +25, 1};
titles[] = {};
};
class Prisonner_Thanks
{
name = "Prisonner";
sound[] = {"Sound\Prisonner_Thanks2.ogg", +150, 1 };
titles[] = {Welcome to the station};
};
};
class CfgRadio{
sounds[] = {};
class Radio_Welcome
{
name = "";
sound[] = {"\Sound\Welcome1.ogg", +15, 1.0 };
title = "Subtitles are said here";
};
};
It doesn't give error?
You have one }
Too much there,
CfgRadio should be own
I think you have radion currently in cfgSounds
yes
I will try it then
wait no
hm?
you have an extra };
at the end?
chop the one underneath Radio_Welcome's closing } off
like that?
yes
lift a finger for every opening bracket lower a finger for every closing bracket
I would use notepad++ but sometimes im lazy
okay okay we are seeing results
but he only like
tapped the radio once, I will check the file path
okay so, I am still having issue with something
I dont know whats up
but it seems like everything is working except somehow the broadcast of the radio message
it just does the sound of a radio beginning broadcast and then nothing
there is an animation played by the character talking so I know the script works.
Q: so with entities you can include classes, and whether to include crews, I assume that includes AI in drone positions? but does not let you specify a range about an object, position, etc? so if we used this, we would need some points of interest about which to narrow the result set?
https://community.bistudio.com/wiki/entities
entities [...] select {_x distance player < 1000}
If you need it to be fast then entities [...] inAreaArray [getPosATL player, 1000, 1000]
I do believe I'm being daft however I've no access to a dedi server right now to test -- setVelocity on an object created on the server with createVehicle is correct usage, right, due to the object being local to the server?
Assuming that it's still local to the server, yes.
If a player gets into the vehicle as driver then the locality changes to that player's client and then any subsequent setVelocity needs to run there instead.
nice thank you both for the feedback
Is there a way to open the "mission load" window of 3den from the main menu?
I can't seem to find how it's actually opened, the ui menu config seems to refer to something in-engine, not actually calling an exposed function.
I do not think there is a way. I've tried to see how it's done recently but it indeed is Engine driven
The saga of my radio jamming script is at an end. I just need some help understanding a specific value inside it
YourFunctionName = {
params ["_jammer","_gain"];
_jammerArea = [getpos _jammer,200,200,0,false,200];
while {alive _jammer} do {
{
_gain = if (_x inArea _jammerArea) then [{0},{1}];
_x setVariable ["tf_receivingDistanceMultiplicator", _gain];
_x setVariable ["tf_sendingDistanceMultiplicator", _gain];
} foreach allPlayers;
sleep 5;
};
{
_x setVariable ["tf_receivingDistanceMultiplicator", 1];
_x setVariable ["tf_sendingDistanceMultiplicator", 1];
} foreach allPlayers;
};
Specifically the getpos value
That doesn't look correct imho 
https://community.bistudio.com/wiki/getPos
I've seen a similar getpos value in another script
Wait, it's early ๐
https://community.bistudio.com/wiki/inArea
the getpos is part of the above command ^^
Yeh sorry
_val = if (true) then [{ "true" }, { "false" }];
hint _val;```
Is in example.
Just read 1st 
What you want to set to position of jammer.
That works right? Because all parts looks correct .
You spawn that from initServer ?
You can remoteexec getPos return value if you want.
No, it comes from an init file
call compileScript ["jammer.sqf"];
[jammerName] spawn YourFunctionName;
[secondJammerName] spawn YourFunctionName;
\\\add more as needed
Because using allPlayers, I bet you are using that on MP.
So that will spawn for every client current script.
So every client will check same thing and will add current values every 5 sec forEach player.
You should change that to spawn from server or if you want every client do check for own then pop out allPlayers part and change _x to player.
But still, you asked getPos value.
Just add in script
_pos = getPos _jammer;
systemChat str(_pos);
_pos2 = _jammer modelToWorld [0,0,0];
systemChat str(_pos2);
Oh, I just wanted to know what it meant. The person before pointed me to the right line, it's inArea
You mean an initServer file?
Well yes, but depends how does tf_.. variables are checked. If those are checked local , then you need setVaribales for each client like it's currently.
Because setVariable add current value local.
So if you run it only server it will add current variables on server and only change those on server.
Well Im not best person to explain.
But see
https://community.bistudio.com/wiki/Variables
https://community.bistudio.com/wiki/Multiplayer_Scripting
https://community.bistudio.com/wiki/setVariable
tf relates to the TFAR mod
Meh. Hoped there was a way around having to open the editor on a map first :/
The tf variables are LOCAL. I recommend against trying to use allPlayers in this context. Simply run this from the init, add a check so it runs only on players, find if they are in the area or not, set the variable to player. Repeat every 5 seconds or so.
In my version I also play a white noise sound effect to let players know they are being jammed. You could try something similar. Like a systemChat or hint msg even works. Just a suggestion
Well here is answer.
It needs to execute on clients.
Thanks Ztrack
Is the current setup going to cause major issues?
I'll be honest, arma coding makes my fucking head spin
If that's in init.sqf then it's going to run on the server and all the clients too. So if it's 20 players it'll set the variable 20 times...
You could run it from the serverInit... but honestly that's a lot of traffic that could be avoided by just running it player side
There's another code I found that runs on initPlayerlocal but it's way more complex and I couldn't really wrap my head around some of it
Mostly numbers and true/false values
You don't have to do much. Just remove all the forEach allPlayers and replace _x with player. Then run it from init.sqf
At the top stick this
if !hasInterface exitWith{};
Like this?
YourFunctionName = {
if !hasInterface exitWith{};
params ["_jammer","_gain"];
_jammerArea = [getpos _jammer,200,200,0,false,200];
while {alive _jammer} do {
{
_gain = if (player inArea _jammerArea) then [{0},{1}];
player setVariable ["tf_receivingDistanceMultiplicator", _gain];
player setVariable ["tf_sendingDistanceMultiplicator", _gain];
}
sleep 5;
};
{
player setVariable ["tf_receivingDistanceMultiplicator", 1];
player setVariable ["tf_sendingDistanceMultiplicator", 1];
}
};```
Probably? I'm confused what you're doing with your gain, but the rest looks ok...
Some wizard on the forums posted it in response to a request for help and it works better than what I had
Previously, the players would have their radios permanently disabled if they destroyed the jamming device while they were in the radius
Yep that's why you reset it after the while loop
The other one I was looking at is in this post
About This is a multiplayer compatible script that jams the radios of players that are in range of the jamming device(s). The script supports multiple jammers and terminates once all of the jammers have been destroyed. This script affects each player individually, so a person standing inside the ...
_gain = if (player inArea _jammerArea) then [{0},{1}];
player setVariable ["tf_receivingDistanceMultiplicator", _gain];
player setVariable ["tf_sendingDistanceMultiplicator", _gain];
_gain = [1, 0] select (player inArea _jammerArea);

Please no that obscure else syntax that noone knows
[1, 0] select bool is known
if (cond) then [{then}, {else}] is not ๐
if !hasInterface exitWith{};
missing parenthesis ๐ ahhh
I mean.. Its... a style.. but.. eh..
{
player setVariable ["tf_receivingDistanceMultiplicator", 1];
player setVariable ["tf_sendingDistanceMultiplicator", 1];
}
that btw does nothing
you want to either get rid of the {} or add a call infront
(don't add a call infront)
params ["_jammer","_gain"];
Why is the gain a parameter? its always overwritten
Actually this does nothing at all either
{
_gain = if (player inArea _jammerArea) then [{0},{1}];
player setVariable ["tf_receivingDistanceMultiplicator", _gain];
player setVariable ["tf_sendingDistanceMultiplicator", _gain];
}
Was this code written by AI?
the top is using 2 space indent, inside the while is using 4 space indent, and the bottom is using 2 space indent again.. whaa
ahhh I can't let this be ๐
YourFunctionName = {
if (!hasInterface) exitWith {}; // Executed on non-player
if (!canSuspend) exitWith {_this spawn YourFunctionName}; // Called from unscheduled
params ["_jammer"];
private _jammerArea = [getpos _jammer, 200, 200, 0, false, 200];
while {alive _jammer} do {
private _gain = [1,0] select (player inArea _jammerArea); // if player in area gain is zero
player setVariable ["tf_receivingDistanceMultiplicator", _gain];
player setVariable ["tf_sendingDistanceMultiplicator", _gain];
sleep 5;
};
// reset jamming if jammer died
player setVariable ["tf_receivingDistanceMultiplicator", 1];
player setVariable ["tf_sendingDistanceMultiplicator", 1];
};
I can't let this be
the code fixers curse
hello guys, can someone explain to me, why the hell is my script pausing completely at "sleep" command?!
https://i.imgur.com/IjIe4xd.png
Did you check RPT log messages?
Also pretty sure tf_receivingDistanceMultiplicator is wrong.
Code says the smaller the value, the larger the range you can receive.
So you wouldn't set that to zero to disable receiving/jam the signal... You want to set it to a high value
in TFAR 1.0 it would make more sense to use TFAR_globalRadioRangeCoef global variable.
That's smaller==smaller range, larger == larger range (minimum value is 0.0001)
well, I didn't, but there is no error message triggered when using lower value than 0.079, the script continues normally after sleep
I checked the RPT, it's empty
it's inside a spawned block inside a function that is spawned from a while loop inside a spawned block from init.sqf
well.. After further experiments, it seems that I've somehow killed the sleep function in every script ๐ It doesn't respond anywhere
but it works when launched from debug console...
as I said, it is 100% in scheduled enviro.. Originated from init.sqf through a while loop inside a spawn {} block
I missed that line indeed
and where is that function called?
run diag_activeScripts? I suspect a thread saturation
ima just drop a quick question and get back to it later, I just wanna know if its worth diving into.
Can you put lipsync from the .lip files onto characters doing say or say3d?
without conversation or something like that.
Also worth mentioning its for MP
it should be working out of the box yes
with say (and say3D too I suspect), if the file is voice1.ogg, the lip should be voice1.lip and next to the ogg file
that's it
so it will automatically sync to the .lip with the same name?
ye
please run diag_activeScripts
because one must not spawn a thread for each unitโฆ gooby pls
I am curious @queen cargo, could you give some examples of those things that should be changed and why?
the functions are spawned only after a set of conditions which are hard to accomplish
doesn't explain why sleep doesn't work
[3,0,0,1] before satisfied conditions (debug console)
[5,0,0,1] right before sleep
[4,0,0,1] after (ran from debug console)
I assume you are either talking about ACE or ACRE, no?
simple and fast example?
ACE3, interaction menu
not only the functions are a mess right now, its also the concept behind it which is not optimal solved
never checked ACREs code as there is no need for me
i do know its quite some solid stuff
11:35:36 Starting mission: 11:35:36 Mission file: quickie_kavala 11:35:36 Mission world: Altis 11:35:36 Mission directory: C:\Users\ffredyk\Documents\Arma 3\missions\quickie_kavala.Altis\ 11:35:36 EPE manager release (1|38|0) 11:35:36 EPE manager release (0|1|0) 11:35:38 [CBA] (xeh) INFO: [86387,1241.04,0] PreInit started. v3.15.8.220912 11:35:38 [CBA] (settings) INFO: Reading settings from settings file. 11:35:38 [CBA] (settings) INFO: Finished reading settings from settings file. 11:35:38 [CBA] (xeh) INFO: [86387,1241.12,0] PreInit finished. 11:35:44 soldier[O_G_Soldier_AR_F]:Some of magazines weren't stored in soldier Vest or Uniform? 11:35:44 soldier[O_G_Soldier_AR_F]:Some of magazines weren't stored in soldier Vest or Uniform? 11:35:44 soldier[O_G_Soldier_LAT2_F]:Some of magazines weren't stored in soldier Vest or Uniform? 11:35:44 soldier[O_G_Soldier_LAT2_F]:Some of magazines weren't stored in soldier Vest or Uniform? 11:35:45 Mission id: e7eccdee5e253db63f26f1c1caf865f9e092c373 11:35:48 [CBA] (xeh) INFO: [86516,1250.95,0] PostInit started. MISSIONINIT: missionName=quickie_kavala, missionVersion=54, worldName=Altis, isMultiplayer=false, isServer=true, isDedicated=false, CBA_isHeadlessClient=false, hasInterface=true, didJIP=false 11:35:48 [CBA] (versioning) INFO: [86516,1250.96,0] VERSIONING:cba=3.15.8.220912 11:35:48 [CBA] (xeh) INFO: [86516,1250.96,0] PostInit finished.
End of RPT
your machine is cursed, apply gasoline and match
Feel free to PR your changes then....
just for the lolz, canSuspend returns true?
but also think that i could find something in there too (like you can find in every project)
Why do you think the interaction menu's code is a mess?
โฆprevious statement still applies ๐
๐คฃ
not my job @lone glade, my job is to rage about it
check the backlog of skype @tough abyss (or wait ~2 hours so that im back to my PC)
I have a question about live editing: Is this method viable for general use with any mod, or does such an approach require some specific scripting in the mod for it to work?
This is from the Antistasi GitHub, and building the mod from there and having this makes the recompile function button work as intended, refreshing the shown function in game. However, I wasn't able to get it with a standalone mod I'm working on.
I no longer have Skype installed, I'm afraid.
It depends on how you defined your functions, how you reload scripts "live"
CfgFunctions has a script function that does it
CBA's PREP has a function (I think? does it really? Maybe ACE does that custom?)
Antistasi might have its own, as that script function is called A3A_, that will be specific for antistasi
https://community.bistudio.com/wiki/BIS_fnc_recompile I think this for CfgFunctions, never used it I always restart my mission
Thank you, I'll try to figure this out but restarting the mission would work as well
With the mission restart method, you simply work with loose mod directory instead of with packaged .phos, right?
Same here, no need to anymore. Only installed it for A3 Groupchats
Otherwise you'd need to repackage the mod and restart the game if I know correctly
... ish
not in @mod/addons folder
but the mod basically placed directly in game folder
in my case
Arma 3/z/TC/addons/main/config.cpp for TacControl
there is the webclient too
You have no other mod packages or loose files anywhere else for this?
Or any special directory calling code?
If you have filePatching on, Arma looks up files by their path, in game directory
was not right link ... but its something like that
you can probably access the logs through outlook
pff, meh.
in my case my script is in ingame path z/TC/addons/main/init.sqf
So if I put it in
Arma 3/z/TC/addons/main/init.sqf, Arma will load it from there, instead of loading whatever is in my mod's PBO
So I load my normal mod as PBO, but I also have these files in game directory which will override the ones that were in PBO
Thank you
One last thing: with this, I'd need to restart the mission to see changes in the function viewer, and recompile function button wouldn't work with it, right?
recompile would also work with that
if you set it up
(allow recompile in CfgFunctions, enable filepatching, call that recompile func)
I tried the same approach, but I think instead of trying mission restart, I went with recompile (without having the above-mentioned recompile function embedded) and failed.
all that recompile thing does, is load the script from disk and put it in the variable again
as with filePatching, it loads the script from the separate file, instead of pbo. It doesn't matter if it loads because of mission restart, or loads because you run that recompile func
in short: the global variables require a "hack" to be extended
also, the functions are not rly optimized in it
Alright, thanks a lot.
as said
when i got more time
i could explain further
or you just check the skype backlog ...
or the functions
quite sure if i would dig deeper i would find even more crap in there (just like i did when i just checked out one time CBA ...)
Sure. Give me some specifics if you are up to it, when you got some time.
and for the PR
no, just no
i wont align to some stupid GVARWhatever shit rules
hell fucking no!
it just makes shit more confusing to read and harder to debug
but it is cool because "YEEE WI UZ MACROZ"
No it doesn't, GVAR = mod_pbo_varName
just that you cant just C&P the var into your clipboard
no you have to resolve it first per hand
like with every other crap macro in there
a waste of time
You avoid overlapping vars ...
pff
you dont
you just do it differently
instead of writing the var by yourself aligned to some convention
you let the macro do that for you
which either shows youre not capable of doing that
or you just wanted to use macros because "they are cool"
or because it's easier to maintain ?
its like saying that youre not allowed to have non-constant constants in your code (eg. foo(10) would not be allowed and the 10 has to be made into a macro)
thats bullshit which costs time
also wrong
is creating a new eachframe missioneventhandler for each setvelocitytransformation then deleting it once the transformation is finished an awful idea
i feel like it is for some reason but i do not know why
i could continue like this forever -.- but have to rly leave now
I assume you are talking about magic variables.
good grief
Which really is about providing a useful meaning to a value
but it is cool because "YEEE WI UZ MACROZ" <-- Totaly agrees...
do the returned ID numbers increase, or do they reset back to low number when they're deleted?
I assume increase, which would be bad when you get into the millions range
I think mission eventhandlers are implemented in a way where it doesn't waste any memory (there are differences between the different handler types)
@lone glade while im away, feel free to create some arguments why it is easier to maintain with the macros
i will nicely negate all of em
Oh you don't need to wait
it's easier for everyone to type GVAR(size) instead of mod_pbo_varName
bb
no typing mistakes in mod_pbo
who u mean? ^^
Is it possible to disable the ability to "disable ai" when hosting a scenario?
By Disable Ai what do you mean by that
No
You can run a loop and check if it changes tho
I have some conditions like this:
waitUntil {!(isnull someplayername) && time >0};
But if ai disabled I get error
ah you mean "disable AI for the slot"
Yes
if (isNil "somePlayerName") exitWith {};
waitUntil { sleep 0.1; !isNull somePlayerName && time > 0 };
Thank you!
Is there any way to read a vehicle`s parameters in a script file? For example, reading maxSpeed or accelAidForceSpd of a vehicle (and operating on it) direclty without resorting to velocity and direction?
reading config yes, modifying config no
I want to read a vanilla vehicle's maxSpeed, then set accelAidForceSpd to 1/5th of maxSpeed, then add high accelAidForceCoef to it.
We all know that X39 is the SQF god.
see config commands here https://community.bistudio.com/wiki/Category:Command_Group:_Config
configOf to get the vehicle's config, then e.g getNumber
private _maxSpeed = getNumber (configOf vehicle player >> "maxSpeed"); // the path may be wrong
however what you just described is not possible, what you want to modify, both are config entries
how do I fetch the parameter value? I try:
private _maxspeed = maxSpeed _veh;
but the syntax parser doesn't recognice maxSpeed
Is using the
_value = getNumber (configFile >> "CfgVehicles" >> "Thing" >> "maxSpeed");
In the Config wiki the right way to do this?
ah okay
instead of wanting to modify both accelAidForceSpd and accelAidForceCoef, artificially simulate them with setVelocityModelSpace
wouldn't this apply immediate velocity changes to current speed? for example, wouldn't it add +10 forward speed immediately and not gradually compared to accelAidForceCoef, which decreases as the speed reaches accelAidForceSpd?
https://community.bistudio.com/wiki/setCruiseControl might be what you want
Yes if you used it once with a fixed number, but what you'd actually do is use it repeatedly over time with a scaling number based on how close the speed is to the target speed. Instead of adding a flat 10 once, you might add (targetSpeed - currentSpeed) / 2 every frame the button is pressed, for example.
- actual calculation would be more complex, probably have a cap to avoid insane boost at low speed, safety to prevent negative boosting when above the target speed, etc
is it a mod or does ["hello world"] call BIS_fnc_error in the eden editor work?
oh wait, I could just ask my original question- How does switch execution order work? xD
private _myFunc = {
systemChat "0";
case 1: { systemChat "1" };
systemChat "2";
};
``` from the switch wiki page, this is acceptable to the game, and has a thing that says "order can be difficult to understand" but doesn't elaborate.
oh wait wrong part xD
well, uh- I just realized this is pointless
That seems like a really niche quirk that you almost certainly don't need to exploit tbh
Not only that, but I also can't use switches, I don't think. I need to compare numbers, including if greater/less than
switch (true) do {
case (_num1 < _num2) : { ...```
Oh huh-
Well I'ma write my code to get it working I think, b/c I am having a hard time even doing that xD
(un)fortunately this works yeah ๐
"What if I do X? Oh what about Y! I could do Z maybe?"
How do I work with an unpacked pbo file when scripting ArmA3? Because if I work with the pbo file, I cannot update it in the game, I have to close the game and open it again to change my pbo file, which causes a lot of time wasted. I found this thread on the forum but no one seems to have posted a solution.https://forums.bohemia.net/forums/topic/184587-pboprefix-and-filepatching/
test your script in a separate, empty mission first?
Yes, I thought about it, I'll try it, but doing it with PBOPREFIX on the wiki seems to make my job much easier.
what does it have to do with script? AFAIK you can't read it
Is your folder [symlinked] in the Arma 3 install folder?
"x\myMod\addons\myAddon" i have this folder structure in my arma3 install folder and also i have my mod in "Mods/MyMod/addons/myMod.pbo" and I load it from here.
actually it is a mod but just script code
then make it work in a mission, then pack it
doing it with PBOPREFIX on the wiki seems to make my job much easier.
no idea what that has to do with it
that's a 2009 guide, not recommended
this seems to be my only option at the moment, thanks
What is in your $PBOPREFIX$?
trust lou on that one its lead to me being able to make mods in 2 days
actually at the bottom of the page there are these tags and the updated date, it should work in arma 3 but I guess it doesn't work properly.
x\myMod\addons\myAddon
really, if script only I only recommend you to debug them in a mission, I really don't see what issue having a PBO solves
PBOing should only eventually be used for MP testing, and for release, period
myAddon file contains my pbo unpacked data, i have only 1 pbo file
He's got the antipathy down pat
lmao me who tried to test mp locality of units by just zeus spawning them
For some reason I couldn't get the "vehicle player" work in the example, although it works everywhere else as intended.
However, this alternative worked, so thanks a lot:
private _veh = vehicle player;
private _maxSpeed = getNumber (configOf _veh >> "maxSpeed");
systemChat (format ["%1",_maxSpeed]);
"Mods/MyMod/addons/myMod.pbo" and I load it from here.
is the pbo namemyModormyAddon? we can also dm to avoid taking up too much space here.
ah, might have been an operator priority issue; getNumber (configOf (vehicle player) >> "maxSpeed") might work
sorry & thanks for the update
yes, this works
getVariable undefied, is it any when formatted?
hint "";
_max = _this getVariable "ratchet_ace_maxFuelCargo";
_cur = _this getVariable "ace_refuel_currentfuelcargo";
hint format ["%1 \n %2",_max,_car];
-1
any```
oh no wait
_car xD
_cur is now <null> which makes more sense then it being any
Anyone knows what script I can use?
https://forums.bohemia.net/forums/topic/215767-how-to-spawn-a-single-magazine-on-the-ground/
I tried this but none worked
I havent done this since Arma but cant spawn a single magazine on the ground. Im attempting to spawn a single magazine on the ground with no luck. I can spawn items but not magazines. I just need one additional magazine for a weapon. Thanks Avibird.
You need to create a GroundWeaponHolder(_Scripted?) and add the magazine to its inventory
Sorry I did not quite understand?
Magazines can't exist on their own. You need to create a holder object (classname GroundWeaponHolder) which is a sort of invisible container, and put the magazine in it.
IF the pbo prefix was correctly applied to the pbo
Then you'll have
Arma 3/x/myMod/addons/myAddon/config.cpp
right?
You can open the pbo in Notepad++
if the prefix was correctly applied, you will see
prefix NUL x\myMod\addons\myAddon
close to the start of the pbo
if that is not there, the prefix wasn't correctly applied when packing pbo (setting prefix depends on what tool you use to pack pbo)
Yall ever forget how math works?
"Why is there 100 left over after I filled up a 650 barrel with 50 already in it with 700? Why isn't it 50?" b/c you already had 50 maybe xD
Addon builder UI is pretty awful for prefixes and you want to script that.
Ok, consider if your mod is a giant pile of interconnected shitcode where it's often impossible to test small pieces in isolation.
And yeah, we use filepatching for developing Antistasi :P
mh code looks correct t ome
https://github.com/intercept/intercept/blob/cf6c17afb2e80a79db987966942b22234a29015f/src/client/intercept/client/sqf/position.cpp#L634 maybe set breakpoint here and confirm that from and to contain correct values
Also you probably should't call sqf for distance_2d
Intercept has native c++ vector functions to do that
you mean this https://community.bistudio.com/wiki/BIS_fnc_guiMessage ?
have less shitcode! ๐
yet I somehow think you have your code in one Eden Editor mission to make it work too
why would the PBO help here, I don't see why?
Nah, we're a mod these days.
Can someone send me a link to animation tutorial/scripting basics? I can't find a noob friendly one? It's a shame to play arma 400+ hours and not know how to script
Yeah it was far easier to develop back when we were a mission.
What are you trying to do? Almost all animations are done by model config and not in scripts
Oddly enough my workflow now is better than when it was a mission :P
you have been looking at math equations for too long. It's okay john we don't need good dive bombers
"the Excel file" conundrum?
"wait don't change that, I modified this"
(this is because my workflow was deeply suboptimal before)
Nah, just never figured it'd run from the editor with a bit of folder mapping.
God if we had tdd in Antistasi.
So I'd build the thing to PBO and back Arma out to the main menu each time.
Mod + filepatching is just save file and restart mission.
Unless you messed with hpp, in which case it's rebuild time.
lol, we really need a better solutions for members.hpp
file_exists cmd does exists
At this point could BI just bring back the Java Support from Take on Helicopters? lol
Hold on Lou, what if I promise you 25% percent of all the bitcoins I mine in Java, if you bring back Java /s
J*va ๐ท
Hi, is it possible to move an helicopter just above a specific point ? Because i'm making a custom "slingload load/unload" waypoints but the "move" command is not accurate enough for that so is it possible to move an helicopter with very good accuracy like the vanilla "load/unload" command ?
Because the waypoint terminates at 50m or something?
exactly, it's not 50m but yeah 25 meters or above so yeah exactly
You could do the last bit with some setVelocityTransform horror. Not having any better ideas at the moment.
Maybe if you control the waypoint speed and you know what heli it is you could set the waypoint a bit beyond and it'll be pretty accurate.
Hmm no, waypoint updates are too random for that.
i will try the setVelocityTransform to see if it's good or not
setVelocityTransform stuff will work but it's a lot of work.
Fairly simple case at least.
can't you hook (hehe) the slingload waypoint itself, as the helicopter's AI does the job already?
hmm, wonder what happens if you put an invisible landing pad in mid-air :P
sadly not because i want to lift objects that don't have "Memory Points" in their models and their P3D are binarized so i can't modify them. I wanted to modify the P3D of the "Container" but it is binarized so i can't do nothing. I didn't try to put an array instead of a memorypoint in the config but i'm pretty sure it's not working. They added this to the "createRope" but i'm not sure if they added this in the config.
Could try spawning something that can be slingloaded, and then do a bait-and-switch =p
yeah but how do you detect when an object has been taken ? And if i do a switch, i need to unload it after
there's a rope connected EH
that or the normal slingload waypoint that completed
ok but how can i hide the object that can be slingloaded without losing the feature ? Because i tried "HideObjectGlobal" but the object is like frozen.
If the real object is big enough, you can simply put the slingload proxy inside it
Also, if modifying the P3D was a possibility, this must be a mod, right? So you can make your own invisible slingload-capable object and include it in the mod
Yeah but if "modifying" this simple container p3d was possible then yeah it would be a mod. It's really simple, you just need to create some new memorypoints on the angles and it's almost done. You need to overwrite the container config with the new "slingloadcargomemorypoints" array and it's done. I already did that on my own crates so i know how it's working.
easiest way is to use setObjectTextureGlobal on all its hiddenselections and such
hiding object just makes it no longer exist in the physical plane iirc
ah yeah interesting i forget this one
Obviously, you need to change the mass too otherwise you won't be able to lift it. I will try just in case to see if we can put positions instead of memorypointsstring but i think it's not working.
My point was that if this is a mod and not a mission, you can add your own invisible slingloadable object to use as a proxy for the non-slingloadable container. You can't do that in a mission since CfgVehicles doesn't work in mission config.
then yeah but the object need to be slingloadable and need to have the same size of the container
Well, that's up to you
this is not a real problem but i need to attach the container to this object
If only there was some sort of script command which you could use to attach things To other things
you can attachTo but the problem is the collisions and especially for the doors collisions
for now the best thing is probably the setVelocityTransformation
is this for a cargo container
yep, it's the cargo container 40 and cargo container 20
are those really not sling loadable by default?
sadly not ๐ฆ
I mean...your new invisible object can have collisions
it's not a question of mass, it's a question of memory points. I checked the p3d itself using a converter and there is no memorypoints inside
except 3 that are for the doors
Shameless self-promo but you can easily rig those with Sling Load Rigging, albeit not via vanilla magic rope.
i don't understand what you mean sorry. What do you mean by "You can easily rig those with Sling Load Rigging" ?
its ampersands mod
(quite a good one)
but it's a manual thing, and i want something for the AI
If you don't want to worry about attach/detach collision, my initial idea was to use the bait object to get the chopper in place, then script the ropes, and delete the bait object.
Btw so thank you, now i will try the setVelocityTransformation to see what i can do.
dont expect to be able to use velocity on setvelocitytransformation
if setvelocity does not work on the object then the velocity parts are ignored
yeah i checked and it seems to be something animated with lerp. The only thing i hope is the rope are following the animated vehicle.
so long as theyre attached to it theyll b fine
awesome then
currently having to alter how quickly the interval passes to make acceleration effect on a static object for selveltransform 
Note that if your setVelocityTransformation becomes sufficiently complex, it might be cleaner just to set pos/vel/dir in a loop yourself instead.
As far as I know it's just a shortcut to lerping everything yourself.
i think i will use the linearinterpolation function because to be honnest it's all i need.
the dir will be the same, the velocity will be stopped, so i just need to lerp the positions
I'm using multiple SVTs on multiple objects at the same time so it's simpler for me to use the same command
my main problem is getting the distance along the curve that will happen prior to doing it and I think I may have to end up using bezierInterpolation to add together the distance between steps 
Does "playSound3d" suspend the code until the sound is complete? It seems to be delaying my code running until its done playing...
If this doesn't work, I'm coming back and beating you with a bag of used socks
Well as I said, it doesn't really, because youre not setting receiving distance thing correctly
people inside jammer won't be able to send
but they can still receive
I'm fine with it. I don't want to monkey around more than I have to and gives zeuses the ability to inform squad leads of stuff.
I can try the initplayerlocal one, but I don't really understand it
I watched many videos, but apperantly, everytime I try anything I always fuc_ up and it doesnt work
Nvm
Nvm I'll try again,
but a link to good tutorial won't hurt
There are no tutorials about animations that I am aware of. And from my experience tutorials won't help you learning scripting.
It's all trial and error. Hard work.
is there a way to teleport the player?
setposasl
hey, ive read that when you spawn groups using scripts, its a good idea to have deletewhenempty on the groups in order to save on long term prefromance
I have a script where I have tried to do that without much sucess
_grpG4 = [getMarkerPos "Enemy_Garrison_3", east, ["OPTRE_Ins_ER_Warlord","OPTRE_Ins_ER_Guerilla_AR","OPTRE_Ins_ER_Militia_MG","OPTRE_Ins_ER_Guerilla_BR","OPTRE_Ins_ER_Guerilla_AR","OPTRE_Ins_ER_Rebel_AT"],0] call BIS_fnc_spawnGroup;
_wptG4 = _grpG4 addWaypoint [getMarkerPos "Enemy_Garrison_3",5];
_wptG4 setWaypointType "SCRIPTED";
_wptG4 setWaypointScript "\z\lambs\addons\wp\scripts\fnc_wpGarrison.sqf";
sleep 1;
_grpG4p = [getMarkerPos "Enemy_Garrison_3", east, ["OPTRE_Ins_ER_Insurgent_BR"],0] call BIS_fnc_spawnGroup;
_wptG4p = _grpG4p addWaypoint [getMarkerPos "Enemy_Garrison_2",5];
_wptG4p setWaypointType "SCRIPTED";
_wptG4p setWaypointScript "\z\lambs\addons\wp\scripts\fnc_wpPatrol.sqf";
//rules
sleep 2;
{_x deleteGroupWhenEmpty true;} forEach [_grpG4, _grpG4p];
//where the fault is
any suggestions?
I have tried but no sucsess with _x
do you mean it should be written as it does now?
yes
ah
whats wrong now?
hu
okay I solved it
somehow
Idk maybe the _x didnt save
Only when into the millions range? Unlikely that many transformations would be happening in one server session ๐
I'll check nevertheless as it's still a consideration that should be made, thanks
Yeah is eachFrame so returned ID number increases once deleted with sqf addMissionEventHandler ["EachFrame", { removeMissionEventHandler [_thisEvent, _thisEventHandler]; }];
modes don't work for the land command
i'm trying to script the cage onto a vanilla APC using
car1 setObjectTexture [4, (getObjectTextures car1) select 4];
Where select 4 is "a3\armor_f\data\cage_olive_co.paa"
Any clue why this wont work?
wut
trying to use https://community.bistudio.com/wiki/setObjectTexture
To apply custom camo options available in the editor garage. But through script
select 4 is "select 5th element of provided array". car1 setObjectTexture [4, (getObjectTextures car1) select 4]; is "set 5th texture of 'car1' object to whatever it's 5th texture is right now"
which translates pretty accurately to "do nothing"
wat
so im trying to edit the 5th hiddenselection (slat cage), it starts from 0
Given the 5th texture, which is the cage
and you set the texture to whatever it already is
because getObjectTextures car1 is "get current textures", and (getObjectTextures car1) select 4 is "get 5th current texture"
so how do i get the options listed in the editor vehicle appearance thingimajiger?
using getTexture with the options in seems to give me the standard vanilla textures
nevermind i noticed an export command and i figured it out. Thanks booo
you edit the thing to your liking, start the mission, check getObjectTextures output there and use the texture paths it returns. I suppose that would be the easier solution. Or you browse the "TextureSources" subclass of vehicle class and find the texture arrays in its "textures" property
also, remember that hiding/showing the vehicle parts isn't done by retexturing, it's animation. Textures are only responsible for colors and such
for example, "B_APC_Wheeled_01_cannon_F" needs this animateSource ["showSLATHull", 1]; to show the hull cage and this setObjectTexture [4, "texturepath"]; would only color it if it's already shown
Ah makes sense
Btw. Still waiting for arguments list @lone glade
Not yet home but thought lil gentle reminder helps
I'm still waiting for you to stop your salt factory
it still lands on ground
abort landing if lineintersectssurfaces finds terrain beneath it on each frame ๐
(dont do that)
you can't abort landing
well at least not with the land command
make it move above itself
@lone glade while im away, feel free to create some arguments why it is easier to maintain with the macros
i will nicely negate all of em
The most simple fucking one.
They rename a PBO
No need to ass about replacing it in every single file.
is it possible to use deformer on pub zeus? if so how?
in comp form btw
Deformer is for Eden
The same reason you use interfaces, abstractions and million other things.
It's not rocket science.
and, why would you rename a .pbo?!
Why wouldn't you? A something goes out of scope of a module and suddenly they are two modules.
If a pbo gets to big they might split it into two or such
ACE team decided to use these macros despite them having zero benefits and overcomplicating things needlesly
obviously
Still makes no real sense at all.
face -> wall
Exactly Commy2
irony warning
How does it not make any sense? Unless you're a future teller and you know what your project will look like in a years time, you have to take into account potential restructuring.
It's also server side.
Abstracting away crap is needed in larger projects.
rolleyes
I tried setVelocityTransformation for moving heli into hover position. It plummets after the sequence stops, so I need to have the final altitude at 25m. The up vector has very little effect.
what orders is the heli pilot on?
default. I tried flipping the up to [0,0,-1] and it appeared to align the huron rotors to the ground. i take that to mean the up vector is ambiguous for helis.
wait, what's ambiguous about that
You're right. Who the fuck needs things like namespaces.
at [0,0,1] it maintains a dive angle. it also flips very suddenly with -1 rather than smooth transition, as if it is fighting physics i guess.
Pointless in every single language that implements them.
oh, interpolating between [0,0,1] and [0,0,-1]? Yeah you want an extra stage for that.
but I'm fairly sure that you don't actually want your heli upside down here :P
Oh wait, someone here is making an object oriented sqf thing.
Wait what
Objects in most languages can be EXTENDED
oooooooooooo
Why would you ever extend an object. :O
Seems like you have some Problems oO Keep arguing like an adult.
I'm not the one rolling my eyes.
I meant I tried both as the end state from whatever it already is. With [0,0,1] end it actually ends in a dive if it starts in one. You can try it for yourself with this: https://drive.google.com/file/d/1D_vmCjQHllLxFc0lo75yKmC8YDbGLC1X/view?usp=share_link. Just unzip to your missions folder. I'm working on a version that can sling cargo around the map.
Your flyInHeights don't seem to match the movement?
Most of CBA should be in Arma 3 by default. Macros are a nice way to ease development. It's especially nice if you don't have to type the same few letters over and over and over again. If you really want to get rid of the macros in the built version one could use a preprocessor during the build process.
those are for ai taking over the vertical aspect after it reaches the proper planar position.
and? Did i made up such childish stuff like that above? Nope. I am just not in the mood, to argue with somebody, that is arguing like the stuff before.
the end dir & up are mismatched.
Assuming you want the thing flat at the end, you'd need something like
_endDir = vectorDir _heli;
_endDir = vectorNormalized [_endDir#0, _endDir#1, 0];
Hello, How can I play a video inside a mission activated by a trigger? I am useing it this:
private _video = ["A3\Missions_F_EPA\video\A_in_intro.ogv"] spawn BIS_fnc_playVideo;
And I see it, but the rest of the players on the server not
You could try ["A3\Missions_F_EPA\video\A_in_intro.ogv"] remoteExec ["BIS_fnc_playVideo", 0];
" Unless you're a future teller "
I wouldn't necessarily expect the heli to just stay where you put it afterwards though.
Arma AI never does what you want it to do :P
Ah. I was mixing up dir and up. Also the while condition is tricky. With that code 0.1 will make it get stuck.
should just use interval > 1 really, and make sure it finishes the final setVelocityTransformation
One could argue about the helper functions. They aren't needed in most mods. And if you're only using one or two things from CBA then probably you don't need CBA.
+restructuring almost always happens, that happens. So, pff
ok, I changed those two things and it's pretty good apart from kinda stopping kinda dead above the UGV :P
would be good with with some quadratic position interp.
AI -> setVelocityTransformation transition is nearly seamless.
It's clearly hyperbole. As you say restructuring is the reality of a lot of apps.
erm, @stray kindle , cba was in General Chat :D
Also using start = end for the dir & up works fine until it actually reaches 9m, and then you get a bit of backswing. Would depend on how well the AI was controlling the approach though.
Why not plan ahead and reduce your workload in the future?
Are you sure? If it is stopping dead your while is probably still getting stuck. I had clipping on linearConversion set to true. So if you used !(_interval > 1) as condition it will not complete. For me it almost bombs into the ground when it is complete.