#arma3_scripting

1 messages · Page 511 of 1

tough abyss
#

@minor lance you can get display of the top dialog and create display on it with your dialog

#

@novel trellis you can have mod with sounds and reference them in mission config, not sure why you have a problem

novel trellis
#

okay thankyou for confirming, i will double check everything

peak plover
#

you can avoid all of that by playing alone @tough abyss

west venture
#

No cross-posting, @lament grotto
#rules

rancid pecan
#

hi everone

#

i have a problem

#
Error in expression <dAction['Rob Shop',life_fnc_robShops];
>
  Error position: <
>
  Error Invalid number in expression
File core\harita\fn_robShops.sqf [life_fnc_robShops], line 35
peak plover
#

Looks like an error

keen tusk
#

Chech the 35th line of fn_robshops.sqf

#

Your solution is there

cursive whale
#

can anybody tell me if spawn-ed code shares local variable scope in the same way that call-ed code does? i.e. is there any need/point to declaring vars as private within a spawned routine?

robust hollow
#

no it does not share from unscheduled into scheduled scopes, but does share from scheduled to child unscheduled scopes (obviously).

[] call {
    private _a = 0;
    [] spawn {
        systemchat format["%1",_a]; // "any"
    };
};

[] spawn {
    private _a = 0;
    [] call {
        systemchat format["%1",_a]; // "0"
    };
};```

Not really sure if its worth doing in a fresh spawn scope but I still do as good practice.
cursive whale
#

Thanks, appreciate it.

still forum
#

spawn creates a new script instances

#

Which is completely seperate. Local variable lookup looks in parent scopes. The new script instance doesn't have any parent scopes because it's seperated. Thus local vars don't carry over

#

systemchat format["%1",_a]; // "any" That is script error. Scheduled errors on undefined variable

robust hollow
#

still prints any though. was just showing that it was nil.

rancid pecan
#

@peak plover @keen tusk i don't know solution i don't understand problem

robust hollow
#

the line in that error doesnt even exist in the file you linked after it, are you sure its the right file?

rancid pecan
#

@robust hollow yes i am sure

robust hollow
#

well good luck then 👍

peak plover
#

@rancid pecan Right now it's impossible to find the solution

#

The code is in an obscure language. SQF is written in English

robust hollow
fleet hazel
#

Guys, I have a problem. I call the code and when the character moves I have the output of the code, but it should not be.

#

for "_i" from 0 to _time step 1 do {
hint format ["Passed %1 of %2",_i,_time];
_pos = getPosATL player;
if (speed player > 24 OR {player distance _pos > 20} OR {!alive player} OR {vehicle player != player}) exitWith {hint "Capture aborted"; _exit = true;};
sleep 1;
};

robust hollow
#

not sure what ur saying there but just going to point a couple of things out:

... from 0 to _time step 1 ...
no need to write step 1, it is the default.

    _pos = getPosATL player; 
    if (speed player > 24 OR {player distance _pos > 20} ...

player distance _pos will most likely never be greater than 20 because you're setting _pos then checking it immediately.

#

i assume you mean to have something like this so it exits when the player gets too far away from where he started the action

private _pos = getPosATL player; 
for "_i" from 0 to _time do {
    hint format ["Passed %1 of %2",_i,_time];
    if (speed player > 24 OR {player distance _pos > 20} OR {!alive player} OR {vehicle player != player}) exitWith {hint "Capture aborted"; _exit =    true;};
    sleep 1;
};
fleet hazel
#

@robust hollow hmm, now check

tough abyss
#

I doubt player on foot can move faster than 24 km/h, what is this check supposed to achieve?

fleet hazel
#

@tough abyss the sprint reaches 25

#

@robust hollow this work. thn

copper raven
#

description.sqf > description.ext

peak plover
#

@fleet hazel check your speed when running sideways, I remember it being only forward and backward

#

ex. Hold W and D

fleet hazel
#

@peak plover Ok

still forum
#

No you aren't

#

description is not a sqf file

wild flint
#

I'm attempting to script a dynamic point for a mission, using bis_fnc_findSafePos, however when I use this

    
    _gate = "sga_gate_orbital" createVehicle getPos _posGate;```

I get the following error:

``` 8:59:43   Error position: <getPos _posGate;>
 8:59:43   Error getpos: Type Array, expected Object,Location
 8:59:43 File C:\Users\Lynn\Documents\Arma 3 - Other Profiles\Kinch\mpmissions\co_x_tauri_adventures.Altis\test.sqf, line 25```

I'm unsure  of why `getPos` isn't accepting the array input, any suggestions?
still forum
#

also findSafePos already returns a position. Trying to get the position of a position doesn't make much sense

wild flint
#

Oh... okay that makes sense, thank you

brave jungle
calm pond
#

have a look at their wiki

brave jungle
#

Yeah i just thought to do that also, saw there is an array 😛

#

<STRING, ARRAY>

#

Cheers 😃

calm pond
#

np bud

brave jungle
#

so it would be something like: ["Main Title", "Tool TIP Text"]?

calm pond
#

yes

brave jungle
#

Awesome

calm pond
#
[
    setting var name,
    "CHECKBOX",
    [setting name, settingdescription],
    [setting menu name, sub category name],
    true, // Default value
    true, // _isGlobal    
    {
        params ["_value"];
        _script;
    }
] call CBA_Settings_fnc_init;

example for a checkbox

#

i usually like to use ace for examples when using cba function as sometimes i find cba wiki doesn;t do the best job at explaining things

modest temple
#
_this globalChat "I haven't seen anything, dont bother me"

_this globalChat "sorry, i don't think i can help you"

_this globalChat "sorry, i don't think i can help you"

i want the script to pick one of these (or other lines i will add) randomly every time it's run

#

how do i do that?

copper raven
calm pond
#

systemChat (selectRandom ["1","2","3"]);

modest temple
#

how do i set which is 1,2 ect..

copper raven
#

?

modest temple
#

like do i need to set a number for the line

#

?

#

nvm

calm pond
#

systemChat (selectRandom ["I haven't seen anything, dont bother me","sorry, i don't think i can help you","sorry, i don't think i can help you"]);

copper raven
#

if you want to reference it after somewhere, then yes. But don't see any need for that.

modest temple
#

i missunderstood it at first

#

thanks

calm pond
#

just convert it to globalChat with the unit you want

modest temple
#
this addAction ["<t color='#FFFFFF'>(selectRandom ["Have you seen anything?","Have you spotted any russians?","Any trouble around?"])</t>",{player execVM "talk_unknown.sqf";}];
#

could i use it like this aswell?

still forum
#

no

#

selectRandom is a script command. Script commands work in scripts

#

what you have there is a string. Not a script.

modest temple
#

ah

quasi rover
#

Is there a subtype name that called house(building) only, not powerline, wire, fence, gate, lamp street...etc ?

calm pond
#

doesnt "House" already do that?

quasi rover
#

House include wire, lampstreet, powerline etc...

calm pond
#

"BUILDING"?

copper raven
#
this addAction [format["<t color='#FFFFFF'>%1</t>",selectRandom ["Have you seen anything?","Have you spotted any russians?","Any trouble around?"]],{player execVM "talk_unknown.sqf";}];

@modest temple

quasi rover
#

Building also includes powerline, lamp street, gate etc..

tough abyss
#

House_Small?

#

What HouseBase includes?

quasi rover
#

House_Small does not include garage, slum house, house big and house small class.

tough abyss
#

What about Structure

quasi rover
#

Sorry, Structure does not include any house.

brave jungle
#

Does create3DENComposition not create an array for anyone else? Tested in debug console with:

_myComposition = create3DENComposition [ 
 configFile >> "CfgGroups" >> "West" >> "BLU_F" >> "Infantry" >> "BUS_InfSquad", 
 screenToWorld [0.5,0.5] 
];
_myComposition

Return:
[]
tough abyss
#

Is config valid?

brave jungle
#

Well it's an example from the wiki

#

It creates the units fine, just doesn't return an array of the entity IDs

#

So I can't edit them at all afterwards

tough abyss
#

Strange

brave jungle
#

Yeah, I wanted to ask here first before I submitted a bug report, unless this isn't a bug?

high marsh
#

Are you sure it's BIS, not BUS?

brave jungle
#

The example there

#

It's the same for my units too

high marsh
#

Example could be incorrect.

#

Check the conifg anyways.

brave jungle
#

returns an empty array for them too

high marsh
#

Just open the config viewer, find it, observe the path.

brave jungle
#

But even that was the case midnight, it wouldn't create the units. However it does create units, just doesn't return a array

#

see

tough abyss
#

What if you create them on land?

brave jungle
#

Will quickly test, two secs

#

But surely that wont effect it?

#

two secs

tough abyss
#

Who knows

brave jungle
#

Same thing

night void
#

Who can point me, how to make fire\napalm for populate only on walkable areas and ignore walls\objects?

brave jungle
#

I'll submit a bug report

#

cheers for the suggestions

tough abyss
#

Yeah seems like a bug

jagged mica
#

Hey guys, thought I'd come here to ask for directions, since I've browsed forums, tutorials and scripts and didn't help much, which was proven by my non-funcitonal scripts xD

#

I'm a programmer and I do it for living, but never done anything with this scripting language, started playing with it recently

#

and I find it suprisingly hard to comprehend 😄

#

Any idea where can I learn proper distinction and best practices of server/client side scripting? How to write scripts that run properly on both? I've seen people taking different approaches in the same direction, but I can't find a constructive guide on that

#

most of guides I've seen consist of basic mission scripting, but I'm building a Arma 2 Epoch server which requires more than that

calm pond
#

personally i learnt for looking at ace and cba code and reading their guildlines

#

i can send their githubs as well if you want

still forum
#

most of the new important things won't work in arma 2 tho

calm pond
#

plus killzonekid is really good

#

look at his post on his website

#

yes true but arma 3 has a lot of backwards compatibility, its mainly new commands, functions and some syntax changes between them

tough abyss
#

Arma 2 is for masochists

jagged mica
#

( ͡° ͜ʖ ͡°)

#

Thanks for the links @calm pond

#

yeah I assume major differences will be documented in arma docs

eager prawn
#

Arma 2 is for Massachusetts? Cool, cause I live here

high marsh
calm pond
#

both have A* documentation, which is better than i can say for a lot and things, including my own

jagged mica
#

sweet, thanks a lot mate

#

I hope it will be useful for A2 scripting as well 😄

calm pond
#

i hope it does, still would recommend doing it a3 tho. but thats just me.
Enjoy

tough abyss
#

Ask @queen cargo for the book

jagged mica
#

yeah I was thinking about it, but I'll save it for the next project, DayZ community in A2 is still massive

#

ooh, "the book"?

tough abyss
#

Yeah 😩

jagged mica
#

you don't seem too enthusiastic about it 😄 Thanks, I'll ask him 😄

tough abyss
#

