#arma3_scripting

1 messages ยท Page 772 of 1

little raptor
#

SRD_FNC_CHATLOG] remoteEXEC ["SPAWN"
wat? why do you remoteExec spawn when you already have a function?

#

just remoteExec the function

#

getpos
meowsweats

#

[thisTrigger,thisList] call _onAct;
_onAct is not defined

#

_thisList
_thisTrigger

#

not defined in AAFRB1Action_1

#

also AAFRB1Action_1 is a local function. no need to use a global var for it

rough summit
#

Is it possible to somehow disable the ability to aim missiles at vehicles?

coarse dragon
#
class CfgSounds
{

    class bigmixDAY
    {
      name = "bigmixDAY";
      sound[] = {"sounds\bigmixDAY.ogg", 3,1};
      titles[] = {0,""};
    };
    class fallback
    {
      name = "clu_falling_back";
      sound[] = {"clu_falling_back.ogg", 4,1};
      titles[] = {0,""};
    };
    class halftrack
    {
      name = "clu_watch_out_halftracks";
      sound[] = {"sounds\clu_watch_out_halftracks.ogg", 4,1};
      titles[] = {0,""};
    };
};

is this correct?

#

the fallback one doesnt work. but halftrack plays before it (if that matters)

coarse dragon
#

the bottom one doesnt seem to be working

manic sigil
#

Ugh, I posted an incomplete version, I was mucking around a lot with it.

AAFRB1Action_1 did have a params ["_thisTrigger","_thisList"] line, missed it in the posted version. Similar with NearestEntities, though now I'm wondering if I did make that mistake in my other models - my functioning version uses the correct nearEntities :x

I've been remoteExecing my chatlog function because that was the only way I'd been able to get it to work, but you're right - now I have it properly registered, I should see about cleaning that up. A big problem I had was with MP compatibility, and remoteexecing it to every machine at least solved that, if bluntly.

Wouldn't _onAct be AAFRB1Action_1? It's the third params list, and third in the called array.

And yeah - everything in AAFRB1Action_1 would be changed up if I could get this working, since the additional trigger would use the same IntelTrg function.

little raptor
#

A big problem I had was with MP compatibility, and remoteexecing it to every machine at least solved that, if bluntly.
I didn't say don't remoteExec it

#

I said remoteExec the function

#

not spawn

#

Wouldn't _onAct be AAFRB1Action_1?

#

no

#

it's not defined

#

the trigger statement is being executed elsewhere

#

not in the current scope

#

it doesn't see your local vars

little raptor
coarse dragon
#

the bottom one wont play

little raptor
#

it looks correct

#

if your path is correct too it should work

drifting portal
#

try restarting the game

little raptor
#

yes

drifting portal
little raptor
#

wat?

#

just add the EH to all PCs

drifting portal
#
[[], {
//EH
}]remoteexec ["spawn",0];
```?
#

I'm spawning it because I will also add other EHs

little raptor
#

if you're going to do that:

[_obj, ["HitPart", {myEHCode}]] remoteExec ["addEventHandler", 0];
#

but just make a function instead

drifting portal
little raptor
#

if you don't make a function you'll be broadcasting the whole code

#

which is slow

drifting portal
#

its not a "mission" set up

coarse dragon
#

i swapped the sounds around, and they both worked. but for some reason that bottom one will not play ๐Ÿ˜ฆ

little raptor
coarse dragon
#

the names of the sounds. i added bottom to middle and vis versa

somber gulch
#

does anybody know how to spawn 20-30 troops with a trigger, im making an open world campaign and I want an abush to happen on base after returning

little raptor
little raptor
little raptor
coarse dragon
#
 class halftrack
    {
      name = "clu_watch_out_halftracks";
      sound[] = {"sounds\clu_watch_out_halftracks.ogg", 4,1};
      titles[] = {0,""};
    };
};

it looks fine to me ๐Ÿ˜ฆ

little raptor
#

it looks fine

#

but name doesn't matter

#

only the class name is important (and the sound itself must be correct ofc)

coarse dragon
#

yea they are fine in the triggers

fleet sand
little raptor
coarse dragon
#

no its some guy shouting

little raptor
#

I'm asking how you play it...

somber gulch
coarse dragon
#

playSound "halftrack";

winter rose
little raptor
somber gulch
winter rose
#

perhaps, but desync may ensue

somber gulch
#

all i want is a neat edited intro over my tutorial

little raptor
#

@coarse dragon DM me your folder setup

tough abyss
#

hey gentlemen and ladies scriptwriters, does anyone have any idea how to force AI b turned on the IRlaser on the rifle not only when it is in ACTION. player action ["IRLaserOn", player]; doesn't work for AI ๐Ÿ˜ฆ

little raptor
tough abyss
#

and it can not be forced, for example in safe mode?

little raptor
#

no, it can only be forced in combat mode

tough abyss
#

OK thank you for your answer

little raptor
#
unit enableIRLasers true
tough abyss
#

I know. and the player can even be in safe mode but I can't do it in ai. thanks for reply

proven charm
#

oh, maybe that FSM can be fixed to obey the allowCrewInImmobile setting

little raptor
#

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

#

disabling the FSM should fix it too

#
AI disableAI "FSM"
proven charm
#

ok

#

I thought there could be another job for the devs ๐Ÿ™‚

granite sky
#

I wonder if you can put them in combat mode, turn on the laser, disable FSM then switch them back to safe.

little raptor
#

nope

#

it only works in combat mode

#

they disable it in other modes... meowsweats

somber gulch
#

where are the OGV files?

little raptor
proven charm
somber gulch
#

where do I put OGVs to use them with bis_fnc_playvideo

little raptor
granite sky
#

disableAI "all" does keep their lasers on, but even enabling ANIM turns them off again, so that's pretty useless :P

drifting portal
#

Even if you do disableAI "all"

#

They still jump

little raptor
drifting portal
little raptor
drifting portal
#

like can I for example teleport it?

drifting portal
#

does it consider the laser a projectile for example?

little raptor
#

what laser?

#

is there a laser weapon?

drifting portal
#

no I meant laser marker

little raptor
#

no it's not a projectile

drifting portal
#

because I'm confused on what you mean by "depends", so I thought you meant the laser

little raptor
#

e.g. if the EH triggers by explosions the projectile may already be dead

#

or if the bullet doesn't pass thru the unit

drifting portal
#

hmm

#

but a direct hit will return a live round right?

little raptor
drifting portal
#

what I need is a direct hit anyways

little raptor
#

but I guess yes

drifting portal
#

I guess I will just try it then

little raptor
#

I think projectiles die on the next frame

drifting portal
little raptor
#

it can. that's what I meant

turbid zenith
#

Hello, is there a list or smthing with all the roles and icon units can have? Been trying to look it up, but no "list" of them came up

little raptor
turbid zenith
#

well like this for example
icon = "iconManAT"; role = "MissileSpecialist"

little raptor
#

well you can write a script to give you all of them

#
_iconsAndRoles = createHashmap;
toString {
  getNumber (_x >> "scope") == 2 && getText(_x >> "simulation") == "soldier" && {
    _iconsAndRoles set [[getText(_x >> "icon"), getText(_x >> "role")], _x];
  }
} configClasses (configFile >> "CfgVehicles");
turbid zenith
#

oof, I was hoping there was a list somewhere on the wiki already and I am just blind lol

little raptor
#

list of all vanilla ones

#

if you just want the icons you can find them in configFile >> "CfgVehicleIcons"

turbid zenith
#

โค๏ธ
Thank uu

runic warren
#

Sooo i have a question, but some context is needed.

Im working on a mission where players are doing a training exercise. For the sake of inmersion i'm making them use actual blue magazines, BFAs and that stuff. One mod in particular has dummy blue rockets, which are aesthetic and what im looking for, as they are actual dummies and wont explode.

So far so good, but I want the players to use them against UGVs.

Is there any way of disabling the UGV's simulation when that very specific ammo type hits it? I know it has something to do with eventhandlers but I dont know how I'd go about it.

little raptor
#

I want the players to use them against UGVs.
disabling the UGV's simulation when that very specific ammo type hits it?
I don't get what you mean. do you want the damage or not?

runic warren
#

the rockets deal no damage. All I need is the UGV's simulation to be turned off when the rocket hits it

#

i figured it would be the easiest way to simulate a kill.

#

without actually blowing it up

#

i mean, it would be cool if the turret looked down after getting hit to give players feedback, but its not necessary

little raptor
runic warren
#

wouldnt i need to specify the ammo type somewhere?

#

as im reading it, that would trigger when it gets hit by anything

#

I only want to disable the simulation when the actual rocket hits it

little raptor
#

objects with disabled simulation still take damage

#

you can just disable it from the start of the game

runic warren
#

what?

#

okay im not getting the point across

#

UGVs are protecting certain objectives

#

since its a training mission I wanted to give them dummy rockets

#

when the dummy rocket hits the UGV, their simulation gets disabled to simulate a kill

#

I could do something like remove its ammo and fuel and switch its side to civilian or something like that, but disabling its simulation is faster and simpler, no?

little raptor
runic warren
#

Apologies, I thought it was implied

#

but yeee

little raptor
runic warren
#

yes

little raptor
#

as in no damage with other projectiles?

runic warren
#

I dont know how effective 5.56 is against vanilla stompers, but I dont think it can knock the turret off anyways

little raptor
#
this addEventHandler ["HandleDamage", {
    params ["_veh", "", "_damage", "", "_projectile"];
      if (typeOf _projectile == "myAmmoClass") then {
        [_veh, false] remoteExec ["enableSimulationGlobal", 2];
        _damage;
      } else {
         0
      };
}];
runic warren
#

thanks!

#

is there a way of depressing the turret when it gets hit too?

little raptor
#

but won't work with simulation disabled

runic warren
#

yeah it would have to fire before the sim gets disabled

little raptor
#

if all you need is pretend the UGV is dead you don't need to disable simulation

runic warren
#

its pretend to a degree

#

if the sim doesnt get disabled then its gonna rip them a new one ๐Ÿ˜„

#

er... or several

#

i just dont wanna blow it up because 1) I have cool dummy rockets and 2) if I used real ones I'd have to remove enemy infantry cover of the objective

#

and I dont trust the players not to use "real" rockets against other targets. By forcing them to use dummies I can get away with a lot more stuff

little raptor
#

you can just disable their AI

runic warren
#

would that be easier?

little raptor
#

since you want the turret to aim yes

runic warren
#

im gonna try disabling the sim first

little raptor
# runic warren its pretend to a degree

there:

this addEventHandler ["HandleDamage", {
    params ["_veh", "", "_damage", "", "_projectile"];
    if (_projectile == "") then {
        if (simulationEnabled _veh && scriptDone(_veh getVariable ["my_handle", scriptNull])) then {
            {
                _x disableAI "target";
                _x disableAI "autotarget";
                _x disableAI "CHECKVISIBLE";
                _x doWatch objNull;
                private _unit = _x;
                _x targets [] apply {_unit forgetTarget _x};
            } forEach crew _veh;
            _veh lockCameraTo [getPosWorld _veh vectorAdd (_veh weaponDirection (_veh currentWeaponTurret (_veh unitTurret gunner _veh)) vectorMultiply 10 vectorAdd [0,0,-10]), _veh unitTurret gunner _veh, false];
            
            _handle = [_veh] spawn {
                params ["_veh"];
                sleep 3;
                [_veh, false] remoteExec ["enableSimulationGlobal", 2];
            };
            _veh setVariable ["my_handle", _handle];
            
        };
    };
    0;
}];

#

it also disables simulation

runic warren
#

oh

little raptor
#

I just fixed a couple of bugs

runic warren
#

right

#

question, what does this line exactly? do I need to give the ugv a variable name?

_veh setVariable ["my_handle", _handle];

little raptor
#

also I changed another thing too

runic warren
#

hm doesnt seem to work

#

it might be because the ammo i use does not cause damage

little raptor
runic warren
#

yes

little raptor
#

is it the ammo? or mag?

#

i.e where did you get the ammo class from?

runic warren
#

ACE arsenal

little raptor
#

that gives you mag

#

not ammo

runic warren
#

oh.

little raptor
#

use config viewer to find the ammo name

runic warren
#

right, brb

drifting portal
#

Or it can not depress?

little raptor
#

it does

#

but may not work on an object with active AI

#

I've only managed to make it work on simple objects

#

iirc even empty vehicles don't work

drifting portal
#

It was very annoying for me trying to figure out how it works

#

Only to turn out that it usually doesn't

runic warren
#

@little raptor used the ammo this time, still doesnt seem to work

little raptor
runic warren
#

config viewer

#

cfgAmmo

little raptor
#

then I guess it's as you said

runic warren
#

it might be the round itself whats the problem. When it hits it turns into smoke and it bounces off. I might have to change it to the smoke shell instead and see if it works

little raptor
#
this addEventHandler ["HandleDamage", {systemChat _thisEvent}];
this addEventHandler ["HitPart", {systemChat _thisEvent}];
#

see which one(s) work

runic warren
#

first one returned "handledamage" when hit in the rear

little raptor
#

then it does work

runic warren
#

hm

little raptor
#

now get the ammo name

#
this addEventHandler ["HandleDamage", {copyToClipboard str (_this#4)}];
runic warren
#

that did not return anything

little raptor
#

it shouldn't

#

it copies it to your clipboard

runic warren
#

oh true

#

""

#

huh

#

thats... something

#

is "" a blank class or something?

little raptor
#

then it's not taking damage by the projectile

#

probably due to "fall" (impact) damage and stuff

runic warren
#

Since the rocket doesnt do damage its probably not triggering the actual handler for the disable sim thing since it needs a damage threshold iirc

#

thats frustrating

little raptor
#

you have to add a FiredMan event handler to all players

#

then when they fire something, trace the projectile

runic warren
#

hold on hold on

#

adding "" to the eventhandler worked

#

gonna check if regular bullets trigger it too

little raptor
#

ofc it does

#

but the ugv can die if you hit it with a slow car ๐Ÿคฃ

runic warren
#

im gonna guess adding "" is gonna make any projectile trigger it

winter rose
#

no

little raptor
#

only impact damage

runic warren
runic warren
#

kind of janky but what the players dont know, cant hurt them

#

also just checked

#

with the "" shooting the drone triggers it

#

hmmmm

runic warren
little raptor
#

then your game is buggy blobdoggoshruggoogly

#

are you testing that in multiplayer?

runic warren
#

not yet

little raptor
#

then it should work fine blobdoggoshruggoogly

#

even MP should be fine tho thonk

runic warren
#

alright

little raptor
#

I also updated the code so that the turret looks down where it was

#

it was looking at front before

runic warren
#

alrighty, thanks!

true frigate
#

I asked a question yesterday about teleporting. Currently im doing remoteExec, 2, for a script and inside of that is player setPos ([x,y,z]); but its only teleporting the host, no matter who uses the action.

little raptor
#

not on other clients

true frigate
#

So would this have the same effect on a dedicated server?

#

What I mean is, would it not teleport any player as its not on other clients?

little raptor
#

depends what your code is

#

post the actual code

true frigate
#

Sure, I'll have to be 5 minutes though. Sorry

#

In TpOut:

player setPos ([10158.6,12341.5,37.6614]);```
In action:
```sqf
this addAction ["Leave the Base", "remoteExec ['LouisTag_fnc_TpOut',2]"];```
Description.ext is set up correctly too, in case that's needed
open fractal
#

isn't 2 just the server?

little raptor
true frigate
#

Yes, I suppose 2 is the wrong one then ๐Ÿ˜„

open fractal
#

you can use an object there

little raptor
#

you don't need remoteExec at all

open fractal
#

factual

true frigate
#

Right, see I've just gotten into that habit I guess haha

#

so just sqf this addAction ["Leave the Base", "player setPos ([23337.4,18406.5,0]);"]; would work better?

little raptor
#

yes

#

you might also want to use {} instead

true frigate
#

Is that instead of the second set of "?

little raptor
#

yeah

#
this addAction ["Leave the Base", {player setPos ([23337.4,18406.5,0]);}];
true frigate
#

Awesome, cheers! :)

