#arma3_scripting

1 messages ยท Page 323 of 1

icy mauve
#

*the action does not show up

still forum
#

Not sure if you can even have actions on WeaponHolders

jade abyss
#

hmm

#

Technicaly... hm.. should be possible.

rotund cypress
#

@queen cargo So a ctrlsGroup would pretty much be the only option? What exactly do you mean by "merging together"?

queen cargo
#

exactly that @rotund cypress

rotund cypress
#

I guess it would work fine, but does certainly not seem elegant. From what I've seen with 3DEN etc they're not using that for child displays, yet they show up upon the other display @queen cargo

queen cargo
#

3DEN is done a lot engine-whise

#

you also could create the UI dynamically using ctrlCreate

rotund cypress
#

Ye maybe that is why...however using ctrlCreate does not seem like a good idea so I guess I will stick to a ctrls group then ๐Ÿ˜„

#

ctrlCreate most certainly would not be elegant ๐Ÿ˜„

queen cargo
#

ctrlCreate is pretty elegant actually

#

you just need to code your elements in position

#

that is all

#

some pretty simple process

#

you even could automate it

#

(converting from cpp to SQF/cpp)

rotund cypress
#

Ah ye you mean getting the positions with getNumber or getText etc etc from a hpp

queen cargo
#

actually ... i mean using an external tool to transform
but that also would be possible

rotund cypress
#

Aah, is there such a tool available somewhere? @queen cargo

queen cargo
#

not rly
would not that hard to write though ...

#

you also can catch all that via SQF though

#

it is more or less equally hard

narrow musk
#

The black box you are prompt with showing script errors how do you disable that as everybody in the server can currently see it :3

#

Theres no actual errors just undefined variables as they are defined in another file.

narrow musk
rotund cypress
#

You cant disable client errors showing up if they got scripting errors debug enabled when starting the game @narrow musk

narrow musk
#

Just fixed that it was in the server files i turned debug on and forgot to turn it off...

rotund cypress
#

Just set the undefined variables to a null datatype or soemthing

#

in init

#

aah

narrow musk
#

And good idea to prevent rpt spam, didn't think of that

#

Any ideas on the menu?

dry egret
#

has anyone here done anything with cfgMusic?

#

im trying to figure out a way to get the music to fadeOut while its still playing and then stop the track once its muted

#

nevermind i found the issue lol

#

/facepalm

#

is their anyway to stop a music track mid play?

rotund cypress
#

addmusiceventhandler

#

stopmusic

sour drift
#

I'm curious, is there a way to overwrite a terrain's geolocation via script somehow? Someone was setting up a MP server and was tyring to think of a way to keep people from using gamma from having the upperhand over people actually playing the game properly and using nightvision. I was thinking if you could overwrite the geoloc to somewhere where it doesn't get really dark at night, bam.

dry egret
#

reason the fadeMusic was not working was due to aceHearing overiding the setting, so for the intro i disabled it

#

@sour drift will setting the date so that night time is under a full moon not work?

sour drift
#

eh that doesn't have the best effect. For starters, there's still a period of almost pitch black before moon enters sky

#

and people using gamma still have upperhand.. if the sky was brighter, I'm thinking turning up gamma would blind you, but having nightvision would still be effective.. dunno maybe my thinking is flawed

dry egret
#

only thing i can think of is by running some sort of postProcessing effect via script

sour drift
#

on init or something.. dunno I know jack sht about scripting, I've just been making terrain for 2 years =p

dry egret
#

im kind of in the same boat, but i can disect scripts and see how they work lol

#

still looking up how the addMusicEventHandler works

#

dont think you can use that to stop the current track playing

#

the addMusicEventHandler will return an event when the music stops playing but nothing about actualy stoping an already playing track

#

@sour drift is the mission some sort of PvP?

sour drift
#

wellll I think they're planning on using Exile and tinkering with it a bit, less survival and more tactical or something

#

so yeah pvp

#

Wasn't really looking for a working script though, just was wondering if it would be possible, thanks =]

#

It would be the latitude and longitude settings in the terrain's config.cpp that would need to be overwritten... which I assume that would be the same as changing the starting time/date.

limpid pewter
#

can i use: (findDisplay 46) createDisplay "someDisplayName"; To create a display that will show on the player's screen and not take over their mouse? If not how would i go about creating a display that will be constantly there, and not take over the player's control?

jade abyss
#

I guess you want "RscTitles"

limpid pewter
#

ok, is that a kind of display?

#

@jade abyss

#

i am about to try this ```sqf
cutRsc [display name , "PLAIN", 10, false];

jade abyss
#

Yes

limpid pewter
#

cool

#

so all i need to do is that, and then closeDisplay to close it?

#

This will show the dispaly, and the player will still have control of his character?

jade abyss
#

Yes + There are alot of example on google.

#

It acts like an overlay

subtle ore
#

(findDisplay _coolRsc) cutRsc["","PLAIN"]; ?

jade abyss
#

Not even that

limpid pewter
#

@jade abyss Tahnks

subtle ore
#

Are you implying it requires less or are you saying I'm not even in the ballpark?

limpid pewter
#

on the wiki there are two syntaxs

#

one requires the findDisplay thing, the other doesn't which is correct?

jade abyss
#

e.g.

waitUntil { !(isNull (findDisplay  46)) };

41 cutRsc ["MyRscTitleName","PLAIN"];```
Also works:
```sqf
0815 cutRsc ["MyRscTitleName","PLAIN"];```
limpid pewter
#

ok so 41 is the geneeric display that all other displays can be created on?

jade abyss
#

No, 41 is the one i used, because of: Distrikt41 ๐Ÿ˜„

limpid pewter
#

layered on*

#

oh ok

jade abyss
#

You can choose (almost) any number

#

Thats why the example with 0815

limpid pewter
#

ok so the idd of the display?

jade abyss
#

...

#

You can choose (almost) any number

subtle ore
#

can't you also allow it to assign a random number?

limpid pewter
#

why do i need a number at all? what is it's significance?

jade abyss
#

1,2,3 is a bad choice, obvioulsysfkingfon fkn hate that word
*obviously (hate)

limpid pewter
#

lol

#

@subtle ore so that number is the numberr that cutRsc assigns to the dsiplay being created?

limpid pewter
#

either way, i will try and figure it out

jade abyss
#

Oh, since 1.57 also with LayerName. Nice to know

subtle ore
#

You can also immediately remove resource with cutFadeOut command: ๐Ÿคท

limpid pewter
#

ok, so one display/dialog can have many layers, each with its own number or name yes?

#

if not, don't worry, i will stop asking

jade abyss
#

Display, yes. imho it should also work with Dialogs.

limpid pewter
#

ok thanks for your patience and your help

jade abyss
#

+Take care, that you have onLoad setVariable stuff set up.

#

Example how to access a specific Ctrl in an RscTitles Layer:

disableSerialization;
_Display = uiNamespace getVariable ["MyRscTitlesName",DisplayNull];

(_Display displayCtrl SelectedCtrlIDC) ctrlSetStructuredText parseText format["<t size='%3'><t align='center'><t color='#FFFFFF'>%1 | %2</t></t></t>",2, 5, (0.88 * safezoneH)];```
( (0.88 * safezoneH) = specific Size, so it's in every UI-Size the same height/width)
limpid pewter
#

ok thanks

jade abyss
#

F5 the page.

limpid pewter
#

i need to do this so that when i go to create the RscTitle latter, in another script , it will know wht MyRscTitleName is?

#

like if i said ```sqf
35 cutRsc ["MyRscTitleName", "PLAIN"];

#

?

jade abyss
#

Yes, as long as it's in the RscTitles part of (e.g. for missions) description.ext

limpid pewter
#

ok thanks, its weird, i haven't needed for createDialog, is that a different case?

#

createDialog usually works well, without the whole onLoad = blahblahblah thing

jade abyss
#

Otherwise you wouldn't be able to access it.

limpid pewter
#

yeah that makes sense.

#

call My_fnc_To_Update_The_RscTitles; This fnc you put in the example, why do you need it, if you have already saved the RscTitle's name into the uiNameSpace?

#

nvm, i just found a blog on killzone kid about it

#

i will find all the answers i need there, thanks

jade abyss
#

rgr

limpid pewter
#

@jade abyss it's all working now, thanks for you help

subtle ore
#

Is there any absolute textbook method for looping? Or is it completely contextual?

dusk sage
#

๐Ÿค” ?

jade abyss
#

๐Ÿค”

subtle ore
#

Oh come on now, I wasn't being that vague. I was implying something other than while{true} do {//this is definitely true};

simple solstice
#

and use forEach whenever it's applicable

#

there was a kill zones guide for that

dusk sage
#

Using something when it's applicable applies to most things

simple solstice
#

yeah but loops are common go to solutions when something can be done easier with event handlers and forEach

dusk sage
#

a forEach is a loop

simple solstice
#

but a more efficient one, isn't it?

dusk sage
#

Depends what you're doing exactly

simple solstice
#

as loops I meant while True and for

dusk sage
#

Specifically for iterating a collection

simple solstice
#

