#arma3_scripting
1 messages ยท Page 3 of 1
it might break subsequent waypoints for that group
oh
im tryna have it so it flys to a waypoint and then rappels the player
but im activating the rappel script using a trigger
and the ai keeps flying not exactly on the waypoint so the trigger doesent activate
well try that script for now and see how it works
fixed
well vanilla pilots are terrible and they can't correctly fly exactly to a position
not really
sad
why not use unit capture?
whats that
you fly the heli yourself and capture its movement
When this question is solved, I have one more myself
what part of it is confusing? you just use the command and put the variables you need:
[unit, duration, FPS, firing, startTime] spawn BIS_fnc_unitCapture
``` it even has an example
```sqf
[BIS_Vehicle, 50, 30, true, 10] spawn BIS_fnc_unitCapture;
then it starts recording
what are the numbers
you don't have to wait, just ask
is that the length it records for
dont wait my question might take a while as im a smooth brain and understand none of this XD
it's like a counter before it starts recording after you've run the command
can i set it to record when i do something
nvm
alr
will it say when its recording
or not
just use
[blackHawk, 50, 50] spawn BIS_fnc_unitCapture
and start flying
increase the first 50 if your flight time is longer
just set it to 1000
[blackHawk, 1000, 50] spawn BIS_fnc_unitCapture
is it in a trigger or something
debug console
that's for recording not playback
how do i play back
once you hit Esc it copies the stuff to clipboard
paste the data to a file
for now just do the recording
My second question is how to add actions/code to a spawned vehicle. I'm specifically looking to add an ACRE rack, the ability to change the waypoint (and associated loiter) and the ability to despawn the aircraft and teleport the player back to a specific spot
this addAction ["Create Covey",
{
_Covey = createvehicle ["uns_ov10_usaf", getMarkerPos "AO", [], 0, "FLY"];
_Pilot = [[0,0,0], WEST, ["vn_b_men_aircrew_25"],[],[],[],[],[],232] call BIS_fnc_spawnGroup;
((units _Pilot) select 0) moveInDriver _Covey;
player moveInGunner _Covey;
_wpCovey = _Pilot addWaypoint [getmarkerPos "AO", 800];
_wpCovey setWaypointType "LOITER";
_wpCovey setWaypointLoiterRadius 200;
_wpCovey setWaypointLoiterType "CIRCLE_L";
_Pilot setBehaviour "CARELESS";
}];
https://community.bistudio.com/wiki/BIS_fnc_unitPlay
[blackhawk, parseSimpleArray loadFile "data.txt"] spawn BIS_fnc_unitPlay
just put this in it:
if (true) exitWith {};
on first line
what does that do
skips it
ye
wait
i have a problem
with capture
i want it so the heli waits until player gets in
then takes off
if im controlling the pilot
ok
start the engine and fly
once you're done hit Esc
is that 50 seconds until recording starts
or does it start as soon as i excute it
ah
so it starts as soon as i execute the command
yes
just use another addAction
also next time post your codes with syntax highlighting
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
Oh, my apologies
this addAction ["Create Covey",
{
_Covey = createvehicle ["uns_ov10_usaf", getMarkerPos "AO", [], 0, "FLY"];
_Covey addAction ["My action", ...];
_Pilot = [[0,0,0], WEST, ["vn_b_men_aircrew_25"],[],[],[],[],[],232] call BIS_fnc_spawnGroup;
((units _Pilot) select 0) moveInDriver _Covey;
player moveInGunner _Covey;
_wpCovey = _Pilot addWaypoint [getmarkerPos "AO", 800];
_wpCovey setWaypointType "LOITER";
_wpCovey setWaypointLoiterRadius 200;
_wpCovey setWaypointLoiterType "CIRCLE_L";
_Pilot setBehaviour "CARELESS";
}];
practice 
yeah
but like
its the hovering
it took me so long to get into hovering above the trees
the player would have rappeled already
in the time it took me to hover on the waypoint
use autohover then
i did
but it took a while to get it in the right place
because its rappeling into trees
it needs to be exact
or the player breaks both thier legs
no it has several errors
as for the syntax highlighting:
you type 3 `
```
then type sqf
then hit enter (next line)
```sqf
hint
and then end with ```
```sqf
hint
```
this addAction ["Create Covey",
{
_Covey = createvehicle ["uns_ov10_usaf", getMarkerPos "AO", [], 0, "FLY"];
_Covey add action ["Retask", {Action of interest};];
_Covey [_Covey ["ACRE_VRC64", "Upper Dash", "Dash", false, ["inside"], [], "ACRE_PRC77", [], ["intercom_1"]], false, {}] call acre_api_fnc_addRackToVehicle;
}];```
So, theoretically, this would work? I've peered through the ACRE documentation a few times already and that add rack fnc is giving me a lot of trouble. I'm not sure what I'm doing wrong with it either
Aha
@cedar cape
ok
put the data in a file called data.txt in the mission folder
then put that code in a trigger
if this doesent work
or it goes wrong
are you any good at flying
because if the player gets killed
its down to my shit flying skills
sad
so i put [blackhawk, parseSimpleArray loadFile "data.txt"] spawn BIS_fnc_unitPlay into the trigger correct?
this addAction ["Create Covey",
{
_Covey = createvehicle ["uns_ov10_usaf", getMarkerPos "AO", [], 0, "FLY"];
_Covey addAction ["Retask", {Action of interest};];
[_Covey, ["ACRE_VRC64", "Upper Dash", "Dash", false, ["inside"], [], "ACRE_PRC77", [], ["intercom_1"]], false, {}] call acre_api_fnc_addRackToVehicle;
}];
it has nothing to do with ACRE
your SQF code was wrong (incorrect syntax)
yes
alr
i put it in a trigger
i could put it in init.sqf
infact i might do that
so i have as little stuff in the mission as possible
you might want to do it like:
blackhawk engineOn true;
[blackhawk, parseSimpleArray loadFile "data.txt"] spawn BIS_fnc_unitPlay
also
I see, and that makes sense. I was scratching my head in confusion for a good while with that
the steps are similar
bruh
heli wont stay in the same place
this unit capture thing is annoying me
i swear i had hovered at this point
but it keeps hovering
flying up
hovering
flying up
did you keep recording while hovering?
then how do you expect your hovering data to be there?
thats why
im so smart
HDWSADF
i will just ask one of my friends to fly it
who is much better at flying than i am
Thanks for the help Leopard. It's been much appreciated, especially when I've been essentially just teaching myself SQF scripting
thanks aswell
the entire start of my mission wouldnt be in existance if you didnt help
Good Evening, does somebody know if it is possible to use BIS_fnc_timeline_play on a dedicated Server? I tried so much fifferent ways to call. By Code direct in Script, as separate remoteExec Script, calling as Trigger, calling as Function and nothing worked. I also used the call BIS_fnc_timeline_init before and I am complete clueless, now. On SP and MP it works and so I expect it should work also on Dedicated. I am so thankful for any ideas ๐ Thanks a lot.
Yeah, I know this page. Thanks. But it begins that I can't found out inside the Bohemia Wiki if this Modul is working from localisation like Triggers for example.
generally speaking, if something works in SP and local MP but not in dedicated MP or non-local MP, it means that the function either needs local args or has local effect
but either way the solution is using remoteExec
Hello. I need a few commnds.
How do I make
Myself invincible
My friend invincible
Our vehicle invincivle
Our vehicle have infinite ammo
Thats the point. calling direct with remoteExec and the Args doesn't work also calling in separate script by remoteExec and execVM won't work. Thats the reason whyy I am struggling. But thanks for now. I will do a post with used Code in Forumm tomorrow.
there's also a checkbox in the editor
there's multiple ways to do infinite ammo, you can probably find some variation of that with a quick google
@open fractal
How do I make other players invincible
player allowdamage false; worked, but only on the player doing it
it takes a local argument so it has to be executed on the player's machine
[_player, false] remoteExec ["allowDamage",_player];
``` `_player` being your variable for the player
This doesn't work
Not sure why
he tried ["Hello"] remoteExec ["hint"]; and it worked
I saw hint
how did you define _player?
replace _player with the variable you set for the player unit
no we're in antistasi
{[_x, false] remoteExec ["allowDamage",_x]} forEach allPlayers;
do this i guess
you should share more context to begin with if you want help in the future
is there any reliable way to get building real height?
i'm trying to use
private _buildingBoundingBox = 0 boundingBoxReal _building;
private _p1 = _buildingBoundingBox select 0;
private _p2 = _buildingBoundingBox select 1;
private _maxHeight = abs ((_p2 select 2) - (_p1 select 2));
and it's still returns position 1-2-4 meters higher than it should
Thanks
hello, refreshing my VS Code bits, I seem to recall there was an updated LINT or something like that? anyone happy to have that reference handy? thanks...
I found it, BTW, if anyone was tracking that... https://marketplace.visualstudio.com/items?itemName=blackfisch.sqf-language
that one is obsolete apparently; it was forked and updated.
wat?
IDK where you got that info from... this is from the Code extensions marketplace v2.0.3 ...
Released on 11/19/2015, 05:10:25
Last updated 3/14/2019, 16:00:47
Identifier armitxes.sqf
Versus v2.0.6
Released on 4/11/2022, 10:21:18
Last updated 4/14/2022, 17:24:27
Identifier blackfisch.sqf-language
Ah I see... LINT versus 'language' yessir...
although if that LINT is a fork, as forks go, 0.12 is 'more recent' in release date only, not a 0.13, in version number only, FWIW... how confusing is that. ๐คฃ
if I was the maintainer there, I might bump the version out beyond 0.13+ at least, to avoid confusion
a = 0;
testDummie removeAction _myID;
}];``` How do I get _myID not undefined in this
it has been awhile, but AFAIK, when you assign _myID it is a local variable. it will go away when the scope goes away. you should stow that on the testDummie, perhaps, as a variable that you can reference later, or on the action handler, for instance.
Is it not possible to pass it through params in this instance?
and thou art correct ๐
negative, as the value is provided only after the action is added
you can alternatively setVariable the action id
with, ironically, setDamage
With ace?
allPlayers call ACE_medical_treatment_fnc_fullHealLocal;
if that doesnt work: try
{
_x call ACE_medical_treatment_fnc_fullHealLocal;
} forEach allPlayers;
only reason i give you two methods is because im not 100% certain on syntax for all players, ive only ever healed individuals via script
fullHealLocal, doesn't it require remote execution?
good question, not 100% on that
"ACE_medical_treatment_fnc_fullHealLocal" remoteExec [call, -2];
would work, -2 being every client not the server
You can't skip the parameter.
also syntax is pretty busted there
probably best to use fullHeal instead, and then you can just do this:
{
[_x, _x] call ace_medical_treatment_fnc_fullHeal;
} forEach allPlayers;
Is there a guide to optimizing while loop performance somewhere?
optimize what part of it?
nvm that page doesn't have what I wanted
anyway, a while loop has pretty much nothing to optimize. at least not the loop itself
SQF optimisation is mostly about using as little of it as possible :P
in my case a loop that creates a beep warning. while a condition is true. idk if there is a better practice for such a thing. lemme post what I got
you can use sound sources instead
other than that there's nothing you can do for looping sounds
so pretty much
say2d then sleep is all I got to work with?
Well, sleep as long as possible, but that was probably obvious.
and sound sources. yes
what does sound source mean in this case?
you can also play it as music 
is this faster than using say2d on the player?
well sound sources are 3D
but the engine handles the looping so definitely faster
you just call the command and that's it
and when you want it to stop you delete the source
another idea I thought in my head was having long sleeps but it "compiles" a sequence for sounds.
the case for this would be geiger ticks. I think playing the same audio track is kinda boring so im trying to spice it up with random ticking. But im realizing arma might hate this.
Pretty sure sound sources have support for random sound selection
Could just put different tick noises in as separate sounds and have it pick randomly as it plays
Yeah its pretty much doing that already. From looking at the code optimization wiki page I think Lazy evaluation can help with the speed im worrying about.
Lazy evaluation definitely helps
Though as others said the best optimisation with sqf is generally just using as little as possible
gotcha sounds about right. basically condensing it down right?
Lazy evaluation does not always help, because it's extra SQF itself.
If you have two conditions that are both simple then you're better off without it.
^
if more than 2 use it?
Mostly just use it if you have expensive checks
Also depends how often you're hitting the no-evalution cases.
gotcha I understand a bit better. Also is it better to have a waitUntil inside the while loop? or just have the condition on the while itself
That depends what you're doing, waitUntil and while are not equivalent
waitUntil is going to actually suspend your code until a condition is met, while is just going to continue until a condition isn't met or skip immediately if it isn't met initially
in my case it sounds better to merge the waituntil with the while then given your example. As i dont really need the while to fire until all the conditions are met for my simple case.
It makes sense to wrap a waitUntil with a while only if you need to repeatedly wait for a condition to be met
gotcha gotcha
"lazy eval" in sqf is usually only worth if you have something like cheapcond && expensivecond, in other cases it's actually slower than if you used no "lazy eval", fx., _a > 0 && _b > 0 both are cheap(ofc if you have multiple of them then it depends, also the likely/unlikely part), another case where it's useful is if the right operand requires left to be true, fx., !isNil "_a" && { _a blabla... even though it's cheap}
And a lot of the time you can simplify a conditional chain with logical laws of simplification.
associativity, Idempotence, Complementarity, Identity, Distributivty, etc.
I have a script that runs when a player triggers an action on an object. The script does this:
- creates a curator with some limited objects
- assigns the curator to the triggering player
- opens the zeus interface
- waits for the interface to close
- destroys the curator
This works in a local MP server from the editor, but I assume it won't work in a dedicated server, since I need to execute things both on the server (creating the curator, assigning addons and limitations) and the client (open zeus interface, wait for it to close. How can I sync this to work in a dedicated server?
I'm still pretty new with locality stuff. I assume it works on a local MP server, because addAction runs locally, and I'm both a client and the server.
Everything that needs to be handled by the server should be handled by the server everything handled by the client handled by the client
And yes on a local MP server you are both client and the server
One way you can do it is wrap it in isServer
conditional check to execute only on the server
or for client if (hasInteface) then {}
The other way to do it is use the cfgFunctions.hpp file
and use cfgRemoteExec.hpp
hmm yeah I thought about that. The problem is that the script has things that have to run on client and server in a specific order. I shouldn't open the zeus interface until the curator is created, and while I wait for the interface to close, I have a loop doing something else on the server
I guess I could somehow make both client and server do remoteExec on eachother
Curator things should be handled serverside
you don't have to wrap your entire script just use exitWith
Not client.
if !isServer exitWith {};
^ Or you can use my technique of explicitly isolating subsystems by client and server
yeah, I know. That's why this is a bit complex for me. Most things are done on the server, except opening the interface and waiting for it to close
Well that should run on the client
and that information passed to the server from the client
hmm maybe I could use a broadcasted var on the player, so the server knows when he closed the interface? But I should also tell the client when the curator is created, so I can open the zeus interface
you can define a function in CfgFunctions and use your action to remoteExec to the server
If you have more than 1 player.
since it's curator I think the only thing you need to run clientside is opening the interface
^
The server is where you should store all important things.
The client shouldn't handle anything that requires a singular reference point and copy.
Server is overlord and controller.
curator assignment has to happen on the server or it won't happen at all
curator commands are server execution only
Use an EH on the client
and listen for the opening of the curator interface
Then pass that message to the server using setVariable
currently I'm using openCuratorInterface to force it open, and a waitUntil findDisplay is nil, to know when he closed it
that works, I just need to figure out how to synchronize it
I guess I could run the same script both on client and server, and use waitUntil to sync the order of execution, using broadcasted variables on the player
you can define a function with both an "open" and "close" condition to create and destroy the curator object respectively
and remoteExec to the server
^
ID number 2
to send it to the server only
params remoteExec ["Function name or code",2,false];
if !isServer exitWith {};
params ["_open","_caller"];
if _open then {
//create curatorobj
//make curator assignments
remoteExec ["openCuratorInterface",_caller];
} else {
//delete curator obj
};
pseudo code for how I would go about it
Is the exitWith really needed?
not really but I put it there instead of commenting that it should only be run on the server
I think I'm gonna try this:
addAction:
- remoteExec script on SERVER
server:
- create curator, customize it, assign to player
- remoteExec script on CLIENT
- wait for player broadcasted var
- cleanup
client:
- open zeus
- wait for player to close it
- broadcast var
so I'm gonna have two scripts, one for server and another one for client
Realistically yes you should
Putting client / server code in the same file is a nightmare to debug
I doubt you need to remoteExec anything on client except the openCuratorInterface
yeah, the only code on client's side is opening the interface, and waiting until it's closed, to broadcast a var
if you look at the example I sent above you just remoteExec that function from the client first with true to initiate the interface then with false upon closing
My missions / other projects use 3 folders.
client, server and common, common is for utility functions that are not used client or server side but are used everywhere.
imo if you're broadcasting a variable you're overcomplicating it
yeah, I guess I could remoteExec twice instead
Yeah you don't even need a var.
sounds better
I've used server side listeners to add TFAR radios to cars that don't have them.
i.e. [true, _caller] remoteExec ["max_fnc_curator",2];
Basically a piece of EH code would listen for vehicles being placed then would setVariable and add a radio to them.
then false upon closing it
by the way, if I declare a private set of instructions, and use remoteExec on that, will it work on the server? I mean, the piece of code is local to the client, and the server has it too (it's on init), but I don't know if it will run
Put your client code in something like MAX_fnc_clientOpenedCurator
then call it on the client
use CfgFunctions, no reason not to
yeah I wanted to avoide using CfgFunctions cuz it's a very small script ๐
_opened remoteExec ["MAX_fnc_clientOpenedCurator",2,false];
it takes like 2 minutes to set up
@open fractal Or you could have something like I have that auto generates it ๐
i also have that yes
Python?
I wrote batch files for hpp files
have had no issue with batch
Didn't you get the memo microsoft only keeps batch around for backward compatibility PowerShell has basically set powershell to replace batch
PS is also OOP capable.
batch is fine
Each to their own.
btw thanks for the help ppl 
[100, ["RscZoneTimer", "PLAIN"]] remoteExec ["cutRsc"];
for "_i" from _seconds to 0 step -1 do {
private _timeString = ([_i, "MM:SS"] call BIS_fnc_secondsToString) select [1, 4]; //The problem is not here
if (_i <= 10 && _i % 2 == 0) then {
[_timeString, { (uiNamespace getVariable ["ZoneTimer", displayNull]) displayCtrl 1003 ctrlSetStructuredText parseText ("<t font='PuristaBold' size='2.3'color='#d41a0d'>" + _this + "</t>"); }] remoteExec ["call"];
} else {
[_timeString, { (uiNamespace getVariable ["ZoneTimer", displayNull]) displayCtrl 1003 ctrlSetStructuredText parseText ("<t font='PuristaBold' size='2.3'>" + _this + "</t>"); }] remoteExec ["call"];
};
if (_i == 0) then {
["FD_CP_Clear_F"] remoteExec ["playSound"];
};
sleep 1;
};
[100, ["", "PLAIN"]] remoteExec ["cutText"];
```I am having a weird issue with my structured text display here. I am trying to create an on-screen timer, and it *was* working perfectly. Now, it is only displaying the first 3 characters of the timer unless the last character is a 1. For example, with an 8-minute timer, it looks like this:
8:0
7:5
7:5
7:5
7:5
7:5
7:5
7:5
7:5
7:51
7:4
7:4
7:4
7:4
7:4
7:4
7:4
7:4
7:41
Interesting
Does it happen without the select [1,4] on the time string? I know the comment is there but it seems like the most obvious possible cause
I'll test that
oh, btw, this is the display:
import RscText;
import RscStructuredText;
#include "\a3\ui_f\hpp\definecommongrids.inc"
class RscTitles {
class RscZoneTimer {
idd = -1;
duration = 1e+6;
fadeIn = 0;
fadeOut = 0.5;
onLoad = "uiNamespace setVariable ['ZoneTimer', _this#0]";
onUnload = "";
class Controls {
class TimerText: RscStructuredText {
idc = 1003;
text = "";
x = 0.912595 * safezoneW + safezoneX;
y = 0.203 * safezoneH + safezoneY;
w = 0.0515744 * safezoneW;
h = 0.055 * safezoneH;
};
};
};
};
yeah, that doesn't fix it. Now I'm just getting 08:0, 07:5, and so on
Hmm well worth making sure I guess
oh wait I was gonna try something and then I got sidetracked
I think it might be out of the gui box
lemme check
Interesting that it would only do so for numbers other than 1, but possible
Not sure if structured text uses normalized font sizing or not
If it does then all of the characters should be uniform width anyways
true
well yeah that's what it was
["cutscene", true] call ace_common_fnc_setDisableUserInputStatus;
[{ (getPosATL player)#2 < 1 }, {
showCinemaBorder false;
["cutscene", false] call ace_common_fnc_setDisableUserInputStatus;
}] call CBA_fnc_waitUntilAndExecute;```
this is script
im using
for some reason it works
like
Why wouldn't it work?
wait
its supposed to
first half works fine
but when its finished rappeling the player
the cinema borders dont disable
and i cant move
like its supposed to disable ace interact whilst the player is rappeling, enable it when they are on the ground and remove the cinema borders
but none of that happens
it disables it but doesent remove cinema borders or renable ace interact
Hm
Perhaps just do the waitUntil yourself instead of using the CBA function and see if it works
Or use isTouchingGround instead of the ATL z pos check
so how would i change that script
to use those
also how do i change altitude of heli using a waypoint
instead of using unit capture i went back to ai pilots and it works fine with going to the waypoint but its flying to high atm
so the rappels ropes are too short and the player dies
is there like a script i could use that makes it so the heli flys like idk
20m above the ground
I don't do mission making so I don't know the best way to do it
Unlikely that forcing it via script is the best way to do it though
i belive there is a script that does im not sure tho
like setHeight
not sure how it works tho
ill figure that out on my own
but i do need help with the other one, the rappel script
i belive this might work for my heli problem _helicopter flyInHeight 40;
where would i put that in the script i have already
Could put it in the heli init or just before you tell it to move
Seems like a good way to do it
im confused
[blackHawk] call ace_fastroping_fnc_deployAI;
["cutscene", true] call ace_common_fnc_setDisableUserInputStatus;
[{ (getPosATL player)#2 < 1 }, {
showCinemaBorder false;
["cutscene", false] call ace_common_fnc_setDisableUserInputStatus;
}] call CBA_fnc_waitUntilAndExecute;
where do i put it in there
im executing that script with a trigger
Oh you mean the other thing
I'm on mobile otherwise I'd just write it for you
i think i can put it in a waypoint
oh
can you try to or not
as im horrible with scripting
See the code that says getPosATL player etc.
yea
Just replace that with { isTouchingGround player }
["cutscene", true] call ace_common_fnc_setDisableUserInputStatus;
[{ ({ isTouchingGround player })#2 < 1 }, {
showCinemaBorder false;
["cutscene", false] call ace_common_fnc_setDisableUserInputStatus;
}] call CBA_fnc_waitUntilAndExecute;```
so that?
it doesent look right
Nope the entire thing needs to be replaced
ohhhhh
Everything in the {}
["cutscene", true] call ace_common_fnc_setDisableUserInputStatus;
[{isTouchingGround player}, {
showCinemaBorder false;
["cutscene", false] call ace_common_fnc_setDisableUserInputStatus;
}] call CBA_fnc_waitUntilAndExecute;```
so that?
Yup
so would that remove cinema border and reanble ace interact when the player hits the ground
Yes if that function is actually working properly
If it still doesn't work we can try without the CBA function
and its the piece of code ppl on the ace discord told me to use
alr ill give it a shot
idk if this is the problem
but
the original piece of code had showcinemaborder true at the start
group your messages please
ok
or I'll spam in-between huehuehue
and i removed it because it have it in the init.sqf and left the disable cinema border
Won't matter
alr
ill give this a shot and find out
question, whats the difference between flyInHeight and flyInHeightASL
oh wait nvm its different altitudes for different behaviours
First based on ATL pos second based on ASL pos
an
ah*
bruh, it works kinda but i cant test it properly because the heli flys way to high so i just die because the ropes are too short and i hit the ground
Dunno what to tell you there
oh wait
i think i know why
_helicopter flyInHeight 40;
im supposed to replace _helicopter with variable name
i think
Yes lol
am so smart
Replace it with the variable representing the helicopter
yeah
ill give it another go and let you know if the height works and if the script works
๐
yeah same problem
it flies to heigh, rappel rope too short player go big splat on the ground
Perhaps that ace rappel function lets you adjust rope length
it doesent
Could also just temporarily make the player invincible
Not sure why your heli is still flying so high
because the player would fall for like 20+m before hitting the ground and not dieing
yeah
idk why
Does it have waypoints?
Hm interesting
the way ace rappel works is you use ace interact to prep the FRIES system and then use the rope you brought in the aresenal to rappel
and it has different lengths of rope in the loadout
but thats without the script, the script auto does all of that
i belive
Might be able to get more help by asking in #arma3_scenario
Must be a reason your heli isn't flying low enough
yeah
@cedar cape FligtInHeightASL is Above Seal Level
Meaning the 0 point on the z axis is at the ocean level
Not the terrain level
will that make the ai fly low
how can i force the ai to ignore the trees
like its bc there are trees
and the ai are terrified of going near it
I see explosions in your future
is there any reliable way to get building real height?
i'm trying to use
private _buildingBoundingBox = 0 boundingBoxReal _building;
private _p1 = _buildingBoundingBox select 0;
private _p2 = _buildingBoundingBox select 1;
private _maxHeight = abs ((_p2 select 2) - (_p1 select 2));
and it's still returns position 1-2-4 meters higher than it should for the majority of buildings
using lineIntersects commands from the top of the bounding box
something like
private _realHeight = _maxHeight;
while {!lineIntersects [_maxHeight, _realHeight]} do {
_realHeight = _realHeight - 0.5;
};
this?
function description requires positionASL though, and it seems that boundingBoxReal returns ATL height
you have ATLtoASL commands
so, do I need to ATLToASL the height?
oh ok
looks like there will be some quirks and gotchas, but at least it's something
thanks for suggestion!
but I would recommend e.g lineIntersectsSurfaces
draw from the top of the bounding box to the bottom, stop at first result, check distance from intersection to bottom ๐
hmmm
it has much more arguments though
i guess it should be something like
lineIntersectsSurfaces [_buildingHeightAsl, _buildingHeightRealAsl, ???, ???, true, 1, "GEOM" or "VIEW", probably don't needed, true]
lineIntersectsSurfaces [_buildingTopBBoxASL, _buildingBottom];
```all the default options are what you want actually ๐
yeah, seems that default parameters are good enough
thanks for help!
This reminds me of Coltan Blues in Arma 2 OA. Anyone has the faintest idea how the password protected intel is done ? https://www.youtube.com/watch?v=uCl-yzOTGhI
here? it is camera + 2D UI work + screen texture ๐
I think it's same way done than mine IED numpad project, mine is not ready to publish, but idea is mostly same on that than yours video which you posted
https://youtu.be/BjNaH7m30JU
@languid tundra you have a fan!
Lol
where do i put this
is it the init of the object
oh wait
nvm
_loadoutClass = getPylonMagazines _vehicle;
{
_indexString = str _forEachIndex;
_loadoutMark = ["_loadoutMark", _indexString] joinString "";
_loadout = ["_loadout", _indexString] joinString "";
_indexMod = _forEachIndex + 1;
_incr = (-100 * _indexMod);
_loadoutDisplay = getText (configFile >> "CfgMagazines" >> _x >> "displayName");
systemChat format ["%1", _loadoutDisplay];
_loadoutMarkPos = (getMarkerPos _markername) vectorAdd [0,_incr,0];
_loadout = createMarker [_loadoutMark, _loadoutMarkPos, 1]; // put it just under the Asset
_loadoutMark setMarkerColor "ColorBlue";
_loadoutMark setMarkerShape "ICON";
_loadoutMark setMarkerType "hd_dot";
_loadoutMark setMarkerText _loadoutDisplay;
systemChat format ["%1", _loadout];
_markerCount append [_loadout];
publicVariable "_markerCount";
} forEach _loadoutClass;
};
case false: {
deleteMarker _markername;
{
deleteMarker _x;
} forEach _markerCount;
systemChat format ["%1", _markerCount];
};
for some reason, it fetches all in _markerCount, will delete them but not the marker? so post "deletemarker" the array is empty but the markers remain
you cannot publicVariable a local variable
create it as a GlobalVariable then?
that would be ugly
Send exactly what you wrote
blackhawk disableAI "FSM";
well i cant modify the entries in the array at all
so i cant delete the markers, seems its scope stuff
and still new to sqf so im not sure the best approach
that's a vehicle, not a unit? try driver blackhawk
can you make a simplified version of your code issue?
ah
would blackhawkD disableAI "FSM"; work
perhaps yeah
EH for engine on
engine on: makes a series of markers via foreach loop using the pylons (posts their loadouts on the map)
engine off: delete all markers
^ intended functionality
currently in the loop i have each marker being added to an array, so i can call upon it later to delete them. and in the output of systemchat it has entries for each pylon, 0-3 (4 pylons)
but on engine off, i try to delete the markers, and the array "deletes" them using delete marker, except all it does is empty the array and not delete the markers
and you want everyone to see the markers, or just the pilot?
everyone
I take that it's a function that is called with "is engine on" argument, and in the case of false:
_markername is undefined
_markerCount is undefined
can i reverse this for enable ai again or not?
i figured, so i tried making the arrays visible outside the scope
i think ill just rewrite it to rely on waituntil (engine off)
see the wiki
so i can get it to fly back to base without blowing up
not how you do it
you could use a global variable CBB_LoadoutMarkers directly
but if it's MP, and the script happens on one machine and is not executed again, markers will stay
sooo public variable it would be, or (better) setVariable on the vehicle
alright ill give that a go
Probably right. I haven't done any gui related scripting or interaction before so excited to discover that.
Is he the one who designed the coltan blues mission or the video I shared. Fan is an understatement. Always impressed by how creative the community can get
Coltan Blues seeming to be an official campaign's mission, I think not, as I don't think Kex is an (ex-)BI staff ๐
it does not diminish in the slightest the quality of their work!
Oh indeed. The community thinks of stuff BI staff never even imagined.
ooooooh yeah. ๐
didnt work
ahdhsdeherdwh
or atleast i dont think it did, im tryna make it so the ai ignores the trees and hovers at the fly height i set but instead it keeps flying 50+m above the ground
Hi, i'm trying this command to get a "flight plan" straight but i don't know why the plane always point to the heading : 207
plane enableAIFeature ["PATH", false];
Is there a way to change the default dir ?
wait are you tryna disable it
shouldnt it be disableAI ["PATH"]
i might be wrong
im just guessing there
it might be disableAI "path";
yeah but the "enableAIFeature" is new i will try "disableAI"
wdym enableAIFeature is new
why should that mean you cant use disableAI
actually you still can use this function. Btw i tried and it still doesn't work
ah
{
_x addEventHandler ["Engine", {
params ["_vehicle", "_engineState"];
_crew = crew _vehicle;
_names = [(name (driver _vehicle))], + [(name (gunner _vehicle))];
_markername = str(_vehicle);
PRIVATE _markers = [];
if (_engineState) then {
_className = getDescription _vehicle;
_className = _className select 0;
_displayName = getText (configFile >> "CfgVehicles" >> _className >> "displayName");
_listing = createMarker [_markername, [5700,7600], 1];
_markername setMarkerColor "ColorBlue";
_markername setMarkerShape "ICON";
_markername setMarkerType "RedCrystal";
_markername setMarkerText _displayName + "//" + str _names;
_loadoutClass = getPylonMagazines _vehicle;
{
_indexString = str _forEachIndex;
_loadoutMark = ["_loadoutMark", _indexString] joinString "";
_loadout = ["_loadout", _indexString] joinString "";
_indexMod = _forEachIndex + 1;
_incr = (-100 * _indexMod);
_loadoutDisplay = getText (configFile >> "CfgMagazines" >> _x >> "displayName");
_loadoutMarkPos = (getMarkerPos _markername) vectorAdd [0,_incr,0];
_loadout = createMarker [_loadoutMark, _loadoutMarkPos, 1];
_loadoutMark setMarkerColor "ColorBlue";
_loadoutMark setMarkerShape "ICON";
_loadoutMark setMarkerType "hd_dot";
_loadoutMark setMarkerText _loadoutDisplay;
systemChat format ["%1", _loadout];
_markerCount append [_loadout];
} forEach _loadoutClass;
}
else {
deleteMarker _markername;
systemChat format ["%1", _markerCount];
{
deleteMarker _x;
} forEach _markerCount;
};
}];
} forEach vehicles;
the marker called "marker name" gets removed
but not the array of markers made in _loadout
normal
1/ _markername is defined before the if-else, _markerCount not
2/ use pushBack instead of append []
3/ rename _markerCount to e.g _loadoutMarkers
what did you change since last time?
just did that, nothing changed
i tried using setvariable and getvariable and the effect was the same
I don't see that here
because i removed it after syntax errors and the same effect of it not being deleted, so i took a few steps back for reproach rather than clutter it up
did what
the code flow as I see it:
- if the engine is on, create the markers and store them in the vehicle with
setVariable - if the engine is off get the markers from the vehicle with
getVariable
that's it
all 3 of those bullet points, ill give set variable and get variable another go
I feel like an idiot for asking this because its so simple but I haven't done it in so long.
I'm trying to make a tank shoot at a target, which is an empty vehicle with the var name t1.
Right now, I've tried following a tutorial online I couldn't get working, and the doTarget and doFire commands, on both the gunner of the tank, and the tank itself. I'm still not getting anything from it, so I figured I'd ask here. I know its trivial, sorry ๐
Haha I suppose, I've been trying this for around 15-20 minutes now as well as tweaking the rest of the mission, its just kind of annoying at this point because I've done it before but can't remember how ๐
add an invisible enemy and call it a day? :D
That's possible, I'd rather have it controlled on a trigger though
you can have a crewman with ai disabled and use a trigger with setcaptive
That's true, I will give that a go. Thanks! ๐
use fireAtTarget
I would have to specify the main gun then wouldn't I?
Yeah I just looked at the config and saw it haha, I'm going to try both of these solutions and see if I get it ๐
Ah thats interesting, currentWeapon is returning the MG for the tank, I might have to find the string for the main gun and try it again
weaponsTurret will return all of them
Sorry, do I need to run doTarget first or would it run that automatically with fireAtTarget?
tnk2G fireAtTarget [t1,"CUP_Vcannon_2A46_Txx"];``` I'm using this right now, but it doesn't seem to be firing, or even moving the turret. I could very well have messed it up though haha
Not sure if this would affect it, but the units are around 1.1km away, probably should have mentioned that at first :/
try the tank itself
do I need to run doTarget first
iirc no
Still not having any effect, it is returning True when I put it in extended debug console though ๐ค
_veh doWatch _target;
waitUntil { _veh aimedAtTarget [_target] > 0 };
_veh fireAtTarget [_target];
``` maybe try this template, see if it actually aims at the target?
yeah I guess it needs to look at it
yep
I had just noticed that on the wiki haha, but yep it looks promising ๐
maybe try reveal if the target isn't being detected? Odd that true was returned though
Ayy it worked
Thanks guys! I don't remember it being that complex though haha
When I did it last time I mean ^, but that must have been 7+ months back now
Hello my fellows how does one go about scripting low gravity to a3
I have tried setting the gravityfactor for everything to 0.5 through a config however that seems to have had no effect
I doubt that does anything
depends what kind of object you're dealing with
literally every object
i want it on every object which has physx
there's no good way for it then. at least not scripted
could theoretically accomplish it by applying a fractional setMass to all PhysX objects
not sure if the game uses actual physx forces for gravity though
if not, then that won't work
how would i go about doing that for the sake of it
truthfully I'm not sure the best way to grab all physX objects in a mission, as not all of them have uniform inheritance or anything AFAIK
I know many but not all inherit from ThingX
would changing the mass for all objects not work anyway
seeing as the ones without physx arent moving regardless
most objects are not PhysX
^
even players are not PhysX
Well they can be affected by physX things but any sort of force just causes them to ragdoll
so things that fall instead of just physx
"things that fall" are physX generally
emphasis on generally
you can try the setMass thing but I'm not sure the internals of how the game simulates gravity
can i not just change the mass of every object or will that cause some funky monkey behaviour
changing the mass would only work for simulating low grav if the game actually simulates gravitational force based on mass
doesn't work
well there we go then
it simply makes them bouncier... 
can i turn a grenade into a bouncy ball :o
throw it at a wall and it pings off every wall in the room
i mean if it does it the 'proper' way it wont
but i have no idea how it does it myself seeing as theres no simple mass slider in eden attributes ๐
If it were using newtonian gravity changing the mass would work
Fg = G*m*M/r^2
making either of the masses a fraction of their original mass would result in fractional gravitational force
oh yeah i forgot theres another m
i doubt BI is quite on the level of being able to simulate gravity according to einstein just yet tbh
newtonian gravity isn't hard to simulate but they probably didn't want to need to apply actual grav force calcs to everything
as that would be horrendous for performance I'm sure
according to the wiki doing setMass only changes it for PhysX objects
Then again...
I suppose even if that worked you'd end up with the same acceleration since the mass would be smaller
so you'd need to somehow only adjust the mass for the grav force calc without actually dropping the mass of the object for the applied force
RIP
changing the mass wouldn't change anything since there's no bouyancy or drag as far as I see
yes, acceleration is the same
I just don't think they actually simulate gravity with forces
or at least not mass-based
wait how do flaps work then in that case
does that just reduce the maxspeed of a vehicle or something
maybe you can change gravity in CfgWorlds 
Yeah I had a physics brainfart when I was pondering the mass change
good ol' feather and hammer test
cant find any matches on cfgworlds wiki page for acceleration, gravity or freefall
no 
Although...
you might be able to do an onEachFrame handler or similar that constantly adjusts the Z-axis velocity to a set fraction of its current value
as that would simulate fractional acceleration
yeah thats what i was thinking too lol
would that not hit performance pretty bad?
...perhaps
it does
cant think of a better way to do it though tbh
how would i go about doing it for the sake of testing if its possible
just fetch every objects z-axis velocity every frame and halve or w/e then set that as a new z-axis velocity?
it's technically not correct
it changes the trajectory
e.g. a plane can't nose dive anymore
Indeed not technically correct as you're affecting non-gravitational movement
but not sure how you'd avoid that 
it even changes the gravitational movement
e.g. a ball thrown up
wouldnt it just have half as much 'force' downwards?
yeah you'd have to handle some things differently
tbh it doesnt need to be exact just needs to somewhat simulate low gravity
well if you measure the acceleration you could somewhat do it
problem being that gravity operates on acceleration which we can't work with directly
yeah you'd need to measure it
well if the FPS is high enough you can just subtract two subsequent velocities and multiply by FPS
for each object...
each frame... 
yuuup
i dont think arma will ever have high enough fps for that
I mean there's setAccTime but that will affect everything, not just gravity
i dont intend on having the world time change
yeah I figured not
setAccTime would also just make everything look slow wouldn't it
rather than for instance if i throw a grenade up it'd go twice the height or whatever
yes which is what I meant by everything
is also disabled for multiplayer according to the wiki anyway
onEachFrame {
_accDiff = 9.807 - 5;
_dt = accTime * diag_deltaTime;
{
if (isTouchingGround _x) then {continue};
_v2 = velocity _x;
_w2 = _v2#2;
_w1 = _x getVariable ["lastAcc", 0];
if (_w2 > 0 || {_w1 - _w2 > 9.807 * _dt}) then {
_w2 = _w2 + _accDiff * _dt;
};
_v2 set [2, _w2];
_x setVelocity _v2;
_x setVariable ["lastAcc", _w2];
} forEach vehicles;
};

