#arma3_scripting

1 messages ยท Page 545 of 1

winter rose
tough abyss
#

yes indexes start at zero

#

so second wp would be 1 no

winter rose
#

[center, radius, index, name]

#

you are setting radius

also, index and name are optional

tough abyss
#

Maybe setCurrentWaypoint

granite basin
#

Ok, so say that I want to put a uniform on a player that interacts with an add action. What param would I have to use to make it refer to them when the uniform/gear is being placed on them?

still forum
cosmic lichen
#

What do you mean by "param" ?

granite basin
#

I want to make it that when A script is called through a player interacting with and addAction, the script knows what player called it.

tough abyss
#

Check addAction documentation on wiki

cosmic lichen
#
[
    "<title>", 
    {
        params ["_target", "_caller", "_actionId", "_arguments"];
    },
    [],
    1.5, 
    true, 
    true, 
    "",
    "true", // _target, _this, _originalTarget
    50,
    false,
    "",
    ""
];```
#

_caller would be the param you are looking for,-

granite basin
#

Ok, thanks

cosmic lichen
#

You're welcome.

tough abyss
#

ok ```sqf

waitUntil { sleep 1 ; units _playerGrp findIf { not (_x in _extractHeli) } == -1 };``` is breaking my script

#

i riped this out and the chopper now hits all its waypoints

cosmic lichen
#

make sure _playerGrp and _extractHeli are defined and correct. The code looks fine.

tough abyss
#

they are corect

#

dosnt work

cosmic lichen
#

How did you check?

#

Because I just checked the code ingame and it works.

tough abyss
#
_playerGrp = group player;
_crew1 =[];
_extractHeli =[];




//Spawns INvisible landing pad Near player
_extract = createVehicle ["Land_HelipadEmpty_F", position player, [], 20, "NONE"];
sleep 0.5;
_mk1 = createMarker ["extractmarker", _extract];
_mk1 setMarkerType "hd_pickup";


//spwans extraction Chopper

_crew1 = createGroup WEST;
_extractHeli = [getPos heliPad,0,"B_Heli_Light_01_F", _crew1] call BIS_fnc_spawnVehicle;
sleep 0.5;```
cosmic lichen
#

are you variables set to private?

tough abyss
#

its all in the one script

cosmic lichen
#

Doesn't matter, always set them private

tough abyss
#

isnt that what _ means

cosmic lichen
#

private _XXXX

#

_extractHeli is not the heli

winter rose
#

_var means local variable.
private _var means local to this scope

cosmic lichen
#

it's an array with [heli,crew,group]

winter rose
#

-showScriptErrors + wiki is the winning combo ๐Ÿ’ฏ

tough abyss
#

i have the show script erros box ticked i wasnt getting any error the chopper just wouldnt move

winter rose
#
private _extractHeli = ([getPos heliPad,0,"B_Heli_Light_01_F", _crew1] call BIS_fnc_spawnVehicle) select 0;```
cosmic lichen
#

Because it will not show an error

#

in can work with vehicles but also with arrays

#

Ask BI why the mix an array command with vehicle stuff...

ruby breach
#

I mean, I could think of many things that we could ask BI as to why they are the way they are lol

cosmic lichen
#

๐Ÿ˜„

tough abyss
#

fuck it got it wroking now ended up using sqf waitUntil {({_x in (crew _extractHeli)} forEach units _playerGrp)};

still forum
#

no that doesn't work

tough abyss
#

just worked

still forum
#

nope

#

forEach returns the result of the last iteration

#

You are checking if the LAST unit in the players group is in the helicopter

#

even if all other members aren't inside it

winter rose
#

count would be what you want, findIf even better

cosmic lichen
#

findIf was just fine.

#

Just use the code Lou posted to get the helicopter instead of the array with crew and stuff.

tough abyss
#

ok i think i understand that code now

exotic flax
#

Is there, or will there be ever, a scripted way to create a directional light source?

winter rose
#

@exotic flax there is none, and very unlikely

tough abyss
#

im hesitant to just slap code in that you guys give not because its wont work but because you cant really learn by being given the answers

winter rose
#

@exotic flax maybe (but I just though of that)
create a spotlight, enableSimulation false, and hideObject

but I reaaally don't think it will work.

exotic flax
#

And is there another method to get directional light? I've seen some stuff where a hidden vehicle (with headlights) got attached to a unit, but that doesn't seem to work very well

cosmic lichen
#

@tough abyss You don't have to slap it in. Just ask, if there's anything you don't understand.

winter rose
#

@cosmic lichen your English, for example ๐Ÿ˜„
I recommend you slap your fingers for not following the tempo ๐Ÿ˜ƒ

cosmic lichen
#

wtf. I should look at what I am writing ๐Ÿ˜„

#

It's not the fingers that need a slap. It's the brain.

exotic flax
#

hits head
now I have a headache

tough abyss
#

so let me get this right

thanks to the waitUntil, findIf keeps looping through my group array looking for units not in the chopper and returning a 0

#

wouldnt it terminate after the first unit enters the chopper

cosmic lichen
#

It exits when it finds the first unit which is not in the chopper.

tough abyss
#

ohhh _x in extracHeli so it has to get that result for each right

cosmic lichen
#

Because you negated the condition with NOT

#

ohhh _x in extracHeli so it has to get that result for each right Yes, exactly.

tough abyss
#

the biggest thing that trips me up are all the {} () []

#

i know [] are arrays

cosmic lichen
#

Yes. That's confusing in the beginning.

exotic flax
#

[] = Array, () = Statement, {} = Script

#

like in any programming language ๐Ÿ˜‰

cosmic lichen
#

() are just brackets. They do that same as in algebra.

winter rose
#

clutter things

tough abyss
#

() are just brackets. They do that same as in algebra. I TOOK TRADE MATHS

winter rose
#

(and also prioritising stuff, they do have a use ^^)

tough abyss
#

you know 1+1 = window

#

or if you want to be mean dummy maths

exotic flax
#

who needs maths when you can program a calculator ๐Ÿ˜›

cosmic lichen
#

Nothing better than having a calculator program during a test which solves the task in 30 seconds for which your class mates need 30minutes

#

Will never forget that moment when I finished first, 40 minutes before the official ending ๐Ÿ˜„

austere granite
#

I think graphical calculators these days have some sort of 'exam mode' which locks you out of certain areas

exotic flax
#

so no more Doom on my calculator? ๐Ÿ˜ฆ

cosmic lichen
#

These days maybe, mine if probably 10 years old or so.

austere granite
#

Well, not during exams

#

Yeah my TI-84 plus is like... 16 years old now? ๐Ÿ˜„

cosmic lichen
#

Got a ti 82+

finite dirge
#

And they haven't changed much since.

tough abyss
#

lol il never forget the look on my manufacturing teachers face when gave us a huge like 30 page work book that was supposed to last us entire semester, pulled an all nighter handed it back to him the next day completed!!

winter rose
#

@cosmic lichen calculator bro

austere granite
#

Apparently the Ti-84+ isnt allowed to be used here anymore with exams, just did a quick google and it was the last year

tough abyss
#

pffft i have one of those calculator watches

austere granite
#

New version has 'required exam mode' but that's maybe just for the Netherlands. I imagine it would lock you out of using programs or something like that.

cosmic lichen
#

@winter rose You're just jealous.

winter rose
#

what, I have a Ti82? I meant we are calculator bros!

cosmic lichen
#

๐Ÿ˜„

cosmic lichen
#

Truth be told, programming that calculator for exams probably tought me more than visiting 5 lessons.

tough abyss
#

ok wtf now my script picks me up and flies me to debug corner even though thats not where the marker for that waypoint is

#

lol

austere granite
#

"debug corner" always makes me giggle

#

markerPos "nonexistant" will always be 'debug corner'

tough abyss
#

ohh ok marker name was incorect

austere granite
#

yep there ya go

cosmic lichen
#

Script works on DS but I am not looking for optimisations.

exotic flax
#

@cosmic lichen perhaps add a parameter to force the unit to stay in the animation, so that it can be used as static animations. Or make it so that the unit returns to its position and restarts the animation the moment it is safe again.

#

because nothing is worse than a guarding unit who goes on a rampage and never comes back for duty ๐Ÿ˜‰

tough abyss
#

ok were do i find the names for things like smoke grenades and chem lights

cosmic lichen
#

@exotic flax That's planned. Firstly I wanna get the basics working

tough abyss
#

cool thanks now i have smoke where my chopper is going o land

cosmic lichen
#

The question I have is if I should use a unique JIP string and use that to remove the remoteExec from the queue once the animation was exited.

exotic flax
#

well, using the unit object already makes it unique

cosmic lichen
#

Right. Forgot about that.

tough abyss
#

how do i set up an event handler so that when its triggered it runs my script

tough abyss
#

yeah but where do i put my code in this

this addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
}];```
finite dirge
#

Between the {} or call your function instead.

tough abyss
#

after the params but before }];

finite dirge
#
this addEventHandler ["Fired", {_this call your_fnc_youWant}];

For calling a function. Params is in the code, but after would be fine, yes.

tough abyss
#

ah yeah im not up to making my own functions yet

#

i can barely manage a script

#

so sqf p1 addEventhandler ["Fired", {p1, "SmokeshellBlue", insert script here}];

ruby breach
#
this addEventHandler ["Fired", {
    params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
    //your script here
}];
finite dirge
#

