#arma3_scripting

1 messages ยท Page 685 of 1

dim pine
#

the praetorians

frank mango
#

So, to put the code in english.

You are asking the prae's to attach the plane to itself.

#

As you want the Prae's to attach to the plane, the plane needs to be the parent object with the init

dim pine
#

[this, nuke] call BIS_fnc_attachToRelative;this addEventHandler ["Fired",{(_this select 0) setVehicleAmmo 1}]

#

"nuke" is the nuclear warhead ive seated in the plane so im gonna try attaching the praetorians to that

frank mango
dim pine
#

thats what it was before but now im gonan try attaching it to the land vehicle ive attached to the middle of the plane

#

which is "nuke" in the init

#

"nuke" has an init attaching it to the plane

frank mango
#

See here (Should start a 5.00)

#

Liru, sets BCM as the parent object, as this is the one which will move etc

#

And then BCM has all the attachTo 's as its the parent object

dim pine
#

ahhhh i see! thank you for the help! ill see if i can get this thing raining hell

spark turret
#

@fair drum

unique sundial
#

so you made global var and assigned to it _respawnlaptop which could be nil, what do you think global var will be?

oblique arrow
#

Sorry I dont think I quit eunderstand?

#

Oh, _respawnlaptop itself is the variable name of an object

unique sundial
#

no it is not

oblique arrow
unique sundial
#

you canโ€™t have object named with underscore

oblique arrow
#

TIL

#

Does that name then just not work/isnt recognized, or?

unique sundial
#

it will be nil

oblique arrow
#

huh ok

unique sundial
#

you should get error too

#

where do you define _respawnlaptop

oblique arrow
#

_respawnLaptop was just defined as the variable name in an objects 3den attributes

unique sundial
#

can you test if itโ€™s nil?

if (isNil{_respawnLaptop}) then {diag_log "_respawnLaptop is Nil"};

#

add this to that code then check .rpt

oblique arrow
#

Yup

18:17:00 "_respawnLaptop is Nil"

#

although let me test something real quick

#

ye without the _ its fine

#

Although note that the error for the remoteExec still remains

spark turret
#

{_respawnLaptop} is not an expression tho

#

Loose the brackets

#

Also _prefixed variables are private by default

#

Ah its killzone kid, he probably kniws what hes doing

unique sundial
foggy hedge
#

Is it possible to place a vanilla composition (predefined within the game files) via script or is the only possible way to place compositions with BIS_fnc_objectsMapper and BIS_fnc_objectsGrabber (which seem to be typically used for custom compositions only?)?

smoky verge
#

can't remember how to find an object bone list from the console

winter rose
#

selectionNames?

smoky verge
#

yeah that was the one
thanks

mortal latch
#

are there any other options for grass cutting except for the grass cutters in the editor?
like are there any commands that can be used to do it over a volume?

mortal latch
#

aww

#

thx

#

if i want to use grass cutters for an entire airstrip how bad of a performance hit does that cause?

winter rose
#

be sure to make them Simple Objects and it should be ok

mortal latch
#

cool thanks

drifting vault
#

I'm looking for a script to add a scroll menu option to open the ACE Arsenal. I have this one for the BI Arsenal. What do I need to modify?

player addaction [("<t color=""#FF4444"">" + "Open Virtual Arsenal" + "</t>"), {["Open", true] call BIS_fnc_arsenal}, "", 0, false, false];

drifting vault
#

And to clarify, I mean just to open the full ACE arsenal from any location.

#

player addaction [("<t color=""#FF4444"">" + "Open Ace Arsenal" + "</t>"), {[_this select 0, player, true] call ace_arsenal_fnc_openBox},[this]];
This is how you open Full Ace Arsenal from scroll wheel for anyone coming in from the future to find this. ๐Ÿ™‚

fading dust
#

hello i created a mission with Intel ( init calls sqf file with a script on it ) so what i m trying to do is 2 hints