somber gulch
#

is there any way I can disable AI until I enter a trigger so AI far away don't react to stuff and move about

tough abyss
#

thank you so much man

#

it works phenomenally

drifting portal
#

deletevehicle does nothing to the projectile

little raptor
#

it just deletes it on the next frame

drifting portal
#

still gets damaged

#

so I don't think its deleted

#

and the rocket explodes too

little raptor
#

all of what you said is happening in the current frame

drifting portal
little raptor
#

yes. and stop pinging me with every message

drifting portal
#

oops forgot to turn off ping

#

sorry

winter rose
drifting portal
#

I'm not really good at vectors so,
is there a way to reverse the course (movement) of an object using velocity and setVelocity ?

#

if a missile is travelling east for example, it gets reversed to west

fleet sand
little raptor
drifting portal
little raptor
#

yes

#

it's just reversing it's direction

drifting portal
#

i shot a rocket upwards, and it got reversed but still flew upwards instead of downwards

drifting portal
#

thanks

little raptor
#

it was correct already

drifting portal
# little raptor wat?
    _v = velocity _obj;
    _obj setVectorDir (vectorNormalized _v vectorMultiply 1);
    _obj setVelocity (_v vectorMultiply -1);
open fractal
#
vectorMultiply 1
``` is redundant
drifting portal
#

instead it was doing west upwards

little raptor
#

then your rocket was the problem

#

not my code

drifting portal
#

Arma 3 when they hit you with that 1 dollar store rocket

open fractal
#

is it a modded projectile?

drifting portal
#

nope

#

PCML

little raptor
#

then reverse the dir:

_v = velocity _obj;
_obj setVectorDir (vectorDir _obj vectorMultiply -1);
_obj setVelocity (_v vectorMultiply -1);
#

my code should've worked as it was but meh

drifting portal
open fractal
#

that behavior probably has to do with it being a guided missile rather than a dumb rocket

drifting portal
little raptor
#

or put vectorUp there to be sure:

_v = velocity _obj;
_obj setVectorDirAndUp [vectorDir _obj vectorMultiply -1, vectorUp _obj];
_obj setVelocity (_v vectorMultiply -1);
#

vectorDir works weird sometimes

drifting portal
#

i just wanted to kill the rocket shooter with their rockets basically

open fractal
#

maaws projectile is easier to manipulate in my experience

#

setMissileTarget might work with a pcml projectile

drifting portal
open fractal
#

the plot thickens

drifting portal
#

I can't control what they use but the script seems to work so far

modern aurora
#

hey guys, i am looking for a way to delete an AI unit once they hit their waypoint or once they walk into a trigger near their waypoint which ever is easier. I have found a few sources on youtube but they all are in relation to deleting a vehicle.

modern aurora
#

oh well im dumb

modern aurora
#

i kept thinking that would equate to an actual vehicle

drifting portal
#

Vehicle can be an object or a unit or an actual vehicle

#

You can delete a rock you spawned with deleteVehicle

#

You can imagine it as any object that can be simulated

#

Projectiles, units, props, vehicles etc

modern aurora
#

ok awesome thank you

shadow canopy
tough abyss
#

@little raptor yo man so other players cannot see my vehicle

little raptor
#

Then it's a local vehicle

proven charm
#

I was thinking why the remoteExec doesn't show any error if the function it tries to call is invalid/inexistant

winter rose
#

the remoteExec sender cannot know that
the remoteExecuter should be able to know though

proven charm
#

yep

#

Would be useful for debugging if you have both instances on the same PC

#

client & server

little raptor
# tough abyss <@360154905148653568> yo man so other players cannot see my vehicle
bis_fnc_garage_center = nil;
bis_fnc_arsenal_center = nil;
["Open", true] call BIS_fnc_garage;

if (missionNamespace getVariable ["my_garageEH", -1] != -1) exitWith {};

my_garageEH = [missionNamespace, "garageClosed", {
  player hideObject false;
  isNil {
  _newObj = createVehicle [typeOf BIS_fnc_garage_center, [0,0,0]];
  deleteVehicle BIS_fnc_garage_center;
  BIS_fnc_garage_center = _newObj;
  BIS_fnc_garage_center setVehiclePosition [player modelToWorld [0, sizeOf typeOf BIS_fnc_garage_center, 0], [], 0, "NONE"];
  BIS_fnc_garage_center allowDamage true;
  };
}] call BIS_fnc_addScriptedEventHandler;

[missionNamespace, "garageOpended", {
  player hideObject true;
}] call BIS_fnc_addScriptedEventHandler
#

this should convert the object to global

granite sky
#

Feels like it probably should though.

winter rose
#
[] spawn {
  0 call nil; // does it throw?
};
granite sky
#

hmm

#

It's not just scheduled/unscheduled, it actually cares whether it's remote executed or not for throwing errors?

broken peak
#

Very new to scripting, How would I get the small decontamination shower to turn on / off on a trigger?

winter rose
broken peak
#

okay, thank you

proven charm
winter rose
#

dang

acoustic abyss
#

I'm trying to get a player (the first player in a trigger) to say3D something upon activating a trigger in a dedicated server setting.
When run from the debug console, player say3D "mysound" works.

But if write that same expression in a script file, and run the script as:
execVM "say3Dscriptfile.sqf"
-In a trigger onActivation field, nothing happens. Not even an RPT error. Note that this is still locally in Eden mission preview.

I've gone ahead and also tried passing the first entry in thisList to a global variable, then referencing it in the script:
say3Dplayer= thisList select 0;
And in "say3Dscriptfile.sqf":
say3Dplayer say3D "mysound"
It works. But that method is not only sloppy, it also generates unnecessary network traffic.

So how would I pass a reference to the activating player to a script file?

open fractal
#

(thisList select 0) execVM "script.sqf"

#

then the player is passed as _this

acoustic abyss
#

Yeah, you're right that the BIKI says this. I should've added that I tried that suggestion before the write up, and got this in my RPT:

....>
Error 1 elements provided, 2 expected```
open fractal
#

