#arma3_scripting
1 messages ยท Page 163 of 1
_player setVariable ["asd_initialPos", getPos _player]
Yes
Not the most impenetrable of obstacles
and how do i do the stement then?
And if is skipped completely (no then nor else executed) because your statement returns nil which mutes any command it is used in. So both then and else get nil and do nothing
Oh you also need _player there
I guess MEH args is the way then
Actually, you already use global vars for the MEH, might as well have initial pos and player there too
TAG_player = _player;
TAG_initialPos = getPos _player;
if ((TAG_initialPos distance (getPos TAG_player)) < 3) then {
Or move everything into MEH args and use _thisArgs
Why does it have to be that complicated?
But thanks. It works
What Sa-Matra said is correct. Just alike an addAction when you use an inline code block, within the command; you are still spawning an entirely new script.
Its not complicated, there are tons of ways to pass data to a new scope, its up to you to design your scripts using either way.
I am new to arma scripts that's why I don't know much about it
I have to learn
Event scripts are all executed in a brand new scope, you need to keep this in mind
if(thisDoesntExist == 1) then {
systemChat "123";
} else {
systemChat "321";
};
// Nothing is printed into chat
If this is called in scheduled or some UI unscheduled contexts it will also fire an error, but in usual unscheduled context it just mutes any commands.
The script is triggered with a task, can I prevent other players from triggering the task too?
Like the task disappears while a player is using it?
Yea, you'd likely either want to have some sort of variable broadcast over the network or remoteExec to handle that.
// Variable on taskNPC is available to all clients
taskNPC setVariable ["complete", true];
// Executes a script on all clients
// Alternatively could change -2 to individual players nearby by getting distance of allPlayers or using nearestObjects.
["complete"] remoteExec ["TAG_fnc_taskManagement", -2];
OMG YOU ARE FANTASTIC
Can I marry you? Platonically?
How does it function? Sadly there is no documentation included
There is documentation included, its inside the script file
ah okay thanks!
You need Arma 3 tool's Object builder.
You need to download that whole git repo into a folder.
And then do like described here https://github.com/reyhard/o2scripts/pull/3/files#diff-ac7dba5b5ab1627b6c5b9726f39e57f3e8f55490971443f2622585332da537f8R9
You'll probably not know what to do at
Before you run the script create your LODs, the proxies will be placed in all lods, you will want 0.0 and Geometry at minimum (unless you want the object to have no collision)
I don#t remember how to create LODs in object builder, but #arma3_model will know
I will try my hand at it once I get home
just a couple hours to go
Ill tag you once I figure it out or someone explains it if youd like
Only for clarification. The script should work in multiplayer right?
(when triggered from an Action)
Why do you remote exec it if you start it from action?
Do you want all players see the same progress bar?
Actions are all executed on client who pressed the action, no need to remote exec it then
oh, ok
hello friends, How do i get the Client to onMapSingleClick poisition in a DED server
ofcorse Arma 3
you want to send position from client to server?
yes
onMapSingleClick
{
[_pos] remoteExec ["HereComesThePosition", 2];
};
``` and server must have HereComesThePosition function defined
ahh i see ok cool
sweet m8 thx
totaly awsome my friend thx
i love you man lol it works awsome WooHoo yeah Arma 3
Is there a sane way to control artillery/mortar gun elevation/azimuth without getting into animation manipulation? Trying to make a gun line that can be controlled from a single position (without artillery calculator)
question, I am making a different Fulton Script. I am currently having 2 issues:
- The Baloon, changes its size to what I want, and than changes it back to its default size
- After line 80, players are moved into the transport aircraft. But something damages the players and the aircraft making it almost explode and go down.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
How can I detect if an AI unit is of class Sniper, MG, or Medic?
"Role" entry in config
It's static tho. If the unit changes loadout he still retains his original role
If his role is sniper, he's called out by AI as "sniper" even if his loadout changed?
Yes. That's not the role tho. That's the textSingular/textPlural entry
Thanks.
heyo folks. i'm trying to make a small SP mission, and i'm starting the mission out by having a squad gather up, then heading over and waiting for an inbound helicopter. Right now, the helicopter will behave normally by landing and letting AI board, if timed correctly. However, if the player takes too long to go to their squad and too long to move over the the landing site for the helicopter, the helicopter will take off again 2 - 3 seconds after touching down. It will only stay down if anticipating someone boarding it. (Get in WP)
So what i'd like to have the helicopter do, is stay on the ground, until everybody has boarded the helicopter. How do i go about this?
Hi guys trying to use the "LoadMagazine" command to change the ammo in a vehicles turret, currently trying to just change a slammers tank ammo from AP to HE using either of the following but neither is working. The online documnetation says use the magazine not ammo type so tried but that dident work. So I tried the ammo type instead still no.
(vehicle player) loadMagazine [[0], "cannon_120mm", "16Rnd_120mm_HE_shells_Tracer_Red"];
(vehicle player) loadMagazine [[0], "cannon_120mm", "Sh_120mm_HE_Tracer_Red"];
You don't need to turn off the engine
copy that Leo
Just setFlyInHeight and force it helo setFlyInHeight [0, true]
I have got really really good help in here with a script with a spawn reinforcements function. It is working in ONE mission, I have tried it on other missions with no luck at all. I have no Idea why it just works on one mission and I'm all out ideas to test so I need your help, for real, I will gladly send some coffee/beer money for the help cause this is so god damn important to me.
I have made 2 zip files that contains all that's needed
Regarding the script, when I say it doesn't work, it means that the "function" Call reinforcements isn't showing in scroll wheel menu
So, do i put this in the condition/on activation of the Waypoint? But also how does the helicopter know when to takeoff again?
now were talking more scripting
No you need to wait until it touches down
Then setFlyInHeight
Then wait until all units are on board
Then undo the setFlyInHeight and it will take off to the next waypoint
Yeah, the helicopter is landing, then either waiting for a Get in WP, or for everyone to have boarded, to then move to the obj
oh this is singleplayer oops
Your turret path is most likely wrong
I assume i can undo the setflyinheight, by having a trigger fire, after the last member of a squad has entered the helicopter?
Well you just need a loop. It can be a trigger
This is the condition (meaning all alive units are on board)
[u1, u2, u3] findIf {alive _x && !(_x in myHelo)} < 0
In the statement, do myHelo flyInHeight 50 (or try forcing it if it doesn't work)
u1, u2 u3 are the units that should board
myHelo is the var name of your helo
I do apologies for the questions really, i dont wanna constantly pep you with them. So I've put down a simple trigger, for this
i have all unit names listed there, and set the trigger to skip waypoint upon completion, but i assume this wont be enough?
What is your whole setup again? (Other related triggers/waypoints)
Right now, it's set up so that The player, along with the rest of the squad joins up with the Squad lead
Which is on a hold WP, until the player arrives, then he will move to a new hold WP to "wait" at the Helipad. This Hold WP will skip once the helicopter comes down to land
So yeah, in the off chance that the player doesnt get a move on very quickly, the squad lead wont move to the Hold WP in time, thus it wont prompt the Heli to stay on the ground.
And i'm not sure how to keep the heli forced on the ground, with the SetFlyInHeight. What would i need to do to "spawn" the script?
Anyone found a workaround for magazine deletion bug when reloading?
Update your arma, there was an update today that fixed it
I used a command to chck the main turret turret path and it said 0 ๐ฆ
still have the issue
there is no update for server side right?
Yes your server needs to be updated as well
This
(vehicle player) weaponsTurret [0];
returns this so I think [0] it should be the main turret
["cannon_120mm","LMG_coax"]
If you're still having the issue after updating your server and clients then leave a comment on the feedback tracker
https://feedback.bistudio.com/T185261
Okay, so i put the findIf Alive command in the trigger next to the helipad and given the Heli the appropriate var. The helicopter now stays landed, as the waypoint wont skip. Problem is the Squad lead moves towards the helipad before the player has entered the trigger that removes his first Hold WP.
Edit: Ah i see, I have 2 triggers that skips the waypoints for the squad lead, because i have 2 hold waypoints. So if the player takes long enough, the skip waypoint trigger on the helipad will delete both hold WPs and the SL will board the helicopter without everyone else, and you're blocked from completing the mission (Unable to board.)
Ah, helicopter stays grounded regardless if i have boarded it or not lol.
You mean the heli has already landed from the start?
Apologies if i wasnt clear, but no. It starts some distance away.
tbh since I'm not a mission maker this whole mess with triggers and waypoints seem too overcomplicated to me
You can just do this which is much simpler:
- For the part where you have to go to heli to get in, simply use a Move waypoint, with
isTouchingGround helias its condition. Followed by a get in waypoint - For helicopter landing and waiting, then moving to next waypoint:
Put down an invisible helipad where you want the heli to land and name itpad
Then add 2 Move waypoints to the heli. One to where you want it to land (wherepadis), the other to the next destination
In the first waypoint activation statement, use this:
[] spawn {
heli landAt [pad, "GET IN"];
heli flyInHeight [0, true];
waitUntil {
sleep 1;
!alive heli || [u1, u2, u3] findIf {alive _x && !(_x in heli)} < 0
};
heli flyInHeight 50;
};
This will make the heli move there, land, wait for everyone to get in, and finally take off and move to the next destination
Ill have to get back to this one tommorow as im done editing for today, but I appreciate the help thus far. ๐
Bohemia recently broke something in initialization?
my mission was working perfectly fine like 2 years ago now it's full of bug
some clients crashing just after the download of the mission, initPlayerLocal.sqf is not even executed
does this show to all on DED server,,, Pilot2 globalChat "BlackHawk Must Be Empty Before You Call Insertion Chopper";
and hello again
maybe not i guess
im exec it from the server
Arma3 ofcorse
no
see https://community.bistudio.com/wiki/globalChat - local effect (aka only on the machine that called it)
if it is in a waypoint, I believe it execs on all machines
no its in a script
i never use waypoints my missions is to dinamic
ah i see thx Lou awsome
"Message 1" remoteExec ["systemChat"];
"Message 2" remoteExec ["systemChat"];
// will result in
// "Message 1"
// "Message 2"
// in this exact order on clients
There was bug with mission files just not downloading at all for some players.
If you are getting crashes, send me the crash reports.
Could it be that the players are on a different terrain, and don't even get the mission file?
ok i completed all the changes to all the system chat stuff here goes 1st test, keep your fingers crossed he he i love it
ofcorse it all works thx Lou: and all you awsome guys: i love you guys !!!
i did change one thing i had to add a littel more hight to the water insertion chopper script
or should i say to the water insertion part of the script
thx againe you guys for all the help you guys have givin me, really i love you guys thx again
Does anybody knows, if there is a max. length of "GroupID"?
Any idea why the ballon returns to its original size essentially immediatly?
https://pastebin.com/GxcYzFA8
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
some command maybe
Well ye probably, but what
setdir? i had this issue but forgot which command it was
I am not suing setdir command. Or are you saying I should use it?
no
My script spawns a drone
spawns Balloon, disables its damage and than simulation.
Than attaches it to the drone and sets ballon scale to 3.
few seconds later to 5 and than 10.
Is the order wrong or smth?
It works in SP
oh then check the commands locality
you might need to remoteExec some of the commands
Maybe, but in MP, it would change its size to desired one for a frame, and than it would go back to normal size. And other people could see it as well. So the command did execute for everyone. Its just reverted for some reason
hmm
my guess is you have a drone and you are attaching balloons to that drone and changing their size.
Because Drone is moving you are gonna have to update size of balloons each frame or in while loop. So they would be custom size even when moving on a drone.
I thought that too, but according to the wiki
// multiple MP-compatible options
// global simple object
private _globalSimpleObject = createSimpleObject ["C_Offroad_01_F", getPosASL player, false];
_globalSimpleObject setObjectScale 0.1; // once is enough as long as it is not moved
// local normal object
private _localNormalObject = "C_Offroad_01_F" createVehicleLocal getPosATL player;
_localNormalObject attachTo [player, [0, 2, 1.5]]; // normal object must be attached
_localNormalObject setObjectScale 0.1; // once is enough as long as it is not moved
// local simple object
private _localSimpleObject = createSimpleObject ["C_Offroad_01_F", getPosASL player, true];
_localSimpleObject setObjectScale 0.1; // once is enough as long as it is not moved
I assume mine would fall under "// local normal object"
oh wait
as long as its not moved.....
But I could swear I could change it in zeus manually and it should stick
okay nvm I will try eachframe....doesnt wanna work either
The wiki for setObjectScale isnt 100% accurate. I would suggest trying to use a simple object instead of a vehicle (you can still use the classname) and see if that works. If not then create a simple object and updates its position each frame instead
whipping up a little puzzle segment. just looking for some advice on the section.
6 switches, combination code.
current thought process:
make an empty array.
flipping a switch puts a number into the array.
trigger evaluates the array and if its incorrect then resets all the switches, if correct sets the task as done and procedes the mission
but how to weave in instant feedback? so rather than wait for all 6 inputs, how would i make it check for every input
Make a function for setting a value in the array, then have each switch call that function (i.e. through an addAction).
Have your function save that input. If the input is correct, you could display a hint or something
// initServer.sqf
// three inputs for example
TAG_correctInputs = [0, 0, 1];
publicVariable "TAG_correctInputs";
TAG_leverInputs = [0, 0, 0];
publicVariable "TAG_leverInputs";
// fn_flipSwitch.sqf
params ["_index", "_value"];
TAG_leverInputs set [_index, _value];
publicVariable "TAG_leverInputs";
if (_value == (TAG_correctInputs select _index)) then {
hintSilent "Correct";
} else {
hintSilent "Incorrect";
};
if (TAG_leverInputs isEqualTo TAG_correctInputs) then {
// sequence is correct
};
Wrote that on mobile, could have some syntax issues but should be mostly correct
You could do true / false too, 0 / 1 was just less to type
i started constructing a similar setup. ill have a look at what you have sent over
ty for the help
My brain is being stupid today.
I want to create tasks for an op with an investigative theme to it. I would like to use scripts such as Hold Action or trigger areas to make the tasks appear to players and then change their status (completed/assigned/cancelled/failed, whatever).
What I don't quite know how to do is what the line of script is I'm looking for to say hey taskName1 you are now visible all players or hey taskName1 you are now marked as COMPLETED to all players
Can someone point me in the right direction? I'm not even sure what to look for on the wiki.
surely index would be something counted from the first input rather than set from an addaction
while the value works. index doesnt
as this solution simply works for a correct combination. not if in the event the combination is wrong
hey taskName1 you are now visible all players
Try to change owner.
hey taskName1 you are now marked as COMPLETED to all players
https://community.bistudio.com/wiki/BIS_fnc_taskSetState
if i remove _index from the script params and instead just have it be a variable that is ticked up every time the func is called then reset with the lever inputs when it fails it could work
Is it like a combination lock? That's what I assumed from your description.
I.e. three levers and the correct order is something like: down down up.
_index would just be a number (starting from 0) to mark each lever.
So if you had three levers on a wall, the first would pass [0, _upOrDown], the second would pass [1, _upOrDown], and the third would pass [2, _upOrDown]
Essentially are you wanting them to be pressed in the correct order or just that they are in the right state?
correct order
ive got it working, now its just animating the levers which isnt working
if !(isServer) exitwith {};
this addAction [
"flip switch",
{
params ["_target", "_caller", "_actionId", "_arguments"];
[3] call CBB_fnc_puzzle;
this animateSource ["switchposition",0];
this animateSource ["light",0];
[this, "OFF"] remoteExec ["switchLight",0,true];
},
nil,
1.5,
true,
false,
"",
"true",
3,
false,
"",
""
];
this is what the addaction looks like
initserver.sqf
TAG_correctInputs = [1,3,2,6,5,4];
publicVariable "TAG_correctInputs";
TAG_leverInputs = [0, 0, 0, 0, 0, 0];
publicVariable "TAG_leverInputs";
TAG_leverInputs_index = -1;
publicVariable "TAG_leverInputs_index";
switches = [switch_1,switch_2,switch_3,switch_4,switch_5,switch_6];
function
params ["_value"];
TAG_leverInputs_index = TAG_leverInputs_index + 1;
publicVariable "TAG_leverInputs_index";
TAG_leverInputs set [TAG_leverInputs_index, _value];
publicVariable "TAG_leverInputs";
if (_value == (TAG_correctInputs select TAG_leverInputs_index)) then {
hintSilent "Correct";
} else {
hintSilent "Incorrect";
TAG_leverInputs_index = -1;
publicVariable "TAG_leverInputs_index";
TAG_leverInputs = [0, 0, 0, 0, 0, 0];
publicVariable "TAG_leverInputs";
{
_x animateSource ["switchposition",0];
_x animateSource ["light",0];
[_x, "OFF"] remoteExec ["switchLight",0,true];
} forEach switches;
};
if (TAG_leverInputs isEqualTo TAG_correctInputs) then {
puzzle = true;
};
ive tried _target and _this select 0
Not sure about the animating part, can't check, but you could simplify the logic by just keeping all the current inputs in an array (which it already is), and then just checking if the last 6 elements are correct
im not sure how as right now with the index ticking up. if its incorrect it resets and if its correct it keeps ticking up. once it has hit all 6 correctly it sets a variable true which lets the mission progress
if someone screws up then id want it to reset. trail and error and paying attention to clues then makes sense
I'm not saying you have to change it, could make the logic simpler
Not sure how to write it out properly but like:
private _lastSequence = TAG_leverInputs select [...]; // last six elements in the array
if (_lastSequence isEqualTo [1, 3, 2, 6, 5, 4]) then {...};
Would save you having to track the index
And you know if the array is less than six elements, then it also can't be right
If it's working now, you could just leave it
or keep an empty array, and check elements when they are 6 - if incorrect, reset to an empty array
this resets values and prevents from having "sliding" acceptable values
for the sake of user feedback and speed however, id rather it be a case of "hit lever 1, lever 2, oh shit lever 3 didnt work as they all reset so it must be another" problem solving for players
rather than inputting 6 levers to find out its wrong
forgive me if im reading what you guys are saying wrong
IDK what you want ๐
lou, we have made flying carriers. i cant make a simple puzzle made for 3 year olds
i just want a combination of switches to work
and if any are out of order it resets
that is all
- input 6 numbers
- if 6 wrong, reset, else open
- input any numbers
- if the last 6 entered digits are OK, open
- input 6 numbers
- if one of them is wrong, reset (w/ feedback to the player)
(F Discord formatting)
last one
then have a fixed array (the code), and you can use the index as you said
- if input nยฐ0 != arr select 0, reset
- if input nยฐ1 != arr select 1, reset
and if input nยฐ5 is OK, ding ding ding we have a winner
so with the prior conversation with dart. it works as of current. for my own learning sake. what is more optimized / better about this approach of evaluating the last 6?
rather than just feeding it each time until it spits it back out
why do you want to check the last 6 ๐ ๐
logically, you do not have to check that "previous 6 chars were OK", rather "last 6 inputs were not errors" ๐
idk. i was confused over this
otherwise the issue was just animating the levers which ive now fixed
i cant remember what its called but basically the addaction was faster than the function to flip the switch was the issue ive just solved
Does anybody knows if there is a possibility to rapify sqf files? I just found a (working) sqf file which seems to be rapified
Unfortunately this doesnt seem to work, the helicopter does not land. I've set the 1st move waypoint for the heli directly on top of the helipad, marked the helipad with the variable. but the helicopter goes past the helipad, hovers for 30 seconds, and then gives me an error messages, followed by going to the next objective. The infantry will go to the move marker and display "wait" next to the helipad, waiting for the heli that will never land.
Actually nevermind, I realised what the problem was like 5 minutes later, i didn't define all the variables in the script. So instead of the default "heli", i needed to put in "myHelo" which is the variable name of the helo. And now it works flawlessly, thank you very much. ๐ Edit: Well while the loading procedure works, after the infantry squad has disembarked the heli, the heli will fly a little bit up into the air and just go around casually hovering over the landing zone, not really following the next waypoint to get away from the combat zone, i suppose the aforementioned script has something to do with this?
rapify : binarise
you can't binarise sqf files
the maker probably used defines to obscure it
raP only applies to text with class statements basically
hello again Arma 3 friends
if im useing a chopper script, that has the chopper name _heli,
how would i move the player in the Cargo of the chopper on DED server
i can't seem to get it right
im useing a addaction script from the flagpole, what should i put in the script
this is what i have so far
it seems to me this should work
@pallid palm post everything when asking questions
http://pastebin.com/k88fdC7z
This is the mentioned sqf file
Depends where you've placed the waypoint
Is it far away from the landing zone?
Did you use the same skip waypoint stuff (which as you said yourself was deleting more than 1 of your waypoints)
All I can say is that it's not related to what I wrote. If it was the heli wouldn't have moved at all
sure but the engine wont be able to use that as a sqf file
I can load in that sqf file
in what sense? sqf files are loaded as a string and then compiled and interpreted by the engine.
If i take this script, put it in a pbo and make a entry in the cfgfunctions it will be parsed
The pbo itself can't be opened properly. There are a few errors during opening the pbo
could be that the file in the pbo is correct but the pbo is obfuscated so the opened file seems to be corrupted
Any way to fix
toString [34];
Returning 2 double quotes ("") instead of one (")?
wat
toString [34] is meant to return one double quote mark ("), but sometimes returns two ("")
maybe it's ' " '?
Nope
if I run it like that it gives me " "" "
And other times gives me the correct single double quotation mark
toArray toString [34] correctly returns [34]
so I guess it's an output printing issue.
well, " "" " is a somewhat correct escape option as well, no? https://community.bistudio.com/wiki/String#Quotes_in_Quotes gives private _string = "my string ""with"" quotes";
Yeah that's what I think is happening
What are you actually using it for?
Still completely messes up my script
Taking an array of typeOf elements and then doing a whole lot of filtering and styling
Unfortunately removing the 34 from the toString array doesn't work and returns the array of typeOf but without any (") separating them, just blank classnames
If you want raw text output then you can do text toString [34]
i mean, given that "" is escaped " you have 'U_IG_leader", U_I_CombatUniform_shortsleeve", U_I_Uniform_01_shortsleeve_F' when converted to ' string
and having single instance of " does match your code
Yeah no I worked it out as I was typing a reply to this
That's 1 double quote, just escaped
The issue was caused by me using
copyToClipboard str T1UF
Removing str fixed the issue immediately
Thanks for the help and guiding me there!
I only used skip waypoint triggers on the squad leader of the infantry squad. The helicopter never had any. The next move waypoint is halfway across the island which might be 1 km? And then the next one is a get out command at the airfield. (Cause i dont know how to despawn stuff just yet.)
Something is causing the helicopter to stay put above the landing zone, i didnt have a problem with these waypoint markers before the script was used, so i assumed the ai of the heli got confused after the infantry left? How to fix it im not quite sure. Hope it makes sense. As said before the script works perfectly when picking up people. ๐
That's weird. I'll check.
BTW are those u1-u5 and e units in the same group?
I did a test and it works fine
I used a transport unload waypoint for the heli, followed by a move waypoint, and it moved away
Wish Deleted event handler worked on simple objects, would be so useful
They all start on their own, but they link up together before boarding the helicopter. Are multiple waypoints over to the objective going to be an issue? I have 2 move markers before the helicopter lands at an lz to drop off the squad
So they are in the same group? If so you don't have to name them individually. You can just name the whole group and do units myGrp findIf ...
Also regarding the heli, no it works fine no matter how many WPs you have before drop off
Do you also use the transport unload wp for dropping them off?
Yup. It lands just fine allowing the squad off, for some reason it just decides to hover in the air above the lz afterwards. Ill check on the scenario again when im home
I'm not quite sure what you ran into but it's not raPified. might be .ebo but i dont have any .ebo files on my pc currently
ebo?
the encrypted .pbo type BI uses for new DLC
alternative file pbo encoding? or what is this exactly
ah. any way to make a ebo or unpack a ebo?
I also think its stupid to encrypt stuff but thats another topic
That shouldn't compile.
I don't want to encrypt, I want to decrypt that pbo. It's not from arma files, it's from a server
if it actually is an encrypted file, which im still not sure it is if its an sqf, its encrypted for a reason
the license would definitively not allow you to decrypt it
There is no real license
Is the function defined when you point it to that file?
nope
...
If i take this script, put it in a pbo and make a entry in the cfgfunctions it will be parsed
whatever you think this file is, its not a raPified sqf file
hm, strange
Some other script might loadFile it and parse out itself.
could anyone help me, putting images on screens??
private _pic = findDisplay 46 ctrlCreate ["RscPicture", -1];
_pic ctrlSetText "\A3\EditorPreviews_F_Orange\Data\CfgVehicles\Land_Pumpkin_01_F.jpg";
I put this in the init of the screen?
no, in init.sqf you need to wait until display is done loading first
waitUntil {!isNull findDisplay 46};
private _pic = findDisplay 46 ctrlCreate ["RscPicture", -1];
_pic ctrlSetText "\A3\EditorPreviews_F_Orange\Data\CfgVehicles\Land_Pumpkin_01_F.jpg";
whats the variable name for the screen?
There is no such.
I think there's been a misunderstanding. I don't think they want to put it on the player's screen, I think they want to put a picture on an in-game screen, like a monitor object
yeh on an object
not my screen
Usually that's done with setObjectTexture/Global, provided the object is set up with the appropriate selections
yh im trying to do it with gpt atm i think im using the wrong file path
im not using the sqf just where to go
If you're working with an Editor object, a lot of relevant object types have a field in their Attributes for setting their screen texture, so you don't need to worry about the script, just the file
Are you trying to use an image that's included in the mission, or one from the base game/a mod?
just trying to add one from my files a custom one in a cutscene
Okay, but any file you want to use must be either part of an addon (the packages that make up the base game and mods) or part of the mission (included in the folder that contains the mission.sqm). It matters which of those two options it is, and you cannot use files that aren't in one of those two places.
yh ive placed it inside the mission folder im thinking im using the wrong file path
The path uses the mission folder as its root. So if the file is in the base level of the mission folder, then the path is just "picturename.paa". If it's in a subfolder, then the path is "subfoldername\picturename.paa"
does it need to be a .paa?
It can be a jpeg, but PAA is recommended. Other types aren't supported. There's a converter in the Arma 3 Tools package available on Steam.
The image also needs to conform to specific size rules: both dimensions' pixel lengths must be powers of 2. Not necessarily the same power of 2 - e.g. 256x512 would be accepted.
ive got them to paa but its still not working
its just a white screen
i think i might be in the wrong game folder
Could you provide the path to the file, screenshots, error messages... Or should we guess?
hello, do you know how to add a sound when changing gear on a vehicle?
Just to clarify, does this mean it's just showing a white screen, or that you just want a white screen? Because the latter can be done by procedural texture and then we don't need to deal with any of this
no i dont want a white screen i want the image on the white screen but its just showing a white screen
hold on ill take a ss
Okay, just checking
Did you make sure the image follows the size rules I mentioned before? They really do matter, it will legitimately stop it from working completely, not just result in a stretched or squished image
Not to me, I'm on my phone :U
the dimensions i dont think are to the power of 2
They absolutely must be otherwise it will not work
ill get a differnet image and see if that works#
1920x1080 is that to the power of 2
math isnt mathing atm
No.
ffs
The requirements for textures are described here and in the related article: https://community.bistudio.com/wiki/setObjectTexture
Provided it's a PAA or JPEG
From BIKI:
All textures must have a resolution of 2^a ร 2^b (e.g. 16ร16, 16ร32, 64ร256, 512ร512, ...).
(and if PAA, converted properly, not just changing the file extension by hand)
and paa better, since jpegs might not render properly and your whiteboard will be a blackboard for people who did not walk close enough (or zoom in)
i put it in and its not showing a white screen anymore its just the normal screen
BTW, just a little advice, not related to this issue specifically - it's not recommended to have A3 files, including your profile files, in areas managed by OneDrive. OneDrive's activities can make it difficult for Arma to access files when it needs to, which can lead to corrupted profiles.
that would have been great to know before all of this
all of my stuff is in a onedrive i think
yh
Well, I didn't notice it until you posted the picture of the file path :U
Some might say any change is a good change.
Double-check everything - dimensions, valid correct file type, it's in the right mission folder and you have the right mission open in the game
cause my main directory of steam-steamapps-common-arma3 doesnt have any of the missions in it
Don't worry about that right now, that's just something to investigate later. (You might be able to exclude specific folders in the OneDrive settings or something, but that'll be for another channel)
ive followed multiple videos and nothing works fr
doesnt arma have issue reloading graphic files ?
just a white screen
How are you applying this texture? Object's Editor attributes? How did you convert it to PAA (if you did)?
i used a website to convert it
im using the object specific
im using the rugged large screen and using the object specific at the bottom of the details and just putting in SCP.paa with the same file in the mission folder
How do i silently make all AI of a group change side?
https://community.bistudio.com/wiki/joinSilent join to group of other side
Your 512x512 image is only 24 KB? That's a little suspicious
Would this make all the ai in the group change at once or should I do it one after another?
It takes an array of units so just give it units _group
i think its something with the files
cause everyone saying i have to go to arma 3 other profiles but i dont have that
New to scripting. I would love to talk to someone who knows how this works. Dm would be prefered to not interrupt the public chat
If you can open your mission in the Editor, and that init.sqf etc are working, then you're in the right place
Whats your query ๐
The Other Profiles folder only exists if you have created an A3 profile other than the default one. If you're just using the default autogenerated profile (same name as your Windows username) then you have no other profiles, you're in the right place.
Can I dm you?
Sure
cause i looked at another screen that worked by default and it had the file path of a3 as the beginning but idk where that is
yh my al intro works so i guess im in the right place
That's a file that's part of the base game.
Your files are not part of the base game so they don't go in the same place.
roger, i just dont know why nothing is working
it seems like a problem with the file know but idk what
you said that 24kb for 512x512 is suspicous
maybe i could try another file?
Suspicious but not conclusive, it's a little lower than I might expect. Depends on the image though. It's possible it wasn't converted properly, I don't necessarily trust unknown web converters.
I'm on my desktop now, you can send me the original image and I'll run it through the BI conversion tool.
* I don't mean the very first one that was the wrong size, send me one that's the right size but before conversion to PAA
Wow, I don't know the last time I saw a JFIF
Yeah the BI converter doesn't even support JFIF. I'm going to convert it to something reasonable in Photoshop first, but that might be a clue that it didn't convert properly in the web converter
roger
Right, so the main lesson here seems to be "don't use JFIF for this". It did not originally want to convert and had to go through some intermediary steps to be acceptable.
Definitely start with a JPEG or PNG and convert from there to PAA.
ill try and find a file thats peg
The Rugged Large Screen is actually not a square texture, so I've taken the liberty of sizing it properly for you.
ok thanks
huh, looks like I didn't quite match the shade of black on the background properly. Oh well, I'm sure you can figure that part out ๐คท
hmm still not worrking youve done alot so dont worry ill just try something else
Can you tell me exactly (I mean exactly and in full) what you're putting in the file path field in the Editor?
I ask because I tested myself before sending that
Remove the quotes
yh i didnt put the quotes in
You had another SCP.paa previously, one of the non-functional ones, right? I assume you overwrote it with mine.
Arma caches image files when they're first loaded, and if you tell it to load another file with exactly the same path, it will use the cached version. Rename the file and try the new name, or restart the game.
yh i overwrote and deleted the other scp.paa's
Yeah, so Arma's probably gone "oh, scp.paa? I've already got one of those in memory, no need to fetch it from disk again" and continued to use the old broken file. Try it with a new name, or restart to force it to reload the file.
im restarting atm ill tell you if it works or not
thanks for all of this tho
omfg it actually works
thank you so much
genius
Is there a way to disable an objects friction, but keep it being collideable? I can do any changes .p3d or just scripting, but would prefer a scripting way if possible
I believe friction is not adjistable
I'm trying to emulate players movement with an object, but it just keeps falling over due to friction
Why is this throwing an error O.osqf _tempVeh = ["B_Quadbike_01_F", mapclick_pos, [], 0, "CAN_COLLIDE"]; createVehicleCrew _tempVeh; Error in expression < mapclick_pos, [], 0, "CAN_COLLIDE"]; createVehicleCrew _tempVeh; Error createvehiclecrew: Type Array, expected Object
wait im dumb nvm
- didnt' create a vehicle just an array lmao
... Make it float?
just complicated due to stairs etc but yeah
but the whole thing is complicated, so that's not really an excuse
I guess you could to surfaceNormal?
Most stairs should be geo'd as ramps anyway
Would be a shit geo lod if they weren't
Waste of components
You could enableSimulation false on the object while moving it, and then it should visually move without falling over. If you need it to have physics when stopped then enableSimulation true again. Which object?
disabling simulation is not an option unfortuantely
it will break the fundamentals of the system
I'll send a video soon explaining better
Here is the starting workings for an advanced Zero Gravity script I am developing.
Issues trying to resolve
-
setAngularVelocityModelSpace Sometimes does not correctly return the angular velocity to [0,0,0] in reality, but displays [0,0,0] when checking via angularVelocity
-
You can't glide very well when "attached" to a surface, as friction m...
@foggy stratus
i guess they encrypted the whole file this time with these ebo files? old arma 2 dlc only had an encrypted header ๐
Check the description for a list of issues I am trying to resolve
Wow, cool concept. Maybe take a look at alias's floating objects scripts. His aren't trying to thread a needle like you, but maybe there is some trick in his approach that can help you. His demo mission is here. https://steamcommunity.com/sharedfiles/filedetails/?id=1387052380
POPLOX have you received a report about https://community.bistudio.com/wiki/setAngularVelocityModelSpace not correctly resetting the velocity when you set it to [0,0,0]. It does from the perspective of the angularVelocity command, but not in reality as the object keeps spinning
if not where would I create one
Have I... what? I'm not a developer
ohh I always thought you were apologies
mind pointing me in the right direction of where you can request new functions/features and more importantly where to report bugs
I believe it's the Forums, but was curious if you knew the correct categories just don't want to put in the wrong place
Here: https://feedback.bistudio.com/project/view/1/
Also you can see what bugs and features requests here:
https://feedback.bistudio.com/maniphest/
you have the code ? how you "attach it" to the wall?
WMO does that, and it works flawlassly somehow
https://steamcommunity.com/workshop/filedetails/?id=925018569
walkable doesn't work in the same way
but I'll take a look as it might help me work out a solution thanks
im not sure how WMO do it, but i guess you can replicate it for any surface in any direction
and yes I have the code been slamming my head into a wall the last 2 days working on it
great progress, but still some things I want to sort out
How can I get a "Hold Action" to execute on all players, including join-in-progress players who arrive later?
Like say I want to use a hold action to change a flag texture, or put intel in everyone's diary. I need it to run once on all machines who join or are already in-game.
Previously I had a problem where I used a hold action to change a flag texture, ergo raising a flag over a captured location. But then nobody else could see the flag get changed.
Pretty sure there's a global arg for hold actions
One of these days I'm going to understand how the fuck to use remoteExec intuitively. 
Right now I struggle to make sense of how to write it out correctly and outside of a handful of commands I can't seem to understand it.
Let's start with a simple example.
How does _myFlag setFlagTexture "\ca\misc\data\sever_vlajka.paa"; look in remoteExec?
But the effect is local: https://community.bistudio.com/wiki/BIS_fnc_holdActionAdd
[_myflag, "\ca\misc\data\sever_vlajka.paa"] remoteexec ["setFlagTexture"]; + targets/jip
Thinking of something else then
Okay so variable, the data I want to pinput, remoteExec, and then the command. I don't know what you mean by "targets/jip". Does remoteExec not cover people who join the game later?
_left command _right;
[_left, _right] remoteExec ["command",_targets,_JIP];```
It does, but you have to tell it to. ^Nikko shows it well there. Read the wiki for targets options
Just use remoteExecCall, it doesn't need to run scheduled
https://community.bistudio.com/wiki/remoteExec
By default, remoteExec broadcasts to all machines, but only once at the moment of execution.
It has optional settings to broadcast only to specific machines, and also to add the command to the JIP queue so JIP clients will execute it when they join.
Okay so let me try writing it up myself for that simple flag command, then I'll move onto something more complex.
Using it with JIP in my opinion can be bad depending on what you're doing. In your case it should probably be on. But if you were broadcasting something like damage, or something that really should happen once in that moment then jip will break things for people
Okay, will keep that in mind. Right now my use case is just visual stuff or diary entries for intel I want players to collect.
I'll get to the diary stuff after I first make sure I got the flag thing down
For the diary, make sure you check if the entry already exists so that people who leave and re-join dont get the same entry again
_myFlag setFlagTexture "\ca\misc\data\sever_vlajka.paa"
becomes
[_myFlag, "\ca\misc\data\sever_vlajka.paa"] remoteExec ["setFlagTexture",0,true];
so it executes on all clients, including JIP clients.
Is this correct?
A would replace true with _myFlag.
Yes.
But that field is for this
I thought
Read more.
Read closer: it can also be a String or Object, in which case the JIP entry gets a unique flag which can be overwritten if necessary, and if the object in question is deleted, the JIP entry is removed.
Ohhhhh.
Okay.
That makes sense.
You don't want to execute code if there's no need for it.
Be careful with this, especially in the case of objects, because if any other remoteExec uses that object as its JIP reference, it will overwrite anything that was in the queue before. For some objects this is more likely than others, but there is no separation for different script/mods or different commands being sent, so it's very easy to get accidentally overwritten.
yeah, I wish it wasn't "one slot" only
more like "provide an object" and get a JIPid AND get the JIPid removed if the object is deleted
In terms of converting to remoteExec, that command is actually the most complex it can get.
There are three kinds of SQF commands: nular, unary, and binary.
Nular commands require no arguments. They're pretty simple to remoteExec. e.g. disableSerialization.
Unary commands require one argument. Also quite simple to convert. disableUserInput true, for example.
Binary commands require two arguments, one on the left, one on the right. e.g. _object setPosASL _position. You've just figured out how to do that, and it's also pretty simple, right?
There are no commands which work on any other principle. Anything that appears to have more arguments actually still only has two - one of them will just be an array containing sub-arguments. That array is still treated as one argument for remoteExec; keep it intact and use the same rules as any other.
mfw
but I appreciate the help
So it sounds like my other need, which is to trigger diary entries, has to be done through some other means than remoteExec...
Nah, remoteexec it
Welllllll....I'd suggest making it into a function and remoteExec'ing the function, so you're not adding a full diary entry's worth of text into the JIP queue, but it is possible.
Well again using a hold action:
_caller createDiaryRecord ["Diary", ["Intel title", "Intelligence goes here!"]];
how would that look?
That is a binary command with two arguments, left and right. It's exactly the same as the flag texture command.
Yeah I realized the moment you said it, it's not actually as complicated as I thought at first.
Wait, shit. There is a problem. I need that intel to show up for all players. Uhh.
_caller createDiaryRecord ["Diary", ["Intel title", "Intelligence goes here!"]];
maybe becomes
[player, "['Diary', ['Intel title', 'Intelligence goes here!']]"] remoteExec ["createDiaryRecord",0,true];
That doesn't look right. Maybe ' instead of " but it still doesn't look right.
You've added an extra set of "" that do not need to be here
The left argument of createDiaryRecord is an object. OK, done. The right argument is an array. You don't need to turn that array into a "string" to remoteExec it. Just keep it intact.
Oh, really?
[player, ["Diary", ["Intel title", "Intelligence goes here!"]]] remoteExec ["createDiaryRecord",0,true];
Oh yeah, that makes more sense.
That being said, player is not necessarily the correct thing to use here. The command player will be evaluated (resolved into a unit) before the command is sent. So the other machines will receive the player of the sending machine.
To fix that, and also for other reasons, the best solution would be to turn this into a function (https://community.bistudio.com/wiki/Arma_3:_Functions_Library) and remoteExec that. Everything will then be executed locally to the receiving machine, and the receiving machine will already know what text to use so that doesn't have to be sent over the network.
I was about to say, someone once said to me player should "never be used online"
and I do not know enough to argue
All that being said though, I don't actually know what the object argument for createDiaryRecord even does. It may not matter what object is used. The wiki doesn't give a clear explanation.
That's not a rigid rule, you just need to understand how it works (which isn't that complicated). It's a command that returns the current local player unit, at the moment it was executed. Like getPosASL returns the current position of a thing at the moment it was executed.
The only player-specific behaviour that changes online is that it doesn't work on DS and HC machines, because they don't have a player unit. The other stuff is just a basic rule of SQF/remoteExec: anything not contained in a { code } data type is executed here and now (according to order of operations), which includes being executed before the remoteExec is sent.
remoteExec itself is also a normal binary command and works on the same rules.
// getPosATL player is resolved before createVehicle executes
_vic = createVehicle ["Land_FieldToilet_F", getPosATL player];
// player is resolved before remoteExec executes
[player, 1] remoteExec ["setDamage"];```
havent really looked into it
encryption is dumb in most cases
(with regards to arma modding that is)
@warm hedge Just want to say again how much I appreciate your animations viewer and animations. I salute you sir! ๐ซก
Anyway have an idea why my helicopter is not going to waypoint 2,3,4 on dedicated. But it is working in editor and when locally hosted: http://pastebin.com/uPPyX9k6
anyone*
On dedicated it moves to waypoint 1 and stays there and hovers
Hi guys,
I need some help here with this code
waitUntil {
({alive _x && _x in _heli} count units _taskforce1) == count units _taskforce1
};
What I am trying to do here I put a waypoint for my helicopter to land and pick put my group or who's still alive in my group. the point when I put this code in the waypoint didn't work. It landed but after we rode the heli it didn't move the next waypoint and I don't know what should I do to fix?
You don't need waitUntil.
I had tried this before that but it didn't work either.
Where is the code inserted?
Screenshot?
Oh, dude! Thanks a lot, it works now. I wrote something wrong I think and I couldn't see it initially. I can't believe that I spent almost 2 hours trying to do that ๐ โ๏ธ
I'm trying to have a series of commands for the Zeus that are self deleting after they are used throughout an op but when I try and capture the action id I keep getting undefined variable errors. Here's my code which is in my Zeus unit's (window) init field.
["Start Helicopter countdown",
{
call sq_helicopterSpawn;
window removeAction _heliCount;
}
,nil,0,false,true,"","true",-1,true
];```
It's a new scope, you need to pass _heliCount to your action
Nevermind that's the action id
Also use three backticks for code blocks
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
How can I do that when the addAction operation is the one generating the number I need to pass?
how do I make it visible to the action then?
It shows how to on the wiki
params ["_target", "_caller", "_actionId", "_arguments"];
Those are the parameters passed to the statement
in regards of the script file
very strange thingy
definitly would like to see the whole PBO to do some research
Thank you. Quoting that bit of code was enough for me to realize I needed to add it into my add action.
Sorry, but I don't do any coding for a living. The wiki makes a lot of assumptions on low level reader knowledge of basic scripting concepts and what Arma is doing during every action.
["Start Helicopter countdown",
{
call sq_helicopterSpawn;
params ["_target", "_caller", "_actionId", "_arguments"];
window removeAction _actionId;
}
,nil,0,false,true,"","true",-1,true
];```
params ["_target", "", "_actionId"];
_target removeAction _actionId;
is using _target better that just using the unit?
Not having anything on the left side of call means that all of the parameters passed to whatever is running is also passed to the right side.
Meaning your sq_helicopterSpawn function is also getting _target, _caller, etc.
Just something to be aware of, and if your function doesn't need those, you can just do [] call ...
I mention this just so it doesn't potentially catch you off guard later
sorry, yeah I understood that (eventually). It's just that you could have just directly told me what I had to do instead of linking me back to the wiki where I've been for the last hour
so?
That comment was about something else, not your action on its own
sorry just realized. Reading now a couple times to understand
ok I got it
should be harmless
still pbo
Hi everyone! I'm pretty new to 3DEN and Zeus stuff and I'm kinda smooth-brain when it comes to scripting. So far I've gotten things to work but I'm currently stuck on something. (To clarify up-front, I don't really know anything about .sqf files, so if this kind of thing would require a .sqf to work then I'll probably ask how to do that.)
What I'm trying to do is EITHER:
1 - Teleport all players inside a Trigger area to another location on the map. I have a hold action (I'm using 3den enhanced) that triggers a fade-out/fade-in and I'd like to insert the teleport in the middle of that.
OR
2 - Send a private notification or message to my (and any other Zeuses') screen when the hold action is triggered, so that I know when to manually teleport the group of players.
I'm not sure which one would be easier to implement though. Any help would be big appreciate ๐
(If anyone that wants to help would like to DM me to keep the chat less congested, I should have my DMs open to anyone I share a server with, or you can friend req me. Whatever works for you)
I figured your function didn't have any params since you didn't knowingly pass any, that's why I just wanted to let you know
thanks. That's actually very useful to know for the future
Hi guys ๐ . I have a little issue with this code
private _units = units Taskforce1;
if (alive player) then {
private _currentIndex = _units find player;
private _nextIndex = (_currentIndex + 1) % count _units;
private _nextUnit = _units select _nextIndex;
if (alive _nextUnit) then {
player = _nextUnit;
_nextUnit setLeader group _nextUnit;
hint format ["Switched to %1, now you are the team leader!", name _nextUnit];
};
};
taskforse1 is my unit's group but I am trying to switch between the units in my group and at the same time I will be the team leader, not the AI so I used this code with a trigger and activation is "noun" or "anybody". I left the condition as "this". In the activation bar I typed this code but I didn't work yet.
got this one for Chatgpt
They'd be roughly the same difficulty, so might as well automate it.
In your hold action's statement you could do something like:
// vanilla allPlayers command also returns headless clients
private _players = ([] call CBA_fnc_players) select {
_x inArea YourTrigger; // trigger variable name
};
private _teleportPos = getPosASL TeleportObject, // object to teleport to
{
_x setPosASL _teleportPos;
} forEach _players;
And when I asked him should I give them variable names? He said no and I didn't.
That gets all of the players, filters out players that aren't in your trigger's area, then teleports them to a given spot
Oh cool, quick response, I'll try it in a moment!
It worked, thank you so much!! Well technically it teleported THEN faded but I can figure that out. Thanks <3
Holy shit it works perfectly hell yeah
Nice ๐
this disableAI"PATH"; help this code aint working and idk why
- How you've done that
- How you can be sure it isn't working
ยฏ_(ใ)_/ยฏ
i was looking for if there was another tab but i didnt remeber
now i gotta fix every unit thats supposed to not move 
So i changed it to look for the "group alive" instead like you wrote, and the helicopter seems to not have any issues now, not sure why that made so much of a difference to its behavior but oh well, cheers for the assistance. ๐
Could anyone help me out real quick?
Im trying to have a trigger destroy a helicopter when it takes damage.
I tried this from some stuff i read online
Condition:
Activation:
h1 setdamage 1;
Is there always an error with precision when setting an object's vectors?
damage h1 < 1
should work I think
unless you want it to only be destroyed after it's health is below 10%, which is what you have
at that point I don't think the trigger would make much difference though, vehicles are basically destroyed at 0.1 and can explode after that point
Im testing the trigger by having it run a hint in activation. But im getting the hint immidiately even if the helicopter hasnt taken damage.
I might have it backwards then. Damage might return 0 at full health
so try damage >= 0.1
Yeah anything i try doesnt seem to work. its like damage h1 doesnt return a value..
count magazines h1 <= 0 did work in another test, so the problem im having seems to be with using "damage"
are you absolutely sure h1 is the variable name? and that it's set correctly?
Yeah h1 is the variable name for the heli.
try throwing damage h1 in the debug menu and see what the return says
It worked, i had the heli's simulation disabled by another trigger when the mission launched and that was causing issues it seems.
makes sense
Thanks for the help regardless, i was about to give up on "damage h1 >" so im glad you convinced me to keep trying
Shot in the dark here...
I was looking into these two, recording seems to work and there's data in BIS_fnc_diagAAR_data
https://community.bistudio.com/wiki/BIS_fnc_diagAAR https://community.bistudio.com/wiki/BIS_fnc_diagAARrecord
But I simply can't get BIS_fnc_diagAAR to replay data, I'm sure I'm missing something, can anyone point me in the right direction?
I suspect there's a dedicated display for the AAR but I can't find it, I tried passing default/map/spectator displays and nada...
["Init", [_anAARDisplay]] call BIS_fnc_diagAAR;
Erm oO Since when, can you " select " from a String?!
https://community.bistudio.com/wiki/select
(Alt Syntax 3)
for half a year or so
Oh boy, i wish id knew that earlier -.-
How does the BIS_fnc_showAANArticle function work? specifically for deciding who sees the article. theres no parameters for who calls the function or anything. and it's not something that is done on the side of the server. (ie. respawn settings) so i don't understand how it's possible to call it for a specific person or for all people connected to the game?
Pretty sure its executed locally on the client.
it is UI, so local. You need to use remoteExec.
so would it be possible to call it with a {}foreach units players; and then that would show it to all clients?
or do i need to use {remoteExec BIS_fnc_showAANArticle;}foreach units players?
What players should see it?
all
but im interested in the programming side as to how to specify
and where to put specifications
[parametersToTheFunction] remoteExec ["BIS fnc showAANArticle", 0];
i see. thank you
just in case you are bored @jade abyss :)
{
assign simple ()
""
endAssign
assign simple (::string s)
s
endAssign
fnc simple scalar length ()
count _this
endFnc
fnc simple string subString (scalar off, scalar len)
_this select [off, len]
endFnc
fnc simple scalar indexOf (::string s)
_this find ( s )
endFnc
fnc simple bool contains (::string s)
(_this find ( s ) ) >= 0
endFnc
fnc simple string toString ()
_this
endFnc
fnc simple array<scalar> toArray()
toArray _this
endFnc
fnc simple string append(::string s)
_this + ( s )
endFnc
fnc simple array<string> split(::string delimiter)
_this splitString ( delimiter )
endFnc
fnc simple string toUpper()
toUpper _this
endFnc
fnc simple string toLower()
toLower _this
endFnc
}```
pretty much all you can do with strings in one command (could have missed something, if i did --> tell me)
Anyone knows what the point of:
_test2 = bis_functions_mainscope playMove ""; if (isnil "_test2") then {_test2 = false};
in the BI initFunction.sqf is?
i am more surprised by the bis command
or is that a typo?
erm
It's a game logic.
allVariables bis_functions_mainscope
-> ["didjip","isdedicated"]
an object
cant figure why remExec doesnt return JIP string. i tried this: sqf private _remId = [_newdevice,_devSide] remoteExecCall ["setDeviceUnloadAction", call getDeviceHandlerSides, true]; I also tried with targets 0 but same result
ugh nevermind , had to be in multiplayer mode
... remoteExec ["FNC", 0, true]
I bet
yeah it seems to work with sides as the targets though wiki says "The JIP parameter can only be used if the targets parameter is 0 or a negative number."
so with targets as sides it gives me JIP string but can i trust that works, is the wiki wrong?
Of course! Huge Landscape, many Vehicles and an uber-Strider, that can shoot you from 3km!
Hello, I have an issue with this code and I don't know how I can fix it.
if (alive player) then {
private _currentIndex = _units find player;
private _nextIndex = (_currentIndex + 1) % count _units;
private _nextUnit = _units select _nextIndex;
if (alive _nextUnit) then {
player = _nextUnit;
_nextUnit setLeader group _nextUnit;
hint format ["Switched to %1, now you are the team leader!", name _nextUnit];
};
};
I want to switch to any unit in my group and at the same time I will be the team leader. I got this code from ChatGPT and when I asked it I should change _nextUnit and name the units' variable names it said no I didn't have to do.
!code
```sqf
// your code here
hint "good!";
```
โ
// your code here
hint "good!";
player = _nextUnit;
This cant work
you are trying to assign a value to a command
I got this code from ChatGPT
Our old friend who has no idea how to make a sqf
@tough abyss
The whole thing is a bit confusing:
if (!isNil "bis_functions_mainscope") then {
private ["_test", "_test2"];
_test = bis_functions_mainscope setPos (position bis_functions_mainscope); if (isnil "_test") then {_test = false};
_test2 = bis_functions_mainscope playMove ""; if (isnil "_test2") then {_test2 = false};
if (_test || _test2) then {0 call (compile (preprocessFileLineNumbers "a3\functions_f\misc\fn_initCounter.sqf"))};
};
This would be because if the targets parameter is anything else, the game can't know if a JIP client is going to be eligible at the time the JIP queue is sent to the client. When the client receives the queue, the player may not have selected a side yet; their machine network ID can't be reliably predicted so using that is not smart; objects either transfer their locality after the JIP queue is processed or just shouldn't be targeted again if they change locality.
Yeah. Whats the point?
0 is safe because it means everyone. Negative IDs are safe because it means everyone except specific IDs. 2 doesn't work because the server is never going to JIP.
bis_functions_mainscope = _grpLogic createunit ["Logic",[9,9,9],[],0,"none"];
ok thx for the info. i will just go with zero
A2
Yeah
"//--- Create functions logic (cannot be created when game is launching; server only)"
The initFunctions.sqf does really strange stuff.
is there a way to detect if a player is on a rock specifically? surfaceType only returns type of surface on world floor
Logics cannot be global (createVehicle fails, only createVehicleLocal works). No idea what createUnit does with logics.
Line 630 + below
this command gives you some surface data (not sure what you need exactly): https://community.bistudio.com/wiki/lineIntersectsSurfaces
just need to detect if player is positioned on a rock, instead of in one
you could compare the player's positionATL and positionAGL
rock surface check might work and if the surface is grass or something then he's not on rock
that might work
you'll have to test some areas where it is close to the surface to see how precise it is
Whats there?
uno momento, searching for the start definition of _recompile
Can you give me an example?
You are doing player = _nextUnit;. This means that you are trying to set the value of the global variable player to whatever _nextUnit is.
You can't do this because player is an existing command. (https://community.bistudio.com/wiki/player) You can't create global variables with the same names as commands.
ah, nvm
quickly grabbing my tin foil hat
_recompile = if (count _this > 0) then {_this select 0} else {0};
yes
ok I changed player to a1 as a variable name but it's the same it doesn't transfer the leadership to the next unit; I guess because the next player is alive, rigth?
poor mans params
At least, its working
Well, I'm currently debugging the stuck in loading screen bug when the host changes the mission
never noticed something like that
Pretty annoying. 100% reproducable
The host uses #missions while others are still in the loading screen of the previously selected mission
It's probably the same initFunctions.sqf ๐
๐
never change a running system @tough abyss
Ah, thats why we use an Engine from 1999 ๐
I did some tests to figure out how exactly JIPs in case of sides works and to my surprise the JIP worked just fine. I tested with dedi and two clients of which the seconds was JIP client. I tested using this code: ```sqf
testJip =
{
diag_log format ["TESTING JIP!!!?? %1 %2 %3", player, side player, playerside];
};
if(isServer) then
{
[] remoteExecCall ["testJip", [west], true];
};``` it always printed side WEST properly (in JIP client). so not sure but it seems like sides target is working (with JIP)
https://community.bistudio.com/wiki/objectFromNetId
Correct command to get unique id from object (on server side),
And that doesn't change the middle of the mission, right?
No, that command is the other way around. That command takes the ID and gets the object.
https://community.bistudio.com/wiki/netId is for getting the ID from the object.
Thanks ๐
my script for placing powerlines works perfectly in VR, including around the water area where the terrain has altered height
it doesn't work in any other terrain, exact same conditions
whyyyyy
getUnitLoadout (get3DENSelected "object") why doesn't this work? Says one element provided, two required, while getUnitLoadout is supposed to take just the object classname, unit in this case
get3DENSelected actually returns array in array
so it's displayed wrong here?
that's why I tested it in the sloped area in vr
how bout this
player setVariable ["Saved_Loadout",getUnitLoadout player]; and then on respawn player setUnitLoadout (player getVariable ["Saved_Loadout",[]]);
I'd prefer to grab the loadouts from editor rather than having to preview it
thought of using 3den Agency mod to simplify the process but it adds to much stuff I'd have to manually remove, just need a way to get the loadouts from the editor so I can apply them later to an agent
yeah thats it
up there
i use this to do that
USMC = group this; _handler = this execVM "loadouts\NATO_Soldier.sqf";
an exsample of this would be in the mission End Game
Is getPosASL affected by terrain?
again i want to thx all you awsome people for helping me on Arma 3 stuff all my stuff works perfect now WooHoo Arma 3
i love you guys
im having so much fun in Arma 3 i just love it
Best game ever
script seems to work closer to the water but stops in areas above terrain that gets arbitrarily too high
I don't see why that should matter
can you sink the pole into the ground to get a excepable hight maybe
or something like that
I'm not using poles I am just using helper spheres
oh ok
I'm sill at the stage of connecting the line to two points
The Z component of getPosASL is the object's absolute height above the terrain-wide water plane (base level, not waves). It does not take terrain into account. That's the point of the difference between posASL and posATL.
or ASLW
Do any of the vector commands take terrain into account?
because I am using positionASL and vector commands specifically so I don't have problems with terrain height
and I don't, up until like 50m above sea level
then the wire just points straight up into the air
I should mention this isn't a problem in vr, even well above 50 meters, even above the water area
Vector commands don't consider terrain at all. (Which is why you shouldn't use them with ATL positions)
so what could be the cause
im thinking smoke is coming out of my ears
i know 1 thing when you get this right yull be the guy to talk to about power lines
๐คท
I haven't seen the script. Powerlines are a bit of a mystery to me, usually they're done in the terrain builder which I don't deal with at all.
it's a script to place an object and point it at one of the two objects so each end lines up
it's just connecting a 50 meter line to 2 spaced objects. That's it
I have a semi-functional version that uses attachto but I can't scale it after the fact
or maybe I can, idk
So what does the core code look like?
Giving this a last shot haha
I have a script and it is working in ONE mission, I have tried it on other missions with no luck at all. the exact same script. I have no Idea why it just works on one mission and I'm all out ideas to test so I need your help, for real, I will gladly send some coffee/beer money for the help cause this is so god damn important to me.
I have made 2 zip files that contains all that's needed
Regarding the script, when I say it doesn't work, it means that the "function" Call reinforcements isn't showing in scroll wheel menu
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
I just test it by placing two named objects and executing that code in its entirety from the debug menu
But thats an ironic cynical aphorism (that doesn't even exist in common English). @queen cargo
That code is complicated. I can't even tell what problem it's supposed to solve.
So you place two objects and then use that code to dynamically create, position, rotate and scale a powerline model so that it connects the two objects?
Hello, how to hang a script (Action) on only one bulletproof vest, when putting on this bulletproof vest, the "explosion" button appeared, after removing the bulletproof vest it disappeared. Without using endless checks.
You can't add an action to a vest worn by a unit. The action should be added to and removed from the unit in, for example, https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#InventoryClosed event handler.
Yes, exactly
using that setpitchbank function is inconsistent and I don't know why but the correct result is always possible. It's just a matter of the order of certain values when it is called. So it places several and chooses the best match.
Hah. Apparently you can create global game logics with createUnit.
a = createGroup sideLogic createUnit ["Logic",[0,0,0],[],0,"NONE"];
publicVariable "a"
I'm bad at math and I don't understand that fnc_SetPitchBankYaw (from https://community.bistudio.com/wiki/setVectorDirAndUp#Notes, right?), but there might be a problem in that function (gimbal lock?) or you might be using it wrong ๐คทโโ๏ธ
Maybe @little raptor is willing to take a look, he knows his maths.
I am having an issue passing a variable from a script to another script:
(just for testing purposes, I am adding actions to a whiteboard's init field)
this addAction ["Slides for basic infantry course", {[[whiteboard_2, 1], "scripts\WB_addAction_FVMU1.sqf"] remoteExec ["execVM", 2];}];
The "(Erase the board)" action works as expected (and indeed any actions that call WB_drawTexture directly work fine). The second action ("Slides for basic infantry course") is meant to replace all actions with the option to draw slides for a specific course, but the resultant added actions don't work.
WB_drawTexture.sqf:
_wb = _this select 0;
_texture = _this select 1;
playSound3D [getMissionPath "aud\whiteboard.ogg", _wb, false, getPosASL _wb, 1, 1, 0];
_wb setObjectTextureGlobal [0, _texture];
WB_addAction_FVMU1.sqf:
_wb = _this select 0;
removeAllActions _wb;
_wb addAction ["(Erase the board)", {[[_wb,'img\wb\blank.paa'], "scripts\WB_drawTexture.sqf"] remoteExec ["execVM", 2];}];
_wb addAction ["Draw: Bound by fireteams 1", {[[_wb,'img\wb\eor-vxl.paa'], "scripts\WB_drawTexture.sqf"] remoteExec ["execVM", 2];}];
_wb addAction ["Draw: Bound by fireteams 2", {[[_wb,'img\wb\eor-ansats.paa'], "scripts\WB_drawTexture.sqf"] remoteExec ["execVM", 2];}];
_wb addAction ["Draw: Peel left/right", {[[_wb,'img\wb\eor-blixt.paa'], "scripts\WB_drawTexture.sqf"] remoteExec ["execVM", 2];}];```
Despite using the exact same code to assign a value to _wb in both scripts, _wb seems to be unassigned inside WB_addaction_FVMU1.sqf. The "(Erase the board)" action works when added from the init field, but not when added by WB_addAction_FVMU1.sqf. If I run ``systemChat str _wb;`` from inside WB_addAction_FVMU1.sqf, it returns the string "whiteboard_2", but the variable can't be passed from WB_addAction_FVMU1.sqf to WB_drawTexture.sqf.
Am I missing something? Why can _wb be passed from WB_drawTexture.sqf from the init field, but not to WB_drawTexture.sqf from WB_addAction_FVMU1.sqf?
Error message when using actions added by WB_addAction appended below:
The addAction code is not in the same scope as the local variable _wb. As such, it never sees the value of _wb:
//Scope 1
_wb = whiteboard_2; //_wb exists and has a value in Scope 1.
_wb addAction ["Action", {
//Scope 2
systemChat str _wb; //_wb is undefined and has no value in Scope 2.
_wb = "Hello World!"; //_wb is now defined in Scope 2, but it has a different value than the _wb in Scope 1!
systemChat _wb; //Hello World!
}];
systemChat str _wb; //whiteboard_2
```You don't encounter this problem in the whiteboard's init field because you use a global variable (`whiteboard_2`) there. The global variable can be seen by all scripts.
To fix this, either use a global variable or use the `arguments` parameter of `addAction` to pass the value of `_wb` to the `addAction` code.
Bonus issue: removeAllActions has local effect, so you need to remoteExec that too ๐
thanks! This works:
"(Erase the board)",
{[[_this select 3,'img\wb\blank.paa'], "scripts\WB_drawTexture.sqf"] remoteExec ["execVM", 2];},
_wb
];```
Also thanks for the headsup re: removeAllActions.
I didn't really check the math but I can tell you some stuff from a quick look:
- There are vector commands. You don't need to write vector stuff manually (e.g. the part where you calculate
_linePoscan be simplified to(_posA vectorAdd _posB) vectorMultiply 0.5), or_posOffsetScaledwhich is just_posOffset vectorMultiply_scale - There's no need to use pitch bank yaw. You already have vectors. Then you convert them to angles. Then convert them to vectors again?!
- You create some dummy objects just to use modelToWorld. Arma has matrix commands too. You can just do this:
_side = _dir vectorCrossProduct _up;
_matrix = matrixTranspose [_side, _dir, _up];
_modelToWorld = {
params ["_pos", "_rotation", "_offset"];
_offset vectorAdd flatten(_rotation matrixMultiply (_pos apply {[_x]}));
};
[_relativePositions select 0, _matrix, _lp] call _modelToWorld;
Also another note: when dealing with vectors, use vectorDistance not distance
And this:
sqrt ((((_posB select 0) - (_posA select 0)) ^ 2) + (((_posB select 1) - (_posA select 1)) ^ 2)))
is just vectorMagnitude _vector
Tested?
I'm building a mp mission where the players will be working undercover for a while. And I was wondering if there is a way to have there weapon holstered when the get out of vehicules?
player action ["SwitchWeapon", player, player, -1];
Yes.
_objInformant setName "Mr Smith;
this works in single player (as stated in the docs), but im not finding any option to set a name in multipler, and i cant see how its possible to spawn a unit and give it a name too... anyone know of a way?
wiki says it has local effect so you need to remoteExec it to everyone
that too has local effect ๐
When executed on server, the identity will be JIP compatible.
ah nice
or is that just JIP thing and you still need remExec to current clients. after that server handles JIP. not sure ๐
I use this function on my server without remoteExec, and it works fine.
alright then ๐
thank you, will give that a try ๐
Does anyone know of a way to check if the user is using the splendid camera or spectating?
Try to check if their displays are not null.
Hm good idea
Can someone help me with a script issue? server issue? I think something happened to Arma 3 after the recent update. I've had my server files for about 6 months, and everything was working fine. But now, when I run it, nothing shows up when you try to open the ATM or the car shop. Even when you execute the code to open it, nothing appears. However, when you execute it globally and someone else is nearby, it works for them but not for you. Sounds crazy, i want to add that there is no errors on RPT log on the client or the server.
even if you try to do execute for the console nothing shows up and no errors.
[] spawn Soldiers_fnc_atmMenu;
Video shows what is the problem that I'm facing
https://youtu.be/OaUHxB2Tu-c
You should provide the source code of Soldiers_fnc_atmMenu.
Thanks @faint burrow Works in SP when I spawn but not in MP and only when I spawn and not when I get out of a car.
I<m trying to use it in an eventhandler (getout) but nothing.
Provide your code.
Placed on the unit which is player and playable : player addEventHandler ["GetOut", {player action ["SwitchWeapon", player, player, -1];}];
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#GetOut should be added to a vehicle.
I would recommend using https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#GetOutMan and variables, not player inside EH.
question for UI2Texture. I am applying a display to a UserTexture object.
is it possible for it to support transparency? Right now i am having this texture with an alpha channel.
Instead of being transparent as usual, it shows up green.
effectivly looks like this ingame
#include "..\..\script_macros.hpp"
/*
File: fn_atmMenu.sqf
Author: Bryan "Tonic" Boardwine
Description:
Opens and manages the bank menu.
*/
private ["_units","_type"];
if (!life_use_atm) exitWith {
[format[localize "STR_Shop_ATMRobbed",(LIFE_SETTINGS(getNumber,"noatm_timer"))],true,"slow"] call Soldiers_fnc_notificationSystem;
};
if (!dialog) then {
if (!(createDialog "Soldiers_BankUI")) exitWith {};
};
_hasCheated = call Soldiers_AC_CheckMoney;
if (_hasCheated) exitWith {};
disableSerialization;
_units = CONTROL(8999520,122);
lbClear _units;
CONTROL(8999520,120) ctrlSetText format ["%1%2","$",[BANK] call Soldiers_fnc_numberText];
CONTROL(8999520,121) ctrlSetText format ["%1%2","$",[CASH] call Soldiers_fnc_numberText];
private _playersToCount = [playableUnits, [], { name _x }, "ASCEND"] call BIS_fnc_sortBy;
{
_name = name _x;
if (alive _x && (!(_name isEqualTo profileName))) then {
private _index = _units lbAdd format ["%1",name _x];
_units lbSetData [_index,str(_x)];
};
} forEach _playersToCount;
lbSetCurSel [122,0];
So obviously (as I found out during testing), this doesn't work in multiplayer since addAction is local. I tried removing if (!isServer) exitWith {}; from all constituent scripts and changing the final argument on remoteExec from 2 to 0, which in my mind should cause all scripts to execute on all clients, thus fixing the issue. However, when I test in 3den's multiplayer, the scripts don't seem to execute (no actions are added to the whiteboard when running WB_addAction_FVMU1.sqf). Any ideas?
Don't see errors. So try to debug.
How the script is launched?
Will, I'm running the game on -debug and -showingscriptsErros and when i recorded the video nothing shows up but i will show you something you may know what is the problem
Use https://community.bistudio.com/wiki/diag_log, then check RPT-file.
23:30:01 Cannot intersect with a3\structures_f_epc\civ\accessories\atm_02_f.p3d - missing skeleton bones
23:30:01 Cannot intersect with a3\structures_f_epc\civ\accessories\atm_02_f.p3d - missing skeleton bones
23:30:01 Cannot intersect with a3\structures_f_epc\civ\accessories\atm_02_f.p3d - missing skeleton bones
23:30:01 Cannot intersect with a3\structures_f_epc\civ\accessories\atm_02_f.p3d - missing skeleton bones
23:30:01 Cannot intersect with a3\structures_f_epc\civ\accessories\atm_02_f.p3d - missing skeleton bones
23:30:01 Cannot intersect with a3\structures_f_epc\civ\accessories\atm_02_f.p3d - missing skeleton bones
23:30:01 Cannot intersect with a3\structures_f_epc\civ\accessories\atm_02_f.p3d - missing skeleton bones
23:30:01 Cannot intersect with a3\structures_f_epc\civ\accessories\atm_02_f.p3d - missing skeleton bones
23:30:01 Cannot intersect with a3\structures_f_epc\civ\accessories\atm_02_f.p3d - missing skeleton bones
23:30:01 Cannot intersect with a3\structures_f_epc\civ\accessories\atm_02_f.p3d - missing skeleton bones
23:30:01 Cannot intersect with a3\structures_f_epc\civ\accessories\atm_02_f.p3d - missing skeleton bones
23:30:01 Cannot intersect with a3\structures_f_epc\civ\accessories\atm_02_f.p3d - missing skeleton bones
23:30:01 Cannot intersect with a3\structures_f_epc\civ\accessories\atm_02_f.p3d - missing skeleton bones
23:30:01 Cannot intersect with a3\structures_f_epc\civ\accessories\atm_02_f.p3d - missing skeleton bones
23:30:02 "!!!============================!!!"
23:30:02 "civ_1 ATM GOT OPENNED AT 222.265"
23:30:02 "Life_use_atm true"
23:30:02 "Has Cheated false"
23:30:02 "!!!============================!!!"
createDialog creates dialog. Check what it returns. If false then there is probably a bug in display config.
You can also try creating dialog directly using createDialog "Soldiers_BankUI".
yeah if i do that it work
Anyone have a link to explain how to setup file-patching for dev?
if you want to spawn a enemy in and name it this is for you
"O_Officer_F" createUnit [_spawnPos, _grp, "EOfficer1=this;", 0.0, "COLONEL"];
@lunar cedar
don't you just click on the setting in steam @manic kettle
in the launcher yeah but i want to know how to actually make the game reload functions...
some functions can't be reloaded
iv found anyway
like if you enable saving it seems bad
i'm not sure about dev
i use stable
Can you post the new code?
#include "..\..\script_macros.hpp"
/*
File: fn_atmMenu.sqf
Author: Bryan "Tonic" Boardwine
Description:
Opens and manages the bank menu.
*/
private ["_units","_type"];
if (!life_use_atm) exitWith {
[format[localize "STR_Shop_ATMRobbed",(LIFE_SETTINGS(getNumber,"noatm_timer"))],true,"slow"] call Soldiers_fnc_notificationSystem;
};
// if (!dialog) then {
// if (!(createDialog "Soldiers_BankUI")) exitWith {};
// };
createDialog "Soldiers_BankUI";
_hasCheated = call Soldiers_AC_CheckMoney;
if (_hasCheated) exitWith {};
disableSerialization;
_units = CONTROL(8999520,122);
lbClear _units;
CONTROL(8999520,120) ctrlSetText format ["%1%2","$",[BANK] call Soldiers_fnc_numberText];
CONTROL(8999520,121) ctrlSetText format ["%1%2","$",[CASH] call Soldiers_fnc_numberText];
private _playersToCount = [playableUnits, [], { name _x }, "ASCEND"] call BIS_fnc_sortBy;
{
_name = name _x;
if (alive _x && (!(_name isEqualTo profileName))) then {
private _index = _units lbAdd format ["%1",name _x];
_units lbSetData [_index,str(_x)];
};
} forEach _playersToCount;
lbSetCurSel [122,0];
0:09:11 "!!!============================!!!"
0:09:11 "civ_2 ATM GOT OPENNED AT 277.691"
0:09:11 "Life_use_atm true"
0:09:11 "Has Cheated false"
0:09:11 "277.691 DiagLog is True"
0:09:11 "!!!============================!!!"
Got a question for anyone thats familiar with ACE, specifically ACE interactions. I want to add an interaction to a vehicle class, however I don't want it to be a part of the MainInteractions tree (the ones that always show up in the center of the vehicle). Instead I want the action to show up at a modelToWorld position, similar to how the remove/replace/patch wheel interactions show up on the vehicle wheels instead of the main actions menu. I've tried following the wiki for Ace interact, however the interactions are not showing
Just use [] for the path
@wild star tried that, but it doesn't seem to be putting the actions anywhere on the vehicle. Here is the code:
EMP_Menu_location = [-1.5,-2,-1];
.
.
.
EMP_vehicle_menu_action = [
"emp_vehicle_menu_action",
"EMP",
"",
{},
EMP_vehicle_condition,
{},
nil,
EMP_Menu_location,
5
] call ace_interact_menu_fnc_createAction;
.
.
.
[
EMP_Vehicle_Class,
0,
[],
EMP_vehicle_menu_action
] call ace_interact_menu_fnc_addActionToClass;```
disregard, now its working as expected. Probably my fault for just reinitializing the code w/o actually deleting the old interactions
Maybe i'm just stupid atm. but was there an easy way to check if a targeted heli is unarmed or armed? ๐ค
You could try currentMagazine
Not really working reliable for some of the modded helis with door gunners
I could check the heli and all turrets for a weapon but at that points it feels like it's gonna be faster to just check it against a list of all the armed helis on the server
Just cache it
Do config lookups on first check, and then save the result
Could easily do that but at that point i also can just create an array with all armed helis and just check if the target is in that array ^^
Was wondering if there is an more elegant solution but don't seems like it atm. ^^
dialog is always = true (i don't know why)
Where is [] spawn Soldiers_fnc_atmMenu; written?
In button click event handler?
You can also use this:
if (dialog) then {
closeDialog 2;
};
createDialog "Soldiers_BankUI";
is it possible to make vehicles invisible and still drive them?
If it uses hidden selections you could set all the textures to a blank path. You'd be able to see the character inside it though
Does using hideObject make them undrivable?
hideObject also disables PhysX so... I do believe yes
the setpitchbankyaw function is to correct the precision error that happens without it. Results are better. I don't know anything about vector math at all so I couldn't tell you what's best.
"You create some dummy objects just to use modelToWorld." this is incorrect. I already explained my reasoning for using the dummy objects. Place the objects, and choose the best one. That's how it works.
anyway are you saying that the issue is caused by the issues you pointed out?
also I don't see why distance wouldn't work anyway
No. Like I said I didn't check if the math is correct
It works but the result might be different from vectorDistance
You delete the other 3 tho (only keeping 1)
Also your "closenessarray" order seems wrong
First you should put the distance, then the object
Example:
[([_dml1,[_objA,_objB]] call BTH_fnc_LineClosenessCheck select 2), _dml1],
Why does that matter?
as long as sort works the order shouldn't be a problem, right?
It sorts by the first, then second, etc. element
idk what happens if you sort by object first
Maybe it won't make a difference and goes straight to second
It hasn't failed in my testing
perhaps that is the issue though
well, it wasn't. none of the results are correct if I don't delete them. some are closer than the one that normally remains, probably because the average cancels out the distance or something
I can fix that but it isn't the main problem.
I'll try some other changes but I don't see how those differences could relate to terrain height
would i just use setObjectTextureGlobal for that?
no luck so far. I haven't the slightest clue I am doing any of the changes right
So i'm trying to make it so if a player has a flashlight on in the trigger they take damage. Would i need to make an array to put people that currently have a flashlight in that array to do damage to them in the true part?
This stuff below is currently in the On Activation part of the trigger.
_retVal = if (isFlashlightOn == true) then { "It's true" } else { "It's false" };
I would make the trigger to be local and use this activation condition:
(player inArea thisTrigger) and { player isFlashlightOn (currentWeapon player) }
but how would that deal damage to just the person with the flashlight on
ok just so i can understand this for future. this is an If statment checking if a player is within the trigger and seeing that if the player has the flashlight on correct?
also why do it locally for?
Correct. But you don't need if in trigger activation condition.
oh interesting
To check only the player for whom the trigger is local.
oh
so it stops it doing it for every player
so its good to use local if i only want it to apply to a single person fufilling that condition?
It depends. In your case I think it's better using local trigger because I'm not sure isFlashlightOn and currentWeapon will work fon non-local units.
ok i see
so what happens if i wanted to be able to do this to any unit regardless if its ai or not. is there a variable that corresponds the any unit in the trigger?
In this case you should use server trigger and check all units (thisList) within the trigger.
Something like that:
- Activation: anybody.
- Server only: checked.
- Condition:
_unitsToBeDamaged = thisList select { (_x getEntityInfo 0) && { alive _x } && { _x isFlashlightOn (currentWeapon _x) } };
thisTrigger setVariable ["unitsToBeDamaged", _unitsToBeDamaged];
(count _unitsToBeDamaged) > 0
- On act.:
_unitsToBeDamaged = thisTrigger getVariable "unitsToBeDamaged";
{
_x setDamage ((damage _x) + 0.05);
} forEach _unitsToBeDamaged;
wow ty once again
Yes
When I add an addAction to a human player, the other players in MP are able to activate it. I want this.
However I don't want the human player that has the addAction on him to be able to activate it. Could this achieved?
I have it written like this:
scout addAction [
"<t color='#FFFF00'>""So, you're our carson?""</t>",
{
// code goes here. scout is the human unit variable name.
},
nil,
8,
false,
true,
"",
"ActionTalkToCarson && AllowActionTalk",
4
];```
init.sqf?
This is in initPlayerlocal
Alright
_target != focusOn && ActionTalkToCarson && AllowActionTalk
Have this condition
Basically don't show the action if target (unit with action) is currently controlled unit (player, etc.)
Actually _target != _this could be even better
instead of focusOn
Hmmm except I do want the action to be shown if it controlled by a player. I just dont want it to be shown to the player that is controlling the unit. Everyone else can see it is OK. Sorry its confusing. Am I explaining OK?
This is exactly what you want
don't show if you're the unit the action is added to
Awesome! tyvm, I will test it out now!
Works perfect. TYVM!
Hmmm OK, now what about if I DONT want a certain unit to be able to use an addAction?
Perhaps then the condition field would use: _caller != UnitXYZ?
_this
Check condition in https://community.bistudio.com/wiki/addAction
it has its own variables
!(_this in [_target, UnitXYZ]) && ActionTalkToCarson && AllowActionTalk
Why is _target necessary here? Since, I'm just trying to exclude the action from UnitXYZ and not the target?
I thought you wanted certain unit and the unit with action not see the action, this is what code does
My mistake, I should have clarified I was now asking a separate question/scenario.
just list any units you want in that array
how to make slideshow in arma 3
gonna need more info than that
I try with this video: https://youtu.be/0qeCjKlF3tk?si=UCmkT7QWwkd_qULV
This is just a basic Ass Slide Show tutorial. Sadly its about 8 mins. Good Luck
#arma3 #ace
https://www.youtube.com/watch?v=z30iy... is the music that was playing at the end.
but in controler i don't have interactions
You can rebind the interact key
i have interact i can pick up and drag and cary
Then you have some stuff missing in the module
How bad is the performance difference of sending a hashmap over the network opposed to other types like an array or string? I know a string will ideally be the most performant would love to be able to utilize the data I am sending as a hashmap. Don't wanna murder network though in the process.
To give more detail on the data I am working with right now, it is an array with the size of 10 (excluding 0) and has various different types. Each of those values could also easily and conveniently be given a key if added to a hashmap. This data (which is unique to each object) is applied on hundreds of objects as public variables which is available to all clients in the session (which can be upward 120 players).
how often are you sending it
It shouldn't need to be changed or modified all that often but with it being public it will be in the JIP queue for every client who connects and we do have a lot of players
JIP is probably my highest concern but I will say I am also a little unknowledgeable regarding the ins and outs of how the queue works short of just a base understanding of what it is and what data it takes
in your scenario, i wouldn't worry about it. its not frequent or large enough to have an issue
I'm having trouble understanding how to properly tell player's computers to execute a script or pre-compiled function using a script.
-
I have the script
skyDive.sqfthat usesplayerto effect a single target in various ways, tested and functional on myself using the console andexecVM "functions\skydive.sqf";. -
I've compiled that script in
initPlayerServer.sqf. -
I'm using a trigger set to
player faction/presentand currently have this in the activation section:
["functions\skyDive.sqf"]remoteExec ["execVM",_players];```
4. I've been trying various different variations of `remoteExec`, `execVM`, and anything else I can find, but I keep getting incorrect data type errors. Please tell me what extremely simple thing I should actually be doing.
What if the objects they were on was upward a thousand? Do you think the impact would still be relatively negligible over a string?
Thank you by the way for your response ๐
its all serialized before sending anyways
Are you able to send the exact error you are getting?
if you send that every second, then you'll start bogging
Haha nothing like that thankfully :D
try to reduce what you want to send. there probably isn't a need for what you are doing and can be shortened
Like the interval the data is sent or just the amount of stuff being sent in general or both?
the amount in your case. there probably isn't a reason why you need to send that many object variables
you can choose to trust the client a little more
Give me a sec to verify but I believe it is because _players is a bool ๐
Ahhh
Yeah so if you do in the return will be a bool true or false of whether it found the value in the array. So your remoteExec target is not actually an expected Number, Side Object, Group or String but a bool which isn't valid. I could have sworn bools could actually be used as targets previously but still not likely what you are intending.
ahh, so what would be the correct way to find an array of players in a trigger area?
I should precontext that I haven't played around with triggers all that much but give me a sec and I will try to spin something ๐
oh inArea?
lemme test
no that's Boolean too
well let me run that down on my own. That question will have been answered already. Thanks!
@mellow jolt You could try this although there may be a better way to do it depending on what trigger you are using I imagine.
// _object could be the object the trigger is attached to or any perferred object
_players = nearestObjects [_object, ["CAManBase"], 100, true]; // CAManBase to prevent rabbits from being picked up hehe
["functions\skyDive.sqf"] remoteExec ["execVM",_players];
Also not sure what kind of mission you are working in but figured I'd also pass this your way too if you have not seen it before. It is a real life saver as you no longer have to specify file paths when using commands like execVM, spawn, call or remoteExec :)
https://community.bistudio.com/wiki/Arma_3:_Functions_Library
Also someone gimmie perms to send disguised links pls- I am gonna tweak if I get timed out by the bot one more time ๐ฅฒ
Thanks, I've been messing with functions and had set the script up to be compiled, but had to see that reference again to remember how to call it correctly again.
Here's the correct code for the activation field in the trigger to fire the thing:
remoteExec ["fn_skydive",_players];```
the script is actually for a horror op to suddenly black a player out, teleport them up 750 meters, and then catch them just before they splat, black them out again and place them safely back where where they started and then wake them back up.
titleText ["","BLACK OUT",10];
0 fadeSpeech 0;
0 fadeEnvironment 0;
0 fadeSound 0;
player setUnconscious false;
player allowDamage false;
_origin = getPosAtl player;
_jump = getPosAtl player;
_jump set [0,(_jump select 0) - 500];
_jump set [1,(_jump select 1) - 500];
_jump set [2,(_jump select 2) + 750];
player setPosAtl _jump;
5 fadeSpeech 1;
5 fadeEnvironment 1;
5 fadeSound 1;
titleText ["","BLACK IN",10];
uiSleep 2.5;
dynamBlur = ppEffectCreate ["DynamicBlur",100];
dynamBlur ppEffectAdjust [10];
dynamBlur ppEffectEnable true;
dynamBlur ppEffectCommit 1;
uiSleep 0.5;
dynamBlur ppEffectAdjust [0];
dynamBlur ppEffectCommit 2.5;
uiSleep 2.5;
dynamBlur ppEffectEnable false;
ppEffectDestroy dynamBlur;
_alt = 1000;
Index = 25;
while { Index < _alt } do
{
_altArray = getPosAtl player;
_alt = _altArray select 2;
};
titleText ["","BLACK OUT",0.25];
uiSleep 0.5;
player setPosAtl _origin;
player setUnconscious true;
uiSleep .5;
titleText ["","BLACK IN",10];
player setUnconscious false;
player setPosAtl _origin;
uiSleep 5;
player allowDamage true;```
I don't want to catch more than just the person who sets off the trigger
I didnt know about nearestObjects so thats handy to have in my back pocket though
They're disabled for a reason, they won't re-enable them
Hello, i'm not an expert in A3 scripting and now i need some help. I know how to set a custom role and a custom loadout, but how can i set multiple loadouts to one role?
if using ace, you have to set ACE_Hearing_DisableVolumeUpdate = true or your sound fades won't work (it will disable the earplug effects, so be sure to turn it back off when done)
I'm at a loss. I tested with deformer and the results didn't improve. The script works perfectly at all elevations less than about 50m above sea level. It works anywhere on flat terrains, and semi-flat terrains as well. I don't know what to make of it honestly.
A bug maybe? I am way out of my area of knowledge with pretty much any kind of vector math but at the same time I can't find any indication that the vector commands would be affected by height like what I'm seeing.
The shape/slope/roughness of the terrain seems not to matter. idk
What's the script you use rn?
Can you show me a screenshot of the issue too?
One moment
I might have literally just figured it out give me a minute to verify
Nah I just improved the results a bit but it is still off for some reason. I'll send some screenshots
The one at the beach has perfect alignment, slightly height up, still perfect. Even higher, the alignment is off. It was off by much more before but the best result still looks like in the screenshot
I have verified that all the possible orientations are being considered. When I don't delete the extra dummy objects at this height, none of them align, so it isn't a selection issue.
ok. what about the script?
https://pastebin.com/fFEq2hce Updated here. I rolled back to relying on the fnc_SetPitchBankYaw function because of precision issues and other problems I couldn't figure out
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Those yellow spheres are s1 and s2 right?
yeah
the red line is just a custom model I made for debugging
Land_Powerline_01_Wire_50m_f works with the provided offset. To test you could literally just paste the entire code into the debug menu after mission start
Try this:
BTH_fnc_placeLineBetweenPoints = {
params ["_o1", "_o2", "_model", "_offset"];
private _p1 = getPosWorld _o1;
private _p2 = getPosWorld _o2;
private _dir = _p1 vectorFromTo _p2;
private _up = vectorNormalized ([_dir#1, _dir#0 * -1, 0] vectorCrossProduct _dir);
private _line = createVehicle [_model, [0,0,0]];
private _bb = boundingBoxReal _line;
private _size = (_bb#1 vectorDiff _bb#0)#1;
private _center = (_p1 vectorAdd _p2) vectorMultiply 0.5;
private _scale = (_p1 vectorDistance _p2) / _size;
_line setPosWorld (_center vectorAdd (_offset vectorMultiply _scale));
_line setVectorDirAndUp [_dir, _up];
_line setObjectScale _scale;
};
posOff = [0,0,-0.36];
[s1,s2,"Land_Powerline_01_Wire_50m_f",posOff] call BTH_fnc_placeLineBetweenPoints;
I removed the length parameter because you can just fetch it from the bounding box
I'll try that. Btw, this:
(sqrt ((((_posB select 0) - (_posA select 0)) ^ 2) + (((_posB select 1) - (_posA select 1)) ^ 2)));
seems to work better than
(vectorMagnitude _vector)
It's 2d distance. If you set vector's Z to 0 vectorMagnitude will be the same as what you wrote
that's closer, but the offset doesn't seem to be applied correctly. The offset is meant to be in model space
Oh. In which model space?
I got this same issue when applying the height offset to the world position
the wire model
so it applies in the same way no matter how the wire is oriented
without it, the ends of the wire rise up since the models origin is in the center where it hangs down
Ah that's what it is
Well you can fetch its value from bounding box too
But anyway to correct the fnc...
I don't understand about 50% of your version of the function so I have no idea where to make any changes
Yeah I'm modifying it rn
BTH_fnc_placeLineBetweenPoints = {
params ["_o1", "_o2", "_model"];
private _p1 = getPosWorld _o1;
private _p2 = getPosWorld _o2;
private _dir = _p1 vectorFromTo _p2;
private _up = vectorNormalized ([_dir#1, _dir#0 * -1, 0] vectorCrossProduct _dir);
private _line = createVehicle [_model, [0,0,0]];
private _bb = boundingBoxReal _line;
private _size = (_bb#1 vectorDiff _bb#0)#1;
private _center = (_p1 vectorAdd _p2) vectorMultiply 0.5;
private _scale = (_p1 vectorDistance _p2) / _size;
_line setVectorDirAndUp [_dir, _up];
_line setPosWorld (_center vectorAdd (_up vectorMultiply (_bb#0#2 * _scale)));
_line setObjectScale _scale;
};
[s1,s2,"Land_Powerline_01_Wire_50m_f"] call BTH_fnc_placeLineBetweenPoints;
You can remove the offset from the code btw. I forgot
Removed
You're a genius lmao
or I'm just really dumb
this seems to work perfectly either way
It's just regular vector math ๐
yes exactly
_players = thisList select { _x getEntityInfo 0 };
thisList select {isPlayer _x}
inb4 allPlayers inAreaArray theTrigger ๐ฟ
Why check all players when you can check objects already within the trigger?
This can be faster because it doesn't run a code in a loop (there are usually just a few or at most a few dozen players)
Tho Dedmen recently added SimpleVM which can improve loop performance
because a) running a single command on bigger data set may come up faster than running code loop
b) depending on trigger settings thisList may be way bigger than allPlayers (i.e. activation of ANY and 200 bots on 12 players server)
c) inAreaArray doesn't require trigger to have activation conditions that include players. It can even check for nothing at all and effectively be just a location definition
๐คทโโ๏ธ
As I understood, the trigger is already set to detect any player, in which case the players within the trigger area will be in thisList, so you can just use this var instead of doing the work again to get all players and filtering them. ๐คท
if it only detects players - why is there a need to filter them out in the first place? If it detects more than just players - see points a and b. Anyways my "hurrdurr, it can be" arguments don't mean anything without testing in the real (or at least real-ish) environment. And even setting up for testing is likely not worth it until those checks have noticeable impact on game performance.
Either way I don't think the difference is that large to matter which way you do it ๐
In vanilla data there is function that creates power line between 2 objects \a3\missions_f_orange\campaign\functions\fn_createPowerLine.sqf
just for your info if no longer needed...
Because I thought that the trigger detects any objects, but after reading the message again, I believe the trigger detects only players, although it would be nice to see a screenshot with the trigger settings.
Anyway, I think it's weird to set a trigger to detect something and then not use magic variables (thisList). Better to set detection to "None" then.
Agree with the rest.
Doesn't appear to do anything
[My_obj1,My_obj2] call compile preprocessfilelinenumbers "\a3\missions_f_orange\campaign\functions\fn_createPowerLine.sqf"
works for me
why do you have to call it like that
regardless it places WAY too many objects
has lots of gaps too
I looked at the code. It creates multiple power lines
Because this function is not in CfgFunctions by default but is exclusive to the campaign, nothing prevents you from adding it to yours to simply do [My_obj1,My_obj2] call BIS_orange_fnc_createPowerLine
I imagine this is for missions
3 meter segments, none are scaled as this predates that functionality being scriptable
It's an old function from Laws of War DLC
setObjectScale didn't exist back then
and there are gaps between them at some distances
yes I know lol
ye to connect two two points need more than one 3m segments, or you mean it spam objects?
Yeah. I mean Rylan needed 1 power line between 2 positions
wouldn't be ideal for terrains to have a trillion 3 meter segments rather than a single line for every pole (minus 1 for the end of each line)
I still wish I found that first though lol
Leopard figured it out in like 2 minutes after I posted my 5th failed attempt so no problem anymore lol
I already have a function that will place specific memory points relative to each power pole so I can just combine the two and generate accurate powerlines at any distance for large areas
I didn't even read what was needed
, I just let know that there is such a function in the Arma data when saw screenshot of two spheres and a rope between them
the gaps might be a result of the LENGTH 2.9 with the 3 meter rope model though
Thanks for letting me know anyway though lol I can still think of some uses for this
@foggy stratus, @open hollow This is an updated version of the script. You can hopefully see the improvements, so thanks for the encouragement and advise
https://www.youtube.com/watch?v=wzH7IrSAIFk
Again if you view the description of the video you can see what things I want help with, so any help in that regard would be greatly appreciated
DISCLAIMER: The music used in this video is not owned by me. This is a non-commercial usage, and all rights remain with Bungie
Song Used: Deep Stone Crypt Lullaby - Bungie. All rights reserved.
Advanced Zero Gravity Script Development for Arma 3
I am currently developing an advanced zero-gravity script for the game Arma 3. While this project ...
Hey folks, its a simple question but I was wondering if anybody experienced this before.
I know already had two missions were I had the problem that a variable in a script was not changed on the server even though I used "publicVariable".
In both instances it was in a script that was executed through a "Hold Action", everything else in the script worked, even stuff that came after the public Variable was set.
The Data Type was in one Mission Boolean and in the other a Number.
When I changed the variables in the Debug Console it worked flawlessly. When I repeated the mission myself (with lot less players obviously) and when i tested it local, this problem never occured.
Is there a limitation of "publicVariable" i do not know? Does anyone have a reliable workaround for this? Every hint would be helpful.
bruh, amazing job
Very impressive Jerry. Way to stick with it! This comment of your in YT cracked me up: "Current Challenges
Code Clean-up: The script has accumulated a significant amount of technical debt, necessitating a thorough clean-up before final release." That describes all my projects!!!
early optimization is the root of all evil... but you need to do it someday lol
player addForce [[0,0,1], [0,0,0], false]
is just me or this isnt working? ( i mean i get inconsius)
lets see your hold action. post all your code
Don't have the code for the Hold Action. Used the Eden Enhanced option for this.
Code in the script that was executed was:
if (!isServer) exitWith {};
["task02cargo", "SUCCEEDED"] call BIS_fnc_taskSetState;
objCount = objCount + 1;
publicVariable "objCount";
["Roger, supply coordinates recieved. Supply Drop One secured.","TOC","cargo1"] remoteExec ["UAMT_fnc_quickMsg"];
sleep 5.8;
if (objCount == 4) then {
["Excellent work, Rangers. Mission accomplished. You are RTB.","TOC","end"] remoteExec ["UAMT_fnc_quickMsg"];
sleep 5.1;
"scripts\UAMTScripts\MissionControlCenter\MCC_chapter_missionend.sqf" remoteExec ["execVM",2];
}
else {
["Move on to your next Objective.","TOC","moveOn"] remoteExec ["UAMT_fnc_quickMsg"];
};
is it possible to change the 'transportSoldiers' capacity via script? Background is there are two Trader planes, one with transportSoliders =9 and one with = 0 (for cargo transport). I would like to switch between versions via a service menu, but the transportSoldiers capacity stays to the initial spawned version
Hey is anyone able to give me a hand with an initPlayerLocal.sqf script?
Got this here:
sleep (random 7)+15;
player say3D ["Attack1", 1000, 1, false, 0];
player addForce [player vectorModelToWorld [5000,0,2000], [0,0,0]];
for "_i" from 0 to 15 do {
[player, 1, "body", "vehiclecrash"] call ace_medical_fnc_addDamageToUnit;
};```
Now at the moment, obviously, the say3D command only runs on the local machine, but I'd like for it to play on every machine at one specific local player's position.
I have an idea to use remoteExec 0 with another script, but I need to pass the local player's position to make sure it's created at the right place.
Is there an easier way of doing this, or does anyone know how I could pass information through the remoteExec function?
Thanks ๐
Do you know what Player does say the sound?
If so you could cover that with an if so that the sound is only triggered on the player who says the line:
if (vehicleVarName player == "player_1") then {
playsound3D ["path\Attack.ogg",player,false,getPos player,1,1,1000];
};
Could that help you?
I'm really sorry for the late reply. There isn't an argument that gives player ID or anything, sadly. I was initially going to create a helipad and then see if that worked as an object I can reference.
Wait? So you don't know which player says the "Attack"? So it could be a random player that is on that position? Or is it always the same player? If it is, you can give him a Variable Name in the Eden Editor (for example "player_1") and that would be enough.
No haha, the script is on initPlayerLocal, so it just runs independently on every system.
That's why no other players can hear the say3D command at the minute
Thats why I suggested using playSound3D because this works global
Ahh right I see now. Sorry mate I'm incredibly tired.
No problem at all. Just be aware that because of different machines, the player that "says" "attack" could load faster then others so its not completely sure if everybody can hear it.
I should mention that this is triggered based on other variables
if (_soundDetect >= 10) then {
systemChat "Player is Detected!";
sleep (random 7)+15;
playsound3D ["sounds\Attack1.ogg",player,false,getPos player,1,1,1000];
player addForce [player vectorModelToWorld [5000,0,2000], [0,0,0]];
for "_i" from 0 to 15 do {
[player, 1, "body", "vehiclecrash"] call ace_medical_fnc_addDamageToUnit;
};
_soundDetect = 0;
};```
So I don't know if loading would be an issue with it, as it's only conditional. I see how my old snippet does look like it's loaded on startup, though.
Nope, if its caught with that, this should work fine.
Hmm, the sound path is AQP.VTF_Korsac_Winter\sounds\Attack1.ogg
But for some reason, although
playSound3D ["A3\Sounds_F\sfx\blip1.wss", player, false, getPosASL player, 1, 1, 200]; works fine playSound3D ["sounds\Attack1.ogg", player, false, getPosASL player, 1, 1, 200]; does not.