He just needs a bit of motivation to finish it

jagged mica
#

oh I just sent him a message xD

tough abyss
#

XD

jagged mica
#

thanks, made me look like an asshole, I definitely made a great first impression xD

tough abyss
#

Did you insult him or something?

calm pond
#

i have a shit ton of bookmarks if you want them

#

split into there categories

#

its from a old post i cant find

jagged mica
#

oh dude would be perfect

#

@tough abyss noo, it's just about pestering someone I didn't know about some piece of work he didn't finish 😄 only joking man

tough abyss
#

He is a good guy hopefully will not get mad and kill you

jagged mica
#

yeah he's a top bloke, thanks for recommending him mate

tough abyss
#

Anyway you probably find more help just asking here rather than going through ancient posts elsewhere. Wha lingo are you programmer of?

queen cargo
#

@tough abyss Problem is... I have limited time and nobody is really helping 😅

tough abyss
#

Time is of the essence!

jagged mica
#

@tough abyss well I'm a webdev and I specialise in JS, but I've worked with some other, lower-level languages in the past as well 😄 Gamedev-wise PAWN took a massive amount of time of my life, for scripting server-side mods for good old Counter Strike

#

to be fair though, SQF syntax makes a lot of sense to me and it's not the biggest problem, although I know that I have to get to know it better

#

I mostly struggle with functions, how and why they are called, and generally how to write code that works in perfect harmony with all clients and the server 😄

tough abyss
#

Functions are just variables containing type CODE. You can execute code directly with call or spawn command

still forum
#

There are many other ways to call functions but you probably don't wanna know them.
Though if you understood how SQF works underneath. You'll already know that

tough abyss
#

CODE is just compiled string containing the statements

#

So you write your script as text, compile it and boom now you can execute it

#

So you can pass code literal like call {hint str 123}; or store it in a variable first func = {hint str 123}; call func;

#

When you look up wiki pay attention what type of argument a command takes

#

There are not many types

#

But there are many many commands

#

That is what makes sqf difficult to learn

calm pond
#

thats why google exists

tough abyss
#

But most commands are just APIs for engine functionality

#

Engine methods exposed for scripts

#

Some more recent commands were added to improve and speed up common operations in sqf

jagged mica
#

sorry guys I was on the phone for a sec

#

oh wow, that's cool

#

thanks for clarifying

cursive whale
jagged mica
#

Oh

cursive whale
jagged mica
#

guys, I can't thank you enough

#

perfect, that might answer a lot of questions, thanks a lot, all of you

still forum
#

just beware when using kk's blog as reference. Most of the stuff on there is years old. And some this can be done way easier today. And his scripts don't use things that are standard today, like private keyword and params.
But if you only care about Arma 2 then that doesn't matter to you

jagged mica
#

yeah good point

jagged field
#

Hey is it possible to set a specific weapon to infinite ammo?

#

I've done it for AI, but I want a specific weapon (a handheld minigun) to have unlimited ammo only

young current
#

you would probably need to create some sort of repeating event/script that refills the ammo periodically.

winter rose
jagged field
#

ty

#

ah crap, its only for local

#

so I can't do it on a server

#

oh wait the unit is local to the server

#

so if the server runs the mission it should be alright

digital hollow
#

RemoteExec

tough abyss
#

@jagged field no, every pc runs the mission

#

A handheld mini gun is not vanilla item ergo you can configure your mod so that it contains tonnes of ammo, more than you can fire

jagged field
#

I mean I'd like to make it in code

#

so I could apply it to other things

calm pond
#

are you running cba?

jagged field
#

Nah I've moved to vanilla rn

#

testing it on the navid

austere granite
#

just remotexec it with the vehicle as target, not that hard

jagged field
#
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
}];``` I'm confused how this event handler works, are these `"_ammo"` things just String names?
ruby breach
#

They're variables that correspond to the things listed in the wiki

calm pond
#
this addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
_unit setAmmo [_weapon, some random int for the amount of ammo happy? IE 1];
}];
#

this is just a guess, dont @ me

tough abyss
#

Google params arma 3

jagged field
#

oh I'm blind yeah it states they're the string names

#

my bad

calm pond
#

it wont work, give me a sec

#

ammo is a string

#

you could just set it to 30 or what ever you want

jagged field
#

I'm confused, I thought it was just a variable type String

#

what would setting it to 30 do

#

as in the name of the variable is 30, or can I send it the number 30 and it sets the current mag to 30

tough abyss
#

@calm pond I doubt you can add number to string and get away with it

calm pond
#

no that why i said it wouldnt work

#

its an int you just set to what number he wants

#

plus i said dont@ me bro

jagged field
#

oh its: setAmmo [weapon, count] count just being an int and weapon the String name of the weapon

#

is what he meant I think

tough abyss
#

You seem to know how to edit yet you decided to leave that intact

calm pond
#

better?

tough abyss
#

It could be 1

#

And arma ints are floats lol

#

Sorry couldn’t resist 😁

calm pond
#

best thing is i have no idea if that works, was just a guess, not even sure how EH work with ai. I assume the same but you never know

tough abyss
#

Sure it works

jagged field
#
    params ["InfGun"]; 
_unit setAmmo [InfGun, 50]; 
}];``` Set Navid Variable name to `InfGun` is that correct or am I misunderstanding everything
tough abyss
#

Yes you’re misunderstanding things, until you read about params

foggy moon
#

and order is critical

jagged field
#

I'll just read through the stuff

#

thanks guys

wanton swallow
#

Hi guys. Anybody know how to allow to edit sqf script on server side while it running?

#

First think was to use compile preprocess File. But ARMA lock this file immediately after first call of preprocess and dont release it...

lilac escarp
#
this addEventHandler ["Fired", { 
(_this # 0) setAmmo [currentWeapon (_this # 0), 10]; 
}];
slim oyster
wanton swallow
#

@slim oyster file patching works for client side but dont work on dedicated server in the same game.
After first exec ru of the file on the server it's stand to lock.

#

Forgot to said: this script called from servermod.

foggy moon
#

From what I'm reading, if you are running server file patching, execVM should be able to load scripts from the arma install folder

#

which should release the file between executions

still forum
#

it might not release the lock if you reload the file every frame or VERY frequently.

tough abyss
#

LOL @lilac escarp # was added specifically so that you don’t need to surround it with parentheses. Also current weapon used is passed as param already

frigid raven
#
private _foo = 5;
private _bar = 10;

_foo += _bar

something like this possible? instead of _foo = _foo + _bar

tough abyss
#

No

high marsh
#

I mean, you could make a macro

lilac escarp
#

@tough abyss no matter. the main thing is that it works))
p.s. Sorry for my English)

still forum
#

If you knew how SQF works. You'd see that it can't work.

_foo += _bar
Variables are resolved before command call ->
5 += 10
Uh.. What now.. Can increment the 5, but no idea where to store the result into.. Can't do anything with this.

frigid raven
#

Jeez I really have to know better how SQF works to avoid such questions 🤔

#

Thx for clarification

#

just saw a commit of sb.

private _return =+ _prepend;

therefore was curious what is happening here.
But sb. already commented on that to have it this way

= +_prepend;
still forum
#

=+ works. Or SQF-VM atleast

tough abyss
#

+= is a little different from =+

vague hull
#

Simply because it's actually = +
Isn't it?

still forum
#

yeah

lusty canyon
#

can i overwrite an existing custom info panel with my bullet cam script then revert the panel back to default afterwards?
https://community.bistudio.com/wiki/Arma_3_Custom_Info
here is my basic bullet cam:

FORGET ABOUT THE SCRIPT, FOCUS ON THE CUSTOM INFO PANELS TY

will it be possible to take for example the mine detector panel, switch it out with the camera then switch?

still forum
#

_null = nonsense

#

_missile = _this select 6; if you only want one parameter. Then only pass that parameter to the spawn. Don't pass the whole array first, and then get a single element out later

lusty canyon
#

so how about the custom info panel stuff? (thats what i wanted feedback about)

tough abyss
#

Can you hide the panel and draw your own in place and then show old one when done?

winter rose
#

@lusty canyon ifs in waitUntil? You could simplify it

still forum
#

Usually when people ask things in #arma3_scripting people look at the script instead of at the wiki page that explains config stuff with 0 scripting inside. ^^

lusty canyon
#

thats the thing tho, i could of taken my question to config but i wanted something that i can just run on the fly in debug console. i hoped for a sqf only solution to accessing info panels

still forum
#

I don't know if there are sqf commands for switching info panels

lusty canyon
#

so much for bohemia saying the info panels were mod friendly

#

i guess this is why the rhs raven still uses that ugly old looking pip window

#

thanks anyway, sorry if i got a bit pissy

digital hollow
#

It looks like you'll need to define a custom resource based on RscTransportCameraComponentMissile

tough abyss
#

@still forum there are

neon snow
astral dawn
#

I guess you need to retrieve the needed values from config with functions like getNumber, etc, and then do whatever you like with them

neon snow
#

I am not sure how could I get for example value accelY, arent those sources?

astral dawn
#

I am not totally sure about the specific attributes you need to get, but if you can see it in the arma's config viewer than there should be no problem with getting them

neon snow
#

Oh I know what you mean. No it isnt that, there is a line in config for example like this:

enabled="accelY interpolate [39.9999999,40,-1,1]";

and I would like to read in realtime what accelY parameter is equal to

astral dawn
#

Oh I see... so this variable is only relevant inside whatever string processor arma uses for configs 😫 what a mess

#

If you really need this, you could monitor vehicle's velocity every frame, take their difference, divide by time passed, and thus calculate velocity first derivative or acceleration, then convert this acceleration vector into vehicle's model space, and I guess it would be equivalent 🤷

#

Wait 🤔 I think ACE has G-force effects? They should be based on vertical acceleration, check how they do it

neon snow
#

Ok will check those, big thanks 😃

keen nimbus
#

I think I've found a bug. Can anybody confirm it for me before I make a ticket?

It's in BIS_fnc_initVehicle, where it checks whether to skip reset of animation sources (line 244). Expected behaviour is that if you pass false as the first element in the animations array (see example 10 in the function header), it'll not reset the animations. Actual behaviour is that it ignores the false and continues anyway. Example 10 itself doesn't actually work as expected.

I suspect it's because "false isEqualType true" will return true. Perhaps it was meant to be isEqualTo?

foggy moon
#

It appears that it should work since [false, ...] call bis_fnc_arrayShift would return false and assign it to _resetAnimationSources, but I'm gonna do some more testing to make sure

#

unit test appears to work, an _animations value of [1,2,3] returns true while [false,1,2,3] returns false

jagged mica
#

Hey everyone, it's me again

#

after yesterday I felt inspired to get back to one of the projects I've abandoned for arma 2

#

any clue if there's any chance I can play an animation of user sitting (on a chair/in a vehicle) with his weapon drawn? I played around with some switchMove and some animations but can't find anything constructive