send the code

acoustic abyss
#

Sure. It'll have different variable names.

#

Thank you for that.
I had a typo in my trigger onActivation field:
(thistList select 0) execVM "script.sqf";
Didn't give an error. But did show up when I copypasted it into this textbox.

open fractal
#

writing in-game is a little rough unless you're really good with the syntax

#

can I ask why you're loading a whole sqf file? Is there more than just say3D?

acoustic abyss
#

Two reasons.
Firstly I am trying to make this local and dedicated server proof. Again, I only want 1 player to say this line; not all players. So I'm trying to select the activating player.
Secondly, this is a dialogue. So there's a suspension (sleep), before an AI character does a say3D.

acoustic abyss
#

=================
(Deleted question: solved by simply copying another group and editing variable names. Will never know the typo)

tough abyss
#

Hi folks. Been away from A3 for a few years. What's the premium patrol script to use? Is it still Kronzky

#

Or UPSMON?

somber gulch
#

how do I make triggers only work when they need too, i wanna set up a trigger when leaving a building but youโ€™d have to trigger it to enter the building in the first place

#

is there anyway I can make a trigger only work if youโ€™ve activated another trigger?

#

maybe like making it appear after a task is complete etc

winter rose
somber gulch
#

i just wanna make a basic trigger that activates a voice line when I leave my tent

little raptor
#

oh nvm I read Lou's comment wrong

#

what he said is correct

#

... meowsweats

somber gulch
#

was responding to leopards comment

winter rose
#

ah ๐Ÿ˜„

#

so yeah player-trigger, and on deact (when he leaves) "hey, bla bla"

somber gulch
#

is there anyway I can make it only work when I need to though, because the player can activate it at anytime and I only want it to work after this quest not anytime you enter the tent

#

im really new to A3 scripting so sorry if these questions are rly self explanatory for most people

acoustic abyss
drifting portal
#

if I remoteExec two function on the server

#

will that run two different instances of code?

winter rose
#

yes, why not meowhuh

drifting portal
#

(delay remoteExec)

winter rose
#

it does not "wait for the code to run", it's as if you spawned the function (which it does)

drifting portal
winter rose
#

yep

drifting portal
#

thanks

winter rose
#

also:

[]remoteExec ["myFun1",0];
// =
[] remoteExec ["myFun1"];
// =
remoteExec ["myFun1"];
winter rose
#

ok as long as you know ๐Ÿ™‚ ๐Ÿ‘

somber gulch
#

how to attach task to convoy

#

i wnat the marker on the map to always be on the convoy

#

or so the marker to a hvt mission always stays on the HVT

little raptor
somber gulch
#

tysm bro

#

also whats the current way to do colab projects

#

currently ive been sending my friend the mission folder

#

is there an easier way of doing it

little raptor
winter rose
#

or merge missions

somber gulch
#

i really hope a4 has some colab feature like unreal or unity

#

that sucks

acoustic abyss
#

I'm trying to create an array of all units of a certain classname. But I'm getting stuck on syntax.
Using Syntax 6 of select:

tank_array select ({typeOf _x == "tank_classname"} forEach units west);
brazen lagoon
#

any ideas on how to find the nearest player to a position?

acoustic abyss
#

typeOf takes objects, not arrays.

winter rose
acoustic abyss
#

