#arma3_scripting
1 messages Β· Page 58 of 1
Mine just dips slowly down to 9m after it terminates the loop.
Issue is that it's visibly going from some forward velocity to zero.
GVAR etc. is from CBA
yeah if the 25m alt is used it goes down to 9 safely. but if it is set directly at 9 it will crush the ugv.
(CBA is everywhere :D)
for things like that I use desmos graphic calculator. it's good for trying curve equations.
uses pen and paper :P
If you're arguing against the macro namespacing, you're arguing against every namespacing scheme invented. They use this one because it's clearly the best SQF can offer.
^ true
Where did i argue against namespacing?!?!?!
If you set the flyInHeight to 10m until the loop terminates, it lurches up instead.
those macros are SQFs namespaces effectively
Maybe if you continually set it to the current altitude it'd work better, although it might be adjusting to something else.
Trouble is that the AI's still controlling the rotors through the setVelocityTransformation.
Better to have it terminate well above the flyInHeight here though, I'd have thought.
And?!
namespaceing is nice, so ACE uses namespaces
Thats why there are GVARs. Thats all there is.
If you want to rail against ACE, rail at their documentation. :P
Anyone know of a way to force broken legs in ACE?
The salt in this room is delicious :D
If you want to rail against ACE, rail at their documentation. Get me minions
@lone glade I don't see a wiki-entry in features about logistics.. CHOP CHOP ;)
PR is here for cargo, I'm going to do repair soon
@lone glade still no logistics stuff come on
probably all my fault since I took up 2 hours of his time yesterday
2 minutes and it's fine.
:P
^ blame Schwerer
lol :D
Don't know if photoshopped or if it's an actual protest
looks incredibly shopped
No it doesn't. Totally real.
the reflects make it look very real, which brings a question
what is CBA refering to in that case :D ?
Cutting Babies Apart
:'D
cis born asshats ;)
@winter rose I figured out the issue with the sleep - it was caused by "lookAt"
removing the lookAt line from the script solved everything π
wat
your magical catastrophe cascade amazes me
π π π
now try to isolate the problem please
try re-adding the line and removing another, try just this line and a sleep, etc
either there is a lookAt issue where the command never completes, or you really have some other issues (β¦code-wise I mean)
Will setting a keys value to nil remove the element from hashmap?
no. you can't do that anyway. hashmap keys are copys. if you could modify them that would lead to memory leak
deleteAt does?
Nil is not a supported key type but it is a supported value IIRC and my question was whether or not it removes the element
private _hashMap = createHashMap;
_hashMap set ["Example", "Something"];
_hashMap set ["Example", nil];
ah, a key's β value
reading
a keys value
I thought "setting a key"
but, no, it doesn't
POLPOX nailed it, see https://community.bistudio.com/wiki/deleteAt π
I am already building a VR scenario reproducing the issue
so how would i get this guy to stop moving via a trigger? aka die after a amount of time has passed? im using enhanced artwork by polox
I would thankful if you don't try to use in that way, since this Mod is not for such purpose