the common ones for newer to scripting

dusk sage
#

Count loops out perform forEach loops, assuming you don't need forEachIndex of course

simple solstice
#

oh, that's new for me

dusk sage
#

Really depends on what you're doing. At the end of the day, unless you're trying to shave fractions of a millisecond off, it's irrelevant ๐Ÿ˜‰

simple solstice
#

yup, but some things just can be easier to write with forEach and Event handlers.

#

wish there was an engine function to either make player go out a vehicle with or without a weapon

queen cargo
#

write with forEach and Event handlers wondering what event could be catched via a game loop ...

#

you have to prevent him moving with weapon then in first place

#

there also is SwitchMove that might be helpfull

simple solstice
#

yeah I'm just using a EH getoutman and action switchweapon

queen cargo
simple solstice
#

I meant just an engine function like canWalk true/false

queen cargo
#

would require some more work though due to you being in need to provide the correct move for the correct gun

simple solstice
#

or forceWalk, whatever you know the drill

limpid pewter
#

Is there a way to create a command from a function. Say if i had a function called mld_fnc_MyFunction that required 2 params. Is there a way that i can make into a command, so that i can just type ```sqf
[_test1 , _test2] function;

warm gorge
#

No

limpid pewter
#

: ( thats annoying

#

i mean kinda like the way you can make bash scripts in linux, and then use them as commands later

#

but if no, ok ๐Ÿ˜ƒ

cedar kindle
#

macros is the closest you'd get

simple solstice
#

well you could create a function that you give params to and the function returns a value

#

if that's what you mean

#

say you want something like that

myaddedvalue = [15,30] call my_fnc_addup;
#
my_fnc_addup

_value1 = _this select 0;
_value2 = _this select 1;
_result = _value1 + _value2;
_result
limpid pewter
#

@simple solstice yeah. i am doing that atm, but i was trying to get away from having to write spawn or call and My_fnc_ every time i want to run a function

simple solstice
#

dont use spawn unless you need to suspend

limpid pewter
#

i need to suspend ๐Ÿ˜ƒ

simple solstice
#

there's not other way then other than this or macros

limpid pewter
#

yeah, its ok, just wanted to ask

#

thanks for you help

simple solstice
#

๐Ÿ˜Š

still forum
#

@limpid pewter Is there a way to create a command from a function. Yes Intercept can do that. But syntax would be function [_test1, _test2] or _test1 function _test2

limpid pewter
#

intercept?

still forum
#

You need some C++ knowledge to use it though. And doesn't work with Battleye

#

But it does exactly what you need

limpid pewter
#

ok

#

yeah, i thought there had to be a way to do it

#

thanks

simple solstice
#

@still forum is Intercept ever going to be whitelisted by Battleye or is that non-possible?

still forum
#

It is definetly possible. We aren't doing anything that Battleye considers as malicious anymore. But we never asked BE if they would whitelist it

#

Even if they don't want to.. The likelyness that they would accidentally whitelist it is quite high. They also whitelisted my script debugger that allows anyone to execute arbitrary scripts anywhere. While noone asked for it to get whitelisted

vapid frigate
#

that's stupid.. whitelisting a potentially malicious private 'hack'

still forum
#

Yeah. But apparently Battleye whitelists everything if enough people try to load it over some time.

queen cargo
#

which can get problematic especially with the debugger ๐Ÿ™ˆ

nocturne basalt
#

Hi. I'm hoping some experienced scripters will see this xD
I have GunnerTurrets and CargoTurrets in my VTOL. I want the Cargo positions to be able to enter the gunner positions (in same compartment), but only when certain conditions are met. I dont want them to be able to do it when Guns are turned in.

can this be done in a script? (change compartment when animation == 1 or something?)

queen cargo
#

if you want to disable, create a dummy gunner

#

when condition is not met

#

if you want to enable

#

use addAction

nocturne basalt
#

ah so I can spawn an invisible gunner to take the spot? brilliant

#

@queen cargo
do you think you could post an example of using addAction for this purpose?

queen cargo
#

addACtion should be used to get a non-manable gunner slot manable

#

not to get it "forbidden" when default is that the slot is manable

#

to spawn a dummy, just add event handlers to the vehicle via addEventHandler

nocturne basalt
#

ok ty I will try

delicate lotus
#

@still forum wait you have a script debugger, which can execute scripts anywhere and its whitelisted by BE because a lot of people downloaded it?

queen cargo
#

ArmA.Studio @delicate lotus is build around it
and yes, the range of ArmA.Studio was enough (that and the fact that the game always loads it)

#

exact details about how and why is not known though

delicate lotus
#

I found his thingy on github

#

and how does one use that thing?

queen cargo
#

did you read my msg?

#

ArmA.Studio

#

go

#

download it

#

put the debugger in your

#

or wait

#

mb i should link the wiki

delicate lotus
#

yes pls

queen cargo
#

hf
it is stable enough
though i would recommend using the AppVeyor in-dev build instead

delicate lotus
#

okay, thanks

queen cargo
#

no proble

#

m

#

mb i also should start implementing the pbo-build feature

#

so many todos ...

still forum
#

Or maybe conditional breakpoints? :3 So that people actually really can execute arbitrary scripts? ^^

queen cargo
#

that actually is a thing of few minutes

#

more or less

#

requires new dialogue

#

can do that today if ya want

still forum
#

I have no need for that right now ^^

delicate lotus
#

wait so you can execute scripts on normal game servers with that?

queen cargo
#

game servers not currently due to the debugger being limited to local computer right now

#

but it is planned down the road

still forum
#

You could join Battleye protected servers. And place a conditional breakpoint. And it's condition is arbitrary SQF.
But not anymore. As the Debugger should not be whitelisted anymore. I hope..

delicate lotus
#

still you could edit variables with that

#

like the money on altis life

#

and then broadcast it using publicVariable

queen cargo
#

you could do that before already ...

#

debugger should also be blacklisted by BE

tough abyss
#

hey guys need some help

#

default {[visiblePosition _x select 0, visiblePosition _x select 1, ((_x modelToWorldVisualWorld [0,0.1,0]) select 2)+.5]};

#

_idc ctrlSetPosition [_sPos select 0, _sPos select 1, 0.4, 0.65];

#

yet i cant get it to move down

#

_idc ctrlSetPosition [_sPos select 0, (_sPos select 1) -0.9, 0.4, 0.65];

#

would that work

#

_idc = _ui displayCtrl (iconID + _forEachIndex);

#

whats number 2 from above comment

#

thats the full thing

#

im lost but thats not hard

#

yea i cant figure this out lol

#

my life

#

its prolly quiet clear but i do not undestand what you mean

#

it works but i cant get it to be above the head

#

its just going high

#

modelToWorldVisualWorld

#

i guess i should use the old 1

narrow musk
#

Anybody got the scripts that used to be hosted on the old altis life rpg website for the taxi?

tough abyss
#

dont think so

#

i can check my files for you

#

i think we just made our own

narrow musk
#

Ah i dont expect you to share what you created somebody publicly released one, thanks tho :p

tough abyss
#

@narrow musk taxi as in an ai driver? if so epoch forums has smth like that public

narrow musk
#

No i mean the job taxi driver for altis life, that sounds pretty cool tho if i cant find it ill just create my own ai taxi for malden.

tough abyss
#

ah ok

subtle ore
#

Anyone know how I can locate the position of those hangar lights in Land_Hangar_F via script or am I going to have to find them all manually? Last I checked you could find a geometry position and select it?

simple solstice
#

maybe nearestObjects or nearestObject?

subtle ore
#

would that pick up on the lights? Because afaik they're just a part of the model they serve no purpose further than asthetics

#

Even worse, it doesn't even collide with bullets, objects. So I don't think commands like intersect or lineintersects would work since it's based off of raycast collision?

subtle ore
#

@little eagle thanks, I'll take a shot at it.

#

selectionNames is returning nothing.

hollow lantern
#

I guess a crate is no entity?

subtle ore
#

@hollow lantern Huh? I'm not sure what you are talking about, it's the hangars.

hollow lantern
#

I guess it wasn't related to your stuff ๐Ÿ˜› sorry ^^

little eagle
#

If selectionNames reports nothing then all you can do is to find the positions yourself. Best would be to get them in model space, so you can get them from any hangar once you fiddled with one.

subtle ore
#

@little eagle Well shit, I was hoping I didn't have to. Thanks for the help.

#

@hollow lantern yeah, no worries.

dusk sage
#

Do you know what #include does

#

And how the preprocessor works?

tough abyss
#

Is it possible to hide the player model but to keep the collision?

still forum
#

@hasty violet Yes. If your code get's recompiled a lot. So execVM for example.
But that's just because larger code needs more time to compile. And by including anything you are making your code larger

#

But if you use SQF in a responsible non-retarded matter. Then the answer is no.

abstract shuttle
#

Is there any way to remote control an object as a player so you're able to walk with it? No problem if a modification is necessary to solve that problem ๐Ÿ˜ƒ

dusk sage
tough abyss
#

I wonder if you can do that to animals. I know with seagulls you can but haven't attempted other animals

tame portal
#

@tough abyss Should work for fine

warm gorge
#

Not sure if this is the right topic to ask in but does anyone know any good guides/tutorials on battleeye filters? Trying to understand them

halcyon crypt
polar folio
#

does anyone know if there is an empty or near empty dialog in the ui_f config that could be used as a base for scripted dialogs populated with ctrlCreate?

polar folio
#

this works, in case someone needs it.

createDialog "RscDisplayHintC"; 
 
{ 
 _x ctrlShow false 
} foreach (allControls (findDisplay 57))
halcyon crypt
#

there's also RscDisplayEmpty

#

according to the BIKI ๐Ÿ˜›

little eagle
#

RscDisplayEmpty only has one control - the vignette. So it should be perfect for createDisplay, but not so much for createDialog.

#

As that would double show the vignette...

pulsar anchor
#

Is there a sexy way to get armas root dircetory ingame? Mission root is no problem, but i couldnยดt find arma root...

still forum
#

@pulsar anchor What for? I don't see any use for that ingame.

rotund cypress
#

I guess for getting ArmA default assets? @still forum @pulsar anchor

#

But doesnt just \A3... work ?

still forum
#

If you have filePatching enabled you can load files outside of Arma directory (I think) But by default it already is inside Arma directory. So I don't see any use from SQF where you could need that

subtle ore
#

I'm also pretty sure you can whitelist file extensions like .php , html etc.

#

Ex: "\a3\ui_f\data\igui\cfg\actions\heal_ca.paa"

pulsar anchor
#

Its not about the assets, its about a extension dll. Just thinking about possibillities^^

warm gorge
#

serverTime or time for displaying server uptime to players? From what ive read, both suffer from sync issues and lag

vapid frigate
#

what could you do with a dll by accessing it inside the engine @pulsar anchor ? you would only be able to read it as text at best?

cedar kindle
#

serverTime is broken afaik. Time is not synced

#

use CBA_missionTime if you can

#

tho none of them are uptime really

frosty cave
#

not scripting, but !upt if using BEC

limpid pewter
#

hey, how would i get an array of all the weapon attachments? maybe something like this```sqf