Hehe. This is tied to my previous question. I want players to get a 'retreat' task and sound when they unexpectedly meet tanks.
It's a Zeus scenario, so I can't give each tank a variable name beforehand.

So I want an array of all the tanks in the mission that refreshes.

#

With the specific classnames, my current (not working) array expression is:

panzer_array = [];
panzer_array select ({typeOf _x == "LIB_DAK_FlakPanzerIV_Wirbelwind_DLV"} forEach units west);
// this will have to be repeated for different class names of tank, or parent class
winter rose
#

this is an incorrect use of select

#

if you want to attribute a value, use =

acoustic abyss
#

Right. So I am trying to use the boolean syntax (syntax 6) of select, as specified on the BIKI.

winter rose
#

this syntax filters a filled array

#
private _result = vehicles select { typeOf _x == "LIB_DAK_FlakPanzerIV_Wirbelwind_DLV" };
acoustic abyss
#

Got that. I am trying to filter the array units west.

#

OK will try your suggestion.

#

Ah, I see now. Thank you.

drifting portal
#

Are player fired projectiles local to the player that fired them?

granite sky
#

..depends

#

IIRC bullet-type projectiles have a local copy generated for everyone, while the larger projectiles are global objects. Haven't figured it out entirely though.

#

Hits for bullet-type projectiles are probably assessed locally, so the remote copies are just for effects/sound.

open fractal
#
(triggerActivated previousTrigger) && this
#

this condition will stop the trigger from activating until previousTrigger has been activated

#

that trigger condition box is what tells your trigger when to activate, this representing the settings you selected with the dropdown menus, which is why it just says this by default

drifting portal
drifting portal
# little raptor because projectiles are local

I tried doing

_v = velocity _obj;  
[[_obj,_v],{
    params ["_obj","_v"];
    if (local _obj) then {    
      _obj setVectorDirAndUp [vectorDir _obj vectorMultiply -1, vectorUp _obj];  
      _obj setVelocity (_v vectorMultiply -1);
  };
}] remoteExec ["call",0];
#

but its kind of slowing other things

#

is there a better workaround?

granite sky
#

Install the handler locally wherever you want it to apply.

robust lichen
#
if (isServer) then 
{ 
 private _allTerrainObjects = nearestTerrainObjects 
 [ 
  [worldSize / 2, worldSize / 2], 
  [], 
  worldSize * sqrt 2 / 2, 
  false 
 ]; 
 
 { _x hideObjectGlobal true } forEach _allTerrainObjects; 
};
#

How can i get rid of everything but rocks trees and roads in this way?

open fractal
#

you can filter with nearestTerrainObjects

#

It's the parameter you left as []

robust lichen
#

so filter like ["Chapel", "Fuelstation"]

#

etc

open fractal
#

yeah

drifting portal
#

That's what I thought too

#

I will just install it locally in everyone on the server

#

A little loop can't hurt

tough abyss
tough abyss
#

apologies for the inconveniences

opal zephyr
#

Is there any way for me to get VectorUp from the players camera?
Currently im getting the standard direction with "getCameraViewDirection", but I'm using attachTo and I need VectorUp in order to use the setVectorDirAndUp command.

Edit:
I think I found a solution using BIS_fnc_vectorDirAndUpRelative

mortal saffron
#

I have managed to get this to work (mostly) when placed on an item to use as a deployable respawn position. [this, ["Deploy Respawn",{[west, pack, "Camp"] call BIS_fnc_addRespawnPosition;},nil,1.5,true,false,"","",3,false,""]] remoteExec ["addAction",0,this]; Is there any way to set the module position to the PACK once called? Currently the module displays off the pack position, but allows spawning at the pack. Thanks

exotic flame
#

Does anyone know how to get a DLL loaded ? I try to test a dll but i get this message " 03/06/2022 05:25:27 - Blocked loading of file 'C:\Program Files (x86)\Steam\steamapps\common\Arma 3\test_x64.dll'

brazen lagoon
exotic flame
#

i tried to disable battleye and restart the game but it's still not working

robust lichen
#

hmm enable file patching maybe?

exotic flame
#

file patching ?

robust lichen
#

yeah, its a start parameter

#

-filePatching

exotic flame
#

just tried it's still not working

robust lichen
#

hmm, i dont know then im not well informed on dll's

exotic flame
#

On Bohemia's website they say we have to whitelist a DLL in order to use it and to do so we have to contact battleye support. But come on i can't contact battleye for a test dll that isn't even finished

robust lichen
#

-init="name_of_dll"callextension"" saw this maybe it helps

exotic flame
little raptor
#

Does it export all necessary functions?

still forum
#

Just read the message

Blocked loading of file
BattlEye blocked it

manic sigil
#

Finally gonna have some free time to get back to tinkering with some coding later today t_t

Referencing my function above, im thinking of ways to pass _onAct to the trigger, since I was told they're in a different scope.

Would it be something like setting a global variable to _onAct, then creating the trigger with the global variable called?

And if so, does the trigger store that information, or would changing the variable by calling more instances of the function change the effect of previously created triggers?

#

And yes, looking at cleaning up my spawned Chatlog function, though thinking it through I may just have to put a spawn inside the function - it relies on BIS_fnc_EXP_camp_playSubtitles, which memory serves only works in a scheduled environment :x

exotic flame
# little raptor Did you make the dll?

this is my dll:
using System.Text;
using System.Runtime.InteropServices;
using RGiesecke.DllExport;

namespace testdll
{
public class Class1
{
#if WIN64
[DllExport("RVExtensionVersion", CallingConvention = CallingConvention.Winapi)]
#else
[DllExport("_RVExtensionVersion@8", CallingConvention = CallingConvention.Winapi)]
#endif
public static void RvExtensionVersion(StringBuilder output, int outputSize)
{
output.Append("Test-Extension v1.0");
}

#if WIN64
[DllExport("RVExtension", CallingConvention = CallingConvention.Winapi)]
#else
[DllExport("_RVExtension@12", CallingConvention = CallingConvention.Winapi)]
#endif
public static void RvExtension(StringBuilder output, int outputSize,
[MarshalAs(UnmanagedType.LPStr)] string function)
{
output.Append(function);
}

#if WIN64
[DllExport("RVExtensionArgs", CallingConvention = CallingConvention.Winapi)]
#else
[DllExport("_RVExtensionArgs@20", CallingConvention = CallingConvention.Winapi)]
#endif
public static int RvExtensionArgs(StringBuilder output, int outputSize,
[MarshalAs(UnmanagedType.LPStr)] string function,
[MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 4)] string[] args, int argCount)
{
foreach (var arg in args)
{
output.Append(arg);
}
return 0;
}
}
}

#

nothing fancy

#

and it's blocked by battleye

winter rose
little raptor
exotic flame
little raptor
#

Then you haven't disabled it blobdoggoshruggoogly

exotic flame
#

on Bohemia's page i can read : "Since 1.46, client extensions need to be whitelisted in order to get loaded.". Does it mean i can only test my dll on a server ?

exotic flame
still forum
#

If it still says blocked, then battleye is still on

exotic flame
still forum
#

does it say any other error now?

exotic flame
little raptor
#

your extension is simply supposed to print out whatever you send to it as args

exotic flame
#

i copy and pasted bohemia's example it's supposed to return the name of the called function

little raptor
#

yes, and?

exotic flame
#

i use ("test" callExtension "test")

exotic flame
little raptor
#

that syntax doesn't return anything

#

read the wiki...

#

oh wait it does thonk

#

then no clue blobdoggoshruggoogly

exotic flame
little raptor
#
  1. stop pinging me
  2. I meant the callExtension syntax
  3. use the other syntax. it tells you if the extension failed
exotic flame
#

i used ("test" callExtension ["test", ["bla","bla"]]) and it returns ["",-1,0]

little raptor
#

your extension wasn't loaded then

exotic flame
#

This is what i thought at first but then why does battleye says "Blocking loading of file" ? I also tried to copy the dll in a mod folder to if the game would load it with the mod but i get the same result

#

I also created a dedicated server to try but still doesn't work

little raptor
#

why do you test on a server? just test normally in single player for now

#

why does battleye says "Blocking loading of file"
if it says blocked loading then battleEye is still on for some reason

#

post the rpt

wicked roostBOT
#
Arma RPT

Arma generates a .rpt log file each time it's run, which contains a lot of information like the loaded mods, or any errors that appear, this log file can be very useful for troubleshooting problems.

To get to your RPT files press Windows+R and enter %localappdata%/Arma 3

Additionally see the wiki page for more info: https://community.bistudio.com/wiki/Crash_Files