If a client is waiting for data to update from a target, is there some method more robust than a sleep or using CBA_fnc_waitAndExecute as a sleep. Like idk remotexec'ing back a confrimation of a change or something?
actually this is still wrong
let me fix one thing
i'll test it for the sake of testing but i expect that wouldnt work well enough in MP for an op or something
yo no way does that work
lol not yet
its funny with helicopters
well it gives upward acc to stationary objs right now
another issue this is going to run into is that terminal velocity won't really be a thing anymore
perfect
unless you do the acceleration measuring method
allow people to a c c e l e r a t e to their demise
(i dont intend on anyone really freefalling too much so probably wont be noticeable)
onEachFrame {
_accDiff = 9.807 - 5;
{
if (isTouchingGround _x) then {continue};
_v = velocity _x;
_v set [2, (_v#2) - _accDiff * diag_deltaTime * accTime];
_x setVelocity _v;
} forEach vehicles;
};
pretty sure this would be sufficient as long as you don't care about terminal velocity, no?
given gravitational acceleration should always be negative on the Z axis
that doesnt seem to do anything i dont think
might be better like this
addMissionEventHandler ["EachFrame", {
_accDiff = 9.807 - 5;
{
if (isTouchingGround _x) then {continue};
_v = velocity _x;
_v set [2, (_v#2) - _accDiff * diag_deltaTime * accTime];
_x setVelocity _v;
} forEach vehicles;
}];
as onEachFrame is a bit gross
try this
interestingness happens with this one, helicopter out of fuel and otherwise normally "falling" goes upwards whereas a car goes downwards
the car does go downwards at a lower speed though
this one is increasing acceleration downwards i think?
yeah i hit localexec a load of times and it accelerates downwards faster
hm yeah I suppose it's just adding to the existing gravity
subtracting 15 instead of 5 seems to fix it here though @little raptor, unsure why
How to apply animation on dead unit?
Iโm using Acts_Death-series animation on alive unit, everything is fine but heโs rolling his eyes and moving his head thus completely ruining the idea of the scene, and it seems that simple โswitchMoveโ call is not working on dead unit
use disableAI "ANIM"?
apply animation on dead unit?
not for that. that's not possible
tho iirc doing switchMove does give them a jolt (reminds me of a funny bug in one of my mods...) 
@little raptor is it possible to do a similar thing with units on this
use allUnits + vehicles 
muahahaha
what a huge mess 
it mostly grounds helis btw but that should be no issue
should be
so i want forEach allUnits + vehicles at the bottom right
@sullen sigil
onEachFrame {
_dt = accTime * diag_deltaTime;
{
if (isTouchingGround _x) then {continue};
_v2 = velocity _x;
_w2 = _v2#2;
_w1 = _x getVariable ["lastAcc", 0];
if (_w1 - _w2 > 4 * _dt) then {
_w2 = _w2 - 5 * _dt;
systemChat str _W2;
};
_v2 set [2, _w2];
_x setVelocity _v2;
_x setVariable ["lastAcc", _w2];
} forEach allUnits + vehicles;
};
this should be clearner
and work correctly 
roger i shall use that one moment
im not noticing a hit on performance tbh
will that change in MP or
quite frankly MP will be a nightmare with this
this one isnt altering unit's properly, previous one was
a nightmare in performance or a nightmare in behaviour
i can tolerate a nightmare in behaviour
potentially both depending on how you go about it
I'd distribute the workload to the server and clients and only have them work on things that are local to them
indeed
i think players will always be odd with it because initially falling has a high velocity i believe?
i'll try from higher up
yeah same ting
onEachFrame {
_dt = accTime * diag_deltaTime;
{
if (isTouchingGround _x) then {continue};
_v2 = velocity _x;
_w2 = _v2#2;
_w1 = _x getVariable ["lastAcc", 0];
if (_w1 - _w2 > 5 * _dt) then {
_w2 = _w1 - 5 * _dt;
_v2 set [2, _w2];
_x setVelocity _v2;
};
_x setVariable ["lastAcc", _w2];
} forEach allUnits + vehicles;
};
what about that one 
player is definitely falling slower but vehicles are falling super slow
think player might need to be multiplied by a different value tbh
I'm currently cooking up a potential method as well
I think they might have a slower sync rate 
that'd make sense to me tbh
its not suuppeerr noticeably slower but ACE is only giving me bruises when falling with that and breaks bones when falling without so
helicopter seems to be falling the wrong way again
except its so slow i cant tell ๐
ok no nvm it just takes a while to start falling
which is fine
this seemed to work
but the motion was laggy... 
Sorry to bother but anybdoy have a good solution to this? I'm asking as I realized spaming setvar with a global update in a while loop may not be the best idea so im figuring out a less intense workaround.
iirc motion appearing laggy is unavoidable without major major fps hit -- its how ACE did their old speed limiter thingy
which did hit fps, just not super badly
that's not the thing here tho
o
when I was doing setVelocity every frame it seems that the engine was not updating the velocity
so it was falling with almost constant speed
so now I only change it when it needs to
but because the sync rate of PhysX objects is weird it gets laggy
you should use a "promise" system
Whats that?
oh right, got you -- i suppose that's unavoidable then?
Isn't this current gravity system still going to hard-limit Z-axis acceleration to the gravitational acceleration
it's a name I've heard people call it. it comes from other languages like C++, JS. I personally just prefer calling it callback
anyway, the client that does the remoteExec stores some ID
then the remoteExec target does another remoteExec on the caller using that ID
you don't need an ID tho
it can just be a callback function
here's an example:
fn_remoteExec.sqf
params ["_params", "_function", "_callbackParams", "_callback"];
_result = _params call (missionNamespace getVariable [_function, {}]);
[_callbackParams + [_result]] remoteExec [_callback, remoteExecutedOwner];
usage:
[[_var1, _var2], "my_fnc_remote", [_var3], "my_fnc_local"] remoteExec ["my_fnc_remoteExec", _target];
what happens is:
- your local machine remoteExecs the
my_fnc_remoteExecon the target machine - when that function executes, it runs the
my_fnc_remoteon the target machine, using the[_var1, _var2]args you passed - then it appends the result to the parameters of the function that needs to be called on the local machine (
my_fnc_local) and remoteExecs it. - now the local machine can access the result by doing:
params ["_var3", "_result"]inmy_fnc_local
it limits the falling acceleration only
(negative acc)
yeah that's what I mean
i see, ill see what I can do with that example
so still limits the acceleration of nosediving planes etc.
to test this theory i shall try and nosedive a plane
yep.
(I replied to the wrong comment btw. I meant to reply to @tough abyss )
oh wow
you could put an upper limit on the acceleration
I tried with an A-10 and it didn't seem too noticeably different w/ a value of 5 for the new grav
but with a low value it might have... bad consequences
I mean I don't intend on nose diving with anything anyway
We probably won't have air support
@tough abyss @little raptor surely there's an internal value seeing as all objects seem to be falling at the same speed?
ive just tested it with a shit ton of them and all are hitting the ground at the same time
helis won't be able to lower altitude properly either... 
basically any object that willingly accelerates downwards will be affected
well you could ignore planes and helis with their engines on 
I don't think we're going to touch the skies tbh seeing as the op'll likely be set on a moon so
No atmosphere and tings
oh bruh thats interesting
hang on let me check im not seeing things
i think the MATV just hit the ground a second or two after a few others
yeah im definitely not seeing things
onEachFrame {
_dt = accTime * diag_deltaTime;
{
if (isTouchingGround _x || {
isEngineOn _x && {
toLower getText (configOf _x >> "simulation") in ["airplanex", "helicopterrtd", "helicopter"]
}}) then {continue};
_v2 = velocity _x;
_w2 = _v2#2;
_w1 = _x getVariable ["lastAcc", 0];
if (_w1 - _w2 > 5 * _dt) then {
_w2 = _w1 - 5 * _dt;
_v2 set [2, _w2];
_x setVelocity _v2;
};
_x setVariable ["lastAcc", _w2];
} forEach allUnits + vehicles;
};
DAGOR is hitting the ground before MATV and quad bike so either theres something I don't understand in your code or something I don't understand in how BI did 'gravity'
this code should ignore air vehicles with engines on
air vehicles with engines on dont need to be ignored for me though heh
likely wont be used
#screenshots_arma DAGOR is definitely below the MATV
thats after ive put the script on
all start from same altitude
they drop the same for me
or is that with the "low gravity" code?
with the low gravity one
just tried dropping from 1k+ meters and theyre remaining at the same height without so
idk whats going on there
ok whats even weirder is regular objects are falling slower than before too
even though they shouldnt be impacted??
any PhysX object and units should be affected now
im still using the old code lol
i'll try with the new one
ah yeah thats cool -- dagr is still falling faster than matv & quad for some reason though
surely there's just got to be some constant somewhere to change ๐
I don't think so unfortunately
i want to find out what gravityFactor does now
keep in mind even with this code drag can still make objects fall slower than the cap
can you not change the drag
oh man I need to wrap my head around this one.
If understand correctly _var3 is what data is being sent back?
yes, and the result will be added to that too
also one thing I forgot to say is that that code is meant for 1 remoteExec target
So what is my_fnc_local exactly?
a function 
that will be called on the PC that does the remoteExec
sorry for asking just this setup seems a bit more advanced than what im used too atm.
Ok I understand better now
basically the whole purpose of that code is to avoid waiting, as you wanted
let's say you're in function A right now (on the client)
you execute function B on the server. function A exits without waiting
once function B is executed, the server gives the result back to the client, by executing function C
I see, does that example always pass to the server?
no
another client
but it has to be 1 client
you can change it to support multiple
Ok thank you for the extended explanation.
but it gets more complex
it just changes gravity for the casings ๐
this is more descriptive I guess...
fn_remoteExec links A and B
fn_remoteExecCallback links B to C
the joys of remoteExec
uhhhh
uhhhhhh
@little raptor @tough abyss did you guys actually test setting the mass
while its not working for players its definitely having an impact on vehicles
but is it actually simulating low grav
using {_x setMass (getMass _x * 0.1)} forEach (allMissionObjects "All"); inside of a trigger with radio alpha (just so i can compare) and it does alter the 'gravity'
theoretically, i guess? if you halve the mass of something its downwards force will be halved which seems to be all the engine cares about
in the real world its different
force is halved but so is the mass so acceleration should still be the same
which is the problem leopard and I mentioned
yes
I set the mass of a tank to 0.1 and it fell the same way
but when it landed it started to bounce around
I'm using VR with a MATV and messing with it's mass driving it off a ramp
It's definitely going further
Setting its mass to 0.1 has funny results but I don't want it as 0.1 so ๐คท
so? it falls the same
is it going further because it's falling slower or going further because it's able to accelerate to a higher speed
yeah ^^
I suspect it's still falling at the same speed
I mean, either way it still has the same effect on the surface
yeah but the people in the op will think its low grav if i tell them it is
i dont exactly think theyre going to bother to calculate it

im timing it either way
why not just use the low grav script provided earlier
mp + fps
fair
if it was a single player scenario i would
ok yeah @tough abyss I think you're right, both are ~2 seconds of freefall so
Though I suppose I could try it higher up to reduce any uncertainty ๐ค
fuck it imma do that
Yeah +/- 0.4 seconds in my second test at ~8.5 seconds average so I think you're right
Either way it still has the effect of simulating low gravity
As for how I'm going to explain off players seeming normal ๐ค
you could potentially get the gravity script provided earlier to be performant in MP
but it'd take some remote execution and locality checks and etc.
and even then it would maybe run horribly
not to mention desync between clients
Yeah, unless BI let us just change the constant I don't think it'll be worth it beyond the "poor mans" route imo
Thanks for the help though both of you ๐
๐
Oh noob moment, but today I learned say2d is much slower than playsound
ah yes
say2D relates to the 3D world, playSound to UI only I believe, some "more straightforward process" in a way
not n00b
newbie eventually
After actually testing it in a proper situation I see what you mean now
People aren't propelling themselves off ramps to notice lower gravity, they're hitting bumps and stuff which isn't noticeable if it's only horizontal distance further
I'll experiment with trying to get your script somewhat working in MP but I doubt I'll be able to tbh
How can I put different squads' variables into a group?
elaborate?
I'm trying to create a "repair vehicle" script that will have the caller continuously do a repair animation while they are repairing the vehicle. I have tried several methods, and none of them have worked. This is one of them. The player gets stuck on the animation. What would be the best way to do this?
params ["_vehicle", "_caller", "_actionID"];
_vehicle removeAction _actionID;
_caller setVariable ["repairing", true];
private _repairTime = if ("ToolKit" in flatten getUnitLoadout _caller) then {
20
} else {
100
};
private _repairDistance = _caller distance _vehicle;
[_vehicle, _caller, _repairDistance] spawn {
params ["_vehicle", "_caller", "_repairDistance"];
waitUntil { !(_caller getVariable "repairing") || { _caller distance _vehicle > (_repairDistance + 2) || { _caller distance _vehicle > 3.5 || { !(alive _caller) } } } };
_caller setVariable ["repairing", false];
};
[_caller] spawn {
params ["_caller"];
while { _caller getVariable "repairing" } do {
if (animationState _caller != "ainvpknlmstpsnonwnondnon_medic_1") then {
_caller playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
};
};
};
for "_i" from 1 to 100 do {
if !(_caller getVariable "repairing") exitWith {
hintSilent "Repair Failed";
_caller switchMove (switch (currentWeapon _caller) do {
case "": {"AmovPknlMstpSnonWnonDnon"};
case primaryWeapon _caller: {"AmovPknlMstpSrasWrflDnon"};
case secondaryWeapon _caller: {"AmovPknlMstpSrasWlnrDnon"};
case handgunWeapon _caller: {"AmovPknlMstpSrasWpstDnon"};
case binocular _caller: {"AmovPknlMstpSoptWbinDnon"};
});
};
hintSilent ("Repairing: " + str _i + "%");
sleep (_repairTime / 100);
if (_i == 100) exitWith {
_vehicle setDamage 0;
hintSilent "Repair Finished";
_caller switchMove (switch (currentWeapon _caller) do {
case "": {"AmovPknlMstpSnonWnonDnon"};
case primaryWeapon _caller: {"AmovPknlMstpSrasWrflDnon"};
case secondaryWeapon _caller: {"AmovPknlMstpSrasWlnrDnon"};
case handgunWeapon _caller: {"AmovPknlMstpSrasWpstDnon"};
case binocular _caller: {"AmovPknlMstpSoptWbinDnon"};
});
};
if (animationState _caller != "ainvpknlmstpsnonwnondnon_medic_1") then {
_caller playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
};
};
_caller setVariable ["repairing", false];
_vehicle addAction ["Repair Vehicle", "jump.sqf", nil, 1, false, true, "", "vehicle _this == _this", 3.5];
I've just tried so many different ways of "after the player finishes the animation, make them do it again until they are done repairing the vehicle", and none of them work...