#
hint_2 "message bluh bluh ";
exit; ```
#

and i want the 2nd hint shows up like after 10 seconds

warm hedge
#

The command hint_2 doesn't exist.
The command exit exists, but nonsense in a SQF script
To make a suspension to a script, use sleep command

fading dust
#

ok

#

so how to make 2 hints show up but like with delay

warm hedge
#

To make a suspension to a script, use sleep command

fading dust
#

sleep between the 2 hints

#

do i need make like this

#
hint "you have collect vital evidence";
sleep"10";
hint "message bluh bluh bluh  "; ```
warm hedge
#
sleep 10;```
fading dust
#

thx

#

it worked

broken forge
#

I'm trying to get an addAction that calls a function to work, the addAction appears, but nothing happens when I select it.

this addAction ["Spawn Practice Patient - Stab", SOG_fnc_Medical, [pracGurney, "stabWound"] call SOGMedical];
warm hedge
#

Supposesqf this addAction ["Spawn Practice Patient - Stab", SOG_fnc_Medical, {[pracGurney, "stabWound"] call SOGMedical}];the {} brackets for the codes

Disregard

little raptor
warm hedge
#

IDK what it is ๐Ÿ™‚

#

Uh ah

#

Sorry I misread it ๐Ÿ™ƒ

#

Suppose you're using the SOG_fnc_Medical in a wrong way

copper raven
#

you got SOG_fnc_medical, and SOGMedical, which one is the correct one? or are they both doing something? ๐Ÿ˜„

warm hedge
#

Make sure it atleast launched, just put like only debug command like systemChat

broken forge
#

@warm hedge I'll implement that now

warm hedge
#

Pro tip: @'ing in a edit post, won't throw the ping @broken forge like this

little raptor
#

really?
I know how to ping Dedmen now! ๐Ÿ˜‚

warm hedge
#

โ˜๏ธ mods please ban /s

jade vine
#

Hi, I'm trying to find out my steam playtime from Arma. I tried to query it by using

_playtime= getStatValue "TotalPlayTime";
_playtime= _playtime/60;
_playtime= _playtime/60;
hint format ["%1",_playtime];

but I get a time of 2600 hours even though I have about 3700 hours

little raptor
late jacinth
#

can someone please help me with the scripting to add radio to come up in command menu ie team, supports, ect.. next should be radio but it's not. thanks

copper raven
sonic linden
#

hi i got a problem with my ctrlGroup

0 spawn {
    disableSerialization;
    _display = findDisplay 46 createDisplay "RscDisplayEmpty";
    _ctrlGroup = _display ctrlCreate ["RscControlsGroup", -1];
    _ctrlBackground = _display ctrlCreate ["RscTextMulti", -1, _ctrlGroup];

    _ctrlMap = _display ctrlCreate ["RscMapControl", -1, _ctrlGroup];
    _ctrlButton = _display ctrlCreate ["RscShortcutButton", -1, _ctrlGroup];

    _ctrlGroup ctrlSetPosition [    safeZoneX + safeZoneW * 3/4 - safeZoneH * 1/20,
                    safeZoneY + safeZoneH * 3/4 - safeZoneH * 1/20,
                    safeZoneW * 1/4 ,
                    safeZoneH * 0.3 ];
    _ctrlGroup ctrlCommit 0;

    _ctrlMap ctrlSetPosition [    0,0,                    // the 0,0 pos is Not relatively to the control group ???
                    safeZoneW * 1/4 ,
                    safeZoneH * 1/4 ];
    _ctrlMap ctrlCommit 0;

    _ctrlMap ctrlAddEventHandler ["mouseButtonDown", {
        if (_this select 1 != 0) exitWith {};
        hint "map is actually here";
    }];

    _ctrlButton ctrlSetPosition [0, safeZoneH * 1/4 ,safeZoneW * 1/4, 0.05];
    _ctrlButton ctrlCommit 0;

    _ctrlButton ctrlSetText "Test";
};

My _ctrlMap is set to pos [0,0,X,X] but the positions is not calculated relatively to the control group.
_ctrlButton is done in the same way but its relatively to the control group,
what am i doing wrong here ?

warm hedge
#

Map is not even intended to be used within a Controls Group

sonic linden
#

and why ?

warm hedge
#

Somehow. It says โ€œbecause of its complexityโ€

#

I'm no RV Engine engineer

#

Could be caused by the fact that maps cannot be in controls groups. Engine treats them a bit differently because of how complex they are.
Karel says so
https://forums.bohemia.net/forums/topic/191876-map-control-not-positioned-correctly-using-ctrlcreate/?tab=comments#comment-3049009

brazen lagoon
#

not strictly a scripting thing, but anyone here have experience with alive? What sort of profile counts do you start having problems at?

dusk badger
#

Does anyone knows of an EH that measures the bullet speed?

dusk badger
#

Yeah I use that one when it comes out of the gun, but I want to measure the bullet speed at certain distances i.e 100m 500m...
Here is the code

/*

player addEventHandler 
[ 
  โ€œFiredโ€, 
  { 
    _myStr = format [โ€œEH Fired. ID: %1 Bullet traveling at %2 Km/h.โ€,
    _thisEventHandler, speed (_this select 6)]; 
    systemChat _myStr;
   }
]; */
hint "good!";
winter rose
#

spawn code that will waituntil the bullet is far away

dusk badger
#

So make it wait until is at the desire distances to activate that EH

#

?

winter rose
#

this EH will trigger when you fire, not after

cosmic lichen
#

Spawn the eh code

winter rose
#

so bang โ†’ EH โ†’ wait โ†’ get the values

#

but to wait you need to use spawn

dusk badger
#

Ok I think I got it, thanks

warm blaze
#

greetings guys, how could I make map centralized on current player pos after he has pressed "m" button in multiplayer?

cosmic lichen
#

mapAnimAdd command

warm blaze
#

guess, this command must be attached to some EH for map or not ?

cosmic lichen
#

Not sure if there is an eh

#

Perhaps a loop

warm blaze
#

perhaps it must be triggered somehow when some player presses M button

#

anyway thanks for the tip ๐Ÿ™‚

cosmic lichen
#

Ah nice

#

You can also use Bis_fnc_mapAnimAdd

warm blaze
#

yeah, found it on wiki

cosmic lichen
#

Iz has more options and some additional checks

warm blaze
#

I think it's enough for small upgrade ๐Ÿ˜‰

broken forge
#

What does this error mean? ```
ace_medical_damage_damageTypeCache setVariable [_typeOfProjectile, _damageT>
13:20:22 Error position: <setVariable [_typeOfProjectile, _damageT>
13:20:22 Error Reserved variable in expression
13:20:22 File z\ace\addons\medical_damage\functions\fnc_getTypeOfDamage.sqf..., line 37
13:20:22 Error in expression <lectRandom;
[_victim, _size, _bodypart, _wound] call ace_medical_fnc_addDamageTo>
13:20:22 Error position: <_wound] call ace_medical_fnc_addDamageTo>
13:20:22 Error Undefined variable in expression: _wound
13:20:22 File SOG\SOG_Functions_F\Medical\scripts\medical.sqf..., line 47

#

This is what I have in the unit's init field: ```sqf
[] spawn { waitUntil { sleep 1; !isNil "SOG_fnc_Medical" }; [a1, "randomWound", pracGurney] call SOGSpawnVictim; };

copper raven
#

_wound is undefined that's what it is

#

and then i guess ace defaults something to "", which throws reserved error in setVariable

broken forge
#

@copper raven are you able to look at the medical.sqf file I have on sqfbin.com

tidal ferry
#

Hey, does Keyframe Animation work in MP?

round scroll
#

for an attached plane to a carrier, I want to set it's direction to a mem point. I try sqf _plane setVectorDir ((_spots selectionPosition "C2End") vectorFromTo (_spots selectionPosition "C2Start")); but this leaves the plane facing 180 degrees, e.g. backwards. Any vector math magic that makes this work?

round scroll
#

seems the attachTo messes up everything ๐Ÿ˜ฆ

unique sundial
#

use setvectordirandup

#

after attach to

#

also make sure that selectionposition returns position and not 0,0,0

strong schooner
cobalt sorrel
#

I'm looking for a mission, upon mission start, move one whole side (east) to one of 5 pre-defined spawns via markers.

I have this so far ```sqf
_spawns = selectRandom [spawn1,spawn2,spawn3,spawn4,spawn5];
if (side player == east) then { setPos (getPost _spawns)};


Does this look good so far? 
Also, with the selectRandom, when it picks one of the spawns, does that then save and be applied to the each player and they are moved to the same spot.
Or does it call the selectRandom on each person on east and thus moves each client to one of the 5, as compared to the earlier.
cosmic lichen
#

Where do you execute that script?

cobalt sorrel
#

if (isServer) then {

#

setting.sqf file of our framework

cosmic lichen
#

player is unknown to the server

cobalt sorrel
#

isPlayer?

cosmic lichen
#

the player variable

cobalt sorrel
#

Yes, I just read about it on wiki

#

The player var

cosmic lichen
#

initServer.sqf
missionNamespace setVariable ["RndSpawn", selectRandom [spawn1,spawn2,spawn3,spawn4,spawn5], true};

initPlayerLocal.sqf
if (side player == east) then {player setPos RndSpawn};

#

initServer.sqf is executed before initPlayerLocal.sqf so the RndSpawn variables should be set before any player gets teleported

#

(not tested!)

cobalt sorrel
#

Right

#

Thanks ๐Ÿ™‚

sacred slate
#

before i search for hours, can i have a txt database in SP without lan multiplayer server?

graceful kelp
#

any way to command a player to lock a laser but not fire

brazen lagoon
#

Is there an arma equivalent to string.endswith

violet gull
#

Is there a way to add display EventHandlers to a display created by cutRsc?

unique sundial
unique sundial
violet gull
#

Apparently cutRsc can be used to create a fake display which is not null or displayNull, but also cannot be detected with allDisplays or findDisplay. So far can't get any display EHs to work with it. D:

copper raven
#

findDisplay doesn't work with cutRsc

astral dawn
warm blaze
#

is it possible to control range of artillery by scripts if a player uses arty computer in-game?

warm blaze
#

I found just getArtilleryComputerSettings instruction but it fetches settings of current arty comp. Is there any 'setArtilleryComputerSettings' or similar to it script command ?

wispy cave
#

How does one remove the grenades from the pilot of PF helicopters? This vehicle player weaponsTurret (assignedVehicleRole player select 1) isn't returning any weapons

pulsar bluff
#

whats wrong with the grenades?

#

probably falls under magazinesTurret

pallid coral
#

anyone know where/how to access the Contact DLC directory, trying to figure out how they put tracks on a ugv

winter rose
pallid coral
#

okay, how do i figure out how to combined tanks and ugvs?

winter rose
#

maybe the wiki has something on it, otherwise Google I'm afraid

pallid coral
#

afaik contact is the first and only mod/people to make a tracked ugv

#

tried doing it myself with very very broken resaults

#

is there anyway to gain permission to view what they did?

winter rose
#

did you try checking the wiki?

pallid coral
#

ive looked previously the past few days, an also im looking now but to no avail

split notch
#

ok so i have

    [
        ["USAF_A10"],
        {[_this] execVM "scripts\pylons\a10pylons.sqf";}
    ],

in the object init pointing to

params ["_vehicle"];
_vehicle setPylonLoadout ["1","USAF_PylonRack_2Rnd_AIM9X_LAU105", true];
_vehicle setPylonLoadout ["2","USAF_PylonRack_7Rnd_HYDRA70", true];
_vehicle setPylonLoadout ["3","USAF_PylonRack_1Rnd_AGM65E", true];
_vehicle setPylonLoadout ["4","USAF_PylonRack_1Rnd_GBU24", true];
_vehicle setPylonLoadout ["5","USAF_PylonRack_1Rnd_GBU12", true];
_vehicle setPylonLoadout ["6","USAF_PylonRack_1Rnd_GBU54", true];
_vehicle setPylonLoadout ["7","USAF_PylonRack_1Rnd_GBU12", true];
_vehicle setPylonLoadout ["8","USAF_PylonRack_1Rnd_GBU24", true];
_vehicle setPylonLoadout ["9","USAF_PylonRack_1Rnd_AGM65E", true];
_vehicle setPylonLoadout ["10","USAF_PylonRack_7Rnd_HYDRA70", true];
_vehicle setPylonLoadout ["11","USAF_PylonRack_4Rnd_GBU39", true];
hint "hello";

i get the hello, but the pylons aren't switched, any ideas?

pallid coral
#

will do o7

winter rose
#

and since it's an init field, you may want to use this, not _this
(and also not use init field at all if it is an MP mission)

#

@split notch?

split notch
#

@winter rose its a slice of the init as i'm running kp lib

winter rose
#

and I don't know that

#

I can't help you without context ๐Ÿ™ƒ

split notch
#

yeah sorry

#

liberation kp object init file

#

want me to post the whole file?

winter rose
#

not here ๐Ÿ˜„ try sqfbin

split notch
#

line 142

winter rose
#

pylon: Number or String - pylon index (index starts from 1) or pylon name (see getCompatiblePylonMagazines Example 4)

split notch
#

right i've tried it like

_vehicle setPylonLoadout ["1","USAF_PylonRack_2Rnd_AIM9X_LAU105", true];

and like this

_vehicle setPylonLoadout ["pylon1","USAF_PylonRack_2Rnd_AIM9X_LAU105", true];
warm hedge
#

Not "1" but 1

#

(Not entirely sure the context tho)

winter rose
#

@split notch โ†‘

split notch
#

Interesting

#

Thanks

#

Will try

#

that worked ๐Ÿ’‹

buoyant abyss
ember pier
#

How would I disable Post Process effects in a trigger?
I used the example from the wiki;

_hndl ppEffectEnable true;
_hndl ppEffectAdjust [1.0, 1.0, 0.0, [1.0, 0.1, 1.0, 0.75], [0.0, 1.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]];
_hndl ppEffectCommit 0;
sleep 10;
ppEffectDestroy _hndl;```
But I think the sleep timer is off, so I would like to end the effect on another trigger;
Start trigger
```_hndl = ppEffectCreate ["colorCorrections", 1501];
_hndl ppEffectEnable true;
_hndl ppEffectAdjust [1.0, 1.0, 0.0, [1.0, 0.1, 1.0, 0.75], [0.0, 1.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]];
_hndl ppEffectCommit 0;```
End trigger
```ppEffectDestroy _hndl;```
This enables the effect, but when I activate the 'End' trigger it returns something like 'error undefined variable in hndl'
winter rose
#

so you can make it STRDL_ppEffect =

ember pier
#

Hmm replace _hndl with STRDL_ppEffect in both fields?

winter rose
#

yes, making it a global variable

#

But I think the sleep timer is of
you cannot sleep in a trigger, you should then spawn the code

#
_hndl = ppEffectCreate ["colorCorrections", 1501];
_hndl ppEffectEnable true;
_hndl ppEffectAdjust [1.0, 1.0, 0.0, [1.0, 0.1, 1.0, 0.75], [0.0, 1.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]];
_hndl ppEffectCommit 0;
[_hndl] spawn {
  params ["_handle"];
  sleep 10;
  ppEffectDestroy _handle;
};
ember pier
#

Well I thought the boxes of the SOG Cinema Base module were trigger boxes ๐Ÿ˜… but as you probably already noticed I'm pretty new to this scripting business

#

The module features a run on start, run on end, and loop box, I put 'Start trigger' content in the start box and 'End trigger' content in the end box

winter rose
#

if you want an "end trigger", use a global var ๐Ÿ™‚

ember pier
#

So '_hndl' is a local var while 'STRDL_ppEffect' would be a custom global var?

winter rose
#

yes

#

global as in "accessible from all scripts on the machine", not as "visible by everyone on the network"

cosmic lichen
#

global != public ๐Ÿ™‚

patent lava
#

hi guys, im getting undefined variable error but it's not, can someone tell me what i'm missing or how to improve it?

params ["_radius"];

_types = ["Airport", "NameLocal", "NameVillage", "NameCity", "NameCityCapital", "StrongpointArea", "NameMarine"];

_locations = nearestLocations [position player, _types, _radius];
_location = nil;

{
    if !(_x in (missionNamespace getVariable "completedLocations")) exitWith { _location = _x; }
} forEach _locations;

_location

_location should return nil when it can't be overwritten, but when it's nil it says it's not defined

#

code still works as expected, it's just the undefined error im trying to get rid of

little raptor
patent lava
#

ignore, nil is used to undefine a variable, fixed it by just changing it to a boolean..

little raptor
#

are you sure it's defined at all? completedLocations

little raptor
#
private "_location";
patent lava
#

i was checking if locations was still nil by doing isNil somewhere else:

        _location = [_radius] call HAVOC_fnc_findNearbyLocation;

    while {
        typeName _location == "BOOL"
    } do {
        _radius = _radius + 1000;
        _location = [_radius] call HAVOC_fnc_findNearbyLocation;
        sleep 1;
    };
#

but as you can see im now just checking if it;s a boolean, because i changed it from nil to false

#
_location = false;
patent lava
#

i did that, but i guess when a function returns a variable that is of value nil, it starts crying that it's undefined, because nil is used for undefining variabled

#

it used to look like

_location = [_radius] call HAVOC_fnc_findNearbyLocation;

        while {
        isNil "_location"
    } do {
        _radius = _radius + 1000;
        _location = [_radius] call HAVOC_fnc_findNearbyLocation;
        sleep 1;
    };
robust tiger
#

perhaps use locationNull (?) in your case, instead of checking against a nil

patent lava
#

that is alot cleaner than using false, ill try it out

patent lava
#

full code for anyone that want to have it

HAVOC_fnc_findNearbyLocation = {
    params ["_radius"];

    _types = ["Airport", "NameLocal", "NameVillage", "NameCity", "NameCityCapital", "StrongpointArea", "NameMarine"];

    _locations = nearestLocations [position player, _types, _radius];
    _location = locationNull;

    {
        if !(_x in (missionNamespace getVariable "completedLocations")) exitWith { _location = _x; }
    } forEach _locations;

    _location
};

HAVOC_fnc_getNearbyLocation = {
    _radius = 1000;

    _location = [_radius] call HAVOC_fnc_findNearbyLocation;

    while {
        _location isEqualTo locationNull
    } do {
        _radius = _radius + 1000;
        _location = [_radius] call HAVOC_fnc_findNearbyLocation;
        sleep 1;
    };

    _location
};

if (isNil {missionNamespace getVariable "completedLocations"}) then {
    missionNamespace setVariable ["completedLocations", [], true];
};

_location = call HAVOC_fnc_getNearbyLocation;

_completedLocations = missionNamespace getVariable "completedLocations";
missionNamespace setVariable ["completedLocations", (_completedLocations + [_location]), true];
little raptor
patent lava
#

is that because it automatically makes it public?

little raptor
#

because it's literally the same thing

patent lava
#

got it, thanks

little raptor
#

not setVariable

patent lava
#

thanks, changed it now

past wagon
#

am I doing the file path properly?

player addAction ["Action", "Folder/action.sqf"];
proven charm
#

should probably be \

past wagon
#

it wasnt working with / but I changed it to \ and its working

#

how can I check to see if there are people in a vehicle?

stone patrol
#

I am trying to write an artillery script and I've run into a snag.

_shell = createvehicle [_type, [(getMarkerPos "artyhelper" select 0) + (random 50-25), (getMarkerPos "artyhelper" select 1) + (random 50-25), 50],[],0,"none"];```
This won't create a mortar shell eg: "vn_shell_81mm_m57_fs_ammo", but it will create a bomb eg: "vn_bomb_500_blu1b_fb_ammo".
Any idea why this might be the case?
spark turret
#

also, i think your random math is false, you probably want a range of -25..25 but instead you get 25..75

#

does it give you any errors for the mortar shell?

stone patrol
#

you are right about the maths!

willow hound
stone patrol
#

no errors on the shell that I can see

willow hound
#

What I'm trying to tell you is: You have to find out why _type is "vn_bomb_500_blu1b_fb_ammo" instead of "vn_shell_81mm_m57_fs_ammo".

stone patrol
#

sorry what I mean is if the _type is "vn_shell_81mm_m57_fs_ammo" it wont work, but if _type is "vn_bomb_500_blu1b_fb_ammo" it will

#

Do spawned shells have inertia? I set _type to a tow missile and it launched when created. Are my shells just being launched off into the middle of nowhere?

willow hound
stone patrol
#

this makes sense to me

#

That was exactly it! Thanks a lot @willow hound and @spark turret

vagrant parrot
mystic current
#

Hey guys. Im building a new Persistant survial project in the S.T.A.L.K.E.R. Universe and im actively looking for scripters that can help me build the systems. It will be based on Exile.
My vision is a Server that people can also play on when they are alone and dont get bored since it will basicaly a singleplayer experience on an arma server. There will be different Faction locations known from the original games with questgivers, roaming AI that you can interact with, mutants that make the world feel alive, A huge world to explore based on the Tschernobyl Redux map, all the systems that exile has, ACE medical system.

brazen lagoon
#

can anyone here think of a good way to determine if a vehicle classname is a military or civilian vehicle?

#

does the config tell you what side a vehicle is for? or what faction?

spark turret
unique sundial
brazen lagoon
#

does this work on empty vehicles

dusky pier
#

Hello, what can be a reason of that error?

Observer R ะ‘ั€ะฐะฒะพ 3-5:3 (Pepsi) REMOTE (reb_4) in cargo of R ะ‘ั€ะฐะฒะพ 3-5:3 (Pepsi) REMOTE (reb_4); message was repeated in last 60 sec: 1402
winter rose
#

it looks more a log than an error tbh

viral marsh
#

Hmm

dusky pier
#

Last time i have problems with freezes when player got shot from somebody, though - there something like a lot of damageHandlers, or something else, but... no - damageHandler works good.

But still can't understand - what can be a reason for that lag (players got something like 0 fps when getting damage). And no errors in logs. Checked a lot of scripts, but no idea...

#

Maybe you had problem like this in your missions?

sweet jackal
#

Does anyone know how I can make myself zeus?

I am hosting a server for MIKE FORCE (S.O.G. DLC gamemode) and for some reason, I was able to zeus until I died and respawned, now zeus isn't assigned to me. How can I re-enable Zeus

brazen lagoon
#

does mpkilled trigger for JIP?

#

rather

#

does addMPEventHandler work for JIP

broken forge
#

For cfgSentences, do I need to specify an actor within the topic class? If so is there a way that I could pass a variable from a custom array for the actor param?

sweet jackal
#

Does anyone know?

frank mango
sweet jackal
frank mango
sweet jackal
#

Ah okay. Thank you, by DC I have to disconnect the server

#

:/

frank mango
#

ACE only works when you are Admin logged (In regards to what are you talking about)

#

Though, you cannot assign or reassign Zeus. using ace; ofc you can promote someone to Zeus.
Admin Logging in ace, allows you to create a Zeus slot when there isnt one.

#

But when modules are synced to player either by variable name or physically; ace/ admin logging will have issues with it

sweet jackal
#

Ah okay

broken forge
#

@winter rose I was looking at that, just trying to wrap my head around it, about half way down the page is how my config.cpp is setup, it works, but I'm not following on if the actor param is mandatory.

frank mango
winter rose
broken forge
#

I'm using BIS_fnc_kbTell

winter rose
#

if you provide the actor, it will be used
Otherwise it will try to figure it out iirc (I wrote that page)

broken forge
#

So I created a custom function, will it figure out that the unit that I'm passing into the array is the name of the actor? ```sqf
SOGSpawnBriefing = {
params ["_unit", "_topic", "_sentence"];
_unit = param [0];
_topic = param [1];
_sentence = param [2];

_unit disableAI "ALL";
_unit switchMove " ";

[_topic, _sentence] call BIS_fnc_kbTell;

};

```sqf
[sgt, "topic", "sentence"] call SOGSpawnBriefing;
copper nova
#

I am looking for an event handler that triggers when a player becomes unconscious. And an event handler to check by whom someone was revived (vanilla revive system). But such event handlers don't seem to exist. Are there other possibilities?

broken forge
#

@winter rose The conversation keeps telling me that actor is undefined

plain linden
#

How can I have a hint display to everyone when a task is completed

fair drum
plain linden
#

So a hint. Like the task is completed, cool, now here is a hint for the next task

plain linden
fair drum
plain linden
#

Same. No worries. Thank you

cosmic lichen
#
waitUntil {sleep 0.5; "task_1" call BIS_fnc_taskCompleted};
["Password"] remoteExec ["hint"];
little raptor
#

if you're in charge of task completion just do the hint when you complete it (no need for waitUntil)

copper nova
wet shadow
#

Hello people, I was doing some scripting involving profileNameSpace and had some problems with it. Apparently whenever I join or host any multiplayer server my profileNameSpace is completely empty. In Sp no problems.

I assume this is not intended behaviour. Could this be something with the Arma 3 player profile not transmitting and if so any any known ways to fix this?

winter rose
#

my profileNameSpace is completely empty
how are you accessing it?

#

@wet shadow โ†‘

wet shadow
#

I'm using allVariables profileNamespace to get the variable names, filter what I need to find and then use getvariable. My current problem is that allVariables profileNamespace returns nothing in MP.

crude vigil
#

I think it shouldnt return anything otherwise it would be concerning

#

getVariable specific values work, but iirc, allVariables profileNamespace working on multiplayer would be concerning regarding the safety of the profile..

wet shadow
#

Okay, good to know. ๐Ÿ˜… The problem is that i cannot know the exact name of the variable, only one part of it, hence the need to filter trough them all.

crude vigil
#

is it something like myVar_1 myVar_2 etc?

wet shadow
#

Yeah.

crude vigil
#

then run a for loop , inside it do a getVariable with format ["myVar_%1", _forEachIndex]?

winter rose
#

indeed

wet shadow
#

Makes sense, I'll rewrite the thing so I can go for loop like Talya_taya suggested.

severe hawk
#

hey guys, trying to edit a script that has a random zone landing script to have the option to specify a specific lz on a placed and named marker. its for AI that spawns automaticaly. Ive tried hunting through the script to see what id need to remove/edit/keep but im getting lost. can i post it here for your thoughts?

winter rose
severe hawk
#

9 lines

winter rose
#

a few ^^ go ahead

#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
severe hawk
#
private _spaceMult = 1;
private _pos = [getMarkerPos "ZONE_RADIUS", (br_zone_radius * 2) * sqrt br_max_radius_distance, 600 * _spaceMult, 24, 0, br_heli_land_max_angle, 0] call BIS_fnc_findSafePos;
// We also find another position if it's too far from the zone
while {count _pos > 2 || _pos distance br_current_zone > (br_max_ai_distance_before_delete - 50)} do {
    _pos = [getMarkerPos "ZONE_RADIUS", (br_zone_radius * 2) * sqrt br_max_radius_distance, 600 * _spaceMult, 24, 0, br_heli_land_max_angle, 0] call BIS_fnc_findSafePos;
    _spaceMult = _spaceMult + 0.1;
    sleep 0.1;
};
_pos;
#

its from bradens evvanex, so im not sure what will break if i just try and use marker lz`s to direct the AI thats spawned. I think i might have to spend a few weeks properly learning the sqf functions, but i thought id ask incase there is an easy edit.

winter rose
#
private _pos = getMarkerPos "myNamedMarker";
```and you are good ^^
severe hawk
#

and just change the max radius distance to match?

#

ahh, i get it. thanks muchly!

waxen sand
#

Hello

#

Is there a way to make AI Zeus actually do things?

little raptor
#

There is no AI Zeus

mystic current
#

Hey guys, did anyone play around with the old man functions in multiplayer?

#

they are complete undocumented :{

vague geode
#

If I add a unit/vehicle to the garbage collector via addToRemainsCollector while they are still alive will they only be removed once dead/destroyed or do I need to wait until they are dead to add them?

pulsar bluff
#

never even considered that

#

just run it in an "EntityKilled" event handler and dont worry about it

vague geode
deft ivy
#

If anyone here would be so awesome - trying to turn this into a code that applies for ALL blufor (my team) so we can sponge more bullets. This is for singleplayer! "player addeventhandler ["handledamage",{ (_this select 2) /2}];"

#

Right now it only affects the player.

fleet stirrup
#

Is there any way to use setUserMFDText with text with newlines in?

winter rose
fleet stirrup
#

Yeah, i tried that and it didn't seem to work, I even tried with a static text source setting text = in the config (thought of that after posting this) and that didn't seem to work either

#

Hmm, I may have to re-evaluate feasibility of moving over.

broken forge
#

How would I go about referring a custom function to an array of textures with timers that is provided in a mission's description file or sqf file?

cosmic lichen
#

Not sure exactly what you mean.

broken forge
#

IE. ```sqf
myArray = [["filePath\texName1.paa",30],["filePath\textName2.paa",15]];

Then an addAction to start the presentation, which calls my custom function. The custom function then takes myArray[]; and uses it

Working on a slide show presentation function with an AI presenting it using BIS_fnc_kbTell
cosmic lichen
#

And what is the problem now?

broken forge
#

I dont know how to go about scripting said example, I tried and couldn't get it to work. Unfortunately I'm at work atm, so I can't even paste the custom function I created.

turbid tide
#

Hi,
With this code I can put the truck (_panne) exactly behind another one (_dep). but how to align the blue arrow with the yellow arrow in the direction of travel? I know the coordinates of each arrow.

_panne setvelocitytransformation [getposasl _panne,((getposasl _dep) vectoradd ((vectordir _dep) vectorMultiply -20)),[0,0,0],[0,0,0],vectordir _panne,vectordir _dep,vectorup _panne,[0,0,1],1];

https://puu.sh/HJyye/59dc403056.png

#

Always with setvelocitytransformation to make a smooth movement

winter rose
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
robust tiger
potent dirge
#

Good evening fellas I'm having a small issue with a "Fired" EH on aircraft.
Here is the code:

vehicle player addEventHandler ["FiredMan", {  

    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];

    systemchat format ["%1 was fired", _weapon]; 

    if (_weapon == "FIR_AIM7") then {systemChat "aim7 fired"};

    if (_weapon == "FIR_AIM9L") then {systemChat "aim9 fired"};

The script correctly displays X was fired but doesn't display the other commands, almost as if it's cutoff there.
I've tried with different weapons, using the "FiredMan" EH, using player instead of vehicle player all with no improvements.
I'm stuck, please can anyone help me?

mystic current
#

@little raptoras in, getting the systems to work in multiplayer, with synchronized states accross all clients. I am especialy looking at the quest and relationship systems

dawn radish
#

I'm having this SAME exact issue. Did you ever figure out what was wrong?

slow urchin
#

Nope. Ended up dropping the script entirely

dawn radish
#

i'm entirely confused on why it works half the time. I followed the same exact thread you followed. It kicks the player if they enter the slot. but when i go and add my steamid, it still kicks me. if i mess with the txt file in any way it says it cant find it.

frank mango
#

Whats the context here?

dawn radish
#

adding reserved slots

frank mango
#

oh.

dawn radish
#

yeah its been a pain the butt.

#

i went and added this but i still either get an error, cant find allowedid.txt. or it kicks me

frank mango
#

This the script you using, or another?

dawn radish
#

are you familiar with it?

frank mango
#

Nope, but I will have a look at alternatives

dawn radish
#

i feel like the one provided is missing a step. and I think it has to do with the allowed portion. it doesnt recognize what that is supposed to mean

frank mango
dawn radish
#

yep.

#

Ima try one more thing. if it works ill post it

frank mango
#

and you followed the info.txt?

dawn radish
#

yes

#

The issue isnt getting the reserved slot to work. it kicks unwanted people out

#

the issue is, it also KICKS ME lol.

#

even when my allowedIDs.txt is in where the server.exe is

#

@frank mango
so it kicks me when I leave allowedIDs.txt with server.exe
BUT doesnt kick me when its left in the mission folder

#

no visible errors either.

frank mango
dawn radish
#

yes

frank mango
#

So how was it with the server .exe.????

dawn radish
#

kicks me

frank mango
#

No; how the file get to be in the same folder as your server exe

dawn radish
#

i put it there.

frank mango
#

if its in your mission pbo it should be in your mission folder

dawn radish
#

The thread tells us to create an allowedIDs.txt and put it where the server.exe is located.
While all the other files will be in the mission folder

frank mango
#

Ah sorry, wasnt looking at that bit

dawn radish
#

lol

#

I gotta still try on my test server. It seems to work on eden but never know if it works correctly live.
then ill put on my actual server.

frank mango
#

@pulsar bluff Are you able to shed some like on how your Apex Framework manages Reserved Slots / Whitelisting?

past wagon
#
waitUntil { crew _ifrit == [] };

Im trying to wait until a vehicle is empty. This is giving me an error: Type = array

still forum
#

Yes

copper raven
#

use isEqualTo

still forum
#

== doesn't do array (wiki says)

past wagon
past wagon
dawn radish
#

@frank mango it works now! test server mission success. Kicks when supposed too and doesnt when the correct steamid is loaded!

#

This was exactly what it needed! THANK YOU! why wasnt this included in the thread that was posted?

past wagon
#

I've decided to change my script to this. did I put the ! in the right spot?

waitUntil !{ _caller in ( crew _ifrit ) };
copper raven
#

no

past wagon
#

what about this:

waitUntil { _caller not in ( crew _ifrit ) };
still forum
#

no

past wagon
#

I already checked that wiki page

#

all it says is that not is the same as !

frank mango
#

not
not

Love that

still forum
#

and ! and not both say you cannot do what you did

past wagon
#

and all the wiki page for ! says is that it reverses a boolen

#

there arent really any good examples for what I need

still forum
#

SQF works like this, for EVERYTHING
nularCommand
unaryCommand rightArgument
leftArgument binaryCommand rightArgument

#

but you wrote
leftArgument unaryCommand binaryCommand rightArgument

plain linden
past wagon
#

ok

past wagon
still forum
#

! or not take one argument on the right

#

so if you want to revert you have to do
! argument

#

You want to use _caller in ( crew _ifrit ) as argument.
So
! (_caller in ( crew _ifrit ))

past wagon
#

this is the example the wiki page for crew gave:

player in (crew _tank);
#

ok

#

ohhh

#

yeah makes sense

#

because the () make it an argument

still forum
#

no it doesn't

past wagon
#

well

still forum
#

you have to add parenthesis because
!_caller in ( crew _ifrit )
would result in
(!_caller) in ( crew _ifrit )

past wagon
#

it groups it as one piece of code that can be used as an argument

#

?

still forum
#

but you don't want to flip _caller, you want to first do the in check, and then flip the result

#

yes

past wagon
#

ok

#

yeah

willow hound
plain linden
#

Ah ok. That works

tidal ferry
#

Hey, so did Art of War add the ability to change the map texture that shows up when you press the M key? If so/if not how would one go about doing that?

little raptor
lavish sparrow
#

How can I make a building uneditable/deletable/moveable by Zeus but still have its doors work? Simple object would normally work. But not for this specifically.
I understand that this is what I am supposed to use:
https://community.bistudio.com/wiki/removeCuratorEditableObjects

Is this literally all I know, or do I need to do something to it?

tough abyss
#

hey guys does anyone know how i can set up a AI helo to use the spot light?

copper raven
spark turret
crude vigil
tough abyss
#

@copper raven thanks man i got it

broken forge
#

Could someone take a look at this slideshow presentation function I'm working on and help me with getting it to work?

SOGBriefingChangeSlideTest = {
    params ["_objName", "_SOGSlideArray", "_SOGBriefingSlides", ["_SOGSlideNames",[]], ["_SOGSlideTimers",[]], "_SOGSlideName", "_SOGSlideTimer"];
    _objName = param [0];

    _SOGBriefingSlides = [];

    if ((count _SOGSlideArray) > 0) then {
        _SOGBriefingSlides = _SOGBriefingSlides + _SOGSlideArray;
    };

    {
        _SOGSlideNames pushBack (_x select 0);
        _SOGSlideTimers pushBack (_x select 1);
    } forEach _SOGBriefingSlides;

    {
        _SOGSlideName = (_SOGSlideNames select _forEachIndex);
        _SOGSlideTimer = (_SOGSlideTimers select _forEachIndex);
    } forEach _SOGSlideNames;

    _objName setObjectTexture [0, _SOGSlideName];
    sleep _SOGSlideTimer;
};
#

init.sqf:

_SOGSlideArray = [
    ["filePath\image01.paa", 15],
    ["filePath\image02.paa", 25]
];
lavish sparrow
#

How can I set an item to be an full arsenal by default? And also make the arsenal restricted in terms available types of weapons/equipments?

crude vigil
copper raven
broken forge
#

@copper raven I have an addAction that calls the function

cosmic lichen
#

And what are you trying to do?

#

show the next slide when the action is used?

broken forge
#

@cosmic lichen to start the slideshow presentation

#

When the presentation starts, I would like it to pull the textures and their filePaths in order from the array then set a specific amount of time each slide is shown before it automatically switches to the next slide

cosmic lichen
#

use this then

dreamy kestrel
#

Q: re: triggers, when we connect a trigger to an OBJECT, how to we "set" the trigger position? or does it follow that object from that point forward? or do we need to re-create a new trigger when the object moves; trying to avoid that scenario, or perhaps triggers aren't the right approach tracking with an object after all...

broken forge
#

I have a different funnction that's working, but I would like to refactor it with using an array instead of the same line being copied over and over again and the function being called for each line

#
[screen01, "filePath\slide01.paa", 0] call SOGBriefingChangeSlide;
[screen01, "filePath\slide02.paa", 60] call SOGBriefingChangeSlide;
SOGBriefingChangeSlide = {
    params ["_objName", "_texture", "_time"];
    _objName = param [0];
    _texture = param [1];
    _time = param [2];

    _objName setObjectTexture [0, _texture];
    sleep _time;
};
copper raven
#

why do you use params, and then call param?

broken forge
#

@copper raven I thought it was a shorter way then using this select 0, this select 1, and so on

cosmic lichen
#

;

#

if you have that change slide function already

#

then you just need to loop over you slides array

cosmic lichen
broken forge
#

@cosmic lichen that's what I'm trying to figure out, is how to create a slide array that loops my slides

#

Thanks for that info, that's a lot of code I can clean up then

copper raven
#
tag_fnc_showSlides = {
    params ["_object", "_slides"];
    {
        _x params ["_texture", "_delay"];
        _object setObjectTexture [0, _texture];
        sleep _delay;
    } forEach _slides;
}
//usage
[screen01, [...]] spawn tag_fnc_showSlides;

super ass doing this on phone meowsweats

broken forge
#

@copper raven Thank you, lol, I'll give it a test.

#

What does the [...] mean in ```sqf
[screen01, [...]] spawn tag_fnc_showSlides;

dreamy kestrel
broken forge
#

@dreamy kestrel so I put _myArrayName in that or is that where I put all the slides with their arrays?

dreamy kestrel
broken forge
#

Nevermind I figured it out, lol

#

I'm really off today, lol, it doesn't help that I'm a noob as well

dreamy kestrel
#

@broken forge it gets easier and the docs are mostly there, assuming you ask them the right kinds of questions

broken forge
#

It is getting a little easier by the day, but I still have a lot to learn, lol, thanks again for the clarification, and thank you everyone for helping me out

lavish sparrow
broken forge
#

My next question is to do with the BIS_fnc_kbTalk.
Is there a way to pass the actor config variable through my function that ties into the spawns the audio for the slideshow?

#
[unit, "topicClass", "sentenceClass"] call SOGSpawnLecture;
SOGSpawnLecture = {
    params ["_unit", "_topic", "_sentence"];
    _unit disableAI "ALL";
    _unit switchMove " ";
    [_topic, _sentence] call BIS_fnc_kbTell;
};
winter rose
broken forge
#

@winter rose I'm not sure how to do that

winter rose
#

Check getText, >>, getVariable on the wiki (sorry, I'm off to sleep!)

sacred slate
#

i like to have in my onplayerkilled.sqf somthing like: selectplayer leader group player; but thats the dead player on the ground. i have no clue how to select next alive squad member of _oldUnit

little raptor
sacred slate
#

@little raptor thx. again i fail to apply that into the rest of my script



if (({alive _x} count units group _oldUnit) > 0) then {

selectPlayer _notseenhere;

BIS_DeathBlur ppEffectAdjust [0.0];
BIS_DeathBlur ppEffectCommit 0.0;

}else{
    
//your code    
{
  if (alive _x) exitWith {
    selectPlayer _x;
    _group selectLeader _x;
  }
} forEach units _group;

};
wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
little raptor
# sacred slate <@!360154905148653568> thx. again i fail to apply that into the rest of my scrip...
BIS_DeathBlur ppEffectAdjust [0.0];
BIS_DeathBlur ppEffectCommit 0.0;

_group = group _oldUnit;
_selectedUnit = objNull;
{
  if (alive _x) exitWith {
    _selectedUnit = _x;
  }
} forEach units _group;

if (!alive _selectedUnit) then {
  if (isNull _group) then {
    _group = createGroup ((configFile >> "CfgVehicles" >> typeOf _oldUnit >> "side") call BIS_fnc_sideType);
  };
  _selectedUnit = _group createUnit ["B_G_Survivor_F", [0,0,0], [], 0, "NONE"];
};
_respos = getPos dmpcore;
_newPosdo = [_respos, 2000, 3000, 12, 0, 12, 0] call BIS_fnc_findSafePos;
_newUnit setPos _newPosdo;
 
    _x = _selectedUnit;
    clearWeaponCargoGlobal _x;
    clearMagazineCargoGlobal _x;
    clearItemCargoGlobal _x;
 
    _x addWeapon "hgun_Rook40_F";
    _x addHandgunItem "16Rnd_9x21_Mag";
    _x setAmmo [currentWeapon _x, 4];
 
    dmpHunger=9;
    dmpThirst=12;
    dmpFatigue=0;
sacred slate
#

if no squad member is left, it should switch to a specific created unit.

little raptor
#

oh ok

#

it's certainly not what your code says tho meowsweats

if (({alive _x} count units group _oldUnit)** > 0**) then {

sacred slate
#

its looks like this

#

onplayerdeath spawns a unit, also if i wont switch too it, but that is fine for me, cause i cannot reach that scripting level yet.

#

if a squad member is alive i should switch to him

#

if no squad member is left, i should switch into myspecialunit

#

the code of the pastebin works some how for me, i know the variables are global but they wont work other wise. i even have no clue why that matters cause i have for all my variables names lol

little raptor
#

use the other syntax meowsweats

sacred slate
#

honestly, i just script to get it working. it takes up all time. but i really like to learn it too

#

cool leme mix that new spagetti into the other now thx.

#

by the way, your all in one command thingy made me stay in arma, beside other things. its like unplayable without you guys. thx

#

oh man i dont understand _newunit for _group, cause the old _group is dead?

little raptor
#

but you can check that too

sacred slate
#

this is how it looks now

#

it confused me ๐Ÿ˜„

little raptor
sacred slate
#

yes, but i cannot wrap my head around why i should create him into the old group cause its gone.

#

AH

little raptor
#

I'm saying don't use that syntax

sacred slate
#

yes

#

leme try

little raptor
sacred slate
#

ohhhhhhh

#

that would have exploded in my face in some month haha

little raptor
# sacred slate ok here it is again https://pastebin.com/qw7WZw7H

{
addSwitchableUnit _x;
_x enableStamina false;
_x enableFatigue false;
_x setUnitTrait ["Medic",true];
_x setUnitTrait ["engineer",true];
_x setUnitTrait ["explosiveSpecialist",true];
_x setUnitTrait ["UAVHacker",true];
_x addWeapon "ItemWatch";
//_x addWeapon "itemGPS"; ItemWatch
//_x addItemToVest "DemoCharge_Remote_Mag";

} forEach (allUnits select {playerSide isEqualTo side _x});

why?

sacred slate
#

yeah thats stupid, cause some times there could be a spawned unit from zeus or somthing

#

but yeah i know thats wrong, it applies just to all west units, and there are not many.

#

i could fix that my self. thx

little raptor
#

it's still not done tho

sacred slate
#

ok. thats bad then.

#

i have somthing else

#

where it cames from

#

its like a reinit of this:

#
{
    addSwitchableUnit _x;
    _x enableStamina false;
    _x enableFatigue false;
    _x setUnitTrait ["Medic",true];
    _x setUnitTrait ["engineer",true];
    _x setUnitTrait ["explosiveSpecialist",true];
    _x setUnitTrait ["UAVHacker",true];
    //_x addWeapon "ItemGPS";
    //_x addWeapon "B_UavTerminal";
    //_x addItemToVest "DemoCharge_Remote_Mag";    

} forEach (allUnits select { (side _x) isEqualTo playerSide });

[player, false] call GENIX_fnc_pylonManagerAdd;
#

i exec this at mission start

#

yeah looks like i fucked that up and never noticed it yet

little raptor
#

I updated the code again

sacred slate
#

its risky to call it my code.

little raptor
#

I'm assuming you always want to set the respawn position and stuff

#

which it didn't

#

I updated the code to show you how

sacred slate
#

but it works as intended i guess

little raptor
# sacred slate but it works as intended i guess

so this should only apply to the new unit?

clearWeaponCargoGlobal _x;
clearMagazineCargoGlobal _x;
clearItemCargoGlobal _x;

_x addWeapon "hgun_Rook40_F";
_x addHandgunItem "16Rnd_9x21_Mag";
_x setAmmo [currentWeapon _x, 4];
#

if so ignore the new code then

sacred slate
#

yes, the new spawned unit has this

#

the ammo thing dont work, i forgot that.

#

oh boy. yes that code doesn't work, but i forgot its there

little raptor
sacred slate
#

the code isn't working. i hope its not the respawn settings in description.ext, its sp

#

i used the last pastebin ๐Ÿ˜

#

i restarted the game

#

i mean the scenario in the editor

sacred slate
#

i thought that cames from onplayerdeath.sqf magical some how

little raptor
#
params ["_oldUnit"];
sacred slate
#

yes but now it is. ๐Ÿ˜„

#

have no clue if desciption.ext applies. i dont use lan single player.

#

so group player wont work?

#

i have no idea where to put params ["_oldUnit"];

#

also not why

mystic current
#

is there anyone here that is bored enough to help me on my project?

#

it will be fun .. i promise :)

sacred slate
#

@little raptor i tried it with _group = group player; but it switched me into the new spawned unit, with blur

little raptor
sacred slate
#

but what does it do?

#

it doesnt tell it what it is?

sacred slate
#

it works now. legendary! it took me like two years to have that finally.

#

many thanks for your time

mystic current
#

this is always a great feeling

#

i finaly have the bones of my project standing with all essential systems working .. took me two weeks in overdrive mode

sacred slate
#

yo parsec. whats your project? i cannot script but i have some minor audio and gfx knowledge

mystic current
#

im working on a persistent rpg survival world based in the stalker universe

sacred slate
#

cool. i do somthing similar. funny

mystic current
#

i basicaly want a server that people can also play on completely alone without getting bored

#

aah nice

#

what is it youre building ?

sacred slate
#

i can post you a text, its offtopic for here i guess

sacred slate
#

@little raptor the death blur has to be in each blocks seperate, only on top doesnt work

cosmic lichen
#

@sacred slate (allUnits select { (side _x) isEqualTo playerSide }); โ†’ units playerSide

still forum
still forum
cosmic lichen
#

sleep <condition> notlikemeow

spark turret
#

Dont know about definitions, but i feel like the first expectation is something else than a loop ๐Ÿคท

cosmic lichen
#

How is it supposed to know when the condition is true if it doesn't loop

spark turret
#

Or rather: that its a pure command for waiting and cant be used as a loop?

#

Through codemagic obviously

cosmic lichen
#

wait(lambda: is_something_ready(something), timeout=120, waiting_for="something to be ready")
Python works similar. You assign a function to it which returns boolean.

#

That timeout might be interesting ๐Ÿค”

spark turret
#

Im aware of how it works, but its essentially just a bottom check loop. Which a lot of beginners dont directly realize

#

Anyways, lets move on, i didnt intend to start a discussion :P

winter rose
#

it's too late now!!

cosmic lichen
#

you're too late!

winter rose
warm blaze
#

if west players are friendly to guer players and guer players are friendly to west ones, can they use same side chat or any other chat channel to communicate with each other ?

cosmic lichen
#

global chat only

#

but that obviously is visible for all players

warm blaze
#

hmm

cosmic lichen
#

You could create a custom channel though

warm blaze
#

ok thanks, will check it. One additional question: can I somehow influence arty computer settings via scripts ?

warm blaze
#

did it before and found "getArtilleryComputerSettings". Was wondering if I can use something like SetArtilleryComputerSettings ..

#

just want to reduce arty range a bit

cosmic lichen
#

Don't think that's possible

warm blaze
#

maybe via arty configs, so modding approach

cosmic lichen
#

computer settings are defined by the vehicle config and what the player selects

#

Yeah sure. You can mod the arty

warm blaze
#

on the other hand, gear UI is also moddable by scripts. So maaaybe we could somehow mod arty UI as well and override it's data about currently selected settings...

cosmic lichen
#

Now it's getting complicated notlikemeow

warm blaze
#

just sharing my founds ๐Ÿ™‚

#

I started overriding gear UI recently for mission I am making and could achieve some boost of its time loading. I found that custom gear UI scripts I was using originally simply override data that gear UI uses while running. I am curious if this trick can work with arty UI as well ๐Ÿ™‚

#

in such a case I do need to mod arty configs that simplifies my work theoretically...

sacred slate
#

i like to store the number of squad units and their gear into a sqf, less db as possible. i like to load it after a game restart. this seems to be not easy to google.

warm blaze
# cosmic lichen Don't think that's possible

Found interesting code snippet to influence arty comp settings:

0 = [] spawn {
    disableSerialization;
    private "_ctrl";
    waitUntil {_ctrl = ({ if !(isNull (_x displayCtrl 510)) exitWith {_x}; displayNull } forEach allDisplays) displayCtrl 510; !isNull _ctrl};
    while {!isnull _ctrl} do {
        if(lbSize _ctrl > 1) then {
            _ctrl lbDelete 2;
            _ctrl lbDelete 1
        }
    }
}

Potentially we can get data by lbdata and modify distances for currently selected arty installation ๐Ÿ™‚

winter rose
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“

// your code here
hint "good!";
smoky verge
still forum
#

not aware

#

but you could config that I guess

smoky verge
#

trying to have an AI play an animation after a "death" eventhandler
not sure how to do that since I don't think dead units can animate once dead

winter rose
#

yep

#

so HandleDamage just before dying, play anim, then kill

smoky verge
#

and I guess I can use a waituntil to kill the unit only when the animation ends?

winter rose
#

or an animation changed EH

#

even moar betterer

smoky verge
#

how would that work?

#

you mean in addition to the handleDamage?

winter rose
#

handleDamage โ†’ guy should die โ†’ make invincible and play anim โ†’ add anim eh โ†’ on completed, kill dood

smoky verge
#

mhm ok I'll make some tests

tidal ferry
#

Hey, question

#

Working on the same project as Sanchez here and I wanted to ask

#

If you disable simulation on a unit, will it prevent it from playing animations?

#

Also, are eventhandler scripts happening in the scheduled or unscheduled environment?

warm hedge
#

Always unscheduled

tidal ferry
#

Gotcha

tidal ferry
#

Hmm, okay

winter rose
tidal ferry
#

Well yeah I figured but just wanted to make sure ๐Ÿ˜‚

#

I know some switchMove animations work but only for static poses

tidal ferry
#

Rather than them ragdoll like usual

winter rose
#

yes, I got that part?

tidal ferry
#

Think Sanchez already explained

#

Yeah

#

I'm helping him with the scripting for it

tidal ferry
# winter rose see this

Aye, but would handleDamage be best or should I use the hit/dammaged eventhandlers? handleDamage fires for every damaged part, I only want to detect overrall damage level

#

Also, will ACE Medical complicate damage detection?

winter rose
#

yes

tidal ferry
#

To both?

winter rose
#

handleDamage be best

#

check damages on the "" selection - I believe death is when it is > .9

tidal ferry
#

Gotcha

#

I'll try it

olive cairn
#

Hi guys i'm struggling to get this done. I want to make a simple smooth weather change, something like 5 minutes.
I'm setting a trigger that fires on bluefor presence and on activation does this:

[5, 0.5]remoteExec["setOvercast"];
[5, 1] remoteExec ["setRain"];  
};```
Unfortunately nothing happens at all.

I understand that setOvercast will not change inmediately the clouds and that they will take time some seconds to rerender.
I looked the docs and i'm confused on how to make this. This solution works inmediately but is too strong and noticeable. ยฟHow do you guys do this?

skipTime -24;
86400 setOvercast 0.5;
86400 setRain 1;
skipTime 24;
0 = [] spawn {
sleep 0.1;
simulWeatherSync;
};

 Thanks
winter rose
winter rose
#

(and the last code portion you posted can be done with forceWeatherChange I think)

olive cairn
#

ok but it wont mean that the cahnge will occur on 5 secs? if i put 7200 / 2 = 3600 (1 hour) it means it will take 1 hour to change? im confused because is not supposed to be in seconds?

winter rose
#

โ€ฆI did not understand what you mean here, but setOvercast takes <number> setOvercast <number>, left number is transition time in seconds, right number is overcast value in range 0..1

#
[5, 0.5] remoteExec ["setOvercast"]; // ask to change over 5 seconds
[5 * 60, 0.5] remoteExec ["setOvercast"]; // ask to change over 5 minutes
olive cairn
#

a ok, in the docs it says something like this:

Actual transition time is inversely proportional to the timeMultiplier. For example, a time of 7200 (2 hours) and a timeMultiplier of 2 will result in a real-life transition time of 7200 / 2 = 3600 (1 hour).
In case of overcast, a timeMultiplier > 1 will cause gradual desyncing of the cloud cover with the overcast value, so it is advised that you multiply the transition time by the multiplier, i.e. :

(7200 * timeMultiplier) setOvercast 1

this is the bit it confuses me.

so no need to remote exec, only include the regular (time) set overcast (intensity) on

if (isServer) then {}
winter rose
#

should do yes

#

if your timeMultiplier is unchanged, don't bother ๐Ÿ˜‰

olive cairn
#

a ok

#

thank you i will try

winter rose
# olive cairn a ok

see also Adanteh's note:

Delay in Arma 3 doesn't work for quick changes. Using 120 setOvercast 1 only reaches full overcast after about 50 minutes

This is because the new clouds system is different than in Arma 2 and earlier titles

olive cairn
#

what's should be the minimum time to setOvercast to make the changes visible without skipping time.
that means smooth inmediately (5 -10 minutes) change wont be possible

winter rose
#

most likely not, yeah
a bit too short for big changes

#

I would say consider a change of 0.1 overcast to take ~0.1h or something

#

(I am not reading the values from the game here; it is only a guesstimate)

olive cairn
#

ok i understood now. i'm going to try chaining small changes with skip time to be less noticeable, someting like 0.2 / skipTime / 0.2 /skipTime

#

until reaches its full potential

winter rose
#

skipTime or forceWeatherChange, but you will always get a little freeze here and there I guess

olive cairn
#

true

#

thank you so much.

winter rose
#

sorry for not providing the ideal solution, I wish it existed too

lavish sparrow
winter rose
#

every object

#

some might look broken though, but you can basically spawn any p3d you want

wet shadow
#

Hello people, is there a isNull equivalent command for arrays? I'm in need of way of checking if a control text field is a proper array like "[1,2,3]" and not a typo like "[1,2,3]]". I am using the parseSimpleArray to convert the string into an array.

spark turret
#

Count array ==0?

#

IsEqualTo [] (not sure)

#

Or isEqualType [] to test if its an array

#

Or you loop over every item inside and test its type

wet shadow
#

Count and IsEqualTo will both error out wihtout return if the variable compared is not a recognizable type like [1,2,3]].

winter rose
#

well, what does parseSimpleArray return in such case?

spark turret
#

"Help me stepbro im stuck"

wet shadow
#

Nothing, that is my problem. I would like it to return false.

winter rose
#

then it might return nil

#
private _result = parseSimpleArray "a[}";
if (isNil "_result") then { systemChat "oh noes" };
wet shadow
#

Exists with a generic error due to _result being illegible, not with a isNil unfortunately.

copper raven
#

im afraid you can't avoid it throwing

spark turret
#

Of only there was a try catch in sqf

copper raven
#

you can save the result into a global variable, and check on it next frame

#

will still throw, but will accomplish what you want

wet shadow
#

Intriguing idea, however I am trying to avoid global variable whenever possible and the code throwing would still annoy me to no end. ๐Ÿ˜„

copper raven
#

if you only need constant support, i.e [1,2,"test"], might not be too bad to write an array parser in sqf

slow oxide
#

Please help - I have a trigger that should only activate when a) any player is present and b) no opfor units are alive within the trigger area, but I can't find the right condition. I have the trigger set to "anyplayer present" and I tried multiple things in condition. I thought "this && (east countSide thisList) < 1;" should work, but it still fires when opfor is in range

