#arma3_scripting
1 messages · Page 443 of 1
nope xD
There is a specific animations with and w/o the holding a weapon
They usually come with Wnon
ACE has a ACE_NoWeapon gun. Maybe giving him that gun might help
ill give it a go.
how do I remove grenades from AI?
Or not remove them, but rather make them not use it?
@radiant needle see https://community.bistudio.com/wiki/removeMagazines
Won't that remove the actual item itself?
Wait is throw like an actual weapon?
Can I just removeWeapon "Throw"
not sure you can removeWeapon throw; you would have to test it
Well it seems to work, although I dont know how to try and force an AI to throw a grenade
doesn't work on players, but then again I don't need it to
Grenades are weird in Arma
Is there a command like forceWeapon fire but is timed
Because forceWeapon fire even with full auto as the fire mode, will just fire a single bullet
Is there a way to make doSuppressiveFire work better?
Like make them either fire full auto, or update it more often
Because currently it'll shoot at a spot for ~15 seconds regardless of whether or not the player moves
https://gyazo.com/2b0f1c4b4d87bb884244c25e4633acba is there a way of removing options from this list ?
No idea what that list is. But yeah you can remove options from lists
Ouh... That could potentially be hardcoded
was trying it with a pbo
I have no idea xD
Basically a friend on mine bought the map, but its still got the old communities branding all over it. so im just trying to duplicate the map, and remove the class after inheritence ?
edit the map's pbo and remove it from there
its obfuscated
Yeah, my point exacly.
he didnt even use mikeros to pack it
Double id 259 detected (1x)
Double id 260 detected (1x)
Double id 261 detected (1x)
Double id 262 detected (1x)
Double id 263 detected (1x)
Double id 264 detected (1x)
Double id 265 detected (1x)
Double id 266 detected (1x)
Double id 267 detected (1x)
Double id 268 detected (1x)
Double id 269 detected (1x)
Double id 270 detected (1x)
Double id 271 detected (1x)
Double id 272 detected (1x)
Double id 273 detected (1x)
Double id 274 detected (1x)
Double id 275 detected (1x)
Double id 276 detected (1x)
Double id 277 detected (1x)
Double id 278 detected (1x)
Double id 279 detected (1x)
Double id 280 detected (1x)
Double id 281 detected (1x)
Im currently playing the Tac-Ops Missions and just discovered that if you look at a friendly for 1-2 seconds you see their name (bold, green) and the group callsign (below the name). Is it possible to do this in a simple way using a simple, small script or a BIS Function?
@wary vine Maps list is also a RscListbox
So you can basically run a preInit script which will manage your map's list
Addon only ofc
or even better, just replace its class of the whole display and manage thru onLoad or something
Just dont forget to keep IDCs and IDD, since engine is hardcoded to those (mostly)
ui_f/config.bin and seeking it by class ¯_(ツ)_/¯
or you can rip it off the CfgWorlds like specifiying your own:
class CfgWorlds
{
class CAWorld;
class Altis: CAWorld
{
cutscenes[] = {"intro"};
#include "Cfg\CfgAmbientLifeAltis.cpp"
};
class Stratis: CAWorld
{
cutscenes[] = {"intro"};
#include "Cfg\CfgAmbientLifeStratis.cpp"
};
class Tanoa: CAWorld
{
cutscenes[] = {"intro"};
#include "Cfg\CfgAmbientLifeTanoa.cpp"
};
class Malden: CAWorld
{
cutscenes[] = {"intro"};
#include "Cfg\CfgAmbientLifeMalden.cpp"
};
class VR: CAWorld
{
cutscenes[] = {"intro"};
};
class Empty: CAWorld
{
cutscenes[] = {"intro"};
};
initWorld="Altis";
demoWorld="Altis";
};
@wary vine You copy the map class by inheriting from it? And you then want to edit it?
define STATS\
["maxspeed","armor","fuelcapacity","threat"],\
[false,true,false,false]
SR_vehicleShop_stats = [
("((isClass _x) && (getNumber (_x >> 'scope')) isEqualTo 2)") configClasses (configFile >> "CfgVehicles"),
STATS
] call BIS_fnc_configExtremes;
Is there any way to optimize this? It's causing freezes in my vehicle shop. It's the same way the default arsenal does it.
Alright cheers, ill probably just do the preInit option
Hello people a quick question. Is it possible to make a "Function" in a sqf document that dosent include all of it example. Code code code ThisIsMyFunction = [My function code] more code more code and if this document where to be called on would the function run or whould i have to call it in the document? Hope that makes sense 🙏 all in all can you make a function that in a doucment that you can then call throughout the document...
no it doesn't really make sense...
But I guess you mean something like
some code here
_myFunction = {
functions code here
};
other code here
call _myFunction;
other code here
?
Yes thats what i mean thanks 😉
@still forum I got the class copied and edited, but was just trying to remove the original from the map list xD
what do you mean by "copied"?
Inheritence.
how can I edit it ?
instead of class B : A just do class A and add the original addon to your CfgPatches requiredAddons entry.
Then your new class will edit the existing entries of A
@still forum So just got that you can suspend the whole VM by putting some waitUntil in postInit function?
no
CfgFunctions init script call's all postInit functions. And starts a loading screen before and ends it after
if one of the postInit functions never exists. The loading screen never ends
😂 😂 😂 <- This is literally me when The loading screen never ends
Btw does intercept fix sqf performance already?
the optimizer is not default enabled if you mean that 😄
could someone tell me what i'm missing here? missing ; at line 22(which is the last line)
name = 0;
choice = 0;
name = _this select 0;
choice = _this select 1;
kleuren = [
"#(argb,8,8,3)color(0,0,0,1)", //black
"#(argb,8,8,3)color(0,0.1,1,1)", //blue
"#(argb,8,8,3)color(1,0,1,1)", //red
"#(argb,8,8,3)color(0,1,0,1)", //green
"#(argb,8,8,3)color(1,1,1,1)"]; //white
if (choice == "black") then {_color = kleuren select 0};
if (choice == "blue") then {_color = kleuren select 1};
if (choice == "red") then {_color = kleuren select 2};
if (choice == "green") then {_color = kleuren select 3};
if (choice == "white") then {_color = kleuren select 4} else {hint "failure!"};
hint str(_color);
name setVariable ["BIS_enableRandomization", false]; //zet random kleuren uit
name setObjectTextureGlobal [0, _color]; //verandert texture in kleur
use private "_color"; above your if choice == stuff
params ["_name", "_choice"];
private _kleuren = [
["black","blue","red","green","white"],
[
"#(argb,8,8,3)color(0,0,0,1)", //black
"#(argb,8,8,3)color(0,0.1,1,1)", //blue
"#(argb,8,8,3)color(1,0,1,1)", //red
"#(argb,8,8,3)color(0,1,0,1)", //green
"#(argb,8,8,3)color(1,1,1,1)" //white
]];
_color = (_kleuren select 1) param [(_kleuren select 0) find (toLower _choice), 0];
if (_color == 0) exitWith {hint "failure!" };
hint str(_color);
name setVariable ["BIS_enableRandomization", false]; //zet random kleuren uit
name setObjectTextureGlobal [0, _color]; //verandert texture in kleur
very much a beginner script haha
@still forum that's hella cool! thanks, I'll try it out
the line if (_color == 0) exitWith {hint "failure!" }; doesn't work, if I comment that out it works!
and well, i'll just to be not stupid
hm.. I don't see the error
_color = (_kleuren select 1) SELECT param [(_kleuren select 0) find (toLower _choice), 0]; maybe
I'll try that, arma really doesn't like alt tabbing..
@still forum maybe I scrwed something up, I'll copy it again
@winter rose are you trolling?
Run fullscreen window. No problem with alt tabbing anymore
@still forum no, but I might be tired
yes
why not select? you have [colorArray] param [number, 0] isn't it incorrect? not using param often
oh yes, alt syntax: index, default value
^ noticed
nope, still getting generic error
no you are not
Every error is a generic error. 99.9 errors also show exactly what the problem is
'... find (toLower _choice), 0];
if (_color == 0) exitWith {hint "failure!" };
hint ...'
Error Generic error in expression
File [filepath]
line 13
could you maybe just copy-paste it from RPT?
Does anyone have idea how does arma calculate the angle at with bullet has to be fired in order to hit a certain point in the world, while taking both bullet drop and drag into the account. I mean like in math and physics sense, not arma functions and such.
GravityConstant is 9.8066
In Arma Gravity constant is 9.81
Nope it's not.
I really really love this conversation!
Ok, imagine this: there is an AI shooter, you tell him to shoot a target 723.2m away from him. At what angle the bullet has to be fired in order to accurately hit the target despite the bullet drop and bullet constantly slowing down due to drag. All the equation and calculations I was able to found for calculating the angle of reach do NOT include drag into them. If I could find a calculation that gives me an angle of reach with drag and gravity drop included I would be set.
What I'm after is the "angle of reach", not the velocity or such.
What do you want to do with that anyway, Taro?
Dicking around in unreal, made my own ballistics system with penetrations, bounces and such, just for giggles.
All the equation and calculations I was able to found for calculating the angle of reach do NOT include drag into them.
Weird.. Google finds them for me http://www.exteriorballistics.com/ebexplained/4th/61.cfm ¯_(ツ)_/¯
Yeah, the Arma native preview ballistics formula is pretty shit. Really off on long distances and last I tried with tanks, it was completely wrong. I trust Ruthberg more with this.
How quick is this? It's the same principle I used with my catenary and that was pretty slow. :/
Muuch much quicker than your catenary 😄
C++ looks exactly like SQF man.
calculateVanillaZero is all one needs.
@still forum No angle of reach.
Because that's not how ballistics work
You calculate that by simulating the bullet flight. At the end you have the height difference between start and end. And can get the angle out of it.
That's like.. 8th grade math in germany
but at higher angle the bullet speed changes, so does the drag so if you correct the angle you are still not getting the exact angle
What's wrong with https://github.com/acemod/ACE3/blob/master/extensions/advanced_ballistics/AdvancedBallistics.cpp#L181 ? I don't get it.
also I didn't do any physics for like 15 year now, I completely forgot everything on that
Atleast in Arma it doesn't. And that's what you wanted
that is literally the exact math arma is using. Exactly what you asked for
wait, so the drag is always the same regardless of bullet speed?
yes
oh man, this means I could "just" calculate the total drag force accumulated over the flight time and then subtract it from dragless velocity for any damage and penetration calculations
tf am I on iqnu list or what? The formula you want was posted twice already.
inside a 700 lines of other code, I just haven't found it yet 😄
The highlighted line. I also posted the function name.
It's < 30 lines. Won't get much shorter for what you're trying to do.
if ((_type != "deposit") && (_type != "withdraw") && (_toWho isEqualto "")) exitWith {} // its not withdraw or deposit, and a string wasnt sent with toWho ?
``` this should work right ?
@little eagle Oh, thanks I didn't realize it was a line highlight
This line misses ;, so no, it will not work.
@little eagle >.<
Also the description says not withdrawn or deposited, but the code says AND. Sounds fishy.
@little eagle Code checks !withdrawn && !deposit
means not withdrawn or deposited. Which is correct
aka not (withdrawn or deposited)
Yeah, but what's the point of a comment if it only makes things more confusing.
Yeah the comment is just stupid
its not withdraw or deposit
->
it's neither withdrawn nor deposited
you got what I was on about xD
if ((_type != ("deposit" || "withdraw")) && (_toWho isEqualto "")) exitWith {}
``` that wouldnt work would it ?
no
balls
string or string
doesn't make sense
dogs or cats? Is that true?
no obviously it's false! duh
dogs and cats? Is that true?
neither dogs nor cats are neither true nor false
So that cannot possibly work
Yes. Source: You still haven't disproven dialetheism.
Also there is a second route for these kinds of people that can't really think logically.
It's called reading.
https://community.bistudio.com/wiki/a_%26%26_b
As you can see if you read that. && only takes Booleans. not strings
You should not be allowed in this channel unless you read the wikipedia article for De Morgan's law imho.
I prefer Darwins law
Which is?
im just trying to tidy things up
@wary vine in might be able to do what you think of
if ! _type in ["deposit","withdraw"]
But that's kinda weird. And case sensitive. And somewhat harder to read... soo...
I wonder what the default value for such questions is if no answer is given
if (_type != "deposit" && _type != "withdraw" && _toWho isEqualto "") exitWith {};
->
if (!(_type == "deposit" || _type == "withdraw") && _toWho isEqualto "") exitWith {}
De Morgan's Law.
Yh @still forum i didnt think of doing it in an array xD
I know how to fix this, Whale:
if _acePresent then
{
->
if (_acePresent) then {
i ain't??*
Good question. Probably yes for persons.
you are not rechecking in updateAction if you have ACE though
I don't get what you mean
however removing and readding it everytime an update comes in is kinda dumb
why remove and readd it if nothing has changed at all?
Think about it again.
Yeah. Make sure it it is perpendicular to the players forward vector
Anyone got a nifty way to rotate the gun and set its position on the players back so it does not always clip through the players body? I am already rotating according to stance, movement, weapon raised etc, tho that is really tedious.
https://streamable.com/dss2d
or just attach it onto the weapon on back memory point
that should rotate with animations
attachTo doesn't support that, Dedmen.
🙄
so far the only rotation is with the direction the player is facing, thta twon't do sadly
use getWeaponDirection
diwako, what you're trying to do has been attempted countless times before, and everyone has dropped the idea.
not sure what that's called
that will always point forward
also when player bows down in a animation
well so far it works, just the animation is not working correct for the attached weapon
meaning like.. perpendicular to the players torso
well so far it works, just the animation is not working correct for the attached weapon
It works, except it doesn't: It doesn't work.
you would have to adjust the weapon on backs vector like.. every frame
only problem is that arma prioritizes full mags in the players loadout and not the one that was original in the gun
put the weapon together with it's weapon into a weapon holder... Oh wait... You can't.
I guess dropping it would play that animation which you certainly don't want
ACE gunbag. Maybe that keeps ammo count and has a solution for that
my solution for that is either just add the attachements into the weapon holder or spawn an ai off the map which will drop the gun
put the magazine that the weapon used back into players inventory. And then manually addWeaponItem the magazine from earlier
but.. I think that doesn't set the ammocount
right now i am just adding the half empty magazine back to the player before i give him the gun back with
player addMagazine [_x, _ammo];
countless imes beforeee
hey now, I am not trying to make a solution that fits to every usecase. I am more then enough okay with the basic principle working
i am still kinda sad that the spawned gun's mempoints are useless and cannot be used to attach the attachments
The VBS attachTo has what you need. The arg is called bone. https://resources.bisimulations.com/wiki/attachTo
No way to get this in A3 though.
Trying to emulate this yourself is a waste of time, as this will never work in MP.
well just when they stopped selling licenses for vbs2 (?)
well guess I just to an EH with animdone, looks janky at best, but gets the job done.
It will look really bad, and people will find it distracting.
true.
need some advice on correct remoteExec use with JIP
[_plane,[[_i],true]] remoteExec ["lockTurret",_plane,true];```
from what i understand this will create a new JIP call for each execution - whereas you only want the latest state applied/execute for a JIP
so would the way to go use an unique string instead of the true, like `format ["LIB_JIP_CargoSystem_%1",_plane]`
Pointless, lockTurret already has global effects.
meh sa-matra told me to look into it. so its just lock that needs that treatment?
No, lock too has global effects.
Atleast according to wiki
Well, if there's something wrong with the wiki, then that is a separate issue.
If the wiki is wrong then please fix it or add a note. Instead of telling someone in private that he needs remoteExec with JIP flag to do something that shouldn't be needed
^
If the command has global effects, then it will be synched to JIP clients anyway. So JIP flags are a waste.
https://community.bistudio.com/wiki/lockTurret
https://community.bistudio.com/wiki/lockCargo
Sa-Matra
So it will sort of work in MP with seats locking and unlocking improperly
For example if plane is remote, you'll get on cargo seat, then stand up, same cargo seat will still be unlocked for next player to get on
Pretty sure this is how it will work:
1) Plane on the ground, is remote to both Player 1 and Player 2 (to say Player 3\Server)
2) Player 1 gets on cargo seat 0, presses Stand up, gets into his standing up turret
3) Player 1 script tries to lock cargo seat 0, fails as plane is remote
4) Player 2 selects "Get in as passenger", gets put into seat 0 again since it is unlocked```
did i misunderstand him?
yes
execute it where the vehicle is local and you are golden
Which btw... Wiki already says
ArgLocal.
so just drop the jip flag, and it should be alright, ok?
All that his comment says is "If you use this command incorrectly. it won't work as it's supposed to"
yes
Sa-Matra's comment tl-dr:
undefined behavior when used on remote objects, basic error traps are too advanced for Arma
ok ty. still need to understand the proper JIP flag use for other cmds. if only the last instance should be executed, then the unique string is the way to go?
yes
is vehicle id unique enough?
Probably what you get when you use str on a vehicle without vehicle var name.
That should be the vehicles address in memory
which is unique. Until the vehicle get's deleted. And different on every machine.
I'd go with netId. At least that is proven to be unique on all machines.
on server the vehicle string is unique. Until the vehicle get's deleted and a new one takes it's place
but at that point you probably don't care about keeping your JIP entry
If only BI would give us access to objects OID's :/
What command would require the JIP flag anyway? Can't think of anything useful with local effects.
addAction 😄
lol nice
disable auto-brake when switching seats is that something that can be doen via scripting?
yeah... kinda
if you extremely quickly put a AI into the driver seat. It might be able to hold the break pedal up
well without AI would be better. hmmm
Then no.
rgr. sry
I know that something is there that does that. And I know it's config
Not with scripting.
And don't spam around. #arma3_scenario was more correct place to post it than #arma3_scripting is
Invisible AI exists, check AI UAV
Oh.. Never thought of that. That's a nice solution
sorry
@dusky drift ?
was responding to Dedmen
Sometimes you get people that copy paste their same one liner question to ~10 different channels.
What should I use for logging while debugging
I remeber using system chat
but nothing is showing.
I even put a sys chat call in the init to test it.
sys chat is not disabled.
diag_log not working for you ? 🤔
systemchat is what I wanted.
But is not showing up.
Example.
west setFriend [independent, 0];
west setFriend [east, 0];
independent setFriend [west, 0];
east setFriend [west, 0];
east setFriend [independent, 0];
titleText ["", "BLACK FADED", 0.2];
// Some functions may not continue running properly after loading a saved game, do not delete this line
enableSaving [false, false];
// All clients stop executing here, do not delete this line
if (!isServer) exitWith {};
// Execution stops until the mission begins (past briefing), do not delete this line
systemChat "STARTING COUNTDOWN";```
I know the isServer is the problem
but I was under the impression that it should show for me when hosting lan via eden
if (!isServer) exitWith {}; //--- this
// Execution stops until the mission begins (past briefing), do not delete this line
systemChat "STARTING COUNTDOWN";
Yeah.
And again, I am luanching multiplayer via the eden editor.
So I am the server, or I should be.
If I am correct about that.
if not, how can I get it to broadcast, would be the next question.
remoteExec ?
https://gyazo.com/8581ee6b5a7ce8db3921b56edc485705 i think I may have broken something xD
also if that in init.sqf will be better to use initPlayerLocal.sqf and initServer.sqf
more info here https://community.bistudio.com/wiki/Initialization_Order
@hearty plover
True, that's on the todo list.
I found a good solution.
Going to add a logging funciton to my stuff.
params [["_text", "", [""]]];
[_text] remoteExec ["systemChat", 0, true];
I think I can use this do do something like...
format["LOGGING, %1, %2", var1, var2] ORMP_fnc_log;
If I am correct
That should get debug stuff out when I need it.
Jay, you are the server in local hosted MP regardless of 3den. What may happen with systemChat is, that the display that shows the chat is reset after the code ran, therefore deleting the message. May happen if your code is executed before the loading screen.
What about compiled code?
My logging is in my functions
defined in my own CfgFunctions
All code is compiled before execution, no idea what that changes.
Okay, I didn't think it made a diffrence.
does anyone know if i can use the tree view from the eden editor ? https://gyazo.com/e182cc334c3dc6c4322843cf65310687
Well, how / when was your systemChat executed?
Can I pm you?
Why not this channel?
Just the code I am trying to show you is not sending to channel
It's less than 50 lines.
But not sending.
// CHAT SETTINGS
// GLOBAL 0, SIDE 1, COMMAND 2, GROUP 3, VEH 4, DIRECT 5, SYSTEM 6
disableChannels[] = { 0, 2, 3, 4, 5 }; // simple channel ID list
In desc ext.
try this https://pastebin.com/
disableChannel has no influence over the chat commands like systemChat.
Thanks commy
This is the function, in which I am expecting to see a chat message.
my init sqf
ORMP_fnc_log contains systemChat?
https://github.com/MidnightGH/MAAS/pull/1 (Github PR) , any thoughts on how i might do this a little more cleanly?
params [["_text", "", [""]]];
[_text] remoteExec ["systemChat", 0, true];```
That's the funciton ORMP_fn_log
Just wrapping the remoteExec call.
What's weird is like you said, when hosting locallyg, I am the server
and I still see no logs pop.
Well, you have to wait 260 seconds apparently.
also for disabling channels, this will be better option https://community.bistudio.com/wiki/enableChannel
Did you check the RPT file and have showScriptErrors enabled?
I do have showScriptErrors
I have not checked the RPT
where should I find that for hosting locally
I only know how to find it on my dedicated server
%LOCALAPPDATA%\Arma 3
and you can just
"SCRIPT COUNTDOWN STARTED" remoteExec ["systemChat"];
I think you may also have to control an avatar to see the chat. The avatar may be a spectator camera, but player being null may hide the chat I think.
NOBODY LUAGH
I need to re-think my mission naming convention.
I was editing the previous missions scripts.
ok
One second.
I assumed something stupid like
#include "Zen_FrameworkFunctions\Zen_InitHeader.sqf"
containing isServer exitWith or something like that
How would changing the command to log change anything? systemChat is proven and reliable, so changing to hint won't fix it any way.
I think you may also have to control an avatar to see the chat. The avatar may be a spectator camera, but player being null may hide the chat I think.
this ^
Does forceWeaponFire work on drones? I tried to use it with the vanilla CRAM yet I could not get it to fire
veh forceWeaponFire ["weapon_Cannon_Phalanx","manual"]; //manual seemed to be the only fire mode the vehicle had, I also tried making the AI inside forcefire yet that resulted in nothing either
Have you tried fire or doFire
That or [_unit, "weapon_Cannon_Phalanx"] call BIS_fnc_fire
@lost iris #arma3_scripting is not #arma3_editor
@gleaming oyster you have your PR feedback 😉
Is there an easy way to convert "True" "False" strings into boolean?
Also how do I pass parameters onto remote exec?
I have this and _Position is reporting as undefined
{
{_x hideObjectGlobal _Hide} foreach nearestTerrainObjects [_position, [_Filter], (parseNumber _Radius), false];
} remoteExec ["bis_fnc_call", 2];
Anyone want to take a stab at why this won't work?
systemChat result is correct
3 element array, boolean, integer, string
Oh I'm an idiot
Im passing an empty string to filter
But why isn't If (_Filter == "") working?
I don't see a if (_filter == "")
Yes that does appear to be the issue
Weird how code works better when it's in the right file
Does _i work for forEach?
huh apparently the 8192 character limit was format and not copyToClipboard
YEah I was gonna say I did a straight copyToClipBoard str and it let me copy over 200,000 characters
diag_log is like 2000 chars, not 8192
format alternative
format ["this is %1 and that is %2] -> ["this is ", _str1, " and that is ", _str2] joinString ""
joinString doesn't have the limit afaik
diag_log is 1044 characters according to note on wiki
ok
Is there an easy way to let a user browse the full arsenal, but prevent them from actually taking anything?
If you know scripting, sure why not.
Is there like a easy to use variable or arsenal creation parameter, or do I need to mess with eventhandlers and displays
you can use arsenalopen/close eventhandlers. Save loadout on open. And reapply it on close. They can still edit their loadouts. But everything will be reset after closing arsenal
Does BIS_fnc_save_inventory work for gear or is that literally just inventory
BIS_fnc_saveInventory my bad
Use what Dedmen posted instead.
Im just wondering if that conserves ammo as well
Don't want players to have 10 half mags, open arsenal, close it, then magically have 10 full mags
It won't if done correctly
Also what is the event handler that triggers if arsenal is opened?
ArsenalOpened
BIS_fnc_addScriptedEventhandler I think
missionNamespace
What are the chances this works for ace arsenal?
0
ah apparently for ACE it's ["ace_arsenal_displayClosed", {}] call CBA_fnc_addEventHandler;
So would 0 % 2 == 0 be true or false?
So does that make 0 and even number?
Yes, 0 is an even number.
Better question. Does 0 being even, every number having a successor, and every positive number having a negative counterpart mean, that there're more even numbers than there're odd numbers. 🤔
Am I misinterpreting this array?
BIS_fnc_garage_data one
This is my code
type array expected string on the gettext line
No it doesn't because it is easy to produce a mapping from the even to the odd numbers and vice verses with x +1 and x-1. They are the same infinity size.
But every positive number has a negative counterpart, so they eliminate each other. Only 0 is left, and that one is even.
So I have this script https://pastebin.com/kh7rtMaQ
but some of its output is like this
\a3\soft_f_gamma\offroad_01\offroad_01_hmg_f
some is like this
\a3\soft_f_epc\truck_03\truck_03_device_f.p3d
how do I go from either one of those, to an actual classname
You can't. Those are model paths and different classes may use the same model.
Wow dude. Still trying to get all vehicles out of bis_fnc_garage_data although I sent you a better solution when you asked a couple days ago which you then just ignored?
This is organized though
Probably can't retrieve classnames from bis_fnc_garage_data on pricniple.
Already told you that not all vehicles are in bis_fnc_garage_data. And what does "organzied" mean?
What for?
then take the code that categorizes it and use it. Bam. You suddenly have same categorization
What is the code that categorizes it?
What for?
For a menu
Why not get the list of all those from CfgVehicles. Where does the arsenal come into this?
Will the list from CfgVehicles be organized into categories?
Not by default.
Garage data select 0 is cars, select 1 is tracked, select 2 is rotary wing, etc
This is just sad watching you.
private _cars = "true" configClasses (configFile >> "CfgVehicles") apply {configName _x} select {_x call BIS_fnc_objectType select 1 == "Car"};
typo fixed
I don't do config stuff, no need to be an ass about it
But you were told a week ago to not bother with the arsenal.
That's the point were I would've looked for an alternative.
You could just ask "How could I do that then without the arsenal garage data?" instead of "Screw you and your tips and you trying to help me. I'll just ignore what you say and try to go my own way even if it won't work"
how do I get all cars from the arsenal
you can't
select 0 is cars
won't work
b-but how do I use the arsenal to get all cars
I figured it'd be easier to go from something like \a3\soft_f_beta\mrap_03\mrap_03_unarmed_f to a classname, than to rewrite my script to use your method
You figured wrong then. Because:
Those are model paths and different classes may use the same model.
You think you know better than two guys that have been scripting for several years and know how almost everything works?
I don't know what you know
There isnt a little tag that says "Scripter for 'x' years"
Blue name 😉
Blue name -__-
Commy also has a blue name. theoretically
Mods couldn't handle the truth.
But now you know 😉
I mean I've also been scripting for several years, I just get hung up on little things
like config stuff
ask and learn. Instead of stay away and workaround
That is what most people use this channel for. To learn how to do things they didn't know how to do before
So for this private _cars = "true" configClasses (configFile >> "CfgVehicles") apply {configName _x} select {_x call BIS_fnc_objectType select 1 == "Car"};
Is that just sorting, or is that actually getting all CfGVehicles that are "Car"
from left to right
"true" configClasses (configFile >> "CfgVehicles") get all CfgVehicles classes.
apply {configName _x} get their classnames
select {_x call BIS_fnc_objectType select 1 == "Car"}; filter only the classnames that are of type "Car"
So in the end it returns an array of classnames that are of type Car
Apparently the following code is valid:
lnbSize 38101;
Which makes me wonder: Is the Control type just another word for a Number that is used as the ID of said control or does lnbSize also accept a Number as an alternative data type? Or more general: Can all commands expecting a Control as an argument be fed with a number? And if that is the case: Does the same thing apply for Displays? 🤔
idc syntax of control commands uses the currently active display, but the control syntax could report / influence non active displays.
No. GameDataControl stores a pointer to the control. Not a ID.
No Control is not a number.
no lnbSize doesn't accept a number. Only controls.
No numbers don't implicitly convert to Controls
No even if you did pass a number as Control parameter through any other means. It would internally retrieve a nullpointer as the control. Which would make lnbSize return an empty array
lnbSize <idc>
is alias for
lnbSize (<active display> displayCtrl <idc>)
though, Dedmen.
Oh yeah.
Overlooked the second implementation.
That's not listed though on wiki is it?
Do all control commands have this feature?
Most of them yeah
Would you think one should add this to the wiki? Or would that fall under "weird SQF magic noone wants to see documented" 😅
Thanks for the input guys 😃
I already notified the Wiki magician
I guess I should feel bad for not doing it myself and instead delegating work to others...
Yeah just saw that... Though I could do that myself
You said that most commands accept this... Do you happen to have a list which do and which don't?
Maybe your intercept-list?
it would contain that yeah
Alright then let me dig through that...
@winter rose I'll do it
Does this also work with Displays?
Okay thx
@winter rose probably likes getting spammed with notifications
Yeah sure ^^
I wonder if notepad++ would actually let me do that?
Replace All in files when main windows directory is selected
_ @winter rose says hi_
Can anyone see any obvious reason why this would only create one marker? The position array increments fine like this, but only the first marker is created
_secArr set [0, _xN];
_secArr set [1, _yN];
_secArr set [2, 0];
_markerName = str _secArr;
systemChat str _secArr;
[_markerName, _secArr, _markerName, "hd_dot", "ICON", 1, [1, 1], "ColorRed", 1] call RND_fnc_getMarker;
_secArr = [];
}; ```
Basically just: for coord, coord is less than max coord, coord = coord + max/number
Roundley, I cannot see a single reason why this would create any marker.
Like, there is no createMarker(Local).
Do you have the rest of the script?
Oh, right, I'm calling my own marker function
I do, but wasn't sure it would be okay to post it here
About 40 lines
Just pastebin it or something
Are you trying to make markers evenely spaced in a row or something?
My guess is that the marker names are not unqiue.
[((_Pos select 0)+(sin _Direction*(_Spacing*_i))),((_Pos select 1)+(cos _Direction*(_Spacing*_i))),0];
This will probably help you
Thats what I use when I need things in straight lines
private _yN = _y0 - _offsetY;
for [{_yN}, {_yN <= _y1}, {_yN = _yN + _secY}] do {
These two lines. It looks like the two variables conflict.
Hm
But yeah anytime you want to get a straight line in a grid space you can use
(_XCord + (sin (_Direction*_Spacing)),(_XCord + (cos (_Direction*_Spacing))]
How do you do code on discord lol
```sqf
```
(_XCord + (sin (_Direction*_Spacing)),(_XCord + (cos (_Direction*_Spacing))]
No space.
(_XCord + (sin (_Direction*_Spacing)),(_XCord + (cos (_Direction*_Spacing))]
missing sqf for highlighting.
(_XCord + (sin (_Direction*_Spacing)),(_XCord + (cos (_Direction*_Spacing))]
@radiant needle Thanks! So presumably direction up would be 0, East 90, etc?
yeah
Thank you, will try that now
Then you put this in a for loop or something
I don't think you problem is with the math. It's with how you use the control structures, Roundlay.
I would avoid that for syntax.
for "_i" from a to b do {
is just better...
There's some logic issue I'm ignorant of, in the language, I'm sure
Yeah, if you look at the comments in the pastebin I had many failed attempts with for from do lol
Lots of only 1 marker there too
The iterator shares the same name as a variable previously defined. And the first code block doesn't assign anything to the iterator. That's the bug most likely.
Hm, I see
Maybe use a while loop instead.
So instead, I should increment on the the prev. defined variable in the for _ from _ do part?
My text editor froze. :/
E.g. for "_i" from _predefined to _max do
If you use the formula I gave you, you have to start from 0
while {
_yN <= _y1
} do {
// stuff
_yN = _yN + _secY;
};
I can't wrap my head around how to then increment the predefined variable from there I guess
I'll try these solutions now, thank you 😃
Please tell me how to get the exit coordinate of vehicles for a specific location in vehicles without performing the exit on the player for A2OA
Assuming I'm not retarded into the future, are any of these ideal perf. wise?
you don't create hundreds of marker every couple seconds do you?
for "_I" from 0 to 100 step 1
will for instance create a 1km line of markers if your spacing is 10m
As for loops:
forEach/select/apply > for > while > for ARRAY
I'd say.
@still forum No, just want to get positions for future use, one and done
I see, thanks!
or from 1 to 100 I should say
for something done just once you don't really need to care about perf
just do it at preInit while the mission is still loading. And you're golden.
Very few one and done things can lag out a mission
I see (: Just out of curiosity really
you don't create hundreds of marker every couple seconds do you?
This though tbh. No reason to waste time on superfluous stuff, but the type of loop is pretty inconsequential for something like this.
nearestObjects cough cough
Lol @ calling boats ships
Nice try BI'
We know you ain't got no ships
Depends on the type of drone.
At least there are helicopters in the helicopters category, and cars in the cars category
We'll never get a ship in Arma until Physx is upgraded
PhysX will be dropped in the next version and that is a good thing.
I heard Bullet. Which is not in house
Everyone get's the Bullet.
I wonder if we'll get their full soft body suite
Imagine Arma with full soft and rigid body simulation?
What for? Sounds like a waste.
Hey, I've got a question. I made 2 Animation for a "hostage situation", I just used attachTo to let the Hostage "taker" move around the Hostage, however I cannot shoot the hostage which is attached to the "taker". I can only shoot the hostage taker. Any ideas? Is that because of the attachTo command?
yes that's because of attachTo.
Doubt it.
You can probably use a hit event handler
See if a hit event handler triggers when hostage is attached
If so you can also use it to detach him and kill him
Alright, gonna try that. Thanks
Now the fun part
I get to go through 7865 classnames and set prices
THank god for excel and CONCATENATE
'three ' ' fitty'
uh uh
No luck on the loop variations just yet, but gave me other options to work through, thanks! (:
Did you ever post RND_fnc_getMarker ?
Piped it to system chat and can see it updating
I switched to normal createMarker and same deal unfortunately
so the issue is probably somewhere with your actual functio
Mm
Are you using same marker name for every iteration?
I'm using _markerName = str _secArr;
But that could be the issue yeah
toString also didn't work
also had the same effect*
try something like format["marker_%1_%2"._direction,_i];
format["marker%1%2"._direction,_i];
I wish I could type today
Put some separator between the two numbers, to avoid collisions.
format["marker_%1_%2"._direction,_i];
omg
format["marker%1%2"._direction,_i];
Im going to just install my computer
format["marker_%1_%2"._direction,_i];
format ["my_marker_%1:%2", _xN, _yN];
🤔
Now that is a classy idea
You have periods not commas in all of these, Drew.
format["marker_%1_%2",_direction,_i];
I switched to cherry mx red keyboard
I cant feel when I press the keys half the time
I code with speech to text..
Can you select the last array index like in Python? Like, array select -1?
yeah, just do _i - 1
Figure if the array is updating I could just pushback and select the last index
Oh wait, what are you trying to do?
Basically trying to split mission area up in to n sectors to use for patrols, whatever else
"Figure if the array is updating I could just pushback and select the last index" - pushBack gives you the inserted index.
Oh lawd, where is my shame emoji
That really does sound the way I think it works in my code fiction though, lol
Idea was to use two nested loops to first increment through Y markers, then return to original Y position and increment X, then repeat, making a grid across the map I could use to assign patrols and whatever else
Just practice though, might have to rethink logic and read biki
Learn SQF: Abandon Logic
lmao
You can do with with two nested loops: https://pastebin.com/MiXM8XLw
Who wants to play a game of find the missing )
@errant jasper Thank you! I'll try this now
_MarkerPos = ((_Position select 0) + (sin (_Dir*_Spacing)),((_Position select 1) + (cos (_Dir*_Spacing))];
sin?
Is missing a different char
I see too many parenthesis.
Also that ^^^
_MarkerPos = [(_Position select 0) + (sin (_Dir*_Spacing)),(_Position select 1) + (cos (_Dir*_Spacing))];
_MarkerPos = [(_Position select 0) + sin (_Dir*_Spacing), (_Position select 1) + cos (_Dir*_Spacing)];
btw., what's up with capitalizing the variable names?
#Style
private _var = (((((not (a (lisp nil)))))))
ugly af
Arma uses camelCase. already. Pressing your different style into that makes it kinda ugly
I mean if I type a two word single word I use camelCase
two word single word
But... MarkerPos is two words in one string.
But you use CamelCase there not camelCase
deflated_brain.jpg
iTcOuLdBeWoRsEtHoUgH
_itCouldBe_worse
how do you camelCase a three word word
I propose new style. We make all letters uppercase except the last. so MYVARIABLe
camelCaseIsAWord
_snakeOilSalesman
cookieDoughIsTastyStuffAndHelloTuiderru
"Four word words" are verboten though.
But then we could dromedary case them
🤦🏻
is this how to teleport player to random marker?
player setPos (getPos selectRandom marker1, marker2)
almost
close
player setPos (getPos selectRandom [marker1, marker2])
You need getMarkerPos, not getPos for markers, because there was a time and people that thought everything needs a new command name.
player setPos (getMarkerPos selectRandom [marker1, marker2])
close, but markers are referenced as strings.
i dont know what that means
i dont know what that means
marker1
->
"marker1"
so i have to set it somewhere?
"Marker1" setMarkerPos [200,100];
_pos = getMarkerPos "Marker1";
player setPos (getMarkerPos selectRandom [marker1, marker2])?
humans (╯°□°)╯︵ ┻━┻
i just read what i wrote...
marker1 is a undefined variable. "Marker1" is a marker. And somehow the script uses getMarkerPos twice which is strange.
Why not like this?
private _position = [200,100,0];
"Marker1" setMarkerPos _position;
player setPos _position;
🤔
what about the randomness?
player setPos (getMarkerPos selectRandom ["marker1", "marker2"])
There. Now go.
There's only one marker in your example.
He copied that from biki
ah i just needed "" ?
marker1
->
"marker1"
Are you looking to teleport to a random marker or a random place in general?
Guessing that prepending some random code from some random example on the internet to his code will fix his code
@radiant needle is this how to teleport player to random marker?
I'd say marker
because that's exactly what he asked
look, i havent slept in past 30h because of exams, im a bit slow
I'd say it's open to interpretation
Can I not do something like this ```sqf
switch (_i) do {
case ((_i >= 0) && (_i <= 20)):
switch (_i) do {
case ((_i >= 0) && (_i <= 20)):
{
_Dir = _Dir;
};
case ((_i > 20) && (_i <= 40)):
{
_Dir = _Dir + 90;
};
switch (true) do {
case cond1: {
};
};
oh yeah derp
Also, what's the point of using switch, when you check the same condition twice?
if turn % 20 == 0
switch (true) do {
case (_i <= 20): {
_Dir = _Dir;
};
case (_i <= 40): {
_Dir = _Dir + 90;
};
};
It won't evaluate that second case?
I just realized
Otherwise the switch would be pointless and you could just write some if then's.
Alt:
_dir = _dir + 90 * floor (_i / 20);
I made a square
Wonder if there are any other things I can make with straight lines and right angles
Now you're doing again weird stuff with switch.
Yeah I was just testing my math
switch (_i) do {
case 0: {
};
case 20: {
};
case 40: {
};
case 60: {
};
};
Now do it so all points have the same distance and are still on this spiral.
If you do same spacing you get a circle
Woah, that's cool
: If you do same spacing you get a circle
No.
The dots could be on the spiral and still have the same distance to the last dot as the one before them had to it's predecessor.
if you change the ```sqf
_spacing * _q to _spacing * _i
you get a circle
ah I see what your saying, but I think that math is above my head
reverse that actually
But that's where it get's fun.
if you add a multiplier to _i you can change the tightness of the spiral
But, you should check out the newish getPos syntax.
position = origin getPos [distance, heading];
Yeah that'd probably be a lot easier
Also getRelPos for objects.
code looks a lot less fancy though
It's almost intelligible
@ivory nova You can use modify this to make shapes
Here's one that makes any polygon
Damn too bad marker colors aren't RGB
I could make a rainbow
Saved, thanks man (:
That 8 should be _Sides though
on line 8
will 0001 get truncated to 1?
Heres another version with custimizable density
Yeah, 0001 is the same as 1.
oh my god, if you make a spiral, and zoom in and out really fast, it looks like water rippling
this is trippy
We're not ready for this technology
snake build on A3MapOS when
So if I can't call more than one marker anywhere, is that a reinstall kind of issue?
?
@ivory nova , it makes no sense at all
most likely a script error. pastebin?
make sure to have different names
Hm, tried that D: I'll take it to troubleshooting though 👌🏻
@ivory nova : p.a.s.t.e.b.i.n
Was in reference to a pastebin I posted earlier, but the issue is unrelated to a specific script
i'm trying to get display name for a weapon
configProperties [(configFile >> "cfgWeapons" >> "HMG_127_UGV" >> "displayName")]
but this^ is returning []. What am I doing wrong?
you're not using the right command
getText (configFile >> "cfgWeapons" >> "HMG_127_UGV" >> "displayName")
you da man, thanks
The script I gave you is working 100% for me
Definitely not on your end my dude (:
Do you have any map marking mods installed?
The number of markers Roundlay can spawn
Holy crap
@radiant needle Clue?
Do you want ants? Because this is how you get ants
any one have a good way to convert XYZ data into VEctors ?
@radiant needle Stop mathing on the floor
I've got quite a particular question.... Has anyone tried to convert sqe cfgcomposition data into an sqf array for quicker reading of data? I am trying to spawn in AI via cfgcompositions defined in the missionconfigfile, and I want to speed up the spawn script by not directly reading from the cfg. I thing reading the cfg data at preinit and parsing it into a sqf array would make it quicker, what do you guys think? Anyone know of any scripts/addons that do this?
How do I check if an object has a variable name ("object" can be anything [AI, player, wall, dead body, etc.], "variable name" can, again, be anything [joe, my_awesome_wall, 1541, etc.]).
@tough abyss I don't think you can. Why would you want to do that?
@tough abyss https://community.bistudio.com/wiki/allVariables
oh, well ^^
No problem. It's too easy to miss the new commands added in later versions. Some of them are extremely useful. Check https://community.bistudio.com/wiki/Scripting_Commands_by_Functionality before doing anything in sqf and check if there's a recent command for it before doing a workaround intensive loop or something.
I'm still curious about the why, though
@winter rose - on-the-fly debugging, I guess.
I currently have this, it will output the classnames of all objects of a given kind in a 100m radius, would be nice if it gave me the object's name (assuming it has one) instead of it's classname where possible.
#include "script_component.hpp"
private _objList = [];
{
_objList pushBack typeOf _x;
} forEach nearestObjects [player, ["Tank", "Car", "Ship", "Helicopter", "Plane", "StaticWeapon", "CAManBase"], 100];
hint format ["%1", _objList];
@tough abyss https://community.bistudio.com/wiki/BIS_fnc_displayName if you want the friendly editor name
_x will be the varname of the object if it has a variable name in the foreach block
thank you kind sir Dedmen for the comments on that PR
@tough abyss How do I check if an object has a variable name getVariable with default value
["music", nil, nil] params ["_music", ["_offset",0,[0]], ["_volume",1,[0]]];
That will use the default values and not error out right?
correct
useful because then you can do something like [1, nil, 3] if you want values in the middle to be default
Script with UI to start music in a mission from a specific offset. instead of the zeus module which starts always at start.
It's been broken for over a year now and I keep "fixing" it 😄
//timer
sleep 0.01;
timer = 10;
publicvariable "timer";
waitUntil {!isnil "timer"};
while {(timer >= 0)} do {
hintSilent parsetext format ["<t size=1.5' align='center'>%1</t>",(timer / 3600) call compile loadfile "time.sqf];
timer = timer - 1;
timer = timer - 1;
publicvariable "timer";
sleep 1;
_this setdamage 1;
for some reason _this setdamage 1; is not working
what what did i do wrong?
don't even know how that works at all
why do you decrement the timer twice?
why do you call compile loadfile?
Why is the } of the do code section missing?
thats just bad copy pasting
im trying to make a timer, wich when time runs out kills the player
I can't help you much if you can't show me your code cuz "bad copy pasting"
//spawn
_this setPos (getMarkerPos selectRandom ["spawn_facN_1", "spawn_facN_2"]);
//Text
_this sideChat "You have 20 minutes to extract.";
//timer
sleep 0.01;
timer = 10;
publicvariable "timer";
waitUntil {!isnil "timer"};
while {(timer >= 0)} do {
hintSilent parsetext format ["<t size=1.5' align='center'>%1</t>",(timer / 3600) call compile loadfile "time.sqf];
timer = timer - 1;
timer = timer - 1;
publicvariable "timer";
sleep 1;
_this setdamage 1;
//Deactivation
}
while (!alive _this) do {
timer = timer - 1;
}
thats the whole file
Please do
```sqf
```
and you'll see your mistake
what?
If you add sqf after the top backticks it will do syntax highlighting
And syntax highlighting will show you what's wrong
I would recommend doing any SQF work with an editor that has a plugin for SQF syntax highlighting:
NP++ https://forums.bohemia.net/forums/topic/138891-arma-3-notepad-syntax-highlighting/
Sublime https://packagecontrol.io/packages/SQF Language
Atom https://atom.io/packages/language-arma-atom
As Dedmen said, just edit your code post so the top line is ```sqf and the problem will stand out very clearly
i might just be dumn but im not seeing it
😔
You don't see the color change into that blue-greenish that looks weird?
first half your commands are red. Second half they are green/blueish
wich means?
It all becomes a string at one point
your error is where the blue/greenish text starts
It's one long string
it works now, thanks 😄
see im learning... now i know what string is
before i learn we will have moved on to enfusion tho
guys, please help to solve the problem.
I need to get the coordinate of the exit point and the vehicle for each location in the vehicle.
Any idea how to get this?
In a while statement is something like this possible ? ```
_IDC = 6704;
while {!((ctrlText _IDC) == "cardbackv4.paa")} do {
_IDC = _IDC + 1;
};
_IDC //This being the output of first control thats not"cardbackv4.paa"
Thanks ill play around with it for a bit then
If i have a function within a code Example ```
Hint "Hello";
_myfunction = {hint "Hey";};
hint "Hello there";
call _myfunction;
Would the final hints be in this order Hello,Hello there,Hey or Hello,Hello there,Hello there,Hey?
You would only see "Hello there" because you only see one hint 😉
Hello, Hello There, Hey
you just define a variable in second line. You don't execute it
Thanks
["<t color='#ff0000' size = '.8'>Hostage Will Be killed in:<br />0:00</t>",-0.99,-0.1,1,0,0,789] spawn BIS_fnc_dynamicText;
Is there a way to change the font? what are the one available?
But what are the font availables?
hmm
See config viewer CfgFonts
^ will be better option, possible outdated > https://community.bistudio.com/wiki/FXY_File_Format#Available_Fonts
["<t font='PuristaBold'><t color='#ff0000' size = '.8'>Hostage Will Be killed in:<br /><t font='LCD14'>0:00</t>",-0.99,-0.1,1,0,0,789] spawn BIS_fnc_dynamicText;
Looks good
one thing that wories me is that i heard about resolutions problem with text on screen, this BIS fnc does fix it?
it was a long time ago, the font wasn't well readable?
BIS_fnc_dynamicText is big enough not to have to worry about it 😉
I mean, does diferent resolutions may trow the text off the screen?
just stay in safeZone box, you will be safe 😀
also
"<t color='#ff0000' size = '.8' font='PuristaBold'>Hostage Will Be killed in:<br /><t font='LCD14'>0:00</t>"
safeZone ?
safeZone > https://community.bistudio.com/wiki/SafeZone
grpNull
the default value can be anything. if you want it to be a null group then yea that will work
That works.
Another thing, unrelated..
How do I keep the script error box from vanishing.
["CALLING ORMP_fnc_sniperFire"] call ORMP_fnc_log;
params [["_sniper", objNull, [objNull]], ["_target", grpNull, [grpNull]], ["_danger", false, [false]]];
// stop, and reveal the target.
doStop _sniper;
_sniper reveal _target;
// Set danger level
if (_danger) then {
["DEADLY ENABLED -- "] call ORMP_fnc_log;
_sniper setSkill ["aimingShake", 0.8];
_sniper setSkill ["aimingAccuracy", 0.8];
} else {
["DEADLY DISABLED -- "] call ORMP_fnc_log;
_sniper setSkill ["aimingShake", 0.7];
_sniper setSkill ["aimingAccuracy", 0.3];
};
// Fire on target.
while {[group _target] call ORMP_fnc_numberAliveInGroup > 0} do {
_sniper doTarget _target;
_sniper doFire _target;
};```
Something is going wrong with my reveal statement.
I am giving it a valid group.
_sniper is a single unit.
_target is a group.
Error reveal, type group, expected object.
Can I only reveal a single unit?
You should be able to see the error in your RPT file if you want to look it up.
He already posted his error ^^
a group of units is a group of objects
Not unsimilar to an array?
I don't see where it says that
you could say a group is a very specialized form of a array of objects
That says Unit(s) plural are a group
https://community.bistudio.com/wiki/Object#Object_Type
An Object in the scripting language is a generic reference for a soldier, vehicle or building
Right above it says Units are an Array of type unit
you can do leader _group if there is only 1 unit, Jay
Units are an array of units. An array of objects. Not an object
you can ignore the "subtypes" part
forEach units _group
That's also what i do on my reveal code I think
and then based on a percentage, shoot or don't shoot at the group.
The script is a helper script for creating sniper situations.
At ranges beyond 500-600
I was mainly addressing "how do I keep the script error box from vanishing"
Just check the RPT file in those cases https://community.bistudio.com/wiki/Crash_Files#Arma_3
Yeah I know @blissful phoenix thank you.
I often forget I have RPT's on my local machine.
also with snipers things aimedAtTarget < will helps
So use to parsing server RPT's
aimedAtTarget?
Oh, nice.
Is there a line of sight check I can use?
yep
Just to make sure they are not shooting through walls?
afaik no
lineIntersects
if it doesn't intersect anything besides shooter and target. Then there is nothing inbetween
That something on the wiki?
I know, I was asking if it was a function, or a method of doing it.
I found it, thank you.
@winter rose thanks for clearing the subtype thing up, that really through me off.
_sniper doWatch _target;
waitUntil {_sniper aimedAtTarget [_target] >= 0.75};
_sniper doTarget _target;
``` something like this ^ maybe
Yeah
That works.
My goal is to have a set of "situation" scripts
which can be deadly, or ambeint.
deadly being it will likely kill you, and ambeint meaning, it can kill you, if you are just dumb.
Like, the mortar script, fires in a spread.
has a toggle for deadly (no safe inner radious) and non-deadly (safe inner radious)
The sniper script will be, he will shoot YOU, he will shoot AT you.
there is no arguments or effects, is this going to work in MP? like the text will apears to eveyone?
arguments and effects for BIS_fnc_dynamicText are local
thanks
btw with "aiming" check...
hint str ([objNull, "VIEW"] checkVisibility [eyePos player, aimPos target]);
```no smoke https://gyazo.com/f1a14e7cb0e8c36e825837d562b1c464
with smoke https://gyazo.com/ef5ea203ce65a41d7ed97dfb495ac42a
seems like works and its accurate
Is there a script to add action a action when you have a item on your inventory? like the UAV one?
["CALLING ORMP_fnc_sniperFire"] call ORMP_fnc_log;
params [["_sniper", objNull, [objNull]], ["_targets", grpNull, [grpNull]], ["_danger", false, [false]]];
// stop, and reveal the target.
doStop _sniper;
_sniper reveal selectRandom units _targets;
// Set danger level
if (_danger) then {
["DEADLY ENABLED -- "] call ORMP_fnc_log;
_sniper setSkill ["aimingShake", 0.8];
_sniper setSkill ["aimingAccuracy", 0.8];
} else {
["DEADLY DISABLED -- "] call ORMP_fnc_log;
_sniper setSkill ["aimingShake", 0.7];
_sniper setSkill ["aimingAccuracy", 0.3];
};
// Fire on target.
while {[_targets] call ORMP_fnc_numberAliveInGroup > 0} do {
private _targ = selectRandom units _targets; // select rand victim in group
_sniper doTarget _targ;
sleep 2;
_sniper doFire _targ;
sleep 60; // wait between shots (prevent shot spam)
};```