_muzzle = getArray (configFile / "CfgWeapons" / Myweapon / "muzzle");

#

or maybe ```sqf

_all attachments = getArray (configFile / "CfgWeapons" / "accesories");

warm gorge
#

First step would be using >> instead of /

still forum
#

@pulsar anchor Why do you need the Arma directory for an Extension?
You can easilly grab it within the extension.

warm gorge
#

@limpid pewter Something like this should work:

_compatibleItems = [];

{
    _temp = getArray (configFile >> "CfgWeapons" >> _typeName >> "WeaponSlotsInfo" >> _x >> "compatibleItems");
    _compatibleItems append _temp;
} forEach ["CowsSlot", "MuzzleSlot", "PointerSlot", "UnderBarrelSlot"];
#
_weaponClass = "";
_compatibleItems = [];

{
    _temp = getArray (configFile >> "CfgWeapons" >> _weaponClass >> "WeaponSlotsInfo" >> _x >> "compatibleItems");
    _compatibleItems append _temp;
} forEach ["CowsSlot", "MuzzleSlot", "PointerSlot", "UnderBarrelSlot"];
#

Change weapon class to your weapon

limpid pewter
#

ok, that looks like it will do

#

thanks, yeah just did a hint, it works

warm gorge
#

Even simpler than that, just found a BIS function that does the same thing, BIS_fnc_compatibleItems

#

So [_weapon] call BIS_fnc_compatibleItems

limpid pewter
#

ahh nice thanks

polar folio
#

@halcyon crypt oh thx! just saw it

shadow sapphire
#

Would there be a simple script I could place in the init of a turret to change which side it was on?

#

I can spawn turrets on different sides with a script, but I don't know how to place on in the editor, but have it be a different side than what it was designe to be.

unreal siren
#

Hey guys! I haven't had to bother people with my shenanigans in a while. So the goal today is to use startLoadingScreen until all playableunits are loaded in. Effectively preventing any initial desync from the mission. The problem: playerReady is reported as "undefined".

#
if (isServer) then {

"playerReady" addPublicVariableEventHandler {readyList = (readyList +1);
    if (count readyList == {isplayer _x} count playableunits) then {
        allReady = true; publicVariable "allReady";
        };
    };
};
if (hasInterface) then {
startLoadingScreen ["Loading My Mission"];
waituntil {!isnull player};
playerReady = true;
publicVariable "playerReady";
waituntil {(time>0) && (allReady)};
progressLoadingScreen 0.5;
//Batch of code
//Batch of code
//Batch of code
endLoadingScreen;
};
#

My guess is I'm not broadcasting allReady as intended

little eagle
#

I assume you're creating the units via script? Or what else do you mean by "initial desynch"?

unreal siren
#

It's an extra step to ensure the mission starts at the same time for everyone

little eagle
#

That is not desynch then.

#

Honestly, the easiest thing would be to just have the admin wait in the lobby until everyone loaded in.

#

The waituntil {!isnull player}; you're using has nothing to do with this, so you cannot use it like that.

#

wait in the lobby wait in the briefing

shut flower
still forum
#

Where is that function even Documented?

#

Can you give me the function syntax?

#

void __stdcall RVExtensionVersion(char *output, int outputSize)
That will be RVExtensionVersion@8 then

shut flower
#

Is there a generic rule why it is @8?

still forum
#

Added to wiki

#

size of Arguments

#

char* is 4 and int is 4. 4+4=8

shut flower
#

Oh wow, ok, makes sense ๐Ÿ˜„

#

Thanks

simple solstice
#

Is there any way of using something like find in nested arrays?

dusk sage
#

Sure, just iterate through your elements, however deep you need to go. BI have a function for this IIRC

#

I also think KK made a blog post about it

simple solstice
#

Well I have something like that

[[142,"Johnny"],[153,"Bob"]]
#

And I would like to search if for example 142 is present, and then select the string

#

Now im just doing it without nesting, by finding the id, adding +1 to it and selecting. Works fine, but I was just wondering if you can use find in nested arrays.

dusk sage
#

For something as trivial is this, your method is absolutely fine. They don't provide a command to do such a thing (all in one) AFAIK, so a basic SQF implementation is fine

simple solstice
#

ok, thank you ๐Ÿ˜Š

still forum
#

is _this in Eventhandlers that only have one argument (Like Deleted) still an array with one element? Or is it the one argument as value?

dusk sage
#

Array @still forum

still forum
#

Thank you! Thanks to your advice I can keep working :3

#

And I know I did alot of stuff wrong yesterday

shut flower
#

afaik yes

#

If no value is returned, the default damage processing will be done.

still forum
#

Yes. That would be Nil.
But does "default damage processing" equal the damage parameter's value.

#

The eventhandlers wiki is not very informative if a handler returns something or not. I guess I'll add a column

shut flower
#

If it is build consistent the "default processing" is the damage value itself

#

Is it not possible to create a wiki account any more? I'm quite sure I had one but I it's not working any more (even password recovery not working)

still forum
#

It's not been possible for years afaik

#

I'm Admin I can create you one

shut flower
#

would be nice

still forum
#

I'll PM you in a sec

still forum
#
void intercept::post_init() {
 addEventHandler<eventhandlers_object::Fired>(sqf::player(),
  [](object unit, string weapon, string muzzle, string mode, string ammo, string magazine, object projectile, object) {
   sqf::system_chat(sqf::format({ "%1 fired %2 with %3 resulting in %4",unit,weapon,ammo,projectile }));
  }
 );
}

I'm happy now.

spark phoenix
#

For RscDisplayInventory's control SlotPrimary and all the other controls that extend it: The config viewer says they have type 11
However, when the ctrlType command is used. It returns 103 (CT_ITEMSLOT).
This contradicts the descriptions of the command which reads
Returns number representing the type of control, which is also defined by type property in config.

still forum
spark phoenix
#

@still forum alright ill post there but leave the information about ctrlType

hearty plover
#

Hey folks.

#

I am wondering if this already exists before I get started.

#

Looking for a way to have my players requistion weapons / ammo / etc

#

Whats out there so far for this?

serene vector
frosty cave
north sail
#

I'm assuming a SoundPlayed event handler doesn't fire because it isn't coming direct from the player character, right?

frosty cave
#

Didn't think to check SoundPlayed yet

grand berry
#

Does anyone know how to set the exported variables from the CBA mod settings? For example there are some TFAR variables that cannot be set from the module.

north sail
#

@frosty cave I don't expect it to work, but if it does, lmk. I'm curious now.

frosty cave
north sail
#

Anybody know a scripted approach to checking which CustomInfo panels a given vehicle has available? I've been checking the config for the classes listed in the BIKI article but some vehicles provide a Panel that isn't in the config. Eg the vanilla unarmed Hunter offers a MiniMap panel in the driver's seat, no MiniMap in the passenger seat, and doesn't have the related DisplayManager Components class in the config at all.

north sail
#

I wonder if enableGPS = 1; in the vehicle config is overriding any present or absent DisplayManager* classes

north sail
#

Question re performance: In a local-only script / client-side addon scenario, is there any benefit to storing a variable on the player object rather than the mission namespace?

#

or vice versa

#

In a basic test with strings, storing on the player object was faster, but retrieving was slower than the mission namespace - so it kind of balanced out. But are there any other best practice reasons?

jagged halo
#

i'm rtrying to limit an arsenal to a specific set of units

#

but nothings happening'

#

dodarray = [DOD1];

if (player in dodarray then {
{
["Open",true] spawn BIS_fnc_arsenal;
}
else
{
hint "You are not authorized for this equipment!"
};

#

any ideas?

north sail
#

if (player in dodarray -> if (player in dodarray)

jagged halo
#

oh derp

north sail
#

also you have an extraneous { after then

jagged halo
#

dodarray = [DOD1];

if (player in dodarray then)
{
["Open",true] spawn BIS_fnc_arsenal;
}
else
{
hint "You are not authorized for this equipment!"
};

//

#

no

#

thats not right

north sail
#

if (player in dodarray) then {

jagged halo
#

dodarray = [DOD1];

if (player in dodarray) then
{
["Open",true] spawn BIS_fnc_arsenal;
}
else
{
hint "You are not authorized for this equipment!"
};

//

#

dodarray = [DOD1];

if (player in dodarray) then {
{
["Open",true] spawn BIS_fnc_arsenal;
}
else
{
hint "You are not authorized for this equipment!"
};

//

#

hmm still nothing

#

dodarray = [DOD1, DOD2, DOD3, DOD4, DOD5];
if (player in dodarray) then {
{
["Open",true] spawn BIS_fnc_arsenal;
}
else
{
hint "You are not authorized for this equipment!"
};

north sail
#

youve still got that extraneous {

jagged halo
#

Where?

#

oh

north sail
#

if (player in dodarray) then { {

jagged halo
#

awesome thanks

#

sorry

north sail
#

Count your braces. The { and '}' should tally up the same

jagged halo
#

that was retarded

#

apreciate it

north sail
#

np, gl.

jagged halo
#

another issue i have been banging my head against: i'm trying to whitelist a virtual arsenal. I figured i could just put an array where the true is in this following statment:

#

["Open",true] spawn BIS_fnc_arsenal;

#

but it does not seem to work

#

am i reading the documentation wrong?

#

so it would be for example

#

"Open",["arifle_MXC_F"]] spawn BIS_fnc_arsenal;

subtle ore
#

@jagged halo addVirtualWeaponCargo is the function you are looking for, remove to remove a weapon vise versa

jagged halo
#

ah kk

#

so that will add all the things in the []?

limpid pewter
#

hey, i have a possibly quick and easy question. Is there a way to make all explsive devices (nades, rpgs, claymores,etc..) do way less damage to infantry?

jagged halo
#

you can edit the damage multiplyer in Ace i think

#

or it might be alive

#

can't remember

subtle ore
#

ex: [mySuperNeatBox,["myCatLauncher_F","myCookieLauncher_F","Rock_F"]] call bis_fnc_addVirtualWeaponCargo;

jagged halo
#

but if i want it to call on whatever box the script is attached to

#

instead of the named box?

subtle ore
#

that's where the first parameter comes into play mySuperNeatBox can be any object

jagged halo
#

ok does it have to be a weapon or can it be any equipment

subtle ore
#

you can also (see the biki link) automatically add the virtual arsenal action without an arsenal function call

#

it has to be a weapon in this instance, you have the same variants for items, magazines, and backpacks

jagged halo
#

ok so i need to seperate it out into lists, that might be the issue

#

theres no catch all for items in general?

subtle ore
#

ex: [mySuperNeatBox,["MyPinkBackpack"]] call bis_fnc_addVirtualBackpackCargo; etc.

#

are you talking about to deffer between items, backpacks, and weapons?

jagged halo
#

like i want to just dump the whole RHS items list i ripped out of a mission file

#

thats not seperated into types of gear

subtle ore
#

You could do something like this: {if(_x isKindOf["Rifle",configFile >> "CfgWeapons"];) then {hint "It's a rifle!";};} forEach mySuperRHSBigList;

jagged halo
#

might just be easier to seperate the things i guess

subtle ore
#

Not necessarily, I don't see as to why this would be harder than sorting them individually?

jagged halo
#

this is the code and the error its throwing up

subtle ore
#

firstly, you have as tray comma at the end of that array

#

and parameter zero of that addVirtualWeaponCargo is not a string

jagged halo
#

ok

#

[anypotatobox, ["rhs_weap_m4", "rhs_weap_m4_m203"]] call BIS_fnc_addVirtualWeaponCargo;

#

like that?

subtle ore
#

Precisely.

jagged halo
#

and i have to name a box that

#

but if i want to call this script on a 2nd box?

subtle ore
#

That's when you make a function out of it or something. Whenever I run things multiple times I just call it with different params

jagged halo
#

ok so thats probably what i will have to do

subtle ore
#
[_box,_aow] call bis_fnc_addVirtualWeaponCargo;```
jagged halo
#