this mod is for artwork support, aka screenshots
is there any that can be used for my intended use?
Scripts
they dont have that kind of one π¦
If you want to kill a man after a certain amount of time has passed, all you need is sleep and setDamage
If you want to apply animations without Artwork Supporter, you just need commands such as switchMove
is there any reference page for CfgActions?
I remember reading one a long time ago but i dont recall if it was even in the wiki
There's this for a list of available actions: https://community.bistudio.com/wiki/Arma_3:_Actions
If you're after a reference of the config structure itself, there doesn't appear to be one on the wiki, but #arma3_config might know more
Hey, looking to see if people know of a mod such as this one exsiting current or how I would go about doing it https://forums.bohemia.net/forums/topic/159754-menu-extension/
Menu Extension by: albertfish Description This mod introduces a couple new buttons into the in game menu. These buttons can be expanded to reveal several other buttons that can be added in by mission makers and mod makers. These buttons can be used to open GUI displays through the menus. This mod...
yeah, im actually looking for refs of possible attributes, i have a couple of actiosn defined already but just wanted to know if there was anything extra i could use.
Tbh i dont even rememebr where i got the config reference the first time
find it weird that is not listed in wiki though
it's not possible to change textures of something being worned, right? Without making an entirely new thing that is via mod.
You can change the textures of a backpack or uniform while it's being worn, using setObjectTexture. Other equippables can't be dynamically retextured because they're just proxies, not real things.
Helmets?
that is not a backpack or uniform so no
only backpacks or uniforms can be altered with setobjecttexture
oh so not "For example, backpacks and uniforms" it's only those
If I meant "for example" I would've said "for example"
Well, uniform, is that the whole uniform texture or just a certain part or?
Usually the whole uniform, in various selections, but it's possible there are some uniforms that might have untexturable parts depending on how their model is configured.
Note that uniform textures are not automatically persistent - if the unit's uniform is changed the textures will be reset, and the textures don't stick to a dropped uniform. Backpack textures are persistent because the backpack is a separate vehicle.
Double checking my sanity here. Scripted event handlers, according to patch 1.46 release: Added: Scripted event handlers for entering and exiting the incapacitated state -- I can't find anything in later patches to say they were removed, but I also can't find these SEH's on the wiki: https://community.bistudio.com/wiki/Arma_3:_Scripted_Event_Handlers
they may simply not have been documented π
a3\functions_f_mp_mark\Revive\_eventHandlers_add.inc
Ye defined here, seems like not just documented
ty
nil should be a supported key type, 2.12 fixed an issue to it not working properly
i'm under the correct assumption that the refract particle cannot be static otherwise it wont refract/be visible?
If not, how does that particle works?
Static, as in?
Hi, I am using crateUnit to spawn some enemies on the map. What is the best way to check that the new spawn point is outside a certain radius of the last spawn point? If it is inside I do not want to spawn the units.
distance command is to check how far it is
0 velocity
Surely will work
Thank you. This is the code I am currently using:
taskarray = player call BIS_fnc_tasksUnit;
taskcount = count taskarray;
selectedarray = taskarray select 0;
tasklocation = selectedarray call BIS_fnc_taskDestination;
hint format["%1",selectedarray];
opUnitList = [
"O_R_Soldier_AR_F",
"O_R_Soldier_LAT_F",
"rhs_msv_emr_grenadier_rpg",
"rhs_msv_emr_strelok_rpg_assist",
"O_R_recon_M_F",
"rhs_msv_emr_machinegunner",
"O_R_soldier_M_F",
"O_R_Soldier_TL_F",
"rhs_msv_emr_sergeant",
"O_R_recon_GL_F"
];
taskruns = 1;
for "taskruns" from 1 to taskcount do {
//opUnitSpawned = [];
total = (count opUnitList);
rnd = 1;
for "rnd" from 1 to total do {
pick = opUnitList select rnd -1;
sleep 0.2;
grp = createGroup east;
private _spawnpos = [tasklocation, 5, 50, 3, 0, 0, 0] call BIS_fnc_findSafePos;
_myUnit = grp createUnit [pick, _spawnpos,["myMarker1","myMarker2"], 50, "NONE"];
[grp, tasklocation, 60] call bis_fnc_taskPatrol;
};
selectedarray = taskarray select taskruns;
tasklocation = selectedarray call BIS_fnc_taskDestination;
sleep 0.2;
hint format ["%1", selectedarray];
sleep 1;
};
hint "Spawn complete!"
there is an example in the wiki that uses a smoke puff and that does work, but when using the refract texture the particle is not visible
Just thinking how I could incorporate the distance command to ensure that the new spawn point is lets say 500m from the last spawn point? Otherwise do not spawn and proceed.
How you've wrote?
_particleEffectStatic setParticleParams [
["\A3\data_f\ParticleEffects\Universal\Refract",1,0,1],
"",
"Billboard", 1, 60,
[0, 0, 0],
[0, 0, 0],
1, 1.275, 1, 0, [3.5, 3.5],
[[0, 0, 0, .65]],
[1],
1, 0,
"", "",
_object
];
oh, the indentation
n++ doens like when you copy the tabs
You maybe should to try a BIG alpha like 100 so you know it is error on your side or the particle side
xD
im using a lower one for moving particles of refract type and they are visible, but will try a bigger one then
What command would I look for if I want to lets say move an object forward by 1 meter? (forward being where ever its pointing)
setPosWorld + modelToWorldWorld
confirmed its working with alpha @ %100, weird how >75 or lower alphas are basically invisible when static for the refract effect, thanks for the help!
:D Fixed in next version
π
For the curious: https://github.com/acemod/ACE3/pull/2628
Can I check with the command distance also the distance of one coordinate against an array of 5 different coordinates. The objective is to check if the coordinate is more than 500m away from each of the coordinates in the array.
_posArray inAreaArray [_pos, 500, 500] isEqualTo []
If you want the closest one instead then there is no fast method.
Sweet, just the way i was thinking as well.
Trying to understand the code. Would this make sure that the position is 500mm away from each other position in the array?
I have the following code which spawn enemies around a mission objective on the map. This avoids that enemies spawn again around an objective IF the coordinate of the last objective is less than 900m from the new coordinate. But now I realised that I have to compare against each coordinate of a new array which contains the coordinates where enemies have been spawned already. I am not sure how to achieve this. Any idea how to do this?
sleep 90;
taskarray = player call BIS_fnc_tasksUnit;
taskcount = count taskarray;
selectedarray = taskarray select 0;
tasklocation = selectedarray call BIS_fnc_taskDestination;
hint format["%1",selectedarray];
lastspawnpos = getpos player;
opUnitList = [
"O_R_Soldier_AR_F",
"O_R_Soldier_LAT_F",
"rhs_msv_emr_grenadier_rpg",
"rhs_msv_emr_strelok_rpg_assist",
"O_R_recon_M_F",
"rhs_msv_emr_machinegunner",
"O_R_soldier_M_F",
"O_R_Soldier_TL_F",
"rhs_msv_emr_sergeant",
"O_R_recon_GL_F"
];
taskruns = 1;
for "taskruns" from 1 to taskcount do {
//opUnitSpawned = [];
total = (count opUnitList);
rnd = 1;
for "rnd" from 1 to total do {
pick = opUnitList select rnd -1;
sleep 0.2;
grp = createGroup east;
spawnpos = [tasklocation, 5, 50, 3, 0, 0, 0] call BIS_fnc_findSafePos;
distancemeter = spawnpos distance lastspawnpos;
if (distancemeter > 900) then {
_myUnit = grp createUnit [pick, spawnpos,["myMarker1","myMarker2"], 50, "NONE"];
[grp, tasklocation, 60] call bis_fnc_taskPatrol;
};
if (distancemeter <= 900) then {
hint "Skipped - too close!"
};
};
lastspawnpos = spawnpos;
selectedarray = taskarray select taskruns;
tasklocation = selectedarray call BIS_fnc_taskDestination;
sleep 0.2;
hint format ["%1", selectedarray];
sleep 1;
};
hint "Spawn complete!"
Yeah, physically preserving stuff is super useful for containers and objects saved in variables, but for all the generic stuff added via script it's unnecessary
Does anyone know how to make text appear when you look at an object? Similar to when you use an AddAction, but no action, just have text appear
what is the best way to do a chain of if.. else if... else if... else if... else ?
use a switch(true)
(might not be best way, but it is a way)
best way depends on case-by-case
comparing values?
sometimes
this time i'm looking to id the largest of 3 values
generally everytime i type a else {if} in sqf i wonder if there's a better way
Sort the values and pick the largest?
in this case they have names and i'm looking to find the name of the largest one
Character length?
nah
https://community.bistudio.com/wiki/selectMax this would work if it returned index, but it returns element so eh
private _longestSide = 0;
if (_length0 >= _length1 && _length0 >= _length2) then {
_longestSide = 0;
} else {
if (_length1 >= _length0 && _length1 >= _length2) then {
_longestSide = 1;
} else {
_longestSide = 2;
};
};
this is what i ended up doing
i'm just mildly annoyed at that extra indent
You could get rid of else {} if you wish
_array = [_length0, _length1, _length2];
_array find selectMax _array;
find selectMax is kinda revolting but it works here.
it is absolutely disgusting
i love it
single pass version for laughs:
_hm = [_length0, _length1, _length2] createHashMapFromArray [0,1,2];
_hm get (selectMax keys _hm);
(do not do this)
(i know)
daft question
how on earth would you get the vectordir of the direction of travel? running out of ideas here 
vectorNormalized velocity _object
This is not checking against multiple coordinates in an array, is it?
ah thanks
now time to try figure out how to make my eachFrame position comparison to velocity more accurate to stop it stuttering everywhere π
@modern meteor inAreaArray filters the input array down to positions/objects which are within the specified area.
And then there's just a check for whether the output array is empty.
Oh okay. I am trying to find a way to check the distance of one coordinate against an array of coordiantes. Eg. min distance has to be 500 compared to each coordinate in the array.
I guess I can't use your code for it?
what's a coordinate here?
coordinate of a task location which i store in a variable
So a 3d position?
So when you do you want true and when do you want false?
True if it is more than 500m and false if less than 500m vs. each location in the array
The array is basically storing the location of each task location as x,y,z
what if it's within 500m of some elements?
Now i need to find a way to check the min distance of a new loaction against the locations in the array
If it fails to be more than 500m against at lest one other location then it returns FALSE
struggles to parse the double negatives
in other words the new location needs to have a distance of 500m compared to each location in the array.
I give up :P
_return = true;
{
if (_x distance2d _pos < 500) then {_return = false; break;};
} foreach _posarray;
_return;
@modern meteor does this do it?
Thank you very much - checking.
is there a script one can apply to dropped weapons from dead troops making players ect unable to pick them up?
setDamage 1
done on the ground weapon holder it stops players being able to pick it up
what do you mean?
use setdamage 1 on the ground weapon holder and it stops players being able to pick it up
(dropped weapons in Arma are handled by creating a simulated weapon holder object and adding a weapon to it)
KJW_CapitalShips_Ships = if (isNil "KJW_CapitalShips_Ships") then {[]} else {KJW_CapitalShips_Ships};
KJW_CapitalShips_Ships = KJW_CapitalShips_Ships pushBack _shipHelperObject;
publicVariable "KJW_CapitalShips_Ships";``` -- am i being blind to something or is there a reason that this makes `KJW_CapitalShips_Ships = 0`? 
_shipHelperObject is an object created a couple lines above with createVehicle
have ya got a link on where to do this?
variable is never touched other than those lines, except running the function then returning the variable gives 0 back
creating a simulated weapon holder object and adding a weapon to it
Arma does it itself when units die.

private _myobj = createVehicle ["GroundWeaponHolder", [0,0,0]];
_myObj addWeaponWithAttachmentsCargoGlobal [_myarrayofweaponinfo,1];```
_return = true;
{
if (_x distance spawnpos < 1500) then {
_return = false;
hint "Skipped - too close";
break;
};
} foreach spawnedpositions;
_return;
Gives me an error. Expected array, object, location.
spawnpos is the current location where enemies will get spawned.
spawnedpositions is the array with locations where enemies have been spawned already.
Well, is spawnpos (and the elements in spawnedpositions) an Array, Object, or Location? If it's something else (e.g. a marker) then there's your issue.
spawnpos is the x,y,z coordinate of the task location
At what point does it have the error?
yeah, you're misusing pushBack.
pushBack returns the index it inserted at, hence 0
the if clause triggers the error
spawnpos has the value [10695.6,2886.03]
and spawnedpositions?
looks like it has only x,y actually
doesnt't matter
Being only x,y isn't the issue, distance works with position2D as well
[5872.86,8842.73]
the value of spawnedpositions
that's a singular position, not an array of positions
yes, because i am adding spawnedpositions to the array
1 sec, let me past the full code
maybe then it is more clear
spawnedpositions is, apparently, an array containing 2 numbers. So when you do forEach on it, _x is just a number. So your if condition is trying to do _spawnpos distance 10695.6, which isn't a valid syntax
taskarray = player call BIS_fnc_tasksUnit;
taskcount = count taskarray;
selectedarray = taskarray select 0;
tasklocation = selectedarray call BIS_fnc_taskDestination;
hint format["%1",selectedarray];
lastspawnpos = getpos player;
spawnedpositions = [];
opUnitList = [
"O_R_Soldier_AR_F",
"O_R_Soldier_LAT_F",
"rhs_msv_emr_grenadier_rpg",
"rhs_msv_emr_strelok_rpg_assist",
"O_R_recon_M_F",
"rhs_msv_emr_machinegunner",
"O_R_soldier_M_F",
"O_R_Soldier_TL_F",
"rhs_msv_emr_sergeant",
"O_R_recon_GL_F"
];
taskruns = 1;
for "taskruns" from 1 to taskcount do {
//opUnitSpawned = [];
total = (count opUnitList);
rnd = 1;
for "rnd" from 1 to total do {
pick = opUnitList select rnd -1;
sleep 0.2;
grp = createGroup east;
spawnpos = [tasklocation, 5, 50, 3, 0, 0, 0] call BIS_fnc_findSafePos;
_return = true;
{
if (_x distance2d spawnpos < 1500) then {
_return = false;
hint "Skipped - too close";
break;
};
} foreach spawnedpositions;
_return;
if (_return == true) then {
_myUnit = grp createUnit [pick, spawnpos,["myMarker1","myMarker2"], 50, "NONE"];
[grp, tasklocation, 60] call bis_fnc_taskPatrol;
};
};
lastspawnpos = spawnpos;
spawnedpositions = spawnedpositions + lastspawnpos;
selectedarray = taskarray select taskruns;
tasklocation = selectedarray call BIS_fnc_taskDestination;
sleep 0.2;
hint format ["%1", selectedarray];
sleep 1;
};
hint "Spawn complete!"
This is the full code
is this the longest command?
I use the position of the play to give "lastspawnpos" initially some value
quite possibly
spawnedpositions = spawnedpositions + lastspawnpos;```
This is causing you problems. `+` combines the 2 arrays. So you're combining `[]` and `[1234,5678]` (an empty array and an array of 2 numbers). The end result is...an array of 2 numbers, _not_ an array containing a valid position array.
You should use spawnedpositions pushBack lastspawnpos instead
Oh, i see. Let me try this. One sec
nope, this is the longest:
getCalculatePlayerVisibilityByFriendly
and this the longest function:
BIS_fnc_OM_moduleCheckpoint_checkDistanceFromObject
calculatePlayerVisibilityByFriendly π
oh getcalculate
wtf
why on earth is that a thing
and why isnt there one for enemy
ive cheated, i used a pythonscript lol
why the hell you want to know if an enemy saw you 
undercover mods 
You'll know if an enemy saw you because you'll start growing bullet wounds. ez
Now it's working. Thank you very much guys!
nobody tell lou but im testing code by building a pbo every change
if (damage player < 1) then { spotted = True }
Many thanks for your help!
damage player > 0, surely
a few years ago i saw a post from a guy who wanted to know if its day or night, so he used isLightOn on a light pole... i dont know if it works... but i envy the out of the box thinking there
i still need to figure out a way to find the suns position so i can find if the player is facing it to make their visor tint increase
if (islookingatsun player) then {blind player};
oh
i has a lightDirection vector, so maybe... can work
that would make it quite useful for non pilots too
time to add it to the list
thank you! π
a new "getCalculatePlayerVisibilityByEnemy" would be great indeed
BIS_fnc_sunriseSunsetTime has the math
the command tarta says will be better most likely π
will be making pilots visors dim when looking nearer the sun
sounds like something can go undetected in a ACE update, and some pilot crash because of it lol
what are protected .ebo addons?
Addons that are encrypted so the contents can't be extracted
in a different way from binarizing things?
binarizing isnt encryption
its converting it into a format more easily readable for the game
i thought it kind of was
isn't it impossible to open models that have been binarized?
yes and no
Binarised stuff being harder to read is more of a side effect than the purpose of doing it. EBOs are specifically intended to prevent the contents being extracted by unauthorised parties, regardless of whether it's binarised or not. So yes, in a different way, and for a different reason.
i see
binarize -> makes nearer to binary -> computers read binary -> easier for computer
(thats not how it works but its how to best imagine it)
if you want to encrypt your content youll need to use tools to obscure it but thats not irreversible
i'm not planning on doing that, i just got curious when i saw the addonFiles wiki mention .ebos
also
// replace
KJW_CapitalShips_Ships = if (isNil "KJW_CapitalShips_Ships") then {[]} else {KJW_CapitalShips_Ships};
// with
if (isNil "KJW_CapitalShips_Ships") then { KJW_CapitalShips_Ships = [] };
(or use missionNamespace getVariable ...)
already did π
would use missionnamespace but for some reason i didnt
cant remember what it was
pushBack returns a number
already sorted, just need to be tweaking transformation values as currently object is on its side π
Can someone help me understand why
{private _vecdir = vectorDir _x; private _vecup = vectorup _x; [_x, anchor] call BIS_fnc_attachToRelative; _x setVectorDirAndUp [_vecdir, _vecup]} foreach [maproom1,maproom2,maproom3];
does not appear to work in the vector up manner? This correctly attaches the object as far as I can tell and rotates it appropriately as if using Setdir, but any X or Y rotation seems to be ignored. Isn't that what Vectorup is for?
{
private _vecdir = vectorDir _x;
private _vecup = vectorup _x;
[_x, anchor] call BIS_fnc_attachToRelative;
_x setVectorDirAndUp [_vecdir, _vecup]
} foreach [maproom1, maproom2, maproom3];
```_haaah._
shouldn't BIS_fnc_attachToRelative take care of that already?
It does not appear to in testing, it seems to only take into account Z rotation
I'm running this on a MP server as well, which may be altering some behaviours
https://community.bistudio.com/wiki/setVectorDirAndUp β local argument required
so test in Eden first
[_x, [_vecDir, _vecUp]] remoteExec ["setVectorDirAndUp", _x];
```should do
remote exec to the object...?
runs it on the machine it's local on
that's what remoteExec does yes
huh... I did not know you could put an object into that parameter to make it run local to the machine its on
that's incredibly intresting
*angry Lou noises*
also yes sorry my code is not always formatted well I know >.>
@winter rose I figured it out...
it was a combination of multiple nuances that caused premature script termination by a safeguard
Is there anyway I can grab the name of a player who interacted with an item to display in sideChat
You see, I have a safeguard right after the spawn block containing the sleep, that is checking the _ai knowsAbout player and if it's above a certain threshold, it terminates the spawned block to prevent further logic inside from executing, replacing that by another behaviour
Thing is, the lookAt or doWatch commands brings up the knowsAbout level to 4, satisfying conditions of the safeguard which then terminates the block few scheduler cycles later
that is why it stopped dying after I commented out the lookAt line π it just took the safeguard few cycles to catch up, test the condition and then terminate the block.. I kinda figured it out by removing the sleep and realizing, that the code won't go much further either.. Sleep only paused further executing until it was terminated waiting for the sleep to complete - so I basically just found a "magic" number that represents time for the safeguard to kill the script on my computer π π π
yes, there is.
i assumed its just
player chatSide "Test"; would grab their name specifically
I HOPE YOU LEARNT YOUR LESSON TO DEBUG FIRST BEFORE CALLING THE GAME BORKED hehehe
GJ on the debug though π
have you talked to ChatGPT recently?
No?
chatSide is not a command
I mean sideChat lmao
vectorNormalized (_ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]]), //EXPECT THIS TO LOOK SHIT.
for some reason is making it go on its side and perpendicular to the direction of travel? is vectorDir in setVelocityTransformation 
i can pm video but cannot post here or get bonked
addMissionEventHandler ["EachFrame", {
{
private _shipLastPos = _x getVariable ["KJW_CapitalShips_LastPos", [0,0,0]];
private _shipPos = getPosASL _x;
private _shipVel = (_shipLastPos vectorDiff _shipPos) vectorMultiply 1/diag_deltaTime;
_x setVariable ["KJW_CapitalShips_LastPos", _shipPos];
_x setVariable ["KJW_CapitalShips_Velocity",_shipVel];
} forEach KJW_CapitalShips_Ships;
}];``` is what handles the velocity
vectorMultiply 1/diag_deltaTime; β vectorMultiply (1 / diag_deltaTime);
...that would probably be it π
thanks π
serves me right for not copy pasting from my working one
shouldn't matter, / has higher precedence than binary commands?
when in doubt
always - debug - intermediate - variables
tbh, better safe than sorry - and it removes the doubt so win-win
it's so inaccurate its hard to tell what its meant to be giving out
i am moving an immovable object
ya john was correct
didnt fix it
velocity looks correct too -- but let me get in a truck and drive next to it
I think you pasted the wrong bit of code anyway.
...velocity variable doesn't have negative stuff in it 
whole transformation command is
_ship setVelocityTransformation [
_currentShipPos,
getPosASL _logicObject,
[0,0,0],
[0,0,0],
vectorNormalized (_ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]]), //EXPECT THIS TO LOOK SHIT.
vectorNormalized (_ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]]),
vectorUp _ship, //Needs to get changed for banking.
vectorUp _ship,
_interval
];``` π€·
...i could just do vectorfromto _logicObject couldn't I 
if you "move" something that cannot move, velocity won't apply
hence the variable handled by the eachframe π
_ship setVelocityTransformation [ β most likely won't work yeah
it does
it moves the dir is just wrong thats all
(along with how i manipulate how quickly the interval passes but that's a later problem as its too complex maths for right now π )
Your calc for _shipVel is backwards too but you probably shouldn't be using that for anything due to issues at the endpoints.
Yeah it's only getting used for finding the modelspace velocity of the ship prior to the transformation so I know how quickly it's "travelling"
should be _pos vectorDiff _lastPos anyway
Oh right -- shippos and lastpos need to be reversed?
ye
will rectify now as that could be causing the issues I'm having with acceleration -- and I need it for angular velocity
thanks π
Also precalculate the velocity based on the path and don't mess with it each frame.
Unless you actually want non-constant velocity.
I do want non constant velocity
uh oh
acceleration/deceleration
its some cursed shit as im modifying how quickly the interval passes to make it look like its speeding up and slowing down
why not⦠lerp and all these magic things?
Does velocity actually do anything on those objects anyway?
it's not using the velocity for anything other than calculating how quickly it is currently moving (and even then i need to change that)
Like if you just setVelocity, does it move?
nope
try and set velocity to a house π
I can sqfbin the function if you'd like but it's erm
everything you hate about how i code in one file
Can't be bothered to do someone's else's maths project anyway. I have to finish this dive bombing function myself :P
π¨
not because you don't code "well"
because you know and do nothing about it
oh i know what i need to do its just
i cant make it do it π
no its just the methods im using
i dont really see alternatives to them
how else am i supposed to figure out how fast an object that has no velocity is going in the next function π
https://sqfbin.com/oyedayunasufacokuqep
if you are interested in the methods behind my madness (you shouldnt be)
even the parser refused to colour that
sqfbin hasnt been working properly for months for me
it colours it fine but then when i share it
it just doesnt like to have colour
ah yep, it loses the colour on reload
the way the entire function is constructed is so compact that debugging it is a pain π The most absurd thing is, that the safeguard was my first suspect, but somehow I disassociated it from the probable cause.
agrrrrrr
i did manage to make a function that spawns the ship from config in less than 100 lines though :)
well I can throw 15 years of programming experience out the window, I am becoming old ... π
(getPosASL _ship) vectorFromTo (getPosASL _logicObject) now makes it sideways
just a different sideways 
You know vectorDir for this thing isn't necessarily where the ship is pointing, right
yes -- though the ship is attached to the object in the same direction as it
but it also shouldnt be sideways (as in, half of its horizontal length is in the floor)
like, the vectorUp seems to change -- when I've not touched it, and it's perfectly fine with vectorDir _ship (albeit the direction not changing)
vectorup is changing if vectordir _ship isn't anything but that. it's always vectorUp _ship in the svt command 
hi, i'm trying to create a inventory that appear when a key from the keyboard is press (like in classic survival horror), where i can find information, video or something of how to create it?
4 hours later from the initial problem and I'm no closer to a solution
I love arma 
Arma corrects orientation vectors if you supply one that is not orthogonal to the other, that's probably where your issue comes from
its been working fine for a similar instance (identical setvelocitytransformation parameters)
(getPosASL _ship) vectorFromTo (getPosASL _logicObject),
(getPosASL _ship) vectorFromTo (getPosASL _logicObject),
vectorUp _ship, //Needs to get changed for banking.
vectorUp _ship,
There is no guarantee that previous vectorUp will be orthogonal with result of your vectorFromTo
I didn't look into code deep enough to see how your _ship and _logic objects work
theyre just objects
and the vectorup breaks from the moment the transformation starts.
this however works fine
fiinally home
read through everything
lets continue
@solar geode Thx for giving me the chance to show you how dump you are
They rename a PBO
should never ever happen! It is a nightmare for every end-user (or better: for the admins) to detect that and WILL lead to errors, in case the addon stops getting maintained and somebody else continues it, it is a nice way to prevent a renaming ==> people will still find the addon just with a different maintainer
the rest is also simple to argue against as its a nonsense argument but ye ... lets quote it first:
You're right. Who the fuck needs things like namespaces.
Pointless in every single language that implements them.
Namespaces are logical construct
guess how they are archived in SQF/C/AnyOtherLanguageNotSupportingAbstractionOfNamespacesNativly?
Namespace1_Namespace2_NamespaceN
thus nobody said namespaces are useles shit
i said that the macros are useles overhead which make no fucking sense to ever use as they just make things more complicated to debug but ye ... like you would even think about it
you took it personal which is indeed a problem of yours
anyway ... lets continue with
@lone glade
I'm still waiting for you to stop your salt factory
so i stop throwing it into the open wounds? ha ha ... no way
it's easier for everyone to type GVAR(size) instead of mod_pbo_varName
Wait wait wait wait wait wait ... so you want to tell me
instead of having to type the whole damn complicated string which nobody never ever ever could remember you just type GVAR + the ( and the ) so that it does that automatically for you?
ohh you are so damn right
totally forgot that
nope, nope. really an argument
but ... actually its not
it is just putting the focus away from what youre working with right now and that is a macro which will lead to the thing that as soon as you want to check the global variable ingame using some kind of debug UI you will have to do the resolving per hand
and do not say that thats "the price you pay for easier access to the global var" because thats exactly what it is not!
GVAR is not making things more simple
it just makes things shorter, causes you to not be in need of checking in which pbo project you are (which could be a pro and a con in the same time)
and more complicated as soon as you come to the point where you would have to debug your code
in fact, it is like saying "hey, i drive to the store because ??? to buy a bottle of water instead of walking the 20 meters over there onfoot"
compleete nonsense
As a test, set vectorUp _ship to a variable instead of getting it off an object each frame
Already had tried that, setting to [0,-1, 0] has the same problem
Use [0,0,1]
roger one moment
@tough abyss
We all know that X39 is the SQF god.
no im not but thx anyway (yes i take that sarcasm as compliment)
greetings
X39
Meant [0,1,0] here
[0,0,1] makes it go into the floor like its excalibur or some shit
[0,0,0] keeps it flat but doesnt allow turning left and right 
Is that your normal object's orientation?
no, [0,0,0] is
that'll be why its standard then
Standard where?
[0,0,0] as vectorUp makes it appear "standard"
[0,0,-1] the end of it points into the sky
[0,0,0] is not a valid direction :P
Probably defaults out because [0,0,0] is invalid orientation vector
I think you don't understand how these vectors work
Do some debug drawing to see it visualised
i have
and it works fine for the arrow example
Your arrow example has [0,0,0] vectorFromTo (imabox getVariable ["KJW_CapitalShips_Velocity",[0,0,0]]) which I assume is pretty much [0,0,0]
no its the vectordir of its velocity relative to [0,0,0]
i.e the vectordir of its motion
drawLine3D your vector dir and up to see what they end up being
Also observe how they look on normal objects
Also log acos(_vectorDir vectorCos _vectorUp), it must be 90 and nothing else
Before you set them to an object
what i am not understanding is why the arrow example works but this one does not
Do you even set anything to KJW_CapitalShips_Velocity for the arrow?
yes
or else it would not be orienting in its direction of motion
addMissionEventHandler ["EachFrame", {
{
private _shipLastPos = _x getVariable ["KJW_CapitalShips_LastPos", [0,0,0]];
private _shipPos = getPosASL _x;
private _shipVel = (_shipPos vectorDiff _shipLastPos) vectorMultiply (1/diag_deltaTime);
_x setVariable ["KJW_CapitalShips_LastPos", _shipPos];
_x setVariable ["KJW_CapitalShips_Velocity",_shipVel];
} forEach KJW_CapitalShips_Ships;
}];```
that is KJW_CapitalShips_fnc_velocityHandler
This approach has a problem of sim vs render position scopes btw
i know but how else would you get the velocity of an object that has none
You need getPosASLVisual or even getPosWorldVisual
Actually maybe not then, I think sim position updates each frame if you script set the position each frame?
Anyway, draw your vectors with drawLine3d to get an idea what's going on
yes the velocity bit is as accurate as it needs to be (at least at higher fps and as runs on server should be fine)
and rgr one mo
ok so just needs to be a right angle between the two lines always, right?
Yes
right.
and thats always the case with the arrow as its always "up" -- my problem is that even though the vectorUp of _logicObject is perpendicular to its motion-
no it isnt fuuuck as if it goes up then itd need to be tilted up(?)
no it wouldnt motion has nothing to do with vectorDir
its vectorDir is only 2 dimensional -- and its vectorUp should surely be fine to remain the same as the start of the transformation..?
Sure if you can make sure vectorDir is 90 degress to vectorUp
Nice bait :)
my next question is how to do that as in my head i just have [0,0,0] but it all needs to add to 1?
they took it
not my fault
Why do you even do [0,0,0] vectorFromTo to your velocity?
to get the direction of travel to orient the object towards it
But velocity is already in world space
bruggin i could just normalise the velocity couldnt i
I guess you use it to normalize the vector?
vectornormalise probably cheaper
maybe i could have added to the second @ the note that you ALWAYS have to fucking debug your code
There is vectorNormalized
switched it to that now yeah
I thought you needed vectorFromTo for something else
nope just a daft decision made after writing this one function for about a week π
Do you always need your ships to be parallel to XY plane?
i would like them to be able to bank however it's not the utter end of the world if thats not possible in this context
You'll need to do some vector math to calculate proper vectorUp from your vectorDir
Assuming your KJW_CapitalShips_Velocity as vectorDir is correct each frame, I don't like it it all for multiple reasons
it also might be [0,0,0] the very first frame because your object stood still
thats correct
i hate it too but its the only way i can get the velocity of something that doesnt have any as far as i can tell
is there a bis function for that? feels like there would be 
if you do not have to then you are either the best coder in the world wasting your time with modding instead of quickly writing arma yourself again and some algorythm that generates the tanks atomatically for you
or you are simply a moron who is not testing his code
Maybe, but you can do it yourself
I feel like you already told me what I need
ah yes you did
private _vector_aside = vectorNormalized(_your_vector_dir vectorCrossProduct [0,0,1]);
private _vector_up = vectorNormalized(_vector_aside vectorCrossProduct _your_vector_dir);
You can collapse it into a single expression
thanks, was trying to figure out how to reverse the function to get _vectorUp = [...]
what is _dir there? _vectorDir? π
Mistypes, meant your original vector dir you have
Thank you for the help, I'll give that a try now π
Calculating side vector from [0,0,1] won't let your object bank though, only pitch and yaw
bruh, still got sword in the stone look 
this is probably user error
Make sure your vector dir is not null, take current vectorDir off an object if your variable is [0,0,0]
aha
it is now flat -- however going sideways
[{
_this#0 params ["_ship", "_logicObject", "_logicObjectPos", "_intervalConst", "_maxIntervalChange", "_destination", "_timeToTake", "_currentShipPos"];
private _interval = _ship getVariable ["KJW_CapitalShips_Interval",0];
private _dirOfTravel = vectorNormalized (_ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]]);
private _vectoraside = vectorNormalized ((vectorDir _ship) vectorCrossProduct [0,0,1]);
private _vectorUp = vectorNormalized (_vectoraside vectorCrossProduct (vectorDir _ship));
_logicObject setVelocityTransformation [
_logicObjectPos,
_destination,
[0,0,0],
[0,0,0],
vectorDir _logicObject,
vectorDir _logicObject,
vectorUp _logicObject,
vectorUp _logicObject,
_interval
];
_ship setVelocityTransformation [
_currentShipPos,
getPosASL _logicObject,
[0,0,0],
[0,0,0],
_dirOfTravel,
_dirOfTravel,
_vectorUp,
_vectorUp,
_interval
];``` π
believe I'm doing something incorrect there r.e the vectorDir shenanigans
Use your _dirOfTravel in these calculations
This is what I meant with _your_vector_dir
That was giving sword in the stone look -- if it's [0,0,0] should I be using vectorDir _ship in just that instance?
Yeah
where i can find a tutorial/well explained video/page about creating a interactuable gui?, i'm trying to recreate the inventory from survivals horror like resident evil
Ah rgr
_dirOfTravel = if (_dirOfTravel isEqualTo [0,0,0]) then {vectorDir _ship} else {_dirOfTravel}; gives sword in the stone and removing the else gives script error
-- placed right under where it's defined initially
What? Who is testing what code?
Did you change it in _vectoraside and _vectorUp?
private _interval = _ship getVariable ["KJW_CapitalShips_Interval",0];
private _dirOfTravel = vectorNormalized (_ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]]);
_dirOfTravel = if (_dirOfTravel isEqualTo [0,0,0]) then {vectorDir _ship} else {_dirOfTravel};
private _vectoraside = vectorNormalized (_dirOfTravel vectorCrossProduct [0,0,1]);
private _vectorUp = vectorNormalized (_vectoraside vectorCrossProduct _dirOfTravel);``` yep
and yes the svt is using _vectorUp and _dirOfTravel
Is there an easy way to get the targeted position of an artillery shell?
we have like "ETA to hit" but not "targeted position to hit"
only way i can think of now is to get the map position of the target position crosshair at time of weapon fire
ok so using private _vdirandup = [getPosASL _ship, (getPosASL _ship) vectorAdd (_ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]])] call BIS_fnc_findLookAt; is also giving sword in the stone so i think this is just a problem with something else
Check if angle between vectorUp and dirOfTravel is 90 each frame?
Also, just do setVectorDirAndUp after velocity transformation?
still have the same problem with the vectors not being correct then
daft question is how do i do this
vectormagnitude and arccos isn't it
diag_log ["angle", acos(_dirOfTravel vectorCos _vectorUp)];
ah thanks
systemchats are saying always 90 but will try diag_log for more precision
π
Have some other object that you don't do setVecloityTransformation on and set your vectors on it
roger
Or just draw them so they're visualised
I tried that with
addMissionEventHandler ["Draw3D", {
drawLine3d [getPosASL player, ((getPosASL player) vectorAdd (vectorDir (KJW_CapitalShips_Ships#0))) vectorMultiply 2, [0,0,0,1]];
drawLine3d [getPosASL player, ((getPosASL player) vectorAdd (vectorUp (KJW_CapitalShips_Ships#0))) vectorMultiply 2, [0,0,0,1]];
}];``` and nothing showed up which made me think I just did smth wrong
Command takes positions as AGL
π setting vdirandup on the block
private _vdirandup = [getPosASL _ship, (getPosASL _ship) vectorAdd (_ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]])] call BIS_fnc_findLookAt;
barry setVectorDirAndUp _vdirandup;```
barry is the left cube
But then goes 90 degrees the wrong way when being svt β (is moving away from camera, i assume its pointing downwards too but cant really tell, will use different obj to confirm)
barry setVelocityTransformation [
_currentShipPos,
getPosASL _logicObject,
[0,0,0],
[0,0,0],
_vdirandup#0,
_vdirandup#0,
_vdirandup#1,
_vdirandup#1,
_interval
];``` same vdirandup command from above, yes i noted out the first one
Didn't get what you mean
But yeah, use some better objects, spawn a jet or something, gonna instantly tell its orientation.
Using a house -- seems to be the correct side (and isn't pointed downwards) -- but doesn't have left and right turning either 
orientation just never seems to change now
and fwiw _ship setVectorDirAndUp _vdirandup; doesnt have any influence even if i change the bits in the svt to vectordir _ship etc
i am however into hour 7 of trying to debug this so I will head to bed to save myself from insanity -- thanks for the help π
Wish there was something like ARRAY ctrlShow BOOL to quickly hide\show array of controls
I know you can do that if they're grouped by operating the group, but I need to do that within same group
Rewriting my icons over head scripts, trying to squeeze as much ms as possible out of each frame execution
black pill = players dont care about the ms
Looks like not. Having a command to call engine functions for that would be useful
Guess the only way would be to calculate it yourself
Well it won't be much of a difference to play with 15 or 16 FPS 
best case is to save a chrome tab worth of ms
The topic is very complex in general, so get ready for some rough time
@still forum On a scale of 1 to 10 how bad of idea it would be to make ARRAY set ARRAY command return the left operand array instead of Nothing?
This will let stuff like:
private _pos = getPosWorld player;
_pos set [2, 100];
_pos;
```to be written as single expression of
```sqf
getPosWorld player set [2, 100]
counting ms in most cases is the difference between 15.09 and 15.10 fps, if good principles are already being applied
Well, it adds up pretty quickly
im just very skeptical re the dev time cost of working on marginal optimizations
To get 60 FPS you only have 1 / 60 = 0.016 seconds, which is 16 ms
And like 15.5 of it is engine stuff, so you can use like 0.5 ms for your scripts
If its some loading or one time operation that happens during dialog usage, it doesn't matter
yea, put some ugly scripts in, look at the sky and get 90 FPS ... look at some buildings and back down to 50
But per frame should be as quick as possible
yea i agree on spending time optimizing the high frequency stuff
Or a more niche idea of setX, setY and setZ to operate vector components and return it afterwards like vector* commands do
I'd even suggest something like vectorSetComponents [nil,nil,100] but that's too much, array creation, extra values, etc.
not vectoradd?
No, set
_above = (getposworld player) vectoradd [0,0,100]
Not above, exactly 100 meters above sea
ah
XY from getPos, Z from your needed value
I'd even argue for add command similar to set but it adds number to number in the array
There is vectorAdd, but that won't work if you're operating some long numbers array
getPosWorld player setZ 100
what are you working on broadly .. koth code refactor/optimize, or content/features
Both, adding new KotH features, having to refactor and optimize existing code.
i will say managing Z axis is always a pain in arma π
Back in OA, ASL commands returned values above wave level, not general sea level, yet some other commands that took ASL expect it to be sea level
So icons above players that are over water always went up and down with the waves 
ah that sort of thing
So yeah, Zs can be painful in Arma
lol glad i wasnt around for that
This is the expression that sparked me to write that set return suggestion:
private _icon_pos_agl = if(_x distance _camera_agl > 200) then {
getPosVisual _x vectorAdd [0,0,2.5];
} else {
private _pos = getPosVisual _x;
_pos set [2, (_x modelToWorldVisual (_x selectionPosition "head") select 2) + 0.5];
_pos;
};
Wanted second else to look liked single expression of:
getPosVisual _x set [2, (_x modelToWorldVisual (_x selectionPosition "head") select 2) + 0.5]
have u tried the selectionposition render scope syntax?
Or have that distance check only for Z
selectionPosition is always in render scope
selectionPosition [object, selectionName, LODIndex, isVisual, returnMode]
huh
ahh i didnt even see it was default on
Making commands operate on sim scope by default was stupidest engine decision ever
yes i am dealing with that issue with "taskDestination" command at the moment
Sure sometimes you might not want to register some remote unit lag glitch into an area\trigger due to position prediction\interpolation
But in 99% cases you want to operate over actual object visible state
not some internal jumpy position
only time i use simulation pos is for some rope stuff to attach to remote vehicle... when attaching with render scope, sometimes vehicle surface is in a slightly different position... think when you get into a vehicle and the suspension settles.. sometimes that suspension state is not synced
Does setSimpleTaskTarget follow the object properly in render scope?
Maybe you can create a dummy object and setSimpleTaskTarget to it instead of position
And move the dummy object each frame locally
havent tried too much. i attach a task to a person, but when he is loaded into a helicopter, my task icon is still at (getpos # 2) == 0 and skipping in that simulation state way
Create local dummy object and setPos it each frame for perfect position where you want it?
Actually my own task moves with:
client_game_hillTask setSimpleTaskDestination _position_asl;
It moves very slowly though
but super smoothly
feel free to show me where im wrong @nocturne bluff
its that what im waiting for dude
a beautiful function isnt it?
its the result of some argumentation with one of the fancy mods of /r/armadev in some other subreddit where he said that he will ban me from armadev
well
i took it my way then and banned him from my mods
also XLib is garbage code which i usually write when im drunk
The salt emperor in person @nocturne bluff just don't bother
I know haha.
Hi, does anyone know how to pass a parameter to a dialog? I want to access _spawnLocations in the script run by onload in PlanesDialog
params["_object", "_name", "_vehicleTypes", "_spawnLocations"];
{
if(_x == "Planes") then {
_object addaction ["Spawn plane", {
_dialog = createDialog "PlanesDialog";
}];
};
// Other vehicle types
} forEach _vehicleTypes;
https://community.bistudio.com/wiki/createDialog
New syntax returns created display, you can setVariable your stuff to it
_dialog = createDialog ["PlanesDialog", false];
_dialog setVariable ["spawnLocations", _spawnLocations];
Though I'm not sure if onLoad is called right away or on the next frame so your variable is available there
Thanks mate I'll try that
Oh btw I just realised its an addAction there
Your params-ed variables won't be visible there
_object addaction ["Spawn plane", {
_this select 3 params ["_spawnLocations"];
_dialog = createDialog ["PlanesDialog", false];
_dialog setVariable ["spawnLocations", _spawnLocations];
}, [_spawnLocations]];
@barren valve ^
You also need to pass arguments into addAction so they're available when action runs
Thanks for your help should be ok from here
bis_fnc_diagkey is fixed
And what is the point of
format["%1%2%3%4%5%6%7%8%9%10", "B", "IS", "_f", "nc", "_En", "dM", "i", "s", "si", "on"]
?
inAreaArray makes me wish for something like terrainIntersectArray*
to cast terrain checking rays in bulk
And have it accept entities as arguments too
throws a specific steam user out of the mission everytime he tries to play with XLib
Though checking for entities also requires to know which point to check for exactly, checking against origin might not be enough
Here's me dreaming of new commands again
[_camera_pos, [0,0,2]] terrainInersectArray allUnits => return all units that are visible to camera, checking for 2 meters above them
Or similar unary syntax of existing commands:
terrainInersectArray [_camera_pos, allUnits, [0,0,2]]
Made a ticket asking to ignore sea in terrain intersect commands, in case anybody had such a need before: https://feedback.bistudio.com/T171032
Well that might be the point of the entire function
But why split and reformat the string again
"Obfuscation" ?
there is nothing i hate more then to repeat myself
@still forum is right
a way to simply prevent a simple CTRL+F to find it
and the rest is already explained
Well not that anyone would need to search for long... that was the first source file i looked at in XLib...
uiNamespace setVariable["bis_fnc_diagkey", compileFinal ""]; doesn't really do anything if he uses compileFinal too
lol there are some fucking dumb people in this chat.
Its a public bis chat.
Sry, Nou. I'm trying hard.
Im suprised there isnt a bunch of racist jokes in here.
Not to throw an argument from authority fallacy out here, but ACE/CBA has been doing this for almost 10 years now. I think we know what we are doing when it comes to maintaining HUGE projects in SQF.
lol
psh, i said i am A god... Damn monothesists
I only believe in one true god, myself!
And, i should stop derailing these intelligent discussion
ohh ye ... i see that
CBA is complete gibberish where everybody more or less agrees without even arguing against it
most code is damn outdated
and nobody rly updates that code
lets also ignore that components like the XEH are completly unoptimized and cost fucking FPS
ACE2 was just as much a hell to read like CSE was
Make a PR and improve XEH then
ACE3 however, looks way better but you still did not got rid of those stupid retarded macros
and still got functions where you are not using the native arma ways to eg. get parameters
"stupid retarded macros", try handling a project this big without them
Why get rid of something that works perfectly fine?
we'll enjoy.
@lone glade i already argued against you, feel free to proove that my points are wrong
Well, it's not wrong, it's retarded
@tough abyss already said why i will never contribute to CBA unless thats somewhere easy to access
but stuff like that tends to get forgotten
We already prooved it.. But you just say "No thats wrong cuz its just dumb"
you did nothing
okey they did ^^
you brought up shit and tried to denounce me AFTER i argued against you
@tough abyss do i rly have to repeat myself? thats not what i look for
i fucking know its on github
D U RLY NEED 2 SHORTEN UR WORDS
So how is it hard to access then?
@nocturne bluff we are in some randome online chat
rly is a common shortage of really
so ... yes
That makes me realize that whoever is commiting on CBA_A3 need to be introduced to http://chris.beams.io/posts/git-commit/
How can I assign a unit which I just spawned into a group?
Assign as in?
I disallowed myself from commiting to public githubs due to my nature of witty commit messages instead of informative ones
Trying to find the command for it
So CBA is hard to access even though it's on Gihub? I don't get it.
@tough abyss ... so i REALLY have to fucking repeat myself? just read the backlog! its like three fucking days in the past and its not like i usually show up in chat like ton of times but the one fucking time i start some talk here agian
You can use join...but doesn't createUnit require you to specify a group to put the unit in to begin with?
the question is, assign it to what?
ok ... so two blog posts today get published so i do not have to type the same shit down again and again and again
The only problem with that kind of change is eventhandlers that previously returned nil (and thus did nothing) and now return a value (and might change behaviour for eventhandlers that use return values)
I don't know any eventhandler that takes array as result though
I like that idea but it gives me a bad gut feeling right in this moment
Yeah, thought about possible backwards compatibility issues as well, its bound to break something somewhere at some point π€
Probably none of official and semi-competent content though
You could copy paste it. I have no idea what to look for.
ARRAY set2 ARRAY
ARRAY setR ARRAY
ARRAY setRet ARRAY
ARRAY ret ARRAY
I just realized something.
You are Putins Head?
X39 is ARMA's Derek Smart.
Also that
Will be confusing with configs though
ARRAY @ ARRAY π€
Though I like setX, setY and setZ too
Much more limited but skips creating array for right operand, even faster
^
Never mind, managed to get this sorted. Thank you.
It is very rude not to leave the actual answer.
Curious about the execution order on an object for a use case I have. If Iβm a simple script in the init line of an object, have it set to not simulate in the editor, but then have it enable simulation later on (say, due to a trigger), does the script pass then the simulation is disabled? Or will the init line execute when the simulation is reenabled later on?
Additionally, should I sync a vehicle respawn module to an unsimulated vehicle, will that module take effect once the vehicle is later simulated?
dont worry @tough abyss will ref it for you as soon as i rewrote it
Cool, that doesnβt really answer my second question though - will an unsimulated object still be passed to the vehicle respawn module if synced?
in a longer and nicer version
Oh, I don't care about profanities.
lol
X39 do you have stack traces in your projects? Because we do.
you know how we get those? Macros
also apparently you've never seen a C project.
I hate new commands π
macros everywhere
and trust me, I hate macros too, but guess what I know how to do something the right way and the only way that really makes sense in Arma is using macros to control namespaces.
you can't say that, they are your children
out of curiosity how do you do a stack trace in sqf?
the forbidden way to stop people bugging themselves to debug corner
Then I'd say that changing Nothing to return operated array is a net positive
Big feature vs Potential faint probably not likely issue in some workshop mission
Is there any way to test if locality and remoteexec works as it should without having more players join me?
remoteExec is very reliable
You can join your own server by running another game exe
When testing an op yesturday with some friends, I noticed some dialogue was said once, as it should. Others were said repeated times for some reason. They were all remoteExec'd scripts
Host it as LAN with one game instance, join 127.0.0.1 with another
we use macros for all of our function names
^
Make a bat file with this in it:
arma3_x64.exe -nopause -nosplash -world=none -skipIntro -noLauncher -useBE -ShowScriptErrors
```and run it after having main game open
Then join your own host
in debug mode we can insert function wrappers that trace the calling locations
most likely a remoteExec ["command", 0, TRUE] β the TRUE part means "exec again if someone joins"
for a global command that would make the command repeat for everyone on a player connection
I will look at it wait a sec
then in release mode tada the wrappers are gone because of macros
I host using UPnP (as far as I know)
yeah i see
that shouldn't be the issue
there is obviously significant overhead doing that, which is why its used only when you really need to track something down
but its saved my butt a few times
and the script is activated by a trigger doing
remoteExec on execVM with targets being set to 0
(yes I did formulate it as it should be in the actual trigger I just dont have the game up to copy it. But I know its the correct one)
Basically doing
[DataTerminal1, 3] remoteExecCall ["BIS_fnc_dataTerminalAnimate", 0]; to a execVM for my script.
First time, it works fine, second time on another voiceline also using that, i belive it just repeated 3 time (3 players on server if you include me)
now I was wondering if for this situation having targets set to 0 could have anything to do with the seemingly odd change of outcome
or if I should just double check so some trigger isnt set to not be "server only" or something
why remoteExec, animate is global, no? π€¨
why post another code then
Yes for the example given
I did it to be safe
I mean I could undo it probably I just had no idea
I have no idea what you are about
post the code that repeats and let's start from there?
okay, I did a remoteexec on a execVM (script) containing this. Target set to 0
Captive_1 disableAI "move";
Captive_1 switchmove "Acts_AidlPsitMstpSsurWnonDnon03";
Sleep 1;
Captive_1 switchmove "Acts_AidlPsitMstpSsurWnonDnon_loop";
Captive_1 playmove "Acts_AidlPsitMstpSsurWnonDnon_out";
Sleep 5.3;
Captive_1 playmove "Acts_starterPistol_in";
Sleep 1;
Captive_1 say3D "Prisonner_Thanks";
Captive_1 playmove "Acts_starterPistol_loop";
Captive_1 playmove "Acts_starterPistol_loop";
Which would end up with it saying that voiceline 3 times.
Is setting target to 0 the issue, or something else causing this to be said 3 times in repeat
maybe say3d when being handled this way is more acward than sideRadio
my current bet:
you remoteExec something in a repeat trigger
and everytime someone enters it it triggers that
OR
maybe triggers are created on the client and the condition is true immediately therefore triggering the thing
so yeah, make it server only and let the server remoteExec what needs to be remoteExec - e.g only say3D
also use disableAI before joinSilent
ah alright
wait, playMove/switchMove are local too
so rather remoteExec the whole script on the group's owner
is there anything on the wiki for these commands that gives me and idea if its worthwhile doing remoteexec on them?
ah
on the groups owner?
argument local / effect local, the icons at the top of the page
on the group's owner
also apparently you've never seen a C project.
well @grizzled cliff where you have a debuger it does not matters how your variables are built
well if it says both, then it feels confusing
Global Argument, Local Effect
as in "any unit can be chosen, but only you will see the person talking"
I thought it said like "yeah this is global sometimes and local other times"
that makes a lot make more sense
yeah no, we try to be a tad more precise than that usually π
I would hope so but this is already borderline witchcraft
- make a server-side, no-repeat trigger
- link that trigger to the group (if you have only one group that can free that guy)
- set the trigger to "any unit"
- on activation: remoteExec on the group (
remoteExec ["stuff", groupWest]) - in the script file, remoteExec what is required
so only one machine tells others what to do
I will write this down in a note to myself as rules thanks
its probobly worth a mention
that the players arent the talkers.
but that maybe a given
for the tracing, i have very basic tracing as i never was a fan of footers
(I have changed the volume since this was made. Same with the hints, as they are just for me while I make it to verify its functional)
ideally:
server-side trigger
condition: units groupWest inAreaArray this isNotEqualTo []
activation: server exec one script or server tells another machine to exec that script
the script is run on one machine only, so it may use remoteExec
@still forum Actually, having resize return resized array will be useful too
you could always write an sqf debugger...... ;D
My practical example, adding UI coordinates, [0.5,0.5] vectorAdd [0.1,0.1] returns [0.6,0.6,0] and if you feed that into ctrlSetPosition, it changes control dimentions and not just the position.
If resize returned the array, you could do:
_ctrl ctrlSetPosition (_old_pos vectorAdd [0.1,0.1] resize 2); without extra variables or selects
Some other array commands could've used it too.
heh, all the hooks are in the code for a debugger in sqf
sure @pliant stream, just gimme access to the scriptengine
yeah talk about overhead
they could add it to the diag exe though
that'd be nice since we were promised sorta a sqf debugger
!roll 100
alganthe rolled 47!
yep that's a dice roll
!roll 1
Foxy rolled 1!
!roll 1
Foxy rolled 1!
is this thing zero exclusive?
!roll 2147483648
that makes no sense
how do you physically roll something with only one face ?
!roll 2147483646
Dedmen rolled 2106052863!
32 bit ^^
gosh some of the discussions above really hurt the eyes and head
I know right ? all those dices
@tough abyss as you don't seem to read your forum pms :p I was asking if it's cool to use/modify your cleanup script
and nope not talking about the dices
dices?
floor (random 6)
gives a number between 0 and 5
yeah
But thats wrong. My dice always go from 1 to 6
ceil (random 6) :>
lol
yay nerd talk incoming
Well the channel is called scripting
put the numbers into an array, shuffle it and then _array select floor random count _array
random 6 gives anything between 0 and 5.999(...) doesn't it ?
or bis_fnc_randomSelect
In SQF yes
All missions see the same profileNamespace.
[1,2,3,4,5,6] select random floor 5
there is missionProfileNamespace https://community.bistudio.com/wiki/missionProfileNamespace
[1,2,3,4,5,6] call BIS_fnc_selectRandom
do you guys rly try to randomly get some floored value ?
select random is just select floor random count put in a function
yeah people are bored apparently
yeah but that function has a cool meaningful name
hiding ugly code being cool meaningful names is cool
behind*
I like having 4 blue words next to each other in my syntax highlighter, so I write select floor random count
i'm impressed that this chat doesn't support selecting and copying
and that's a scripting channel
it does in the desktop app
yeah people are bored apparently
7:18 PMZbugyeah but that function has a cool meaningful name
7:18 PMZbughiding ugly code being cool meaningful names is cool
7:18 PMZbugbehind*
7:19 PMcommy2I like having 4 blue words next to each other in my syntax highlighter, so I write select floor random count(edited)
7:20 PMrebeli'm impressed that this chat doesn't support selecting and copying
7:21 PMrebeland that's a scripting channel
oh okay
i heard there's an addon for firefox that can make copying happen in the web version
uuuse the desktop aaaaaap
don't listen to the frenchman
How a βmissionβ is identified ?
So can use the values in more than one mission
https://community.bistudio.com/wiki/saveMissionProfileNamespace
The description here has information on that
Sorry for the mention, only getting around to look at this again. Did you find a reference for entering and exiting incapacitated state in that file? I'm not finding anything
http://x39.io/?page=news&id=49# SQF - Why you should NEVER use a macro to generate your variable
feel free to argue
Pr0gramm User? 4Head
well if it runs better i'd like to try the new version :) not that there's any performance issues atm but it can't hurt
X39 your way to make points is much too aggressive and everyone will consider you a troll, just saying
The "problem" you mention X39 is non existent
@queen cargo you don't seem to understand what you're looking at when you linked that github search for define FUNC
@bold comet would not make fun without it
mimimi @daring zinc small issues with that post
it is not getting better with EFUNC
but dont worry
will fix the link for ya
Do you even understand what you're looking at ?
As we are already at the flame point now here, let's argue about this awesome guidelines: http://ace3mod.com/wiki/development/coding-guidelines.html
The pbos, folders and file hierarchy NEVER changes.
The pbos, folders and file hierarchy NEVER changes.
THANKS
SO WHY YOU USE FUCKING MACROS
jesus christ dude. get laid. get high. or just try to finally dislodge that redwood from your digestive tract
The arguments of the pro-macro side
Nonsense ... ALL of em
I vote X39 for republican presidential candidate!
the ENTIRE argument of @lone glade was about maintainablility
and that is ONLY the fucking case when you rename stuff or move it to the endles swhatever
also, good job adding extra line breaks to your example you fucking tryhard
pff @daring zinc, resolved your bollock so it matches fine into half display and did not modified the original code so nobody could say "HE MODIFIET IT BLA" and flame like that shit on me
thats why the reflink is there too
It's like a normal code should look like and not formatted the "ace way": http://ace3mod.com/wiki/development/coding-guidelines.html
@queen cargo i have no idea what that trainwreck of a sentence is supposed to mean
Looking at this code could look like: if(_sideCheck != sideUnknown && {playerSide != _sideCheck}) exitWith {hint localize "Ultra_log_message..................................."};
I don't see ScriptedEventHandlers anywhere
hi, i'm trying to create a inventory like old survival horror games but i don't know how to create the inventory itself (the gui i know how to do it), have anyone idea where i can find info of how to do it?
three ` before and after your code
gui in arma is uh
just dont
what looks better
[QGVAR(colorTextMax), QGVAR(colorTextMin), QGVAR(colorShadowMax), QGVAR(colorShadowMin), QGVAR(textSize), QGVAR(shadowSetting)]
or
["ACE3_interact_menu_colorTextMax","ACE3_interact_menu_colorTextMin","ACE3_interact_menu_colorShadowMax","ACE3_interact_menu_colorShadowMin", "ACE3_interact_menu_textSize", "ACE3_interact_menu_shadowSetting"]
i just got the idea of detecting the item on the real inventory and use a 'if' to detect it, in case it is on the inventory, it shows the image of the item in the gui inventory
nah all those "interact_menu"s are crucial information bruh
i'm trying to remake dino crisis maintaining some old things like the inventory and interactions
especially when you have 72 modules.....
I don't get how macros prevent you from debuging.
"ACE3_interact_menu_colorTextMax",
"ACE3_interact_menu_colorTextMin",
"ACE3_interact_menu_colorShadowMax",
"ACE3_interact_menu_colorShadowMin",
"ACE3_interact_menu_textSize",
"ACE3_interact_menu_shadowSetting"
]```
looks the best
i'm gonna go get myself a pumpkin spiced latte and write a blogpost about all of this.
i also fixed your stupid syntax of yours @daring zinc ((in blogpost))
huh?
@faint oasis @granite sky Latest version of the ai pilot sling script. Transition is not smoothed at the waypoint terminal, but it is a bit too much bother for me atm. Use decelerating cargo hook action. https://drive.google.com/file/d/1f6I6RYH7_qPsLFrxETU9T8C9jwxGZU1X/view?usp=share_link
read further commy2
let's talk about what caused @queen cargo to fall to the dark side
or rather, the salty side
so you want to start to denounce like the rest too now?
feel free to do so
whys everyone in this channel so mad
@daring zinc Any idea how to go about scripting a units legs as broken in ACE?
Well the intendation is slightly off
Bug caused by discord. raw version looks fine
I mean on the blog
copied 1:1 from the ACE3 example @tough abyss
just modified the stuff after the if a lil so it matches in small screens too
I still don't get how it prevents you from debuging. There is no sense in resolving the name any time. Just let the preprocessor do that. The macros can stay while debuging
Okay, carry on guys. I just made popcorn (salty - lol)
The macros even help when debuging , because you can redefine the macro and print potential valuable info in the RPT
How do I summon @tough abyss ?
Yeah, let's overload the preprocessor with unnecessary macro shit :P
... maybe it was an over abundance of sweet food in his childhood, so now his body produces unnatural amounts of salt as a countermeasure...
It's unnecessary load at all
@tough abyss we currently do not have a proper way of doing so for third parties.
You compile everything on init anyway. After that nothing is "overloaded"
You could try using the handleDamage function directly
You compile everything on init anyway
thanks god we do not have better ways of doing that in A3 by today
You really set fire to this place while i played with a full team of ruskies on CSGO
Though of course using hitpoint damage would prevent walking as well, but I assume you would want some specific injuries to go along with it, no? @tough abyss
I'm back with trying to rectify this problem. still using the replied transformation as closest I've managed to get
currently is causing this behaviour (the truck is attached to a CBA target vehicle, however this has no influence as they have the same vectorUp
(It should be horizontal and pointing in its direction of travel)
private _vdirandup = [getPosASL _ship, (getPosASL _ship) vectorAdd (_ship getVariable ["KJW_CapitalShips_Velocity",[0,0,0]])] call BIS_fnc_findLookAt; -- gets vectordirandup of the current position to the position of its motion
(now imagine, doing this in Skype -> Hell)
systemchatted feedback is the vectordirandup calculated, then the vectordir then the vectorup of the logic vehicle (cba target airplane)
I don't get it. How would the preprocessor be overloaded? The more you make with the preprocessor, the less the engine has to do when calling the functions
hinted feedback is the velocity, found with this.
let's just create a new shiny OO language that compiles to SQF and never deal with this circle jerk again :D
@tough abyss That's correct. Looking to leave a player in a relative incapacitated state. I can set them unconscious, but not break their legs
Compiling on init? Wait, have seen this in epoch and exile server side code, it's the elegant way to compile funcs
umm, what's the problem again?
hemtt is vertical, should be horizontal and pointed in its direction of travel
what is the code you move it with?
At least in arma 2
this, but standby for sqfbin of the entire perframe handler
@tough abyss Maybe force fractures?
Where can I retrieve the respawn delay that was set in the mission attributes?
I only found missionConfigFile >> "respawnDelay", but that is only valid if the respawn delay is set in the description.ext, not if it's only set in the attributes.
Google ain't helping π¦
I would assume it's in the missionNamespace maybe?
Fractures are not implemented
We do have the CfgFunctions system..,
what is barry and _ship?
also I'm not sure what BIS_fnc_findLookAT does. wiki page doesn't say anything useful
params [["_start", [0.0, 0.0, 0.0], [[]]], ["_end", [0.0, 0.0, 0.0]
@pliant stream ha ha ... nice reference
_ship is the cba logic object, says at the top.
barry is a minivan ruin object to make sure im not going insane, which im not
(initial position is 90 degrees the other way -- facing player)
Given target location, calculates orientation vectors facing direction
so vectordirandup from one position to another
what is the point of the _logicObject? 
so i can attach more objects (like the hemtt) to without desync due to lower simulation rate
is _ship attached to it?
yes
no
wait
sorry i got confused
_ship is the logic object for the ship, it has the hemtt attached to it
the logic object is placed equidistant from the destination (diagram coming) and moved in the direction of the destination, with _ship moving towards it in order to form a curve
drawing diagram now
what function do you use?
apologies for the flashbang, hope that helps
thanks :) what was i referencing again..? :innocent:
_logicObject moves straight to destination, _ship moves towards _logicObject whilst it does that in order to make it curve towards destination
OOS
here's the same principle (but not code, thats just below -- but is similar anyways) applied to a bunch of arrows
Sorry to interrupt anything, just get back to me when you can. I am looking for a script/addon that replicates the logistics/building of Mike Force. Tried R3F but it seemed very unbalanced/unsupported and bare bones at the time. Thanks for your time
@tough abyss Balls. Alright thanks for the reply, I appreciate it
are you sure you've attached the hemtt correctly?
yes as it's worked fine with regular svt in the past (where ive manually defined everything) though i can sqfbin that function if you want
isn't Mike Force open source?
well it should just be a simple attachTo with no setVectorDir or anything
it's bis_fnc_attachToRelative but yes
setvectordir is done just before that -- but not after
well I guess that's the problem then
hm?
just do a simple attachTo
For what it seems yes, Iβve asked about ripping it for other maps and whatnot and people seemed to shy away like it was pulling teeth. Iβd be willing to attempt it if I knew where to begin
roger I'll give it a try like that but would've thought it's the same thing? any reason why that shouldn't be used?
well no it's not the same thing. it changes the vector dir and up (and attach pos but that's irrelevant)
right now you want the hemtt to have the same dir and up as the CBA obj
so its vdup must be [[0,1,0], [0,0,1]]
Am I able to have anything like that in that case as there's some objects I don't want to have that 
If you need some specific information on how to deal with injuries, send me a PM.
Also -- attached objects don't get touched after they're attached at any point either
Only exception is _obj setFeatureType 2
You mean which function do I use to set the time?
setPlayerRespawnTime
But the issue is that I don't know how I can retrieve the default time set in the mission attributes at runtime to reset it after I changed it to sth else