spark turret
#

Shouldnt do that.

#

Your condition looks correct, unless its throwing errors

slow oxide
#

no errors. the trigger executes a script that spawns a group. when i exit the trigger and enter again I would expect it to NOT spawn a second group, but it does.

spark turret
#

Ah, set to "not repeatable" then

#

Thats not related to the opfor units tho

slow oxide
#

yea ... that would be easy. but it must be repeatable. just not when enemies are currently in the area.

spark turret
#

So it gives a false positive on the absent enemies?

#

Log the enemies upon execution with diag_log thisList

#

See if its actually a false positive or something else

slow oxide
#

k, let me test that

#

where would i find the log?

winter rose
#

!rpt

wicked roostBOT
#
Arma RPT

Arma generates a .rpt log file each time it's run, which contains a lot of information like the loaded mods, or any errors that appear, this log file can be very useful for troubleshooting problems.

To get to your RPT files press Windows+R and enter %localappdata%/Arma 3

Additionally see the wiki page for more info: https://community.bistudio.com/wiki/Crash_Files

To share an rpt log here, please use a website like https://sqfbin.com/ to upload the full log, that way the people helping you can take a look at it and try to figure out the problem you're having together with you.
Note: RPT logs can hold personal information relevant to your system, the game or others.

little raptor
little raptor
#