because i want the zeus to be able to add this code to a box which calls to the SQF that checks if a player is in an array. If they are in an Array they get acces to a specific list of items if not they get a hint.

subtle ore
#

Wait, Zeus can execute sqf? Since when?

jagged halo
#

through ares can it not?

#

this addAction["<t color='#FFFFFF'>Ammobox</t>", "AuthAmmo_PUB.sqf"];

subtle ore
#

Ooohh. My bad! I was thinking vanilla.

jagged halo
#

so it would add that which would hypothetically call to the sqf which would do the check

#

pubarray = [PUB_1, PUB_2, PUB_3, PUB_4, PUB_5];
if (player in pubarray) then {
[anypotatobox, ["rhs_weap_m4", "rhs_weap_m4_m203"]] call BIS_fnc_addVirtualWeaponCargo;
}
else
{
hint "You are not authorized for this equipment!"
};

#

but with this code is only works with anypotatobox

subtle ore
#

well addAction takes parameters differently.

jagged halo
#

ok

#

what would you recomend i look into?

subtle ore
#

selection zero is the object you added the action to, and selection one is the user using the action

jagged halo
#

is there some sort of this function?

#

that will pull whatever is calling it?

subtle ore
#

Here, give me a moment and I will give you an example.

jagged halo
#

and use as selection zero

#

thanks

subtle ore
#
pubarray = [PUB_1,PUB_2,PUB_3,PUB_4,PUB_5];
[_obj, ["rhs_weap_m4", "rhs_weap_m4_m203"],false,false] call BIS_fnc_addVirtualWeaponCargo;
if (_player in pubarray) then {["Open",false] call bis_fnc_arsenal;} else{hint "You are not authorized for this equipment!";};```
#

this is super rough, but basically it adds the weapons but only opens the arsenal if the player is in your pub array there

#

and your this addAction["<t color='#FFFFFF'>Ammobox</t>", "AuthAmmo_PUB.sqf"]; should be just fine for this, as I believe the parameters are already passed from the action

jagged halo
#

ok thanks a lot i apreciate it!

subtle ore
#

yep.

#

Just make sure all of your pub array items exist in the game, otherwise it's not going to understand what to check for.

jagged halo
#

ok

#

gonna sleep and look at it properly in the morning

#

thanks again

subtle ore
#

Yep, sure thing.

jagged halo
#

just one last thing @subtle ore when i plug that in the arsenal opens up but the items don't show

subtle ore
#

@jagged halo I made a mistake, params are backwards. Use this: params["_obj","_player"];

jagged halo
#

now its saying PUB_1 is not authorized

#

or wait

#

1 sec

#

yeah thats what it was before

#

no weapons

subtle ore
#

Hmmm..so the arsenal does open up though yes?

jagged halo
#

yes just no items

subtle ore
#

I could be totally be making a mistake here, stick with me here one moment

jagged halo
#

no problem

#

sorry im falling asleep, let me hit you up tomorrow

#

thanks for your help dude

subtle ore
#

Okay, not a problem. I'll figure this out, shoot me a direct message in the morning and I'll let you know. See you later.

jagged halo
#

Cheers!

vapid frigate
#
blufor reportRemoteTarget [[[vehicle]] player, 60];``` this is wrong right?
#

example from the biki

subtle ore
#

yeah it's wrong. [target, time]: Array

#

needs to contain the two items, the target then then time.

vapid frigate
#

yeh, so should just be [vehicle player, 60];

subtle ore
#

Yep.

tough abyss
#

Are there regular expressions in SQF or CPP/HPP?

vapid frigate
#

nope

#

that's an extension (dll) to do it, but not sure if it's been updated for 64 bit

subtle ore
#

well, didn't he also have a tutorial for 32 bit extension conversion to 64 bit?

dry egret
#

i need some help on making mission peramaters

#

iv alraedy got the peramater defined in the correct class

#

but im having an issue with getting an if statement to work with it in the init.sqf file

#

description.ext

class Params {
     class f_param_headless
     {
    title = "Headless Client";
    values[] = {0,1};
    texts[] = {"Disabled","Enabled"};
    default = 0;
     };
};
#

