#arma3_scripting
1 messages Β· Page 10 of 1
ok i added 10 but now im just frozen in midair ;-;
i also dont seem to be able to move my camera any further than just up or down
Yes because setVelocityTransform is constantly resetting your vectorDir
Which locks your horizontal rotation
is there any way to stop it doing that
Could have it use vectorDir player for both vectorDir values
Then it'll just follow how you're already turned instead of resetting it
Show current code
_velocity = (_playerPos vectorFromTo _entityPos) vectorMultiply 10;
_vectorDir = _playerPos vectorFromTo _entityPos;
_sideVector = _vectorDir vectorCrossProduct (vectorUp player);
_vectorUp = _sideVector vectorCrossProduct _vectorDir;
_interval = 0;
_playerPos = _playerPos vectorAdd [0,0,10];
addMissionEventHandler ["EachFrame", { _thisArgs params ["_playerPos", "_entityPos", "_velocity", "_vectorDir", "_vectorUp", "_interval"];
player setVelocityTransformation [_playerPos, _entityPos, _velocity, _velocity, (vectorDir player), (vectorDir player), _vectorUp, _vectorUp, _interval];
_interval = _interval + diag_deltaTime/10;
if (_interval >= 1) then {
removeMissionEventHandler ["EachFrame", _thisEventHandler]};
},
[_playerPos, _entityPos, _velocity, _vectorDir, _vectorUp]];
will sqfbin the whole thing
there
Also your velocity still doesn't match your interval update
You have the velocity at 10m/s with a total interval of 10s yet that'll only be accurate if the start and end positions are 100m apart
Interval calc isn't persistent there anyway. You need to write it back to _thisArgs, like _thisArgs set [5, _interval]
^
wait, you're not even passing it in :P
That above is your main issue
Another one is that your condition should be > 1 not >= 1
As you want it to be able to reach 1
No
or am i being stupid
5 is the index of _interval in the _thisArgs array
That command sets the value of _interval in the _thisArgs array to the current _interval value so it is saved for the next loop
You want to do it after you increase the value
gotchu
Also like john said you need to actually pass interval to the code again
It's not in your arguments array at the end of the command
ah
_interval = _interval + diag_deltaTime/10;
_thisArgs set [5, _interval];
if (_interval > 1) then {
removeMissionEventHandler ["EachFrame", _thisEventHandler]};
}, [_playerPos, _entityPos, _velocity, _vectorDir, _vectorUp, _interval]];
like this right
That should be sufficient
it seems to keep trying to move me after i actually get to the location
actually
i think im clipping into the roof
errrrrrrr
oh i'll just move _entityPos down a bit
Good idea
If you want to actually stop at the end the end velocity needs to be [0,0,0]
ah
But keep in mind that'll have your velocity slowly drop to 0 over the course of the movement
thats fine i want it to get slower as it gets shorter anyways
ok now the rope doesnt seem to be destroying
What is the code for destroying it?
}, [_playerPos, _entityPos, _velocity, _vectorDir, _vectorUp, _interval]];
systemChat "hello i did a thing";
waitUntil {_RopeLength = player distance _entityPos; _RopeLength < 3};
sleep 0.5;
detach _PoleBoi;
ropeDestroy _daRope;
deleteVehicle _PoleBoi;
first line there is the end of the EH bit
Did you offset entitypos only in the EH or everywhere
Seems like an issue with it only being offset in the EH
everywhere
Hm
_entityPos = _entityPos vectorDiff [0,0,1];
addMissionEventHandler ["EachFrame", {```
Wat
thats where its offset
line above the EH
oh hold on
its not actually calculating vectors and stuff for the new values
i need to move this above the calculations i think
that doesnt fix it but it solves it looking a bit odd
Something is causing the player's distance from entityPos to NOT go below 3
i'll turn it up to like 5 and see if that works
That vectorDiff usage seems... wrong
does it need to be -1
I'm guessing that you want to move the entityPos 1m towards the player?
I mean it's vec1 - vec2 so it's not wrong
maybe not far enough though.
it seems to be stopping my movement prematurely
i think
i took out the change for entitypos and didnt go into the roof
..which is where entitypos should be
maybe if i use _poleboi instead of player
nope
it seems to not be destroying when the final velocity is set to [0,0,0]
How about just put the destroy code in the condition in the EH
setting it back to _velocity seems to work fine
especially as im no longer getting suck in the ceiling
I mean hey if it works how you want
the player movement looks a little worse than i'd want but its nbd
so the interval thing should be fine in mp right
Your main concern for mp should be making your velocity match the actual interval you've set
So really your velocity should be the difference between the start and end points divided by the interval you're using
In this case 10 seconds
ah right gotchu
no wait i dont gotchu
its set to multiply by 10 to get 10ms
do i just divide by 10 again?
roger doger
Hi. Trying to use DrawIcon3D. Here's what i got so far:
onEachFrame { drawIcon3D ["BombStrike.paa", [0.9,0,0,1], dir, 1, 1, 0, "Supplies inbound!", 0]; };
-BombStrike is a file in mission folder
-dir is a variable set by screenToWorld
-Intended for MP
Errors:
- BombStrike.paa not found
- How do i remove the drawIcon3D?
Please help.
- is the image in the mission's root?
2.sqf onEachFrame {}
don't you also have an issue that there is no position provided (after the colour)?
oh
dir is a the position π
It's set by screenToWorld
...is it in mission's root
One sec let me check
the naming is bad, just sayin' π
Huh? What naming?
I see... Looks like i accidentally removed the .paa from the folder. i added it back and tested it and it didn't work with the error "Could not load texture"
oh, i see, so, onEachFrame is a command that always runs at the back, but without any arguments
and when we use it it just adds what to execute
and with that you remove what to execute
Worked, thank you;
the .paa still couldn't load for one reason or another. It's converted from a simple picture with background removed with the powers of 2 in place (256) fixed by using a basegame icon.
always run your scripts scheduled my mellows
Except when you shouldn't π
wrong advice :^)
i am now having to reinstall my drivers π
right before i fucking kill my drivers again has anyone got any bright ideas on how to make the rope connecting the player and origin to appear taut
cutting its length down on each frame was NOT the move.
arma is also complaining about a circular reference for something with hashmap and memory leaks when (accidentally) saving the mission file -- i assume thats just due to the oneachframe eh and can be ignored?
oh nvm that only comes up when i accidentally exec twice
waitUntil {((getPos player) select 3) < 0.05 || sleep 5};
is this a valid way of waiting until the player is touching a floor or 5 seconds have passed?
not at all
private _time = time + 5;
waitUntil {sleep 0.1; isTouchingGround player || time >= _time };
your select 3 is wrong (select 2)
and || sleep 5 does not return a boolean
isTouchingGround didnt come up when i searched the wiki 
Β―\_(γ)_/Β―
wiki search is... not good.
yeah it seems to be that way
hm
it doesnt seem to actually do anything
like it never completes
does it happen to be⦠unscheduled?
i think this is outside of the scheduling bit probably π
is there any issue with just
scheduling my entire script
(in which case you should really turn on script errors)
i have them turned on
can i just schedule the entire thing
would save me a lot of pain
I don't know your script so perhaps
you cannot wait in unscheduled
thats the entire script
but
sleep 0.5;
ropeDestroy _daRope;
detach _PoleBoi;
deleteVehicle _PoleBoi;
private _time = time + 5;
waitUntil {sleep 0.1; isTouchingGround player || time >= _time };
player allowDamage true;
systemChat str (isDamageAllowed player);```
if (_magazine isEqualTo "KJW_Grapple") then {
replace with
if (_magazine isNotEqualTo "KJW_Grapple") exitWith {};
and save a scope
i set the sleep at the top for 5 seconds and it worked
don't
how is it comfortable
how do you see all your code
so make an sqf file and edit it with VSCode, run it with execVM
this way you can remove/readd and it gets your updated code without restarting your mission
I second VSCode
don't
I'd recommend defining functions for your handlers instead of making a big nested thing like that
be ultra active for your own comfort
be lazy for your code (write the smartest)
as lou can attest trying to get me to make a function is painful
while I can get the lol part, I also have to say it is painful for people helping you as well
i still dont know what i did wrong initially
"excuse me, how can I prevent my wallpaper from falling, I add glue but it doesn't stick - also, how can I reduce the tapwater's temperature?"
"your house is on fire, just get out of here!"
my main issue is i dont actually know when i would use functions in this instance or why its better than doing this
1/ make an SQF file and/or a function
2/ use a proper editor
3/ set your game windowed
if just an sqf file used with execVM:
4/ temporarily setup your code to remove/readd the event handler on each execution, this way you can refresh easily
why its better than doing this
google Hadouken code style, you will see
i get street fighter
exactly
is it bad i see nothing wrong with that
It's functional (probably) but difficult to read or modify
no, but with experience you will
we provide you a shortcut with our advice π
the thing is i usually create things in like one or two days so i never really forget things
code as if the next person to inherit your code knows where you live and has a really big knife
its simple enough isnt it
i prefer this over having to open like 5 windows for my functions π
"oh, there is an issue in this aspect"
"okay, where does adding the event start, where does it stop⦠oh wait, this part is scheduled, ah but no my indent is wrong so it's still part of the EH"
nay
how does one eat an elephant?
piece by piece π
i was taught intendation was just for appearance 
https://sqf.fini.dev/convert someone mentioned this site the other day
SQF Converter. The best Arma 3 SQF tools out there!
it'll automatically indent sqf
yeah but that doesnt actually teach me anything innit
if you use VSCode with the SQF extension you can format with right click
it doesn't have any impact on code execution
it is for visual comfort and easy reading/debug
you can look side by side and decide which looks better
and then implement that indentation style in the future
Indentation is purely for appearance, but if you have to use too much of it, you risk losing track of what level you're at and consequently where your }; should be, which is bad
i think installing VSCode is probably the move
ADT debug console is little more than atom with a quick click thingy
the thing for VSCode that did it for me was that I can have Ace and CBA functions
oh word??
no, don't use Word as an SQF editor
lmfaooooo
watch me
I just use notepad++ syntax highlighting and having a biki tab constantly open for reference
The true programming experience
i had like 20 biki tabs open this morning trying to figure everything out π
I never understood the devotion to notepad++
It's simple and not bloated
it was excellent at one point; now I feel like it is lagging behind
notepad++ doesn't phone home to microsoft
still excellent for "simple" text edit with plenty of neat features, and xtra fast
im sure windows already phones home, so I'm not too worried about that lol
write them with google slides
all my homies make arma addons in scratch
I do all of my sqf debugging with outlook vbs scripts
catch me writing sqf functions in excel macros
β¦I won't say anything without my lawyer
Arma 4 will only support a PnP abacus for math functions
Good luck getting out of it
thats wild
(wq iirc, right?)
should be
there are a lot of ways to get out of vim
"Vim random text generator: get a N++ user on your PC and get him to try and quit Vim"
i will now be writing my code all on the same line
Shoutout to my early programming days spent writing batch code in notepad
No syntax highlighting and a blinding white background
Just as god intended
yup, I remember doing that in high school
i used to do retextures in ms paint
we always wrote batch files at school because for some reason we could execute them when everything else was locked down
ok back to the original point i can get indentation i just dont understand why id make functions when im only really running most of this once
SOLID concept: Single responsibility
one big chunk of code, it's tough
multiple small ones, well defined, you know where to debug
i can get sticking the EH into a function too but beyond that its mostly just variables and shit
you can still have single responsibility in a full sqf file though? There's nothing stopping you from writing little sqf's with one job. Unless its just best practice to do so
hang on the bit lou sent me seems to be working after doing the indentation 
I underutilize functions in sqf though. I really should use them more, even just so I get comfortable with them
i cant even manage to get a function compiled into an addon π
that's another story
not sure I can π
from my one time compiling an addon, you need a fair bit more than just the function to do that
i literally copy pasted the wiki example and substituted my bits in and it didnt work π
and i feel a lot more people would be complaining it if was the wiki example which was wrong so
yup
still didnt work π€·
i managed to get it working within a mission file though so
god knows
anyways does anyone know how to make a rope not break when its too short
I guess you would have to know what you want it to do instead of break
just reading the page on the wiki for when a rope breaks
const float maxRopeStretchLength = (desiredLength * maxRelLength) + maxExtraLength;
if (currentLength > maxRopeStretchLength) { /* breaks */ };
you might be able to make a check for the rope about to break, then have some kind of handling for it
but I wouldnt exactly know how to do that either. I've never messed with ropes before
drawLine3D
Aha searching maxropestretchlength brings up the page I was looking for
There's 2 pages named ropes on the wiki π
is there a way to shove the rope texture onto that
from the look of it you can only do colours
No, it's a "virtual" line, like the bounding boxes when you select something in the Editor. Ropes are real models.
yeah i figured as such
I think drawLine3D might be useful for detecting if a rope will break. Though..... I dont know if there's a way to get the distance of it
its just a cosmetic thing so wont bother with anything super complex just for making the rope appear taut while it pulls in the player
well
"pulls"
pretty sure you can properly pull a player with a rope if they are in ragdoll
this is the second version of the script im doing ive got it working fine
im just on cosmetic bits now
one second i'll get a screenshot of what i mean
looks pretty crap for something which is meant to be pulling the player
if you want the rope to be taught, you could always just shorten the rope based on the distance between the player and the source
i tried that and it broke my drivers
broke your.... drivers?
to be fair i was running ropeCut on an oneachframe handler
but yea drivers went poof
wtf lmao
my thoughts exactly π
i could try get ropeunwind working to sync with the players speed but the players speed isnt meant to be constant so it looks more natural
nah nah, ropeunwind on a per frame event handler that shortens it to the distance between the player and the target. You can set the speed so it happens almost instantly
is the player going faster than 20 meters per second?
holy fresh hell lmao thats faster than I was thinking
im trying to use cutText ["", "BLACK FADED", 0.001]; to have a black screen while i do some setup in onPlayerRespawn, but if you move a player out of a vehicle it breaks that. i tried putting another cutText call in right after the moveout command but it doesn't work. Any suggestions?
i just want a black screen that's persistent even if you get out of a vehicle
trying out BIS_fnc_blackIn rn
function
https://sqfbin.com/hakitapinosetopixuba
Config
https://sqfbin.com/ritafefibutanolivuve
Cant seem to fix the bino disappear and the gun disappearing. its something with creating weapon holders
relative on ropeUnwind seems to be broken... π€
unless im misunderstanding the wiki
which is quite possible
i think i am though its unclear so i cant be sure
yes i think i am
therefore*
true = "add/remove given length from existing rope"
false = "set rope's length"
examples are I hope clear enough
yeah i get it now its just a fault of the english language being unclear as a whole
can't fix that π
yeah i know i dont have any suggestions on how to make it clearer either π
i think im done now its just messing with offsets
Bro your GPU saw that line of code and went
"Nah bro, you got me all kinds of f***** up if you think I'm doing that"
weird thing is its working fine now so i think i might've accidentally hit exec twice or something
If I ever break a script to the point my drivers decide to retire, then I know my days with SQF are over
i think it was probably as a result of it trying to do two things at once to the rope when it was trying to destroy it or smth
correct indentation seems to have fixed its scheduling for some reason so idk
just fooling with offsets and mp testing now
and detecting when it hits a unit
feels much nicer than the last version but thats probably because it uses maths which i dont understand properly π
Tl;dr the way it works is this
you give it a starting and ending value for position and rotation vectors
It computes the difference between the ending value and beginning value
Then adds a fraction of that difference to the starting value (based on the interval) to make the starting value smoothly transition to the ending value
Which all in all is referred to as linear interpolation aka lerp for short
Is there a way to make Lambs a script for a mission instead of making it mod to download? Reason I ask is because I have VCOM AI as a script so it runs with my mission. ANY ideas?
I mean yeah
oh i thought interpolation was a fancy extra bit
i understand this a bit more now
@ember wing Most of it should work fine without needing to change much so long as you copy all of the files over, main thing would be needing to fix any paths that refer to the mod's pathing
Which would mainly be in CfgFunctions if I had to guess
@sullen sigil glad it makes more sense
idk where youre from so this may not make any sense to you but i did alevel maths and thats the absolute extent of my maths knowledge
Sounds like a europe thing and I am not a Europe person
if youre american then its similar to AP but a bit more complicated content
idk what it is in other continents
Thatβs very good to go thank you
either way i only lightly touched on vectors in three dimensions
Vectors go from hilariously simple to mind meltingly complicated fairly quickly depending on what level of math you're working with
For the most part arma doesn't require any of the insanely difficult stuff though
The peak of arma's math difficulty is probably matrices
Which aren't even really that complicated for the few uses you'll ever have for them
I survived so far without knowing what a matrix is
I am a happy ignorant
OFP:R made me understand sin & cos π not school
They let you do some vector operations quicker but you never really need them in arma from what I've seen
Only thing I've ever used them for is adding quaternions
Because doing those without matrices is horrible
I want to set the skill of AI based on how many people are on the server
which one is better to use in this case?
PlayerConnected or OnUserConnected event handler?
also is the best way to count the players on the server in this case it to use count allplayers ?
nope, as allPlayers also counts headless clients
see BIS_fnc_listPlayers (iirc)
(and yes, I know, allPlayers also listing headless clients)
Returns a list of currently played units
hmm
is there a way to return the number when the player haven't chosen a character from the lobby yet?
count allUsers?
I did forget about these - thanks!
Is there some way to increase the capacity of a box in the editor?
something simple like "setObjectCapacity" in the init field would be my first guess but I don't know the actual syntax
beware - playersNumber counts AI-filled slots
problem is, if they don't choose a slot yet they are not counted, isn't allUsers better here?
playableSlotsNumber west - playersNumber west will give you the unoccupied slots
yeah that's true but my question is isn't it more direct to use allUsers to achieve finding how many players are on the server, with occupied or with no occupied slots?
if you want to slow down your code, you can go for it π
yeah i only ever really did stuff like 8i+5j+3k in maths
the most complicated it got was having to write them stacked on one another
i think i could attach the rope to the muzzle this time around though with the matrices function π€
what the heck is that π
first time I see this!
discovering the forbidden error messages
maybe "zomg too much code in isNil", unsure
there is literally nothing on google for error gif pre stack size violation
its not even written on a stackexchange or anything
wtf have you done
β¦scripting (sorry!)
not haram
memory allocation flag?
haram = bad
halal = good
I don't know if you did a double negative here ^^
scripting is good π
Use [] call cba_fnc_players
Requires cba_a3
Hey I'm trying to make the base game taru bench able to be sat on like the transport variant, is there a certain code or something to be used?
almost (because I am a feature creep) finished my choice dialog
Now what about an illusion of choice dialog
ez, provide the same code in the exec arguments π
I'm quite happy with this one - the image ratio is automatically done, can be forced, the text is optional, yeah, so far it's pretty cool!
Pretty neat nice job
Damnit... I'm testing my local mod-mounted project, and every time I load in Mike Force with it running, the mission immediately 'Mission Failed' T_T
Okay, so it is my mod.
does anyone know of a way to get the dynamic loadout presets for an aircraft?
Do you mean what you can set in Eden Editor?
Located in configFile >> "CfgVehicles" >> typeOf plane >> "Components" >> "TransportPylonsComponent" >> "Presets"
is there a good way to move 3den camera below the terrain?
Tried this but it didn't work:
_pos = getpos get3DENCamera;
_pos set [2,-10];
move3DENCamera [_pos, false];
it lifts me back to the ground
You can't, Engine limitation
So what do you think is the best way to have an area where I have character being recorded by a PIP camera
with a bunch of objects around the character, and have the "studio" not be discovered by players
because there is a CAS player in the mission
Just put it out of bounds at the other end of the map. CAS won't pay too much attention to the ground outside the AO and especially outside the map.
using Takistan, when you place it out of bounds the objects disappear for some reason
you can collide with them
but they are hidden
around -2000m they start doing weird stuff (phasing in and out of existence or straight up disappearing but the collision remains)
is this an engine limitation?
probably has to do with maximum bounds the map maker set or something?
to explain what I mean
it is as if the building is only visible when the camera doesn't cross a certain barrier
regardless the in game preview (as a player) will have the building hidden with collision on (isHidden returns false)
i guess it's not supposed to work out of the map area. In some maps also the terrain textures go bad
Alright, I've got all my functions lined up, packed into a PBO, and all of them tied into an executing function... now how do I have that function execute on a server?
It's currently preInit = 1'd, but I've had to manually call the function to get things kicked off. The article for addon making also mentions event handlers; am I correct in thinking it would be something like:
addMissionEventHandler ["PreloadFinished", {
call srd_fnc_MFAIOexecute;
}];
are you making an addon? or mission
Addon
ok
If I'm reading right, postInit = 1 should just call the function, once the mission begins, but I find I have to manually call it to have it activate ._.
can you show the source code of the file/function?
hmm are you sure it doesn't run? because systemChat may not work at beginning of the mission. to debug things like this is better to use diag_log
Yeah, the functions it calls on have their own systemChats, which run when I boot up arma. And it doesn't spawn in the truck or helipads that it's supposed to.
But those functions are compiled, and if I call this function, it all kicks off fine.
ok, then I'm not sure whats wrong
make sure your variables are defined such as MarkerUpdateCheck
Yeah, missed that one, but it hasn't caused a problem so far - just a backdoor 'oh shit this isn't working, gotta shut it down'. When called, it all runs properly.
ok
... didn't I, though? Right before it, missionNameSpace setVariable?
oh yeah looks like you did
not 100% sure though since this is addon and missionNameSpace is for running mission
Yeah, didnt work out.
Is there a command not to forceWalk player when unit load exceeds max?
try enableFatigue or enableStamina
Yeah, that will work, but I want stamina to be enabled.
maybe player setUnitTrait ["loadCoef", 0];
there is the https://community.bistudio.com/wiki/forceWalk command but i doupt it works to that direction....
@cyan dust
Yeah, that works too, but if your loadAbs exceeds 1000, you're forceWalked. And that's what my question is all about.
anything within the first 2 map squares around a map border should work somewhat okay. anything more causes multiple issues.
A quick investigation suggests that loadCoef should bypass this limit, but currently doesn't. I suggest raising a ticket on the feedback tracker (https://feedback.bistudio.com/)
I think preStart = 1; did the trick for me, but doing more testing to be sure.
setRandomLip doesn't work for agents?
if you tried it and it didn't then it doesn't 
(unless you had disableAI "ANIM")
I don't recall exactly, is there a way to tell if a POSITION is within the bounding box of an object, building, container, etc?
I see there is BIS_fnc_isInsideArea, which gets us lateral containment. But what about the vertical?
inArea with boundingbox dimensions perhaps?
well, that wouldn't work with angled vehicles.
perhaps getting direction from the object, and with the isRectangle c variant.
other than that maybe inPolygon, though I'm not sure what the polygon would be on a house or container model bounding box; the corners perhaps?.
worldToModel
then simply check each coordinate component against bb one's
#define INRANGE(x, min, max) (x >= min && x <= max)
INRANGE(_pos#0, _bb#0#0, _bb#1#0) && ...
how do you mean each coordinate? and does that account for rotation, azimuth?
yes
may I ask: why? (what is the use case?)
I am a bit confused that it would account for rotation. Isn't the bounding box just that, the box it would take to contain the model? apart from rotation, etc.
confused that it would account for rotation
you're doing worldToModel
everything is in the model coord
including the box
need to determine if a unit is contained within an object such as a container, for instance; such as a Cargo_base_F base class.
need to determine if a unit is contained within an object
that's what you are trying to do; but what is the use case?
that's it. that is the use case. if the unit is already positioned there, then we do not need to reposition the unit.
so the driving condition is 'container contains unit'
ah, OK! and thanks (I didn't get it as you meant at first)
no need for that, just use [0,0,0]-based positions?
huh okay; actually, that raises another question. we are compiling a hashmap of object bounding boxes, mainly for use with a safe radius. but there are instances such as this one that we may actually want an 'actual' bounding box, for cases like this.
wdym? it is [0,0,0] based
yes, then inArea works fine
X, Y and Z no?
and what I mean by that is, we create a temporary model in a ghost position to get the bounds and such, then delete it. but in this case we may want the actual object.
yes. and you're just checking if X >= x_min and X <= x_max, etc.
you could do that via inArea but it's 10x more complex
so _relativePosition inArea _areaDefinedByBBoxDimensions ?
oh you mean inArea 3D?
yes
right I forgot that existed 
who knows if there are multiple containers etc
we'll cross that bridge later π€£ βοΈ
perhaps one container per unit group, but anywho...
so inArea with Z comprehension would work then. without needing to π around with world or model coordinates?
private _bbCenter = _bb#0 vectorAdd _bb#1 vectorMultiply 0.5;
private _bbSize = _bb#1 vectorDiff _bb#0 vectorMultiply 0.5;
(_obj worldToModel ASLtoAGL _pos) inArea ([_bbCenter, _bbSize#0, _bbSize#1, 0, true, _bbSize#2])
it's not as clean as I thought it would be
no worries, I'll pursue the inArea approach and experiment a little. thanks both of you.
Hello. I use the trigger along the river, creating the sound of the river, since it is missing. I need it to work in multiplayer.
if !(player inArea _this) exitwith{};
while {player inArea_this}do
{
playSound "River";
sleep 90;
};
};```
The problem is that when I leave the trigger, the sound continues to play.
If I add this sound through the sound effects tab in the trigger, then the sound works for all players, even those who are not near or in the river and should not hear it.
playSound is 2D
use say3D
or createVehicle a CfgSFX
That's right, I need 2d
oh, disregard then
then delete the sound
that's a bit harsh π
π curious, so river sounds would play when a unit is 1000m+ in the air but 'near' the river (in 2D)?
not 2D in position sense, more in audio sense
I experimented already with 3d sound, I did not like the result, since the sound is very much duplicated in two ears (the effect is not very pleasant).
what exactly do you want to do:
a 2D sound will be playing however you are turned from the river, absolutely not related to its position - no left/right ear channel changes
I don't know how to turn off the sound when I leave the trigger.
thisTrigger spawn {
if !(player inArea _this) exitwith {};
private _obj = objNull;
while {player inArea _this} do
{
if (isNull _obj) then {
_obj = playSound "River";
};
sleep 1;
};
deleteVehicle _obj;
};
Yes, I need it.
hmm; function of two things, the quality of the source audio. but isn't 3D intended to be able to tell left from right also? IDK... just π
True, intended, BUT
The river is small, it is not a huge shore, which is why it sounds not very beautiful in the vicinity, since there will be not 1 3D sound playback point, but several. And it so happens that 3-4 identical sounds are reproduced and it turns out "porridge".
so to me seems like an audio quality issue; maybe simplify it or thin it a bit, like a light trickle water sound, for use with 3D. again π
you could do calculations to have only one CfgSFX sound source that is placed regularly on the point in the river the closest to the player
buuut that's tricky ^^
not having the audio file to gauge, bit difficult to meaningfully feedback. but it sounds interesting.
Yes, light. But noisy...
Thx, it's work!
π π π
Update: Um, I think PIP is failing to load lip movement? because when I look at the character (character = agent) through a PIP camera, it doesn't move its mouth, but when I teleported next to it it did (it was running a set of animation so the issue is not with dynamic simulation or something)
not PiP, most likely the LOD or lip system not wanting to waste animation from afar
try PiP while you are close to it
Alright hopefully tomorrow
Is there a reliable way to make all doors of a building open and stay open for every player?
I tried the Edit Terrain Object module but doors stay closed for clients
[_building, 'Door_1_rot'] call BIS_fnc_DoorNoHandleOpen;
[_building, 'Door_2_rot'] call BIS_fnc_DoorNoHandleOpen;
[_building, 'Door_3_rot'] call BIS_fnc_DoorNoHandleOpen;
//etc
is this reliable for terrain objects in MP?
yes, iam not aware of any problems
you've used it in MP and have not had any problems?
correct
I'll give it a shot thanks
You can also disable the doors actions by doing this
_building setVariable ["bis_disabled_Door_1",1,true];
_building setVariable ["bis_disabled_Door_2",1,true];
//etc
Question, is there any script I can use to make the Shikra texture/model hidden without it being actually hidden?
Example picture: https://cdn.discordapp.com/attachments/740313787827224696/1008187920512987146/unknown.png
This is the furthest I was able to get with setObjectTexture and setting the texture to " ".
I', trying to have a completely invisible Shikra that can still be locked on but can not be seen.
No
If hideObject doesn't fit into, there's nothing
Yea sadly with hideObject you can't lock on the vehicle.
I'm trying to use a hidden plane to attach a cruise missile object to it and give the players the ability to shoot down the "cruise missile".
is there any way to edit the end mission statistic window?
the one that says "your kills" "casualties" etc
or rather, add onto the existing categories
This might help? https://community.bistudio.com/wiki/Arma_3:_Debriefing
checked that, only seem to edit the initial screen
The screen that can be shown ingame not in debriefing am I right?
What's your goal?
I need 2500000 civilians added to the casualties list
just as a single line I don't want 2500000 individual names
and before you ask its not for a stupid overused joke
what if I named a blufor unit "2500000 civilians" and killed it
it should pop up right?
I did see first names in the list, so I assumed identity would work
mhm I can only see the type in the list I have no idea how to show names like in the link
Back to my inArea question... re: bounding boxes... when we're talking angle, rotation angle, is that literally what getDir _target reports?
Also with regard to "Cargo_base_F" classes, I believe the editor (directional?) orientation is breadth-wise, if that makes sense, correct?
Just trying to orient bounding box XYZ elements appropriately re: a, b, angle, and c vectors, if that makes sense.
https://community.bistudio.com/wiki/inArea
https://community.bistudio.com/wiki/boundingBoxReal
I can probably make some best guess estimates, but if someone happened to know...
Thanks...
If I read the docs correctly, a is X, b is Y, c is optionally Z, rotation only, strictly speaking, not speaking of azimuth, i.e. when you rotations along XYZ axes. so hence the more detailed analysis involving world model coordinates, I imagine.
The container models themselves, the "width" axis in particular is also a bit tricky, I think; cause there is some buffer in the model allowing for opening of doors, so I want to reduce that width accordingly.
Bit difficult to see the model bounding box in the editor. But to give the sense of the bounding box. Best guess, 80% 90% of the model width of box is the actual model, not counting opening doors. Totally experimental.
I believe the box around the selected container is the bounding box
my best guess is, if it is a one-object thing use manually-provided measurements
Yep, from some preliminary assessments, medium container re: player positions...
[medium distance player, getpos player, getpos medium, boundingboxreal medium]
Yields,
[4.50015,[14568.4,16119.3,0.00144386],[14571.8,16121.9,-3.43323e-005],[[-4.67598,-1.24,-1.32431],[4.67598,1.24,1.32431],5.00877]]
These are the raw, 'precise' numbers real gives us. Which includes some buffer for doors opening.
But I think with that, I can better work with this and make some educated guesses.
how to disable collision of an object with every player
Actually you can. It's not necessary that each pair of objects with disabled collision should only be disabled with each other
Hm, good to know. I must be misremembered then
added a clearer description here
https://community.bistudio.com/wiki/disableCollisionWith
βοΈ
is there any way to localize role description in the lobby screen?
https://community.bistudio.com/wiki/Stringtable.xml
You can check this out for the idea
yeah, I know about stringtable and already actively use it, but how to pass string key to role description in 3DEN Editor?
You can set a custom role description in Eden (Edit Object -> Object Control -> Role Description), however to localize it you will need to modify the mission file and replace the string with Stringtable variables.
Thanks for suggestion. Sad that there is no way to do this through the UI.
although it might work when setting the Stringtable string directly in Eden, never had to use it though
I tried to put $STR_ROLE_NAME/localize "STR_ROLE_NAME" there, it still treats it as ordinary string
Try "@STR_Something"?
brb
if I recall correctly it should be
// object in mission.sqm
description = $STR_ROLE_NAME;
while adding it in Eden will always add quotes around it
quotes ideally should be present around $STR
if it works without, it is the engine trying to be nice and understanding
you can actually try in a CfgSounds, name = My Sound;
(perhaps not spaced, but underscored - to be checked)
hmmm... KP-Liberation uses "@STR_ROLE_NAME" (ampersand instead of dollar sign) π€
although I guess they use some weird replace stuff
Yeah, putting @ before string key works
Once again - thanks
in the Biki:
In markers and other Eden Editor fields (e.g Mission Name), translation keys should be prefixed with @, without any quotes around - e.g @STR_myMarkerName. Casing does not matter here either.
https://community.bistudio.com/wiki/Stringtable.xml#Editor
Localisation keys can work without quotes in description.ext. I don't trust that trying a non-localisation key strings without quotes would work though.
decription.ext is a config file, mission .sqm is not π
at least not the same as regular config files
CfgSounds (which is description.ext) was mentioned so I assumed there must be some degree of relevance
when creating JIP calls is it called on client after client's init.sqf or some other point?
like: remoteexec ["jipTestFn", west, true]; When does jipTestFn get called on JIP client?
https://community.bistudio.com/wiki/Initialization_Order
Persistent functions are called is what you're looking for π
so init.sqf is not the right place to define the jipTestFn function?
init.sqf is not the right place to define any function 
well that's what I use anyway π
But yes, the table says that in multiplayer, init.sqf runs after persistent functions are called, so you should not be able to persist a function call to a function you defined in init.sqf.
ok
yeah init.sqf does not seem to work if there's any delay
so I have this for the JIP functions: sqf class CfgFunctions { class Teeeest { class InitFns { class JipTest { file = "jipFns.sqf"; preinit = 1; }; }; }; }; i guess that's the only way?
You should define all your functions in CfgFunctions rather than init.sqf anyway
I have so many functions it would take years to put them all there π
Arguably even more of a reason to do it
It's not difficult to do, just cut & paste each one to a new file and add 1 new line to cfgFunctions per function. Should take 15 seconds per function at most.
i appreciate the feedback but seriously I have so many functions that Im choosing the lazy way and just create the all via init.sqf . Everything is organized in files though which are execVM'ed
If you've already got them all in separate files then this isn't the lazy way, it's exactly as much work as cfgFunctions, but worse performance and less remoteExec-ability
I mean lot of functions in one file
Look, I can't make you do anything you don't want to, but please understand that you're deliberately choosing to make things worse in the long term in order to save a few seconds now. If you truly have so many functions that it'll take more than 10 minutes to convert them all, it's very likely that the performance difference will be noticeable.
i appreciate the fact that you are trying to help me but you really can't guess how many functions I have π
btw i guess there's no way to run some function files in CfgFunctions in client and some in server? or do I just do that inside the file? (hasInterface etc)
do I just do that inside the file? (hasInterface etc)
yes
or move server-only functions to servermod, i guess
it used to be the same way for me like 3 yrs ago and I had hundreds of functions and it only took me an hour to get everything sorted out
and it was worth it 
it saves you a lot of time in the future because whenever you want to add a function you just add a single class fnNmae and create a fn_fnName.sqf file and you're good to go
plus it makes mod <-> mission transition easy for me (I make my mods in missions)
ok thx for all the help guys π
sounds like a "I won't do it anyway" π€£
the one thing i wish was possible with CfgFunctions is to have like 1-2 more levels of nesting
why? 
to have stuff a bit more structured, i guess. For, say, a "Vehicle respawn system" to contain a "Mission maker interface" , "Server respawn logic" and "Abandon detection" sub-systems π€·ββοΈ
After i set Pip to black and white, using example 4 here https://community.bistudio.com/wiki/setPiPEffect
How can i set color back again?
I tried"rtt" setPiPEffect [0]; but no color, still B&W.
If Color Corrections effect has been used, going back to Normal will have no effect. In order to unset Color Corrections, set the 2nd param in it (enable) to 0.
Ah! Thanks!
it probably goes the same for chromatic aberration and film grain
π
You want your functions separated?
to in own folders in functions path
@little raptor when i change Pip quality (Low, Standart, High, Very High, Ultra) the Pip Effects i have set are lost. This is normal?
This don't happens with vanilla Arma 3 Pip's like the ones on vehicles.
idk 
Wouldn't it be possible to make a cheap implicit type system by creating a plugin in e.g. Visual Studio Code and forcing the variable types by the editor itself with naming conventions or do I have some critical error in my logic here?
what do naming conventions have to do with types?
I began to think about it because my SQF mastermind friend developed relatively complex stuff back in the days by creating an implicit type system with naming conventions. But why not take it to the next level and write an editor plugin for it to both automate it (easing unnecessary cognitive load) and eliminate occasional errors caused by the manual method?
If you can determine the original variable type when it's created, you can keep the type intact during its lifetime even with a hacky and/or implicit solution such as that one
The naming conventions would just mostly signal the variable type
So in a twisted way I think that the very core of the concept would be the same than with TypeScript, just the means to get there would be different
`private _vehicle = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
player reveal _vehicle;
hint "Votre vehicule est pret !";
life_draw_vehicle_icon = {
private _vehicle = _this select 0;
if (isNil "_vehicle" || {
isNull _vehicle
}) exitWith {};
if ((vehicle player) isEqualTo _vehicle) exitWith {};
private _distance = round(player distance _vehicle);
private _text = format["%1m.", _distance];
private _pos = getPosATLVisual _vehicle;
private _vehicleInfo = [typeOf _vehicle] call life_fnc_fetchVehInfo;
private _icon = _vehicleInfo select 2;
drawIcon3D[_icon, [1, 1, 1, 1], _pos, 1, 1, 0, _text, 2, 0.05, "PuristaMedium", "center", true];
};
private ehID = format["LIFE_ID_VEHSPAWN%1", (round random 999999)];
[_ehID, "onEachFrame", "life_draw_vehicle_icon", [_vehicle]] call BIS_fnc_addStackedEventHandler;
sleep 30;
[_ehID, "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
`
where is my error ???
Paste the error.
"life_draw_vehicle_icon" looks like an error to me.
should be just life_draw_vehicle_icon without the quotes. Function takes either code or stringified code.
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
Also BIS_fnc_param and BIS_fnc_addStackedEventHandler are obsolete in A3 and should be replaced with the engine commands.
the engine commands ?
Error in expression <]] call BIS_fnc_addStackedEventHandler; sleep 30; [_ehID, "onEachFrame"] call BI> 16:42:03 Error position: <sleep 30; [_ehID, "onEachFrame"] call BI> 16:42:03 Error Suspending not allowed in this context
my erorrs
You need to run that code in scheduled context. Spawn or remoteExec.
I don't know your macros.
#define ANYONE 0
#define CLIENT 1
#define SERVER 2
[_vehicle] remoteExecCall ["life_fnc_unimpoundCallback",_unit];
remoteExecCall is unscheduled context. You need to use remoteExec, or add a spawn inside the function.
so like [_vehicle] remoteExec ["life_fnc_unimpoundCallback",_unit];
Yes.
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
its exhibiting a weird behaviour
yes when you are far away from it, the lips in PIP won't move, and yes when you teleport next to the character the PIP will show lip momvents but:
If you teleport yourself away (after teleporting yourself close to the character) the lip movement will still work in PIP
Really weird
Right I'm unsure if this should explicitly be in here as I think it's to do with maths, but with setVelocityTransformation, is there any way to stop the player from spinning around vertically etc when moving the camera? I'm currently using vectorDir player for both results but I think I want only one element of the player's vectorDir for this?
basically i want the player to turn like theyre on the ground with setveltransf
Trying to avoid this level of weirdness
Something like this maybe:
_pdir = vectorDir player;
_pdir set [2, 0];
_pdir = vectorNormalized _pdir;
Might want some tolerance on the z rather than a hard zero.
roger i'll give that one a shot ty
not quite what im looking for i dont think but im not entirely sure what i need to change
let me experiment a bit
ya i dont think this is what im looking for because i still want the player to be able to move around just not move their entire body if that makes sense
like theyre on the ground or falling
looking for function to do SUM of values in array
There's no fast method. You just have to do something like
private _total = 0;
{ _total = _total + _x } forEach _array;
_array accumulate [0, { _accumulator + _x }] when 
It's still running SQF per element, unless they add specific expression optimisations. Which they could, I guess.
there is a very small case pool for having a specific command like that, so it having to run sqf is most optimal i think
I wish
anyone got any bright ideas for this as im utterly stumped
the maths for this is beyond my ability
@sullen sigil What's the vectorUp setting?
_vectorDir = _playerPos vectorFromTo _entityPos;
_sideVector = _vectorDir vectorCrossProduct(vectorUp player);
_vectorUp = _sideVector vectorCrossProduct _vectorDir;```
Does anyone have a script to add inventory items to random civilians...
And SVT is just using that?
yup
player setVelocityTransformation[_playerPos, _entityPos, _velocity, _velocity, _playerDir, _playerDir, _vectorUp, _vectorUp, _interval];```
_playerDir is this
whole gear or just add particular item to random civilians ?
Hm
random items from a list ...
doing military patrol... interrogate ... arrest action...
so looking to randomly give contraban items to civilians spawned with COS
@sullen sigil Yeah alright watched your video... problem is that your vectorUp points away from the rope (hence why you are angled like you are) which was intentional
However as a result
Your vectorDir movement (which is unlocked) is to the sides perpendicular to that so you rotate weirdly like that
There's not a great way to fix it other than either being oriented differently or just not allowing rotation
I think I understand what you're saying there?
Is there any way to stop X and Y rotation and only allow Z? Sort of makes sense within the use of the tool
private _items = ["Chemlight_green", "Chemlight_blue"];
{
_x addItem ( selectRandom _items );
}
forEach ( allUnits select { side _x isEqualTo civilian } );
depends on type of item, change addItem to addMagazine
cool thanks i will give it a try
@sullen sigil Yes, we can project the vector onto the plane of your movement, though I need to recall how to do so
One moment
you're a legend btw thanks so much for the help π
No problem lol
Alright found it
As long as you're using a normalized vector (which you are) this should be sufficient
_vectorDir = _sideVector vectorCrossProduct (_playerDir vectorCrossProduct _sideVector);
Set that outside of the EH with _playerDir as vectorDir player
legendary, i'll give that a punt now -- thanks for the help dude
Yup, that works perfectly, thanks man
how to do I approximate a number?
e.g: 3.25 = 3.3
for printing or for further math usage?
toFixed
Nicely done π
@sullen sigil No problem, glad it worked out
Yeah thanks dude π
I have a script that teleports you where you are aiming, is there a way to limit the teleportation distance to lets say 10m?
player addAction ["<t color='#000000'>Dash</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
player setPos screenToWorld [0.5, 0.5];
player setPosASL [getPos player select 0, getPos player select 1,10000];
player setPosASL [getPos player select 0, getPos player select 1, (getPosASL player select 2)-(getPos player select 2)];
playSound3D ["A3\Sounds_F_Vehicles\air\noises\SL_rope_break_int.wss", _target, false, getPosASL _target, 5, 1.5, 0];
}];
Yes it's easy
though why are you doing
player setPos screenToWorld [0.5, 0.5];
player setPosASL [getPos player select 0, getPos player select 1,10000];
player setPosASL [getPos player select 0, getPos player select 1, (getPosASL player select 2)-(getPos player select 2)];
instead of just
player setPosASL (AGLToASL screenToWorld [0.5, 0.5]);
should do exactly the same thing
as for limiting the distance, you could do it like so:
player addAction ["<t color='#000000'>Dash</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
private _playerPos = getPosASL player;
private _teleportPos = AGLToASL screenToWorld [0.5, 0.5];
if (_playerPos distance _teleportPos > 10) exitWith {};
player setPosASL _teleportPos;
playSound3D ["A3\Sounds_F_Vehicles\air\noises\SL_rope_break_int.wss", _target, false, getPosASL _target, 5, 1.5, 0];
}];
if it's a "dash" you shouldn't use screenToWorld to begin with
doesnt seem to be doing anything
Are you pointing at a position less than 10m away?
Okay I see, is there a way to do it that even if you point further away it only teleports you 10m max?
Yes one moment
player addAction ["<t color='#000000'>Dash</t>",
{
params ["_target", "_caller", "_actionId", "_arguments"];
private _playerPos = getPosASL player;
private _teleportPos = AGLToASL screenToWorld [0.5, 0.5];
private _teleportDir = _playerPos vectorFromTo _teleportPos;
if (_playerPos distance _teleportPos > 10) then {
_teleportPos = _playerPos vectorAdd (_teleportDir vectorMultiply 10);
};
player setPosASL _teleportPos;
playSound3D ["A3\Sounds_F_Vehicles\air\noises\SL_rope_break_int.wss", _target, false, getPosASL _target, 5, 1.5, 0];
}];
one way to do it
Good evening! Is it possible to get player's uid in main menu?
I have custom mod, but for some developer funcs access - i need to sort it somehow
i don't think so, i guess you can hack the ui though, pretty sure you can get the uid from the profiles options
Does anyone know of find the signal type of script? .. where your guys have to locate a transmission via signal strength or something
Spectator problem. When a player dies and is resurrected, it happens that in spectator mode it shows his corpse, and not the resurrected player. There is a solution? I am using ACE.
is this place for editing addon scripts?
any kind or arma script (sqf)
does cinecam count?
What are you trying to do with cinecam?
re enable a feature and disable a feature
there's a feature which prevents you from zooming in
Are you actually doing that through an sqf file though?
pbo :/
Do you have permission to be editing the mod? It doesnt look like a license is mentioned on its steam page
the second feature is where you press right click hold or not it just forces you in first person ads
yeah issue with that in order to get permission I need to reach the guy
however he is banned
so there's no way to reaching him out
He's banned in this discord?
It looks like their profile is just private, their vac ban has nothing to do with you being able to reach them. You could try commenting on the page to see if they respond
can't comment got a community ban
idk what to tell you π€·ββοΈ
he hasn't been working on the mod for 2 years either
then again this is just a custom version for me not something I will release
its for a video
Check out the license page for arma and see if a default license is applied if none is specified. You might be able to edit it without redistributing it
where do I see the license page
I guess this is his license?
CineCam | Cinematic Third-Person Camera Replacement
https://forums.bohemia.net/forums/topic/220040-wip-cinecam-cinematic-third-person-camera-replacement/
Copyright (C) 2018 Zooloo75
REQUIRES: COMMUNITY BASE ADDONS
CineCam | Cinematic Third-Person Camera Replacementby Zooloo75 Steam Workshop Page: https://steamcommunity.com/sharedfiles/filedetails/?id=1551751531 Version: 0.15 / Nov 1, 2018 Development Began: Oct 27, 2018 License: Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Licens...
the code was originally made by Zooloo tho
nvm its the same guy
it looks like that forum post has it under this license: https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
Which isnt an arma license, however assuming it is in compliance with arma 3's eula then it still stands.
Look into that license and see what you're allowed to do
looks like I don't have to comply with them
but my intentions aren't breaking any eula either
What makes you not have to comply with it...?
don't have to Comply with any of the mentions that has to do with the Eula unless I gain profit or as in commercial advantage
Ok then, what are you having trouble with script wise?
Im having issues understanding which code does what Im struggling to find the very code that is responsible for preventive third person aim and preventive camera zoom in
when I press right click it instantly goes to first person ADS no matter how I press it. hold or non hold it instantly goes to ADS First person
the mod also disables some of arma 3 vanilla zoom in features
which belongs to view
Does the mod have a section in controls? It may be possible to just fix through that
It seemingly does but I can't share it due to how long it is
I mean in game controls, not in the code
yes Ive done that through mapping the right click key
to a something else in logitech
but it doesn't work as intended
I found a decent workaround to that bit but even if it works it still is janky while the camera zoom in vanilla being disabled haven't really found any work around on that part
or prevented somewhat that one is also a issue
there's no configurable option to turn this on or off unfortunately which is why im requesting for help
thanks
NoUserName, there really isnt a lot we can do to help without an actual code example
do you mind if I post it to you through dm or something?
If you have a specific block you want help with. I don't have the time to sort through thousands of lines of code looking for a solution to a unspecific problem
Im just gonna assume
considering the offset settings that are configurable is obvious enough if I don't include them the text won't be as long as anticipated
Better start using sqfbin.com
?
That's a large block of code
yeah
Use sqfbin.com to make it easier for the chat
It's a website where you can paste the code and it will have sqf syntax highlights
Plus makes it easier to read than a discord chat
That's what most people here use when sending large chunks of code
how do I make him read through the website tho I can't really post images
(it makes a link for you and you paste that here)
https://sqfbin.com/iqihaficonupagagunisI assume it goes from here
ya that sqfbin is empty
you have to copy the link and paste it manually
idk why discord doesn't directly respond
nah, it just takes me to the default page. Anyway, it looks like they are adding keybinds with cba, what are the ingame binds that you see?
so far only toggle camera shoulder
idk if it could be this one that is responsible for thirdperson switching to first person when press right click if (vehicle ThirdPerson_FocusedUnit != ThirdPerson_FocusedUnit) then {
switchCamera ThirdPerson_FocusedUnit;
} else {
if (ThirdPerson_IsInFirstPerson) then {
if (ThirdPerson_IsAimingDownSightsFromThirdPerson) then {
ThirdPerson_FocusedUnit switchCamera "gunner";
} else {
switchCamera ThirdPerson_FocusedUnit;
}
} else {
switchCamera ThirdPerson_Camera;
};
};
second try hopefully this link will work https://sqfbin.com/yoritiqijeqemuxicazo
Ok so I solved that part with the right click
now its all left is the preventive zoom in
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
Good morning,
Is there guide / wiki page to add to my script ability to change options via addonn menu?
I mean in editor
Options - configure addOn options -
Override.
Server [x] client [x] mission [x]
Cannot send picture here , so if my question is not clear , let me know, so I will explain again π
that's a CBA feature
refer to their docs
Thanks , i will look from there
CBA_fnc_addSetting to be exact
Nice, this helps me alot
glad I could help
Can i rotate a spawned object?
Specifically I have a small script which spawns a missile but the missile is spawned at 90 degrees. Can it get it to spawn facing upwards?, if so how?
Yes, you can, by changing its vectorDir and vectorUp
i.e. doing something like
missile setVectorDirAndUp [[0, 0, 1], [1, 0, 0]];
should make it face upwards
is there any particular inefficiency in loading data from a config file?
I guess that's a bad question lmao
would it be faster to load data from memory than from a config file? I dont know if those get stored in memory like variables
I assume it would be better to load the data from the config once and store it in a variable to call on later, than load the data from the config file once every time you need it.
Does SQF have commands that have context sensitive output data types?
Explain in further detail what you mean
All config data is loaded into memory by the game on startup anyways. configFile just accesses that stored memory.
At least, everything I've ever seen seems to imply such. Don't believe it does any further disk reads seeing as configs are basically ROM as far as the game is concerned.
well that saves me a little bit of work π
instead of loading data and saving it all in vehicle namespaces lol
I would recommend a caching system if you're frequently needing to read the same data
otherwise don't worry about it
how frequently is frequently?
if someone wanted to, I suppose they could spam the scroll wheel action, but its only once per
For that sort of thing I wouldn't worry about it
this would be moreso if you're looping something that could be re-accessing the same info
no problem
How would one implement this in case of Arma? Like that it'd actually increase performance
Depends what kind of caching you need but in most cases I'd go with a hashmap
Does SQF have commands that can have varying data types as outputs based on which kind of data (types) you give them as parameter?
I mean, you can make commands that do that, yeah
that's what I'm planning on doing for the stuff I'm pulling from the profile namespace. Looks promising and exciting
SQF is loosely typed so
functions can return and take any type unless you explicitly forbid it
Yeah hashmaps are very useful
Ah, I just realized that the definition of cache includes software level solutions too π (I'm a turd) π
I'm sure the engine itself does some caching in the background
I'm unsure of the details of any such caching, though
This is exactly what I'm trying to avoid. I'm not speaking about functions btw, but actual script commands, like the built-in ones / API
Ah
as far as the commands go, IIRC almost all of them if not all of them have expected argument/return types
not so much dynamic
but some can have some variance depending on the type of params, yeah
Because if we pretend for a moment that I wrote a TypeSQF to SQF transpiler, context sensitive command outputs (they exist in SQF according to a friend who knows quite a lot about it, but he didn't specify it further) cause some headache but I guess it'd still be doable
I mean they exist to an extent
I guess what I'd say is this
all type-based behavior is pretty much done either using conditionals with
https://community.bistudio.com/wiki/typeName
or specifying a required type for a parameter with params
Well, in some way they have to be deterministic, so I think it would be doable (as long as the functionality of the command isn't a black box)
Thanks for the examples btw!
i.e. at the beginning of a function I could have
params ["_arr", [], [[]]];
which forces _arr to be an array, otherwise an error will throw
or if an argument can be one of many types I'd use typeName conditionals to alter the behavior based on the type
that's pretty much the extent to which SQF does type-based behavior
Yes, and that's why I'm playing with the idea of TypeSQF with transpiler
Well I certainly think there could be some benefit from such a thing
I myself am not a big fan of loose typing, though to some extent it makes things easier
SQF taught me to have a deep hatred towards loose/dynamic typing π
I basically refuse to work with even JavaScript now 
But at least the length of feedback loop is more tolerable with JS than with SQF... Thinks about the countless times when I had to spend minutes to notice a simple type error in my code
But I'm a weird programmer anyways... I like writing documentation and I love writing human readable code (when possible), I prefer (decent/good) UIs as the main method of interacting with program with command line as fallback method for more accurate control and such... 
Hmm, after checking typeName and params the logic behind them is clear when it comes to types. As a follow-up question: are there any SQF commands with context sensitive output data types that work like a black box from the modder's/scripter's perspective?
I mean basically all of the commands are a black box to an extent since you can't easily see their internals
though the BIKI documents all of the expected input/output types
so not really a black box
Dynamic typing is like peeing with your clothes on in winter... Makes you feel warm in the short run, but even more miserable in the long run
Yeah. I'm sorry, I intended to limit the scope of the question to data types only but worded it badly π
No worries
tl;dr if a command has any sort of noteworthy type-based behavior it'll be noted on the BIKI (hopefully)
otherwise there's not much other way to know
i made script to save and load map markers, but when i create them i cant delete it ( mp) how can solve this ?
i used the last parameter but it dont seem to work ( im testing it on editor MP)
createMarker [str [getPlayerUID player ,_foreachindex], _x select 0, 1, player ];
solved: need to add "_USER_DEFINED" in the marker name
it is doable, there are a few commands that have multiple return types though, dynamic scoping makes it tricky aswell (call specifically), so you'd probably want to forbid it for easier typechecking
As long as the logic is deterministic and most importantly available or can be figured out by us modders, I think it could be doable. But if we ran regularly into the black box issue, it wouldn't necessarily increase my motivation π
Thanks a lot!
No problem
Made a funny video for a new mod I made that I figured I'd share
https://www.youtube.com/watch?v=xnl9foSNXmU
Iβm guessing _asset is a specific unit
Not the group that it belongs to
Ah
Lemme google real quick to find the line Iβm looking for
I think itβs group _asset which should return the group that _asset belongs to
But I gotta check
Yeah thatβs it
In your setgroupOwner
A createVehicle'd thing won't belong to a group
What is _className you want to spawn?
Listen to this guy he knows more than me lol
Oh, if itβs a vehicle it shouldnβt belong to a group afaik
createVehicle'd object won't have an AI. Even if it is B_Soldier_F
In the first place, what exactly you wanted to do?
Oh, TIL. Thatβs good knowledge
!code
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
Where is the _asset? π€
Also if you want to post entirely use sqfbin
And
In the first place, what exactly you wanted to do?
Also if you want to post entirely use sqfbin
https://sqfbin.com/
Use this
how would I integrate this into the script I am using.
[[7071.01,5782.47,4.15596], "RHS_9M79B", car1, 180, false, [0,0,0.25]] spawn BIS_fnc_exp_camp_guidedProjectile;```
In the first place, what exactly you wanted to do?
Please answer this
Then relaunch Discord? π€
And what is the relevance with setGroupOwner?
What mapmarker?
If you want the map marker to be the colour of the playerβs side, I think you are over complicating this tremendously
marker setMarkerColorLocal format ["Color%1", side player];
```this?
Thatβs exactly what I was trying to get. Waiting for my PC to load to rip it out of one of my scripts

If it was me, right after the vehicle spawns I would CreateMarker using the position of the vehicle (which I believe you had stored in _asset)
Then what Lou posted to set the colour of it
If I understood correctly what you were trying to do, setting the colour of the map marker, correct?
I wonder if itβs a scope thing
That is generally how code works lol
Context is important
But I see what itβs trying to do
So, what is the intended sequence of events for the player?
Scroll wheel action > openβs menu > select vehicle type from list > spawn vehicle?
so that line that was erroring
_asset setGroupOwner (owner player);
do you know what that's supposed to do?
I would see what happens if you remove it
so it just slaps a parachute on your position?
alive _asset
I mean, the else is a bit excessive
if (!alive _asset) {
give back money
};
just invert it using !
First step of my project has come together, if still needing some polishing, but its on to new additions.
Im trying to include a method of adjusting created building objects, particularly, the SOGPF Mike Force FOB buildings, so you can more fine-tune their position.
The idea being one player electing to take a supervisory role, and have a couple Fired EHs attached to them, such that if they have the SOGPF shovel equipped, they can addAction select between push, pull, lift, and lower, as well as a value to adjust by, and beat the object into place.
I can understand vectorAdd, and get the target to move in the cardinal directions, but the thing Im having trouble with is the idea of 'move object to a new position equal to its own position, plus/minus the adjustment value, in a direction the eventHandle'd player is looking,' which would narrow the necessary inputs some.
It should be that you can use vectorDir to find the direction the player is looking, vectorMultiply that value to produce the adjustment interval, and then vectorAdd that to the object position to apply it
Hey, if i use an addAction on say a vehicle, is there some way to "get" the player that is perfoming the addAction? I need to feed the position of the player perfoming the addAction into a separate script, but im not sure whats the best way to do that
https://community.bistudio.com/wiki/addAction
The caller is available as one of the variables which can be retrieved with params. You can then pass it to the script as an argument e.g [_caller] call your_fnc_function.
@cursive tundra β
kind of a general question, but anyone have a good method of visualizing your data structures?
having trouble wrapping my head around the layers of data I'm trying to store
as in⦠what?
Just trying to think about how my data stores
oh wow that embedded, wasnt expecting that lmao
drawing it out like that kinda worked. I was just curious if anyone had a way of doing it that they found really easy to understand
nay π
lol guess I just gotta trust my hands to write the code that needs writing
there's saying well designed code is 90% complete
I cannot emphasise that more
write your logic in human language, translating it into code is 5% of the work
if you store a hash map using setVariable, does it get stored/retrieved as an array?
nvm, its my default value which is the array π
btw for those who always hated doing systemChat, hint etc., the latest update of Advanced Developer Tools adds an in-game debugger!
don't crosspost just kidding, do it, it's well deserved π€―
I googled/wiki'd these and I have no clue at all what im doing.
how did you halt the game like that? π€
setAccTime?
Well...those were intended for someone else's problem, and I don't know what you're trying to do with them, so I'm not sure I can help
in unschd env the breakpoint hits in the next frame but doesn't pause the script (the breakpoints just keep accumulating until next frame)
in schd it pauses the script using waitUntil
very nice π
I see that now.
I misread your username.
plresumed that is was a reply to something I was asking about earlier
Wow! Congrats for the release! π
oh didn't know he was constipated now
quite rude to release it right after I finished working on a project honestly
Sending you a DM
this sounds like something I need in my life right about now