you have regex now meowsweats

#

although bracket matching doesn't need regex meowsweats

spark turret
#

Where do you guys publish your scripts?

#

(after armaholic died)

slow oxide
#

Weird... when I enter the trigger, it seems to count only my player in thislist, but at the same timestamp it throws some warning about an enemy unit in the same area:
20:12:32 [B Alpha 1-4:1 (Lenny79)]
20:12:32 soldier[vn_o_men_vc_14]:Some of magazines weren't stored in soldier Vest or Uniform?
20:12:32 soldier[vn_o_men_vc_14]:Some of magazines weren't stored in soldier Vest or Uniform?

spark turret
#

are you spawning units with the trigger?

slow oxide
#

yes

#

but even if i set one manually within the trigger area it is not in thislist

#

maybe ace or cba is messing with the command?

#

oh, the problem is that thislist only lists groups of the defined type, in this case players because i set the trigger to "any player"

spark turret
#

Well if you spawn the group with the trigger; it wont catch it bc it checks and then spawns

slow oxide
#

how would i check in the script if an enemy unit is within a certain area?

slow oxide
#

nevermind, i got it, thanks for the backup

copper raven
astral carbon
#

Hi is it possible to delete all objects/vehicles in a radius?

winter rose
#

yes

astral carbon
#

