#arma3_scripting
1 messages ยท Page 430 of 1
@still forum Great... So apparently sometime in 2009, I've forgotten the password to my old account, but still known the one to my wiki account, so I must have created a new forum account. And then during the upgrade, they've been merge into one, with the password I don't know.
Can't you just request password reset if you still know your email?
And I assume they're registered with my very old e-mail, which I haven't had access to since probably the 90s.
That answers that
Interesting that google translates of cause correctly and doesn't show any warning about that.
Lul. linguee shows like 99% german/austrian websites as examples for uses of of cause ๐
Well, "of cause" is valid. But it means something completely different than "of course"
of cause translates to something like "for a good reason"
And of course translates to "for sure" or "certainly" or "naturally" or "obviously"
Machine learning. ยฏ_(ใ)_/ยฏ
@still forum Actually, "of cause" is closer to "for some reason"
Well.. Yeah.. There is some reason why scheduled scripts get worse timing ๐
Fixed it to of course now tho. And got a crap ton of extensions to check spelling and grammar for me.
Yeah, but "for some reason" is the same as saying "I don't know why, but it happens"
Which I doubt is what you want to convey
Man English is hard :x
tf are you doing?
Me? Why? What? Where?
Yeah, you.
blog post about scheduler
Was easier to explain than SQF Assembly
pls
And didn't have ideas for what else
I guess a "why private keyword is better" post would be good too. But that would be so short
As long as you don't do the multidimensional array copy thing.
exemple 8
_wh = "GroundWeaponHolder_Scripted" createVehicle position player;
player action ["DropWeapon", _wh, currentWeapon player];
exemple `3
_veh = createVehicle ["ah1w", position player, [], 0, "FLY"];
How do i use the alternative Syntax in the exemple 3 on the exemple 8?
How do I use this thing on that different thing
what?
You mean how to spawn a "GroundWeaponHolder_Scripted" with that script that spawns a "ah1w" ?
Yup.
Well.. Eh..
Use "GroundWeaponHolder_Scripted" instead of "ah1w"
_veh = createVehicle ["GroundWeaponHolder_Scripted", position player, [], 0, "FLY"];
Nothing happens
Well, he's right
Do you mean it returns nil. Or it throws an error. Or you just don't see the created object?
xD
Well, no error, no weapon, no return, nothing.
No return is not possible
Something has to be in _veh either it's nil or something else
And yeah.. No weapon is normal.
As you don't spawn a weapon.
soo, what is the solution for the same effect i want?
I don't know what effect you want
I want to use the Alternative Syntax on the "GroundWeaponHolder_Scripted"
Yeah.. You did that
that will spawn a weapon holder.
It does exactly that. And you just did that
Yeah, i "see".
I looked at https://github.com/X39/sqf-vm/commits/master today
....
At first I was like "huh, that's actually good" then I looked down and the apocalypse struck.
Please, someone teach this man on how to use feature branches and squash.
I also do such things when fixing CI because you have to trigger a build. But I squash it down to a single commit with reasonable title when I'm done
I just commit properly so even when I fuck up I can blame / history check it.
I am too Lazy to develop on my Linux and pushing stuff manually over is just too much to bother me
having a "lot of commits" isn't a big deal, not being able to blame or have a proper history is.
O.o
DUDE
When fixing CI and you just change a comma or something there isn't really much to name properly ^^
Didn't even think about blame yet..
If you later find some bug and want to find out how that happened. And that file has like 500 changes and 90% of them are just like a missing indentation or something with a commit title of "LOL"
I sometimes overdo it with the squashing though. If you look at Intercept ๐
it's no biggie if the original feature branch is still available somewhere
It is not like I just squeeze out bs commit messages...
That literally was getting the shit working and driving me crazy
Also.. If you are the only one mainly deving then there is not much who you can blame for (and it is not like I got many intendation fixes in there....)
Also top thing for lazyness and "can't be bothered" is to get some git UI tool.
even git for windows is better than nothing (NOT GITHUB DESKTOP)
I pump out a couple dozen bullshit commits. Then just Click + Shiftclick to select and then rightclick->Squash. Done.
Then change the title and all looks beautiful
or just use CLI, literally the same workflow
I still remember your 200+ commit arsenal PR btw ๐
Would not really have solved the g++ commits
Those would have required Filezilla pushing Code changes regulary to my Linux and then commiting the change and reverting on the Linux to pull again
let's see how many those were, I think 258
You push manually to Linux and compile there?
I see the problem
Why not just use VS integration and let it be done automatically
No
I use git for that
Ah. You can still squash and force push later though. To clean up the history when you are done getting something working
_veh = createVehicle ["arifle_MX_ACO_pointer_F",[3801.08,13468.1,0.0015955], [], 1, "none"];
Not working
_veh = createVehicle ["Weapon_arifle_MX_F",[3801.08,13468.1,0.0015955], [], 1, "none"];
working
Vs Integration is for some reason not working clean
With complete hangups partially
Probably my Web connection...
I May at some point just create a new Master branch and add everything
Or I leave it like it is right now
Tbh... There is not much of a difference
๐
something wrong with arifle_MX_ACO_pointer_F, is there something diferent that i need to note?
stats in comparison is 83 commits
As I said. Weapons are not vehicles
I guess Weapon_arifle_MX_F is a weapon holder class that contains a MX by default
You need to add the weapons to the weapon holder that you spawned
strange that the weapon on my hand does go to the ground with all the attachments
"all the attachments" as in an ACO scope and a laser pointer that's it
because "arifle_MX_ACO_pointer_F" do not work and is a MX with a sight and a pointer that i cant spawn
there fixed
As I said. A weapon is not a vehicle.
weapons are weapons, they are defined in CfgWeapons, vehicles are defined in CfgVehicles
I still don't know what's strange that if you drop a weapon... your weapon get's dropped. Seems obvious to me
weapon ground holder are also defined in CfgVehicles
but i can get the "Weapon_arifle_MX_F" on the ground that MX i have in hand goes to the ground with all the attachments
:facepalm:
So, what is the weapon holder of "arifle_MX_ACO_pointer_F"?
What?
It doesn't work like that
a weapon holder is a empty, invisible inventory "box" that you can add items into
And if you add items they are displayed
there are different types, but that's mostly it
boxes are the same, people are the same
There are SOME prefilled ones I guess. But not one for every weapon type
ohgod the horror
So why does the "arifle_MX_ACO_pointer_F" do not spawn?
BECAUSE A WEAPON IS NOT A VEHICLE
You can't spawn weapons using createVehicle
because a WEAPON IS NOT A VEHICLE
I already told you what you have to do. But you apparently just ignored that
then, what is on the ground when i drop my weapon? is there a way to create a weapon?
It automatically creates a weapon holder and put's your weapon into it
And yes. I already told you how.
To quote myself You need to add the weapons to the weapon holder that you spawned
addWeaponCargo(Global)
So, using this
_veh = createVehicle ["currentMuzzle player",position player, [], 0, "none"];
by default will not work, how should i put addWeaponCargo with createVehicle?
WTF
Again..
You need to add the weapons to the weapon holder that you spawned
weapon holder that you spawned Spawn a weapon holder.
add the weapons Add the weapon(s)
You need to Do that.

40 minutes ago you still knew how to spawn a weapon holder. So don't try to tell me you don't know how.
Never change, Dedmen.
my problem was that GroundWeaponHolder_Scripted seens to get the weapon on my hand
It doesn't
so that did not worked because of the weapon on my hand did not have a weapon holder
Of course if you use player action ["DropWeapon", _wh, currentWeapon player]; to Drop your Weapon you will drop your weapon
so that did not worked because of the weapon on my hand did not have a weapon holder What? If you drop a weapon it automatically creates a weapon holder
That does work.
It's called prevention, that way I have less stuff to fix in reviews ๐
Got the feeling it's gonna take me some time to get used to it
taps forehead
There is work to be done guys
Go Code monkeys
Wait, you thought "ofcause" was a word?
Great @lone glade
I got stuff to do for you
of course a horse a horse is a horse because horses are coarse of course.
waits until He come back
Let me try to simplefie
You want to spawn a weapon on the ground?
@astral tendon just rephrase what you want to archive
then we post you the code
and then you can say "no that is not what i want"
and we rant each other and somebody posts ๐ฟ
I already lost all faith in you learning how to script anyway
use createVehicle to create a groundWeaponHolder, then addWeaponCargoGlobal the weapon you want
player action ["DropWeapon", _wh, currentWeapon player];```
works great, but my problem is that the weapon some times apears far from the player or on the outside of the wall, i want it to spawn on the player's feet
Might aswell just tell us what you want and let us give you the finished code
faith is never lost
it just fades away
It's neither hard nor difficult to understand.
Yeah. That's why you use that alternative syntax. That I showed you how to use like.. an hour ago
Continue to tell us why the solution to your problem didn't solve your problem.
And, i did not figure it out how to use that syntax with "GroundWeaponHolder_Scripted", so i would ask for a example
๐
You said to just swap it so
```_veh = createVehicle ["GroundWeaponHolder_Scripted", position player, [], 0, "FLY"];````
And I asked what you mean by that
Yeah..
Why would the weapon be there
you spawned a invisible box to put the weapon into
Arma doesn't magically know what you want from it. You have to tell it to drop the weapon into the box(weapon holder)
player action ["DropWeapon", _wh, currentWeapon player];
Or did you think the DropWeapon thing was irrelevant?
https://community.bistudio.com/wiki/Arma_3_Actions#DropWeapon There is more info on how that works
player action ["DropWeapon", _wh, currentWeapon player];```
and this still spawning the weapon far from the player
special: String - "NONE", "FLY", "FORM", "CAN_COLLIDE". "CAN_COLLIDE" creates the vehicle exactly where asked, not checking if others objects can cross its 3D model.
"CAN_COLLIDE" creates the vehicle exactly where asked, not checking if others objects can cross its 3D model.
"CAN_COLLIDE" creates the vehicle exactly where asked
"CAN_COLLIDE"
I could've told you that right away if you would have told me what you wanted to do or what your problem was ๐
that is why you should always at first try to phrase your problem @astral tendon
Sure, It was my mistake not to give a context
anyway, is there a way to remove default actions like take? removeAllActions does not seens to work
Having some problems, i think with locality.
I've got this _mkrPos = param[0]; //systemChat format ["%1", _mkrPos]; uav1 addAction ["Remove Flight Recorder","rdg_UAVTakeFlightRecorder.sqf"]; _mkr = createMarker ["mkrUAV", _mkrPos]; _mkr setMarkerShape "ELLIPSE"; _mkr setMarkerSize [600,600]; _mkr setMarkerColor "colorOPFOR";
Not without modding
it creates the addaction but I don't see the marker
Base actions are removed via config, you can't remove them with SQF
I kinda make that work on my last mission by seting the damage of a weapon on the ground to 1 so the action gone, but i wondering if there is another way
that snippet above is what's called here in UAVClientSetUp
//This section needs creating on server only.
_mrk = "mkrUAV";
_area = markerSize _mrk;
_nul = _area pushBack markerDir _mrk;
_nul = _area pushBack ( markerShape _mrk isEqualTo "Rectangle" );
_vehPos = [ _mrk, _area ] call BIS_fnc_randomPosTrigger;
uav1 = "B_UAV_02_dynamicLoadout_F" createVehicle _vehPos;
_dir = random 360;
_dist = random 500;
_mkrPos = uav1 getPos [_dist, _dir];
_taskID ="UAV";
_title = "Recover UAV Flight Recorder";
_desc = "A UAV has been lost in the indicated area. It's likely that it captured the location of enemy camps before it was lost, we need that data!. Recover the UAV Flight Recorder and return it to the Intelligence Office for processing";
[WEST,[_taskID],[_desc,_title,""],objNull,0,2,true] call BIS_fnc_taskCreate;
[_taskID,"plane"] call BIS_fnc_taskSetType;
[_taskID, _mkrPos] call BIS_fnc_taskSetDestination;
//this section needs creating on all clients
[[_mkrPos], "rdg_UAVClientSetUp.sqf"] remoteExec ["execVM"];```
Anyone see what I've done wrong?
We talked about removing that action a couple weeks ago. I don't remember if there was a solution though
Who did I talk to about that some retards will always do something like 0 = call func even if it doesn't make any sense? The DUWS guy right?
Look at this:
_nul = _area pushBack markerDir _mrk;
_nul = _area pushBack ( markerShape _mrk isEqualTo "Rectangle" );
Ah @hushed minnow that was you! +
makes sense to me @still forum
if i wanted to at some point say "improved performance of skript"
i would do exactly that
"Stopped script from always crashing when calling a function"
someone doesn't know about performance loops
Dedmen, sorry, i just copied that from a thread on BIS.
"Remove a decimal here so we can say we improved speed by 10%"
From BIF? See that proves even more that that's not rare. Always make sure to never end your API functions with an assignment guys
Anyway, pretty sure that's not the problem. that bit works, I get a random position in the area I think.
Scrolled right past the fact that there is a CBA function that does that.
true.
and again. that's not what stops my code from showing the marker. So...
Figured it out. I was using the same marker name twice. Duh.
do all classes have the custom info panel? eg:
class CustomDisplayXY //Custom display using custom resource
{
componentType = "CustomDisplayComponent";
resource = "RscCustomInfoMyCustomRadModule";
};
if not, is there a configless, script way to add custom display pip for player and show a cam object on it?
@lusty canyon You can use Procedural Textures alike #(argb,512,512,1)r2t(uavpipsingleview,1.0) to provide the effect you want
@lusty canyon https://community.bistudio.com/wiki/Procedural_Textures
so i have a trigger with the spawn BIS_fnc_spawngroup function, if i place
if !isServer exitWith {};
Should that make it so the AI spawns only once?
if (!isServer) exitwith {};
for "_i" from 0 to 2 do {
_UnsGroup = createGroup [east,true];
_typeofgrp = [(configfile >> "CfgGroups" >> "East" >> "UNSUNG_EV_VC" >> "vcmainforceInfantry" >> "vc_mainriflesquadone")];
_UnsGroup = [getMarkerPos "spawn1", EAST, _typeofgrp] call BIS_fnc_spawnGroup;
_ranWay = [3015.9,535.170];
_UnsGroup addWaypoint [_ranWay,0];
}
Like that?
That.. Or check "Server only" in the trigger
@compact galleon thanks! I was to try that but i wasn't sure if the "Server Only" helps, thing is that the mission is MP and meant for a large group of players
but last time i tried it, it spawned that group for each player that entered the trigger
@still forum I did a review, it's mostly a few typos, nothing too big and the presentation seems good on my end.
@subtle wigeon you could use Mission madoules in the editor, its way easier... Ooor, we could make the mission from script
typo's ? I already fixed typo's like a dozen times or so
That's a big fat phony lie
@lone glade which? to Dedmen or to me?
dedmen
Thanks, i guess mine has a solution then!
Your inner german also leaked a bit ded, I saw one word with capitalization still present.
IN THE MIDDLE OF A PHRASE !!!1111
You just capitalized every word in that phrase
which is a single word
And if you don't choke twice on it it's not german enough ๐
Yes. phrase is a single word
Well, i wouldn't call a solution a solution for as long as it's stuck in a trigger
Anyone happen to know what the name is for arty computer display / idd?
@Adanteh#0761
class RscDisplayArtillery: RscStandardDisplay
{
idd=-1;
enableSimulation=1;
class controlsBackground
If its the one, it has idd=-1 and no scriptName, so basiclly not marked in UI namespace.
thanks
i hope im right here but i have a little problem with R3F Logistic
i added FOX CARS ADDON to the list that vehicles can tow but it doesnt work for this cars can someone tell me why ?
R3F_LOG/addons_config/fox/landvehicle.sqf -> https://pastebin.com/GVVWG4Bx
R3F_LOG/addons_config/fox.sqf -> https://pastebin.com/vBdEs1U5
R3F_LOG/config.sqf -> https://pastebin.com/KjLBBpsb
unlock vehicle with lost key every restart is bugged for me, sometimes it open even if i have key
anyone have a fix?
i use this : UPDATE
Object_DATA
SET
Object_DATA.CharacterID = 0
WHERE
Object_DATA.CharacterID <> 0
AND Object_DATA.CharacterID <= 12500
AND Object_DATA.Classname NOT LIKE 'Tent%'
AND Object_DATA.Classname NOT LIKE '%Locked'
AND Object_DATA.Classname NOT LIKE 'Land_%'
AND Object_DATA.Classname NOT LIKE 'Cinder%'
AND Object_DATA.Classname NOT LIKE 'Wood%'
AND Object_DATA.Classname NOT LIKE 'Metal%'
AND Object_DATA.Classname NOT LIKE '%Storage%'
AND Object_DATA.Classname NOT IN ('OutHouse_DZ', 'GunRack_DZ', 'WorkBench_DZ', 'Sandbag1_DZ', 'FireBarrel_DZ', 'DesertCamoNet_DZ', 'StickFence_DZ', 'LightPole_DZ', 'DeerStand_DZ', 'ForestLargeCamoNet_DZ', 'DesertLargeCamoNet_DZ', 'Plastic_Pole_EP1_DZ', 'Hedgehog_DZ', 'FuelPump_DZ', 'Fort_RazorWire', 'SandNest_DZ', 'ForestCamoNet_DZ', 'Fence_corrugated_DZ', 'CanvasHut_DZ', 'Generator_DZ', 'BagFenceRound_DZ')
AND FindVehicleKeysCount(Object_DATA.CharacterID) = 0
@pseudo cypress Well you better contact that addon community, since you could mistake a vehicle classname, or whatever happens in that scripts.
@fading burrow Pasting a SQL query especially without markdown is quite not helpful, but you actually set CharacterID = 0 for anything that has that not at 0 value and doesn't look like those classnames parts listed after WHERE statement. That seems like to be a Arma 2: DayZ Epoch database? As I remember CharacterID was a field for a password values of a safes, not the keys of vehicles.
arma 2 dayz epoch yes
Hey gus, whats the difference between having a jet places as object ingame and creating it via via createvehicle? Does arma internally create the static vehicles as simple objects or are there any antimations executed to make things like no tires, closed cockpit etc possible
vehicles spawned with createvehicle are just like those normally placed in 3den
well the jet is not started in editor, ingame its at full engine speed without anyone flying it ...
pretty obscure behavior
Does it have to to with enablesimulation?
@indigo snow Besides ownership is different in MP.
Local to the client where it is created? I dont think thats worth mentioning when the context is the mentioned above.
And if i had to guess, yea, playing with enableSimulation might result in wierd behaviour
@barren magnet you may consider playing around with the special string in the createVehicle command. I'm assuming "FLY" is set by default above a certain height above terrain level
allright, I will play around with it thx
So did BIS change that you can't prevent vanilla actions anymore by return true on EHs?
with KeyDown works
people was yelling at me for that... some time ago lol
was solution for blocking throw ๐
DefaultAction can be blocked. Throw used to be blockable, but is no more. The rest cannot be blocked.
The fug
I swear you could just return a true on keyup/keydown and block shit
Am I making this up?
Keys yes
you coudl but not anymore?
not aware of it not working anymore
KeyUp could never block. KeyDown can block, but this won't prevent binds like 2x_Key_ or Hold Key.
still works, but... not reliable for some custom key binds
0 spawn {
disableSerialization;
waitUntil {!isNull (findDisplay 46)};
VAR_block_nades = (findDisplay 46) displayAddEventHandler ["KeyDown",{
if (inputAction "Throw" > 0) then {true} else {false};
}];
};
could be readability
for return true... or it will not work, commy
(findDisplay 46) displayAddEventHandler ["KeyDown",{
inputAction "Throw" > 0
}];
Already returns a boolean, otherwise the IF wouldn't work.
is the situation the same for both actionKeys and inputAction?
about keys distinguishing because of precision
then {true} else {false}; Never makes sense
And no.. then [{true},{false}] also doesn't
End Game Bis code #official ๐
// Block throwing grenades
[] spawn
{
disableSerialization;
scriptName "initPlayerLocal.sqf: Players stuck at start";
waitUntil { !isNull (findDisplay 46) };
BIS_lockThrow = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) in actionKeys 'Throw') then { true } else { false };"];
};
Demellion, not sure what you're trying to say. KeyDown can't block 2x_Key_ and Hold Key either. Or mouse inputs or joysticks.
#official is the best argument against copy pasting it tbqhfamalarm
๐
Im just asking if inputAction reliable to detect something like Throw action in KeyDown
as actionKeys sucks because of reasons.
KeyDown can't block Throw reliably, so it doesn't matter if you used inputAction or actionKeys.
awesome.
I thought we went over this weeks ago already.
yep
This is how you create a safezone: https://gist.github.com/commy2/351c1262933016ce313e0c74be89480a
No other way as far as I am aware of. At least nothing that can't be exploited.
there is this big safezone object in 3den editor, preventing players to shoot anything (catching the bullets and keeping them out)
@little eagle Why _this setWeaponReloadingTime [_this, _x, 1]; if true will just not allow to shoot?
This is for Throw and Put.
Oh ok.
The true is for the weapon.
cool. so actually make a nade forever reload ๐
More like make the hands forever reload.
Hands are the weapon, grenade is the magazine.
well techncally yes, but that sounds.. strange ๐
It being strange is not of concern as long as it's true.
don't having body but having hands which is weapons... more strange, noooo
The really strange thing is that each grenade type is a different muzzle of the Throw weapon (hands).
Which is why changing from frags to smokes is faster than taking the next frag right after you threw one.
ir eally hope A4 will give us more control over behaviour like that
btw commy because you're a smart lad, any way to block firing vehicles like that?
Haven't tried. Vehicles are weird, because they may not belong to your machine if there's a driver and then some commands just fail.
firedMan eh maybe...
Well FiredMan doesn't give you keys control, only like deleting the projectile.
i mean if that just some sort or restrictions... but if eh is to late then just lock it
is it possible to create controls within a controlsGroup ?
is there a way to stop BIS_fnc_UnitPlay?
Yes
You just create a controls class within the ControlsGroup
In fact, thatโs the entire point of it.
didnt work for me.
I just wanted a listbox type thing with buttons , but im just opting for listnbox
I put a list box in one the other day
Youโll want to set the x and y to 0 on the list box
Easiest way to put it in top left
array = [0,1,2,3,4,5,6,7,8,9,10]
how i can select 5 to 10 with out have to do "select x" to all numbers i want?
array select [start, count]
It is alternative syntax 4 for select
Or otherwise array select expression where expression is tested against each _x array element
uh nevermind, i found a better solution for what i want
_thing setVariable [ "BIS_fnc_unitPlay_terminate", true ];
btw, can you make a better exemple with that? i am actually interested
1st or 2nd one?
1st
okay using your 'array' as the example, to get 5 to 10
array select [5,6] //returns [5,6,7,8,9,10]
array select [5,5] //returns [5,6,7,8,9]
array select [1,99] //returns [1,2,3,4,5,6,7,8,9,10]
gg?
hum the second one returns [6,7,8,9,10]
oh right you are, got my indices mixed up
if i undestand right
array select [start, count]
the count only counts AFTER the start?
The wiki says count is... ""Number of array elements to select""
so the start index onwards , up to what count would you like returned.
thanks.
"The information on this page is very outdated and often misleading. The content of this page most likely will radically change in the future."
https://community.bistudio.com/wiki/Function
Anyone able to update that page?
@meager heart Yet again, you have the answer I sought! Thank you ๐
achievement unlocked
lol
The old page about functions is weird. The second sentence is already off topic and talks about commands instead of functions.
@little eagle can i ask you about your custom lobby script? I want make custom lobby, but can't find script what set roles on lobby listbox.
in lobby 2 listboxes - 1 - roles in team 2 - is players list
can't drop picture ๐ฆ
can i send you in pm?
Does anyone know what box/device in Arma is called that you can animate through scripting to open it up etc?
? ... p3d?
Huh?
"Data Terminal" ? ๐
Yes! Thats it. Thank youuu
Land_DataTerminal_01_F classname
Is there any good tutorials out there for how to use Mysql as a database for arma. Or any tutorial what so ever to get started with Mysql?
Hi James, I used armadb to add a database to my arma server.
It has a pretty good step by step instructions
Cool. I use a ton of stuff on my server and they have almost no instructions
I'm sure you'll find extDB stuff in life forums or maybe Exile
Yep, experience is the best teacher huh ๐
Or you could just ask Torndeco the... eh.... brain... cmon.. wtf... Eh... Torndeco directly if he ehh... has too much free time
haha
I did find his site too ..
SInce i'm in the channel, is anyone interested in helping optimize my server scripts, pls pm me.
how many scripts? Some framework?
Total of about 6-8 scripts just like init.sqf, initPlayerServer, initserver etc...
Put them on github and ask here if someone can review it
Yea framework to run database and whitelisting.
UltraNoob did that a couple days ago and it worked well I'd say
Ok, awesome thanks for advice.
Atm they are just a bunch of scripts I have cobbled together over time and probably not optimized.
@warm bone I can take a look (no promise on result though)
how can you make any vehicle into a uav? i tried adding B_UAV_AI as driver/gunner but nothing shows up on terminal? (without cfg, sqf only)
Can somebody help me with an script? I'm trying to create basic logistics system for a mission. I need to be able to attach a helicopter to a landing platform but i need the action only to appear when the helicopter is within a certain distance from the platform. here's what i got so far.
[
player,
"Attach AH-6 Little Bird Helicopter",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance LP_1 < 2.5", // LP_1 IS THE LANDING PLATFORM
"_target distance LP_1 < 2.5", // LP_1 IS THE LANDING PLATFORM
{},
{},
{
_target playaction "Putdown";
LB_1 attachTo [LP_1, [2, 0, +2.2] ]; // LB_1 IS THE LITTLE BIRD
sleep 0.1;
lb_1 setDir 270;
},
{},
[],
10,
1000,
true,
false
] call BIS_fnc_holdActionAdd;
Add LB_1 distance LP_1 < (your distance) to the condition
mhhh ... could somebody check if this ends up as a comment?
_str1 = 'left /* middle */ right';
_str2 = 'left // right';
diag_log [_str1, _str2]```
Okay, i'll give it a try thanks for quick response
im doing it wrong.
this is how it looks now
[
player,
"Attach AH-6 Little Bird Helicopter",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance LP_1 < 2.5", // LP_1 IS THE LANDING PLATFORM
"_target distance LP_1 < 2.5", // LP_1 IS THE LANDING PLATFORM
"LB_1 distance LP_1 < (2.5)"
{},
{},
{
_target playaction "Putdown";
LB_1 attachTo [LP_1, [2, 0, +2.2] ]; // LB_1 IS THE LITTLE BIRD
sleep 0.1;
lb_1 setDir 270;
},
{},
[],
10,
1000,
true,
false
] call BIS_fnc_holdActionAdd;
Yes you are doing it wrong
could you explain real quick? like i said im only good at changing values and names haha
"_target distance LP_1 < 2.5" -> _target distance LP_1 < 2.5 && LB_1 distance LP_1 < (2.5)
still wont work
i hate bothering people
[
player,
"Attach AH-6 Little Bird Helicopter",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance LP_1 < 2.5", // LP_1 IS THE LANDING PLATFORM
"_target distance LP_1 < 2.5", // LP_1 IS THE LANDING PLATFORM
"_target distance LP_1 < 3" -> _target distance LP_1 < 3 && LB_1 distance LP_1 < (3)
{},
{},
{
_target playaction "Putdown";
LB_1 attachTo [LP_1, [2, 0, +2.2] ]; // LB_1 IS THE LITTLE BIRD
sleep 0.1;
lb_1 setDir 270;
},
{},
[],
10,
1000,
true,
false
] call BIS_fnc_holdActionAdd;
[
player,
"Attach AH-6 Little Bird Helicopter",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance LP_1 < 2.5", // LP_1 IS THE LANDING PLATFORM
"_target distance LP_1 < 2.5", // LP_1 IS THE LANDING PLATFORM
"_target distance LP_1 < 3 && LB_1 distance LP_1 < 3"
{},
{},
{
_target playaction "Putdown";
LB_1 attachTo [LP_1, [2, 0, +2.2] ]; // LB_1 IS THE LITTLE BIRD
sleep 0.1;
lb_1 setDir 270;
},
{},
[],
10,
1000,
true,
false
] call BIS_fnc_holdActionAdd;
Please format : #info_help_tips
Dude
@queen cargo As expected, both become comments
wut?
"Change to this"
Not like.. Append that into a new element in the array
so _str1 is left right
change both conditions you already have
and _str2 probably completly breaks
Yes
@ornate pawn to format your code, do the following:
```sqf
your-code-here
```
and second is not terminated
[
player,
"Attach AH-6 Little Bird Helicopter",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance LP_1 < 2.5 && LB_1 distance LP_1 < (2.5)", // LP_1 IS THE LANDING PLATFORM
"_target distance LP_1 < 2.5 && LB_1 distance LP_1 < (2.5)", // LP_1 IS THE LANDING PLATFORM
{},
{},
{
_target playaction "Putdown";
LB_1 attachTo [LP_1, [2, 0, +2.2] ]; // LB_1 IS THE LITTLE BIRD
sleep 0.1;
lb_1 setDir 270;
},
{},
[],
10,
1000,
true,
false
] call BIS_fnc_holdActionAdd;
wont work
why not?
invalid number in expression
Yeah no, +2.2 doesn't make any sense at all.
LB_1 attachTo[LP_1,[2,0,2.2]];
That could be your errror
that's not the problem
i deleted the + sign and still
same problem
init: Generic error in expression
thats what it says
"_target distance LP_1 < 3 && LB_1 distance LP_1 < (3)",
two LP_1 ?
should i change it to: "_target distance LP_1 < 3 && LB_1 distance LB_1 < (3)",
same freaking error
heres what i get
LB_1 distance LB_1 Doesn't even make any sense
why would you check the distance to yourself and expect anything other than 0?
dude i was doing what you said
LB_1 = Little bird helicopter and LP_1 means Landing Platform
Im going to try that @subtle ore
not sure if comments work in the init boxes or not.
Can time of day be changed clientside?
dude i was doing what you said No you weren't. I gave you LB_1 distance LP_1 And you thought LB_1 distance LB_1 is a better idea
i didn't change anything before trying everything you said
And I didn't know you were trying to use a init box. You never said that.
Yeah comments in init box == bad
i deleted them already
@peak plover skiptime only can be executed on server, so I dunno ๐คท
i forgot to delete one more comment
now the init box accepts the script but when i put the helicopter close the the Landing Platform the action doesn
appear
[
player,
"Attach AH-6 Little Bird Helicopter",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance LP_1 < 2.5 && LB_1 distance LP_1 < 2.)",
"_target distance LP_1 < 2.5 && LB_1 distance LP_1 < 2.5",
{},
{},
{
_target playaction "Putdown";
LB_1 attachTo [LP_1, [2, 0, 2.2] ];
sleep 0.1;
lb_1 setDir 270;
},
{},
[],
10,
1000,
true,
false
] call BIS_fnc_holdActionAdd;
syntax error?
yeah
you have two lines which previously were always exactly the same
suddenly they aren't anymore
I don't even know why. That change isn't even related to the other stuff you just tried to fix
my cheeky uss freedom is always pretending to be a submarine
openMap true; onMapSingleClick "
_freedomCarrier = createVehicle [""Land_Carrier_01_base_F"", _pos, [], 0, ""NONE""];
openMap false;
true";
spawns at seabed, how to move it just a bit under sea surface?
setPosASL
so i should delete one of these lines: "_target distance LP_1 < 2.5 && LB_1 distance LP_1 < 2.5",
?
you have two lines which previously were always exactly the same
suddenly they aren't anymore
Like.. Just read.
You have two lines who were the same previously. Now they are different.
Now think. Is the solution removing one line although that was not a problem at all before.
Or is the solution to fix the typo you made in the second line?
The function needs a condition.
I have no idea how to script okay? i only take scripts from the game and change some stuff.
"_target distance LP_1 < 2.5 && LB_1 distance LP_1 < 2.)",
"_target distance LP_1 < 2.5 && LB_1 distance LP_1 < 2.5",
Just use your eyes.
- and 2.5
You don't even need to know how to script
that is the problem?
No it's totally not the problem at all /s
[
player,
"Attach AH-6 Little Bird Helicopter",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance LP_1 < 2.5 && LB_1 distance LP_1 < 2.5)",
"_target distance LP_1 < 2.5 && LB_1 distance LP_1 < 2.5)",
{},
{},
{
_target playaction "Putdown";
LB_1 attachTo [LP_1, [2, 0, 2.2] ];
sleep 0.1;
LB_1 setDir 270;
},
{},
[],
10,
1000,
true,
false
] call BIS_fnc_holdActionAdd;
Still nothing
Okay
thanks for your help
sorry for not understanding
I'll ask my friend who works in BIS he's the one that helps me but he'
he's currently offline that's why i came here.
๐ค
if i have the variable that is assigned to the groupID of a specific group of players, how can i forEach all the units in that group later on? using ```
{
code
} foreach units (variable);
or is there another method to store a group of players and run code on them later on
I got the script working.
[
player,
"Attach AH-6 Little Bird Helicopter",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance LP_1 < 2.5",
"LB_1 distance LP_1 < 2.5",
{},
{},
{
_target playaction "Putdown";
LB_1 attachTo [LP_1, [2, 0, 2.2] ];
sleep 0.1;
LB_1 setDir 270;
},
{},
[],
10,
1000,
true,
false
] call BIS_fnc_holdActionAdd;
Your username surely shouldn't be permitted, but I guess you've found a way to be annoying @devout niche
hahaha
ive asked a few times for it to be changed but nobody has changed it for this server for me ๐ฆ
change your name, leave, rejoin
I was asking for a server-specific name change
Well it's annoying universally.
PM a moderator
Oh my.
Will the function from CfgFunctions marked with preInit|postInit execute if its having a conflict with the same function name and tag?
Why do you ask this?
My friend dude has a conflict somewhere, and bit of a dumb to find it within hunders of his shitty addons. Just changed the tag. Thanks guys.
I have no idea how to script okay? i only take scripts from the game and change some stuff. Then you really shouldn't be touching scripts.
@devout niche Best bet is to use an alternate name for this Discord. Else you'll join one day to find you've been banned. 11,000 + members and only one person who can change names...it aint gonna happen.
I really want to find the person responsible for those characters beening in utf
But its a good idea to change your name, its just annoying and some people will just block you aka me ๐
Hi everyone
i am trying to edit values in the config based on a script
but seems not to allow me to slingload verhicles ...they don't even show up on the SLA
if (_t in ['B_Heli_Transport_03_unarmed_green_F']) then {
slingLoadMaxCargoMass = 15000;
liftForceCoef = 1.7;
};
i am trying to edit values in the config based on a script impossible
Also that's not how scripting/programming works
it doesn't magically know which config value you want to change
all you basically done is defined some global variables, you need to make an addon to override some config values
ok thanx
hi can anyone please help me im trying to make a script that says if player is <= sea level else if above sea level then
ok thanks ill give it a try ๐
@Dedmen
so is there anyway i can change say Huron Config in the mission file ?
like this ?
if ((getPosASL player) select 2 > 0) then { blabla } else { if ((getPosASL player) select 2 <= 0) then { blabla }; };
๐ค
@fringe torrent No.
@Zeuzy#0422 Yeah... But you don't need the other if in the else.
If it's not bigger then 0 then it's obviously less or equal to 0
yeah thanks there's more to the if statements but didn't want to add too example which is why the extra else
oh question
so the spartan sam missiles come in 21 missiles per mag if u do this _this addMagazineTurret ["magazine_Missile_rim116_x21" ,-1,1]; _this addWeaponTurret["weapon_rim116Launcher", -1.1];
I was wondering
is there away to add say 6 missiles rather then 21?
ik u can add partially filled magz for infantry weapons, but is there away for vics?
That should do exactly that
I don't know what you are doing there
turret path is an array. not a number
Hello, I'm quite unexperienced in scripting with sqf and would like to know how to remove the ammunition of the car the player is currently sitting in (e.g. an armed ifrit). I've already tried "vehicle player setVehicleAmmo 0;", but it also removes the ammunition of the player itself, which is something I dont want to do. Anyone want to help me..?
@ViRazY#0594 Any vehicle?
Tank, Car, Helicopter, Plane, Boat.. Anything controlled by players and being able to shoot..
It's for a little safezone-script and I dont want players to abuse their invincibility to shoot out of the safezone with a vehicle
@ViRazY#0594 Kinda not the best way to take ammo away but:
player addEventHandler ['GetInMan',{
params ['','_proxy','_vehicle',''];
_vehicle setVehicleAmmo 0;
}];
updated, forgot that that you just might get to gunner
Thanks, but its not working as it should do.. It's working fine if I'm switching to the gunner's seat without exiting the vehicle but if I'm accessing the gunner's seat from the outside it's always empty and the ammo is still full if I'm switching to the gunner's seat without exiting the vehicle inside of the safezone. Should I paste the whole code, so you could better understand what i'm trying to achieve (and maybe what isn't working)?
@ViRazY#0594 Oh i forgot thats AL. Well you need to remoteExec this to a vehicle owner, because only owner can actually remove the ammo.
Do I need to do something specific with your piece of code or is it something in the initialization of the script? As I said before: Im quite unexperienced and the wiki page of "remoteExec" kind of confuses me even more with these 10 different examples. I'm sorry for these dumb questions I guess
Honestly, you may be able to just use a "firedman" EVH to delete the projectile if player distance "safezone" < _distance. Not sure if deleting the projectile via firedMan will work with 100% success or not however
Deleting projectiles would be awesome (even better than my current solution for preventing players from shooting). If you would explain me how to do this, I would be very happy ๐
awww fuck
I accidently typed it wrong
_this addMagazineTurret ["magazine_Missile_rim116_x21" ,[-1],1];
_this addWeaponTurret["weapon_rim116Launcher", [-1],1];```
okay so that will add 21 spartan missiles to the pilot
is there away so that I can only add say 1 missile for the magazine?
_vehicle addMagazineTurret ["60Rnd_40mm_GPR_Tracer_Red_shells",[0],13]; //--- 1 magazine for turret [0] with 13 rounds
@edgy dune
Gnashes: Honestly, you may be able to just use a "firedman" EVH to delete the projectile if player distance "safezone" < _distance. Not sure if deleting the projectile via firedMan will work with 100% success or not however
commy's gonna have a dejavu again ๐
Safezones: The Following
probably most reliable way will be setVehicleLock and FriedMan at the same time ๐
w8 thats 13 mags of 60 rounds though? What Im wondering is can I add just 40 rounds with the weapon you mentioned
no lol
T_T sad days
Since Arma 3 v1.55.133817 it is possible to set custom ammo count in added magazine.
that is not magazines count... that is ammo count in added magazine
yea I wonder if there was a way to change the ammo count in the magazine
Person or vehicle?
vehicle
A currently loaded magazine or one from the reserve?
hmmm I wana try and load half a magazine of spartan missiles(which is 21 missiles for a full mag,so I guess 10 spartan missiles). SO a currently loaded mag
Wait, is that a plane?
wat? spartan missiles? nah Its the sam short range missiles on the carrier I think
_vehicle removeMagazinesTurret [_magazine, _turret];
_vehicle addMagazineTurret [_magazine, _turret, 10];
Tried this?
isnt that just adding 9 mags of what ever _magzine is?
No, one with 10 rounds.
ill try that in the morining,im sleepy now ๐
before:
magazinesAllTurrets a
[["FakeWeapon",[-1],1,1e+007,0],["magazine_Missile_rim116_x21",[0],21,1e+007,0]]
script:
private _vehicle = a;
private _turret = [0];
private _magazine = "magazine_Missile_rim116_x21";
_vehicle removeMagazinesTurret [_magazine, _turret];
_vehicle addMagazineTurret [_magazine, _turret, 10];
after:
magazinesAllTurrets a
[["FakeWeapon",[-1],1,1e+007,0],["magazine_Missile_rim116_x21",[0],10,1.00001e+007,0]]
Even changed optically. I thiknk your previous error was adding another magazine without taking the full one away. Also adding another copy of the weapon is just weird.
Yeah, [-1] is the driver.
They said something about "pilot" too. Can you even enter these?
no clue
How to implement custom respawn timer depending on respawn position selected?
Problem is more, when to run that command? We have on killed and on respawn events but not on select respawn
make one :3
probably make a loop that checks for current selected respawn and call a scripted event if it's changed
How do you know which spawn is selected on the map?
why is causedBy returning the player intead of the object used?
for context here is the code
this disableAI "move";
this addEventHandler ["HandleDamage",{0}];
this addMPEventHandler ["MPHit",{
systemChat format ["select 0 %1",_this select 0 ];
systemChat format ["select 1 %1",_this select 1 ];
systemChat format ["select 2 %1",_this select 2 ];
systemChat format ["select 3 %1",_this select 3 ];
systemChat format ["select 4 %1",_this select 4 ];
}];
select 0 is returing the name of the unit
select 1 the player
select 2 the damage
select 3 the player
select 4 <null>
it was used a weapon for the hit
though i dont get the name of the weapon
same problem with the normal Hit
@fossil yew
Add some ui eventhandler on the respawn ui. Which one depends on what that ui is. Never used it myself.
I had to deal with that not so long ago. This thread was the best solution i found and it still works (with the mentioned fix in the last post)
ah fml. nvm. Sorry. You want the respawn position not the role.
Still maybe a look at the link helps you. It uses the same ui after all
thanks
anyone with custom deathscreen on 1.0.6.2?
@fading burrow Did you hit the wrong discord?
lol
So, doing a little experimenting with the BIS_fnc_garage
And I've realized I'll also need some kind of trash removal.
Is there some kind of way I could link deleteVehicle to a certain area, and have it delete any vehicles inside that area?
Commy back at it again with the good links
So I'll admit, I'm probably out of my league here.
How can I set it up so whatever array nearEntities detects, if it's a vehicle then deleteVehicle removes it.
So far I've only managed to get a list, and not managed to pull from that list and use deleteVehicle
@bitter bough You need to check it with isKindOf
@bitter bough Or you can go as example given in the command Example 1:
_list = (position player) nearEntities [["Man", "Air", "Car", "Motorcycle", "Tank"], 200];
This will return only kinds of that is specified there.
CAManBase instead of Man.
Oh I'm gonna need to start making my own functions for this arent I
@bitter bough If you are not afraid of people getting in those vehicles, you can also use deleteVehicle with GetInMan EVH.
I think what you're looking for is https://community.bistudio.com/wiki/forEach
Alrighty, this is beginning to make a bit more sense now.
@little eagle curious why CAManBase exactly, does Man missing something? Or its just about capturing animals too?
So, I'll let you guys tell me I've done something fairly horribly wrong, as it makes sense but I just don't grasp the full concept.
this addAction ["Remove Vehicle",{(VehSpawn nearEntities 15), deleteVehicle} forEach ["Tank"]]
(be harsh if you must, if Konig were here he'd do the same)
Not like this bud {deleteVehicle _x} forEach (Vehspawn nearEntities [[โTankโ],15]); @bitter bough
Smth like that Iโm on phone so
Assuming you have defined vehspawn
What
missing _x there also
Not in my example
yep
var_action = this addAction ["Remove Vehicle", {
(VehSpawn nearEntities ["Tank", 15]) apply {deleteVehicle _x}; //--- VehSpawn is defined ?
}];
@bitter bough
Why did you do that
what's the var_action for?
Nani?
There was already a solution given
Donโt know why anyone would want an apply that doesnโt do anything special
It is 1% faster according to wiki :kek:
yes!
Weird
Ohhhh, so I could use Action ID's should I decide to work into creating my own functions instead of working strictly out of init
That's a step out of the comfort zone but it makes a lot more sense
Uh
Action IDs are just handles
This
Yeah I'm still kinda learning.
I went from just putting objects down and calling it good to trying to understand systems.
Everything is making more sense little by little
how to make titleText appear if player is looking at object(s) from array while the text remains there until a player is out of range from the same object(s)?
Maybe with this https://community.bistudio.com/wiki/drawIcon3D
check there example 2.
you can make color fade out... so text is still there but becomes transparent when conditions meet... something like
_fadeOut = (player distance _x) / <number>;
if (<condition>) then {
_color set [3, 1 - _fadeOut];
};
Hey, need help with scripting, need help with making a script, where if units of a squad(player squad) are further then 200 meters from player unit(squad leader). I need it so that the code only executes on units further then 200 meters and not the squad members that are within 200 meters from player unit.
I can't seem to find a way that the code only executes on the units greater then 200 meters and not the entire squad.
_dist = ({_x} forEach units squad1) distance playerUnit > 200;
try using inArea or inAreaArray
so if (! inAreaArray) then {stuff}
(of course that's not the actual syntax of inAreaArray, see https://community.bistudio.com/wiki/inAreaArray )
also _dist = ({_x} forEach units squad1) distance playerUnit > 200;
{_x distance playerUnit > 200} forEach units squad1; //--- if playerUnit and squad1 are defined
// playersGroup has to be defined
{
if (_x distance leader playersGroup > 200) then
{
/* your effect here - setDamage? huhuhu */
}
} forEach units playersGroup;
@ trying to make it so if a AI squad member is further than 200 meters away he gets teleported to your position
0 spawn
{
while{alive player} do
{
{
if(_x distance player > 200) exitWith
{
_x setPos[((getPosATL player) select 0) + 5,((getPosATL player) select 1) + 5,0];
};
} forEach units group player;
sleep 0.3;
};
};
ยฏ_(ใ)_/ยฏ
Probably not the best example, but I guess it'd work.
works on my end at least.
@winter rose doesn't seem to excute the code
_x moveInCargo heli
@subtle ore only want it to be excuted once
@undone turret Bam, done.
@winter rose Ah gosh, i used execVM and it worked
I'v been using "exec" to execute scripts, that must be why sometimes they don't work
Hey guys wondering if I could get some scripting assistance in here really quick? Its about adding the HoldAddAction to an object and making it execute a script.. I am not sure how to do such. It seems to only work with a function name.
Donโt use exec. Itโs something that should seldom get used.
Anyone know solution to: https://forums.bohemia.net/forums/topic/215025-selectionposition-door-offset-issue/
Looking for a way to properly attach it so it stays on door regardless of animation phase (open/closed) - any ideas?
that's not possible
Arma'd ๐ข
Well actually that's possible, but that's gonna be retarded. You need to create some invisible helper object on interaction and probably setVariable of its position and switch drawing to its position, by reading variable from the house you just set to understand its there.
And its kinda enough to just createSimpleObject so it will not spam packets.
because it fucking isn't
So its not possible to createSimpleObject on the selectionPosition when the door animationPhase is different from 0 on a specific door and setVariable this to the house as door name and let drawIcon3D detect that by reading that very variable for presence of object and switch drawing to that position?
Re read what you just wrote very carefully
So yes i just basicly said that you need a helper object position to switch drawing to it instead of current selectionPosition.
If that what author actually wanted.
โ _ โ

to switch drawing to it How do you switch drawing to something??
Don't even have a slight clue what that's supposed to mean
@unborn ether Man isn't missing anything. CAManBase is a subclass of Man. But Man has other subclasses too. Like Animal. So your version would pick up all Animal too, like snakes, rabbits and fish.
Does this statement return unique player identifier getPlayerUID that is same every time player connects?
@fossil yew
https://community.bistudio.com/wiki/getPlayerUID
In Arma 3 the returned string is the steamID64 of the player.
So, yes.
thanks.
Trying to get Zeus aka Curator to work on first player spawn (currently, it works only after respawn)
Here is what happening during first player spawn (after joining the server through lobby):
Player assigned to unit in the slot -> Player requests auth from Serverside -> Serverside checks UID and Name, then sends Player data (gear, pos, dmg, etc.) -> Player recieved data, set gear, pos, etc., auth end. (Sadly, after this procedure player still have original unit name)
Respawns are handled by default Arma disposal manager, with respawn points set through mission description.ext
Can missionnames setvar work in preinit?
yes
public var?
Ugh... Should. Not 100% sure
missionNamespace is ALWAYS available unless the mission isn't loaded (preStart)
is it really not available then @lone glade ?
what happens if you use missionNamespace during preStart?
crash? error?
Dedmen: to switch drawing to it How do you switch drawing to something??
Change the position of drawIcon3D in Draw3D? ๐ค
so... you mean "change the position of the icon" and not "to switch drawing to it"
private _value = _param call (missionNamespace getVariable ["BIS_fnc_storeParamsValues_data", {}]); that's the function part, I suppose that one probably comes in postInit then.
Ok you can start TeamViewer
is there a way to directly add a magazine onto the weapon if a player has no space for the magazine?
addPrimaryWeaponItem
@still forum any way of doing it adding limited ammo back? like addMagazine ARRAY would work
:u
:[
trying to make a scenario where I read an ammo + mag amount and add it back to a player - want to avoid a method to refill ammo count I guess
unit addWeaponItem [weaponName, [itemName, ammoCount, muzzleName]]
I can make that work -- Thanks dedmen ๐
if you ever thought wind in arma is all the same everywhere - only true for land!
https://i.imgur.com/JlfHFRm.jpg
Time for Nigel to make lifer sailboats work with the wind of the sea
Heheheh
don't even need to change the title for it to be relevant ๐
but don't they have a setting for wind gusts as well?
There are wind gusts yeah.
Is there a way to run script after vehicle is rearmed?
Yes
How?
Well how are you rearming? Something you made? BI vehicles?
I mean, I made a script that is sending data about pylons to config , now it just works in a loop with sleep. I can add this to jet's service menu, aswell as inside init.sqf. However with that approach, the jet will not update its pylon iformation, with other rearming scripts like GOM. I just thought that there is a even handler for rearming or something similiar
๐ค
Can you use dialog to reliably detect any case in where the mouse cursor is moveable and could leave the game window if you run windowed?
with MouseMoving ctrlEH maybe
with a ctrlEH you already know that a dialog is open don't you?
Is there a way to allow mouse movement without opening a dialog that would trigger dialog command?
with a ctrlEH you already know that a dialog is open don't you?
notdialogthat will be added to one of the controls of display...
so i think yes, for second part
but you will need some extra controls for that...
if just check mouse position and was fast movement output is not accurate
Basically need a 100% safe way to check if moving the mouse would not move the cursor. Aka usually move the in-game camera.
how can I set bool to true from addAction?
if the bool is false I want the player to have an addAction on AI, if it's true the action is removed
isOnDelivery = false;
if (!isOnDelivery) then
{
// hint "debug:(isOnDelivery) false";
GetDeliveryJob = delivery_job addAction ["Get Delivery", ""];
};
if (isOnDelivery) then
{
// hint "debug:(isOnDelivery) true";
};
@tough abyss check addaction biki Page
addAction has a condition parameter
so in that condition I can just do isOnDelivery == true?
set the variable to true. Just like you set it to false in your script
isOnDelivery = true;
in condition field?
the action isn't showing up
Did you set isOnDelivery to true?
isOnDelivery = true
Is that a yes?
yes
full action
GetDeliveryJob = delivery_job addAction ["Get Delivery","", [],1,true,true,"","isOnDelivery = true"];
๐คฆ
To repeat myself
"so in that condition I can just do isOnDelivery == true?"
"No"
"just isOnDelivery"
action shows without isOnDelivery but not with it
GetDeliveryJob = delivery_job addaction ["Get Delivery","","",1,false,true,"",""]; that works
GetDeliveryJob = delivery_job addaction ["Get Delivery","","",1,false,true,"","isOnDelivery"]; that doesn't
And you set the isOnDelivery variable to true? Or to false or did you not define it?
You can check it's current value in the debug console
Then you have to invert the condition using !
that works but it's still false
isOnDelivery = false;
GetDeliveryJob = delivery_job addAction ["Get Delivery", {isOnDelivery = true;}, [], 1, false, true, "", "!isOnDelivery"];
๐
You're amazing @meager heart โค
๐คฆ
Hello everyone I am having a little problem, I am trying to get all the coords of the 50 Km/h speed sign on altis using this command copyToClipboard str ((nearestobjects [player,["Land_SignRestrict_01_speedLimit_50_F"], 2500000]) apply {getPosWorld _x}); however its not copying anything it just gives me "[]" when I use a building classname instead it works fine
Yes. And what's the problem?
@still forum just edited the text sorry about that
Are you sure the classname is correct?
If you walk up to a sign and check typeOf cursorTarget or typeOf cursorObject?
Yeah.. That's what I feared. It might be a terrain object
Then why can I spawn it in though :/
try nearestTerrainObjects with like a 10m radius while standing next to the sign and see if it returns it
You can spawn it in because you spawn it as normal object. On the map it's a terrain object though
[593036: signt_speedlimit50.p3d] @still forum
jup
so no way to do it then or any other ideas?
That returns the objects. So you can iterate over them and call getWorldPos
but you might have to do the filtering by yourself
okie fuck but I could specify "empty" as its class name is categorized under empty?
nearestTerrainObjects [player, [], 5] in the brackets can I not specify what type?
Okay cool I am getting all terrain objects on altis this might take a while lmao
Is it possible to lock a house and make it unenterable with script command?
_building setVariable ["bis_disabled_Door_1",1,true];
_building setVariable ["bis_disabled_Door_228",1,true];
...
cool, thanks, making it unlocked basically means setting it to 0?
yep
@fossil yew or if you placed it double click and you can choose which doors to lock
yes, via 3DEN, I know, I was wondering about altering the state later... like owner getting out of his house and locking the doors and then coming back (don't ask why do I need that lol)
Ahhh okay
Do note that not all building support that
Yes, I will place the building via 3DEN so I'll pick the one that is ok. Basically I want to make a warehouse that is not enterable for other players, just the guard.
MP mission or SP?
also if you need just lock it you can try _building call BIS_fnc_replaceWithSimpleObject;
afaik doors will be locked and closed on simple object...
@fossil yew
is there a reverse process too?
no
yeah, that's a problem, it has to be unlocked at certain point. But your code above will help.
nobody knows if ternary operator exist in sqf ?
No. In SQS yes but not in SQF
Thanks
Is the default Arma revive system very optimized for use on high pop servers? Or would I be better off making a more simplified one
Yeah I saw the dev changes, just noticed it does a lot of remoteExec's and data handling for all players
Which I understand it has to for all the 3D icon stuff it does
@flat beacon I think you can do private _var = if (_something) then { 1 } else { 2 }; which is close enough I guess ๐
you mean [2, 1] select _something
grr
noob scripter here .. which file do I execute code in to only initialize it after MP players are in 3D? I'd like to allow them to place map markers during the briefing phase, but once the game starts, ability to place the double click map markers should be disabled / not shared with anyone else
I've gotten the code to work in initPlayerLocal.sqf, but it's already disabled markers during briefing as well
select has an entirely different context and I don't find it an intuitive way to replace the if / ternary operation with
imo ๐
wat
@sick sorrel you'll have to wait until the player object equals player I guess
something like waitUntil { player == player };
or whatever clever solution the next person comes up with ๐
we had a joke about the worst way to do this ๐
hm?
@halcyon crypt yes may be it's work, but it's different of _var = (something)?1:2; but thanks ๐
๐
i still think create a trigger to cover the entire map, then sleeping 0.5 sec, then doing thisList and getPlayerUID _x on it and checking if it matches player UID
is best
wouldn't the objectParent one return true during briefing?
that makes it better
right this joke thingy is about being in a vehicle or not, not whether we're in briefing or in mission ^^
player in player is my bae
are any of the above meant to work? It's all still very unclear to me tbh
Is there a way to add a new line in a tooltip?
\n
player in player? Does that do anything special?
Not really. Basically the same as player == vehicle player
Figured as much
I have just ran into an issue with something im working on, wondering if someone could help, Im working on a market system, and just thought of something, if someone lists say "arifle_Katiba_GL_Nstalker_pointer_F" on the market, my system removes all the attachments from the weapon, and stores them in an array, so the attachments gets added to the market along with the weapon , but then when someone buys the item they will be given the weapon and attachments... is there a way of fixing this ?
get the base weapon
thereโs some BI function for that iirc?
"yourClass" call bis_fnc_baseWeapon
ah
hmm
that could help xD
ty
Yes, Thats great thanks โค
Just thought people could use it to exploit xD had to fix it xD
A SQF script
or
An SQF script
?
An sqf script
An FSM script and An SQS script too?
@still forum direct objects start with an
I played with an sqf script whereas I played with sqf
_objects = nearestObjects [_position, [], _radius];```
Trying to find all AI within a radius. According to the WIKI, "Man" only lists dismounted infantry. Is there a class name that will ignore whether they are mounted or not? Or even only list the nearest groups of AI?
How much AI do you expect to have and what''s your radius going to be?
it's 1000m, I expect around 40 units to be found
Okay
(allUnits select { !isPlayer _x }) inAreaArray [_pos, _range, _range, 0, false, _range]
Use that instead
if I were to search only the leader of the groups that they are in, would sqf _leaders = []; { _groupleader = leader _x; _leaders = pushBackUnique _groupleader; } forEach (allUnits select { !isPlayer _x }) inAreaArray [_pos, _range, _range, 0, false, _range]; suffice?
((allGroups apply { leader _x }) select { !isPlayer _x }) inAreaArray [_pos, _range, _range, 0, false, _range]
Should be faster
okay last question, why is ArmA nagging about a missing ; in this statement? ๐ค
{
if (_x distance2D _base > 1500) then {
exitWith { _module = ["ALIVE_SYS_PROFILE","ALIVE_MIL_OPCOM","ALIVE_AMB_CIV_POPULATION","ALIVE_MIL_LOGISTICS","ALIVE_SYS_AISKILL"] call ALiVE_fnc_unPauseModule; _base_stat = TRUE;}; };
} forEach playableUnits;```
Why are you using then before an exitwith?
hm good point
If you use an if exitWith, it will evalute the code segment in the exitWith regardless if it executes that branch of code etc
Personnal just avoid using if exitWith, not really gonna help with performance enough and chances are you will make a mistake
private ["_base","_base_stat","_module"];
_base = getMarkerPos "BLUF_1";
while {true} do {
_base_stat = FALSE;
{
if (_x distance2D _base > 1500) exitWith {
_module = ["ALIVE_SYS_PROFILE","ALIVE_MIL_OPCOM","ALIVE_AMB_CIV_POPULATION","ALIVE_MIL_LOGISTICS","ALIVE_SYS_AISKILL"] call ALiVE_fnc_unPauseModule; _base_stat = TRUE; };
} forEach playableUnits;
if(!_base_stat) then {
_module = ["ALIVE_SYS_PROFILE","ALIVE_MIL_OPCOM","ALIVE_AMB_CIV_POPULATION","ALIVE_MIL_LOGISTICS","ALIVE_SYS_AISKILL"] call ALiVE_fnc_pauseModule;
};
sleep 300;
}; ``` Is there an easier way to escape the script then?
what the....
the formatting got ruined pasting it to Discord
formatting has nothing to do with my surprise
oh
it is supposed to check if any player is outside a certain zone and then enable the AliVE modules
that's why I used exitWith, because as soon as it's found the first player outside the zone, it won't have to check the rest
@lone glade ```sqf
_groupleaders = ((allGroups apply { leader _x }) select { !isPlayer _x }) inAreaArray [_center, _radius, _radius, 0, false, _radius];
diag_log "Scanning in for BLUFOR progress...";
diag_log format ["%1 hostile groups found.",count _groupleaders];
diag_log format ["Position tolerance: %1 m",_posTolerance];``` returns 0 hostile groups found even with an enemy group right in front of me ๐ค
need the entire thing?
you should maybe leave z axis of inAreaArray on default
while {true} do{
{
if(side _x == west) then {
_radius = 1000;
_center = [(getPos leader _x) select 0, (getPos leader _x) select 1];
_deleteTime = 120;
_posTolerance = 5;
_groupleaders = ((allGroups apply { leader _x }) select { !isPlayer _x }) inAreaArray [_center, _radius, _radius, 0, false, _radius];
diag_log "Scanning in for BLUFOR progress...";
diag_log format ["%1 hostile groups found.",count _groupleaders];
diag_log format ["Position tolerance: %1 m",_posTolerance];
for "_i" from 0 to (count _groupleaders) - 1 do
{
_unit = _groupleaders select _i;
if ((side _unit != side _x) && (side _unit != civilian)) then
{
_leader = leader _unit;
_marker = createMarker [format ["tempMarker_%1",_i], [_leader, _posTolerance, random(360)] call BIS_fnc_relPos];
format ["tempMarker_%1",_i] setMarkerType "o_unknown";
format ["tempMarker_%1",_i] setMarkerColor "ColorUNKNOWN";
format ["tempMarker_%1",_i] setMarkerSize [0.5, 0.5];
};
sleep 1;
};
diag_log format ["%1 hostile groups found.",count _groupleaders];
diag_log format ["Position tolerance: %1 m",_posTolerance];
sleep _deleteTime;
for "_i" from 0 to (count _groupleaders) - 1 do
{
deleteMarker format ["tempMarker_%1",_i];
sleep 1;
};
};
} forEach AllGroups;
sleep 150;
};```
don't have a Z-axis in there
select 0 and select 1 are x and y, aren't they?
by the way, anyone else seen ACE3 BLUF Tracker markers on (0,0) even though no AI should exist?
Hello, is there a way to set the direction vector of a unit towards another specific unit ?
still getting the 18:20:28 "0 hostile groups found." 18:20:28 "Position tolerance: 5 m" after editing the code to remove the Z axis
enemy groups are approx 8m away from player (who is group leader)
( @still forum )
@quartz coyote https://community.bistudio.com/wiki/getDir alt syntax. And then setDir
am I doing something wrong with the factions or something
@still forum oh great thanks
@lone glade / @still forum do you reckon the issue lies with the multiple assignment of _x? In one line it refers to a group if( side _x == west)... and the other to an array element _groupleaders = ((allGroups apply { leader _x }) select { !isPlayer _x }) inAreaArray [_center, _radius, _radius, 0, false];