#arma3_scripting

1 messages · Page 443 of 1

still forum
#

Do you have ACE?

wary vine
#

nope xD

unborn ether
#

There is a specific animations with and w/o the holding a weapon

#

They usually come with Wnon

still forum
#

ACE has a ACE_NoWeapon gun. Maybe giving him that gun might help

wary vine
#

ill give it a go.

radiant needle
#

how do I remove grenades from AI?

#

Or not remove them, but rather make them not use it?

winter rose
radiant needle
#

Won't that remove the actual item itself?

#

Wait is throw like an actual weapon?

#

Can I just removeWeapon "Throw"

winter rose
#

not sure you can removeWeapon throw; you would have to test it

radiant needle
#

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

radiant needle
#

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

radiant needle
#

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

wary vine
still forum
#

No idea what that list is. But yeah you can remove options from lists

wary vine
#

the editor

#

select map

still forum
#

Ouh... That could potentially be hardcoded

wary vine
#

was trying it with a pbo

still forum
#

which UI control is that?

#

or Display

wary vine
#

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 ?

still forum
#

edit the map's pbo and remove it from there

wary vine
#

its obfuscated

still forum
#

if he bought it he should have the rights to it shouldn't he?

#

Oh well...

#

¯_(ツ)_/¯

wary vine
#

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)

tough abyss
#

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?

unborn ether
#

@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)

wary vine
#

yeah

#

whats the display for that one @unborn ether

unborn ether
#

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";
};
still forum
#

@wary vine You copy the map class by inheriting from it? And you then want to edit it?

warm gorge
#
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.

still forum
#

do it scheduled

#

or better. Do it once at preInit and store the result

warm gorge
#

Alright cheers, ill probably just do the preInit option

fleet wind
#

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...

still forum
#

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

?

fleet wind
#

Yes thats what i mean thanks 😉

wary vine
#

@still forum I got the class copied and edited, but was just trying to remove the original from the map list xD

still forum
#

what do you mean by "copied"?

wary vine
#

Inheritence.

still forum
#

Why?

#

Just edit the original

#

instead of creating a copy

wary vine
#

how can I edit it ?

still forum
#

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

wary vine
#

ahh ty ❤

#

it didnt overwrite the title/image

unborn ether
#

@still forum So just got that you can suspend the whole VM by putting some waitUntil in postInit function?

still forum
#

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

peak plover
#

😂 😂 😂 <- This is literally me when The loading screen never ends

#

Btw does intercept fix sqf performance already?

still forum
#

the optimizer is not default enabled if you mean that 😄

steady terrace
#

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
still forum
#

looks like a beginner script..

#

I don't know why missing ; but _color is undefined

winter rose
#

use private "_color"; above your if choice == stuff

still forum
#
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
winter rose
#

I would have used a switch do for readability

#

@steady terrace ^

steady terrace
#

very much a beginner script haha

#

@still forum that's hella cool! thanks, I'll try it out

steady terrace
#

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

still forum
#

hm.. I don't see the error

winter rose
#

_color = (_kleuren select 1) SELECT param [(_kleuren select 0) find (toLower _choice), 0]; maybe

steady terrace
#

I'll try that, arma really doesn't like alt tabbing..

#

@still forum maybe I scrwed something up, I'll copy it again

still forum
#

@winter rose are you trolling?

#

Run fullscreen window. No problem with alt tabbing anymore

winter rose
#

@still forum no, but I might be tired

still forum
#

yes

winter rose
#

why not select? you have [colorArray] param [number, 0] isn't it incorrect? not using param often

#

oh yes, alt syntax: index, default value

still forum
#

no

#

param does the same as select

winter rose
#

^ noticed

steady terrace
#

nope, still getting generic error

still forum
#

no you are not

#

Every error is a generic error. 99.9 errors also show exactly what the problem is

steady terrace
#
'... find (toLower _choice), 0];
if (_color == 0) exitWith {hint "failure!" };
hint ...'
Error Generic error in expression
File [filepath]
line 13
still forum
#

could you maybe just copy-paste it from RPT?

thorn saffron
#

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.

still forum
#

yes

#

I recently wrote that down somewhere. I'll search

little eagle
#

GravityConstant is 9.8066
In Arma Gravity constant is 9.81
Nope it's not.

I really really love this conversation!

thorn saffron
#

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.

little eagle
#

What do you want to do with that anyway, Taro?

thorn saffron
#

Dicking around in unreal, made my own ballistics system with penetrations, bounces and such, just for giggles.

still forum
#

Why don't you use real life math then?

#

Why try to adapt the non-real arma maths?

thorn saffron
#

All the equation and calculations I was able to found for calculating the angle of reach do NOT include drag into them.

little eagle
#

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. :/

still forum
#

Muuch much quicker than your catenary 😄

little eagle
#

C++ looks exactly like SQF man.

little eagle
#

calculateVanillaZero is all one needs.

thorn saffron
#

@still forum No angle of reach.

still forum
#

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

thorn saffron
#

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

still forum
#