There's a ton of action going on in a scene and I want to do some optimization once the player leaves the scene

#

gotcha, do you know you would use? looking on the site but not too sure

copper raven
astral carbon
#

thanks!

copper raven
#

"See Also", some got better perf, nearObjects i believe

astral carbon
#

oh okay

copper raven
#

that one doesn't sort by distance

#

you don't care about the order if you just want to delete

astral carbon
#

gotcha

ember pier
#

Is there a way to open certain hud elements by a trigger, like the compass for example?

spark turret
#

what the hell is going on??


22:36:27 ["helo order action was called with: ",[B Alpha 1-2:1 (IR0NSIGHT),B Alpha 1-2:1 (IR0NSIGHT),[B Alpha 1-2:1 (IR0NSIGHT),"Unterstรผtzung",["Anastasia","Annika","Galina","Irina","Katina","Katerine","Khristina","Lada","Lelyah"],supply_helo_01,crate_01]]]
22:36:27 Transfer of uninitialized variables is not supported
22:36:27 Error in expression <ler = _this select 3;
_lzPrefix = _this select 4;
_lzNames = _this select 5;
_he>
22:36:27   Error position: <select 4;
_lzNames = _this select 5;
_he>
22:36:27   Error Zero divisor
winter rose
#

a code error apparentlyโ€ฆ?