To share an rpt log here, please use a website like https://sqfbin.com/ to upload the full log, that way the people helping you can take a look at it and try to figure out the problem you're having together with you.
Note: RPT logs can hold personal information relevant to your system, the game or others.

exotic flame
#

Yes this is what i was doing but on Bohemia's website i can read "Since 1.46 client extensions need to be whitelisted in order to get loaded.". So i tried it on a server to make sure. Battleye doesn't say anything anymore it disabled. I was just saying it says "Blocked loading of file" when i activate it

#

I don't know why i can share the RPT file on this channel to show you but it doesn't say anything about the DLL, exactly like the DLL didn't exist

#

i sent you a dm with the rpt file

exotic flame
#

I solved the problem ! Finallyyy! The problem is coming from my misunderstanding of Visual Studio 2022. I was trying to create a project based on .Net and Standard .Net. You must create a project based on .Net Framework and select Framework 3.5 in the project properties to have it working ! A Superior Framework Will not work.

vale swift
#

Anyone familiar with the basics of scripting, kindly DM me if you have a minute or two. I could use a hand with... like.. the most basic thing.

winter rose
vale swift
#

So I wrote this script, which in theory should work. The only problem is, uh... Idk how to tell you this... ||I still don't know how to include script files into a gamemode lol||.

vale swift
vale swift
open fractal
#

here are files you can put in mission root that the game will consistently execute

winter rose
open fractal
#

for example you can write execVM "yourScript.sqf" in initServer.sqf for the server to run yourScript.sqf on mission init

#

or you can define a function and call yourTag_fnc_yourFunction in, say, a trigger

opal zephyr
#

Im using this command "BIS_fnc_vectorDirAndUpRelative" but "vectorUp" isnt changing, its stuck at 0,0,1. Anyone have any idea whats wrong?

vale swift
vale swift
open fractal
#

yes

#

you create the file next to mission.sqm

#

the game will automatically check for it and execute whatever instructions your write in it

vale swift
#

So the init file will only loadup other scripts/funcs I made, correct?

open fractal
#

you can write whatever sqf code you want in there

#

but execVM is the command to load and execute a separate file

vale swift
#

Hol' up... can I just dump all my scripts in initServer.sqf? ๐Ÿคฃ

#

I'm only asking if it's possible, not if it's a good idea.

open fractal
#

yes it's possible, just not clean

vale swift
#

Is there any limit for how many scripts I can include in a single mission?

winter rose
#

your RAM ๐Ÿ˜„

open fractal
#

you can load as many scripts as you want, sqf is just inefficient so you want to limit it to whatever you need

vale swift
open fractal
#

not for scripts

#

unless you want to move to reforger :)

vale swift
#

My hardware can barely run A3 on crutches... Reforger would probably send my PC into cerebral palsy.

#

One last question, bear with me please... what is binarisation? Do I want it? Do I need it? What difference does it make?

open fractal
#

converting files to computer-talk so it loads faster

#

afaik the tool for that is more for addon config, though mission.sqm is also binarized by default

vale swift
#

So... faster loading when playing at the cost of slightly longer saving time when editing? Right? Wrong?

open fractal
#

it just means you can't read and write the file in a text editor

vale swift
#

Oh

#

But that's only the .sqm file, nothing else, right?

open fractal
#

you can uncheck it and manually configure the sqm but yes, in a mission file I believe only the sqm would be binarized

vale swift
#

Now that begs the question... what can I edit in the .sqm file that I can't edit in the in-game editor?

open fractal
#

most commonly removing dependencies I think

#

If you made the mission with an addon loaded and change your mind about the mission requiring it

#

also ctrl+f to replace classnames of items

vale swift
#

Right, automation and macros

#

Thanks a lot for all the info, really.

open fractal
#

yw

brazen lagoon
#

any idea how to figure out why my mission gets stuck in the loading screen? Like, after i hit start on a dedi it sits in the map screen endlessly

#

this is really odd. is there a way to skip the map screen?

opal zephyr
#

If its the respawn screen your talking about but it doesnt give a spot to respawn and there arent any buttons. Sometimes pressing Enter fixes it

brazen lagoon
#

no thats not it

#

before the briefing screen that you have to click 'continue' on

#

im talking about the loading screen that shows the map thats being loaded

little raptor
brazen lagoon
#

@little raptor what does postInit=1 do?

little raptor
#

I mean in cfgFunctions

#

it runs the function at post init, as the name says

#

but if you have an endless loop in there the loading screen will never finish

drifting portal
#
      [[],{  
        if (missionNamespace getVariable "Sheild") then {  
          with uiNamespace do {  
          SHEILDText = (uiNamespace getVariable "FightDisplay") ctrlCreate ["RscStructuredText", 3453];  
          SHEILDText ctrlSetPosition [0.436131 * safezoneW + safezoneX, 0.0842 * safezoneH + safezoneY, 0.133918 * safezoneW, 0.033 * safezoneH];  
          SHEILDText ctrlSetStructuredText parseText (format ["<t size='1' font='PuristaBold' valign='middle' align='center' shadow='2' color='#E8302E'>sheild %1:%2</t>", 3,"00"]);   
          SHEILDText ctrlCommit 0;  
          };  
        };  
      }] remoteExec ["spawn",0,_Veh];  

I'm having problems with this, basically prior to this there is another remoteExec JIP that creates a screen using cutRsc, when its executed by itself it creates the screen normally, but once I remoteExec JIP the example provided here (which is me trying to add another element to the screen after a certain event occurs) both this JIP and the other JIP that creates the screen doesn't work, why is that?

little raptor
#

is shield even defined?

missionNamespace getVariable "Sheild"
just use shield. what's the point of writing it like that?

drifting portal
#
missionNamespace setVariable ["Sheild", true ,true];  
#
_Veh = missionNamespace getVariable "Sub";  
#

this is in another JIP:

with uinamespace do {
"someLayer" cutRsc ["RscTitleDisplayEmpty", "PLAIN"];   
FightDisplay = uiNamespace getVariable "RscTitleDisplayEmpty";  
};
drifting portal
hallow mortar
# vale swift Is there any limit for how many scripts I can include in a single mission?

There isn't a numerical hard limit but be aware of file size. Having a lot of long script files, custom textures, custom sound files etc. in a mission file can make it take a long time for players to download the mission file from the server. My usual guideline for a multiplayer mission is to keep the total file size below 4mb to avoid unreasonable download times.

hallow mortar
drifting portal
winter rose
granite sky
#

Also not sure why you're JIPing on a variable that doesn't seem to be related to the functionality.

grim wing
#

is there a script i can run that gives me all of the textures of the current uniform im wearing

jade acorn
drifting portal
#

that only appears after an event occurs

#

so I want it so that when that even't occurs , if players join in progress they can also see the gui element

drifting portal
#

or what is the advantage to be more precise

drifting portal
winter rose
spark turret
#

and the function is protected, so i cant send code over the network to hack your function

#

and its "compiled" or sth iirc, not just interpreted at runtime.
whatever "compiled" means in a dynamic environment

drifting portal
#

I thought it had benefit to stop the weird thing going on with JIP

#

if I could make it a function I would already have, so much easier to deal with

#

instead I have to create a large tablet of code that does everything

little raptor
leaden ibex
#

Hello there, just to make sure that I understand it correctly:
https://community.bistudio.com/wiki/setMarkerColor needs to be executed only by the server and the change get's broadcasted to every client right? So no need to change it locally for everyone.

If I change it on a client, it still does get broadcasted to everyone too, is that correct?

granite sky
#

In principle, yes

leaden ibex
#

I don't really like the "in principle", but the "yes" makes me calmer now.

#