no

#

the drag doesn't change

little eagle
thorn saffron
#

also I didn't do any physics for like 15 year now, I completely forgot everything on that

still forum
#

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

thorn saffron
#

wait, so the drag is always the same regardless of bullet speed?

still forum
#

yes

thorn saffron
#

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

little eagle
#

tf am I on iqnu list or what? The formula you want was posted twice already.

thorn saffron
#

inside a 700 lines of other code, I just haven't found it yet 😄

little eagle
#

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.

wary vine
#
 if ((_type != "deposit") && (_type != "withdraw") && (_toWho isEqualto "")) exitWith {} // its not withdraw or deposit, and a string wasnt sent with toWho ?
``` this should work right ?
thorn saffron
#

@little eagle Oh, thanks I didn't realize it was a line highlight

little eagle
#

This line misses ;, so no, it will not work.

wary vine
#

@little eagle >.<

little eagle
#

Also the description says not withdrawn or deposited, but the code says AND. Sounds fishy.

still forum
#

@little eagle Code checks !withdrawn && !deposit
means not withdrawn or deposited. Which is correct

#

aka not (withdrawn or deposited)

little eagle
#

Yeah, but what's the point of a comment if it only makes things more confusing.

still forum
#

Yeah the comment is just stupid

little eagle
#

its not withdraw or deposit
->
it's neither withdrawn nor deposited

wary vine
#

you got what I was on about xD

#
 if ((_type != ("deposit" || "withdraw")) && (_toWho isEqualto "")) exitWith {}
``` that wouldnt work would it ?
still forum
#

no

wary vine
#

balls

still forum
#

string or string
doesn't make sense

#

dogs or cats? Is that true?

#

no obviously it's false! duh

wary vine
#

what about "deposit" ** "withdraw"

#

&&

still forum
#

dogs and cats? Is that true?

#

neither dogs nor cats are neither true nor false

#

So that cannot possibly work

little eagle
#

Yes. Source: You still haven't disproven dialetheism.

still forum
little eagle
#

You should not be allowed in this channel unless you read the wikipedia article for De Morgan's law imho.

still forum
#

I prefer Darwins law

little eagle
#

Which is?

wary vine
#

im just trying to tidy things up

still forum
#

@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

little eagle
#
if (_type != "deposit" && _type != "withdraw" && _toWho isEqualto "") exitWith {};

->

if (!(_type == "deposit" || _type == "withdraw") && _toWho isEqualto "") exitWith {}

De Morgan's Law.

still forum
#

if _acePresent then call addAceActions
else call addVanillaActions

#

boom

wary vine
#

Yh @still forum i didnt think of doing it in an array xD

still forum
#

are you?

#

you aren't

little eagle
#

I know how to fix this, Whale:

if _acePresent then
{

->

if (_acePresent) then {
still forum
#

i ain't??*

little eagle
#

Good question. Probably yes for persons.

still forum
#

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?

little eagle
#

Think about it again.

still forum
#

Yeah. Make sure it it is perpendicular to the players forward vector

digital jacinth
#

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

still forum
#

or just attach it onto the weapon on back memory point

#

that should rotate with animations

little eagle
#

attachTo doesn't support that, Dedmen.

still forum
#

🙄

digital jacinth
#

so far the only rotation is with the direction the player is facing, thta twon't do sadly

still forum
#

use getWeaponDirection

little eagle
#

diwako, what you're trying to do has been attempted countless times before, and everyone has dropped the idea.

still forum
#

not sure what that's called

#

that will always point forward

#

also when player bows down in a animation

digital jacinth
#

well so far it works, just the animation is not working correct for the attached weapon

still forum
#

meaning like.. perpendicular to the players torso

little eagle
#

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.

still forum
#

you would have to adjust the weapon on backs vector like.. every frame

digital jacinth
#

only problem is that arma prioritizes full mags in the players loadout and not the one that was original in the gun

still forum
#

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

digital jacinth
#

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

still forum
#

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

digital jacinth
#

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];
little eagle
#

countless imes beforeee

digital jacinth
#

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

little eagle
#

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.

digital jacinth
#

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.

little eagle
#

It will look really bad, and people will find it distracting.

digital jacinth
#

true.

velvet merlin
#

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]`
little eagle
#

Pointless, lockTurret already has global effects.

velvet merlin
#

meh sa-matra told me to look into it. so its just lock that needs that treatment?

little eagle
#

No, lock too has global effects.

still forum
#

Atleast according to wiki

little eagle
#

Well, if there's something wrong with the wiki, then that is a separate issue.

still forum
#

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

little eagle
#

^

#

If the command has global effects, then it will be synched to JIP clients anyway. So JIP flags are a waste.

velvet merlin
#

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?

still forum
#

yes

#

execute it where the vehicle is local and you are golden

#

Which btw... Wiki already says

#

ArgLocal.

velvet merlin
#

so just drop the jip flag, and it should be alright, ok?

still forum
#

All that his comment says is "If you use this command incorrectly. it won't work as it's supposed to"

#

yes

little eagle
#

Sa-Matra's comment tl-dr:
undefined behavior when used on remote objects, basic error traps are too advanced for Arma

velvet merlin
#

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?

still forum
#

yes

velvet merlin
#

is vehicle id unique enough?

still forum
#

netID is I think

#

what is a "vehicle id" ?

little eagle
#

Probably what you get when you use str on a vehicle without vehicle var name.

still forum
#

That should be the vehicles address in memory

#

which is unique. Until the vehicle get's deleted. And different on every machine.

little eagle
#

I'd go with netId. At least that is proven to be unique on all machines.

still forum
#

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 :/

little eagle
#

What command would require the JIP flag anyway? Can't think of anything useful with local effects.

still forum
#

addAction 😄

little eagle
#

lol nice

hollow lantern
#

disable auto-brake when switching seats is that something that can be doen via scripting?

still forum
#

yeah... kinda

#

if you extremely quickly put a AI into the driver seat. It might be able to hold the break pedal up

hollow lantern
#

well without AI would be better. hmmm

little eagle
#

Then no.

still forum
#

:3

sand pivot
#

rgr. sry

still forum
#

I know that something is there that does that. And I know it's config

#

Not with scripting.

winter rose
#

Invisible AI exists, check AI UAV

still forum
#

Oh.. Never thought of that. That's a nice solution

dusky drift
#

sorry

winter rose
#

@dusky drift ?

dusky drift
#

was responding to Dedmen

little eagle
#

Sometimes you get people that copy paste their same one liner question to ~10 different channels.

hearty plover
#

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.

meager heart
#

diag_log not working for you ? 🤔

hearty plover
#

NOt to a file

#

I want to show it in game.

#

rpt logging is working.

meager heart
#

hint, systemchat ?

#

hint format ?

hearty plover
#

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

meager heart
#
if (!isServer) exitWith {}; //--- this

// Execution stops until the mission begins (past briefing), do not delete this line
systemChat "STARTING COUNTDOWN";
hearty plover
#

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.

meager heart
#

remoteExec ?

hearty plover
#

Oh, yeha.

#

I see I can also use side-chat as a alternative.

wary vine
meager heart
#

@hearty plover

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.

little eagle
#

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.

hearty plover
#

What about compiled code?

#

My logging is in my functions

#

defined in my own CfgFunctions

little eagle
#

All code is compiled before execution, no idea what that changes.

hearty plover
#

Okay, I didn't think it made a diffrence.

lost iris
little eagle
#

Well, how / when was your systemChat executed?

hearty plover
#

Can I pm you?

little eagle
#

Why not this channel?

hearty plover
#

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.

meager heart
hearty plover
#

side, and system are enabled.

little eagle
#

disableChannel has no influence over the chat commands like systemChat.

hearty plover
#

Thanks commy

#

This is the function, in which I am expecting to see a chat message.

#

my init sqf

little eagle
#

ORMP_fnc_log contains systemChat?

hearty plover
#

Yes

#

One sec, I will paste that as well

gleaming oyster
hearty plover
#
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.

little eagle
#

Well, you have to wait 260 seconds apparently.

hearty plover
#

I do.

#

Then the arty script fires.

#

I know it works, because the arty fires.

meager heart
little eagle
#

Did you check the RPT file and have showScriptErrors enabled?

hearty plover
#

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

little eagle
#

%LOCALAPPDATA%\Arma 3

meager heart
#

and you can just

"SCRIPT COUNTDOWN STARTED" remoteExec ["systemChat"];
little eagle
#

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.

hearty plover
#

NOBODY LUAGH

#

I need to re-think my mission naming convention.

#

I was editing the previous missions scripts.

little eagle
#

ok

hearty plover
#

One second.

little eagle
#

I assumed something stupid like

#include "Zen_FrameworkFunctions\Zen_InitHeader.sqf"

containing isServer exitWith or something like that

meager heart
#

^

#

or try hint 🤷

hearty plover
#

Nah, the Zen stuff is nice.

#

Guy did a good job with most of it.

little eagle
#

How would changing the command to log change anything? systemChat is proven and reliable, so changing to hint won't fix it any way.

meager heart
#

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 ^

karmic flax
#

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

naive estuary
#

Have you tried fire or doFire

#

That or [_unit, "weapon_Cannon_Phalanx"] call BIS_fnc_fire

karmic flax
#

BIS_fnc_fire worked

#

thanks man

still forum
#

@gleaming oyster you have your PR feedback 😉

radiant needle
#

Is there an easy way to convert "True" "False" strings into boolean?

peak plover
#

Yea

#

If ((toLower _string) isequalto 'true') then {_string = true}

radiant needle
#

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?

still forum
#

I don't see a if (_filter == "")

radiant needle
#

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?

still forum
#

no

#

_forEachIndex is the index

radiant needle
#

huh apparently the 8192 character limit was format and not copyToClipboard

still forum
#

both

#

no wait

#

format and diag_log.
Yeah. Not copyToClipboard

radiant needle
#

YEah I was gonna say I did a straight copyToClipBoard str and it let me copy over 200,000 characters

little eagle
#

diag_log is like 2000 chars, not 8192

still forum
#

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

little eagle
#

ok

radiant needle
#

Is there an easy way to let a user browse the full arsenal, but prevent them from actually taking anything?

little eagle
#

If you know scripting, sure why not.

radiant needle
#

Is there like a easy to use variable or arsenal creation parameter, or do I need to mess with eventhandlers and displays

still forum
#

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

radiant needle
#

Does BIS_fnc_save_inventory work for gear or is that literally just inventory

still forum
#

No Idea what that's supposed to be. It's not on wiki

#

getUnitLoadout/setUnitLoadout

radiant needle
#

BIS_fnc_saveInventory my bad

little eagle
#

Use what Dedmen posted instead.

radiant needle
#

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

little eagle
#

It won't if done correctly

radiant needle
#

Also what is the event handler that triggers if arsenal is opened?

little eagle
#

ArsenalOpened

still forum
#

BIS_fnc_addScriptedEventhandler I think

radiant needle
#

yep see it

#

Wait what namespace would I use?

little eagle
#

missionNamespace

radiant needle
#

What are the chances this works for ace arsenal?

little eagle
#

0

radiant needle
#

ah apparently for ACE it's ["ace_arsenal_displayClosed", {}] call CBA_fnc_addEventHandler;

#

So would 0 % 2 == 0 be true or false?

little eagle
#

tf is this a quiz now?

#

0/2 is 0 rest 0, and 0 is 0, so it would be true.

radiant needle
#

So does that make 0 and even number?

little eagle
#

Yes, 0 is an even number.

radiant needle
#

I guess that makes sense

#

just never actually thought about it

little eagle
#

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. 🤔

radiant needle
#

Am I misinterpreting this array?

#

BIS_fnc_garage_data one

#

This is my code

#

type array expected string on the gettext line

tough abyss
#

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.

little eagle
#

But every positive number has a negative counterpart, so they eliminate each other. Only 0 is left, and that one is even.

radiant needle
#

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

little eagle
#

You can't. Those are model paths and different classes may use the same model.

still forum
#

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?

radiant needle
#

This is organized though

little eagle
#

Probably can't retrieve classnames from bis_fnc_garage_data on pricniple.

still forum
#

Already told you that not all vehicles are in bis_fnc_garage_data. And what does "organzied" mean?

radiant needle
#

Like it's seperated neatly into catageories

#

armor, fixed wing, cars, helicopters

little eagle
#

What for?

still forum
#

then take the code that categorizes it and use it. Bam. You suddenly have same categorization

radiant needle
#

What is the code that categorizes it?

little eagle
#

What for?

radiant needle
#

For a menu

little eagle
#

Why not get the list of all those from CfgVehicles. Where does the arsenal come into this?

radiant needle
#

Will the list from CfgVehicles be organized into categories?

little eagle
#

Not by default.

radiant needle
#

Garage data select 0 is cars, select 1 is tracked, select 2 is rotary wing, etc

little eagle
#

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

radiant needle
#

I don't do config stuff, no need to be an ass about it

little eagle
#

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.

still forum
#

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"

little eagle
#

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

radiant needle
#

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

little eagle
#

You figured wrong then. Because:

Those are model paths and different classes may use the same model.

still forum
#

You think you know better than two guys that have been scripting for several years and know how almost everything works?

radiant needle
#

I don't know what you know

#

There isnt a little tag that says "Scripter for 'x' years"

still forum
#

Blue name 😉

little eagle
#

Blue name -__-

still forum
#

Commy also has a blue name. theoretically

little eagle
#

Mods couldn't handle the truth.

still forum
#

But now you know 😉

radiant needle
#

I mean I've also been scripting for several years, I just get hung up on little things

#

like config stuff

still forum
#

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

radiant needle
#

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"

still forum
#

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

scarlet spoke
#

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? 🤔

little eagle
#

idc syntax of control commands uses the currently active display, but the control syntax could report / influence non active displays.

still forum
#

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

little eagle
#

lnbSize <idc>
is alias for
lnbSize (<active display> displayCtrl <idc>)
though, Dedmen.

still forum
#

Oh yeah.

#

Overlooked the second implementation.

#

That's not listed though on wiki is it?

scarlet spoke
#

Do all control commands have this feature?

still forum
#

Most of them yeah

scarlet spoke
#

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 😃

still forum
#

I already notified the Wiki magician

#

I guess I should feel bad for not doing it myself and instead delegating work to others...

scarlet spoke
#

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?

still forum
#

it would contain that yeah

scarlet spoke
#

Alright then let me dig through that...
@winter rose I'll do it

scarlet spoke
#

Does this also work with Displays?

still forum
#

according to intercept.. no

#

only two variants

scarlet spoke
#

Okay thx

still forum
#

@winter rose probably likes getting spammed with notifications

scarlet spoke
#

Yeah sure ^^

radiant needle
#

I wonder if notepad++ would actually let me do that?

#

Replace All in files when main windows directory is selected

winter rose
#

_ @winter rose says hi_

ivory nova
#

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

little eagle
#

Roundley, I cannot see a single reason why this would create any marker.

ivory nova
#

Interesting (:

#

Is my question poorly worded? Need to add more detail?

little eagle
#

Like, there is no createMarker(Local).

radiant needle
#

Do you have the rest of the script?

ivory nova
#

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

radiant needle
#

Just pastebin it or something

#

Are you trying to make markers evenely spaced in a row or something?

ivory nova
#

Alrighty

#

Yeah, I am

little eagle
#

My guess is that the marker names are not unqiue.

radiant needle
#

[((_Pos select 0)+(sin _Direction*(_Spacing*_i))),((_Pos select 1)+(cos _Direction*(_Spacing*_i))),0];

ivory nova
radiant needle
#

This will probably help you

#

Thats what I use when I need things in straight lines

ivory nova
#

Thank you! I'll see what I can do with this

#

Hoping to create a grid

little eagle
#
private _yN = _y0 - _offsetY;
 
 for [{_yN}, {_yN <= _y1}, {_yN = _yN + _secY}] do {
#

These two lines. It looks like the two variables conflict.

ivory nova
#

Hm

radiant needle
#

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

little eagle
#

```sqf