You are missing { in your message I think.

tough abyss
#

ahh ok but a smoke grenade dosent have a muzzle

ruby breach
#

You aren't defining those things, they're already defined

tough abyss
#

i confused XD

#

so i dont touch the things in params

ruby breach
#

No

#

You use them in your code. _unit is the unit that fired. _weapon is the weapon he fired, etc

finite dirge
#

Those are all the things passed by the event into your code.

tough abyss
#

fack it its late im tired il just leave it as a damn radio activation i cant be assed at the moment XD

#

still its working now

#

so i can just rip it out and stick it in my other missions now

#

XD

upper cliff
#

does anyone know how I can have the player's inventory carry through to the next mission in my campaign?

finite dirge
#

Create functions to save and load it. Then save it to the profile or a database with a mod/extension.

frozen gull
#

how do i add my custom music into a multiplayer mission? and is there any restriction on filesize for it?

finite dirge
upper cliff
#

so would I use parsingNamespace or profileNamespace?

finite dirge
#

Profile.

upper cliff
#

alright that's what I thought

upper cliff
#

so it says the inventory isn't found, this is just because im going right into the second mission right?

finite dirge
#

What do you mean?

upper cliff
#

im working on the second mission of the campaign and when i play through, it says the inventory isn't found

#

im assuming this is just because since i didn't play through the first mission it has nothing to load

half monolith
#

I am working on a pvp mission, and have a perpetual problem with "error no unit" . it shows up in the killkeed, it seems to happen midgame, (a player that starts with a known name, will turn into error no unit) . i think this comes from calling name on a dead unit, and after a player receives the error no unit, it is not able to be reversed without them leaving?
i suppose my question is if this is indeed the case, and if anyone knows any work arounds. ive had this issue for a year, over several missions. i am setting a name and side var while the player is alive.
remove it by event handler on death, add back on player respawn.

torpid grail
#

We've been having that exact same issue in the unit I'm in for quite a while now, and multiple people have asked that same exact question multiple times and nobody answered. So I assume it's something that you can't do anything about, you just have to hope it happens later in the mission and it arma doesn't want to crash your server that time

neon snow
#

Hey there is there a way to increase quality/resolution of live feed created using BIS_fnc_liveFeed ?

finite dirge
#

There's a PIP quality in your settings.

#

It may be that.

neon snow
#

Unfortunately no

#

looks significantly worse than other PIP screens

half monolith
#

i do believe it is an engine problem , it even has effect on the players sidechat.(they seem to lose side too but im coming from a place where , it wasnt a problem, ever, so i do believe it can be worked around.

torpid grail
#

Yeah, I'm 99% sure it's a problem in the engine itself too. The last time I looked at the log file when that happened I noticed it started spamming that right after a group of units got garbage collected (Or the zeus deleted them) and those exact 4 units were being reported as not having a name. The solution then would be to not delete units, but that's not something we can do.

The only difference from your case to ours is that I can't remember if the units were players or not, so I'm not sure how that affects it. We only notice that it is spamming the RPT after the server has crashed, so we can't pinpoint the units that are causing that while it is happening

half monolith
#

i have seen it happen on ai once in my travels, but it is the same, it ends up being a player, but who, and , not even really able to do anything with that person in our admin consoles.

oak parrot
#

Is there a way to detect a player's Arma 3 unit? For example, Player 1 is in (for example) the 1st Infantry Division, and so he gets a certain loadout, but Player 2 loads in and is part of the (also for example) 2nd Infantry Division, so he gets a different loadout

still forum
#

yes

oak parrot
#

Thanks for the fast response

spark turret
#

@oak parrot you can also give the players units specifiv names in the editor and directly call them in your scripts.

#

or their groups

oak parrot
#

The main usage is for joint operations (the two units I used for examples are not the two units that are doing it)

#

To significantly cut down time for loadouts and etc

#

People like to play dress-up

spark turret
#

yeah

#

use a custom ace arsenalo reduced time too

#

quite easy to set up as well, time of setting up depends on how many different items you want in it

oak parrot
#

That may be worth looking into as well

spark turret
#

or combine both (like i do). spawn loadout has uniform and bandage shit and some grenades but no weapon, that is chosen in the custom ace arsenal. its fast, fool proof and player still get to choose a bit.

oak parrot
#

Sure why not

#

I'll do it

tough abyss
#

hello

#

does anyone know why this happens?

#

i'm trying to make AI get in player's vehicle using this script
{
_x assignAsCargo (vehicle player);
} forEach units _group;
(units _group) orderGetIn true;

#

but for some reason when i'm as the commander, gunner or passenger of the vehicle and the engine is on they get in position to get in, but wont get inside,

finite dirge
#

Are they the same side as you?

tough abyss
#

yes they are

#

they get in once in change seats to driver

#

or if i get in driver turn the engine off and get back as commander

#

or just using the script when the mission starts and the vehicle has not started by the other crew member

eager mesa
#

On my server the map cursor isn't showing the gridref and elevation asl for some reason, we haven't purposely removed it and don't know what could have removed it

vague harness
#

Hello I'm having trouble with BIS_fnc_holdActionAdd

#

Getting "error params: type number, expected bool

#

this is my code

#
 removeallitems _fobcrate;

 private _alliesNearby = [];
        {
            // _x is a magic variable see https://community.bistudio.com/wiki/forEach
            if ((side _x) == (side player)) then {
                _alliesNearby pushBack _x; // If sides are the same, add man to array
            }
        } forEach (getPos player nearEntities ["Man",25]);
 [  
    _fobcrate,                                        // Object the action is attached to
    "Deploy FOB",                                        // Title of the action
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",    // Idle icon shown on screen
    "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa",    // Progress icon shown on screen
    "_this distance _target < 3","leader _caller == _caller","count _alliesNearby > 2",                        // Condition for the action to be shown
    "_caller distance _target < 3",                        // Condition for the action to progress
    {},                                                    // Code executed when action starts
    {},                                                    // Code executed on every progress tick
    {execVM "${scripts\FOB.sqf}"},                // Code executed on completion
    {},                                                    // Code executed on interrupted
    [],                                                    // Arguments passed to the scripts as _this select 3
    5,                                                    // Action duration [s]
    0,                                                    // Priority
    true,                                                // Remove on completion
    false,
    true                                                // Show in unconscious state 

] remoteExec ["BIS_fnc_holdActionAdd", 0, _fobcrate];    // MP compatible implementation ```
#

I can't figure out which param is a number and would need to be a bool

#

this is the params for this function

vague harness
#
title, 
idleIcon, 
progressIcon, 
conditionShow, 
conditionProgress, 
codeStart, 
codeProgress, 
codeCompleted, 
codeInterrupted, 
arguments, 
duration, 
priority, 
removeCompleted, 
showUnconscious, 
showWindow] ```
#

I know @still forum ๐Ÿ˜†

still forum
#

what can't you figure out? everything is listed on there

vague harness
#

why it's giving me: error params: type number, expected bool

#

theres only 3 bool in the function and I have them listed

still forum
#

so then some parameter where you have a number, should be a bool

#

your execVM there is wrong syntax btw

vague harness
#

yeah it wasn't working

#

its what I got on the wiki lol

still forum
#

you are two arguments off

vague harness
#

yeah the // arent exact

still forum
#

no

#

just count the commas

vague harness
#

I tought I did, 1 sec

#

ah I see

still forum
#

your 5 is where removeCompleted should be

#

you have 3 parameters where the comment says "condition for action"
but it's 2 conditions, and codeStart there

vague harness
#

how do I split multiple conditions for the scipt to appear

#

()?

ruby breach
#

&&

vague harness
#

I feel stupid now, Thanks @ruby breach and @still forum

#

Also, how could I make it so that the sectors in SC are capturable in a certain order and not all at once?

#

disable simulation?

tough abyss
#

anyone has any idea on the error i'm experiencing?

vague harness
#

@tough abyss I think this is a problem with the game as I have experienced this exact problem during a BI campaign mission. Get out of the vehicle and they will get in

tough abyss
#

demn, they i will have to limit the script so it only activates when player is driver

#

then*

vague harness
#

It happened when I was commanding the marshall on the Steel Pegasus Campaign. I went to extract the wounded and they wouldn't get in.

#

So yeah

#

@tough abyss might be worth shooting a ticket over to BI since you have the exact faulty code.

tough abyss
#

Oki doki will try that

vague harness
neon snow
#

Soo, anyone tried setMissileTarget and other new commands? tried to use them with Fired eventhandler, none of them works

copper raven
#

@neon snow of which missile are you trying to set the target?

runic quest
#

Hey, excuse me, I want to ask you, when I am copied by shift + R, I can't switch the voice channel (team channel, direct communication, etc.) so that players can't communicate after being arrested by the police. I want to solve this problem, how to operate it?

tough abyss
#

question would this be a way to get a random spawn

_spawnLocation = selectRandom ["marker1", "marker2", "marker3"];
[ getMarkerPos _spawnLocation, EAST, ["TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;```
frozen gull
#

Im having trouble adding in music into my game. I've done the description.ext and placed my music into a folder with the .ogg files in it, but for some reason the command I run on a trigger in game doesn't play the music track that I've defined.

tough abyss
#

@frozen gull throw up your script plz

frozen gull
#
{
    tracks[] = {};
    
    class Track01
    {
        name = "SUPER MEGA ACTION";
        sound[] = {"\sound\Track01.ogg", db+0, 1.0};
        duration = 147;
        titles[] = {0,""};        
        musicClass = "Action";
    };
    
    class Track02
    {
        name = "Eerie";
        sound[] = {"\sound\Track02.ogg", db+0, 1.0};
        duration = 360;
        musicClass = "Stealth";
        titles[] = {0,""};
    };
}; ```

thats my description.ext
tough abyss
#

remove the \ from before sound

frozen gull
#

kk

tough abyss
#

oh no sorry my bad thats not it

frozen gull
#

but the code that i run on trigger activation is
playMusic ["Eerie", 0];

tough abyss
#

playMusic "Eerie";

#

you dont need the 0 as it will always play from start

frozen gull
#

the triggers all set but the music doesnt play when the trigger is activated

tough abyss
#

is your music off

#

in the options XD

#

ive done that before

frozen gull
#

no my music is on full volume

tough abyss
#

have you tried turning up the sound of the sond

frozen gull
#

gimme a sec

runic quest
#

Hey, excuse me, I want to ask you, when I am copied by shift + R, I can't switch the voice channel (team channel, direct communication, etc.) so that players can't communicate after being arrested by the police. I want to solve this problem, how to operate it?

frozen gull
#

nah didint work

tough abyss
#

give us a sec il test it on my end with a song i have

#

ah ok @frozen gull for what ever reason it wont work direct from trigger instead do this

frozen gull
#

whats this for @silk carbon?

grave torrent
#

@extDB3;@life_server are server mods

frozen gull
#

ahh right

tough abyss
#

@frozen gull in the trigger put ```sqf
execVm "music1";

next open up a note pad and paste this in  an put in ```sqf
playMusic "Eerie";```

save as music1.sqf as file type all files
frozen gull
#

kk

tough abyss
#

and stick that sqf in your mission file

#

@frozen gull so hows it going

#

@frozen gull me stupid trigger has to be sqf execVM "music1.sqf";

frozen gull
#

not working even with the code you've used

tough abyss
#

hmm ok

#

@frozen gull ```sqf
class CfgMusic
{
tracks[]={};

class Music1
{
    name = "Eerie";
    sound[] = {"\sound\track2.ogg", db+5, 1.0};
};

};```

try replacing your second song with this

#

@frozen gull in your description.ext

#

@silk carbon i havent a clue bout server stuff sorry

frozen gull
#

still not working

#

:|

#

omg

#

i think i figured out why

#

this is annoying

brittle harness
#

Anybody have a fix for ace3 medical with ryanszombies infection module? Zombies wont resurrect with ace 3

#

Oh thank u sirs

tough abyss
#

@frozen gull what was it

frozen gull
#

nah it still doesnt work but i just found out that my desc.ext had a missing letter within the filename

tough abyss
#

your files are ext and sqf right

frozen gull
#

yep

tough abyss
#

strange the code i gave you and how to run it should all work it does on my end

#

@frozen gull are you running -showscriptErrors

frozen gull
#

no but i managed to get it to work for now

tough abyss
#

lol

#

close arma and tick the box show script errors under paramaters in the launcher

frozen gull
#

the music finally was being shown within the trigger effects, after i fixed my misspelling for the desc.ext file

#

ok

tough abyss
#

oh are you trying to get it to show up in the music part of the triggers options

frozen gull
#

no but thats whats currently working right now

tough abyss
#

ah cool

#

yeah the way i was showing you it should just instantly play the music the instant you hit the trigger

you did put sqf execVm "music1";
in the onAct. field right

frozen gull
#

yea i did

vague harness
#

Is there a way to stop BIS_fnc_holdActionAdd from fading away when the duration used is long?

finite dirge
#

What do you mean? Just the unit being created? Take the array and make the selectRandom on an array of arrays.

#

If you mean the created group, put the vars in the array.

tough abyss
#

anyone here knows how to check if high command is active?

dim kernel
#

can someone help me to figure out how to check if a control exists

tough abyss
#

is there any way to find what index select random choses

finite dirge
#

Add a number that you can read that matches the index or make a function to loop the array and find out where it ended up. Not directly to my knowledge.

tough abyss
#

damn

finite dirge
#

You could make your own function to do this and then store what index it chose. It wouldnt be as fast though.

dim kernel
#

came out with this ```systemChat format ["%1",isNull (finddisplay 15001 displayCtrl 3000)];

#

returns false

#

when the control exist

#

any help

ivory lake
#

has anyone made a script to detect if a player is aiming down sights? I know cameraView works but I want it to trigger when the camera transition starts, not after its finished (which is only when cameraview works)

slim oyster
#

using set3DENAttribute ["init",/*code*/] will sometimes result in call{call{/*code*/}} has anyone else experienced this?

#

get3DENAttribute "init" works fine and always returns call{/*code*/} but the 3den editor init box shows call{/*code*/} instead of just /*code*/

brave jungle
#

I'm using create3DENEntity to make a respawn position module. I am able to set the attribute name correctly, but not the side.

_RespawnPos = create3DENEntity ["Logic", "ModuleRespawnPosition_F", _position];
  _RespawnPos set3DENAttribute ["name", "defaultRespawnPosition"];
  _RespawnPos set3DENAttribute ["Side","1"];

Is my code. I also tried setting the variable upon mission start, but that also didn't work. _RespawnPos setVariable ["Side","1"]; //only thought is i'd need to wait for the mission to start
Any thoughts on setting a default side?

winter rose
#

@dim kernel you called it isNull, so no it is not null

crude needle
#

Do modules with a function listed under their class run that in a scheduled environment?

lucid junco
#

dont you guys know if its possible to reduce intensity of campfire flames? Or isnt it possible to set wind strenght at specific place? (like in trigger for example)

still forum
#

@crude needle more details?

winter rose
#

@lucid junco you could use setWind with a trigger yes, but it would be global

lucid junco
#

@winter rose have some example? i have no idea

crude needle
#

@still forum In the config file, the class for the specific module has directly under it the function it uses when activated.

Not sure if this is just used for info rather then directly on what function the module uses. I'm trying to ensure it runs un-scheduled from this module.

{
     ... 
     function="function from cfgFunctions";
     isTriggerActivated=1;
     ...
     
     class Arguments
     {
          ...
     };
     ...
};```
cosmic lichen
#

@crude needle Just test it with canSuspend command

crude needle
#

I know that it does run scheduled currently. I was curious if it was possible to even change that with a module setup in this manner.

cosmic lichen
#

So you mean a config property which you can set to call the code?

#

Never heard of it.

verbal saddle
#

You could use canSuspend along with a exitWith to execute the function correctly

crude needle
#

I'll give that a shot.

pseudo kernel
#

How make delayed paradrop with setVehicleCargo?

#

I want to drop vehicle every 4 seconds.

finite dirge
#

Store all the vehicles you loaded in an array and loop, with a sleep of 4 seconds, through dropping/unloading all of them.

pseudo kernel
#

But how to use sleep? I

#

As far I know, I can use it only in scheduled environment.

finite dirge
#

Right?

pseudo kernel
#

I Made some functions, but all of them are executed using "call".

digital hollow
#

So use it inside spawn

hollow thistle
#

using call doesn't mean the code is unscheduled.

tough abyss
#

hmmm high command modules don't have a lot of documentation it seems

hearty plover
#

Yeah they do not.

upper cliff
#

so how would one use a sound defined in the CfgSounds class in the description.ext with the BIS_fnc_showSubtitle style of subtitles? From what I've seen BIS_fnc_EXP_camp_playSubtitles seems like the most likely answer but looking at the wiki I don't see where in the command it plays the sound.

finite dirge
#

I believe you would play the sound and run that simultaneously.

exotic flax
#

I'm working a script to calculate the yaw and pitch to make attachTo work on the head. I believe I have all the values correct (using eyeDirection), but I'm not sure how to change the yaw and pitch of an object.
Currently I use BIS_fnc_setObjectRotation, but for some reason this doesn't seem to work (the object moves, but not in sync with the head). And since the documentation is very limited I'm not getting any further...
Is there someone who has experience with calculating and using yaw and pitch on objects?

winter rose
#

@exotic flax setVectorDirAndUp maybe?

exotic flax
#

BIS_fnc_setObjectRotation uses setVectorDirAndUp with some additional functionality. However since I have no idea how these values work, I can't tell the difference...

#

@distant hazel the script from Killzone is designed to use within the game (from server to server), and not in the launcher

#

The launcher itself already has the functionality to directly connect to a server, however that can't be done with sqf (as far as I know, since I don't believe the launcher is running any engine related stuff)