Running something like this on every connected client is probably not the correct way of doing it HAha
Warning, shitty code:
||```sqf
"Zone4Capturing" addpublicVariableEventHandler {
private _tmp = missionnamespace getVariable "Zone4Capturing";
private _tmp2 = missionnamespace getVariable "Zone4Captured";
if (!_tmp2) then {
if (_tmp) then {
hint "Zone 4 is being captured";
"zone4" setMarkerColor "ColorWhite";
"zone4" setMarkerBrush "Cross";
} else {
hint "Zone 4 capturing interrupted";
"zone4" setMarkerColor "ColorRed";
"zone4" setMarkerBrush "Solid";
};
};
};

#

But I'll move all of this to the function checking if capture is happening and add fancy flashing, as it get's executed every second anyway.

granite sky
#

Yeah just change that stuff on the server and broadcast the hints.

leaden ibex
#

Thanks for the help!
Will experiment and hopefully get it working correctly now.

granite sky
#

Note that missionnamespace getVariable "Zone4Capturing" is by default equivalent to Zone4Capturing

woeful kiln
#

What do I put in the debug console to take a picture of a specific class name?

#

Like, I put in a class name and it takes a picture of that model

#

Nvm, I'm dumb

#

Was looking at the wrong spot

#

Is there a way to take an editor preview of weapons?

#

Through the editorPreview debug command?

leaden ibex
drifting portal
#

Its becoming quite chronic to say the least

granite sky
#

Do you know if your JIPs are not firing at all or just not working?

drifting portal
granite sky
#

that's a debugging question not a code question.

#

Like you can narrow down what you're looking at a lot if you can answer it.

drifting portal
#

Yeah I already have it narrowed down

#

Its a 5 line issue

#

But you explain it clearly I need the entire code shown

#

1 minute

#

Its basically something conflicting with the other when it shouldn't

drifting portal
#

from line 27 to 44 is the main GUI creation (works with JIP)

#

after the submarine take a certain amount of hits

#

line 206 to 215 should create a new element on the already existing display earlier

drifting portal
#

but problem is

#

when its JIP is turned on

drifting portal
#

(NOTE: First JIP works if second JIP is not triggered, it ONLY stops working once the second one triggers)

#

that's the problem I'm not understanding, why is it stopping the first JIP from working?

granite sky
#

You know init statements run globally, right?

drifting portal
#

That's not the case in zeus as far as I'm aware

#

In Zeus objects with init, run the init locally

#

Locally on the Zeus who placed them

#

So that's not the issue

granite sky
#

Ok I think this code is gonna drive me madder than the necronomicon

#

but it looks like you have three remoteExecs with the same JIP ID?

#

There are two remoteExec ["spawn",0,_Sub]; in here and then the whole pile of shit is actually remoteExec'd with the same object as ID.

#

JIP IDs have to be unique otherwise they replace each other.

#

If you JIP with an object as ID then it has to be the only JIP using that object as ID.

drifting portal
#

So

#

Basically

#

I have to use another object?

granite sky
#

Or a text string you construct or whatever

drifting portal
#

Can't use the same object twice for two remoteExec?

granite sky
#

correct, unless you want the last one to replace the first in the JIP queue.

drifting portal
#

Damn

#

Thing is

#

I wanted it to stop executing once the object doesn't exist

#

But that can be solved easily

#

Using isNull

#

How can I fix that sir?

#

The JID

drifting portal
granite sky
#

Looking at your code so far I'm sure you'll figure out some abominable solution

drifting portal
granite sky
#

Note that you can clear JIPs manually with a poorly-documented remoteExec syntax.

granite sky
#

remoteExec ["", "MY_JIP_ID"]; // the "MY_JIP_ID" order is removed from the JIP queue

drifting portal
#

Damn

granite sky
#

so you can create three JIPs with arbitrary IDs, and then remove them all in an EntityKilled hander or whatever.

drifting portal
#

Arbitrary IDs

#

That's exactly what I'm asking about

#

How do I generate them

granite sky
#

Like literally "my stupid ID 1" "my stupid ID 2" etc

drifting portal
#

It accepts normal strings

#

Thought it was netid only

granite sky
#

strings

drifting portal
#

Lol

granite sky
#

It accepts many things.

drifting portal
drifting portal
granite sky
#

You can put true in there and it'll even make you a unique ID, but given the structure here that's probably not too helpful.

drifting portal
#

I will try your solution and hopefully get it working

#

Thanks

tough abyss
#

anyone got a garage script thats global and other players can see and you can use skins

past wagon
#

can you override the "Fired" event with an EH?

#

keep people from shooting their gun?

open fractal
#

I believe a fired event handler will always be executed on the next frame

#

which is after the weapon fires and the projectile travels a little bit

cold mica
#

What does it mean when an AI squad name has the word (Remote) in its name? In the editor, I get the name Alpha 1-1 but the same squad on a dedicated server is called Alpha 1-1 (Remote)

spark turret
#

can someone confirm that the 82mm Flare is not working? it doesnt spawn for me at all.

createVehicle ["Flare_82mm_AMOS_White",getPosWorld player];
jade acorn
#

it is broken and has been since 2015 I think. position player will spawn the projectile model under your unit and it dissapears quickly.

little raptor
little raptor
spark turret
#

wtf. with that code?

little raptor
#

with any code

#

but you need to trigger the flare yourself

spark turret
#

aaaah okay. yeah it returned something but i couldnt see anything

little raptor
spark turret
#

yeah, it literllay doesnt work for me with that exact code.
gonna check which branch im on

little raptor
#

triggerAmmo doesn't work on perf/stable with flare rounds

spark turret
#

theres a chance that im on a custom perf branch

#

not 100% sure

little raptor
#

well it only works on dev branch

spark turret
#
Build: Stable
Version: 2.08.149102
#

yeah, no triggerAmmo for me it seems

little raptor
#

not sure if it works on perf too

#

let me check the logs

little raptor
#

ofc everyone must have the perf branch for it to work

spark turret
#

yeah its fine, ill just skip that flare. the 40mm ones work as intended/expected.

#

thanks for the insight tho ๐Ÿ‘

drifting portal
#
playSound3D ["\a3\Sounds_F_tacops\SFX\Missions\heli_alarm_bluefor_quieter.wss", player];
#

seems like I can't play this sound, what is the issue?

past wagon
flint topaz
#

Not sure which channel to put this in as it crosses multiple parts,

Does anybody know if you can change the skybox of a mission per player during a live mission?
so one person can see one skybox while another sees a different one
Intended purpose: Having two "places" you can teleport between having different skyboxes depending one which one you are at.
https://pmc.editing.wiki/doku.php?id=arma3:changing-skybox
I've found this sofar but not sure if it's the only way (or even if it can be done mid mission) as this seems to be more based on setting up your own map configs

little raptor
little raptor
#

tho you can make an object and use that as "skybox", but it will be weird a bit

flint topaz
#

unfortunate but thanks

flint topaz
little raptor
#

no. at least not for a long time

#

the server syncs the time every now and then

flint topaz
#

ahh okay

#

appreciate the help anyway. I'll just have to use postprocessing to play with the views a bit

#

actually while you are here any suggestions for postprocessing to make it feel different, but not overpowering?

little raptor
#

different how?

flint topaz
#

Initially I was thinking just a colour shift. and that works fine. Just I'm bad at choosing colours

drifting portal
little raptor
#

it plays for me

drifting portal
flint topaz
flint topaz
#

haven't looked into chromAberration yet thanks

drifting portal
#

instead of white you will see red, green and blue depending on how high you tune it

little raptor
#

remove the leading slash

drifting portal
drifting portal
flint topaz
#

Yeah I'm trying to remain with colours identifiable, but the world as a whole look shifted weird. (Like a different set of elements in the air)

drifting portal
#

yeah

flint topaz
#

as they will be in it an extended period of time. So don't want to piss them off

drifting portal
#

you might as well

#

add ash or snow or something similar

#

basically particles flying

flint topaz
#

don't they cause performance issues

#

maybe not in low amounts actually

drifting portal
#

can't say for sure

flint topaz
#

I just know rain kills our frames typically

drifting portal
#

yeah

#

not that dense

#

its ash, its really small

flint topaz
#

I'll certainly give it a try thanks a lot

#

Actually last thing can weather be per client?

#

or I assume the server syncs it again every now and then

flint topaz
#

Yeah just checked on the forums they are all server executed ๐Ÿ˜ฆ

drifting portal
#

it will eventually sync with the server

#

so yeah nope

flint topaz
#

can we detect the sync? and counteract it?

#

or would that just be a seizure inducing mess

drifting portal
#

not sure not that good at networking with sqf

#

I summon Leo

flint topaz
#

I took a look. Seems no there is no simple way to detect weather changes without an infinite loop and those are never fun.

drifting portal
flint topaz
#

yeah shame, but can probably make something cool out of it

little raptor
flint topaz
#

Ahh thankyou

spark turret
#

damn, spent 15 minutes trying to figure out why the damn guided rocket just yeets above the target.
setMissileTargetPos takes ATL, not ASL -.-

drifting portal
spark turret
#

Its agl in one format and asl in the other :^) according to biki

winter rose
#

Yep (unfortunately)

cold mica
#

How come AI groups in a dedicated server have the word REMOTE appended to their names? Local testing does not cause this.

For example, I get Alpha 1-1 when printing an AI group in a listen server but if I run the same command on a dedicated server, it is Alpha 1-1 REMOTE

granite sky
#

Because the group isn't local to the dedicated server.

#

If it is local, then it won't have REMOTE on it.

cold mica
#

Odd that would happen, where would it be local to if there are no headless clients?

cold mica
#

If it is local to the server then it wouldn't have the word REMOTE appended

leaden ibex
#

Hello there, I am trying to edit a gunner screen that is present inside a vehicle. It has thermal enabled by default and I want to disable it.
I found in the config that the renderTarget name is "rendertarget4", so I am trying to execute in the vehicle init box.

"rendertarget4" setPiPEffect [0];

But it does not take effect, I have yet to try the BIS_fnc_PIP, but was hoping I could figure out why `setPiPEffect [0];" does not work, any ideas?