spark turret
#

well its obviously not a zero divisor. and the parameters are all there

#

im trying to parse the above logged params into my variables in an ace addaction

#

fixed the zero divisor.

what does that one mean:
22:58:22 Transfer of uninitialized variables is not supported
EDIT: i passed the wrong variables, basically i gave <null> into params.

#

aha, now that looks suspicious
23:02:25 ["markername ",scalar NaN]
23:02:25 Transfer of uninitialized variables is not supported

#

if you add <null> + <null> it gives you scalar NaN. ๐Ÿคญ

wary hill
#

Hello, is there any tutorial/info how I can spawn custom groups with custom loadouts (i.e. Syndicat troops with CUP weapons) with use of CustomGroups.inc or smth similar?

winter rose
spark turret
#

i fed an array out of bounds into params, it parsed that into a string and a string array and i tried concatenating string1 + selectRandom stringArray

winter rose
#

ah, string + nil ๐Ÿ˜„

#

selectRandom [] is nil iirc

spark turret
#

what about selectRandom <null> ๐Ÿ˜„

#

a lot of commands werent failsafe here lol surprised i even got that far

#

probably bc they were intitialized through params but had no value

#

how do i access the maps center (to catch findSafePos returning its default)?
default map center position is returned, which will be in format [x,y,0]