init.sqf

//Headless Client
if (f_param_headless == 0) then 
{
    execVM "headless\HCInit.sqf"; 
    HCDebug = 0;
};
#

i was thinking i could call it like this but its saying undefined variable

dry egret
#

that shows me how to define one but not how to properly call it

halcyon crypt
#

you need to read further ๐Ÿ˜›

dry egret
#

not seeing it cause the only one that is close doesnt show how it works

dry egret
#

thats showing me how to defind peramaters of built in arma functions for that second link

halcyon crypt
#

omg

#

"f_param_headless" call BIS_fnc_getParamValue

subtle ore
#

Yep, mission had no idea what "f_param_headless" is on it's own

#

BIS_fnc_getParamValue returns a number by the way. So if((["f_param_headless"] call bis_fnc_getParamValue) > 0) then { ];

dry egret
#

when a paramater is defined via the description.ext, the mission wont know about it before hand unless you make that call bis_fnc_getParamValue?

dry egret
#

@subtle ore thank you for helping me understand how it works ๐Ÿ˜ƒ

vapid frigate
#

not sure if it will, but you could check what the function does in the 'functions viewer' (or on a properly extracted P drive) and do it yourself if it doesn't and you need it to

dim owl
#

Hi guys, how can i set my cursortarget/move it to a certain target, in my case a house for a intro ?

vapid frigate
#

cursortarget is what's in front of your cursor.. only way to change it is to point at a house

dim owl
#

I need to set my view to the house

vapid frigate
#

a house built in to the map?

dim owl
#

No, its spawned

vapid frigate
#

how? with a script?

dim owl
#

Yes, i spawned it on briefing

vapid frigate
#

k so it's createVehicle?

dim owl
#

Yes

vapid frigate
#

so if you want to do something with it in that same script you could use _house = createvehicle whatever;

#

or otherwise, you'll need to make it a global var like thehouse = createvehicle whatever

#

and then replace cursortarget with _house or thehouse

#

(the underscore makes it a local var)

dim owl
#

But how can i set my view to it via the script

still forum
#

@dim owl Want's to create a camera for a Intro. Move it into the house via script. And switch the player view to it.
I think script commands for that are createCamera/setPos/ cameraSmth

vapid frigate
#

yeh that's pretty much the opposite of what i thought you meant.. it's a bit more complicated because you need both the house and a camera position

dim owl
#

Yeah or can i use my camera view on camsetpos ?

vapid frigate
#

i can give you an example of what i use, but CBF editing it to look like an example, so just replace anything starting with ASOR

dim owl
#

Ok

vapid frigate
#
ASORGS_CameraTarget = YOURHOUSE;
ASORGS_Camera = "camera" camCreate _cameraPos;
 ASORGS_Camera cameraEffect ["internal", "back"];
ASORGS_Camera camPrepareTarget ASORGS_CameraTarget;
ASORGS_Camera setPosATL _cameraPos;
ASORGS_Camera camCommitPrepared 0;

^to open the camera

#
player cameraEffect ["terminate","back"];
camDestroy ASORGS_Camera;```
^to close the camera
dim owl
#

Okay thx

quaint ivy
#

Hey guys,can anyone help me to set up the GOM Aircraft Loadouts script? I've set up description.ext, ive set up initPlayerLocal and i've set up a laptop to be an object that grants access yet the laptop still doesnt have any actions

vagrant badge
#

hi

grand berry
#

Has anyone come across the initPlayerServer.sqf stopping half way through the script?

tough abyss
#

Likely an issue with your code if it is stopping halfway through.

grand berry
#

Sorry correction - its skipping random bits of code.

#

No visible script errors (using show script errrors).

tough abyss
#

Can't exactly help when I have no context.

grand berry
#

Yea sorry, am just testing one last thing. Will provide a paste bin in a sec

#

It skips adding the weapons and backpacks for anyone after the first person to join.

tough abyss
#

Why are you doing all that in initPlayerServer?

#

Seperate it into initServer and initPlayerLocal.

grand berry
#

Just do the loadouts on the local part?

#

Yea that makes much more sense.

tough abyss
#

Server needs to run and manage db stuff, server doesn't need to have a backpack and weapons ๐Ÿ˜‚

#

Easier to manage too ๐Ÿ™‚

grand berry
#

Oh fuck, Yep. Thank you for that, all tested and working now.

tough abyss
#

Sweet

subtle ore
#

Something that does scare me a tad bit is that any script in SQF sometimes just immediately skips over errors though.
Usuaully it's code that is ran in a couple of seconds and exits, I'm not sure as to why it does this.

stable wave
#

Last night all players in my server were killed by some kind of explosions. Vehicles that had players in were blown up. Players who were on the ground were killed and thrown up into the air. Only those in small buildings like chapels were able to survive. None of the BE filters were triggered. I believe this is cuased by a hack, which has been openly sold online in my country. Is there a way to protect my server from this hack?

subtle ore
#

CfgDisabledCommands, CfgRemoteExec, etc.

narrow musk
#

Got a friend this is the server rpt log 'setting up client please wait' for alits life cannot find the problem thinking it could be exdb but all looks ok... any ideas?

subtle ore
#

very possible the hack has gotten past the filters as well

#

Ugh, Altis Life? Don't bother.

narrow musk
#

Hahaha

tough abyss
#

@narrow musk Line 765:
16:32:45 Warning Message: Script \life_server\init.sqf not found

#

Make sure you have it setup as follows:

#

@life_server\addons\life_server.pbo

#

A lot of the time, people don't pack up the pbo.

narrow musk
#

FFS

#

i JUST saw that an fixed it then open discord to see if i have any replys and BAM you found it

#

starting server now.

tough abyss
#

๐Ÿ‘

narrow musk
#

HAHAHA it works thank you very very much!

tough abyss
#

Sure thing ๐Ÿ˜ƒ

pulsar anchor
subtle ore
#

@pulsar anchor 0_o

tough abyss
#

phew. Really could have done so much with that 0.0001 ms

#

๐Ÿ˜‰

subtle ore
#

Holy shit, that is a huge difference. Freaking old crappy operators ๐Ÿ™„

gilded rover
waxen dagger
#

Does anyone have problem with paramsArray?

#

it seems they're not initialized in the init.sqf

tough abyss
#

Anyone want to make a simple death & inventory logging system for a big wasteland community of mine? DM me!

marble flare
#

Well I was going to start off my question with "anyone" but damn...

#

If I take a trigger and have it make ten AI fire a gun how can I make it where it's a split second delay?

sharp jay
#

Is it possible to add machine guns to a civvi vehicle?. Like add machine guns to a cessna (caesar) or something

marble flare
#

You could try the addweapon command

pulsar anchor
tough abyss
#

@tough abyss has experience doing that haha

tough abyss
#

They want to know about attaching guns to the cessna @tough abyss

merry ibex
#

Can setpos or vectorAdd not be used to lower an object?

still forum
#

It can.

merry ibex
#

๐Ÿค”

#

Got it ^^

tough abyss
#

See that @sharp jay ?

sharp jay
#

Ah, already figured it out thanks though

#

Also found out that the cessna cant deal with the recoil of a 30mm gatling

abstract shuttle
#

Is there any option to remove the footstepsound in MP mission without influencing other sound volumes?

tough abyss
#

@abstract shuttle I think @little eagle has a solution to switch the animation on each frame and the noise goes away.

distant egret
#

Anyone has any idea of how to stop static guns from falling over? There is a slight slope and they just fall over.

pulsar anchor
#

if they are just visually simpleobject true or enablsimulation false does it. If they should be able to be used properly, they maybe could be attached to something without physix...

distant egret
#

Yea they need to be used, ill look into the attachTo one tho thx.

limpid pewter
#

hey, this is probably a stupid question, but is it possible, or is there a work around, for enabling the artilery computer on a non artillery vehicle.

#

So the reason i ask, is coz a mate is trying to add a mortar to a UGV, with the attachTo and the addWeaponTurret command. It has added it to the UGV and it fires, but we have no idea if there is a way to still use the atilery computer on that UGV/Mortar monster thing XD

delicate lotus
#

is there a way to increase fatigue gain for a unit?

#

or modifying its current fatigue value?

delicate lotus
#

lol

#

like I already sarched for set and get and couldnt find any

still forum
#

I just typed "Fatigue" in the search box on the top right

delicate lotus
#

I bet I am just retardet again

limpid pewter
#

on the scripting commands page, use ctrl + f and search easily for commads, well atleast that's what i do

delicate lotus
#

dat upvotes lol

limpid pewter
#

So knowone knows any way to do what i was asking about above? or

warm gorge
#

This alternative syntax of getDir is confusing me. Is it even possible to make a player look directly at something such as a position?

delicate lotus
#

I think thats possible with vectors or something

#

or direction to function

jade abyss
#
player setDir (player getDir Pos1);```
warm gorge
#

@jade abyss Thats what I thought could work but in my case its not. Ive got a marker position which I need to make a player look at, but cant seem to figure out how to. Using that example would make the player look at whatever rotation the marker is