finite dirge
#

He's not talking about the launcher, he's talking about the main menu or ARMA once you launch it.

astral tendon
#

How to force the player to close the inventory?

finite dirge
astral tendon
#

Nope, did not worked

finite dirge
#

What about player action["Gear", objNull];?

exotic flax
#

eg. ACE disables all dialogs when you are unconscious with

while {dialog} do {
    closeDialog 0;
};

For just the inventory all you need to know is the correct ID of the inventory dialog

finite dirge
#

If I remember correctly.

exotic flax
#

@astral tendon This is a script which will close the inventory when opened by a player (found in a vanilla mission):

// Detect when the player accesses the inventory
BIS_lacey addEventHandler [
    "InventoryOpened",
    {
        private ["_unit", "_container"];
        _unit = _this select 0;
        _container = _this select 1;
        
        if (typeOf _container != "GroundWeaponHolder") then {
            // Player has opened the inventory of an object
            BIS_inventoryOpened = true;
            
            // Detect if the player has the crate inventory open
            if (_container == BIS_crate) then {
                [] spawn {
                    scriptName "init.sqf: crate open control";
                    
                    private ["_invIDD"];
                    _invIDD = 602;
                    
                    waitUntil {!(isNull (findDisplay _invIDD))};
                    BIS_crateOpen = true;
                    waitUntil {isNull (findDisplay _invIDD)};
                    BIS_crateOpen = false;
                };
            };
        };
    }
];
finite dirge
#

You sure about that?

exotic flax
#

above will check if someone opens the inventory through a crate (so not pressing I).

Simply using closeDialog 602; should close it manually

meager granite
#

Since when are error file paths are cut off? And why?

#

Before

13:35:51 File D:\Documents\Arma 3 - Other Profiles\Sa-Matra\mpmissions\KingOfHill_1944.iron_excelsior_Tobruk\client\c_fl_playerLoadout.sqf, line 1222

Now

 0:48:04 File D:\Documents\Arma 3 - Other Profiles\Sa-Matra\mpmissions\KingOfH..., line 152
finite dirge
astral tendon
#

I was attempting to avoid player to use enemy ammo box

#

kinda like side locking it.

exotic flax
#

true... been a while since I worked with dialogs ๐Ÿ˜‰

#

@astral tendon in that case the event handler should be a very good start, and that in combination with finding and closing the dialog/display

ivory marsh
#

does it possible to change the sky in arma 3? make a "skin" into the sky ?

#

a texture, or Something like this?

young current
#

not without creating a new terrain config and sky textures

#

also you cant post pictures. only links

ivory marsh
#

we can put a texture for the sky when we create map?

young current
#

if you know how to make them and use them in config

ivory marsh
#

Ok, perfect, thank's !

slim oyster
#

is there a way to get 3den category checkbox open/closed states? cbChecked is always displaying true

#

and ctrlShown/ctrlVisible is always showing true

pseudo kernel
#

Is there any guide about init files? I want to know, what thing I can put in what files, good and bad practices, optimalisation, call, exec, spawn, remoteExec and so on. For I know about BIS wiki.

winter rose
#

@pseudo kernel it is run on every machine, don't put bad code in it, close the door when you're done and you'll be fine

#

See also Code Optimisation and Mission Optimisation articles, they may help you too

drowsy axle
#

Where can I set a garage customisation script? @winter rose in terms of on the wiki

#

"Vehicle Appearance" i mean.

winter rose
#

sorry, what?

drowsy axle
winter rose
#

I didn't get the "term of wiki" part

drowsy axle
#

nevermind. its fine.

finite dirge
#

Please don't cross post. I answered wherever else you posted it with a snippet of code.

sturdy cape
#

dont know if that even belongs here but i have a GUI related question.i have a gui set up in an addon but when i createdialog from a server plugin (client function of course) it says "resource "dialog_name" not found.why?

slim oyster
#

Regarding all my previous issues with 3den dialogs, to get proper command returns you need to wait 0.11, after the 3den 0.1 exec time. Who knows...

pale depot
#

Are any of the Achilles mod makers in this discord? I'm looking for some help in making a module that spawns an object under the cursor.

high marsh
#
0 spawn {
    while{alive blah} do {
        _pos = screenToWorld getMousePosition;
        "Rabbit_F" createVehicle _pos;
    };
};
pale depot
#

I'm not having any luck with this.. I'll copy pasta what I have and hopefully someone can tell me where I went wrong.

