#arma3_scripting
1 messages ยท Page 433 of 1
Sorry. ๐
[
Marshall_Dude_1,
"Preparation",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance player < 2",
"_target distance player < 2",
{},
{},
{
p2 switchMove "Acts_JetsCrewaidL_idle_m";
sleep 3;
p2 switchMove "Acts_JetsCrewaidFCrouch_in";
sleep 2.9;
p2 switchMove "Acts_JetsCrewaidFCrouch_loop";
sleep 2;
p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_in";
sleep 2;
p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_out";
sleep 1;
p2 switchMove "Acts_JetsCrewaidFCrouch_out";
},
{},
[],
0.5,
1000,
false,
false
] call BIS_fnc_holdActionAdd;};```
why?
Only display the addAction in the scroll menu
afaik that is not possible for hold actions (without some tricks), there are noshowWindowparam like withaddAction... but you can try to set action priority at negative value, @ornate pawn
EDITED @knotty mantle @ornate pawn
condShow: String - Condition for the action to be shown. Special variables passed to the script code are _target (unit to which action is attached to) and _this (caller/executing unit)
you dont need that while
Just edit that line.
I will try that Capwell and if doesn't work then i will have to use the old AddAction
nope. Edit that into the string in 5th and 6th line.
these are conditions designed to make sure the action shows up.
tbh it would be nice to have a holdaction for the doors.
Yeah
Yup
I have a towing system that is working and everything is in addAction
when you get close the landing platform and park the towing vehicle close to it you can attach that platform to it and get the platform out of the hangar
and detach the little bird that is attach to that platform
pretty cool
i wish i could make the attachto more realistic
[
Marshall_Dude_1,
"Preparation",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance 'markername' <= 10",
"_target distance 'markername' <= 10",
{},
{},
{
p2 switchMove "Acts_JetsCrewaidL_idle_m";
sleep 3;
p2 switchMove "Acts_JetsCrewaidFCrouch_in";
sleep 2.9;
p2 switchMove "Acts_JetsCrewaidFCrouch_loop";
sleep 2;
p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_in";
sleep 2;
p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_out";
sleep 1;
p2 switchMove "Acts_JetsCrewaidFCrouch_out";
},
{},
[],
0.5,
1000,
false,
false
] call BIS_fnc_holdActionAdd;
This should btw help you out. Not sure if you need the single quotations around your markername tho.
Youยดll have to fiddle around a bit with that.
what you guys trying to do ?
The addAction wont work with empty marker
haha i added a helipad invisible and it works but the addAction stills appears on my scroll menu at all times
how is it going @meager heart
with marker you need https://community.bistudio.com/wiki/markerPos
meeh its cool i will use the helipad with animation disable
but @meager heart do you know how to hide BIS_fnc_holdActionAdd ?
this is my script:
[
player,
"Preparation",
"scripts\BEW\Logistics\images\attach_ca.paa",
"scripts\BEW\Logistics\images\attach_ca.paa",
"_target distance p2 < 5",
"_target distance Marshalling_Area < 5",
{},
{},
{
p2 switchMove "Acts_JetsCrewaidL_idle_m";
sleep 3;
p2 switchMove "Acts_JetsCrewaidFCrouch_in";
sleep 2.9;
p2 switchMove "Acts_JetsCrewaidFCrouch_loop";
sleep 2;
p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_in";
sleep 2;
p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_out";
sleep 1;
p2 switchMove "Acts_JetsCrewaidFCrouch_out";
},
{},
[],
10,
1000,
false,
false
] call BIS_fnc_holdActionAdd;
the addAction works but its on my scroll menu at all times
how can i hide it or disable if im not close to the marshalling_area
on screen ?
yeah on my scroll menu
so it will be only in scroll menu and not on screen ?
no
okay
I'm trying to do marshalling animations
for a milsim base
but i want airforce guys to have marshalling actions only if they are inside the marshalling area
but
the addAction is there all the time on my scroll menu i want it to disappear if im not inside the marshalling area
understand?
i'm not good at explaining things haha
@drowsy axle https://pastebin.com/y9hfCA73 make sure you add this setVariable ["status","opened",true]; to all the doors initcode
Okay
what is Marshalling_Area ? @ornate pawn
are you guys trying to open a door with animation or just unlocking and locking the door?
Marshalling_Area is a helipad
ok
I'm using it to mark the marshalling are so the signal man knows where to stand
in order to be able to marshall incoming helicopters
but those actions are in the players scroll menu even if i'm a mile away
action should be removed after use ?
not after use
okay
lets say im the signal man and theres a helicopter inbound
i need to run to the marshalling area in order to be able to get the actions in my scroll menu
and if i'm not inside that area then i want addActions to disappear
get it?
if im inside the marshalling area then i get the marshalling actions in my scroll menu
if im not then don't
thats what i want
ok
var_helipad < helipad name, replace it with your
0 spawn {
[
player,
"Preparation",
"scripts\BEW\Logistics\images\attach_ca.paa",
"scripts\BEW\Logistics\images\attach_ca.paa",
"_this distance2d var_helipad <= 5",
"_target distance2d var_helipad <= 5",
{},
{},
{
p2 switchMove "Acts_JetsCrewaidL_idle_m";
sleep 3;
p2 switchMove "Acts_JetsCrewaidFCrouch_in";
sleep 2.9;
p2 switchMove "Acts_JetsCrewaidFCrouch_loop";
sleep 2;
p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_in";
sleep 2;
p2 switchMove "Acts_JetsCrewaidFCrouchThumbup_out";
sleep 1;
p2 switchMove "Acts_JetsCrewaidFCrouch_out";
},
{},
[],
10,
10,
false,
false
] call BIS_fnc_holdActionAdd;
};
@ornate pawn
no addAction
maybe cause of this line?
"_this distance2d Marshalling_Area <= 5",
distance2d?
i change it to distance
and i was missing };
now it works
nice
thank you so much dude
hey
one more thing
how would you add the remoteExc to thos animations so everytbody can see the animations
[p2,"Acts_JetsCrewaidL_idle_m"] remoteExec ["switchMove",[0,-2] select (isMultiplayer && isDedicated)]; //--- fix for all kind of hosts
@ornate pawn
thanks dude
This is flawed. isDedicated already implies multiplayer mode.
Not really. switchMove has local effects and therefore has to run on every machine.
It should just be:
[p2,"Acts_JetsCrewaidL_idle_m"] remoteExec ["switchMove"];
Everything else is wrong.
A command having local effects doesn't mean it "isn't good for MP". No idea where you got that idea from.
remoteExec switchMove.
remoteExec makes the command be executed on remote machines.
okay
If you use my simple syntax it makes the command be executed on every machine.
Which is essentially the same as if switchMove had global effects.
Like, e.g. playMove.
so cause last time i was doing the marshall animations and the pilot didn't see any animations
i was just standing there hahaha
but on my end i was doing all the animations
also possible that playMove will not work with those animations, not sure
.... except that playMove only works when executed on the machine that owns the unit. remoteExec switchMove works when executed on any machine.
yeah i'm not using playMove i'm using switchMove with sleep command
to let it do the animation properly
You'll soon see how wonky it looks thanks to the scheduler. Have fun.
๐
We'll see if it'll be any better.
hopefully
arma 4 just will be... soon โข ๐
its been a long time
if i want to add another addAction to the sqf do i need to place it inside the 0 spawn { or do i need to place that before every single addAction?
don't understand why you adding hold actions to a player tbh
then should i use regular addAction?
regular actions would work better?
is because i wanted to add a custom image to the addAction
no i mean... you are adding hold action to a player and wait until he will be close to helipad... maybe add it for helipad ?
no cause he needs to be looking at the helicopter in order to marshall
you know what marshalling is right?
yeah... saw that in movies with john rambo couple times /s
lol
do you have any clue why the addActions wont work in MP?
do i need to add something to the script or the init.sqf
do you have any clue why the addActions wont work in MP?
sure... something went wrong
yeah but do i need to add something to the script or init.sqf?
cause it works for me but im hosting
and my friend doesn't see the action
how you add it ?
sqf file
1 sec
this is the only like in init.sqf
//Jail Door Lock
[] execVM "JailDoor.sqf";
and this is the sqf file
//- Open Jail Door
[
player,
"Abrir Puerta",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance JailLaptop < 2",
"_target distance JailLaptop < 2",
{},
{},
{
_target playaction "Putdown";
sleep 3;
JailDoor setVariable["bis_disabled_Door_1",0,false];
},
{},
[],
0.5,
1000,
false,
false
] call BIS_fnc_holdActionAdd;
//- Close Jail Door
[
player,
"Cerrar Puerta",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance JailLaptop < 2",
"_target distance JailLaptop < 2",
{},
{},
{
_target playaction "Putdown";
sleep 3;
JailDoor setVariable["bis_disabled_Door_1",1,true];
},
{},
[],
0.5,
1000,
false,
false
] call BIS_fnc_holdActionAdd;
@ornate pawn addactions need to be executed on each client, did you do that?
[
player,
"Abrir Puerta",
"images\take_ca.paa",
"images\take_ca.paa",
"_target distance JailLaptop < 2",
"_target distance JailLaptop < 2",
{},
{},
{
_target playaction "Putdown";
sleep 3;
JailDoor setVariable["bis_disabled_Door_1",0,false];
},
{},
[],
0.5,
1000,
false,
false
] remoteExec ["BIS_fnc_holdActionAdd", -2];
^but the best way would be to just make sure he also executes the script that adds the actions
initPlayerLocal or something
also with
"_target distance JailLaptop < 2", //--- caller _this
"_target distance JailLaptop < 2",
you will have the same troubles as it was b4
yeah just saw it
what is _target
replace it with ```sqf
cursorTarget / cursorObject
err actually, you just need
```sqf
player
no I mean try
okay
[
player,
"Abrir Puerta",
"images\take_ca.paa",
"images\take_ca.paa",
"player distance JailLaptop < 2",
"player distance JailLaptop < 2",
{},
{},
{
player playaction "Putdown";
sleep 3;
JailDoor setVariable["bis_disabled_Door_1",0,false];
},
{},
[],
0.5,
1000,
false,
false
] remoteExec ["BIS_fnc_holdActionAdd", -2];
I don't know where you are using _target if you actually mean the player
but let's assume you do
@ornate pawn ^
the action works perfectly in another mission
even in MP
i don't know why isn't working in this sample mission
perhaps you failed to rercreate the exact conditions then?
what do you do to execute it
init.sqf
How can i add remoteExc to this line of code? : JailDoor setVariable["bis_disabled_Door_1",0,false];
You don't, you can just use
JailDoor setVariable["bis_disabled_Door_1",0,true];
i had to add this in order to make the actions to work in mp
] remoteExec ["BIS_fnc_holdActionAdd", [0,2] select isDedicated, JailLaptop];
for some reason only the person that executes the action is able to locked and unlock the door
is that legit way?
private _y = _x;
Yeah, _y would equal _x...
Example:
requiredAddons[] = {"X", "Y", "Z"};
Uhm... I'm not sure....
"X", "Y", "Z" would be equal to .pbo names?
Just need your clarification guys
Does anyone know of a way to add items/weapon to a players dead body?
(unitbackpack _unit) addItem "FirstAidKit";
etc.
etc.
};```
Something like that...
Where "_x" โ player or id or anything you need.
where "_unit" can be "player" as well (but i'm not sure).
I tried add item but not on a bag, ill give it a shot thx
That's example, so just added for easy reading. What and where... ๐
@little eagle - CBA_fnc_createNamespace - this can create as many namespaces as we wish?
What is the best way to create a table UI element where each row in the table is a picture + text?
@fossil yew everytime you call it it creates a new one yes
sure there's a limit but you won't be creating 10k of them right?
that's fine
Shame there is no structure support in sqf
Language could be as powerful as javascript
You can create more than you'd ever need.
:)
@drowsy axle To your code from yesterday. Just don't optimize it. You won't make it any better.
I have a lot of object like 750, i want to optimize it, the problem, i need a simulation on each them when player is near, dynamic simulation is cool, but i think, not compatible, because too much object, if I made a loop that create a simple object when no have any player near 50 meter of the object, and if player is near, i create a vehicle, this will be really more optimized than dynamic simulation ?
probably you will lose more when that script/function/loop runs
-
is there a bis/cba fnc that makes the player entity throw a grenade (or any physx obj)?
-
how do you know if an obj is physx enabled or not? like cursortarget isPhysx?
I think CBA Fired XEH
i want a fnc that actually does the "firing of a grenade" or action throw something?
is there a grenade object dummy that doesnt blow up? i wanna throw rocks at people
_unit forceWeaponFire ["HandGrenadeMuzzle","HandGrenadeMuzzle"];
Oh missread.
what kind of grenade is HandGrenadeMuzzle? is that the vanilla rgn? (i need a bloody rock, or a way to disable that grenades explosion)
That's your hand
HandGrenadeMuzzle is a muzzle of the Throw weapon which only has one compatible magazine: HandGrenade.
It's the weapon. Your hand that does the throwing basically
what happens if the player doesnt have the grenade in the inventory will it still do it?
You can't fire a weapon with no ammo. Nothing will happen.
so i have to add the item to inventory first then run the forcefire? how can i then get that whatever thrown object into a var?
You want them to throw HandGrenade_Stone?
yes throw stone/rock/turd any non explosive and the object has to stay alive for awhile
Which object?
the HandGrenade_Stone
Grenades cannot die anyway. I mean they could, but they still explode as normal.
ok so first a have to additemtovest "HandGrenade_Stone""
then make a player addEH "fired" if ( firedBullet == "HandGrenade_Stone") //do stuff to it in flight
then throw action player forceWeaponFire ["HandGrenadeMuzzle","HandGrenade_Stone"];
am i on the right track?
@still forum Thanks. That's what I did. Ended up scrapping it anyway. ๐ฆ
The muzzle HandGrenadeMuzzle doesn't support the magazine HandGrenade_Stone. And it has no fire mode called HandGrenade_Stone either.
The muzzle HandGrenade_Stone supports the magazine HandGrenade_Stone. And it's only fire mode is also named HandGrenade_Stone.
So HandGrenade_Stone everywhere.
private _grenades = currentThrowable _unit;
_unit forceWeaponFire [_grenades select 1,_grenades select 1];
no ?
like just anything selected
Kinda. I think that would work, but only because the fire mode happens to be the same string as the muzzle for handgrenades.
ok so after i do player forceWeaponFire ["HandGrenade_Stone","HandGrenade_Stone"];
will that stone stay in game ? for how long?
@meager heart what does that code do?
The "stone" will be thrown and then it has a lifetime...
can i modify its lifetime in the EH?
ammo = "GrenadeHand_stone";
can i modify its lifetime in the EH?
No.
timeToLive = 6;
6 seconds.
Inherited indirectly from class CfgAmmo/Grenade
6s is not enough time, plus i dont want to mod cfg....
can i throw something thats not a grenade? like a physx baseball? (im guessing forcefire wont like that?)
You can throw a stone. Then on firedEH spawn a physx ball. Set it to the same velocity as the stone. And delete the stone
There is a physx baseball?
๐ค You could delete the grenade once thrown and replace it with a custom created object. Then you setVelocity on the object whatever velocity the grenade had.
๐
Of course also add torque to the object so it looks fancier once thrown: https://community.bistudio.com/wiki/addTorque
Requires a physx object though.
right thats a good idea! but yeah where can i get a physx object that small?
Well, is there a physx basketball?
cough i saw someone was throwing some animals... cough
there is a Land_Baseball_01_F but how to know its physx
Land_Football_01_F
Land_Rugbyball_01_F
Land_Volleyball_01_F
^^
They are all ThingX, so they are PhysX objects.
ok great, thanks guys !
can i make a script where units don't wander outside of a certain area?
Yes. Certainly
Could kill them. Or attach them to a lamp post.
Either you spawn invisible walls via script.
Or you check periodically if they are outside of the area and move them back.
Or just break their legs
lol
setvelocity 0 on the dudes?
Do human units have a velocity?
Is this about fleeing civilians? There is this: https://community.bistudio.com/wiki/allowFleeing
Do human units have a velocity?
Yes.
What they don't have is an up vector different from 0,0,1
Dumb question.. velocity player :D
does setting their velocity work? or do they speed up for a single frame and go back to normal?
I remember throwing playable units around in A2 using setVelocity.
Was fun on a server to make people float.
I remember making rocketjumps in A2
I would make Voold float in the air and then throw him down to his death.
Fun times.
we did little crysis mod... hold action with text "Maximum speed" and setVelocityModelSpace or setAnimSpeedCoef lol
in the rare occurence that the player is completely naked how do i add the ammo = "GrenadeHand_stone"; ?
(or force it to add even when all gear slots are full?)
add a dummy backpack, then add the grenade, then remove the dummy backpack.
Bag_Base is a nice one, because it has no model to load/show.
there is no forceAddIgnoreFull ?
lol, you funny
There is addWeaponItem, which works with magazines, but the last time I tried, it failed on the Throw weapon.
If there is literally no place to add something to
Dedmen, a mag to a weapon.
forceAddRockToUnderwear!
Not being able to hold anything, because you don't wear a uniform is a dumb flaw of the A3 inventory system.
biggest flaw is they are not even truly naked!! atleast take off that shirt!
That's even more unlikely to happen than exploding heads.
how about setting the ammo = "GrenadeHand_stone"; inventory weight to 0? (in script not cfg)
inventory weight to 0?
You need a container to hold it, even if the weight is 0. One container could hold infinitely* many of them though.
in script not cfg
Not possible.
i mean the weight property of the ammo itself not the container bkpk vest etc
Yes, me too.
so you can add them to full containers
Yep. Not possible. Not part of the scripting API.
Why not go the dummy backpack route?
yeah the bag base does solve most of the problems, wont the player see his bkpk flicker in out tho?
Oh, you mean for players with already full backpacks?
yeah
I thought you mean ai without any container.
Well you cannot add a grenade to a unit with full inventory period.
Another dumb limitation.
for something as simple as throwing a rock i have to violate the sanctitiy of a players inventory.
yeah so many dumb limitations
can c++ intercept get past stuff like this? or is it just a wrapper for native?
What about not actually throwing a grenade, but just doing the animation?
yeah that can work, but then i would have to manually do the physics on the obj? (velocitytransform , torque, etc)
Sure.
atleast then i wont need to add EH
Yep.
But the object needs to support velocity and stuff
I don't think houses can have a velocity
Basketballs do.
Ah yeah. They are ThingX
yeah its gonna be the Land_Baseball_01_F i think its the smallest of the bunch.
if i hideobjectglobal it, physx stops too?
Good question. I'm not sure.
https://community.bistudio.com/wiki/Arma_3_Actions
no throw grenade action??
they have example:
_logic action ["useWeapon", player, player, 7]; //player throws hand grenade
i dont get it
For that you need to guess the weapon index, which is a pretty hidden property and it changes depending on the history of what weapons the unit picked up and in which order.
Don't see any benefits compared to forceWeaponFire either.
yeah fucked up either way, ill probably just give up on adding the animation for now
how do i make an crate have a certain amount of items (e.g. 20 guns) and then for the guns to be translated into an infinite amount within the crate
Crates can only hold a finite amount of items afaik.
as in the crate system from the antistasi scenario
Should ask the developers on how to do that. Doubt anyone here knows.
kk, ty
Is there anyway to hide 3DEN's interface via script command?
findDisplay 313 createDisplay "RscDisplayEmpty";
???
not worked
What do you mean by hide?
Like backspace
Im working on this
https://twitter.com/polpox_avenger/status/970178224574537728
Maybe do3DENAction? https://community.bistudio.com/wiki/Eden_Editor:_Actions
Have you tried them all?
Try them all idolatrously?
I mean, some look promising like ToggleUnitSel.
Okay maybe that's the answer
{_x ctrlShow false} forEach (allControls findDisplay 313) ; //hide
{_x ctrlShow (ary select _forEachIndex)} forEach (allControls findDisplay 313) ; //show```
Thanks @little oxide
Does anyone know any good usages of multiline drawIcon3Ds that I could look at? Im trying to draw nametags above players with multiple lines, but cant seem to get it looking right because at different distances the lines seem to intersect
If, for example, Iโm transmitting publicVariableClient to publicVaribleServer stuff every second between letโs say 65 clients will there be significant network lag (server has good connection related stuff)?
The only content transfered is a bool
Or should I use get/set var with global param checked
publicVariableClient/Server is obviously better
Danke
Side question. If I setVariable with the public arg to true, and the value is the same locally, will it still broadcast the value? For example:
missionNameSpace setVariable ["MyGlobal", 456, true];
missionNameSpace setVariable ["MyGlobal", 123, false];
// Will this broadcast?
missionNameSpace setVariable ["MyGlobal", 123, true];```
yes it will
Because others may not have the same variable
and you are telling everyone to set that variable to what you want
Thx. Was also my guess, but you never know with Arma.
Edit: Well I guess we do know, but you know what I mean -- I guess.
From the BIKI I gather that, if you use public setVariable any addPublicVariableEventHandlers on the receiving sides do not run?
That's my thinking too. So the BIKI is wrong/omitting things in this case?
Where did you read that?
Well no where does it say that it does. Basically on addPublicVariableEventHandler: "This event handler will detect if a missionNamespace variable (it is attached to) has been broadcast over network with publicVariable, publicVariableClient or publicVariableServer commands and will execute EH code upon detection. "
For setVariable, on the 'public' parameter: "Boolean - when true, the variable broadcast is global and persistent"
My interpretation of broadcast here is that the new assignment is sent to others and JIPs, but not that broadcast automatically implies PVEHs run, especially since the docs for addPublicVariableEventHandler explicitly mentions only the public* commands. Maybe I am just weird, but even Example 2 for addPVEH does both the setVariable without broadcast and then does a public, although that example does look like it has been griefed - that variable name is not even valid is it?
I mean it all makes sense that it works like you say. Just not the impression I get from BIKI.
It will fire when a variable has been broadcast.
But you are not sure if broadcasting a variable will fire it?
Like... Just read what you just wrote?
Well sorta. If you say that: EH will happen if you BROADCAST with commands X, Y and Z... Then yes, it is not immediately apparent to me it will also happen if you broadcast using command W.
setVariable will trigger PVEH too. JIP however will not.
Oh, setVariable will not trigger the PVEH on the local machine. Only on remote machines. It's exactly the same as publicVariable.
Not sure what the setVariable owner version does when the target is the local machine.
My best guess is that it will set the variable, but not run any PVEHs.
Not so sure. The message will go through the server, because clients don't know owner ids.
So maybe it will trigger it anyway.
But what happens if you do it on the server?
publicVariableServer for example will trigger PVEH when executed on the server, while publicVariable will not.
Needs some testing I guess.
Sounds like. We can go even stranger. Like will publicVariableClient then trigger if the target client is itself?
publicVariableClient fails outside the server.
How do I get the position of a trigger from a script that's run in that trigger generically (without naming the trigger)?
getPosWorld thisTrigger
?
Wow. I was pretty far off. I was thinking like getpos this trigger.
Every trigger is an entity, and thisTrigger is a local variable in the trigger condition and activation scripts that report that entity. https://community.bistudio.com/wiki/this#thisTrigger
You were pretty far off? Not at all. You just had one space too many
Oh, shoot. @little eagle, I don't think this will work for my case, because the script isn't in the trigger field, it's an sqf being called by the script. I was trying to figure out how to say that, but I failed originally.
Also I tested it and it didn't work.
Wanted to be sure before I troubled you.
Pass thisTrigger to your script then.
I tried searching the Discord, because I know I've been taught this relatively recently, but I couldn't find the post. So... How do I do that?
private _fnc_myScript = {
params ["_trigger"];
hint str getPosWorld _trigger;
};
[thisTrigger] call _fnc_myScript;
This, inside the condition field, should print the triggers position twice every second.
And it's how you pass arguments to a function or script.
If i were to do publicVariableServer and the client happened to be losing connection (no connection left to server) would the request still go through once the connection is restablished?
They're sent as TCP messages or something. @Dedmen should know. https://en.wikipedia.org/wiki/Transmission_Control_Protocol
@little eagle
call {
thisTrigger spawn {
_G1 = [(getPos _this), WEST, ["B_Soldier_TL_F","B_Soldier_GL_F","B_Soldier_F","B_soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G2 = [(getPos _this), WEST, ["B_Soldier_SL_F","B_Soldier_TL_F","B_Soldier_GL_F","B_soldier_M_F","B_soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
{
{
_x setBehaviour "SAFE";
_x setFormation (selectRandom ["COLUMN","STAG COLUMN","WEDGE","LINE","FILE","DIAMOND"]);
} forEach units _x;
} forEach [_G1,_G2];
[_G1, getPos leader _G1, 3000] call BIS_fnc_taskPatrol;
Sleep 45;
_G2 copyWaypoints _G1;
Sleep 1;
deleteVehicle _this
};
};
Isn't working. I know I'm misunderstanding the syntax, but I don't know what it is I'm missing.
so it will send again as connection is restablished?
true will test and report back
Me, @still forum or Cloud? "What's not working on that?"
It still isn't recognizing thisTrigger.
Note that this script is in an SQF file that is being executed from a radio trigger.
Is the script in the trigger? Or how do you get from trigger to that script
Well, of course no local variables carry over if you don't pass them to that script.
0 = [thisTrigger] execVM "script.sqf";
Then:
params ["_trigger"];
inside that script file.
0 = [thisTrigger] execVM "USPlatoonSecurity.sqf";
Then:
if (isServer) then {
params ["_trigger"];
call {
thisTrigger spawn {
_G1 = [(getPos _this), WEST, ["B_Soldier_TL_F","B_Soldier_GL_F","B_Soldier_F","B_soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G2 = [(getPos _this), WEST, ["B_Soldier_SL_F","B_Soldier_TL_F","B_Soldier_GL_F","B_soldier_M_F","B_soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
{
{
// _x execVM "Gear\FN_CentralGreen.sqf";
_x setBehaviour "SAFE";
_x setFormation (selectRandom ["COLUMN","STAG COLUMN","WEDGE","LINE","FILE","DIAMOND"]);
} forEach units _x;
} forEach [_G1,_G2];
[_G1, getPos leader _G1, 3000] call BIS_fnc_taskPatrol;
Sleep 45;
_G2 copyWaypoints _G1;
Sleep 1;
deleteVehicle _this
};
};
};```
Is still saying the same thing.
No, thisTrigger is undefined in USPlatoonSecurity.sqf.
Right. I get that. I don't understand how to define it there.
The whole call and spawn is weird. They just make it more complicated than it has to be, serve no purpose.
Okay.
call and spawn don't make any sense. Your script is already spawned
You don't define it there. You already passed it and stored it in _trigger with the params.
@little eagle, OH! Okay, shit. Got it now. Thank you.
Thanks to you as well, @still forum.
i'm curious why you didn't just make the script use the trigger's variable name
Well, there's no need to give it a name if you pass it as variable.
That way you can recycle the script for multiple triggers.
You know, avoid hard coding.
True, but then there would've been no need to put it into a file in the first place.
For addMPEventHandler, is it exclusively for the MPEvents https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#addMPEventHandler or can i use any events?
Only these three.
stupid question, what is the list of types in isKindOf ?
RiverX, the parents listed in the config viewer.
@commy2 Thank you
Some useful classes are CAManBase, Tank, Car, Helicopter, Plane, Ship_F ... from memory.
StaticWeapon
Not sure whether this is the right place to post it in, however - I am an author of a marker addon for A3, and I would like to ask - how does one declare a new category for the markers? At the moment they're flooding Flags category, and I would like to declare a new one, in order to put them here.
So there isnt probably the parent like aircraft(to sum up helicopters, planes and uavs)?
Adami
markerClass = "System";
markerClass = "Military";
etc.
RiverX, best to consult the config viewer.
Ok will do
@little eagle In this case I want to declare a new, custom category. If I put in something else than default ones in markerClass, would it outright create another category?
I think Air is the common parent class for Helicopter and Plane.
Let's say, WW2Markers category.
And UAVs are themselves either Plane or Helicopter already. Depending on how they fly.
@commy2 Thank you, that will do, I will just put in script iskindof with plane and heli
class CfgMarkerClasses {
class MyTag_CustomMarkerCategory {
displayName = "My Custom Markers";
};
};
MyTag_CustomMarkerCategory can then be used as markerClass.
Excellent, I'll try it out once I'll be able to, thank you very much for assistance
Does array "vehicles" has only alive vehicles?
Doesn't mention dead vehicles on the wiki, so I believe it includes dead and living.
Returns an array of all vehicles available to current client. This command returns both empty and crewed vehicles but not soldiers. It will also return "WeaponHolderSimulated" of dead bodies (weapon on the ground). Vehicles created with createVehicleLocal will only be returned on the client that created them.
@little eagle Thank you very much ๐
Hey hey,
Trying to get a group of playable units to teleport into the Cargo of a chopper post mission start. Was initially using this in the vehicles init field. {_x moveInCargo this} forEach units GrpName; before I realised locality was an issue. Then moved onto {_x action [โGetInโ, this]} forEach units GrpName; the last example works for the most part. However it seems that when the unit does the get in action, it randomly begins falling to its death (probably due to the helicopter moving away from the unit trying to get in). Is there a better way to do this that I am overlooking?
if you need to do it from unit/vehicle init field, probably better way will be just
this moveInCargo vehicle_name;
```unit init ^
next option
```sqf
{_x moveInCargo vehicle_name} foreach units group this;
```group leader init ^
but possible that there will be no player in leader slot
@warm bronze
@meager heart spawning in the helicopter once all the players are connected and in game. So that wouldnโt work unfortunetly.
you need some delay ?
Yeah but simply putting a sleep in wouldnโt work, if players have issues connecting. Was thing that I could put a check in to see if the unit is alive or not, but the way it spawns it is briefly alive in mission load before deleted and cached
๐ค
0 = this spawn {
waitUntil {time > 0};
waitUntil {!isNull _this};
_this moveInCargo vehicle_name;
};
```unit init ^
@warm bronze
{[_x, this] remoteExec ["moveInCargo", _x]} forEach units GrpName;
This in your helo init should solve any locality issues ๐
Fuck yeah. Was just looking at doing that.
glhf ๐
Thanks for the help team ๐
yeah... in case some funny things will happens, you can try that spawn ^ thingy ๐
Will do thanks!
I'm trying to find the nearest vehicle, so if Landvehicle is all cars how do I find helicopters? or just all vehicles in one go, tried "all" "allvehicles" "air" "aircehicles"
in trigger ?
{_x isKindOf "Helicopter"} count thisList > 0
_items = items player;
if ("ToolKit" in _items) then {
// private ["_caller","_veh"];
_caller = _this select 1;
_veh = nearestObjects [_caller, ["landvehicle"], 6] select 0;
_veh setDamage 0;
};
ok il try changing it to that but I'm sure I tried it
nope, not working not when I add it to that script^
hmmm, well something else is going on
I think that will work when i change somthign else but is there not a class for all objects
well vehicles
well it seems to work perfectly with cars, but with helicoptes its worked a couple of times
not sure why its not working reliably
ok so get rid of the private line?
wait
no that's what I have
_items = items player;
if ("ToolKit" in _items) then {
// private ["_caller","_veh"];
_caller = _this select 1;
_veh = nearestObjects [_caller, ["helicopter"], 6] select 0;
_veh setDamage 0;
};
its not coming up with the erro _veh undefined ether its just doing nothing
odd because it works perfectly with "Landvehicle"
ok
tbh I don't know what the private part is doing
check this then https://community.bistudio.com/wiki/private
now I'm even more confused because if that is the problem why does it work with my first script
ive never even come across " private" before
also to format code in discord you can try this ๐
```sqf
your code
```
I keep forgetting how to do that
I guess because I'm thinking bout something else lol
๐
sqf
private ["_caller","_veh"];
_caller = _this select 1;
_veh = nearestObjects [_caller, ["landVehicle"], 5] select 0;
_veh setVectorUp [0,0,1];
_veh setPosATL [(getPosATL _veh) select 0, (getPosATL _veh) select 1, 0];
nope
that ^ works fine
_items = items player;
if ("ToolKit" in _items) then {
// private ["_caller","_veh"];
_caller = _this select 1;
_veh = nearestObjects [_caller, ["landvehicle"], 20] select 0;
_veh setDamage 0;
};
and that
well, thanks but I'm now more confused, Il ask somebody tomorrow cheers.
also try it with 'air' but first jump in heli, start engine, kill engine and then try your code ๐
@sinful sky
Could just remoteExec an addaction to repair it?
well I'm doing it so a repairtruck with the Action has to be close to another to flip or repair it
its possible when I first checked "air" I messed something else up
Ahh rgr.
still helicopter was Half working and I guess I should do something about the
private ["_caller","_veh"];
?
dos it even need to be private?
hint str (nearestObjects [player, ["Air"], 50] select 0); // works
hint str (nearestObjects [player, ["Helicopter"], 50] select 0); //works
why hint str?
well... private command allows you to declare a variable in current scope...
and whats the object being called?
and whats the object being called?
try it in debug console
why hint str?
strconverts any value into a string
yes hint works with strings or structured texts lol
yep
only problem I have now is that I'm searching for both a landvehicle and "air" one after the other and it will repair both the nearest car and heli at the same time
not exactly what I was looking for but it mean the repairtruck gets repaired everytime I fix the heli lol
o well
cheers for the help
indeed
oh great now the other script I didn't even touce isn't working...
how could this
private ["_caller","_veh"];
_caller = _this select 1;
_veh = nearestObjects [_caller, ["landVehicle"], 5] select 0;
_veh setVectorUp [0,0,1];
_veh setPosATL [(getPosATL _veh) select 0, (getPosATL _veh) select 1, 0];
work perfectly until I fixed the other one
and iven even remove the other one now
private _caller = _this select 1;
private _veh = nearestObjects [_caller, ["landVehicle"], 5] select 0;
_veh setVectorUp [0,0,1];
_veh setPosATL [(getPosATL _veh) select 0, (getPosATL _veh) select 1, 0];
private ["_caller","_veh"];
better show all code
ive pasted it all up there^
is it file and you execVm it ? or that is function ?
show how you call it
or the stuff i use
addaction
_flip1 = repair_truck addAction ["Flip", "flip.sqf"] call BIS_fnc_MP;
nope
great so ive acheaved basically nothing i thought i understood, now the first thing i did is broken and I'm more confused
yay
lol
well actualy I'm pissed off
time for ben even tho i hate giving up while its broken
bed*
thanks for the help
BIS_fnc_MP
[repair_truck,["Flip",{[_target,_caller] execVM "flip.sqf"},[],1,false,true,"","_this distance _target <= 5"]] remoteExec ["addAction",[repair_truck,-2] select isDedicated,true];
lol
tbh I'm not going to try that because its just going to confuse me more I'm sure, but thanks
the MP bits been there all along
it works... then it doesn't
well i did try it before i leave and its not working still,
its clearly calling the sqf with ither that or mine but the sqf its just miraculously broken..
lol
well tbh ive now wasted about 3 hours fucking about with this and I'm basicly no further in
i was
now I'm not
btw if you interested how to make you "unflip thing" stop killing people around and jump, you can check this https://community.bistudio.com/wiki/surfaceNormal ๐
Anyone know why spawned AI would run around and shoot randomly? I have AI spawned at locations, they're load outs are scripted random, they're behavior is scripted random, and they're waypoints are scripted random. All that seems to work okay, but a random few seem to orient in a random direction and begin firing their weapon into the ground. They continue to do it until they run out of ammo. They also move position and reorient to shoot, almost seems like they are looking through the map... I have checked to see what they are firing at, and there doesn't seem to be anything in the general direction. Any ideas?
lol
do they fire at random positions/directions or that is the same point for all ?
each one seems to choose a random direction to focus at.
they also "twitch" left and right, very rapidly, while they fire, so it's like they are looking in multiple areas within a 45 degree arc of the direction they target.
is it with vanilla ai or some addons ?
total vanilla (units and equip). Also doesn't seem to matter what map, same behaviors.
What's throwing me off is that it only happens with random units, if it was all of them (each scripted unit), then I could focus in on what was the cause.
i so want to see a video of this ๐ Sounds hilarious ๐ Apart from the fact that it is a problem for you obviously ๐
There obviously is a bug in your script somewhere causing this.
Hello Could you tell me if it is possible to make an AI walk while i'm spawning [UNIT1, _unitCaptureData] spawn BIS_fnc_UnitPlay; ??
Cuz all the AI does is glide around like a ghost xD
I swear I just read that on twitter somewhere
You can spawn a "parallel" script that forces them into the walking animation I guess
Yeah, that was me lol
I tried several ways but looks like the animation takes over anything you make the AI do
The walking animation probably won't match the unit though. Meaning his feet will most likely still slide around unrealistically
Yes
I think I have two accounts tho. Nah.. That has stuff from 2012 so probably my only account
^^
so, how would I manages to deal with this gliding AI... it would be awesomely cool to have AI walking around exactly how you'd want the to ...
Instead of UnitPlay make a custom script that set's AI waypoints and have them follow the path that way...
But that requires that AI does what you tell them to do. So I guess that's not an option...
it is not indeed
cuz in my case, i am making the ai walk inside a badly designed Mod building
he would go through walls and shit
Anyone got a clue ?
walking inside/over obejcts is limited at best and requires the models to be set up properly
that could work
there was some "unitcapture/play" tutorial from a guy who won the #armachinima
this one https://youtu.be/kWtJzATbNfA
Config or script?
skript
["CAManBase", 0, ["ACE_MainActions"],
ACE_HeadActions ?
I can't even find where the possiblities are defined
one arg should be selection iirc
That defines the parent. Not where the action is on the model
Wait so the parent is not where it's modeled
["CAManBase", 0, ["ACE_Head"],?
ohh thanks a bunch
Does anyone have a script that export config hierarchy properly? Like tracing inheritance of subclasses?
Basically i wanna change some value somewhere in cfgVehicles, for example in inherited turret subclasses, but the InheritsFrom doesn't seem to give me a proper order
For example (InheritsFrom (configFile >> "cfgVehicles" >> "AllVehicles" >> "NewTurret" >> "ViewGunner"))
returns config.bin/CfgVehicles/AllVehicles/ViewOptics
But with all the commands that return config classes, viewOptics is defined AFTER the NewTurret, so that doesn't give a working config
Instead i suspect it's actually inherited from class all { class ViewPilot; } but I can't seem to figure out how that inheritance is done through script
Extra example, using a BIS config that shows what i need ```cpp
class Tank;
class Tank_F: Tank
{
class AnimationSources;
};
class APC_Tracked_01_base_F: Tank_F
{
class AnimationSources: AnimationSources
{
class HideTurret;
};
};
So animationSources comes from Tank_F here as it should be
but script shows (InheritsFrom (configFile >> "cfgVehicles" >> "APC_Tracked_01_base_F" >> "AnimationSources"))
config.bin/CfgVehicles/All/AnimationSources
Are you asking for the correct inheritance of APC_Tracked_01_base_F/AnimationSources/HideTurret ?
So in my case i'm looking at zoom configs, but i'll use vanilla config example instead, so lets say for APC_Tracked_01_unarmed_base_F i want to change the initPhase to 0
I wanna have a script that allows me to export a config with proper inheritances that would modify that value
So the end result should look somewhat look like this: https://pastebin.com/k0b2MHpv
So right now what my script does is export something like this: https://pastebin.com/yTS5EadJ
But that class ViewGunner is trying to inherit a non-existant class, the inheritsFrom command says it's allVehicles >> ViewOptics but that is defined AFTER newTurret, instead it is all >> ViewOptics but i'm having a hard time wrapping my brain around making sure i can mark that properly for exporting
I'm a brainlet
I know that newTurret is defined in the main body of one of the classes instead of under Turrets. Might be something like that
Yes i know what the result should be, just not how to get it from a script right now
Why would you want to change the initPhase of the animation? Can't you not use animate and leave the initPhase as is?
So in my case i'm looking at zoom configs, but i'll use vanilla config example instead
i dont want to
Just because i had a example of how the config should look to be functional on hand
In your example it says HideTurret and initPhase 0. That has nothing to do with the zoom.
It's missing ViewOptics.
Let me create and post an example and maybe we can clear this up. Gimme a minute.
This should be good
Thing is that in that inheritsFrom (configFile >> "cfgVehicles" >> "Tank_F" >> "Turrets" >> "MainTurret") shows allVehicles
As in that configfile, class Tank { class NewTurrets } }
Stop talking
I said gimme a minute.
jeez
// config 1
class M1 {
class A {
};
class B: A {
};
};
// config 2
class M2: M1 {
class A {
};
};
// master config (config 1 loaded before config 2)
class M2 {
class A {}; // M2/A
class B {}; // inherits from M1/A
};
};
Read this. This is essentially your problem.
The issue is that you cannot not modify the inheritance of class M2 with a third config patch that is loaded after config 2.
There is now way in Arma configs to avoid this problem.
I do know how to patch it for the record
That does it
I'm looking into a script to create a config that shows that inheritance correectly
Itโs usually a better habit to just make your own class anyway
With the goal to create a patch config that doesn't modify inheritance? Because there will be no such script, because this particular example cannot be patched.
The classnames collide. There are two different classes with the same name. And there is no way to reference them.
Arma configs suck. We've been over this four years ago.
Same reason why B_Heli_01_F or whatever the name is has an UBC error when starting ACE. The error will never go away, because it can't go away.
Hmm okay, was aware they're not exactly great, but figured some smart young lad as yourself probably had an magical workaround
Sadly no. I can only tell you that it's not possible. You'll have to manually change all modified config entires and live with your addon modifying base classes. Hoping it doesn't break any mods.
Is something wrong with disableai "WEAPONAIM"? I keep getting a foreign value error.
"SUPPRESSION" and "AUTOCOMBAT" seem to trigger fine, but that one in particular doesn't seem to want to run.
There are quite a few "foreign enum value" false alarms in the current version.
It should still work though. Whatever it does.
@meager heart thanks !
@little eagle I'll try; it's my safezone script, tested it last night on the public server and it kinda-sorta worked. Kept flipping player-sided units back to non-captive long enough to get shot... and even the captive enemy units in town would engage forces outside the town.
Ideally, a unit enters the zone and goes back to safe mode, walking, no engaging, until they leave.
Kinda worked for one unit, didn't work for the next :/
Can anyone spot something wrong with this trigger?
if i run the "0 = [] spawn whz_fnc_moveInPlane" part in debug console (GLOBAL execute) than, the function is executed
anyone have any pointers or know any methods to add/remove stuff from a dead body? The only way I can seem to get it to work is by adding an item to a bag/vest but I am trying to remove a weapon
using mpkilled EH - trying to use clearWeaponCargo (_this select 0); or removeAllWeapons (_this select 0); is not giving me any results
Persons don't have a weapon cargo. So clearWeaponCargo will not work.
It seems weird to me that you would use MPKilled for this. removeAllWeapons only works on the machine where the object is local. So why not use the killed eventhandler? That one only triggers on the machine where the object is local. So it would work perfectly for this.
@quasi thicket are you sure the startMission trigger is being activated? Put a hint in the On Activation box to see if the trigger fires at all
might be locality issue
eventually changed the condition to just "this" and blufor not present and it worked
and made sure that the trigger overlapped startMission trigger exactly ๐
not the best solution... but it SEEEMS to work
hmm. that just means startMission isn't triggering
well, startMission starts a script with a title screen and that worked fine
it seems more that it didn't activate for the players in the trigger
^^probably won't be because title screen, i guess
you could also make all of the triggers server only, and remoteExec stuff
but i mean that's more of an effort
well, trigger seems more complicated than i thought
Triggers seem to create a list of AI and players who meet the conditions as well
well, it does list everything that meet the trigger rules AFAIK
^ Yes
you could filter with thislist select { isPlayer _x }
well, trigger seems more complicated than i thought
Yes, they are more complicated than what you want to achieve has to be.
Just don't use triggers tbh
@commy2 ๐ฉ#9913 was thinking of MP setting but I will take a look at that
probably was my issue was trying all different commands
but ill try regular killed EH
and I was trying weaponcargo thinking it was a dead body container
Hey guys. Maybe I am nuking this... but I have a trigger checking to see if 2 AA sites are alive... so the syntax I am using is (!alive aa1_1) && (!alive b1_1) where aa1_1 is the aa turret and b1_1 is the person manning it.... problem is I have 3 turrets/personnel per site......... is there a much better/more efficient way I can check this instead of (!alive aa1_1) && (!alive b1_1) && (!alive aa1_2) && (!alive b1_2)..... (!aliveb2_3)
Well, are they all in a group?
Yes.
But checcking the group doesn't work
Alive expects an object not a group. At least that was the error it threw me.
What variable stores your group?
(count ([unit_1,unit_2,vehicle_name] select {!alive _x}) isEqualTo count [unit_1,unit_2,vehicle_name])
@vagrant mango
Thanks! And none currently? I am not sure of the question exactly @strange urchin Are you asking what I set the variable as for the group?
Yes
Just gave it a variable name of a1... but when I tried to use that with the !alive it threw an error telling me it expected a singular object not an entire group.
Then give it the name a1
I had. This is the error it throws if I set the group variable name to a1
and then have the trigger looking for !alive a1
What I just sent you is what it throws.
if (count ((units a1) select {alive _x}) == 0)
Which the way I am reading it then it doesn't like it being passed a group variable.
Oh okay.
I see how you have that written out.
My fault.
I was writing it specifically like I had been
which was just !alive a1
!alive a1
Donโt know what sldt1ck was doing up there
Overcomplicated
Yeah, you still have to check each group member
But doing a forEach or something is the best way
Cool. So I can kind of gleam the basics of what its saying... which is if the count of units for variable (group) a1 == 0 then this expression is true correct?
er units alive == 0
so if I have 2 sites then I could just logical and them together right?? with two statements?? so
(if (count ((units aa1) select {alive _x}) == 0)) && (if (count ((units aa2) select {alive _x}) == 0))
I would do this:
Meaning I want to show that all units are dead for both sites?
There is also the big part which is I want to see that all of the AA pieces (turrets) themselves have been destroyed, which I don't believe turrets themselves can be grouped/added to groups?
Okay, im listening.
Replace (units aa1) with (units aa1 + units aa2) instead
Oh, I didnt realize you could do that.
(if (count ((units aa1 + units aa2) select {alive _x}) == 0))
Hm. Why do you have parenthesis around the if?
Whoops. Holdover from when I ANDd the two if statements.
if (count ((units aa1 + units aa2) select {alive _x}) == 0)
There.
So... ideally they are taking out the AA turrets too... could I do something lazy to keep from evaluating ALL of the pieces (6 in total) and just look for the one final one? That way the objective doesn't show as completed when they just kill the units on the turrets?
B ecause correct me if I am wrong, but emplacements/vehicles themselves are not part of groups? Just the units that occupy them?
Kill a unit and tell me what assignedVehicle <unitname> returns
Or just kill them all and check one if you donโt feel like figuring out which name belongs to which static
Uhm... sorry but how do I check that?
Debug console
Alright one sec.
Should appear when you press escape
There are 4 pairs of lines at the bottom
Type it into one of the pairs
The result is printed below
The if statement?
Sure
But also the thing I told you to do
So type assignedVehicle aa1_1
Into one of the boxes
Okay typed in before I do anything it returns false obviously since the condition hasnt been met, gonna kill one and see what the return is.
Those four lines are mighty useful if you want to check something repeatedly
You can do the same thing in the main text box if you want
So
Kill aa1_1 and tell me what their assigned vehicle is upon death
For assignedVehicle aa1_1 I get aa1_1
Pardon?
What about before?
<NULL-Object> is what it returns
before it is aa1_1
Right
My bad
I forgot
aa1_1 is the vehicle
You named the statics
b1_1 is the person.
Lol
Then do the same thing but with b1_1
on death its <NULL-Object>
for vehicle b1_1 it returns aa1_1
when they are alive. I went back into the 'play' session.
When he dies though.
aa1_1
Ah, we have a winner
aa1_1 still
So, what kind of AA gun is it?
So, thereโs no reason they would bail out or the crewman would get deleted, right?
No. I set them to no pathing so they specifically wouldnt
I donโt think they would regardless
Just to be on the safe side I did.
But are the statics locked?
How do you mean?
Just as youโd lock your car
Lock them
Ok, I got a tough one here. Is there a way to do remove the parking break or put a car into neutral?
Nope
Okay, theyre locked. Thats to prevent people from jumping in/out correct?
Yes
If they do, then the gunner will be forced out
And that will make our condition produce incorrect results
So
if (count ((units aa1 + units aa2) select {alive vehicle _x}) == 0)
That should work
So in the debug with all the units alive that returned true.
What
Whoops
nevermind
It was a typo.
the _x was now part of vehicle
so it read vehicle_x
Lol
that made it true.
So count is the part that iterates through correct?? SO for the array of groups aa1 and aa2, select to see if their vehicles are alive... if THAT is equal to 0 then return true fulfilling the trigger and triggering the .sqf I wrote.
Am I reading the statement correct?
Okay thats what I was getting at. Right on.
Thanks man I appreciate the help.
I suck ass with code/scripting and learning a whole new language while doing makes it worse.
Now that I think about it
if ({alive _x} count (units aa1 + units aa2) == 0)
That does the same thing, and looks fancier
how so?? does it not evaluate the static emplacements??
Wait
I copied that
if ({alive vehicle _x} count (units aa1 + units aa2) == 0)
That does it in one statement
Not sure if itโs much faster, but it probably is
Thereโs a speedometer in the bottom left of the textbox
It checks the average runtime of whatever you put in the textbox
.0057 ms for the original
.005 for the new one.
For the trigger, should it be a server only trigger evaluation?? Since I wouldn't want it running on every machine and it doesn't really need to?
as long as the result is proper execution across all clients?
That is correct
okay. The call I have set up right now is execVM "AA_Destroyed.sqf"; should work correct?
Provided that AA_destroyed.sqf exists in the main directory of your mission
The reason I want it running on all clients is because AA_Destroyed.sqf does a map update, moving some markers around and changing alpha transparancy.
It does.
As long as they are global markers, you can run it on the server
How do I ensure if they are global or not?
Iโm just glad to help an aspiring scripter
๐
Is it possible to make it so pressing escape closes a createDisplay display with priority over closing a background createDialog? Or do I need to add a key handler to the background dialog to detect the escape press
Question, anybody know how to make this script global so AI can take advantage of the higher lighting as well?
https://www.youtube.com/watch?v=O4b69Rm7EVc
how do you get the center pos of any map?
getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition") //--- not reliable - map maker/designer will set this manually in cfg
getArray (configfile >> "CfgWorlds" >> worldName >> "safePositionAnchor") //--- more reliable but also not 100 (was fails)
@lusty canyon
i dont know the world names nor do i want to know them, i just want a relative pos that can work on any map (doesnt have to be absolute center just near enough)
//--- option 2
_path = configfile >> "cfgworlds" >> worldname;
_size = getnumber (_path >> "mapSize");
_size = _size / 2;
_center = [_size,_size,0];
//--- option 3
_centerposition = [worldSize / 2, worldsize / 2, 0];
actually nvm just realized i can just get the pos from openmapclick
i do have another question, say im admin in dedicated, and i already have zeus access, can i make another player that joined my server also have zeus? like curator assign?
i mean i want to have more than one player open zeus at the same time
so everyone can work on the mission
@lusty canyon use worldSize ?
divide by 2 and voilร , you have your X/Y of the map centre
yeah... like option 3 from above ^ probably the easiest
right thanks for that one guys, say if i run globalexec openCuratorInterface;
does that make everyone in the server have zeus window open?
can they exit from it themselves?
or i need to run close?
ooooooh indeed @meager heart , "ninja'd (I was behind in the conversation, my bad)
๐
How do I get a vector
From player to cursorTarget
And use with velocity to push the target away from player
could be better
if you want to go directly the opposite direction player looks at
or
etc etc
It's a punching script. So I want to ragdoll the target and then push him away from the player that is punching
Kind of yeah
0 spawn {
private _start = ASLToAGL eyePos player;
private _end = (_start vectorAdd (eyeDirection player vectorMultiply 20)); //--- range
cursorObject setPos _end;
};
@peak plover
i want to remoteExec create AI on the HC, what is the id num for the target field?
or will (entities "HeadlessClient_F" select 0) give me the first HC player object?
private _target = (entities "HeadlessClient_F" select 0);
private _script = {
if !(hasInterface) then {
//do stuff on HC
};
};
_script remoteExec ["BIS_fnc_call", _target];
will this work?
I think it should
but it is usually recommended to disable usage of BIS_fnc_call (in Description.ext), for two reasons:
- network security
- performance (you send the whole code block over network)
like i already said create AI on the hc
sorry for making you repeat yourself, I tend to not scroll up enough today - my bad
don't forget to check whether there is a HC or not
how do you then get the HC player object? or ID
also if !(hasInterface || isDedicated)...
is HC considered dedicated tho?
count entities "HeadlessClient_F" == 0 ?
please mind that a mission "properly" configured, disabling BIS_fnc_call, will break your code here (it will do nothing)
you can define a function like JayTAC_fnc_myFunction loaded on every machine
then use it remoteExec ["JayTAC_fnc_myFunction", _hcClientId]
if !(hasInterface || isDedicated)
This makes no sense.
dedi doesn't have interface indeed
Is there any reason to use remoteExec here anyway? Can't you just use:
if (!hasInterface && !isServer) then {
// do stuff on HC
};
in init.sqf?
so now i have to worry about BIS_fnc_call being disabled by mission makers??
yyyup
Well, is this for a mod or a mission?
like i said i want to create AI on the HC
if i cant use BIS_fnc_call then what can i use that doesnt involve adding cfg
for what occasion do you spawn things? why not server?
if server then whats the point of HC
: if i cant use BIS_fnc_call then what can i use that doesnt involve adding cfg
Depends. Is this for a mod or a mission?
(a random thing though, aren't HC a mission maker consideration?)
mod
Then you cannot use remoteExec period, as any mission maker could disable it completely.
remoteExec is not suited for addons.
actually private mod for my unit servers
if !(hasInterface || isDedicated) ... it will make sence if server and client is on the same PC, if HC is on the same PC with server also, commy
@lusty canyon check https://community.bistudio.com/wiki/Functions_Library_(Arma_3) for defining your own functions too
Well, if you have absolute control over the missions, then you can use remoteExec freely.
Even with BIS_fnc_call
Just have to make sure not to block it.
But again, I don't see any reason to use it at all.
if (!hasInterface && !isServer) then {
// do stuff on HC
};
This in some init script and it will only run on a HC.
No, >: if !(hasInterface || isDedicated) will never make sense.
ok ill just use that conditional then
It's also highly confusing boolean logic with the not or.
Well, mission makers demanded it, because they thought it'd make their missions safe.
Which of course it doesn't, but w/e
if its an anti cheating thing, doesnt battleEye already do this shit?