digital plover
#

How to make Custom in Game Left Top Logo ?

robust hollow
#

create a picture control, position it in the top left and set text to the image filepath

#

like this @digital plover

#include "\a3\3den\ui\macros.inc"

private _ctrl = (findDisplay 46) ctrlCreate ["RscPicture",-1];
_ctrl ctrlSetPosition [safezoneX + (3*GRID_W),safezoneY + (3*GRID_H),16*GRID_W,16*GRID_H];
_ctrl ctrlSetText "\a3\ui_f\data\logos\a_64_ca.paa";
_ctrl ctrlCommit 0;
solemn steppe
#

Hello guys. Could someone can confirm this ?

When giving order to a unit, using doTarget and fireAtTarget at another unit, the "lock" is only possible if the bullet/missile/bomb has the capability to lock the target ?

exemple : a VLS firing a missile at a car, the missile will reach his target because the missile is configured to lock on ground vehicles ?
Can the same VLS could lock and destroyed a helo flying if his missiles can't lock AA targets ?

I'm trying to figure what doTarget and fireAtTarget can really do.

digital plover
#

@robust hollow where should I write this code exactly?

robust hollow
#

into an sqf file so you can execute it when you need to.

digital plover
#

i want to make @MyOwnMod

#

Can I run it in my own mode? @robust hollow

robust hollow
#

yes

digital plover
#

Can you help me with this?

#

@robust hollow

robust hollow
#

not from my phone no

digital plover
#

mylogo.sqf: ```#include "\a3\3den\ui\macros.inc"

private _ctrl = (findDisplay 46) ctrlCreate ["RscPicture",-1];
_ctrl ctrlSetPosition [safezoneX + (3GRID_W),safezoneY + (3GRID_H),16GRID_W,16GRID_H];
_ctrl ctrlSetText "\a3\ui_f\data\logos\a_64_ca.paa";
_ctrl ctrlCommit 0;```
Correct ?

#

anda MyMod config.cpp: ```class CfgPatches
{
class MyMod
{
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {"A3_Data_F","A3_Map_Altis","A3_Map_Stratis"};
};
class exile_client{};
};

class CfgMods
{
class MyMod
{
name = "MyMod";
author = "Spook";
version = "0.1";
};
author = "Spook";
timepacked = "";
};
class CfgFunctions
{
class SPK
{
tag = "SPK";
class SPK
{
file = "MyMod\functions";
class init
{
postinit = 1;
};
};
};
};```

#

mylogo.sqf in the MyMod\functions path

#

@robust hollow

#

Does this work?

robust hollow
#

you tell me, does it? im going to guess no cause you havent defined it in cfg functions.

digital plover
#

I have no idea about this. trying to do something by trying

outer fjord
#

So I been digging around for a anti-looting script. Basically something that just removes enemy weapons on killed. I found this in a old forum that looks like what I need, but I feel this is directed to the player rather then the AI?
player addMPEventHandler ["MPKilled",{_unit = _this select 0; removeAllWeapons _unit; removeAllAssignedItems _unit; clearMagazineCargo _unit}];

#

If it does effect AI, how could I make it universal to a dedicated server with HC?

tough abyss
#

add it to "EntityKilled" EH

#

with condition checking if it is a soldier that has been killed and not a vehicle

#

with locality in mind of course

outer fjord
#

I'm lacking scripting knowledge. But isn't the even handler the condition itself?

tough abyss
#

event handler fires upon event

#

EntityKilled fires upon entity killed

outer fjord
#