{
    _objects = ["Land_Money_F", "Land_Tablet_02_F", "Land_Laptop_03_black_F", "Land_MultiScreenComputer_01_black_F"];
    private _object = [_logic, false] call Ares_fnc_GetUnitUnderCursor;
    private _dialogTitle = "Test Spawn Object";
    private _dialogOptions = 
    [
        ["Object", ["Money", "Rugged Tablet", "Laptop", "TriScreen Computer"], 0]
    ];

    _dialogResult = [_dialogTitle, _dialogOptions] call Ares_fnc_showChooseDialog;
    private _dialogCount = count _dialogResult;

    if (_dialogCount == 0) exitWith {};

    if ( _dialogCount == 1) then 
    {
        private _type =_objects select (_dialogResult select 0);
        _object = _type createVehicle (position _object);
        [_object, false] remoteExec ["enableSimulationGlobal", 2];
        _object setPos (position _object);
        [[_object], true] call Ares_fnc_AddUnitsToCurator;
    };
}] call Ares_fnc_RegisterCustomModule;```
runic quest
#

Who can tell me how to write a log log in the database SQL so as to query the records of player's related operations? Thank you very much.

tough abyss
#

https://i.imgur.com/r0CkBsm.png is the position of the vehicle group indicators something hidden by arma or is there an actual way to get its position from vehicle to vehicle?

Edit: the image is every selection name with all of its lod varients

high marsh
#

selectionPosition @tough abyss

tough abyss
#

yah that would be how i got all those other positions

untold copper
#

@tough abyss Does boundingCenter return group indicator PositionRelative?

tough abyss
#

no bounding center is not even close

untold copper
#

Ah, shame!

still forum
#

!purgeban @dusty trench 14d spamming, mass crosspost

lyric schoonerBOT
#

*fires them railguns at @dusty trench* ร’_ร“

runic quest
#

Excuse me, there is tazed in my script, which means that I can stun or kill people by installing acc_pointer_IR or removing acc_pointer_IR. Now I want to add it to my mouse wheel (mount, unload) how do I do, thank you!

winter rose
#

addAction and addPrimaryWeaponItem @runic quest !

runic quest
#

@winter rose I tested it, but it didn't work.

winter rose
errant jasper
#

How are the Eden function tooltips generated?? The editor tooltip for remoteExecCall is funcName remoteExecCall [funcParams, targets, jipID] but funcName and funcParams should be swapped?

winter rose
#

in-game doc, dismiss ๐Ÿ˜„

still forum
#

lul

#

it's in engine

#

they are generated by humans ๐Ÿค–

winter rose
#

instead of Germans ๐Ÿ˜„

errant jasper
#

Wait, so Humans were harmed in the production of Arma 3 ๐Ÿ˜ฎ

finite dirge
#

ARMA 3 is human tested unfortunately. Many humans were harmed. ablobtonguewink

south bloom
#

How does one make it so an addaction is only useable inside a vehicle?

#

want to add a heal action though you can still use it outside the vehicle
cursorTarget addAction["<t color='#00FF00'>Heal</t>", {vehicle player setDamage 0}]

winter rose
#

add some "guy in vehicle" as action condition

finite dirge
#
!(vehicle player isEqualTo player)
winter rose
#
isNull objectParent player``` ๐Ÿ˜‹
finite dirge
#

Opposite if you want to see if they are not on foot, but that works.

winter rose
#

not*

#
not isNull objectParent player```
wasn't there some weird thing such as `player in player` or something?
south bloom
#

figured it out vehicle player addAction["<t color='#00FF00'>Heal</t>", {vehicle player setDamage 0},[], 0, false, false, "", "_this in _target"]

#

specifically "_this in _target"

astral dawn
#

Hello guys. I wonder, how hard is it to script the spectrum scanner device to work like in the contact campaign?

#

Like, make some objects 'emit signals' which I can 'scan' and 'analyze'?

#

(make a spectral peak appear on the screen when I point at something)

wispy cave
astral dawn
#

Oh nice, thanks man!

astral tendon
#

How to change a map flag texture to a custom one?

young current
#

thats a map flag texture?

astral tendon
#

Like, I want to change the flag to another country that is not on the main game

#

but is for the map, not the flags in game.

digital hollow
#

You mean a marker, then? not a flagpole object?

astral tendon
#

Yes the marker

astral tendon
#

Thats really too much stuff for that.

winter rose
#

You can bring a horse to the riverโ€ฆ! ๐Ÿ˜„

finite dirge
#

You can bring a horse to the Vet and drip-feed them water though. So anyone want to do that here lolbro

astral tendon
#

This page could use a update to the magazine, seems like its a A2 magazine

#

this one as well.

finite dirge
#

Why's that?

winter rose
#

@astral tendon the example is still good, we don't rewrite all pages according to the most recent game

astral tendon
#

m16 seems kinda missleading to undestand that it has to be the weapon to add the magazine

winter rose
#

M16 is OFP-era, and back then most of weapon classnames == magazine classnames
In order to avoid confusion, these examples should be changed yes

frigid raven
#

I have a RscCombo Control which is filled by elements

private _rolesCombo = _loginDialog displayCtrl GUI_ID_LOGIN_CHARACTER_CREATION_ROLE_COMBO;
// init the role selection combobox
{_rolesCombo lbAdd _x} forEach _roleNames;

When selecting an element and accessing the lbCurSel current index it always returns -1.

private _selectedIndex = lbCurSel _rolesCombo;

What might be the problem here?
I have an event handler attached to that RscCombo:

_rolesCombo ctrlAddEventHandler ["LBSelChanged", { call coopr_fnc_selectRole}];

Is there something like "consuming" the event and therefore not changing the selected index? I doubt that but meh SQF...

cosmic lichen
#

You are not passing the parameters to coopr_fnc_selectRole it should be _this call coopr_fnc_selectRole;

astral tendon
#

Quick check

//side lock
SideLockVehicle = {
    params ["_vehicle","_sideToLock"];
    _vehicle addEventHandler ["GetIn", {
        params ["_vehicle", "_role", "_unit", "_turret"];
        if (side group _unit != _sideToLock) then {
        moveOut _unit;
        };
    }];
};

_sideToLock will not pass to the event handle right?

winter rose
#

yep, will stay out of it

frigid raven
#

@cosmic lichen The seletRole functions works fine. _this will be given to the handler implicitly. You can always access _ctrl as a parameter in a control handler func

cosmic lichen
#

Right. I am just used to writing _this always.

astral tendon
#

So I changed to this

SideLockVehicle = {
    params ["_vehicle","_sideToLock"];
    _vehicle setVariable ["SideLocked", _sideToLock, true];;
    _vehicle addEventHandler ["GetIn", {
        params ["_vehicle", "_role", "_unit", "_turret"];
        if (side group _unit != (_vehicle getVariable "SideLocked")) then {
        moveOut _unit;
        };
    }];
};

But the GetIn event handle only fires were the vehicle is local, in case of a change in locality (Other player enters the vehicle) does it fires?

winter rose
#

see wiki?

astral tendon
#

" It can be assigned to a remote vehicle but will only fire on the PC where the actual addEventHandler command was executed. "

#

Do I need to add this event handle to all players?

cosmic lichen
#

@frigid raven The script you posted. From where is it executed? It says on mouseButtonDown in the functions header.

frigid raven
#

its coming from another dialog. If you click on an empty character space it opens the character creation dialog. The logic for that creation dialog is the one I posted

cosmic lichen
#

Alright.

#

Did you double check all var names and defines?

#

No typo?

frigid raven
#

yeah - the combobox itself does work all the way. When refering to it in the selectRole handler I can access it's index without a problem

#

sec code incoming

winter rose
#

@astral tendon well yes, else "it will only fire where the command was executed"

frigid raven
#

As you can see I do the same here like in the posted code before

#

And there it works fine

#
private _selectedIndex = lbCurSel _ctrl;

returns the correct number

cosmic lichen
#

What does DEBUG2("role %1", _rolesCombo); return a line before you wanna return the index?

frigid raven
#

sec

#
22:27:46 (0:00:15) [Server] COOPR.LOBBY.debug - roleCombo Control #1303
22:27:46 (0:00:15) [Server] COOPR.LOBBY.debug - index -1
22:27:46 (0:00:15) [Server] COOPR.LOBBY.debug - roleName 
22:27:46 (0:00:15) [Server] COOPR.LOBBY.debug - role []
#
DEBUG2("roleCombo %1", _rolesCombo);
DEBUG2("index %1", _selectedIndex);
DEBUG2("roleName %1", _roleName);
DEBUG2("role %1", _roleId);
#

@cosmic lichen all debug statements

#

The same debugs in coopr_fnc_selectRole

22:29:54 (0:02:23) [Server] COOPR.LOBBY.debug - roleCombo Control #1303
22:29:54 (0:02:23) [Server] COOPR.LOBBY.debug - index 2
22:29:54 (0:02:23) [Server] COOPR.LOBBY.debug - roleName Engineer
22:29:54 (0:02:23) [Server] COOPR.LOBBY.debug - role coopr_role_engineer
#

here it works

cosmic lichen
#

uff

frigid raven
#

Only difference is that I pass _loginDialog to the button control

_rolesCombo setVariable ["_params", [_loginDialog, _rolesHash]];
_rolesCombo ctrlAddEventHandler ["LBSelChanged", { call coopr_fnc_selectRole}];
#

Yeh I am confused as well

cosmic lichen
#

Something that happend to me recently was a non private variable overwriting my var. Can you check that?

#

Nevermind. You've already logged the vars

frigid raven
#

hm

#

actually good point ๐Ÿค”

#

well I have no non private vars

#

but I deactive the selectRole handler

#

and see what happens

#

nah did not help

#

what the actual hell is going on there

cosmic lichen
#

No clue.

#

The script looks fine from what I can see.

frigid raven
#

ye thx anyway!

south bloom
#

anyone know if its possible/know how to to change the value of enableDebugConsole ingame using the debug console

#

mission default is set to 1 on the quick hosted scenario me and friends play on

#

don't really want to unpack scenario to change it

solemn token
#

as it is an entry in description.ext you can not change it ingame ๐Ÿ˜ฆ

south bloom
#

thought so
worth a shot though :v

peak plover
#

Dubug console mod

cosmic root
#

Is there a "correct" or easy way to add event handlers or scripts to cfgAmmo projectiles? I can always pull it from a fired EH but I was wondering if there was a better way to do it

winter rose
#

@cosmic root no better way

cosmic root
#

Damn

#

Thanks

still forum
#

The better way is using the config/mod only ammo eventhandlers

cosmic root
#

Link to those?

#

That would work for me

still forum
#

Not really documented that well.

#

you have fired and AmmoHit in the CfgAmmo's Eventhandlers class

ivory lake
#

do note ammoHit seems to be limited to mines... atleast when I last tried it was

cosmic root
#

Hmm, not super helpful. But I do appreciate the effort ๐Ÿ‘

ivory lake
#

ok yeah I just looked it up, yeah, mines only for ammohit, BI didn't want to implement it at all

#

but it got put in for mines, VBS has it for all CfgAmmo

cosmic root
#

Also, just out of curiosity, can I get an opinion on this technique? I think it's clever, if a little hacky. But I'm scared there is something I'm missing that makes it terrible.

[{
    params ["_args", "_handle"];
    _args params ["_mortar", "_posArray"];
    
    //This works in a hacky sort of way
    //We passed an array to this PFH, since it is passed as reference we can update that array with set
    //This creates a pseudo global variable that can be update each frame with the mortars position
    //And if the mortar is gone we still get to keep the variable until the EH is removed
    if (!isNull _mortar) exitWith {{_posArray set [_forEachIndex, _x]} forEach getPos _mortar};
    
    systemChat format ["Final Position: %1", _posArray];
}, 0, [_mortar, [0,0,0]]] call CBA_fnc_addPerFrameHandler;
#

Essentially abusing the fact that arrays are passed by reference to create a pseudo global variable for a PFH to track the position of a projectile.

still forum
#

you should remove the eventhandler if mortar gets null

cosmic root
#

Yeah, That's further down. I just only wanted to include the relevant bit

#

I'm also checking for a "#crater" object when doing what I need to do. I don't know if that is a reliable means to ensure the round impacted. I imagine it is though right?

hollow thistle
#

you could do _args set [1, getPos _mortar] for more perforceperformance.

still forum
#

perforce? there are still people who use that stuff?

hollow thistle
#

Popular in game dev afaik.

#

And still better than SVN blobpeek

cosmic root
#

๐Ÿ‘

uneven torrent
#

Is there a function that only returns what a given unit has in it's launcher slot? Or generally testing whether a unit has a launcher?

winter rose
#

@uneven torrent secondaryWeapon?

#

also, command*, not function

uneven torrent
#

hah, here I was mistakingly assuming secondaryWeapon would return the handgun

#

Thanks @winter rose

winter rose
#

@uneven torrent that would be handgunWeapon, thanks to their introduction order in the series ๐Ÿ˜‰

frigid raven
#

What is the diff between ComboBox and ListBox again?

#

@cosmic lichen just a heads up for that error with the combo box selected index. The Control was disabled by ctrlEnable and only enabled at the end of the script. Therefore the call for the index was done while the control was still inactive. As a user testing the feature like me you could not realized that because it all happened in a blink of a second.

frigid raven
#

Is it necessary to ctrlEnable false a control if it already has been ctrlShow false made invisible?

winter rose
#

you may still have focus on it, idk

frigid raven
#

oki

#

I want to have a stance animation where the character actually holds a rifle ergo his whole equipment.
This is what he does atm: https://imgur.com/a/qH9xX55
I changed the animation to this:

    [player, "GUARD", "FULL"] call BIS_fnc_ambientAnim;

But it seems he is not reacting to changes.
I have this camera setup here:

private _playerDirection = getDir player;
private _camPos = [COOPR_LOBBY, 5, _playerDirection] call BIS_fnc_relPos;
private _cam = "camera" camCreate _camPos;
_cam camSetTarget player;
_cam cameraEffect ["External", "FRONT"];
_cam camCommit 0;

Does this somehow prevent animations from working?

winter rose
#

I would say no?

frigid raven
#

hm

lucid junco
#

do someone knows why some animations works different way then the others? like i have this one "InBaseMoves_assemblingVehicleErc" when use playmove or switchmove, nothing happens. Also other animations via playmove are playing good but when i want to cut them like this way civ1 playMove "AmovPknlMstpSnonWnonDnon_AmovPercMstpSnonWnonDnon"; they also wont stop. But on the other hand with same usage few other animations will stop..... Im confused. Cant see any rules in this mess ๐Ÿ˜„ some advices?

quartz pebble
#

Guys, any way to disable UXO of cluster bombs? After several hours of multiplayer, server is full of that crap all over the map, and it starts to eat performance.

#

Thats what I already do for all kind of stuff like weaponholders.

#

Thought there was a more intelligent way

frigid raven
#

I have these different cutText statements

        cutText [_saveText1, "WHITE OUT", 1.0, false, true];
        sleep 1;
        cutText [_saveText2, "WHITE OUT", 1.0, false, true];
        sleep 1;
        cutText [_saveText3, "WHITE OUT", 1.0, false, true];
        sleep 2;

The thing is it starts to blink for every cutText. I want the first one to white out and for the rest just to display text on that "white curtain".
PLAIN does not work because it removes the white. And I was not able to find a WHITE attribute which just makes the foreground white. Any ideas?

#

Maybe I need to work with those cutText Layers

#

๐Ÿค”

finite dirge
#

Maybe play with some post-processing effects to make the background white and use the PLAIN cutText.

frigid raven
#

hm good idea, too

#

but I used layers now

#

worked fine

finite dirge
#

Yep different Layer's will work too. bcaHappy2Cheer

waxen tendon
#

how can i make independents enemy mid-mission

finite dirge
#

addRating so they become ENEMY?

waxen tendon
#

will i have to execute that on every member of side?

next moss
#

Hi, i am trying to make a launcher (weapon) that when dropped on the ground, turns into an explosive (magazine).
I have a seen a similar thing done with the 3cb tripod bags that when dropped via the inventory menu, turn into actual tripods that you can make static weapons from, although the 3cb files and locked down.

finite dirge
#

@next moss Check the groundweaponholder for the weapon, remove it, add the mag.

sturdy cape
#

fiddling around with getting all pointer attachments from cfgweapons into an array.how do i do this ? is there a type name?

finite dirge
#

Like all of the possible ones, or just compatible for a specific weapon?

sturdy cape
#

all of them

finite dirge
#

Hmm. I can't think of a specific class or anything they inherit from off the top of my head. Maybe someone else will.

sturdy cape
#

slot is 301,maybe i can get it through that

cosmic lichen
#

@frigid raven Thanks for the headsup.

astral tendon
#

How to make the player go to the respawn screen with out have to kill him?

#

I need to add a redeploy action

frigid raven
#

I think that is not possible @astral tendon

#

you have to kinda create your own "Login" / "Role Change" Dialog or whatever

#

Does anybody know if there is a way to prevent a Dialog from being closed by the ESC key ?

#

I have a mandatory Dialog that should only be closed if some things have been set up

astral tendon
#

My real problem is the dead body it makes, I tough It could have a more clean way than move in to the possition [0,0,0]

frigid raven
#

you can create a new unit - switch teh player to that one and deleteVehicle the old unit

#
private _oldPlayerUnit = player;
private _playerGroup = createGroup [west, true];
private _newLoginUnit =  _playerGroup createUnit ["B_diver_TL_F", _somePosition, [], 0, "NONE"];
selectPlayer _newLoginUnit;
deleteVehicle _oldPlayerUnit;
tough abyss
#

oof i'm finally finishing some functions related to units (getting in/out) of vehicles including one that takes parachutes from the vehicle inventory and distrutes them between units before making them eject from the plane/heli

astral tendon
#

How to disable lose condition when tickets reach zero?

smoky verge
#

I was looking for a script to have dialog trees
something like multiple choice conversations
I've seen something similar in spyder's modules
I'm not begging for someone to make it I'm just curious if there was already one around

frigid raven
#

Does anybody know what the IDC of the main menu is?

frigid raven
#

I mena the name for it

#

so I can open if via createDialog <name_of_main_menu>

#

I only found createDialog 'RscDisplayInterrupt' so far which is a different main menu (with return to eden editor button)

finite dirge
#

Try hunting through a config dump and see if it's there.

frigid raven
#

I think I just found out that it actually is the right one - but was wrongly invoked

#

Needs to be a display and not a dialog.

#

there createDisplay might work

untold copper
#

@frigid raven
Not sure if this is right... Found in AIO config.

RscMainMenu

frigid raven
#

will try

untold copper
#

That actually looks like it is for the Commanding Menu. ๐Ÿ˜•

frigid raven
#

gosh so many false information via google

#

yeh @untold copper it opened like "nothing" for me

untold copper
#

@frigid raven Ach! Sorry.

vague harness
#

Hello, I have this script that was working fine as a .sqf in mission folder, but now that I put it as a function, it does not anymore...

#

part 1 ``` fobcrate = 0;
publicVariable "fobcrate";

