// Include this in the mission as a configured function, or define it on the fly from debug console.
// If in cfgFunctions, this line and the last }; are not needed.
TNRGN_fnc_missileStrike = {
// Specify your firing pos here, use getPosASL on a reference object, etc.
private _firingPos = [0,0,0];
{
private _position = [_x] call BIS_fnc_gridToPos;
private _target = createVehicle ["laser_target_classname",_position];
private _missile = createVehicle ["cruise_missile_classname",_firingPos,[],200,"FLY"];
sleep 0.1;
_missile setMissileTarget _target;
} forEach _this;
// Trigger your SAM launch, idk how you implemented it
[] spawn TNRGN_fnc_SAMlaunch;
};
/*
To use: local execute in debug or execute code module. Specify grid refs as strings. Can be used more than once.
["123456","768910"] spawn TNRGN_fnc_missileStrike
*/```
#arma3_scripting
1 messages Β· Page 74 of 1
holy shit man this looks great
so, how does this work in detail?
and what do i need to do to install this?
btw so to trigger the sam launch, i have the fnc be activated in a trigger, and the condition for that trigger is the moment the VLS fires
You can put it in the mission as a configured function: https://community.bistudio.com/wiki/Arma_3:_Functions_Library
Or you can define it from the debug console as the comments describe.
However you define it, it's designed to be run from the debug console or an execute code module, so you can tell it the list of grid references. (I could write a chat event handler so you can just type grid refs in chat but ehhhhhhhhhh)
So just take the function out of the trigger, and put it in the relevant place in the script instead.
- receives list of grid references from you
- iterating through the list:
-- converts grids to real positions
-- creates laser targets on those positions
-- spawns a missile for each position way off yonder
-- sets that missile's target as the laser target that was created
is it possible to just trigger a master trigger (which will thus trigger all the separate triggers, because i have the sam launch at random in a specific window of time)?
also heads up, my notifs are off, so please do enable ping when you reply to me
Well...how do these SAM launch triggers work?
so basically each trigger has the code to execute an sqf which will let that individual launcher start firing, there are 6 launchers in a battery, each trigger has a countdown of min 1 mid 10 and max 20 seconds so the launchers dont all fire at the same time
and also one of them which has a missile programmed to launch and smash into the ground in front of it, because its a russian s-300 
the code inside this trigger is quite simple of course
its just WR_VIC = [S3001] execVM "WR-VIC-Shoot.sqf"; i got the code from white raven
albeit slightly modified
its this
but i dont think thats super relevant
Alright, so in my script where it has the function spawn for fnc_SAMlaunch, put this instead:
// Trigger your SAM launch
[] spawn {
{
sleep (random 5);
[_x] execVM "WR-VIC-Shoot.sqf";
} forEach [s3001,s3002,s3003,s3004,s3005];
};
// and here's where you put the code that blows up s3006
// ...```
WR_VIC_Shoot.sqf should really be turned into a function, but since this is the only time it's used (....right?) this will be fine.
@sage heath forgot to ping
yeah np was just about to check anyways
so put together that would be...
// Include this in the mission as a configured function, or define it on the fly from debug console.
// If in cfgFunctions, this line and the last }; are not needed.
TNRGN_fnc_missileStrike = {
// Specify your firing pos here, use getPosASL on a reference object, etc.
private _firingPos = [0,0,0];
{
private _position = [_x] call BIS_fnc_gridToPos;
private _target = createVehicle ["laser_target_classname",_position];
private _missile = createVehicle ["cruise_missile_classname",_firingPos,[],200,"FLY"];
sleep 0.1;
_missile setMissileTarget _target;
} forEach _this;
// Trigger your SAM launch, idk how you implemented it
[] spawn {
{
sleep (random 5);
[_x] execVM "WR-VIC-Shoot.sqf";
} forEach [s3001,s3002,s3006,s3004,s3005];
// This is the code where the failed launch occurs
[s3003] execVM "WR_VIC_Shoot2.sqf";
};
};
/*
To use: local execute in debug or execute code module. Specify grid refs as strings. Can be used more than once.
["123456","768910"] spawn TNRGN_fnc_missileStrike
*/```
correct? @hallow mortar
You don't need to [attempt to] forEach the failed launch code, since there's just the one of those.
[s3003] execVM "WR_VIC_Shoot2.sqf";```
also uhm im really sorry but...i dont know how to put this in the cfgfunctions in the description.ext
right
Does your description.ext already have a cfgFunctions?
nope
Okay, simples then
First, take out the TNRNG_fnc_missileStrike = { line at the start, and the very last };. Those are only used for on-the-fly defining the function.
Now save the whole thing as fn_missileStrike.sqf in a folder called functions, inside your mission folder.
Then in your description.ext:
class CfgFunctions
{
class TNRGN
{
class functions
{
file = "functions";
class missileStrike{};
};
};
};```
and thats it?
yarp
so to run this in the op, i do what in the debug editor?
Do you see the comment at the bottom of the script?
ahhhhh this
["123456","768910"] spawn TNRGN_fnc_missileStrike
right XD i completely missed that
Make sure you hit local execution
also i assume i need to fill out laser_target_classname and the cruise missile one
Yep
how many missiles does this spawn per target?
One
Yep, just a minute
cuz if not im down to skip that part
thanks! meanwhile ill get that classname figured out
hey btw, you should publish this on the workshop people would love it
also in the classnames in cfg vehicles, there are 2 weapon classnames, LaserTargetEBase and LaserTargetE do you know whats the difference between these two?
Not really, but base classes are usually designed to be logistical elements that are just used internally for config inheritance. To be sure, use the one that's not base.
and for the cruise missile, im using a mod where it allows SPAAGs to target and shoot down TLAMs https://steamcommunity.com/sharedfiles/filedetails/?id=2880553405&searchtext=anti+missile
this one, im creading the config cpp rn to figure out if its a different one from base game
right
im not sure if im allowed to redistribute the config cpp doh so you can see too
You can probably just use the base game cruise missile, no one will notice. Unless you want the missiles to get shot down.
i do
which this mod handles
so basically
but honestly
lets just get it to work first
we'll worry about this later
since if its not possible, ill try to figure it out, or ill fake it
Replace the appropriate forEach with this:
{
private _position = [_x] call BIS_fnc_gridToPos;
for "_i" from 1 to 2 do {
private _target = createVehicle ["laser_target_classname",_position];
private _missile = createVehicle ["cruise_missile_classname",_firingPos,[],200,"FLY"];
sleep 0.1;
_missile setMissileTarget _target;
};
} forEach _this;```
what does that do?
Makes it fire two missiles per target
ah, gotcha
Also, whichever dev decided back in like 2012 to have LaserTargetE be BLUFOR and LaserTargetW be OPFOR is an actual maniac
so this is the .sqf file in total
// Specify your firing pos here, use getPosASL on a reference object, etc.
{
private _position = [_x] call BIS_fnc_gridToPos;
for "_i" from 1 to 2 do {
private _target = createVehicle ["laser_target_classname",_position];
private _missile = createVehicle ["cruise_missile_classname",_firingPos,[],200,"FLY"];
sleep 0.1;
_missile setMissileTarget _target;
};
} forEach _this;
// Trigger your SAM launch, idk how you implemented it
[] spawn {
{
sleep (random 5);
[_x] execVM "WR-VIC-Shoot.sqf";
} forEach [s3001,s3002,s3006,s3004,s3005];
// This is the code where the failed launch occurs
[s3003] execVM "WR_VIC_Shoot2.sqf";
};```
is this correct?
just BI things
Missing the line defining the launch position
whoops
// Specify your firing pos here, use getPosASL on a reference object, etc.
private _firingPos = [0,0,0];
{
private _position = [_x] call BIS_fnc_gridToPos;
for "_i" from 1 to 2 do {
private _target = createVehicle ["laser_target_classname",_position];
private _missile = createVehicle ["cruise_missile_classname",_firingPos,[],200,"FLY"];
sleep 0.1;
_missile setMissileTarget _target;
};
} forEach _this;
// Trigger your SAM launch, idk how you implemented it
[] spawn {
{
sleep (random 5);
[_x] execVM "WR-VIC-Shoot.sqf";
} forEach [s3001,s3002,s3006,s3004,s3005];
// This is the code where the failed launch occurs
[s3003] execVM "WR_VIC_Shoot2.sqf";
};```
also
is it ok if i switch out the firing pos to anywhere on the map?
say my VLS is in 222,222,100 instead
i just plug that in correct?
Yes
The missiles are created in a ~200m radius around the specified position to provide a nice spread
good, TLAMs are usually programmed to come in from different directions to blindside enemy radars
also i have no idea what the classname for the cruise missile is
ammo_missile_cruise_01, I believe
btw i figured out how the mod works, it basically creates a UAV which is embedded inside the TLAM everytime one is fired, which allows for it to be shot at, so the base game classname should do(?)
if im reading the code right
I don't know, maybe
No idea. Grid-to-real is handled by a BIS function.
rip @hallow mortar
sqf
// Specify your firing pos here, use getPosASL on a reference object, etc.
private _firingPos = [15441,10577,203];
{
private _position = [_x] call BIS_fnc_gridToPos;
for "_i" from 1 to 2 do {
private _target = createVehicle ["ammo_missile_cruise_01",_position];
private _missile = createVehicle ["LaserTargetE",_firingPos,[],200,"FLY"];
sleep 0.1;
_missile setMissileTarget _target;
};
} forEach _this;
// Trigger your SAM launch, idk how you implemented it
[] spawn {
{
sleep (random 5);
[_x] execVM "WR-VIC-Shoot.sqf";
} forEach [s3001,s3002,s3006,s3004,s3005];
// This is the code where the failed launch occurs
[s3003] execVM "WR_VIC_Shoot2.sqf";
};```
wait
oh im dumb
i swapped the laser and cruise missile classnames
Not the source of the error though
then what do you think it is?
on a plus side the s-300 works like a charm
I'm thinking. I haven't spotted it yet.
oh I know what it is. Wacky output from BIS_fnc_gridToPos. Ugh.
Do you use CBA?
Okay, instead of [_x] call BIS_fnc_gridToPos, use _x call CBA__fnc_mapGridToPos
That will provide a functional return, and also definitely works with whatever length of grid you like.
sick
// Specify your firing pos here, use getPosASL on a reference object, etc.
private _firingPos = [15441,10577,203];
{
private _position = [_x] call CBA_fnc_gridToPos;
for "_i" from 1 to 2 do {
private _target = createVehicle ["LaserTargetE",_position];
private _missile = createVehicle ["ammo_missile_cruise_01",_firingPos,[],200,"FLY"];
sleep 0.1;
_missile setMissileTarget _target;
};
} forEach _this;
// Trigger your SAM launch, idk how you implemented it
[] spawn {
{
sleep (random 5);
[_x] execVM "WR-VIC-Shoot.sqf";
} forEach [s3001,s3002,s3006,s3004,s3005];
// This is the code where the failed launch occurs
[s3003] execVM "WR_VIC_Shoot2.sqf";
};```
this should be correct
testing now
Not [_x], just _x
oops
shit
and thats why i send these code samples back XD
@hallow mortar i dont believe i see a cruise missile spawned, and its been about 90 seconds (usual flight time of the missiles) and one hasnt hit yet
ill wait a bit more
wait!
nope! they do spawn...but uhm
they're heading the wrong way
Right, well, that's a start
I hoped they would be smart enough to lock on no matter the direction, since they can do vertical launch, but hey ho
Add this immediately before the setMissileTarget line:
private _dir = _missile getDir _target;
_missile setDir _dir;
_missile setVelocityModelSpace [0,200,2];```
yeah they just head straight north
rgr
// Specify your firing pos here, use getPosASL on a reference object, etc.
private _firingPos = [14681,10889,477];
{
private _position = _x call CBA_fnc_mapgridToPos;
for "_i" from 1 to 2 do {
private _target = createVehicle ["LaserTargetE",_position];
private _missile = createVehicle ["ammo_missile_cruise_01",_firingPos,[],200,"FLY"];
sleep 0.1;
private _dir = _missile getDir _target;
_missile setDir _dir;
_missile setVelocityModelSpace [0,200,2];
_missile setMissileTarget _target;
};
} forEach _this;
// Trigger your SAM launch, idk how you implemented it
[] spawn {
{
sleep (random 5);
[_x] execVM "WR-VIC-Shoot.sqf";
} forEach [s3001,s3002,s3006,s3004,s3005];
// This is the code where the failed launch occurs
[s3003] execVM "WR_VIC_Shoot2.sqf";
};```
code check
Yep
Even if they appear to head the right way, watch them all the way to the target. This will make them go the right way even if they don't lock, so you need to verify they do actually dive and hit on target.
yeah nope on that part, they did fly the right way
btw this is the code i put into the console
["12191270"] spawn TNRGN_fnc_missileStrike```
Yeah you're invoking the function fine, it's obviously a valid position since they're going the right way
but why arent they hitting...
They're not acquiring the laser target.
They should be able to, since it's, you know, how they work...
hmmm
Try adding some sleep after setVelocityModelSpace and before setMissileTarget. At least 1, up to...most of whatever the flight time to target is (like 15 seconds before they arrive over the target)
imma try 10
oh uhhhh...this is going to cause each subsequent missile to be delayed by that much. That can be fixed later, just test the guidance on the first one for now.
im just cycling through the numbers from 10 to 1 in descending order
this'll take a whiel
Start at 10 and go higher if it doesn't work. The closer they get to the target before the setMissileTarget happens, the better the chances of successfully locking.
(If this is indeed the problem)
flight time is about atleast 10 to max 16 seconds, thats from one end of the airfield to the other
nah, tried 10, 12, 14, thing just flew right by
the flight time to that target was 14 seconds
In my experience, the laser target has to be on the data link for the entire flight duration. Otherwise the missile heads towards the laser target (or where it used to be) but it never attacks the target; just passes over it and continues in the direction indefinitely.
However, I only have experience with cruise missiles that were actually launched by a VLS, not created with createVehicle.
i was gonna suggest this, is it possible to...create a list of targets i punched in, and have vls go after them?
Can you add systemChat str missileTarget _missile; right after the setMissileTarget? And tell me what it says
sure doing it now
Ah and I also just remembered: Laser targets don't exist for long if they don't belong to a laser designator. Attach the laser target to something (and manually delete it once you no longer need it) to keep it from despawning automatically.
<Null-object>
How long is the sleep on that?
14 seconds
Okay, try it with like 1. The target could've despawned by then / missile could be too close
gotcha
If we can get a positive return on this, then the missile can do it but the target is despawning before it gets there, and that's an easy fix
Yes, that's what I mean.
it returns 2 null objects XD
That's probably the next missile
yep
Okay, so it seems like the missile can't remotely acquire laser targets, which is uhhhhhh a pain in the ass
You would think that a laser-guided missile would be able to have its target set to a laser target, using the dedicated target-setting command, but oh well
lets hope it gets better in arma 4
The VLS is just special π
I'm borrowing some of Marko's previous code to modify this to use a real VLS
Go ahead and place a VLS somewhere convenient, and give it a variable name
π already did
actually I have this mostly done but can you do something for me first
change laserTargetE to laserTargetW and test it
gotcha, i have a question for you too btw, if i try and find the classname of the object spawned in by a mod that is not accessible via eden, how would i do that
If you can find it in the world and look directly at it with your man eyes, you can use typeOf cursorObject
If you have a rough idea of what it might be called, you can open the Config Viewer from the Editor tools menu and browse CfgVehicles for it
You can also try looking for the mod's functions in the Functions Viewer; if you can find where it's created, the classname will be there.
well that'd be hard its a cruise missile
also im in the mods config.cpp
Then it would be in CfgAmmo
would it be kosher if i post it here?
also
im not even sure if its a cruise missile
since the mod may work on the basis of attaching a target to a base game missile
tested with sleep 1 and 13, both still null object
I suspect it modifies the event handlers of the ordinary missile rather than introducing a new one
In my experience the side of the laser target does not matter. It just needs to be reported on the correct data link.
ansin, you've probably been around more than me, whats the precedent on this?
also you're proabably correct on this one
testing it now
line 19 as well and 21
well you're supposed to replace that with the actual variable name of your VLS (or change the name to that)
that's my fault
its fine~
My understanding of intellectual property is very limited, but I'm pretty sure that you can only share third-party code as permitted by the license that the code is under.
Unfortunately, this is frequently ignored in this channel.
[TNRGN_veh_VLS,[_target]] remoteExec ["fireAtTarget",TNRGN_veh_VLS];```
I think you can figure out which line this replaces
luckily, if we use the vls fires at the targets instead of spawning them in, this ensures compatibility
thats weird i cant find the non functional line in the error in the sqf
but
i assume its like this?
/*
Function for causing a VLS to shoot at grid references. Hopefully.
To use: local execute in debug or execute code module. Specify grid refs as strings. Can be used more than once.
["123456","768910"] spawn TNRGN_fnc_missileStrike
*/
{
// Create target at position converted from grid
private _position = _x call CBA_fnc_mapGridToPos;
private _target = createVehicle ["LaserTargetW",_position];
// Create a dummy object to attach the laser target and force persistence
private _dummy = createVehicle ["Land_InvisibleBarrier_F",_position];
_target attachTo [_dummy];
sleep 1;
// Make sure everyone knows about the target
west reportRemoteTarget [_target,300];
_target confirmSensorTarget [west,true];
for "_i" from 1 to 2 do {
[gunner TNRGN_veh_VLS,_target] remoteExec ["doTarget",TNRGN_veh_VLS];
sleep 3;
[gunner TNRGN_veh_VLS,_target] remoteExec ["fireAtTarget",TNRGN_veh_VLS];
[TNRGN_veh_VLS,[_target]] remoteExec ["fireAtTarget",TNRGN_veh_VLS];
};
// Clean up targets and dummies after a reasonable delay
[_target,_dummy] spawn {
sleep 180;
{
deleteVehicle _x;
} forEach _this;
};
} forEach _this;
// Trigger your SAM launch
[] spawn {
{
sleep (random 5);
[_x] execVM "WR-VIC-Shoot.sqf";
} forEach [s3001,s3002,s3006,s3004,s3005];
};
// Oops!
[s3003] execVM "WR_VIC_Shoot2.sqf";```
It's line 21. It looks different because it's showing it after going through the remoteExec.
And you did not replace the right one :U
dammit!
i was close, its line 22
/*
Function for causing a VLS to shoot at grid references. Hopefully.
To use: local execute in debug or execute code module. Specify grid refs as strings. Can be used more than once.
["123456","768910"] spawn TNRGN_fnc_missileStrike
*/
{
// Create target at position converted from grid
private _position = _x call CBA_fnc_mapGridToPos;
private _target = createVehicle ["LaserTargetW",_position];
// Create a dummy object to attach the laser target and force persistence
private _dummy = createVehicle ["Land_InvisibleBarrier_F",_position];
_target attachTo [_dummy];
sleep 1;
// Make sure everyone knows about the target
west reportRemoteTarget [_target,300];
_target confirmSensorTarget [west,true];
for "_i" from 1 to 2 do {
[gunner TNRGN_veh_VLS,_target] remoteExec ["doTarget",TNRGN_veh_VLS];
sleep 3;
[TNRGN_veh_VLS,[_target]] remoteExec ["fireAtTarget",TNRGN_veh_VLS];
[TNRGN_veh_VLS,1] remoteExec ["setVehicleAmmo",TNRGN_veh_VLS];
};
// Clean up targets and dummies after a reasonable delay
[_target,_dummy] spawn {
sleep 180;
{
deleteVehicle _x;
} forEach _this;
};
} forEach _this;
// Trigger your SAM launch
[] spawn {
{
sleep (random 5);
[_x] execVM "WR-VIC-Shoot.sqf";
} forEach [s3001,s3002,s3006,s3004,s3005];
};
// Oops!
[s3003] execVM "WR_VIC_Shoot2.sqf";```
lets give this a shot?
I recommend not posting the whole thing here every time you change a couple of lines, it does clog up the channel. That's why I sent it as a file once it started getting large.
Outstanding
π₯³
ill send you the fireworks show
at this point
you deserve to see it
Hello party people
Bit of weird one, please can anyone help:
(Abridged code)
InitPlayerLocal.sqf
player addAction ["Readbox", {
["Func\read.sqf"] remoteExec ["execVM",2];
}];
player addAction ["SaveBox", {
["Func\Save.sqf"] remoteExec ["execVM",2];
}];```
save.sqf
```SQF
containerIDs = [TOC_1]; // Define container/box variable names
vehicleIDs = []; // Define vehicle variable names
containerData = []; //Init storage array
vehicleData = [];
{
_x params[ "_vehicle" ];
containerData pushBack [ _vehicle ];
format ["%1", _vehicle] remoteExec ["hint", 0];
}forEach containerIDs;
profileNamespace setVariable ["TertioSavedContainers", containerData];
copyData = containerData joinString ", ";
copyToClipBoard copyData;```
read.sqf
```SQF
containerData = profileNamespace getVariable "TertioSavedContainers";
{
_x params[ "_vehicleID" ];
format ["%1", _vehicleID] remoteExec ["hint", 0];
}forEach containerData;```
InitServer.sqf
```SQF
containerData = profileNamespace getVariable "TertioSavedContainers";
copyData = containerData joinString ", ";
copyToClipBoard copyData;
{
_x params[ "_vehicleID" ];
format ["%1", _vehicleID] remoteExec ["hint", 0];
}forEach containerData;```
When I action SaveBox I get hinted the variable name of the box as pegged out "TOC_1", and my clipboard data shows all of the stuff I want
When I action Readbox I get hinted the variableName of the box as saved to the profileNamespace var
**BUT** when I reload the mission, I get hinted <NULL-object> and my clipboard data shows <NULL-object> but shows the correct values in the rest of the array - why is this happening?
Ah so you gave up on spawned missiles and went for actual vls in the end π ?
It turned out the spawned missiles could not be manually given new targets. Why? It is a mystery.
I might add, i had issues with reportRemoteTarget and confirm sensor target. Was unreliable in multiplayer (it fired/didnt lock). My solution was to remote exec the whole shebang where vls was local.
No remote target was found by vls, when these commands were called on remote client
urgh.
Line 16 and 17 replacement:
[west,[_target,300]] remoteExec ["reportRemoteTarget",TNRGN_veh_VLS];
[_target[west,true]] remoteExec ["confirmSensorTarget",TNRGN_veh_VLS];```
btw @hallow mortar i put the S300 code in first, cause, realistically the S300 is gonna try and intercept and degrade the strike package milesssssssssss away, before that so how does that look?
cuz i put it in and uh
TLAMs never fired
also, done
What data type does the TOC_1 variable have?
TOC_1 is a crate
Object
also btw you would not believe this, when i initially started recording, no fewer than FOUR S-300 missile flew into a civilian village π and that was completely random, on the mod's part
If you want to do that, you need to put that whole block, from [] to sleep 60;, before the first {.
how does this look?
Correct
great!
Consider your timing on this btw. In this layout, the SAMs will begin firing as soon as you execute the function. Presumably, the missiles won't be detected by air defence radar the exact second they launch, so if you tell the players "just launched" and the SAMs begin firing that exact second, that will seem odd. That was why it was originally the other way around, to give a delay (albeit not a very long one) between execution and when the SAMs detect the incoming and start to engage.
oh yeah i will probably wait about...10 seconds, then trigger the actual script
then the sams launch
then the missiles hit
Okay, and what exactly do you mean by reload the mission?
but honestly i could and probably would just put sleep ahead of that, but rn, i actually reduced the sleep 60 to 1 to expedite testing
@hallow mortar then this happened...
Put , after _target
testing on local host via eden, so abort, back to eden and then join again
so line 28 looks like this?
[_target, [west,true]] remoteExec ["confirmSensorTarget",TNRGN_veh_VLS];```
Yes. My fault again π€¦
as advised previously, this is abridged code, and TertioSavedContainers contains multiple more values, it's simply the first value that is being lost, all other values are carried over.
thats fine my dude, you're already amazing
the fact that this works
sorry, launch again
So save.sqf β read.sqf (TOC_1 is there) β restart mission β read.sqf (TOC_1 has become objNull)?
ok so @hallow mortar there's an issue, the VLS refuses to fire if i put in too many targets, problem this is isnt even that many compared to what the op might look like
this is what i put in
["12251280,12231284,12151279,12171275,12271277,12191272,12291273,12141269,12221262,12171264,12061289,12031287,11991285,11961283,11921282,11861280,11791296"] spawn TNRGN_fnc_missileStrike```
TertioSavedContainers contains [ "_vehicleID", "_vehicleType", "_vehiclePos", "_vehicleDir" ], all are maintained except the "_vehicleID"
That's wrong, the grids have to be separate strings, not one long string
["12251280","12231284","..."]
Stay cool.
yeah im cool just yelling in the absurdity of all this XD
i found it humorous honestly
Also you may wanna delay inputting another target before missile is away. Otherwise launcher might get confused.
Hey, you imagined this absurdity.
There's a delay built in immediately after creating the laser target, which places it between firing and assigning next target in the loop. If it becomes an issue that can just be increased.
And also force hold fire on launcher, otherwise it will continue firing on known targets untill they are removed
Or it runs outta ammo
Well, you store a reference to a specific object in the profileNamespace. However, the original TOC_1 object no longer exists once you restart the mission. Instead, a new object of the same type and with the same variable name is created.
Thus, the reference that was stored in the profileNamespace is no longer valid, i.e. it no longer points to a valid object.
Do you understand what I mean?
ok well, im either dumb or blind cuz i punched this in
["12251280","12231284","12151279","12171275","12271277","12191272","12291273","12141269","12221262","12171264","12061289","12031287","11991285","11961283","11921282","11861280","11791296"] spawn TNRGN_fnc_missileStrike```
still nothing
grids are all solid too
Does it work if you only put one or two in?
I don't know why it would be different for larger arrays of targets. It iterates through sequentially, so even if it was getting lost or confused it should get through the first few before that happens.
If something was completely broken by having multiple targets, it should be just as easily be broken by having 2 as by having 20.
waitβ¦
ok i probably made a typo somewhere cuz suddenly it worked
btw @hallow mortar would it be possible to randomise the number of missiles fired? to simulate the potential number the S-300 could intercept, im thinking of randomizing it to anywhere from 1-4
Line 29: for "_i" from 1 to (round random [1,3,5]) do {
i think it would sound even better with jsrs, but just blastcore would have to do
Here we go:
save.sqf
containerIDs = [TOC_1]; // Define container/box variable names
vehicleIDs = []; // Define vehicle variable names
containerData = []; //Init storage array
vehicleData = [];
{
_x params[ "_vehicle" ];
_vehicleID = vehicleVarName _vehicle;
containerData pushBack [ _vehicleID ];
format ["%1", _vehicle] remoteExec ["hint", 0];
}forEach containerIDs;
profileNamespace setVariable ["TertioSavedContainers", containerData];
copyData = containerData joinString ", ";
copyToClipBoard copyData;```
InitServer.sqf
```SQF
containerData = profileNamespace getVariable "TertioSavedContainers";
copyData = containerData joinString ", ";
copyToClipBoard copyData;
{
_x params[ "_vehicleID" ];
_vehicle = call compile _vehicleID;
format ["%1", _vehicle] remoteExec ["hint", 0];
}forEach containerData;```
Done and working
_vehicle = missionNamespace getVariable [_vehicleID, objNull] might be slightly cleaner than _vehicle = call compile _vehicleID.
I see what you mean, however I am compiling the first element of an array, and it is the array that is the namespace variable,
The vehicleID is not the namespace variable itself.
@hallow mortar ok everything looks to be working now fully, no errors, and operational, i'd like to thank you, so so much man, thank you!
You're welcome
Hello, I'm using call BIS_fnc_infoText to make a small intro message for my mission
Is there any way in which I can modify the text size, font and others through this?
or in the other hand what other functions could I use to make cool mission intro texts?
TitleText supports formatting so its pretty customizable, look at last example.
https://community.bistudio.com/wiki/titleText
And you could animate it i guess
Can anyone give me even a passing example of the correct syntax to RemoteExec a createDiaryEntry?
The wiki has many examples of how to invoke it locally but I need it globally for coop.
I mean, you could do that. But you are sending shitloads of text over net for no reason.
Suggest you use cfg function and define all parameters there. If you dont wanna mess with cfgFunctions you could use initPlayerLocal.sqf and define function over there eg.: my_unique_function = { player createDiaryRecord [...]; //your parameters };
And then when you wanna add record, use
[] remoteExec ["my_unique_function", [0, -2] # isDedicated, true];
okay, so, hm
But if you really wanna remote exec then { [_x, [subject, text, task, taskState, showTitle]] remoteExec ["createDiaryRecord", _x]; } forEach allPlayers;
does this unique function support sleep?
like is it scheduled even though remoteexec isn't scheduled
Yes
okay cool
RemoteExec is
so basically I need to take my current intel.sqfs and transpose them into functions
and I could somehow include them from initPlayerLocal
so they can be in their own file
thanks again marko
I think that's all the puzzle pieces
ok almost all of them
can I somehow have cfgFunctions just be its own file or does it need to be physically inside of description.ext
I need to do the same with respawninventories at this point tbh
You can #include anything from description.ext.
You could make it into one function that can add all eg: my_unique_function = { params["_s"]; switch (_s) do { case 1 : { player createDiaryRecord [...]; //your parameters }; case 2: .... };
[1] remoteExec ["my_unique_function"...
This will add first record to player when called
[2] will add second and so on
And yes you can include in description.ext, so make a new file, like CfgFunctions.hpp
That contains class CfgFunctions {...
Then in description.ext do #include CfgFunction.hpp
Or you could fragment it further, eg each tag in separate file. (Filename doesnt matter)
hpp instead of sqf?
Wait are you trying to include into sqf?
description.ext is a config file (vaguely similar to C++) not an SQF script file, so it (and files included into it) don't use the .sqf file type
I'm not trying to do anything yet.
Okay.
That makes sense.
I'm gathering as much info as I can before I do anything.
This will only work for includes into description. Im not sure you can include into sqf without some sort of precompiler.
Please dont include sqf scripts into description
So, if I have, say
JES_intel_secSysDone = {
jesterDummy sideChat "Uplink Established to Security System.";
sleep 3;
jesterDummy sideChat "Security archives downloaded.";
}``` and 4 other basic commands like that inside of **`configIntel.hpp`**
I can just `#include scripts\configIntel.hpp` and have remoteExec `JES_intel_secSysDone` work?
Ah. No
You can see I'm having troubles from my experience in other script languages, I'm having to suss out equivalent acts with things I already know
I meant the includes of cfgFunctions etc.
With what you are doing you could use compile, and make them sqf again
You use CfgFunctions to define functions as described here: https://community.bistudio.com/wiki/Arma_2:_Functions_Library
The actual function code is located in sqf files, and CfgFunctions tells the game how to detect and handle those files.
The use of #include would be so you can have your CfgFunctions in a separate file to description.ext, purely for ease of logistics and tidiness.
Okay. Hm.
Any way to have mulitple/modular cfgFunctions?
one for the intel functions, one for the other functions, etc
Ye, new tag
You can't have multiple CfgFunctions, but you can have multiple categories within it
The way you did it you could put compileScript ["my_func1.sqf"]; etc into initPlayerLocal.sqf
But i suggest learning the cfgFunctions way
So in description.ext you might have something like this:
class cfgFunctions
{
#include "taskFunctions\config.hpp"
#include "eventFunctions\config.hpp"
};```
and each of those files would contain tag, category etc layers of function config
So sorry, I just realised I linked the A2 functions page by mistake
And that way you also have scripts separated by files
And you dont have to do my_unique_function ={.. as cfgFunctions will append tags to them anywho
You can #include in sqf files btw (as long as what you're including is valid SQF), provided the script goes through the preprocessor (i.e. I don't think it works in debug console, triggers etc)
Go finger... you are right
SQF script - parsed when preprocessFile, preprocessFileLineNumbers, compileScript or execVM is used.
Interesting factoid: I don't believe #include actually cares what the file type of the included file is, as long as it's readable as plain text. It's treated as if it was part of the main file. So you can #include .txt files and they'll work fine. Using the right file types for things that are going to be included is mostly just for your IDE/syntax highlighting.
That is true, but its nice to stick to format. I just warned ash not to include sqf into description. Not cause of extension but well... sqf wont fare well in there.
I did mention file can be named anything.
This isn't totally exhaustive - SQF also goes through the preprocessor when it's compiled via being a CfgFunctions function. Engine files like init.sqf are also automatically preprocessed......[I think]
Tell that to Lou thats a quote from wiki
How do I change this to _unit setVariable ["ACE_Medical_MedicClass", 1, true]; to MenuObj addAction would I do
MenuObj addAction {"Give Medic Perms", _unit setVariable ["ACE_Medical_MedicClass", 1, true}];
You kinda screwed up the whole syntax of addAction
But menuobj addAction ["blah", {params["_obj"]; _obj setVariable ["ACE_Medical_MedicClass", 1, true];}];
Also suggestion, you could use ace menu instead of addaction
whats the ace menu code?
Yeah I know im not much of a coder just tryna make sense of it, more of a learn it on the go
Google shall answer your thirst for knowledge
Thank you kind sir
this is fascinating.
this is what I was hoping was possible! Thanks
uh, question actually
if there's guaranteed to be a unit named jester, can I have the command jester sideChat "Stand by..."; inside of a function?
or is there a scoping issue or something
Ye.
Okay cool.
Later on I'll make a better function that takes the target unit as the speaker but this'll do for now.
Hmm. And now I wonder if anyone has a good progress bar script for showing unobtrusively on the HUD
as opposed to holdaction or the ace style where the progress bar is front and center
Ready I'd just love to combine Endgame's progress bar with my timer
Anyone know how can I get the logo of the mod to which a weapon belongs?
Check how ace arsenal does it
ohhhh hmm no you can't
Why no?
intel_securityDone = {
jesterDummy sideChat "Uplink Established to Security System.";
sleep 3;
jesterDummy sideChat "Security archives downloaded."; }
Gives:
it thinks there should be a = instead of sideChat
unless I'm just calling it wrong
If u are using cfg functions u can drop intel_securityDone = {
And that is unconnected to your global variables jester and jesterDone. Unless they are simple objects in editor they are synced to all clients
Also issue is in cfgintel.hpp not the sqf script
Define away
description.ext: sqf class CfgFunctions { class AID { #include "scripts\cfgIntel.hpp" }}
cfgIntel.hpp's content: ```sqf
class JesterIntel {
intel_securityDone = {
jesterDummy sideChat "Uplink Established to Security System.";
sleep 3;
jesterDummy sideChat "Security archives downloaded."; }
intel_cdcServerStart = {
jesterDummy sideChat "Beginning download from research server...";
// Implement countdown / modem script
}
intel_cdcServerDone = {
jesterDummy sideChat "Research archives successfully downloaded.";
sleep 3;
jesterDummy sideChat "Stand by..."; }
}```
I'm implementing this hpp wrong
probably because I want to treat them like very simple code blocks when they're not
Oh... you did what i said please dont do. You are including sqf script into description ext π
Right, I need a degree of seperation here...
No, you need a degree of definition π
well yeah that's what I meant :P
I see what I"m doing wrong I think
yeahhh here it is on the wiki
ok
I didn't want every function to have to be a seperate SQF is my thing
but it looks like it has to be?
and then I call those files one at a time in cfgFunctions
Yes and no.
Since im on the phone and cant type it out, well can but wont. Lets say yes.
better to just enforce the structure
First you wanna define file="path\to\script\folder"; in 2nd line of intel.hpp
file = "scripts\intel"; aye?
And then place the scripts in that folder, calling them fn_<functionname>.sqf
okay can do
Then line 3 of intel.hpp etc
You add class <functionname> {};
(Note do not add fn_ at the front or .sqf extension)
And inside .sqf file drop the function = {code} just do code
You can later execute said function by AID_FNC_<Functionname>
π
modParams
configSourceAddonList
configSourceModList
Question: Is there a way to quickly get the number of rounds remaining in a mag currently loaded in a muzzle?
Not a efficient way, but probably getUnitLoadout or similar commands. I think we want that straightforward command, though
weaponState is probably best
Oh forgot was a thing
closest weaponstate seems to have is if the unit happens to be currently reloading
If only that command took a muzzle as an argument, then it'd be really useful.
weaponState then π
How can I check if saveloudout is on in a mission?
What saveloadout? Campaign you mean?
whoops the thing from eden enhanced I think.
but in general anything that saves loadout on respawn, is it possible to detect?
3den Enhanced? Haven't used much so...
ammoCount is returned
Yes, but you can't specify which weapon you want to test.
Syntax 3
My bad, I thought we were talking about currentMagazineDetail, and thanks I didn't spot the ammoCount in weaponState's return value.
_allExtractionLocations must be an array of strings. Markers are strings, not positions
If that really is an array of positions you could do:
{
private "_marker";
_marker = createMarkerLocal [format ["my_marker:%1", _forEachIndex], _x];
_marker setMarkerTypeLocal "mil_Pickup";
} forEach _allExtractionLocations;
Hard to tell with only one line of code.
Does anyone know the reason why player keep losing their main weapon but they kept their arsenal loadout after respawn with ACE?
This is what i'm using based on multiple threads on Bohemia and Reddit:
onPlayerKilled.sqf
player setVariable["Saved_Loadout", getUnitLoadout player];
onPlayerRespawn.sqf
removeAllWeapons player; removeGoggles player; removeHeadgear player; removeVest player; removeUniform player; removeAllAssignedItems player; clearAllItemsFromBackpack player; removeBackpack player; player setUnitLoadout(player getVariable["Saved_Loadout",[]]);
how to produce:
Enable the ACE Spectator and Vanilla Spectator will cause the main weapon not spawned with the player after death.
Keep in mind that all marker names must be unique since they are always referenced by that name.
Umm doesnt ace have this already inbuilt?
https://ace3.acemod.org/wiki/feature/respawn.html
i don't see the module. more like i can't find the module in editor.
Hmm, check addon settings. It might be there now
still not working, return me back to default loadout instead of custom one.
CfgFunctions is just a script that runs compileScript
But engine called scripts might warrant a note
how can I render the "bounding box"? or however you call the cuboid showing up when you select an entity in Eden. I'm looking for a more convenient way of highlighting stuff pickable by players during scenario
By drawing the lines using drawLine3D
Here is a snippet I use for debug purposes. Probably can be optimized for use during gameplay, for example you can cache results and drop the cache if getPosWorld&vectorDir&vectorUp changed.
#define MTV(XX,YY,ZZ) _veh modelToWorldVisual [XX,YY,ZZ]
private _color = [0,0,1,1];
private _veh = _x;
private _bb = 0 boundingBoxReal _veh;
_bb select 0 params ["_x", "_y", "_z"];
_bb select 1 params ["_xx", "_yy", "_zz"];
drawLine3D [MTV(_x,_y,_z), MTV(_xx,_y,_z), _color];
drawLine3D [MTV(_x,_y,_z), MTV(_x,_yy,_z), _color];
drawLine3D [MTV(_x,_y,_z), MTV(_x,_y,_zz), _color];
drawLine3D [MTV(_xx,_yy,_z), MTV(_x,_yy,_z), _color];
drawLine3D [MTV(_xx,_yy,_z), MTV(_xx,_y,_z), _color];
drawLine3D [MTV(_xx,_yy,_z), MTV(_xx,_yy,_zz), _color];
drawLine3D [MTV(_xx,_y,_zz), MTV(_x,_y,_zz), _color];
drawLine3D [MTV(_xx,_y,_zz), MTV(_xx,_yy,_zz), _color];
drawLine3D [MTV(_xx,_y,_zz), MTV(_xx,_y,_z), _color];
drawLine3D [MTV(_x,_yy,_zz), MTV(_xx,_yy,_zz), _color];
drawLine3D [MTV(_x,_yy,_zz), MTV(_x,_y,_zz), _color];
drawLine3D [MTV(_x,_yy,_zz), MTV(_x,_yy,_z), _color];
nice, thanks. I thought there might be a little less complicated function since it's used in editor already
I cannot find any info on how to remove them, do they disappear when _veh does not exist anymore? Is there a cap on how many can I have them?
drawLine3D only draws for a single frame, you have to do it each frame
In Draw3D MEH
right
This kind of things should be a BIS function IMO
Engine function rather
drawBoundingBox [POSITION, BBOX, COLOR]
drawBoundingBox [getPos _vehicle, 0 boundingBoxReal _vehicle, [1,0,0,1]]
Howdy @digital hollow & @south rivet, apologies for the ping but I've searched and searched and I'm stuck in a rut here and was wondering whether you two could assist based on the conversation here: #arma3_feedback_tracker message
I'm looking to disable the pilotcamera in jets as described previously here: #arma3_scripting message
There's some info about getting into pilotcamera or setting the FOV but nothing I could find about disabling it. Would the functionality spoken about in your linked conversation in a future update be able to do achieve something like this? Or would it already be possible by scripting (ie not having to delve into the config).
@meager granite i requested a drawboundingbox function not too long ago
its so needlessly tricky but so useful and commonly required
Yep, no reason not to have these functions not exposed to SQF
drawline3d in SQF probably isnt the right tool for it either
inefficient
how many lines, 12 or something
can you link a ticket to that?
does a continue inside a while loop skip the check of the while condition?
no it skips the current iteration of the loop
while cond do {
if ((round time)%2 isEqualTo 0) then {systemChat "oops"; sleep (0.5); continue};
systemChat "hi im a loop";
sleep(0.5);
};```
will skip the current iteration if time is divisible by 2 with no remainder
while { ( _cityOwner == ( _city getVariable "owner" ) ) && ( count ( _city getVariable "attackingSides" ) != 0 ) } do {
private _thisList = list _thisTrigger;
if ( ( count _thisList == 0 ) || ( ( _camp getVariable "currOwner" ) countSide _thisList > 0 ) ) then { sleep 0.1; continue; };
private _attackingSides = _city getVariable "attackingSides";
_attackingSides pushBackUnique _cityOwner;
{
if ( _x countSide _thisList > 0 ) then {
systemChat str _thisList;
_camp setVariable [ "currOwner", _x ];
private _campMarker = _camp getVariable "marker";
if ( !isNil { _campMarker } ) then {
private _markerType = switch ( _x ) do {
case west: { "b_installation" };
case east: { "o_installation" };
case independent: { "n_installation" };
default { "u_installation" };
};
_campMarker setMarkerTypeLocal _markerType;
_campMarker setMarkerColor ( [ _x, true ] call BIS_fnc_sideColor );
};
};
} forEach _attackingSides;
sleep 0.1;
};```
this loop only terminates when it's not encountering the continue, even if the condition returns false
I know for a fact that the condition is false because I have the same script run at the same time using different variables (the ones in the condition are the same though)
How to use SQF syntax highlighting in Discord
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
pls
sorry, don't post code very often
I just don't see why the loop doesn't terminate either way
the only explanation I could come up with so far is that continues skip condition checks but the wiki doesn't say anything about it and I'd assume that would be something known
seems like it has nothing to do with the continue
I'm probably just unintentionally changing my condition
thanks for now, maybe I'll be back once I know where my actual problem is and still can't fix it
how are you spawning the code and are you passing the correct variables into it
I think I found the issue
private _attackingSides = _city getVariable "attackingSides";
_attackingSides pushBackUnique _cityOwner;
this line in the loop was changing my condition so that it would never return false
I passed the correct variables, I just wasn't aware that the pushBackUnique would also change the original variable in _city
yup, that was the problem
private _contestingSides = [ _cityOwner ];
_contestingSides append ( _city getVariable "attackingSides" );
changed it to this and now it works
thanks
Best you can do for now is maybe to detect on https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#OpticsSwitch, and force the pilot back using switchCamera.
Ahh, so I'd use switchCamera to change to INTERNAL? (based on info here: https://community.bistudio.com/wiki/cameraView) I guess that would disable EXTERNAL, GUNNER, and GROUP camera views too. I'd have to discriminate against just the GUNNER view if I wanted to disable the camera (without disabling third person) right?
Also, thanks for the reply!
Hi
I'm trying to get the icons to work in my inventory
To explain exactly what I mean, it's the icon you issue in your inventory in I.
What is the issue?
The icon not showing but it doesn't show error
How do you show it?
My English
I mean that we didn't run out of text errors or something like that, which has happened to me a few times
but not in this case.
I think he wants to see the code you are using.
{
mass=20;
uniformmodel="sf\sf1.p3d";
modelSides[]={3,1};
armor=75;
passThrough=0.5;
ace_hearing_protection=0.75;
ace_hearing_lowerVolume=0.15000001;
hiddenSelections[]=
{
"camo",
"camo2",
"camo3",
"camo4",
"camo5"
};
hiddenSelectionsTextures[]=
{
"sf\tex\SF_Body_Blk.paa",
"sf\tex\SF_NVG_Base_blk.paa",
"sf\tex\SF_rail_blk.paa",
"sf\tex\AMP_P1_blk2.paa",
"sf\tex\AMP_P2_blk2.paa"
};
hiddenSelectionsMaterials[]=
{
"sf\data\SF_Body_nohq.paa",
"sf\data\SF_NVG_Base_nohq.paa"
};
picture="sf\tex\logo.paa";
class HitpointsProtectionInfo
{
class Head
{
hitpointName="HitHead";
armor=75;
passThrough=0.5;
};
};
};```
https://community.bistudio.com/wiki/CfgWeapons_Config_Reference#Picture.3D.22.5B.5C.5D.5B.pac.5D.22
Path must explicitly have a \ leading.
already asked about getting that irritating thing changed but was told too much work for too little reward
Does anybody have a working example for a DLL extension, which doesn't require Visual Studio?
I found something in Go, but it makes the game crash, because the code is obviously outdated.
Ugh i once recompiled exdb3 for 64bit on linux using gcc. But i guess you need it for windows
yeah, primarily for Windows, but gcc should be fine, no?
It should i guess
thank
Anybody know how to script a nuke UXO with gm? Is it possible?
Nuke UXO... like, the rocket but that is stuck on the ground?
Like that it goes off when you get too close or step on it? Id like to point out that would never happen. But for a sake of scenario its doable. Do you already have a nuke effect you wanna use?
"Code on unit created" in civilian presence, if it returns false, does the unit not get created?
to be fair if the bomb/warhead landed in such a way that it damaged the trigger mechanism in such a way that it is sensitive to vibrations - it could be set off by foot steps I imagine
not that I have any knowledge of nuclear weapons trigger mechanism
rule of cool for sure though
if you mean the _m setVariable ["#oncreated",onCivCreated]; i dont think the return value matters
ah yes, it seems triggers and synchronizing might do waht I want xD
it's called after the civilian is already created
GM has a nuke. So those effects.
or not-
tacops 
allPlayers select {_x distance _pos < 50 || {(_x distance _pos < 150 && {... from relevant function code 
only uses special unit classes with redefined fsm properties 
_unit spawn (_module getVariable ["#onCreated",{}]); and only spawn the provided code after the unit has been created
What about the first part of the question?
PCA_fnc_targetFinding = {
params ["_grp"];
_groupTarget = _grp getVariable ["PCA_groupTarget", ""];
_index = 0;
if (_groupTarget == "") then
{
for "_i" from 0 to count sortedArrayBlu do
{
_target = sortedArrayBlu select _i;
_trigger = _target select 7;
_connectedGroups = _trigger getVariable ["PCA_connectedGroups", []];
_noConnectedGroups = count _connectedGroups;
if (_noConnectedGroups < attacking_squads) then
{
_connectedGroups pushBack _grp;
_grp setVariable ["PCA_groupTarget", _target];
_target
break;
};
}
};
};
i want to break the for loop (and the whole function) if the condition is met and i also want to return the _traget... what would be the right wa to do this?
btw update from last night, to simulate time on target tlam attacks, i simply just doubled the script and maybe more so 2 maybe will do 4 vls will fire at the same time, which means no fewer than 2 targets will be hit at the same time
@torpid mica Well, there is breakWith.
Your for loop is overshooting by one element though.
Generally you want to use forEach for that.
@torpid mica ```sqf
scopeName "func"; // first line of the function
_target breakOut "func"; // exit the function
just a one way to do it
In this case there isn't any more function afterwards so you don't really need it here :P
thank you very much π
when i have an endless loop which cycles all elements of an array and i add elements to this array will they also be available in the endless loop?
yes
probably.. depends on how you loop, but most likely yes
Show code as example if you want a sure answer
0 spawn
{
while {true} do
{
{
} forEach bluGroups;
};
};
ofc there are many more lines of code between the forEach brakets but they would be to much for one discord message. I can post the whole code on sqfbin if needed
if you pushBack into bluGroups, it would loop over the new values too yes
even if you do it inside the forEach loop
if you do it inside the forEach loop
if it's not controlled you'll have an infinite forEach on your hand...
in this case since it's a global variable you don't need pushBack
(and it could be dangerous if it's not done carefully as I said)
it seems like iΒ΄m doing something wrong with pushBack:
if (count _groupTarget == 0) then
{
for "_i" from 0 to count sortedArrayBlu do
{
_target = sortedArrayBlu select _i;
_trigger = _target select 7;
_connectedGroups = _trigger getVariable ["PCA_connectedGroups", []];
_noConnectedGroups = count _connectedGroups;
hint str _connectedGroups;
if (_noConnectedGroups < attacking_squads) then
{
_connectedGroups pushBack _grp; // for groupDeletion do _connectedGroups = _connectedGroups - [_grp];
_grp setVariable ["PCA_groupTarget", _target];
breakWith _target;
};
};
}
else
{
_groupTarget
};
};
this code runs several times. on the first run _connectedGroups = [], but on the second iteration it should be _connectedGroups = [_grp].... but it is still empty... why?
If the array was empty at the start, it won't be written into the trigger after you pushBack
You need to setVariable it back onto the trigger because getVariable doesn't create the variable if it doesn't exist
Technically you only need to set if it didn't exist yet.. but it's easier for you to just always set it
is it possible to delete a specific entry from that array with _connectedGroups = _connectedGroups - [_grp]; when _grp is already saved in there?
Yes, but then you HAVE to setVariable definitely
Alternative, pushBackUnique? If you want to prevent duplicates
ok thank you very much i will try to implement everything into my code...
Is there a way to refer globally to the squad logo of a unit? I would like to use the logos in setObjectTextureGlobal but as squadParams only return the local path to the file that doesn't help. As the game is able to set the squad logo on every client when someone get's into a vehicle shouldn't there be a way to do the same?
hmm. spitballing here, can you getObjectTextures check the selection?
Haven't tried it yet but i suppose it only would return the local path again but let me try real quick^^
Nope getObjectTextures don't return the squad texture
I'd say no
Mhh not sure if applying it on each client locally would be worth the effort. Thought there may be a mechanism to refer to the squad files without getting the file path on each client :/
Is there any way to get what value was set withsetPlayerRespawnTime?
playerRespawnTime returns it, but only if the player is dead. I need a way of getting the current respawn time a living player, because I was to temporarily set the respawn time very high, then revert it back to what it was previously.
I will make a FT if there is no way to currently achieve this.
doesn't look like
https://community.bistudio.com/wiki/everyContainer
"Returns array of all containers (uniforms, vests, backpacks) stored in given crate or vehicle. Used for accessing containers content stored in ammo box or ground holder."
nvm you can
_ListOfContainersInBackpack = everyContainer (backpackContainer player);
backpack or vest container
Thanks will, however query answered like 2 hours ago. thanks for response though.
Question: With preprocessor command #if, what kinds of things can be used as conditions there?
The description is not precise. can only variables starting with double underscore be used as a condition?
It's not really working with variables at all.
You might do something like this, for example:
#define MYVERSION 3
...
#if MYVERSION >= 2
//some code here
#endif
preprocessor replaces later instances of MYVERSION with 3
I assume it only allows simple numerical comparisons.
Is there much overhead when you assign first variable (setVariable) to an entity? As in does it initialise the variable space somehow or are they already initialised alongside the entity? Talking about shots more specifically, I noticed that you now can do setVariable even on bullets (I think you previously couldn't?), so I'm wondering if I should do setVariable on them or use them as a key in some hashmap instead (str _projectile for a key). Not sure if I can measure it with diag_codePerformance easily, thus my question in case somebody has engine insight.
Hello,
How do I check is DLC loaded when building mission.
If I have 4 different textures and i have ability to change color of canister if DLC orange is avaible. I can do this in config or in function doesn't matter, what is easiest way, that I would use.
Hmm, use getAssetDLCInfo on some Orange DLC object?
getAssetDLCInfo ["C_IDAP_UAV_06_F", configFile >> "CfgVehicles"] => [true,true,true,true,"571710","Arma 3 Laws of War"]
[isDlc, isOwned, isInstalled, isAvailable, appID, DLCName]
So in total:
private _is_orange_installed = getAssetDLCInfo ["C_IDAP_UAV_06_F", configFile >> "CfgVehicles"] select 2;
What do you mean by "available"?
Yeah, isn't this DLC always preloaded even if you don't own it?
Does it? Haven't test. I have two accounts I have current dlc on both so I cannot test without .
I use settexture object global, there I saw path to other textures is in orange dlc.
If that is preloaded , does that mean I can use textures without owning current dlc?
Everyone has every data from First-Party DLCs (besides Contact)
Owning a DLC just "unlocks" it
Aa, awesome. Didn't know this. So I do not need to check is DLC loaded/ owned, right?
If the intention is just to access an paa, no
Technically users can uninstall DLC by unticking boxes in Steam. It's all installed by default.
Can we remove one through that nowadays?
hmm, maybe it doesn't actually get rid of anything when you do.
Ah yeah, it'll even redownload if you untick, delete & verify.
So I guess you can assume existence of DLC.
With Contact content coming to regular .PBO files doesn't that means that all the contact content will become accesable just like the other DLCs?
Of course not..
Question: Is there any way to get the height of the nearest surface under a position? Whether it be a terrain surface, or an structure surface (such as building)
Is there any way to get the height of the surface without doing a binary search?
Return Value: Array of intersections in format [[intersectPosASL,... uhm?
What is the easiest way to get a profile of all scripts executing? Looking for a sum of execution times per script, to learn what mods are causing slowdowns.
If the POS is in ASL you can just do
POS#2 - getTerrainHeightASL POS
Needs to take into account height of structure surfaces under the position as well. such as building floors.
and i still don't really understand the problem 
I'm trying to find the height of the nearest surface under a position.
so you can just run lineIntersectSurfaces [[_xpos, _ypos, _zpos], [_xpos, _ypos, 0]]; to raycast straight down and get the first intersection (with maybe selecting non-default LOD or applying some fitting logic to result selection), no?
How do I get the height from the returned surface?
"height" from what
basically i'm trying to figure out what vertical clearance there is between the surface and the position, whatever surface is immediately below a position.
height of the starting position to the intersection - you subtract their Z coordinates π€·ββοΈ
Does that return only the surface that is intersected, or its position as well?
Return Value: Array of intersections in format [[intersectPosASL,...
OOps. I'm used to seeing the return value listed near the top of the article. My bad.
it does have to allocate the hashtable on first var set
Thanks. Thought about it and once again it all comes down to running as less SQF commands as possible.
_projectile setVariable ["stuff", [1,2,3]];
```vs
```sqf
projectilesHashMap set [str _projectile, [1,2,3]];
```which is one more command
setting the first (and only) variable on projectile will use more memory, but so little that you shouldn't care
Gonna do that for each and every Fired local projectile in the game π¬
good luck
They do, thus str _projectile being unique, it has ID there
(as in getObjectID)
no netid though
well then it might be more reasonable to use getObjectID instead of str
Yeah, getObjectID returns just the number, gonna use it instead of str then
no automated cleanup with single global hashmap, though
diag_codePerformance returns same execution time for both though
Good point, no way to reliably tell when its time to clean up the hashmap, unless I store entity too. Could get 10s of thousand big through gameplay.
Well it only has to allocate a few more bytes for the str version... 
It cannot measure accureately enough, the new profiling branch one is much more accurate
as here you even need to measure single-run performance
Oh I mean for projectile setVariable, witht he single run
with str vs objectId its probably also so low difference that the old profiling cannot measure it with its millisecond precision
getObjectId also seems reverse-able with position nearestObject typeOrId 
Did 100 copy pasted str and 100 copy pasted getObjectID in a row (no for), still about the same π€
[
diag_codePerformance [{str player}, nil, 10000],
diag_codePerformance [{getObjectId player}, nil, 10000]
]
[[0.00091146,10000],[0.00042464,10000]]
Thanks! Great to see diag_codePerformance get even more useful
https://community.bistudio.com/wiki/diag_codePerformance also new parameter, I think thats also going on prof
[
diag_codePerformance [{str player}, nil, 1000],
diag_codePerformance [{getObjectId player}, nil, 1000]
]
Current Arma: [[0.001,1000],[0.001,1000]]
Next profiling/dev: [[0.0008925,1000],[0.0004305,1000]]

Running into an issue where ALiVE is virtualizing artillery shell UAV classnames created by ITC. This is an issue as that means the shells never land. The current script we've got (which is meant to exclude this class from virtualization) is running on initServer.sqf. We've got a headless client as well but I don't think that should affect things. Just to sanity check that the script is written correctly, this is how it is currently:
_vehicle setVariable ["ALIVE_profileIgnore", true];
}, nil, nil, true] call CBA_fnc_addClassEventHandler;```
Is this formatted properly?
is itc_land_shell_b the classname of what is actually created when fired
Im working on a script that captures a helicopters flight path in a series, then on command places simulation-disabled copies in position along the path. Its intended to help display to new fliers the different methods and approaches available to landing, as a review tool, etc.
My current problem is that, while they are 'Can_Collide'd to each other with no issue, they are still physical objects to the rest of the world, which means that the helicopter creating them needs to leave the area before the spawning code can be run.
Is there a way of making them permeable?
I was tinkering with a way of turning any copy that is approached to hidden, but trying to sort out how to un-hide it when free was turning into a giant hassle.
maybe check if two helis are too close to each other and then use https://community.bistudio.com/wiki/disableCollisionWith
oh that command doesnt work with PhysX objects, i guess helis are such
Air conditioners and wind turbines have simulation = "fountain"
Had no idea this simulation was even a thing
"getText(_x >> 'simulation') == 'fountain'" configClasses (configFile >> "CfgVehicles") apply {configName _x}
=> ["Land_wpp_Turbine_V1_F","Land_wpp_Turbine_V2_F","Land_AirConditioner_01_sound_base_F","Land_AirConditioner_02_F","Land_AirConditioner_03_F","Land_AirConditioner_04_F"]
fountains have a continuously emitted sound
π€
Assumed it might be something about rotating blades or something, but then again its "fountain", it doesn't have blades
just the humming sound these make (and fountains usually make)
your fountains hum? damn
Then they roar?
Hi guys complete noob to scripting honestly haven't a clue how to work it. But I need some help anyone here know of a way I can make it so Medical Vehicles will not be engaged by AI as per Geneve Convention? I basically want to have Blufor players drive a Medical Vehicle, when any Blufor Players get in the Medical Vehicle they get marked as Civillian as the Vehicle would be marked as civillian so AI don't shoot it. When the Players exit the vehicle they would then become Blufor again... Is something like this possible??? Thanks
setcaptive of unit that gets into it
Yep, correct. ITC spawns a "UAV" (with that classname) which is attached to the actual artillery round. If that UAV is killed, the round is deleted, which is how ITC is able to incorporate stuff like CIWS killing indirect fire. The issue here is if the UAV gets virtualized (which is what's happening), the round disappears as well
anyone knows why this code doesn't fill the b array?```sqf
a = []; a resize 10000; // Updated
b = [];
{ b pushback _x; } foreach a;
either im trying to do something weird or could it be bug in the new SC feature?
If I change _x to 0 then the b array gets filled
Is it possible cause its filled with nil?
dunno
Yes
Posted on November 26, 2014 - 18:25 (UTC)
DreadedEntity
pushBack does not support nil while set and a plus b do
just tested and yeah you are right, its because a is filled with nils
Every script command is silently ignored if you give it nil as argument
_x is nil, so every pushBack is ignored
makes sense
how do i properly end the mission in multiplayer?
Hey there,
I'm currently trying to figure how how to disable damage taken from HE explosions.
This is what I have so far. No idea tho how to handle the area effect of explosion damage.
player addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
if (_source isEqualTo mtt_static) then {
systemchat "hit"; //debug
_damage = 0; //new damage
};
_damage
}];````
You can do this with a zeus module or take a look at
https://community.bistudio.com/wiki/BIS_fnc_endMission
make the event handler log ALL hits, then go in and find the specific shrapnel projectile and use that.
THIS, Good idea. (Why didn't I think about this)
β€οΈ
an example from one of my old (2021) pvp missions for cinematic explosions
player addEventHandler [
"HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
diag_log format ["%1 - source, %2 - projectile, %3 - damage", _source, _projectile, _damage];
if (_source == _unit || _source == objnull || _projectile == "Bo_GBU12_LGB") then {
_damage = 0;
};
diag_log format ["%1 resulting damage after calculation", _damage];
_damage;
}
];
i was using the GBU to create my explosions
without ACE
ace does something different with spalling
Oh so my above probably has some issues with this then I guess, because we're using ace
yeah so you need to find that spall class. so do the logging
on it on it
Greetings.
Im trying to get IMS (Improved Melee System) from Webknights, to running on my "AltisLife" Australia Life Server.
But i dont know how to fix it.
Thats what he sended
In Singleplayer, everything works fine.
But when i go on the Server.
There are No Animations, Attacks etc etc.
Not enough information. You'd need to know what functions to add to cfgRemoteExec.
Either that or you just allow everything.
Yea thats what i dont know
anyone know of an existing script that would allow players to respawn via airdrop? so when a player dies it would spawn an aircraft going a certain direction, put them in the cargo, and then drop them over a certain point?
have you ever created or modified CfgRemoteExec?
In the Altis_Life the CfgRemoteExec already exists
you can probably take a look in the Functions Viewer via the in-game debug console or via ALT-F in the edent editor and look for the dropdown for the melee system
no, but that doesn't seem too bad to make on your own. You'd have to make the spawn aircraft spawn in waves and repeat its flight plan

yeah doesnt seem horrid, just didnt wanna reinvent the wheel
Oh yea, i have Zero Scripting Experiance or such
that wasn't for you. but as for CfgRemoteExec, that's found in your missionconfigfile (description.ext) or if altis_life is a mod, find out where it builds that config.
What could it be if the projectile in diag_log shows empty but I take damage from it and die?
fall damage?
"mtt_static - source, - projectile, 1.13854 - damage"
fall damage would either show objNull or playersObjectNameHere for source. did your code above when working with the source not work either?
Well, basically I could take loads of hits, but I figured I am dying by ""
like literally
19:55:06 "mtt_static - source, - projectile, 0.00136427 - damage"
no idea how I can handle this
like this everything is alright except the "" class
Yes I do all the time, but the redplasma doesnt kill me actually
Like I take no damage from it
or in other words, it gets handled by the EH
script is looking like this right now:
_test = player addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
diag_log format ["%1 - source, %2 - projectile, %3 - damage", _source, _projectile, _damage];
if (_source isEqualTo mtt_static) then {
systemchat "hit mtt"; //debug
_damage = 0; //new damage
};
if (_projectile isEqualTo "3AS_MTT_redplasma_HEAT" ) then {
systemchat "hit heat"; //debug
_damage = 0; //new damage
};
if (_projectile isEqualTo "ammo_Penetrator_AAT" ) then {
systemchat "hit penetrator"; //debug
_damage = 0; //new damage
};
if (_projectile isEqualTo "") then {
systemchat "hit empty"; //debug
_damage = 0; //new damage
};
if (_source isEqualTo player) then {
systemchat "hit player"; //debug
_damage = 0; //new damage
};
_damage
}];
diag_log _test
sorry edited
I have no idea how I can figure this out
which things do you want someone to NOT take damage from
Well basically I have a course, where a vehicle (mtt_static) is aiming as usual and firing. I want the players to not take damage by the vehicle turrets but still be able to take damage from small arms fire of infantry
so you can better imagine what I mean
basically like a citadel
@brave jewel
player addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
if (
_source in [player, mtt_static]
or
toLowerANSI _projectile in (["3AS_MTT_redplasma_HEAT", "ammo_Penetrator_AAT"] apply { toLowerANSI _x })
) exitWith {
diag_log format ["Source: %1 | Projectile: %2 ---- Setting Damage to 0", _source, _projectile];
0 // damage of 0
};
diag_log format ["Source: %1 | Projectile: %2 ---- Allowing Damage Through: %3", _source, _projectile, _damage];
_damage;
}]
what does this give you in the log?
I don't want the damage in the diag_log besides the Allowing Damage Through
got it
true
or just put it as the message that discord does and i'll look through it. that one up there correct?
btw, there is no entry with allowing damage through in the logs
the upper one is correct, yes
and you're still dying? it should tell us what is killing you
still dying yes
if you are, then its something ace is doing behind the scenes i think
I believe it could be ace fragmentation simulation
let me see if i can find anything relevant in their code.
ace_frag_skip got it, trying to put it in the mission now
should be ace_frag_skip = 1 I believe
should be ok if I put ace_frag_skip = 1; in the debug console right? if yes, doesn't work
true
try this @brave jewel
player addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
if (
_source in [player, mtt_static]
or
toLowerANSI _projectile in (["3AS_MTT_redplasma_HEAT", "ammo_Penetrator_AAT"] apply { toLowerANSI _x })
) exitWith {
diag_log format ["Source: %1 | Projectile: %2 ---- Setting Damage to 0", _source, _projectile];
[_projectile] call ace_frag_fnc_addBlackList;
0 // damage of 0
};
diag_log format ["Source: %1 | Projectile: %2 ---- Allowing Damage Through"];
_damage;
}];
if not, might have to add to blacklist before the hit handler, so you would add it to the "Fired" event handler on the vehicle shooting
Guess I'm gonna try the fired eh then, cause that didn't work out.. man is this is complicated xD
mtt_static addEventHandler ["Fired", {
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
[_projectile] call ace_frag_fnc_addBlackList;
}];
should be correct eh?
that blocks all projectiles from that vehicle, yes
well, didn't work xD
you still need the player handler though
yea got it as wlel
hmmm okay head off to the ACE discord then and ask there.
#channel_invites_list message
Just to have it set up right: HandleDamage goes into initplayerlocal / fired goes into initServer or init?
make them both local to the object they are attached to
Sorry about the long delay. Each Extraction Location is named 'Extraction_0' through to 'Extraction_5'
of which type is Extraction_0 to Extraction_5?
I'm sorry, what do you mean?
I can explain what I'm doing as a whole, but it's even confusing for me :(
how do you define _allExtractionLocations? Does it look like _allExtractionsLocations = [ "Extraction_0", "Extraction_1", ... "Extraction_5"]; ? or without the parentheses?
Oh, sorry, yes. _allExtractionLocations = ["Extraction_0","Extraction_1","Extraction_2","Extraction_3","Extraction_4","Extraction_5"];
Sorry, I just woke up.
so did you try commy2s advice and created a marker with 'createMarkerLocal' first? Otherwise there is simply no such marker 'Extraction_0' to 'Extraction_5'.
Not yet, I'll give it a try in a second!
I want people to listen to a short intro music track on mission join.
How would I go about this?
I was using:
description.ext
author = "Gazpa Nova";
onLoadName = "Biohazard";
onLoadMission = "Abandonados en el desierto... una sola misiΓ³n.";
loadScreen = "images\denton_Fallujah_01.jpeg";
class Header
{
gameType = Coop; // Game type
minPlayers = 1; // minimum number of players the mission supports
maxPlayers = 25; // maximum number of players the mission supports
};
respawn=3; respawnDelay=2; respawnOnStart=-1;
#include "LARs\override_VA_templates\settings.hpp"
class CfgFunctions
{
#include "LARs\override_VA_templates\functions\functions.hpp"
};
class CfgMusic
{
track[]={};
class gameIntro{
name = "";
sound[] = {"\music\gameIntro.ogg", db+10, 1.0};
};
};
init.sqf
playMusic "gameIntro";
but it's not working
I assume gameIntro.ogg is actually located in a folder called music in your mission folder?
it is
You might try adding a sleep 0.1; immediately before your playMusic in init.sqf. Init.sqf runs during the "briefing" phase (when the mission is at the map screen and the game has not actually started), and playMusic might not work during this stage. Adding a sleep would force it to wait until the mission starts.
interesting. Will try that right away. Thank you!
Oh, also where you have track[]={}; in description.ext, that should be tracks[]={};
_tgt = tgt1;
pzf hideObject false;
pzf enableSimulationGlobal true;
_tgt enableSimulationGlobal true;
sleep 2;
pzf reveal _tgt;
pzf dotarget _tgt;
sleep 1;
pzf doFire _tgt;
grp4 setCombatMode "RED";
grp5 setCombatMode "RED";
for some reason the unit pzf isnt shooting anymore. I had it working reliably last time I checked this and I dont remember changing anything.
The AI unit has only the launcher equipped (but doesnt draw it, it just stands still).
Hey, do any of you know off the top of your head a good explosion class? I'm trying to do flak guns firing at incoming aircraft, hopefully with some screen shake and whatnot
*screen shake for the passengers of the aircraft
Hello guys!
I'm trying to make a "Gas attack" Operation.
I would very much like to avoid using a mod, and would much prefer using scripts to achieve this.
In reality, the only thing I need is a visible "Gas". Something colored, whether it's yellow or any other color really.
Any ideas?
Thank you kindly! π
Hiyo! You can look up Particles, on the wiki for example
see this tutorial for guidance (and here for help!)
Oh wait, I just realized he's creating the markers, as where I'm using existing ones.
The most fun one is "Bo_GBU12_LGB_MI10" in my opinon. But "HelicopterExploBig" is another good one.
Sorry for the late reply lol
lol ye HelicopterExploBig was a neat one but I didnt find it had much shake
I ended up using I think an IED explosion
If I remember correctly, "Bo_GBU12_LGB_MI10" is the largest vanilla explosion there is
For screen shake, I usually do that by myself with addCamShake
also @fallow vector I have this code written already if you want to look it over or try to reverse engineer it. https://github.com/Ajdj100/AJ_CBRN_V2/blob/main/AJ_CBRN_V2/functions/fn_chemicalParticleLoop.sqf
I'm just trying to work out how to pass variables through addAction right now. Being a ballache lmao
Hey, thank you! I'll give it a look :)
This looks like the perfect thing for me! I'll give it a shot ^^
Due to the way addAction works with params, if I add it in the params line, it returns the variablename of the unit that used the action. I took a look at the wiki and it seems you pass arguments through after the script.
It's a little confusing lol
Either that or the lack of examples is really getting to me
I'll kinda explain what I'm doing. For a certain character, at the start of a game, 6 extraction locations are shown, but only one is correct. As long as he's in possession of a certain item, over time, markers will be removed one by one until only the correct one remains. I've never really used arrays before, but I have a few now. _allExtractionLocations contains all the names of each marker, _trueExtraction contains the name of the correct one, and _extractionLocations is = _all - _true, and is constantly having one removed each, say, 2 minutes.
Exactly what I was looking for! Good shit my man :D
Hope that makes some sense.
Although i'll have to figure out a way to remove the damage!
And donezo! You're a god among men, I swear
How big of an impact on frames do you think the "Gas" particle is (on a dedi)? I'm planning to encompass an entire city (around 500m or so) with it. That a bad idea?
when you remove a marker, how do you do that? set the alpha? Or delete it?
If you do it around a player it should immerse the effect they are βsurroundedβ
Doing a whole city would most likely tank frames with a lot of particles. Just have to edit the particle params and see what works best for you.
Unfortunately it's for a multiplayer mission, and it'll span more than just that specific area, so I can't quite attach it :/
Yeah,I might just decrease the amount of particles and see how that looks like
change it's type from "mil_pickup" to "none"
Oh, and then remove it from the _extractionLocations array
But I'm just trying to get it to show all of them first, using arrays and code.
Question: Is there any way to force ai to "turn out" when they're sitting at a station which has a gun that can only be fired from the turned out position?
Here's a picture of what I have now. A little messy, but I'm new to scripting, so. I've also removed most functionality from the bottom part, as I was just using systemChat to check if things were executing when they were needed http://i.imgur.com/nR5e96y.png
Question: https://community.bistudio.com/wiki/moveTo The wiki says for the command "moveTo", that it is meant to be used only in a FSM. What other commands are only supposed to be used in a FSM?
where do you define the markers for Extraction_0 ...
or are they defined in the mission.sqm?
Yes, they are created within the editor in advance. I find it easier to place them exactly where needed.
sorry, out of ideas now
It's all good. Thank you for trying though!
I think I know what the issue is.
Normally when you'd do setMarkerTypeLocal, the marker name is defined as "Marker_Name" in quotes. Maybe I should make a string first, that uses quotes and _x? Issue is, I don't know how to use quotation marks... in quotation marks haha.
the code is correct, so the error is somewhere else
But wouldn't the array _x output be Extraction_0, where, for setMarkerTypeLocal, it needs to be "Extraction_0" ?
no? thats not how strings work
_x is the current element forEach is reviewing, which are all strings in your array
i love how you took a picture of your code xD
Yeah, I didn't really want to fill up the chat with it either, and pastebin wasn't l oading for me haha.
Definitely the best way :D
Sorry :P
http://hastebin.com/ is a good alternative
I thought you were being sarcastic with that link haha.
Do you get the "Download under 20" systemChat?
Yes, actually. I was just about to say that.
knowing me, probably 'any'
systemChat str count _allExtractionLocations
So like this then? http://hastebin.com/rohozevutu.avrasm
Also, thank you for Hastebin. I like it.
ugh, yeah. Sorry. I'm going to grab some coffee or something before I slam my head into my keyboard any further. I might make sense afterwards.
Any idea why
_vehicle = createVehicle [ _vehicleType, [0,0,0], [], 0, "NONE" ];
wouldn't work, but
createVehicle [ _vehicleType, getPosATL player, [], 0, "NONE" ];
does?
fails silently
The only thing that comes to mind is that the first one is creating at [0,0,0], which may not be where you're looking for the vehicle. It is also [0,0,0] ATL, which may be underwater depending on the map.
Alternatively _vehicleType could be wrong because of stuff happening before the posted code
createVehicle uses AGL coordinates but yeah, first line creates at 0, second near player
Land_Camping_Light_F has simulation="shipx";

Oh, that's why class Land_Camping_Light_F: FloatingStructure_F so it can float
I've cracked this, so the bag is at 0, but when i attempt to move the bag using the script to a valid location, it disappears.
You're moving it wrong then
ah, (count(_allExtractionLocations)) gives me scalar.
I am trying to execute this in runtime as zeus. However, it gives me a black screen instead of the PiP. Its executed as 'Local'.
_bb = "Land_BriefingRoomScreen_01_F" createVehicle [550.533, 4516.7, 0];
_bb setObjectMaterialGlobal [0, "\a3\data_f\default.rvmat"];
_bb setObjectTextureGlobal [0, "#(argb,512,512,1)r2t(uavrtt,1)"];
uav = createVehicle ["B_UAV_01_F", _bb modelToWorld [0,100,100], [], 0, "FLY"];
createVehicleCrew uav;
uav lockCameraTo [_bb, [0]];
uav flyInHeight 100;
_wp = group uav addWaypoint [position _bb, 0];
_wp setWaypointType "LOITER";
_wp setWaypointLoiterType "CIRCLE_L";
_wp setWaypointLoiterRadius 100;
{
cam = "camera" camCreate [0,0,0];
cam cameraEffect ["Internal", "Back", "uavrtt"];
cam attachTo [uav, [0,0,0], "PiP0_pos"];
cam camSetFov 0.1;
} remoteExec ["spawn",-2];
Are you're server?
Ah i didn't think about that omg. Let me try with remoteExec 0
Also you need to broadcast your uav to other clients
publicVariable "uav";
Or sent it as argument in remoteExec
[uav, {
cam = "camera" camCreate [0,0,0];
cam cameraEffect ["Internal", "Back", "uavrtt"];
cam attachTo [_this, [0,0,0], "PiP0_pos"];
cam camSetFov 0.1;
}] remoteExec ["spawn", 0];
Suggest u use [0,-2] # isDedicated instead of -2. So u dont have to worry bout it un future.
Ah ok. Also can I add the addMissionEventHandler inside the remoteExec block?
You can but it doesn't sound like a good idea
[uav, {
cam = "camera" camCreate [0,0,0];
cam cameraEffect ["Internal", "Back", "uavrtt"];
cam attachTo [uav, [0,0,0], "PiP0_pos"];
cam camSetFov 0.1;
addMissionEventHandler ["Draw3D", {
_dir =
(uav selectionPosition "PiP0_pos")
vectorFromTo
(uav selectionPosition "PiP0_dir");
cam setVectorDirAndUp [
_dir,
_dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
];
}];
}] remoteExec ["spawn", -2];``` It would look something like this.
Change uav to _this inside spawn code
(-2 again)
Also uav won't be available inside "Draw3D" either
So I guess public var'ing it is better here
_bb = "Land_BriefingRoomScreen_01_F" createVehicle [550.533, 4516.7, 0];
_bb setObjectMaterialGlobal [0, "\a3\data_f\default.rvmat"];
_bb setObjectTextureGlobal [0, "#(argb,512,512,1)r2t(uavrtt,1)"];
uav = createVehicle ["B_UAV_01_F", _bb modelToWorld [0,100,100], [], 0, "FLY"];
createVehicleCrew uav;
uav lockCameraTo [_bb, [0]];
uav flyInHeight 100;
_wp = group uav addWaypoint [position _bb, 0];
_wp setWaypointType "LOITER";
_wp setWaypointLoiterType "CIRCLE_L";
_wp setWaypointLoiterRadius 100;
publicVariable "uav";
{
cam = "camera" camCreate [0,0,0];
cam cameraEffect ["Internal", "Back", "uavrtt"];
cam attachTo [uav, [0,0,0], "PiP0_pos"];
cam camSetFov 0.1;
addMissionEventHandler ["Draw3D", {
_dir =
(uav selectionPosition "PiP0_pos")
vectorFromTo
(uav selectionPosition "PiP0_dir");
cam setVectorDirAndUp [
_dir,
_dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
];
}];
}remoteExec ["spawn", [0, -2]];```
Or am I confusing myself with the LE/GE functionality.
(and it does not work π¦ )
change: remoteExec ["spawn", [0, -2]]; to: remoteExec ["spawn", [0, -2] # isdedicated];
Just to make sure my array was actually working, I did try this, and it worked {systemChat format ["Extraction: %1",_x];} forEach _allExtractionLocations;
It showed all locations. So I've got that going for me, which is nice.
I've set it to 0 for now and its still a black screen hmmm
Your code works fine, you're doing something wrong
Perhaps you're not server and remoteExec is blocked?
So i try this code in a my own local server as zeus and executing this in the Execute Code module and in Local execution.
Make sure you do this: }remoteExec ["spawn", 0];
Are you even looking at the right screen at all?
Its the only screen in 500m radius π
preferred to use select instead of #
this won't work
it's not a matter of preference in this case
# doesn't take bool
Oh yea, the # would require a number not bool
spawn is binary not unary
Oh yeah, that's the reason why it worked for me, I used call instead of spawn
Its still black for me idk why (even with remoteExec call and 0)
can you provide me your working code please? so i can compare it with mine
}remoteExec ["call", 0];
I have just that
_bb = "Land_BriefingRoomScreen_01_F" createVehicle [550.533, 4516.7, 0];
_bb setObjectMaterialGlobal [0, "\a3\data_f\default.rvmat"];
_bb setObjectTextureGlobal [0, "#(argb,512,512,1)r2t(uavrtt,1)"];
uav = createVehicle ["B_UAV_01_F", _bb modelToWorld [0,100,100], [], 0, "FLY"];
createVehicleCrew uav;
uav lockCameraTo [_bb, [0]];
uav flyInHeight 100;
_wp = group uav addWaypoint [position _bb, 0];
publicVariable "uav";
_wp setWaypointType "LOITER";
_wp setWaypointLoiterType "CIRCLE_L";
_wp setWaypointLoiterRadius 100;
{
cam = "camera" camCreate [0,0,0];
cam cameraEffect ["Internal", "Back", "uavrtt"];
cam attachTo [uav, [0,0,0], "PiP0_pos"];
cam camSetFov 0.1;
addMissionEventHandler ["Draw3D", {
_dir =
(uav selectionPosition "PiP0_pos")
vectorFromTo
(uav selectionPosition "PiP0_dir");
cam setVectorDirAndUp [
_dir,
_dir vectorCrossProduct [-(_dir select 1), _dir select 0, 0]
];
}];
} remoteExec ["call", 0]; ```
Do you have PiP disabled in video settings? xD
Its on Ultra / Very High
On a side note, is this function / feature now available in game? https://twitter.com/dedmenmiller/status/1590327261093580801
Already on stable, good improvements on dev branch
I have no idea where this is going wrong or what im doing wrong at this point xd
Do you know the function name?
Execute the code in debug console in an empty mission and see if it works there
Cool thanks!
This code works. My guess is that remoteExec is blocked.
Is there a possibility of the remoteExec being blocked in a player hosted server?
Thats something new/strange for me
I have battleye disabled. Could it be the fault?
It can be blocked on mission level
Try remote exec'ing something simple
Its mission defined
Something like {diag_log "WORKS!"} remoteExec ["call", 0];
And check RPT on other clients and server for WORKS!
It does.
I can see it in my RPT files - "WORKS!"
Forget remote execution, I can't even execute it locally on a SP instance too.
Are there any examples for this using map? Can't seem to find any in the wiki.
I have some repro code in my ticket, you can learn from it: https://feedback.bistudio.com/T170754
Thanks a lot!
at the same place in the script? Try (_allExtractionLocations select 0) setMarkerTypeLocal "mil_Pickup"; around the same spot.
So essentially im doomed in figuring out whats the problem behind this xd
I'll give that a try. I was just about to say, despite what i said earlier, about the {systemchat} forEach _all working, it doesn't seem to want to work when used in this, even if I remove the setmarkertypelocal line http://hastebin.com/okadahozuq.avrasm
Yeah, no visible markers for that either. I'll see what select 0 actually returns as.
Can I ask you what do you think about this script? Do you think it will work? I made it with ChatGPT (Ignore the text in Italian)
// Imposta la variabile per indicare se il giocatore sta mirando a un nemico o a un civile
player setVariable ["isAimingAtEnemy", false];// Aggiungi l'evento per verificare se il giocatore sta mirando a un nemico o a un civile
player addEventHandler ["Fired", {
_unit = cursorTarget;// Se il giocatore sta mirando a un nemico o a un civile if (!isNull _unit && (_unit isKindOf "Man" || _unit isKindOf "CAManBase")) then { player setVariable ["isAimingAtEnemy", true]; // Imposta la variabile per indicare che il giocatore sta mirando a un nemico o a un civile hint "Premi ALT + A per far abbassare l'arma e alzare le mani."; // Mostra un messaggio sullo schermo per indicare all'utente cosa fare } else { player setVariable ["isAimingAtEnemy", false]; // Imposta la variabile per indicare che il giocatore non sta mirando a un nemico o a un civile };}];
// Aggiungi l'evento per far abbassare l'arma e alzare le mani
player addEventHandler ["KeyUp", {
_key = _this select 1;// Se il giocatore sta mirando a un nemico o a un civile e preme ALT + A if (player getVariable ["isAimingAtEnemy", false] && _key == 18) then { _unit = cursorTarget; _morale = morale _unit;
!code
How to use SQF syntax highlighting in Discord
```sqf
// your code here
hint "good!";
```
β
// your code here
hint "good!";
'any'
Thank you XD
Oh and ChatGPT sucks, it doesn't know SQF and you can't learn from it. If you understand SQF and Arma you don't need it, if you don't understand SQF it won't help you.
if (!isNull _unit && !isNull (primaryWeapon _unit) && _morale < 0.5) then {
_unit action ["DropWeapon", _unit, primaryWeapon _unit];
_unit action ["GestureSurrender", _unit];
} else {
// Altrimenti, se il morale Γ¨ alto, il nemico o il civile rispondono o attaccano
switch (floor(random 3)) do {
case 0: {_unit say "Non mi arrenderΓ²!";};
case 1: {_unit say "Non mi farei intimidire!";};
case 2: {_unit fireAtTarget [player, "FullAuto"];};
};
};
// Rimuovi la variabile che indica che il giocatore sta mirando a un nemico o a un civile
player setVariable ["isAimingAtEnemy", false];
};
}];```
Thank you for the answer! I was trying to see how it performs XD
This is the rest of the code
I asked to create a script that when you press ALT + A and the morale of the enemies is low, it makes them surrender
I dont see any reference to what _morale is set to or any reference of any way to activate this code
what that code will do, as far as I can tell, is check if a unit exists and has a weapon and if a variable _morale is below 0.5.
_unit also isnt defined, I assume that is outside this
if those conditions are true then it looks like it makes the unit surrender and drop their weapon. If not then it randomly selects some random shit to say and do
I'm going to ask him to define _morale and _unit
!quote 6
_ https://cdn.discordapp.com/attachments/105462984087728128/1096430025504473209/image.png _
Lou Montana; Friday, 14 April 2023
Lol
I don't get why {systemChat format ["Extraction: %1",_x];} forEach _allExtractionLocations; works at the start of the script, but not in the under 20 if statement, despite the 'under 20' systemchat message shows.
NVM i was just dumb - fixed it.
Greetings folks.
I can't seem to be able to create a specific rugged laptop with a dedicated screen texture.
The laptop is listed as expected but the texture always fails on me. Tried various format without success.
Any clue?
Do you have the sample code and or the texture?
The same code I was using on regular laptop and it worked with it. Changed texture number to 1 as rugged are using it instead of 0.
class CfgVehicles
{
class Building;
class FloatingStructure_F;
class Thing;
class ThingX;
class Wall_F;
class House;
class Land_Billboard_F;
class Land_Laptop_device_F;
class STyx2909_Laptop: Land_Laptop_device_F
{
scope=2;
displayName="Laptop CIA Terminal";
hiddenSelections[] = {"camo"};
hiddenSelectionsTextures[]=
{
"STyx2909_LAPTOPS\Texture\CIA.paa"
};
init="This setobjecttexture [0,""STyx2909_LAPTOPS\Texture\CIA.paa""]";
};```
Rugged laptops code:
class Land_Laptop_03_base_F;
class Land_Laptop_03_black_F;
class FODDSQUAD_Laptop1: Land_Laptop_03_black_F {
scope=2;
displayName="FODDSQUAD Laptop dark";
hiddenSelections[] = {"camo"};
hiddenSelectionsTextures[]=
{
"foddsquadpatches\Computer\dark.paa"
};
init="This setobjecttexture [1,""foddsquadpatches\Computer\dark.paa""]";
};
how does it "use 1 instead of 0" with only 1 hiddenSelection listed in config, though? 
Using 0 doesn't work either...
class Land_Laptop_03_black_F: Land_Laptop_03_base_F for inheritance with seemingly no model redefned and hpp class Land_Laptop_03_base_F: Items_base_F { ... hiddenSelections[]= { "Camo_1", "Screen_1" }; ... in the base class π€·ββοΈ
This new laptop does not have second hiddenselection defined though so it does not have screen hiddenselection at all.
And the 0 does not work because camo selection is defined but does not exits
Since original uses Camo_1
All borked config
@humble tundra
ok so, update, just tested on the server, and the cruise missile part works beautifully, however, i ran into some issues with the S-300 section, (for context, this is a sequence where an S-300 bty launches all its missiles towards an invisible target to simulate an intercept), now, in SP and local MP, the S-300 launch their missiles just fine, but in dedicated MP, the missiles completely miss their target, which does make it look a bit silly, i think there's some issue with either do target or...fire at target, idk
it's probably a locality issue or a pointer issue. Try passing +_allExtractLocations into your spawn.
Using the original script file (without remoteExec):
- rename it to fn_wr_vic_shoot.sqf
- put it in the functions folder with the other one
- add
class wr_vic_shoot{};to description.ext cfgFunctions alongside the other line that looks like that - in missileStrike, replace
[_x] execVM "WR-VIC-Shoot.sqf";with[_x] remoteExec ["TNRGN_fnc_wr_vic_shoot",_x];
*and save the mission before testing to force a functions refresh
alright, ill give it a shot
btw if you dont mind me asking, what does this do exactly?
and how does it affect the sequence?
It turns it into a function, which is more efficient than a raw script file and easier to remoteExec it.
Then it remoteExecs that function so it's running locally on whichever machine the launcher is local to.
It makes no changes to the actual operation of the sequence, but will solve the locality issue that is likely to be the cause of your problems.
i see
still the same issues sadly
so this is the problems in video form, if you can see the 3 floating blufor groups, that are the airborne targets the s-300 are supposed to hit, you can see that the missiles are going straight on based on the vics orientation instead which means the vic failed to aim
luckily this is one of those problems that could be explained away "we're jamming the fuck out of those S-300s"
and "growlers are working"
@meager granite I figured out the problem - Every time I enter / leave Zeus, it resets the texture to black.
also this is what the S-300s are supposed to look like for reference
Yeah, I think you're right. Moving them down inside of [] spawn worked. I wonder why it didn't work otherwise? It's not like they needed to be public arrays, did they?
Sounds like you need to read about scopes
Well, I did say I was new to all this. I guess I'll have to. Thank you :)
And all markers show up. That took a lot longer than it rightfully should have.. Thanks again, @indigo snow! I'll look up scopes now.
@spice kayak read this: http://foxhound.international/arma-3-sqf-private-variables.html
Has anyone explored any of these newer, code-focused models for A.I. generated code?
We've been working on it and the results I think will be a lot more promising than GPT.
The only code-focused models for A.I. generated code I prefer is Github Co-Pilot
Saves me a lot of time doing repetitive / regular task
Co-Pilot has a new rival now called StarCoder.
What databses do they have as training models?
Since Github is pretty much used globally, they should have robust database for training their model so they'd be more stable and general correct
"StarCoder and StarCoderBase are Large Language Models for Code (Code LLMs) trained on permissively licensed data from GitHub, including from 80+ programming languages, Git commits, GitHub issues, and Jupyter notebooks. Similar to LLaMA, we trained a ~15B parameter model for 1 trillion tokens. We fine-tuned StarCoderBase model for 35B Python tokens, resulting in a new model that we call StarCoder."
but these are more ifs and thoughs so dont take it 100%
@hallow mortar still stumped on this honestly, im about to give up on it for now, nikko do you have any other leads?
Nope
I'm so excited for these coding models.
If you've followed the previous suggestion, it is already being remoteExec'd to the only place it would make a difference. remoteExec'ing it again would be redundant.
Try setMissileTarget
alright lets see how it goes
dont think that would work sadly
The missile is accessible in the fired event handler. Or if players aren't going to be close to the launcher, you can just create the Missiles
@stark fjord got an idea? you're my last hope for this one
they will see the launcher so i can just create it sadly
im gonna see if the basegaem S-400 has the same issue, if not imma use that
Does startLoadingScreen have any effect on dedicated servers, or do they have the 50ms per frame script execution time regardless?
So add fired eh, do your existing code that fires which triggers the fired eh, and setMissileTarget in there.
will do, thank you.
