#arma3_scripting

1 messages · Page 538 of 1

still forum
#

That will hit max array length limit

peak plover
#

What about variables?

still forum
#

If you are overloading ram, then that has nothing to do with your while loop itself

#

it's caused by your stuff being badly written code

dull drum
#

probably I was too stupid and it wasn't ram that was overloaded

still forum
#

You should put sleep into your while loop to improve your performance (less fps-loss)

dull drum
#

I didn't mean to tell that sleep should make it last forever 😃

still forum
#

while true without sleep will execute as many iterations as it can until it hit's the 3ms limit.

peak plover
#
while {true} do {
    missionNamespace setVariable ['ten_var_' + str (random 10^10),random 10^10]
};
#

Can variable overload ram?

still forum
#

think so yes

#

So if you don't want it to iterate multiple times per frame, you should add a sleep

dull drum
#

Thanks guys 😃

peak plover
#

waitUntil only does it once a frame :^)

#

I just made 2m variables and only went up like 200 mb in task manager

#

It just wrote to pagefile after a while

#

😢

dull drum
#

You probably can abuse the CPU or GPU faster

#

Enter some good smoke effect spawns there

tough abyss
#

Can variable overload ram?
Now do the same with profileNamespace only add saveProfileNamespace

dull drum
#

I wanted to show a player's health % in the bottom right corner of the screen. But it looks that titleText somehow doesn't apply Structured decoration. Plus I don't really get how to place it by x/y coordinates. While animated text functions are just too much animated for this. Any suggestions? Thanks!

#

Interestingly enough [_stringHealth-1,-1,0,1,0,789] spawn BIS_fnc_dynamicText; puts animated text to the center of the screen, while changed to -2, -2 for x, y completely removes it from the screen.

plush oriole
#

Any way to implement a dictionary in sqf without cba?

#

i.e. any nice small addon scripts written efficiently

tough abyss
#

Is it possible to make a mission with only triggers and no SQF’s?

plush oriole
#

yep

#

but you're limited in what you can do

tough abyss
#

I’m new to coding completely and I’m making a mission, sooo I’ll probs need a crap ton of help x3

plush oriole
#

i'm up to help

tough abyss
#

I mean all I know is switchmove and setpos

plush oriole
#

yeah arma's interesting

#

because most programming languages you ge tstarted with the basics first

#

but in arma you're like 'i want to do something'

tough abyss
#

I can explain the mission in mission editors

#

Makers*

plush oriole
#

so you ge tsome code, have no clue how it works but slowly over time begin ot understanding

#

wow my spelling

tough abyss
#

Yeah that’s what I did with html

plush oriole
#

same

#

it's all copying and pasting

#

i still have to look up the

#

what is it

#

<!DOCTYPE html>

tough abyss
#

Yeah

#

I explained it in mission makers

plush oriole
#

Any nice way to represent a weighted probability?

#

hmm

#

actually

plush oriole
#

oh christ it accepts weights

#

ah well mine is a bit nicer anyway

plush oriole
#

Any nice way to create and spawn compositions?

#

without manually entering positions and configs

fierce oyster
#

@tough abyss so how can i get a Target Lead Indicator for other vehicles?

exotic tinsel
#

im having an issue where players get kicked from the server as they should for being idle in role selection for too long, but cant connect for 10min afterwards. i dont have that set to be that long anywhere but its happening. this is what is in my server.cfg

kickTimeout[] = { {0, 300}, {1, 30}, {2, 60}, {3, 0} };
votingTimeOut[] = {60, 90}; // Kicks users from server if they spend too much time in mission voting
roleTimeOut[] = {90, 120}; // Kicks users from server if they spend too much time in role selection 
briefingTimeOut[] = {60, 90}; // Kicks users from server if they spend too much time in briefing (map) screen
debriefingTimeOut[] = {45, 60}; // Kicks users from server if they spend too much time in debriefing screen
lobbyIdleTimeout = 300; // The amount of time the server will wait before force-starting a mission without a logged-in Admin.
copper seal
#

Hey all! I've got a problem with the revive system. I'm one of the Devs on Dynamic Bulwarks and we have a system where if you're carrying a Medikit you get automatically revived. The way we're doing this at them moment is terrible. We're just using a script in a loop to check if any players are unconscious and if so the script revives them. This leads to weird things like players stuck in the revive animation and stuff. I'd much rather handle this with and Event Handler. Any ideas? I can't find any events connected to the revive system. Is there any way to use the "hit" or "dammage" events to detect if the player is about to die? Then I can just make them play an animation instead of going into the revive state or something.

copper seal
#

Actually, I think I have it figured out using handle damage.

still forum
#

@plush oriole Any way to implement a dictionary in sqf without cba? you mean a string->value map? Just do it the same way CBA does it

tough abyss
#

Yo, anyone able to look at my script in DMs and see if its all correct?

#

And possibly help me with a trigger script

tough abyss
#

How do i do sleep commands in a trigger

#

and if i cant

#

How do i make it into an sqf or something so i can execute itttt
"

still forum
#

spawn {}

tough abyss
#

I know its just

#

I dont know how to use it

#

Can i send you the script over dms?

still forum
#

why not just ask everyone in here

tough abyss
#

Ill paste it here

still forum
#

and take the answer from the first guy that finds time to look at it

tough abyss
#

I dont know how to get this into an SQF

#

its a trigger btw

still forum
#

This is already SQF?

tough abyss
#

No

still forum
#

Looks very much like SQF to me

tough abyss
#

Like when i put it into a trigger

#

it doesnt work as intended

#

the sleep commands dont work

still forum
#

the [pos] is weird

tough abyss
#

Yeah im gonna put the positions in

still forum
#

Yes. As I said, put it into a spawn

tough abyss
#

Where?

still forum
#

[] spawn { <your code here> }

#

Just put that around your code

tough abyss
#

And then do i just paste that into a trigger? or into a SQF

still forum
#

Trigger code IS SQF

tough abyss
#

Ok so i just paste it into the trigger

still forum
#

Doesn't matter where you put it. Works both ways

tough abyss
#

Let me try that gimme a momento

still forum
#

Yes

#

also please don't set your pastes to "expires never" :U

tough abyss
#

Sorry

#

Didnt work @still forum

#

Hang on ill just paste the whole thing how i have it set up in the trigger

#

I have the condition set to this

dull drum
#

Hi! Am I getting it right, that if amount of damage coming is something like 1.83398e-006 it does not kill unit because it hits some HitPoint that is not lethal?

tough abyss
#

It is very very very low value, almost 0

dull drum
#

how come? it looks like "one-point-eight" while setDamage 1 kills everything

tough abyss
#

Google scientific notation

dull drum
#

Oh, it's because of -

#

Got that, thanks.
Next question: if I want to simulate more simple damage model, will it work if I will gather every HitPoint damage, nullify it and apply 0.02 to body?

tough abyss
#

Probably not, some hit points depend on other hit points

dull drum
#

Oh noes.

#

Hmm, I can still nullify everything if I'll have a list of all HitPoints

#

Or I can setDamage 0 and then wound a body hit point with 0.02 if it wasn't a body

tough abyss
#

this is actually bugging me so much, I spent all day working on this

dull drum
#

Well, I want to simplify a damage model for a player and show his Health 😃

#

And thanks for the article, it can fix some things both inside me and around

tough abyss
#

Nothing i do seems to work for some reason and i put the spawn in it

#

Put in it [] spawn {hint "triggered"}

#

Do you see hint?

#

I tried that

#

It wont even play

#

I put it all in the trigger

#

Hint doesn’t play

#

No I mean like

still forum
#

@tough abyss explain how exactly it doesn't work

tough abyss
#

I put spawn in my code

#

It just wont, like it wont put anything in the animation

#

when i test it

still forum
#

If the code doesn't execute at all, then that's not the codes fault

tough abyss
#

Do what I said

still forum
#

add systemChat or hint's into code to see if it's running properly :u

tough abyss
still forum
#

Oof... So.. Every player will setPos these units, meaning you maybe get a dozen setPos per thing.
Also every player will start the animation, so it might flicker around.
Also every player will try to switch into "Main1" but only one player can do that.

Is this a singleplayer mission?

tough abyss
#

Yeh

#

We don’t know even if the trigger triggers

#

It does

#

But you say your code doesnt run

