#arma3_scripting
1 messages Β· Page 101 of 1
Thanks guys.ππ»
well the thing is you will notice that comands to retrive contents of containers withing containers return doubled info and stupid crap
comands for inventory handeling dont really complement eachOther
especially
getItemCargo, everyContainer
grim ... dont make me do that ... PLEASE ... i already have like a ton of shit still to do :(
- Fallout 4
- OOS
- XMS2
- Study (ye ... i actually DO have a RL too :P)
@queen cargo I'm guessing you are being sarcastic, but it's not really redundant when it has different functionality, especially when the BIS function uses a command that would extend the scripts run time by like 200
X39 dont forget external UI
which command is that pennyworth?
ha ... not even thought about starting that one yet @fallen locust :P
saveprofilenamespace
@native hemlock besides the fact that it does exactly the same thing, the script time is just extended by somewhat around a few ms ... which is nothing
I have this now ```if (!isServer) exitWith {};
towerchat = { [] spawn {
private["_p1","_p2","_base","_h1","_h2","_activate"];
_p1 = p1;
_p2 = p2;
_base = carrier;
_h1 = h1;
_h2 = h2;
_activate = activate0;
while {true} do {sleep 1.5;
if ((_p1 in _h1) && (_activate) || (_p2 in _h2) && (_activate)) exitWith {};
};
sleep 1;
[_p1,"RadioMsg_Request_takeoff"] remoteExec ["sideRadio",0];
sleep 5;
[_base,"RadioMsg_Request_takeoff_TowerReply"] remoteExec ["commandRadio",0];
sleep 5;
[_p1,"RadioMsg_Request_takeoff_confirm"] remoteExec ["sideRadio",0];
sleep 10;
"Reminder: Adjust View Distance Before Take Off" remoteExec ["hint", 0];
[[this]] call ANZ_heli_mission_fnc_pzchat1;
};
};``` but its stopped working.i have executed it from debug console but nothing.no errors show either...
oh yeah, it writes to disk. i'm definitely sticking with my own functions then, thanks for the heads up
and a fact it uses profilenamespace is anoying
Because you're just assigning a value to a variable (towerchat = { ... };), but you're not executing any code.
This should be all you really need:
if !(isServer) exitWith {};
[] spawn {
//There's no need to assign hardcoded global variables to private variables, so I skipped that.
waitUntil {sleep 1.5; activate0 && (p1 in h1 || p2 in h2)};
sleep 1;
[p1, "RadioMsg_Request_takeoff"] remoteExec ["sideRadio", 0];
sleep 5;
[carrier, "RadioMsg_Request_takeoff_TowerReply"] remoteExec ["commandRadio", 0];
sleep 5;
[p1, "RadioMsg_Request_takeoff_confirm"] remoteExec ["sideRadio", 0];
sleep 10;
"Reminder: Adjust View Distance Before Take Off" remoteExec ["hint", 0];
[[this]] call ANZ_heli_mission_fnc_pzchat1; //This won't work because there is no variable "this" in this context.
};
using this to execute [[this]] call ANZ_heli_mission_fnc_towerchat;
while {true} do {sleep 1.5;
if ((_p1 in _h1) && (_activate) || (_p2 in _h2) && (_activate)) exitWith {};
};
```β```sqf
waitUntil { sleep 1.5; _activate && (_p1 in _h1 || _p2 in _h2) };
Yoink
I refuse!
By this ```sqf
towerchat = { [] spawn {....
And that you would do by ```sqf
[] call towerchat;```
sigh ... lets look at least into the UI editor the external one a lil bit closer ...
executing from debug.is that what u mean?
First you declare, then you call.
You can do it from anywher once you have declared the function.
ok.got your edit.Thank you!
If you want it to execute right when u enter the main code (function), you need to restructure it a bit as @willow hound suggestted before. Basically you would need to take the content of the function and run it as a series of commands not as a function. If it makes sense.
<array> = serializeInventory <object>
and
deserializeInventory [<object>,<array>]
i would kill for that :P
call my Function; //now it will execute the insides of myFunction```
or you can just type and execute:
```do something here; //here it will execute the insides right away```
Its starting to get tricky...
Ok ,i'll try to get to grips with this.Thanks guys.:)
Just google what the concept of a function means in programming/coding.
rgr that
SQF is a bit special because anything wrapped in { } is a code object.
k.thanx.
would make more sense
same thing
I feel like you have started a bit wrong, maybe you need to try few simple commands and functions first, and then read and try some bigger tutorials.
you get the point
been working from different examples to learn and just hoping for the best.
i think you mean based
and not be a special edge thing for special typee of missions
An appropriate usage of the word, I guess :P
You seem to understand well, but you do make some fundamental mistakes here. Try for example to write a function that will do something like showing a text on display when it is called (for example from a trigger that you place in the editor). Once u master this you can level up. π
From the SQF syntax page:
The SQF Language is fairly simple in how it is built. In fact: there are barely any actual language structures at all.
you will learn Enforce Script way peacefully
BY FORCE!
i will not!
im not even a scripter im just a designer who likes sqf because i can do things how i like
and sqf is easily accessible to me because
i dislike oop scripting
its easily readable
SQF is definitely an OOP language, even though not in the true sense of the words. So basically it is and it is not at the same time. So, SQF is a paradox. π€
i know i just prefer call this text file
but so it saves and loads weapon attachments in vehicles
rather than the word spaghetti of calling other methods in c# and other languages
its unironically my favourite language for how easy it is to make the stupid ideas i have
as this is atm not possible
it is OOP since v2.14
I kinda hand problems to wrap my head around the idea that I don't know which object's method is being called and which object is just an argument. π Also the code {} object thing is great π
i dont know what that means and i think itll hurt my brain if i do
the only thing i dislike about sqf is no angular velocity commands (i am biased) and its performance (which isnt even terrible if youre not awful at scripting in a lot of cases) other than that its perfect
never fixed that ship orientation bug
the only thing i dislike about sqf is no angular velocity commands
that's not related to "SQF" tho. the engine itself doesn't have angular velocity
i must keep banging on this drum until something changes
the past 6 months of my life cannot have gone to waste like this
though tbf i am much better at scripting now
working from the towerchat example i edited another of my scripts to be the same but am getting nothing.as far as i can see it should work the same?```if (!isServer) exitWith {};
[] spawn {
waitUntil {
sleep 1.5;
activate1 && (h1 distance pzsmokepos1 < 2300 || h2 distance pzsmokepos1 < 2300)
};
[p1,"RadioMsg_Alpha_1_1_approaching"] remoteExec ["sideRadio",0];
sleep 6;
[carrier,"RadioMsg_Alpha_1_1_cleared_for_landing_1"] remoteExec ["commandradio",0];
gun1 doArtilleryFire [ship_target1, "magazine_ShipCannon_120mm_HE_shells_x32", 6];
sleep 1.5;
gun2 doArtilleryFire [ship_target2, "magazine_ShipCannon_120mm_HE_shells_x32", 6];
sleep 2.5;
gun3 doArtilleryFire [ship_target3, "magazine_ShipCannon_120mm_HE_shells_x32", 6];
sleep 2;
gun4 doArtilleryFire [ship_target4, "magazine_ShipCannon_120mm_HE_shells_x32", 6];
[] call ANZ_heli_mission_fnc_lzchat1;
};```
getting nothing though
ive not had an error in my code for months now, just errors in whats produced
executing with this activate1 = true;[] call ANZ_heli_mission_fnc_pzchat1;
where is that run
from debug console
not on a server i presume
is ANZ_heli_mission_fnc_pzchat1 defined?
yes or at all
you can run code by making it a public variable then calling the variable
doesnt need to be cfgfunctioned
if it's define you should see the code when you type just ANZ_heli_mission_fnc_pzchat1 in debug console
run things like h1 distance pzsmokepos1 etc in systemchats
yeah
e.g. one systemChat in the waitUntil
systemChat str [h1 distance pzsmokepos1, h2 distance pzsmokepos1, activated];
and one after to see if it finishes at all:
systemChat "Condition satisfied"
Also enable "show script errors" in the launcher so that you at least get a warning when your code falls over entirely.
you guys are starting to leave me behind.why does towerchat run but not pzchat1.different rules? or is the code ok?
theres no syntax errors in the code
i have script errors on
meaning its likely an issue with the waituntil never completing
if theres no errors that get thrown just look for spots where your script can hang
Make sure that you have your units named h1 and h2. π Or assigned to those vars.
yeah got that..activation numbers screwed
is persistence really a niche thing?
now they are structured like this do still need to add them in with cfgfunctions ?
cfgfunctions just serves as a way to define your function and prevent it being overwritten during runtime
kjw_fnc_ilikeballs = {
systemChat "i like balls";
};
publicVariable "kjw_fnc_ilikeballs";```
does a similar thing but the function can be overwritten
which can help during developing code
lol ok
i tend to use filepatching with cba's PREP macros so that i can edit code in vscode then just restart the mission and have the changes
and not be limited to a single mission file
i prefer pron
If you have it as you posted in the last message, you can either try to run it in debug console by copy pasting, or adding the name of the .sqf file to the cfgfunctions and then calling it by its name defined in cfgfunctions.
fn_myFunction.sqf
then in game
call yourTAG_fnc_myFunction;
porn
i have this ```class ANZ_missions
{
tag = "ANZ_heli_mission";
class functions
{
file = "functions";
class goodluckchat {};
class towerchat {};
class endchat {};
class base_arty {};
//class base_arty2 {};
//class base_arty3 {};
class fiftycal_fire {};
class fiftycal_fire2 {};
class fiftycal_fire3 {};
//class tank_fire {};
//class vls_fire {};
class Getin1 {};
class Getin2 {};
class Getin3 {};
class Getin4 {};
class Getin5 {};
class Getin6 {};
class Getin1_b {};
class Getin2_b {};
class Getin3_b {};
class Getin4_b {};
class Getin5_b {};
class Getin6_b {};
class Eject1 {};
class Eject2 {};
class Eject3 {};
class Eject4 {};
class Eject5 {};
class Eject6 {};
class Eject1_b {};
class Eject2_b {};
class Eject3_b {};
class Eject4_b {};
class Eject5_b {};
class Eject6_b {};
class pzchat1 {};
class pzchat2 {};
class pzchat3 {};
class pzchat4 {};
class pzchat5 {};
class pzchat6 {};
class lzchat1 {};
class lzchat2 {};
class lzchat3 {};
class lzchat4 {};
class lzchat5 {};
class lzchat6 {};
};```
i havnt had to do that.restart game or mission?
if you make changes to the functions if defined through cfgfunctions you need to restart the game
or should need to do so
If you are in editor playtesting just get back to editor and playtest again
1 in 10000 times things do go arse up.is that why?
i just work in editor with scripts
But I am not sure if your tag could be that long? 
not had issues tbh.that i am aware of..
Thnaks for ya time guys.Got alot to digets and some scripts to edit.:)
well more then 50% of arma player base uses some presistance, low or high i would say no
i misread that for diglets, got very confused
but yea whatever
depends what you are doing really, if you had rotating scenarios you wouldn't need it but if people are playing the same content it gives them something to work towards
It had a purpose a lot of years ago.
It exploited a bug (= not returning a value) to workaround another bug (Editor script fields refusing the code if they returned a value)
Nowadays that doesn't make any sense anymore, and in standalone script files, it never did
There is Arma Debug Engine. If you're looking for a debugger
@candid sun yes it is
it might be true that many people play that stuff but nearly nobody needs that stuff who is doing SQF/missions
If you try to implement persistence, especially saving contents of containers inside containers.
You will notice the commands are all ad-hoc in arma, most of them don't have a reverse command.
So you will end up parsing the info to make use of it
It does have ang velocity
settorque doesnt count
*nearly all ad-hoc
im very salty about 6 months of work not working because the engine doesnt want to interpolate the orientations
both me and leopard spent ~2 weeks debugging and i rewrote the function entirely with no joy
^^ that
setvectordirandup on each frame also doesnt get interpolated
and you still cant get 1:1 replica
that sentence⦠doesn't make sense?
things without physics need an eachframe with valid values you provide (interpolated vectors)
network refresh rate is another thing
it interpolates positions between network updates π
You can not get the submarine-ariplane to turn smootlhy, or what is the problem?
yep
leopard and i spent ~2 weeks on debugging this and i spent another 2 weeks before giving up
works fine when its local (because it doesnt need to be interpolated)
network doesn't try to interpolate vectorDir/Up changes, OK
real
it's a pickle for sure
so @fallen locust ... your UI editor ... well ... it would not be that hard ... still a ton of work
would need at least like two month to develop a first version
which would get moved to trash after one month of polishing
You probably need to tie the movement to a time dimension, and then manually interpolate the vector based on the time passed. And if possible make it run locally, and resynchronize with server. But I am not sure where exactly your problem lies. π
i do that
it works perfectly in sp
im 95% certain this is an issue with the game engine rather than my code
so you cant do it right:P not good enough? :P
I think that this is not a task for SQF scripting then. The only thing that could help is to run it entirely on a local machine and shorten the time between anim changes.
Yeah, I guess you could have client-side interpolation and the server would just send position updates that would then get interpolated on the client. But in general it's a tricky problem to solve well
Yup, seems pretty obvious to me
i do can ...
cant do as object needs to be global
and no local effect setvectordirandup (else this'd be easy as piss)
but i cannot start another time intensive project
i bet you you cant :P
wonders
we will see
Engine does have angular velocity, right. It just doesn't send it, or only sends it for objects with certain simulations?
tried planeX instead of physx crate and has the same issue if thats what youre thinking
How is this object so different from the normal submarine or a plane that is in Arma 3? Could it not be just a vehicle as any other.
its a physx crate with a sub attached
Aha.
i see i have fooled you as well
(thats the point)
its intended for sci fi capital ships so you could have them hover, reverse etc without dealing with armas engine thats built for milsim helicopters and around irl physics
i could ref you to OOS where people said i could not do it ...
What if u used another virtual invisible object being attached to the sub from side (like a jet engine) and givin it its forward thrust? π€
really reminds me of this tweet
eh?
You have problem with a angular thrust, dont you?
real
angle not being interpolated across non local clients
but its is a physical object
yes
with its vdirandup set on each frame
looks fine in sp
and if local to the client viewing
I think that it might have a workaround solution. It is just a hypothesis.
On another note, anyone aware if checking if the object you want to animate is already in that animated state is necessary? Obviously it would be slower to do if!(house animationPhase "Door" isEqualTo 0) then {house animate ["Door",0]}, rather than just ignoring the current state and doing house animate ["Door",0]. But if the animation was still broadcasted globally the check would be worthwhile.
Have you tried this @sullen sigil?
you cant have client side interpolation
theres no vectordirandup setter with local effect
yeah i do delta time stuff
Would it interpolate correctly if you just let a physx box fall?
Oh, it's global effect only?
ye
yes because thats physx system
Exactly, use the physx system and let it do what it needs to do.
i cant, there is no physx angular velocity commands
which brings us back to the start of the conversation lmao
What happens to a box if you crash a car or another box to it? Could not this be your angular thrust?
so much passive aggression
no because then you have a velocity change that you need to account for and setvelocity resets angular momentum
what's wrong with addTorque, doesn't interpolate on network either?
get used to it @candid sun
we are in the internet and i do not plan to treat anybody as SJWs or feminists (+ the "modern people") would like me to treat em
So if you get a normal plane on the server, chuck it in the air without a pilot and give it some angular velocity with addTorque, what does that look like on the client?
dont know and cant test at the moment but thats not having velocity set on each frame at the same time
oh sure, it's not necessarily useful
But it seems odd that angular velocity wouldn't be transmitted or used for interpolation.
yeah but it has no angular velocity as it gets reset when you setvelocity
and you cant give that angular velocity back afterwards
right
i know
(nice graphic)
but you would have an angular velocity that is difficult to calculate and also gets reset by setvelocity
so you would also need to somehow disable physx gravity on that object without setvelocity
I assume setVectorDirAndUp command would reset angular velocity. And there is no way to set it. So it is zero.
So zero angular velocity gets sent over network. And zero velocity gets interpolated on receiver end
oh and if the object was already turning you would need to figure out where to place that object in accordance with it turning so you dont miss
which you cannot do as you cannot get the angular velocity π
setvectordirandup is probably before physx too isn't it?
Β―_(γ)_/Β―
was introduced in .5
OK, what if you did not use set velocity at all on the submarine itself? π
then you would have some very bad sci fi capital ships if theyre all moving on the ground
And why did not you used a normal vehicle (submarine) object in first place?
because you cant setvelocity on those
and setposasl and setvectordirandup on each frame also has no interpolation
You could make your own submarine, but IIRC Arma has a size limit so it can't simulate anything large.
yes thats why im doing this
so you can have a huge ass object with no collisions attached to the box
ive tested an 8km long one in sp and that works "fine"
i think its 8km anyway, may be 4km
You will probably then have to build your own submarine game outside of Arma, or wait for Arma 4. π
arma 4 will be enfusion, instant no
Why?
dislike the language
someone will make an SQF2EnforceScript class to help the transition I guess
i will marry them
dropping that project now
HEY
youre french i would never marry you
actually
french citizenship
maybe
(i have actually read the wiki articles about sqf to enscript and i still dislike it)
class SQF2EnforceScript
{
static void setDir(notnull IEntity entity, float directionAng)
{
entity.SetAngles({ 0, directionAng, 0 });
}
}
```or something
yeah im annoyed enfusion has got angular velocity from day 1
but oh well
im still not moving!
did you like Windows Vista XP day one, no
it takes time to transition to it, dear sir
It will be either SQF or the submarine, the choice is yours. π
wait does enfusion do angles in roll pitch yaw
i barely remember windows xp
why not π
shush, you
yet you use ScummVM font :p
its monocraft actually
(well, any low res old font actually yeah)
and very easy for me to read
wait maybe thats why i dislike c#
my visual studio font isnt monocraft
see?
i actually dislike c# because its a pain in the balls to build dlls for .NET 6.0 but i digress
(i want my voice to text extension to work so i can make spell casting)
ffs
use .NET Framework π
nuget package for it doesnt work on .NET 4.8 and below
which i assume is what youre talking about i havent touched .NET in ages
it's a game dude
so what?
as soon as you want to script you should make yourself clear that you now started to "program"
even if you do not have any clue what you actually do
you waste peoples time by asking for help
dont get me wrong
i really do want to help
but 80% of the stuff which gets asked is just random stuff you need 12 seconds to google
ehh ... @candid sun ...
so much passive aggression
was not me who bothered
just making a little observation
what's up with you always bringing up SJWs @queen cargo?
why you bother @daring zinc?
are you one?
of course not. but i fail to see what arma or scripting has to do with that tumblr bullshit
x39 SQFJW IMO TBH
How can I make an addaction on terrain objects to make it do the following?
Player uses addaction
Terrain object gets hidden/destroyed
"SQF Justice Warriors - Taking the fight to macros since 1999"
stick that in your squad.xml and smoke it m8
It ended up working when I removed the // comments and after 9 hours of the mission running they are still knocked down π
they are placed inside an invisible heli pad
This is just demonstration, overall we want to have multiple groups in one side to be sometimes hostile, sometimes not to each other, so kind of lets say 100 sides, so setCaptive is not an option
Yeah, you can't have comments in an object's init, Arma tries to read it as code which gives an error
Hello, script gurus!
Here's the thing: I'm trying to get a marker position and render it onscreen for a limited amount of time using a resource (rscTitles) I built. I can get it to render it if my character happens to be looking to the direction of the marker at the moment the HUD opens. But it only stays on the screen position it was initially rendered (say it [0.5, 0.5]). I can't get it to "move" throughout the screen as I look around like draw3DIcon would (don't want to simply use draw3DIcon, I have greater plans).
What am I doing wrong?
My code is as follows:
disableSerialization;
params ["_display"];
private _marker = _display displayCtrl 100;
private _myMarker = missionNamespace getVariable ["SERGIO_myMarker", ""];
private _markerSize = 0.05 * safeZoneH;
private _markerPos = getMarkerPos _myMarker;
private "_worldToScreen";while {!isNull _display} do {
_worldToScreen = (findDisplay 12 displayCtrl 51) posWorldToScreen [_markerPos # 0, _markerPos # 1];
_marker ctrlSetPosition [
_worldToScreen # 0,
_worldToScreen # 1,
_markerSize,
_markerSize
];
_marker ctrlCommit 0;
sleep 0.1;
};
Well, _myMarker isn't defined.
Sorry, my code is usually in brazilian portuguese so I made a hasty and sloppy translation and adaptation to post the code here.
Earlier in the script I get _myMarker through a missionNamespace variable I defined in the parent script.
Just fixed it up there ^
Ok so just figured it out!
_worldToScreen = worldToScreen _markerPos; is what I was suppose to use!
wait, this isn't for the map view?
trying to teleport a few hundred AI to an area on the map, I managed to get them to make a perfect circle around the area but I want them to be spread around the whole area not just the perimeter, herea is the Trigger on acivation: _enemies = allUnits select {side _x == independent};
_centerPos = getMarkerPos "AIRESPAWNCENTER";
_radius = 1000;
{
_newPos = [_centerPos, _radius, random 360] call BIS_fnc_relPos;
_x setPosATL _newPos;
} forEach _enemies;
random _radius instead of _radius.
Now if you want them evenly spread out then that's a different problem.
trying that thanks
No. I aim to basically render an image on a world position without using the "draw3dIcon command and Draw3D event handler" combo.
Right, I assumed you were trying to render stuff on top of the map UI because you were using (findDisplay 12 displayCtrl 51) posWorldToScreen
The code is correct for that :P
Yeah I figured wth am I using the map control
Guess my mind just remembers MAP_CONTROL commands nowadays
@granite sky thank you, that was 100% it
You have to grab the terrain object using the nearestTerrainObjects command. Then it's just like adding an action to anything else.
How to determine if object is projectile? Please ping me.
Greetings, I run a custom mission on my server (no mods), for the past few months we've had a problem with players becoming invisible to other players. I can't seem to replicate the issue on a dev server (probably because no desync).
- Player can be seen by those with them at the time they become invisible
- If they travel to a new area with other players, the players in this new area never see the invisible person exit their vehicle
- The invisible person is normally unable to shoot people that can't see them (their bullets do no damage but blood is visible for both the shooter and the target.
Anyone with any ideas? I've tried running some hacky type fixes such as resetting a player's position when they exit a vehicle, but had no success
Not really scripting related. Maybe move to #server_admins or #server_windows
Sounds like an ongoing Ace bug where wounded player's positions stop being updated, leaving their 'wounded' bodies whevever they fell while their client has them moving and shooting after being healed.
Not seen that. I have seen the one where you wake up too fast and most other people see you slithering along the floor.
My group had it going for a while, was really bad because TFAR would register your position for everyone who sees you bugged out as where you got hit, so you'd be shouting at them but some corpse a mile away is the one emitting the voice, meanwhile everyone else who has the proper position updated is wondering why you're having trouble hearing them XD
I thought it got fixed... either that or we got so used to fixing it ourselves by running the affected player over so they ragdoll and force their model to update position and animation.
No mods, no ace.
Happens quite often when there's 80 plus players, and yeah, I guess it isn't a scripting issue
So, ACE medical spits out a JSON string that has arrays I'd like to edit and then shove back into a reserialization function. Are there any good ways to edit the JSON as if it were a normal array?
"{""ace_medical_openwounds"": [], ""ace_medical_bloodpressure"": [80, 120], ""ace_medical_ivbags"": null, ""ace_medical_inpain"": false, ""ace_medical_medications"": [], ""ace_medical_tourniquets"": [0, 0, 0, 0, 0, 0], ""ace_medical_heartrate"": 80, ""ace_medical_pain"": 0, ""ace_medical_bloodvolume"": 6, ""ace_medical_stitchedwounds"": [], ""ace_medical_fractures"": [0, 0, 0, 0, 0, 0], ""ace_medical_triagelevel"": 0, ""ace_medical_bodypartdamage"": [0, 0, 0, 0, 0, 0], ""ace_medical_hemorrhage"": 0, ""ace_medical_occludedmedications"": null, ""ace_medical_triagecard"": [], ""ace_medical_bandagedwounds"": [], ""ace_medical_peripheralresistance"": 100, ""ace_medical_painsuppress"": 0, ""ace_medical_statemachinestate"": ""Default""}"
I really only need to switch ace_medical_bloodvolume to be a different number, and keep all the other things by default
but this isn't a normal array...
guys, any idea why this isn't working?
[] spawn {
sleep 10;
Hint "Minimap scritp running";
waitUntil {!isNull (uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull])};
disableSerialization;
private _display = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull];
private _miniMapControlGroup = _display displayCtrl 13301;
private _miniMap = _miniMapControlGroup controlsGroupCtrl 101;
{
_miniMap ctrlAddEventHandler ["Draw", {
(_this select 0) drawIcon [
getText (configFile >> "CfgVehicles" >> typeOf (vehicle _x) >> "icon"),
[0,0.3,0.6,0.90],
getPosWorld _x,
19,
19,
getDirVisual _x,
format ["%1:%2", profileName ,getText (configFile >> "CfgVehicles" >> typeOf (vehicle _x) >> "displayName")],
1,
0.03,
"PuristaMedium",
"top"
]
}];
} forEach (units group player - [player]);
};```
It is running from initplayerlocal.sqf and the hint shows but then the icons on the GPS mini map don't...
And yes, I do have team mates on my group too π
I feel like my brain is fried, is there no easy way to do "ForEach but only the first 3 indices and don't bother after that"
if (_forEachIndex >= 3) exitWith {};```
You can't use sleep in there either
And now that I look at the code again you didn't need a while at all
{
} forEach (_arr select [0,3])
should be faster than this
the hint doesn't really mean anything
it's before everything else
you should put it after the waitUntil to see if it succeeds at all
no. it's not meant for SQF use anyway
ace_medical_bloodvolume = different_number I think (depends in which namespace it's defined)
isClass (configFile >> "CfgAmmo" >> typeOf _object)
actually it's not just like anything else. most terrain objects are simple and don't support actions
also you can get terrain objects using nearestObject + ID from getObjectID in case you want specific objects
lol now that i see that x39 is probably some redpill mra, kotaku in action man child i kinda wanna be actual serious competition for getting an OOP SQF thing out there :D
As nobody was able to answer, I have created a bug report: https://feedback.bistudio.com/T174954
I think because the AI targeting follows a change in knowsAbout. you reset the knowsAbout but the engine proceeds to tell the AI to engage, which again raises the knowsAbout (I think to 4)
also knowsAbout changing doesn't mean anything. e.g. the knowsAbout could be 4, in which case the EH won't continue to trigger anymore
so they will continue to engage
anyway I think the KnowsAboutChanged should have priority over engaging a target, meaning executed before the actual targeting etc. so it will allow devs to have more control over it
Another question: is there something like createUnitLocal?
For what purpose?
Well in my case we have complex situation: we want to have 1 side and the groups inside might be hostile to each other, we are investigating different ways to achieving that, now we are investigating possibility of virtually attaching "Invisible Target" unit from CBA_A3 mod to all units inside a side and managing hostility by playing with knowsAbout value
forgetTarget doesnt work via KnowsAboutChanged EH as we expect, and we found it somehow works via perFrameHandler, but later we found it's not good solution in multiplayer game as it will DDOS the server as each forgetTarget call will cause sync over network, so having a LOCAL unit could prevent that
they are already local to server, the knowsAbout value will be synced on each call to forgetTarget to clients because https://community.bistudio.com/wiki/forgetTarget has Global Effect
have you evem tested the network strain
and creating a local unit would mean only the server could see it
yes, it DDOSED the server
no, how so?
because its local to the machine and doesnt exist on any others
units exists on all machines
yeah, because theres no createunitlocal command
run createvehiclelocal with a unit on the server, see what happens lmao
I assume that the unit will be created on each machine anyway
what the hell?
its a local vehicle
ok I will try that, thank you for the info. Anyway it's not proper solution to our problem as it causes tons of performance issues, we just need the EH to work as I wrote in the ticket
execute on next frame or two
I tested that, the forgetTarget will become unstable and units will attack each other every few seconds
must be every frame
so sounds like its a case of the units instantly seeing the target again which makes sense
yes, but we also overwrite it instantly
yes, but you cant forget about a person if youre staring at them
if you forgot they exist youd just instantly remember they exist
hence why your solution doesn't work
they forget about them then instantly know about them again because theyre looking at them
that's why the EH should have priority over it
no, because itd just cause a recursive loop
if i am staring at someone and forget about them i instantly remember them
however having it changed to an eh that changes output on return value could work i think
but doubt thatd be done for backwards compat or smth
exactly, like in the HandleDamage
yes i will leave a comment on your "bug" report
thank you
there, done
What would be the best way to wait for all of the players to load into the game after the briefing screen is done on a dedicated server? E.g. I'd like to execute an intro after everyone is fully loaded. I've seen this (https://www.reddit.com/r/armadev/comments/527inm/comment/d7i05km/?utm_source=share&utm_medium=web2x&context=3) comment on r/armadev but perhaps there's a better way.
Maybe something like this: ```sqf
({ (getUserInfo _x # 6) <= 10 } count allUsers) == 0 // True if all users past the briefing
I'll give it a go, thanks π
Seems I'm misreading the syntax
how can I get the player unit from the machineNetworkID?
getUserInfo
if you have the right ID
that takes PlayerID as the argument not the machine Network ID doesn't it?
Is there an easier way to copy script errors out of the game? at the moment i'm jsut typing them in full into a notepad haha
Script errors are recorded in the RPT file, which is in uhhhhhh localappdata Arma 3?
C:\Users\username\AppData\Local\Arma 3
Thank you gentlemen!
%localappdata%\Arma 3 for a shortcut
Has anyone tackled virtual arsenal whitelisting per role/player slot ? google has not been forthcoming
i have created whitelists and defined them as "slots" so that i can use a function to apply the whitelists to the virtual arsenal, however i think i might be misusing the bis_arsenal function:
{
private["_playerRole", "_whitelist"];
_playerRole = _x select 0;
_whitelist = _x select 1;
{
BIS_arsenal addItemToCargoGlobal [_x, 1];
} forEach _whitelist;
} forEach [
["d_legend", d_legend_whitelist],
["d_pilot", d_pilot_whitelist],
["d_med_pilot", d_med_pilot_whitelist],
["d_riflemen", d_riflemen_whitelist],
["d_grenadiers", d_grenadiers_whitelist],
["d_autoriflemen", d_autoriflemen_whitelist],
["d_snipers", d_snipers_whitelist],
["d_missilesp", d_missilesp_whitelist],
["d_medics", d_medics_whitelist],
["d_crewmen", d_crewmen_whitelist],
["d_engineer", d_engineer_whitelist]
// ... add entries for other roles```
you can, basically, fill arsenal for players locally with https://community.bistudio.com/wiki/Arma_3:_Arsenal#Add (all commands have "local" parameter) π€·ββοΈ
Ah perfect thank you!
or you can create multiple global arsenals, place empty object for players to interact with and manually add actions to it with conditions that only show the correct arsenal to the player (yeah, the description sounds like a proper mess)
hey i am hiving trouble getting an add action on one object the change the texture of another
should work. What code are you using?
this addAction ["Mod2_1", S1 setObjectTexture [0, "Slideshow\1.paa", 0]];
this addAction ["Mod2_2", S1 setObjectTexture [0, "Slideshow\1.paa", 2]];
this addAction ["Mod2_3", S1 setObjectTexture [0, "Slideshow\1.paa", 3]];
this addAction ["Mod2_4", S1 setObjectTexture [0, "Slideshow\1.paa", 4]];
this addAction ["Mod2_5", S1 setObjectTexture [0, "Slideshow\1.paa", 5]];
this addAction ["Mod2_6", S1 setObjectTexture [0, "Slideshow\1.paa", 6]];
this addAction ["Mod2_7", S1 setObjectTexture [0, "Slideshow\1.paa", 7]];
i dont know how to do the box thing on here
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
looks like wrong bracket order π€·ββοΈ setObjectTexture [0, "Slideshow\1.paa",0] should be setObjectTexture [0, "Slideshow\1.paa"], 0 and so on
although having numbers for a third argument of addAction doesn't make sense as well. What are you trying to achieve with it?
useing a laptop to change what is showing on an abject
The second argument there is supposed to have code brackets around it too.
tried using the ace slide show but that not working either
When the wiki says a parameter is code, it means a code object.
so this addAction ["Mod2_1", {S1 setObjectTexture [0, "Slideshow\1.paa"]}]; and so on then
ok i will try this
; script by David Berka (David.Berka@nmi.at)
; 2006/08/29 quick fix cosmetic repairs by Mr.Peanut
private ["release1"];
_heli = _this select 0
_car = _this select 1
_chute = _this select 2
#Update
_heliPos = getPos _heli
_heliPosX = _heliPos select 0
_heliPosY = _heliPos select 1
_heliPosZ = _heliPos select 2
_chutePos = getPos _chute
_chutePosX = _chutePos select 0
_chutePosY = _chutePos select 1
_chutePosZ = _chutePos select 2
_chute setPos [_chutePosX, _chutePosY, 300]
_car setPos [_heliPosX, _heliPosY, _heliPosZ - 5]
_car setVelocity velocity _heli
_heading = getDir _heli
_car setDir _heading
~0.01
? (release1 == 1) : goto "Drop"
goto "Update"
#Drop
_chute setDir _heading
~0.01
_carPos = getPos _car
_carPosX = _carPos select 0
_carPosY = _carPos select 1
_carPosZ = _carPos select 2
_chute setPos [_carPosX, _carPosY, _heliPosZ - 18]
#DropUpdate
_chutePos = getPos _chute
_chutePosX = _chutePos select 0
_chutePosY = _chutePos select 1
_chutePosZ = _chutePos select 2
_car setPos [_chutePosX, _chutePosY, _chutePosZ - 3]
_car setVelocity velocity _chute
~0.01
? (_chutePosZ > 3) : goto "DropUpdate"
eyyy, sqs
I have this script and I keep getting Undefined var error 'release1 == 1' Any Ideas why?
In a move to marker I have on activation realease1 = 1
In the helo I have this flyInHeight 75 ; [this, car1, chute1] exec "helidrop.sqs"
do a release1 = 0 somewhere before running that chungus π€·ββοΈ
I will try that. Is there a better script then this around?
@south swan Thank you its working now
have got an odd issue, have a hashmap in an array. trying to do _arr = _arr#1 to get the hashmap returns error of type hashmap, expected array, but typeName of _arr at that point is returning array
(and getting type array expected hashmap afterwards if i do not do _arr#1)
changing to a different variable worked tho, dunno why
I knew it was that easy.
dumb question, how do I add 200000 to a number and keep decimal points? π
You can't.
oh horray
At least not reliably :P
so I'd need to do some string hacking to get it- Since it's already being made to a string xD
toFixed might help if the limiting factor is output
or some other funny hack like https://youtu.be/6OuqnaHHUG8
To fixed? Hmm- idk if that'd work xD But maybe I could grab the number, convert to string, grab everything after the ., get the number BEFORE I converted to string, and do the addition, then concat to the end. Output is a string so
you'd have to do the addition in string format
string format?
yes
you cant convert it to number to do the addition
you have to figure out how to do "3" + "7" = "10"
yaaay to making SQF even slower
personally would just write an extension for it
Heh- it's literally only for a single script x3
then check the video i've linked x3
yaaay for making SQF not a ton slower but a whole lot more convoluted
I got a a map I was given permission to mess with by the creator, but cant do stuff in the WRP.
So to make new roads, I need to place objects, then make sure I copy and paste them somewhere, then add 200000 to the X value, then I can make points for the road polyline.
With the correct ordering.
even if you do the string shenanigans - you'd lose the precision as soon as you try to feed that number back to game, though
Not feeding to the game, feeding to terrain builder. :P
oh
well, it's working so far atleast, so eh π€·ββοΈ
then export as-is and use some real programming tool. Like Excel 
_obj = get3DENSelected "object" select 0;
_br = toString [13,10];
TEMP_getSynced = {
params["_obj"];
private _synced = [];
diag_log get3DENConnections _obj;
{
diag_log ((_x select 0) == "Sync");
if((_x select 0) == "Sync")then{
_synced pushBack (_x select 1);
};
} forEach get3DENConnections _obj;
_synced;
};
TEMP_getSyncedOrdered = {
params["_obj","_doneObjs","_positions"];
{
if(_doneObjs find _x < 0)then{
_doneObjs pushBack _x;
private _objPos = position _x;
_positions = _positions + "20" + str(_objPos # 0) + " " + str(_objPos # 1) + _br;
if(count ([_x] call TEMP_getSynced) > 0)then{
_positions = _positions + ([_x,_doneObjs,""] call TEMP_getSyncedOrdered);
};
};
} forEach ([_obj] call TEMP_getSynced);
_positions;
};
_txt = [_obj,[],""] call TEMP_getSyncedOrdered;
copyToClipboard _txt;
then I paste into notepad, and can do part 2 of the tedious task of making the road polyline xD
oop, alt syntax of toFixed worked xD
Everyone knows Excel is an IDE, that's where I write all of my Python
with official python support in excel now that joke is even funnier
what is scalar NaN? undefined number?
Hi guys myb somebody can awnser me on this question. So i have audio file and i put that audio file in mission folder. When i call audio file in debug console with PlaySound3d it works it plays normaly but when i take the same code and put it inside the trigger it dosent. The debug console and Trigger are in the same enviormente ?
Not a Number. I believe that's when math goes wrong, but not 100%
you may need getMissionPath
how on earth have i managed to make 1-0.5 go wrong
thats impressive
Same code in debug console and trigger but when called from console audio plays but when from trigger audio dosnet play ?
is it a string? ;P
wait what line
if MP, perhaps
answer doesn't change
if you are sure the trigger triggers ofc
when in doubt, spam diag_log :P
who's lara? 
result of a command that would return scalar, but received NaN
example is 1 + nil I think 
the grenades i keep throwing at myself on vr terrain to test this
ah thanks u
systemchats are returning numbers only on the first iteration
so probably something to do with how data is saved
or I guess 1 + e3000 
dunno exactly
hashmaps to string, do those display like array to string?
[xyz,xyz]
yes
[[xyz,zyx],[sdois,dopsiapdoi]] but yes
Trigger did activated but it didnt play sound, on debug console it did play sound
Well what'd I'd do is put a log that tells me "_value" right above the _unitData set [_x,_value]
i have done that
theyre all numbers for the first iteration
then no systemchats again, probably due to error π
what about after _unitData set?
doesnt change
wait, first iteration as in first loop in the for loop, or first time the for loop completes
guh
this is a Moment
except the variable is fine and has scalar nan everywhere which... shouldnt happen
persistant missions are future of arma MP lbh
i love this game
print the hashmap.
chat str(<hashmap>) (example)
oh-
Well, still, wouldn't mind seein that myself x3
what's _deltaT?
shrugs
im just going to systemchat all the variables in a second
Try to put all variables you are using at the start of the iteration.
Whole thing is gonna be garbage-in, garbage-out. Only question is which input is the garbage :P
mashallah
except this says that it should be setting the variable as the one with numbers
so for some reason when it gets numbers it breaks
ok, try making _value in the set be "0.066667" or whatever.
Replace _value I mean
_unitData set [_x,0.01667]
if it still happens, try just 1
yes
I was assuming- uh, yea, set a value to deltaT before the for loop :P
this is all of the values for final iteration
values are getting set properly so somewhere in second iteration its fucking up because theres now values
this works fine too
wtf
same
although....
that shouldnt be happening? 
i dont set the variable to the player again in this bit
yeah, same thing
wonder if it could be an issue with the createhashmap as default value π€
It succeeds after the waituntil... I guess the issue is the sqf ctrlAddEventHandler ["Draw" ?
Updated script: ```sqf
[] spawn {
sleep 10;
waitUntil {!isNull (uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull])};
Hint "Minimap script running";
disableSerialization;
private _display = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull];
private _miniMapControlGroup = _display displayCtrl 13301;
private _miniMap = _miniMapControlGroup controlsGroupCtrl 101;
{
_miniMap ctrlAddEventHandler ["Draw", {
(_this select 0) drawIcon [
getText (configFile >> "CfgVehicles" >> typeOf (vehicle _x) >> "icon"),
[0,0.3,0.6,0.90],
getPosWorld _x,
19,
19,
getDirVisual _x,
format ["%1:%2", name _x ,getText (configFile >> "CfgVehicles" >> typeOf (vehicle _x) >> "displayName")],
1,
0.03,
"PuristaMedium",
"top"
]
}];
} forEach (units group player - [player]);
}; ```
what about bloodData, what's that look like after
looks perfectly fine
values from unitdata subtracted
im not crazy, right? im not setting the variable anywhere?
the variables also update fine for iteration one but never on iteration 2 regardless of predefined or not
yeah what the dick
Hmm- Maybe it's hashmap reference?
idk why tho
here, dumb idea, try backing to eden or whatever, then previewing again.
no need as just running scenario for a second resets to nan
yea, but reset all values.
Perhaps something is running that's messing with it, in the backgroun
thats why lmao
oh yea that might do it :P
so I was right!
i bet it still doesnt work after removing the setvariable though
I don't normally use hashmaps, I normally just use arrays xD
it shouldnt be creating that error either though
unless it is due to the createhashmap default value and a mix of the setvariable or some shit like that
Did you ever put this into an event handler or something that runs in the background?
this is called by a 1 second pfh iirc
I'm thinking something in the past was giving NaN, but then it was fixed, but it's still running and referancing the hashmap.
removing the setvariable also didnt fix
ffs
dont need a setter in the getordefault actually
did you try this
^
idk- maybe try breakpoints
just dump the whole input data with diag_log before each iteration and you'll find what's breaking pretty fast.
this would be so much easier if i didnt need to use cfgfunctions to overwrite ace
Anyone got a second to look over my arsenal whitelisting script per player slots, i get this error:
{
BIS_fnc_addVirtualBackpackCargo [_x, 1];
} forEach _backpacks;
{
BIS_fn>
16:32:38 Error position: <[_x, 1];
} forEach _backpacks;
{
BIS_fn>
16:32:38 Error Missing ;
16:32:38 File C:\Users\ezhpo\Documents\Arma 3 - Other Profiles\Wombat\missions\Legandary_Domination.Altis\whitelist.sqf..., line 184```
But i can't see the syntax problem on that line for the life of me
you need to actually call the functions
20 reasons i hate diag_log
- You don't know how to use it? :P
(i forgot to str the variables)
yes
like everything
why do i subject myself to ace function overwrites this was working perfectly fine until i fucked with it
@deep vessel The BIS functions are functions, not commands. You call them like this:
[_x, 1] call BIS_fnc_addVirtualBackpackCargo;
Ah, thank you very much. Fairly new to all this
well then
yeah, number + string tends to error out in many programming languages π€£
getVariable ["blahblahblah", createHashmap, true]?
eh?
are you creating BloodInfo hashmap anywhere?
yeah gets created on players postinit
could be why? wouldnt explain why it worked in debug fine tho
well "will always be executed" means "empty hashmap will always be created, but not used if not needed" in this case π€
(and i removed the default variable and this still happened)
god why do i always get the most obscure bugs
(this is not an obscure bug)
In your code you're spamming extra createHashmap calls but that doesn't hurt anything except performance.
i shall change that part to [] and createhashmapfromarray if []
done, didnt fix
thats expected tho
uh
You've never said where _bloodData comes from in your original code. It's just a hanging local variable.
its params passed into the function
same as how i define blooddata up here
well no, because that's not being passed into a function.
its done here in a different function but is passed across perfectly fine
i had this whole thing working before but took a break and forgot where i left off
That's kinda impressive. You define _bloodData as three completely different things within four lines of code :P
found where it breaks
i like recycling
so issue is blooddatahash gets cleared for some reason
...
dear fucking lord
Looks like the fluid data lookup is missing some data?
i am going to bash my head against a wall
because i even thought
hey why dont i move this out of the scope seeing as its fixed
and just went meh let me fix this bug first
if you never hear from me again i have moved to poland to start a new life away from all this shame
Enfusion script wouldn't let you do this because the variables are typed :P
i was actually relying on my linter to catch it
nobody can convince me to use enscript
i spent 6 months on a project that would take me maybe a week to make in enscript but i still refuse to touch it
i have never been so happy about having testicular torsion
that is so fucking embarassing
Are you making STD simulation in Arma?
Actually, on second thoughts, pretend I didn't ask
I thought it was just filler and "haha, funny thing for debug"
this reminds me of rubber duck debugging
it's not the same thing, but it reminds me of it.
no just regular diseases
i am doing the hee hee funnee
but you can spread diseases by IVs π
as well as blood cell counts etc
oh, that will be SO annoying :D
so giving someone with acute radiation poisoning some blood is probably a good idea
yes it will i cannot wait to give everybody aids
i just had an Idea, but considering we're in the same unit, I don't wanna share it and then have to worry about it xP
lol
close enough
i keep getting invited
Welp, as for me, lets see if my road export script worked
Exporting roads? Ah, so you're simulating the Roman Empire
Sorta
I'm placing spheres, syncing them so their connections look like how I want the road to look, then run the command. Then it gives me the X and Y of each sphere in a way I can easily paste it to a file editor, then go through and copy past each X, then Y :P
End product usage*
so looks like it works! :D
What is your end goal?
Just want to switch blood volume? why?
If you just want to edit a unit's blood level just do:
_bloodLevel = _unit getVariable ["ace_medical_bloodVolume", 6.0];
// Whatever math you want
_unit setVariable ["ace_medical_bloodVolume", _bloodLevel, true];
is there any easy way to get all numbers out of a string? regex makes my head hurt
found a workaround
so
peqwjo231230909j290jdasj0a9samd0a9 would become 2312309092900909
well you've crossed stuff out so idk what you wanted 
trying to find references for the mass to kilograms conversion factor ... IIRC wasn't it 2.2 or something? could someone direct me to that url(s)? thanks...
mass to kilograms?
ah you meant Arma's mass
found it...
right, for uniform/vest/backpack containers, as well as for vehicle mass i.e. cargo maxLoad getContainerMaxLoad, etc... one blog suggests 1 kg = 22 mass units, something like that... but possibly being different for vehicles from the other...
Arma mass units are whatever
If you check AKM mass you'd get 33 (or even 40) units per kilo
maybe it's just a heavy AKM 
maybe made out of lead π
Magazines and small arms tend to be close to 22 iirc
I mean it could be DU rounds...
I somehow remember mentions (maybe from Dedmen) of size being a factor as well or something
I'm not really fixed to the conversion just making a sensible one... with 22 sort of being the baseline atm...
right that is the mass consideration not just weight but also bulk...
but I am aiming to display a sensible weight (kg or lb)...
Long story short: find something close you want to be consistent to and go somewhere near that 
Vehicles' physx masses were pretty consistent to kilos if i remember correctly
physx masses? you mean in terms of the vehicle itself? or its carrying capacity, i.e. load, maxLoad?
The script not working is probably due to a bug with the V-44 blackfish: https://feedback.bistudio.com/T174962
In terms of its physics mass. Collisions, slingloading, that stuff
oh okay... right, if it helps for context, I am cargo focused right now, literally, inventory manager. that's all...
Go for 22 mu/kg and blame the cruel world for inconsistencies then 
fair enough... I mean bottom line if I am gauging whether a thing can be contained, I want to go with getMass and then decide whether the OBJECT was vehicle or not for maxLoad etc purposes... the kg conversion being a nice to have. thanks...
I wanted to do some complex operations and per-wound editing but I figured out how to do it without touching the json.
Is there a way to get all functions from a category?
Read the config?
Yeah I was just wondering if there was a command to do it too
Was just going to do that if there wasn't
Single config lookup command is a weird thing to have a command for.
I figured there wasn't
Is there an Event Handler for getting when a game master remote controls a unit?
Q: in terms of cargo, estimating whether an item by class may be added to a vehicle cargo, best if I use this to gauge the item requirement?
// assuming I know the item CONFIG from its CLASS (STRING)
getNumber (_item_cfg >> 'ItemInfo' >> 'mass'); // ...
// then evaluating versus container load, maxLoad, etc
Unless you're trying to check for multiple potential items at once, you can use canAdd
hmm okay, sounds good, it may be able to support count as well, if I read that correctly:
https://community.bistudio.com/wiki/canAdd#Syntax_2
interesting however there is also a built-in sanity check for weapon accessories, attachments, mags.
hmm another cargo inventory scenario... uniform vest backpack objects contained in a vehicle... seems like the scripting commands tend to prefer containers be slotted on an actual unit... or is it possible to manage container cargo for them while stowed in a vehicle?
Hello, I have created a script for simulates the effect of a trailer being towed. It works well, but I have the impression that it is not optimized for multiplayer. What do you think?
[] spawn {
_dir_c = getdir camion;
_dir_r = _dir_c;
remorque setdir _dir_c;
sleep 1;
while {true} do {
if (_dir_c != _dir_r) then {
if (_dir_c > _dir_r) then {
if (_dir_r + 0.1 >= _dir_c) then {
// on aligne parfaitement
remorque setdir (getdir camion);
}else {
// on ajoute
_dir_r = _dir_r + 0.1;
remorque setdir _dir_r;
};
}else {
if (_dir_r - 0.1 <= _dir_c) then {
// on aligne parfaitement
remorque setdir (getdir camion);
}else {
// on ajoute
_dir_r = _dir_r - 0.1;
remorque setdir _dir_r;
};
};
};
remorque setpos (camion modelToWorld [0.11792,-2.3,0.1]);
sleep 0.001;
_dir_c = getdir camion;
};
};```
is it a script you have to write for that, don't know, have not dug into the particulars, for native towing (if it is possible) or Advanced Towing (mod)... but some known issues either way, kiting or when the towed object rides up on nearby terrain objects... also some walls, railroads, tend to be fatal to catastrophic events for the towed vehicle, so if you can figure those scenarios out, that's key.
What worries me about my script is that the updating of the trailer's position is too frequent. As for the Advanced Towing mod, it uses a rope and doesn't produce the rotational effect that I want.
!quote 5
stop using 'setPos' for the love of god
Leopard20; Tuesday, 10 August 2021
yeah, I'm not certain of the inner workings... but I imagine there is some combination of historical averaging referenced to the towing vehicle.
You have alternative ?
yes
I'm not sure I have any ready alternatives, the objects have to sync somehow. would need to know how deep the averaging runs reference towed to towing vehicles. and/or how frequent is acceptable in terms of sampling those details.
what are you thinking ? x)
Yes
setPosASL
setPosATL
setPosWorld
If you use setPosASL, use modelToWorldWorld rather than modelToWorld.
Trying to use setPosWorld is probably more trouble than it's worth; its incredibly useful unique thing is using the model centre rather than its origin and converting for that is complex.
For using setPosATL, you'd want to use modelToWorldWorld and then convert it to ATL with ASLtoATL.
In short...use setPosASL and modelToWorldWorld.
Okay thanks for your help
Is it possible to re-declare a private var with the same name in a sub-scope? What would it result in?
fnc =
{
private _var = 21;
{
private _var =15;
} forEach array;
};```
and indent your code
Has anyone been experiencing a bug where players go invis and go into some defualt t pose state in their vehicles?
Which kind of vehicle (which Mod or?)
Just the default arma ones
Any Mods?
Then AnimDataCache issue I assume
Located in Profile or parent(s) of it, detele the folder and try again
Its not something that stays between game sessions though, it stops when the player either switches seats in their vehicle, or logs back to the lobby
You can try what I said anyways
It has never happened to me, I wont be able to see if that fixes it
and I cant delete it for other players
As I said, you can try. And report back if it doesn't help
Will try, does the AnimDataCache just get to big sometimes and break?
No, it harms nothing if you delete. No need of backup too
Does it just store info about the animations? Thats what I assume by the name
alright thanks, Ill see if this helps
yes. private variables belong to the scope they were defined in
so now you have 2 _var variables. one belongs to the outer scope, and one to the inner scope. while you're in the inner scope you won't see the outer scope _var so it remains unchanged
once you exit the inner scope you can continue to use the outer scope _var like nothing happened
private _var = 21;
{
private _var =15;
} forEach array;
// _var is still 21
tho you should also be careful of reference modification (only relevant with hashmaps, arrays and structured text):
private _arr = [];
private _var = _arr; // _var points to _arr
{
private _var = _arr; // _var now points to _arr array
_var pushBack 1; // pushback modifies the array by reference
} forEach array;
// _var and _arr are now both [1] because the data was modified by reference
while the inner var is a completely different variable (due to private), since it uses the same data as the outer var, you end up modifying both
How would you make a sniper reveal a group of targets instead of just one target in a trigger?
been playing with this script but need to find out how to replace p3d with p3d.the script replaces p3d with classname of the p3d.Any help appreciated.
private _repleacearray = [
["t_BroussonetiaP1s_F.p3d", "CUP_b_betula2w_summer", 0],//CUP_les_singlestrom_b
["t_FicusB1s_F.p3d", "CUP_hrusen2", 0],
["t_FicusB2s_F.p3d", "CUP_str_javor", 0],
["t_FraxinusAV2s_F.p3d", "CUP_t_PistaciaL2s_EP1", 0],
["t_OleaE1s_F.p3d", "CUP_les_singlestrom", 0], //CUP_t_picea3f CUP_les_singlestrom
["t_OleaE2s_F.p3d", "CUP_str_fikovnik2", 0],
["t_PhoenixC1s_F.p3d", "CUP_misc_BrokenSpruce_PMC", 0],
["t_PhoenixC3s_F.p3d", "CUP_misc_TorzoTree_PMC", 0],//CUP_DD_borovice02
["t_PinusP3s_F.p3d", "CUP_t_picea3f", 0], //CUP_DD_borovice
["t_PinusS1s_F.p3d", "CUP_t_picea2s", 0],
["t_PinusS2s_b_F.p3d", "Land_HelipadEmpty_F", 0], // *No trees //CUP_t_PinusS3s_EP1
["t_PinusS2s_F.p3d", "Land_HelipadEmpty_F", 0], // *No trees //CUP_t_PinusE2s_EP1
["t_poplar2f_dead_F.p3d", "CUP_Smrk_maly", 0], // CUP_t_picea1s
["t_PopulusN3s_F.p3d", "CUP_str_vrba", 0], //CUP_Smrk_siroky
["t_QuercusIR2s_F.p3d", "CUP_str_liskac", 0]
];
{
```
2nd part ```private _a = ((getModelInfo _x) select 0);
private _c = _repleacearray select {_a == _x select 0};
if !( _c isEqualTo []) then {
private _b = ((getModelInfo _x) select 1);
private _replacetree = ([(_c select 0) select 1] call BIS_fnc_simpleObjectData) select 1;
private _directionOffset = (_c select 0) select 2;
private _position = getPosWorld _x;
private _vectorDirUp = [vectorDir _x, vectorUp _x];
hideObjectGlobal _x;
private _simpletree = createSimpleObject [_replacetree, _position];
_simpletree setVectorDirAndUp _vectorDirUp;
_simpletree setDir (getdir _simpletree) + _directionOffset;
_simpletree enableSimulationGlobal false;
systemchat format["getModelInfo: %1 getPosWorld: %2 replacing tree ",getModelInfo _x, getPosWorld _x, _x];
};
} forEach nearestTerrainObjects
[
[worldSize/2, worldSize/2],
["Tree"], //["Tree","Bush"],
worldSize,
false
];
};
hint "Replacing_trees_script done";```
for long scripts use https://sqfbin.com
also your question is confusing. you're trying to replace p3d with p3d?!
also using setDir after setVectorDirAndUp makes no sense to me
it will reset the up too
also your script is very very slow. just use a hashmap instead of the select
the script is very bad too
you should only replace objects locally for each client (terrain objects are local anyway)
not on the server...
here's a slightly better one:
private _repleacearray = [
["t_BroussonetiaP1s_F.p3d", "CUP_b_betula2w_summer", 0],//CUP_les_singlestrom_b
["t_FicusB1s_F.p3d", "CUP_hrusen2", 0],
["t_FicusB2s_F.p3d", "CUP_str_javor", 0],
["t_FraxinusAV2s_F.p3d", "CUP_t_PistaciaL2s_EP1", 0],
["t_OleaE1s_F.p3d", "CUP_les_singlestrom", 0], //CUP_t_picea3f CUP_les_singlestrom
["t_OleaE2s_F.p3d", "CUP_str_fikovnik2", 0],
["t_PhoenixC1s_F.p3d", "CUP_misc_BrokenSpruce_PMC", 0],
["t_PhoenixC3s_F.p3d", "CUP_misc_TorzoTree_PMC", 0],//CUP_DD_borovice02
["t_PinusP3s_F.p3d", "CUP_t_picea3f", 0], //CUP_DD_borovice
["t_PinusS1s_F.p3d", "CUP_t_picea2s", 0],
["t_PinusS2s_b_F.p3d", "Land_HelipadEmpty_F", 0], // *No trees //CUP_t_PinusS3s_EP1
["t_PinusS2s_F.p3d", "Land_HelipadEmpty_F", 0], // *No trees //CUP_t_PinusE2s_EP1
["t_poplar2f_dead_F.p3d", "CUP_Smrk_maly", 0], // CUP_t_picea1s
["t_PopulusN3s_F.p3d", "CUP_str_vrba", 0], //CUP_Smrk_siroky
["t_QuercusIR2s_F.p3d", "CUP_str_liskac", 0]
];
_replaceHashmap = createHashmapFromArray (_replaceArray apply {[_x#0, getText(configFile >> "CfgVehicles" >> _x#1 >> "model")]});
{
private _mInfo = getModelInfo _x;
private _model = _replaceHashmap getOrDefault [_mInfo#0, ""];
if (_model == "") then {continue;};
private _position = getPosWorld _x;
private _vectorDirUp = [vectorDir _x, vectorUp _x];
private _simpletree = createSimpleObject [_model, _position, true];
_simpletree enableSimulation false; // this line is probably useless
_simpletree setVectorDirAndUp _vectorDirUp;
_x hideObject true;
} forEach nearestTerrainObjects
[
[worldSize/2, worldSize/2],
["Tree"], //["Tree","Bush"],
worldSize / sqrt 2,
false,
true
];
Thanks for the quik reply.I was hoping for it to replace bush1.p3d with bush2.p3d.the script replaces bush1.p3d with the classname of bush2.p3d.Not many objects have classnames/no cfg entry.I found the script on BI forums and started toying with it.I have noticed there is a significant performance loss after the script has run., iam pretty sure.I'll give your script a whirl.Is that your script? So i know who to credit in my mission if it gets released in a mission.
Huge Thanks m8!ππ»
ran it from init.sqf
Well it's your script. I just modified it
undefined variable _replacehashmap and _model
it's just a typo
replace the first array with _replaceArray
the typo was actually from the script you posted. I typed it correctly myself π
the performance loss is inevitable. you're adding thousands of new objects to the game...
but in mp the original one will destroy the performance
looks like it works a treat.heaps faster too
b4 the performance seemed to suffer after the script was run.while playing.
Nice one m8.Thanks!!
It looks to me that there is a roughly 10fps loss after the process.even if i use a game logic to delete the specified trees.I dont think the script veg replacers are a feasible process.
b4 you edited it it took about 90 secs to run .now you edited it it takes maybe 10 secs.
You da man!!
π€π»
if i want to get a hashmap out of _hash apply {}; am i supposed to just output with [_x, _y]; and create the hashmap from the result?
you mean literally the same _x and _y?
having changed _y but yes
use case:
private _arr = [1,2,3];
private _hash = createHashMapFromArray [[1,1],[2,2],[3,3],[4,4],[5,5]];
private _newHash = _hash apply {
if (_x in _arr) then {
continueWith ([_x, _y*20]);
};
[_x, _y]
};
createHashMapFromArray _newHash;```
thats what im doing atm, wondering if its the "correct" way
no it's not
BIKI says it only returns array and no mention about modifying Hash
what would be the correct way
ya returns array for hashmap when i want to modify hashmap values
not creating a hashmap unnecessarily
wait i need to do that anyway if im multiplying
just realised
_hash in my use is a variable on the player that is values per 250ml blood, im multiplying up by blood bag volume/250
so need to create that new hashmap anyway to stop the original being modified
I like that SQF did not give up on some pointer stuff, even though it's an abstract pointer. π
all data in SQF are ref counted pointers under the hood
i really need a new syntax highlighter
Oh my the font
Instaban ready
the worst part is how much easier it makes reading the code for me lmao
But TBH I don't really see why you need to store a person's blood into a Hash instead of their namespace
this is the data for the blood bag
if i kept reading out of persons namespace while i had a 1000ml iv going and they contracted hiv midway through
i would suddenly get hiv
despite the fact they donated hiv-less blood
wut
if i donate blood
then get hiv afterwards
the blood i donated does not become hiv positive
Will you include brothels with infected personnel set up by the enemy in your mod too? π
but if i kept reading out of the players blood data rather than giving blood bags hashmaps of data
then any changes to the players blood data mid iv would mean they would be reflected in the iv bag
no
not sure this is more readable (close uppercase)
i have 4 modules already and only one of them is a kjw one and im still naming variables kjw_medicaltreatment_ instead of medicalexpansion
I mean the font QGVAR - the A and R are too alike for me
Back to the days of illegible handwriting π
(Yikes, that actually reminded me from a programming course exam where we had to "code" on paper...)
Exactly
yeah i will concede R is a bit too similar to the rest of the letters
i turned one of my job interview tests into a mod
the grind never stops
didnt even need to do this, i was being stupid with how i was doing my variables
does anyone know what the following hitpoints are used for?
258 leg_l Leg (Left)
259 leg_r Leg (Right)
You can actually detect these parts, but the hitpoint commands does not return the equivalent to them on units.
https://community.bistudio.com/wiki/getAllHitPointsDamage
getAllHitPointsDamage player;
//[
//["hitface","hitneck","hithead","hitpelvis","hitabdomen","hitdiaphragm","hitchest","hitbody","hitarms","hithands","hitlegs","incapacitated"],
//["face_hub","neck","head","pelvis","spine1","spine2","spine3","body","arms","hands","legs","body"],
//[0,0,0,0,0,0,0,0,0,0,0,0]
//]
are they for the dog
π€· just my guess
HandleDamage detects them on humans. Selection rather than hitpoint.
I think they just stack damage onto the legs hitpoint. Same with the separate arm/hand selections.
yeah, I've noticed that
brings hope to my situation but makes me wonder why the hitPoint commands generalize them
I would guess it's because the sub-selections don't store damage. They just pass it up the chain.
But I've not done any Arma modelling so it is just a guess.
{
if(_x isKindOf "EmptyDetector")then{
....
deleteVehicle _x;
};
}forEach synchronizedObjects _obj;
Will this work or will it break the for loop and make it skip over things
Also, can I delete triggers with deleteVehicle? x3
IIRC deleteVehicle doesn't actually delete the vehicle until the next frame, so it might be fine in unscheduled.
and even if it did, it might not change the array immediately.
Also is there anything I can change to make it better?
Helo comes to me and lands, I get in and it errors with var base not declared
β + please use https://sqfbin.com/ thanks
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
!quote 5
stop using 'setPos' for the love of god
Leopard20; Tuesday, 10 August 2021
they're just using getPos, no?
getPos is only good to know the altitude from the surface below, otherwise something else should be used
What aobut if ya don't need alt?
getpos is slow
getPosASL is the fastest (getPosWorld is the fastest but it has an offset, so beware with non-flat)
any pos without a suffix is slow
oh heh- heads up, if ya wanna make a ctrl event handler, wait until after the senario is ready π
Been pulling my hair out, of course, finally check if it's being made. Nope, trying to make it too early xD
no, you had it, just before the new line after ``` put sqf without a space between them
```[LANGUAGE]
code
```
will make it appear according to the language's syntax
notice how 'deleteVehicle' is orange, for example
is there a fade out function for titleRsc just like cutRsc has cutFadeOut?
trying to find a way of getting rid of resources of infinite duration.
Been trying to use the syntax highlighting, BUT its not working
@analog hull ```sqf <line return>
And you can copy from Bot example and change
//your code here part hint "good"
With your own.
Been doing that , its not working
There worked this time. Someone said stop using "getpos" What do I use in its place????
getPosASL getPosATL getPosWorld
the choice is yours
can you tell what has been manually added? x3
hmm- wish I could make the outline, but eh well
use o&t eden expansion
im 90% sure it lets you add road markers
i know it lets you do map markers for "terrain" objects
does it cover up location names
no
but if you make a marker for buildings via a map marker, it covers location names x3
I am still geting the error undefined variable base. I have a marker called base. Any ideas why the error?
yes
you don't get a marker position with any getPos* command because it is not an object
use getMarkerPos
Marker names and variable names aren't quite the same thing. You can save a marker name into a variable with its own name, but really markers are referenced by strings passed to marker-specific commands.
Here it'd probably be getMarkerPos "base"
does it actually work?
I don't think it modifies the road network, so AI can't use it
ive added bridges over land before and ai have used those
tho it was a small distance
Q: about lockInventory or lockedInventory, for whom? client side the player invoking the command?
https://community.bistudio.com/wiki/lockInventory
https://community.bistudio.com/wiki/lockedInventory
These icons mean Global Argument, Local Effect. This means the argument (the object) can be anywhere and the command will work, but the command will only take effect on the machine where it is executed.
You need a `, not a '
* or rather, three of them
ah okay I see, so not likely (not) going to have the 'intended' effect...
` is basically the same button as ~ on most keyboards
if you press it with shift you get ~. without it you get `
fn_changeTexture = {
params ["_object", "_texture"];
_object setObjectTexture [0, _texture];
};
{
private _unit = _x;
}
{
Laptop2 addAction ["Modual2_1", {
[S1 , "Slideshow\1.paa"] call fn_changeTexture;
}];
Laptop2 addAction ["Modual2_2", {
[S1, "Slideshow\2.paa"] call fn_changeTexture;
}];
Laptop2 addAction ["Modual2_3", {
[S1 , "Slideshow\3.paa"] call fn_changeTexture;
}];
Laptop2 addAction ["Modual2_4", {
[S1, "Slideshow\4.paa"] call fn_changeTexture;
}];
Laptop2 addAction ["Modual2_5", {
[S1 , "Slideshow\5.paa"] call fn_changeTexture;
}];
Laptop2 addAction ["Modual2_6", {
[S1, "Slideshow\6.paa"] call fn_changeTexture;
}];
Laptop2 addAction ["Modual2_7", {
[S1, "Slideshow\7.paa"] call fn_changeTexture;
}];
Laptop2 addAction ["Modual2_8", {
[S1, "Slideshow\8.paa"] call fn_changeTexture;
}];
Laptop1_1 addAction ["Modual1_1", {
[S1, "Modual\1.paa"] call fn_changeTexture;
}];
Laptop1_1 addAction ["Modual1_2", {
[S1, "Modual\2.paa"] call fn_changeTexture;
}];
Laptop1_1 addAction ["Modual1_3", {
[S1, "Modual\3.paa"] call fn_changeTexture;
}];
Laptop1_1 addAction ["Modual1_4", {
[S1, "Modual\4.paa"] call fn_changeTexture;
}];
Laptop1_1 addAction ["Modual1_5", {
[S1, "Modual\5.paa"] call fn_changeTexture;
}];
} forEach playableUnits;```
Got it,
anyway trying to make so all players can see the texture change
There's not much point in having fn_changeTexture if calling the function is the same length as just doing it without a function
The main answer though is to use setObjectTextureGlobal
Q: about adding bits via any of the addXyzCargoGlobal commands... apparently Ga+Ge, 'when' does the local player 'see' the change? synced, yes, but 'when' is the local effect?
On the machine that executed it? Same or next frame, I would expect.
On other machines? However long it takes the message to cross the internet, probably.
thanks... 'irrelevant' for other machines in this case... player will have a inventory manager display open, needs to be refreshed immediately (ish) for the lists to show correctly. thanks...
corollary to all that, weapon inventory, and its accessories, magazines and attachments... can I gauge whether I can add or load such an item using the same base canAdd command? i.e. does not matter whether associated with the weapon at all, it is treated the 'same' from an overall inventory perspective for things like mass considerations?
Hey folks, I am making an op for my players where they have to go destroy some SAMs, and theyre gonna be using a bunch of drones. I dont want the SAMs to just destroy the drones, though, so I wanna limit their engagement to stuff that is above a certain altitude.
What might be better, performance-wise?
A trigger that is server-only, which occupies most of the map, with an activating condition of that specifies altitude>100 (or something), or an executed script with a loop that checks every 10 seconds or so, and if a drone is above 100m, it turns the SAM radars on?
Im leaning to the script, but not sure.
For script, I was thinking of something like:
sleep 10;
_UAVinRange = [];
{
private _altitude = getPosATL _x select 2;
if (_altitude > 100) then {_UAVinRange pushBack _x}
}
forEach allUnitsUAV;
if (count _UAVinRange > 0) then {
{_x setVehicleRadar 1} forEach SAMSonMap} else {{_x setVehicleRadar 2} forEach SAMSonMap;
sleep 10;
private _UAVinRange = [];
{
private _altitude = getPosATL _x select 2;
if (_altitude > 100) then
{
_UAVinRange pushBack _x
};
} forEach allUnitsUAV;
if (count _UAVinRange > 0) then
{
{ _x setVehicleRadar 1 } forEach SAMSonMap
} else {
{ _x setVehicleRadar 2 } forEach SAMSonMap;
}; // β missing "}"
oops, didn't copy/paste everything from VSC.
I'm also not being careful enough to script it so the SAMs target only stuff that has above that altitude, but should be fiiine.
sleep 10;
private _UAVsInRange = allUnitsUAV select { getPosATL _x select 2 > 100 };
if (_UAVsInRange isEqualTo []) then
{
{ _x setVehicleRadar 2 } forEach SAMSonMap;
}
else
{
{ _x setVehicleRadar 1 } forEach SAMSonMap;
};
```simplified
actually, you don't even need to get them all, just check if one UAV is > 100m
private _isOneUAVAbove100m = allUnitsUAV findIf { getPosATL _x select 2 > 100 } > -1;
if (_isOneUAVAbove100m) then // ...
True.
I originally set it up to make an array of which UAVs were above 100m so I could then write a script telling the SAMs to only target the UAVs in that array, but then decided not to bother haha.
fair enough!
does it make sense, or can I simplify the question? adding an accessory, either standalone, or as part of an attached to weapon platform item. canAdd tells me in either case whether it is possible?
how can i make a sound loop? i have the sound already ingame, just dont know how to make it loop. (added by a mod, in the SFX category)
I want it to be looped with a trigger if possible
then loop it with a trigger
Scripters hate this one simple trick
I don't have time right now to write a full explanation, but the most basic way is to use a while to create a loop, and sleep to create a delay the length of the sound. If running from a trigger, you may need spawn to create a scheduled thread where using sleep is allowed.
Is there a way I could fade an image (I've have a paa file ready) in and out during a cutscene? It's a logo for the mission that's just for the intro.
ctrlCreate with RscPictureKeepAspect to make a picture displayer; ctrlSetText to give it the image path; ctrlSetPosition to set position and size; ctrlSetFade to adjust transparency; and ctrlCommit to apply properties like fade over a given duration.
Will test!
is it that hard of a question? I guess will find out, but would like to go in with gainful insights...
Reading the wiki will answer your questions
https://community.bistudio.com/wiki/canAdd
too bad the only type of persistent missions that make sense in Arma are COIN and arcade games.
maps are way too small for anything else
I have this code below and I want the same result for every client. How would I achieve that? I just did it via the server only trigger and sent the sql file to everyone via remotexec, but it's still not synced.
https://sqfbin.com/nagowokenavifujuyale
But why you want send it to everyone to execute? Effects are global
your code doesn't really do what you think it does and its logic is flawed
also why do you create objects then delete them...?
just don't create them in the first place...oof
also:
_objectsInTriggerArea = [];
{
if (_x inArea arenaTrg) then
{
_objectsInTriggerArea pushBack _x;
};
} forEach _allObjects;
can be shortened to:
_objectsInTriggerArea = _allObjects inAreaArray arenaTrg;
this is how it looks, now i want to replace some of these vr-objects with boxes
then if replaced with the boxes it would look like this
now i need to delete some of the boxes to make some free space
like I said, don't create them in the first place
are you making a maze generator
i suggest some cellular automata algorithm instead of randomly placing walls
nope
well then i'll write one
I got it working but the main issue is, it is not synced for everyone, how would I achieve that?
there's nothing local about it as far as I see
Yes but the random deletion and random placement of object are not same for everyone, thats the problem
are you executing it on the server?
I tried with server only trigger
Is there a way to move what part of the map is viewed with UIToTexture?
ctrlMapAnimAdd?
ctrlMapSetPosition?
I couldn't make that work last time. I think my params were meh, I'll try again. Thanks!
I'll come again if that doesn't work!
I tried both of those as well a while ago, no luck either π , tell me if you get it working π€
Sure thing!
if im using the hit part event handler and want to spawn something on the _selection of the _target that was hit
How would i go about doing that?
Like i have the object spawning on the target but i need the "_selection" to attach it to the lad properly < -> i know _selection returns a string but how do i tell it to pick the nearest selection/first selection hit?
no
because _selection returns a string
a list of selections available on the object
Not the selection hit
but i know something returns that value 
like its shown here
HitPart gives an array of arrays, just do it how it's shown on the EH wiki:
this addEventHandler
[
"HitPart",
{
(_this select 0) params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect"];
someObj attachTo [_target, [0, 0, 0], _selection#0];
}
];
Sample says it's an array of selections (strings)
when you say the EH wiki do you mean this one: https://community.bistudio.com/wiki/Arma_3:_Event_Handlers
or is there another resource i be missin
That's the one
hmmm
now its just spawning them on the ground
weird
if i shoot them in the head it sticks in the head, hand in the hand, but anywhere else, ground
the selection that the hitPart EH returns belongs to the HitPoints LOD afaik
if you're using attachTo, it uses the memory LOD
so the damaged selection may not exist in that LOD
Yeah I just looked at attachTo again and saw it takes a mem point, was thinking it took a selection for some reason
it does take a selection
is there a way to sort this? or a "get nearest" ?
are you just trying to show it temporarily?
or you want it to "stick" there (like attachTo)?
i want it to attach to the point hit temporarily then vanish after a bit
for now im focusing on the attach part
Marb_Brute_FNC_Spiker = {
_projectile addEventHandler ["HitPart", {
params [ "_projectile", "_hitEntity", "_projectileOwner", "_pos", "_velocity", "_normal", "_component", "_radius", "_surfaceType"];
systemChat "yeoch!";
private _dumbass = _hitEntity;
private _HitSection = _component;
[_dumbass] remoteExec ["Brute_SpikeFNC", 0, _dumbass];
}];
};
Brute_SpikeFNC =
{
params ["_dumbass", "_lightSource", "_HitSection"];
_dumbass addEventHandler ["HitPart", {
(_this select 0)params ["_target", "_shooter", "_projectile", "_position", "_velocity", "_selection", "_ammo", "_vector", "_radius", "_surfaceType", "_isDirect", "_lightSource"];
private _bruteSpike = createVehicle ["P_Brute_Spike", getPosATL _projectile, [], 0, "CAN_COLLIDE"];
_bruteSpike attachTo [_target, [0, 0, 0], _selection#0];
_bruteSpike setDir getDir _projectile;
deleteVehicle _Projectile;
}];
};
publicVariable "Marb_Brute_FNC_Spiker";
publicVariable "Brute_SpikeFNC";
it's sqf btw
