#arma3_scripting
1 messages Β· Page 5 of 1
At some point it's either put up with some network desync or use a different method for moving the vehicle
Perfect network sync isn't gonna happen
there is one thing you can do
use local vehicles 
if you don't want to use AI at all
well I'd much rather just have the pilot fly the plane in a straight path than use setVelocityTransformation, anyway, if that would have the same effect
I mean yeah but 
I'm fine with having an AI fly the plane, as long as it wouldn't be unreliable
I need it to go in a line
if you use setFlyInHeightASL it should
doesn't have set 
flyInHeightASL
got it
thanks
and what about the dir? I can't have it switching direction, even a tiny bit
Also strip out any additional behavior from the ai you don't need to make it more stable
setting it to careless is enough imo
Should be
ok...
Theoretically π
set the dir when you spawn it
ok
_plane setDir (_start getDir _end)
Simply punish the ai with setDamage when it moves to enforce compliance >:)
and make sure you change setPos to setPosASL
The punishment for using setPos is death
Pretend it doesn't exist it's for the better
Honestly biki page for setPos should just force redirect to setPosWorld
how would you find magazines for a unit classname?
you mean magazines that it carries by default?
yes
if you have a spawned unit you can just do primaryweapon and look in cfgweapons
basically is there a helper fn for getting config weapons for a unit classname + for getting mags for that
using its linked uniform/vest/backpack
and the magazines entry ofc
well i just want to get all mags allowed for all weapons of a unit
yes so. given a unit classname. i want to get all compatible mags for all weapons that unit has
e.g. an ammo bearer carriers AT rounds but he doesn't have a launcher
yeah that doesn't matter to me
BIS_fnc_compatibleMagazines
and after v2.10 update, compatibleMagazines command
ok. that's for getting mags for a weapon classname
so i just need to get those from config
yeah i couldnt find it
looks like it doesn't return muzzles
you have to get those yourself
oh wait. just doing CfgVehicles >> _classname >> magazines[] might be good enough
it's not
it only shows mags added to the unit itself, and has nothing to do with compatible mags
yeah, that's good enough I think. this is for having an 'arsenal' for refilling ammo
private _plane = createVehicle ["B_T_VTOL_01_infantry_blue_F", [0, 0, 1000], [], 0, "FLY"];
private _pilotGroup = createGroup blufor;
_pilotGroup deleteGroupWhenEmpty true;
private _pilot = _pilotGroup createUnit ["B_Pilot_F", [0, 0, 0], [], 0, "CAN_COLLIDE"];
_pilot moveInDriver _plane;
_pilot setBehaviour "CARELESS";
_plane flyInHeightASL [1000, 1000, 1000];
_plane setPosASL _planeStartPos;
_plane setDir (_planeStartPos getDir _planeEndPos);
```Right now this is what I have, and the plane is changing direction. what parts of the pilot's AI should I disable?
Doesn't "FLY" actually create the aircraft at a much lower altitude than the input?
So the flyInHeight is asking it to climb hard.
hmm
well if I don't create it in "FLY", then the engine isnt on
but when I do _plane setPosASL _planeStartPos, that sets it to the correct height
private _dir = _planeStartPos getDir _planeEndPos;
[_plane, _dir] spawn {
params["_plane", "_dir"];
while {true} do {
_plane setDir _dir;
sleep 1;
};
};
this could also help as a bit of a "bruteforce" solution to keeping the dir constant
though likely that it will still have some sync issues in MP
I tried this but I'm pretty sure it froze the plane midair
changing direction
vertically? (as in pitch)
nope
also you need to add a move/waypoint or something
just heading
ok...
I assume you have a waypoint set up externally...?
elsewise not sure how you're even getting the pilot to move to the pos
I don't, setting it up now
when you say "move/waypoint", is the "move" something other than a waypoint?
test it with a waypoint and then if it's still behaving weirdly then gross measures may be in order
can I just do _pilotGroup move _planeEndPos?
private _plane = createVehicle ["B_T_VTOL_01_infantry_blue_F", [0, 0, 1000], [], 0, "FLY"];
_dir = _planeStartPos getDir _planeEndPos;
[_plane, _dir] spawn {
params ["_plane", "_dir"];
while { !isNil "_plane" } do {
_plane setDir _dir;
sleep 1;
};
};
clearItemCargoGlobal _plane;
clearBackpackCargoGlobal _plane;
private _pilotGroup = createGroup blufor;
_pilotGroup deleteGroupWhenEmpty true;
private _pilot = _pilotGroup createUnit ["B_Pilot_F", [0, 0, 0], [], 0, "CAN_COLLIDE"];
_pilotGroup move _planeEndPos;
_pilot moveInDriver _plane;
_pilot action ["VTOLVectoring", _plane];
for "_i" from 1 to 3 do {
_pilot action ["VectoringDown", _plane];
};
_pilot setBehaviour "CARELESS";
_plane flyInHeightASL [1000, 1000, 1000];
_plane setPosASL _planeStartPos;
_plane setDir (_planeStartPos getDir _planeEndPos);
_plane lock 2;
```This is what I currently have
what's the difference?
_pilotGroup addWaypoint [_planeEndPos, 0];
ok
that's all I need tho, I don't need to set the waypoint type or anything?
[_plane, _dir] spawn {
params ["_plane", "_dir"];
while { !isNil "_plane" } do {
_plane setDir _dir;
sleep 1;
};
};
```Also this does make the plane freeze mid-air
ah shoot forgot setDir resets velocity
could do
private _dir = _planeStartPos vectorFromTo _planeEndPos;
[_plane, _dir] spawn {
params["_plane", "_dir"];
while {true} do {
_plane setVectorDir _dir;
sleep 1;
};
};
would just need to make sure the Z pos of the start and end positions are the same so it doesn't pitch (unless you want it to?)
yup
ok thanks
yeah this is awful
the plane is still frozen and it is wobbling worse than ever lol
maybe I should go back to setVelocityTransformation?
I don't think I'll be able to get the pilot's AI to do what i want
it's a very long distance and I need it to fly perfectly straight
even on the server?
yes
well, with this:
private _plane = createVehicle ["B_T_VTOL_01_infantry_blue_F", [0, 0, 1000], [], 0, "FLY"];
_dir = _planeStartPos vectorFromTo _planeEndPos;
[_plane, _dir] spawn {
params ["_plane", "_dir"];
while { !isNil "_plane" } do {
_plane setVectorDir _dir;
sleep 1;
};
};
private _pilotGroup = createGroup blufor;
_pilotGroup deleteGroupWhenEmpty true;
private _pilot = _pilotGroup createUnit ["B_Pilot_F", [0, 0, 0], [], 0, "CAN_COLLIDE"];
_pilotGroup move _planeEndPos;
_pilot moveInDriver _plane;
_pilot setBehaviour "CARELESS";
_plane flyInHeightASL [1000, 1000, 1000];
_plane setPosASL _planeStartPos;
_plane setDir (_planeStartPos getDir _planeEndPos);
did you try it with the waypoint without the bruteforce spawn
not sure, I'll try that now
show me a vid
bruteforce was meant to be a last resort π
just imagine the plane frozen mid-air, the pilot constantly trying to fly the plane down, and the plane's dir being reset every second
nah
the plane gets created at the right altitude, then set to the right altitude, then flown at that altitude
also pretty sure the plane wasnt actually frozen at that point, but yeah
well you're flyInHeight could be wrong
what is the Z in plane's start pos?
perhaps try flyInHeight instead of flyInHeightASL as well, as flyInHeightASL has this note: Sets the minimal ASL height. Final height is flyInHeight max flyInHeightASL - the higher altitude has priority.
_plane flyInHeightASL [1000, 1000, 1000];
you might want to do that with delay
though then again it might not matter if flyInHeight is never set
1000
private _plane = createVehicle ["B_T_VTOL_01_infantry_blue_F", [0, 0, 1000], [], 0, "FLY"];
_plane setDir (_planeStartPos getDir _planeEndPos);
private _pilotGroup = createGroup blufor;
_pilotGroup deleteGroupWhenEmpty true;
private _pilot = _pilotGroup createUnit ["B_Pilot_F", [0, 0, 0], [], 0, "CAN_COLLIDE"];
_pilotGroup addWaypoint [_planeEndPos, -1];
_pilot moveInDriver _plane;
_pilot setBehaviour "CARELESS";
[_plane, _planeStartPos, _planeEndPos] spawn {
params ["_plane", "_planeStartPos", "_planeEndPos"];
sleep 1;
_plane flyInHeightASL [_planeStartPos#2, _planeStartPos#2, _planeStartPos#2];
_plane setPosASL _planeStartPos;
_plane setDir (_planeStartPos getDir _planeEndPos);
};
_plane setPosASL _planeStartPos;
@past wagon try that ^
what does the #2 do?
select 2
it's older
because select has alternate syntaxes as well
# is newer and not known by many
yea
and also has different operator priority
...precedence
that's the word I'm looking for
yeah ima start using that now, much cleaner
yeah I read about that
select is mainly still useful in that it allows for selecting ranges and filtering
which # does not
and iirc # isn't compatible with bools like select is
so no using it for compact if statements
okay so for some reason the plane is starting like 100m higher than the startPos Z, so it is flying down at the start. I think this is because of "FLY" in createVehicle. Second, it is still switching direction and moving off the path, which I cant have even a little bit
yeah
I'm gonna go back to setVelocityTransformation for now, because I got that working a lot better than it was before, without the pilot
so now I have a question about that one. can you create it locally?
the vehicle?
yes
well, the vehicle is used to transport all the players on the server at once
I'm currently doing that on the server, not sure what doing that locally would look like, or if I even could
well each player would be in their own local vehicle
yeah I couldnt do that lol
not sure if they would disappear tho
oh
well all the players need to be taken across the same flight path at the same time
there would be a boom I think
so the vehicle dont exit for the other players?
yeah, I feel like it would mess up the mission a bit
I mean, I like the players being able to see each other inside the vehicle, it would be weird if they couldnt
well you never know unless you try

floating through the air?
lmfao
so it looks like they're actually in your plane
assuming they're synced well enough it should look normal-ish...
would it be synced that well tho?
I mean it comes down to what you care about more
^
the plane being smooth or players being smooth
is there really no way to just get a normal plane flight for all players across the map in a straight line?
arma has a wonderful way of making seemingly simple goals very hard to accomplish
a bitter pill to swallow
doMove on the pilot doesn't work?
uh
try this:
private _plane = "B_T_VTOL_01_infantry_blue_F" createVehicleLocal _planeStartPos;
_plane setVehiclePosition [[0, 0, 1000], [], 0, "FLY"];
clearItemCargoGlobal _plane;
clearBackpackCargoGlobal _plane;
_plane setPosASL _planeStartPos;
private _startTime = serverTime;
addMissionEventHandler ["EachFrame", {
_thisArgs params ["_plane", "_planeStartPos", "_planeEndPos", "_startTime"];
private _vectorDir = _planeStartPos vectorFromTo _planeEndPos;
if (_vectorDir vectorCos (getPosASL _plane vectorFromTo _planeEndPos) <= 0) exitWith {
removeMissionEventHandler ["EachFrame", _thisEventHandler];
};
private _vectorUp = _vectorDir vectorCrossProduct [0, 0, 1] vectorCrossProduct _vectorDir;
private _velocity = _vectorDir vectorMultiply 100;
private _distance = _planeStartPos vectorDistance _planeEndPos;
private _interval = (time - _startTime) / (_distance / 100);
_plane setVelocityTransformation [
_planeStartPos,
_planeEndPos,
_velocity,
_velocity,
_vectorDir,
_vectorDir,
_vectorUp,
_vectorUp,
_interval
];
}, [_plane, _planeStartPos, _planeEndPos, _startTime]];
I don't think trying to get an AI pilot to fly a plane on a perfectly straight path for several kilometers will ever work
this is local btw
should be done in initPlayerLocal.sqf
I did it with a helicopter in my mission
like, it didnt deviate from the path even 5 meters?
no afaik I set the direction and velocity and it continued on the path
hmm
did you get it to sync well in MP though 
clearly the solution here is to hide all of the other players and make local object clones of them to sit in the local plane π
yeah the other player is like 100m in front of the plane and this is over LAN
actually I used serverTime
which is wrong 
also the plane just looks buggy in general, the wheels keep appearing and disappearing
it doesn't give the mission start time 
setVelocityTransformation is about the best solution possible
the limits of MP sync are fairly fundamentally unavoidable
you didn't add an AI to it again right?
no
okay, now I have a bit of a predicament. I am using the following code without a pilot, and the plane essentially looks fine:
private _plane = createVehicle ["B_T_VTOL_01_infantry_blue_F", [0, 0, 1000], [], 0, "FLY"];
clearItemCargoGlobal _plane;
clearBackpackCargoGlobal _plane;
_plane setPos _planeStartPos;
_plane lock 2;
private _startTime = time;
addMissionEventHandler ["EachFrame", {
_thisArgs params ["_plane", "_planeStartPos", "_planeEndPos", "_startTime"];
private _vectorDir = _planeStartPos vectorFromTo _planeEndPos;
if (_vectorDir vectorCos (getPosASL _plane vectorFromTo _planeEndPos) <= 0) exitWith {
removeMissionEventHandler ["EachFrame", _thisEventHandler];
};
private _vectorUp = _vectorDir vectorCrossProduct [0, 0, 1] vectorCrossProduct _vectorDir;
private _velocity = _vectorDir vectorMultiply 100;
private _distance = _planeStartPos vectorDistance _planeEndPos;
private _interval = (time - _startTime) / (_distance / 100);
_plane setVelocityTransformation [
_planeStartPos,
_planeEndPos,
_velocity,
_velocity,
_vectorDir,
_vectorDir,
_vectorUp,
_vectorUp,
_interval
];
}, [_plane, _planeStartPos, _planeEndPos, _startTime]];
```However, I need a pilot in order to do this code:
```sqf
_pilot action ["VTOLVectoring", _plane];
for "_i" from 1 to 3 do {
_pilot action ["VectoringDown", _plane];
};
```The problem is, even when I disable the pilot's AI, it still has the wobbly effect on the plane.
could just briefly spawn a temporary pilot
I also tried doing this:
[_pilot] spawn {
sleep 5;
deleteVehicle _pilot;
};
```but the pilot doesnt get deleted for some reason
oh
haha
lol
yeah, it works
I hope none of my players notice that there is nobody flying the plane
doing
_pilot disableAI "all";
didn't stop it from messing up the movement?
nope
Hi, I'm currently having issues with getMissionPath-Command. Although the mission I'm using is packed as a PBO and has a custom name, all paths returned refer to mpmissions/__cur_mp.altis. Is there anything I'm missing here? As a side note: this is a MP mission tested on a locally hosted dedicated server instance. Thought I might ask here before opening a ticket on the feedback tracker...
afaik that's the path extracted to the local app data of Arma 3
but it should work nonetheless
or do you mean that the paths are not correct when returned like that?
Is there a way to use Cruise Control on AI? Iβm trying to do a parade
you can use setDriveOnPath
limitSpeed is fine too.
Ok, thanks
I use limitSpeed to control convoy spacing, works surprisingly well.
Hi. I can't to add Mission EH EntityCreated. This code generates error:
addMissionEventHandler ["EntityCreated", {
params ["_entity"];
}];
17:12:48 Error in expression <addMissionEventHandler ["EntityCreated",>
17:12:48 Error position: <addMissionEventHandler ["EntityCreated",>
17:12:48 Error ΠΠ½Π΅ΡΠ½ΡΡ ΠΎΡΠΈΠ±ΠΊΠ°: Unknown enum value: "EntityCreated"
I'm pretty sure EntityCreated doesn't exist until the next update
Oh. Yes, i see we have 2.08 for now π
2.10 is expected to land in mid to late August
yes.
in 3den it works fine, but for the MP dedicated server mission it returns mpmissions\__cur_mp.altis instead of mpmissions\mymission.altis and I can't seem to find a reason
is there an easy way of making particles like the enfusion workbench for arma 3? or do i have to change a particle array manually until its better?
There's a mod called...Particle 3ditor, I think? Something like that. It has a UI for making particle effects (out of existing components and properties) and shows the effect live in the editor. I've found it to be a little unstable but the live preview is useful.
I've got a feeling that is correct and that's just how DS handles the current mission. That path should still lead to the right files so it shouldn't break anything (source: have used that command on DS without problems)
If you need to display the file name for some reason you could try missionName or missionNameSource.
it is definitely not correct that's the problem.
Arma saves mission files in mpmissions with the same name the PBO has on the server side. __cur_mp.altis is the filename, if the mission is provided as a directory instead of PBO. so effectively it points to the wrong file. to make matters worse, even replacing __cur_mp with a copy of my mission file did not yield results that's why I'm thinking this might be an issue with the command itself
So I'm pretty sure now, that this is broken. I checked again and it works in singleplayer and hosted MP, dedicated MP however seems to break it. I'm going to head over to the feedback tracker for this. thanks for the input π
Is there any reason that the below script would cause issues on a dedicated server, being executed from a trigger?
call{{_x setdammage 0; _x setfuel 1; _x setVehicleAmmo 1; _x call ace_medical_treatment_fnc_fullHeal;} forEach thislist;}
Activation requirements are Any Player Present, repeatable, 60/60/60 Timeout timer
issues as?
Any, I'm just curious if I've made any errors in the way it's written.
Basically I want it set up such that if someone drives a vehicle in, it'll completely repair, refuel and rearm said vehicle, as well as healing anybody in the trigger using ACE's full heal function.
well, ask if it would cause issues then! π
check locality for commands/functions, also check if the trigger is server-only
and remove that useless call {} wrap
also setDamage hahaha
Does call actually do anything beyond change scope?
What I meant is that if you use that path as the path to a picture for example, is the path invalid?
If it's not then there's nothing wrong there
call{{_x setdammage 0; _x setfuel 1; _x setVehicleAmmo 1; _x call ace_medical_treatment_fnc_fullHeal;} forEach thislist;} would be redundant because it's already running unscheduled as far as I know
Call doesn't run unscheduled
No, and no
idk what you mean by is blocking
Adds given set of compiled instructions to the current stack and waits for it to finish and return, provides an option to pass arguments to the executed Code. See Scheduler to learn more about how the code is excuted and behaves.
Are you seriously showing me a wiki page?!
?
Like I said, call doesn't run unscheduled
It just executes the code
Only referring to what was said there...
When i said blocking meaning it waits for a return before proceeding.
"Adds given set of instructions to the stack and waits for it to finish and return" Is the wiki wrong?
...
The problem is the word wait. There's no waiting
When you write: if (condition) then code, do you "wait"?
Call is the same thing
Why do so many scripting commands do redundant things...
I didn't say it's redundant. I just don't like using the word wait here
If no return type is specified will call lock up a script?
It always "locks it up", regardless of return
It always "waits" for it to finish
You just said it didn't...
regardless
I meant using the word wait is wrong here. That's all
It just runs sequentially
What's there to wait for?
basically:
call is just like copy-pasting code at its location, that's it
so it has to process the code before jumping to the rest
no returns? no problem.
Still vague...
I guess the problem is you're thinking of sqf like other languages
It's kinda unique in some ways tho
You can't compare everything
So am I right to assume under the hood everything is a bowl of spaghetti?
I wish the Java programming project BI was working on was actually done...
If you get what a "code" in sqf is it will make sense
Again:
if (true) then {...};
// Or
if (true) then my_function
Is the same as:
call {...};
// Or
call my_function
Okay. Lets go a bit more in depth? Are even control structures commands?
And what is compiled code according to arma?
Is it bytecode?
Afaik yes
Yes
if is a unary command
If BOOL, and returns IF
then is binary, IF then CODE, and returns whatever the code returns (if the condition was true)
and yes
I've seen a tool being used around
called ArmAcriptCompiler.exe ?
Is that just translating to raw byte code?
and the VM just executes it without any care?
that's translating to bytecode, and the engine translates bytecode to whatever internal structure it uses for the instructions and what not
call creates a scope and runs some code, whatever is left on the stack is pushed back onto calling scope's stack(call command's return value, literally like any other command), call is blocking yes, but blocking in it's actual context, not entire scriptvm, if you use scheduled code for example
and that "pushing back" behavior appears pretty much everywhere, do, then forEach and other commands
and no there are no control structures,
_alive = alive player;
_if = if _alive;
_else = [{"alive"}, {"dead"}];
hint (_if then _else);
is valid
Never thought about it π€£ Looks cursed
looks cursed? it absolutely is
thanks for the nightmares sharp. π
it is, that's the point
can you somehow remove player from the slot in the lobby?
not afaik
hmm except via kick I guess
that would be considered rude
But rule might be rude
On the off chance anyone here knows, for those of you familiar with the ALiVE framework and its Virtual AI system, is there a way to set it up such that vehicles will devirtualize further away than infantry (as standard and set by the Virtual AI module)?
Thanks, will take a look at that now. Out of curiosity, is the cooldown on the backpack being moved or just using the action itself? Ie will trying to hit it when enemies are nearby cause it to "eat" the cooldown?
when the movement is done
you should also add a check for screenToWorld return value - if someone looks at the sky, you will get an error
also, the person could use binoculars and put the respawn point 5km away
Cool, thanks. I'll have a look at getting it into the mission and see how it goes.
21:54:47 Error in expression <markerName];
private _actionId = _unit addAction ["Place Rally Point", {
params>
21:54:47 Error position: <addAction ["Place Rally Point", {
params>
21:54:47 Error Type String, expected Bool
21:54:47 File C:\Users\Jesse\Documents\Arma 3 - Other Profiles\Fuzzle\mpmissions\Eisenwand1.WL_Rosche\onPlayerRespawn.sqf..., line 12```
stop breaking my code
Forgive me, my copy paste skills are clearly not sufficient
at least I fixed the _unit β _target thing
ah yes
forgot a nil, before 1.5,
@quiet geyser while I'm at it, wanna set a max distance from leader?
like, can't place the spawn 200m away
No that's all good, the primary purpose of this is so that a squad leader can place a rally point in a secure point before their element assaults through a town/objective etc. So making it so that you need to be within x distance to respawn would potentially break things on larger urban objectives.
no no, I mean
your code says "if there are no enemies around the leader then place the spawn point wherever you want" (a.k.a 10km away, right in the middle of enemies, etc)
oh wait, you mean so that when you're placing it, the point it's getting placed needs to be within x distance of the guy placing it?
think of it as a limitation on the length of the squad leader's arms
yeah, kinda π
oh yeah if you know a good way to do it I'll take it; placing within like 5 meters would be fine
"hey, I'm in a safe place - let's put the spawn point in that enemy camp I see on the hill through my binoculars"
would that please you?
https://sqfbin.com/owodoyiqirujaqiniqac
one could also add the cooldown timer in the action but that should be good for now ^^
I have a local version where the action doesn't appear if the location is too far away, wanna?
There is exactly one other thing that could improve it, and make it exactly like Project Reality's rally point system which was sort of the goal: is there any way to make it check if there are group members within a certain distance? Ideally I'd like it to require at least 1 other group member (not including the squad leader) within 10 meters.
If you can get that working, you should seriously publish the script online as I know tons of people love the PR spawn system, and a rally point system that works like this is dead-on.
Nah as it is works great.
check if there are group members within a certain distance? Ideally I'd like it to require at least 1 other group member (not including the squad leader) within 10 meters.
gimme 5
5... I gave it you!
if you want to prevent the guy moving the spawn point by 1m
oh right, nice.
I wanted to set it to e.g 200m, but I thought "what if the pole is misplaced and the person just wants to put it e.g behind that building"
I could also add another parameter to decide how many group members should be there (1, 5, 500)
Yeah honestly just having it as a control for misclicking the scroll menu right next to the previous one is good.
Apparently there are words I thought were benign that are not benign, learning experience.
Anyway, this sounds good
how so? (sounds good as in "yeah add it?")
Yes, sounds good as in the affirmative, get it in there
I also didn't get
there are words I thought were benign that are not benign, learning experience.
?
I tried to type shorter-word-for-overweight-fingered rather than misclick and got a finger-wag from the server
oh. yyyeah, I got a 1 min cooldown myself for explaining a word I did ***star out
But yeah, that aside, a parameter to set how many people need to be nearby sounds good π
oooh, a bug
15:15:03 [GERSL1,"< 1"]
15:15:03 Unknown attribute itemsCmd
15:15:03 Unknown attribute itemsCmd
15:15:03 [B Alpha 1-1:2,"< 1"]
15:15:03 Error in expression <) then
{
diag_log [_this, "< 1"];
_this setUserActionText [_this getVariable "FU>
when selecting another unit (via F2) while the action is up
or "hidden feature", at least
it seems that _this (in addAction's condition) changes depending on who is selected π€¨ π
https://sqfbin.com/pigusaxatibeviwaviki β viki, it's a sign!
Very lovely work. I won't be able to test the group member additions until tomorrow, but thank you very much for all of your work. Like I said, you should really post this script up somewhere. I can think of a ton of people who would want to use it.
well, I don't know of any public SQF scripts library so far but maybe one day π feel free to share to lovely people needing it
Excellent work again. Cheers, and I'll let you know if there's any issues with it in a live server environment tomorrow
Customer Service ready for action, sir!
Is there any scripting function that overwrites the vehicle config value of armor? I just found setVehicleArmor but it's just like setDamage
no
couldnt you just use set object scale on a smaller vic and then detect when its dead then create a satchel charge and blow it up? i know it's be a bit of work but it might work
Hii, guys can you help me with something?
Basically I need this to work on server, it works on AI unit in singeplayer but im not sure how to implement it on dedicated server.. I need a unit to be just bigger, thats all.
[] spawn {
while {alive dude1} do {
dude1 setObjectScale 0.3;
};
};
don't
https://community.bistudio.com/wiki/setObjectScale
Setting the scale of non-simple objects, such as vehicles with players/AI in them, static objects (simulation = "house" in config), etc. might be possible, but not officially supported. You may encounter issues.
see notes (performance would be awful)
Thanks for the info. I would like to try it anyway to see the results.. But no matter how I try to do it on the server the size does not change. It does change while I am in singleplayer tho.
setObjectScale requires local arguments so you need to make sure it's executed where the affected unit is local (or possibly even everywhere since its behaviour may not be normal)
on each frame as well not just in a while loop
see notes
:-)
those were clearly written just to be skimmed over and ignored
I am back with another question!
disableAI https://community.bistudio.com/wiki/disableAI - If the unit changes locality, this command might need to be executed again at the new locality to maintain effect.
Is there a way to detect if locality has changed?
Is all AI by default "owned" by the server? Once a player joins and "takes over", is that unit owned by the player? If this player leaves, is the unit (AI) owned by the server again?
I've got this script
{
_x disableAI "AUTOTARGET";
_x disableAI "TARGET";
_x disableAI "FSM";
_x disableAI "MOVE";
_x stop true;
_x setBehaviour "CARELESS";
_x allowFleeing 0;
_x disableConversation true;
_x setVariable ["BIS_noCoreConversations", false];
_x setSpeaker "NoVoice";
} forEach playableUnits;
Do I just run it once on mission start, or do I also need to create a handler for HandleDisconnect and run it again with the unit as a parameter?
So far it never worked 100%, so any insight into this is really welcome!
there is a "local" EH
So running this on mission start and then every time the Local event get's fired should get the job done?
(AI should just stand still, if player disconnects, the AI should just "freeze")
TBH I am not sure about
If the unit changes locality, this command might need to be executed again at the new locality to maintain effect.
it might be that the command only works where it has been applied when the object is local
but again, it might also be "the command is ignored if the object is not local", too.
Well, the Local event handler might help me, thank you!
Will experiment with it a little more
good luck!
[_unit, false] remoteExec ["allowDamage", _unit];
_unit setVariable ["ILBI_allowDamage", false, true];
and in the local EH, get that variable to see if true or false?
Thanks man, I'll report back with either broken framework, or a thank you note
hehe noice! GL
I have an addAction that when triggered, runs a script with execVM. Inside the script, I run setDamage [1, false]; on a vehicle. But this doesn't work for some reason. The line is executing, the vehicle is valid and alive, but the setDamage doesn't work. If I run it from the command console, it works. Do anyone know why could this be happening?
this is the script:
params["_veh"];
if (isNil "_veh") exitWith {};
_isDeployed = _veh getVariable ["deployed", false];
_isAlive = alive _veh;
if (!_isDeployed) then {
if (alive _veh) then {
_veh setDamage [1, false];
hint "RESPAWNING";
};
}
else
{
hint "VEHICLE IS DEPLOYED. CAN'T RESPAWN";
};
the hint "RESPAWNING" is displayed, but the vehicle doesn't take any damage
setDamage has global params and effect, so it shouldn't be necessary to do remoteExec. I also tried to do remoteExec on the server but didn't work
can you try to remote execute it where the vehicle is local and report please?
[_veh, [1, false]] remoteExec ["setDamage", _veh];
Hmm didn't work. I still get the hint, but it's not applying damage. I tried with a different vehicle placed in the editor, and it didn't work either.
if it helps, this is what's in the init field of the object that has the action:
call{
this addAction [["<t color='#FF0000'>", "RESPAWN MHQ", "</t>"] joinString "","scripts\respawnMHQ.sqf", [mhqv1], 1.5, true, true, "", "true", 10];
}
what if you set it to true?
Are you definitely looking at the right vehicle? I know you've checked that the vehicle is valid, but is it the one you're looking at when you test or might there be a similar one elsewhere you've got mixed up with?
oh I think I found the problem
addAction sends 4 params to the script, the fourth one is the custom arguments
I was trying to kill the object that has the action
yep, that was the problem. Thanks ppl
What is the best way to spawn a while loop in a mod not mission? I currently have my script setup to execvm 3 scripts inside the XEH_postInit but I feel like its not starting up correctly or something. The first execvm starts up, but the others sometimes does not I feel. My while loops work correctly when I run them in debug console but seems to not startup correctly on mission boot or something.
Hey guys, does anyone have the python code with opencv to plot the Armas 3 boundingbox in the image (print)?
sometimes does not
then the problem is the loop itself
well I debug the loop and every condition fires true
when I run the whole loop in debug it runs correctly
so idk if the mod is firing the script up correctly
mods don't do anything special
so either your postInit EHs are wrong, or the loops themselves
if !(hasInterface) exitWith {};
_handle1 = execVM '\KPP_RadiationSystem_indev\functions\radscore\KPP_RadiationCore.sqf';
_handle2 = execVM '\KPP_RadiationSystem_indev\functions\radscore\KPP_GeigerTicks.sqf';
_handle3 = execVM '\KPP_RadiationSystem_indev\functions\radscore\KPP_WarningBeeps.sqf';
here is what is in my postInit
RadCore works correctly all the time
but the other two seem to not start up all the time
what do they contain?
I mean I want to see the actual codes
while {radSystemToggle && KPP_Boolean_GeigerCounterWarningBeep && {"KPP_GeigerCounter" in items player}} do {
if (KPP_Float_RadsValue >= KPP_Int_GeigerCounterWarningBeepThreshold) then {
playSound "warning_beep";
sleep 4.5;
} else {
sleep 4.5;
};
};
beeps
while {radSystemToggle && KPP_Boolean_GeigerCounterTicks && KPP_Float_AreaRads >= RadiationValueLight && {!isNil {radObjects select 0} && {"KPP_GeigerCounter" in items player}}} do {
private _sndList = selectRandom [
"geiger_1",
"geiger_2",
"geiger_3",
"geiger_4",
"geiger_5",
"geiger_6"
];
switch (true) do {
case (KPP_Float_AreaRads == RadiationValueHigh): {
playSound "geiger_long";
sleep 6.05;
};
case (KPP_Float_AreaRads == RadiationValueMedium): {
playSound _sndList;
sleep (random [0.01, 0.05, 2]);
};
case (KPP_Float_AreaRads == RadiationValueLight): {
playSound _sndList;
sleep (random [0.01, 0.5, 2]);
};
};
};
``` ticks
have you defined radSystemToggle and KPP_Boolean_GeigerCounterWarningBeep?
yeah
hence the condition saying its true
where did you define them?
XEH_PostInit
you mean above these?
well for one thing, postInit is scheduled, so it MUST be above it
for the other:
"KPP_GeigerCounter" in items player
there may not even be a player
your while loop starts working if you switch to another player for example
when I drop the item the condition fires false, when I pick it up true
my point is that your while loop is not persistent
as soon as it's false, it completely stops
let's say I drop and pick up the item
the loop will never start again
it updates correctly when the loop is active
issue is think the loop isnt starting up sometimes cause of how im trying to start it or something
meh just go try it for yourself in debug console to see what I mean...
I have, thats how I confirm the loop works
so the loop magically starts working after you drop and pick up the item?!
yeah
well no
it stops when I drop it
the behavior I want
and starts when I pick it up
wait at least 5 seconds
you'll see what I mean
i've only noticed this issues as when I sent the mod to my friend he had the issue of the loops not working
then when he restart the mission to stream and show me it started working all of a sudden
it will never start again, unless you have an event handler that controls when to start the loop somewhere
Well if that is the case truely what event handler would I need to reduce/fix the issue?
how does this even handler apply when the unit spawns with the item?
Oh ok I found something interesting
decided to actually use that diag_activeSQFScripts command and found out that geigerticks is actually not running
warningbeeps and core are.
which explains why those two seems to always works fine expect ticks
Anybody got a working flak script that will work on any AA?
strange I think I figured it out
I reduced the amount of stuff being checked in the while condition and it works perfectly now on every startup
I guess while has a limit on what or how much it can check
I told you why
you have several conditions. if one of them is not true then the while loop stops
and you never restart it, because there is nothing to restart it in your code
and here was another example
you could easily break it by testing it like that
how would you filter out weapon classnames that aren't weapons? like how would I filter out binocs and such
Ok yeah I tested it better by not spawning with the Geiger on, now I see what you mean.
binocs are weapons tho 
anyway, using its type
yeah I mean like, things that don't fire things like. bullets or grenades or so on
I could always check its ammo + simtype
@little raptor do you mean the 'type' config entry?
yes
is there an explanation of how that works
Β―_(γ)_/Β―
lmao

well 1 is primary
2 is handgun
4 is launcher
and some large number is vehicle weapon
probably 65536
π
plz fill a bit :3
I don't know what Type=WeaponHardMounted is supposed to mean 
come to my room, I'll show you π
Is there any command to check if player sees some object (maybe it's tied to raycasting, so command to cast ray from player's eyes to to object and see if intersects anything)?
lineIntersectsSurfaces
or lineIntersects
or checkVisibility
it already exists at the top:
ah, noice! *unlocks the door* you're free then π
btw how did you hashlink within a page? iirc there was a short syntax?
it doesn't support showing a text instead right?
Note to self: do not spend days trying to debug MP performance issues only to find out that they were caused by my friend setting a projectile's speed to the literal speed of light
Interestingly enough it didn't cause any performance drop in SP... somehow
fun. I wonder if object update rate is scaled proportionally to velocity or something.
I'm sure the network loved needing to update its position by 300,000,000 meters every second
What's the difference between unitBackpack and backpackContainer, if any?
apparently none according to ffur2007slx2_5's note on https://community.bistudio.com/wiki/unitBackpack
Yes, but that's from 2014 so I was just wondering if anything might have changed.
is it possible to get cutText on the top of the screen rather than center or below
Is there a Discord specifically for ACE3? If not, may I ask a scripting question here about it?
Yes, and yes anyways https://discord.com/invite/FVkgwggNcZ
Thank you π It's a fairly simple question...
I want to call ace_medical_fnc_addDamageToUnit which simply takes "Damage" as a number as one of its parameters. But I can't find anywhere what the acceptable "range" of damage should be. Is it 0 to 1? 0 to infinity? I just want to avoid values that would constitute instant death, but there doesn't seem to be any documentation I can find or helpful comments in the source code that would hint at what a sensible number would be.
I would think the quickest way would be try-it-and-see.
I'm gonna guess it's the same scale as Arma damage values, so roughly 0-1 but potentially larger for headshots etc.
Gives me a start. TYVM
Bear in mind that with ACE, a small bruise can cause death under the wrong circumstances.
(typically when someone was bandaged up but not stitched)
What is the threshold for death with ACE btw? I always thought it was just too little blood or a stopped heart for too long, but is it more complicated than that?
see cba settings for that
you can adjust it in addon options
most stuff in ace can be tweaked on your end
including causes of death
@winter rose so, a couple of small bugs I've noticed (can work around them but fixing is obviously better) with the rally point script:
There's a noticeable (roughly 5 second) delay on the object being moved. This may be because the server was under heavy load, and isn't a huge issue.
This one is more important. For whatever reason, after deploying the rally point once, the marker doesn't move, then when you deploy it again, it moves to the previous position. From that point onwards, it's always one "placement" behind where you want it.
How can i perform helicopter to land?
AI looks so buggy and don't landing after reaching waypoint.
Im spawn helicopter and create vehicle crew
private _airVehicle = createVehicle [(selectRandom _helicoperClasses), getMarkerPos _spawnMarker, [], 0, "NONE"];
private _airCrew = createVehicleCrew _airVehicle;
After im create check for spawn and initialize
waitUntil {!isNull _airCrew && !isNull _airVehicle};
Create cargo group and push into group (and vehicle) units
private _landSoldiersGroup = createGroup [West, true];
private _squadLeader = _landSoldiersGroup createUnit [_squadLeaderClass, getMarkerPos _spawnMarker, [_spawnMarker], 10, "NONE"];
_squadLeader moveInCargo _airVehicle;
After that im set destination via
private _reinforcementsOffest = _reinforcementsPosition getPos [(random [100, 150, 200]), random 360];
private _landPos = [_reinforcementsOffest, 1, 500, 15, 0, 30, 0] call BIS_fnc_findSafePos;
private _landPad = createVehicle ["Land_HelipadEmpty_F", _landpos, [], 0, "NONE"];
_airCrew move _landpos;
And set land command where this heli is near of position
while {uiSleep 1; !(isTouchingGround _airVehicle) || !(alive _airVehicle || !isNull _airVehicle) || (count (units _airCrew select {alive _x}) == 0) || ((count (units _landSoldiersGroup select {alive _x}) == 0))} do {
_airVehicle land "GET OUT"; // "LAND"
};
But heli didn't land π¦
P.S This is part of script (full script contains much more lines)
@warm hedge Goal is the spawn rain puddles, as well as create a realistic looking rainfall particle effect coming off roofs
try using transport unload waypoint
The Nimitz has a fairly complex init script system where the sub-systems are spawned dynamically and arranged on the carrier. Now if I try to spawn the Nimitz via Zeus on a dedicated server the server crashes with dump files generated. I see 12:05:47 Ref to nonnetwork object 4bf48100# 166167: empty.p3d REMOTE as last message from default_init.sqf for the in-mission init script. I suspect the complete script is broken as somehow the locality of a Zeus spawned entity is not the server, or? I added _nimitz setOwner 2; to the init script, but that probably does not work from init?
Im found reason. HC
Anyone with experience building extensions?
I am building a super-simple extension (just copying the example on biStudio.com)
However I am getting this error message:
Trying to load a x86 DLL 'C:\<CENSORED>\@MyExtension\dllExtensionTry_x64.dll' from a 64-bit executable
Any help anyone?
did you compile it as 64bit extension?
which make system do you use?
Visual studio 2019
quick google pointed to: https://docs.microsoft.com/en-us/answers/questions/258041/how-to-make-a-64-bit-c-dll.html
Microsoft Q&A is the best place to get answers to all your technical questions on Microsoft products and services. Community. Forum.
reading..
thank you btw!
I used duck duck go, didnt get a decent result
@little raptor Nice to see ur still alive, the doc did not help much...
Since you bothered enough to react I guess you want to help?
I am building it in C#,
The page I got here refers to c++, which might be why I cannot see the options that they referred to in the article.
I already went trough:
https://stackoverflow.com/questions/1159161/how-to-compile-a-64-bits-version-of-my-dll
&&
https://stackoverflow.com/questions/50164687/how-to-compile-a-64-bit-dll-written-in-c
that's⦠odd
if you see the code, it can hardly do that - are you sure that the variables and marker names are set properly in the array?
Regarding the delay, I call heavy load, indeed Oo
@rough summit I would recommend you to create a simpler test mission with only your helicopter and the commands you use on it
if it works there, then something in your main mission interferes with it
if it doesn't, the failure is easier to find with 2 units and 20 lines of code instead of 30Γ this π
I have an Eden mod with the following expression:
expression = "[_this] execVM 'test.sqf';";
``` and the following test.sqf:
```sqf
params ["_box"];
[_box, ["Test Action", {hint "Hello World";}]] remoteExecCall ["addAction", 0, _box];
``` but on the connecting player I get two addActions?
the expression is only evaluated on the server afaik
-0 :-)
params ["_box"];
[_box, ["Test Action", {hint "Hello World";}]] remoteExecCall ["addAction", 0, _box];
The 0 says that all machines should run this code, in order to run it on the server only use 2, the last param is for JIP (default false)
[_box, ["Test Action", {hint "Hello World";}]] remoteExecCall ["addAction", 2];
or
[_box, ["Test Action", {hint "Hello World";}]] remoteExecCall ["addAction", 0];
no, - 0 is 0
oh
the issue comes from running it from the init
the init runs for the server and for every client, including JIP
If you go to project properties you should see the option
'tis not the init. it's the expression from https://community.bistudio.com/wiki/Eden_Editor:_Configuring_Attributes#Entity
well it might be the same
// Expression called when applying the attribute in Eden and at the scenario start
// The expression is called twice - first for data validation, and second for actual saving
// Entity is passed as _this, value is passed as _value
// %s is replaced by attribute config name. It can be used only once in the expression
// In MP scenario, the expression is called only on server.
I am and I see:
Application
Build
Build Events
Debug
Resources
Services
Settings
Reference Paths
Signing
Code Analysis
And I've looked trough every single option Not finding any option to set it to x64
called twice? π€
only in Eden i think
would also not explain why the server does not get two actions (hosted mp)
Yep, they're definitely all implemented as you said to, and the markers and variable names match ingame.
Unfortunately I am not able to send screenshots here or I would sho you.
I am on that page and just do not get the same option
I summon @cosmic lichen, your only hope
And you are getting these options with a C# class library project?
ofc yes 
Well... I am not...
maybe you haven't installed the necessary .NET frameworks 
hmm... I'll check...
@somber radish
Right click on the project and go to properties. Choose the Application tab and, on the right side, you have an option called Output Type. You can choose whatever you want; for example, if you want your project to emit a DLL, just choose Class Library.
From: https://stackoverflow.com/questions/56044025/visual-studio-2019-exports-c-sharp-program-as-dll-instead-of-exe
(Simple fix, use C++, C++ masterrace
)
(In case your add-on/extension becomes popular, you're making the life living hell for Linux admins
)
Oh I am getting the dll, no worries, the problem is that it is in x86 not x64 which is what I need for Arma 3.
And I am just a lowly highlevel peasant lol
I fount solution for this problem. Headless client after syncing termiante all waypoints and orders, wiΡh script give to the crew group.
But thanks for attention anyway
indeed, that's quite some intricate setup - cool you found!
Here's the code btw, haven't changed much other than the hints.
https://sqfbin.com/ewuvomoqimigeqisuzor
I checked all the variable names as well, they seem like they line up fine. I doubt those would be it as the respawn_west markers were moving, just one jump behind the bag
Actually, just occurred to me: the delay is what's screwing it. Is there any chance I could trouble you to set the marker move to be after the bag, with a delay of 10 seconds?
To be clear, by bag, I'm referring to the object. We're using a backpack heap for the object lol
have you disabled the simulation on the "rally point" objects?
No. The issue is just that when there's high load on the server, the script is a bit delayed.
high load on the server or clients?
did you check diag_activeScripts on the clients?
High load on both. All that needs to move here is the segment of the script which moves the respawn_west markers.
the only thing I can think of is that the object doesn't get moved instantly because it's not local to the clients
you're trying to fetch the rally point's position and set it on the marker, while it may not have moved at all yet (as you said it yourself, it happens with a 5s delay)
just use the position you set on the rally
_rallyPoint setVehiclePosition [_pos, [], 0, "NONE"];
_markerName setMarkerPos _pos;
_pos set [2, 0]; // on the floor
_pos is always "on the floor"
what you guys think about first calling endMission on client that's been idling for too long and then after few secs kick him? So that the player slot is freed. This is the best I come up with so far.
endmission so that client sees the reason for the kick
I'm honestly going to wait for @winter rose's input on this as it's his script and a lot of that goes over my head
even if you aim at a wall?
anyone know why this works with owner but not with ID? _pw serverCommand format["#exec ban %1", owner _plr];
tried getPlayerUID & getPlayerID
does ban take uid?
i tried getPlayerUID
that's not my question
sorry did not understand the question then ;D
according to the wiki it can take "#exec ban nickName" or "#exec ban 47114712" etc
and all your answers shalt be found
Ah I was missing quotes . works now! thx!
Yes
screenToWorld doesn't detect the "wall" anyway
Only terrain
Not sure about water tho
iirc ignored
noice
I did set this as a safety, I didn't remember the behaviour
so maybe a lineIntersects check would be noice, to be "100% cool"
Any thoughts on getting around server load delay?
nope π don't get an overloaded server!
is it possible to just put a sleep delay on the marker move?
the "marker going one step later" that's weird and shouldn't happen
are you sure you did remove all your other "marker moving" scripts?
This is why it happens
the marker is setPosed before the object is due to network
try
[_spawnPoint, _posAndOtherArgs] remoteExec ["setPosStuff", _spawnPoint];
[_marker, _pos] remoteExec ["setMarkerPos", _spawnPoint];
```to sync them
where would I put that in the script?
don't copy/paste it, it's pseudocode π
@little raptor this would line them in the JIP queue and update only when it's done I believe
though⦠because of setVehiclePosition the marker won't be pinpoint on the location
This is what you had:
_rallyPoint setVehiclePosition [ASLToATL AGLToASL screenToWorld [0.5, 0.5], [], 0, "NONE"];
private _markerName = _rallyPoint getVariable "FUZ_markerName";
_markerName setMarkerPos getPosWorld _rallyPoint;
so yeah, @quiet geyser , line 52
_markerName setMarkerPos getPosWorld _rallyPoint;
// replace with
_markerName setMarkerPos _pos;
is there any invisible objects other than the helipad?
Plenty
everything with hideObject
tried that performance goes down a lot because im attaching a player to it
basically what im doing is having an area that if a player goes into it they start levitating then die
but because pub zeus restrictions
have to try attachto
then set an objects velocity
aaand⦠why do you need invisible objects for that?
so they cant see it and it is mysterious
i suppose i could try make it small with setobjectscale
what's wrong with the helipad?
no
well, the decal is, but an invisible helipad itself is in the air if you set it there π
ok thanks
What I said here was not a joke btw π
There are other invisible objects
cfg names etc?
I don't remember 
On mobile rn
ah ok dw ill find a fix
your memory is influenced by your equipment?
I don't use my memory for that stuff π
good π db exist for a reason
database's are best setup on excel change my mind
Ok for example the user texture objs
They're invisible by default
has flashbacks of his first job in IT where people transferred a 10MB xls file as client database - BY MAIL
how much therapy?
in the first two months I created on the side a db + a web interface for customer service logging (yeah, they tried to make me write on PAPER for every call) - they didn't renew my trial period, and they signed me immediately π
the real question is was this early bohemia interactive?
it was 12 years and 5 months ago π in France
An aside and unrelated to my rally point thing, having an issue where for whatever reason players that should be able to can't call in any support. Support provider modules are synced to the requester module, a HQ unit is present and being read by the modules. The link from the players who should be able to call the support are applied by a short line in their init:
[RTO,SuppReq] call BIS_fnc_addSupportLink;```
This works just fine locally, but for clients on a dedicated server it's not a fan. What's a good way around this?
run a player-hosted server? π
Yeah, performance issues would bugger that very hard. Is there a better way to apply this line on both server and clients, and make sure it applies on respawn? I would assume onPlayerRespawn.sqf is the way to do it, but I need to make ti so that it's only for certain variable names
doesn't it lack providerModule?
https://community.bistudio.com/wiki/BIS_fnc_addSupportLink
that's what SuppReq is
RTO is placeholder for a player variable name (there are a few), SuppReq is the requester module which is itself connected to the providers
[requesterUnit, requesterMod, providerMod]
I count three parameters
[RTO,SuppReq]
I count two arguments
RTOis placeholder for a player variable name
useplayerthen?
prepare for some bad formatting
ok so im getting a no ; error at _Ent = createVehicle "Land_HelipadEmpty_F" #position pos1;
pos1 is defined as an init name which i believe is global
_Ent = createVehicle "Land_HelipadEmpty_F" position pos1;
_Array1 = _Ent nearEntities ["Man", "Car", 5];
_obj1 = createVehicle "Land_HelipadEmpty_F" _Array1;
_Array1 attachTo [,_obj1 [0, 0, 0]];
_obj1 setVelocity [, 0, 0, 10];
_posATL = _Ent modelToWorld [0, 0, 10];
_ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal.p3d",16,13,2,0],"","Billboard",0.07,5,[0,0,0],[0,0,6],0,4,7.9,0.1,[0.5],[[0.251196,0.0512141,0.401182,1]],[1000],1,0,"","","",0,false,0,[[0,0,0,0]]];
_ps1 setParticleRandom [1,[2,2,2],[0,0,15],20,0,[0,0,0,0],0,0,1,0];
_ps1 setParticleCircle [0,[0,0,0]];
_ps1 setParticleFire [0,0,0];
_ps1 setDropInterval 0.01;
yep.
very, very, very first line - the rest doesn't matter.
ive had issues befor but i suppose nothing being made there could conflict
I don't know what it is supposed to mean
your issue is here
_Ent = createVehicle "Land_HelipadEmpty_F" position pos1;
also, what is pos1 exactly?
the init name of an invisible helipad
ah, ok. named like this, it could be a position, not an object
so, hint #1:
https://community.bistudio.com/wiki/createVehicle
so because both don't work, it means you don't need position? wait, what is that logic π
"your engine is dead"
"I don't need the key to start the car! I tried without earlier, it didn't start either"
sorry but no π
so, hint #1:
https://community.bistudio.com/wiki/createVehicle
i just saw r3vo's reply tbh
but my brain smol
i fail to see what is wrong is it something to do with how defined pos1?
Does that nearEntities work without you are selecting there which you want and If its empty array IT doenst work.
I had select and check so i got work my nearEntities loop work.
while {alive TAG_myObject} do {
_nearest = TAG_myObject nearEntities ["Man", 2];
if !(_nearest isEqualTo []) then {
_nearest = _nearest select 0;
if (isPlayer _nearest) then {
_nearest setPos [(getPos _nearest select 0) +10, getPos _nearest select 1, getPos _nearest select 2];
};
};
sleep 0.5;
};
hint #2
TYPE createVehicle POSITION
π
i need to put my palm through my face real quick
not stupid, but don't code when exhausted (and/or drunk π)
im 16 not drunk but tired ish
also just so no one misses it prisoner hasnt had a reply to and wasnt helping debug
I do not understand the sentence nor the issue?
It was for you, i had problem with nearEntities, i got that work Leo or Lou answered here that gives more than 1 array or nothing. So If you dont have anything what you select from array it will give error
yes
Sry my Bad english. i was answering to nucle.
I had problems with nearEntities, because it was returning more than 1 array or nothing. so i had add there !(isequal) and select 0
if the array is empty, selecting 0 will return nil, above will throw an error
so check before that if the array is empty with isEqualTo []
private _theArray = /* blablabla */
if (_theArray isEqualTo []) exitWith {};
// _theArray has content, we can work
Yeh
Whats up?
the sky
You, when I shoot you too the moon
_Array1 = _Ent nearEntities ["Man", "Car", 5];
_obj1 = createVehicle "Land_HelipadEmpty_F" _Array1;
Does this work because If there is more than 1 or 0
Just to clarify, I don't want this to apply to every single player, just the ones which have the snippet in their init. Does this achieve that?
Also, will this apply after respawn as well?
no idea!
you are not checking if there is something
also no
Ye, thats what i was trying to answer to nucle problem
this @cosmic lichen
i doubt any of the code i posted here works i post if for early debugging
it'd propably pop up with some error about not expecting an array
Target = 0?
Would there be any way to apply it to certain variable named player slots in onPlayerRespawn.sqf?
//pos1 is defined as an init name which i believe is global
_ent = "Land_HelipadEmpty_F" createVehicle getPosATL pos1;
_array1 = _ent nearEntities ["Man", "Car", 5];
if !(_array1 isEqualTo []) then {
_array1 = _array1 select 0;
_obj1 ="Land_HelipadEmpty_F" createVehicle getPosATL _array1;
_array1 attachTo [_obj1 [0, 0, 0]];
_obj1 setVelocity [0, 0, 10];
_posATL = _ent modelToWorld [0, 0, 10];
_ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal.p3d",16,13,2,0],"","Billboard",0.07,5,[0,0,0],[0,0,6],0,4,7.9,0.1,[0.5],[[0.251196,0.0512141,0.401182,1]],[1000],1,0,"","","",0,false,0,[[0,0,0,0]]];
_ps1 setParticleRandom [1,[2,2,2],[0,0,15],20,0,[0,0,0,0],0,0,1,0];
_ps1 setParticleCircle [0,[0,0,0]];
_ps1 setParticleFire [0,0,0];
_ps1 setDropInterval 0.01;
};
wait was that all my code fixed for me lol i wasnt asking for that but thanks
was more for 1 line
thanks a lot if it is
Both instances of createVehicle in that are still wrong. That's not a valid syntax
@distant oyster
yeah? isn't it already?
Yeah it turns out I'm a fucking moron and put the wrong variable name into the existing inits lmao
No need for anything complex
back to the Nimitz. When zeus spawning it on dedicated server I get the following debug output now: 18:27:09 Mission id: de2911ef5117f5467726756977dea68c22e9b513 18:27:20 "Nimitz: 4ad6c100# 166167: empty.p3d REMOTE" 18:27:20 Ref to nonnetwork object 4ad6c100# 166167: empty.p3d REMOTE I guess this means that the init script is executed with a different client id than server, e.g. the Nimitz object is Remote to the script and stuff stops working.
I'll try remoteExec the init function on the server now: // _nimitz call TTT_nimitz_fnc_defaultInit; [_nimitz] remoteExec ["TTT_nimitz_fnc_defaultInit", 2];
I've asked this in a few other places, but is anyone aware of a way to make the CAS bombing run module into requesting a gun run instead? Somewhat akin to the Zeus module.
The idea here is to have an A-10 that the player RTOs can call for pinpoint suppression, but bombing runs just aren't quite what I'm looking for. Nothing else I can find seems to help in this regard, and ideally this would still be going through the supports menu.
use cfg vehicles to get the a10 strafe
then find where the player is looking
then make a way for the player to activate it addaction if you want ot be fancy group artillery menu
create the vehicle where theyu are looking
Not sure you're following what I'm saying; I want it to go through the exsting Supports menu which you get from using the Support modules in editor. There is a way to enact a script on the spawned aircraft; was wondering if it would be possible to remove the vehicle's loadout leaving it only with guns, then forcing it to use said guns on the marked point?
There's a Zeus module, not an editor module.
check out the Unsung code, I've forked the CAS from BI and extended it for Napalm. You can restrict it to gun runs as well
Yeah on an Australian internet connection not sure I'm going to be downloading the entirety of Unsung for that one, sorry. Anything a bit more digestible you'd be able to point me towards?
my b im thinking of artillery target
copy the BI function and modify it
which function
modules_f_curator\CAS\Functions\fn_moduleCAS.sqf
Yeah looking at that now, thanks. Pretty much all of this is over my head so don't worry about it.
_weaponTypesID = _logic getvariable ["type",getnumber (configfile >> "cfgvehicles" >> typeof _logic >> "moduleCAStype")];
_weaponTypes = switch _weaponTypesID do {
case 0: {[ "vehicleweapon" ]};
case 1: {[ "rocketlauncher" ]};
case 2: {[ "vehicleweapon", "rocketlauncher" ]};
case 3: {[ "bomblauncher" ]};
case 4: {[ "missilelauncher" ]};
default {[]};
};```
gun is vehicleweapon as far as I remember
Also this still seems to be operating off the Zeus module, not the editor ones at least as far as I can tell
The existing bombing run module works fine it's just that in this use case I'd want to make the aircraft use guns instead.
you can modify the radio menu as well
but if the moduleCAS is already too tough, this might be to involved, sorry to say
couldnt he just use an ai waypoint with removeweapon?
moduleCAStype = 0 should do the trick in the module, or?
@quiet geyser this is the call napalm script from Unsung: https://sqfbin.com/zakomotucisaruwebijo you need to at least change vehicle to your plane type class and type to 0. Also uns_mbox_fnc_moduleCAS needs to be the vanilla CAS module or a copy of it, at you preference. I would use this as addAction for now and once you get it working I share the radio support menu stuff with you
Have tried implementing that as an addAction, keep getting back this error:
[BIS_fnc_moduleCAS] No weapon of types ["machinegun"] wound on 'CUP_B_A10-_DYN_USA'```
I assume "wound" there is found. What's odd is that the vehicle most definitely has a gun.
Have tried the other types (2 for guns/launcher) and they don't want to work either, it can't seem to find any weapons on the plane. When you place it by default in the editor it's absolutely stacked with munitions so I don't think it's an issue with the plane itself there.
_plane weaponsTurret [-1] should return the weapon classes
Oddly enough, I may have found a good fallback if this doesn't work. For whatever reason, the Helicopter Attack module still supports fixed wing, and basically just functions like a search and destroy directive. Means that if we can't get a targeted gun run (which is ideal) working, at least players can still call in an A-10 to hunt down some targets.
["CUP_Vacannon_GAU8_veh","CMFlareLauncher","CUP_Vmlauncher_AIM9L_veh_1Rnd","CUP_Vmlauncher_FFAR_veh","CUP_Vmlauncher_AGM65pod_veh","CUP_ALQ_131_Pseudo"]```
If you check the script TeTeT linked above, that's not something I'm defining. It's taking that (presumably a category or class of weapon) from the CAS module.
then you're looking for "vehicleweapon"?
if it's a text entry try without quotes as well
it's not looking for it verbatim, it uses https://community.bistudio.com/wiki/BIS_fnc_itemType : sqf _weapons = []; { if (tolower ((_x call bis_fnc_itemType) select 1) in _weaponTypes) then { private _firstMag = getArray(configFile >> "CfgWeapons" >> _x >> "magazines") # 0; private _ammo = getText(configFile >> "CfgMagazines" >> _firstMag >> "ammo"); private _airLock = getNumber(configFile >> "CfgAmmo" >> _ammo >> "airLock"); // ignore air to air weapons if (_airLock != 2) then { _modes = getarray (configfile >> "cfgweapons" >> _x >> "modes"); if (count _modes > 0) then { _mode = _modes select 0; if (_mode == "this") then {_mode = _x;}; _weapons set [count _weapons,[_x,_mode]]; }; }; }; } foreach (_planeClass call bis_fnc_weaponsEntityType);//getarray (_planeCfg >> "weapons");
I really think for your purpose it's much easier to fork the moduleCAS function and hardcode your cannon weaponry to it
Hi, is there a way to remove the "goggles" added automatically with the "createUnit" command ? I tried "removegoggles" but it doesn't work. I think the goggles are added after
You could wait a moment with e.g. sleep 0.1
yeah i think i will do that
How can I find the icons of vehicles for a marker? I mean the icons that are displayed on the map on allied crewed vehicles or enemy contacts, NOT the NATO icons.
I'd hazard a guess it could be found in the vehicle's cfgVehicles entry
ah yes, it's the "icon" of the cfgVehicles entry. Thanks
I guess I can't use any PAA file as marker
just fyi, the -par startup parameter is actually quite useful, i added an example to test mp missions here: https://community.bistudio.com/wiki/Startup_Parameters_Config_File#Host_and_Client
Can second -par; I've been using it on my dedicated server for a few months now. Oddly enough we actually had problems with our server provider and particular mods; had to use -par to get the commandline to read properly which was bizarre. Now we use txt file modlines for everything as it lets us change modsets really quickly.
does anybody know where the rpt is written to when you start two instances of the game without specifying the -profiles parameter?
apparently not, it only creates an rpt for the first instance
Whenever I add any Arma3Profile files to \Documents\Arma 3 - Other Profiles\User and load in game with it add of its data is reset is there any way to stop this
If you're trying to transfer them between profiles, you need to rename to match, and Arma must be shut down first.
even when my game is fully closed launcher an all if i make a new folder throw the 3 files in and launch the game the files sizes will all be reduced
set it to read only
also, not really scripting, more #arma3_questions π
Will moveInGunner work for two-seated jets? Im having difficulty with it
player moveInGunner _jet1; is the command I'm using
Depends on the plane
Its the phantom from SOG:PF
Probably moveInTurret instead
player moveInTurret [_jet1, [0]]; worked Thank you!
What is the purpose of the cross product in arma 3?
I know what the cross product is but how does arma 3 use it?
Creates a vector perpendicular to the other vectors?
Yes
Which is used to derive the Z axis?
A normal axis
Ohhh. So plane presented in Tangent space is gets the normal axis of geometry of an object like a house or car.
Namely the normal of the actual model triangle?
Or whatever it is, that must be how the eden editor snaps objects to surfaces.
What is the purpose of the SetVectorUp command?
I see it used everywhere but what does it do exactly?
Sets the up vector of the model to the vector in world
Sort of like defining the local axis in a model vs global axis?
What is the up vector?
A vector pointing to the up (+z) of the model
Ah.
I noticed a command called LinearConversion could this be used to convert my problem of 0 - 360 to a representation of 0 to 1
?
Yes
Ah ha.
Another question I am trying to find out how to create arma 3 water particles. I'm mucking around with the idea of water running off the roof of a building, how could I go about doing this?
I would just forget about it if I were you
Particles don't have collision (at least not with objects)
So to do what you want you'd need to detect the edges of the model
Which needs thousands of line intersections
Which is slow
So very computationally intensive, and the engine won't like it?
Has the Enfusion engine fixed any of that?
I saw a guy created an arma 3 script which could collide with the ground.
Water splashes.
On roads or is that a different issue?
Sure
That's easy
But you're talking about water running off a roof
It's not just a simple line intersection anymore
If you want to simulate the flow of each water drop that's still relatively easy, but again it's slow
It was more like spawning them at the edges of the building
Letting them drip off
Not making them run off a roof.
It simulates enough without being too intensive
Like I said the edge one is worse
So particles are not smart enough to interact with geometry?
They'll just fall straight through.
No
They don't necessarily fall
e.g. smoke rises
So you can control whether they are influenced by gravity or their density etc?
Yes
But they lack the smarts for collisions.
Many engines don't have that anyway 
Yeah I can imagine the performance cost.
Checking say 1000 particles if they hit something or not.
Definitely expensive.
1000 is just what you get from 1 smoke grenade
It's many more
Particles are CPU bound too are they not?
Yes
What could cause setFog to only decrease the fog?
0 setFog * sets it properly
But having time>0 makes fog only decline instead of reaching target value
Same behaviour on both syntaxes
It works fine on an empty mission, but doesn't work on mine
Feels like some other weather parameter prevents fog from working
I logged each and every setFog usage so its not some other script messing it up
did you try ticking "override fog" in mission's settings?
It works fine on an empty mission, but doesn't work on mine
then something is changing that in your mission π π
Yeah, and I can't figure out what π€
No such checkbox
Isn't it a default?
Oh, default is 0 π€
Can't remember how that -1000 got there
fog is 0.01
Executing 100 setFog 0.2;
starts going down to 0

It uses time but always target value of 0
1 setFog 0.2 => goes to 0 in 1 second
0 setFog 0.2 => sets to 0.2 instantly

restart from scratch!
Rewrite the whole mission 
Found out what it was
Having 0 setWindStr 1
Doesn't matter what wind you set afterwards, if you have that, no more fog for you

Honestly I have no idea what setWindStr and setWindForce are
"Set max. wind overall wind changes in time."
it respectively sets wind's str and force

hue hue hue
Is there a way to detect mission-side if a mission was launched from the MP Eden editor? I'd like to dis/enable some debugging if it is
is3DENPreview ?
ah, that might work, thanks
0 setWindStr 0.85; 1 setFog 0.2 sets fog to 0.15 over 1 second
Oh, so the formula is simple
Max fog = 1 - setWindStr
Not explained anywhere it seems, thanks Arma
ooooooh, wikiwikiwiki
is an "AttachTo" event handler a good idea? @meager granite
Added comments under setFog
Feel free to remove them and add the info to the article itself
I wont mind
I'd say no because engine never attaches anything by itself and not knowing if you attached something is sort of your own fault.
there is one in the engine event enumeration , think it is not hookable tho
TurnOut = 31,
TurnIn = 32,
AttachTo = 33,
HandleHeal = 34,
HandleIdentity = 35,
AnimStateChanged = 36,```
Interesting
im on laptop, cant open arma rn
can you test to see if it works? dont think ive ever actually tried
ah sorry, I wanted to say "I'm going to wiki it" ^^ I was caught on a call
thanks for the note, definitely!
No idea how to hook to unused EHs
I think it might be one of VBS event handlers
Sadly VBS scripts reference is behind login now, can't check it anymore
Also found in some mirror of an old community.bistudio.com somewhere
hmm
Volumetric clouds can be disabled with setSimulWeatherLayers 0 but can't be enabled back even after switching mission or server.
private _display_menu = findDisplay 46 createDisplay "RscDisplayInterrupt";
ctrlActivate(_display_menu displayCtrl 301);
ctrlActivate (findDisplay 5 displayCtrl 2);
_display_menu closeDisplay 2;
```Code snippet to re-init volumetric clouds in case somebody needs it. It opens video menu and closes it, triggering the engine to re-init the clouds.
Sharing in case somebody was dealing with overcast and clouds
If you want to deny players getting more FPS by script-setting themselves flat Arma 2 clouds before playing your mission/server 
wiki? :3
Already posted a comment with that snippet there
It might be sensible to raise a FT ticket about it too, that seems like something that should be fixed
How does one teleport the player to a different location by a trigger?
setPosASL etc commands
Perhaps, setSimulWeatherLayers > 0 should fix the clouds as well as clouds re-initing on mission loading.
That's the original code for the password protected intel (executed with Achilles' or ZEN's execute code module): https://github.com/ArmaAchilles/Achilles/blob/master/Experimental/PasswordForUnlockingIntel.sqf
As far as I remember it does not work in MP though
Thansk @languid tundra that's very kind of you
You can thank Lou for pinging me or I would have missed it for sure π
thank everyone, all of you!
@languid tundra I honestly just saw a YT video of that arma 2 mission where you have to imput a code and your video was recommended next. Blew my mind.
Does anyone know where the holster function is? I would like to change the placement of the rifle. If that is possible?
that would be animation modding, not scripting
ahh, alright, thanks!
I'm pretty sure that this should cause the while loop to stop when njt_gpsjamming becomes true. It doesn't. There must be something obvious I'm missing but I just can't see it.
while{!(missionNamespace getVariable ["njt_gpsjamming",false]) && {!isNull player}} do
// ...
// This happens later in a function that runs on the server and is verified to run
missionNamespace setVariable ["njt_gpsjamming",true,true];```
Never mind. I found a second while loop hidden deeper in the code which is what _actually_ causes the issue.
probably want to check if the vehicle is close enough to the right orientation and not exact bc that'd be really tedious
check if direction vehicle player is close to direction launchpad1
check vehicle player distance launchpad1
lou is probably typing out the if statement I was going to type so I'll just defer to him
something like that
private _veh = objectParent player;
if (_veh != mySuperAircraft || { _veh distance theLaunchPad > 100 }) exitWith {};
the dir thing is a lengthier thing to do but you get the idea
yeah
yeah you'll prob want to do something like direction pad - direction veh < 5 or something
err. put an abs in there too
(also + 360 % 360 something)
something tells me it's in a plane so it's "is the plane oriented towards the target
not just 2D dir :(
thats true but i figured since it was a catapault launch pitch/roll didnt matter just yaw
since they'd be on the same surface as the launcher?
oh, didn't even get that part π
im not certain obv, i could be wrong. but thats how i read it lol
no no you're right, I just stopped reading at the <code> post π
no
also no
neither are correct
e.g. if direction of vehicle is 359 and direction of pad is 3 both will yield incorrect results
it is possible. but it's incorrect
call compile wont work π¦
because it's wrong
Just checking some shops from life servers and try to do something, linked with conditions
well if you do it like this:
{ private _dir = (direction _aircraft - direction launchpad1 + 360) % 360; _dir < 5 || _dir > 355}
it will be correct
why its wrong?
you had something getVariable ['var']
that's not the correct syntax
['someVar', 0]
ye
didn't spot syntax error
also I'm not sure why you're using call compile
why is that code a string in the first place?
i mentioned you'd need an abs in there but ye true
so anyway if I want to use the arsenal to let you refill ammo how should that work? I tried adding all mags for all weapons but they don't show up unless you already have one of those mags on your person.
oh im dumb. ofc. i was using virtualitemcargo when i should have been using magazine cargo π€
how would I get statics for a faction? would i just look up CfgVehicles entries with scope=2, faction = _faction, iskindof "StaticWeapon"?
iskindof "StaticWeapon"
that's one way
but I personally hate isKindOf for that kind of stuff
yeah its not ideal :/