jade abyss
#

It does work.

#

No clue what you do.

warm gorge
#

@jade abyss Ah yep you're right, im stupid. Was doing it the wrong way. Cheers ๐Ÿ˜ƒ

subtle ore
#

Wait a sec, do things like gamelogics have the ability to have a direction?

#

Or is it always zero?

tough abyss
#

You can rotate them, but it doesn't have any effect (except on those it is relevant for)

subtle ore
#

Hmm, interesting.

shut flower
#

Does anybody got an idea how to check whether a player looks at the head or torso of a unit? I tried to do this with
lineIntersectsWith [getPosASL player, player modelToWorldVisualWorld [0,3,0], objnull, objnull, true]
but I don't get a result

I know that my attempt is not an ideal solution cause it just checks if a unit is in front of the player

jade abyss
#

use Intersect instead

shut flower
#

will try that thanks

subtle ore
#

eyePos ?

shut flower
#

Not sure how to exactly use this. Let's make this whole thing easier by excluding the selection. So what's to do if you just want to detect who is in front of a player?

still forum
#

a player or the player?

shut flower
#

the player

#

it's running local

still forum
#

cursorTarget/Object?

shut flower
#

works only when I'm looking at the center of the target unit

#

but when looking at the head it's objnull

#

Whoops, ok, cursorObject seems to just detect the target unit when looking at the torso

still forum
#

I can't confirm that. For me cursorTarget also gives me the object if I aim a few centimeters besides it

shut flower
#

cursorTarget works fine

#

strange

still forum
#

cursorObject is very exact yes. But should still work if you aim at the feet. I think.

shut flower
#

this is quite strange

still forum
#

Your crosshair is right next to his feet aiming at the ground

shut flower
#

nope, it's directly on it

still forum
#

or atleast the center of screen is

jade abyss
#

intersect, as i said before.

shut flower
#

the cursortarget is exactly on his feet

jade abyss
#

+CursorObject > cursorTarget. I barely use cursorTarget anymore.

shut flower
#

as you can see cursortarget still has it's benefits

jade abyss
#

Look trough your scope and aim at the foot again.

#

No Problems at all with both.

#

+If the object is not know to you -> cursorTarget might return nothing.

little eagle
#

@tough abyss Never heard of that,
And Syntax (can't tag that name), the answer is no.

jade abyss
#

@๐“ข๐“จ๐“๐“ฃ๐“๐“ง#3254 โ˜

little eagle
#

Your mistake was trying.

jade abyss
#

Excuse me?

little eagle
#

It didn't work

jade abyss
#

Thats Discord Bullcrap, he is highlighted anyway.

little eagle
#

Hahaha

tough abyss
#

eh someone said it mb for the tag

little eagle
#

That question about removing the footstep noise comes up like every week. No idea why. It's still not possible with scripting only.

shadow sapphire
#

It's totally possible to have scripted inventory items, right?

#

If I had a script where a player could pick up razorwire fences, then redeploy that one, it would be possible to keep track of them having just the one, right? Like I wouldn't need to figure out a way to keep them from being able to create them from thin air as they placed them, right?

little eagle
#

I'd like to say no to this, but I'm not sure I understand that question fully.

#

If you have a script that does X, then yes X is possible. Because you presupposed it to be possible by having it already.

subtle ore
#

@little eagle I think @shadow sapphire is trying to say: a static item like a soda can, is able to be picked up from the ground and be able to be moved around in the inventory of the player.

little eagle
#

You'd have to create the soda can item, because the soda can that is in the game is just a prop and not an item.

#

So you'd need to make a CfgWeapons config for it.

subtle ore
#

Right, exactly. So the answer is: no, not in a mission. Possible in mod form

little eagle
#

Pretty sure there are plenty mods that do this already.

subtle ore
#

Surely. Strike me down if I may say it. i think exile does this

little eagle
#

I wouldn't know.

queen cargo
#

@shut flower you can get there by using some math and the player view vector

tough abyss
#

Hi, I've created a firing range with targets that I can control up and down.
It works in the editor preview, in a hosted session, but not in my dedicated server.

still forum
#

Use that to easilly profile where the heavy part of your code is

#

Player FOV probably doesn't change every frame. So no need to calculate it more than once

#

You should also cache config lookups in variables

little eagle
#

every 0.1 s would be smooth enough

still forum
#

How can you even change FOV ingame?

#

Ah yeah.. okey.. Zoom ๐Ÿ˜„

#

It's a whole Nametagging system. a bit of code would probably not tell enough about the system

#

Using the integrated profiler is the best you can get.
I also have a experimental profiler that records every single script instruction. But that's too experimental to be of any use

#

the getX commands are not what's slow. The config lookup is slow

#

iterating through allPlayers IMO would be better than nearEntities Definetly not

little eagle
#

getVariable != getNumber / getText

still forum
#

@hasty violet Github?

#

Why not?

little eagle
#

It's free

still forum
#

And it makes it really easy for people to help you

#

Well.. Let's say you want players 200m around you. You have 100 players on a server and none of them are around you

subtle ore
#

why would you want to

still forum
#

Isn't just using cursorObject enough for that case?

#

You only see their Name if you aim on directly on them. But performance wise that would totally be worth it for me

subtle ore
#

Need to know basis -> cursorObject

#

didn't realize thee was cursorTarget

#

I would imagine it's definitely easier to use it because targets are different from just objects.

still forum
#

cursorTarget was there long before cursorObject ๐Ÿ˜ฎ

subtle ore
#

Well shit.

still forum
#

And cursorObject returns more stuff than cursorTarget

little eagle
#

cursorTarget seems like the more useful one anyway, no?

still forum
#

Depending on difficulty they would show up on the Map then wouldn't they?

#

That code just made the problem worse ^^ The if check decreases performance by alot.

#

reveal (according to wiki) does nothing when knowsAbout is already bigger.

#

To accomplish that reveal has to check that itself

#

so you are doubling up on the check

jagged halo
#

anyone see what the issue could be with this code:

#
dodarray = [DOD_1,DOD_2,DOD_3,DOD_4,DOD_5,Commandant];

if (player in dodarray) then 
    {
    this addaction ["Open Virtual Arsenal", 
        { ["Open",true] call BIS_fnc_arsenal; 
        }];
    };
}; ```
shut flower
#

this addAction is it

#

change it to player addAction

still forum
#

Nope

#

That's probably the init field of a box

jagged halo
#

yeah

shut flower
#

you can also use ["AmmoboxInit",[this,true]] spawn BIS_fnc_arsenal this automatically adds the action to your player

still forum
#

If you add it to the player you're never gonna get it off again

#

Also won't work.- @shut flower

shut flower
#

ok, good to know that this is the init box

still forum
#

He want's the arsenal only for some people. As the code shows

#

AmmoboxInit gives it to everyone

shut flower
#

Yes you're right

tough abyss
#

It's easy to give it to certain people

still forum
#

Already thought about it but the code looks alright to me

jagged halo
#

hmm ok thanks

tough abyss
#

On my phone so I don't have the code on hand

jagged halo
#

probably because im trying to do it through mcc

#

during the games progress

#

whats interesting is that adding an arsenal by itself works fine

shadow sapphire
#

@little eagle, the item doesn't need to be visible or interactive in the inventory, it doesn't need a count or an icon, but could you pick up the object, it disappears, then a hint pops up and says, you have X of object.

jagged halo
#

thats normally how you make intel and such items exist

#

like a platonic relationship between a man and his attractive female co-worker

#

completly hypothetical

tough abyss
#

is there a similar command/EH to achieve a looping sound just like the EH for the music. If not, i will have to loop it manually xD

jagged halo
#

there is a method of setting it up

#

to loop

#

its one of the variables

#

i cant remember how to do it but ive done it

waxen dagger
#

Hey there! Is anyone having problems with the paramsarray command? Basically it doesn't work in the init.sqf

nocturne iron
#

Hmm

#

Did you define the params in your description?

waxen dagger
#

of course

#

infact it works in the postinit

nocturne iron
#

That's curious

#

I always put it in the initServer.sqf and it seems to work there

waxen dagger
#

poor clients then ๐Ÿ˜„

nocturne iron
#

pass it to global publicVariable'd variables

waxen dagger
#

not really a smart move

#

I can postpone it for the clients, i was just wondering if i'm the only one with this problem

#

never had this error in the past

nocturne iron
#

fair

tough abyss
#

I'm trying to make a parameter that changes gear for the mission:
I have this in my Description.ext:

        {
        title = "Gear For The Mission";
        values[] = {1,2,3,4,5,6,7};
        texts[] = {"AOR1","AOR2","MultiCam","MultiCam Alpine"};
        default = 1;
        isGlobal = 1;
        file = "mission_scripts\gear_script\GearSelector.sqf";
        };```
#

My question is, when GearSelector.sqf executes, is there a way to check which value of the parameter is selected?

delicate lotus
#

yes

#

the parameter you have set are always global variables

#

paramsArray

#

@tough abyss

tough abyss
rotund cypress
#

