#arma3_scripting

1 messages ยท Page 231 of 1

finite bone
#

Ah yes ty

azure portal
#

Does anyone know if BIS_fnc_setUnitInsignia needs to run specifically on init?

proven charm
#

like run it on respawn. idk though if respawn EH triggers on mission start

azure portal
#

Yeah I was finding the wiki to be unhelpful on this particular matter, I had it in an init of a unit to begin with and after shifting it to a postInit, it's just not working and I'm rather perplexed as to why

proven charm
#

hows your init code?

azure portal
#

This is what I've got at the moment postInit = "params ['_unit']; [_unit, '160thSOR_Inf_Badge'] call BIS_fnc_setUnitInsignia;"

#

The only error I can see for it says invalid selection: insignia but the insignia part hasn't changed at all

proven charm
#

have to admit idk what that postInit is, never seen before. is this at unit config file?

azure portal
#

Hence, perplexed

proven charm
#

ah ok so more of config question

hallow mortar
#

The EH can only be applied in config, but its actual content and operation is script, not config

azure portal
#

Maybe I've just been staring at this thing too long, I can't figure it out

hallow mortar
#

Has anything else changed, for example the unit's uniform class? Not all uniforms support insignia

azure portal
#

Same uniforms, the only other difference is not using _this and instead using _unit from the params, but it feels like it'd make less sense for that to cause the issue

#

Could it be a weird issue with the deprecation of call?

hallow mortar
#

What do you mean by deprecation?

#

As an intermediate step while I try to think of anything else, prove the EH code is running at all by adding a systemChat or something

proven charm
#

changes reloaded?

azure portal
#

I was under the impression that it had fallen out of use for some reason, but perhaps I misunderstood some commentary on the wiki, I can't seem to find it at the moment

#

Loading up to test with a systemChat now

#

Yep, it seems to be running, systemChat works

#

I'll keep trying to figure it out, thanks for the help so far fellas ๐Ÿ™‚

stable dune
hallow mortar
#

Why would it not like params?

#

Using params in event handlers is perfectly normal and I've never heard of any reason why it wouldn't work

lunar mountain
#

Awesome, thanks for the info!

delicate hedge
#

when i use "remoteExecCall" globaly (0) does the local execution of "remoteExecCall" command is proccessed same as it would proccess just straight "call"?

old owl
granite sky
#

Well, you can guarantee that execution won't be immediate :P

hallow mortar
#

call also doesn't necessarily guarantee immediate execution; if you're starting from a scheduled context then it will remain scheduled and could theoretically be paused by the scheduler at any time

hushed turtle
split ruin
#

I cannot add anti malaria pills in a crate ... ๐Ÿคท

this addItemCargoGlobal ["Item_Antimalaricum", 100];
proven charm
#

its full?

#

try crate canAdd "Item_Antimalaricum"

winter rose
#

also this + GLOBAL ๐Ÿ‘€

split ruin
#

yes, I though someone will point this ๐Ÿ™‚

winter rose
#

angery

split ruin
#

crate can take this item, returns true

winter rose
#

is it maybe too early or something? tried with something else?

proven charm
#

does count 1 work?

tulip ridge
#

Is that the CfgWeapons class?

cosmic lichen
#

"Antimalaricum","Antimalarial Pills","\a3\Missions_F_Oldman\Props\data\Antimalaricum_ca.paa"

this is what you wanna use

split ruin
#

there is another classname for the same item "Land_Antimalaricum_01_F"

tulip ridge
#

That'd be a static prop version of it

hallow mortar
#

If you can place it in the Editor, or it can be found in CfgVehicles, then it is a vehicle (world object) and not an inventory item

tulip ridge
#

Looks like it's just called Antimalaricum based on R3vo's message though

cosmic lichen
#

You cannot find it at all. it's hidden

split ruin
#

@cosmic lichen its working with "Antimalaricum" classname

hallow mortar
split ruin
#

I have found a bug, you cannot reload sidearm in Syndikat RHIB boat ("I_C_Boat_Transport_02_F"), gives error message

hallow mortar
#

That appears to be an ACE problem

split ruin
#

I let them know

jade acorn
#

I've just noticed that the VR Entity units have a baked in feature where they don't shoot at player. Any way to make them fire again or have a regular AI unit "wear" their model? VR Entity Faces mod is kinda what I want except when a unit gets shot, the texture changes to white.

#

nvm, they do that but only if they want to...

lapis raven
#

Could someone help me with playSound3D? I'm trying to follow the explanation on the wiki but it's not making sense to me.

I'm trying to tie activation of the sound to a trigger, so that the sound doesn't loop indefinitely for an entire mission. I want it to play from an object, as it'll be music from a speaker.

This is what I have in the trigger "On Activation" box: playSound3D ["A3\Sounds_F\sfx\alarm.wss", boll, false, getPosASL boll, 1, 1, 0, 0, true, true]; "boll" is the object I want to play the sound from.

lapis raven
#

nvm, I figured something out

small perch
#

I may be stupid but do you mean this? which is inside a confin.cpp inside a .pbo?
because I tried it and it doesn't seem to work when the mod is on

fair drum
#

You can also check if a fileExists. If the mod isn't loaded, it will be false.

tulip ridge
#

isClass (configFile >> "CfgPatches" >> "WBK_MeleeMechanics")

next prairie
#

Is there a way to change the radius of a cargo item so you can't loot it far away?
It's on the other side of a wall and you can loot through the wall.

round hazel
#

Hey there, trying to get the USS Liberty to move via a script, and I noticed that at runtime a bunch of components of the prop are created, and the placed prop itself is an invisible one. Does anybody know how to capture these new spawned componenets to feed them into the movement script?

#

Tried sticking it in an editor layer, hoping the components would be created inside that layer, but no dice

proven charm
#

hate to say but even you did get all the carrier pieces to move, their update rate is very slow in MP because they are static objects (pretty sure about that)

tired trout
#

you checked out how they moved the liberty in the AoW showcase?

round hazel
fair drum
#

Network update times are slower for moving static objects, so per frame movement will be choppy on multiplayer.

hallow mortar
#

attachTo can solve that (other limitations may apply)

hallow mortar
#

You can look at the base object's config to find the functions it uses to create the objects, and open them in the function viewer to see how they work

iron flax
# round hazel Hey there, trying to get the USS Liberty to move via a script, and I noticed tha...

I found this a few years ago, I'm not sure if this is the best way of doing it, but maybe there is something in the script that may be helpful to you.

[CVN1,45,120,FALSE] call MGI_CVN_PATTERN;