#

it ran before all this

#

but did everything at once

#

because sleep doesnt work

still forum
#

add systemChat's to your code, to check that each line actually runs as you expect

#

Atleast I hope systemChat will show up in SP?

tough abyss
#

If it is not disabled

ivory lake
#

it does unless its running before its not loaded

#

dont spawns in triggers complain if you dont assign a var when you execute it in triggers or did they fix that

tough abyss
#

You are talking about unit init maybe?

#

huh

ivory lake
#

yeah maybe

plush oriole
#

kerc i believe you do still have to assign handles

#

'nothing expected but returned handle' or something like that

still forum
#

Not if @tough abyss is using CBA

#

CBA fixes that

plush oriole
#

Any way to add folding settings to an extension in vs code?

#

so i can do something like #region #endregion to have a foldable block, like an if statement

#

i need to configure the language, but it's from an extension

still forum
#

sure you can

#

but Arma preprocessor will error on that

compact maple
#

hello

#

If I got a sqf file which contain inline functions.
If I dont call this sqf file, can I use theses inlines functions ? are they compiled at the connection ?

still forum
#

compiled yes

#

but they are not put into a global variable if you don't execute the script that puts them into a variable

compact maple
#

Oh okay so I have to execute the file, thanks

queen cargo
#

@plush oriole make it catch this:
//#region
//#endregion

plush oriole
#

yep just did a config

#

Nothing - This syntax does NOT return a unit reference! In order to reference this unit, you can use newUnit = this in the init field. If the target group is not local, the init script will only execute after a slight delay; see Killzone_Kid's note below for more information and issues about this syntax.

#

does this mean in order to get a reference to a created unit, it has to be part of a group

#

ah nice you don't need a unit to create a group

tough abyss
#

disableCollisionWith Isnt working for me

#

Like the breaching animation doesnt start right away so the units get pushed around and the command isnt working

winter rose
#

@tough abyss in multiplayer, or even in the editor?

tough abyss
#

Singleplayer

#

[Flashbang, Doorman] remoteExecCall ["disableCollisionWith", 0, Flashbang];

#

So im just gonna put that into the trigger

#

and see if it works

#

Remote exec is called remote because there are local and remote PCs on network. In single player there is only local PC, what do you need remote execution for?

#

Well that's what I saw on the wiki

#

So you know the breaching animation how they all have to be in the same spot right?

#

They spawn in and then it takes a second for the trigger to activate

#

There is lots of other code on the wiki too

#

So they move about

#

Like how do I make it so they don't move about, Do i have to put something into the Init sqf>

#

Besides the JIP param in remote exec in SP is utter nonsense

#

Well I dont know that, its just the disablecollisionWith isnt working for me

#

Basically Im trying to get the truck to pull up then the trigger to activate

elfin comet
#

Would anyone happen to have a script that forces a player to drop their bag if they have a specific item in their loadout? I have put together the little bit below and while it doesn't produce errors, it also doesn't drop the bag.

_recentlyDeceased = getUnitLoadout player;

if ("SatchelCharge_Remote_Mag" in _recentlyDeceased) then 
{ 
    _gwh = "Weapon_Empty" createVehicle position player; 
    player action ["DropBag", _gwh, typeOf unitBackpack player];
};```
However, the section below when run on it's own, drops the bag regardless of present items since it isn't checking for anything.

_gwh = "Weapon_Empty" createVehicle position player;
player action ["DropBag", _gwh, typeOf unitBackpack player];```
So, I'm thinking its something that I'm formatting wrong with the if portion but I can't figure out what. Any ideas? Feel free to ping me if you have something.

ivory lake
#

use magazines player instead of getunitLoadout

tough abyss
#

getUnitLoadout is array of arrays you query just 1st dimension, so it never finds the item

tough abyss
#

So in an sqf file do i have to define what the varible name for what it is ingame?

#

Or can i just put the name of the unit into the file and it will run

#

maybe im just too dumb to understand this all

#

So once i've done

if (triggerActivated trg1) then {
    execVM "setpos.sqf";
    };

In init.sqf, In the setpos.sqf I put this

Flashbang setpos [3255.19,6746.35,0.160004];
Deadman setpos [3255.08,6746.5,0.160004];
Guard setpos [3255.19,6746.35,0.160004];
Doorman setpos [3255.18,6746.35,0.160004];

Is this ok? Is there anything I need to add?

still forum
#

"So in an sqf file do i have to define what the varible name for what it is ingame" no, you do that in editor already

#

"Or can i just put the name of the unit into the file and it will run" the name of the unit IS the variable

#

"So once i've done " where do you put the code?

#

"in init.sqf" no that won't work

#

you will check once if the trigger activated at mission start. The trigger won't be activated then

#

and then you check never again

#

You should run the code from your triggers onActivation field, that's how it's supposed to be done

elfin comet
#

@ivory lake @tough abyss Thanks!

tough abyss
#

Oh, alright. i'm just still dealing with a couple problems which i have already put on the forums, so I wont bring them up here but thanks

still forum
#

What happened to the troubleshooting we tried to do before?

tough abyss
#

Well

still forum
#

where we told you to add systemChat's, you never came back

tough abyss
#

nononon

#

the trigger works

#

Im having troubles with the collisions

#

Like you know how the breaching animation requires all four to be in the same spot, the trigger doesn't activate fast enough to stop them from being pushed

still forum
#

disableCollision only works for physics objects afaik

#

human players aren't physics

#

Ah no. it was opposite.

#

