#arma3_scripting
1 messages Β· Page 316 of 1
I thought about it. Looked at your code.. Saw it's not the problem. And didn't say anything
yea dumb me, should have read wiki before, i dont use in var alot, so yea
How to make a list of classnames lower case in SQF
@cedar kindle Thank you for the info. But can sock execute native javascript code and return values? I thought it was for more complex uses afaik
@rotund cypress Because there are any languages aside from C++ ?
_array = ["Lol", "LOL", "loL"];
_array = toLower (_array joinString "$") splitString "$";
Meh only Language that could me get away from C++/C# + SQF is Python
Well i should start learning C# and c++ ...
This , for example, should allow to execute python code from arma https://github.com/maca134/armaext , but it is written in C# so no Linux at all..
Huh? What's wrong with C# on Linux?
I can't compile it, am i wrong?
@little eagle's comment should've inspired you to do a quick google search and the only proper response should've been: "Oh... yay!"
π
Uhm. I'm pretty sure SOMEONE made a solution for it.
'Oh yay'
π
nvm,it uses windows libraries.. :L
i thought Mono solved .net on linux
.NET Core is on linux
_array = ["Lol", "LOL", "loL"];
_array = toLower (_array joinString "$") splitString "$";``` that is the worst solution for that i ever have seen
heh makes sense to me xD
_array = ["Lol", "LOL", "loL"];
_array = _array apply { toLower _x };``` ?
How bad is it passing an empty array to remoteExec? Getting error: Trying to call RemoteExec(Call) with 0 targets for func
it's very bad because you will get the error Trying to call RemoteExec(Call) with 0 targets for func
Can .Net core be used to write extensions for arma?
@rancid ruin Are you being sarcastic? Sorry cant tell lol. Surely thats not that bad
@jovial nebula i don't see why not
@rancid ruin So I guess it would be worth adding in a isEqualTo [] check?
i honestly don't know m8
you should share your code if you want someone to help though
_targets = allPlayers select {_x getVariable ["medic",false]};
(format [""]) remoteExecCall ["SR_fnc_globalMessage",_targets];
@rancid ruin As you can see, it checks for a variable on all players and gets an array of targets to use with remoteExec. But this could sometimes use an empty array, causing this error
what's that format doing?
Oh I got rid of that just so it was easier to read, but doesnt have anything to do with my concern tho
_array = ["Lol", "LOL", "loL"];
_array = parseSimpleArray (toLower (str _array));
Might be faster right?
that format is just == to an empty string though, i don't understand
He removed the content of that format to make it easier to read
I would add an if isEqualTo [] check. It's less expensive than a RPT message
Yeah fair enough, I guess ill just do that, cheers
@pliant stream How ?D:
i don't know if you can export native functions in C# on .NET Core very easily, so it might be easiest to make a C/C++ extension that loads your .NET Core library and calls a normal method
You can use pretty much any language I think, as long as it produces a DLL.
which is fine if you're running windows
How many people here are using Linux?
I mean, I don't really get people running ArmA servers on Linux
It speaks for itself that support for Linux is always gonna be at the bottom of the list.
errr loads of people use linux servers lol
go host some servers then maybe you'll see why
I've hosted a lot of servers, all running on Windows
Me :L
Yeah basically because it is cheaper
It is harder to mantain,harder to configure
Only after around 6 months I wrote some scripts for making my life easier
lightweight, less bloatware. Sticks to widely accepted standards. Better error logging. I tkink it is easier to configure b/c shit is not cluttered over thousand places but maybe this is b/c I'm used to linux servers.
Linux is top server OS isn't it? I don't have the money for a Windows License. I also don't have the money for a 100β¬+ server
Monetize your Server.
It's a private Server. And it's running some Mods that don't allow Monetization
hey folks, is there anyone who knows how to make a menu like the Escape one? i don't mean the button but the submenu buttons and the slider-effect. is there a command doing that or is it just a config thing?
Anyone came across the global animation that gets triggered when you leave a plane? I mean the canopy gets closed and no ladder is present. I tried to read all animations from a plane and tried to apply some but thats not working. Anyone has an idea how thats done? Now even the A-164 Wipeout has that feature
gotta agree to @jade abyss
btw. got an addon to monetize addons
want me to sell it to you?
reskin so 2016
we switch skins now to get the sense of animation
if (isServer && _bool1) then
{
_roads= _obj nearRoads _radius;
_roads call BIS_fnc_arrayShuffle;
_road= selectRandom _roads;
_unitType="O_Soldier_F";
if (isNil "_road") exitWith {};
//groupName addWaypoint [center, radius, index, name]
_unitPos= getPos _obj;
_number= (count _roads-1);
_WPstart = _roads select 0;
_WPend= _roads select _number;
_veh= selectRandom _vehArray;
_createVeh= createVehicle [_veh, _road, [],0, "NONE"];
_crew= createGroup _side;
_Driver= _crew createUnit [_unitType, _unitPos, [], 0, "FORM"];
_Gunner= _crew createUnit [_unitType, _unitPos, [], 0, "FORM"];
_driver moveInDriver _createVeh;
_gunner moveInGunner _createVeh;
_wp1= _crew addWaypoint [_WPstart,1];
_wp2= _crew addWaypoint [_WPend,1];
_wp1 setWaypointType "MOVE";
_wp2 setWaypointType "CYCLE";
};//isServer
the AI driver wont cycle (guard the road), he would just stop, any suggestions?
Add diag_log and check if all the variables are right.
Cycle as first waypoint has no sense
even doe its not first?
ye, every log is this, saying cycle as first has no sense
cycle should be last waypoint i think
it is last, isnt it?
wait, there's only 2 waypoints
you're saying go to A, then B is saying go to A
so you'll never move
you need at least 3 for cycle to work i'd think
a > b > c > a?
hm but you can do a > b >a in editor itself
so it should be possible outside editor
it works? you tested it?
i always thought cycle wasn't actually a "go here" WP, it just does "go back to first WP"
i cant test it atm, doing other stuff, will do soon
Hey peeps! First time using perams and I'd love some help.
My goal is to pass the distance to say3D but I'm not sure how. (param[0,objNull,[objNull]]) say3D (param[1,"",[""]]); that's current code. called via [_thisunit, _selectsound] remoteExec ["client_fnc_say3D",0]; And works fine. Not sure how to add support for distance though.
where?
_thisunit, _selectsound
(** param[0,objNull,[objNull]]**) say3D (param[1,"",[""]]);
It's fine to use param(s), but do so before using them
params [
["_object", objNull, [objNull]],
["_sound", "", [""]]
];
.. say3D ...
So it's actually readable π
Oh, lol
So when you say distance, you want to use the alt. syntax for say3D?
So then what stops you using it π ?
Syntax for skipping a peram
I'm really not sure what you mean
You are welcome to do something like
params [
["_object", objNull, [objNull]],
["_sound", "", [""]],
["_distance", 100, [0]]
];
_object say3D [_sound, _distance, 1];
Distance defaults to 100m by default, so if you don't want to pass a distance, you don't have to
[_thisunit, _selectsound] remoteExec ["client_fnc_say3D", -2]; //100m
[_thisunit, _selectsound, 50] remoteExec ["client_fnc_say3D", -2]; //50m
Awesome, killed two birds with one stone as I wasn't real sure how to specify expected type. [0]
So -2 excludes the server... Is this just good coding practice or an optimization?
Well, why would you execute something where it's not needed? π€ @unreal siren
Fair enough
I'm trying to find a way to detect when a player receives an invite from the BIS dynamic group system, what's a good way to go about retrieving said information? The vars aren't public inside the function as I'd use a Public Variable Event Handler but... ["GetPlayerInvites", [player]] call BIS_fnc_dynamicGroups; Can be called. Doesn't clear list when the invite is accepted though. I don't really want to use a while loop when the player respawns.
Hey guys! Is there any option to display the safezone mousecursor position?
I think my AI became sentient. after hours of testing a mission where death is inevitable, one has given himself a raven vest and 23 rgn grenades. the story goes a little differently now...
im looking for a rogue game logic or something, an init field somewhere...
Small question. When I set a global variable in init.sqf and I want to edit this variable for clients, how can I do that? Let's say this variable is DZE_preferHint = true;
I will make a script that is called in !isServer part of init.sqf so only for client. In this script I will change the variable DZE_preferHint to false. Is this only for the client or is this disabled on the whole server then?
A global variable is local to the client
Changes to it won't be broadcasted automatically
@dusk sage Thank you!
I don't want to make it public.
Ok, sorry.
π₯
how can i generate a respawn point on the fly through script, i have sectors that can be captured and i would like to make those respawn points, depending on who owns them and maybe other conditions
and how can i attach a respawn point to a vehicle for a mobile HQ?
will it work if i generate new matrkers with name "respawn_west_XXXXX" usw?
and move them around?
so that is a yes? because i now that page, im just wondering if all that applies for markers generated and moved or changed during game, or if its only initialized once on start of the mission.
so i mean if i change a markername from respwand_west to respawn_east during game, that will work, yes?
it should do yes
How do I check if a player is the host in a non-dedicated, player-hosted server?
isServer & hasInterface?
Wiki says ```SQF
if (isServer) then {
//run on dedicated server or player host
};
that is true, but if you want to filter out a player host vs. dedi server then hasInterface will do
Ok, thank you!
π
Hi, I want that the arsenal opens if a player spawns and is not in a vehicle
So I tried to put these in the onPlayerRespawn.sqf, but both donΒ΄t work
if !(isNull objectParent player) then {["Open",true] spawn BIS_fnc_arsenal};
if !(player == vehicle player) then {["Open",true] spawn BIS_fnc_arsenal};
if you diag_log !(player == vehicle player) at the same point in the script does it say true?
maybe good old waitUntil {player == player} Just guessin
Sorry where does that output to @rancid ruin
RPT @twilit tartan
you could also systemChat str (!(player == vehicle player)) to show it in chat box
ah ok
Sorry IΒ΄m a noob still, my onPlayerRespawn.sqf looks like this atm: waitUntil {player == player} {["Open",true] spawn BIS_fnc_arsenal};
systemChat str (!(player == vehicle player))
DoesnΒ΄t output anything
π
waitUntil {player == player};
systemChat str (isNull objectParent player);
if (isNull objectParent player) then {["Open",true] spawn BIS_fnc_arsenal};
you were also using if !isNull. That would only execute when the player has a parent. Which means he is in a vehicle. so your objectParent code would execute only if player is in a vehicle. The opposite of what you want
Ah ok thanks
now it returns true in chat, but the arsenal doesnt trigger when outside the vehicle
uhm
maybe semicolon missing. right after BIS_fnc_arsenal
check RPT for script errors
have a weird issue here: moveInTurret/action ["moveToTurret",.. works fine in 2d editor, but not in Eden
assignedVehicleRole shows the correct turret but the player doesnt get moved to it
@still forum It says this: 15:55:22 File C:\Users\Fried\Documents\Arma 3 - Other Profiles\Fritz%20von%20Bordeaux\mpmissions\IRAQ%20APACHE.DYA\onPlayerRespawn.sqf, line 2
15:55:22 Error in expression <emChat str ((isNull objectParent player);
if (isNull objectParent player) then {>
15:55:22 Error position: <;
if (isNull objectParent player) then {>
15:55:22 Error Missing )
my systemChat has one ( too much
@still forum Alright, the arsenal starts now, but it starts in the helicopter as well sadly. Any more Ideas?
Player spawns directly in helicopter? Doesn't maybe get moved into it after arsenal opened?
IΒ΄m using the standart arma spawn selection screen, so that could be the case yeah
Would a delay help maybe?
@little eagle thanks!
In the Killed event handler, whats this new instigator object parameter? As in hows it different from killer
@little eagle Would this be a workaround for killer sometimes being the driver of a vehicle rather than the gunner? As in would the instigator properly return the gunner
If time doesn't pass in 3den, then how come it starts raining when setting the overcast to max...?
rain is probably a shader effect rather than an actual environmental physical thing i'd guess
When I pull a string from a database, for example, the name George should it be stored in a VARCHAR(30) with quotes or is it good practice without?
Is it common/good practice to store an array in a database or should I store the data in separate columns and create the array in arma?
Didn't I read the same question a minute ago somewhere else?
I don't see why you would store it with quotes.. You'd have to parse the quotes away again later.. Why do additional processing?
Do what's fastest and easiest
Ok I get the first answer but the second I'm not sure. (Fastest/Easiest) It seams like storing it as '[""data"",43,b_soldier_n]' would be quicker but will arma detect it as a string when I do _anArray = ["data",42,b_soldier_n] ?
look up parseSimpleArray
thanks
is showGPS the command to show/hide the Rctrl+M minimap? Am trying to force it to show but it is unresponsive both in my mission & in a plain editor mission :/
I should also say: the unit does have a GPS assigned.
yeah it seems to be fucked
visibleGPS reports true/false correctly
and if you have GPS open already, then showGPS false hides it again
but showGPS true does nothing π€πΏ
almost certain that you'll be able to display it via script somehow though
this ```sqf
_pos = _mobileHQ getpos [5, (getDir _mobileHQ + 180)];
should give me a position 5 meters behind the mobile HQ right?
fr some reason it returns random positions around the mobile HQ....
heyho, is there a button which can contain a picture as well? like rscPicture but with an action attribute?
you can put a button with no opacity over a picture
thats what i did until now, but i thought there is an easier way ;D
I'm sure you can set an onclick event handler but I've never tried it
how do you get the stupid callouts to stop interrupting sideRadio, because enable sentances also turns off sideradio commands
TIL you can have multiple radio messages at once if they're from diffrent units
disable the voicePack for the unit? π€·
trying to stay vanilla, want to release this :P
I found out I can just layer over it with other units
I know there is a solution to this, because I used it to disable AI from talking during mision run
There is enablesentences but that turns off the sideradio command too
Hey guys, is there any function to check how much inventory space a player has left? I can't remember.
I tried looking at the RscDisplayInventory, but I couldn't find it all in RscDisplayInventory function.
https://community.bistudio.com/wiki/setVectorDirAndUp why is this so hard to understand
and why does changing numbers on only one array change nothing
I've been testing numbers in the debug menu for an hour now and it's either sideways and staring straight ahead, how the fuck do you do this shit
Don't sleep in maths lessons π
_camera setVectorUp [0.001,0,0]; is 90 degrees sideways, but _camera setVectorUp [0.000,0,0]; is straight
wat
pbtbtbtbtb okay
and.. yeah... The results are correct. That's how vectors work
google for some angles to upVector calculator
I know you can cross product the forward vector with something and then you get the right vector.. and then you can cross product that with something again to get the up vector
I'm not sure what to search for if I want to get the position of a player where he is lookin with a rangefinder or similiar. While writing this question maybe lookAt will do the job?
Control what the unit(s) is/are looking at (target or position). ah nope
Gimme a sec
https://community.bistudio.com/wiki/getCameraViewDirection
eyepos -> eyepos + viewDirection * maxRange
https://community.bistudio.com/wiki/lineIntersectsSurfaces
intersectPosASL from returned array
Or just
eyepos + viewDirection * RangeToTarget
dunno how to get the range to whatever point the player is looking at without lineIntersects
@plucky beacon https://github.com/CBATeam/CBA_A3/blob/master/addons/vectors/fnc_polar2vect.sqf
That might do it. remember that upVector has to be perpendicular to forward vector. So elevation has to be choosen acordingly
I found a bis function for pitch and bank so I'm using that
thanks though, I'll bookmark it
hmmm could be a tryout. Not sure how its done with the BIS arty / cas module
there you also just spot a location and ask for support via the radio π
[_supportType, _supportCoords] call BIS_SUPP_pickProvider; interesting I need to investigate further π
@plucky beacon well, you have to use a combination of directions. One axis controls left or right of the original pos, one controls forward and backwards from original pos, and one controls the up and down. Assuming it conforms to the regular positioning
So I have a issue using the https://community.bistudio.com/wiki/BIS_fnc_UnitCapture
I'm using the Y-32 as the transport. Since AI drive them like a run away semi I figured I would just use UnitCapture.
took me like 20 times, but I finally got a decent landing and take off. However, the gear, and VOLT manuvering wasn't rrecorded.
iirc, Enemy Units can't enter Vehicles, wich is taken by the enemy.
(or does it work?)
+What is your issue?
The landing works, but the unit fails to deploy landing gear, and the door. As well as not using proper vector(which is fine for now).
It basically just stops were it's gear normally would hit. But since it doesn't deploy them it just kinda floats.
As well as not using proper vector(which is fine for now). <- Is it a prob or not.
You must be clearer with your statements.
I have no clue what the actual problem is, that you need help with
The prroblem is the AI will follow the UnitCapture path but fail to deploy landing gear. Which means it doesn't properly land but instead hovers about .8m off the ground.
BIS_fnc_UnitCapture
and a VTOL is following it?
BIS_fnc_UnitCapture is a function that allows you to create movment data from player made paths.
Wait a sec, i mixed that with another Command
@outer fjord Yeah but not sure if deploying landing gear will covered by that. You could try to press F2 to copy the weapons data
I mixed that with "setCaptive" -.-
https://community.bistudio.com/wiki/setCaptive
Hence why I put a link up first thing >.<
Maybe that includes the landing gear deployment
mmm, I'll give it a try. Kinda sucks I have to go back to landing that. VOLTs have became a pain since Auto-vector is broken at least in dev. :\
Now that I think of it, probably explains why BI never used a vehicle that has deployable gear that uses that featurre.
_coords = _this getVariable "BIS_SUPP_supportRunCoords"; hmm now I need to find out where this variable gets set and how π
ah that comes from _supportCoords = (player getVariable "BIS_SUPP_request") select 1; via _provider setVariable ["BIS_SUPP_supportRunCoords", _supportCoords, TRUE];
Hey guys, this problem has been pissing me off for an hour and it makes absolutely NO sense.
_thisItem = _x;
id = (_thisItem select 0);
That returns ```SQF
["Vest_White","Vest"]
but when I do ```SQF
_thisItem = _x;
id = (_thisItem select 0) select 1; // To return "Vest"
HOWEVER! When I do it in the "watch" section of debug console with public variables
shouldn't just id = (_thisItem select 1); work?
it works fine
but not in script
No, select 0 includes the brackets. I want to have the second entry within those brackets
ah
rgr
Β―_(γ)_/Β―
It's been working for weeks xD
@jade abyss do you have some way for replacing words with acii? Or a text pad for the shrug ? :P
Well when I look at id for example in the 'Watch' section it is correct
Ooohh....
Β―_(γ)_/Β―
and when I go (id select 0) select 1 it works
but when it's in a script
no dice..
even if it's just that in a script
I don't have a magical glassbowl
grr it seems really hard to find out how arma gets the coords from the player where he is lookin at trough an object (laser designator for e.g.). As far as I see that doesn't seem to be available in the modules_f.pbo hmmm only thing I was able to find is that the coords maybe get transported trough a variable with name BIS_SUPP_request
ah yeah modules, ofc its maybe not inside there lol
Raycasting to the rescue? π€·
Only 1 km wtf?
:, damn having no luck with this.
Is there anyway to force gear down on a aircraft controlled by AI? action ["LandGear", planeOne]; doesn't seem to work.
prolly animate
Check in the configViewer for the AnimationSources, then do a PlaneOne animateSource ["AnimNameForTheGars",1];
But i doubt, it would help.
this tells me if a player is in a vehicle (vehicle player != player)
or (isNull objectParent player) = not in a Vehicle/on foot
would !(vehicle player != player) tell me if the player is not in a vehicle
ok so (isNull objectParent player) means they are not in any vehicle?
β Read above, i edited
ok thanks
Meh, I think I give up for now, and will just switch to a helicopter. I can see why Bi never used the VOLTS in the campaign either.
Well. Mission development versus when the vtol was made is important to consider
If they felt they needed to use it they would be adding more functionality specifically for use in that mission
Well yea, it's nice to run into the hurdles they delt with during their own mission making.
Hopfully fixing the auto-vector when jet DLC comes out will fix this. At least then I can just force the AI to take it very slowly so it's not a crazy 3 orbits to land.
Quiksilver, the only person that talks more trash than me.
(difference: I mostly mean it as a joke π )
π€¦
Why did i removed you from my blocklist again? ^^
Do they even have job openings for ai programmers?
Honestly the Arma 3 AI is pretty damn impressive consideriring what it does.
Indeed, and the truth of it is: it's not going to get any worse.
Well, if there is a poor design decision, it could go down.
So far the only issue which is what is effecting my mission set up is the AI is having trouble with VOLTS now a few things have changed with the flight model in dev.
And that's only an issue post flight model changes correct?
That I don't know, been stuck in dev forr awhile just foaming at all the jet DLC stuff :S
Lol, yeah it's really weird getting used to the new stuff. First time engaging a ifrit I was like "wtf?". But yeah, that'll get fixed if it hasn't been already I guess. O'
Maybe a few more days on the dev branch and see if it gets fixed?
Hopfully, the lack of auto-vector is killing me and many AI. XD
Hmmm..are you sure there isn't like a defined user action for it? I mean like if I were to do "_myCoolAI action["Eject"(vehicle _myCoolAI)]" except with vectoring? π€·
why do you call them VOLTS, isn't that a measure of electricity?
π
@tough abyss Nah, i just tab in when PboProj is packing files π
I need a 3rd monitor -.- everythings full
Lool, they're quite the shock @rancid ruin π
I hate how tiny mobile devices are π¦
Oh jeez, I can see this being a fad now.
i think logic gately thinking you'd run out of electric puns pretty quickly
who knows. We can be CREATIVE Β―_(γ)_/Β―
its telling me im missing a )? if (!(isNull objectParent player) && (_stage = 1)) exitWith {hint "Debug: You are in a vehicle"};
stage == 1
thanks
any way to see if you are wearing a certain peace of clothing? cant find it in arma
i think i found something _uniform = uniform _unit
that's the one
Yep
So just a update, putting the AI on limited speed in the waypoints will cause the VTOL's to switch over. But only the Blufor one will activily/some what effectivly land at the designated spots. The Y-23 still won't turn full VTOL and will go for runways.
I decided to just settle with a Taru T-T
how does the nearRoads work? its so confusing, iam running a script so it selects the first position in road, then middle position, and the last position by selecting specific number in array, but it doesnt work since this: http://prntscr.com/f51dsv
_roads= _obj nearRoads _radius;
_number= (count _roads-1);
_count= (floor(count _roads)-1);
_div= _count / 2;
_WPstart = _roads select 0;
_WPmid= _roads select _div;
_WPend= _roads select _number;
this is what iam up to, but it doesnt work since nearRoads returns array in a very interesting way, i could just do this:
_WPstart = _roads select 6;
_WPmid= _roads select 3;
_WPend= _roads select 25;
by the screenshot, but i run script of different camps passing the obj, so the preset selections wouldnt work, because radius is different
The array reported by nearRoads has an arbitrary size depending on how many roads are inside the circle.
What is confusing to me is what you're doing with that.
making cars spawn/despawn
What is the difference between _number and _count?
dont judge me on that, iam too lazy :T
Also I don't think you can just apply waypoints to these road segments like that.
theyre working
tested this:
_wp0= _crew addWaypoint [_WPstart,1];
_wp1= _crew addWaypoint [_WPmid,1];
_wp2= _crew addWaypoint [_WPend,1];
_wp0 setWaypointType "MOVE";
_wp1 setWaypointType "MOVE";
_wp2 setWaypointType "CYCLE";
Like say the middle road segment in the array has the WP in the middle of the first and last segment.
I don't think the order is guaranteed and the road segments can be from totally different roads.
Leave out the middle waypoint completely I guess. It serves no purpose anyway.
then cycle stops working
returning error of cycle as first WP makes no sense
creating 2WP same place as "MOVE" doesnt work, already tested
Yeah, you need a starting WP, then a first waypoint and CYCLE can only be the second waypoint
I guess when you createUnit the crew, it doesn't add the starting waypoint until a few frames later and then it doesn't for you, because you already created some.
Just add the first "MOVE" waypoint twice.
k, but how do i return road positions again
getPosASL _road?
You don't even need the position really. addWaypoint accepts objects as positions and I don't see why that wouldn't work with road objects.
What radius?
any, passed into VM
as i said iam running it so i could pass different settings into VM
onto different camps with different obj
"VM"?
pff
lol
_bool1= (_this select 0); //enable vehicles
_bool2= (_this select 1); //enable garrison
_obj= (_this select 2); //obj
_radius= (_this select 3); //radius
_side= (_this select 4); //AI side
_skill= (_this select 5); //AI skill
_percentage= (_this select 6); //percentage
_exclusionList= (_this select 7); //exclusion list
_vehs= (_this select 8); //vehs
null=[true,true,camp1,200,EAST,0.20,50,_exclusionList,_CSATvehs]execVM "garrison\init.sqf";
eww
potato iknow
What is the question again?
commy2 - Today at 10:16 AM
You don't even need the position really. addWaypoint accepts objects as positions and I don't see why that wouldn't work with road objects.
What radius?
you would just write _radius i think if using getPosASL
I don't get it. How is that different from what you're doing now?
And you don't need getPosX. addWaypoint accepts objects as positions.
you mean how different is the radius?
What radius do you speak of?
I have no idea, but
_roads= _obj nearRoads _radius;
seems fine to me
yes, but we arent talking about nearRoads anymore bcuz it doesnt work me
nearRoads works fine
so... nearRoads, how do i get first and the last position in road then? selecting first and last element in array wont work, dumb
why don't you just place the waypoints manually since you know where they are meant to be?
sort them, but idk if they aren't sorted already.
@rancid ruin debugging road positions, then placing waypoints for many camps different radiuses its just too much of work
you could put them in a logical order using https://community.bistudio.com/wiki/roadsConnectedTo but i don't think you'll ever get something perfect
a minute ago it was for placing waypoints...you really need to explain yourself better lol
it is about placing waypoints wdym?
i wantedto mention that roadsConnectedTo is more for placing static objects
#define ASCENDING true
#define DESCENDING false
_roads = _roads apply {[_x distance2D _origin, _x]};
_roads sort ASCENDING;
_roads = _roads apply {_x select 1};
sorts roads by distance from _origin. For Dscha edition.
that's good if there's no sharp corners π
well, ill take that one probably the best i can get, there are some turns, but i will workaround them
thanks
do i see this right, that eventhandler respawn is only usable on players, not ai units?
to fill a vehicle with gear i can use [_this,_value] call bis_fnc_initAmmoBox;and replace _value with this array of arrays? i dont find documentation of that function anywhere
hm i guess i might just use these 4 functions
BIS_fnc_addVirtualBackpackCargo
BIS_fnc_addVirtualItemCargo
BIS_fnc_addVirtualMagazineCargo
BIS_fnc_addVirtualWeaponCargo
but why is there the 'global' variant for them?
wont the stuff that i add be available for everyone anyway?
Anyone used https://community.bistudio.com/wiki/screenToWorld lately? It returns coords but I'm not sure what is meant by the screen. atm I just check if the player is in (cameraview == "GUNNER") and then use screenToWorld with the example coords
Well.. It converts screen coordinates to world coordinates
0,5,0,5 returns the position you are currently looking at
hmm thats fine exactly what I want
but only where it intersects with the terrain.
Yeah.. Just remembered we talked about exactly that yesterday
not also with buildings?
Nope
But you can make a LIS between posScreenToWorld 0.5,0.5 and that point to get that
hmm well goal is that player looks trough laser designator and "marks" a target. that position then should be returned
I know I will try that thanks
Is there really no command that returns the current camera FOV? I want to add a 3D compass to the Drone Feed. Currently doing that via posCameraToWorld and drawIcon3D which works fine. But is ofcause way to big If I zoom in. Any way to detect how much zoomed in a player currently is?
@still forum guess you want use CBA?
I have CBA yeah
there is function called CBA_fnc_getFov let me see https://github.com/CBATeam/CBA_A3/blob/ffd5fa78b0c51427e186909682fe7ea1815c6906/addons/common/fnc_getFov.sqf
or directly with ArmA http://killzonekid.com/arma-scripting-tutorials-get-zoom/
Ah yeah.. Nice. Thanks
I'm watching the uav Feed and shownUavFeed == false...
Probably only applies to the little onscreen video thingy above the gps :/
Well.. Alternative works atleast
uavcontrol (getConnectedUAV player) select 1 == "GUNNER"
Noob here, I have a question: I have this in the Init of a Helicopter: position[west, this] call BIS_fnc_addRespawnPosition; Now I want that this respawn only gets activated when the helicopter leaves the area of my marker called "FOB_Marker", so something like waitUntil not on FOB_Marker or something?
_targetPos = screenToWorld [0.5,0.5]; I want to use that in a script but what I don't get is where I tell Arma to get the screen from one specific player? In Singleplayer there is only one but in MP?
in MP there is only your local screen
yeah but which local screen? How does the screenToWorld determines which local screen to use?
I don't get that
@twilit tartan not a super scripted but maybe add a trigger area using the on activate and on deactivate to toggle it on and off?
Quick question that i was hoping someone may be able to help me out with, we use ACE on our server and im working on a addaction vehicle respawn script for aviation on the Nimitz carrier. i have got the respawn system working but im wanting to find out if there is a way to have the aircraft spawn with a init and also with the FRIES fastroping that ACE has. Im able to do this in the editor but with the respawn its a base craft without any init or selected attributes. This is the init im running on the sign to spawn in aircraft
MenuObject addAction ["UH1Y Ground Support Chopper", {createVehicle [(_this select 3), (getPosATL chopper), [], 1, "NONE"];}, "RHS_UH1Y_GS"];
the getPosATL chopper is just a invisible landingpad so i could set hieght
@still forum I mean if I have three players in a mission and have a screenToWorld that is present in a script. How can I determine which player is used then? e.g. sqf _targetPos = screenToWorld [0.5,0.5]; _intersectTargets = lineIntersectsSurfaces [_targetPos, _targetPos];
You only have one screen.
@hollow lantern
_targetPos will be different for each player
anyone knows how to get a hold of a king of the hill mission? or do i need permission to host it?
_targetPos = screenToWorld [0.5,0.5];
_callerPos = [positionCameraToWorld [0.5,0.5]];
_intersectTargets = lineIntersectsSurfaces [_callerPos, _targetPos];
``` can someone explain the command ``positionCameraToWorld`` for me? I don't get what exactly I need to give as arugments. I tried to give 3 args but then the error tells me I only have provided 1...
@hollow lantern _callerPos = positionCameraToWorld [0.5,0.5,0];
thx
why that 0.5?
positionCameraToWorld turns a camera relative position into a world relative position
positionCameraToWorld [0,0,0] == position of the camera
positionCameraToWorld [0.5,0.5,0] == position of the camera + [0.5,0.5,0]
if player is in first person that should be extremly close to eyePos
well I just want the position of an objet that lineIntersectsSurfaces because screenToWorld does only on the work terrain side
if you want the exact position of the camera use positionCameraToWorld [0,0,0]
@still forum it returns a coordinate but sadly its the one where I'm standing at π
hmm thats not what I want π I'm looking trough a Rangefinder and want the position where I'm looking at with the Rangefinder
and if there is a Object (Unit / soldier) it I want that position instead.
I tried stuff with sqf _targetPos = screenToWorld [0.5,0.5]; _callerPos = positionCameraToWorld [0,0,0]; _intersectTargets = lineIntersectsSurfaces [_callerPos, _targetPos]; _intersectTargets params ["_intersectTargetPos"];
Yeah
_targetPos = screenToWorld [0.5,0.5];
_callerPos = [positionCameraToWorld [0,0,0]];
_intersectTargets = lineIntersectsSurfaces [_callerPos, _targetPos,player];
_pos = _intersectTargets select 0;
_pos is the target you are looking at
hmmmm sqf 16:37:02 Error in expression < screenToWorld [0.5,0.5]; _callerPos = [positionCameraToWorld 0,0,0]; _intersect> thats my code sqf _targetPos = screenToWorld [0.5,0.5]; _callerPos = [positionCameraToWorld [0,0,0]]; _intersectTargets = lineIntersectsSurfaces [_callerPos, _targetPos, player]; _strikePos = _intersectTargets select 0;
but screenToWorld looks fine according to the wiki https://community.bistudio.com/wiki/screenToWorld
what error in expression?
wait what
wtf are you doing
[positionCameraToWorld 0,0,0]; that's not how.. wtf
dude
lol
ah I see
Hey what script editors does everyone use? Is notepad++ good? Is there one that particularly good for Arma 3?
i've used notepad++ for years but there's a few options
atom https://atom.io/
sublime text (website seems to be down)
try a few and see what you like best
I'm mostly using Atom and N++
atom/sublime here
I use Intelij IDEA Ultimate ^^
_targetPos = screenToWorld [0.5,0.5];
_callerPos = positionCameraToWorld [0,0,0];
_intersectTargets = lineIntersectsSurfaces [_callerPos, _targetPos, player];
_strikePos = _intersectTargets select 0 select 0;
_weap1 = "R_60mm_HE";
_weap2 = "rhs_mag_AZP23_100";
_orbitalstrike = createVehicle [_weap1, _strikePos, [], 10, "CAN_COLLIDE"];``` thats weird, the coordinates are still near my soldier. 2meters away but I looked at an house 1 click away hmmmmm
If I want specific weather and fog values set for a MP mission, does setting it from the intel screen in the editor work fine, or do I need to specify it via the init? I guess what I'm asking is what's the best way to make sure everyone (including JIP) sees the weather the way I want it?
Does anyone have any experience with packing scripts into a .pbo? I'm having a hard time finding info about it in general, like what should the folder structure be and contain? And how do I execute functions or scripts from that PBO?
@median abyss I'll have a look for you in a moment
This is the line in my init.sqf for a CTI mission, ```[] execVM "scripts\towingandslingloading\fn_advancedSlingLoadingInit.sqf";
[] execVM "scripts\towingandslingloading\fn_advancedTowingInit.sqf";
As you see it's for the advanced sling loading and towing :p If you can execute the script while in game with other means I imagine you can drag drop it into a mission and add to the init.sqf [] execVM "insertpathtothescript/insertscriptname.sqf"
Thanks π I'll have a closer look at that in the morning
The code inside of even handlers is unscheduled right?
yes @plucky beacon
Thanks
hey guys, anyone know the CFGmagazine of the IFA3 Katyusha rockets?
quick question guys how do I get my script to broadcast globally from the server to everyone that is on it. I was looking at BIS_fnc_MP but it doesnt seem to have the functionality to complete this task
while{true}
do
{
x = selectRandom[1200, 1400, 1800];
sleep x;
_null = [] spawn
{
[selectRandom[1,2,3,4]] call BIS_fnc_earthquake;
};
sleep x;
};
is the script
and I do not wanna put it into the init.sqf as what will end up happening is that earthquakes will happen at different times for every player
I looked at that I thought that it couldnt execute this without it being defined in CfgRemoteExec
ill give it a go though
something like this?
"EpicEarthquakesDude.sqf" remoteExec ["EpicEarthquakesDude.sqf",0];
No
[selectRandom[1,2,3,4]] call BIS_fnc_earthquake;
->
[selectRandom[1,2,3,4]] remoteExec ["BIS_fnc_earthquake"];
wow. for some reason I thought I had to make another script for this
Thanks commy! your the man
But I haven't done anything yet.
?
is there a script to reduce vehicle (only vehicle) sound while in a vehicle? i know the 1944 KOTH mod has like a bar where you can set the volume..... the ifa3 vehicles are way to loud
you can use fadesound
but if you are looking for changing sounds for the vehicle specifically, modding is required
Does anyone know the display of the in game pause menu off the top of their head (the debug console)
RscDisplayMPInterrupt or something like that
RscDisplayInterrupt and RscDisplayMPInterrupt
but I guess you're looking for the number ^^
MPInterrupt is 49 apparently
the other one is probably the same
@blazing zodiac For the debug console specifically, RscDisplayDebugPublic
more watch lines would be nice π
is it possible to define the name of a function inside a variable and then execute it? How would i do that?
_myfunc = "myaddon_fnc_test";
[stuff] call _myfunc; // obviously wont work
without the quotes it would
functions are just global variables (with code in them)
@austere hawk
@fierce dock
player addEventHandler ["GetInMan",{0 fadeSound 0.5}];
player addEventHandler ["GetOutMan",{0 fadeSound 1}];
@vapid frigate problem is that i read _myfunc from a config - and thats always text
if it has to be a string you could call compile "myaddon_fnc_test"
Is it possible to get the OBJECT of player's weapon, like backpackContainer?
Does anyone have any experience with packing scripts into a .pbo? π
sure. Basically everyone here !
Nice, is there any folder structure or specific files that needs to be present when packing?
mod
there is no structure for what needs to be in a pbo.
all the pbos must be in a addons folder.
normaly you make a modfolder marked with @fervent nymph..
fuuck
that wasn't intended XD
Is there any documentation for creating the pbo's on the wiki? Tried searching but came up empty
hehe
/@ModName /addons/ pbos must be here
then there is none
just a config.cpp in the root
you can use official arma 3 tools to pack addons, or mikero's 3rd party tools, or most tools from arma 2 days
that wasn't the problem i think π
oh right
de-pbo other people's mods to learn how to structure your own, that's how i figured it out
Yeah, I've been looking at one or two
But the problem has been that they binarized parts of them
Making me unsure about what's important and not π
you can make binarized stuff readable again with official arma 3 tools
yeah can't remember the name, it's de-something
@vapid frigate i tried, but that doesnt work. No error but it doesnt do anything. Whereas the "standard way" (commented out line) works
switch (true) do {
case (_effectType == 2): {
// [_vehicle,_memorypoint] spawn k40_fnc_effect_exploTurret;
private _func="k40_fnc_effect_exploTurret";
[_vehicle,_memorypoint] spawn compile _func;
};
case (_effectType == 1): {
// [_vehicle,_memorypoint] spawn k40_fnc_effect_fire_blowout;
private _func="k40_fnc_effect_fire_blowout";
[_vehicle,_memorypoint] spawn compile _func;
};
default {
// [_vehicle,_memorypoint] call k40_fnc_effect_fire_medium;
private _func="k40_fnc_effect_fire_medium";
_effectVehicle = [_vehicle,_memorypoint] call compile _func;
};
};
private _func=call compile "k40_fnc_effect_exploTurret";
oh ok.
[_vehicle,_memorypoint] spawn _func;
probably more useful to make the string in the config a generic bit of code though
of course, thats the next step
which would be [_vehicle, _memoryPoint] spawn compile _stringFromConfig
then you could make the string in the config _this spawn k40_fnc_effect_exploTurret
(or any code)
i'd rather just put the name of the function in the config
yeh works either way, just more flexible having code in there
works, thanks
if I add players names to the lblist like that
_list lbAdd format["%1", name _x];
how would I sort it?
but would it work?
considered doing something like that
lbSort [_list, "DESC"];
lbSortByValue _list;
That format is pointless. And why sort the LB twice?
saw it somewhere as an example on the BIS wiki, guess they were just examples but didnt look like that
lbSort should sort them by their label (the name of the player)
lbSortByValue would sort them by their lbValue, which is set by lbSetValue and defaults to 0
So the second sort would do nothing or even undo the first sort.
And format ["%1", STRING] does nothing.
Don't know if I am putting this in the correct section, but when working with dialogs, I have made a full screen dialog initially on a 1920x1080 display with Small interface size. I have used safezones, but people still tend to get their dialogs squished together and unable to load a RscCombo for example. Is there anyone who is experienced with dialogs here?
Sorta.
I don't use the safezone stuff directly, but use the predefined grid system from that BI library.
Do you mean these all strings with a bunch of brackets?
@little eagle
What BI library are you referring to?
#include "\a3\ui_f\hpp\defineCommonGrids.inc"
Oh
x = X * GUI_GRID_W + GUI_GRID_CENTER_X;
y = Y * GUI_GRID_H + GUI_GRID_CENTER_Y;
w = W * GUI_GRID_W;
h = H * GUI_GRID_H;
X,Y,W,H are some numbers
I know that lol
π€£
So, would that solve my problems do you reckon? @little eagle
I know. Im just drilled to put legends on my examples. lol
Also @tough abyss as I mentioned above, I already use safezone.
Idk. I never had problems since I use it like that.
Ok.
Okey, well thanks @little eagle I will give this a try, if this works I owe you big time cause I've had problems with this for such a long time.
Is there any script to keep the UAV feed from getting darkened?
When I open the UAV Terminal the Feed first looks like this http://image.prntscr.com/image/2f1f995c4e33400ab580a694283d41d4.png
But after a few seconds fades to this http://image.prntscr.com/image/8b8790a06a9a4c8887c5096ad5e1bd0d.png
@rotund cypress https://community.bistudio.com/wiki/Pixel_Grid_System
I usually use the following format for my dialogs: ```
x = "SafeZoneX + (510 / 1920) * SafeZoneW";
y = "SafeZoneY + (285 / 1080) * SafeZoneH";
w = "(100 / 1920) * SafeZoneW";
h = "(30 / 1080) * SafeZoneH";
Ooh, thanks @smoky crane
Oh right, thank you!
good wiki page
π
hmm I'm not able to find a solution on how to create a bullet (or lots of) in arma via script. Can it be archieved?
createVehicle ?
Dunno if this is the right channel but how do I format this correctly? if this !alive call BIS_fnc_removeRespawnPos; So basically if this heli is dead, remove the respawn position
maybe
if (!alive this) then {call BIS_fnc_removeRespawnPos}
although i've never seen that function before
Alright gonna try that
This is the init: Null = [this] spawn {params["_heli"]; waitUntil {sleep 1; _heli distance getMarkerPos "FOB_marker" > 1000}; [west, _heli] call BIS_fnc_addRespawnPosition}; if (!alive this) call BIS_fnc_removeRespawnPos; BIS_fnc_removeRespawnPos should remove it if the chopper died
@rancid ruin hm doesnΒ΄t work, it does not remove the respawn. Is there any other solution maybe?
spelling the function name properly might go some way to making it work https://community.bistudio.com/wiki/BIS_fnc_removeRespawnPosition
Oh. Thanks π
also you need to put a then after an if or it will never work
Should've come up as error when game started with -showScriptErrors
i suggest you bookmark these 3 pages and have them open whenever you are scripting in arma, i know i do: https://community.bistudio.com/wiki/Scripting_Commands_by_Functionality // https://community.bistudio.com/wiki/Category:Arma_3:_Functions // https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
Good Idead, I will do that thanks
is there a specific way to get the bulletobject from a specific weapon? I'm unsure where to look in the config viewer as I didn't saw anything bout it. Weapon is sqf "RHS_weap_2a14" "RHS_weap_AZP23" with "rhs_mag_AZP23_100"
i'm pretty sure the fired event handler returns the bullet object itself, so you could probably run typeOf on it or something
magazine cfg should contain the bullet ammo config name
I'll take a look thanks
any good tricks for making a sound loop via script and avoiding it (a) playing on top of the other sound for a fraction of a second or (b) having a slight silent gap between the sounds?
simply playing and sleeping in a loop works ok, but hard to avoid either (a) or (b).
hintSilent?
hintSilent?
hintLoud?
definitely not with a sleep or loop due to scheduler shenanigans.
it used to be possible to make a CfgVehicle class play a looping sound for as long as it exists, but it seems that this is no longer the case
A3's Sound_Alarm object used to play a looping alarm sound for as long as it was spawned, but now you can't even spawn it
ah - that's what I'm thinking about doing now
dummy object and set it's sound to a custom sound source
and then just moving that dummy object around
hopefully that will work well
I'm interested in figuring this out aswell, as I had it working before, which is even more annoying because I know it worked perfectly
I've tried but wasn't able to make it work anymore unfortunately
but if you can come up with something, let me know!
using that setting?
yes, precisely that
nothing - the object spawns and doesn't play a sound
I already looked into other ways of doing it, such as the air conditioning units on Tanoa
(im trying to use this to create train sounds for ATS - and changing them depending on if you're inside or outside the train)
it turns out the buildings with AC units have a selection in the memory LOD, the name of that selection matches the sound entry of a class in the Tanoa terrain, meaning it is bound to the terrain
interesting
well also let me know if you find anything - looping via a script stinks
and if you think you can edit the Default terrain class to make all terrains inherit from it, you'd probably be right about that idea, however that sound class is not defined in the Default terrain
instead, Tanoa and Altis both create that class rather than inheriting it from elsewhere
meaning you'd have to add your sound to both of these terrains and hope that all custom terrains from other mods all inherit from either Altis or Tanoa (which thankfully 99% of them do)
but still, it's a big hackjob
yeah, I resolved to looping my sounds with a script that uses uiSleep
not the prettiest solution but it gets the job done
hmm config viewer does not list rhs_mag_AZP23_100. Is there a way to get the MagazineCFG without opening a pbo? something like currentMagazine
I've asked a BI dev who has helped me out in the past with the train stuff - maybe they have some ideas. Will let you know if I hear anything back.
why can't we disable simulation on weapon holders π¦ I just want to spawn a weapon that you can't interact with
createSimpleObject ?
createSimpleObject
allVariables
disabled for controls?
(allControls (allDisplays select 0) select 0) getVariable "a"
1
allVariables (allControls (allDisplays select 0) select 0)
[]
There is no real number, that anyone can tell.
It hardly depends on the Scripts itself
I don't think you can use createsimpleobject with weapon models
_model = getText(configFile >> "CfgWeapons" >> (primaryweapon player) >> "model"); simpleGun = createSimpleObject [_model, getpos player]; doesn't do anyting
alright, its creating the object now, but its not visible
place it higher
ah, there it is
π
do you think its an animation that's giving it the appearance of being fired?
Of course
I'm gonna try simpleGun hideSelection ["proxy:\a3\data_f\proxies\muzzle_flash\muzzle_flash_rifle_mk20.001",true] firstly
simpleGun hideSelection ["zasleh",true];
got it
shit I'm too late
XD
I uses selectionNames and tried them one by one
Hey yall, I got this flying script I'm working on. It works as intended BUT
The toggle_flight function and toggle_hover function seem to only work properly every second time the script is run. I can't figure out why, it seems bizarre to me that it would work properly only every other time you run the script. even if you restart the mission. Any idea what's going on? (I call the script from init.sqf call compile preprocessFile "fly.sqf")
So in a function how do I return a value? Is it just a value placed at the very end? Or?
^ disregard last
solved or not?
nah, can't figure it out
Was talking to midnight.
Anyway:
keyToggle = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 21) then {call toggle_flight;false;}"]; //y toggles flight
keyForward = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 17) then {call fly_forward;false;}"]; //W - Forward
keyBackward = (findDisplay 46) displayAddEventHandler ["KeyDown","if ((_this select 1) == 31) then {call fly_backward;false;}"]; //S - Backward```
Put them together in one KeyHandler
e.g.
(findDisplay 46) displayAddEventHandler ["KeyDown","call My_fnc_KeyHandler;}];
My_fnc_KeyHandler =
{
params["_ctrl","_button","_BtnShift","_BtnCtrl","_BtnAlt"];
private _ButtonDisabled = false;
private _BD = {_ButtonDisabled = true;};
if (_button == 21) then {call toggle_flight; call _BD;};
if (_button == 17 hen {call fly_forward; call _BD;};
_ButtonDisabled
};```
@jade abyss Yep all solved I was being retarded
rgr
Anyone know to get the position of the camera if the player is currently looking at the work via a camera?
I essentially want to know the eyepos of the player (which might be the eye pos of the player object or the position of the camera)
maybe I want positionCameraToWorld
ok, answered my own question - thanks π
thank you @jade abyss Ill give htat a try in a bit
If anyone wants to know how to create an empty object that emits a custom sound (kinda like the camp fire) and can be moved around, here's how you setup the config:
class CfgSFX
{
class ATS_Train_Outside_SFX
{
sound0[] = {"\ats\sounds\sounds\ats_train_outside.ogg", db+0, 1, 250, 1, 0, 0, 0};
sounds[] = {sound0};
empty[] = {"", 0, 0, 0, 0, 0, 0, 0};
};
};
class CfgVehicles {
class House_F;
class ATS_Sound_Source : House_F {
scope = private;
simulation = "fire";
};
class ATS_Track_Exterior_SS : ATS_Sound_Source {
class Effects
{
class sound
{
simulation = "sound";
type = "ATS_Train_Outside_SFX";
};
};
};
};
then you create the vehicle (in this case ATS_Track_Exterior_SS ) and then call _theObject inflame true; to turn on the sound
Formatting is key
Anyone know a workaround for having to rename a mission file on a server everytime to avoid people getting kicked as soon as they dl it?
Is there an option for Arma 2 to make a line break in a RscText? I tried with \n and <br/>. Or at least an option that the text starts in the next line when the previous one is full?
@warm gorge you can not work around it, however you can make a build script to do it.
@rotund cypress What do you mwean by that
Well, you can make a build script that does that. For example, with my continous integration, it builds a PBO for me and names it whatever name + build number. @warm gorge
@rotund cypress Ah yeah I see what you mean. Out of curiousity what PBO builder do you use?
Ill have a look at that, havent found many updated tools other than Mikeros
Armake is really good and very updated ^^
I think its PBO builder is based off of Mikeros as well
But Koffeinflummi is in this discord, so him would be the guy to ask.
Can anybody assist me with BIS_fnc_establishingShot? I'm trying to make it follow a unit rather then just a location.
Or is that possible?
@rotund cypress Considering this is just the source code on GitHub, do I need to compile it myself or something? Cause im not sure how to
No you do not have to compile yourself, check releases tab.
oh derp didnt see that
Then there is for both Linux and Windows, and you can execute from whatever script you like.
I.e. Bat
Would it be possible to make a bat to drag and drop a folder on to build a PBO out of it
Wot? You can build a folder to a PBO yes. @warm gorge
if you ever wanted to be able to work with UIDs inside a container object's inventory, please take a look at https://feedback.bistudio.com/T124736 and help it get noticed - thank you!
Can you not just manipulate an array instead? @half inlet
Like select, deleteAt etc
you can, but that's not interaction with the inventory
it wouldn't actually remove anything from the unit/container
What? Why not?
well, maybe I'm missing something, but how would you do it?
Well, if you would get contents of a box, you could get an array with certain items, just select at what index you want that and remove it?
okay, but how would you actually remove a certain item using a given index?
deleteAt
that deletes the entry in the array, but you can't set the inventory of a container/item to match an array
But if it's not in the array anymore, surely it won't be in the inventory?
no, the array and the inventory are completely separate
we'd need more commands to access the inventory, as currently most of it is handled by the engine, and the few parts that have commands to allow interaction are still very restrictive
Okey, I think I see what you mean now
We can get array of contents, but we can't actually update the box again, since the array is only returned?
exactly - and while I wish it was possible to access inventory data with scripting means (such as getVariable/setVariable - this would give us FULL control), I don't think this will happen anytime soon
Ye, certainly would be nice then
which is why I suggested introducing a small set of commands that use UIDs for a start
Ye, I was looking the other day at the Inventory display script, but noticed it was all handled by the engine
it still wouldn't solve all problems, but it would at least make life easier, as currently you have to go through a lot of workarounds to achieve simple things
yeah, been looking into making a custom inventory, already have a lot of it planned out, but it wouldn't be pretty due to the lack of adequate scripting commands
Yep
I guess it's handled by the engine for all the shenanigans it has
Animated drag/drop etc etc
well, some things can be done with scripts, which leads me to believe they at least had something planned - for example you can make units take/drop weapons from/to containers around them, however they're pretty much workarounds as there are no native scripting commands to support these actions
Yep
for example, if you wanted to create a weapon with a dynamics set of attachments (that means a custom CfgWeapons entry is not an option here), you'd have to spawn a dummy unit and equip him with the weapon and all the attachments, then have him drop it on the ground
I've made a script like that and optimised it as much as I could, yet it still takes anywhere between ~0.3 to ~0.8 seconds for the action to complete
not to mention you need to spawn a unit to achieve this, which can lead to all kinds of exceptions and issues
what's surprising however is it seems that BI actually wanted to work with IDs when handling inventories, since at least 2 functions use IDs in either their arguments or their output
however these 2 aren't meant to be used with one another, and there are no other functions (to my knowledge) that would return IDs from inventory items, making the whole thing useless
So I have a script which loops through groups on a player and sends a remoteExec to the server to delete the group. But some players are detecting groups as being null/have no players in them when they actually arent like that. Any ideas? Syncronization issues?
Just ignore the null groups
I would code it the other way, get the server to check for groups and if they arent null remoteexec the groupowner to delete them.
There is also this command you could use aswell https://community.bistudio.com/wiki/deleteGroupWhenEmpty
@tough abyss Yeah ill most likely do that. Might use that new command as well. Have seen it but held off using it yet
Cheers for help π
If the group is null, then it is deleted. No? π€
Thats what you would think, but it doesnt seem to work like that for me with groups stored in an array and accessed by all players. Some detect them as null, others perfectly fine. @little eagle
With how my script works, its either the player is detecting it as null, or that its units isEqualTo []. Either way its returning innacurate results.
if((isNull _group)||{(units _group) isEqualTo []})then {
[_index] remoteExecCall ["SR_fnc_removeGang",2];
};
deleteGroup doesn't have to run on the server. It has to run on the machine that owns the group
Yeah I know, my removeGang function does some other stuff as well, on the server. Thats not the problem tho
And the if isNull makes no sense. You cannot delete a null group, as it already is deleted.
Good point, I guess I can just remove that. But even then, ill probably still get the same issue
Could it be issues with the groups being synchronized with the player?
You break the system by using deleteGroup on remote groups.
That's my guess.
It's like using addWeapon on a remote unit. The weapon is only added on the machine where addWeapon was executed, but is not synchronized to the machine that owns the unit.
In the code I provided up above, I dont call deleteGroup, thats called on the server within the function, so that shouldnt be an issue? Its just a matter of getting this function called, the local player has to detect the group as empty, which it seems to be doing when it isnt
units _group
is not guaranteed to be the same on every machine
dead units are removed from groups, but that doesn't happen immediately when a unit dies, but is delayed on every client
Just do the whole check on the server. No need to remoteExec at all.
I dont know whether I should start using the private keyword to make variables private rather than through a private array
Yeah I might as well start using it then
I'm writing a script to get as much performance as possible for video playback.
So far I have disable HUD, set viewDistance to 100m and disableEnvironment. Any more Ideas what could boost performance?
Is there any way besides loading screen how I can stop Arma to render the world?
do it in VR terrain?
No. It's the intro video to a mission
even in blank VR terrain you still get pretty bad FPS though π¦
At the start of the mission that video runs fullscreen.
ALT+TAB, start VLC, play video, ALT+TAB back in π
I guess I could create a custom loading screen and play the Video on that using RscPicture.. But I'm not sure if that's worth the effort or if it even works
ohhh, so you're trying to play a video in game and suppress what's going on in the background as much as possible?
yeah
put the player like 5km above terrain so nothing renders?
setViewDistance 100 and objectViewDistance 1 hides almost everything already. Without video I jump from 30 to 80 fps when doing that
use loadingscreen? I believe we had a video playing in that in A2
there's still shit going on near to you even if you can't see it. this game has butterflies and stuff remember
I guess I'll have to try that then.. Thought there was an easier way
I'm already disabling butterflies with enableEnvironment and also environmental sounds while the video is playing
have you tested the map display?
if you zoom in max on the map then your FPS goes mad high
also encoding settings possibly affect performance quite a bit
@still forum Object view distance can even be 0 (or 1?) and not even the player renders.
it can be 1. setObjectView distance arguments can be as low as 1. Didn't try 0.1. setViewDistance is limited at 200 I think.. or 100
Is there anything that stops me from calling functions in the Killed EH? EDIT: onKilled is actually killed
// Executed when unit dies
"respawn_fnc_onKilled" spawn debug_fnc_log;
// Code begins
params ["_oldUnit","_killer","_respawn","_respawnDelay"];
// Set unit as dead
_oldUnit setVariable ["respawn_dead",true,true];
// Disable respawn button
respawnButton = 0;
// Run onKilled scripts
_nul = [_oldUnit,_killer,_respawn,_respawnDelay] call respawn_fnc_runOnKilledScipts;
respawn_fnc_runOnKilledScipts does not run
But if I just do call respawn_fnc_runOnKilledScipts; in the debug box it works
killed, not onKilled
?
"respawn_fnc_onKilled" spawn debug_fnc_log;
this line works
You are correct
But that does not solve the issue of the call not working
OH MY GOOOOOD
It says runOnKilledScipts ( should be runOnKilledScripts)
π³ STUPID STUPID STUPID
What's the difference between closeDisplay and closeDialog
One is for displays and one is for dialogs. If you dont know the difference look it up.
Dialogs will take control over the mouse for things like buttons or controls.
Oh god, take it away commy :P
The naming is inconsistent and the concept is stupid. You generally want to use closeDialog with createDialog and closeDisplay with createDisplay.
Why use them any differently?
There is an explanation with the difference between the two on the biki, so its not like its information you couldnt find.
I am searching and testing for 6 hours now but I think I made one mistake I am not able to find.
When a display/dialog is executed with
_layer cutRsc ["rlnt_weaponhud_2_bg","PLAIN",1];
what do you use then?
Errors? Slow downs? Mistakes? Explain.
There are no errors. It's the typical uiNamespace issue that no errors are given out.
Where is your layer definition?
It's _layer = 1300; I think this is not necessary for now. I am more interested in how to close a display that was created with cutRsc
Take a glance at the cutRsc eexamples on the biki.
I did
Posted by kk: cutRsc ["myRsc", "PLAIN"]; //show cutText ["", "PLAINS"]; //remove
The wiki doesn't answer everything. I am studying it for about half a day now
Look at my post above
Wait you take "Default" as the class in the cutRsc and then it's gone?
Sure
It's the typical uiNamespace issue that no errors are given out.
wat
Oh jeez, not ready for that yet. Slow it down at least.π
@little eagle shhhhhh...its okay. Breathe in, breathe out.
I'm confused by what he meant saying this.
Shhhhhhh....its okay.
OK
π€·
π€¦
Hi, I have this in my init to set a respawn position when the heli leaves the base: Null = [this] spawn {params["_heli"]; waitUntil {sleep 1; _heli distance getMarkerPos "FOB_marker" > 1000}; [west, _heli] call BIS_fnc_addRespawnPosition}; And this in my init to remove the spawnpoint when the heli is dead: if (!alive this) then {call BIS_fnc_removeRespawnPosition}; Any Idea why the spawn isnΒ΄t getting removed?
I guess the heli is still alive when that init line is executed and afterwards nothing happens anymore.
maybe waitUntil? But I donΒ΄t know how to implement that π¦
You also need to put the argument before the call of BIS_fnc_removeRespawnPosition
Otherwise it doesn't know which respawn position to remove obviously.
You should use init.sqf and not the init boxes from the editor imo.
That would be a great help for you.
Alright, how would that look like in the init.sqf? Sorry IΒ΄m still learning this stuff is pretty hard
yep
Hey guys, I have a question regarding HandleDisconnect eventhandler. Does anyone know if it will keep the player disconnecting on the server and run the code in the eventhandler before it lets that player disconnect?
// init.sqf
if (isServer) then {
0 spawn {
waitUntil {
sleep 1;
My_Heli distance getMarkerPos "FOB_marker" > 1000
};
private _respawn = [west, My_Heli] call BIS_fnc_addRespawnPosition;
waitUntil {
sleep 1;
!alive My_Heli
};
_respawn call BIS_fnc_removeRespawnPosition;
};
};
I guess
Was that, "I guess" for me @little eagle ?
No, Fritz
Thanks, trying!
HandleDisconnect only works on the server, so idk what you mean by "before it lets that player disconnect".
Do you know @little eagle if HandleDisconnect EVH will keep player on server until code is executed?
The player disconnects and then the EH fires on the server.
Hmm, okey.
And PlayerDisconnected will only execute on server, but can be added on client?
No
They both fire only on the server no matter where added.
I know that, but what I wondered if it could be added on client
The eh is just a stackable version of the command
Those are both stackable mission eventhandlers
Ummm...im not talking about the eh. Im talking about the eh vs the command
That is what I am talking about.
π€¦
And probably also SimZor.
Also what I am talking about
π
I mean I did say EVH, not command
I guess I can override abort button instead and use that.
They both fire only on the server and I don't think it's possible to remoteExec something to that disconnecting player if that was the question.
That one is old and busted.
I was confused, i was to believe zor was talking about that one
Which is not stackable
I mean remoteExec would not work anyways, I could do that, execute on the client in question. But since it's remoteExec it would not execute in same scope regardless?
And also only fires on the server, so nothing to gain from that.
Well, I could execute on the client, but it would ofc execute on server as well.
It all depends on what you're doing I guess.
Also, if they were to disconnect quick, it could cause problems as well, so no thanks.
Depends on what you are saving / doing.
Yeah, you can always Alt+F4 and then the game has no chance to do any SQF
Like if you wanted to save a player variable that is massive then of course, but anything reasonable would not cause problems
Hope scripting
Again
π€¦
Ye, I think I'm just better off with overwriting the abort button and doing it from there.
Too bad there is not a local disconnect EVH
π€£
@little eagle Thanks works perfectly!
Now another little thing: My Heli always explodes first time after it respawns in the hangar, Can I avoid that by making it invincible for 10 seconds?
Of course it does. Was there ever any doubt?
Never π
Better not spawn it inside a hangar I guess.
Not an option π
sleep number;
My_Heli allowDamage true;```
Or waitUntil {spawnvar};
@twilit tartan
I put this where? The init.sqf?
You put My_Heli allowDamage false; before vehicle is spawned
And My_Heli allowDamage true; after vehicle is spawned
@twilit tartan
If you are using respawn position I am not sure you can use this method though
π
Sorry what do you mean before and after vehicle is spawned?
and @little eagle if I want to add more helos, do I just go My_Heli1, MyHeli2 or do I have to copy the whole thing?
copy everything
ok
// init.sqf
if (isServer) then {
{
_x spawn {
waitUntil {
sleep 1;
_this distance getMarkerPos "FOB_marker" > 1000
};
private _respawn = [west, _this] call BIS_fnc_addRespawnPosition;
waitUntil {
sleep 1;
!alive _this
};
_respawn call BIS_fnc_removeRespawnPosition;
};
} forEach [My_Heli1, My_Heli2, My_Heli3];
};
or something like this
Cool, That makes it a lot easier! Do you know where I put the spawn protection?
Do you have CBA in that mission?
yep
["Helicopter_Base_F", "init", {
params ["_heli"];
_heli allowDamage false;
[{_this allowDamage true}, _heli, 10] call CBA_fnc_waitAndExecute;
}] call CBA_fnc_addClassEventHandler;
There. Every newly spawned heli should be invulnerable for 10 seconds.
Put it in the init?
yes
Thanks a lot, you guys are wizards
oops
replace
CBA_fnc_addEventHandler
with
CBA_fnc_addClassEventHandler
π€¦
π
For this? No.
does anyone know if/how you can change the texture of a player's face and/or hands to a procedural texture? is that possible?
I saw a guy make his face glowy and I want to do that
Hey guys, I'm trying to make it so a VIP vehicle can get disabled but not completely destroyed is there a good way to do that? I'm thinking of modifying the on-hit stuff, but last time I tried that the vehicle would become like all red, but still have wheels and be able to drive.
Awesome, so fuel dmg is what will trigger the vehicle to explode?
iirc in some cases the "Hull" also (depends on Config)
is mikero's rapify used to lint sqf script files?
srifle_DMR_06_camo_F = currentWeapon p1; anyidea why this does not trigger my trigger?