cosmic lichen
#

worldSize / 2

spark turret
#

aha! thank you

errant cedar
#

Hello, hopefully this is the right place to ask... I am trying to have a sound play when I open an ammo container, or close said ammo container. (not just the one, the entire "class" of object) that i'm importing into the game. The problem is, I have no idea how to do this. I've tried utilizing eventHandlers but i'm very new to this and it's quite confusing. Here are my pastebins.

https://pastebin.com/vxQbpqJM config.cpp
https://pastebin.com/cSU8RWmp bagsounds.sqf

spark turret
#

help, findSafePos keeps giving me the same position as the map center, but its not the maps center:
0:19:09 ["world center: ",[7680,7680,0]," for worldsize: ",15360," distance pos to center: ",827.377]
0:19:09 ["found safe spot at search radius",50," : ",[7228,6987,0]] <- same value again and again, close to map center, but not quite.

haha how dumb, its a hardcoded config value:
_worldcenter = getArray (configfile >> "CfgWorlds" >> worldName >> "centerPosition");

wanton inlet
#

Hi all, looking for a script to addAction on a vehicle that when selected it will respawn back at fob/set location.

spark turret
#

theres a module for that

tidal ferry
#

Hey, is there any way to get the functionality of initPlayerServer by executing code inside of init.sqf?

#

Currently looking to condense the standard files we use in missions (e.g. initPlayer, initPlayerServer, initServer, onPlayerRespawn etc.) into one CfgFunctions function that can be called from init.sqf

winter rose
tidal ferry
winter rose
#

you might miss some arguments mayhaps? idk

tidal ferry
#

The code I need to execute is ```{
if (!isnull (getassignedcuratorunit _x)) then {
_unit = getassignedcuratorunit _x;
if (isnull (getassignedcuratorlogic _unit)) then {
unassignCurator _x;
sleep 1;
_unit assignCurator _x;
};
};
} foreach allcurators;

lavish sparrow
#

Can I use a script to make any object join a faction so that AI would shoot at it? Like for an firing range.

plain patio
#

anyone know of a basic script that could spawn a vehicle when you interact with whatever object the scripts on, as i wanna setup something of the sorts that just spawns a vehicle on a invisible helipad, etc?

olive cairn
#

Hi. I need your help again. I have a trigger activivated on bluefor prescence that will fire a say3D in a loop:

nul = [thisTrigger] spawn {while {true} do { 
[tv1, ["Audio1", 22, 1]] remoteExec ["say3d", 0, true]; 
; sleep 150;};};

my problem is that the trigger is firing continuosly each time a bluefor unit enters the area or if the same unit stills there, overlapping the audio. my idea is just to play once in loop no matter how many bluefor units are on the trigger. once they leave the area the sound will stop and if they re enter the tv will say3D again. Any idea?

#

thanks in advance

olive cairn
lean anchor
#

is there a way to see/know how many EHs have been made? im trying to check how many "killed" ehs are running with the mods i use before thinking about using it for my own purpose

little raptor
little raptor
plain patio
#

cheers

main shale
#

can someone tell me where can I find a list of examples for proper syntax that are used to activate triggers? for example how do I write if I want "X unit" to move forward after been fired upon but only continue moving strategically to, not mindlessly continue to move forward?

#

idk if im being clear enough, im trying to make a scenario where the enemy attacks first, blue forces hold off the attack and after holding off the attack mount a counter attack on the enemy camp. I already gave them the waypoints from point A to point B, but I only want them to begin moving after the 1st attackers have been eliminated

main shale
#

Ty

wanton inlet
# spark turret theres a module for that

The module works but I want to have a action on the vehicle that the player can select with the mouse wheel to manually respawn the vehicle. Say tire were blown out the player can respawn it back at the starting point respawn location manually.

warm hedge
#

_unit does not exist in onEachFrame

proven charm
#

how can you set all flags true with BIS_fnc_bitflagsSet?

winter rose
#

16777216

proven charm
#
b = [0, 16777216] call BIS_fnc_bitflagsSet;
#

b becomes zero

acoustic abyss
proven charm
#

65535 works

wanton inlet
round scroll
#

I'm working with NightIntruder on a carrier and wonder if there's a way to detect if any object/plane is on top of the landing strip of the flight deck. Is there any way to detect this straight forward? I consider checking the nearEntities of 150 meter around the carrier and for any vehicle check if it's on top of an landingstrip invisible object with lineintersectswith function. Basic function is to allow pilots to 'call final' and get confirmation by the CV is the deck is clear or not for landing.

#

if there's a more clean path to the above problem, I'd be happy to read about it!

winter rose
#

using isTouchingGround maybe?

#

@round scroll โ†‘

little raptor
#

isTouchingGround + inArea

round scroll
#

inArea?

#

ok, thanks!

little raptor
#

landing strips are rectangular aren't they?! tanking

winter rose
#

a carrier should be, at least ๐Ÿ˜„

#

although there was this round carrier prototype at one point ๐Ÿค”

little raptor
#

there's also inPolygon

#

but it's 2D

#

inArea can be 3D

#

although I assume inPolygon + a simple altitude check is enough

round scroll
#

the landing part of the deck is pretty rectangular indeed

little raptor
#

if you want 100% accuracy inPolygon is a good choice tho ๐Ÿ˜„

#

that plus vectorUp and vectorDotProduct (since the carrier is flat, I assume?)

round scroll
#

yes, the flightdeck is flat

winter rose
#

unless it's sinking - you are not thinking of everything Leo!! ๐Ÿ‘€ ๐Ÿ˜„

round scroll
#

ha ha, I tried that once with the Nimitz. Ye good ole man on moving object problem

little raptor
#

altho doing that in model space seems a way better option

winter rose
#

but if it is upside down and one lands on the keelโ€ฆ? ah-HAH !!

round scroll
#

lol

winter rose
#

โ€ฆbut ok joke aside, inArea (3D) + isTouchingGround should do ๐Ÿ˜„

#

not inArea 2D version, otherwise wrecks at the bottom of the sea would trigger it too ๐Ÿ˜„

little raptor
#
if (isTouchingGround _plane && {
  _planePos = ASLtoAGL getPosASL _plane;
  (_carrier worldToModel _planePos) inPolygon _deckPoly //deckPoly must also be in model space
  && {
    _diff = _planePos vectorDiff _deckPos; //deckPos is also in model space
    abs(_diff vectorDotProduct [0,0,1]) <= 5 //on deck (3D) 
  }
}) then {
    //on deck
}
round scroll
#

so I'll place four mem points on the edge of the flight deck landing strip, use inArea or inPolygon with modelToWorld/selectionPosition and nearEntities

winter rose
#

you could even use bounding box, it's not that bigger I guess

round scroll
#

so in case a wing is over the landing strip it's recognized?

winter rose
#

yes, the getPos takes the object's centre ๐Ÿ™‚

#

(more or less)

#

it is not checking if the whole item is in the box, only the centre point

round scroll
#

yes, so i'd need to check the four rectangle corners of the bounding box around the plane?

winter rose
#

with the altitude check as well

proven charm
#

you can also use BIS_fnc_nearestPoint to check if plane is on the runway

#

using that in my script ๐Ÿ™‚

winter rose
#

that might beโ€ฆ how?

little raptor
winter rose
#

agrrrrrr รจ_รฉ

proven charm
#
_p = [_runwayStart,_runwayEnd,getposATL _veh,false] call BIS_fnc_nearestPoint;
if(_p distance _veh < 20) then
{
_runwayClear = false;
};
#

something like that

little raptor
#

that's just a line

proven charm
winter rose
#

so you have an ovale around the line ^^

#

I mean, it works ๐Ÿ™‚

round scroll
#

I wonder if I should use nearestPoint for the wire grappling detection... there are three arresting wires and I check now if the tailhook is close to the line between two wire anchors

#

or might it make more sense to define an area with inArea and check tailhook pos inside any of them... hmm

little raptor
#

but engine commands (inArea and inPolygon) are faster than scripts (BIS functions, etc.)

#

(if performance matters for what you're working on)

round scroll
#

yes, that's my thinking. Right now I use custom code for that, it has to run in a per frame eh so perf is relevant

hollow thistle
round scroll
#

no, it's checking distance to a 'wire center' point and then auto applies the brakes (on the Freedom and Nimitz)

hollow thistle
#

oof meowtrash

round scroll
#

for the new carrier I've experimented with attaching ropes between tailhook and wire anchors, but I need to detect the point when the hook catches one of the wires

hollow thistle
#

But I think near entities might be useless.

#

inArea alone should be faster.

round scroll
#

inArea does not detect objects

hollow thistle
#

What is the functionality exactly?

round scroll
#

Right now I consider creating a global array of planes and one for carriers and walk through this rather than use nearEntities/Objects whatever

#

I mixed two questions now: 1) how to detect if a plane is on the landing strip of the fligh deck for a 'final approach' call by the approaching plane. 2) how to detect if a tailhook grapples a wire during the landing/touchdown part

#

I think inArea sounds like a good approach to either problem

hollow thistle
#

Basic function is to allow pilots to 'call final' and get confirmation by the CV is the deck is clear or not for landing.
for that nearEntities is needed, right. As it's called on demand I assume performance is not that important.

#

how to detect if a tail-hook grapples a wire during the landing/touchdown
is BI functionality not enough?

round scroll
#

no, I want to extend in the mod what BI/Bravo provided in the Freedom

hollow thistle
#

gotcha. For that I guess you could use only the inArea.

#

eachFrame where plane is local check if tailhook is inArea defined by carrier memory points. thomp

#

I would do it like this if it would be performant enough.

#

Is the tailhook handling really in scripts? I can't find any BI code related to this.

round scroll
#

first check in the eachFrame is currently if it's already grappled (getVariable on plane), then distance plane and carrier smaller than 150, then the actual check for wire grappling. That is hopefully reasonably cheap to start with the getVariable and distance

round scroll
#

so you need to check the F-181 jets dlc functions

hollow thistle
#

Cou can benchmark this

round scroll
#

it's a bit improved over the old Nimitz functions, but basically same approach

hollow thistle
#

but distance check is most likely not that much less expensive than inArea

round scroll
#

ok, run it in debugger and measure the time?

hollow thistle
#

It will be more expensive due to all the modelPositonToWorld that you will need to do to get the area itself thomp

acoustic abyss
hollow thistle
#

but... you could create a trigger and attach it to carrier when it inits.

#

then I guess it would look something like
_plane inArea (_carrier getVariable "carrier_tailHookArea") thomp

round scroll
hollow thistle
#

but how you create the poly.

round scroll
#

selectionPosition

#

mem points on the carrier

hollow thistle
#

so that's 4 additional command calls.

round scroll
#

as you mentioned the carrier is not moving, so I can init a variable with it, good idea

hollow thistle
#

If we assume it cannot be moved by scripts then it's fine. You can store the area on the object.

round scroll
#

ha ha, if you start moving it with a script all kind of funny things might happen ...

hollow thistle
#

jesus, the tailhook wire arrest is really scripted...

#

In a damn spawned script.

round scroll
#

lol, same for the Nimitz... old code!

cosmic lichen
#

Yeah, all these things are scripted ๐Ÿ˜„

hollow thistle
#

have fun landing with low fps with a lot of scripts running.

round scroll
#

thanks for all the useful information!

spark turret
wanton inlet
#

Thanks, will have a look and see what I can come up with๐Ÿ‘

winter sierra
#

does anyone know how to restrict a radio channel to people with curtain backpacks, and also in vheicles ??

winter rose
#

@winter sierraalso don't crosspost thanks (#rules)

winter sierra
#

ahh sorry i am about to delete the one in mission makers

#

never mind ๐Ÿ˜‰

#

thanks

#

yeah i have the channel (literally just a module) but i want it to only be avalable for people in Pilot/CoPilot/Driver/Gunner seats

#

and people with curtain backpacks

tough abyss
#

Is it possible to make a permanent script that runs though the whole game that makes lightning strike a player if they teamkill?

winter rose
#

yes

tough abyss
#

Oh my

#

Aw the gif didnโ€™t work

#

Okay so... how do I make that happen?

little raptor
#

selectionPosition returns coords in model space

round scroll
#

yes, ok, and worldtomodel translates the plane coordinates

little raptor
#

Yup

#

You only need 1 translation

#

It's very cheap

round scroll
#

ok, I'll remove the distance check and just go with the inArea

little raptor
#

Just cache the selectionPosition (they're always fixed in a fixed bone structure)

round scroll
#

yeah, the flightdeck is pretty much fixed ๐Ÿ˜„

#

I think I will change the Nimitz elevator code for inArea as well

vague geode
#

Is it possible to create a custom radio channel with the same properties as the direct communication?

sullen robin
#

Not sure if Iโ€™m just too tired, dumb or just played arma for too long, but Iโ€™m having issues with this:

{_x allowDamage false;} forEach units group groupname;
waituntil {triggerActivated task2trg};
{_x allowDamage true;} forEach units group groupname;

Basically having this specific group invincible up until player reaches a certain trigger. Any ideas?

willow hound
#

It should probably be forEach units groupname ๐Ÿ™‚

spark turret
#

!sqf

#

/sqf

#

D:

spark turret
#

stop mocking my misery D:

sullen robin
#

Error says type group, expected object

Leaving โ€œgroupโ€ out creates a generic error in expression

spark turret
#

WHY

```
it worked perfectly 16 hours ago
#

