#arma3_scripting
1 messages Β· Page 565 of 1
i'm looking at execVM and call commands and i cant get the difference ! i can apply call to an object but not execVM ?
hmm example plz?
i want to call a script that reload a crate
execVM "crate.sqf";
or
mycrate call "crate.sqf";
No, it's either
myCrate execVM "crate.sqf" OR myCrate call YOUR_FUNCTION
Yup
ok and call is used only for functions ?
Only for CODE, functions are code but you could also do myCrate call { .... }: https://community.bistudio.com/wiki/call
but it's confusing π₯΄ execVM is code isn't it ?
execVM calls the code that is contained in a file
basically, execVM takes a file, call takes code
If in doubt, check our Bible (the Wiki), everything is explained there https://community.bistudio.com/wiki/
(And if not clear, blame Lou!)
I already using that option too much
apologies kind sir
nevah (apologise), you're learning!
if something is not clear after you did read⦠we gladly explain
Hi all, I'm trying to recreate the AI respawning behavior in the Virtual Arsenal, I'm currently stuck on what I'd have to do after an AI target is killed since setDammage will not work if the AI isn't alive.
I have a script that attaches a unit to an another in a medic animation. Works fine in single player. In MP the unit some times does not attach it selt to the correct unit position.... Keep in mind I have detach using a sleep command a couple seconds later... Any idea why?
Referring to the roaming targets that stand/patrol near the player when you go into the Virtual Arsenal practice range
Not necessarily BIS_fnc_arsenal itself
Killed EH will help you out
How do i allow third person when connected to a uav? i use the following code to allow third person when in a vehicle.
while {true} do
{
if (cameraView == "External") then
{
if ((vehicle player) isEqualTo player) then
{
player switchCamera "Internal";
};
{
if (isPlayer _x) then
{
player switchCamera "Internal";
};
} forEach attachedObjects player;
};
sleep 0.01;
};
is there a way to disable the LOD on usertexture objects
or will i just have to make my own
usertexture objects?
UserTexture10m_F
i need it to render at full quality no matter the range
the shape and textures aren't all that complicated, so i might just make an object for it
but im trying to avoid making a mod for now
anyone know a code for a bomb in a van with a timer after players have entered a radius??
if you can, you could try to attach a trigger into the van
haven't played around with them though, so im not sure how they work exactly
another option is to spawn a waituntil
Ok, thank you
and once the condition is filled, enter a sleep for timer ammount and then spawn a gbu at the van position
i can write a real quick and dirty oen for you if you want to that you can work off of
- Place trigger around the van in the radius you want
- use createVehicle (or a similar command) to create an explosve charge
- wait for x seconds
- setDamage 1 on the charge
Yeah thank you!
Btw do you peeps know if theres a command to change a units side?
yes it will be moving to a building and then driver has time to escape and it explodes
ummm...
you could create a headquarters unit
and then a group under that headquarters
and move the unit you want to change the side of into that group
it's a bit dirty, but i remember getting it working maybe once
@tough abyss hold on, let me dm you
Use addAction on the vehicle, set a timer (eg. 30 seconds), when timer reaches 0 place an explosive under the vehicle and make it explode
@oblique arrow Create a group on "enemy" side, let the unit join that group.
"Headquarter" is not needed anymore (formaly createCenter)
hm oki
//_unit = on side west
_group = createGroup east;
[_unit] joinSilent _group;
//== _unit on side East
thanks Dscha for clearing the headquarters thing. I had not needed to use anything like this in years
And i already forgot it (had to search for it's correct name again π )
btw, here is the quick script i wrote for what @tough abyss was asking for:
null=this spawn
{
waituntil{{_x distance _this < 500} count allPlayers > 0};
_charge = createMine ["SatchelCharge_F", position _this, [], 0];
_charge attachTo [_this,[0.7,-0.85,-0.87]];
[_charge, 600] call ace_explosives_fnc_scriptedExplosive;
_this addEventHandler ["Explosion", {
params ["_vehicle", "_damage"];
{
if (typeOf _x == "SatchelCharge_Remote_Ammo") then {
"Bo_GBU12_LGB" createVehicle (position _vehicle);
};
}forEach(attachedObjects _vehicle);
_vehicle removeAllEventHandlers "Explosion";
}];
};```
Intended use:
To be dropped into the Init field of vanilla arma 3 Van Boxxer. Ace is a requirement. It will spawn an explosive bag ontop of the fueltank that is defusable with a defusing kit
multiplayer compatible (i assume, haven't actually tested it out yet)
it has surely got some points to improve still, like if someone detonates a grenade nearby, the truck will go skyhigh
but i cant be asked
"it's a feature"
feel free to use, reuse, publish or abuse. i dont care
I am doing intensive allUnits enemySide & distance selects for a variety of functions, and I am thinking of storing that data in the unit with a timer as a way of mitigating redundant calls for those checks again.
Does this make sense? Macros are CBA/ACE
params ["_unit", ["_forced",false,[false]]];
private _enemyArray = GETVAR(_unit,enemyArray,[]);
private _enemyUpdateTime = (CBA_MissionTime - GETVAR(_unit,enemyArrayUpdateTime,(CBA_MissionTime - 5)));
if ((_forced) || (_enemyArray isEqualTo []) || (_enemyUpdateTime >= (GETMVAR(EnemyUpdateFrequency,5)))) then {
private _unitSide = side _unit;
_enemyArray = (allUnits select {!(_x isKindOf "TargetSoldierBase") && {[_unitSide, (side _x)] call BIS_fnc_sideIsEnemy}}) - allCurators;
SETVAR(_unit,enemyArrayUpdateTime,CBA_MissionTime);
SETVAR(_unit,enemyArray,_enemyArray);
};
_enemyArray```
How and how often is this called/needed?
this is in an addon that I hope to build on, as of now it gets called by 3 modules with various timings
Because the function itself makes sense (to me), but I can image it can put a lot of data on an unit and if it's called for each unit a lot of time as well.
Of course I don't know in which context it's used, but I guess in some use cases functions like nearEntities or allGroups could give similar results.
Function is typically only called for group leader, but occasionally called for MGs and vehicle gunners. Array is typically filtered more for specific cases like visibility, group size, etc.
Want to set up like a private teleporter from one door way to another door way. I want to replicate this across 4 different doorways what's the best / easiest way around this. (Like a sky scraper having an elevator to certain floors but the floors are spread out across buildings. So each door has its own teleporter.)
I figured the addAction would be used in the init section but how would one move the player to the location?
anyone know any good tutorials for scripting in arma like I am currently going through college and just barely scratched the surface of coding so like is there a good scripting tutorial for eden that I can look into?
Like how to get a certain object give it a name and then once I have that I should be able to figure it out by myself
Would I setPos or setPosworld
@slim oyster
why the ugly GETVAR macros that CBA/ACE themselves don't even use because they hurt readability too much, and then all these superfluous parenthesis that hurt readability even more :U
You could probably just use cba cachedCall for that, or was it ACE which has that?
also the last entry of the if condition should probably be lazy eval.
also it might be better to do -allCurators first, before you iterate through the units+curators, and then filter them back out afterwards.
Is it possible to get whether or not the player is in a state that lets them fire their weapon?
which state, "animation", or ammo, gun etc?
animation - so false when they're running or sprinting and true when they're in combat stance, standing with weapon up etc.
none I know
afaik!
also, maybe the information is in the animation config, so you may get the animationState and go through the config to see if the unit can fire
π€ that's an idea
now is it a good one, yet to be found out π
so, setVelocityTransform is asking me velocity
how can I give it a certain velocity?
the velocity page on the biki says I have to define the classname of a vehicle or something, which I don't/can't have
copy/paste your code?
```sqf
/* your code here*/
```
β
/* your code here */
I think i'm right, using the UI EH onLBSelChanged on a combo box would fire it?
[
getPosASL car1,
getPosASL car2,
_currentVelocity,
_nextVelocity,
_currentVectorDir,
_nextVectorDir,
_currentVectorUp,
_nextVectorUp,
_interval
];```
as you can see I barely started
lou you may be pleased to know the answer is as simple as using find with the right keywords on the animationstate
how so?
https://community.bistudio.com/wiki/AnimationTitles#STANCE find is pretty cheap, so i'm planning to just run a few checks for substrings like 'sras' and others i need to check
oh this way! indeed - beware of ptential weird naming? (like weapon raised but it's a cutscene anim or such thing)
@smoky verge what are
_nextVelocity,
_currentVectorDir,
_nextVectorDir,
_currentVectorUp,
_nextVectorUp,
_interval```?
its what the biki wants in said slots
https://community.bistudio.com/wiki/setVelocityTransformation
which is what I was hoping you guys could tell me
apparently the first 2 want Velocity
specifically, those velocities are vectors
@smoky verge it doesn't take a classname. it takes an object that you apply the transform to
I think he figured that out (see above example)
yeah I know @winter rose , I'm there
and from that parameters section I went into the velocity page
https://community.bistudio.com/wiki/velocity
but I don't understand what it exactly wants
@still forum why would it ask the object I'm moving?
β¦to move it?
didn't it already ask it in the first parameter?
yeah my bad, meant variable name
a class is a config entry, the vehicle is an instance of such class
no problem π
What I asked is what to put in fromVelocity and toVelocity
a velocity vector
oh, and I guess thats [x,y,z]
yes
that was what I was hoping to understand, thank you a ton
Description:
Return velocity (speed vector) of Unit as an array with format [x, y, z].
Just like in the description π
so you need to work out the vector from the start pos to the end pos
yeah I thought that too but the example looked different and got confused
I should be set, probably... possibly.
looks okay, tbh
if ((velocity _plane1 select 2) > 50) then { hint "Aircraft is climbing up too fast!"; };
index 2 = Z axis
So if velo on Z > +50 = "too fast"
iirc, https://community.bistudio.com/wiki/vectorFromTo can be used to get the vector from 2 positions
Yes
Ah yes, I use it to "shove" an uncooperative AI driven vehicle
https://community.bistudio.com/wiki/setVelocityModelSpace
_car setVelocityModelSpace [0, 10, 0]; //pushes car forward```
whats an interpolation interval?
its a value between 0 and 1
0 start
1 final
at what point to start?
i assume you are on
https://community.bistudio.com/wiki/setVelocityTransformation
?
yeah
at what point to start?
the hell i know? π
I mean, does the interpolation thing defines at what point to start the travel?
You have to rephrase your questions a bit more (like with setVeloTrans). We don't see what you see or know what you know
Sometimes, asking the right question is harder than finding the answer
Not being a native english surely doesn't help, I'll rephrase
I simply have no idea what the interpolation value does, what I understood is that its a value between 0 and 1 and that 0 means start and 1 final
not sure what to make of it
@jade abyss knows ~0.7 human languages
hehe
and .sqf @winter rose
you know 5 sqf!
So make it 0.5
i tried to listen to @weary trail and we both have the same first language
i struggled a little π
scottish?
yes
im joking, btw, i understood him just fine, even when he was drunk
SanchezToday at 2:59 PM
Not being a native english surely doesn't help, I'll rephrase
I simply have no idea what the interpolation value does, what I understood is that its a value between 0 and 1 and that 0 means start and 1 final
not sure what to make of it
Have you checked the pic in setVeloTransf?
It can't be described easier, tho :/
what's going down?
I might have an idea of it
this is the script so far
car setVelocityTransformationyTransformation
[
getPosASL car1,
getPosASL car2,
[0,5,0],
[0,5,0],
[0,1,0],
[0,1,0],
[0,0,0],
[0,0,0],
0.5;
]
what is setVelocityTransformationyTransformation
This moves the car 50% of the path from car1 Pos to car2 Pos, staying at the same vectorUp and Dir
So if car1 is at [0,0,0] and car2 at [2,2,2] -> The Pos would be [1,1,1]
I'm literally trying to keep this car in a straight line, so yeah
yeah
keyframe animations?
nono
oh, ok
it should be a way to move objects
does it need to be non-rigid?
https://community.bistudio.com/wiki/vectorLinearConversion
Might also be a command to look at
I think, the best way would be, to understand how vectors work and what they are
can someone link me the original request
(not advanced stuff, just basics)
this sounds interesting
page up then :p
it started way longer than you think
I challenged @winter rose at making a train tunnel scene
oh wait, I still have that somewhere π
didn't finish it, still rotting on my hard drive
ims till asking why not https://community.bistudio.com/wiki/Arma_3_Key_Frame_Animation
3den, not scripting
so they need to have it working in script?
nah, that, would work but it would obliterate any player on it
what I'm trying to do is move the tunnel backwards to give a sense of movement without being beaten down by the engine
vectorLinConv
so set velocity transformation won't work?
it will
Of course it will
but making anything move smoothly in script is not really performance friendly if there are too many of them
But since i assume that you have to reset the "tunnel" models* over and over again, you can go this way
I indeed do, I'll check it out
e.g. 10 Tunnel Parts
Each one starts with a difference of 0.1 in the rangeValue (assuming using 0..1) -> loopedyloopedy and go on
add some blur to the player's screen to make it more convincing even if the object movement is choppy
for example Β―_(γ)_/Β―
I'm using camera shake
sounds good
I need to check my old files, i did that Tunnelscene out of boredom before.
thanks a lot @jade abyss I'll make some tests
you can also attach some usertexture frames with transparent textures moving slower than the "tube" and be closer to the player camera to give a perception of depth
@smoky verge
Check again:
https://community.bistudio.com/wiki/setVelocityTransformation
Under the pic is an example, how to use linearConv
so nice, a multi parameter script with a script in it that has even more parameters
welcome to arma
You haven't even touched the surface π
hehe
I just wanted to move forwardπ
if all you want to do is move forward, why not setvelocitymodelspace?
just don't go mad with it, or you can end up in orbit
We had that before
if i understood it right
ah
it could
DschaToday at 3:11 PM
But since i assume that you have to reset the "tunnel" models* over and over again, you can go this way
VectorlinConv
@finite sail
force the player to look up, make the object physics enabled and keep dropping and teleproting it back and forth around the player XD
im not sure you can force the head dir
*head pitch
You can't
and then vectordir and up
like a dentist's chair
that stuff is scary
anyways, ive had some luck using setVelocity
sounds like as much fun as being in the dentists chair IRL
messing around with vectors and setVelocity felt like being magneto
This is (actualy) more fun:
https://community.bistudio.com/wiki/bezierInterpolation
I've lost you guys 10 messages ago
all fine π
mom I'm scared come pick me up, they are doing weird stuff
Welcome to #arma3_scripting
But never go near #arma3_terrain or #arma3_tools
They are the worst.
yeah, freaks
I mean... they either play constantly with dirt or stay locked inside the rooms. Freeeeeeaky ppl
everytime someone launches the editor.. the spanel brothers laugh maniacally and stroke white cats
im going to have to say
the best experience working out things in arma comes when things have least to do with bohemia-stuff
nothing against bohemia, love em'
but vectors jsut make sense
although a bit... hard to udnerstand at first because you skipped maths in high-school
so if I understood correctly linearConversion should go in the _interval parameter of setVelocityTransformation
Yes
oh yeah, in an xyz universe, you really need to get your head arround vectors
no stop
oh god oh frick
I'll pray to the content ripper gods
meh, doesn't look like it....
so if I understood correctly linearConversion should go in the _interval parameter of setVelocityTransformation
Oh wait, i missread that. Yeah, it has to
ahw, thats fine, I'll just have to make extra tests
I should know most of the stuff
I was confused with VectorLinConv
where should I put the VectorLinConv?
one q before:
MP or SP?
SP
thank god for that
yeah I'm not even gonna bother moving stuff in multiplayer
wierd I'm getting an error, missing ;
don't see anything wrong
car setVelocityTransformationyTransformation
[
getPosASL car1,
getPosASL car2,
[0,5,0],
[0,5,0],
[0,1,0],
[0,1,0],
[0,0,0],
[0,0,0],
linearConversion [5, 5, 5, 0, 1, false],
];
its as likely to be a missing comma as it is a square bracket
what code editor do you use?
[ 0, 1, 2 ] = OK
[ 0, 1, 2, ] = NOK
also setVelocityTransformationyTransformation β setVelocityTransformation ?
yup
as for the comma, I don't see it anywhere before a bracket
are you not familiar with transformationy, Lou? most proper coders are
@finite sail I'm in an eden trigger lmao
current code plz?
same as above but with correct setVelocityTransformation
then ```sqf
linearConversion [5, 5, 5, 0, 1, false], // last comma
];
[ 0, 1, 2 ] = OK
[ 0, 1, 2, ] = NOK
that did it, for some afwul reason I though it was necessary
Well I already told you above that you had a comma too many..
yeah I realized that, but thoughit was in one of the vectors above
worst thing is that there aint no real reason to disallow a final comma
Β―_(γ)_/Β―
because frick you thats why
π¦ *
with that same code but corrected
not only it doesn't loop
but car doesn't even reach car2, it just moves once
which command did you end using?
the one above
ok, im not sure
double to starting velocity?
tbh, ive missed a lot of the convo and am ot sure why we're using https://community.bistudio.com/wiki/setVelocityTransformation
i understood all you wanted to do was to move an object towards anopther
I got confused in the way, but yeah I simply want to move an object in a direction at a stable velocity without the slightest of unwanted movement
im trying to force a helicopter into a flying height of like 10m, so the ai can rappel themselves.
this flyingheight 10 and vehicle this flyinheight 10 doesnt seem to do anyhting.
any helPΓΌ?
@spark turret tried that too once, seems that AI doesn't like to fly lower than 45 or something
setvelocitytransformation, as i understand it, is good for smoothly moving an object from one position to another while handling the roll, pitch and yaw in one go
just like th biki example, an aircraft going nose up at speed
the object that is being moved, what is it?
I'm using a woodbox to which all tunnel pieces are attachtoed
a moving tunnel?
yup, trying to fake a train moving through a tunnel, so static train and moving tunnel
Is it possible that in Arma 3 comments in stringtable.xml files don't work?
Not me
For some reason he commented all languages he doesn't need, but arma still reads those and therefore returns an empty string.
"weird flex but ok"
its an xml, is commenting allowed?
bug of the XML parser then
@finite sail Yes, <!-- --> is the right syntax
Yeah I guess it's just a bug. Was just wondering if someone can confirm that
arma just uses a standard xml parser library π€ so that shouldn't be happening.
Single line comments work, so XML parser bug I guess.
Maybe someone needs to update the library π€£
u? 
Just implement Chromium in the backend, so we have proper XML, HTML and CSS support π π€π
and replace sqf with js
and buy everyone more ram, they'll need that for chromium

Anyone know what I did wrong?
//in config.cpp/bin inside a mod addons folder
//didn't work
class CfgVehicles {
class Man;
class CAManBase: Man {
class EventHandlers {
respawn = "[(_this select 0), 'respawn'] call salmon_heac_fnc_adjust";
getInMan = "[(_this select 0), 'in'] call salmon_heac_fnc_adjust";
getOutMan = "[(_this select 0), 'out'] call salmon_heac_fnc_adjust";
};
};
};
//placed in config.cpp/bin inside mod addons folder
//works perfectly fine
class Extended_Respawn_EventHandlers {
class CAManBase {
class Salmon_heac_respawn_eh {
respawn = "[(_this select 0), 'dead'] call salmon_heac_fnc_adjust";
};
};
};
class Extended_getInMan_EventHandlers {
class CAManBase {
class Salmon_heac_getInMan_eh {
getInMan = "[(_this select 0), 'in'] call salmon_heac_fnc_adjust";
};
};
};
class Extended_getOutMan_EventHandlers {
class CAManBase {
class Salmon_heac_getOutMan_eh {
getOutMan = "[(_this select 0), 'out'] call salmon_heac_fnc_adjust";
};
};
};
how didn't it work? Ie., what were the errors reported
no idea then, sorry
I did diag_log and systemchat and neither of it worked on the vanilla. It made no sense..
my question today: Draw3D missionEventHandler & drawIcon3D don't appear to work on created camera interfaces (camCreate), any suggestions for a workaround?
Although oddly they seem to work in BIS_fnc_establishingShot, and I can't figure out how
nvm, solved my own problem, cameraEffectEnableHUD true; - has to be called after the camera is activated
Please tell what's not working. I don't want to go looking for missing semicolons when thats not the problem
What's an easy way to check if a unit looks trough a rangefinder?
returns "GUNNER" if they are using optics
and check if their primaryweapon is the rangefinder
currentWeapon*
neat
for running code in a condition, it has to be in {} right? or can we (code; true) ?
would (true && {code; true} && {condition}) be necessary to run code before condition?
does the firedEH works on a rangefinder? What I want to simulate is the marking of a target with it and then on that "laser pos" something gets executed. So guy pulls out rangefinder, "shoots" and then code
Best way to disable collision on a physx object like a building? I know that disableCollisionWith is just vic based but I want to disable a skyscraper collision so I can set up a proper building floor!
@pulsar trail keep questions on one channel
@hollow lantern why not just waituntil laserTarget for that unit?
like waituntil the laser target is a valid position
Its more of a scripting question than before so thats why I moved it
can you make a new model for it with no collision geometry?
if you dont want something to have collision with anything to begin with, then that would be the best option
No I was hoping I just could disable the collision
feel free to disagree, though. I only do scripting and that very little
@ebon citrus that is actually a nice idea
also something Dscha gave an idea to do if you dont want the waituntil to run on each frame:
waitUntil
{
uisleep 0.1;
someBoolVarToCheck
};
@pulsar trail delete the message on the other channel please to keep the discussion on one channel please.
@ebon citrus do you by any chance know if I can return the unit of an object dynamically? In your example now with laserTarget I need to fetch the unit based on the rangefinder. Aka if the rangefinder will be passed on to another unit that should be used instead
lineIntersect ?
i think he is talking about getting the unit lazing the lkazertarget
thing is , one of the parameters for lazertarget is the unit that you want to get the target for
so you need to figure out the unit you want to get the target of and work from there
ah
yup
i'm not entirely sure if you can attach any kind of namespace variable to a specific item
Using that?
https://community.bistudio.com/wiki/laserTarget
doesnt sound like sopmething you can
so attaching a script to a specific item is not possible as far as im aware of
well you can use setVariable and getVariable
different topic, dscha
well I need _unitThatIsWatching but base off a rangefinder
cant
?
so if UnitA has it, it will return UnitA
forEach unitstuff
they are asking if they can attach an identifier to an inventory object
if the rangefinder will be handed to UnitB it will be UnitB
and check which unit is holding it
Then check for Inventory obj
you can't identify any specific laser range finder
maybe a laser code with laser designator
are laser code vanilla?
https://community.bistudio.com/wiki/currentWeapon
{
if(currentWeapon _x == "NameOfLaserThingy")then{_doStuff};
}forEach UnitThingy;```
Or whatever it was using
yeah, but that works off of classnames
so anyone with that object in general gets to use the feature
not just THAT SPECIFIC item
they are asking if they can attach an identifier to an inventory object
That is a no, sadly.
with ace, you could probably use laser codes to identify a specific designator
There seem to be IDs internaly, but nothing we as users can get.
not even setVaraible works ?
Or just store the unit that has it in missionNameSpace and request it from there (of course, when it picks it up, store it in there)
so basically, you need to track yourself which unit has the designator somehow and work from there
not even setVaraible works ?
No, doesn't.
hmmm sad, ok
inventory items are not actually objects
the inventory is just an array that holds information of what, in what condition you have
yeah
@pulsar trail , yes, activating the laser desi is 'firing' it
why was i tagged my appologies
My question was about disabling collision on a building which cant be done sadly π¦
lol, ok
who should i have tagged if not you?
it's @hollow lantern
wow.. not had a drink yet, either
np
@slim oyster yes. Semicolon only in code block
as long as it eventually returns a boolean, can you make nested if conditions inside the lazy evaluated code block?
Yes
It's a normal Codeblock like any ither
Could also pass function variable instead of cblock
thank you
So it looks like even if you createGroup with the deleteWhenEmpty boolean set to false, arma will still eventually delete the group when it's empty.
is there a local mission namespace?
i would like to integrate the spectrum device in a multiplayer environment, but having more than one would be really hard if the mission namespace is always global and i cant set per-device variables
or rather, "per-user" variables
The missionNamespace of playerX != missionNamespace of playerY
am i misunderstanding some part of "global" in Returns the global namespace attached to mission.
ahh, public
heck*
i am
good one Heyoxe
global != public
Best way to outright deny the usage of nvg equipment to a multiplayer server because disableNVGEquipment is for vehicles so it says?
So, i just recently started making a real arma mission in the editor and the scripting of waypoints is a little... daunting. I had a get in waypoint working a few nights ago but it's not working anymore.
I'm literally just copy/pasting code from the wiki documentation for waypoint scripting. I'm trying to get transports loaded and moved, and unloaded with soldiers/ pilots.
doesnt Eden have waypoint functions for that?
I linked a driver's load waypoint with a group's get in waypoint but, that's just broken stuff
yeah, mmm...
It does yeah
ok, thank you
if you want help in bypassing the whole waypoint system and scripting AI to do stuff instead, im all for that
I do need some with something called a "knowsabout" script. I need to use this in order to trigger reinforcements
Can I use a while true loop in arma?
yes, you can @pulsar trail
but if you "should" is another question
very case sensitive question
There's an officer in the base and his sole job is to callout for help. But I don't know how to make it so that when the enemy detects the players, the man runs off and triggers all manner of help
Yeah i want to constantly have nvgs off unitl somthing is destroyed
yeah, jsut dont
okay whats a better solution to just have the nvgoggles off?
just make some plot-point to give your units NVG's once the device is destroyed
or make a fake-nvg's and replace them with rela ones
like NVG's that take up the nvg-slot but are not actually nvg's
and call them like...
"NVG's (broken)"
or something
how would one force gear to a multiplayers units
@hoary torrent https://community.bistudio.com/wiki/knowsAbout
make the "Officer" into its own group
and check until that unit is aware
Either way thanks nica π
awesome, thank you very much
Awesome and one last question wheres a good document for like parent classes of things like for multiplayer is "player" like I guess naming conventions
π
those terms you have dont really go together
killzonekids tutorials helped me quite a bit when I first dabbled with scripting, those might help you too
then BI wiki has a looot of pages about that stuff
Does anyone know if a script exists that can save/export a camera's exact position and rotation? I want to take comparison screenshots between two versions of a terrain and the only way I have been able to ensure the images are aligned and oriented in the exact same way is to simply save a mission in the 3den editor, and load it again with the changes. With two terrains loaded, I can simply do this, remain the mission folder to use the other terrain, and load the mission again.
But, that is inefficient and in my case, won't work, since i would need to unload addons and restart the game entirely, which is far too slow. I also plan to take a significant number of screenshots to compare.
My idea for a solution would be to have an action or key that would "record" the current camera position, rotation, fov, and everything else relevant, and export it. That way, I can simply have a script that loads this data, so when I restart the game, I can take the new screenshots in sequence and have them be properly aligned.
I can't seem to find a good way to do this. There are commands to get the eden camera, but none to get the rotation.
set camera position in eden for the curator object not good enough?
if not, then you want to look at https://community.bistudio.com/wiki/camPreparePos
and
https://community.bistudio.com/wiki/camPrepareTarget
or
here's the whole list of junk: https://community.bistudio.com/wiki/Category:Command_Group:_Camera_Control
i suggest you use cameras
set camera position in eden for the curator object not good enough?
I don't know what you mean by this
what is the curator object?
"zeus"
set camera position is under the zeus stuff in 3den
haven't messed around with it too much because i like scripts
it's ok for keyframes though
and world building
so it seems π
all good
I'll look into it, thanks. The main issue I have is being able to export and reload the exact rotation of the camera from within 3den
sounds awfully specific
why within 3den?
is that like some sort of fetish?
no shaming though
π
anyways, if youre looking for editor stuff, go to #arma3_editor
everything else is already mentioned here
this is where you want to start for camera related stuff: https://community.bistudio.com/wiki/Category:Command_Group:_Camera_Control
The 3den camera controls are much faster and easier to use, and I want to be able to quickly fly around and log camera info to be used again later
good luck
here
load into the world
make sure you have debug menu enabled for yourself or atleast the camera
open up the camera
hit "ctrl+c"
then paste it somewhere
hitting "ctrl+v" when you have that stuff copied immediately sets your camera to the exact point
@runic surge ^
or hit ctrl+ any number ROW key
and hitting that number row key again returns your camera there
2 ways!
and not at all related with scripting
That seems to work almost perfectly
I didn't realize that actually saves the rotation now
Maybe it always did and I'm just a moron lol
thanks for help anyway though @ebon citrus
π
https://sqfbin.com/ohesucesabiwinafovov who could tell me the mean of the line 6 and line 11 ?tks!
@slim oyster Yes, on the one hand, independent to civ, and on the other hand, civ to independent, but I don't quite understand what "GUER" means.
tks!
Is it possible from within a script to change a models config setting, for example I would like to be able to change the following within a script, however, I am unsure how to both get the values and then set new values
extCameraPosition[] = {0.4, -0.2, -1.2};
};```
within a script to change a config setting
no
Bugger, thanks Dedmen
Hm whats the 'easiest' way to make a custom mission sound work with playSound3D
?
@oblique arrow this: https://community.bistudio.com/wiki/playSound3D
also, if you want the sound to be attached to an object, use say3d instead
How do I make an object or a screen in arma play a media, using an ace interact to play it?
you can't play videos but you can use the slideshow module for pictures
Here' a link do what Dedmen is talking about : http://killzonekid.com/arma-scripting-tutorials-ogv-to-texture/
Hm how do I show the missions info after loading into the mission? As in in some missions some ambient information like mission name time and location are shown in the bottom right of the screen
@oblique arrow https://community.bistudio.com/wiki/BIS_fnc_infoText
Check see also too. There are several functions with different style for that.
Thanks
Hey, Im trying to get this particular wake up animation working on all players for my MP mission, Ive tried swapping out player for another variable name but no luck, any help?
playSound "b_in_intro";```
Where are you calling that?
@light moat
It's hard to help you when you don't give us any context as to where our when you are calling those commands
It only works on like the player
not any of the other playables
@ebon citrus would i find something like that in there
if you want to run it on the local client IMMEDIATELY as a player joins, use this in your initPlayerLocal.sqf:
waitUntil {
sleep 1;
(!isNull player && time > 0)
};
//your stupid sqf code here, please
the "player" global variable is also only available on a client
yeah?
do what? run your code as the player logs in?
btw, if you want to be ultra secure, use like... (!isNull player && time > 1) or (!isNull player && time > 5)
Not necessarily, I want them to spawn and just kind of do the wake up from the start
some people have slow PCs
precisely
yeah, then that should be good
So just drop that in the Init
use this in your initPlayerLocal.sqf
also, might want to PlayMoveNow
switchMove has a tendency to get people stuck
I assume i have to make a notepad++ thing for that .sqf
Copy
Executed locally when player joins mission (includes both mission start and JIP). See initialization order for details about when the script is exactly executed.```
so all I do is make that sqf and simply put the code in order
say something smart Dscha, im feeling a bit tipsy
In your mission folder, simply create a file named: initPlayerLocal.sqf
Add the code from above in it -> It runs, during the players initialization.
i run my spawning in GUI stuff with that script
i'm also not sure if it's valid to execute playmove, playmovenow or switchmove on a remote client
if that makes sense
so you might need to do it in initPlayerServer.sqf
the script i provided above DOES NOT work server-side, though
so just... see if it works
might get some weird results, like animations playing only on the client it is executed on when run locally, though
So your initPlayerLocal.sqf should look like this:
params ["_player", "_didJIP"];
_player switchMove "Acts_UnconsciousStandUp_part1";
playSound "b_in_intro";
https://community.bistudio.com/wiki/switchMove
Applies given animation to a unit. When used on a person, the given move is started immediately (there is no transition). Use _unit switchMove ""; to reset animation. For a smooth transition use playMove.
i recommend personally https://community.bistudio.com/wiki/playMoveNow
@jade abyss im pretty sure the _player variables is redundant in this case
initPlayerLocal is always local
so "player" should be just as good
let me know if im wrong
yeah i guess, as long as you have memory and clock as the sheep eat
so i just put the code you gave just in that sqf
Now i assume
i can try and start the scenario
?
remember ```
waitUntil {
sleep 1;
(!isNull player && time > 0)
};
//your stupid sqf code here, please```
Ok lemme try
are you sure
GUI stuff wont load if it runs immediately
and it's really unpredictable, especially on slow PCs
params ["_player", "_didJIP"];
+UI Stuff != other stuff. Maybe the display get's loaded to late (or whatever)
Ok so
fair point
I made the SQF
all i have in it is this
params ["_player", "_didJIP"];
_player switchMove "Acts_UnconsciousStandUp_part1";
playSound "b_in_intro";
That's most likely more like, what ya want @ebon citrus
waitUntil{!isNull findDisplay 46};
is that correct
@jade abyss
just try it
i did
Instead of asking, just start it.
If it doesn't work, tell us the problem.
I will try
Nobody is going to rip your head off, if you got it wrong π
IDK man...
Just keep on testing
ALSO:
Start your game with the "show Script Errors" option enable in the A3-Launcher
@light moat
arma 3 once crashed
also, what's up with UserTexture10m_F
if you set it a texture and shoot it... the game crashes
@jade abyss I dont see the animation, however i hear the Sounds script
No clue, never used
@light moat At least you have the sound, probably the animname is wrong?
that name looks weird
No, i used it in SP with the player thing
Have you tried executing it in the editor before? Seeing if it works at all?
it worked
just like it did in the anim in east wind
when you wake up on the beach
No @ebon citrus
try https://community.bistudio.com/wiki/playMoveNow @light moat
Can't check atm myself.
if you set it a texture and shoot it... the game crashes
@ebon citrus chcked the feedback-tracker?
@light moat To be sure it's beeing loaded:
Add systemchat "i was loaded"; to the beginning of the file
Β―_(γ)_/Β―
Ok yeah its loaded
but its not working
@jade abyss i hear the sound still
i mean, you've tried everything surely already
Its gotta work though
I have tried it on SP
it work
MP no work
but ive seen it been used
in like Maxor videos
one of 2 things
start with trubleshooting
can you execute it manually in the debug console on "execute local"?
does it work?
on the server
but execute it locally
make sure to enable the debug console in description.txt
makes debugging a hela lot easier
if it is working, then maybe... jsut maybe , give a shot to trying to delay executing after the player is loaded with the script i provided
alright, great
so i was onto something earlier
abouts here
you might need to run the script in initPlayerServer.sqf instead
same script should work, but do the playmusic locally
so
initPlayerLocal.sqf
params ["_player", "_didJIP"];
playSound "b_in_intro";
and initPlayerServer.sqf:
params ["_player", "_didJIP"];
_player switchMove "Acts_UnconsciousStandUp_part1";```
ok?
yes
are you working on some already existing script or is this a clean slate?
clean slate
roger
ok
am goiung to try
IT WORKED
:DDDDDDDDDDDDDDD
THANK THANK THANK THANK
@ebon citrus
oh and thank you @jade abyss
:)))))))))))))))))
Btw: You started your game with show Script Errors?
nop I did not
This will help you ALOT with errorsearching
I will from now on
thanks a bunch yall
@light moat Btw:
Favorite this page, it will be the biggest help you can get (Ctrl+F to search on it) + read the descriptions+Example properly.
(also the first thing i do open up, when i start stuff for coding π )
https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3
Be sure to be able to endure alot of pain and suffering.
Wanna eventually help develop with the Operation Trebuchet mod
Love halo a lot, ive heard a lot of negative things about BIS cod
so
i am ready
well
are we ever truly ready
nope.
lmao
And you never stop learning π
just smack letters together until they worjk
π
i've found it more useful to learn to speak gseon the side with any programming language
than to bookmark a bunch of websites
ofcourse, you SHOULD bookmark
but dont rely on just that
gse: Google Search Engine
@ebon citrus now heres a fun thing to try
can i have it target specific player slots
lets say
i am zeus
i dont want that animation
yeah
give that slot a varibale name
and make sure that the script is not executed on a player if they are that variable name
can i make it like officer1,officer2,etc
do you use Eden?
in the "name" field
question, if you may?
yep
yeppo
oh boy, ok
we can take this to DMs?
because im not going to lie, im going to be a bit rude, but i assure you we will get this done
one way or the other
or i can point you to a bunch of biki links like a platonic butthole
this would happen as each player loaded in
i could simply load before hand now?
and then as the players load in
they too, will enter the same anim
youre already doing that
you jsut dont want the player slot to get done in
so do you just want the work done for you or do you want me to teach you?
no offense, just be clear with me here
ok
can you DM me your initPlayerServer.sqf?
Or post on pastebin and send link here, so more people can look into it π
player addEventHandler ["Fired", {[player, "Laserdesignator_03"] execVM "itsAebian\KI_OrbitalStrike.sqf"}];``` seems fine for me, however the script doesn't get fired when I lase a target with a laserdesignator, I thought this counts as fired, tried with ``FiredMan`` also
Q: do you need to detach objects before re-attaching them, i.e. to a different location on the hosting object?
I guess that every one that has _display or _displayorcontrol can be used on display https://community.bistudio.com/wiki/User_Interface_Event_Handlers
@ebon citrus thanks, so to avoid funny or bouncing animations I might disable the simulation on the attaching object?
@dreamy kestrel unless the attached object is ragdolled, there shouldn't be any issue. I have not noticed any, atleast.
@austere granite Did you create a new display and suddenly they don't work?
its in buldozer, seems like it doesn't want to work for that π¦
keydown works fine, but mousedown or whatever its called does not
Any pointers why ```sqf
addMissionEventHandler ["EntityKilled",{
params ["_killed","_killer","_instigator"];
_vehicles = [veh1,veh2,veh3,veh4];
if !(_killed in _vehicles) exitWith {};
[_killed] spawn {
params ["_killed"];
_var = vehicleVarName _killed;
_type = typeOf _killed;
sleep 10;
deleteVehicle _killed;
_newVeh = _type createVehicle [0,-40,0];
_newVeh setVehicleVarName _var;
missionNamespace setVariable [_var,_newVeh,true];
waitUntil {isNull _killed};
if (_var == veh1 || _var == veh2) then {_var call TEST_fnc_respawnFnc1};
if (_var == veh3 || _var == veh4) then {_var call TEST_fnc_respawnFnc2};
};
}];
errors with ```if (_var |#|== veh1 || _var == veh2) then >
10:01:08 Error position: <== veh1 || _var == veh2) then >
10:01:08 Error Generic error in expression``` ?
(Trying to achieve vehicle respawn functionality with sleep with this ππΌ )
Because _var is a string and I presume that veh1 - veh4 are objects. == requires comparisons to be of the same type.
Thanks Gnashes. Got that problem solved just a tad earlier by referencing to _newVehicle instead of _var so as far as I understand anything of that the issue was exactly what you pointed out it to be
Anyone know if there is docs for https://github.com/overfl0/yapbol . Trying to use python with PBOs and trial and error is getting tedious
@final vessel
There are no docs @surreal peak :)
You can take a look at the tests in https://github.com/overfl0/yapbol/blob/master/test/yapbol_test.py if they are of any help to you
But as stated, the library is in alpha state for now. Some things are less optimized than they could be, etc..
I never had the time to improve the library besides what i needed, myself, at the time of the writiing π¦
thanks, its been a while since ive used python so im coming back to it, seems like im doing some more reading then π
thats fine, I should figure it out
thanks for help!
If you have any questions, mention me because I'm not following this channel @surreal peak
will do, thanks!
is there any version of addWeaponWithAttachmentsCargo that works for players?
I'm trying to add a primaryWeapon in a players primaryWeapon slot with a specific mag (and ammo) as well as attachments.
Hey
Is this a coincidence
π€
@tough abyss addWeaponItem is most likely what you're looking for
there's not a version which can add attachments main and secondary muzzle mags with ammo etc etc
addWeaponWithAttachmentsCargo is so easy to combine with weaponsItemsCargo
player addWeaponItem ["arifle_MX_GL_ACO_F", ["1Rnd_HE_Grenade_shell", 1, "GL_3GL_F"]];
This is actually putting a HE shell in the 3GL launcher on the MX-GL
you get an exact copy without having to write anything yourself at all
IE: ```sqf
_unit addWeaponWithAttachmentsCargo [weaponsItemsCargo _weaponHolder select 0, 1];
@surreal peak basically, from what I remember, you just fetch the file from the PBO using the methods available in the test file, linked above, and then when you have the file_entry, you can access the file contents with file_entry.data
the addWeaponItem doesn't support multiple magazines or attachments. You'd have to do some type of loop and link them I guess
@tough abyss yes you have to use addWeaponItem and loop it somehow.
would've been a lot cooler if there was a non cargo version lol
thanks
so you know how there are OFPEC name thingys, is there a place in PBO's where people will place this?
TAGs, you mean? @surreal peak
yes
yes @winter rose
Testing out: a trigger is created by pressing Server Exec in dedicated server with the following input
dmgTrigger = createTrigger ["EmptyDetector", getMarkerPos "Marker_1", TRUE];
dmgTrigger setTriggerArea [1000, 1000, 0, TRUE];
dmgTrigger setTriggerActivation ["ANYPLAYER", "PRESENT", TRUE];
dmgTrigger setTriggerStatements [
"this",
"_x = _this select 0; _x setDamage 1;",
""];
but the OnActivation is not killing the player (me that is). I thought _x would be the magic variable for everything but apparently it isn't.. so what gives?
(thislist select 0) setDamage 1```
@forest ore
Does anyone know how to call up textures / data from a mod in Eden editor? Like the file path for them? I'm trying to use the object specific Texture #0 on the "Banner" object to retexture it to a texture I put in my custom mod, is this possible or can you only use game / mission textures?
Basically I just want to cut down on the size of the mission file by including textures in mod rather than in mission
you totally can call mod textures yep
as for the path I am not sure so I let other people answer about it
The path for the mod would be the path in the pbo structure @tough abyss
So if your pbo is test.pbo
/test/mypath/texture.paa
Would /test/ be A3 or ?
Like where would it start since it's clearly dependent on the user
Or
Oh
Test is the PBO name
yes
But it would start at test and not anywhere else?
/[your pbo name minus .pbo/[path to texture]/[texture].paa
Gotcha, I'll try that rn
You can do absolute file paths aswell
C:\mypath\texture.paa
That wouldn't work nicely though if you plan on distributing it to multiple people
pls dont even suggest that
thats how people learn to do mods the wrong way
@tough abyss to build proper addon you will need to setup the mod development tools and development environment correctly.
PMC wiki has steps to set up arma 3 tools and P drive
follow those to the letter
@winter rose Yesterday at 10:49 PM
"(thislist select 0) setDamage 1"
Oh so that's how it was supposed to go this time around. Finally got to test it also so here to confirm that it works (of course, how else). Thank you Lou π
Well, now what is wrong with this then. I used to have editor placed triggers but had to switch to scripted version for reasons. In the editor placed trigger's Condition field I used (thislist findIf {side _x==east || side _x == resistance} == -1) with no hiccups. With the editor placed trigger as activation I used ANY. Now with the scripted version that same condition does not seem to work anymore:
hideyMrkr = createTrigger ["EmptyDetector", position civVeh_1, TRUE];
hideyMrkr attachTo [civVeh_1, [0, 0, 0]];
hideyMrkr setTriggerArea [1000, 1000, 0, TRUE];
hideyMrkr setTriggerActivation ["ANY", "PRESENT", TRUE];
hideyMrkr setTriggerStatements [
"(thislist findIf {side _x==east || side _x == resistance} == -1)",
"['vehMarker_1', 0] remoteExecCall ['setMarkerAlphaLocal',-2];",
"['vehMarker_1', 1] remoteExecCall ['setMarkerAlphaLocal',-2];"];
Are you running it locally? -2 will exclude you as server
Testing on dedicated
sorry, nothing jumps out at me
FYI if I use EAST or INDEPENDENT as activation and have this in the sripted trigger's Condition field then the scripted trigger works (as in the "vehMarker_1" changes it's Alpha as expected)
Ahh, for the functionality I was looking to achieve one way that I found working was to turn the Condition "around" with !(thislist findIf {side _x==east || side _x == resistance} == -1)
you could enhance readability with sqf side _x in [east, resistance] @forest ore π
That I will most certainly check out Lou! π€
FWIW I always use independent instead of resistance
old habits die hard :p
the arma3 ones are blufor, opfor and independent
{
_lootHolder addWeaponCargoGlobal [_itemClassName, 1];
if !(_itemClassName isKindOf ["Exile_Melee_Abstract", configFile >> "CfgWeapons"]) then
{
_magazineClassNames = getArray(configFile >> "CfgWeapons" >> _itemClassName >> "magazines");
_blackList = [ "rhsusf_5Rnd_HE","rhsusf_5Rnd_FRAG","rhsusf_8Rnd_HE","rhsusf_8Rnd_FRAG","rhsusf_5Rnd_doomsday_Buck","rhsusf_8Rnd_doomsday_Buck"];
{
if ( _x in _blackList ) then {
_magazineClassNames set [ _forEachIndex, -1 ];
};
}forEach _magazineClassNames;
_magazineClassNames = _magazineClassNames - [ -1 ];
if (count(_magazineClassNames) > 0) then
{
_magazineClassName = selectRandom _magazineClassNames;
_numberOfMagazines = 2 + floor(random 2);
_lootHolder addMagazineCargoGlobal [_magazineClassName, _numberOfMagazines];
_spawnedItemClassNames pushBack _magazineClassName;
};
};
_numberOfItemsToSpawn = -1;
};```
Can someone tell me why the blacklist isnt working ? π
what's your error
Not sure I like this construction _magazineClassNames = _magazineClassNames - [ -1 ];
@sharp grotto be sure to enable -showScriptErrors in the launcher, to see script errors when (and where!) they happen.
When a vehicle gets deleted, the dead units inside cannot be deleted but they still are not null objects and they appear in allDeadMen
anyone know a fix?
i don't delete the vehicles, they delete themselves after they explode an such
otherwise is there a way to check if the unit is just not visible but not null?
cause isObjectHidden returns false
Are you just using vanilla garbage collection?
its not really for any particular mission
so I would need vanilla garbage collection to work
it has to just be some kind of arma 3 bug
Yes
that is super annoying
i created a ticket https://feedback.bistudio.com/T148420
hopefully they fix it but who knows with bohemia
I've been hunting down a strange behavior with a script and think I got it to a point where its reproducible. I have a script firing from init_server which redresses on a case basis, most units. It works properly if I log in and get mission running before the headless clients connect. If HCs connect at startup/before players init, the script doesnt fire properly.
Does this behavior sound familiar to anyone?
@grave lotus sounds like ownership of units is messed up, or synchronization of initialization with HCs is broken
@echo yew I guess you can do it client side, check player's name, then endMission for him with explanation that his name has wrong characters
why, did someone wipe your database? π
serverCOmmand needs password to be passed to it
Instead of pbo containing scripts with password, just prompt whomever is logged as admin at the tine.
Might get annoying after a while, so if some client preference has this disabled, then instead just endMission them yes
Method given isnt rcon
you asked in scripting so we assumed SQF
all SQF
@astral dawn that sounds about right. i could cause the state by connecting the HCs. works fine before/without. Is there a best practice here for syncing HCs? I have a routine running in init which scoops up aispawned units in zeus. Could I perhaps use that to execute my redress and have that propigate to the HCs?
can you show me how units are redressed? I believe that it must be called locally on the computer which owns the unit, right?
@astral dawn I have init_server firing [] execVM "GF_Set_Custom_Loadout\Vanilla\GF_SCL_allUnits_REWORK.sqf";
well, must see what's inside that script of course
The script itself is: GF_SCL_allUnits = {
_this unlinkItem "NVGoggles";
_this unlinkItem "NVGoggles_OPFOR";
_this unlinkItem "NVGoggles_INDEP";
params ["_unit"];
if !(isServer) exitWith {};
if (isPlayer _unit) exitWith {};
private _side = side _unit;
private _unitType = typeOf _unit;
switch _side do {
case INDEPENDENT: { case "I_E_Scientist_F": {
removeAllWeapons _unit;
_unit unlinkItem "NVGoggles_INDEP";
_unit removeWeapon primaryWeapon _unit;
_unit removeWeapon secondaryWeapon _unit;
_unit removeWeapon handgunWeapon _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
_unit forceAddUniform "skeleton_u";
_unit addVest selectRandom ["V_Chestrig_blk",""];
_unit addWeapon "SMG_02_flash_F";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
};
default {
_unit unlinkItem "NVGoggles_INDEP";
removeAllWeapons _unit;
_unit removeWeapon primaryWeapon _unit;
_unit removeWeapon secondaryWeapon _unit;
_unit removeWeapon handgunWeapon _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;
_unit forceAddUniform "U_O_R_Gorka_01_black_F";
_unit addWeapon "SMG_02_flash_F";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addMagazine "30Rnd_9x21_Mag_SMG_02_Tracer_Green";
_unit addVest selectRandom ["V_Chestrig_blk"];
_unit addHeadgear selectRandom ["H_PilotHelmetHeli_B"];
_unit addGoggles selectRandom ["G_her_GasMaskA"];
};
};};
_this linkItem "ItemMap";
_this linkItem selectRandom ["ItemCompass","","","",""];
_this linkItem selectRandom ["ItemWatch","","","",""];
_this linkItem "ItemRadio";
//________________ reload handgunWeapon ________________
_this selectweapon handgunWeapon _this;
sleep 3;
reload _this;
sleep 8;
//________________ reload primaryWeapon ________________
_this selectweapon primaryWeapon _this;
sleep 3;
reload _this;
sleep 8;
//________________ reload secondaryWeapon ________________
_this selectweapon secondaryWeapon _this;
sleep 3;
reload _this;
};
//________________ *** End *** ________________
[] spawn {
while {true} do {
{
if (
((alive _x))
&& (!(_x getVariable ["Var_GF_SCL_allUnits",false]))
/*
//________________ You can filter the side here ________________
&& {((side group _x) == west ||
(side group _x) == east ||
(side group _x) == independent ||
(side group _x) == civilian)}
*/
// && (side group _x == playerSide)
// && (!(side group _x == playerSide))
) then {
_x spawn GF_SCL_allUnits;
};
_x setVariable ["Var_GF_SCL_allUnits",true];
{waitUntil {!alive _x};
_x setVariable ["Var_GF_SCL_allUnits",false];
};
}forEach allUnits;
sleep 5;
};
};
thats it, pared down. the important part I think is the flag set for units which have been added to the Var_GF_SCL_allUnits variable in relation to the HCs
i an replace it with a simple case test if that helps. π Put santa hats on em or something
Use code blocks for easier and nicer reading plox @grave lotus
aok π
neub π
Ive avoided scripting for like 2 decades of computer hustling π
I mean in discord tho
yes π first time cut/pasting π
@grave lotus
```sqf
hint "text";
```
hint "text";
Please format your above message to make it readable
lemme work on that π
thanks!
@grave lotus commands like removeWeapon and such require unit to be local, are you sure that he is local?
thats likely IT! They arent
what is the global equivalent for weapon?
removeWeapon ratjer
rather
There is none, use remoteExec to pass it to the unit owner.
so I remoteExec the script rather than exec?
yep!
whole script
better remoteExecCall
oh, and GF_SCL_allUnits_REWORK.sqf must be made a function, preferably
unless I am doing something wrong removeMissionEventHandler does not seem to be working
I have it assigned to a handler variable such as handler = addMissionEventHandler ["EachFrame", {}];
I am removing it with removeMissionEventHandler ["EachFrame", handler]; but every time I add the event handler again it increments the ID as if the previous one was never removed
the wiki specifically states "When any handler is removed, all handler indices higher that the deleted one should be decremented." https://community.bistudio.com/wiki/removeMissionEventHandler
and when i use removeAllMissionEventHandlers "EachFrame"; it resets the ID back to 0