MGI_CVN_PATTERN = {
  params [["_CVN",objNull],["_firstDir",0],["_leg",300],["_rightTurn",TRUE]];
  if (!isServer) exitWith {};
  _CVN setdir ((_firstDir + 180) mod 360);
  _CVN setVariable ["CVNPattern",[_firstDir, getDir _CVN]];
  _CVN setVariable ["CVNTrueDir",_firstDir];
  _CVN setVariable ["CVNTimer",0.1 - diag_tickTime];
  ["movingCarrier","onEachFrame",
    {
      private _CVN = _this param [0,objNull];
      private _leg = _this param [1,300];
      private _rightTurn = _this param [2,TRUE];
      private _dir = _CVN getVariable "CVNTrueDir";
      private _t = _CVN getVariable "CVNTimer";
      _CVN setdir ((_dir + 180) mod 360);
      _CVN setPosWorld ASLToATL  (_CVN getpos [0.3,_dir]);
      [_CVN] call BIS_fnc_Carrier01PosUpdate;
      if (((diag_tickTime + (_CVN getVariable "CVNTimer")) mod _leg) < 0.1) then {
        _CVN setVariable ["CVNTimer", - diag_tickTime];
        _CVN setVariable ["CVNTrueDir",_dir + ([-0.01,0.01] select _rightTurn)];
        if (abs((360 +(_CVN getVariable "CVNTrueDir") mod 360) mod 360 - (_CVN getVariable "CVNPattern")#1) < 0.5) then {
          _CVN setVariable ["CVNTrueDir",(_CVN getVariable "CVNPattern")#1];
          reverse (_CVN getVariable "CVNPattern");
          _CVN setVariable ["CVNTimer",0.1 - diag_tickTime];
        };
      };
     },
    [_CVN,_leg,_rightTurn]
  ] call bis_fnc_addStackedEventHandler;
};
round hazel
#

Absolute legend

vapid scarab
#

I just peeked into here. Idk where you are with this, so this might be useless now. But here is how you handle it in MP

If you want this to be a display object in the distance, the problem is simple. Create a local object on everyone's client and run the movement script on each client. You just need the specific display ovject and not the invisible ground. (Just make sure to clean up the physical parts in case anyone flys near it)

If you want the object to be walkable before or after, have two copies of the boat. Start and end, hide the end. When going to move the boat, spawn the local at start, hide the start, move the start to the end, unhide the end, and remove the local.

#

Essentially, you are doing movie magic.

#

@round hazel

split ruin
#

is there a script way to open UAV terminal ? ๐Ÿค”
edit: found it

player action ["UAVTerminalOpen", player];

another stupid question ... how to close the terminal ๐Ÿ˜‚

winter rose
#

findDisplay close imo?

old owl
# split ruin is there a script way to open UAV terminal ? ๐Ÿค” edit: found it ```sqf player ac...

Could probably use closeDisplay or closeDialog. Not sure though off the top of my head though if it is a display or dialog although the differences can be found here:

https://community.bistudio.com/wiki/GUI_Tutorial#createDialog_vs_createDisplay_vs_cutRsc

If it's a dialog you'll be able to just run closeDialog with your exit code no biggy. If it's a display you'll have to find the IDD or display name but that shouldn't be too difficult as you can just check the diff of allDisplays before and after.

split ruin
#

@old owl I manged to close it with

player connectTerminalToUAV objNull;

but I guess this is not the optimal way
this GUI tutorial is very useful

old owl
azure mural
#

anyone know the IDD for the scoreboard display? I tried 175 but that didnt seem to work

faint burrow
#

But it's actually 175.

azure mural
#

pain

faint burrow
#

Then you're doing something wrong.

azure mural
#

yeahhh I derived that, heading back to the chalk board

vapid scarab
#

So are trying to get it while its closed or open? I forgot how i did testing exactly, but I think I ran a background script that logged the displays and then i would open whatever menu i needed

split ruin
#

Is it possible somehow to play like this

showHUD[] =
{
    0,    // Scripted HUD (same as showHUD command)
    0,    // Vehicle and unit info
    0,    // Vehicle radar [HIDDEN]
    0,    // Vehicle compass [HIDDEN]
    0,    // Tank direction indicator
    0,    // Commanding menu
    0,    // Group info bar
    0,    // HUD weapon cursors
    0,    // Vehicle display panels
    0,    // "x killed by y" systemChat messages
    0    // force show drawIcon3D icons
};

but to have the UAV, tank, etc interface elements normal?

small perch
#

how can i modify the code of whatever this is called in a similar manner to overriding functions?

versed trail
#

Anyone happen to know off the top of their head where I can find the BIS function to create the editor preview images? I could have sworn it was on the biki somewhere but I cant find it

#

got it, bis_fnc_exporteditorpreviews

tulip ridge
# versed trail got it, bis_fnc_exporteditorpreviews

Do note that your images will come out very over-exposed when using it, you will also need to resize them to 455x256 and convert them to a jpg

If you're using HEMTT for your project, you can use hemtt photoshoot which will handle taking the images with the correct settings, resizing them, and converting them to jpgs

versed trail
#

Nah, I was mostly trying to reference the camera setup code there. The photos do come out overexposed but I think that's an issue with screenshot in general, ive mostly mitigated issues by following the wiki guide for picture taking, along with disabling depth of field and lowering brightness

split ruin
#

I want to make my ace self interaction menu a little more customized but I don't know where the find the default ace icons ... any config class or a file path?

granite sky
#

They're spread around the different ACE addons where they're used, I think.

#

An example from addons\dragging\functions\fnc_setDraggable.sqf:

private _icon = [QPATHTOF(UI\icons\box_drag.paa), QPATHTOF(UI\icons\person_drag.paa)] select (_object isKindOf "CAManBase");
#

Not used to ACE/CBA structure? :P

#

Virtual file system path there would be something like z\ace\addons\dragging\UI\icons\box_drag.paa

#

The QPATH macros basically append to the PBO prefix of the addon.

mellow pilot
#

hi, im tring to make a random sector attack in eden edtior, but i can't move area object and trigger object with a script. what do i do? i need them for ai to know where to go?

mortal folio
# granite sky Not used to ACE/CBA structure? :P

Ngl i cannot stand the extent to which cba and ace use macros, half of them are nested macros too, things are immensely unreadable for anyone trying to just understand what something does lol

#

Then again i dislike macros in general ๐Ÿคท

#

The file path one isnt too bad tbf, or simple quote ones, its other stuff especially to do with vars

hushed turtle
#

Macros are nice blobcloseenjoy

proven charm
#

mostly use them with configs

split ruin
#

I am trying to switch tank cannon ammo types via script but unsuccessful ๐Ÿ˜”

(vehicle player) selectWeaponTurret ["12Rnd_120mm_HE_shells_Tracer_Red", [0,0]];
//this doesnt work too 
(vehicle player) selectWeaponTurret ["12Rnd_120mm_HE_shells_Tracer_Red", [0]];
proven charm
#

the command seems to take weapon name

#

if you want to change ammo that maybe wrong command

split ruin
#

@proven charm I cannot find command that changes ammo type ...๐Ÿคท tried this but didn't work either

vehicle player selectWeaponTurret ["12Rnd_120mm_HE_shells_Tracer_Red", [0], "cannon_120mm"];

and there is not action for it

proven charm
#

depending on what you want to do, change ammo?

split ruin
#

@proven charm I am searching for scripted way to~~ change~~ switch tank main cannon ammo types - APDSF, HE-T, etc

proven charm
split ruin
#

I cannot believe there is no way to switch ammo types except the addAction ๐Ÿคฌ

ivory lake
split ruin
#

@ivory lake I found it simultaniously ๐Ÿ˜‚ , thanks @ivory lake & @proven charm

vehicle player loadMagazine [[0], "cannon_120mm", "12Rnd_120mm_HE_shells_Tracer_Red"];
old owl
#

Anything is good in moderation but if you're commonly using them over local functions, you need to seek help ๐Ÿ˜„

small perch
#

I am trying to use

[_unit, true] call ace_medical_fnc_setUnconscious;

to set a unconscious in ace however all it seems to do is just kill the unit.

tulip ridge
#

If it's disabled then they'll just die

small perch
#

you know, i did not think about, thanks

fair drum
jade acorn
#

I just noticed that I can't use sleep within the OpticsSwitch EH. Any way to work around this? Basically I have a script that triggers when _isADS returns true, however I need to delay it by .5s because I want to wait until the player is actually looking through the sights.

#

I can use a cameraView while loop but as far as i remember loops seem to break when player loads a save, never had any issues with EHs.

proven charm
jade acorn
#

for which one

proven charm
#

to be able to use sleep in OpticsSwitch EH

tulip ridge
granite sky
#

Because technically the sleep doesn't happen in the EH? Well, yes.

silent comet
#

Is there a way to make it so the AI units get out of a vehicle after BIS_fnc_unitPlay is done? I noticed there is a varDone param in the function, but couldn't find much on the proper syntax

hallow mortar
#

The varDone is a variable which will be set (I assume to true) once the function is complete. You provide the object whose namespace will be used (I'd probably use the object being unitPlayed) and the name of the variable.
You can then monitor that variable to detect when it changes to true, e.g.

[_object, [...], [_object, "my_unitPlay_var"], ...] spawn bis_fnc_unitPlay;
waitUntil {
  sleep 1;
  _object getVariable ["my_unitPlay_var", false];
};
{
  _x action ["GetOut", _object];
} forEach crew _object;```
(this is just an example of one approach you could take, there are multiple methods of doing this kind of thing)
silent comet
#

No errors though, so that's a plus

split ruin
#

anyone has succes using Drongo Drone Tweaks with Crocus FPV? Works fine with Reaction Forces drones but not crocus ... nvm I am making my own script ๐Ÿ’ช

hallow mortar
fair drum
#

interesting to see what will come of promises. would be a great instance to use it if they ever rewrote that function

open flume
#

So im trying to make a "reinsert alert" for pilots so they know if there are people waiting, though I was wondering how I could make it target specific slots

I currently have

[["<t valign='top' shadow = '2' color='#00ff00' size='1.5' font='PuristaMedium' >Air Control</t><br /><t color='#add8e6' size='1.5' font='PuristaMedium' shadow = '2' >Reinsert needed!!!!.</t>", "PLAIN DOWN", -1, true, true]] remoteExec ["titleText", tp1];```

but when testing it still sends it to people without the variable name. [I have this on one of the ruggest computers on the code complete hold action]

I also tried doing
```_pilot = [tp1 , tp2];
remoteExec ["titleText", _pilot];```
#

but it still has it coming to all of them

old owl
# open flume but it still has it coming to all of them

Have you checked to see what those variables are via diag_log or systemChat? There are cases like in instance of remoteExecutedOwner being used outside of remote executed context it will set the target to 0 which is global

open flume
#

i shall take a gander tho!

#

||as soon as i figure out how XD||

tulip ridge
proven charm
#

__has_include is weird when it returns true on loose files even when filepatching is off. the fileExists on the other hand does not return true on those files

hushed turtle
#

Loose files?

proven charm
#

files in arma dir that exist also in pbo

hushed turtle
#

So it works as expected? True when file path exists?

proven charm
#

depends what you expect. right now id prefer it to return false because i turned filepatching off

#

but maybe its intent to work that way. different from fileExists ...

hushed turtle
#

I use __has_include to see if file exists to check if addon is loaded

proven charm
#

thats exactly what im doing also

#

but even mod is not loaded it will return true because of loose files

granite sky
#

Err, is this in precompiled code or what?

proven charm
#

precompiled?

granite sky
#

Well, is it in config or code, for a start?

proven charm
#

description.ext

granite sky
#

Someone give me a good thing to put in description.ext to test that :P

real tartan
#

how to add ContainerOpened event handler on unit ( corpse ) ?

    _unit addEventHandler [ "ContainerOpened", {}];
    ( uniformContainer _unit ) addEventHandler [ "ContainerOpened", {} ];
    ( vestContainer _unit ) addEventHandler [ "ContainerOpened", {} ];
    ( backpackContainer _unit ) addEventHandler [ "ContainerOpened", {} ];

none of these trigger from server, nor client

#

should I try to find nearest GroundWeaponHolder ?

proven charm
#

well i can live with it, just wasnt sure if its bug or not...

granite sky
#

I'm just not sure if it's real. It absolutely shouldn't be detecting files that it can't access.

#

Can't think of anything in description.ext that's obvious enough to test though.

#

I guess dumping some random stuff into mission config would work.

proven charm
#

well all i have is #if __has_include("\somefile.h") foundFile = true; #endif somefile.h in arma dir and filepatching off

hushed turtle
jade acorn
#

Can someone show me an example of how to use BIS_fnc_GUIhint? I can't really get it working, anything I do it just makes the screen go black

opal ember
#

I'm wondering if someone knows how to override a CfgWorlds initWorld/demoWorld .
I was using a custom mod where I setup a initworld with a cutscene so In the main menu I can have a 'custom background' (Its a diashow of multiple pictures) which works completly fine unless I load the GM DLC.

When I load GM DLC it just ignores my custom world/cutscene and loads the ones from GM instead.

Does anyone know how I can override it? (I first tried using a custom image with RscDisplayMain which works well for just having a single picture but since code that is attached to it does run in preStart I cant use any suspendable scripts and therefore can not use any sleep code to change the image every X seconds.

sly cape
opal ember
sly cape
fair drum
ember pier
#

Is it possible to eg change the type of parachute used in Warlords by creating a [WarlordsMissionScript].sqf file in the mission folder that overwrites part of the Warlords module? Or is the Warlords system not accessible

little raptor
split ruin
#

any way to add night vision to driver/pilot camera, it has only thermal (and vanilla thermals aren't very helpful)?

tulip ridge
#

Not with scripting probably

split ruin
ember pier
dusk gust
#

Does anyone have an idea of where the camera is anchored to on player characters?
Is it based off the model, or is it based off the animation? Is there a config location that its stored in?

tulip ridge
little eagle
#

Not with scripting commands

somber silo
#

For the HandleDamage event handler, does anyone know why the 120mm howitzer, 230mm rocket and 82mm mortar zeus fire supports now register IsDirect as true even though the hit was indeed not direct and splash damage??

This does not happen with the real 120mm howitzer, and this only started happeneing recently - is this an intentional change?

hushed turtle
#

It's a long time since last update on stable branch. Nothing about HandleDamage changed recently

granite sky
#

Not sure which of the 30-odd handleDamage events from a single howitzer hit you're talking about :P

#

As far as I can tell, the ones from the howitzer projectile have directHit false but the first batch of post-ragdoll damage has directHit true.

#

The second batch of post-ragdoll damage is three seconds later so I guess that's from hitting the ground.

#

It would also be possible for the shell to hit directly, in which case you'd get a batch of pre-ragdoll direct damage too.

#

I guess the wiki does claim directHit false for "all other kinds of damage", but I wouldn't know whether the wiki or the engine is wrong.

somber silo
#

hmm im looking specifically at ones where context = 0 - for some reason the zeus arty is always returning directHit true

granite sky
#

Can't replicate that without dropping it right on the guy's head.

#

Oddly enough, if you do that then there's no indirect damage from the shell.

somber silo
#

directhit is always true for me

granite sky
#

No projectile. You're only seeing the tail of the ragdoll + fall damage there.

#

systemChat doesn't have enough buffer for this.

#

Use diag_log instead.

#

or only print the context 0 cases. Should work.

full swan
#

Hi guys, anyone knows any way to change blackfish vectoring via script?

#

"animate" is unable to

full swan
#

the vehicle is attached to a game logic mid-air with AI inside.. action is not working either

warm hedge
#

Then likely no, I don't think there is anything useful

full swan
#

alright... animate works, but AI is overriding it..... it defaults to forward facing when no driver present..

#

disableAI doesnt work though

#

enableSimulation false for the AI does nothing aswell

iron flax
split ruin
#

I hope the Blackfish isn't on the ground otherwise the propellers will hit it resulting in catastrophic failure of everything ๐Ÿฅถ

iron flax
split ruin
#

@iron flax they are big and if they are horizontal (zero tilt) they will hit the ground

iron flax
#

It won't allow full horizontal tilt while on the ground.

split ruin
#

I speak about the high pathetic situation when 0 degree tilt is forced by script ...

jade acorn
#

Can someone show me an example of how to use BIS_fnc_GUIhint? I can't really get it working, anything I do it just makes the screen go black

fair drum
#

Post what you have so far

jade acorn
#
[
["Description blahblah", ""],
"Header",
[""],
["OK", {hint "works";}, 0],
[""]
] call BIS_fnc_GUIhint;```
#

i've seen comments how superior this is to any other hints in the game but somehow there is not a single example out there

full swan
full swan
iron flax
#

Have you tried unitcapture/unitplay?

fair drum
sudden fable
#

the only issue i have with my script is the text wont show when they interact with the intel but it assinging the task works

this addAction ["<t color='#00FF00'>Read Notepad</t>", {
    [["gate", "SUCCEEDED"], ["Read Notepad", "We Need To See What This Gate is, By The Blood God We must Understand This and Give Him blood!", ""]];
    deleteVehicle (_this select 0); 
}, nil, 1.5, true, true, "", "true", 5, false, "", ""];```
tired spear
#

I am new to this. I have a trigger with condition

{ alive _x && side _x == resistance } count thislist > 2

and the sqf with

hint "1";
sleep 5;
if ("areathing" == true) then { goto "next1" };
#next1
hint "2";

but no work. also tried

if ("areathing" == true) then { continue };

but also generic error in expression.

tulip ridge
old owl
#

If a multi-type comparison is desired you can use isEqualTo or a switch statement

tired spear
#
hint "1";
sleep 5;
if (areathing == true) then { continue };
hint "2";

generic error in expression?

mortal folio
tired spear
mortal folio
mortal folio
#

Also you can just do if areathing then.... - no need for == true, assuming areathing is a bool

thin pine
#

@next prairie it is possible with scripting commands but it would be on a degree of complication that I wouldn't even bother.

ivory lake
#

I don't know if this is an issue between seat and keyboard but with :
https://community.bistudio.com/wiki/setTurretLimits

one issue I keep having with it is if for example you want to lock the turret to -15 degrees
and input

vehicle setTurretLimits [[0,0],-15,-15,-25,25];```
the game translate this to -15 , 0 allowing the turret to still turn from -15 to 0
#

locking to 0 or positive numbers works fine but negative numbers does not work

#

I'm not too sure if this is a bug or simply a limitation of the script command

upbeat estuary
#

Hello, new scripter here. I managed to figure basically everything out, except an intro sequence. When I want the op to start, I want everyone to be teleported to the same base location.
Now I can teleport every player individually or do it via Zeus, but I think that firstly it's inefficient, and two there is a cutscene when everybody needs to be teleported, so it'd be hard for me to teleport everyone.

Question: How would I do this?

#

My code being this, with "introteleport.sqf" being the new script to teleport everyone

#

Whoops, just noticed there are some traces from the old script still in there

#

ignore the heliIntro engineOn thing

finite bone
#

Is there a way for the END screen (missionEnd) to be auto continued? Running intercept and also python bridge layer - if a native call doesnt exist Ill have to manually send mouse input signal to the button location - which i also wonder if the position is always the same?

finite bone
upbeat estuary
#

Not what I was looking for. I was looking to have them teleported once a trigger that I (as Zeus) manually trigger

#

The video plays and after (or right before) it ends, they get teleported

finite bone
#

How are you defining the trigger?

#

Is it going to be a scollwheel action? a variable that becomes true? manually executed as a code somewhere?

upbeat estuary
#

The trigger works, but I just don't know how to efficiently teleport the players

finite bone
#

There are many ways you can do - the shortest and easiest (if you are going to teleport everyone) is to wait for the trigger variable to become "true" and then teleport.

For example, you can wait until the variable "FinnoNr1_Teleportrigger" becomes true (run a waitUntil inside a spawnblock with some sleep delay) and then teleport everyone

#

If you are using a trigger box - then you can just add it in the 'OnActivation' field

upbeat estuary
#

It's necesarrily the trigger that's the problem, I just don't know the line of code I need to use to teleport everyone

#

Like what's the command thing

#

(Remember, I started with scripting like a week go, basically)

finite bone
upbeat estuary
#

I'

#

I'll look into it

#

thanks for now

#

Although, if I use this, won't every player teleport to the exact same spot?

#

Won't that cause any issues?

finite bone
#

a quick snippet:

private _allPlayers = allPlayers select {!isNull _x};
private _targetPos = [12000, 4500, 0]; // if the position is an object like invisible helipad use `getPosATL object_name`
{
  _x setPosATL _targetPos
} forEach _allPlayers;
#

It entirely depends, you can use random(3) to spread them out a bit, check if they are in vehicles etc.

upbeat estuary
#

That should do it

#

Thanks

finite bone
fair drum
#

No afaik, but the menu probably also uses an exit code, so you can just close the dialog when you detect it using closeDialog

full swan
#

why the fuck is setPosASL breaking targetting sensors?! ๐Ÿ˜„ ๐Ÿ˜„

#

does anyone know about this?

fair drum
#

You're going to have to get more context than that

full swan
#

lemme give you specific repeatable case I just spent 2 hours figuring out....

#

be left gunner in blackfish - let that blackfish be teleported via setPosASL to a new position (or the same, doesnt matter)

#

you can no longer target tanks and empty vehicles

finite bone
#

The process loop im going for is: select maps (say 5 maps) -> script auto loads first map -> runs the script inside the first map -> mission ends (user input to click 'continue') -> loads second map automatically

fair drum
finite bone
#

Ah cool then

fair drum
upbeat estuary
#

I might be an idiot, but I tried doing some random nuimber in the teleport command
private _allPlayers = allPlayers select {!isNull _x}; private _targetPos = [random [665, 668], random [6403, 6406], 0]; { _x setPosATL _targetPos } forEach _allPlayers;

#

based on the code El Pepe gave me

upbeat estuary
#

Yeah i figured something out

#

I figured it out

winter rose
#
{ 
  _x setPosATL [665 + random 3, 6403 + random 3, 0];
} forEach (allPlayers select { !isNull _x });
upbeat estuary
#
private _allPlayers = allPlayers select {!isNull _x};  
private _targetPos = [random [665, 666.5, 668], random [6403, 6404.5, 6406], 0]; 
{  
  _x setPosATL _targetPos  
} forEach _allPlayers; 
#

This is what I did ^

finite bone
#

Trying to close the missionEnd screen with IDD 58 does not seem to work

warm hedge
winter rose
#

fine, fine!

fair drum
finite bone
#

Yea ill get an exhaustive list of allDisplays first and also I wonder if I should try closeDisplay over closeDialog for this

#

though dialog will be the correct ones atleast in theory

jagged mica
#

hypothetically, would it be possible to pass a function as a parameter when Im calling some other function?

#

it seems that call allows params of any type

#

and I need to be able to pass a handler function to a function Im calling

proven charm
#

yes callback functions are possible (or whatever kind of function you need)

jagged mica
#

epic, gonna give it a shot later

errant jasper
#

But no closures, so any arguments from outside you want to later call it with has to be moved around some other way.

jagged mica
#

yeah it was one of the first lessons I learned in this language

#

I just need the function luckily

split ruin
#

any way to make a ai heli to fly faster? any way to add to speed?

old owl
split ruin
#

hmm, what drawback if reduce the mass ? and how to do it ?

old owl
#

I believe it makes the vehicle more prone to damage and more sensitive to pitch/yaw. The command is setMass

#

From a mod standpoint though I imagine there's a better way where you can override the class or something but that goes outside my knowledge

split ruin
#

its ai driven so I can ignore commands I guess
if I make 50% less mass it will fly faster?

#

mass is 6154.5

split ruin
#

@old owl wow actually is flying faster !

heli setMass 3000;
atomic niche
#

iirc
for heli mass higher = more manouverable, and lower mass = less manouverable

mortal folio
#

Negative mass = the terrain moves coolfrog

split ruin
#

and all this because I don't understand vectors ๐Ÿ˜‚

mortal folio
# split ruin and all this because I don't understand vectors ๐Ÿ˜‚

Direction vectors? - its pretty simple actually - doing them by hand ofc is hard but reading them is almost the same as reading xyz euler - except the rule is essentially "which axis is the entity's direction(y) pointing", [0, 1, 0] is default y forward, i.e 100% y axis, [1, 0, 0] is essentially " y is pointing world x positive" and combinations are just fractions of the axis

#

Vectorup is the same, it just says where the entity's local z is pointing instead of y, which is why default is [0, 0, 1]

split ruin
#

so with vector dir [0,1,0] object is pointing right ?

mortal folio
#

[0, 1, 0] is north

#

0.5, 0.5, 0 would be diagonal forward/right

split ruin
#

[1,0,0] will be east ?

mortal folio
#

Yep

#

-1 west

split ruin
#

oh I got it now ๐Ÿฅณ

mortal folio
#

-1 on y is south then

#

Etc

#

[-0.5, 0.5, 0] would be north west

#

Im doing 0.5s as an example since its easiest to math, but vectors have to add up to 1 or -1, no lower or higher

split ruin
#

what about [1,0,1] this will be east and up like diagonally ?

mortal folio
#

Vectorup is separate

#

[1, 0, 1] is no longer a normalized vector either so its not valid

split ruin
#

what is the last component for vectorDir ?

#

[x,y,z] what is z

mortal folio
#

Z axis, so vectordir [0, 0, 1] would make direction try to face "up", but if vectorup is already [0, 0, 1] which it will be in most cases.... i never tested what happens but it wont work well, so ypu gotta adjust vectorup to be [0, 1, 0] or [1, 0, 0], in which case up will face forward/sideways and direction will face the sky

#

You shouldnt really be writing normalized vectors manually, thats what euler angles are for, but learning to read them is useful

fair drum
#

Something something gimbal lock

mortal folio
#

That too is fun lmao

#

Thats why i prefer quaternions blobcloseenjoy

#

But they too are hard to read like vectors

split ruin
#

lets apply this to a command like

heli setVelocity [20, 0, 0];

heli will fly east with 20 m/s ?

mortal folio
#

Yes

split ruin
#

but if I want for it to fly east and down
it will be

heli setVelocity [20,0,-10];
mortal folio
#

Keep in mind i was talking about direction vectors, position and velocity vectors are much easier to understand, its just xyz, positive x is east, positive y is north, positive z is up, and obviously they are not normalized and you dont have to account for different "main axies" like you do with setvectordir and up

split ruin
#

nice I got it finally ๐Ÿฅณ
but I don't undestand this command

vehicle setVectorDirAndUp [vectorDir, vectorUp]

vector dir I know already but
is the vector up the same?

old owl
#

Keep in mind setVelocity will only work while the vehicle is local

mortal folio
#

Instead of "directoin will face this axis" with vectordir

split ruin
#

@old owl its will be local to the server ๐Ÿ˜†

mortal folio
#

In short - if you ever have to modify where the "top" of an entity is facing, you will have to mess with both vectordir and vectorup, but if youre just changing direction, vectordir is fine, but then so is setDir ๐Ÿ˜„

split ruin
#

so its facing direction, then rotating ?

mortal folio
#

Come again?

split ruin
#

oh, vector up is just the z axis of the vector ?

mortal folio
#

Yyes by default its z positive because... well... the up of the unit points up into the sky ๐Ÿ˜„

split ruin
#

and its expressed wit the vector up array [x,y,z]

mortal folio
#

Yes

split ruin
#

now i got it finally

mortal folio
#

If vectorup were [0 1 0] then a units head or top will be pointing north

split ruin
#

thank you so much bro, I finally understand it ๐Ÿค

atomic niche
#

"I prefer quaternions" are words that should never be spoken

finite bone
#

and displayAddEventHandler only has onChildDestroyed and no onChildCreated kmao

mortal folio
#

Only time ive had issues with quaternions is when trying to make a fluid 360 degree rotation

errant jasper
#

only vectors? You like gimbal lock? Because that's how you get gimbal lock

old owl
#

I'm NGL I didn't even know what the word meant until I looked it up then realized it's what's used in the Eden Editor

old owl
#

Quaternions

mortal folio
#

Err... eden uses standard euler angles converted to vectors, ive not seen a quaternion anywhere in arma (at least not in exposed functions)

old owl
#

Isn't that how the positioning is done UI wise?

mortal folio
#

No, quaternions are a rotational transform method

#

Ui positioning is just 2d position and scale

old owl
#

Shows how much I know ๐Ÿ˜„

#

I just saw this and it looked familiar

mortal folio
#

Tbf this stuff is very specialized and most people dont encounter it

#

Im in animation so i know it but if youre scripting theres not much reason to know anything beyond eulers

finite bone
proven charm
#

@finite bone what i did was overwrite RscDisplayDebriefing onLoad to call my code. but i hope there are better ways. the code itself should be created in uinamespace. This may require a mod

finite bone
#

Yea mod is not a problem - its how im testing these anyways

mortal folio
#

iirc MPEnded and Ended are slightly different

#

I.e the display might be visible when those events trigger is what im getting at

split ruin
#

I am trying to make fpv drone face player, but it doesn't work, it always faces north

_azimuth = _fpv getDir player;
_fpv setVectorDir [sin _azimuth, cos _azimuth, 0];
_fpv setVectorUp [0, 0, -0.3];

what am I missing here ...

sly cape
stable dune
split ruin
#

actually @sly cape got it right
but I want to tilt the drone like 30 degree downwards ๐Ÿค”

jade acorn
split ruin
#

or can I get the vertical direction to player ๐Ÿค”
like azimuth but vertical ?

fair drum
#

Do a !remindMe 1.5 hours

digital hollow
split ruin
#

does setVelocity need to be constantly applied?

onEachFrame {fpv setVelocity [20, 0, -10];};
little raptor
#

yes

#

but don't use onEachFrame

split ruin
#

what then ? ๐Ÿค”

little raptor
#

a stacked version

#

EachFrame event handler for example

full swan
#

guys is there an upper limit for the amount of sensors in the mission? ๐Ÿ˜„

#

I am trying to find a culprit for my targetting issues.. and I am starting to believe that the amount of vehicles is making the sensors globally confused... as missiles are not able to navigate to their lock on targets aswell..

jade acorn
fair drum
fair drum
jade acorn
#

yeah, I was looking for something that will be displayed at the centre of the screen with buttons to click. As an alternative to hintC that can take a bunch of text

#

bis_fnc_guiMessage has a limited number of lines it can fit iirc

proven charm
#

@jade acorn bis_fnc_guiMessage can show multiple lines ( with structured text and <br/> )

tiny cairn
#

Hey hi guys I need a little help.

I would like to create prisoners who can be freed by the players and who join the playerโ€™s team, which script should I use?

winter rose
hallow mortar
#

You may also need addAction or bis_fnc_holdActionAdd, as well as switchMove or similar

#

Note that if you use ACE, there's already a framework which can handle most of the "prisoner" part for you (though the joining part is still up to you)

tulip ridge
#

Could always make more with ctrlCreate

molten yacht
#

Looking for help improving this script. It's to be called from a server-only trigger that usually but not always contains all of the people it should be targeting.

params ["_group1"]; // all players in drop zone


private _squads = [];
private _allSpecops = [];

{ // get list of all squads in drop zone (admins won't be in a drop pod)
    _squads pushBackUnique (group _x);
} forEach _group1;

{ // get every unit from each squad and put them into a giant array
    {_allSpecops pushBackUnique _x } foreach units _x 
} foreach _squads;

{ // do action to every unit in the squads that are in the drop zone.
    _x setDamage 1; //placeholder for later thing
} foreach _allSpecops
    
#

Having this many foreaches makes me cringe preemptively even if it only fires once in a mission

winter rose
#

_group1 being an array of some units?

molten yacht
#

Yes, we're trying to catch outliers.

#

Like if one drop pod is still above the trigger zone when it fires.

winter rose
#
{
  { _x setDamage 1 } forEach units _x
} foreach _group1;
```?
molten yacht
#

All the units are players and they're all on the same side

molten yacht
winter rose
#

if they are part of the group of one of the _group1 member, yes

molten yacht
#

....no way it's that easy

#

can this cause it to accidentally fire on someone twice?

#

like does this check for dupes

winter rose
#

units also take unit as parameter, as a shortcut for units group dude

molten yacht
#

oh

#

hm

winter rose
molten yacht
#

It needs to check for dupes because of other later scripts that do things like knock you unconscious... hmm

winter rose
#

that's where arrayIntersect rises

molten yacht
#

oh yeah that'd work

winter rose
#
private _unitsToDeal = [];
{ _unitsToDeal append units _x } forEach _group1;
_unitsToDeal = _unitsToDeal arrayIntersect _unitsToDeal;
{ _x doSomething 42 } forEach _unitsToDeal;
molten yacht
#

you're a god? that's perfect

errant jasper
#
params ["_playersInZone"];
private _allSpecops = [];
{
    {_allSpecops pushBackUnique _x; } forEach units group _x;
} forEach _playersInZone;

Why is pushBackUnique not suitable?

winter rose
#

forgor

errant jasper
#

Performance doesn't really matter here. But selecting the groups uniquely is enough since units are not part of multiple groups

#

(technically assuming you run it unscheduled, but even outside the chance is astronnomically small any will change group)

#
params ["_playersInZone"];
private _groups = _playersInZone apply {group _x};
_groups = _groups arrayIntersect _groups;
private _allSpecops = [];
{_allSpecops append units _x; } forEach _groups;
#

How many ways to skin a cat...

granite sky
#

Yeah, Muzzleflash's version.

winter rose
#

I agree ๐Ÿ˜„

granite sky
#

Also mentioned the unscheduled thing so basically a perfect answer :P

errant jasper
split ruin
#

ruforgor ...

livid kraken
#

I have no idea where to put this but a lot of scripting went into this so Imma drop it here if not allowed just delete it.

I just got an interface set up to select a mission and then run the #mission command and swap the server to that mission all without admin intervention I think its pretty cool. This is just the beginning of a massive project but this was the locking factor to being able to do it.

molten yacht
#

Is there any way to have a recorded flight work in MP?

#

last time I tried the engine on the helicopter was off

#

while it moved through the air weirdly

past wagon
#

Thatโ€™s what I had to do to make a blackfish fly in a straight line over the island with everyone inside

molten yacht
#

wouldn't really work for them all getting in a heli together though

past wagon
#

Yeah I had to locally add dummy passengers for each player

mortal folio
# molten yacht Is there _any_ way to have a recorded flight work in MP?

If you mean with unitPlay - that works in mp ive done it before - you sure you called it from where the aircraft is local? You might need to turn the engine on manually, but any jittering you see (if thats what you mean by weird) is just netcode paired with the fact that the script is scheduled

fair drum
#

unitCapture/unitPlay works fine for helis. its usually user error if it doesn't.

mortal folio
#

Ye all it does for the most part is setvelocitytransformation

past wagon
past wagon
#

I'm having an issue with ppEffects (specifically "FilmGrain")

When the player's view is dim when I enable it, their vision gets stuck looking way too dark.

Here's a video: https://youtu.be/wEVrR3KbASI
If it's hard to tell, the effects are enabled when I leave the blue zone on the map.

This is basically the code causing it:

filmEffectH = ppEffectCreate ["FilmGrain", 3];
filmEffectH ppEffectAdjust [0.5, 1, 1.5, 0.5, 0.5, true];
filmEffectH ppEffectCommit 0;

while { true } do {

    if !(player inArea "Zone") then {
        filmEffectH ppEffectEnable true;
    } else {
        filmEffectH ppEffectEnable false;
    };

    sleep 1;
};

Here's the full code, which is more convoluted: https://pastebin.com/NKB6B9Pm

I am checking whether or not the player is in a specific zone every second, and if they are not in the zone they get the effects. The "WetDistortion" isn't causing the problem because disabling the "FilmGrain" fixes it. There are also "Light" and "Heavy" versions of the effects, which are applied depending on the player's goggles. Both versions cause the problem.

mortal folio
#

hence why unitplay has to be local too

#

im surprised it even does anything if you do it remotely

past wagon
#

So unitPlay remoteExecs it for everyone?

mortal folio
#

no, just the machine where the vehicle is local

#

remote-execing it for everyone is probably why you're having issues

past wagon
#

Yeah when I use interpolation on the server, where the vehicle is local, the movement is visually bugged for remote clients

mortal folio
#

unitplay itself doesnt remoteexec anything, it just sets velocity transformation, the command itself does the networking

past wagon
#

The plane moves in the straight line I want it to, but every half second or so it flips upward

#

Like itโ€™s rapidly tilting

#

And correcting

mortal folio
#

mm... that's either somehow the recorded data being wrong, it's simply lag, or delays in the scheduler, or mods messing with things

past wagon
#

It isnโ€™t recorded

#

Itโ€™s just setvelocitytransformation

mortal folio
#

oh nvm i mixed you up with ashu who was trying unitplay

#

well ๐Ÿคท works on my machine โ„ข

#

you can just try using setvelocity

#

setvelocitytransformation is kind of just a wrapper to my knowledge that does a buncha things

#

but functionally is identical to just combining setVelocity, setdir, etc...

past wagon
#

It interpolates between a start and end vector

#

oh nvm

#

im tripping, thats what my code as a whole does

#
private _startTime = time;
addMissionEventHandler ["EachFrame", {
    _thisArgs params ["_plane", "_planeStartPos", "_planeEndPos", "_startTime"];
    private _vectorDir = _planeStartPos vectorFromTo _planeEndPos;
    if (_vectorDir vectorCos (getPosASL _plane vectorFromTo _planeEndPos) <= 0) exitWith {
        removeMissionEventHandler ["EachFrame", _thisEventHandler];
    };
    private _vectorUp = _vectorDir vectorCrossProduct [0, 0, 1] vectorCrossProduct _vectorDir;
    private _velocity = _vectorDir vectorMultiply 100;
    private _distance = _planeStartPos vectorDistance _planeEndPos;
    private _interval = (time - _startTime) / (_distance / 100);
    _plane setVelocityTransformation [
        _planeStartPos,
        _planeEndPos,
        _velocity,
        _velocity,
        _vectorDir,
        _vectorDir,
        _vectorUp,
        _vectorUp,
        _interval
    ];
}, [_plane, _planeStartPos, _planeEndPos, _startTime]];
past wagon
native hemlock
#

Well he could use an InventoryOpened event handler and check the player's distance to the container. You could run into some issues with certain objects and their distances for inventories, but you could add a check for it being the same typeOf the container.

lone glade
#

or just remove all actions on the container and add his own

blazing zodiac
#

I though you couldn't remove all actions on default actions like opening doors and containers?

lone glade
#

pretty sure you can.

blazing zodiac
#

Is there anyway to remove the Open Door action and other default actions? I'd like to ditch the action menu completely for my mission since I'm using the rotation menu system and it's so much better then the default action menu.

#

Description:
Removes all unit's user added actions.

#

from the removeAllActions wiki page

lone glade
#

eeerf, I was wrong

blazing zodiac
#

If anyone knows of a way to do this I would be very interested. It would really clean up a lot from my mission.

blazing zodiac
#

Excellent, thanks for the tip Quiksilver

spice arch
#

Is there a way for me to see the full script errors for a mission? The tiny script error snippet only shows one issue at a time and barely stays on long enough for me to read fully.

indigo snow
#

%APPDATA%/local/arma3 > here the .rpt files are located

#

they contain fully verbose errors

spice arch
#

@indigo snow thanks, I've looked there but I can't seem to find any .rpt files from my recent editing session.

lone glade
#

make sure you have -noLogs turned off

spice arch
#

@lone glade thanks, I missed that =X

jade abyss
#

Anybody knows what that error is?

20:25:19 Cannot create object 2:2167 with type[AISubgroup], param[subgroup], NMT code[106]:
20:25:19 Cannot create object 2:2173 with type[AISubgroup], param[subgroup], NMT code[106]:
20:25:19 Cannot create object 2:2179 with type[AISubgroup], param[subgroup], NMT code[106]:
20:25:19 Cannot create object 2:2185 with type[AISubgroup], param[subgroup], NMT code[106]: ```
sullen marsh
#

Looks like it can't create an object with type AISubgroup

agile pumice
#

how can I turn an addon's reflector on/off at will?

agile pumice
ivory nova
#

Hey, can anyone point me to any good resources that outline what I should learn in order to start scripting? Is the scripting language in Arma proprietary or could I script in other languages?

queen cargo
#

@ivory nova SQF is a bitch and your only lang in arma. Technically, sqf is nothing else but a bunch of commands and various types which means: know one, know all. To start with ir, just check some existing scripts and head over to the biki

ivory nova
#

I see! Thanks for the advice!

tiny ravine
#

I would also start simple first.

#

Work with smaller missions and expand a little bit each time

#

I just script for a hobby - so I know for me it was important to make sure I had fun doing it.

ivory nova
#

Re. starting simple, at my current level of understanding it can be hard to know what I can achieve with the editor and what ideas might require scripting

#

So I will take your advice for sure (:

open vigil
#

Not specifically Arma related, but I wanted to pick the brains of those who know a thing or two about authentication. Specifically, passwords. Sure, not all scripters are programmers, just like not all infosec specialists are programmers, but it sure does help. Send me a DM and I'll ask my questions (don't want to hog up anymore space than I need to here).

prime valve
#

I have a friend of mine that has a problem with extDB. When he tries to store a getPosATL of an object in the database, it returns a scientific-like number, like -e+05464.. Does anyone know what's going on ?

native hemlock
#

Well how is he storing it? Three columns with a data type that allows for decimals? Or in one column using varchar with the square brackets included?

#

Both A3Wasteland and Tonic's Life Framework should have working position saving examples for extDB. Tonic's would be in saving house coordinates and A3Wasteland will have vehicle and player positions saving.

tough abyss
prime valve
#

Thanks, we got it fixed folks !

young mantle
#

Hey Guys does anyone know how to force players into the new spectating? I've got a mission with a kind of purgatory system with the timer set on the parameter I would like to force into spectating if the parameter is set to unlimited.

deft zealot
warped thicket
austere granite
#

@warped thicket Why should I switch from Poseidon to Atom?

warped thicket
#

never used Poseidon so I can't tell you ๐Ÿ˜›

#

but from what others told me Atom overall has more features and is somewhat better to use, no idea myself though

frail dune
#

@tough abyss Had a UAV spawned, not UGV, but ended up getting the same type of RPT errors on Sunday during a 2-3 hour mission:
Group B Bravo 2-1 (0x4ce04900) - network ID 2:1669

  • no leader
    Group B Bravo 1-2 (0x47c13880) - network ID 2:1635
  • no leader
#

Ended up with a 300MB .rpt file

#

Not sure if it's related to UAVs/UGVs though, seems to occur regardless of their presence

#

Also had: Update of nonlocal object 2:1609 called

agile pumice
#

any reason why a script wouldnt run in an intro?

tiny ravine
#

How are you calling it in the initIntro.sqf?

agile pumice
#

i wasnt ๐Ÿ˜› that was my issue

#

thanks though

fallen locust
#

@tough abyss proTip : 3x '

_true != true;
_k = "a";
shut flower
#

it seems like you can't reach an hc in any way when the map was converted by eden

#

tried it with publicVariableClient and also via RemoteExec

lone glade
shut flower
#

Sorry didn't knew that there is a channel for it

lone glade
#

I WANT TEH FEEDBACK TRACKER BAAAAAAACK T.T

gaunt patio
#

Anybody know if it's possible to apply equipment/clothing to a unit 'model'. Emphasis on the model... I'm basically wanting to display a unit model using a dialog object but would like to equip it as well. I presume it's not possible but I figured I'd ask.

#

I'm just gonna' use the VR Entites as a replacement if it's not possible

fallen locust
#

well you could hack it together with multiple 3dControls

#

not worth it imo

#

or you could do it with an actual unit thats local only... and then render the camera on the control

#

^^ better @gaunt patio

gaunt patio
#

Thanks man, the camera idea completely skipped my mind, I'll have to think of a way that I can do it with what I'm trying to do.

On the topic of dialog objects though, I've encountered an interesting issue. They have a tendency to display solid white occasionally.

fallen locust
#

amazing link

#

But the white thing could be default texture for RscPicture

gaunt patio
#

wait

#

rip

#

There

fallen locust
#

color=[1,1,1,1]; ?

#

like a default one

gaunt patio
#

could be, the classes don't have it defined and they don't inherit from anything. They're just base object classes

#

It's just an interesting bug... it doesn't seem to want to load the texture all the time

fallen locust
#

"could be, the classes don't have it defined and they don't inherit from anything. They're just base object classes" then it would error

gaunt patio
#

object classes don't take a color param

fallen locust
#

hmm

gaunt patio
#

It's just one of these

#

rendering a 3d object

#

in this case, the VR entities

#

It isn't dependent on the model either, it happens randomly with any model

fallen locust
#

hmm i didnt play around with object controls that much as camera method wins every time ๐Ÿ˜›

gaunt patio
#

Well the object controls are pretty nice. They let you render a 3D object to the screen directly

#

Which would have been ideal

fallen locust
#

Yes but they are really limited

#

as they take model path and read the texture from it

#

and you cant setTexture on it

#

so that dosent work for most of things

gaunt patio
#

Oh yeah, they're definitely limited

#

but it does have it's uses

#

You can't really have a camera of an object on screen without it having it's own dedicated box for the camera to be displayed in

fallen locust
#

same with object dialogs...

#

if i got you right

gaunt patio
#

well take that image I linked of the bug for example

#

3D objects directly on top of the screen, with full background transparency and such

fallen locust
#

you can have it on top of the screen but no transperency

#

as picture has none

gaunt patio
#

Well that was my main gripe ๐Ÿ˜›

fallen locust
#

well.... i theory you could do it ๐Ÿ˜›

gaunt patio
#

inb4 green screen script

fallen locust
#

extension ๐Ÿ˜›

gaunt patio
#

I'd be extremely impressed if someone managed to pull that off

fallen locust
#

but you would need to recreate armas renderer

#

not worth it

gaunt patio
#

๐Ÿ˜›

#

I'll definitely be using a camera as it's more than suitable for my needs anyway. If the object control was more versatile though, that would have been ideal.

fallen locust
#

you could have object control groups

#

like 7 of them

#

but that would just be a nightmare to do

gaunt patio
#

Oh definitely.

fallen locust
#

and even then you coudnt really do it

#

as back of the vest would overlap the units chest etc

#

as you are still doing it in 2d effectivly

gaunt patio
#

If the object control class interpreted actual configured classes rather than p3d files, it'd be a lot easier. You could just have uniforms and the like defined in the config

#

dreams of a better place

fallen locust
#

I would link you a feedback tracker where i asked for it few mhonts ago... but you know feedback tracker

gaunt patio
#

kek

#

it'll be back up Soonโ„ข

#

Essentially I'm making a unit select screen. Your suggestion of local units on a camera might actually look nicer anyway... I can just have them all lined up with a camera facing them, have their stats displayed above them and such.

#

I did think of a camera but for some reason the idea of spawning the units locally completely skipped my mind, hence why I dismissed the idea due to MP issues.

fallen locust
#

In exile we did similar with vehicle buy screen

#

i cant find a video of it for a life of me

gaunt patio
#

Yeah, I already have the exact same thing planned for a garage

#

That's the part that annoys me the most... I was thinking up the concepts for the garage literally yesterday... yet I totally forgot about local spawned units while making this today

fallen locust
#

I did a POC of garage a while ago

#

You literaly walk trough a door and you are in your "garage"

#

GTA5 style

gaunt patio
#

Ah nice, like instanced garages

fallen locust
#

Yes

#

and same way you drive it out

#

same same

gaunt patio
#

put any thought into removing other players temporarily?

fallen locust
#

its really far away

#

and local only

#

so no issues with MP

gaunt patio
#

I was thinking more about there being issues with two people using the garage at once

fallen locust
#

Just a lock ๐Ÿ˜›

gaunt patio
#

kek

fallen locust
#

No can do ๐Ÿ˜›

gaunt patio
#

ez mode

fallen locust
#

i could have done it tbh with 2 players as well

#

as garage is same for both players

#

so i could have "faked" it for both players ๐Ÿ˜›

gaunt patio
#

Couldn't you just local set the other players to invisible

fallen locust
#

nah thats easy

gaunt patio
#

of course, each player would see their own vehicles

fallen locust
#

i mean 2 actuall players in same "fake" garage

gaunt patio
#

well yeah but I mean
say you want multiple people to be viewing multiple different 'fake' garages... Could you not hide other players on each client?

fallen locust
#

I just had it so it offsets the garage by 100m in x of the other one

#

based on playerNumber

#

sooo

#

easy

gaunt patio
#

Well that works too. I'm just thinking of ways to negate the need to place these garages out in the middle of buttfuck nowhere

#

keep everyone in the same building, in the middle of town or something

#

just hide/show whatever is needed

fallen locust
#

well you could just do it in Z axis ๐Ÿ˜›

gaunt patio
#

lol XD

fallen locust
#

so its there but not ๐Ÿ˜›

#

hideObject i noticed... dosent work all the time

#

now this is the thing that anoys the living hell out of me

#

hideObject - wont hide REMOTE object
hideObjectGlobal - wont hide LOCAL object

but both of them complain about it.... sooo there is an if(local) in arma somewhere....

#

why not just have 1 command?

#

sense escapes me here

gaunt patio
#

hideObjectGlobal doesn't work locally? Hmm

fallen locust
#

not if you are not the server

#

in 1.54

gaunt patio
#

Genius

fallen locust
#

ikr

gaunt patio
#

I'll have to jot this idea down for testing at some point. I'm really intruiged in the whole "gta5 style garages"

#

could also be used for instanced housing

#

many other applications actually

fallen locust
#

Yea i made a framework for whole instancing thing a while ago

#

never used it for anything

#

i was kinda hoping for redirectToServer command @lavish ocean *cough
i would link the feedback but you know ๐Ÿ˜› @lavish ocean ๐Ÿ˜ƒ

grizzled cliff
#

Just to tout how awesome Intercept is getting...

#

You can now in Intercept compile and load plugins in a way that allows you to recompile between mission restarts.

#

Intercept will unload and reload the DLL from a temporary file, so everything is transparent to the developer.

#

In a lot of ways development is no more complicated than SQF in that regard.

lavish ocean
#

@fallen locust too early for that command, other things first

gaunt patio
#

Anyone ever looked into disabling footstep sounds on a unit?

#

well, just making a unit silent in general

zealous solstice
#

best way to end a mission #include"fuck you"

fallen locust
#

dosent work anymore btw

earnest valve
#

@zealous solstice that won't work. Maybe: #include"fuck you"

zealous solstice
#

๐Ÿ˜„ sorry

#

fixed

rocky cairn
#

Any one had issues with Players Init lines not being called when they JIP for missions made in 3d editor?

indigo snow
#

JIPs dont execute init fields in 3den format missions

#

Known bug

willow pike
#

Guys why sucks createvehiclelocal so hard does not have the same parameters as createvehicle (WTF?!) And performance wise it is worse than createvehicle even tho that gets transmited over the network

#

@lavish ocean

lone glade
#

owner doesn't work locally

#

it never did

#

owner returns 0 on clients, it only work serverside.

tough abyss
lone glade
#

oh wait initPlayerServer.sqf is serverside, I mistook it for initPlayer.sqf

queen cargo
#

@fallen locust sanity was never an argument for SQF .. why you start bothering now?

little eagle
#

clientOwner fails on resumed MP games.

#

Reports totally wrong ids. use at your own risk

queen cargo
#

wasnt it just a +1 wrong?

#

((with each load))

little eagle
#

no, it's totally wrong

queen cargo
#

cool โค

little eagle
#

If 4 players were on the server it will be +4

queen cargo
#

as said ^^ SQF
we โค to consume your sanity

#

but there should be a way to fix that wrong behaviour

little eagle
#

And KK is wrong. It's the exact same issue on dedicated resumed MP games

queen cargo
#

clientOwner should return the same value on server always with the offset X

lone glade
#

wait, there's people who use save in MP ?

little eagle
#

It's as broken as #restart is ๐Ÿ˜›

queen cargo
#

which then means you can save the offset at the very start of the mission and then just use a function which takes that offset and checks it

little eagle
#

Just in different ways

queen cargo
#

its arma

#

everything is kind of broken

little eagle
#

Sure, but what is the offset?

#

And why do you have to do it in the first place

queen cargo
#

because its ArmA

#

dont ask

#

just do

lone glade
#

cuz arma

little eagle
#

I liked the answer I got on the feedbacks:
"this is intended behaviour, no one remembers why. - works on dedi though"

lone glade
#

๐Ÿ˜„

queen cargo
#

yep ๐Ÿ˜ƒ best answer ^^

lone glade
#

"it's normal, we just don't remember the reason why it is"

little eagle
#

I just feel like I now have to be an ass about it every time clientOwner is suggested, because of that answer

#

At least they fixed OPC serialization, so that batch of bug reports is at 50/50

#
  • The only thing that works in 1.56
lone glade
#

to fix that they decided to log ammobox inits, mother of god the spam

little eagle
#

๐Ÿ˜›

lone glade
#

that and "object found (random number, random number)"

little eagle
#

They once loged when it wasn't "found". They reduced the spam by reversing that logic
(not really jk)

lone glade
#

ohgod

little eagle
#

๐Ÿ˜›

nocturne bluff
#

who even saves

little eagle
#

You can't return to the main menu without saving in this game

gaunt patio
#

Anyone know the function that gets called to open the pause menu when you hit escape? I know you can "createDialog 'RscDisplayInterrupt';" but not all the menu features function correctly.

I'd take a look at the code for the key eventhandler but I don't have all the files unpacked so I figured I'd ask before spending the time to unpack everything.

tough abyss
#

Alternative to unpacking all the pbos. Install Arma3 Tools & mount the P Drive, that way would you can just search P:\a3

lone glade
#

P:\a3 is a symlink to arma 3 root for me

#

he could use Arma3P from mikero to unpack / unbin everything (except P3D)

little eagle
#

Anyone know the function that gets called to open the pause menu when you hit escape?
It's hard coded, not SQF

sacred fox
#

what am i doing wrong here?

/Config.cpp/

class CopilotTurret: CopilotTurret
{
class EventHandlers
{
init = "[_this select 0] execVM 'immobilizer\immobilize.sqf'";
};
};

/Immobilize.sqf/

#include "\vbs2\headers\dikCodes.hpp"
waituntil {!(IsNull (findDisplay 46))}; _keyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 == 44) then {
_gunner = _this select 0;
_gunner cursorObject setFuel 0;
_gunner cursorObject setHit ['motor', 1];
hint 'Vehicle Immobilized!'}"];

it should work afaik, but ig uess im missing something, the thing is that the copilot should be able to trigger this evenhandler, but isnt :S

tame portal
#

_gunner cursorObject setFuel 0; -> _gunner setFuel 0;

#

_gunner cursorObject setHit ['motor', 1]; -> _gunner setHit ['motor', 1];

sacred fox
#

oh

#

so whats the difference, if you mind explaining? ๐Ÿ˜› just if you want m8! ๐Ÿ˜ƒ

tame portal
#

"_gunner = _this select 0;"

#

Assigns an object to _gunner

#

Now _gunner holds the object you want to work with

sacred fox
#

is it like just forwarding a variable value?

#

aha ๐Ÿ˜„

tame portal
#

cursorObject returns the object youre looking at

#

setFuel for example needs an object and a number to work

#

so

#

object setfuel number

sacred fox
#

and the script will know its what the copilot is looking at then? ๐Ÿ˜ƒ

tame portal
#

_gunner -> Object
cursorObject -> Object

sacred fox
#

k

tame portal
#

What do you want to achieve with the script?

sacred fox
#

copilot looking at vehicle, and immobilize it with a eventhandle ๐Ÿ˜ƒ

#

Eventhandler*, in this case its "Z" key

tame portal
#

So you want your player to be able to look at a vehicle then press a button and make the vehicle he is looking at immobile

sacred fox
#

yes.. to begin with.. but the i will add some other functionallity to it ๐Ÿ˜ƒ

#

i just need the basics to work first ๐Ÿ˜›

#

i can do it in the debug console in game no problem

#

its just when i call it as a init eventhandler something's not right

tame portal
#

One sec

sacred fox
#

ok ๐Ÿ˜ƒ

#

this for example works when i debug ingame

waituntil {!(IsNull (findDisplay 46))}; _keyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 == 44) then {
cursorObject setFuel 0; cursorObject setHit ['motor', 1]; hint 'Vehicle Immobilized!'}"];

but i want to add it to the config.cpp for my helicopter, so that it only may be called by the copilot, and by him looking at the object. so basically my problem is how to identify the object which the cursorObject is applied to, in this case the Co pilot turret class, where the eventhandler init is =/

tame portal
#

So

#

You want to give the copilot the option to press a key and then the cursortarget gets immobile, correct?

sacred fox
#

yes

tame portal
#

alright give me a minute

sacred fox
#

and if possible, when "onMouseDown when the selected weapon is "FakeWeapon" thats not neccesary though, but thats primarily what i want, i just found the keydown more easy in this example

tame portal
#

Is the coopilot always going to be a player?

sacred fox
#

onMouseButtonDown* yes always a player

#

i just want the basics done, then i will make it to gradually decay when "lazed" but thats nothing you need to worry about now ๐Ÿ˜ƒ

#

my main goal is to "bleed" the target slowly down to 0 hp, by keeping your cursor on it when firing, so its not a instant immobilization ๐Ÿ˜ƒ

tame portal
#

If the copilot is always going to be the player this should be enough

#

init = "waitUntil {!(isNull (findDisplay 46))};_keyDown = (findDisplay 46) displayAddEventHandler ['KeyDown', {if ((_this select 1) == 44) then {cursorObject setFuel 0;cursorObject setHit ['motor', 1];hint 'Vehicle immobilized!';}];";

sacred fox
#

and if i want mousebuttondown instead of key? ๐Ÿ˜ƒ sorry for asking dumb questions..

#

thanks, anyway will try that!

tame portal
#

init = "waitUntil {!(isNull (findDisplay 46))};_keyDown = (findDisplay 46) displayAddEventHandler ['onMouseButtonDown', {cursorObject setFuel 0;cursorObject setHit ['motor', 1];hint 'Vehicle immobilized!';}];";

#

Try it first though I cant really do anything as starting up arma crashes my pc atm

sacred fox
#

Turrets/CopilotTurret/EventHandlers.waitUntil':'{' encountered instead of '='

class EventHandlers
{
init = "init = "waitUntil {!(isNull (findDisplay 46))};_keyDown = (findDisplay 46) displayAddEventHandler ['onMouseButtonDown', {cursorObject setFuel 0;cursorObject setHit ['motor', 1];hint 'Vehicle immobilized!';}];";";
};

#

nvm, saw the issue there, but i still cant seem to get it to pass the checks..

i guess this should work

class EventHandlers
{
init = "waitUntil {!(isNull (findDisplay 46))};
_keyDown = (findDisplay 46) displayAddEventHandler ['onMouseButtonDown',
{
cursorObject setFuel 0;
cursorObject setHit ['motor', 1];
hint 'Vehicle immobilized!';
}];";
};

zealous solstice
#
    class SUBClass {
    init = "[] spawn {
        if !(isNil 'SUBkeyDown') exitWith {};
        waitUntil {!(isNull (findDisplay 46))};
        SUBkeyDown = (findDisplay 46) displayAddEventHandler ['onMouseButtonDown', {
            cursorObject setFuel 0;
            cursorObject setHit ['motor', 1];
            hint 'Vehicle immobilized!';
        }];
    };";
    };
};```
little eagle
#

won't that add the key event for every vehicle that spawns?

sacred fox
#

interesting ๐Ÿ˜ƒ

#

End of line encountered after [] spawn {

little eagle
#

And for every unit?

sacred fox
#

is it? ๐Ÿ˜›

zealous solstice
#

that is why i add the if exit @little eagle

little eagle
#

a key handler should not be in a vehicles init

sacred fox
#

this eventhandler is only going onder the copilot turret

#

uner*

little eagle
#

that doesn't work like that at all

#

like at all

zealous solstice
#

it work but not what he want

little eagle
#

you can't add init events to turrets

zealous solstice
#

๐Ÿ˜„

#

yeah that is wired

little eagle
#

This is completely backwards

sacred fox
#

ok.. well i can use evenhandler in the debug console to "immobilize cursortarget" from copilot, but i just want it under that specific class in the vehicle

#

im lost

#

this works ingame atleast
waituntil {!(IsNull (findDisplay 46))}; _keyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 == 44) then {
_gunner = _this select 0;
_gunner cursorObject setFuel 0;
_gunner cursorObject setHit ['motor', 1];
hint 'Vehicle Immobilized!'}"];

#

but im trying to apply it to just the copilot turret, and its only going to be a player there no AI

little eagle
#

everyone will be able to disable veicles that way, not just the copilot

sacred fox
#

haha lol

tame portal
#

Are you adding this to your mission?

sacred fox
#

no, my mod

lone glade
#

use the vehicle seat index.

sacred fox
#

an own chopper

little eagle
#

You have to check in your key event if the player is inside that vehicle type and in that seat

sacred fox
#

hm, ok

little eagle
#

and the keyhandler should be added with a cfgfunctions script with postInit = 1 and not a vehicle init

sacred fox
#

well, im getting more and more lost here =/, all i want is to be able to disable vehicles fro the copilot seat with the push of a button, and to get it to work ingame is not hard when its applied to the player.. but as i said i want it to be applied to only the copilot turret.. and there seem to be alot of ways of doing it ๐Ÿ˜›

little eagle
#

your script has to check where the player is. that's all

#

and you have to move it to postInit = 1 and not vehicle init

lone glade
#

halting inits.... such a good idea.....

sacred fox
#

yeah.. im not that used to arma3 scripting yet.. but i got basic understanding of programming logic.. only from PHP and ASP though, but i got alot of stuff to work so far, so im learnin g:)

little eagle
#

please use hasInterface and not !IsDedicated to not create death loops on headless clients

#

basically never use isDedicated

sacred fox
#

ok so if (!hasInterface) then? ๐Ÿ˜ƒ

little eagle
#

no hasInterface

lone glade
#

nono, ! is the operator for not

little eagle
#

hasInterface is every machie where someone has a keybord and mouse

sacred fox
#

but.. why should it be executed before the mission started.. its going to be used on a public server we have. where a mission is always running, thats why im trying to fucis on the model, but i may be all off here, but just so you understand the situation, im NOT adding this to my mission, im adding it to my mod and model ๐Ÿ˜›

austere granite
#

hasInterface is every client and excludes both HC and deci server.

sacred fox
#

ah k

austere granite
#

Basically everything that's releated to players / UI or th eikes should be on hasInterface

little eagle
#

correct, especially key handlers

#

omg

austere granite
#

๐Ÿ˜„

lone glade
#

.....

austere granite
#

if (hasInterface)

little eagle
#

drop the isDedicated . It's nieche and almost never usefull

austere granite
#

Something that would true on hasInterface can NEVER be dedicated, so it's a redundant check

little eagle
#

It's only used because of rampant copy past shit coding

jaunty drift
#

use ``` for large codeblocks

sacred fox
#

ok, but how do i apply this so it only affects the copilot?

austere granite
#

It's not a very hard thing, just explaining why to use one command over the other.

#

Otherwise he'll still use that in 5 years when there's better commands available that do what he needs

lone glade
#

burn the heathen

austere granite
#

if (!isDedicated && hasInterface && (1 == 1) && (format ["%1", "hi"] isEqualTo "hi")) then {

sacred fox
#

now ppl are just bored i see xD

#

adding a bunch of redundant conditions ^^

lone glade
#

triggered

sacred fox
#

yh

#

and then i just #include init.sqf in the config.cpp?

lone glade
#

AAAAAAAAAH

#

RUUUUUN

little eagle
#

lol

lone glade
#

qsdkfjqsdifqsdnfs

#

I can't even

sacred fox
#

i cant odd ๐Ÿ˜›

#

so in the init.sqf it should be like this then?

//init.sqf

if (hasInterface) then {
0 spawn {
waitUntil {
(!isNull (findDisplay 46))
};
(findDisplay 46) displayAddEventHandler ['onMouseButtonDown',
{
cursorObject setFuel 0;
cursorObject setHit ['motor', 1];
hint 'Vehicle immobilized!';
}];
};
};

#

what does spawn do?

austere granite
#

making sure the waitUntil doesn't stop the rest of your init.sqf

sacred fox
#

ah paralelle instead of serial

little eagle
#

yes

sacred fox
#

got it!

austere granite
#

learn to use scheduled vs unscheduled.

sacred fox
#

but now when i have this.. what actually defines, that only my copilot wilbe able to use it?

austere granite
#

Scheduled is spawned code basically, unscheduled is serial in your case

sacred fox
#

yeah

lone glade
#

fun fact: addAction use an unscheduled check and execute in scheduled

austere granite
#

It's good to get used to those terms, because they're pretty important

lone glade
#

BI devs are odd

fallen locust
#

if(false)throw{systemchat"123";};

sacred fox
#

yeah im learning as i go ๐Ÿ˜ƒ

lone glade
#

LEL

#

TOP KEK

#

I have 98% in unscheduled, I never had better perfs

sacred fox
#

isnt this script going to be applied to all the seats in the heli now?

little eagle
#

depends on what you put in these addActions

fallen locust
#

Just if you need to use dynamicly add them and remove them

austere granite
#

addAction does only get checked within 15 meters of an object though I believe

fallen locust
#

preferably dont use them

sacred fox
#

well, i dont want to use addactions, thats why i want to override with eventhandlers ๐Ÿ˜›

lone glade
#

my sides.

#

they're in orbit.

sacred fox
#

i just want a trigger thing.. that wil apply aslong as FakeWeapon is the selected weapon

little eagle
#

if (currentWeapon vehicle player == "fakeWeapon") then {

fallen locust
#

Easy to use != good

sacred fox
#

would this do the trick?
if (hasInterface && currentWeapon vehicle player == "fakeWeapon") then {

little eagle
#

no

#

because the weapon can change durign mission

#

and at that point this part is long executed

sacred fox
#

yh true, its in the init

#

thats why i went with eventhandlers to begin with

little eagle
#

use this inside the onMouseButton event

fallen locust
#

AddAction but its all dynamicly added/removed

#

i didnt ever say its good

sacred fox
#

im tired of addaction everywhere ๐Ÿ˜›

#

clutters the screen, a bunch of modders with 20 different options lol xD

#

{ if currentWeapon vehicle player == "fakeWeapon") then {
cursorObject setFuel 0;
cursorObject setHit ['motor', 1];
hint 'Vehicle immobilized!';
};
}];

little eagle
#

pretty sure you are still better of using simple booleans in addAction instead of removing them

sacred fox
#

yeah true

lone glade
#

my hand is trying to pass through my face right now

fallen locust
#

@little eagle oneachFrame check a bool? for construction + vehicle x 3-5 actions? really?

sacred fox
#

is the a condition for like is copilot or is gunner in current vehicle?

fallen locust
#

keep in mind some servers have over 10k objects

#

thats a loot of ifs

little eagle
#

first of all there are no addctions on the server

#

only the client

fallen locust
#

who mentioned addactions on server?

little eagle
#

and secondly they are ony evaluated for objects with 15 meters ifront of the player

lone glade
#

hahahaha @tough abyss call me when you decide to get your head out of the sand

sacred fox
#

if i read this code correctly now, it would allow anyone which in a vehicle and has "fakeweapon" selected to use the function?

#

//init.sqf

if (hasInterface) then {
0 spawn {
waitUntil {
(!isNull (findDisplay 46))
};
(findDisplay 46) displayAddEventHandler ['onMouseButtonDown',
{ if currentWeapon vehicle player == "fakeWeapon") then {
cursorObject setFuel 0;
cursorObject setHit ['motor', 1];
hint 'Vehicle immobilized!';
};
}];
};
};

little eagle
#

also I never use addAction to begin with. The systems I use only evaluate the conditions when the menu is active

#

and that cached

#

looks good, havent counted the brackets though

#

need one ( after the if

austere granite
#

THis might sound a bit complicated.... but why not add getIn on the helicopter type and only add / remove event handler there?

little eagle
#

because getIn eh aren't executed when you are moved in with some script commands

austere granite
#

Are those used in his case?

lone glade
#

simplicity vs learning

#

it's easier to learn to do it yourself, in the end it'll be easier for him to do other things.

little eagle
#

I have another question though

#

according to the doc

#

onMouseButtonDown only works on controls and not on the display 46

#

You sure this eh works in the first place?

austere granite
#

General question on cursorObject by the way... does it actually work okay?

lone glade
#

yep

#

it's also faster than cursorTarget

austere granite
#

I've had so much bullshit with cursorTarget. You look at a box standing somewhere below a helicopters rotors... returns heli

lone glade
#

and it's much more precise

little eagle
#

dude

lone glade
#

you serious ?

little eagle
#

you are not funny

austere granite
#

Really? I figured it would be slower. RIght now I got nothing using cursorTarget, but i'll have to try it then

#

A famous problem I had is interacting with dead units, where the dropped weapon from ragdoll always returns on cursorTarget instead of the actual dead guy I'm aiming at

little eagle
#

Because the "house" simulation ground weapon holder is much more important obviouly

austere granite
#

Damn right!

lone glade
#

I wish we could lock them.....

little eagle
#

id = (findDisplay 46) displayAddEventHandler ["MouseButtonDown", {systemChat str _this}];
actually works now!

lone glade
#

best command in 1.56 is apply, god that thing is useful

#

well, modifying arrays ?

#

example adding a random nature to a positions

#

_pos apply {_x + (random 50)} where pos in a position _x,_y,_z

#

yep

sacred fox
#

@little eagle i initially used this

waituntil {!(IsNull (findDisplay 46))}; _keyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 == 44) then {

lone glade
#

but it's much more efficient and return the array.

little eagle
#

onMouseButtonDown works on displays now, but still can't block input unfortunately

sacred fox
#

tested this ingame in the editor via the debug console now and it worked :)

if (hasInterface) then {
0 spawn {
waitUntil {
(!isNull (findDisplay 46))
};
(findDisplay 46) displayAddEventHandler ["MouseButtonDown",
{ if (currentWeapon vehicle player == "fakeWeapon") then {
cursorObject setFuel 0;
cursorObject setHit ['motor', 1];
hint 'Vehicle immobilized!';
};
}];
};
};

so now that just have to go into the inti.sqf and the init.sqf has to be included in the config.cpp?

little eagle
#

you create a function and execute it via the CfgFucntions framework

sacred fox
#

ok, will ook at it

#

yea ofcourse

#

but i dont want to stall myself with toom any conditions at the beginning

#

ill add them as i go ๐Ÿ˜ƒ

#

but so , do i have to create all these subclasses under CfgFunctions?, and just come up with some names to them?

little eagle
#

same with setHit

#

all sub classes are needed

sacred fox
#

oh ok..

#

so if i want it to be global?

little eagle
#

they are all global

#

oh setFuel?

sacred fox
#

yes

#

and setHit

little eagle
#

^ this

sacred fox
#

that structure is completely foreign to me xD

little eagle
#

welcome to sqf

sacred fox
#

๐Ÿ˜›

little eagle
#

I am

#

nested array serialisation

sacred fox
#

so if i want it mp i just replace the cursorobject setHit 1 with that function?

little eagle
#

shudder

#

yes

sacred fox
#

ok

little eagle
#

modules with default value = 0 are saved as -1

sacred fox
#

so this?

if (hasInterface) then {
0 spawn {
waitUntil {
(!isNull (findDisplay 46))
};
(findDisplay 46) displayAddEventHandler ["MouseButtonDown",
{ if (currentWeapon vehicle player == "fakeWeapon") then {
[cursorobject,0] remoteexec ['setfuel',cursorobject,false];
[cursorobject,1] remoteexec ['sethit',cursorobject,false];
hint 'Vehicle immobilized!';
};
}];
};
};

little eagle
#

looks good to me

#

RC phase was too short

#

154 was the longest current version I believe

sacred fox
#

setfuel worked, but somehow not sethit

little eagle
#

hmm

sacred fox
#

expected array

little eagle
#

[cursorobject,["hitengine",1]] remoteexec ['sethit',cursorobject,false];

#

I think

#

setHit has global effect, but it still require a local unit

jaunty drift
#

The object must be local to the computer where command is executed.

sacred fox
#

'(_this select0) |#|setHit (_this select 1)'
Error setHit: Type Number, expected array

#

ah ok

little eagle
#

setFuel has global effects too

sacred fox
#

ok, so no need to use remoteexec?

little eagle
#

It's required to use it

sacred fox
#

btw now when we're at it, how about say and say3d?

austere granite
#

Welcome to locality

sacred fox
#

xD

#

ok

little eagle
#

because the command requires a local object

sacred fox
#

ah ok

little eagle
#

It's silly

austere granite
#

Basicall you want to execute it on the cient who 'owns' the vehicle

#

So if you remoteExec with as target that vehicle it should work

#

With local arg and local effect you want to broadcast to everyone

#

With global arg and global effect you don't need remoteExec

little eagle
#

You just need to move around the arguments for sethit. in your last try the hit selection was missing for example

#

^

austere granite
#

Usually on the Wiki pages for commands and the top it has 2 pictures or argument (So the thing you're applying a command to) and the effect.

#

For example setObjectTexture you can apply on global arg (So you can apply it to a different unit for example, but the effect is local so only you will see it)

sacred fox
#

shouldnt it be lite this?
[cursorobject,"motor",1] remoteexec ['sethit',cursorobject,false];