fobcratespawner_1 addAction
["Spawn FOB crate", {fobcrate = "B_CargoNet_01_ammo_F" createVehicle position player; clearWeaponCargoGlobal fobcrate;
clearItemCargoGlobal fobcrate;
clearBackpackCargoGlobal fobcrate;
clearMagazineCargoGlobal fobcrate
}];
//
fobcratespawner_2 addAction
["Spawn FOB crate", {fobcrate = "B_CargoNet_01_ammo_F" createVehicle position player; clearWeaponCargoGlobal fobcrate;
clearItemCargoGlobal fobcrate;
clearBackpackCargoGlobal fobcrate;
clearMagazineCargoGlobal fobcrate
}];
//
fobcratespawner_3 addAction
["Spawn FOB crate", {fobcrate = "B_CargoNet_01_ammo_F" createVehicle position player; clearWeaponCargoGlobal fobcrate;
clearItemCargoGlobal fobcrate;
clearBackpackCargoGlobal fobcrate;
clearMagazineCargoGlobal fobcrate
}];
//
fobcratespawner_4 addAction
["Spawn FOB crate", {fobcrate = "B_CargoNet_01_ammo_F" createVehicle position player; clearWeaponCargoGlobal fobcrate;
clearItemCargoGlobal fobcrate;
clearBackpackCargoGlobal fobcrate;
clearMagazineCargoGlobal fobcrate
}];
//```

#

part 2 // [ fobcrate, // Object the action is attached to "Deploy FOB", // Title of the action "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Idle icon shown on screen "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", // Progress icon shown on screen "(leader player == _this) && (count units group _this > 1)", // Condition for the action to be shown "_caller distance _target < 10", // Condition for the action to progress {}, // Code executed when action starts {}, // Code executed on every progress tick {_this call PRA3_Fob}, // Code executed on completion {hint "FOB Deployment Interrupted!"}, // Code executed on interrupted [], // Arguments passed to the scripts as _this select 3 5, // Action duration [s] 0, // Priority true, // Remove on completion false ] remoteExec ["BIS_fnc_holdActionAdd", 0 , fobcrate]; // MP compatible implementation

#

it gives me an error at the last line

finite dirge
#

What's the error?

vague harness
#

1 sec ill get it

untold copper
#

@frigid raven The only other possible entry I see is: RscDisplayMainMenuBackground .

frigid raven
#

I will try

#

where did u find thoe

#

@untold copper

vague harness
#