```

radiant needle
#
(_XCord + (sin (_Direction*_Spacing)),(_XCord + (cos (_Direction*_Spacing))]
little eagle
#

No space.

radiant needle
#

(_XCord + (sin (_Direction*_Spacing)),(_XCord + (cos (_Direction*_Spacing))]

little eagle
#

missing sqf for highlighting.

radiant needle
#
(_XCord + (sin (_Direction*_Spacing)),(_XCord + (cos (_Direction*_Spacing))]
ivory nova
#

@radiant needle Thanks! So presumably direction up would be 0, East 90, etc?

radiant needle
#

yeah

ivory nova
#

Thank you, will try that now

radiant needle
#

Then you put this in a for loop or something

little eagle
#

I don't think you problem is with the math. It's with how you use the control structures, Roundlay.

ivory nova
#

Yep, I wouldn't deny it

#

New to scripting ):

little eagle
#

I would avoid that for syntax.
for "_i" from a to b do {
is just better...

ivory nova
#

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

little eagle
#

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.

ivory nova
#

Hm, I see

little eagle
#

Maybe use a while loop instead.

ivory nova
#

So instead, I should increment on the the prev. defined variable in the for _ from _ do part?

little eagle
#

My text editor froze. :/

ivory nova
#

E.g. for "_i" from _predefined to _max do

radiant needle
#

If you use the formula I gave you, you have to start from 0

little eagle
#
while {
    _yN <= _y1
} do {
    // stuff

    _yN = _yN + _secY;
};
ivory nova
#

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 😃

fast python
#

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

ivory nova
#

Assuming I'm not retarded into the future, are any of these ideal perf. wise?

still forum
#

you don't create hundreds of marker every couple seconds do you?

radiant needle
#
for "_I" from 0 to 100 step 1
#

will for instance create a 1km line of markers if your spacing is 10m

little eagle
#

As for loops:
forEach/select/apply > for > while > for ARRAY
I'd say.

radiant needle
#

remember to multiple spacing by the index as well

#

or _i

ivory nova
#

@still forum No, just want to get positions for future use, one and done

#

I see, thanks!

radiant needle
#

or from 1 to 100 I should say

still forum
#

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.

radiant needle
#

Very few one and done things can lag out a mission

ivory nova
#

I see (: Just out of curiosity really

little eagle
#

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.

radiant needle
#

nearestObjects cough cough

#

Lol @ calling boats ships

#

Nice try BI'

#

We know you ain't got no ships

little eagle
#

Drones aren't helicopters either.

#

Quads are no cars.

radiant needle
#

Wait do the drones show up under helicopters?

#

Or just the quadcopts

little eagle
#

Depends on the type of drone.

radiant needle
#

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

little eagle
#

PhysX will be dropped in the next version and that is a good thing.

radiant needle
#

Are they replacing it with an in-house physics library?

#

Or still 3rd party?

little eagle
#

Probably in house.

#

Dedmen is typing 🍿

still forum
#

I heard Bullet. Which is not in house

little eagle
#

Everyone get's the Bullet.

radiant needle
#

I wonder if we'll get their full soft body suite

#

Imagine Arma with full soft and rigid body simulation?

little eagle
#

What for? Sounds like a waste.

ornate quail
#

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?

still forum
#

yes that's because of attachTo.

ornate quail
#

meh

#

Is there another way to do it?

little eagle
#

Doubt it.

radiant needle
#

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

ornate quail
#

Alright, gonna try that. Thanks

radiant needle
#

Now the fun part

#

I get to go through 7865 classnames and set prices

#

THank god for excel and CONCATENATE

ivory nova
#

'three ' ' fitty'

radiant needle
#

uh uh

ivory nova
#

No luck on the loop variations just yet, but gave me other options to work through, thanks! (:

radiant needle
#

the for loop didnt work for you

#

?

ivory nova
#

It didn't ): Still just the one marker

#

The array does increment though

little eagle
#

Did you ever post RND_fnc_getMarker ?

ivory nova
#

Piped it to system chat and can see it updating

#

I switched to normal createMarker and same deal unfortunately

radiant needle
#

so the issue is probably somewhere with your actual functio

ivory nova
#

Mm

radiant needle
#

Are you using same marker name for every iteration?

ivory nova
#

I'm using _markerName = str _secArr;

#

But that could be the issue yeah

#

toString also didn't work

#

also had the same effect*

radiant needle
#

try something like format["marker_%1_%2"._direction,_i];

#
format["marker%1%2"._direction,_i];
#

I wish I could type today

little eagle
#

Put some separator between the two numbers, to avoid collisions.

radiant needle
#

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];
little eagle
#
format ["my_marker_%1:%2", _xN, _yN];

🤔

ivory nova
#

Now that is a classy idea

little eagle
#

You have periods not commas in all of these, Drew.

radiant needle
#
format["marker_%1_%2",_direction,_i];
#

I switched to cherry mx red keyboard

#

I cant feel when I press the keys half the time

little eagle
#

I code with speech to text..

ivory nova
#

Can you select the last array index like in Python? Like, array select -1?

radiant needle
#

yeah, just do _i - 1

ivory nova
#

Figure if the array is updating I could just pushback and select the last index

radiant needle
#

Oh wait, what are you trying to do?

ivory nova
#

Basically trying to split mission area up in to n sectors to use for patrols, whatever else

errant jasper
#

"Figure if the array is updating I could just pushback and select the last index" - pushBack gives you the inserted index.

ivory nova
#

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

little eagle
#

Learn SQF: Abandon Logic

ivory nova
#

lmao

errant jasper
radiant needle
#

Who wants to play a game of find the missing )

ivory nova
#

@errant jasper Thank you! I'll try this now

radiant needle
#
_MarkerPos = ((_Position select 0) + (sin (_Dir*_Spacing)),((_Position select 1) + (cos (_Dir*_Spacing))];
ivory nova
#

sin?

errant jasper
#

Is missing a different char

little eagle
#

I see too many parenthesis.

errant jasper
#

Also that ^^^

radiant needle
#

Im also missing a [

#

that might be the issue

still forum
#

and a ) at the before the ]

#

actually.. No

#

remove the ( after the last ,

radiant needle
#
_MarkerPos = [(_Position select 0) + (sin (_Dir*_Spacing)),(_Position select 1) + (cos (_Dir*_Spacing))];
little eagle
#
_MarkerPos = [(_Position select 0) + sin (_Dir*_Spacing), (_Position select 1) + cos (_Dir*_Spacing)];

btw., what's up with capitalizing the variable names?

radiant needle
#

#Style

errant jasper
#

private _var = (((((not (a (lisp nil)))))))

little eagle
#

ugly af

still forum
#

Arma uses camelCase. already. Pressing your different style into that makes it kinda ugly

radiant needle
#

I mean if I type a two word single word I use camelCase

little eagle
#

two word single word

radiant needle
#

like camelCase

#

its two words

#

but still one word

still forum
#

But... MarkerPos is two words in one string.
But you use CamelCase there not camelCase

little eagle
#

deflated_brain.jpg

radiant needle
#

iTcOuLdBeWoRsEtHoUgH

little eagle
#

_itCouldBe_worse

radiant needle
#

how do you camelCase a three word word

errant jasper
#

I propose new style. We make all letters uppercase except the last. so MYVARIABLe

still forum
#

camelCaseIsAWord

little eagle
#

_snakeOilSalesman

still forum
#

cookieDoughIsTastyStuffAndHelloTuiderru

little eagle
#

"Four word words" are verboten though.

radiant needle
#

But then we could dromedary case them

little eagle
#

🤦🏻

modest temple
#

is this how to teleport player to random marker?
player setPos (getPos selectRandom marker1, marker2)

still forum
#

almost

little eagle
#

close

still forum
#

look at the examples

#

also markers are strings. and you have to use getMarkerPos

modest temple
#

player setPos (getPos selectRandom [marker1, marker2])

little eagle
#

You need getMarkerPos, not getPos for markers, because there was a time and people that thought everything needs a new command name.

modest temple
#

player setPos (getMarkerPos selectRandom [marker1, marker2])

little eagle
#

close, but markers are referenced as strings.

modest temple
#

i dont know what that means

still forum
#

look at examples

#

notice "MarkerOne" is different than your marker1

little eagle
#

i dont know what that means

marker1
->
"marker1"

modest temple
#

so i have to set it somewhere?

#

"Marker1" setMarkerPos [200,100];
_pos = getMarkerPos "Marker1";
player setPos (getMarkerPos selectRandom [marker1, marker2])?

still forum
#

humans (╯°□°)╯︵ ┻━┻

modest temple
#

i just read what i wrote...

little eagle
#

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;

🤔

modest temple
#

what about the randomness?

still forum
#

player setPos (getMarkerPos selectRandom ["marker1", "marker2"])
There. Now go.

little eagle
#

There's only one marker in your example.

still forum
#

He copied that from biki

modest temple
#

ah i just needed "" ?

little eagle
#

marker1
->
"marker1"

modest temple
#

im an idiot 😄

#

thanks a lot

radiant needle
#

Are you looking to teleport to a random marker or a random place in general?

still forum
#

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

little eagle
#

Dedmen, we ARE random guys on the internet.

#

We may not even be real irl.

modest temple
#

look, i havent slept in past 30h because of exams, im a bit slow

radiant needle
#

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;
        };
little eagle
#
switch (true) do {
    case cond1: {
    };
};
radiant needle
#

oh yeah derp

little eagle
#

Also, what's the point of using switch, when you check the same condition twice?

radiant needle
#

I actually have 4

#

every 20 turns it adds 90 degrees to the dir

still forum
#

if turn % 20 == 0

little eagle
#
switch (true) do {
case (_i <= 20): {
    _Dir = _Dir;
};
case (_i <= 40): {
    _Dir = _Dir + 90;
};
};
radiant needle
#

It won't evaluate that second case?

little eagle
#

No.

#

Only if >20 and <= 40

radiant needle
#

I just realized

little eagle
#

Otherwise the switch would be pointless and you could just write some if then's.

radiant needle
#

I can just check == 20

#

🤦

little eagle
#

Alt:

_dir = _dir + 90 * floor (_i / 20);
radiant needle
#

I made a square

#

Wonder if there are any other things I can make with straight lines and right angles

little eagle
#

Now you're doing again weird stuff with switch.

radiant needle
#

Yeah I was just testing my math

little eagle
#
switch (_i) do {
    case 0: {
    };
    case 20: {
    };
    case 40: {
    };
    case 60: {
    };
};
radiant needle
#

Wow this looks cool

little eagle
#

Now do it so all points have the same distance and are still on this spiral.

radiant needle
#

If you do same spacing you get a circle

ivory nova
#

Woah, that's cool

little eagle
#

: If you do same spacing you get a circle
No.

radiant needle
#

yes senor

#

the math says yes

#

This will give you a circle

little eagle
#

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.

radiant needle
#

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

little eagle
#

But that's where it get's fun.

radiant needle
#

if you add a multiplier to _i you can change the tightness of the spiral

little eagle
#

But, you should check out the newish getPos syntax.
position = origin getPos [distance, heading];

radiant needle
#

Yeah that'd probably be a lot easier

little eagle
#

Also getRelPos for objects.

radiant needle
#

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

ivory nova
#

Saved, thanks man (:

radiant needle
#

That 8 should be _Sides though

#

on line 8

#

will 0001 get truncated to 1?

#

Heres another version with custimizable density

little eagle
#

Yeah, 0001 is the same as 1.

radiant needle
#

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

ivory nova
#

snake build on A3MapOS when

#

So if I can't call more than one marker anywhere, is that a reinstall kind of issue?

radiant needle
#

?

winter rose
#

@ivory nova , it makes no sense at all

ivory nova
#

I'm unable to create more than one marker

#

(that is visible on map)

#

Strange

winter rose
#

most likely a script error. pastebin?

ivory nova
#

It's for any instance of createMarker, etc

#

Includes shape and type

winter rose
#

you need to setMarkerSize after createMarker

still forum
#

make sure to have different names

ivory nova
#

Hm, tried that D: I'll take it to troubleshooting though 👌🏻

winter rose
#

@ivory nova : p.a.s.t.e.b.i.n

ivory nova
#

Was in reference to a pastebin I posted earlier, but the issue is unrelated to a specific script

sand pivot
#

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?

lone glade
#

you're not using the right command

#

getText (configFile >> "cfgWeapons" >> "HMG_127_UGV" >> "displayName")

sand pivot
#

you da man, thanks

radiant needle
#

The script I gave you is working 100% for me

ivory nova
#

Definitely not on your end my dude (:

radiant needle
#

Do you have any map marking mods installed?

ivory nova
#

Vanilla

#

Reinstalling now, no idea what was up with that, will play around a bit

radiant needle
#

Does 1.145 mean anything to you guys?

#

Like in a mathematical sense?

ivory nova
#

The number of markers Roundlay can spawn

radiant needle
#

Holy crap

ivory nova
#

@radiant needle Clue?

radiant needle
#

360 / 314.59 = 1.145

#

I just mathed

#

I just mathed all over the place

ivory nova
#

Do you want ants? Because this is how you get ants

fringe torrent
#

any one have a good way to convert XYZ data into VEctors ?

tame portal
#

@radiant needle Stop mathing on the floor

still forum
#

XYZ data into vectors?

#

[X,Y,Z] is a vector. 😕 🤔

slim oyster
#

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?

tough abyss
#

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.]).

winter rose
#

@tough abyss I don't think you can. Why would you want to do that?

slim oyster
winter rose
#

oh, well ^^

tough abyss
#

👍

#

Thanks @slim oyster.

slim oyster
winter rose
#

I'm still curious about the why, though

tough abyss
#

@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];
winter rose
slim oyster
#

_x will be the varname of the object if it has a variable name in the foreach block

gleaming oyster
#

thank you kind sir Dedmen for the comments on that PR

tough abyss
#

@slim oyster - would it now? I never noticed that.

#

Wow that's...

#

Thanks!

still forum
#

@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?

austere granite
#

correct

#

useful because then you can do something like [1, nil, 3] if you want values in the middle to be default

still forum
#

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 😄

modest temple
#
//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?

still forum
#

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?

modest temple
#

thats just bad copy pasting

#

im trying to make a timer, wich when time runs out kills the player

still forum
#

I can't help you much if you can't show me your code cuz "bad copy pasting"

modest temple
#
//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

still forum
#

Please do
```sqf
```
and you'll see your mistake

modest temple
#

what?

blissful phoenix
#

If you add sqf after the top backticks it will do syntax highlighting

still forum
#

And syntax highlighting will show you what's wrong

blissful phoenix
modest temple
#

i might just be dumn but im not seeing it

meager heart
#

😔

still forum
#

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

modest temple
#

wich means?

peak plover
#

It all becomes a string at one point

still forum
#

your error is where the blue/greenish text starts

peak plover
#

It's one long string

modest temple
#

"time.sqf];

#

so its the "?

ruby breach
modest temple
#

it works now, thanks 😄

#

see im learning... now i know what string is

#

before i learn we will have moved on to enfusion tho

fast python
#

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?

fleet wind
#

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"

still forum
#

sure it is

#

it executes condition till it's true. Then executes the do code

fleet wind
#

Thanks ill play around with it for a bit then

fleet wind
#

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?

still forum
#

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

fleet wind
#

Thanks

astral tendon
#
["<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?

meager heart
#

yes

astral tendon
#

But what are the font availables?

meager heart
#

hmm

still forum
#

See config viewer CfgFonts

meager heart
astral tendon
#
["<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?

winter rose
#

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 😉

astral tendon
#

I mean, does diferent resolutions may trow the text off the screen?

meager heart
#

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>"
astral tendon
#

safeZone ?

meager heart
hearty plover
#

how to use params with type group

#

objNull dont work

robust hollow
#

grpNull

hearty plover
#

What about for the default value

#

["_grp", grpNull, [grpNull]]

#

Like so?

robust hollow
#

the default value can be anything. if you want it to be a null group then yea that will work

hearty plover
#

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?

still forum
#

Error reveal, type group, expected object. Only unit.

#

only unit

blissful phoenix
#

You should be able to see the error in your RPT file if you want to look it up.

still forum
#

He already posted his error ^^

hearty plover
#

Here it says Object can be a group of units.

still forum
#

a group of units is a group of objects

hearty plover
#

Not unsimilar to an array?

still forum
#

I don't see where it says that

hearty plover
still forum
#

you could say a group is a very specialized form of a array of objects

hearty plover
#

Talking about object sub types

#

Makes sense.

still forum
#

That says Unit(s) plural are a group

winter rose
still forum
#

Right above it says Units are an Array of type unit

meager heart
#

you can do leader _group if there is only 1 unit, Jay

still forum
#

Units are an array of units. An array of objects. Not an object

winter rose
#

you can ignore the "subtypes" part

hearty plover
#

That should fix it.

#

I was thinking of just iterating over the gorup members.

still forum
#

forEach units _group
That's also what i do on my reveal code I think

hearty plover
#

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

blissful phoenix
hearty plover
#

Yeah I know @blissful phoenix thank you.

#

I often forget I have RPT's on my local machine.

meager heart
#

also with snipers things aimedAtTarget < will helps

hearty plover
#

So use to parsing server RPT's

#

aimedAtTarget?

#

Oh, nice.

#

Is there a line of sight check I can use?

meager heart
#

yep

hearty plover
#

Just to make sure they are not shooting through walls?

meager heart
#

afaik no

still forum
#

lineIntersects

#

if it doesn't intersect anything besides shooter and target. Then there is nothing inbetween

hearty plover
#

That something on the wiki?

still forum
#

Yes

#

Every command is on the wiki (every command that people use)

hearty plover
#

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.

meager heart
#
_sniper doWatch _target; 
waitUntil {_sniper aimedAtTarget [_target] >= 0.75}; 
_sniper doTarget _target; 
``` something like this ^ maybe
hearty plover
#

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.

astral tendon
#

there is no arguments or effects, is this going to work in MP? like the text will apears to eveyone?

meager heart
#

arguments and effects for BIS_fnc_dynamicText are local

astral tendon
#

thanks

meager heart
#

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

astral tendon
#

Is there a script to add action a action when you have a item on your inventory? like the UAV one?

hearty plover
#
["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)
};```