#arma3_scripting
1 messages · Page 610 of 1
well it's defined and it works
functionName: String - function or command name.
While any function can be used, only commands and functions defined in CfgRemoteExec will be executed.```
Add this into description.ext
class cfgFunctions {
class rokunin {
tag = "mytag";
class core {
file = "";
class fuelingTimer;
};
};
};
class cfgRemoteExec {
class Functions {
mode = 1;
jip = 1;
class mytag_fnc_fuelingTimer{
allowedTargets = 0;
};
};
};
make a file called "fn_fuelingTimer.sqf", toss it into your mission folder.
put this into the sqf
private["_time", "_initTime"];
params ["_time", "_on"];
_time = RK_fuel_timer;
_initTime = _time;
"booyah!" remoteExec ["systemChat", -2, true]; // broadcast message everywhere except the server
I don't remember anything more
possibly
still says function or command name.
not code
but if it works, that's good enough for me
anyways, i would have to see the rest of the code in fuelingTimer.sqf
@tough abyss not really
well I've mentioned "func" from the general programming perspective, not as a BIS fnc
my fault
lemme do a pastebin really quick
cheers
also inb4 excuse my dirty code
also, what is serverInit?
do you mena initServer.sqf?
@tough abyss he has no functions defined
he is defining a variable
Anyway to force a helicopter's copilot and gunner to get out?
It seems running the eject action on those specific units doesn't work
AI or player?
@ebon citrus here it goes https://pastebin.com/b8hmZFrj
are they AI or player?
The other seats get ejected fine
Standard seats. Not gunner or co-pilot
did you try https://community.bistudio.com/wiki/moveOut
@ebon citrus also it works perfectly well if called with "0" parameter in OnActivation. But messes the sleeps, so the timer ticks unevenly
Well I want eject as it'll be used for multiplayer
you can also try https://community.bistudio.com/wiki/doGetOut
Ooh ok
@dull drum have you tried running [8, true] remoteExec ["fuelingTimer", 2]; from the debug console?
Yikes 😄
i'm still heavily on the part that you NEED to have a function or a command
a variable is no good
🤷♂️
would have to ask dedmen, but i cant bother to tag him
instead
@winter rose can you use code-blocks in a remoteExec instead of a command or function?
server environment vs local environment is different.
I can't remember if remoteExec are forced whitelist only by default now
@ebon citrus you can remoteexec call or spawn yes
nop
not that
i mean
defining code on server-side
into a variable
and then trying to remoteExec that variable
Who wouldn't run battleeye? xD
like so:
client:
[8, true] remoteExec ["fuelingTimer", 2];
server:
fuelingTimer = {
params ["_time", "_on"];
_time = RK_fuel_timer;
_initTime = _time;
"booyah!" remoteExec ["systemChat", -2, true]; // broadcast message everywhere except the server};
I would say perhaps
@ebon citrus yup, I've run it from the console, as always "2" does nuthin, "0" works Ok
@tough abyss you defined the codeblock on the same side
@dull drum dedicated or hosted multiplayer, just asking
@ebon citrus doGetOut worked a charm ❤️
first initServer.sqf execVMs the fuelingTimer.sqf, then runs remoteExec
dedicated, but when testing local also does not compute
i gave you a solution, which is doing functions instead
it's fine if you want to do it differently, but that's just what im comfortable with
CfgFunctions are safer anyway.
execVM probably executes a "call"
but i dont understand what remoteExecCall is for
ok, never mind
i do
Bohemia Naming scheme as always
remoteExecCall is unscheduled, remoteExec afford sleeps in whiles
not the trigger
car in area, it works
it's to do with the remote-Exec
anyways, 2 cooks
Come to me if you need help with functions
G4rrus can take over and handle this one
he seems more eager to deal with variable-soup
[] execVM "file.sqf" is literally [] spawn compile preprocessFileLineNumbers "file.sqf". about remoteExecing a function that isn't defined on remoteExecing machine, yes you can, aslong as target machine has the function defined it'll execute, doesn't matter if the issuing machine doesn't know anything about it
also just a question. why are you remoteExecuting on server instead of just making a server only trigger?
@tough abyss cause I need server to tick timer and send it's value to other clients. remoteExec 0 does it but timer value is messed up on different machines.
Because of course it just runs a copy of each code block for every computer in mp
about remoteExecing a function that isn't defined on remoteExecing machine, yes you can, aslong as target machine has the function defined it'll execute, doesn't matter if the issuing machine doesn't know anything about it
Good to know, might add this somewhere on the wiki
I meant the remoteExec "unknownServerFunction" 🙂
technically it's not unknown, its in missionNamespace
server-side only
after it goes from initServer execVM
Would one not expect it?
server-side only
@winter rose true
I could not be sure before that, so I guess it's worth writing somewhere - maybe the remoteExec(Call) page
interesting
systemChat has a local effect, but needs the interface to be init'd
if JIP, waitUntil { not isNull player };
to hell with sChat I didn't get the timer broadcasting to the UI 🙂
ok, I'll check everything tomorrow, I suspect something in the mission messing up with remoteExec, for example some GameLogic leftover that could run the same sqf file as server initialization does
thanks for the help guys!
so something interferes on my side
but I could check only tomorrow as my main machine now blocked by sleeping bodies
Maybe better for #arma3_gui , but is there any way to tie a control back to the config entry it originated from?
Best I've seen is ctrlClassname which I suppose I could abuse in some sort of loop to just walk the entire heirarchy
you could perhaps add onLoad config entry and do something there
like set variable on control
In my practice I gave up IDCs and just scan for all controls until I find the one with given ctrlClassName btw, much more convenient
pr _allControls = allControls _display;
//OOP_INFO_1(" ALL CONTROLS: %1", _allControls);
pr _index = _allControls findIf {_className in [ctrlClassName _x, _x getVariable ["__tag", ""]]};
if (_index != -1) then {
OOP_INFO_1(" found control: %1", _allControls select _index);
_allControls select _index
} else {
OOP_WARNING_1(" control not found: %1", _className);
controlNull
};
How do I get an actual instance of a unit's weapon instead of just a string with the weapon name?
no can do
@humble harbor like a proxy?
like a normal object hahahah
yeah I had the feeling this wouldn't be possible🤦🏼♂️
and even then, you would not have the object itself, just a holder
is there a way to see if a display is open if I create the display like this:
disableSerialization;
display = (findDisplay 46) createDisplay "RscDisplayEmpty";
when I use that the variable display returns "Display #-1"
then it is open
it means display with an idd of -1
when you close the display that variable will change to "No display"
im more so talking about getting a boolean value if its open or not
isNull display; true = closed (use a better variable name though)
I've tried findDisplay with that variable and that didnt work it said "Type display, expected number" then i tried -1 and it was always true
and yeah display isnt my actual variable, its just for simplification
there is probably more than one display that uses idd -1. it is like the default idd if you dont want to set a proper one.
hmm alrighty then
okay that was it. I seriously don't know why that was such a big issue for me lmfao
thanks a lot @robust hollow
How to disable car explosion in safe area
what do you mean by car explosion
a quick Google search gave me hundreds of quick (and dirty) solutions...
@exotic flax
did not give me
this doesn't give you pages with scripts and examples?
https://lmgtfy.com/?q=arma+3+safezone+script
that website is beautiful, thank you for that haha
I have made a few very unsuccessful attempts at creating Red, White, Blue & Yellow in both the runway edgelight and the land flush light.
Just trying to add color to 2 of those types. Any help would be appreciated.
Thank you
its the runwaylights.sqf
@marsh ermine please surround this message code with ```sqf (see pinned messages)
apologies
He didn't said remove it...
LoL, I'm aware. just was looking for someone that could help me figure out the Red, white, blue, green & yellow in the runwaylights.sqf
Thank you
well, we can, but now I don't know what you were trying to do nor where you did run this code 😅 (and if it was all of it)
can i send you the .rar?
Why would you need to send the rar?
just the script content and how you call it, you can use sqfbin.com if the content is too big
sorry, been up late. okay its 1.8KB
// RUNWAY LIGHT SCRIPT \\
// BY AUSTINATST \\
// v.01 \\
null = [this,#] execVM "runwayLights.sqf";
Different Lights:
( USE for # )
1 = Yellow Navigation Light --- "Land_NavigLight"
2 = White Edge Light --- "Land_runway_edgelight"
2.1= Red Edge Light --- "Land_Flush_Light_red_F"
2.2 = Green Edge Light --- "Land_Flush_Light_green_F"
2.3 = Blue Edge Light --- "Land_runway_edgelight_blue_F"
2.4 = Yellow Edge Light --- "Land_Flush_Light_yellow_F"
3 = 3 Nav Lights --- "Land_NavigLight_3_F"
NOTES:
->(r,g,b,y) or (.1,.2,.3,.4) <-
USE A "SPHERE 25mm" AS YOUR OBJECT
THIS WILL BE MORE CONVIENENT
Then other objects but its not required.
*/
//Object arrays
_Light = _this select 0;
_LightType = _this select 1;
_LightDir = direction _Light;
_lightPos = getPos _Light;
//Deletes said object
deleteVehicle _Light;
//This creates the lights
if (_LightType == 1) then {
_Light = createVehicle ["Land_NavigLight", _lightPos, [], 0, "CAN_COLLIDE"];
};
if (_LightType == 2) then {
_Light = createVehicle ["Land_runway_edgelight", _lightPos, [], 0, "CAN_COLLIDE"];
};
if (_LightType == 2.1) then {
_Light = createVehicle ["Land_Flush_Light_red_F", _lightPos, [], 0, "CAN_COLLIDE"];
};
if (_LightType == 2.2) then {
_Light = createVehicle ["Land_Flush_Light_green_F", _lightPos, [], 0, "CAN_COLLIDE"];
};
if (_LightType == 2.3) then {
_Light = createVehicle ["Land_runway_edgelight_blue_F", _lightPos, [], 0, "CAN_COLLIDE"];
};
if (_LightType == 2.4) then {
_Light = createVehicle ["Land_Flush_Light_yellow_F", _lightPos, [], 0, "CAN_COLLIDE"];
};
if (_LightType == 3) then {
_Light = createVehicle ["Land_NavigLight_3_F", _lightPos, [], 0, "CAN_COLLIDE"];
};
//Sets light params from object
_Light setDir _LightDir;
_Light setPos _lightPos;```
Yes…?
this is the script, I'm attempting to make edgelight and flush lights in Green, Red, White, Blue and yellow. I've made attempts but i'm not sure what i'm doing wrong....
What is the issue? Any error message?
everything is in this script works as intended.
I need edge lights and flush lights in all colors.
I'm lost on what I'm messing up on.
What exactly are you doing, and what actually happens when you do it?
I need to make more script, adding to this, to make a variety of runway lights.
You can only do that if those additional types of runway lights actually exist in the game. I can't answer that.
If there is (for example) no white flush light object for the script to spawn, then it cannot be done.
Right, but the flush light exists and the color white exists, shouldn't i be able to script that together. Or am i just that big of an idiot.
Excuse me, so you want to make more variants to this script, but don't know what are the classNames?
sorry, been up late. okay its 1.8KB
@marsh ermine wount it be more efficient to use a switch instead of a whole bunch of if's?
Yes, I'm reaching out here, because I'm very naive.
it's possible that https://community.bistudio.com/wiki/setLightColor could work on the runway light objects, which would solve your problem, but it's also possible that it doesn't
I'm making an airport in Arma Eden Editor for our group from scratch.
Won't work with those objects
@marsh ermine classnames (the "light names" between quotes) are defined by addons and game data. If nothing defines e.g a purple light, then you cannot create one like this.
Maybe,but it is not sure, maybe some lights allow for setting their colour, but this is not guaranteed.
I very much suspect that lights are available in all the colours that would be present at an actual airport. Airport navigational lights are like reflective road markings, the colours mean things. So if you need a light that doesn't exist...you probably don't actually need it.
Since a few people are reading...I have a little scripting question my self.
It may be a lack of coffee. I dont know.
here it comes:
its not necessarily the color, but certain colors are attached to different object (some are flush to the ground and don't project a distance) others project a distance but don't have a variety of color
the different object types are probably appropriate for the purposes of the lights, e.g. flush lights for markings that planes might need to drive over
[
_x, // Object the action is attached to
"Mission Control", // Title of the action
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Idle icon shown on screen
"\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Progress icon shown on screen
"_this distance _target < 1.7", // Condition for the action to be shown
"_caller distance _target < 1.7", // Condition for the action to progress
{}, // Code executed when action starts
{}, // Code executed on every progress tick
{ (_this select 1) assignCurator mission_control;
openCuratorInterface;
if (local (_this select 1)) then {
["CuratorAssign",["",(_this select 1)]] call bis_fnc_showNotification;
[(_this select 0), (_this select 1)] execVM "disconnect_MC.sqf";
};
}, // Code executed on completion
{}, // Code executed on interrupted
[], // Arguments passed to the scripts as _this select 3
1, // Action duration [s]
0, // Priority
false, // Remove on completion
true // Show in unconscious state
] remoteExec ["BIS_fnc_holdActionAdd", 0, _x]; // MP compatible implementation
} foreach MC_devices;```
you can try digging through the configs to see if there are some other types available, but it seems likely that a dedicated airport light creation script already accounts for everything you need
Im trying to make a laptop, connect you to Zeus
and when you walk away it disconnects.
It works when I just send the commands through the debug console
but doesnt respond to this
okay, thank you everyone
@marsh ermine just one thing. Are you calling this script by using its example command (null = [this,#] execVM "runwayLights.sqf";) in the editor init field of an object?
I am @hallow mortar
In multiplayer, you are executing the script for each client, so if you have for example 5 clients + server, every light will be created 6 times.
won't the headless clients take that off of the clients?
No, headless clients have nothing to do with this.
Headless clients are for offloading AI processing, they don't prevent clients from executing scripts.
or making them simple objects won't make the lights functional correct?
Simple objects are not the solution. That's a performance saving measure but there is an easy way to make it just not create 6 extra lights
if (isServer) then {_null = [this,#] execVM "runwayLights.sqf";};```
use this instead
thank you
Wanna see something nightmarish?
private _gunnerDirectionModel = -deg (_vehicle animationSourcePhase "mainturret");
private _gunnerElevationModel = deg (_vehicle animationSourcePhase "maingun");
private _gunnerVectorModel = [1,_gunnerDirectionModel,_gunnerElevationModel] call CBA_fnc_polar2Vect;
private _gunnerVectorWorld = _vehicle vectorModelToWorld _gunnerVectorModel;
private _gunnerWorldAngles = _gunnerVectorWorld call CBA_fnc_vect2Polar;`
Check the pinned message to format
@umbral nimbus it appears that your completion code executes the disconnection script immediately after giving you Zeus. I don't know the content of the disconnection script, but if it removes zeus then perhaps it is being removed too fast for you to notice.
here is what is does:
Also, using params is much easier to read than using this select x all the time
waitUntil {sleep 2; ((_this select 0) distance (_this select 1)) > 3};
player sideChat "disconnect";
[] remoteExec ["unassignCurator", mission_control];
["CuratorUnassign",["MC Link disconnected",""]] call bis_fnc_showNotification;```
And yes correct regarding params. Will do
so it waits until you step away from the laptop in this case
it all works. except connecting and disconnecting Zeus
the rest of the script runs
I'm not sure about connecting, but I can tell you that in the disconnection script the remoteExec is not formatted correctly
When I say it's not formatted correctly I mean that's why it's not working
and
(_this select 1)] remoteExec ["assignCurator", mission_control];```
I understand
But lets look at connecting first
mission_control is the zeus module
Your second method is also an incorrectly-formatted remoteExec
aah then there is my problem for sure
oh wait typo
[(_this select 1)] remoteExec ["assignCurator", mission_control];
missing [
but that's in there.
even then it doesnt work
You will need remoteExec because assignCurator is a server-only command and must be sent to the server from the client that's executing the action. But that remoteExec is wrong.
here is an abstract example of a correct remoteExec:
[left parameter,right parameter] remoteExec ["command"]```
What you are doing is:
[left parameter] remoteExec ["command",right parameter]```
and not the ,2 to exec on the server only?
yes, the ,2 as well, but I was going to get to that in a second
haha ok
Doing it without the target parameter (,2) would default to executing it everywhere, which is inefficient but not a huge issue in this case since the command only works on the server
unAssignCurator is a server-only command too, so you need to do the same thing for that.
however that only has the 2nd argument (on the right of the command). I can just put it in there on its own?
like:
[mission_control] remoteExec ["unassignCurator" ];
Yes
ok
let me give it a shot. stby
yup works as intended now
thanks mate
somehow got confused by BIS's description of the RemoteExec I think
It does put the cart before the horse somewhat
I've taken to just doing [{some code}] remoteExec ["call"], which is objectively worse but much more readable. Doesn't always work though
I have Carrier Strike Group with a total of 42 turrets in one of my missions. Because players shouldn't have access to them they are locked for players and to prevent them from crowding up the UAV list in the UAV Terminal I have placed 42 NPCs with UAV Terminals that connect to those 42 "fleet turrets" thus hiding them from the UAV Terminals of the players. The only problem is that the first person that joins still has all 42 in the list of their UAV Terminal even after respawn.
Does anyone know a way around that? Is there any possibility to hide those turrets from the UAV Terminal of the first player as well?
JIP you mean? @vague geode
You could probably save some time by having some of them be placed empty, I can't imagine you'll ever need all 42 of them to be operational
Also, and this is just a guess, try placing it as an empty object then giving it an ordinary rifleman as crew. Without the special UAV AI brain it may not be connectable. (MAY, GUESS)
@winter rose No, on mission start the NPCs UAV Terminal gets connected to the turret by <NPC> connectTerminalToUAV <fleet turret>; in their init section. The first player that joins on mission start has all 42 turrets in the list of their UAV Terminal but everyone else doesn't as expected since the NPCs are connected to it.
So for all JIP players none of the fleet turrets are visible in their UAV Terminals...
where is the code run…?
On the server, I think. It's in the init section of those NPCs but I am not sure whether or not I put a server check in...
try putting it i the serverinit.sqf
hmm Object Init fields are called before that....🤔 nevermind
do -not- put this in the init field.
can you try https://community.bistudio.com/wiki/setAutonomous ? maybe it does the trick, unsure about this command's goal tbh
no it wont
it keeps the UAV from doing its own attacks and stuff
or atleast movement
it's somewhat debatable how effective that command actually is, but yeah this isn't what it's for
it is effective actually
for example. it keeps the Cruise missile launcher from enaging data linked Laser spots
yeah I wasn't sure if it worked like "do your stuff when I don't control you" or "cannot be controlled"
@winter rose No, on mission start the NPCs UAV Terminal gets connected to the turret by
<NPC> connectTerminalToUAV <fleet turret>;in their init section. The first player that joins on mission start has all 42 turrets in the list of their UAV Terminal but everyone else doesn't as expected since the NPCs are connected to it.So for all JIP players none of the fleet turrets are visible in their UAV Terminals...
@vague geode
Maybe remove the UAV terminal
make it an object to pick up
or...add it a second later by script to its inventory
I've personally observed inconsistent behaviour as a result of setAutonomous. It seems to stop some AVs from doing things, but I've also had the Mk45 turret engage targets at will despite being, in theory, affected by that command.
https://community.bistudio.com/wiki/disableUAVConnectability ?
@cold glacier If I am not mistaken I would need to run that command 42 times whenever a player closes their inventory since they could pick up a UAV Terminal from a dead NPC teammate. I don't think that is really feasible.
Yeah, that's entirely possible.
Only once per pickup, it accepts an array of objects as the parameter for UAVs to block
Do you actually need these turrets to be able to fire @vague geode?
I still stand by what I said here btw https://discordapp.com/channels/105462288051380224/105462984087728128/740873405930405909
@cold glacier Absolutely, otherwise the Carrier would be completely defenceless which defeats the whole purpose of having it in the first place...
Also, and this is just a guess, try placing it as an empty object then giving it an ordinary rifleman as crew. Without the special UAV AI brain it may not be connectable. (MAY, GUESS)
Yeah, this suggestion from Nikko is best idea I've heard then.
No idea if it'll work, but it might.
Potential alternatives:
- turrets are secretly friendly INDFOR (only works if you don't need INDFOR to be hostile for other reasons)
- design the mission so that the carrier doesn't need to come under attack
- give them a recon team instead of free eyes in the sky
Also, and this is just a guess, try placing it as an empty object then giving it an ordinary rifleman as crew. Without the special UAV AI brain it may not be connectable. (MAY, GUESS)
@hallow mortar I am not sure whether that works or not, since I have another problem that might be cause but this. I have added some UAVs to theCfgWLRequisitionPresetsof my custom Warlords mission but whenever one of them gets called/bought they are not listening to orders, even when brought up into the air again after landing and then given a waypoint to fly to they just turn around and fly out of the map.
I think the problem is that the function BIS fnc WLAircraftArrival spawns them empty and then adds crew to it. The UAVs can still be connected to with a UAV Terminal they are just "dumb".
idk man I don't know whether it works either. The idea is really that you would test it, it's the only way to find out
btw, added some commands to https://community.bistudio.com/wiki/Category:Command_Group:_Remote_Control
I don't see what you mean (F5 the page @tough abyss 😉)
Did the Init event handler suffer modifications in the last 2 years?
I used to have:
player addEventHandler ["Init", {```
But it no longer triggers
Wiki does indeed say "Triggered whenever an entity is created. Cannot be used in scripts, only inside class Eventhandlers in config. e.g: "
and you used it where?
I have a mod that is HUD. The purpose of this Init was incase the player started a mission inside a vehicle the HUD would show up. This used to work but apparently not anymore
weird, but there shouldn't have been any changes
I already have the GetInMan, SeatSwitchedMan, for all other scenarios
But this used to work, at first I thought was a problem with the script or something, but even setting in the mission init doesn't work either.
ah wait
where did you place this code?
addEventHandler ["Init", {}] should not work
only through config init = ""
So, I should change this to config.cpp?
Or it just basically doesn't work anymore the way it used to
(for easy reference https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Init)
addEventHandler ["Init",{}] basically doesn't make sense in scripting context
I guess so. Was just a cheap trick i used to have to run something at begining.
It really doesn't...
That was really dumb of me. Instead of:
player addEventHandler ["Init", {
CODE
}];```
I should have just put the CODE as main without event handler
just run the code yes 🙂
I guess I'm surprised that even was a thing then xD
I am surprised it ever worked yes ^^
I guess technically it would make sense for it to work, it's just...completely redundant
Actually, maybe there's a case scenario but even then there's alternatives
I do have a:
["vphud", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
}];```
So when the player respawns, the script runs from begining or should I force a respawn event handler of some kind?
Yup, there's a respawn event handler, gotta add that one
I believe you should use https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#Draw3D instead
and not draw when the player is dead, without adding/removing
Gonna check that
😮 that's exactly what I need
That might even improve the "onEachFrame" paradox which performance aficionados could easily get angry about that constantly executing code
Hmm
That's a missionEH, I'm doing a stackedEH, gonna take a better look
hmm, i should just actually change the whole thing
Thanks Lou 👍
how to check if some unit is remotely controlled by player (ZEUS) ?
when you are zeus and remote control unit (not remote control with terminal)
They are the same thing, UAVControl returns ZEUS for ZEUS-controlled unit.
^ Remote controlling unit is basically the same thing with UAV
should I add UAVControl to remoteControl seeAlso?
(wait, it already is there)
UAVControl is not a getter for remoteControl (just checked)
Oh?
What do you mean not a getter?
player remoteControl joe;
UAVControl joe; // [objNull, ""]
*insert_sad_face
so I guess I need to wait for getter or use that hacky solution "SQF_fnc_remoteControlledBy"
I don't know how Zeus works, if it's by selectPlayer or remoteControl (I guess the latter though)
I mean, I don't need to check, who is driving, just check if it driven by curator (true/false)
but does ```sqf
player remotecontrol joe
although what happens to the original unit
or do both count as player
no, player remains player
isPlayer joe return false on remote-controlled unit by zeus
Hi guys, if I want to create a countdown timer which uses a trigger to add addition time to that count. How would one go about creating one
A global var or local server var if trigger is server side only, that would add time to that countdown var would be a good aproach i think.
Look up forum or here for countdown examples, depending on when you want the countdown to start you'd have to implement it diferently.
I think triggers actually can have countdown themselves but I don't know if you can mess with their timers so I wouldn't recommend that approach.
rgr
```sqf
see pinned message 😉
this ok?
ta
i have a scripted waypoint i have made up to work in sp and mp but its not working in mp at all now..
heres the script.Any help would be appreciated.:)
_pos = _this param [1,[],[[]],3];
waitUntil {
sleep 1;
(istouchingground vehicle player) && (vehicle player distance _pos < 400)
};
{ _x enableai "move" } forEach units grp1_b;
{_x assignascargo h2} foreach units grp1_b;
{[_x] ordergetin true} foreach units grp1_b;
{ _x setunitpos "up" } forEach units grp1_b;
activate1 = true;
waitUntil {
sleep 1;
{!(alive _x) || _x in h2} count units grp1_b == count units grp1_b;
};
gunner1_b vehicleRadio "RadioMsg_troops_on_board";*/
It doesnt make it to grp1_b line
iam executing it thru the scripted waypoint
It doesnt make it to grp1_b line
which one?
also, player varies depending on the machine it is run on
the first enable ai move commands
playervaries depending on the machine it is run on
sooo why it works in SP, but not in MP
not sure
I am, don't worry about it
the waypoint holds at the pos
yes, it waits until player's vehicle is close to _pos
rgr
but the ai wont board
like in sp
ive changed the player vehixle command to the heli name but no good
erm, is /* removed in your script?
kk
i had a go at remote execting but i had no luck
dont use 'player' im MP
You can totally use player in MP as long as you use it in the appropriate locality
is there a way to force https://community.bistudio.com/wiki/lockDriver only on AI units?
it there a way to define a custom waypoint (e.g. the ones you can make in-game by shift+clicking the map) via script? Of course there is addWaypoint, but I think that can only create standard waypoints.
I think that shift click waypoint has a special name
there's a script command to retrieve it
@still forum @winter rose Thanks for the info. Define is what I was looking for but I guess that just means I'll be working with regular waypoints.
ever add a case sensitivity note to the arma_3_respawn#respawn templates wiki?
So right now i have a script that rolls twice from a selection of four locations. The first is the start location for a convoy, the second is the destination. It works perfectly, randomizing the convoy route. Except for when it randoms the same start and destination
any way to fix that other than doing a series of if/then statements for my second roll?
basically now, i do this twice ```sqf
_marker2 = createMarker ["Ground_convoy_end", position tester];
_marker2 setMarkerType "mil_triangle";
_marker2 setMarkerText "Enemy Convoy Destination";
_marker2 setMarkerColor "ColorRed";
_RandCorp2 = floor (random 4);
switch (_RandCorp2) do {
case 0: {
_marker2 setMarkerPos _start1;
};
case 1: {
_marker2 setMarkerPos _start2;
};
case 2: {
_marker2 setMarkerPos _start3;
};
case 3: {
_marker2 setMarkerPos _start4;
};
default { hint "default" };
};
only substitute _marker1 for the other
randomise the array order, then take only the first two elements 😉
@spark rose
private _baseMarkers = ["marker1", "marker2", "marker3", "marker4"];
private _markers = _baseMarkers call BIS_fnc_arrayShuffle;
_markers resize 2;
_markers params ["_start", "_finish"];
```@spark rose
You can also remove elements from arrays once you've selected them by using the - operator
in this case Lou's solution is clearly superior but it's a related useful trick
Lou's solution is clearly superior
that's all I decide to keep from your comment \o/
Lou's (…) clearly superior
😁
Hey guys, i have this MP scenario where one player plays as the bad and mean zombie, since he can jump there is a possibility where if he hits something mid jump he will take fall damage and eventually die, i cannot disable fall damage and bullets damage since i wants him to die if shot, i was thinking... is there a way that the zombie gets slow down or frozen in place for a small amount of time when shot?
if he can get slow down then it's ok if he's immortal
@ me if you have any solution!
@obtuse quiver you can make him invulnerable to fall damage
(and car ramming in the process)
Take a look here:
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage
You can also separate vehicle damage and fall damage, if i recall correctly
Falldamage doesnt have a source, i think
Or an instigator, i dont remember
Play around with it a bit
im basically code illiterate could you give me the code to copy and paste if it's not a problem of course? 🙂
this addEventHandler ["HandleDamage", {
params [ "_damage" ];
}];
is this right?
wait, community.bohemia.net is a thing? if I knew, I forgot
so, i read the article but i still don't understand 😅
wait, community.bohemia.net is a thing? if I knew, I forgot
yea, it redirects to https://community.bistudio.com/
confused italian noises
I noticed 😛 @copper raven
@obtuse quiver read the parameters, you can probably just check if projectile is an empty string plus something like https://community.bistudio.com/wiki/isTouchingGround
Turn off seeing players and vehicles near me
@tough abyss … ?
close your eyes i guess
@winter rose
I can see enemies around me on the map
thx
this addEventHandler ["HandleDamage", {if ((_this select 4) == "") then {0} else {_this select 2};}]; this worked! thanks guys!
@tough abyss that's not scripting. if you are setting up your server, head towards #server_admins. if it is for your own settings, see #arma3_questions. Thanks
adding scripts to existing mission, the script files include initPlayerlocal.sqf , does this folder simply go in my mission folder or do I need to copy/paste the contents into my mission ?
…perhaps?
it depends on how the scripts are made. If you downloaded from the webz, there must be a readme
i just dont see when he actually add this to an existing mission,
ok found this too, trying...
ok copied but now I have 2 files called init, should they be combined? how?
not sure I understand what to learn from that link
In this tutorial from the script maker he says you dont need to copy his init file if you have one, I do have one but I thought I needed the info from his init as well as mine, do I need to copy the actual text from his init and paste it onto mine (after a ";" of course) ?
this is kind o #arma3_scenario
but ehhh...
if you send me the init file, i'll tell you if you need it or not
@inland valve youre supposed to read the article and understand what those files are for
does that article explain that?
did you read the article?
...I mean, obviously but
Look, buddy
nobody here can help you unless they know what's in that file
i gave you the advice i could and extended the offer of helping you, granted you let us into what's going on
its the init file from the smoke script I had mentioned earlier
if ((!isServer) && (player != player)) then {waitUntil {player == player};};
//titleText ["Smoke Signal Script DEMO", "BLACK FADED", 0.2];
setViewDistance 2000;
[] execVM "briefing.sqf";
[] spawn {
sleep 10;
[s1,"red"] execVM "AL_smokeSign\al_object_smoke.sqf";
sleep 1;
[s2,"white"] execVM "AL_smokeSign\al_object_smoke.sqf";
sleep 2;
[s3,"blue"] execVM "AL_smokeSign\al_object_smoke.sqf";
sleep 1;
[s4,"green"] execVM "AL_smokeSign\al_object_smoke.sqf";
sleep 3;
[s5,"orange"] execVM "AL_smokeSign\al_object_smoke.sqf";
sleep 2;
[s6,"yellow"] execVM "AL_smokeSign\al_object_smoke.sqf";
sleep 1;
[s7,"purple"] execVM "AL_smokeSign\al_object_smoke.sqf"
};
codeblocks
its the init
check pinned messages
ok, what do you intend to do with this?
from what i can see, you dont need any of it
unless you want to run the demo
but i guess youre not intending on running the demo
urgh, ok
you dont need any of that
you can go with a blank init.sqf
if this is all that's in it
how much experience do you have in scripting(sqf)?
Ive never copied script into a mission before, so zero
have you ever written script?
do you know the syntax
do you know the structure
are you familiar with majority of the common commands?
do you want to?
Im very new to it
or do you just want to run this particular script
I just want to run this one, I need to glean what I can, otherwise I drive people nuts
...glean from small scripts, make changes etc
ok, jsut run [<object>,<color-string>] execVM "AL_smokeSign\al_object_smoke.sqf";
drop the AL_smokeSign folder into your mission root
you might need to combine some parts from the description
if you want to use the sounds
everything you actually need is in the smoke_signal.txt
so copy/merge (CORRECTLY!) the description.ext, initPlayerLocal.sqf and all the other folders
init.sqf is not necessary
again, this doesnt fall under #arma3_scripting but rather #arma3_scenario
if you have 0 understanding into scripting and missionmaking, then i would recommend you read up on a little
you should try to get a basic understanding into what all these files youre meddling with do
lol reading up on it and getting a basic understanding is what were doing hehe, thanks for the help! MisiionMakers you say? this isnt script?
@ebon citrus thanks
it is a script
but youre not having any problems with scripting
youre having problems with setting up your mission
I see
...but sorry earlier you said just run[<object>,<color-string>] execVM "AL_smokeSign\al_object_smoke.sqf";
this goes into my existing init.sqf ?
...sry gimme a sec im slow\
quoting from that article i sent you:
init.sqf: Executed when mission is started (before briefing screen)
so no, unless you want to run it before the mission starts
also, you need to fill it
[<THE OBJECT WHERE YOU WANT THE SMOKE TO SPWN GOES HERE!!!>,<THE COLOR YOU WANT THE SMOKE TO BE GOES HERE!>] execVM "AL_smokeSign\al_object_smoke.sqf";
aalso, read the smoke_signal.txt in the example mission
Spawn smoke signal using objects
[object name,color] execVM "AL_smokeSign\al_object_smoke.sqf";
Color options:
"white"
"red"
"blue"
"green"
"orange"
"yellow"
"purple"
Example
[smoke_obj,"red"] execVM "AL_smokeSign\al_object_smoke.sqf";```
youre jumping off the deep end a bit here
it all might seem overwhelming if you start here
so this is where i recommend you start for arma 3 scripting:
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting
its not that I dont read these things (or watch his videos) it just seems like hes talking about different ways to use this and I just want one

again, im not getting your problem here
what do you want?
im not getting it
do you want to learn how to write script? https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting
do you want to know what the init-file does? https://community.bistudio.com/wiki/Event_Scripts#init.sqf
do you want to know how to setup your mission? #arma3_scenario
ok, thanks. I dont want to frustrate anyone
do you want to know how to use the script? https://discordapp.com/channels/105462288051380224/105462984087728128/741082464113393706
@inland valve youre not frustrating anyone. Your problem is that you cannot make a coherent question that is on topic
copy, thanks for the help
so to call the smoke object
and to me it seems like you dont read these things and dont watch the guides.... or atleast you dont understand them
You are right, I am still going through all of it, and I do not understand it yet, sorry, its frustrating
stop saying sorry, youre not doing anything wrong
and to me it seems like you dont read these things and dont watch the guides.... or atleast you dont understand them
seem worthy of applology
not at all
this is what i see. What i see is not always the whole picture
which is why im saying that you need to be more clear and coherent with your questions
and be on topic
help me help you
Its difficult to be on point when asking questions about subjects in which I have no knowledge... analagous to asking the proper way to ask the proper way in another language...?
im kind of cutting/pasting here
why does inGameUISetEventHandler have to overwrite globally ugh
and there isnt even a way to check if it's in use by other mods
is that a question?
just venting
I'm trying to make a functions to correct some savegame file with incorrect entries.
For entries with <NULL-object> it works well (using tolower str comparison with "<null-object>").
But, for example, I have an entry ["gang25",<null>]
And IDK what can I do with the second list element.
I can't convert it to string, or compare with something to replace it. Any ideas?
I had some weird ones, like getting this list's element length (it counts well), then getting some variable with the default value from each element, and make a comparison between the first length and number of variables that are not equal to default value... But I want to believe there is a much easier way ))
Yet another getAllHitPointsDamage question...
Currently working on a ballistic/armor/damage calculator test mission to debug armor values for a gear mod. I’m running into an issue using the “hitPart” EH as it returns the “_selections” hit on the P3D model, but those do not directly correlate to the “HitPoints” from the configs or getAllHitPointsDamage.
Am I missing something here? Not sure if ACE 3 is causing an issue. @winter rose you seem to be versed in the command...any thoughts?
I can't convert it to string, or compare with something to replace it. Any ideas?
use isNil ? @unreal scroll
if (isNil {_array select 1}) then {}
or you can make a recursive search for isNil in the array
Also it's better to not save such things at all, so prior to saving you should check if you are about to save incorect data
isNil doesn't work, I tried
so is it a string with value "<null>"?
"Also it's better to not save such things at all"
Of course. And it does not exclude the load check 🙂 Something could happens.
"so is it a string with value "<null>"?"
No, it is not a string, of course, otherwise I would made it easily ))
Nothing
isNil returns nil?
how did you use isNil? Maybe you used it wrong?
only valid variants of isnil are:
isNil string - string is variable name
isNil code -
isNil (_array select 1)
Anyway, even select command returns nothing
then it's nil I guess
private _value = _array select 1;
isNil "_value"
or
isNil {_value}
Anyone know why using getpos on a piece of gear (backpack) returns a location that is not the actual location of that gear?
For instance, using getpos on the backpack i get [17887.1,10722.8,-50.9157]
standing directly above it and using getpos player i get [8943.59,5361.01,0.00161743]
maybe you could just add a -y vector to the player's position to get the backpack position xd
since backpack is always behind the player
Use modeltoworld (and worldtomodel) - to the relative backpack position, for example. As I understand, you want to show some visual effects based on its position?
@unreal scroll you mean player worldtomodel getpos pack ?
So I have this as my onPlayerRespawn.sqf... any interesting ways I could possibly go about making it so that players could choose to either spawn on the ground or up on a drop?
No, I mean a player can't interact with the backpack as it was an object, so he need to do what he wants to do with the relative coords.
Like attaching a light. Anyway , depends on a purpose.
// Get the names of all the crates
private _crateName = [
missionNamespace getVariable ["base_box_1"]
];
// Get the game object as referenced by _crateName
_crateName select 0;
// Get the cargo of the crates
private _crateBackpackCargo = [getBackpackCargo _crateName];
private _crateMagazineCargo = [getMagazineCargo _crateName];
private _crateWeaponCargo = [getWeaponCargo _crateName];
private _crateItemCargo = [getItemCargo _crateName];
//Add the items to a global array
missionNamespace setVariable ["CrateCargo", _crateCargo, true];
help plz
with...
private _crateItemCargo = [getItemCargo _crateName];```
exitwith : expected Object, not array
what do
your second line does nothing
try creating a new variable like
_cratename2 = _cratename select 0;
then using that later
All of the code is... weird.
missionNamespace getVariable ["base_box_1"] - wrong syntax
_crateName is a list of about 10 boxes. In this example, it's only 1, solely for testing.
missionNamespace setVariable ["CrateCargo", _crateCargo, true];
no need to make it global, it is global already.
right
so I made some changes and was able to get it to run
I need _crateName as an array, is there a way to do that with public names?
One works, I just can't seem to get multiple to work when combining them into an array
private _crateName - what is stored here? If it is a class, then you can't get anything from it.
If you want to save/load (you want to save it in missinnamespace, so it is supposed you want to save it), then you should not save the object itself, it will not be saved.
_crateName is supposed to contain the variable names of a handfull of boxes
These badboys V
https://gyazo.com/176cdca9122e3fb551469053ecc438f2
Variable names? Stored? Why? Maybe you want to save the variable values? 🧐
basically, I want to grab the contents of a handful of boxes and pipe the contents over to an ACE arsenal
The variable _crateName doesn't last more than maybe a second
Then why you want to use missionamespace? It is a very weird decision. Use server variable.
I understood it as, object names were stored in missionNameSpace?
Yup. But maybe there is no need to use global variables, if the TTL "maybe a second"?
Without using a global variable, how would I get the variable names of the boxes I'm trying to access?
What is the "variable names of the boxes"?
Boxes are the objects. Variable names are just variable names. It can be linked with object, and may not.
Variable value can be linked with name[s] of object, objects, etc.
You need to explain you purposes well.
If you want to get a cargo from nearby boxes, then just:
- Do foreach cycle for each nearest ammoboxes, and get the content of it (nearobjects, nearestobejects, etc)
- Put the content into one variable, and pass it to ACE arsenal.
private _ammoboxes = (collect the ammoboxes objects here);
private _cargo = [];
{
_cargo pushback (conntent of a box);
} foreach _ammoboxes;
Use modeltoworld (and worldtomodel) - to the relative backpack position, for example. As I understand, you want to show some visual effects based on its position?
@unreal scroll Thanks Max, I'll try that
i have two respawn points, one is a squad leader, other is a marker. how would i go about making it so that I can call a different script depending on the respawn type? object or marker?
cause right now, my scripts apply to all respawns available
measure player's distance between leader and marker?
whichever is closer means player respawned there
@unreal scroll I got it to work. The syntax threw me for a loop, I will say.
thanks man!
(or woman)
Guys, if I create a countdown timer using while loop and want to add time by killing a ai how would one go about writing it.
any AI or just a specific unit?
Any ai
I'd give all of them a new killed eventhandler, make your timer global and add to that that
or maybe you could work with the players score?
Okay let's cut out the ai for a sec. Let's say the countdown timer which runs in a while loop. And I add time to it let's say another 60seconds. I would update the variable by adding the remaining time left with the added time which is 60 . How do I let that timer go down again because in the while loop this variable will continue to add instead of going down again
So is the while loop the best for countdown ?
Or is there another way of executing it
Don't add the time in the while loop. Have the time be a public variable that is modified in two places: down 1 once per second by the while loop, and up 60 by an event handler whenever someone murders a robot
this will tick down every second, you can add other stuff into the do loop to check for, some if x then mytimer=mytimer + 10
while {(missionNamespace getVariable ["mytimer",60]) > 0} do {
_currentTimer = missionNamespace getVariable ["mytimer",60];
_newTimer = _currentTimer - 1;
missionNamespace setVariable ["mytimer",_newTimer,true];
}```
then in an event handler, probably an MPKilled event handler so you only need one:
```sqf
_currentTimer = missionNamespace getVariable ["mytimer",60];
_newTimer = _currentTimer + 60;
missionNamespace setVariable ["mytimer",_newTimer,true];
I'm not sure the best way to check for being an AI in the EH. isPlayer is the obvious one, but on the other hand it might return false even if it was a player because they're not a player once they're dead. The most foolproof way IMO would be to know which faction(s) all your target AI will belong to and check against that.
Thanks guys will give it a try appreciatecit
I'm running into a wall
how do you get getMagazineCargo (and similar fnc) to apply to an array of objects, like nearestObjects?
I tried manually entering the objects into getMagazineCargo and I get an expression error
curious
Thanks from me aswell Nikko and Nica
oh yeah you do need a sleep or uiSleep in my while loop example as well, I just forgot to put it in
@wheat island forEach
Some of you regular's need to take a break from these forums for a bit.You cannot expect people who come here for help to be able to have coding knowledge.Thats why they are here.If they have trouble communicating their problems it is because they themselves are trying to learn.I have interests in most aspects of modding and even after modding since ofp i still learn and find myself asking seemingly silly questions.Btw,I am a qualified sound engineer and have made many terrains and mods in different game engines.But, i know only the basics of scripting.Ive also contributed to the development of the arma series itself.The point is, if helping ppl or answering questions is getting stressfull ,take a break.I do every 4 or 5 years.
Thanks.
Valid point, but monocausality doesnt exist
People coming in here should also put some effort into their questions
What infuriates me personally most is when people come in here asking for things they should ask in #creators_recruiting
Put some effort into it
If you make script and it doesnt work, that is 100 times better than asking here for people to explain to you how your idea would be turned into a script
And for that question, the answer is found here:
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting
Now, let's keep the discussion on topic

I'd say it's worth to have some generic programmic knowledge before diving into specific topics of the platform. So yes, we should expect people to know programming basics, otherwise it makes no sense.
I was looking at the optimizations page and it struck me a bit of wonder.
if ([] call check_rendering_conditions) then {
[] spawn render_vphud;
};
I made this a couple years ago and I know I did it like this for a reason, but I'm just not sure why in the if I used call and in normal execution i used spawn. Or perhaps is not even the best way to execute these functions.
Is it possible to make an IR strobe also visible on thermals? I am trying to use them to mark friendly units e.g. in the Blackfish's thermal scope...
Not via scripting I am afraid
Messing with configs. Try to find another kind of object that also shows thermal values, you could try reverse engineer and add those characteristics to a new IR strobe.
I was looking at the optimizations page and it struck me a bit of wonder.
if ([] call check_rendering_conditions) then { [] spawn render_vphud; };I made this a couple years ago and I know I did it like this for a reason, but I'm just not sure why in the if I used call and in normal execution i used spawn. Or perhaps is not even the best way to execute these functions.
We can't know either without knowing what render_vphud does 🤦
@winter rose Is there another way (particles etc) to mark friendly units with some kind of blinking on thermals?
Actually yes we can know why you used call, because spawn returns a handle to spawned script
However my doubt is that perhaps only vehicles (humans deep down are vehicles too), that have such thermal characteristics.
IR strobes are vehicles
@astral dawn My guess is that because of the if being a evaluation that needs a return and also has things depending on it, i used call because like wiki says "waits for it to finish and return"
While the rest being a normal execution not in a rush i used spawn. "Adds given set of compiled instructions to the scheduler. Exactly when the code will be executed is unknown" 🤷♂️
render_vphud is the core function of the addon, renders a hud using draw3d
Should have done it in call then
@vague geode in A2 strobes may have worked in TI, I am not sure to remember that properly
you may create a "thermal effect" drop, I don't know if they are detected by thermal, needs testing
usually, thermal thing would need an addon
@winter rose I think I found a way to get the IR strobe to show up on thermals. My only problem now is to properly synchronize the flashes of the IR strobe and the flash of the particle.
Does anyone happen to know exactly in which interval the IR strobe flashes and how long each flash takes?
"B_IRStrobe" createVehicle getPos this attachTo [this, [0.03, 0.03, 0.03], "leftshoulder"];
_null = attachedObjects this select 0 spawn {
while { true } do {
_source = "#particlesource" createVehicle getPos _this;
_source setParticleClass "MissileDARExplo";
_source attachTo [_this,[0,1.333,0]];
sleep 0.5;
deleteVehicle _source;
sleep 0.5;
};
};
either check the config… or time it ^^"
but even if you don't sync it, it's not a big deal at all
and because in MP you may have trouble sync'ing it precisely
and because when in TI, you don't see the IR flash
@vague geode
@winter rose Yeah, I know that you don't see the IR flash in thermals BUT you see the MissileDARExplo particle in night vision...
ah well
try ["\A3\data_f\ParticleEffects\Universal\Refract",1,0,1] perhaps?
@winter rose Is it possible to use a deactivated version of the IR strobe? That why I would not need to worry about synchronization at all since the IR strobe wouldn't emit anything...
What do you mean with try ["\A3\data_f\ParticleEffects\Universal\Refract",1,0,1]? Where should I put it and how do I use it?
instead of missile explosion, try a thermal deformation? I am not sure it works though (see the wiki for particle settings)
@winter rose I am sorry but I don't understand what you are suggesting nor how to do it...
@winter rose But how do I use any of that on the IR strobe? I can even find the Blinking1 effect (configfile >> "CfgAmmo" >> "B_IRStrobe" >> "NVGMarkers" >> "Blinking1") in CfgCloudlets...
you use it the same way you did _source setParticleClass, but with setParticleParams?
I do get what youre after, but do also consider this. IR strobes are not visible in most thermals
They dont output enough heat to be visible
Well, remarkably visible
Try NV for IR strobes
You could add some sort of FOFI gui for the gunner using thermals, if you want to
Like friendlies being outlined by a small box
@ebon citrus I know that they are only visible in night vision but not on thermals but making them visible on thermals is the whole point of this coversation.
I understand that you want them to, and that is fine and all, but they are realisticly not meant to
Keep on going though, if you feel like it
Let the guy have some fun 😉 Imagine the chinese invented a new tech 😛
well… yeah?
Personally, if i were to be asked to do this, i would suggest a FOFI
That would add faint bixes around friendlies
(Is this not a thing already?)
I remember there was a hud mod at some point that added tags on friendly units on thermals
I understand that you want them to, and that is fine and all, but they are realisticly not meant to
@ebon citrus I may be mistaken, but isn't thermal imaging nothing else than infrared emission measurement?
Not really
It is a very narrow band
The IR the IR beacons is the near infrared
Which is "almost visible light"
Not heat
Well, not traditional heat
This is picked up very clearly with night vision equipment
And cameras
Grnated you remove the IR filter
Infrared imaging equipment usually filters out the near infrared or doesnt sense it at all because it would generate so much noise that it would make all the other readings useless
There are some 4th gen(?) NV equipment that combine both infrared and night vision in a smart way
Not my field of expertice, though
So dont quote me on this
aaanyway, can we do this with #arma3_scripting
kicked the ants' nest and leaving, thanks!
@winter rose I still don't get how I can use that on the IR strobe. What I am doing in the code I send you is creating a completely new particle source and then adding the MissileDARExplo effect on it. Are you suggesting I handicraft a new particle by bodging together certain parts that are already existing?
@ebon citrus "Thermographic cameras usually detect radiation in the long-infrared range of the electromagnetic spectrum (roughly 9,000–14,000 nanometers or 9–14 µm) and produce images of that radiation, called thermograms." https://en.wikipedia.org/wiki/Thermography
@vague geode I am saying "don't use a particle class, but define it with params" yes
Ok, as i have been tagged to the topic i am back
Yes, they detect infrared in a soectrum which does not include the near infrared
Near infrared is at 780-2500nm
Far below 9000nm
The point is that near infrared is not actually heat
Hot objects, unless INCREDIBLY HOT, dont emmit Near infrared
@winter rose i didnt kick the ants' nest, i simply pointed out a fact, offered an alternative solution and saw myself the opportunity to go and take a shower because my solution was not suitable
showers are forbidden for #arma3_scripting crew members, you should know that
"programming" socks right 👀
@winter rose Ok, I think I get what you are suggesting now but I fear that's a bit beyond my understanding and as such my capabilities...
@ebon citrus Ok, but assuming someone would make an IR strobe that would emit infrared light in an electromagnetic spectrum of 9,000–14,000 nanometers it would show up on thermals, wouldn't it? And if that's possible why wouldn't someone want to give that equipment to their men for use when danger close air support e.g. by an AC-130 in needed?
what I get is you want to do something like the COD Modern Warfare AC130 mission yeah
@winter rose Yeah, kinda, but not that clear since that would make it even more unrealistic, wouldn't it?
well, I think there might be a way (not 100% sure of TI without IR thing)
@vague geode the thing with your missile thing that you can see in NVGs, why not simply remove the whole IR strobe?
@vague geode we're a bit offtopic-ish soon. If yiu want to continue this in DMs, im more tham happy to do that.
@winter rose Yeah, I could do that. I also realized that using the MissileDARExplo effect isn't ideal because if you move you have a fire trail behind you. Not to great. I would need to disable physics effects on that particle effect.
@ebon citrus No need.
Alright. I'll keep it simple without dwelling into the physics too much. We dont, because we cant
Or rather the drawbacks outweigh the benefits
@winter rose Basically I am locking to make something like this: https://youtu.be/H7qutmDYaQI
so it's technically doable 😁
So how do you force addAction to move with a piece of player equipment? Right now I have a vest on the ground, but when it's picked up, the Action remains where the vest was
did you add the action to the ground holder by any chance?
I created a vest in 3d3n, gave it a variable name, then addAction in the init box
Something tells me this is wrong...
Okay
3den
l33t 3ng1n3s!
okay enough of that, i don't know anything about ground holders, but i will go read
it's an (invisible) object that shows what it contains
the vest itself is not an object, in a way
okay
the player who wears the vest is the object that should have all the actions imo
and just conditions to show them when the vest is loooked at on groumd or when it is worn
@young current I thought about doing it that way, but it seemed more complex then just doing addAction on the vest
no can do, "add action to the vest"
wait, unless I am mistaken, hold on
try sqf vestContainer player addAction [...]perhaps?
I doubt it would work but worth a shot
I doubt it too - also not sure it would remain after dropping/taking
for a vest it would be vestContainer instead 😉
ah yes, bad copy/paste 😛
yeah, that doesn't seem to work
back to the drawing board
i'll just add to the player and remove upon donning/doffing
u can play with take/put event handlers, and save action data on the holder with setVariable or something.
If you limit access to what gear players can wear, you could designate a specific type of vest not available anywhere else, and just add the action to all players with a condition of wearing that type of vest
this is what I thought was the case to begin with
What i did is almost exactly that Raynor, and then removed the action when they no longer had the vest
I used a Rebreather, which is available nowhere else than this one location
Using the action condition to only show it when the player is wearing the vest is much better than having custom add/remove logic. It's essentially foolproof and is technically much simpler.
is deleting a module not as simple as deleteVehicle?
it is, but its effects may remain 🙃
if you can avoid, avoid
I don't know how this one works, and you could always find a weird workaround but script it if you can
how do I create an object at player position but on the sky?
getPosATL player vectorAdd [0,0,500]
```@sacred turret
yes, you would need to create a parachute vehicle first then move the guy in driver (unless it's an object?)
player setPos ((getPosATL player) vectorAdd [0,0,500]);
private _chute = "Steerable_Parachute_F" createVehicle [0,0,0];
_chute setPos (getposATL player);
player moveInDriver _chute;
@sacred turret You can also modify this script to create parachutes on the player: http://killzonekid.com/arma-scripting-tutorials-epic-armour-drop/
ok, thank you guys
I am trying to figure out how to create a module and then later delete the module, could anyone help me figuring out how to delete the module? The part that creates the module is already created and working just fine:
private _moduleGroup = createGroup sideLogic;
"Ravage_Hordes" createUnit [getMarkerPos "cap_test_spawn", _moduleGroup,
"
this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];
"
];
Missionnamespace seem to provide a solution
use the primary syntax of https://community.bistudio.com/wiki/createUnit, so you can get the reference of the created module
Hmm, im trying to fiddle around but I cant get it to work. I should note that I'm putting this in a trigger and I am putting the delete part in something else
I was not really clear about that part ^ because that changes some thing I guess
The whole idea is to have a ravage zombie horde placement spawning in at a certain moment and then deleting that horde placement as the player.. turns a lever or something
you won't obtain that by deleting the module I'm afraid, unless it is specifically built for this behaviour
How about setVehicleVarName on the module's init?
what about that?
Well, having that on the init of the module EG: this setVehicleVarName "_DelModule"; and then deleting with deleteVehicle _DelModule;
its probably not that easy though
Ah and well yeah... deleting the module probably doesnt work but still worth a try
yep forget about setVehicleVarName, it's not its usage
That's a bummer
In that case i have absolutely no clue on how to get this working XD Unless I manually put in a horde of zombies or make a horde spawn script.
The thing is with manually spawning the zombies their behavior is quite odd. My guess is that they are missing a init
u can look at the functions they run, and see if you can find some ways to access the emitters/whatever, people usually setVariable stuff on the logic itself
that's a good idea, thanks for the tip
well, there we have it: rvg_fnc_horde_spawn {};
And I give up on that, instead I will be putting the ravage module somewhere in the middle of nowhere sky and use MoveTo to re-locate it to the place it needs to be, hacky but maybe it works
a module is only a non-physical object on which scripts are applied – if the scripts are not planned to deal with this object later, it is useless; many modules can be spawned then deleted
but moving the virtual object will not relocate your zombies
unless your module has a script which will also add waypoints around itself for AI to move to
In that case, could you show me how to create the module by trigger 1 and remove the module by trigger 2 because I've hit a brick wall
I just have no clue on how to reference, when a module is pre-created it's the variable name but I've tried setting this without any luck
deleteVehicle will delete the module.
maybe not its effects.
Tested it and well yeah that happeens
Thanks a ton for the help 🙂 I
I'll be using individual AI's instead
does anyone know if magazines and magazinesDetail always order the items the same way?
im trying to find out magazine id and cr from just knowing the class name
@tough abyss what's the purpose?
And no, as soon as the inventory is altered, the order can change
UseMagazine action requires magazine id but I only have magazine class
Different types are always ordered the same
currently I'm counting the index of the magazine from magazines player then use that index to get magazine id from magazinesDetail
Ehhh
i'm aware the order can change but I just need the ordering to be the same between magazines and magazinesDetail
Why not just get the id with the classname
what do you mean
Get the name of the magazine from its config and look for a matching string in the magazineDetails list
Then fetch the ID from that entry
what if there's two types of magazines with the same display name?
Then it doesnt matter, does it?
And you shouldnt have 2 magazines with the same name unless they fill the same purpose
And you can use https://community.bistudio.com/wiki/loadMagazine instead
Localisation is accounted for
Since the names come from the same stringtable
I kinda need to magazine to be fired off immediately since I'm dealing with explosives
loadMagazine only loads the magazine doesnt it?
how would I fire it after it's done?
just call fire?
Any of the 1000000 commands to fire a weapon, yes
You can even dictate the magazine to fire with fire
Some of them work better than others
So keep that in mind
hmm this looks a lot better, thanks!!
position is the exact positon of object? e.g. "Sign_Arrow_F" createVehicle (position player); The arrow is not the my position. https://cdn.discordapp.com/attachments/284252397306380288/741508153656737862/20200808130631_1.jpg
@quasi rover check the description if createVehicle
You forgot to dictate CAN_COLLIDE
CAN_COLLIDE or use setPos after spawning
Oh I see. thanks guys, I never thought of it.
Is there a way to have a field pop up and have the player input text (or a number in my case)?
Yes, see dialogs on the wiki
Good luck! 👍
What a... useless calculator lol
Someone posted it yesterday in a memes channel and i find it absolutely hilarioud
Need that in arma
#arma3_gui may help you then 😉
Currently in a train, will look into it asa i get home
Should just say you're a manlet with that input
I need some help with High Command. I'm adding groups to player's high command dynamically, using hcSetGroup. However, I noticed this doesn't work well if the player isn't synced to a HC Commander module. Without that, the newly added HC Groups don't have an icon, and the player can't give orders to them. Do anyone knows what does the HC Commander module do, and if there's a way to replicate it with scripts? (So I don't need to add an HC Commander module to every playable unit)
Should just say you're a manlet with that input
@austere granite
I thought about that but the whole joke is that the calculator does absolutely nothing.
so if he has a commander module all is fine? even if you add groups mid mission?
@tough abyss yeah. If I place a commander module synced to the unit, adding groups to the units HC works fine. Without the module, HC doesn't work. I'm trying to find a way to make it work without the module. I assume that module executes some init function or something like that, but I don't know what exactly.
hmm after experimenting a bit, this is what I came up with:
private _logicGroup = createGroup sideLogic;
private _HQModule = _logicGroup createUnit ["HighCommand",position player,[],0,"NONE"];
private _HQModuleSubordinate = _logicGroup createUnit ["HighCommandSubordinate",position player,[],0,"NONE"];
_HQModule synchronizeObjectsAdd [player,_HQModuleSubordinate];
Since modules are logic objects, they need to be created with createUnit. I put them on a logic group. The "HighCommandSubordinate" is necessary because adding only a "HighCommand" makes nearby groups automatically join the player, which usually means your own group is shown in the HC Bar.
That works. I just need to check if there isn't another HighCommand module attached to the player to avoid duplication. Thanks!
is it possible to recreate ttt? i just need something that randomly select one player to be the traitor and the other innocents
ttt?
trouble in terrorist town
someone get selected to be the killer
everyone has the same weapon
ah, I don't know that ^^ but for your question:```sqf
private _killer = selectRandom playableUnits;
Ty so much you are my lord and saivor
sorry, where should i put it and how do i know if i am the selected player? 😅
Init.sqf right?
it depends ^^
initServer.sqf I would say, as the server should be the one taking decisions
Nah
I actually scripted this gamemode
it's a very old gamemode
Ah Okay
teach me master
Uh i might even find the mission. I dont think its usable out of the box
But you can look over the code
Assuning that i find it
Oki
Iirc i made a flag with an addaction that teleports ppl into the zone and then randomly spawned lootcrates and premade locations
so if you spawned in a location you where the traitor?
I think everyone gets teleported to a semi random pos and after 2 minutes the traitor gets a hint that he is it
do you remember how you did the hint thing?
remoteExec?
I cant find it
private _killer = selectRandom playableUnits;
sleep 3;
["you are the killer."] remoteExec ["hint", _killer];
["you are not the killer."] remoteExec ["hint", - owner _killer];
Its probably lost to the void but in theory not to complicated
The random lootcrates were the most complicated tjing i guess
private _killer = selectRandom playableUnits;
sleep 3;
["you are the killer."] remoteExec ["hint", _killer];
["you are not the killer."] remoteExec ["hint", - owner _killer];
@winter rose I'll try this now!
tell me when it does*(n't)* work ^^
my pleasure
note that it might hint both cases if there are AI and the server is a player
if it's no AI, perfect
No ai just 7 italians with guns
the recipe for a catastrophe 😛
hahahahaha
anyone knows a way to prevent switching effective commander on a vehicle? besides reassigning it to the driver all the time
I have a group of drivers under HC control, and if the player is inside one of the vehicles (and no other unit is inside besides the driver), that vehicle will refuse to follow its commander orders, because the player is now the effective commander, and can control the vehicle with AWSD
as soon as the player leaves, the vehicle moves again
I need to find a way to lock the effective commander to the driver
give him a higher rank
hmm that didn't work. The gunner always becomes the vehicle effective commander, regardless of its rank
the only way I found to make the AI ignore the effective commander, is to reassign the driver as commander every time someone enters the vehicle (that's when the commander is recalculated)
maybe if I could detect when someone enters the vehicle, I could reassign the driver automatically
@winter panther Errrr..... https://community.bistudio.com/wiki/setEffectiveCommander ?
yeah, I ended up adding an ACE option to the interaction menu, to execute that command. The problem is that the effective commander is overriden every time someone gets in or out, and it gets recalculated. I was looking for a more automatic solution, but I didn't want to make a mess of event handlers or while loops, so I added that option.
Ok so it is not preventing engine from calculating it? I could not be sure because of the last line of the explanation in page.
I'm adding ACE options to convert squad units to High Command groups, so I can make vehicle convoys on demand. That's why I needed the driver to stay as effective commander at all times.
You can just use an getIn event handler(it is triggered upon someone goes inside the vehicle) and setEffectiveCommander when that handler is triggered.
yeah, it sets the current effective commander, but it doesn't prevent the engine from recalculating it sadly
That would be the correct approach, not a mess.
yes, and you are saying it is calculated every time someone goes in.
so in that case, you can just put an event handler, and execute the command each time engine changes the effective commander.
same thing for when someone gets out as well.
yeah I tried that approach, but I didn't want to think of all the conditions in which the event handler should stop working haha, so I added a manual option instead. But yeah I should probably do that
You care about a specific vehicle or you want player to become effective commander every vehicle he gets into?
nah, I added an ACE option to move selected units from your squad, to an HC group. If those units are inside a vehicle, I make them stay there, and if there's more than one, it becomes a convoy. The idea is to make the convoy ignore player commands, and only follow the group leader orders
otherwise, any vehicle where a player is gunner will refuse to follow the convoy
so you want player not to become effective commander, just a gunner?
all that is done the moment the new group is created, so only those vehicles should be affected. An event handler should do the trick
I didnt understand how ACE option is relevant to that at all.
yeah, I want to make it so if players get in/out of those vehicles, they won't be able to control them manually
the ACE part is irrelevant. I just mentioned it to explain what I was trying to do
I'm also worried about locality. I'm pretty new to Arma scripting so I don't know much about how that stuff works. If player A executes the ACE action, creating the convoy, and the event handler is created there, what happens if player A disconnects? will the event handler still run? The wiki seems to indicate it won't
is it multiplayer?
yes
event handler runs based on where you put, if it is on player, it will be destroyed, if it is on another object, it will remain..
<vehicle> addEventHandler ["GetIn", { //<vehicle> is ur vehicle variable.
params ["_unit", "_role", "_vehicle", "_turret"];
[_vehicle, driver _vehicle] remoteExec ["setEffectiveCommander", 0];
}];
that should be as easy as it is , if I did not misunderstand.
yeah, that should work. However, the getIn event handler doesn't work when changing seats apparently
and I'm pretty sure Arma recalculates the effective commander there too
ah nice
write the same for these too, then :P
you got example, time to practice :)
it is based on the vehicle, so no locality issue either, dont worry.
thanks Talya! you helped me a lot 🙂
Oh and yeah, the object inits are run on every machine but this is enough this to be run on server, so you might wanna write it somewhere properly. Guess missionmakers prefer init.sqf etc. so you may use it. I dont know though, I hate adding extra files for scripts and usually use game logics. So up to you I guess.
@winter panther I just read it properly, it has to be run on every machine , this particular command so updated the code to do that.
So.. I am working on a lootspawn script and I need you guys to give your two cents:
The problem is I am getting errors that _muzzle, _optics, etc are not defined. I have no idea why or what could cause this.. here is the script snippet that throws the error :
_weapon = _weaponArray call BIS_fnc_selectRandom;
_compatibleItems = [];
_MuzzleSlot = getArray (configFile / "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "compatibleItems");
_Muzzle = selectRandom _MuzzleSlot;
_CowsSlot = getArray (configFile / "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems");
_Optic = selectRandom _CowsSlot;
_PointerSlot = getArray (configFile / "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems");
_Pointer = selectRandom _PointerSlot;
_UnderBarrelSlot = getArray (configFile / "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "UnderBarrelSlot" >> "compatibleItems");
_UnderBarrel = selectRandom _UnderBarrelSlot;
_compatibleItems append _Muzzle;
_compatibleItems append _Optic;
_compatibleItems append _Pointer;
_compatibleItems append _UnderBarrel;
hint str _compatibleItems;
_attachment = _compatibleItems call BIS_fnc_selectRandom;
_holder = "WeaponHolderSimulated" createVehicle [0,0,0];
_holder setPos _x;
_holder additemCargoGlobal [_attachment, 1];```
` <-- this is what u re looking for.
thanks 😄
Also write 'sqf' after the first 3 of those.
oh so I should use remoteExec to execute stuff on all machines. Nice, thanks again!
@brave jewel Do every weapon have at least one compatible accessory in every category?
Oh that might be the case! Nice input, ehm so I should probably put in a failsafe right?
or you can just try running your code till you hit the lucky scenario :)
since it is random weapon ^^
hmm well this is not in my interest as it will be an mp mission and I don't want errors to show up for people 😛
Any Idea how I could make the script ignore the variable then?
check if _xxxSlot > 0 ?
I was thinking about: ```sqf
if !(_Muzzle == "") then {_compatibleItems append _Muzzle};
if !(_Optic == "") then {_compatibleItems append _Optic};
if !(_Pointer == "") then {_compatibleItems append _Pointer};
if !(_UnderBarrel == "") then {_compatibleItems append _UnderBarrel};
okay that didn't work out
{
_slot = getArray (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> _x >> "compatibleItems");
if (count _slot > 0) then {
_compatibleItems pushBack (selectRandom _slot);
};
} forEach ["MuzzleSlot", "CowsSlot", "PointerSlot", "UnderBarrelSlot"];
I forgot a lane, but u get the idea.
never worked with pushback, what does it do again?
adds an element to the end of the array
Ahh alright
Got that
Still got an error
its for :```sqf
if (_slot |#|> 0) then {
Error: Type Array, expected Number, Not a Number
oh wait you edited the code in the last second haha
😄
still says _attachment is undefined :x
{
if (_spawnchance select 4 > floor(random 100)) then //attachments
{
_weapon = selectRandom _weaponArray ;
_compatibleItems = [];
{
_slot = getArray (configFile / "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> _x >> "compatibleItems");
if (count _slot > 0) then {
_compatibleItems pushBack (selectRandom _slot);
};
} forEach ["MuzzleSlot", "CowsSlot", "PointerSlot", "UnderBarrelSlot"];
hint str _compatibleItems;
_attachment = selectRandom _compatibleItems;
_holder = "WeaponHolderSimulated" createVehicle [0,0,0];
_holder setPos _x;
_holder additemCargoGlobal [_attachment, 1];
};
} forEach _buildingPos;
and what does the hint return? Since we are working with abstract stuff here. 😅
Well the hint returns literally [] 😄
well , one more thing to add safety I believe then just like rest.
why are you even using that function while you have selectRandom?
I like to switch between both :x
half of lines are using function, half of them are using command.
You do not want to write the same command everywhere, so spicing up things huh?
Adding some different taste to your code.
I still dont see _compatibleItems empty scenario handled!
I am also afraid to ask why it keeps coming empty all the time.
I have no idea :/
Everything else in this script works except of this piece of... letters and numbers
Will you edit the code to handle empty case of _compatibleItems?
it is why _attachment becomes undefined.
Altho no compatible accessories even in that level raises suspicion about whether or not you properly receive the compatible items.
I finally understood what you meant with this xD I'm a little dummy 😄
You will get used, it just takes time.