So like addMissionEventHandler ["EntityKilled", { params["_killed"]; if (_killed isKindOf "Man") then {?

#

or something like that.

tough abyss
#

the entity could be not a soldier

#

Maybe, but animal is also a "Man"

outer fjord
#

Would that be a major issue?

robust hollow
#

isnt there a class that men inherit but animals dont? CAManBase or something like that.

tough abyss
#

I would also start the code with

if (!local _killed) exitWith {};
#

Do what Connor says

still forum
#

Would that be a major issue? no

jagged mica
#

Hey is it possible to prevent damage conditionally, i.e. Allow damage from only a specific user? allowDamage isn't an option because it disables all damage. Any chance to achieve this with handlers or something?

robust hollow
#

HandleDamage EVH with ur condition inside would do the trick

tough abyss
#

HandleDamage is not an easy EH to comprehend though

robust hollow
#

how so?

digital jacinth
#

Fires multiple times for each body selection including the "whole body" """section""""

tough abyss
#

because it fires for every selection and the damage is applied after depending on return values from each selection damage @robust hollow

#

if you just return 0 it will restore full health

#

Doubt this is what Vestarr wants

robust hollow
#

oh, yea i knew that much, thought there must have been something else going on i was unaware of. fair enough though 👍

glad timber
#

So i have been working on a map for my server and i types up this script to lock it to our server name only so other people cant use our map while our community is still running a server. This is the first 2 line of the script:

if (!isMultiplayer) exitWith {};
if (_servername != "Oure Server Name Here") exitWith {

The problem im getting is when I launch the server it gives me and error and says File mapProtect.sqf, line 0: '.if': "(" encountered instead of "=".

robust hollow
#

are you loading it as a config or something?

glad timber
#

im using the config.cpp to call it like this #include "mapProtect.sqf";

peak plover
#

🤔
I don't think your map is going to be worth protecting...

#

Also you can't write a script like that

#

At all

#

Without a custom .dll

#

** lock it to our server name only** so other people cant use our map while our community is still running a server
This is harder to do than you think

high marsh
#

What's preventing someone from repacking without that line? Nothing. Obfuscation will

robust hollow
#

im using the config.cpp to call it like this #include "mapProtect.sqf"; thats not how it works, and yea, even if you do get this working, nothing is stopping anyone from removing it.

glad timber
#

We have already use the Obfuscation

high marsh
#

so why are you doing this?

peak plover
#

What you are asking for:
A script which checks if your community is running a server, if it's still running a server, then player can not load that map on other servers

#

This is difficult to do

robust hollow
#

i think he just means he will remove the check when they stop using the map

glad timber
#

All it is ment to do is to check what the server name is and if it is not our server name then stop the server form loading

high marsh
#

You guys are giving me the chills, we're talking about a terrain right?

robust hollow
#

¯_(ツ)_/¯

peak plover
#

@robust hollow he can't guarantee that he is still alive or remembers at the time his community dies

glad timber
#

This is not the first server that has or have tried to do this

high marsh
#

Map = "Terrain" ? "Scenario" ??

peak plover
#

You can't script that

high marsh
#

What about leaving the key absent from a mod?

#

does the client still need the key with the signed files?

robust hollow
#

@peak plover i know what your saying, i just dont think he means for it to be so complicated. simply checking the server name and ending if it doesnt match is all he is trying to do.

glad timber
#

Yes that ^^^^^^^

#

I have seen it done before thats the only reason why im trying to do it

high marsh
#
if(serverName != "BLAH") then
{
    "EveryoneLost" call BIS_fnc_endMissionServer
};
#

or, if you want without gui style.

if(serverName != "BLAH") then
{
    "CONTINUE"  remoteExec["endMission",0];
};
peak plover
#

🤔

#

😂

high marsh
#

Yikes

peak plover
#

Smart lad

#

life servers usually have remoteExec configs and stuff 'tho

#

so I doubt that'll work

robust hollow
#

remoteexec from server doesnt pay attention to the config.

high marsh
#

add it to whitelist. Bam.

#

Are you sure connor? Doesn't CfgRemoteExec have specific "You can't target clients" option?

peak plover
#

please don't use remoteExecute there

robust hollow
#

yea but i understand it to be sending from one client to another. i dont define whitelist for functions if its just the server sending to clients and it works fine

peak plover
#

Someone will join his friends server with the wrong mod and cause everyone's mission to end

high marsh
#

Hmm

robust hollow
#

only let the server execute the check then?

peak plover
#

Yeah ,that could work

#

Or just endmission for the client

#

So he'll go back in the lobbyu

#

also include an error message somewhere

#

Otherwise they will not know why

#

This kind of stuff should be obvious 'tho

high marsh
#

No, just leave them in complete confusion please. It'll be funny.

glad timber
#

It would be lol

robust hollow
#

crash the server when it loads. then u dont need to worry about players joining 👌

peak plover
#

It will be funny, but if someone did that to me I'd deobsfucate and upload the files somewhere

#

in spite

glad timber
#

true

high marsh
#

Is it possible to have a variable created in the definition of a variable?
Ex:

_table =
[
    blue = "Blah!",
    red = "Blaaahhhh!"
];

I wanted to use the color names as index references. But it would seem this is not possible.

robust hollow
#

no, no it isnt.

high marsh
#

Darn. I thought this was going to be really simple:

_blockColor = _table select (_table find _color);
peak plover
#

You can create a new namespace and use setvar/getvar

high marsh
#

Hmm, how do you mean new namespace?

peak plover
#

any object or anything which has a namespace, usually location

high marsh
#

Aha. That's what I thought you meant, will see about it.

peak plover
#

_blockColor = _namespace getVariable _color;

#

imagine if . worked as getvariable

_namespace._color
high marsh
#
loc setVariable["colorLibrary",
[
    ["Blue",[255,255,0]],
    ["Red", [255,255[0]]
],true];

Like so?

peak plover
#

nah

high marsh
#

I'm retarded. Hold on.
Red def = color, namespace holds color are reference

#
loc setVariable["Red",[255,255,0],true];
//so on for each color
foggy moon
#

#define . getVariable 😂 if only...

peak plover
#
{
    _namespace setVariable [_x#0,_x#1];
} forEach [
    ["Blue",[255,255,0]],
    ["Red", [255,255[0]]
];
// locations are local ONLY, so you can't use public variables
high marsh
#

I see, excellent wizardry.

peak plover
#
private _color = _namespace getVariable 'Blue'
high marsh
#

Neat. That's cool.

peak plover
#

If this is a ui, you can even use a display or a control as your namespace

#

Won't even have to create a location

high marsh
#

Correct, this is actually for those VR blocks. Was looking for a good way for a quick lookup / quick setter function for each of them. But good to know for the future, pain in the ass ui color.

still forum
high marsh
#

Gotcha. That makes sense.

still forum
#

Also no SQF command ever can see the name of the variable you pass to it. The variable is always resolved before the command is called. The command has no clue where that value comes from

#

["Red", [255,255[0]] syntax error 😉

tough abyss
high marsh
#

LOL

still forum
#

Diwako does the same with his unitHud. Storing colors in a namespace by the name they will be looked up on. Mainly for performance
Though I think that indirectly comes from commy

tough abyss
#

syntax error not quite red either 😩

high marsh
#

Hey, it was for ex.
Anyways, this is technically the most performant way of doing so?

still forum
#

Well if you already know what color you want, hardcoding the array might be faster than getVariable call

high marsh
#

Nope, it's supposed to be random. I didn't want to have to pass the exact color values to fnc everytime, so I wanted to build a lookup of sorts.

foggy moon
#

Has anyone had experience with multiplayer performance impact of running setObjectMaterial possibly every frame to reflect an animation scalar value (i.e. throttle)?

digital jacinth
#

@still forum correct commy suggested it. I completely forgot about namespaces as I normally do not use them

tough abyss
#

setObjectMaterial is local why would it have any multiplayer impact?

foggy moon
#

true, I guess just for lower end machines

digital jacinth
daring pawn
#

Hi guys, with

_position = _this select 0; //starting search pos
_threshold = _this select 1;

{
     if(_x distance _position < _threshold) exitWith
     {
          hint format ["%1 is closest",_x];
     };
} forEach allMapMarkers;

if I was using a Square marker, would it count the markers edge or from the markers centre for the distance?
https://forums.bohemia.net/forums/topic/188016-search-for-the-nearest-marker/

robust hollow
#

center, though allMapMarkers returns strings so you need to change _x to markerPos _x

#

i think you do anyway

foggy moon
#

yep that's right Return Value: Array of Strings

daring pawn
#

Yea sweet. I've got a setup as below
https://i.imgur.com/UiqLiGs.png

and essentially i've got dudes that spawn in based on the quantity of building positions in a grid to occupy + random dudes patrolling. I want to further bolster those numbers based on nearby markers.

So like

If theres 2 nearby, its likely an area thats larger and would justify more dudes in that area

#

Just trying to discover an effective and not performance rapey

#

cause I got to run it for every marker

tough abyss
burnt cobalt
#

Hi there - if I remember correctly, it was possible before to give a doStop/moveTo combination to an AI that had another AI as a group Leader, they would wait at their position as intended. These days it seems that after a little while, they will go back into formation after a certain interval, no matter what - does anyone know anything about this? Even if I use a doMove/sleep/doStop combination it will take about 5 seconds before the unit returns to formation

jagged mica
#

Have I told you that I love you all

high marsh
#

not enough. give it up

jagged mica
#

My question is a long way up but HandleDamage is exactly what I needed

fleet hazel
#

guys. How to create such a radius of 15 meters?

drowsy axle
#

Could you give a better explanation please @fleet hazel

fleet hazel
#

@drowsy axle How do I set the radius of a given circle?

drowsy axle
#

I'm trying to return a Cfg... entry from an Object. ```sqf
params ["_object"];

private _class = (configFile) call BIS_fnc_GetCfgData;

switch (_class) do {
case CfgWeapons : { _classname = (configFile >> _class >> _object >> "displayName") call BIS_fnc_GetCfgData; };
case CfgMagazines : { _classname = (configFile >> _class >> _object >> "displayName") call BIS_fnc_GetCfgData; };
default { hint "Something Went Wrong!" };
};``` Here's what I've got so far. I hope someone can help me.

#

@fleet hazel How are you creating the circle?

fleet hazel
#

@drowsy axle I need to make a transparent barrier around the player with a radius of 15 meters. If he goes beyond the radius then his script is interrupted. How to make a transparent barrier?

still forum
#

you are trying to get a classname from the display name after you throw it through getCfgData?

drowsy axle
#

No. the Cfg

still forum
#

tell me exactly what you want

#

what is _object

drowsy axle
#

@fleet hazel you can use a trigger.

still forum
#

private params makes no sense

fleet hazel
#

@drowsy axle The player does not visually see the trigger...

drowsy axle
#

Refined version above @still forum

#

@fleet hazel Why don't you locally create objects, around the player at a radius of 15 metres

still forum
#

answer my questions.

#

That code is so nonsense that I don't understand what you are trying to do

fleet hazel
#

@drowsy axle What are the objects?

drowsy axle
#

_ object is either a Weapon or Magazine. @still forum

still forum
#

no it's not

#

what is it

#

what type

#

what's inside it

#

There is no "weapon" type

drowsy axle
#

All I want to do, is have an AddAction on an object, which runs above script, that SHOULD, switch depending on it's Cfg class. Now, that I know which Cfg class is it, get the classname of the object.

tough abyss
#

The FiredNear event handler has a note in it that the distance has a maximum of 69m, so does that mean a pair of units more than that, say 100m apart would not have the event triggered at all?

still forum
#

where do you get that weapon or magazine thing from?

#

If you have the class then you already have the classname

tough abyss
#

I assume that is what it means rather than it would just report it as a maximum of ~69m

drowsy axle
#

I don't want to do it manually for every object.

still forum
#

that's what that should mean yeah @tough abyss

tough abyss
#

@fleet hazel you can't, it is what it is

drowsy axle
#

I want to place a ``[this] call CAP_fnc_getClassname` script. inside each objects, init field, in the editor

still forum
#

@drowsy axle WHAT IS INSIDE _object. Why is that so hard to answer?

#

A object is in there?

#

So Not a weapon or magazine at all

drowsy axle
#

I was sooo close. I looked at TypeName..... ffs man. Why is it so hard for me to find the command that I need.

#

Thanks for that long winded bullshit. I apologise.

tough abyss
#

Why is it so hard for me to find the command that I nee typeOf is in see also on typeName page and second result on google under typeName

slim oyster
tough abyss
#

pointless

slim oyster
#

how?

#

"I dont know commands, I want information about an object"

#

Object Information -> smaller list of commands useful for the user

still forum
#

ok.

waxen tendon
#

how can i manually access the stored arsenal presets?

#

i.e where does arsenal write the presets

#

also exporting does not help me in this case

grim coyote
#

Profilenamespce

#

Im not sure what the variable names are but you can find them from function viewer, and then see the arsenal script

waxen tendon
#

thnaks!

slim oyster
#

profilenamespace getvariable ["bis_fnc_saveInventory_data",[]]

sturdy cape
#

hey there (again ^^ ) ive got a script where i collect nearEntities to apply damage to them but its not working for the case the entity is inside a vehicle its ```sqf
_near_units = (position _object) nearEntities [["Man"],8];

if (count _near_units >0) then 
  {{     
   
if !(vehicle _x == _x) then {      
    _bomb = "Bo_GBU12_LGB" createVehicle (getpos _x);
    _bomb setdamage 1;
    diag_log "player in vehicle has been killed by an anomaly (burp)";
    
   } else {/*do something else because on foot*/};

}foreach _near_units;
};

#

this is inside a foreach near_units btw,i think that does matter

#

added this

foggy moon
#

huh, nearEntities isn't returning units in vehicles for me

#

don't see that anywhere in the docs

ruby breach
#

Because it doesn't return units in vehicles

lilac escarp
#

_near_units = entities [["man"],[],true,false];
?

ruby breach
#

The entity it would return would be the vehicle itself

tough abyss
#

Not if you have it return only kind of Man

foggy moon
#

Is that not something that should be mentioned on the wiki? The only qualification mentioned is the unit must be alive, which units in vehicles are.

tough abyss
#

Good point calling @winter rose over

foggy moon
#

(entities [["man"],[],true,true]) select {player distance _x < 8}; would be the equivalent, however it takes 4x longer than nearEntities, and that's just on a test map with 4 units

lilac escarp
#

Is there an alternative?

winter rose
#

@tough abyss good evening?

tough abyss
#

If you want to count units in vehicles with nearentities the workaround would probably be slower @foggy moon

#

How’s going?

winter rose
#

@tough abyss Fine thanks, how may I help (:

tough abyss
#

@foggy moon brought up interesting point, wiki for nearEntities doesn’t mention that it doesn’t detect units in vehicles, do you think you could amend that?

winter rose
#

true, will do!

tough abyss
#

Sweet

winter rose
#

is this sentence correct?
If any types are given, only entities of given types or subtypes are listed

#

regarding the plural form for any types and further plurals

foggy moon
#

If the alternate syntax is used, would be more accurate as it only applies to that

#

but technically yes

winter rose
#

thanks

#

done

mortal nacelle
#

How would I call for an NPC's classname from EDEN and use it in a script?

winter rose
#

@mortal nacelle typeOf ?

foggy moon
#

@mortal nacelle Do you mean Right click unit(s) > Log > Log Classes to Clipboard?

mortal nacelle
#

No no @foggy moon I believe Lou has given me what I wanted.

foggy moon
#

@lilac escarp Going back to your issue, adding vehicles to the nearEntities check and iterating their crew might still be the fastest way

lilac escarp
#

@foggy moon this is not my problem)) but I also find it interesting

foggy moon
#

Oops, sorry

#

@sturdy cape ^

sturdy cape
#

sorry went afk for a few minutes.so this is not me but difficult at all,no?

#

so counting the crew ?

winter rose
foggy moon
#

beautiful

sturdy cape
#

nice! can anyone give me an example how to approach this ( in terms of a dummy code snippet so i can understand)?like if i should do a pushback or append or whatever?

winter rose
#

@sturdy cape I would say use nearEntities, then do a second pass where you add crew _x to the array, and remove the vehicle from the array?

sturdy cape
#

thats something i can start with

#

sorry if i need coffee but could i just do something simple like sqf if ((_x isKindOf "Car") && (player in crew _x)) then {?

rancid zephyr
#

That would only work if the code is called on the clients. If you want to run the code on server then I wouldn't use 'player'

#

If you are just trying to see if the vehicle is occupied you could use (count fullCrew _x) > 0

tough abyss
#

player in crew _x could just player in _x @sturdy cape

sturdy cape
#

Yeah this code is running client side via broadcasted function

#

You never stop learning. Fullcrew is interesting.

#
if ((_x isKindOf "Car") && (count fullCrew _x)>0) then {``` need to test this in the morning.thank you
tough abyss
#

Is there any way to get the classname of a road? IE:

_roadList = [worldSize / 2, worldsize / 2, 0] nearRoads worldSize;
_road = selectRandom _roadList;

systemChat format ["%1", str _road];

to return

systemChat: "CUP_A2_Road_OA_dirt1_02000"

for instance.

EDIT:
It returns the ID number (I think?) but I can't get the classname from that.

ruby breach
#

Does typeOf not work? (I've never tried to return the classname of a road object, so I have no clue)

foggy moon
#

no, it returns ""

#

I think the most info you can get about a road is surfaceType

tough abyss
#

TypeOf doesn't work, no.

EDIT:
Figuring out the width of the road might help determine which classname it is on certain maps. IE: Wide roads == paved, slim roads == dirt.

tough abyss
#

I feel like I've missed something. I'm having troubles adding eventHandler "killed" to vehicles such as cars and explosives (ieds). Has anyone had similar issues and know what I'm doing wrong?

still forum
#

I eat my 🍪 warm, but not hot.

#

@tough abyss roads don't necessarily have classnames

sturdy cape
#

@tough abyss how are you getting the vehicles? Also,killed or MPkilled?

#

I know this is a long shot but try redefining the object via select again inside of the EH.had this once and this worked

cursive whale
#

anybody got a clever pattern that allows an array as a macro param?

robust hollow
#

This what you mean?

#define myMacro(a) systemchat str a
private _myArray =  [1,2,3,4,5,6,7,8,9];
myMacro(_myArray);
cursive whale
#

yes, that's what i want to do

#

does that work for you?

robust hollow
#

yea, cause it "translates" it to systemchat str _myArray so cant get confused by the commas

still forum
#

CBA has ARR_X macros

#

#define ARR_2(a,b) a,b

MYMACRO(ARR_2(abc,def));

cursive whale
#

thanks but as i don't yet require CBA it's probably overkill for this purpose (just tidier code)

still forum
#

it's just macros

#

just copy them

cursive whale
#

roger, thanks both

#

d'oh, wasn't the fact that i was passing an array, rather that I'd used '#' (for select) within the macro

modest temple
#

im wondering if this will work in multiplayer
civilian AI's init

this addAction ["Have you seen anything?", "talk_unknown.sqf"]

contents of the talk_unknown.sqf

player globalChat (selectRandom ["I haven't seen anything, dont bother me","sorry, i don't think i can help you","sorry, i don't think i can help you","go away","i wish i could help","i don't think i have notice anything...","everything seems normal around here"]);
still forum
#

no it won't

modest temple
#

what should i do then?

still forum
#

Well actually.. Do you want people around you to hear what the AI said to you?

modest temple
#

i just want the text to show up in chat

#

i dont care how it looks like that much

still forum
#

Then it doesn't make a difference if multiplayer or not

#

Btw.. The player is saying the answer, shouldn't the AI be saying it? ^^

modest temple
#

yes it should

#

how can i get the AI's name and then make him say it

#

or what ever

still forum
#

you get the ai as parameter in _this

modest temple
#

so _this globalChat?

still forum
#

check out the addAction wiki page. Just grab the AI and pass that to globalChat, instead of player

#

no. IN _this. It is not _this, _this is an array. check the wiki page

modest temple
#

aight

tough abyss
#

@sturdy cape
It's all spawned using createVehicle in mp (not dedi yet). Still not working.

_ied = createVehicle [classname, pos, whatever, bla bla];  //works
_ied addEventHandler ["killed", "systemChat "IED destroyed"];

doesn't work. Spawns in IED but if I blow it up it just goes away.

digital hollow
#

Try deleted eh then

sturdy cape
#
_ied addEventHandler ["MPkilled", 
_ied = _this select 0;
"systemChat "IED destroyed";
];```
tough abyss
#

I know there's an error in the eh btw heh wrote it hastily. Don't have the exact code rn

sturdy cape
#

just try this,i solved an object killed EH doing this

tough abyss
#

alright, I'll try it out. Thanks! 😃

dim terrace
#

does anyone know a way to recompile fsm during mission?

tough abyss
#

Are you sure your issue wasn't just the fact that you tried using an undefined local variable inside the EH @sturdy cape?
IE:

_object addEventHandler ["MPkilled", {systemChat format ["%1", str _object]}];

because it doesn't really make any sense otherwise, then again this is arma.

still forum
#

_ied addEventHandler ["killed", "systemChat "IED destroyed"]; pretty obvious why that doesn't work

#

even discord shows you that it doesn't work

sturdy cape
#

{}; ermahgerd didnt even see this.making coffee now. @tough abyss the guys here are awesome and we suck 😉

tough abyss
#

Yeah, that's not the issue @still forum

    _ied addEventHandler ["Deleted", {
        systemChat "IED DESTROYED!";
    }];

Could it be because it's the ace pressure plate ieds? They have some weird behaviour at times but could be it's like that for all mines.

still forum
#

Deleted EH might be unrealiable

#

I already know it fires even if the vehicle doesn't get deleted.. When you create a vehicle in zeus then Deleted EH fires on it, it's nuts

tough abyss
#

What do you mean?

#

I've tried deleted and killed so far. Neither has worked. Not even hit works it seems :/

#

You need vehicle reference to add eh to

#
_ied = createVehicle [_iedType, _iedPos, [], 0, ""];
_ied addEventHandler ["Killed", {
    systemChat "IED DESTROYED!";
}];

Vehicle reference?

#

or are you talking about zeus?

#

Yes asking Dedmen

still forum
#

CBA XEH. Config Deleted eventhandler

#

You don't need a reference to add a config handler in the class

tough abyss
#

Could be the cba

digital hollow
#

Oh, is this ace explosives? you might as well give up xD ace explosives swaps in like 3 different objects depending on what stage of placing it is in. When I did my breaching charge I had to spawn another object and put an "explosion" eh on that.

still forum
#

Does ace explosives not have a EH that you can just hook into?

digital hollow
#

I didn't look very hard in that direction. That does sound optimal.

tough abyss
#

Yeah that's what I just kinda realised 5 min ago @digital hollow
I remember running into issues with ACE explosives before.

@still forum
I hope so!! 😄 Otherwise some ghetto triggers or smth might work.

digital hollow
#

explosion eh on wire_loop_F , that's the way to go =p

still forum
#

ace just does setDamage one to explode

tough abyss
#

yeah I was hoping ace_firedNonPlayerVehicle would work but seems like it doesn't 😦

tough abyss
#

Running vanilla ArmA3 using the debug console in editor

_ied = "IEDUrbanBig_Remote_Ammo" createVehicle position player;
systemChat format ["%1", _ied];
_ied addEventHandler ["Killed", { 
systemChat "IED DESTROYED!"; 
}];

doesn't work neither :/

tough abyss
#

If anyone knows any good ways to detect mine explosions hit me up! I need something to execute the ied position and object name when the ied is either defused or destroyed.

sturdy cape
#

got another one here: i need to check for a condition and count an array to check if a vehicle is already claimed (for my locking system plugin).code is as follows sqf _claim_count = {_vehicle = _x select 0; !isnull _vehicle && {alive _vehicle && {_vehicle getVariable["type", -1] == 3 && {_vehicle getVariable["oOWNER", ""] == _player_uuid}}}} count DB_var_Objects; if _claim_count is <5 the result is true and the player can claim another vehicle,.somehow this line always returns false.ds_var_objects is an array of all db objects.so it should check for all vehicles if alive,type 3 (saved to db which the former claims would have done),owner id etc. but it doesnt.did i go wrong in this code line ?

#

diag log db_var_objects results in an array containing what it should obviosusly,checked what i am capable of already

#

sorry i am always asking kind of naive questions,i just see no error in syntax and sometimes its just that second pair of eyes looking at it what makes the difference^^

sleek token
#

how would you get the player object by netid or uid without having to loop around allUnits? Any ideas?

tough abyss
frigid raven
#

was there ever a plan to make ACRE2 and TFAR compatible to each other? Like people using ACRE2 could talk to peeps using TFAR

tough abyss
#

You mean like people on XBox playing with people on PlayStation?

frigid raven
#

is it that far from possible?

austere granite
#

yep

still forum
#

@frigid raven yes it is far

frigid raven
#

🌹 too much negativity for me 🌹

peak plover
spice axle
#

Is there a base class for a rifle projectile? If i want to filter projectiles into projectiles who come from a rifle/gun/marksman, etc. but no tank or something like this

#

Nvm i think i found one. "BulletBase"

mortal nacelle
#

Hey, so i'm struggerling to understand the param. If I have another variable, let's say _test in one function, and I want to pass that variable over to this function, how do I do it? Would I just do _test = param[0]

#

?

digital hollow
#

You can pass _test by including it in the input array.

private _test = "test value";
[_test] call _func;

Then in _func you can get it using param

private _var = param [0];
_var    //"test value"
mortal nacelle
#

Thanks. Can you use an array of classnames with typeOf

#

?

#

_distance = player distance2D (typeOf person player == _npcArray);

#

_npcArray = ["npc_supermarket","npc_supermarket_1"];

still forum
#

person what's that?

#

distance2D to a boolean? that doesn't make sense

#

what are you trying to do

mortal nacelle
#

Okay let me explain, this will be a long one.

#

I am trying to get all the classnames of the NPC's from EDEN. I am then executing a function that robs that specific npc. But I am trying to get the distance from the NPC to the player, and if the player moves away from the npc e.g. 3m then it will exit the script

#

if that makes sense

still forum
#

"the npc's" (many)
"robs that specific npc" (one)
which one?
What does robs mean

mortal nacelle
#

yeah sorry my english is whack 😂 I am trying to find the distance from the player to the NPC.

#

But I want to use NPC classnames, that I set in the mission.sqm

still forum
#

why not just give the npc a variable name in it's attributes in the editor?

mortal nacelle
#

I have done that.

#

That is what I mean

#

But i'm just too stupid to describe that

#

😂

still forum
#

That is the variable name.

#

Just use that name

#

player distance npc_supermarket

solar coyote
#

hey guys, I'm toying with MenuInventory respawn template, and ive run into problem, i cannot make any locations to respawn with [missionNamespace, 'respawn'] call BIS_fnc_addRespawnPosition; I do have an empty marker named respawn, tho even after i enter it into debug console, Resapwn button is avalible but no locations

mortal nacelle
#

Huh, okay.. Well. I guess I over complicated that 😛

#

Thanks @still forum

winter rose
#

huh, I can't sleep in a CfgFunctions defined function… weird? canSuspend returns false

languid tundra
#

What are you trying to do?

winter rose
#

hmm wait, maybe it's the wrong problem… I had sleeps in it before. I have to dig

#

yep, seems I should spawn it

languid tundra
#

lol

winter rose
#

I am not really familiar with CfgFunctions-declared functions indeed

drifting copper
#

OK. So on runway lights I was told by a forum to do the following

        {
            dataType="Object";
            class PositionInfo
            {
                position[]={23125.061,3.2350702,18981.07};
                angles[]={0,3.1400568,0};
            };
            side="Empty";
            flags=4;
            class Attributes
            {
                init="call{_light setLightIntensity 9000;}";
            };
            id=3857;
            type="Land_MBG_EdgeLight_Green";```

The effect is supposed to be to make the object shine brighter though after the "init" the light is more dim. Can anyone with a bit more insight please advise? **Note I am a idiot to coding**
robust hollow
#

init="call{_light setLightIntensity 9000;}"; i dont think _light is predefined, have you tried changing to init="this setLightIntensity 9000;";?

drifting copper
#

Yoh that kinda went over my head. will try init="this setLightIntensity 9000;";

robust hollow
#

thinking on it more, i dont think setLight... commands work on objects, only lightpoints?

languid tundra
#

Yeah, I doubt this will work. You're referencing the lamp instead of the light object.

drifting copper
#

Yeah still the oposite effect

languid tundra
#

I have no idea how you would get the light object.
However, you could spawn an additional light effect and adjust that one to your needs.

drifting copper
#

I tried light effect but the wash is weird and clips through some of the terrain so it looks jagged. Trying to find a fix without running a .sqf

languid tundra
#

Well, the init statement is SQF...

drifting copper
#

Only lights I could find was land_MBG_MiddleLight_"color" and land_MBG_EdgeLight_"color". Can not seem to find any other runway markers

languid tundra
#

There are several script commands to manipulate light sources. With the right settings and positioning, I'm sure you could get rid of the clipping and jagging.

drifting copper
#

Is there a way to change the radius? So light spreading from 1 meter to say 5cm but still visible from range or "approach"

languid tundra
#

Check out setLightAttenuation

drifting copper
#

will do

languid tundra
#

If you have Achilles by chance, you could play around with the light source module to get an idea.

still forum
#

@winter rose CfgFunctions are no different than anything else. Just goes through compileFinal command

#

CfgFunctions are also just compiled via script

winter rose
#

I never really got this distinction in my mind I think.

call compile preprocessFileLineNumbers "script.sqf";``` works, even in the script has `waitUntil` ; functions don't?
still forum
#

call doesn't change environment

#

depends on where you call it from

#

there is 0 information stored inside the script about how and where it was compiled

#

if you call from unscheduled then you can't sleep

winter rose
#

oh wait, yes the debug console is unscheduled ofc

#

indeed

high marsh
#

@winter rose Maybe your script has lupus

winter rose
#

@high marsh it's never lupus (except in that one episode)

high marsh
#

😃

tough abyss
high marsh
#

Wat.

_mine spawn
{
    waitUntil
    {
        !alive _this;
        sleep 1;
    };
    systemChat "HE'S DEAD JIM!";
};
#

if you only pass one parameter, then that'll work. Otherwise, it's obviously an array.

still forum
#

no wait

robust hollow
#

!alive _this would need to be under the sleep wouldnt it?

still forum
#

@high marsh waituntul broke

#

aww. don't spoil it

high marsh
#

Damn...what did I screw up this time :/

still forum
#

everything! like you always do!

high marsh
#

Wow, that really hurts.

still forum
#

Here take a 🍪 you done good

high marsh
#

Thanks, is it at least oatmeal raisin?

still forum
#

yes. special for you

high marsh
#

Yummy

still forum
#

but if you don't edit out your error then it turns into jelly

tough abyss
#

I added two more parms to it for my usage. That's just copypasted from his alternative eventHandler on the tracker 😄

high marsh
#
_mine spawn
{
    waitUntil
    {
       sleep 1;
       !alive _this;
    };
    systemChat "HE'S DEAD JIM!";
};
tough abyss
#

Now lets see what type of performance hit this will give me in my EOD campaign of hundreds of stat saved mines!! (Y)

still forum
#

that's scheduled.. so none

tough abyss
#

that's actually amazing if ~100 waitUntil doesn't do anything at all

winter rose
#

are mines considered ammo or "vehicle"? an EH would fit here

tough abyss
#

I think they're considered ammo. 99% sure.

foggy moon
#

From what I've done with them, they seem to essentially be a vehicle holding the given ammo

#

They can be manipulated with createVehicle and deleteVehicle after all

winter rose
#

@foggy moon bullets too, but EH cannot be attached to them

foggy moon
#

sure, definitely not normal vehicles

winter rose
#

yep, no event handler

#

@tough abyss you could also manage a list of mines and waitUntil one is dead, then remove it from the array – same checks, less threads

tough abyss
#

Pretty much what I'm doing. Got it working without any performance hit for now so I'm going to leave it until it's a priority heh

#

Thanks for the help!

prime horizon
#

hey guys so guys im making an admin menu and i have this script player list```_index = (findDisplay 45856) displayCtrl 2500 lbAdd "---- Player List ----";

{
_index = (findDisplay 45856) displayCtrl 2500 lbAdd name _x;
(findDisplay 45856) displayCtrl 2500 lbSetData [_index, getPlayerUID _x];
}forEach allPlayers;```
i want to change it to weapone list please guys i need help

tough abyss
#

You don’t need to find display every time, you can do it once and store control in a variable

#

You can also use RscFrame to nicely wrap your lbBox with frame with title label instead of making title the first item on the list

mortal nacelle
#

Can somebody help me with my foreach loop. I set it up so that if you are 3 meters away from the list of variable names i set for my NPC's, it will exit the script. However, even when i'm like 1m away from the NPC it hates me and says you are too far away..

#
        _nearestNPC = [npc_supermarket,npc_supermarket_1];
        _foundNPC = true;
       {
            if ((_x distance player) > 3) exitWith {
                _foundNPC = false;
                ["You are too far away!"]
            }
        } forEach _nearestNPC;
        if (!_foundNPC) exitWith {};
foggy moon
#

As you have it now, you have to be within 3 meters of all of the npcs for it to return true

mortal nacelle
#

Correct

#

wait

#

All of them?

foggy moon
#

yes, I assume you just intend any of them right?

mortal nacelle
#

Yes, I intend to select the closest one out of that array

foggy moon
#

So invert your selection:

_foundNPC = false;
{
    if ((_x distance player) < 3) exitWith {
        _foundNPC = true;
    }
} forEach _nearestNPC;
if(!_foundNPC) exitWith {systemChat "you are too far away"};
queen cargo
#

please use the proper command ..

private _index = _nearestNPCs findIf { (_x distance player) < 3 }
if (_index == -1) then
{
    systemChat "You are too far away";
}
else
{
    systemChat "All nice and smooth thanks to findIf dude :wink:";
};```
foggy moon
#

Was just working up a findIf version 😆

#

just wanted to show him why the first one didn't work

prime horizon
#

@tough abyss can you change it to weapon list please?

tough abyss
#

Your request is vague, but I will try to answer it. Change name _x to currentWeapon _x

prime horizon
#

done

#

then

#

?

tough abyss
#

Now instead of player names you should see weapon class players have in their hands

#

This is best I can do answering your question mark

prime horizon
#

not this what i mend i mean weapon list

#

that i spawn

tough abyss
#

Yeah no idea what it means sorry

prime horizon
#

but only weapons

#

and weapons items

iron sand
#

How do I access it in public zeus?

tough abyss
#

Oh you want the list of all weapons in the game? Needs config look up

iron sand
#

Like how can I edit the script thing

prime horizon
#

@tough abyss can i add you ?

iron sand
#

Or do I need to be admin

prime horizon
#

@tough abyss so i make a config.cpp in my menu right?

#

then i put the weapon config

#
_weaponConfig = configFile >> "cfgWeapons";
for "_i" from 0 to (count _weaponConfig)-1 do {
_weapon = _weaponConfig select _i;
if (isClass _weapon) then {
_weaponName = configName _weapon;
_ulx = toArray _weaponName;
_ulx resize 7;
_ulx = toString _ulx;
if ((_ulx != "ItemKey") and (getNumber (_weapon >> "scope") == 2) and ((getText (configFile >> "cfgWeapons" >> _weaponName >> "picture")) != "")) then {
weaponList = weaponList + [_weaponName];
};
};
};

for "_i" from 0 to (count weaponList)-1 do
{
_weapon = weaponList select _i;
LBname lbAdd _weapon;
LBname lbSetPicture [_i, (getText (configFile >> "cfgWeapons" >> _weapon >> "picture"))];
lbSort LBname;
};```
#

this is it?

tough abyss
#

You need to get an array from config containing CfgWeapons classes

tough abyss
#

That list contains classes that are not weapons as well, don’t know why you are showing it to me

mortal nacelle
#

Would it be possible to take the position from _x inside a forEach and use the position as a private ['marker'] variable?

robust hollow
#

yea..

mortal nacelle
#

Okay. How?

robust hollow
#

depends what exactly ur trying to do

mortal nacelle
#

well in this case, _x stores the closest npc variable name to the player. I want to get that position of the npc and use it in a marker outside of the forloop

tough abyss
#

There's no mention of it in the wiki but am I correct in assuming that if you attachto a player to an object, setDir now uses that objects relative position instead of azimut?
IE: Chair facing 090 > player attachTo chair > player setDir 180, player facing 270.

robust hollow
#

@mortal nacelle

private _index = _nearestNPCs findIf { (_x distance player) < 3 };
private _position = if (_index == -1) then {[0,0,0]} else {position _nearestNPCs#_index};

then u can use the position whereever u need

#

@tough abyss yes i do believe thats correct.

mortal nacelle
#

Oh my bad I thought you were talking to me

#

@tough abyss

tough abyss
#

Ok. I missed IceShades entry on the wiki somehow smh
np @mortal nacelle

slim oyster
#

while creating a loop with iterations based off of an array element count (count _arrayOfStuff) is there benefits to using for # from # to # step # do { instead of foreach, or is this only when you need to access the index or element itself?

robust hollow
#

imo for is better for if your step is more or less than 1, if you arent searching every index or if you start at the highest element and go backwards.

foggy moon
#

@lewis ```
_foundNPC = nil;
{
if ((_x distance player) < 3) exitWith {
_foundNPC = _x;
}
} forEach _nearestNPC;
if(isNil "_foundNPC") exitWith {systemChat "you are too far away"};

robust hollow
#

he kind of had it before, just didnt understand forEach wasnt the only command to use _x.

foggy moon
#

Right, but it's the cleanest way to exit and return the element reference in one shot iirc

rain mulch
#

Does anyone know how to make the CUP SUV tougher? Trying to make it more resilient for PMC type missions but its armor level is quite low. I know there's the armored SUV but I don't want to be rolling around with a minigun all the time. Also the armor level on the armored one is still pretty weak in my opinion

#

Preferably without editing the config as (I imagine, I could be wrong) I'd have to have everyone in the group download the edited version

foggy moon
#

You could use the handleDamage event handler to reduce incoming damage by a certain ratio

rain mulch
#

Okay, I'll look into that, thank you

lost copper
#

Hi everyone! How i can detect, that unit is unconscious (ACE 3 mod)?

tame stream
#

Hi, can i specify direction for spawning vehicles...below does not seem to work.

_vehicleObject = "Some_vehicle" createVehicle (getMarkerPos "spawn_location");_vehicleObject setDir 0;```
robust hollow
#

well... the default direction is 0 so you wouldnt notice it changing direction.

rain mulch
#

So I found this and it works (sort of): unit_or_vehicle addEventHandler ["HandleDamage", {((_this select 2)/2.9)}]; but every so often, the vehicle fixes itself in random spots

lost copper
#

@tame stream may be that:
Though effects of this command remain local, you can do a setPos afterwards to synchronize the direction on all machines in MP.

myObj setDir 90;
myObj setPos getPos myObj;
tame stream
#

like this then

_vehicleObject = "Some_vehicle" createVehicle (getMarkerPos "spawn_location");
_vehicleObject setDir 90;
_vehicleObject setPos getPos _vehicleObject;```
lost copper
#

yes, try this

tame stream
#

doing it now thx

#

@lost copper thats it sir...thx 🍻

lost copper
#

@tame stream Not at all 😀

tame stream
#

@lost copper one last thing.....

if i want to randomize spawn point between say 6 points how would i go about it

lost copper
#

in then you can add array of markers

#

markers: Array - If the markers array contains any markers, the position is randomly picked from array of given markers plus desired placement position. If any of the markers were given z coordinate with setMarkerPos, the vehicle will also be created at given z coordinate.

tame stream
#

oo shit yeah sorry im on that page just missed it

_veh = createVehicle ["2S6M_Tunguska", getMarkerPos "marker1", ["marker2","marker3"], 0, "NONE"];```
#
_vehicleObject = createVehicle ["Some_vehicle", getMarkerPos "marker1", ["marker2","marker3"], 0, "NONE"];```

What is marker1 for, i get that marker 2-3 are for random placement
lost copper
#

Read again: the position is randomly picked from array of given markers plus desired placement position

tame stream
#
_vehicleObject = "Some_vehicle" createVehicle (getMarkerPos ["marker1","marker2","marker3","marker4"]);```
would this not work
lost copper
#

so pos being picked from array ["marker1", "marker2", "marker3"]

tame stream
#

so spawn to this marker that can be anywhere here... marker 2-10

tough abyss
#

Add selectRandom after getMarkerPos and it will work

lost copper
#

also you can use old syntax like that:

_markers =["marker1", "marker2", "marker3"];
_vehicleObject = "Some_vehicle" createVehicle (getMarkerPos (selectRandom _markers));
_vehicleObject setDir 90;
_vehicleObject setPos getPos _vehicleObject;
tame stream
#

sweet... thats more recognisable

#

imma try both to see how they work, thx guys 😃

tough abyss
#

@rain mulch HandleDamage is more complicated than that and yes the behaviour you described is expected with code like that

rain mulch
#

@tough abyss lol of course it is. Alright thanks, I'll keep digging

radiant egret
#

https://pastebin.com/GpdgFu6e
^ Problem, i need to pass a dynamicly created string with objects into setTriggerStatements condition [Line 21] , tried few hours last night but could find any way to get it to work.

robust hollow
#

L8 you use _objects but it isnt defined

for L11 & 13, creating the condition, you format the object directly into the string which wont work. need to do something like this
format["!alive (objectFromNetID '%1')",netid _t];

tough abyss
#

You cannot just convert object into a string

#

Use bis_fnc_netId and the rest

radiant egret
#

@robust hollow its only the last part of the script, i didnt posted the whole script only the condition problem

robust hollow
#

ahh, that makes sense

radiant egret
still forum
lost copper
#

@still forum ooo, thx!

drifting copper
#

Can I attach myLight lightAttachObject [myVehicle, [-0.5,-0.25,1]]; to any object or does it have to be vehicles?

tough abyss
#

Why don’t you try and share the result?

young current
#

all arma objects are "vehicles"

#

everything is under cfgvehicles

drifting copper
#

OK.

So far I have come semi right with this

if (isServer) then {this setPos [getPos this select 0,getPos this select 1,12]; this setVectorUp [0,0,1]};light1="#lightpoint" createVehicle [0,0,0];light1 setLightBrightness 1;light1 setLightColor [3,.5,0];light1 lightAttachObject [this,[0,0,0]]

But it creates "wash" effect. Looking for a more contained light. SO more a reflector feel than a light-bulb feel.

still forum
#

light points are omnidirectional. there are no directional light points you can spawn. Besides just spawning a object that has a light. Like a worklamp or streetlight

drifting copper
#

Yeah I noticed. Especially after I lit up the ENTIRE altis. I am still fighting with runway lights and still trying to find a solution without having to run a .sqf as it adds weight ( or so I have been told). ^ That works in the init line without the need of a sqf though it is more for ambient / house lighting. Works nice though. Just not for what I want XD

tough abyss
#

Light effects are local, limiting it to isServer will only work for the host

normal monolith
#

Hi guys !
After 2 hours of searching and testing things, i'd like to know if you guys know if there's a possibility to change the size of a text in a RscEdit control and in real time ? 😃

tough abyss
#

ctrlSetFontHeight or something maybe

normal monolith
#

oh

drifting copper
#

@tough abyss Yea good point and did not know. (noob life). In terms of running a .sqf and something like this http://www.armaholic.com/page.php?id=23570 how heavy does it impact on performance? I have been told that sqf files run a loop after ini and takes away processing from the server with a major impact? Is this true?

tough abyss
#

No idea not about to download that to find out. But runway lights should be objects you can place that would emit light by default

drifting copper
#

Only lights I could find does not emit great at all and after running the forums for a bit it seems I am not the only one. Hence starting to look at scripts. Looking for more of "Altis Terminal" but can not seem to have find anything that match. In terms of my question I am more asking in running sqf initializations in general than to that specific one.

young current
#

Arma has big limits in nightime lighting

#

so you cant expect to do very special things with them

tough abyss
#

Not to mention there is a limit on how many light sources you can have defined in video settings

drifting copper
young current
#

can you explain again what were you doing?

drifting copper
#

Making a basic strip. Right now just random placement but placed down the lights I wanted IE edge lights and flush lights. But they hardly emit no light at all and only noticeable with NVG. I started scouring the forums for faults+solutions and general response was to run a script as other people have the same issue. That is how I ended here

young current
#

for dynamic placement?

drifting copper
#

Explain dynamic placement?

young current
#

are you placing a runway somewhere where there is no runway

#

or are you just decorating a runway that is already on the map?

#

and why not use runway light objects?

drifting copper
#

Placing down runway where there isn't. Also only found lights under MBG buildings but nothing else in the editor

young current
#

there is a one way to get them to load in mission here

drifting copper
#

Looked at that. ctrl+f search return 0 results on
Land_Flush_Light_green_F
Land_Flush_Light_red_F
Land_Flush_Light_yellow_F

young current
#

read more

#

also there are mods on workshop that add them/more of them to the editor

drifting copper
#

OK in the meantime I tried it and seems to work even though I could not find the class-name in the document.

tough abyss
#

Land_runway_edgelight_blue_F works fine and seen without NVG

mint kraken
#

So I copied the splendid camera sqf and hpp. I replaced all the function names to the one I made in the sqf. I also removed a few functions I disliked. But when the camera loads it just wont listen to any controls no movements. The camera creates though. I have an idea that it has something to do with the original hpp header, its onLoad. I have also tried the original sqf with my new hpp and it still won't work. I really need help with this as I have been stuck on this for months.
Here is the sqf: https://hastebin.com/xapovocosi.cs
Hpp: https://hastebin.com/nenobenupa.cpp
Original hpp: https://hastebin.com/gucibobewe.cpp

little ether
#

Hey all just looking for a little advice/help on a script.

Now I'm building a trench map for my arma group, the people in the terrain chat have been amazing at helping me learn all that, however no trench mission is complete with a nice bombardment.

I wanted a nice random bombardment, constantly, across the whole map and luckily the script existed nicely; the good ol' DZ_fnc_Mortarfire script I've seen mentioned in a few places.

Now it work perfectly with one exception. It spawns the mortar round on the ground, so you get the barest split second of that mortar "whine" noise, which I think is essential to the experience.

So my question is, how do I take this script: https://pastebin.com/GLVvSD55 and make it so the rounds spawn at a set distance off the ground so that the "whine" occurs for longer?

I'm really not great with arma coding, I tried adding _zcoord and adding that to the _firerun part however I'm sure I did not do it right and of course it did not work.

Even just a prod in the right direction would be an amazing help

young current
#

@mint kraken is there a purpose for the camera system edit? Other than remove stuff you dont like?

#

ah RLRP..

#

so quite possibly you might fare better if you started to create your own camera function based on the splendid camera and add functionality instead trying to take parts out of the original

#

as those parts can affect others and their removal can then break them

mint kraken
#

I firstly don't like the horizontal lines, I don't like the overlay (I know that u can remove it by clicking backspace). And also I have tried using the original sqf with the original hpp (in my mission). Still same issue?

languid tundra
#

@little ether
Can you show what you tried to do?

young current
#

@mint kraken what is the purpose of the new camera?

languid tundra
#

Also the script would look much nicer with params 😄

little ether
#

@languid tundra I deleted it all to make sure the original code went to you guys, I'll type what I tried out again if that would help?

young current
#

what Im after is that perhaps the splendid camera is too complex to begin with and you could do what you want in a simpler way

mint kraken
#

Using it for a Admin "camera" I am working on.

languid tundra
#

Yeah, it would help.

mint kraken
#

@young current If there is a simpler way to make the camera having the functionality of moving. I can add stuff like night vision and map click later. How should I start?

#

I tried looking into EGSpectator camera but that looked a bit more complicated to understand

young current
#

smooth camera stuff like that is never simple

#

but I think you need to build it from ground up to properly understand it

little ether
mint kraken
#

I could make the current code work, but what does onLoad="[""onLoad"",_this,""RscDisplayCamera"",'GUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')"; do? Because I think that is the main cause. If there is anyway to edit it to work with the current code I have. I will be right back in 10-20min

languid tundra
#

Why did you add getmarkerpos _marker select 3?

little ether
#

Simply because it seemed like the trend, figured at least following what came before would get me closer than my feeble attempts

languid tundra
#

You should enable Show Script Errors in the A3 launcher settings. Then you would notice that your script is erroneous.

#

getmarkerpos returns an array with 3 elements, but you try to select a fourth. Like there was a fourth dimension 😄

little ether
#

Right so I don't need to do the getmarkerpos bit, I just need to have the _zcoord on it's own to tell the createvehicle the height desired?

Also thanks for letting me know about the script error parameter

twin steppe
#

Is there a way to spawn water in Arma 3?

tough abyss
#

Yes

#

Pond object

languid tundra
#

Once you removed that additional coordinate, it should work fine I guess.

twin steppe
#

@tough abyss Is that from the terrain builder? Or is it something I can do with commands?

young current
#

there are couple of water/pond object addons on Workshop

#

they work so-and-so

twin steppe
#

I'm trying to spawn it without any mods. I guess vanilla doesn't have an option to spawn water then?

#

Just trying to create a village that looks like its under water.

fleet hazel
#

Guys. How do I intercept the right mouse button.

little ether
#

@languid tundra No luck I'm afraid, I'm probably being dense but it's still saying I'm giving it 4 values. Going to look again

young current
#

@fleet hazel you cant intercept the right mouse button

little ether
#

ah hold on think I worked it out

young current
#

or at least Im 99% sure no one has succeeded in it

fleet hazel
#

@young current While in the inventory menu, if you right-click on the equip it is removed in a backpack or thrown to the ground.

young current
#

yes thats the normal behaviour right?

#

but thats likely related to the inventory dialog

#

what is it you want to do exactly?

fleet hazel
#

@young current I want to create my inventory.

#

@young current If I right-click on an item to see a list with a choice of action. You need to add an action to the right mouse button. I don't know how.

young current
#

ah that is different from intercepting the right mouse button

little ether
#

Well I currently have this; https://pastebin.com/5G6TZSk6 which is working again but just like before is spawning the mortar round on the ground and immediately exploding it, not dropping it from a height

young current
#

getmarkerpos _marker select 2 you can replace this with static 400 for example

languid tundra
#

Holy moly, I forgot to set the timer 😄

young current
#

and each round should spawn 400m up

languid tundra
#

What projectile are you using?

little ether
#

Oh so that section is refering to the z coord?

#

and 60 or 80 mm HE mortar rounds

languid tundra
#

I meant the class name

little ether
#

R_60mm_HE

languid tundra
#

You still have a script error... try this line instead:

_firerun = _ammo createVehicle ((getMarkerPos _marker) vectorAdd [random _xcoord, random _ycoord, _zcoord]);
tame stream
#

Hi, im having a annoying issues with addactions, trying to reduce the distance range it can be used/seen....

current addaction (not working)

this addAction ["<t color='#FF0000'>Reset targets</t>", {0 = [80, iCenter] execVM "scripts\reset.sqf"},_this distance _target < 1];```
#

any suggestions

little ether
#

Okay I'll try that now but funny thing @young current I tried what you said, spawns the mortars travelling left to right across my screen (at the correct height though)

languid tundra
#

You tagged the wrong guy^^

little ether
#

No he suggested to replace getmarkerpos _marker select 2 with static 400

languid tundra
#

My bad

little ether
#

No all good, do you have any idea why this would happen? Script is just this now https://pastebin.com/THLWJbta

Good news is, it's the correct height, bad news is they literally fly horizontal from right to left at 400 meters

languid tundra
#

Well, somehow modify the velocity or vectorUp of the projectile...

tough abyss
#

@twin steppe pond objects are vanilla but they are just models you need createSimpleObject them

little ether
#

Is that as simple as adding setVelocity [x,y,z] in the _firerun? or a little harder than that?

languid tundra
#

Yeah, I thought so too, but didn't get it working so far.

tough abyss
#

"a3\map_altis\data\Water\test_ad_quarry01.p3d"
"a3\map_altis\data\Water\test_dam01.p3d"
"a3\map_altis\data\Water\test_reservoir01.p3d"
"a3\map_altis\data\Water\test_swamp01.p3d"
"a3\map_altis\data\Water\test_wf_lower.p3d"
"a3\map_altis\data\Water\test_wf_upper.p3d"
"a3\map_altis\data\Water\water_tile.p3d" @twin steppe

#

@tame stream look up addAction documentation you can limit distance with param you pass to it

tame stream
#

i have been so far no joy...hence asking question here

tough abyss
#

I doubt it, the documentation is comprehensive

#

I cannot say more than is already said on addAction page

#

You are looking at radius param

tame stream
#

im still learning arma coding, might seem obvious to you but it does not to me

tough abyss
#

I did not say obvious I said comprehensive

tame stream
#

finding the wiki page that info was the first thing i did, then google to try and find examples in order to help myself achieve desired result....i have not managed sofar so this is why im asking here....pasting the wiki link helps zero

#

if you anyone can provide a example or suggests anything beyond wiki links that would be greatly appreciated

winter rose
#

@tame stream, @tough abyss mentioned the radius parameter.

tame stream
#

yes but im struggling to add it to addaction along with activating the script i need

winter rose
#

If you have issues understanding the wiki page format then yes, we can help out with that too

tame stream
#

my question is how do you incorporate it

#

yeah i do, wiki was goto, google youtube after...now here

little ether
#

@languid tundra I thought I might be able to post the setVelocity in the trigger that calls the init, but that's doing nothing either. Is it possible to name the object spawned as a result of the _firerun? as everything I'm reading says do _objectname setVelocity [x,y,z]

winter rose
#

It's a number that you place in the addAction params; I am on mobile right now so I can't help more but add all the params (you can set nil for optional parameters, default value will be used) and when you "reach" the radius element, set your value e.g 5 @tame stream

#
dude addAction ["action text", "script.sqf",(…), 5];```
tame stream
#

ok i gathered as much, radius value needs to be set to desired value...

the example on wiki is...sqf this addAction [ "<title>", { params ["_target", "_caller", "_actionId", "_arguments"]; }, [], 1.5, true, true, "", "true", // _target, _this, _originalTarget 50, false, "", "" ];

im having trouble translating that to what you posted

dude addAction ["action text", "script.sqf",(…), 5];```
im gonna try your suggestion
#

thx

winter rose
#

you're welcome

tough abyss
#

(...) is not real param @tame stream

tame stream
#

yeah error in expression

languid tundra
#

@little ether
Looks like setVectorDirAndUp works.

#
isNil {
    _firerun = _ammo createVehicle ((getMarkerPos _marker) vectorAdd [random _xcoord, random _ycoord, _zcoord]);
    _firerun setVectorDirAndUp [[0,0,-1], [1,0,0]];
};
sleep (random _timer);
little ether
#

oh you beautiful beautiful man, I was going to look into it myself but you pulled through ❤

#

hhhmmmm that crashed my arma with a script error so let me ask a quick question or two;

isNil - this is replaced by the "while {_fire} do{" part of my code correct?

#

Wait.....I think I've been stupid

languid tundra
#

nope, it's what you should put in the while-loop

#

the isNil {} part is just to ensure that the setVectorDirAndUp get executed immediately after you created the object.

little ether
#

ah okay, I'll slot that in and report back

#

@languid tundra Perfect, absolutely perfect. Thanks a ton mate!

west grove
#

oi fellas. quick question.

#

with currentVisionMode i get the... current vision mode, as the name implies

#

is there any way to switch the current vision mode?

#

with ... switchCamera "GUNNER"; i'll get the optics mode, but i would also like to autostart in nvg or tti mode

compact maple
#

hey, does anyone knows why battleye is blocking extDB3_x64.dll ?

tough abyss
#

It is not whitelisted by BE?

cold pebble
#

You using it on a client?

foggy moon
#

I found that build 1.028 was the most recent build whitelisted by BE

#

as of a couple months ago

still forum
#

you don't run it on clients normally, so it doesn't need to be whitelisted

still forum
#

Trying to investigate a profiler bug.
And I found that initFunctions calls a function that randomly either puts a "wetDistortion" effect over your screen and plays music and displays copyright notices on screen.
Or the other random effect is playing music and forcing the player into a dancing animation and setting the variable BIS_IAmDancingHardSince

What the literal F bohemia?
The code responsible for compiling CfgFunctions has code to force the player into dancing animation and playing weird music? WAT?
Actually not only the player. It forces dancing animation on all units 20m around the player.

#

Here if anyone wants to try it out..

_timesActivated = profileNamespace getVariable [ "BIS_IShouldSupportTheDeveloper", 1];

 if ((random 5) < 1) then  {
    _handle = [_timesActivated] execVM "A3\functions_f\GUI\fn_enableAnotherSystem.sqf";
} else{
    [_timesActivated] execVM "A3\functions_f\GUI\fn_enableSystem.sqf";
}
#

It fires if setPos returns true, or playMove returns true.
Hint.. Both return nil.. That makes no sense

slim oyster
#

...what

#

okay

#

it is absolutely true

#

im just going to ignore all that in an attempt to keep my sanity

#

playMusic "Electronic_Track01_H";

foggy moon
#

Entertaining DRM?

winter rose
#

@still forum F.A.D.E?

still forum
#

ye

#

prolly

winter rose
#

hm! according to https://en.wikipedia.org/wiki/FADE , FADE comes from… Codemasters?? I always thought it was an in-house protection…?

FADE (or DEGRADE) is digital rights management software developed by Codemasters. It operates by detecting if a game has been pirated, and initially allows the player to use the game normally. It then gradually degrades certain game features over a time, eventually rendering...

still forum
#

And I thought they dropped that in A3 cuz steam

winter rose
#

it may be a leftover from before the Steam-only decision, too

mint kraken
#

So I wanted to look through how EGSpectator camera works and I found it but there was 1 thing I didn't find which was how they handle the movements of the camera, (WASD), not sure if I was blind... The addons pbo I looked in was functions_f_exp_a.pbo Anyone have an idea where I could find the WASD movements?

winter rose
#

@tame stream could you figure it out?

verbal knoll
#

Hello, i need help, in the gif you can see that the first button that i put is one layer below the text and the rest of the buttons are working well (as i configured in the gui editor) why is that?? i get this problem only in one button and the configuration for all of the buttons is the same. please help me with that. Thanks https://gyazo.com/74acabac5e4f761487fa1b5cd12b81cd

tame stream
#

@winter rose No not yet, dude addAction ["action text", "script.sqf",(…), 5]; this gives error...havent given up yet but had to move on to make progress with mission

winter rose
#

@verbal knoll didn't understand your problem according to the gif

verbal knoll
#

do you see when i put the cursor on the first button

winter rose
#

@tame stream yes, it's because you have to use nil instead of other params you don't want to change

#

iirc radius is param #7 , so you should do dude addAction ["action text", "script.sqf", nil, nil, nil, nil, 5]; or something @tame stream

tame stream
#

that make much more sense

#

ill try that

verbal knoll
#

_button ctrlAddEventHandler ["MouseEnter",{((_this # 0) getVariable "linkedPicture") ctrlSetText format ["Radial_Menu\textures\hover\b%1.paa",((_this # 0) getVariable "index")]}]; _button ctrlAddEventHandler ["MouseExit",{((_this # 0) getVariable "linkedPicture") ctrlSetText format ["Radial_Menu\textures\regButtons\b%1.paa",((_this # 0) getVariable "index")]}];

winter rose
#

@verbal knoll isn't the problem about the text being
only about one line?

verbal knoll
#

this is the script to make it change the picture when you hover on the button

#

@winter rose no i checked it

#

even if its one line in the first button it doesn't work

winter rose
#

the left-most, not the "#2" ?

#

"Registration", or "Second page" ?

verbal knoll
#

registration

#

the registration is #1

#

second page is #8

winter rose
#

is the problem "the button doesn't hover unless the mouse is on top of the text itself"?

verbal knoll
#

yes, it seems like the text is on the button but the layer priority is ------ buttonPicture >> text >> button

#

and the button has no texture

#

so you can see the text but when you click or hover you click on the button

#

do you get me?

winter rose
#

…not sure =]

verbal knoll
#

what did you understand from what i said so i can explain my self better

mint kraken
#

So i have made a display with 2 panels on the side and with EGSpectator open. WASD keys dont work and I am not sure but does it have to do something with focus of the display? Any way I could solve this?

winter rose
#

@verbal knoll I "understood" that the tile effect should be on click and on hover? that's what I don't get, really