granite sky
#

@cold mica Well, you didn't say where you were testing from, but if a group is local to the server then it'll say REMOTE on the client, and if a group is local to the client then it'll say REMOTE on the server.

winter rose
granite sky
#

There's actually nothing special about headless clients. You can spawn hundreds of AIs on normal clients if you want to.

leaden ibex
#

Trust me, that was the first thing I tried. Actually this is run on all vehicles in the mission... sadge Disables the one you have while "in turret", but the PiP screen is still TI

winter rose
#

official vehicle?

leaden ibex
#

ACR_A3 mod

#

(Czech Army mod, "editing" the Dingo 2)

#

I don't need to turn it into normal camera, I can just "criple" it, make it black and show nothing, any ideas?

winter rose
#

Can you try on a vanilla vehicle, see if it happens?

leaden ibex
winter rose
#

if the PiP thing lost TI as well
if not, it might be a game issue
if it does, it's a mod issue (you can report on their feedback tracker)

leaden ibex
#

Oh, yeah, I know that works on vanilla and most modded ones.

#

But just on few it does not sadly. sadge

winter rose
#

ah okey

#

welp

#

report to the author? (-:

leaden ibex
# winter rose welp

I am currently trying to "replace" the PiP in the car. I've got two objects in the world, let's call them camm and targ
Can I replace the screen in the vehicle with something like

["rendertarget4",[getpos camm, targ], this, true] call BIS_fnc_PIP;

given that rendertarget4 is the correct one, at least according to my config finds.

This somehow results in the player having a small screen in the right GPS position with the image and I have no idea why. Would be happy if you got any insight that you can share.

#

Even though this is executed in the vehicle init box HAha

#

I'll report it, hopefully something can be done on their end, but I kinda need this for Thursday, so I doubt there will be a fix soon enough sadge.

winter rose
leaden ibex
winter rose
leaden ibex
#

Will try, thanks for the idea

drifting portal
#

it opens a tablet at the right bottom of the screen

leaden ibex
#

I see, sad it's not documented. But I guess no ideas on how I could fix my problem, right? sadge

drifting portal
#

you want to replace

#

the hunter's back pip camera?

leaden ibex
#

It's a Dingo from Czech Army mode, but it should work the same.
No need to replace it per say, "cripling" it is enough

drifting portal
#

you don't want it to work?

leaden ibex
# drifting portal cripple?

just let it blank, black.
If I can get it working, that would be awesome, but crippling it also works, as you can right click and go into the "fullscreen" mode

drifting portal
#

idk I would say attach an object to the back of the vehicle

#

in the spot of the camera

#

to block it

#

lol

leaden ibex
drifting portal
#

damn

leaden ibex
drifting portal
#

well

#

thing is

#

I don't think you can replace cockpit textures

#

I hope I'm wrong but I tried doing so before

#

Veterans rise up

leaden ibex
#

I still got time until Thursday. Worst case scenario, I hope I could create a mod that changes it. But I've never experimented with this. Also forcing 120 ppl to download it is... Bad

I'll wait for a normal time and hopefully someone will be able to help me

hallow mortar
#

I've been having some trouble getting BIS_fnc_fireSupportVirtual to work. Specifically, it didn't work on DS in the same circumstances as it did work in local MP [*note: executed on server only], and in some cases it seems to create an endless loop of incoming shell whistle sounds even after the barrage has ended. Curious if anyone has any insights (or at least the same experience).

tough abyss
#

In unscheduled environment, is the command setUnitLoadout "waiting" for all the stuff to be set on player before going to next instructions?

little raptor
#

It does that even in scheduled environment

drifting sky
#

Oops, meant to put that in config editing

winter rose
little raptor
#

just create a camera and use rendertarget4 directly as the cameraEffect's r2t

#

e.g. this will give you a 3rd person camera:

_cam = "camera" camCreate [0,0,0];
    
_r2t = "rendertarget4";
    
_cam cameraEffect ["terminate", "back", _r2t];
_cam cameraEffect ["Internal", "Back", _r2t];

boundingBoxReal vehicle player params ["_c1", "_c2"];

_cam attachTo [vehicle player, [0,_c1#1,_c2#2]];
_cam camSetTarget vehicle player;
_cam camCommit 0;
#

if you want to make it black, just put a black object in front of the camera:

_cam = "camera" camCreate [0,0,1e4];
_cam setPosWorld [0,0,1e4];
_r2t = "rendertarget4";
    
_cam cameraEffect ["terminate", "back", _r2t];
_cam cameraEffect ["Internal", "Back", _r2t];

_obj = createSimpleObject ["UserTexture10m_F", [0,0,0]];
_obj setPosWorld [0,1,1e4];
_obj setObjectTexture [0, "#(argb,8,8,3)color(0,0,0,1)"]
winter rose
little raptor
#

because there's a bug that causes duplicate r2ts to fail

#

you have to "delete" the old one (using "terminate")

#

not sure if the bug triggers in that case, but better safe than sorry

little raptor
tough abyss
#

How to add a blacklist to a zone in ALIVE via a script?

leaden ibex
#

@little raptor thank you! I'll try it soon.

winter rose
gray thistle
#

Henlo i got an issue on an server and wanted to know if i belive right that it is executed on a global scope via chained execVMs

[] execVM "file" chain
init.sqf > init_client.sqf

shortcut_init.sqf

// Weapon to the back
(findDisplay 46) displayAddEventHandler ["KeyDown", {
    if (_this select 1 == (actionKeys 'User10') select 0) then { [] execVM "addons\KEY\user1.sqf" };
}];

Final user1.sqf

// Weapon to the back

if (player getVariable ["GRLIB_action_inuse", false])  exitWith {};

if (currentWeapon player != "") then {
    player setVariable ["GRLIB_action_inuse", true];
    player action ['SWITCHWEAPON',player,player,-1];
    uIsleep 3;
    player setVariable ["GRLIB_action_inuse", false];
};
steady ice
#

How to make "File patching allowed: Yes"?

gray thistle
#

I am not sure if init.sqf is on the global scope.

little raptor
gray thistle
steady ice
#

thx

gray thistle
steady ice
#

ik

fleet sand
#

Hi Guys I have a question. I am using flak script from flyinpenguin for tigris and it works code here:
https://pastebin.com/qLWNn9QC
but I tried to convert this so tigris dosent shoot but the German FlackPz from GM DLC code here:
https://pastebin.com/5QwVMm1W
Vehicle fires but it dosent create any explostion around air vehicle any help would be nice.

fleet sand
#

Nvm i got it to work ty guys.

tough abyss
#

I'm looking for a way to script in a splash screen that displays the mission name and author when triggered by a trigger in the editor - Anyone know how to do this who could show me/walk me through how to script it?

Bare in mind that I have never scripted before, have next to no knowledge of it, and require extremely simple and precise instructions.

Thank you in advance!

little raptor
tough abyss
#

I saw the splash screen options in the trigger UI selection menu but they don't seem to work, or I'm doing them incorrectly.

little raptor
#

since all you want is a splash screen it's very easy

tough abyss
#

Yeah I know

#

But... How

#

๐Ÿคฃ

little raptor
#

open GUI editor

tough abyss
#

2500 hours of mission making and I STILL don't know how to do it

little raptor
#

place all GUI elements where you want them to be

tough abyss
#

Uhhh

#

Okay, step one, where is the GUI editor you're referring to?

little raptor
#

play a mission in 3den

#

there's a button called GUI or something when you pause the game

#

or EDITOR

#

not sure what it was called

tough abyss
#

Okay, one sec while I hop in

#

Oh my damn I found it

#

What should I do now? I have the grid up on screen

little raptor
#

right click and select what you want to put

tough abyss
#

Okay, I've put down a text thing, how do I add text to it?

little raptor
#

right click on it

tough abyss
#

Right click, got it

little raptor
#

to resize it hold Alt

tough abyss
#

Okay

little raptor
#

also you might want to use the SafeZone position format

#

so people with different resolutions and UI sizes see stuff the way you see them

#

well at least for text

#

pictures might get stretched

tough abyss
#

Gotcha

#

How do I make that appear in the mission after I've done?

little raptor
#

well there are several things you should do:

  1. press Ctrl+Shift+S and type some random name. it'll copy some code to clipboard
  2. go to the mission folder, make a file with .hpp format, e.g. myTitle.hpp
  3. paste the stuff into it
  4. put this code above it:
class RscTitles
{
    class myTitle
    {
        idd = -1;
        duration = 5;
        fadeIn = 0;
        fadeOut = 0;
        onLoad = "";
        onUnLoad = "";
        class Controls {

and at the bottom just put:

        };
    };
};
  1. look for class XXX : YYY stuff. then put import YYY; at the top of the file for each unique YYYs.
    e.g. for this:
class Ctrl1 : RscPicture

put:

import RscPicture;

at the top of the file. (only one RscPicture should be imported)

  1. in your mission's description.ext, type:
#import "myTitle.hpp"
#

once you're done, you can open the "splash screen" using this code:

("myMissionSplash" call BIS_fnc_rscLayer) cutRsc ["myTitle", "PLAIN"];
#

it'll disappear after 5 seconds

#

there are other (and easier) ways to do this but they need scripting and you said you've never scripted before...

tough abyss
#

Okay, thanks.

Another question I have is how to get those UI options in the trigger menus to actually work

little raptor
#

idk. I've never used them. let me check

tough abyss
#

Also my mission doesn't have a description.ext

little raptor
#

make one

tough abyss
#

Okay I have

tough abyss
#

Putting it in the On Activation box causes an error

little raptor
#

yeah

#

remove the comment

tough abyss
#

Got it

#

Haha fun

#

After all that I get "Preprocessor failed with error - Invalid file name(empty filename)

#

While trying to save

little raptor
#

well like said put some random name

tough abyss
#

Ah gotcha

little raptor
#

I didn't say leave it empty

tough abyss
#

I left it at myMissionSplash instead of replacing it with the name of the title I made

little raptor
#

you can show them manually tho. e.g.:

("myMissionSplash" call BIS_fnc_rscLayer) cutRsc ["SplashArma3", "PLAIN"];
tough abyss
#

And then I see the next message

tough abyss
little raptor
little raptor
tough abyss
little raptor
#

you can just try it rn

tough abyss
#

That'd be awesome. I notice there's multiple, one for Apex, one for regular, one thats the bohemia logo, copyright and tagline

#

I'm wanting to show the arma 3 one, and then the tagline afterwards

#

Preferably the regular arma 3 one (Which I assume is the code you already sent)

little raptor
#

well if you want something really simple you don't need to make your own title

#

you can just try this for example:

#
[] spawn {
  ("myMissionSplash" call BIS_fnc_rscLayer) cutRsc ["SplashArma3", "PLAIN", 1];
  sleep 2;
   ("myMissionSplash" call BIS_fnc_rscLayer) cutFadeOut 1;
  sleep 2;
  ("myMissionSplash" call BIS_fnc_rscLayer) cutRsc ["SplashTagline", "PLAIN"];
  sleep 2;
  ("myMissionSplash" call BIS_fnc_rscLayer) cutFadeOut 1;
  sleep 2;
  ("myMissionSplash" call BIS_fnc_rscLayer) cutText ["Mission by LucyTheFluffyBunny", "PLAIN", 1];
  sleep 3;
  ("myMissionSplash" call BIS_fnc_rscLayer) cutFadeOut 1;
};
tough abyss
#

That'd be awesome, but I'm wanting to plop it down on a trigger for sure

tough abyss
#

Tweet

little raptor
#

just throw it in a trigger and see for yourself

opal zephyr
#

This code being present in my script is making addons no longer be recognized in my game. For example under controls > configure addons becomes greyed out. Keybinds I also have set up to the mod stop working. I have no idea whats wrong with it, any help is appreciated :)

JCF_fn_FlashlightIntensityIncrease = 
{

    if (jLightState == true) then 
    {
        if (jLightIntensity < 50) then
        {
            jLight setLightIntensity (jLightIntensity = jLightIntensity + 10)
            systemChat (format ["%1", jLightIntensity]);
        };
    };

};
little raptor
#

jLightState == true
just write jLightState

opal zephyr
little raptor
#

you're also missing ;

opal zephyr
#

ah I think the ; is probably whats breaking it

little raptor
#

no

#

well that's one

#

the other one is what I said first

opal zephyr
#

Whats the correct way of going about it?

little raptor
#
jLightIntensity = jLightIntensity + 10;
jLight setLightIntensity jLightIntensity;
systemChat (format ["%1", jLightIntensity]);
open fractal
#
        if (jLightIntensity < 50) then
        {
            jLight setLightIntensity jLightIntensity;
            jLightIntensity = jLightIntensity + 10;           
            systemChat (format ["%1", jLightIntensity]);
        };
``` you can't do it all in one line
opal zephyr
#

Oh ok, unfortuante thats the way its set up. Thanks for the help!

#

Damn I was worried it might not work, are Lights created with the "Reflectors" class inaccessible through sqf scripting? I made a light, simple p3d containing 2 points to use for position and direction, gave it a config and all that fun stuff. Now im trying to modify some of its variables after the fact with sqf, in this case its intensity... Is this just not possible?

#

After some more testing, im thinking it is indeed impossible through the method im attempting

winter rose
opal zephyr
# winter rose there is #lightpoint and #reflector

#lightpoint can be created through script but #reflector cant right? It looks like I can change #lightpoint freely using commands like setLightIntensity and setLightColor, but I cant do the same with #reflectors, is that correct?

#

Ughh, that being said it looks like the wiki contains some things for reflectors, like setLightConePars. It seems that parameters are either "lightReflector" or just "light"

#

I cant find any other uses for "lightReflector" other than that page though

hallow mortar
#

Reflectors can be created through script

#

Use #lightreflector in the same way you would use #lightpoint

#

This is a relatively new addition (2.0something) so it's not terribly well-documented yet.

#

Known working example I had on hand:

obj_light1 = "#lightreflector" createVehicleLocal getPosATL o_wall_1;   
obj_light1 setLightDayLight true;  
obj_light1 setLightConePars [360,360,360];   
obj_light1 setLightColor [0.3,0,0];   
obj_light1 setLightIntensity 2000;   
obj_light1 setLightAmbient [0,0,0];   
obj_light1 setDir 31; 
obj_light1 setLightAttenuation [2,0,0,5,2,3.5];```
#

Huh, so new Discord's sqf highlighter doesn't know about setLightConePars

winter rose
#

but BIKI's does ๐Ÿ˜Ž

opal zephyr
#

@hallow mortar Thankyou for that, ill look into it as a cleaner alternative to what I've already done!

Does it decide which direction its pointing with setDir or does it determine that piece another way?

hallow mortar
#

I used setDir because it was convenient for me but you can also use the vector direction commands

#

In terms of positioning, direction etc it's just a tiny invisible object. The only magic part is the light properties

tough abyss
#

apparently configfile is an undefined variable even though other examples on the wiki show that it is fine do i just define it with private = or am i doing something else wrong?

_weaponPool = "getText (_X >> 'author') isEqualTo 'Community Upgrade Project'" configClasses (conifigFile >> "cfgweapons");

wiki example

_configs = "true" configClasses (configFile >> "CfgVehicles");
tough abyss
#

๐Ÿคฆโ€โ™‚๏ธ

#

thanks

#

im stupid

winter rose
#

hi stupid, I'm dad!

tough abyss
#

does anyone have a garage script that lets you spawn vehicles that are global with skins

drifting portal
#

https://sqfbin.com/legiquduwigadutimazo
I'm placing this in an init of an object that I will spawn in zeus, when I first use the action, the texture of the laptop changes to that of the camera as I wanted, and the action text becomes "turn off screen" too, but when I press the action again to turn off the screen, it does beep but neither the texture nor the action text changes, why is that?

winter rose
drifting portal
drifting portal
winter rose
winter rose
#

also, actionIDs are local, so it's tricky
how I would do:

  • add two actions on remoteExec to everyone and joining
  • set their condition depending on the getVariable on the laptop
  • make the actions use setVariable global
drifting portal