@tough abyss if you are looking for setting loadouts in MP, you could use Bohemias new system introduced with Apex. Should be bale to setup gera with that.

tough abyss
#

You mean the loadout selection screen of Apex? @rotund cypress

rotund cypress
#

well the one you can setup in desc. ext

#

its with the respawn screen

tough abyss
rotund cypress
#

yep thats it

tough abyss
#

It's not what I need, I don't want players to choose their gear

#

Anyway, I got the script from the forums working

delicate lotus
#

How long does a normal day in Arma at speed multiplyer 1 take?

still forum
#

speed multiplyer one is realtime

#

so 24 hours

delicate lotus
#

okay

nocturne basalt
#

Hi. I attached an object in my init eventhandler (attachTo). Can I fetch this object from another eventhandler or do I have to attach it again? If so, can somebody send me an example code on how to do it?

nocturne basalt
#

wont that just return a list of whats attached? will I be able to perform actions on the objects using this?

little eagle
#

If you have the object reference, you can do anything with it.

nocturne basalt
#

so it's returning the objects and not just strings?

little eagle
#

Yes

nocturne basalt
#

thanks

little eagle
#

yw

still forum
#

Return Value: Array of Objects
That kinda says it would return objects.

thick ridge
#

Anyone happen to know which LOD(s) lineIntersectsWith actually looks at for intersections?

little eagle
#

All I remember is, that it's broken for soldiers.

thick ridge
#

I can confirm that too. My tumbleweed can't pick them up ๐Ÿ˜ƒ

still forum
#

@thick ridge VIEW and NONE

little eagle
#

NONE ??

still forum
#

Intersect takes primary and secondary LOD. Primary is VIEW and secondary is NONE

little eagle
#

So it only takes one LOD.

still forum
#

Yes.

#

Like lineIntersectsSurfaces.

little eagle
#

You have a complicated way of saying that.

thick ridge
#

Dedmen, does it somehow fall back to Geometry

#

if no View Geometry LOD is available?

#

thanks for the info

little eagle
#

If there is no view geo LOD, then the object would be invisible.

#

I think the only intersect command that can handle the GEO lod is LIS

thick ridge
#

k

#

thanks

jade abyss
#

Nope

#

VIEW, GEOM, FIRE work with intersect

#

Even when the model has no GeoLod, you can still check for VIEW

#

@thick ridge

thick ridge
#

@jade abyss is that also the case for the line intersect methods that don't accept LOD name(s) as inputs?

ivory vector
#

The colors, in the layers.cfg didnt exactly match the colors on the mask... I have now manually gone through and remade the mask manually. and have finally got the clutter working.

queen cargo
#

i highly doubt that

#

nametag script?`

#

features a range of those lil nametag script thingies

#

looks larger then it actually is too though ... it is mostly just c&p with tiny changes

#

nearEntities should be way slower then allplayers with distance

little eagle
#

X39 is arguing with reality now.

queen cargo
#

ohh yeha .. like i assume that allplayers just checks a list and performs most simple +- ops to get the distance between two points
instead of dynamically finding the players meaning that allplayers should be faster then nearEntities

#

weirdo ...

#

ohh wait
allUnits is a different thing

#

without an actual server with actual ppl on it we will never know

#

NOTE: For security purposes, this command will only run for 1 cycle in MP, unless in-game debug console is available via description.ext option or Eden attribute setting. not fully true

little eagle
#

The explanation of nearEntities being faster is, that it's a very similar concept to what you're doing with the distance check. It's essentially the same loop, but in C++ land and since that doesn't have nearly as much SQF command with input validation etc., it's faster.

#

Pretty obvious tbh. We've been over this again and again.

queen cargo
#

just that it checks above different lists ...

little eagle
#

So?

queen cargo
#

in the absent of any other object, yes
nearEntities should be faster
with a lot of entities close by allPlayers approach should be faster

little eagle
#

The allPlayers approach will be pretty much always be slower.

#

You decreased the amounts of times you have to iterate through the count SQF loop significantly by filtering the array for distance and type (CAManBase) in C++.

#

Offloading work to C++ land will make the script take less time.

little eagle
#
private [... "_showVeh", ...

...

_showVeh = if (!isNil "WH_NT_SHOW_VEHICLEINFO") then [{WH_NT_SHOW_VEHICLEINFO},{false}];

Could be:

private _showVeh = missionNamespace getVariable ["WH_NT_SHOW_VEHICLEINFO", false];
#

There is many similar lines so this should help a lot.

#

You made it messier than it had to be:

#
// If the unit is dead, shorten the range. Set name.
if (alive _u) then 
{ 
    _name = name _u;
}
else
{
    _name = if (name _u isEqualTo "Error: No unit") then { "" }
                                             else { name _u };
    _range = (_range * 0.5);
};

Could be:

// If the unit is dead, shorten the range. Set name.
private _name = name _u;

if (!alive _u) then {
    if (_name isEqualTo "Error: No unit") then {
        _name = "";
    };

    _range = _range * 0.5;
};
little eagle
#

hmm. All old info. I guess you have to try...

velvet merlin
#

do you guys use remoteExec (RE) or publicVariable (PV) + pVEH design? and why

thin pine
#

I've switched to remoteExec because I always found that the pveh design is a bit cumbersome

#

And considering it's newer and has more flexibility

#

E.g. easy jip & target control, I prefer it

still forum
#

I don't understand why allPlayers should be faster. nearEntities is basically searching a hashmap of a grid for units inside it. Then confirming the distance in engine.
And SQF code is generally slow. So doing the distance check in SQF is always slower than it staying in c++ context.

#

hmm. All old info. I guess you have to try...
No that's not old info.

#

@hasty violet 1.7ms per frame? That's not soo bad.

still forum
#

@hasty violet https://github.com/Whalen207/WH/blob/master/wh_nametags.Stratis/wh/nametags/fn_nametagDraw.sqf#L47-L50
GetVariable has a default value. As commy already said
https://github.com/Whalen207/WH/blob/master/wh_nametags.Stratis/wh/nametags/fn_nametagUpdate.sqf#L14
if !(WH_NT_NAMETAGS_ON) exitWith {}
Get's rid of all the indentation.
As commy already saidprivate ["","",""] is bad. That is executed at runtime. private _var is done at compiletime

https://github.com/Whalen207/WH/blob/master/wh_nametags.Stratis/wh/nametags/fn_nametagUpdate.sqf#L68
That is what ARRAY select CODE was made for. (https://community.bistudio.com/wiki/select alt. sytnax 5)

https://github.com/Whalen207/WH/blob/master/wh_nametags.Stratis/wh/nametags/fn_nametagUpdate.sqf#L95
what is this?
if true then true else false?
If statements are quite slow in SQF.

https://github.com/Whalen207/WH/blob/master/wh_nametags.Stratis/wh/nametags/fn_nametagUpdate.sqf#L159
you can use count which doesn't have forEachIndex and thus is a little faster.

https://github.com/Whalen207/WH/blob/master/wh_nametags.Stratis/wh/nametags/wh_nametagInit.sqf#L31
This is a nono for PvP. You could atleast filter by side. OR add a variable to enable/disable filtering by side

https://github.com/Whalen207/WH/blob/master/wh_nametags.Stratis/wh/nametags/wh_nametagInit.sqf#L96
https://feedback.bistudio.com/T123355
You can either suffer from that. Or move the if check into your _update function. But I'm not sure if the call+alive check is cheaper than compile+alive check + maybe call.

tame portal
#

i always went for the weirdest approach

#

have a not-so-fast-function prepare everything that should be rendered ๐Ÿ˜„

#

and then the actual framehandler just displays that

#

whats in the dedicated arrays

still forum
#

Which is actually a good approach. Just prepare data in scheduled and read it in unscheduled.
If the data didn't get ready in time you draw the data from last frame. You don't really need to be frame perfect for Nametags. And if the scheduler is too full. It's to be expected that things will start to get laggy

tame portal
#

i figured thats the best way (atleast from my testing) to handle a larger amount of players

#

and, well, objects in general to cover

frosty cave
#

does arma have an "image cache"? I notice when i first try to render icons in a per frame handler on the map, that when it hasnt loaded those icons before, theres a long pause. after that everything is cool, so there must be a cache.

how can i pre-cache those images

still forum
#

It's called VRAM.

grand berry
#

๐Ÿ˜‚

still forum
#

to pre-cache you have to display the image.

#

you might be able to draw it offscreen

jade abyss
#

@frosty cave Yes there is. Restarting Mission also doesn't fix it. Rename the files (e.g. Pic.paa -> pic1.paa) is the only way to "workaround" atm -.- pretty shitty

frosty cave
#

thanks yall

little eagle
#

I don't think you can preload images by displaying them off screen, but a scripting only solution could be to display them very small (like one pixel) or simply transparent.

#

@still forum
I was referring to this part:

Versions with performance profiling
98699
98711
98809
These beta builds contain performance tools normally not available for a retail version. These builds will be a bit slower as a result, and is therefore not intended for a general use.

Those are A2 builds. I'd just delete that tbh. Who cares about A2.

still forum
#

Oh yeah. I'll update it with a link to the perf/prof thingy

little eagle
#

If your question is, "what version do I need for this" and all info under "Versions with performance profiling" is 5 years old.

#

๐Ÿ˜ฆ

still forum
#

Fixed now

limpid pewter
#

Hey , i need some help with a health regeneration function im working on. ```sqf
params ["_unit", "_hitSelection", "_damage","_cause","_projectile","_hitPartIndex", "_instigator","_hitPoint"];