you did a remoteExecCall before (the call part is nonsense but it doesn't change anything here) but in singlePlayer, you don't remoteExec, there is no remote.

tough abyss
#

Yes I did, im just trying to wonder if there is a command to stop them from colliding

#

I've looked pretty much everywhere

plush oriole
#

just remove the remoteExecCall

#

because it's singleplayer

#

so it gets confused (non technical :D) when you try to do it in singleplayer

winter rose
#

if the mission is planned to be MP, use remoteExecCall though. but if testing that in singleplayer is not working, your problem is elsewhere

plush oriole
#

yes

tough abyss
#

Huh, I think i managed to figure it out

#

Do you need a camera for the cinematic borders to show?

#

wait nvm scratch that think i found something

#

Thanks boys

dull drum
#

Guys, what is the difference between a hit point and a hit selection? And also a hit index o_O

winter rose
#

hit index is when a bullet hits a finger

dull drum
#

Oh, yeah

winter rose
#

afaik, selection is a 3D model part's name, whereas hitpoint is the "generic" name (such as rotor, hand etc)

#

it is better to use hitpoints now.

dull drum
#

Got it, thanks

winter rose
#

which do you prefer,

myVeh getHit "velka vrtule"``` or ```sqf
myVeh getHitPointDamage "HitEngine"``` ? ^^
dull drum
#

I was accustomed with mala vrtule not so long ago, so i'm kinda ok with both!

winter rose
#

you were supposed to destroy them, not join them!!

dull drum
#

%)

plush oriole
#

mala vrtule gang

#

ok so it appears addAction does not work on vehicles with hideObject set to true

#

but this isn't documented so it may just be my own personal frickery

winter rose
#

if you hide, addaction, then unhide them does the action appear afterward?

plush oriole
#

'ang on i'll test

#

wait do you mean the otherway around

#

i.e. hide after doing addaction

#

neither hide then addaction or addaction then hide wor

#

work

tough abyss
#

What do you mean doesn’t work?

#

It doesn’t add or you can’t see action?

plush oriole
#

can't see action

tough abyss
#

addAction is the only purpose is to ADD action. Is the action added?

plush oriole
#

what

#

well

#

the point is there appears to be undocumented behaviour where hideObject also hides actions

tough abyss
#

Does it return action id that is not -1?

plush oriole
#

and it doesn't work either way round so I assume it's just hidden

#

yeah i'll check

#

0

#

but this is addAction, then hide

tough abyss
#

and if you do it other way round?

#

hide then add?

plush oriole
#

still doesn't work

#

but i'l check the id

#

yeah 0 again

#

still works

tough abyss
#

so hiding makes no difference?

#

ok so it appears addAction does not work on vehicles with hideObject set to true
Incorrect assumption?

plush oriole
#

well i don't know

tough abyss
#

if it looks like a duck and quacks like a duck it is...? Well I dont know

plush oriole
#

what

#

when it's visible, actions work. when it isn't, addaction returns a valid id but aren't visible

tough abyss
#

really? why would you expect it appear on invisible object?

plush oriole
#

i don't know

#

it could have been either way

#

it's because scripted satchel charges appear not to have any hitbox so adaction doesnt work

#

so i need a helper

tough abyss
#

what the addaction has to do with hitbox?

#

"well i dont know"

plush oriole
#

ok

#

Does anyone know of any way to keep actions visible and usable on a hidden object?

#

none of the 'invisible' props are the right size

frozen oar
#

Wouldn't "variable name" addAction "Custom action name", "abcdefg.sqf"; work on any object even invisible?

plush oriole
#

nope

#

or at least not in my experience

#

well

#

it works and adds the action but the action isn't visible

frozen oar
#

Ah and it's on an object that is invisible correct?

#

Have you tried adding an action while in a certain area

plush oriole
#

unfortunately it's moving

#

basically it's a helper object, because the actual object is a scripted satchel charge and its hitbox doesn't seem to be large enough to aim at for an action

tough abyss
#

@frozen oar
Syntax: object addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition, radius, unconscious, selection, memoryPoint] Parameters: object: Object - unit, vehicle or static object <---------------------------------- OBJECT
https://community.bistudio.com/wiki/addAction

plush oriole
#

what

#

yes i think he just mistyped the quotes

frozen oar
#

Yeah doing of the top of my head

#

Currently at work 😅 so I don't have my files in front of me

#

Also, I'm new to writing scripts in. Sqf files. So take a pinch of anything I say as it may not all be true exactly.

tough abyss
#

We have all been there this is why wiki is your best friend

frozen oar
#

Yes and thankfully there is one because I'd be lost

#

Ever so lost...

tough abyss
#

Does the breaching animation support the force weapon fire command?

plush oriole
#

'support'?

#

you can force fire

#

do you mean your script

#

it's not built in

tough abyss
#

Like some animations allow and dont allow firing

plush oriole
#

hmm

tough abyss
#

whilst playing them

plush oriole
#

i believe you can always force fire

#

because it doesn't retarget

#

not sure

tough abyss
#
Deadman ForceWeaponFire ["weapon_arifle_MSBS65_F", "Single"];
plush oriole
#

so the best way to find out is a little advanced but check the config files via the config browser

tough abyss
#

Would that work?

plush oriole
#

should

#

if it's the right weapon

#

is 'weapon_arifle_MSBS65_F' actually the weapon

tough abyss
#

Promet 6.5 mm

plush oriole
#

well weapon_arifle_MSBS65_F needs to be replaced with the muzzle name

#

you're telling the game which of his weapons to fire

tough abyss
#

So where would you find the muzzle name?

plush oriole
#

currentWeapon

#

should be it

#

or just use fireAtTarget

#

which doesn't actually move where the unit is aiming

#

afaik

tough abyss
#

So I would just put

Deadman ForceWeaponFire ["currentWeapon", "Single"];
plush oriole
#

no currentWeapon is a command

digital hollow
plush oriole
#

oh yeah currentMuzzle

tough abyss
#

So where does it print what the muzzle name is?

plush oriole
#

but fireAtTarget uses the weapon name i believe

#

it doesn't print it

#

what

tough abyss
#

Well i assumed that

plush oriole
#

if you do currentMuzzle unit, it returns unit's current muzzle on thei rcurrent weapon

#

so something like Deadman ForceWeaponFire [currentWeapon Deadman, "Single"];

plain current
#

_muzzle = currentMuzzle player;

tough abyss
#

Wait wouldnt that be currentMuzzle Deadman? or CurrentWeapon Deadman

plain current
#

Wiki says muzzle

#

Thought about testing it?

plush oriole
#

currentMuzzle for forceWeaponFire

#

yeah that's an idea

tough abyss
#

Thank you!

#

Jesus's idea worked

plush oriole
#

nice

peak plover
#

today I fouind out

#

checkVisibility

#

epic command

plain current
#

Pretty sure it doesn't work indoors

peak plover
#

why not?

plain current
#

likeIntersects doesn't work indoors, pretty sure checkVisibility also always returns 0 indoors

#

But not sure on that, can't test rn

peak plover
#

hmm

#

Hopefully that's fine

#

I'm just using it for Early Warning System for a tank

tough abyss
#

likeIntersects doesn't work indoors
Huh? Which likeIntersects?

winter rose
#

lineIntersects 🙄

plush oriole
#

Any way to more directly force ai to drive a certain way

#

other than that command wher eyou record and play back movement

#

i'm setting up a checkpoint and when the bar gate is closed, they'll happily go through both bar gates, but when i open the gate they invariably go all the way around, normally crashing into something on the way past

winter rose
plush oriole
#

that 's exactly it

#

thankyou so much

#

how did i not find that

#

and it will make them drive through or over anything in their way?

#

no pathfinding?

#

and presumably it's based on unit speed setting

astral dawn
#

you could give a set of waypoints to your group

plush oriole
#

yeah waypoints aren't working

#

the bargate messes up the pathfinding

plush oriole
#

hmm setDriveOnPath doesn't seem to do anything

#

i've turned the vehicle's engine on

#

tried with various targe tpoints

#

ooh maybe there has to be multiple points

exotic tinsel
#

im having an issue where players get kicked from the server as they should for being idle in role selection for too long, but cant connect for 10min afterwards. i dont have that set to be that long anywhere but its happening. this is what is in my server.cfg

kickTimeout[] = { {0, 300}, {1, 30}, {2, 60}, {3, 0} };
votingTimeOut[] = {60, 90}; // Kicks users from server if they spend too much time in mission voting
roleTimeOut[] = {90, 120}; // Kicks users from server if they spend too much time in role selection 
briefingTimeOut[] = {60, 90}; // Kicks users from server if they spend too much time in briefing (map) screen
debriefingTimeOut[] = {45, 60}; // Kicks users from server if they spend too much time in debriefing screen
lobbyIdleTimeout = 300; // The amount of time the server will wait before force-starting a mission without a logged-in Admin.
plush oriole
#

do they get a different error if they try to connect within the time they're kicked for

#

i..e after 300 seconds or whatever does it switch to a different error message

exotic tinsel
#

message is the same. "the way the server is setup you can not rejoin for x seconds" or something like that. Ive been kicked for idle too long. just says 600 seconds soon as im kicked and it takes that long to get back on.

plush oriole
#

Could someone possibly test setDriveOnpath how they expect it to work

#

I can't get it to do anythinf

astral dawn
#

could your coordinates be in wrong format?

#

AGL or AGLS or ATL or whatever

plush oriole
#

thing is i'd expect it to do something anyway

#

yeah

#

well i've tried getPos player, [0,0,0], getMarkerPos

#

and getMarkerPos is the example, so I assume it works with a z coord of 0

astral dawn
#

yeah seems so 🤔

frozen oar
#

how are you using the code? for a Player or Ai

plush oriole
#

AI

#

but I can't get it to make anything happen

#

at all

faint vale
#

How would I get this eventhandler to work with my character class? Would I just add it to class eventhandler? Or do i need to do it a different way.

I'm trying to get it so when the Spartan picks up a weapon it will get replaced with one that is compatible with the Spartans skeleton, which is not the same as the arma skeleton. I made a second weapon class and added spartan to the end of it, which has the new handanim for the new skeleton.

player addEventHandler ["Take", {
    params ["_unit", "_container", "_item"];
    if(_item == "OPTRE_SRS99D") then { 
        player removeWeapon "OPTRE_SRS99D";
        player addWeapon "OPTRE_SRS99D_Spartan";

}]; 
plush oriole
#

well you need closing curly braces for one thing

#

and i'm not sure whats going on with that indentation

#

but yes

peak plover
#

yeah then { never closes

#
if (((toLower (typeOf _unit)) find 'spartan') != -1) then {
    // unit classname has spartan in it
}
#

That's how you can find out if the unit that picked up the goods was a spartan

plush oriole
#

i assume they only add the EH to the spartan units

#

but good catch

peak plover
#

The best way to do it is just add the class EH with cba XEH

faint vale
#

okay, thanks i'll try later when i get time.

plush oriole
#

oh my god

#

setDriveOnpath needs two points at least

#

and it does not mess around

#

civilian vehicle goes over two fences at top speed, then screeches to a halt literal centimetres from the barrier gate

little ore
#

Hey, how or where can i look up what these Macro's do in the Ace Mod Code on Github . f.e. :
[_unit, !_unconscious, 10e10] call EFUNC(medical,setUnconscious);
(thats a Line in the "fnc_moduleUnconscious.sqf" of the Ace Mod)
Im tryin to find out how to make an AI Unconscious, but i cant use
[player, true, 5, true] call ace_medical_fnc_setUnconscious;
because the ace-uncon setting for the AI is on 50/50 and they get killed from time to time.
I dont want to change this setting

tough abyss
#

Can i use setPosWorld in a ammo box that have global simulation off?

#

Thanks!

plush oriole
#

I believe setPos works on unsimulated objects

#

try it

peak plover
#

🤔

plush oriole
#

don't see why it wouldn't

#

but give it a go

#

or at least i'm pretty sure it's worked for me in the past

peak plover
#

interdasting

#

I can't remember

#

I want to know too

tough abyss
#

i will test in 6 hours

little ore
#

@peak plover thx, thats quiet helpful. Its basically the same function i used before ace_medical_fnc_setUnconscious ^^
so why is the AI going to be 100% uncon with the Zeus function, when it uses obviously the same function?

peak plover
#

here

#

You can set the value for individual units

#

so you can still have it as normal mission settings for the rest of the units

#

I assume it has to be 2

#

so sqf _unit setVariable ['ace_medical_enableUnconsciousnessAI', 2,true]; _unit call setunconsious

tough abyss
#

Does anyone know the IDs of the Apex doors

#

Wait let me get the classname of the house

#

Land_House_Small_02_F

#

The door is just called BIS_fnc_Door

peak plover
#

I don't know what door IDs even are

#

What are you tryina do?

tough abyss
#

Open the door

#

Through a trigger

#

So with the breaching anim, there is a guy that opens the door and I want that to happen

peak plover
#

use the terrain edit module

#

or

#

🤔

tough abyss
#

This is what the statement is

statement = "([this, 1, 1] call BIS_fnc_Door)";
#

How can I put that into a trigger so it opens

#

I just dont know how

peak plover
#

yeah

#

instead of this you have the house

#

use the edit terrain object module

#

You can add a variable name to the house with it

tough abyss
#

_theBuilding = nearestBuilding someObject;
_theBuilding animate ["BIS_fnc_Door", 1];

#

I do not even know how to do that

#

Can I just put

house1 animate ["BIS_fnc_Door", 1];
#

Nope

peak plover
#

call bis fnc door

#

you can't animate a function

tough abyss
#

damn

#

In the statements for the doors they dont even tell you the name like the normal ones do

peak plover
#
([this, 1, 1] call BIS_fnc_Door)
#

just replace this with your house

tough abyss
#

Dosn't work

#

Wait theres two doors

#

you can also do 2, 1

peak plover
#

per

#

haps

tough abyss
#

YSe

#

Yeah

#

Thank you

#

Holy crap where has this discord been most of my life

#
// Let me say something. I have seen this happen too many times. When there is a place on the internet that has people with certain level of expertise it often attracts more people of the equal or superior knowledge. Then this place becomes an interesting place to visit. However earlier or later it attracts people who are not willing to learn but find it convenient just to ask for copy paste solutions. The problem is that they ask primitive questions and they ask a lot. This pushes people with knowledge away because it becomes boring place to visit. This has happened to BI scripting forum sometime ago and this is happening to this discord. I hate to see it vanish, but unfortunately this is unstoppable like global warming. IMO StackOverflow is the only website that did it right and still stays afloat. Sorry for the rant, and this is not directed at anyone in particular.
if (true) exitWith {};
peak plover
#

Maybe it's not that they are not willing to learn, but rather unable to learn? 🤔

tough abyss
#

I look all over the internet before i ask

#

sometimes Its obvious and I just dont see it

#

after spending a solid 3 days without asking questions, I ask

peak plover
#

It's okay to ask

#

I just sometimes reply with an image of google.com 😄

tough abyss
#

g00gel

plush oriole
#

i mean on the flipside there are people who jump on anyone asking a basic question

#

and this server is very confusing for a new player

tough abyss
#

Definitely, i barley know anything about coding tbh

#

But i've managed to make this and im happy

plush oriole
#

honestly you're one of the better ones

#

you're trying stuff, unlike some people who just go 'then what'

tough abyss
#

best way to get the name of a vehicle?

#

Hover over it in eden editor

#

Like class name of the vehicle?

#

Then yeah I found that’s one way

#

I have an array (vehicles) that returns all the vehicles available. I want to list the names of the vehicle in a list (doesn't work with name _x) in a ForEach vehicles

#

Yep okay that’s out of my range zone

#

Haha sorry buddy, I thought ya just meant how to find a class name

#

thanks anyways

plush oriole
#

have you tried typeOf?

ruby breach
#
getText (configFile >> "CfgVehicles" >> (typeOf _X) >> "displayName")```
plush oriole
#

oh display name

#

sorry 🅱 anger 🅱 oo 🅱 el mentioned classnames

tough abyss
#

S m 🅱

#

I tried that gnashes but for some reason the list is empty...

ruby breach
#

Then you have other issues because that should work

plush oriole
#

what does sqf typeOf (your object) return?

spark turret
#

the classname of the object

#

@plush oriole

#

in string form

plush oriole
#

ok that should be fine

#

what actually is the object?

spark turret
#

i see no reason why "getText (configFile >> "CfgVehicles" >> (typeOf _X) >> "displayName")" shouldnt work. are you sure you are using it on a vehicle?

#

because magazines and weapons are not part of cfgVehicles.

little ore
#

@peak plover finally set up a fresh scenario and it worked, still dont know where the problem was. Anyway thx for your help

dull drum
#

Thanks @quartz coyote for all the help!

spark turret
#

is there a way to delete a position inside an array with out rearranging the whole thing? kind of like

_testarrray set [0,<null>];```
but with an actual working command. i dont wanna replace, i wanna delete positions.
sleek token
#

is there a way to make a keypress for a player with sqf?

#

e.g. make the player move forward

dull drum
#

Is keypress necessary or you just want him to move?

sleek token
#

the last one

#

not necessary

#

but i dont see a better way

dull drum
#

Will this fit?

plush oriole
#

no that's an order

#

for AI units

#

oh

#

yes

#

wait is it an AI unit??

#

that you want to move, sorry for double ?

sleek token
#

nope i want to move a player

#

but with full animation and not by setting his pos every few frames

plush oriole
#

i'd have it as an AI unit and put a camera on its face

dull drum
#

If it's for a cutscene sounds like a plan. You can even substitute your player with the same model and loadout. Gamedev is fun.

oblique pine
#

Hi all, can i found some help here for new dayz -serverMod ?

#

or its only Arma 3 scripting

plush oriole
#

so long as it's sqf it should be similar

#

but most people won't know about dayz specific functions

tough abyss
#

I noticed a strange behaviour that can be a bug in the core soul of Arma 3 Engine:

#

On this code:```sqf
_posW = getPosWorld BRPVP_construindoItemObj;
_vdu = [vectorDir BRPVP_construindoItemObj,vectorUp BRPVP_construindoItemObj];
[BRPVP_consMovObj,_vdu,_posW] remoteExecCall ["BRPVP_moveActionBoxBack",2];
[_posW,BRPVP_consMovObj,BRPVP_construindoItemObj] spawn {
params ["_posW","_consMovObj","_delete"];
waitUntil {ASLToAGL _posW distance _consMovObj < 10};
deleteVehicle _delete;
};
BRPVP_construindoItemObj = BRPVP_consMovObj;

#

_vdu select 0 will have vectorDir BRPVP_consMovObj and not vectorDir BRPVP_construindoItemObj.

#

Run in unescheduled mode

#

BRPVP_construindoItemObj at start is an box created with createVehicleLocal

plush oriole
#

can you demonstrate it with a smaller snipper

#

snippet

#

without using non vanilla functions

tough abyss
#

@plush oriole you understand what happened wrong?

winter orchid
#

Hey all,

I'm attempting to add Alias's Kamikaze script into another mission and I'm not 100% sure what to do. Can someone point me in the right direction?

velvet merlin
#

try to find badly placed objects in terrains - namely overlapping/intersecting ones
we tried with BB and vectors, but its too imprecise and costly
any other suggestions we could try?

peak plover
#

I can't think of another way other than BB and lineIntersects

#

Just check one per frame

#

I would image you'd need to review it manually anyway

#

So I'd just check on per frame

#

Save the array to profilenamespace

#

So i could load it again later if I reload the mission or sth

#

Have a keybind to teleport through the array

meager granite
#

@velvet merlin What kind of objects? Terrain pre-placed ones or added through some script?

velvet merlin
#

terrain objects

peak plover
#

like RscTitleDisplayEmpty

#

etc

#

and also controls

#

like

#

RscText

plush oriole
#

@tough abyss Well the AI won't automatically land, so presumably when a player who is not the leader of their squad lands, the AI command them to 'move' to their current objective, which always involves taking off

#

i.e. the AI don't land of their own accord

#

so presumably the VTOL throttle is affected directly by the AI command

#

/\ speculation /\

#

dangit

tough abyss
#

Hey. Does anyone know a script that restricts 3rd person in certain locations?

plush oriole
#

i believe this works on units

spice axle
#

is there a command for knowing if lights are enabled? Because you can't enable lights from a vehicle at day (or from something else)

plush oriole
#

found this

#

If a vehicle has headlights, they are usually available for the driver of the vehicle and if the driver is a human player, the headlights could be operated via keyboard binding (normally L) or scroll action menu. If the driver is AI, it will operate the headlights depending on some preset condition. For example it will turn the lights at night and turn them off in the day time. The exact time when AI may decide to use the lights can be obtained via the following formula (⚠ current formula but could change):

private _isTimeForLightsOn = [0,0,0] getEnvSoundController "night" > 0.7;

#

so apparently no built in function which is guaranteed to be accurate but you can recreate the internally used one

spice axle
#

Thanks a lot

plush oriole
#

no problem

shrewd inlet
#

Does anyone know a module that makes a player roll virtual dice?

plush oriole
#

as in a function that returns a number from 1 to 6

#

or one which says 'roll a dice', then animates dice rolling

calm bloom
#

Hello, guys! How can i check if an object has the inventory?

#
private _vwitemcargo = weaponsItemsCargo _x;
                    private _vitemcargo = itemCargo _x;
                    private _vmacargo = magazinesAmmoCargo _x;
                    _vcount = 0;
                    if (!isnil '_vwitemcargo') then {
                        _vcount = _vcount + count _vwitemcargo;
                    } else {
                        _vwitemcargo = [];
                    };
                    if (!isnil '_vitemcargo') then {
                        _vcount = _vcount + count _vitemcargo;
                    } else {
                        _vitemcargo = [];
                    };
                    if (!isnil '_vmacargo') then {
                        _vcount = _vcount + count _vmacargo;
                    } else {
                        _vmacargo = [];
                    };
                    if (_vcount > 0) then {

that one seems too large

ruby breach
#
private _vwitemcargo = weaponsItemsCargo _x;
private _vitemcargo = itemCargo _x;
private _vmacargo = magazinesAmmoCargo _x;
if (count (_vwitemcargo + _vitemcargo + _vmacargo) > 0) then {};
calm bloom
#

Yes thank you but i am talking about another wayto do that

#

sorry if that excessive code part messed you up about what i was asking

still forum
#

Your question didn't really make sense

tough abyss
#

Hey. I'm looking for a script that would allow me to add XP system on the server. One that would reward XP for player and npc kills and could be used to spawn with better gear by leveling up. i have seen that on some servers

plush oriole
#

they probably made their own

#

shouldn't be that tricky

harsh sphinx
#

switchMove has this on the wiki: When the argument is remote, the animation change on the executing PC is only temporary. - I've been using remote execution to run this, but I've found in a few small cases it does only seem to be temporary, and the animation change is never propagated to the person it's applied to or anyone else. Is there a solution to this I'm missing?

plush oriole
#

are you using remoteExec?

harsh sphinx
#

Yes

plush oriole
#

so something like remoteExec [unit]

harsh sphinx
#

In about 90% of cases it's fine, there's just a small proportion where it's only temporary. I can only figure there's something with locality affecting this.

plush oriole
#

with the other arguments

#

hmm

harsh sphinx
#

Other scripting functions I'm using in a similar fashion all seem to be fine over the network all of the time, it's just switchMove proving to be unreliable.

plush oriole
#

i imagine one of the sqf wizards will know something about this

#

actually

#

is it only being run on the object local machine

young current
#

It may say so in the commands wiki page btw

plush oriole
#

I think he's already read it

hoary stratus
#

hi guys, how can i force a player to get out of a vehicle with a script?

plush oriole
#

player action ["Eject",vehicle player];

#

that was fairly googleable btw

#

i don't want to be snarky bc lots of people are but often you can just google what you want

#

although admittedly often it'll be very hard to find

#

and wording is important

#

Anyone know why diag_log stops working when I go more than 2 layers deep of execVM scripts?

still forum
#

your script apparently doesn't execute

#

diag_log doesn't care where it is

#

Doesn't even know where it is

plush oriole
#

pretty sure it's not an issue with mine

ruby breach
#

If it's not logging, it's not the command

plush oriole
#

a diag_log at the start of my second layer of script sqf diag_log "AAAAAHHHH D:";

#

never runs, although the stuff inside it does

ruby breach
#

It's something you're doing that's not executing the command

still forum
#

If it doesn't log, then your script doesn't run

plush oriole
#

hmm so no weird edge cases

#

thanks i'll keep testing

#

oh wow it was

#

wtf

#

ahhh a waituntil

#

that shouldn't have paused

thin pond
#

do you guys know any good databases for camouflage patterns ?

still forum
#

I heard there was a good thread on facepunch

#

but that's gone now

#

What does that have to do with scripting?

thin pond
#

whops wrong channel sorry 😄

#

was meant for texture obviously

winter orchid
#

Attempting to get the sounds from a script demo (Kamikaze) to port over to the KP Liberation mission correctly. For some reason, I can't get the sounds to link and keep getting an error saying that they cannot be found, even though I've kept the directory the same from the original.

Can there only be one CfgSounds in a mission file? Or what else could be causing this?

plush oriole
#

yes probably only one CfgSounds

#

multiple sounds within it but if it's not working i assume that's the issue

vapid wadi
#

I'm making a Main menu mod which Im hoping to create a simple config for, I was wondering if there was a way, how could I make this dialog check a config for image directories? to make it easier for certain people to use it.
could I just do configFile >> "anxMenu" >> "directories" >> logoimage ?

#

put in config editing by accident

plush oriole
#

you can delete messages if you want

#

and yeah you can read config from scripts

vapid wadi
#

Is there a way to do it from the dialog or do I have to make it ctrlset with the config?

plush oriole
#

as in make a property which automatically checks the config?

vapid wadi
#

Its going to be a mod obviously, but I have the dialog with the text directory, is there a way to make the text check the config for the correct directory & image?

plush oriole
#

think you'd have to do a script

vapid wadi
#

alright

carmine oak
#

how do i return the texture of an object that doesn't have any texture in it's config?

native hemlock
#

As in if doesn’t have a hiddenSelection defined? I don’t think there is any other way other than unpacking the PBO and checking the paths in the model.

#

Do you have an example of the kind of object you’re looking to find the texture for?

proven crystal
#

hello, im trying to get me a list of available factions

#

i was trying ```("(getnumber (_x >> 'side') == 1)" configClasses (configfile >> "CfgFactionClasses" ))````

#

but that returns me this:

#

[bin\config.bin/CfgFactionClasses/BLU_F,bin\config.bin/CfgFactionClasses/BLU_G_F,.......]

#

i only need that last bit....

#

BLU_F etc...

plush oriole
#

is this for a2 a3 compatability

#

afaik east,west,resistance,civilian and then sideUnknown,sideFriendly,sideEnemy,sideLogic,sideEmpty,sideAmbientLife are always going to work

tough abyss
#

@proven crystal ```sqf
_yournamesarray = _yourresultarray apply { configName _x };

proven crystal
#

ahhh thanks

#

and how do i get the corresponding DisplayName?

#

ah got thant

#

gettext (configfile >> "CfgFactionClasses" >> "BLU_T_F" >> "displayName")

#

just had a typo in it

tough abyss
#

yeah ```sqf
getText (_x >> "displayName");

plush oriole
#

Can anyone spot why this doesn't work

_vehicle addAction ["Open Rear Doors", {(_this select 0) animateDoor ['Door_4_source', 1]}, nil, 1000, true, true, "", "_target doorPhase 'Door_4_Source' < 0.5", 10, false, "","door4"];```
it does work like this:
```sqf
_vehicle addAction ["Open Rear Doors", {(_this select 0) animateDoor ['Door_4_source', 1]}, nil, 1000, true, true, "", "_target doorPhase 'Door_4_Source' < 0.5", 10, false];```
so something's wrong with the memoryPoint argument.
#

it also doesn't work like this

_vehicle addAction ["Open Rear Doors", {(_this select 0) animateDoor ['Door_4_source', 1]}, nil, 1000, true, true, "", "_target doorPhase 'Door_4_Source' < 0.5", 10, false, "door4"];```
#

so apparently door4 is neither a valid memoryPoint or selection argument, despite sqf van selectionPosition "door4" working

vernal mural
#

Hey there, I would appreciate a little bit of help here :

_types = ["B_Heli_Transport_01_F", "B_Heli_Attack_01_dynamicLoadout_F", "B_Heli_Light_01_dynamicLoadout_F", "B_Heli_Light_01_F", "B_T_UAV_03_dynamicLoadout_F"];
{
    _display = [_x] call GSRI_fnc_minifyName;
    _modifier = {
        // some code, working well
    };
    _condition = {
        // some code, working well too
    };
    _statement = {
        systemChat "poke";
    };
    _action = [format["action%1",_display],_display,"",_statement,_condition,{},[_hangar, _x],"",2,[false, false, false, false, false], _modifier] call ace_interact_menu_fnc_createAction;
    [_handle, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToObject;
} forEach _types;

With the code above, the statement is never executed. It doesn't looks like an ACE problem since similar actions all around my mission are working perfectly. I got no script error. There is not trace of such operation in RPT.

It's probably a very dumb mistake, but I can't see where exactly.

#

@plush oriole, what vehicle is that ?

plush oriole
#

the IDAP van

#

it's in the config and i really can't see any way that's not a valid selection

#

and i'm afraid i don't know anything about ACE functions

#

although at least we have vaguely related issues :D

compact maple
#

Hello, I can use pi in arma with pi command right ?

vernal mural
#

@plush oriole just tried, the action is not displayed indeed. However the game does not look at it as an error : the action ID is properly returned by addAction.

#

@compact maple looks like you can, yes

plush oriole
#

yeah i think it's a positioning error

compact maple
#

ok thanks

plush oriole
#

what's really weird is that the only 'issue' with selectionPoint i can find is some of them are animatio nrelated, so return [0,0,0]

#

but that should still be object center

vernal mural
#

@plush oriole look into config defined userActions of your vehicle

#

there is already a "rear open" action, but it has no position attribute

plush oriole
#

it's filtered by seat position i assume but i couldn't find that action in the config

#

i assume it's inherited

#

but i don't know if that's even a thing

winter rose
#

there is already a "rear open" action, but it has no position attribute 👀

vernal mural
#

@winter rose ?

winter rose
#

@vernal mural just a sentence that needs a context, else it is a dirty reference 😄 don't mind me, please proceed

vernal mural
#

can someone explain this :

plush oriole
#

@vernal mural sometimes you get duplicate config folders

#

i believe they both open when you expand one though

#

which is fun

#

yep

#

the main issue is i'm using valid selectionPoints but it just 'doesnt work'

vernal mural
#

yeah I'm still searching for a solution here

#

I've just seen this funny strange thing in config

plush oriole
#

yeah it's another 'arma thing'

vernal mural
#

@plush oriole this works :

#

van addAction ["Open Rear Doors", {(_this select 0) animateDoor ['Door_4_source', 1]}, [], 1000, true, true, "", "_target doorPhase 'Door_4_Source' < 0.5", 10, false,"","pos cargo LR"];

winter rose
#

@tough abyss thanks :3
It is open to criticism / other advices

Also, may I add a "clean useless items" function to this page, inspired by yours?

plush oriole
#

thanks"!

#

oops

#

how did you figure that out cheitan?

vernal mural
#

no idea

plush oriole
#

i couldn't find a reference for what 'memoryPoint' actually was

vernal mural
#

just tried other memoryPoints found in config

plush oriole
#

it's only referred to on the wiki in othe rarugments

#

oh

#

well thanks anyway

vernal mural
#

first one was the right one ^^

plush oriole
#

which entry are memorypoints in

vernal mural
#

the one I found is in configfile >> "CfgVehicles" >> "C_Van_02_vehicle_F" >> "Turrets" >> "CargoTurret_03"

plush oriole
#

ah

#

so are memorypoints defined in the p3d

#

i was wondering if maybe they were in the model, so you could only find them by seeing where they're used

vernal mural
#

@plush oriole yeah I tried to find a quick memoryPoint script exporter but it looks like no script command is able to get a list of it.

plush oriole
#

hmm

#

thanks anyway

vernal mural
#

However, I'm still stuck with my problem :/

plush oriole
#

anyone who copies this, just be aware that obviously since that's a cargo position it's not quite centred

proven crystal
#

what seems to be the issue with these waituntil {!isNil "fez_zonefncs_init"; sleep 1;}; waituntil {!isNil "fez_patrolfncs_init"; sleep 1;}; waituntil {!isNil "fez_reinffncs_init"; sleep 1;};

#

there are 3 scripts, at the end of which i set a public variable to true. before that the variable does not exist

plush oriole
#

remove the quotes

still forum
#

You are not returning anything from waitUntil

#

"remove the quotes" no, don't do that.

plush oriole
#

oh am i misunderstanding isNil

still forum
#

yes

plush oriole
#

ok

#

ah that makes sense that it's that way

still forum
#

waitUntil needs to return a bool.
"Sleep 1" doesn't return a bool.

proven crystal
#

oh i got to put the sleep before the statement?

still forum
#

ye

proven crystal
#

thanks

jaunty ermine
#

I remember seeing a while back something that inserted a diary entry to all mission files for things like server rules/standards. Does anyone have any extra info on this or know about it? I know it requires file patching enabled but thats about it

plush oriole
#

as in you have multiple different missions running on a server but add the entry to all of them?

jaunty ermine
#

yeah, inserting a diary entry into the mission on init/pre-init. I remember seeing it on a BI forum a few months back but cant find it again

plush oriole
#

so the first thing that occurs to me is a server global init script

#

rather than for diary entries specifically

still forum
#

just a serverside mod, with preInit that remoteExec's with JIP flag a script that creates diary entry

plush oriole
#

yeah that makes sense

jaunty ermine
#

tyvm ❤

winter rose
#

@tough abyss change this to unit attachments
I did split like this in order to show that not only "equipment objects" but also clothing pieces were impacting

manic bane
#

Is there any way to make multi listbox item like toggle button(make it selected when click. make it unselected when click already selected item)?
Currently I cannot unselect list item with click but Ctrl + click is working.

plush oriole
#

like multiple radio buttons?

#

i.e. none, some or all can be selected?

#

*checkbox

vernal mural
#

hey, quick question, I'm on the way of fixing my problem, but does anyone know what is <null> in an array ?

plush oriole
#

well it's null

#

which is a type which is distinct from false

manic bane
#

@plush oriole Thanks. I will check

plush oriole
#

there's also nil but that means undefined, whereas null is actually a type returned

#

i.e. a function to find an object might return null if no object is found

vernal mural
#

I think in 5 years I never encountered such a thing. I'm used to objNull, grpNull and all other null things, but I think I never seen this one

#

I know nil also

plush oriole
#

i think <null> is the representation when it's formatted

#

i.e. i assume that hinting a null object will show it as <null>

manic bane
#

I think checkbox isn't for me. I need LIST with toggle capability.

vernal mural
#

usually I know exactly what data type I'm working on, but I'm know designing a function which is able to handle different data types, and it looks like it does not know how to handle one of the tries

tough abyss
#

i.e. i assume that hinting a null object will show it as <null>
you assume wrong

#

@vernal mural <null> is nil, same as any ```sqf
parsesimplearray "[something]"

vernal mural
#

Really ? I think I'm starting to understand why my code doesn't work in some specific cases

tough abyss
#

because you rely on string representation of nil?

vernal mural
#

I rely on a string returned depending on the input. But I was not expecting this function to start outputing this <null> duda

plush oriole
#

nil is worse than a type

#

because you can't interact with it

vernal mural
#

It works this way :
OBJECT ==> myFunction ==> modified DisplayName
STRING ==> myFunction ==> modified DisplayName of the corresponding type

plush oriole
#

stuff like isNil requires a string parameter

vernal mural
#

but it looks like if I input :
objNull ==> myFunction ==> <null>

#

this output is then compared with other strings, but comparing strings with <null> seems to fail silently

#

all that is wrap in a ACE action's condition, which is still displayed even if it's condition silently fail to be processed from time to time. But in such a case, the statement block is not processed at all

plush oriole
#

as in isEqualTo?

tough abyss
#

you should check if the result is nil if there is a chance it could be nil

vernal mural
#

!(bla isEqualTo bla) or (bla != bla), same result here

plush oriole
#

they are different though

#

isEqualTo is type strict for example

vernal mural
#

@tough abyss yeah, I just figured it out, thanks to you

plush oriole
#

and can compare different types without an error

vernal mural
#

yeah I know but here the result is the same, it just fails

plush oriole
#

ye

vernal mural
#

ending myFunction with [(_entry splitString " ") select 0, ""] select (isNil "_entry") should do the trick

plush oriole
#

probably nicer to format as sqf if (isNil "_entry") then {""} else {(_entry splitString " ") select 0}

still forum
#

Nope

#

that is syntax error and probably slower

tough abyss
#

no syntax error but it can return nil

still forum
#

Yes syntax error

tough abyss
#

Ah sorry Im ignoring @plush oriole was talking about @vernal mural 's code

still forum
#

How can that return nil?

tough abyss
#

empty string

still forum
#

Ah the splitString can fail and return empty array

vernal mural
#

I really like being able to use select for two-alternatives choices like this. Is that performance friendly ?

still forum
#

as with everything, it depends

tough abyss
#

use param

still forum
#

yes it's faster, but it evaluates both values always

tough abyss
#

array param [0, ""]

#

so if array is empty you get your ""

plush oriole
#

where's the syntax error?

#

oh a misspelling

#

yes

vernal mural
#

First I get it to work, next I optimize ^^ for now I have a few mistakes to fix before getting all this cleaner and faster

#

Yep ! All clear, working perfectly !

#

Me being like

#

Except I'm french.

#

Thanks everyone for all advices !

winter rose
vernal mural
#

is there a way to make custom textures behave properly ? Usually when a flag or a sign is set with a custom texture, it appears black until the player get close enough

winter rose
#

@vernal mural jpg or paa?

vernal mural
#

jpg need horribly close player to display. paa is better but still, it does not always load quick enough not to notify it

#

or maybe it's just at mission start...

winter rose
#

once loaded, what if you leave and come back?

calm bloom
#

By the way guys, about that non-senscetive question about the vehicle cargo detection - i was trying to find the way of determining if an object has an "inventory" action - ability to store any items inside. So far ive found that fastest:

private _vwitemcargo = weaponsItemsCargo _x;
                    
                    if (!isnil '_vwitemcargo') then {
plush oriole
#

surely

if (!isNil 'weaponsItemsCargo _x') then {```
#

or am i missing something

still forum
#

yes you are not reading the wiki

#

"source" stringReplace [needle, replaceWith]
and
"source" stringReplace [[needle1, needle2, ...], [replace1, replace2, ...]]

Thoughts?

plain current
#

Is there something similar to backpackContainer but for weapons, to get the weapon object or that specific objects netId?

calm bloom
#

i dont think weapon is the object

#

i think it is the 'WeaponHolderSimulated'

#

in case it is on the ground

plain current
#

But why are backpacks/vests/uniforms objects?

still forum
#

no

#

because they are containers

plain current
#

nvm just saw that on the wiki

still forum
#

they are vehicles, just like ammoboxes

#

actually you can't see the backpack container

#

what you see is a inaccessible proxy that's linked to the container bla bla bla magic bla bla

plain current
#

mmm, what'd be the best way to check if a weapon gets duped (2 ppl get it out of a container at the same time)? It's easy to just check if there are two people with the same backpack...

still forum
#

serverside check

#

container has 3 weapons, two people take one out and now have a weapon from the container, but the container still has 2 weapons inside it.

plush oriole
#

@still forum and presumably

if (!isNil {weaponsItemsCargo _x}) then {``` won't work
still forum
#

it would

plush oriole
#

since the alternate syntax can't deal with undefined since it evalutes the expressio

still forum
#

but weaponsItemsCargo only returns nil if _x is nil

plush oriole
#

n

#

oh

still forum
#

"since the alternate syntax can't deal with undefined since it evalutes the expressio" what?
What has evaluating a expression to do with dealing with undefined?

#

isNil checks if piece of code returns nil

plush oriole
#

so what's the undefined value

#

somewhere I read that something like nil is synonymous with a non-existant variable

#

i.e. you remove a variable by assigning it to nil

#

and evaluating expression = executing code and dealing with result

vernal mural
#

is there a neat way to check if given number is in given range ?

plush oriole
#

other than x>lower && x<upper?

vernal mural
#

yeah

plush oriole
#

that seems pretty simple and it's the most common idiom i've seen

#

all i can think of is some other convoluted solution involving max and min

#

actually

#

nah it's more convoluted

#

someone else might have a suggestion

still forum
#

nil is a value, that says "there was nothing here"

plush oriole
#

what

#

oh

#

is null undefined then

still forum
#

if you pass nil to a command, it won't execute the command but instead just make the command return nil too, because there is no command that could sensibly do anything with nil

plush oriole
#

as in nil is a value with a type, and null is the absence of anything

still forum
#

no and no

plush oriole
#

ok

#

so?

#

so nil isn't a value

still forum
#

Nil is a value

#

Nil has a type

plush oriole
#

so it is a value

#

with a type

#

so yes and no

#

or

still forum
#

for example if you get <bool> it's a nil, of type bool

plush oriole
#

ahh

#

ok

still forum
#

as I said above, script commands that you give a nil to, don't execute but return nil, but they return a typed nil

#

of the type that the command is supposed to return

plush oriole
#

seems like that wouldn't always be desirable

#

althoguh i guess if you use an array of arguments you can show no arguments with an empty array

still forum
#

Then there's also null (objNull, ctrlNull) which is a different category

plush oriole
#

yea

still forum
#

the null's are the actual types, just with null value.

For example objNull is of type object, but it doesn't point to any object.
There are only null types for things that point to something, control, object, group, scripthandle and so on.

runic edge
#

Hello guys, i'm looking to create a crate with unlimited capacity : is there a command line to do so ?
thanks in advance !

plush oriole
#

set the crate's storage mode to 'virtual'

#

also what do you mean 'command line', as in script?

runic edge
#

no just a crate with unlimited cargo capacity, and yes i mean with a script (I don't know if its possible)

plush oriole
#

oh i see

#

so unlimited space

#

rather than unlimited supply of objects

#

hmm

#

i think you'd need an addon because it's a config change

#

or else a slightly more complex scripted solution where you put items in as more space is available

calm bloom
#

[19:01] Dedmen: but weaponsItemsCargo only returns nil if _x is nil

that command returns nothing if there is no inventory (tested on random static object though)

still forum
#

nothing aka nil or empty array?

#

commands that return array, should always return empty array 🤦

calm bloom
#

not empty array

still forum
#

consistency!

calm bloom
dull drum
#

Hi guys! Are there any commands or function that provide access to the wounded state of a unit? I want to lower wounding effects.

plush oriole
#

well getDamage is the obvious choice to get if the unit is at all injured

#

and you can check animations to see if a wounded animation is playing

#

what do you mean lower wounding effects

dull drum
#

Don't put a man on both broken legs when he is really hurt

plush oriole
#

hmm?

proven crystal
#

how do i get drones to attack known enemies?

#

they are just flying circles...

plush oriole
#

which drones

astral dawn
#

and to whom are the enemies known... you must reveal the enemy to drone's crew I think

dull drum
#

@plush oriole player is slowed down and clumsy when wounded

#

I want to diminish that

plush oriole
#

hmm

#

haven't found anything

crude needle
#

@dull drum Look at setHitPointDamage and setHit on the wiki.

edgy dune
#

is there a script way to change values of a rvmat?

#

or do I have to go and make my own rvmat and load it in

still forum
#

own rvmat

edgy dune
#

rip okay thx

dull drum
#

@crude needle I can lower damage itself by it, but it can't set something like "stop acting like a drunk chameleon when wounded". It's somewhere else.

#

On the second thought I can prevent damage to get to the wounded state. Hmm.

plush oriole
#

store a seperate health counter?

#

keep player's health at 100%

#

then when your own health counter gets to 0, kill them

#

although theywouldn't be able to heal themselves

crude needle
#

I don't know what specifically your use case is, but you may also want to use the hitPart eventhandler.

dull drum
#

I like the way of your thought, my lord @plush oriole

swift badge
#

Hey guys, I have a script which part of is supposed to deduct side score via addScoreSide, and it works fine on my listen server. However, the addScoreSide part does not work on a dedicated server. I've tried encasing it in "if (isServer)" or "if (isDedicated)" checks, but neither work. I'm trying to make it run serverside. What am I doing wrong? Thanks.

dull drum
#

Server execution only. From where do you run it?

swift badge
#

A .sqf I made in the main directory of the mission.

dull drum
#

Try initServer.sqf

#

It runs specifically on server

plush oriole
#

where areyou calling the sqf from

swift badge
#

I create a new comm menu option in description.ext, which opens a submenu defined in its own .sqf. The options you can pick in that submenu run "execVM" on other .sqfs I have made in the same directory. With that said, I'm not sure how I would adapt this to putting my scripts in initServer.sqf, since right now I just call the .sqf I want to run when an option is picked in the menu.

plush oriole
#

well when the option is picked, that happens locally

#

only on the client who opens the menu and clicks

#

you need to use remoteExec to tell the server to run it

swift badge
#

Oh, I see, thanks! I'll see if that works. EDIT: It worked, thank you so much!

spice axle
#

how was the waitUntil isNull display thing for the map at mission start? So I can waitUntil the player can move around? I don't care if the loading screen is still up, you can have to click ok to close the window

dull drum
#

If can move around sounds like a findDisplay 46 to me

#

waitUntil (!isNil findDisplay 46)

spice axle
#

of course i'm dumb. I tested exactly this but forgot the !

dull drum
#

Probably just tired. It's 2 am europe time :)

spice axle
#

1 am for me

dull drum
#

Still late enough

random crescent
#
  1. That's wrong and an error. You'd want isNull.
  2. It's entirely unnecessary. Just use postInit, or for missions without CfgFunctions, initPlayerLocal.
spice axle
#

I used isNull^^

i used initPlayerLocal (but i got a CfgFunctions)

i want to open the aan article thing from the laws of war DLC at the beginning after the map at mission start @random crescent

tough abyss
#

@calm bloom this has been fixed on dev for awhile now, no need to panic

meager granite
#

Anybody gets spam of Wrong text element 'null' and Overflow in their client RPTs?

#

Trying to figure out if this is caused by something in my mission or general arma spam.

calm bloom
#

@tough abyss thats bad, because i was using that behaviour(

plain urchin
#

hey guys, i'm trying to create my own form of the "limited arsenal" script made by Jeroen in the Antistasi missions. instead of an arsenal, i'm using a dialog. i'm having a few problems, could anyone take a couple mins to help me out?

plain current
#

@plain urchin what problems u having?

manic bane
#

How can I have camera like Virtual Arsenal when I open my GUI?

meager granite
#

You have to script it. Look at arsenal script and see how it works.

manic bane
#

Okay thx!

outer scarab
#

I'm trying to work out the best way to transfer loadouts of specific players between missions (The mission is manually edited after each session). Right now the most achievable method I can think of is to do it all manually - getting screenshots of everyone's inventory at the end of each session, replicating it in arsenal and exporting it to a loadout, putting that in the init of units named after the players. But that's far from ideal.
I know the loadouts can be exported with BIS_fnc_exportInventory, but I don't understand where the exported data would go - it'd need to be visible without direct access to the server its self.

Ideally, the mission would save players' loadouts and load them back in based on playerID so it's all automated.
I don't have a great idea as to where to start, so please DM me if you can help.

digital hollow
#

diag_log and getUnitLoadout will get it into RPT, then you can just go copy it into a startup script for the next mission.

outer scarab
#

Is the RPT server-side or will it go into those of every client?

digital hollow
#

Can be either depending on where you run the command.

outer scarab
#

Alright, that should work. Thanks

ivory lake
#

you can save it to profileNameSpace if its just one server for one mission

#

either to the client or the server

compact maple
#

Hello, should I use global var or setVariable on player ?

still forum
#

depends on what you need

compact maple
#

Well, I need to access vehicle or cams

#

in some scripts

still forum
#

global is probably good for your case?

compact maple
#

Ok thanks. There is no big diff between global and setVar so ?

still forum
#

sure diff

#

one is on the player, the other is global

#

but I don't understand why you want to take the extra effort

compact maple
#

just curious

frank flame
#

im very very (very) new to this scripting thing and was just wondering if this would work:

#

HQ_MAP addAction [Escape, player SetPos [getMarkerPos [selectRandom [Spawn1,Spawn2,Spawn3,Spawn4,Spawn5,Spawn6,Spawn7,Spawn8,Spawn9]]]]

#

if not how would i make this work?

plain urchin
#

needs to be in this format:

#

HQ_MAP addAction [title (String), { (your code) }];

#

so in your case, it would be

#

HQ_MAP addAction ["Escape", { (_this select 1) setPos (getMarkerPos (selectRandom ["Spawn1","Spawn2","Spawn3","Spawn4","Spawn5","Spawn6","Spawn7","Spawn8","Spawn9"])) } ];

#

oops

#

something like that

digital hollow
#

Marker names need to be strings too.

plain urchin
#

oh, i forgot they were markers

#

that's true

#

@frank flame like that ^

digital hollow
plain urchin
#
  • agreed
frank flame
#

ty

winter orchid
#

Trying to add a script to a unit so that it has it enabled whenever it spawns. How do I do this? I know how to add it to a unit in editor but I need the unit to spawn with it made added already.

plain urchin
#

@winter orchid dm me

peak plover
#

@winter orchid cbq extended event handler

#

Cba not cbq

winter orchid
#

@peak plover Would that be done in the unit's config or in the config that spawns the unit?

peak plover
#

Just in script

#

Cba adds a script to every unit cfg, that runs cba init eh

#

Ityou can add code to the init eg with a script

#

So you can have mission specific code that runs when the unit is created

#

Just google cba a3 extended eventhandler

#

Tge documents have an example for init

winter orchid
#

Alright sweet, thank you. I'll check it out.

outer fjord
#

Is there a function that basically makes a vehicle undetectable to active radar or other sensors?

golden epoch
#

Is the .ogv file format the only format you can play video in a mission

#

Making a mission currently where at the start of the mission I want a small intro video to play

#

However with a 720p, low bitrate video going for 40 seconds its 14mbs :/

#

Wondering if I can use .avi or something

young current
#

Nope. Ovg is the one. Now you must decide if its worth the disk space.

golden epoch
#

Dang, figured as much. Its more Im worried 50 players downloading the mission file from the server at once will tank it hahaha

young current
#

possibly

#

it is not optimal to include a lot of textures and stuff like that in a mission

#

such should be added via an addon

still forum
#

I have a mission with a intro/outro movie, we just put it into a seperate pbo in our mods

#

couple hundred MB no issue

peak plover
#

😮

#

That's big

still forum
#

That's probably not what she said

#

remember that arma mission download is quite slow

#

atleast in my missions a couple hundred KB take several seconds

#

I play a different mission every week

peak plover
#

privileged

plain urchin
#

hey guys, i'm trying to get the containers of a crate which i know how to do, but i also need all of the contents of each of the containers (weapons, backpacks, uniforms, vests , etc). is there an easy way to do this or do i just have to use everyContainer and go through everything like that?

#

the end result would be to loop through an array with all the classnames and amounts of the stuff stored in the crate , so I can save the crate’s inventory

still forum
#

use everyContainer to go through everything