16:15:48 Error in expression <,
true,
false
] remoteExec ["BIS_fnc_holdActionAdd", 0 ,>
16:15:48 Error position: <remoteExec ["BIS_fnc_holdActionAdd", 0 ,>
16:15:48 Error Type Number, expected String, Bool, Object, Group
16:15:48 File C:\Users\Antoine\Documents\Arma 3 - Other Profiles\AtlasTheCarry..., line 20

#

I have looked at the wiki and the syntax is exactly like on there

finite dirge
#

fobcrate = 0;

#

fobcrate, // Object the action is attached to

#

Can't be both, no?

vague harness
#

dosent = 0; means that it is a globalVariable?

untold copper
finite dirge
#

@vague harness No? Having no _ in the front did and the publicVariable broadcasted it. You just set it to contain the integer 0.

frigid raven
#

@untold copper ah ok thx

vague harness
#

I tought _object was to make it private

ruby breach
#

_ makes a variable local, private makes a local variable private

vague harness
#

@ruby breach gotcha

#

in my case since "fobcrate" is reused in another script, it is correct the way it is?

#

just remove fobcrate = 0;

finite dirge
#

If it's already set and broadcasted, drop that and the pubvar.

vague harness
#

it is not, it's re-used afterwards

#

this is the first script of 2

finite dirge
#

Reused?

vague harness
#

in another script I use the pubvar fobcrate to delete the object

#

let me explain, basically,this is the script that spawn a crate with and action

#

second script deploys a fob with respawn point and deletes the object that was used in the first script

finite dirge
#

Where are you actually linking an object and that variable? An action?

vague harness
#

yes

finite dirge
#

When you do that, do the pubvar.

vague harness
#

do I have to write it in everyscript or it's already known by the server?

finite dirge
#

Write what/

#

?

ruby breach
#

If you declare a public variable once (in this case, you're declaring a variable assigned to an object), you can use that variable over and over again to reference that object until the object is deleted

finite dirge
#

Is there a specific reason you are using Public Variable for this anyway? Why would all clients need to know this object?

vague harness
#

@ruby breach so I do not have to do fobcrate = nil; if it is deleted?

#

@finite dirge don't know, it's an action that players need to have on the crate. Do I need server or public?

finite dirge
#

I also don't get what you are doing with the remoteExec. You are trying to exec on the fobcrate object?

vague harness
#

It's for it to be MP and JIP compatible. That's what I read on the wiki.

finite dirge
#

Yah, you need to run it on all players to add it to that crate, but your target is the crate.

vague harness
#

yep

#

like I said, was working fine until I put fobcrate=0; I guess

#

gonna test it now

finite dirge
#

My recommendation is to rewrite this. You should use the addAction to run a function to make the crate and then remoteExec the holdAction to all players for that object. No global vars or pubvars involved, just the one remoteExec.

vague harness
#

would that be more optimized?

#

I wanted to have less functions as possible

finite dirge
#

Yes. More functions isn't the issue, network traffic is far worse.

vague harness
#

Alright

#

Made 2 separate functions, exactly like when I first posted the scripts, but now it says that "fobcrate" is undefined

finite dirge
#

And link it here.

vague harness
#

can I addaction to an array of objects or it needs to be 1 object?

finite dirge
#

One object, but you could use a foreach/count

vague harness
finite dirge
#

publicVariable "fobcrate"; fobcrate = 0;

Why?

vague harness
#

testing forgot to remove it

finite dirge
#

Also:

This command broadcasts a variable to all clients, but as soon as you change the variable again, you have to use publicVariable again, as it does not automatically synchronise it.
So you have to run it every time you update that variable and want it synchronized. Which is why I gave you the alternate way.

vague harness
#

Understood

#

@finite dirge mind doing PM's?

loud python
#

how do I create a game logic object using sqf?

#

I tried "Logic" createVehicle position cursorTarget but it doesn't work

vague harness
#

I think it's createUnit for logic

#

Logic createUnit [ "LocationArea", getPosATL _sectorArea, [], 0, "CAN_COLLIDE" ];

#

@loud python

frigid raven
#

Is there a way to return to the main menu by script? Like the thing the Pause Menu button Abort does but only as script execution?

loud python
#

What's "LocationArea" though?

#

Any alternative ideas?

#

Actually, this may be an X-Y question

#

what I want is to lock an NPC in place

#

so I was going to just attach it to a game logic object

#

maybe there's a better way though

snow blade
#

Define lock.

#

You can disable simulation.

#

Or you can freeze the AI.

loud python
#

disable simulation leaves the NPC completely static

#

I want the NPCs to move around a bit

snow blade
#

...yes.

#

Huh.

loud python
#

otherwise it just looks awkward imo

snow blade
#

That's a bit more complicated, yeah.

loud python
#

also AI is already disabled, but players can push NPCs around

snow blade
#

You could try disableAI.

loud python
#

and it's kind of a problem when a store NPC can be pushed out the window and falls off the building xD

snow blade
#

I'd try if disableSimulation and switchMove work together, but I don't think it does.

#

How about having stuff like tables, walls, or something all around him with disabled simulation?

#

Effectively fence the AI in so it can't be pushed around.

#

Worst case scenario you can do some brute force BS and just force him onto XYZ coords every few (insert time interval)

loud python
#

I just tried attaching an NPC to a game logic object and it works

#

it still does the usual things but can't be moved

snow blade
#

Excellent.

#

I'll have to remember that in case I ever need to editor stuff up.

loud python
#

so I guess I'mma go with that

#

but how do I spawn game logic objects from sqf?

#

or is there some other, more convenient type of object I could use?

snow blade
#

Worst case scenario, invisible helipads can work just as well.

loud python
#

yeah, probably

snow blade
#

Or an object that is visible in theory, but the Z coord is so low that it's under the ground.

loud python
#

kind of a hack, but it should work

snow blade
#

Then play with the Z value on the attachTo.

loud python
#

seems to work

#

this attachTo ["Land_HelipadEmpty_F" createVehicle position this]; this disableAI 'MOVE'

snow blade
#

Yup.

#

Though the disableAI might be redundant at that point.

loud python
#

nope

#

if it's enabled, the unit tries to turn around

#

which looks glitchy

snow blade
#

Oh.

#

Ok, makes sense.

loud python
#

any idea how I can rotate the helipad to face the same way as the unit without using a temporary variable?

snow blade
#

Well...

#

One moment.

#

unit setDir (getdir object)?

loud python
#

ah, but that's the problem

snow blade
#

Or the other way around.

loud python
#

then I need to save the helipad in a variable first xD

snow blade
#

That's the first solution comes to mind, with my not-so-recent experience.

#

Not if you name it in the editor...

#

(Which yes, is a variable, technically, but well)

loud python
#

but it doesn't exist in the editor ๐Ÿ˜‰

snow blade
#

sigh

loud python
#

I want a one-liner that I can put in a units init field

snow blade
#

I should've assumed as much.

loud python
#

but I can just hide it all away in a script

snow blade
#

You're creating it via what, createUnit array?

loud python
#

I was just wondering if it's possible to do that in point free style

#

nope, the unit is in the editor

snow blade
#

Because if so, and if I remember correctly then object = createUnit yaddayaddayadda...

#

Same for createVehicle.

#

You should be able to straight up name the created object with the command.

loud python
#

my problem is

#
this attachTo [
  createVehicle ["Land_HelipadEmpty_F", this, [], 0, "CAN_COLLIDE"] // Can't setDir on this because it's not in a variable
]; this disableAI 'MOVE'
#

wait, setDir wouldn't happen to conveniently return the object, right?

snow blade
#

this attachTo [objectName = createVehicle; objectName setDir (getDir unitname)]?

#

Return value nothing.

#

Nope, sorry.

#

I dunno, it's getting too late and I have to work tomorrow.

#

Try if what I just wrote solves your trouble, if it doesn't, I'm honestly at a loss as to what might work.

loud python
#

I just had a bad idea

#

I can use a forEach loop with a single element like a let block in other languages xD

snow blade
#

That is...

#

SUCH a brute force solution.

loud python
#

it works though ๐Ÿคท

#

{ _x setDir getDir this; this attachTo [_x] } forEach ["Land_HelipadEmpty_F" createVehicle position this]; this disableAI 'MOVE'

#

oh, but it seems the attachTo option doesn't work after all

#

for whatever reason the characters animations move at like 1 frame per second when it's attached

snow blade
#

It's constantly reattaching.

#

With literally like every processor tick or something.

tough abyss
#

so in the ghosthawk

#

the copilot seat is taken as turret

#

and one of the turret sids is considered gunner

#

the left side to be exact

#

is that a bug?

vague harness
#

@snow blade every frame

loud python
#

quick question

#

is it possible to actually revive a dead unit?

#

if not, is there an easy way to create a new one with the exact same equipment, face, etc.?

tough abyss
#

yes, i think

loud python
#

hmmm...

#

is there a way to access the content of a units init field ingame and run that on another unit?

frigid raven
#

What camera effect is the proper one without those black stripes on the top & bottom - these cinema effect things... ?

#

I want to get rid of those

loud python
#

Any idea why sleep 0.1 throws a "generic error in expression"?

#

it's inside an event handler

loud python
#

wrapping it all in a spawn {} fixed it, thanks ๐Ÿ™‚

#

didn't suspect that at first because I assumed it'd throw a more specific error when attempting to sleep in the wrong place

#

anyway, I'm stuck again ๐Ÿ™„

#
 _target = param [0, objNull, [objNull]];
_name = param [1, "repsol", [""]];
_init = param [2, {}, [{}] ];

_target setVariable ["name",_name];
_target setVariable ["init",_init];
//_target call _init;
[_target, _init] remoteExec ["call",0,true];

_target addEventHandler ["killed", {
    _this spawn {
        _target = _this select 0;
        _class = typeof _target;
        _pos = getpos _target;
        _dir = getdir _target;


        
        hint ("Se han escuchado disparos en la gasolinera de " + (_target getVariable "name"));
        sleep 0.1;
        _target enableSimulation false;
        sleep 1;
        for "_i" from 1 to 5 do {
            _target hideObject true;     sleep 0.2;
            _target hideObject false;    sleep 0.2;
        };


        deleteVehicle _target;

        hint "Manolo ha muerto";

        sleep 3;

        _new = _class createVehicle _pos;
        _new setdir _dir;
        [_new, _target getVariable "name", _target getVariable "init"] execVM "manolo.sqf";
    }
}]
#

the problem is the following:

#

that script is called manolo.sqf; so it calls itself on a respawned unit

#

and, in theory, should hand the _init variable through to the new instance of itself

#

now, the _name variable does get passed through, but _init doesn't

#

and I really don't see why

#

in the units init field, the script is called with [this, 'foo', {this addAction ["foo", {hint "bar"}]}

#

the first unit does have the "foo" action

#

when it gets killed and a new unit is created, it doesn't have the action anymore, but it does also respawn when killed and have the correct name set

runic quest
#

Hello, everyone. I'm running Altis Life 5.0. I want to know how to add a second bank (small bank) to the map. Do you have any relevant tutorials or links? Thank you very much.

loud python
#

I don't understand arma anymore

high marsh
#

[this, 'foo', {this addAction ["foo", {hint "bar"}]

#

extra }

loud python
#
_target setVariable ["DTI_init",_init];
hint typeName (_target getVariable "DTI_init");  // WORKS -- Prints: "CODE"

[_target, _init] remoteExec ["call",0,true];

_target addEventHandler ["killed", {
    _this spawn {
        _target = _this select 0;
        // ...
        hint typeName (_target getVariable "DTI_init"); // FAILS -- Does nothing
    // ...
    }
}]
#

@high marsh extra } where?

#

It's a nested code block

high marsh
#

Oh, haha. Discord was scrolled.

#

for one use params

loud python
#

where?

#

in the spawned code block?

high marsh
#
params[
    ["_target",objNull,[objNull]],
    ["_name","repsol",[""]],
    ["_init",{},[{}]]
];
loud python
#

the script itself uses param, but the block in spawn only has one parameter and it's always there, so there's not really a need for it

high marsh
#

you're taking multiple parameters. You don't need to always use all of them

#

what exactly are you getting instead of:

this addAction["foo",{hint "bar"}]
loud python
#

the parameter works, I know that much

#

the code works the first time

high marsh
#

So you're not getting the action? this isn't a valid reference to the player calling it

#

when calling it in the script, it has no idea what that is.

loud python
#

I get the action at first

#

then I kill the unit and it respawns after a while

#

the new unit gets the same event handler, so it also respawns, but it doesn't get the action

#

I've narrowed it down a bit though:

#

the parameter works fine; if it gets passed a code block, it runs it, because it works the first time

#

immediately after setting the "DTI_init" variable on _target, getVariable returns the correct value, as is expected literally right after setting it

#

but inside the event handler, the exact same code returns nothing

#

so somewhere along the way the variable "DTI_init" just disappears from the object

high marsh
#

because the variable is gone with the object that was killed

#

it's not the same object

loud python
#

objects change when they're killed?

high marsh
#

player object is a new object yes

loud python
#

note that, at that point, _target is the old object and _new the newly spawned one

high marsh
#

ยฏ_(ใƒ„)_/ยฏ

loud python
#

player has nothing to do with it; it's an AI unit

high marsh
#

AI's are the same way

#

obviously that isn't the issue though

#

ยฏ_(ใƒ„)_/ยฏ

loud python
#

so if I shoot an AI soldier it turns into a new unit?

#

that would make no sense

high marsh
#

if you kill it, it'll respawn AS a new object / new unit.

#

the body is still there.

loud python
#

of course it respawns as a new unit

high marsh
#

๐Ÿคฆ

loud python
#

but as I said, the _target variable still references the old object

loud python
#

the new one is saved in _new

#

anyway

#

the problem seems to be that the object loses the variable at some point

#

possibly when it dies?

#

The game shouldn't just drop variables on an object just because it dies, right? RIIIIGHT?!

#

I want to die

#

I DELETED the object a few lines ago

#

so the error isn't that init doesn't exist anymore

#

the error is that name still exists

#

I might have looked that way sooner if it hadn't randomly found the other variable

#

FFS I don't understand arma

#

Thanks for the help anyway though

tough abyss
#

A AI unit driving a vehicle in stealth behaviour have more chance to get stuck than driving in careless behaviour?

tough abyss
#

I prefer to use stealth behaviour but i fear AI will get stuck too often (using careless so).

#

But there are some bad things like vehicle lights on at night.

slim oyster
#

can BI attribute values for entities be given expressions/property values? The config has been updated for them properly but the expressions are not added to the mission file nor are they being activated on mission start

#

specifically the state attribute category ones like UnitPos, Init, etc

mortal wigeon
#

How can I detect multiple waitUntil conditions at once? I'm airdropping 5 vehicles at a time, and because the terrain below might be uneven, I don't know which one will touch down first. However, I need to execute some code on each vehicle as it touches down. waitUntil is the simple solution, but can't operate on each vehicle at the same time.

slim oyster
mortal wigeon
#

@slim oyster that worked great thanks! learn something new

mortal wigeon
#

I've got it working for five individual vehicles. Now, I'm unsucessfully trying to loop it in one block of code.

veh_array = [veh1, veh2, veh3, veh4, veh5];
{
    ["_x"] spawn
    {
        _sleepTime = _forEachIndex;
        sleep _sleepTime;
        _dropDir = getDir transport;
        _x setPos (transport modelToWorld [0,-20,-5]);
        _x setDir _dropDir;
        sleep 1.5;
        _chute = createVehicle ["B_Parachute_02_F", [0,0,0], [], 0, "FLY"];
        _chute setDir _dropDir;
        _chute setPos (getPos _x);
        _x attachTo [_chute,[0,0,0]];
        waitUntil {(getPosATL _x select 2) < 1.01};
        detach _x;
        _x setDamage 0;
        deleteVehicle _chute;
    }
} forEach veh_array;

tells me waitUntil is returning nil. What am I doing wrong?

cosmic root
#

Specifically using this format produces a "missing ;" error:

_unit checkAIFeature "MOVE"
cosmic lichen
#

@mortal wigeon _x is unkown

mortal wigeon
#

Ah yes, figured that out. I've restructured the block of code as follows and get a new error:

{
    [_x] spawn
    {
        _this setDir (getDir transport);              // <--ERROR: TYPE ARRAY, EXPECTED OBJECT
        _this setPos (transport modelToWorld [0,-20,-5]);
        sleep 1.5;
        _chute = createVehicle ["B_Parachute_02_F", [0,0,0], [], 0, "FLY"];
        _chute setDir (getDir transport);
        _chute setPos (getPos _this);
        _this attachTo [_chute,[0,0,0]];
        waitUntil {(getPosATL _this select 2) < 1.01};
        detach _this;
        deleteVehicle _chute;
        _this setDamage 0;
    };
    sleep drop_int;
} forEach veh_array;```
cosmic lichen
#

add params ["_vehicle"]; before that error line

#

The issue is, that _this currently is not _x but [_x]

#

Than you can use _vehicle instead of _this

mortal wigeon
#

So I need to tell it how to refer to _x, it's not implicit

cosmic lichen
#

Well it is, but then you need to use (_this select 0) instead of this

#

you can also try to do _x spawn { _this setDir....}

mortal wigeon
#

ahhh so the argument is passed as an array

cosmic lichen
#

Yes

mortal wigeon
#

aha got it ๐Ÿ˜„

#

never quite understood arguments

cosmic lichen
#

Not much to understand. Everything you pass to spawn is stored in _this

#

If you pass it as array, _this is an array

mortal wigeon
#

omg it's beautiful and works

cosmic lichen
#

If you don't wanna think about it, uses params command

#

Glad it works now

mortal wigeon
#

thanks ๐Ÿ™‚

cosmic lichen
#

Two more things. Make sure to set your local variables to private by using private _chute

#

And add a tag to your global vars like veh_array -> Jester_veh_array

mortal wigeon
#

OK

frigid raven
#

Is there a way to prevent an animation from actually moving the character?

#

I have an animation that moves him slighty

#

when repeated he is moving away from his camera position

exotic tinsel
#

how do i get the side of the uniform a player is wearing. im using this but it keeps returning 0 for all types of uniforms.

hint str getNumber (configfile >> "CfgWeapons" >> uniform player >> "side")
still forum
#

That's because you are loading a mod which makes uniforms available for all sides

winter rose
#

@frigid raven attachTo another object ๐Ÿ™‚
Or reset its position every time

exotic tinsel
#

@still forum im not setting that anywhere unless using this on the arsenal causes it.

0 = ["AmmoboxInit",[this,true]] spawn BIS_fnc_arsenal;
frigid raven
#

@winter rose will try that

still forum
#

are you loading any mods?

#

try looking into uniforms mo.... Why are you looking in CfgWeapons? uniforms are vehicles

exotic tinsel
#

@still forum
i have no thrid party mods. just our server side one and we dont do anything complex like mess with uniform side modification. also i tried both cfgvehicles and cfgweapons.
this is the code im tyring to get to work. the previous code i posted was from testing

if ((getNumber (configfile >> "cfgvehicles" >> uniform _player >> "side") != 1)) then
still forum
#

you can check modelSides array

#

that says which sides can pick up and wear the uniform

exotic tinsel
#

how do i get the name of a uniform? this doesnt work because uniform returns a string

name uniform player;
#

nvm found this

getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "DisplayName")
exotic tinsel
#

ok thats not working, how do i get the name of a uniform? not the type but the name?

winter rose
#

uniform player?

exotic tinsel
#

that gives type

winter rose
#

Instead of typeOf _vehicle, I mean

#

Check the config viewer to see the name property on uniforms

exotic tinsel
#

im using this and its not working.

private _uniform_name = toLower (getText (configFile >> "CfgVehicles" >> uniform _player >> "DisplayName"));
#

what function tells me the config file type?

still forum
#

uniform player gives you the config type

#

but displayname might be in CfgWeapons entry

exotic tinsel
#

i tried CfgWeapons too in that code i posted. no luck.

#

nvm cfgweapons does work i had a syntax error

frigid raven
#

Can I select something like objNull as player ?

#

I want to deselect my player from a current unit so I can remove it. But I haven't anything to substitute the player control for some time

winter rose
#

@frigid raven yes.

frigid raven
#

is there anything happening bady when doing so?

winter rose
#

shouldn't

selectNoPlayer is SP only, maybe try selectPlayer objNull

frigid raven
#

yeah will do that atm

#

Ok I get nuts here

winter rose
#

Scrat wants to know your location ๐ŸŒฐ

frigid raven
#
// setup lobby agent
private _playerGroup = createGroup [west, true];
COOPR_LOBBY_AGENT = _playerGroup createUnit ["B_diver_TL_F", getPos COOPR_LOBBY, [], 0, "NONE"];
DEBUG("lobby agent was created");
COOPR_LOBBY_AGENT setUnitLoadout EMPTY_LOADOUT;
// to prevent lobby players from syncing
COOPR_LOBBY_AGENT setVariable [COOPR_KEY_PLAYER_LOGGEDIN, false, true];

// remove old character
private _oldPlayerUnit = player;
selectPlayer objNull;
deleteVehicle _oldPlayerUnit;
DEBUG("old character has been destroyed");

COOPR_LOBBY_AGENT setPos getPos COOPR_LOBBY;
DEBUG2("lobby agent for %1 spawned in lobby", getPlayerUID player);

This is my problem atm. This is the spawnToLobby function. I want to destroy the former player unit and have the player selected as objNull. COOPR_LOBBY_AGENT is just a showcase unit for the character selection. I let it play some animations and so on.
What happens here is that the _oldPlayerUnit is not destroyed.

#

@winter rose ๐Ÿ›ฌ low one

#

So when I logout in my mod the old player character/unit is still there. It has not been destroyed ๐Ÿ˜ข

winter rose
#

are you sure that selectPlayer objNull does indeed select no player?

frigid raven
#

it worked when I did this:


// remove old character
private _oldPlayerUnit = player;
selectPlayer COOPR_LOBBY_AGENT;
deleteVehicle _oldPlayerUnit;
DEBUG("old character has been destroyed");

But that is not an option since I can not play animations when the AGENT is the player - or I just don't know how to properly

winter rose
#

I don't know if you can deleteVehicle the player (but I don't see why not)

frigid raven
#

@winter rose no unsure

#

A deleted player unit will stay visible until that player has disconnected.

#

means that selectPlayer objNull had no effect

#

I think I spawn a stone and make this the player

#

lol

#

4ever...

winter rose
#

or move the old unit to [0,0,0]

#

hue hue hue

frigid raven
#

no way

#

the clients will end up with 100 clones when logging in and out all the time ๐Ÿ˜„

#

maybe I should drop a bomb every 10seconds at [0,0,0] ๐Ÿค”

winter rose
#

delete and move
so that the unit will disappear on player disconnection?

#

well, move then delete

frigid raven
#

hm

#

can the player be a marker?

#

lel

winter rose
#

where did you get the "a deleted player unit (โ€ฆ)"?

frigid raven
#

selectPlayer doc

#

bottom note

#

no wait

#

deleteVehicle doc

#
Multiplayer:
A deleted player unit will stay visible until that player has disconnected.
#

mybe I just use hideObject

#

hopefully it won't simulate collisions that way

#

hideObject did the job

winter rose
#

Funny, I don't see it in deleteVehicle doc (on mobile)

frigid raven
#

I have an IntelliJ Plugin for SQF - it will show doc when hovering over keywords

#

there it is shown - the plugin is fetching the html from that wiki site - maybe the text is hidden via css/html on the browserpage

finite dirge
#

It's not in that page, hidden or not.

#

Have you actually tested that?

winter rose
#

@frigid raven

frigid raven
#

dunno where my plugin fetches the stuff tho

quartz pebble
#

Guys, has anyone thought on increasing tank smoke effectiveness via scripts?

The bird's eye view on the approach:

  • Script activates either via the tank's incomingMissile or AT's fired EH
  • During the missile flight, scan if tank has deployed smokes
  • If smokes detected - make something with missile

The trickiest part here - is detection of the deployed smokes. I can't imagine any ways to check if tank is into smoke area, except querying smokeshells nearby tank via nearEntities or analogical commands. Taking into account missile speeds, the check has to be done either each frame e.g.waitUntil or using a loop without a delay.

The issue here - is that approach would work in single player, but not in MP, where there are dozens of missiles fired.

Anyone has ideas how it could be dealt with?

frigid raven
#

anyway no I did not tested since I am good with another solution

finite dirge
#

@frigid raven Ah ok. It probably downloads a copy of the wiki that's old or been edited since. I think that plugin has a button to take you to the actual wiki page.

frigid raven
#

yeah it does and it's the same you guys are looking at

frigid raven
#

Any idea how to get rid of those blank planks on the top and bottom when using the camera?

tawdry harness
#
while {true} do {
    _isInWater = surfaceIsWater getPos player;
    if (_isInWater) then {
        hint "In Water";
    } else {
        hint "Not in Water";
    };
};```
Anyone know why this wont run forever?
#

only runs for a second

winter rose
#

@frigid raven see showCinemaBorder

plain current
#

i have hacker using scripts to cheat on my server, any way to catch him? he bypasses battleye filter, can i use to script to detect script?

frigid raven
#

@winter rose worked Thx!

finite dirge
#

He could easily kill your script threads even if you tried to do anything with scripts. Watch and ban him when he acts is your best bet.

round scroll
#

got a problem with the Nimitz plane initialization when zeus spawns a plane on a hosted server (dedicated not tested, local no problem). The code looks like this: ```sqf
// Written by TeTeT for Nimitz
params [["_plane", ObjNull]];

if (isNull _plane) exitWith { diag_log "planeInit Nimitz: null _plane"; };
if (!local _plane) exitWith { diag_log "planeInit Nimitz: !local _plane"; };
if (_plane getVariable ["TTT_catHook", false]) exitWith {};

_plane setVariable ["TTT_catHook", true, true];
diag_log "planeInit Nimitz: before syncCatapult";
[_plane, ObjNull] remoteExec ["TTT_fnc_syncCatapult", 0, true];
diag_log "planeInit Nimitz: after syncCatapult";
[_plane] remoteExec ["TTT_fnc_syncTailhook", 0, true];
[_plane] remoteExec ["TTT_fnc_syncFuelAction", 0, true];
[_plane] remoteExec ["TTT_fnc_syncIflols", 0, true];

diag_log "planeInit Nimitz: initialized plane!";
_plane;```

#

the diag_log lines are all shown in the rpt, but the critical line [_plane, ObjNull] remoteExec ["TTT_fnc_syncCatapult", 0, true]; seems to be ignored in the case of Zeus spawned plane

#

the script is called from the init event handler

#

when I use debug console and execute locally [(vehicle player), ObjNull] remoteExec ["TTT_fnc_syncCatapult", 0, true]; the catapult sync works

plain current
#

prolly the plane is not initialized yet, as described somewhere on the wiki regarding the init eventhandler or it's a locality issue

round scroll
#

@plain current thanks, but the following code seems to work: ```sqf
diag_log "planeInit Nimitz: before syncCatapult";
[_plane, ObjNull] remoteExec ["TTT_fnc_syncCatapult", 0, true];
[_plane, ObjNull] call TTT_fnc_syncCatapult;
diag_log "planeInit Nimitz: after syncCatapult";

#

is there something with remoteExec and zeus spawned units?

#

when I use createVehicle the init eh seems to be executed: sqf p = "B_Plane_Fighter_01_F" createVehicle (getPos player); p setPosASL [getPos p # 0, getPos p # 1, 17.5];

finite dirge
#

That's odd. 0 should still run it on all clients.

round scroll
#

@plain current you were right, the plane seems to be not complete yet when spawned via zeus, the following code seems to work: ```sqf
diag_log "planeInit Nimitz: before syncCatapult";
[_plane] spawn {
params ["_plane"];
sleep 1;
[_plane, ObjNull] remoteExec ["TTT_fnc_syncCatapult", 0, true];
};
// [_plane, ObjNull] call TTT_fnc_syncCatapult;
diag_log "planeInit Nimitz: after syncCatapult";

#

seems like a race of some sort

ruby turtle
#

is there a scripting way to increase the item cargo space of an ammobox?

winter rose
#

setUnitTrait "loadCoef" for a unit, but for a vehicle I don't know, I think not

ruby turtle
#

I just want to prevent overloaded Ammoboxes when players want to put items back into it

winter rose
#

no need to justify it ^^ but IDK if it is possible, unfortunately. maybe someone else here knows

ruby turtle
#

I hope so. ^^

solemn token
#

@tawdry harness

In non-scheduled environment, while do loop is limited to 10,000 iterations, after which it exits even if condition is still true. In scheduled environment no such limit exists.

https://community.bistudio.com/wiki/while
so use

[] spawn {
    while {true} do {
        _isInWater = surfaceIsWater getPos player;
        if (_isInWater) then {
            hint "In Water";
        } else {
            hint "Not in Water";
        };
    };
};
flat vapor
#

Hi,
probably a very simple question:
I want to use Grumpy Old Man's Aircraft Loadout (https://forums.bohemia.net/forums/topic/204747-release-gom-aircraft-loadout-v135/) in every singleplayer mission on every soldier so I can modify air loadouts on the fly.
I'm a super script noob, but I managed to modify the variables to my liking. However I can't figure out how to correctly call the script. I use several mods (like MCC) that run on every mission. But I don't know how to replicate its behaviour.
I tried to use this tip: https://steamcommunity.com/app/107410/discussions/0/35221031836000477/#c2765630416818239773
But it seems I won't be able to load the description.ext which contains the links to the subfolders.
Anyone here that can guide me? I googled around a bit, but can't find a solution.
Many thanks ๐Ÿ™‚

tawdry harness
#

sweet thanks so much

pallid finch
#

Hi, I have placed a house on my map but I cannot open the door, there isnt even an option. But when I place it using eden builder, i can open it. How do I fix this

#

(I placed the house in terrain builder and exported the .wrp)

winter rose
pallid finch
#

what about its scripts or whatever

winter rose
#

you placed the house in the Eden *editor?

pallid finch
#

placed the house on eden, exported to terrain builder. exported the .wrp . Packed the pbo and opened back up on eden editor. THe house is there, but it cannot be opened

winter rose
#

if it is a Vanilla Arma 3 house, yep, I believe it goes to terrain builders. It may be a config issue, or something like that

pallid finch
#

It isnt a vanilla arma house

winter rose
#

I don't know, but it is not a scripting issue

pallid finch
#

Oh okay, I appreciate your help.

winter rose
#

Sorry about that, I don't know anything about terrain creation

torn isle
#

I have been trying to to get it to work in my mission and it has just been incredibly noisy.

#

I can get the modifications to the script in a postbin if you want to look at it.

still forum
#

looks like you changed the (argb,512,512,1) part

torn isle
#

unfortunately changing it back to 512x512 did nothing :/

real tartan
#

I am using helicopters for BIS_fnc_moduleCAS. There is condition at the end waituntil {_plane distance _pos > _dis || !alive _plane};. The distance variable _dis is set to 3000, so in case of helicopters they do not reach that far after shooting, so they are stuck in air waiting for that condition. Any proposal how to order helicopter to fly away using BIS_fnc_moduleCAS any other than create my own CAS script ?

snow blade
#

Is there a global condition somewhere in the function that you could reference?

#

I suppose it would be possible to reference a variable if there is one, then calculate where the front of the chopper is, create an invisible helipad 3km in front and doMove the helo onto it.

dark ocean
#

its possible change this animTextureNormal via script

tawdry harness
#
placeCharge = {
    if (_actionShowing == 0) then {
        _actionShowing = 1;
        c4 = [];
        player addAction ["Place Charge", {
            _actionShowing = 0;
            player playActionNow "PutDown";
            _c4 = "DemoCharge_Remote_Ammo_Scripted" createVehicle position player;
            _n = count c4;
            c4 set [_n, _c4];
            player addAction [format ["Detonate Charge #%1", _n + 1], {
                (_this select 0) removeAction (_this select 2);
                (c4 select (_this select 3)) setDamage 1;
            }, _n];
            player removeMagazine "DemoCharge_Remote_Mag";
            (_this select 0) removeAction (_this select 2);
        }];
    };
};``` Anyone know why the _actionShowing var isn't being changed back to 0?
#

is it cos its in a function?

winter rose
#

_actionShowing is not defined in this scope, yes

tawdry harness
#

ok so how would i make it so that it does actually change the variable?

#

this is called from a while true loop

winter rose
#

Make it a global or object variable I suppose

tawdry harness
#

i thought of that but making it a public variable sends it to every client on a server?

#

which would be bad

winter rose
#

@tawdry harness global variable != publicVariable

#

just use setVariable on the object, don't make it public, and it's good

tawdry harness
#

alright sweet

#

thanks

south bloom
#

is it possible to create a zeus using the debug console?
(not using eden editor)

copper raven
#

yea, just create the curator module and assign a unit to it

south bloom
#

How would one do that confuse

real tartan
#

How to have multiple destinations per one task ? BIS_fnc_taskCreate

errant jasper
#

BIS definition of what a task is implies one or zero destinations. However, you can have a parent task.

real tartan
#

hmm, so break it to sub-tasks I guess :/

errant jasper
#

I mean possible there are various workaround... I believe the description can be structured text. So a single task could contain hypertext to markers instead... Or maybe the execute tag works so the text could contain words that toggle the various destinations ... at locations <execute expression='["MyTask", getMarkerPos "the_village"] call BIS_fnc_taskSetDestination'>village</execute> .....;

ornate sky
#

Do the EHs and object namespace vars get transfered to the new unit after respawn?

errant jasper
#

I believe the EHs does, but not actions or namespace vars

ornate sky
#

So I would have to transfer those via onPlayerRespawn

errant jasper
#

I believe so, yeah... Though I would recommend only copying those variables your scripting administrates... Otherwise other scripts breaks.