#arma3_scripting
1 messages ยท Page 231 of 1
Does anyone know if BIS_fnc_setUnitInsignia needs to run specifically on init?
i dont see why. theres good info in the wiki comments https://community.bistudio.com/wiki/BIS_fnc_setUnitInsignia#usernote20210621215100
like run it on respawn. idk though if respawn EH triggers on mission start
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
hows your init code?
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
have to admit idk what that postInit is, never seen before. is this at unit config file?
Hence, perplexed
It is indeed
ah ok so more of config question
The EH can only be applied in config, but its actual content and operation is script, not config
Maybe I've just been staring at this thing too long, I can't figure it out
Has anything else changed, for example the unit's uniform class? Not all uniforms support insignia
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?
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
changes reloaded?
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 ๐
I assume it doesn't like params
""[(_this select 0), 'yourbadge'] call BIS_fnc..."
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
Awesome, thanks for the info!
when i use "remoteExecCall" globaly (0) does the local execution of "remoteExecCall" command is proccessed same as it would proccess just straight "call"?
Just means that the code that is ran on the target machine is ran in unscheduled context (where suspension isn't allowed and error handling slightly differs). If I'm understanding you correcly example 3 on the remoteExec wiki page might be the answer to what you're asking; in that it doesn't guarantee immediate execution like call does
Well, you can guarantee that execution won't be immediate :P
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
Server is called first when you use remoteExec and remoteExecCall, so it won't be same as just call
I cannot add anti malaria pills in a crate ... ๐คท
this addItemCargoGlobal ["Item_Antimalaricum", 100];
also this + GLOBAL ๐
yes, I though someone will point this ๐
angery
crate can take this item, returns true
is it maybe too early or something? tried with something else?
does count 1 work?
Item_ prefix kinda implies that's the ground holder for an item, not the actual item name
Is that the CfgWeapons class?
"Antimalaricum","Antimalarial Pills","\a3\Missions_F_Oldman\Props\data\Antimalaricum_ca.paa"
this is what you wanna use
there is another classname for the same item "Land_Antimalaricum_01_F"
That'd be a static prop version of it
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
Looks like it's just called Antimalaricum based on R3vo's message though
You cannot find it at all. it's hidden
@cosmic lichen its working with "Antimalaricum" classname
Hidden items and objects can still be found in config. I think you misunderstood what I was saying, though.
I have found a bug, you cannot reload sidearm in Syndikat RHIB boat ("I_C_Boat_Transport_02_F"), gives error message
That appears to be an ACE problem
I let them know
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...
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.
nvm, I figured something out
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
You can also check if a fileExists. If the mod isn't loaded, it will be false.
Yeah that's the addon name
isClass (configFile >> "CfgPatches" >> "WBK_MeleeMechanics")
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.
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
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)
you checked out how they moved the liberty in the AoW showcase?
I haven't, no, I'll go take a look, cheers!
Network update times are slower for moving static objects, so per frame movement will be choppy on multiplayer.
attachTo can solve that (other limitations may apply)
Information about the created parts is stored in a variable on the base object
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
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;
};
Absolute legend
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
is there a script way to open UAV terminal ? ๐ค
edit: found it
player action ["UAVTerminalOpen", player];
another stupid question ... how to close the terminal ๐
findDisplay close imo?
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.
@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
You are cooking on that though. My solution was just to close the display or dialog, I didn't think about terminating the UAV connection which you'd probably still otherwise need to do anyway. Nice work ๐
anyone know the IDD for the scoreboard display? I tried 175 but that didnt seem to work
But it's actually 175.
pain
Then you're doing something wrong.
yeahhh I derived that, heading back to the chalk board
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
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?
https://community.bistudio.com/wiki/showHUD whenever you get in/out of a vehicle?
how can i modify the code of whatever this is called in a similar manner to overriding functions?
CBA lets you overwrite keybinds
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
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
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
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?
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.
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?
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
Macros are nice 
mostly use them with configs
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]];
the command seems to take weapon name
if you want to change ammo that maybe wrong command
@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 I am searching for scripted way to~~ change~~ switch tank main cannon ammo types - APDSF, HE-T, etc
https://community.bistudio.com/wiki/addMagazinesTurret and remove old mags?
I cannot believe there is no way to switch ammo types except the addAction ๐คฌ
@ivory lake I found it simultaniously ๐ , thanks @ivory lake & @proven charm
vehicle player loadMagazine [[0], "cannon_120mm", "12Rnd_120mm_HE_shells_Tracer_Red"];
I feel like for me it just depends on how they're used, love them when they're used right; hate them when (imo) they are used wrong
Anything is good in moderation but if you're commonly using them over local functions, you need to seek help ๐
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.
Do you have AI unconsciousness enabled?
If it's disabled then they'll just die
you know, i did not think about, thanks
Even if you did, it doesn't mean the module is written for responding to the movement of it. Instead, select the units in the area and move them manually via script using vector positions.
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.
for which one
to be able to use sleep in OpticsSwitch EH
That's not how that works
Because technically the sleep doesn't happen in the EH? Well, yes.
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
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)
VarDone might work a bit differently. The waitUntil is getting seemingly skipped and the units eject immediatly after the script runs
No errors though, so that's a plus
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 ๐ช
You can always check BIS_fnc_unitPlay in the functions viewer in the Editor to see how it works
interesting to see what will come of promises. would be a great instance to use it if they ever rewrote that function
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
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
nope, didnt know those existed XD
i shall take a gander tho!
||as soon as i figure out how XD||
I sent you a dm about some stuff as well, couldn't send it here
__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
Loose files?
files in arma dir that exist also in pbo
So it works as expected? True when file path exists?
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 ...
I use __has_include to see if file exists to check if addon is loaded
thats exactly what im doing also
but even mod is not loaded it will return true because of loose files
Err, is this in precompiled code or what?
precompiled?
Well, is it in config or code, for a start?
description.ext
Someone give me a good thing to put in description.ext to test that :P
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 ?
well i can live with it, just wasnt sure if its bug or not...
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.
well all i have is #if __has_include("\somefile.h") foundFile = true; #endif somefile.h in arma dir and filepatching off
There should be enough files to pick from to avoid loose ones
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
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.
You probably can just undo whatever it did in the config with another config.
I would not know how.
It looks like GM also has a config that uses CFGWorld with demoWorld and a cutscene but it seems to load after my Mod therefore overrides mine and I have no idea how to change that
Move to #arma3_config.
Make another config with skipWhenMissingDependencies = 1; and that requires GM's last-loading addon (see #arma3_config message).
Delete and repost to #arma3_model
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
idk how its parachute works. but generally speaking, the only way to overwrite a script is to change the function it executes, which depends on how the function is defined.
if it's defined in CfgFunctions (or config in general) or via a global var without compileFinal you can replace it, otherwise it's not possible
any way to add night vision to driver/pilot camera, it has only thermal (and vanilla thermals aren't very helpful)?
Not with scripting probably
this one is good looking but I noticed it marks white artillery completely cold, no running engine, so whole vision mode is just an overlay
https://steamcommunity.com/sharedfiles/filedetails/?id=2041057379
also you cannot see you own laser ...
Thanks, I guess I will need to take a look into the pbo
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?
First person camera is pilot(?) memory point, third person camera is aimpoint memory point offset by extCameraPosition config value
Not with scripting commands
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?
It's a long time since last update on stable branch. Nothing about HandleDamage changed recently
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.
One close-proximity howitzer hit, for reference:
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.
hmm im looking specifically at ones where context = 0 - for some reason the zeus arty is always returning directHit true
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.
directhit is always true for me
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.
Hi guys, anyone knows any way to change blackfish vectoring via script?
"animate" is unable to
the vehicle is attached to a game logic mid-air with AI inside.. action is not working either
Then likely no, I don't think there is anything useful
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
Try this
addMissionEventHandler ["EachFrame", { myBlackfishD action ["VectoringDown",myBlackfish];}];
I hope the Blackfish isn't on the ground otherwise the propellers will hit it resulting in catastrophic failure of everything ๐ฅถ
???
I don't think the propellers can hit the ground.
@iron flax they are big and if they are horizontal (zero tilt) they will hit the ground
It won't allow full horizontal tilt while on the ground.
I speak about the high pathetic situation when 0 degree tilt is forced by script ...
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
Post what you have so far
[
["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
not working either.. ๐ nevermind I am gonna workaround it with absent driver
nope ๐ it's midflight transition cutscene - the blackfish is actually stationary and camera work makes an illusion of moving through air (although the vertical propellers are kinda killing this illusion) ๐
Have you tried unitcapture/unitplay?
I'll look at it tonight. But most use the config defined advanced hint
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, "", ""];```
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.
Got it working
Couple issues
- You want to check the side of a unit's group, as checking the unit side directly can give you odd results
- In your condition, you're trying to compare a string,
"areathing"to a boolean gotois only for SQS scripts
If a multi-type comparison is desired you can use isEqualTo or a switch statement
whoops lol thanks
hint "1";
sleep 5;
if (areathing == true) then { continue };
hint "2";
generic error in expression?
You arent meant to use if statements like that, continue is for loops, just put the hint "2" into the if code block
will it actually wait until the "if.." finishes or will it execute things past that line?
Sqf is single threaded, only multiple spawned scripts can execute out of order technically, but in this context that is not the case - in short, it will execute in order, i.e "wait"
ah that's great thank you
Also you can just do if areathing then.... - no need for == true, assuming areathing is a bool
@next prairie it is possible with scripting commands but it would be on a degree of complication that I wouldn't even bother.
@next prairie https://community.bistudio.com/wiki/Arma_3:_Event_Handlers - Take & InventoryOpened and perhaps even inGameUISetEventHandler if you really want to - are tools that can help you further. I recommend to just drop it though ๐
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
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
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?
You can use initPlayerLocal.sqf which runs once the player has connected and loaded to the server
https://community.bistudio.com/wiki/Event_Scripts#initPlayerLocal.sqf
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
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?
The trigger works, but I just don't know how to efficiently teleport the players
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
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)
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?
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.
Bumping my earlier request again - any native cals/functions that I can hook/use to autocontinue on missionEnd?
No afaik, but the menu probably also uses an exit code, so you can just close the dialog when you detect it using closeDialog
why the fuck is setPosASL breaking targetting sensors?! ๐ ๐
does anyone know about this?
You're going to have to get more context than that
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
Yea but I want to automate the closeDialog xd
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
Yeah so wait for that UI element to open then submit the closeDialog. You'll have to look up the elements IDC/idd or it's possibly stored in UI namespace
Ah cool then
There actually is an IDD for mission end ๐ - https://community.bistudio.com/wiki/Arma_3:_IDD_List#:~:text=IDD_MISSION_END,58
I won't be at my computer for like another 8 hours so I can't reproduce until then. Hopefully someone answers it earlier for you
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
https://community.bistudio.com/wiki/random
the 2 items array is for I assume Perlin noise
{
_x setPosATL [665 + random 3, 6403 + random 3, 0];
} forEach (allPlayers select { !isNull _x });
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 ^
Ok so it does not work 
Trying to close the missionEnd screen with IDD 58 does not seem to work
It's not a perlin, I even visualized in Example 5 to prove it's not
fine, fine!
Show what you got? Did you grab the parent displays first?
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
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
yes callback functions are possible (or whatever kind of function you need)
epic, gonna give it a shot later
But no closures, so any arguments from outside you want to later call it with has to be moved around some other way.
yeah it was one of the first lessons I learned in this language
I just need the function luckily
any way to make a ai heli to fly faster? any way to add to speed?
Reducing mass would but that does have it's own drawbacks and there's probably a better way to do it if you're doing it as a mod
hmm, what drawback if reduce the mass ? and how to do it ?
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
its ai driven so I can ignore commands I guess
if I make 50% less mass it will fly faster?
mass is 6154.5
Maybe with this?
https://community.bistudio.com/wiki/addForce
@old owl wow actually is flying faster !
heli setMass 3000;
iirc
for heli mass higher = more manouverable, and lower mass = less manouverable
Negative mass = the terrain moves 
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]
so with vector dir [0,1,0] object is pointing right ?
No, that would be [1, 0, 0], its x y z
[0, 1, 0] is north
0.5, 0.5, 0 would be diagonal forward/right
[1,0,0] will be east ?
oh I got it now ๐ฅณ
-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
what about [1,0,1] this will be east and up like diagonally ?
Nope, east and up is vectordir and vector up respectively: [1, 0, 0], [0, 0, 1]
Vectorup is separate
[1, 0, 1] is no longer a normalized vector either so its not valid
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
Something something gimbal lock
That too is fun lmao
Thats why i prefer quaternions 
But they too are hard to read like vectors
lets apply this to a command like
heli setVelocity [20, 0, 0];
heli will fly east with 20 m/s ?
Yes
but if I want for it to fly east and down
it will be
heli setVelocity [20,0,-10];
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
Yep
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?
Keep in mind setVelocity will only work while the vehicle is local
It is identical, it just says "vectorup will face this world axis"
Instead of "directoin will face this axis" with vectordir
@old owl its will be local to the server ๐
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 ๐
so its facing direction, then rotating ?
Come again?
oh, vector up is just the z axis of the vector ?
Yyes by default its z positive because... well... the up of the unit points up into the sky ๐
and its expressed wit the vector up array [x,y,z]
Yes
now i got it finally
If vectorup were [0 1 0] then a units head or top will be pointing north
thank you so much bro, I finally understand it ๐ค
statements like this should be bannable

"I prefer quaternions" are words that should never be spoken
Any idea how I can check for allDisplays after the missionEnd is called/executed? As regular scripts are killed/stopped when the mission ends
and displayAddEventHandler only has onChildDestroyed and no onChildCreated 
Hey maybe theyre almost equally as bad to read as vectors but if youve got a gizmo for them they are better in almost every way ๐
Only time ive had issues with quaternions is when trying to make a fluid 360 degree rotation
only vectors? You like gimbal lock? Because that's how you get gimbal lock
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
A gizmo?
Quaternions
Err... eden uses standard euler angles converted to vectors, ive not seen a quaternion anywhere in arma (at least not in exposed functions)
Isn't that how the positioning is done UI wise?
No, quaternions are a rotational transform method
Ui positioning is just 2d position and scale
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
Bumping my early query again - How would I check for something after missionEnd is called/executed? Since usual scripts are killed/exited when its invoked - can do CBA
@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
Yea mod is not a problem - its how im testing these anyways
either what gencoder suggested, or the Ended mission event handler (unless you've tried that already)
iirc MPEnded and Ended are slightly different
I.e the display might be visible when those events trigger is what im getting at
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 ...
Try setVectorDirAndUp [ [sin _azimuth, cos _azimuth, 0], [0, 0, 1] ]
// Set object's direction towards any given position
_object setDir (getDir _object + (_object getRelDir [_x, _y, _z]))
actually @sly cape got it right
but I want to tilt the drone like 30 degree downwards ๐ค
did you have time to take a lookie
or can I get the vertical direction to player ๐ค
like azimuth but vertical ?
Crap I forgot. I'll be leaving work here in about 1.5
Do a !remindMe 1.5 hours
setDir then BIS_fnc_setPitchBank may be easier here
does setVelocity need to be constantly applied?
onEachFrame {fpv setVelocity [20, 0, -10];};
what then ? ๐ค
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..
reminder :3
Just got home, let's see here...
there's something wrong internally with that function that I'll have to dive in deep. it might rely on internal data and might be a private function. in the mean time, use CfgHints (in either config.cpp or description.ext for mission) and then call BIS_fnc_advHint. This is the newer way. https://community.bistudio.com/wiki/Arma_3:_Advanced_Hints_(Field_Manual)
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
@jade acorn bis_fnc_guiMessage can show multiple lines ( with structured text and <br/> )
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?
hi, see setCaptive and join (or joinSilent)
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)
But only two buttons...
Could always make more with ctrlCreate
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
_group1 being an array of some units?
Yes, we're trying to catch outliers.
Like if one drop pod is still above the trigger zone when it fires.
{
{ _x setDamage 1 } forEach units _x
} foreach _group1;
```?
All the units are players and they're all on the same side
Does this grab units outside the trigger zone?
if they are part of the group of one of the _group1 member, yes
....no way it's that easy
can this cause it to accidentally fire on someone twice?
like does this check for dupes
units also take unit as parameter, as a shortcut for units group dude
no
It needs to check for dupes because of other later scripts that do things like knock you unconscious... hmm
that's where arrayIntersect rises
oh yeah that'd work
private _unitsToDeal = [];
{ _unitsToDeal append units _x } forEach _group1;
_unitsToDeal = _unitsToDeal arrayIntersect _unitsToDeal;
{ _x doSomething 42 } forEach _unitsToDeal;
you're a god? that's perfect
params ["_playersInZone"];
private _allSpecops = [];
{
{_allSpecops pushBackUnique _x; } forEach units group _x;
} forEach _playersInZone;
Why is pushBackUnique not suitable?
forgor
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...
From a performance perspective it's better to get the list of unique groups first, because arrayIntersect gets quite expensive on large arrays. Because each unit can only be in one group, unique groups -> unique units is just a forEach/append. Won't matter unless you're running it in a loop though.
Yeah, Muzzleflash's version.
Also mentioned the unscheduled thing so basically a perfect answer :P
Next time you forgor it will be a reforgor
ruforgor ...
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.
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
You can create a local heli for each client
Thatโs what I had to do to make a blackfish fly in a straight line over the island with everyone inside
wouldn't really work for them all getting in a heli together though
Yeah I had to locally add dummy passengers for each player
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
unitCapture/unitPlay works fine for helis. its usually user error if it doesn't.
Ye all it does for the most part is setvelocitytransformation
In my experience setvelocitytransformation looks weird when the object isnโt local
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.
that's because the command is a local arg, youre not meant to execute it on remote units
hence why unitplay has to be local too
im surprised it even does anything if you do it remotely
So unitPlay remoteExecs it for everyone?
no, just the machine where the vehicle is local
remote-execing it for everyone is probably why you're having issues
Yeah when I use interpolation on the server, where the vehicle is local, the movement is visually bugged for remote clients
unitplay itself doesnt remoteexec anything, it just sets velocity transformation, the command itself does the networking
define visually bugged
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
mm... that's either somehow the recorded data being wrong, it's simply lag, or delays in the scheduler, or mods messing with things
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...
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]];
Anyone have an idea of how to fix this? The FilmGrain ppEffect combined with night/sunset/overcast lighting causes the playerโs view brightness to bug and randomly get stuck in an extremely dark state.
I need to consistently create a mild FilmGrain ppEffect for any environment / time of day. Am I using ppEffectEnable wrong?
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.
or just remove all actions on the container and add his own
I though you couldn't remove all actions on default actions like opening doors and containers?
pretty sure you can.
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
eeerf, I was wrong
If anyone knows of a way to do this I would be very interested. It would really clean up a lot from my mission.
Excellent, thanks for the tip Quiksilver
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.
%APPDATA%/local/arma3 > here the .rpt files are located
they contain fully verbose errors
@indigo snow thanks, I've looked there but I can't seem to find any .rpt files from my recent editing session.
make sure you have -noLogs turned off
@lone glade thanks, I missed that =X
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]: ```
Looks like it can't create an object with type AISubgroup
how can I turn an addon's reflector on/off at will?
I found this code for the spotlight, but I'm guessing itll turn on every reflector in the config http://pastebin.com/raw/3uBncT9K
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?
@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
I see! Thanks for the advice!
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.
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 (:
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).
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 ?
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.
Thanks, we got it fixed folks !
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.
Arma language support in Atom v2.2.0 has been released https://atom.io/packages/language-arma-atom featuring new commands and BI functions as well as CBA functions
@warped thicket Why should I switch from Poseidon to Atom?
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
@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
We're not the only ones with this issue, it seems: https://forums.bistudio.com/topic/188302-eden-editor-spawn-point-issue-no-leader-wasteland/
any reason why a script wouldnt run in an intro?
How are you calling it in the initIntro.sqf?
@tough abyss proTip : 3x '
_true != true;
_k = "a";
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
no shit, that's what we've been trying to figure on #headless_client
Sorry didn't knew that there is a channel for it
I WANT TEH FEEDBACK TRACKER BAAAAAAACK T.T
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
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
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.
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
"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
object classes don't take a color param
hmm
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
hmm i didnt play around with object controls that much as camera method wins every time ๐
Well the object controls are pretty nice. They let you render a 3D object to the screen directly
Which would have been ideal
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
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
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
Well that was my main gripe ๐
well.... i theory you could do it ๐
inb4 green screen script
extension ๐
I'd be extremely impressed if someone managed to pull that off
๐
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.
you could have object control groups
like 7 of them
but that would just be a nightmare to do
Oh definitely.
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
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
I would link you a feedback tracker where i asked for it few mhonts ago... but you know feedback tracker
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.
In exile we did similar with vehicle buy screen
i cant find a video of it for a life of me
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
I did a POC of garage a while ago
You literaly walk trough a door and you are in your "garage"
GTA5 style
Ah nice, like instanced garages
put any thought into removing other players temporarily?
I was thinking more about there being issues with two people using the garage at once
Just a lock ๐
kek
No can do ๐
ez mode
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 ๐
Couldn't you just local set the other players to invisible
nah thats easy
of course, each player would see their own vehicles
i mean 2 actuall players in same "fake" garage
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?
I just had it so it offsets the garage by 100m in x of the other one
based on playerNumber
sooo
easy
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
well you could just do it in Z axis ๐
lol XD
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
hideObjectGlobal doesn't work locally? Hmm
Genius
ikr
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
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 ๐
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.
@fallen locust too early for that command, other things first
Anyone ever looked into disabling footstep sounds on a unit?
well, just making a unit silent in general
best way to end a mission #include"fuck you"
dosent work anymore btw
@zealous solstice that won't work. Maybe: #include"fuck you"
Any one had issues with Players Init lines not being called when they JIP for missions made in 3d editor?
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
owner doesn't work locally
it never did
owner returns 0 on clients, it only work serverside.
https://community.bistudio.com/wiki/clientOwner
new command
oh wait initPlayerServer.sqf is serverside, I mistook it for initPlayer.sqf
@fallen locust sanity was never an argument for SQF .. why you start bothering now?
clientOwner fails on resumed MP games.
Reports totally wrong ids. use at your own risk
no, it's totally wrong
cool โค
If 4 players were on the server it will be +4
as said ^^ SQF
we โค to consume your sanity
but there should be a way to fix that wrong behaviour
And KK is wrong. It's the exact same issue on dedicated resumed MP games
clientOwner should return the same value on server always with the offset X
wait, there's people who use save in MP ?
It's as broken as #restart is ๐
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
Just in different ways
cuz arma
I liked the answer I got on the feedbacks:
"this is intended behaviour, no one remembers why. - works on dedi though"
๐
yep ๐ best answer ^^
"it's normal, we just don't remember the reason why it is"
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
to fix that they decided to log ammobox inits, mother of god the spam
๐
that and "object found (random number, random number)"
They once loged when it wasn't "found". They reduced the spam by reversing that logic
(not really jk)
ohgod
๐
who even saves
You can't return to the main menu without saving in this game
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.
Alternative to unpacking all the pbos. Install Arma3 Tools & mount the P Drive, that way would you can just search P:\a3
P:\a3 is a symlink to arma 3 root for me
he could use Arma3P from mikero to unpack / unbin everything (except P3D)
Anyone know the function that gets called to open the pause menu when you hit escape?
It's hard coded, not SQF
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
_gunner cursorObject setFuel 0; -> _gunner setFuel 0;
_gunner cursorObject setHit ['motor', 1]; -> _gunner setHit ['motor', 1];
"_gunner = _this select 0;"
Assigns an object to _gunner
Now _gunner holds the object you want to work with
cursorObject returns the object youre looking at
setFuel for example needs an object and a number to work
so
object setfuel number
and the script will know its what the copilot is looking at then? ๐
_gunner -> Object
cursorObject -> Object
k
What do you want to achieve with the script?
copilot looking at vehicle, and immobilize it with a eventhandle ๐
Eventhandler*, in this case its "Z" key
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
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
One sec
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 =/
So
You want to give the copilot the option to press a key and then the cursortarget gets immobile, correct?
yes
alright give me a minute
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
Is the coopilot always going to be a player?
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 ๐
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!';}];";
and if i want mousebuttondown instead of key? ๐ sorry for asking dumb questions..
thanks, anyway will try that!
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
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!';
}];";
};
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!';
}];
};";
};
};```
won't that add the key event for every vehicle that spawns?
And for every unit?
is it? ๐
that is why i add the if exit @little eagle
a key handler should not be in a vehicles init
it work but not what he want
you can't add init events to turrets
This is completely backwards
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
everyone will be able to disable veicles that way, not just the copilot
haha lol
Are you adding this to your mission?
no, my mod
use the vehicle seat index.
an own chopper
You have to check in your key event if the player is inside that vehicle type and in that seat
hm, ok
and the keyhandler should be added with a cfgfunctions script with postInit = 1 and not a vehicle init
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 ๐
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
halting inits.... such a good idea.....
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:)
please use hasInterface and not !IsDedicated to not create death loops on headless clients
basically never use isDedicated
ok so if (!hasInterface) then? ๐
no hasInterface
nono, ! is the operator for not
hasInterface is every machie where someone has a keybord and mouse
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 ๐
hasInterface is every client and excludes both HC and deci server.
ah k
Basically everything that's releated to players / UI or th eikes should be on hasInterface
๐
.....
if (hasInterface)
drop the isDedicated . It's nieche and almost never usefull
Something that would true on hasInterface can NEVER be dedicated, so it's a redundant check
It's only used because of rampant copy past shit coding
use ``` for large codeblocks
ok, but how do i apply this so it only affects the copilot?
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
burn the heathen
if (!isDedicated && hasInterface && (1 == 1) && (format ["%1", "hi"] isEqualTo "hi")) then {
triggered
lol
i cant odd ๐
so in the init.sqf it should be like this then?
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?
making sure the waitUntil doesn't stop the rest of your init.sqf
ah paralelle instead of serial
yes
got it!
learn to use scheduled vs unscheduled.
but now when i have this.. what actually defines, that only my copilot wilbe able to use it?
Scheduled is spawned code basically, unscheduled is serial in your case
yeah
fun fact: addAction use an unscheduled check and execute in scheduled
It's good to get used to those terms, because they're pretty important
BI devs are odd
if(false)throw{systemchat"123";};
yeah im learning as i go ๐
isnt this script going to be applied to all the seats in the heli now?
depends on what you put in these addActions
Just if you need to use dynamicly add them and remove them
addAction does only get checked within 15 meters of an object though I believe
preferably dont use them
well, i dont want to use addactions, thats why i want to override with eventhandlers ๐
i just want a trigger thing.. that wil apply aslong as FakeWeapon is the selected weapon
if (currentWeapon vehicle player == "fakeWeapon") then {
Easy to use != good
would this do the trick?
if (hasInterface && currentWeapon vehicle player == "fakeWeapon") then {
no
because the weapon can change durign mission
and at that point this part is long executed
use this inside the onMouseButton event
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!';
};
}];
pretty sure you are still better of using simple booleans in addAction instead of removing them
yeah true
my hand is trying to pass through my face right now
@little eagle oneachFrame check a bool? for construction + vehicle x 3-5 actions? really?
is the a condition for like is copilot or is gunner in current vehicle?
who mentioned addactions on server?
and secondly they are ony evaluated for objects with 15 meters ifront of the player
hahahaha @tough abyss call me when you decide to get your head out of the sand
if i read this code correctly now, it would allow anyone which in a vehicle and has "fakeweapon" selected to use the function?
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!';
};
}];
};
};
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
THis might sound a bit complicated.... but why not add getIn on the helicopter type and only add / remove event handler there?
because getIn eh aren't executed when you are moved in with some script commands
Are those used in his case?
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.
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?
General question on cursorObject by the way... does it actually work okay?
I've had so much bullshit with cursorTarget. You look at a box standing somewhere below a helicopters rotors... returns heli
and it's much more precise
dude
you serious ?
you are not funny
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
Because the "house" simulation ground weapon holder is much more important obviouly
Damn right!
I wish we could lock them.....
id = (findDisplay 46) displayAddEventHandler ["MouseButtonDown", {systemChat str _this}];
actually works now!
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
@little eagle i initially used this
waituntil {!(IsNull (findDisplay 46))}; _keyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 == 44) then {
but it's much more efficient and return the array.
onMouseButtonDown works on displays now, but still can't block input unfortunately
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?
you create a function and execute it via the CfgFucntions framework
https://community.bistudio.com/wiki/Functions_Library_(Arma_3)
postInit = 1 is what you want
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?
that structure is completely foreign to me xD
welcome to sqf
๐
so if i want it mp i just replace the cursorobject setHit 1 with that function?
ok
modules with default value = 0 are saved as -1
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!';
};
}];
};
};
looks good to me
RC phase was too short
154 was the longest current version I believe
setfuel worked, but somehow not sethit
hmm
expected array
[cursorobject,["hitengine",1]] remoteexec ['sethit',cursorobject,false];
I think
setHit has global effect, but it still require a local unit
The object must be local to the computer where command is executed.
'(_this select0) |#|setHit (_this select 1)'
Error setHit: Type Number, expected array
ah ok
setFuel has global effects too
ok, so no need to use remoteexec?
It's required to use it
btw now when we're at it, how about say and say3d?
Welcome to locality
because the command requires a local object
ah ok
It's silly
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
You just need to move around the arguments for sethit. in your last try the hit selection was missing for example
^
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)
shouldnt it be lite this?
[cursorobject,"motor",1] remoteexec ['sethit',cursorobject,false];