Ducking arma keeps ducking crashing i hate my life

cosmic lichen
#
{_x allowDamage true;} forEach units GROUP_NAME;
sullen robin
#

From RTP:

10:55:54 Error in expression <{_x allowDamage false;} forEach units group groupname; waituntil {triggeract>
10:55:54 Error position: <group observation; waituntil {triggeract>
10:55:54 Error group: Type Group, expected Object

spark turret
#

i bet you named your group oberservation

sullen robin
#

@cosmic lichen using it like that causes a generic error in expression

spark turret
#

you dont need the "group" command then, its already a group

sullen robin
#

Yeah I used groupname here to make it easier

#

Thatโ€™s why Iโ€™m breaking my brain, both cause an error

spark turret
#

show code that causes generic error

sullen robin
#

{_x allowDamage false;} forEach units groupname;
waituntil {triggerActivated task2trg};
{_x allowDamage true;} forEach units groupname;

cosmic lichen
#

This is correct. You probably have a wrong var name somewhere

sullen robin
#

Would it matter where I executed it? This one is in TLโ€™s init

cosmic lichen
#

with spawn?

sullen robin
#

Yes

spark turret
#

Nah shouldnt matter

#

Gib error code of generic one

sharp peak
#

I'm trying to made a trigger activate when all intel has been picked up (it deletes itself)
This is my triggers Condition
!alive intel_1 && !alive intel_2 && !alive intel_3
That worked like it should

#

But then I want only some intel to spawn, completely random how much and which ones, so I set them all to probability of presence - 50%
When I do this, trigger doesn't activate anymore

#

Did I do smth wrong, or is there a better/working way to achieve what I'm trying?

sullen robin
#

if not all of them are spawning try using or instead of &&

sharp peak
#

Wouldn't or only complete when one of them is picked up?

#

I want all of the spawned ones to be picked up for the trigger to activate, so if two spawn - or would activate after I pick up only one

copper raven
#

command will fail silently if an argument is nil

#

so, if one of those variables is nil, everything will fail

sharp peak
#

Makes sense, what can I do about it/can I go around it?

copper raven
#

you can check if they're defined with isNil, personally id make an array of intel, and use findIf or something like that

sharp peak
#

So basically smth along these lines?
if (isNil intel_1) then {!alive intel_2 && !alive intel_3}

#

And then just repeated with elseIf for every other possible situation? That would be way to messy, since I'd have more than 3 intel pieces

#

How would I use findIf instead?

#

Would this be it?
waitUntil { {!alive _x} count [intel_1, intel_2, intel_3] == 0 };

#

or
waitUntil { [intel_1, intel_2, intel_3] findIf {!alive _x} == -1}

cosmic lichen
#

neither count nor findIf return what waitUntil needs

sharp peak
#

edited, forgot the 0 and -1

#

Those are exampled from the biki

#

So if they aren't it, should I do it?

cosmic lichen
#

Now they will work

sharp peak
#

Ah, perfect

cosmic lichen
#

Not sure what happens if !alive nil

#

Will need some testing

sharp peak
#

About to try it out)

copper raven
#

i told you that it fails silently

sharp peak
#

waitUntil { {!alive _x} count [intel_1, intel_2, intel_3] == 0 }; returned true instantly, which I didn't work
waitUntil { {alive _x} count [intel_1, intel_2, intel_3] == 0 }; worked, but had an error on mission start

#

'...e _x} count [intel_1, intel_2, intel_3] |#|== 0 };}'
Error Generic error in expression

#

same error and results with the other one

#

I guess I'll stick with the error one, since it seems to work fine still. Ty for help)

spark turret
#

!sqf cries silently

#

I hate arma. It kept crashing for 2 hours, probably bc my virtual machine is bugged, then it claimed my addAction is broken, which worked yezserday so i debugged it and changed nothing and it works again

still forum
spark turret
#

Nah, its a problem on my end

still forum
#

Arma crash == arma problem :u

spark turret
#

I have an ubuntu running in a vm and that is causing problems with my RAM (i think)

My exploresers and VCS crash and reopen and arma doesnt survive but freeze. Ill send in the mdmp

sharp peak
#

Now I'm trying condition of presence. Intel_1 should only spawn when elder_1 exists.
I've tried alive elder_1, which resulted in nothing spawning
Then tried if (alive elder_1) then {true}, which did the same

#

Again, am I doing it wrong, or am I using the wrong tools?

spark turret
#

youre wanted tool is "diag_log [myStuff]" to see if your code works and checking the .rpt ๐Ÿ™‚

sharp peak
#

I don't know what that means

wary hill
#

Any help w/ praire fire?

_newGrp = grpNull;
_newGrp = [_basePos, east, configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> "OIA_InfTeam", [], [], [0.2, 0.3]] call BIS_fnc_spawnGroup;// Spawns Vanilla east team

_newGrp = grpNull;
_newGrp = [_basePos, east, configfile >> "CfgGroups" >> "East" >> "VN_VC" >> "vn_o_group_men_vc" >> "vn_o_group_men_vc_01", [], [], [0.2, 0.3]] call BIS_fnc_spawnGroup;// Error: Generic error in expression fn_spawnGroup.sqf line 160
spark turret
#

diag_log is a command that writes to your error log file (the .rpt)

#

use that to write your stuff step by step into the log file, making sure the values are correct

spark turret
#

also it tells you errors in there so you know what went wrong

sharp peak