healing = false;

if (!(_damage> 0.99)) then {
_i = _damage * 100;
player setDamage _damage;

        sleep (4);

        while {_i > 0} do {

            healing = true;
            _dmg = _i/100;
            if (!healing) exitWith {player setDamage _dmg};
            _i = _i -4;
            sleep (2);

            player setDamage (_i/100);

            hint str _i;
        };
        healing = false;

} else {

player setDamage _damage;
};

#

btw, all the params are passed into the function when the "handleDamage" EH is triggered

zenith edge
#

looks like scope issue

limpid pewter
#

yeah thats what i thought might be the case, but i can't figure out how

zenith edge
#

each time you call this, it is running in its own instance, healing variable is not shared between instances I assume

#

I don't sqf really, but I think you need a global variable, and call the global variable from global space each time

#

and somehow tie that to player

limpid pewter
#

ok

#

yeah healing is a global var, but maybe because when the handleDamage EH is triggered, i spawns the function, that global var isn't in the same scope as the one in the while do loop

#

is that what you mean?

zenith edge
#

I don't think global variables can be used like a reference

#

I think you have to call it from the global namespace every time you use it

#

like you need to assign the change back to the global space

jade abyss
#

I don't think global variables can be used like a reference
Wut?

zenith edge
#

?

#

i don't sqf, so i may be wrong

#

i mean are all global var in mission available in every file, from default?

limpid pewter
#

yeah

#

they are

zenith edge
#

I assumed you hvae to call it from some area using a function

limpid pewter
#

but i don't know how the var isn't being seen in the if exit with statement

jade abyss
#

abc = 1; Global Var

#

abc = 1;
publicVariable "abc"; PublicVar

#

_abc = 1;
local Var

#

Just to avoid missunderstandings.

limpid pewter
#

hey Dscha, can you take a look at my function above, and see if you can see why it won't work then?

#

@jade abyss

jade abyss
#

if (!(_damage> 0.99)) then { <- Makes not much sense

little eagle
#

@limpid pewter
I think I know what might be wrong.

call {
    if (true) exitWith {
        systemChat "1";
   };

    systemChat "2";
};

systemChat "3";

What do you expect this prints in chat?

jade abyss
#

โ˜ I know it

#

โ˜ โ˜ โ˜ โ˜ select me, select me

limpid pewter
#

1 , 2, 3

#

is this a lesson in scopes :)?

jade abyss
#

โŽ wrong

limpid pewter
#

1 2

little eagle
#

1, 2, 3 is wrong

limpid pewter
#

1,3

jade abyss
#

Stop guessing

limpid pewter
#

sorry its 1,3

#

ok but daddy : (

jade abyss
#

So, why is it 1 and 3?

little eagle
#

Your exitWith thing might only escape that while loop and you expect it to end the whole script?

limpid pewter
#

ok, that makes sense,

#

so then i should have another if exitWith jut after the while do then?

#

so that when it exits the while do it will also exit the if then?

little eagle
#

I guess? It's hard to make sense of your function tbqh.

zenith edge
#

he wants it to set healing to false though? after his healing is done? so he can heal again later?

#

while he is in healing loop, he doesn't want another healing loop to go

jade abyss
#

Your exitWith just exits the while Loop

leaden summit
#

When I export CBA settings for like STHud and TFAR, can I just paste that straight into the mission init? Is that how it works?

little eagle
#

^ This. The script just continues after the while loop

#

@leaden summit You copy paste it into a file named cba_settings.sqf

limpid pewter
#

yeah dscha, i understand that now, but will putting another exitWith (with same conditons) after the scope of the while do loop then exit the scope of the if then?

leaden summit
#

Cool thanks commy

jade abyss
#

Nope, no idea why commy mentioned that ยฏ_(ใƒ„)_/ยฏ

limpid pewter
#

ok, nvm thanks for you help, will just need to use trial and error for a bit, will report results

little eagle
#

Dscha, it looks to me like the script tries to use exitWith like return

jade abyss
#

Not rly^^

little eagle
#

exit the script, not only the scope of the while loop

zenith edge
#

there is nothing after the while loop though....?so just existing that loop...is fine?

jade abyss
#

He just set the healing = false too late

#

wait, nvm

#

Where is that beeing executed?

limpid pewter
#

the whole function?

zenith edge
#

"[6:37 AM] Sneaky_Moldi: btw, all the params are passed into the function when the "handleDamage" EH is triggered"

jade abyss
#

Yes. DamageEH?

limpid pewter
#

yes using the handleDamage EH

jade abyss
#

DamageEH fires multiple times, at each hit

#

means -> 1st hit -> healing = false;

#

2nd hit healing = false;

#

3rd healing = false;

#

always exiting "if (!healing) exitWith {player setDamage _dmg};"

little eagle
#

And you can't use suspension commands there, so something is missing here.

#

sleep

limpid pewter
#

@jade abyss yeah thats the idea

jade abyss
#

That also

#

Sneaky, read again ๐Ÿ˜‰

limpid pewter
#

i don't want the script to heal if you get hit again

jade abyss
#

DamageEH fires multiple times, at each hit

limpid pewter
#

oh, why is that

little eagle
#

So this is auto regen.

jade abyss
#

HitPoints

#

+If i would be you -> Put that outside the Hit EH

limpid pewter
#

ok, so one for chest, one for leg, etc..?

zenith edge
#

the first set to false, may be more likely issue

jade abyss
#

Yes Moldi

limpid pewter
#

ok thanks

zenith edge
#

the second firing of event, sets that value to false

jade abyss
#

Put that outside, let it run in a loop.

#

done.

#

Deadly, shush

#

back to your basket

little eagle
#

^ this tbqh. No need for an eh here.

zenith edge
#

im eating bread

#

how did u know it was in a basket

jade abyss
#

<- Halfgod in black.

limpid pewter
#

btw yes commy it is an auto regen, basically i want the unit to start healing after 4 seconds of being hit. if the unit is hit again, it stops the healing process and starts it again

jade abyss
#

Commy lost his glasses again, he is typing for ages now.

little eagle
#

Why do people do this?

if (!(_damage> 0.99)) then {

When they could do this instead?

if (_damage <= 0.99) then {
limpid pewter
#

yeah idk, it was 2 in the morning

jade abyss
#

Yes, start it outside in a loop.

zenith edge
#

not statements are fun is what my programming teacher said

#

even if they are bad

little eagle
#

Just make it one loop that runs from mission start to end and that does nothing if not wounded.

zenith edge
#

gross

#

๐Ÿ˜ƒ

limpid pewter
#

ok, so the handleDamage EH is useless for this application then?

little eagle
#

I'd say so.

limpid pewter
#

ok

jade abyss
#
DamageEH:
LastTimeDamaged = diag_TickTime;

[]spawn
{
    while{true}do
    {
        uisleep 4;
        if(LastTimeDamaged + 4 < diag_TickTime)then
        {
            DoYouDamageStuffInHere;
        };
    };
}```
#

Just an example to get the idea.

little eagle
#

uiSleep, so you can heal in SP by pausing the game. ๐Ÿค”

jade abyss
#

Who cares about SP

little eagle
#

Someone might

limpid pewter
#

that doesn't bother me commy, it is solely a MP mission

jade abyss
#

See ๐Ÿ˜›

limpid pewter
#

but thanks for the headsup

jade abyss
#

Use that above as base, that works with -> If Hit -> Update the time. LastTimeDamaged + 4 = Time+4s

So it just updates, when the last time you get hit was min. 4s earlier

little eagle
#

I vaguely remember healing by pausing the game actually being a bug in some FPS years ago.

jade abyss
#

ยฏ_(ใƒ„)_/ยฏ

limpid pewter
#

to calrify this ```sqf

DamageEH:
LastTimeDamaged = diag_TickTime;
would be this in the initPlayerLocal.sqf or whateversqf
player addEventHanlder ["HandleDamage", {LastTimeDamaged = diag_))tickTime;}];

jade abyss
#

Without ))

limpid pewter
#

lol typo

#

thanks tho

still forum
#

Handler instead of Hanlder

jade abyss
#

๐Ÿ˜„

#

Dedmen also can't type

limpid pewter
#

ffs, leave me alone XD

little eagle
#

wrong chat

jade abyss
#

+Rememeber to use TAGs, when using GlobalVars

limpid pewter
#

anyway, as usualy you guys are always a good help. thanks

jade abyss
#

e.g. SM_LastTimeDamaged = diag_TickTime.

little eagle
#

OFPEC tags!!

limpid pewter
#

yeah makes sense, neat and tidy

zenith edge
#

people respond faster if you start giving bad advice

#

so I helped people look good and get problem solved