#arma3_scripting

1 messages · Page 435 of 1

still forum
#

the index is the same?

torn juniper
#

yes

still forum
#

That is something completly different than what you just told me

#

Think about it. Why do you re-add the EH after respawn?

torn juniper
#

because its a new unit/new player

still forum
#

And it has no EH's because it's a new unit.

torn juniper
#

so it makes sense but maybe I got mislead by this Some event handlers are persistent (i.e. they stay attached to a unit, even after it dies and respawns). Arguments of this scripting command have to be local to the client the command is executed on "Killed" and "Hit" eventhandlers are executed where given unit is local. on wiki thinking it would keep adding my same EH to the respawned unit

still forum
#

So what EH ID do you expect to get after you add the first EH?

#

If you add the first EH you will always get the first EH ID

torn juniper
#

right, I understand that part

still forum
#

It's not "ignoring duplicates" There are no duplicates.

torn juniper
#

I guess I was just getting messed up with that line I was reading on the wiki - thinking that it would persist over respawns

still forum
#

some EH's persist yeah

#

not all

#

that's why it says some

#

It should probably say which exactly

torn juniper
#

so that was the source of my confusion 😛 I'll try it with a respawn module and see if I need to work with my code

#

thanks

wispy lynx
#

anyone know of way to check if a spawned unit has a weapon with grenade launcher (GL)?

still forum
#

Would it be enough to check if the unit has loaded a grenade in his launcher?

wispy lynx
#

I started down that road, but two things seem to be blockers: The GL ammo is randomly assigned, so would need to determine every type of GL capable ammo (HE, flares, smokes) that might be loaded, and because I'm trying to figure out if the primary weapon is GL capable while still in the spawning process, the unit hasn't loaded the GL ammo yet, so when I tried checking, it returns no ammo and assigns launcher as well.

#

I tried loading only an HE round first, but thats when I ran into the "hasn't loaded yet" issue.

knotty mantle
#

vanilla or rather big modset?

wispy lynx
#

@knotty mantle ?

still forum
#

you can check if the weapons config has a second muzzle

#

But I hoped there might be a easier way that might also work for you

knotty mantle
#

Well if you just use vanilla the you could check for an "GL" in the weapons classname. But if you use a big modset that isnt feasable as you have no way of knowing what those mods do with their classnames

wispy lynx
#

@still forum That's what I've been trying to find on the BI forums, but haven't been successful, do you know where I can find that capability?

still forum
#

As I said... by reading the weapons config

#

But not sure what that entry is called

wispy lynx
#

@knotty mantle Yes, right now, trying for just vanilla, but would like to open it up for other mods in future.

knotty mantle
#

Yeah i noticed it worked fine for vanilla with "GL" but BWMod for example uses "AG" in their classnames. So my way is really only a last straw option imo. Oh and i used that pre-Apex although i think they are still using the same naming pattern for new stuff

wispy lynx
#

@still forum I've looked in the weapon configs, for each one, but seems that there are at least two different GL names just in the vanilla weaps, and they don't seem to be assigned as second muzzle, but a sub weapon?

#

@knotty mantle Yes, I looked at the RHS weaps, and they have 3-4 different names for different GL's. Was really hoping to find a way like what Dedmen was saying about searching for a second muzzle type, as that would also help finding the Type 115 shotgun as well (a latter problem I'm going to have to tackle once I figure out this GL issue).

#

@still forum Do you know of a way to check if a weapon has a second muzzle? Not what type the second muzzle is or what it's named, just that the weapon has a second muzzle?

still forum
#

no

#

I would need to look at a config

#

don't have that right now tho

wispy lynx
#

@still forum Here's what's listed for vanilla weapons in the CfgWeapons:

all arifle_XXX_GL_F variants = muzzles[] = {"this","EGLM"};

except the MX variants

arifle_MX_GL_F = muzzles[] = {"this","GL_3GL_F"};

still forum
#

If there is more than one muzzle you can guess that it's a GL

#

but no guarantee that it actually says GL

wispy lynx
astral tendon
#

player allowdamage false
How do i remoteexec that?

still forum
#

just like you remoteExec any other command with two arguments

#

Like it's shown on the remoteExec wiki page

astral tendon
#

[player,false] remoteExec ["allowdamage", 0];
By following the exemple i dont really get it

still forum
#

what don't you get?

#

And yeah... I guess I know what you mean

#

you want to disable everyones damage?

#

With that you disable the players damage

astral tendon
#

i though that command would be executed to all machines

still forum
#

It will

#

And it will disable the players damage on all machines

#

But only the one player

astral tendon
#

oh i see my mistake

#

i was pressing the local exec button on the console

#

on the global works

still forum
#

Uh...

#

Yeah...

#

As I just said

#

you only disable damage of the player you execute that

#

because you pass the value in player and don't tell everyone to execute player by themselves

#

Easiest way is to just remoteExec spawn or call
and just pass the player allowDamage false code along

meager heart
still forum
#

No he can't

#

we already talked about that

#

in fact that was my thought on my first message to him

#

and he explained why it doesn't work

edgy dune
still forum
#

No difference if you store them in variables and call them

edgy dune
#

is it call the file or the variable?

still forum
#

you can't call a file

edgy dune
#

oofff im stupid

ornate pawn
#

Hey guys. i'm working on a powerpoint for my arma 3 base

#

does setObjectTextureGlobal works in MP? cause last time i tried other people couldn't see the image changing

still forum
#

GLOBAL

#

yes.

edgy dune
#

how would you go about calling a function from another function

ornate pawn
#

Thanks i will update the script and test it again with someone in MP

astral tendon
#

[player,false] remoteExec ["allowdamage", 0];
Soo that being called by initServer.sqf just does not work, why?

ornate pawn
#

so i have a laptop in the command center of my military base which controls the powerpoint i'm working on. that laptop has an addAction that allows me to show one image in 3 different monitors plus the laptops screen. how can i use the same addAction for next image but everything you activate the addAction you get the next image instead of the same image?

#

everytime*

#

this my addAction script:

#

[
  schoolLaptop,
  "Start Presentation",
  "images\take_ca.paa",
  "images\take_ca.paa",
  "_target distance schoolLaptop < 2",
  "_target distance schoolLaptop < 2",
  {},
  {},
  {
  PowerPointScreen_1 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_1_ca.paa"];
PowerPointScreen_2 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_1_ca.paa"];
PowerPointScreen_3 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_1_ca.paa"];
schoolLaptop       setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\laptop\laptop_desktop_1_ca.paa"];
sleep 6;
PowerPointScreen_1 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_2_ca.paa"];
PowerPointScreen_2 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_2_ca.paa"];
PowerPointScreen_3 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_2_ca.paa"];
schoolLaptop       setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\laptop\laptop_desktop_2_ca.paa"];
sleep 0.1;
PowerPointScreen_1 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_3_ca.paa"];
PowerPointScreen_2 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_3_ca.paa"];
PowerPointScreen_3 setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\desktop_3_ca.paa"];
schoolLaptop       setObjectTexture [0, "scripts\BEW\PowerPoint\images\bg\laptop\laptop_desktop_3_ca.paa"];
sleep 0.1;

  },
  {},
  [],
  0.5,
  1000,
  false,
  false
] call BIS_fnc_holdActionAdd;

still forum
#

@edgy dune Exactly like calling any function anywhere.

#

@astral tendon Because the server has no player.

astral tendon
#

well it does, me and... me

still forum
#

If you host yourself then you are the server

#

dedicated server doesn't have a player

#

You anyway won't understand why that doesn't work if I'd try to explain that to you. Which I already did

#

I also already told you what you should use and what would work like you expect it to

astral tendon
#

spawn also did not worked

meager heart
#

😀

still forum
#

What did you execute exactly?

#

Spawn works 100% unless you have CfgRemoteExec white/blacklist

astral tendon
#

[] spawn {player allowDamage false}

still forum
#

🤦

meager heart
#

GGWP

still forum
#

Let's quote myself Easiest way is to just remoteExec spawn or call and just pass the player allowDamage false code along
Read that again.

#

No! Read it another time. And another. And to be safe atleast 5 times.

ornate pawn
#

anyone?

still forum
#

@ornate pawn setVariable on the object of what screen you are on

#

then read it and depending on that choose next

ornate pawn
#

I have an Addaction on the laptop "start presentation"

#

so i need that action to activate another addaction which is "Next" and everytime i select next a new image will show

still forum
#

Uhm...

#

Yes...

#

Doesn't change anything about what I just said ^^

ornate pawn
#

setVariable on the object of what screen you are on? i don't understand

#

you mean the laptop?

still forum
#

yes

#

set a indicator so you know what screen is currently active

#

when the Next action is used read that variable. And based on that decide what should be shown next

ornate pawn
#

all screens are active

astral tendon
#

urg, nevermind that, i dont think i can work around stuff too complicated.

ornate pawn
#

monitor_1, monitor_2 and 3

#

the addAction is only in the laptop

still forum
#

@astral tendon Exactly that's why I told you the easy way

#

I still don't get how that changes anything.

#

Your problem is that you don't know what screen should be switched to next?

#

Store it in a variable and just read it. Then based on that switch the screen. Set the variable to a new value which will be read again next time the screen is switched

ornate pawn
#

Start presentation > Next Image > image 1 > Next Image > image 2 and so on

still forum
#

Yes..

#

Exactly that is what I'm telling you

#

you don't need to keep repeating yourself ^^

ornate pawn
#

no dude

#

i don't need to switch to another screen

#

i need to switch image not screen

#

in the same screen

still forum
#

Which is exactly what I'm telling you

ornate pawn
#

haha

still forum
#

switch the image on the screen

#

switch the screen

#

switch what the screen shows

#

just make a if statement
if variable == "image1" then showImage2 and set variable to "image2"
if variable == "image2" then showImage3 and set variable to "image3"
if variable == "image3" then showImage1 and set variable to "image1"
There. You now rotate between 3 images everytime you use the action

edgy dune
#

ah cool thx dedmen

ornate pawn
#

okay i will mess around with it and see if i can put it together

#

lol

meager heart
#

also setObjectTextureGlobal maybe, BullsEyE|WORKS 😀

ornate pawn
#

yeah i will thank you

#

thanks Dedmen for the help. i'm still figuring out hahah

ornate pawn
#

if variable == "image1" ? inside the " " goes the setObjectTextureGlobal line?

still forum
#

Uh....

#

wtf

#

no

#

You should learn the basics of scripting before attempting this

ornate pawn
#

I've made a towing system asking questions which works 100%

#

could you make one sample using my code please?

#

[
  schoolLaptop,
  "Start Presentation",
  "images\take_ca.paa",
  "images\take_ca.paa",
  "_target distance schoolLaptop < 2",
  "_target distance schoolLaptop < 2",
  {},
  {},
  {
    PowerPointScreen_1 setObjectTextureGlobal [0, "scripts\BEW\PowerPoint\images\bg\desktop_1_ca.paa"];
    PowerPointScreen_2 setObjectTextureGlobal [0, "scripts\BEW\PowerPoint\images\bg\desktop_1_ca.paa"];
    PowerPointScreen_3 setObjectTextureGlobal [0, "scripts\BEW\PowerPoint\images\bg\desktop_1_ca.paa"];
    schoolLaptop       setObjectTextureGlobal [0, "scripts\BEW\PowerPoint\images\bg\laptop\laptop_desktop_1_ca.paa"];
        sleep 6;
    
    PowerPointScreen_1 setObjectTextureGlobal [0, "scripts\BEW\PowerPoint\images\bg\desktop_2_ca.paa"];
    PowerPointScreen_2 setObjectTextureGlobal [0, "scripts\BEW\PowerPoint\images\bg\desktop_2_ca.paa"];
    PowerPointScreen_3 setObjectTextureGlobal [0, "scripts\BEW\PowerPoint\images\bg\desktop_2_ca.paa"];
    schoolLaptop       setObjectTextureGlobal [0, "scripts\BEW\PowerPoint\images\bg\laptop\laptop_desktop_2_ca.paa"];
     sleep 0.1;
    
    PowerPointScreen_1 setObjectTextureGlobal [0, "scripts\BEW\PowerPoint\images\bg\desktop_3_ca.paa"];
    PowerPointScreen_2 setObjectTextureGlobal [0, "scripts\BEW\PowerPoint\images\bg\desktop_3_ca.paa"];
    PowerPointScreen_3 setObjectTextureGlobal [0, "scripts\BEW\PowerPoint\images\bg\desktop_3_ca.paa"];
    schoolLaptop       setObjectTextureGlobal [0, "scripts\BEW\PowerPoint\images\bg\laptop\laptop_desktop_3_ca.paa"];
        sleep 0.1;

  },
  {},
  [],
  0.5,
  1000,
  false,
  false
] call BIS_fnc_holdActionAdd;

still forum
#

half of your code is irrelevant

#
if (_object getVariable ["currentImage",0] == 0) then {
setObjectTexture blaa;
_object setVariable ["currentImage",1];
}
#

No I won't copy past all that irrelevant stuff over and over again and spam the channel with it like you do

ornate pawn
#

okay thank you

river meteor
#

Looking for some help in solving a bug. Attempting to Override the default action menu with a custom menu. Everything is working as intended except that _selection variable isn't being updated correctly when called by the mouse wheel scrolling nor is the color being changed in selectInteraction when called using mouse scroll wheel. Relevant lines are 32 and below. https://pastebin.com/fWGKKGFe

lusty canyon
#

will this code be able to add the object to the EDIT list (left side column) to all zeus players?


    _obj = cursortarget;
    private _script = {
        params ["_obj"];
        { _x addCuratorEditableObjects [ [_obj] ,false] } foreach allCurators;            
    };
    [ [_obj], _script ] remoteExec ["BIS_fnc_call", 2];
wispy lynx
#

@sldt1ck#9436 Thanks, I'll give it a try.

cloud thunder
#

@river meteor A couple of things I can spot by looking at that code.
EventHandlers have their own scope so _selection is undefined within the scope of the EventHandler.
InGameUISetEventHandler is not stackable so the last one overrides any previous ones.

river meteor
#

Do you know if making the variables global i.e. with the _ would fix the scope issue? @cloud thunder

cloud thunder
#

yes it could

lusty canyon
#

is there a way to make any weapon/ammo able to lock onto any object with FCS auto prediction? (sqf only not cfg)

winter rose
#

^ I think not, as this is really a cfg value.
you could ugly-script something to fly towards cursorObject, but I wouldn't call that locking

obsidian chasm
#

Is there an 'easy' way to make my spawned units disappear after the player moves x amount of meters away? I've tried quite a things already but the AI just stays where they are.

little eagle
#

It's about 5 lines of script:

_unit spawn {
    params ["_unit"];

    waitUntil {player distance _unit > 1000};
    deleteVehicle _unit;
};
obsidian chasm
#

I have tried a few of those but none of them seem to work

#

would I have to put this for every individual soldier or just underneath them or something

lusty canyon
#

strange all my player add EHs work on init, EXCEPT the damage ones i need to place them inside the respawn EH just to make them work????? (wont this mean the damage EH will be stacking every single respawn? or are they cleared?)

obsidian chasm
#

GWfroggyPepoThink anybody else know what to do with commys lines?

lusty canyon
#

@obsidian chasm did u pass in the right args in the right scope? did u actually go 1000m away?

obsidian chasm
#

well i dont know where to put it to begin with..

#

sorry :\

lusty canyon
#

are your units already placed? where are u editor? debug console?

obsidian chasm
#

they work via trigger

#

i posted a pastebin with the squad

#

and just in regular editor..

lusty canyon
#

with the script u pastebin'd add this on line 33 (commys script plus a foreach)

{
_x spawn {
    params ["_unit"];

    waitUntil {player distance _unit > 1000};
    deleteVehicle _unit;
};
} foreach units _newGrp;
#

if you dont want them to be deleted entirely u can do a hideobjectglobal true them and do another waituntil they are inside desired proximity hideobjectglobal false;

obsidian chasm
#

i dont mind them deleting, it's just so I can add a few more US and there wont be loads of AI aimlessly walking around when I'm done with them

#

also thanks a lot, one more thing i never have to learn again

little eagle
#

wont this mean the damage EH will be stacking every single respawn?
Yes. Eventhandlers carry over to respawned persons. If you add them every respawn they will pile up.

or are they cleared?
No.

lusty canyon
#

thats the thing tho daddy commy, my damageEHs seem to only trigger after respawn.. (the init EH ones like getIn getOut killed , etc work 100%) , do you think the mission can be interfering with them?

little eagle
#

You mean "Dammaged" eventhandler?

lusty canyon
#

yeah damaged, handlescore, handlerating

#

those ones only work inside the respawn EH

little eagle
#

Maybe some other script removes them again.

lusty canyon
#

how do they know my EH id, im creating em on the fly

little eagle
#

They don't. They could be shitty scripts that use removeAllEventHandlers.

lusty canyon
#

ouch any way around those? like is there an EH for it lol

little eagle
#

Remove the broken mod or mission.

lusty canyon
#

@little eagle can you make me a

player addEventHandler ["AllEventHandlersRemoved", {
_modCulprit = _this select 9;
}];
👌

#

in CBA

#

XEH

little eagle
#

I probably could if I worked at BI.

lusty canyon
#

can intercept make new EHs?

little eagle
#
["CAManBase", "Dammaged", {
    params ["_unit"];
    if (_unit != player) exitWith {};

    systemChat str _this;
}] call CBA_fnc_addClassEventHandler;

This one cannot be removed.

#

fixed typo, damn muscle memory

#

ffs

lusty canyon
#

where do i put the damage handling?
my vanilla EH


        player addEventHandler ["HandleDamage", {
            _returnDamage = (_this select 2);
            if ( _returnDamage > 1 ) then {
                _returnDamage = _returnDamage / 4;
            };
            _returnDamage;
        }];
#

@little eagle something like this?

[player, "Dammaged", {
    params ["_unit"];
    if (_unit != player) exitWith {};
    
    if ( _this > 1 ) then {
    _this = _this / 2;
    };
    _this;
            
    systemChat str _this;
}] call CBA_fnc_addClassEventHandler;

do i need any #includes with cba ?

little eagle
#

I have no idea what you're trying to do with this. cut the damage in half? That won't work with Dammaged.

#

do i need any #includes with cba ?
No.

lusty canyon
#

yeah trying to cut in half

#

why wont it work?

little eagle
#

No, this is wrong on about every level of it.

#

Dammaged ignores it's return value, only HandleDamage uses it to overwrite the units damage.

#

The CBA class eventhandlers are config based. The config based HandleDamage eventhandler ignores it's return value. You have to use the scripted eventhandler for this.

#

Your code wouldn't cut the received damage in half. It would cut the total damage in half. Essentially capping the units damage at 0.5 making them invulnerable.

#

Unless they are overkilled twice with one shot e.g. headshot should still work (damage ~4).

#

The return value is the last value in a script, but you put systemChat there overwriting the return value with nil, the return value of systemChat..

lusty canyon
#

oh ok sorry never used cba fncs before

little eagle
#

Just to understand this fully. You put player addEventHandler ["HandleDamage", {...}]; into init.sqf and it works fine unless the unit is damaged already by the mission?

lusty canyon
#

all the other EHs not relating to damage/score/rating are working fine in init, but the damage/score/rating ones only work when placed in the respawn EH or manually in debug console localexec

little eagle
#

What do you mean by "init".

lusty canyon
#

init.sqf

little eagle
#

Well, HandleScore only works on the server and player is null on a dedicated server, so that one will not work anyway.

#

I have a theory on HandleDamage not working, but HandleRating not working would mean a different script removes it or it's something else unkown to me.

lusty canyon
#

i have these inside init.sqf

    
    // HALF ENEMY DAMAGE
    player addEventHandler ["HandleDamage", {
        _returnDamage = (_this select 2);
        if ( _returnDamage > 1 ) then {
            _returnDamage = _returnDamage / 2;
        };
        _returnDamage;
    }];
    // NO PLAYER AUTO RENEGADE ON FF
    player addEventHandler ["HandleRating", { (_this select 1) max 0; }];
    player addEventHandler ["HandleScore", { (_this select 1) max 0; }];
    // NO FALL DAMAGE
    player addEventHandler ["HandleDamage", { 
        _unit = _this select 0;
        _damage = _this select 2;
        _source = _this select 4;     
        if ( (_source == "") ) then {0} else {_damage};
    }];
#

these arnt being applied, only when i duplicate them into respawnEH then they work

#

i also duplicate into remoteExec, 2

little eagle
#

Your first handle damage thing would heal the player if he has damage over 0.5 already.

lusty canyon
#
[player, _addPlayerEHtoServer] remoteExec ["BIS_fnc_call", 2];
little eagle
#

HandleScore doesn't work a clients machine, so this is broken regardless.

lusty canyon
#

handle rating also server only?

little eagle
#

No, HandleScore is.

#

You also added two HandleDamage, The second one would overwrite the first one, so the first one does absolutely nothing.

lusty canyon
#

i thought it stacks?

#

returned value from first EH then gets processed into the next EH?

little eagle
#

_source being "" doesn't only mean fall damage, it also applies to e.g. crash damage. So this eh would make cars explode when they touch players and leave the players undamaged.

lusty canyon
#

i thought the point of multiple EH on the same property makes them pass values from one to the other?

little eagle
#

i thought it stacks?
They do stack as in you can add as many as you want. But only the return value from the last one is taken, so you can only use one to modify the damage. That aspect of eventhandlers that acknowledge return values does not stack.

#

makes them pass values from one to the other?
That would be a cool feature, but it doesn't exist.

lusty canyon
#

so say incoming damage is 10

first dmg EH {_dmg + 2; _dmg} // dmg is now 12
second dmg EH {_dmg / 2; _dmg} // dmg is now 6

your saying this pass process previous doesnt work????

little eagle
#

No, in the second one it will again start as 10.

#

Where did you got this from?

lusty canyon
#

fuck me! my misconceptions wer implanted by INCEPTION team!

#

BUT doesnt my way actually make sense for stacking EHs?? if it only accepts last EH then whats the point

little eagle
#

It means your first one is wasted space and processing time.

lusty canyon
#

but then so many mods add EHs, each one breaking the last??

little eagle
#

If they use HandleDamage or HandleScore and HandleRating, yes. Which is why I consider these to be unusable by addons.

#

ACE uses HandleDamage anyway, because it has to. But lot's of missions break it and of course ACE team gets the angry bug reports.

lusty canyon
#

wow just wow, why would BIS do this? pls dnt tell me stacking doesnt work for getIn getOut as well

little eagle
#

This only applies to eventhandlers that consider the return value. All other work just fine. It's not that the code isn't executed, it's just that the return value is overwritten by the later added eventhandler.

lusty canyon
#

so i have to convert my fall dmg EH and reduce dmg EH into just 1?

little eagle
#

That is the next misconception that you apparently haven't understood.

#

The _damage reported by the eventhandler is the total damage the unit would have in _selection after the damage event.

#

Which means the sum of the previous damage plus the newly received damage.

#

If you just cut the total damage in half, you also cut the previous damage in half: your unit could be healed by getting shot.

lusty canyon
#

oh right, so its the total dmg, geez here i thought its just the most current hit dmg

little eagle
#

That would be a nice feature, but it doesn't exist.

lusty canyon
#

so there is no way to just get the dmg from say 1 bullet?

little eagle
#

Enormous effort has to be put into HandleDamage to get it to work in an acceptable way. I did this for the medical rewrite in ACE with lot's of experimentation.

#

Of course people want quick results so they script some shaddy stuff together not looking too different from what yours looks like.

#

Until it feels about right, but of course it will behave unpredictable in edge cases: still good enough for most mission makers.

#

It's a steaming pile of shit, and if you know too much about it, you can't greenlight what others've done with it and posted in a chat.

lusty canyon
#

stuff thats supposed to be common sense just its there, my fault i guess for glancing at biki and then filling up the holes with my own common logic

#

so what if i modify the dmg inside the hit EH?

little eagle
#

Yeah, HandleDamage existing in it's current form is worse than it not existing at all. With it not existing people would at least request it and have leverage. This one is a bad excuse for an essentially missing but crucial feature.

lusty canyon
#

fuck hit EH so many not reliable triggers

#

says will not trigger on such and such, so what if it should of died, trigger first before dying!

little eagle
#

The hit eh cannot modify the damage. Only eventhandlers that start with "handle" do generally. Maybe there's an exception I can't think of one now, but nothing to do with damage.

lusty canyon
#

and here we have tanks DLC, christ this EH stuff is a black hole of silent doom!

#

and its only those few people that really think and test the internals that will complain about it

little eagle
#

It's one of the worst aspects of this game. Right after weapon animations for asset makers.

lusty canyon
#

plus i would like it if everything can be sqf'd, i dont like trawling static cfgs #PURE_SQF

little eagle
#

Configs have their merrits, not being able to edit them on the fly or with missions at all is the bad thing.

lusty canyon
#

yeah base cfg alright, inheritance ftw! ive modded games without inheritance and its just painful

little eagle
#

Same.

lusty canyon
#

gotta be honest tho, even with all the hair pulling gripes, the arma engine is still so much more comfortable compared to other engines. dangerous waters back in the 90s was a total bitch to mod but i still cant find any modern subsim that can beat it. same with c&c generals, EA used alot of proprietary stuff, but is still the best modern day RTS. was coding in some kind of LUA

peak plover
#

Yes amra is leading platform for modders and community creations

austere granite
#

4now

little eagle
#

🔥

austere granite
#

Enormous effort has to be put into HandleDamage to get it to work in an acceptable way.

#

damage handling modifications i hope Enfusion will suck less at

#

That and allowing to properly disable input in a way

little eagle
#

Nothing you'd need a new engine for. Sure, it's an opportunity, but as for me, I will lament every old feature that will get lost or broken.

austere granite
#

agreed, but a cleanup on things like that probably wouldn't be a bad thing

gray thistle
#

Good Afternoon,

I once again have a Question about Eventhandlers for Active Mines (In combination with ACE i thought it should be noted) i tried to get an Eventhandler Killed and Deleted to work with my Activ mines but it seems not to recognize it if the mine detonates (Kills itself) or is deleted. Is there a Reason for that?

tough abyss
#

Is SQF _offset = _preset select 0; _blend = _preset select 1; _colorize = _preset select 2; _weight = _preset select 3; the same as ```SQF
_preset params ["_offset", "_blend", "_colorize", "_weight"]

still forum
#

yes

#

no

#

That would be

private _offset = _preset select 0;
private _blend = _preset select 1;
private _colorize = _preset select 2;
private _weight = _preset select 3;
tough abyss
#

Thanks 👍

gray thistle
#

I found out that mines are pretty bad included into Arma 3. I probably have to do for each placed one something like sqf Waituntil {!alive _mine}

young current
#

what are you trying to achieve

still forum
#

Killed EH?

gray thistle
#

Dedmen somehow the Killed one won't work probably because of ace but i am not sure

#

at the moment i am working with that ```sqf
{
_x addEventhandler ["Killed",{hint "ToT"}];
_x addEventhandler ["Deleted",{hint "Gelöscht"}];
[_x] call ser_fn_insertmine;
hint format ["Gesetzt %1", _x]
}foreach _updated_mines;};

#

for the protokoll _updated_mines are the new ones

#

and foreach is just to make sure that everything will be handled properly cause of the second sleep

#

@young current uhm simply to get code executed by an removed mine by defusing or exploding it

young current
#

i would guess triggering mine activates fired event so could you use that?

gray thistle
#

not sure maybe a try worth i read a lot about that Bi didn't put much love towards them

young current
#

They work as mines as intended, you walk on one and BOOM. Im still not getting what is the big picture you are making

gray thistle
#

Database of placed mines

#

A lot is already working

young current
#

you are aware of the mine related scripting commands yes?

gray thistle
#

the most stuff i am using is allmines i probably have to do something about the ownage and things like that i think there are 6-8 related commands after searching them with strg + F

young current
#

so you want a list of mines

#

and then cross off whose that have exploded

#

but keep them in the list

gray thistle
#

this is what i am doing by substracting strings in arrays

next lily
#

Waituntil {!alive _mine}

wouldn't isNull be better?

still forum
#

And another guy who is unable to read and write a name properly...

#

isNull and alive would probably do the same in this case

gray thistle
#

{true}

still forum
#

And no nothing can disable Eventhandlers. So ACE isn't breaking the Killed EH

next lily
#

I'm just not sure if there's weirdness handling alive objNull

still forum
#

I think ACE has a special EH for ACE mines too

gray thistle
#

Yeah ace will be brought in a little bit later in utilizing it

next lily
#

I thought ace scripted all its explosives anyway.

gray thistle
#

first A3 Related than addon

next lily
#

@gray thistle
Also, I've not looked at mine defusal in a while, but I recall them just sort of... tilting when defused.

#

You might be able to use vectorUp and some checks if that's still the case.

gray thistle
#

Ähm i don't know how this would be a solution for the event handler problem

#

I even think this has nothing to do with that

still forum
#

I also don't see the connection ^^

#

You can use CBA_waitUntilAndExecute

next lily
#

I just woke up, forgive my brain.

still forum
#

That will behave somewhat like an eventhandler
instead of the unpredictable waitUntil

next lily
#

I'm seeing things that aren't there.

gray thistle
#

The thing is Dedmen this gamemode shall support also the normal arma way but i am working for myself on Ace too and that is a mess i will even have to do maths when is is disabled cause of the diffrences

still forum
#

Dude

#

learn to write my name

gray thistle
#

And yes with the suspension is Waituntil somewhat random but mostly at least to the point of understanding (Also me is sorry just noticed)

#

When i think i just wanted to start a loop with if else questions phew the horror i did not experience the load the agony....
And Sadly Fired did not work

#

Well i will look into !waituntil to solve the problem for the moment thanks. Still if someone has ideas to that then please let it me know

proven crystal
#

i seem to have a problem with adding actions with remoteexec.

as i was initially cobying stuff, i used addaction the normal way. i included a few addactions in a function and remoteexec that function. I thought that does the same job as remoteexec the addactions individually. That doesnt seem to be the case though. as player i see those actions only, if i connect before that function is called. but they should be there for everyone when they connect. so i guess something with the Jip dont work.

#

[_object] remoteExec ["fnc_XYZ", 0, true];

#

and that function contains a bunch of addaction

#

would it change anything if i change it to [_object] remoteExec ["fnc_XYZ", 0, _object];

#

not sure how the JIP works tbh

still forum
#

No that wouldn't change

#

Does that function already exist when JIP scripts are called?

#

AKA using CfgFunctions instead of setting a variable in init.sqf

little eagle
#

Just put it into initPlayerLocal.sqf and it will be executed for every JIP client.

lusty canyon
#

possible to force set side to enemy ai? _aiUnit setRating -8000 doesnt work

proven crystal
#

i define a function in some file and call it

#

and those functions are read when the server starts

next lily
#

@lusty canyon
I've gotten it to work with addRating -20000.

lusty canyon
#

@next lily really? great ill give that a go. ty

next lily
#

I've had success with it, so... I see no reason why it wouldn't work.

proven crystal
#

cant put it in initplayerlocal. buddy wants to put it in a separate sqm to be placed on a server

little eagle
#

Well, you do have a problem. There are a few solutions suggested that would 100% work and are how this usually done.

#

But you don't like them.

#

Can't help someone like you.

lusty canyon
#

my ais that previously had waypoints got cleared when i gave them addrating -30000. i guess this is intended behaviour?

#

is this cuz renegades dont have side center?

native siren
#

Hello does anyone have any idea what that error might be caused by? Error Foreign error: Unknown enum value: "onPlayerDisconnected"

still forum
#

Yep

#

That enum value is unkown. Aka it doesn't exist

native siren
#

So like using function that is not declared yet in EH?

still forum
#

What?

#

No

#

The onPlayerDisconnected EH doesn't exist

native siren
#

oh

#

thanks

still forum
#

Maybe you meant the PlayerDisconnected EH?

native siren
#

yeah probably thats the problem

#

thank you

native siren
#

Error Foreign error: Unknown enum value: "PlayerDisconnected" ? 😃

#

oh can those be used on client?

#

or server only

still forum
#

What command are you using?

native siren
#

player addEventHandler["PlayerDisconnected", {_this call function}];

still forum
#

That eventhandler doesn't exist.

#

It's a MissionEH

native siren
#

Do you know if there is any EH that would fire when player leave mission?

still forum
#

Yes.

#

The PlayerDisconnected EH

cold pebble
#

You add it to the server

#

Not client

still forum
#

You can also use it on the client

#

But I guess it won't fire for the client itself

#

only when other players disconnect.

native siren
#

What I want to do is to send some information from client before he leaves.

cold pebble
#
addMissionEventHandler ["HandleDisconnect",{_this call some_fnc_onClientDisconnect}];
still forum
#

You can't really do that

#

you can detect that he left

#

not before he leaves

#

I guess you can detect when he opens the Escape menu screen

#

But that doesn't mean he clicks the abort button

#

and that also wouldn't detect ALT+F4

cold pebble
#

Depends what info you want

native siren
#

It's fine if it's impossible with EH I can find workaround. Thank you for explaining this for me. 😃

cold pebble
#

Well you can use it for some stuff

#

Like if you wanna use their UID/side

native siren
#

I'm trying to save some information into db before they leave.

cold pebble
#

What information? 🤔

still forum
#

Can you somehow get that information to be on the server?

native siren
#

like gear they have etc

still forum
#

You can do that on the server

#

But PlayerDisconnected EH is too late unless you have AI enabled

#

Or you just use HandleDisconnect

native siren
#

So if I understand correctly this one holds information on player unit after he disconnect so I could use that on server to write it to db after player left?

still forum
#

yes

native siren
#

That's cool I need to play with this one.

#

Thank you 😃

wispy lynx
#

While trying to spawn an AI unit with script:

_glMuzzles = getArray (configFile >> "cfgWeapons" >> _primaryWeapon >> "muzzles");

if (count _glMuzzles > 1) then {
    _glMuzzle = (_glMuzzles select 1);
    _primaryWeaponGLRounds = getArray (configFile >> "CfgWeapons" >> _glMuzzle >> "magazines");
    _primaryWeaponGLRound = _primaryWeaponGLRounds call bis_fnc_selectRandom;
    _unit addMagazine _primaryWeaponGLRound;
};

I'm getting this error:

_unit addMagazine |#|_primaryWeaponGLRound;

Error Undefined variable in expression: _primaryweaponglround

Ideas? Or does anyone know another way to determine if a primaryWeapon has a GL attached and then be able to select it's CfgWeapons name to assign random ammo types (HE, flares, smoke) for the GL?

still forum
#

I think... That variable is undefined

#

bis_fnc_selectRandom is outdated and deprecated

wispy lynx
#

Could you explain "deprecated" in this context for me? I'm using the bis_fnc_selectRandom for several other "randomizers" in the script, and they are behaving without issue?

cold pebble
#

Eh there's an engine solution to it

#

selectRandom

still forum
cold pebble
#

Ah damn

#

😛

still forum
#

configFile >> "CfgWeapons" >> _glMuzzle >> "magazines" That's incorrect

#

the muzzle is not a weapon

#

it's a subclass at most

wispy lynx
still forum
#

Yeah.. And what you copied from there is correct.

wispy lynx
#

So how is: configFile >> "CfgWeapons" >> _glMuzzle >> "magazines" incorrect?

still forum
#

Could you please just read what I wrote?

#

Because I told you exactly what is incorrect on that

little eagle
#

There're no muzzles in CfgWeapons.

wispy lynx
#

@still forum Okay, I'm new to scripting, I was asking "why" it's incorrect?

still forum
#

Dude

#

the muzzle is not a weapon it's a subclass at most

#

It's not a weapon

#

it's not in CfgWeapons

#

It's a subclass of the weapon

little eagle
#

why
There're no muzzles in CfgWeapons.

still forum
#

@meager heart NO.

#

Dude...

#

If you wanna help you should read the conversation so you know what we are actually doing..

#

I said 10 minutes ago that that is correct. And he did it like that

meager heart
#

ok sorry then

#

200+ messages

#

😀

still forum
#

Yeah. I always read from oldest message to newest

little eagle
#

Sarcasm.

still forum
#

Could you say what a "unit mod" is?

little eagle
#
  1. make a mod
  2. make a unit
  3. put unit into mod
still forum
little eagle
#

It's true. I've done it once or twice before.

still forum
wispy lynx
#

Okay, so what should I change to be able to get the GL appropriate ammo?

still forum
#

Grab the weapons subclass and not from CfgWeapons

#

getArray (configFile >> "cfgWeapons" >> _primaryWeapon >> _glMuzzle >> "magazines"); Like that

little eagle
#

Looks good to me.

wispy lynx
#

Okay, thanks, I'll try that out.

meager heart
#

Could you explain "deprecated" in this context for me?
afaik deprecated - mean that it is recommended to use "something better/another/new", "old thing" may still works for backwards compatibility or there are some troubles with "the old thing"

wispy lynx
#

👍 Worked! Again, thanks for your help.

#

and I will update script with the selectRandom instead of bis_fnc_selectRandom.

still forum
#

deprecated means "this still works. But you should not use it anymore. And it might disappear or stop working completly soon"

meager heart
#

yeah... in short - don't use it

wispy lynx
#

I'm glad that subclass method worked, as it'll carry over to getting the Type 115 subclass as well, it was going to be my next problem child to figure out.

next lily
still forum
#

Don't know of one

next lily
#

If there ain't and I think there should be, where would the best place to go and say so be?

still forum
#

I think there is a dev branch scripting feedback thread on BIF

#

If you know the file is there than you don't need to care about it

#

But not seeing what's in there while the code has effect on the other code (local variables) is a bad practice

#

better just call it.
If you want to save memory then execVM or call compile preprocessFileLineNumbers instead of properly using CfgFunctions.

#

That way side effects from invisible scripts don't carry over to yours and could cause conflicts

meager heart
next lily
#

@meager heart
That's good to set, but I'm looking to get.

meager heart
next lily
young current
#

@next lily you can read engineTemp Temperature state of the vehicle engine [A3 post 1.66 only] any ? wheelsTemp Temperature state of the vehicles wheels [A3 post 1.66 only] any ? turretGunTemp Temperature state of the vehicles primary gun [A3 post 1.66 only] any ?

#

animationSources

#

Id suspect that gives value from 0 to 1

next lily
#

Can you give an example of how to do this?

next lily
#

object animationSourcePhase "engineTemp"

#

Like that?

young current
#

yes

#

as I said it probably gives you value from 0 to 1

next lily
#

Is there a list of these strings?

young current
#

so depends what you want to do with it if its useful for you

#

so where do you need it?

next lily
#

so where do you need it?

Looking to quantify a gradient thermal return for a simulated heat signature.

young current
#

so going way out of arma scope

next lily
#

Debatable.

#

:p

young current
#

well judging by the scripting commands we are given yes. 😛

next lily
#

Oh!

#

Yeah.

young current
#

but in any case the animation sources are only thing I can think of that return anything heat related

next lily
#

I appreciate this information all the same.

young current
#

unfortunately the thermal values are baked into the p3ds via model.cfg on binarization so it is not very easy to those values out

#

not in runtime anyway

#

and they only apply on vehicles too

#

so buildings, plants etc their thermal is simpler

next lily
#

I figure humans are always 'warm'.

young current
#

If I recall it was just calculated from the diffuse color or something

#

well not when theyre dead

#

and they get warmer when they move I think

next lily
#

That's a simple check.

young current
#

but when theyre alive yes theyre warm

next lily
#

And they're not the target of IR missiles, typically.

young current
#

except when they use thermal camouflage

#

yeah not warm enough for that I guess

#

also irTarget = 0; in config I think

#

Am I correct to assume you want to make man units thermal targets?

next lily
#

I'm... Less than thrilled with the behavior of the Titan/ACE Javelin behavior. I'm trying to emulate proper Javelin behavior.

#

Including simulating the CCD on the missile.

#

Finding where a bunch of intercept lines strike a target then finding the relative thermal values thereof.

#

Looking for the hot spot as it were.

young current
#

I see

#

sounds like an ambitious project

#

and not so simple in Arma

next lily
#

Agreed. I've started and dropped it a couple times.

young current
#

good luck!

next lily
#

Appreciated.

#

I'll keep you apprised, if interested.

young current
#

sure why not!

next lily
#

Will do.

lusty canyon
#

how can you make ai crew unable to eject from damaged vehicles?

ornate pawn
#

DisableAI "MOVE"; ?

#

just guessing lol

still forum
#

You can lock the vehicle I think

sick drum
#

Can someone give me a list of commands I can use for OBJa

ornate pawn
#

Dedmen i still can't fix my powerpoint 😛

#

google doesn't work? @sick drum

sick drum
#

I'm asking experienced people So I dont get wrong commands

ornate pawn
#

you need commands for ?

#

OBJa?

#

what's that

sick drum
#

Objectives like Kill this person then it triggers something else for you to do

ornate pawn
#

!Alive

#

!Alive soldier1

#

for example

#

you put that inside your triggers condition

next lily
#

Be aware that that's a check.

#

Merely running it doesn't mean that suddenly it will wait for the death of the unit.

#

At least, in a script or somesuch.

ornate pawn
#

it will wait for that condition to be completed

next lily
#

In a trigger it'll work.

ornate pawn
#

he said triggers so there you go

#

im not an expert dude. i'm still learning

next lily
#

He said for something to trigger. I don't see specific mention of in a trigger.

#

So, my confusion.

sick drum
#

I used to do this all the time but I kind of quit

ornate pawn
#

stop make things complex dude

#

if you want a trigger to be activated when somebody or something is dead use that command

next lily
#

Can you elaborate what you specifically want to happen?
@sick drum

ornate pawn
#

o.o-

next lily
#

Just a bit more context.

ornate pawn
#

yeah

#

Loren

sick drum
#

Well right now I want to make a basic defense mission

ornate pawn
#

are you good with scripting?

#

if you are. are you whiling to help me with somethin? 😛

next lily
#

I'm familiar. Not a massive expert on part with big name mods, but I know some.

#

Just not dialogs.

#

Those I see too little of to figure out.

ornate pawn
#

Do you know variables? and know how to use if ?

next lily
#

That I do. PM me, let's see if we can get @sick drum sorted first.

ornate pawn
#

yeah

#

big gun

#

what exactly do you need?

sick drum
#

a basic defense mission

ornate pawn
#

that doesn't help

next lily
#

Okay, so are you looking for a group to be dead or a specific unit?

ornate pawn
#

he wants a trigger to be activated when a unit dies

sick drum
#

Basically I want one group of units to move into the friendly units once the friendly units kill all of the enemy units the game ends

ornate pawn
#

okay

#

i have the code you need

#

1 sec

next lily
#

How many enemy units are there, roughly?

ornate pawn
#

Loren i have the code he needs

sick drum
#

hmm likes go with 4

ornate pawn
#

writing it right now

#

stand by

#

{alive _x} count [s1,s2,s3,s4] < 1

#

put that inside the triggers condition

#

place a soldier and name it s1

#

then place another soldier and name it s2 and so on..

sick drum
#

K

ornate pawn
#

on activation you can put this code: titletext ["","BLACK FADED"]; "End1" call BIS_fnc_endMission;

#

and this code inside your description.ext:

#

class CfgDebriefing
{  
    class End1
    {
        title = "MISSION COMPLETED";
        subtitle = "EXCELENT WORK OUT THERE GENTLEMEN!";
        description = "Though I may walk through the valley of the shadow of death, I will fear no evil, for I am the meanest mother fucker in the valley.";
        pictureBackground = "images\M_overview_ON_END.jpg";
        picture = "";
        pictureColor[] = {1.0,1.0,1.0,1};
    };
};

meager heart
#

k

ornate pawn
#

@sick drum this is a better ending: titleText["THE END","BLACK OUT",8]; "End1" call BIS_fnc_endMission;

#

haha

#

sup @meager heart

meager heart
#

privet

river meteor
#

Does anyone know how to make 3D dialogs?

ornate pawn
#

is this the place for that? i don't think so

river meteor
#

I believe it is

ornate pawn
#

wait dialogs are made with scripts haha ma bad dude

still forum
#

I don't know what you mean by 3D dialog

#

Dialogs are 2D

river meteor
#

Like ACE Interaction is in 3D space

still forum
#

Is it?

#

It's a few 2D points on a screen

river meteor
#

I don't know if it is literally rendered as 3D objects, but it certainly simulates being in 3D space

ornate pawn
#

@sick drum did it worked?

still forum
#

Well... Then you already know who knows how to make 3D dialogs.. ACE Interaction

#

And it's open-source. So you can just look at how they do it

sick drum
#

I haven't even tried yet been trying to get animations to work on NPCs

ornate pawn
#

s1 switchMove "name of animation";

sick drum
#

no no not that Idle animations

#

Non-combat

river meteor
#

I already tried looking through the ACE code. Problem is there are 20 files and I don't know where exactly the logic to draw and resize it is

ornate pawn
#

oh yes

river meteor
#

Also ctrlSetPosition has a parameter for 3D controls. So I assumed that such a thing existed

still forum
ornate pawn
#

uuu

#

thats a lot of code

still forum
#

And you can certainly see on the FPS counter if that code is currently running 😄

ornate pawn
#

@sick drum [this,"SIT_HIGH2"] call BIS_fnc_ambientAnim;

#

@sick drum [this,"STAND"] call BIS_fnc_ambientAnim;

#

@sick drum [this,"LEAN"] call BIS_fnc_ambientAnim;

#

@still forum help me with my powerPoint please T_t

still forum
#

Didn't I do that yesterday?

#

Oh.. 6AM.. Eh.. 2 days ago*

sick drum
#

oh ok lol i was doing this [unit, "SIT", "NONE"] call BIS_fnc_ambientAnim;

ornate pawn
#

@sick drum lol no

#

@still forum I couldn't figure it out T_T

#

hahaha

#

@sick drum did it worked?

sick drum
#

I'll let you know tomorrow I'm busy doing the detailing at the moment

ornate pawn
#

hahaha

#

okay

lusty canyon
#

is there fnc that simulates a smooth transition effect when constantly waituntil _obj_A setpos (getpos _obj_B);

still forum
#

linearInterpolate

lusty canyon
#

i dont get all the params, sorry im trailer trash that had to use cheat sheets in high school math exams just to get a passing grade 😫

#

so many numbers as args where do i specify the objects?

#

i just want _obj_A to follow the path of _obj_B without stuttering or micro teleporting

still forum
#

That's not thaaat easy

lusty canyon
still forum
#

😮

#

yes I think so

gray thistle
#

@native siren Sem i heared you are also working on a Database maybe i can share with you some information about DBs

lusty canyon
#

in most of the EH with source obj + instigators like hit/dmg/killed, whats the difference between those two types?
say the player is inside a vehicle and attacks _obj_A triggering said EHs.
is the source obj in the EH the players vehicle? and the instigator is the player entity?


_obj_A addEventHandler ["HandleDamage", {
    params ["_veh","","","_source","","","_instigator",""];
    if (_source in allPlayers) then {
        _veh setVariable ["DW_IMS_LAST_DMG_SOURCE", _source,true]; };
    if (_instigator in allPlayers) then { 
        _veh setVariable ["DW_IMS_LAST_DMG_SOURCE", _instigator,true]; };
}];        

would this reliably get the player (either on foot or in veh) that attacks _obj_A?

#

(also created copies EH hit, dammage, killed just to make sure, or is that overkill?)

#

context: i need this for an aerial mission, multiple players focus on a single enemy aircraft and i need to know reliably who shot it down. gets unpredictable since the ai crew can eject (locking the veh didnt stop ai from ejecting) or it can just crash all on its own

sinful sky
#

I'm trying to make a maker follow a car when a sqf activates, ive tried
ull0 = [] spawn {while {not isnull car_1} do {"carmarker_1" setMarkerPos getPos car_1; sleep 0.5;}; };
with no luck ive seen this work on videos but the makerer isn't moving

#

0 = this execVM "car_1track.sqf";

this is what actives the sqf. The car and the marker are definitely named correctly

sinful sky
#

well ive tried about 20 slightly different variations with still no luck. YAY scripting....

little eagle
#

Check the rpt file.

sinful sky
#

its not saying anything about the SQF

#

is this for sure what I need to activate it ?

#

0 = this execVM "car_1track.sqf";

little eagle
#

What's car_1track.sqf?

sinful sky
#

the sqf in the mission folder

#

ive changed quite a lot of stuff so i forget what ive done. I had it working erlier with a test "hint" in the sqf

little eagle
#

You had it working? But what happened?

sinful sky
#

lol good qyuestion

#

well ive got the sqf starting now with just execVM "car_1track.sqf";

#

well it wasn't moving the marker

#

guna test this quick

#

ok well that's working now

#

must have got a bit muddled and I'm not used to activating sqf via a trigger

little eagle
#

You're doing weird stuff.

sinful sky
#

how is that weird?

little eagle
#

All of it.

sinful sky
#

you new here?

#

that's pretty basic sqf with a pretty basic activation

#

just its been years since ive done it before

#

got confused

little eagle
#

OK

sinful sky
#

well if you cant tell me HOW its weird il just take that as you are weird lol

#

seriously if im doing it in a werid way id like to know why

little eagle
#

This is supposed to be a marker that follows around a vehicle. Why would that need a trigger?

sinful sky
#

o i see

#

well the vehicle its attached to only gets moved to you base once a "cache" is destroyed

#

and that's when i wanted the tracking to start

little eagle
#

Next, what's the purpose of spawn in car_1track.sqf when it's executed with execVM?

sinful sky
#

I don't know

little eagle
#

See? It's weird.

sinful sky
#

well how?

#

should i remove that bit

#

its copied and i didn't want to mess with it seeing as it works

little eagle
#

To me that's weird.

sinful sky
#

well i guess it would activate when the player spawns i duno il link you the vid

#

both have the spawn part

little eagle
#

Yes, but the video from Armaidiot doesn't use spawn and execVM.

#

And neither does the deleted reddit commentor.

sinful sky
#

so

#

how do i activate the sqf ?

#

and what in this do i change

ull0 = [] spawn {while {not isnull car_1} do {"carmarker_1" setMarkerPos getPos car_1; sleep 2;}; };

#

he does use the Spawn part

#

im watching it now

little eagle
#

Idk. You should read the wiki probably. That way you won't have to waste time to hunt for weird code on google in future.

sinful sky
#

well you haven't helped atall, you have said that wrong but cannot tell me how.

#

ive read the wiki and tried myself with no luck

little eagle
#

I've said it's weird. It's obviously not wrong because it works. But so does wrapping it in fifty more spawn {}.

meager heart
#

discord is fun

little eagle
#

Nah, it's a horrible platform and I hope it dies soon.

sinful sky
#

fifty more ?

little eagle
#

Yes, or seventy.

sinful sky
#

errr, what is all ive got

#

well thanks for the confusion lol

little eagle
#

I pointed you to the wiki. There you can read what works how. Then you won't have to try for hours next time.

sinful sky
#

you don't realise how much i don't know, the WIKI is not for the people who don't code

#

its usualy just more confusing

#

i only ask here when the wiki makes no sense to me

little eagle
#

Looks to me like you were already confused, but confident. Guess that is what people want to be.

sinful sky
#

whats you problem man.. infact i don't care good day

little eagle
#

Weird guy.

meager heart
#

¯_(ツ)_/¯

sinful sky
#

typical scripters lol

little eagle
#

If only. They tend to actually believe they know something. They act even more confident even when confronted with their bullshit.

meager heart
#

probably new tutorial will be out soon ™

real loom
#

Hello Guys I'm working on a paradrop script for an addon ,I have done a function that I need to start on the mission start ( BDF_linha_fixa = { .... ). The function then later will be called by an action inside a vehicle . My question is how do I put it inside an .Pbo in a way that there's no need to start a module for it to work.

I'm working in this mod with a friend.

https://forums.bohemia.net/forums/topic/214834-parachute-mc1mc4t11-wip/

little eagle
real loom
#

Tks

unborn ether
#

you don't realise how much i don't know, the WIKI is not for the people who don't code its usualy just more confusing wat?

little eagle
#

This is the state of the world in 2018, Dismal. You should be used to this by now.

unborn ether
#

¯_(ツ)_/¯

river meteor
#

Someone needed to point that guy to the wiki articles that go over the syntax of sqf

still forum
little eagle
#

Amir al Mumpitz.

tough abyss
#

Lol

ornate pawn
#

Does anybody has an aearbud script with a keybind?

#

for example pressing F1 and your sound effects will reduce down to 40 or something like that?

unborn ether
ornate pawn
#

that does the keybind too?

unborn ether
#

KeyDown does

lusty canyon
#

heres my simple earbuds addaction


    player addaction ["<t color='#7396ff'>UTIL EARPLUGS:</t> ON", 
    {
        _myPlayer = (_this select 0);
        _actionID = (_this select 2);
        _earPlugs = _myPlayer getVariable ["DW_UTIL_EARPLUGS",0];    

        if ( _earPlugs == 0 ) then     {
            _myPlayer setVariable ["DW_UTIL_EARPLUGS", 1, true];
            _myPlayer setUserActionText [_actionID, "<t color='#7396ff'>UTIL EARPLUGS:</t> OFF"];
            2 fadeSound .20;
            hintsilent "EARPLUGS ON (-80%)";
        }
        else {
            _myPlayer setVariable ["DW_UTIL_EARPLUGS", 0, true];
            _myPlayer setUserActionText [_actionID, "<t color='#7396ff'>UTIL EARPLUGS:</t> ON"];
            2 fadeSound 1;            
            hintsilent "EARPLUGS REMOVED";
        };    
    },
    "args",    -400,    false,    false,    "",    "(alive _this)",    5,    false,    ""
    ];
#

@ornate pawn

ornate pawn
#

Thank you @lusty canyon

#

thanks a lot guys!

unborn ether
#

hintsilent str "EARPLUGS REMOVED"
str on string?

little eagle
#

Adds additional quote marks and looks very unprofessional.

lusty canyon
#

extra quotes = extra professional

#

👌

#

atleast im finally giving back!

grizzled rain
#

Could someone help me with a command? I tried using that animate command to make doors open by themselfs with a trigger but it wasnt working for me. Followed it to a T via wiki but not working.

little eagle
#

Post what you got.

cyan ore
#

hey anyone know if its possible to set the buoancy of a object?

#

trying to make a barge of somekind

meager heart
#

afaik you need "buoyancy lod"

#

or some weird workarounds with setpos

hearty plover
#

Can someone explain the diff between remoteExec and remoteExecCall and when I should use one over the other? Been reading the wiki now for a while, and it's still a little unclear. To me they look almost exactly the same.

peak plover
#

Uhh

#

does pushback work with public var?

#

ie.

_arr = [];
missionNamespace setVariable ['ten_arr',_arr,true];
_arr pushBack 'abc';
meager heart
#

_arr and 'abc' are not public variables in your example, nigel

peak plover
#

k makes sense

#

on client

#

ten_arr

#

is ['abc']

#

on server

#

it's []

meager heart
#
_arr = [];
_arr pushBack 'abc';
missionNamespace setVariable ['ten_arr',_arr,true];

now on server ten_arr is ['abc'] and on client ten_arr is ['abc']

#
ten_arr = []; 
publicVariable "ten_arr";

ten_arr pushBack 'abc';
publicVariable "ten_arr";
#

🤔

peak plover
#

Yeah

#

Just the thing is it modifies the original array

#

but only on the client

#

it's run on

meager heart
#

task was send it, then append/pushback element and ?

#

...loading

#

🛫

warm gorge
#

Is there any way to avoid RscTree list item pictures from becoming squashed like in this image: https://i.imgur.com/4ipoduz.jpg

All I've done is increased the sizeEx of the tree to: 6 * (1 / (getResolution select 3)) * pixelGrid * 0.5

still forum
#

@peak plover does pushback work with public var?
No. Because public vars don't exist

#

Thought you already knew that 😮

little eagle
#

@hearty plover For commands, remoteExec and remoteExecCall are exactly the same. For functions, remoteExec executes them in scheduled environment, while remoteExecCall executes them in unscheduled environment.

peak plover
#

Yeah I was just waking up at that moment 😄

#

@still forum

#

It makes 100% sense

lusty canyon
#

is it possible to create a small synchronized timer on each players screen (mp/dedi)? (bomb defusal mission related) pure sqf only

elder slate
#

@lusty canyon you can create a timer function and launch it with remoteExec from defuser client

lusty canyon
#

will it be in sync tho? if i do a remoteexeccall -2 (all clients) and one player is on a potato running 10fps and the other player is on a nsa farm at 60 fps. wont the timers become out of sync the longer the script runs?

#

plus at timer 0:00 i want to run server + HC fncs

still forum
#

No.. Time doesn't elapse faster/slower depending on FPS

#

Time is a constant.. Eh... Relative constant..

lusty canyon
#

but timer has to be rendered on the players pc?

still forum
#

Do you have players that play from the earth orbit?

#

If not you can ignore time difference

#

Yes the timer has to be rendered... ofcause

meager heart
#

ofcuz*

lusty canyon
#

ur right fuck the clients ill just use the servers time to trigger my fncs

#

i have no idea how to manipulate UI tho to display said timer

still forum
#

Uh.. yeah I guess that isn't so easy

#

besides if you just use a hintSilent that posts the timer every second

lusty canyon
#

i can do everything else xpt the UI part

#

can you make a parallel hintsilent somewhere else on the screen so the regular hints still appear without overwrite them?

still forum
#

no

#

Not without making own UI for that

meager heart
#

you can try bis_fnc_countdown for the timer

cedar kindle
#

if you have CBA use CBA_missionTime

#

the diff is very low

#

works for jips etc

lusty canyon
#

is there a CBA_renderTimer 😋

still forum
#

What would that do? No

cedar kindle
#

idk what bis fnc countdown is but assuming that it does what the name implies you can use that with cba time to start it

still forum
#

CBA also has a func to wait a specified number of seconds and then execute

#

CBA_fnc_waitAndExecute

cedar kindle
#

he wants to show the count down

#

i assume the BI func does that

meager heart
#

yeah, ^ it will show timer... within "mission info" like tickets,sectors... etc

still forum
#

sounds like coutdown will kill the mission

lusty canyon
#

oh no i dont want to run endmission at the end

#

i could do a dirty change marker text every second, but players would have to open map just to check the timer

still forum
#

Or you copy the code from BIS_fnc_countdown

#

and use it's way to display the timer. And remove the mission ending

lusty canyon
#

can i copy paste the code from debug console?

still forum
#

yes

lusty canyon
#

ok ill try the bis fnc, else will have to stick to marker Text

#

thanks ppl

peak plover
#

Ok

#

I need to get player entity entry from mission sqm

#
  1. I need to get all groups that have players in them
  2. I need to compare all the playable units names to current vehicleVariableName thingy
#

Does that make sense?

#

Basically

#

I need to know the original group of player

#

So I can always move him back to his original group on respawn

#

So I need to find which group it is (from mission.sqm config refference)

cedar kindle
#

save the group on mission start and just move him back?

peak plover
#

what if he jips

#

What if group has died off or connected/disconnected and someone jips?

cedar kindle
#

what happens if you jip into a group where everyone has moved to another group ?

peak plover
#

Exactly

cedar kindle
#

iirc you’ll still be in the original group

#

as long as the group isn’t deleted

still forum
#

^ What if his original group doesn't exist anymore

#

People usually #include the mission.sqm in their description.ext. That way you can use missionConfigFile to browse the mission.sqm

peak plover
#

Yeah

#

So I should still sniff out the group for the player from the missionConfig?

still forum
#

I guess yeah. If that's what you want then you need to do that

peak plover
#

Ok, and there's no automatic get player config?

cedar kindle
#

how would you even find the player if there’s no varname and how would you get the group reference from the sqm

#

what issue are you trying to solve here

still forum
#

no such a thing doesn't exist

peak plover
#

if there’s no varname
I got a check that checks if all playable units have variable names

cedar kindle
#

what’s the issue ?

peak plover
#

wrong group after respawn

cedar kindle
#

the group should be correct when joining so you should settle with that, just double check for jips but I see no reason why it should change

#

Unless the group is deleted in which case you’re in a bad spot anyway with either solution

peak plover
#

Not going to be an issue

#

I'll look for existing group

#

If no existing group found. It'll create a new one and setvar so it then exists

cedar kindle
#

if this is a generic thing it’s pretty obnoxious requiring a var name on each player

#

my 2 cents

peak plover
#

🤷🏻

#

If not setting a variable for every unit is not worth it, then the mission I'm working on is not worth it as well...

meager heart
#

need one more line with text: _ i said immediately_

cedar kindle
#

what i meant is that if possible you should avoid it, try to find other solutions but if there’s no way then 🤐

peak plover
#

Aye

#

I guess it'd get tedious if starting from scratch, but I usually just copy paste from template so I only had to name everything once

warm gorge
#

Just found out about 4 listbox/combobox commands that werent listed on the wiki until now. lbSetText, lbSetTextRight, lbSetColorRight, lbColorRight

still forum
#

Sets the color of the item (left) What is the item left?

warm gorge
#

I should probably reword that, I meant as in the left side of the item

#

Would "Sets the color of the left side text" be better? @still forum

still forum
#

What is left side text in a combo box?

lone glade
#

lbSetText is listed
lbSetTextRight... hm...

#

oh, I know

warm gorge
#

lbSetText wasnt even listed either

lone glade
#

it probably acts the same way as lbSetPictureRight

#

but for text

#

inb4 it has the same perf issues huehuehue

warm gorge
#

Performance issues?

lone glade
#

lbSetPictureRight has insane perf issues

#

it's slow as fuck

warm gorge
#

Interesting, never noticed that

lone glade
#

it's very obvious when you run perf profiling (dedmen's) and add / remove that command

#

on a listbox with 800+ items I gain 60-70ms

warm gorge
#

Probably worth sending in a bug tracker ticket about that then

lone glade
#

nah

#

those are old as fuck commands, I doubt they'll ever touch them

#

if they could fix how frame controls are drawn that would be nice

warm gorge
#

Theres a lot of issues I wish Bohemia would fix

#

@still forum The commands work the same in comboboxes as well. Left, and right side text can both be set so not sure how I could word that any better

still forum
#

how does left/right text in combo boxes look like?

warm gorge
still forum
#

Normally the text is centered though. Does that mean when you use setTextRight it automatically moves the otherwise centered text to the left?

#

If so that should definetly get a note on the wiki. And when you add that it's also clear what left/right text means

warm gorge
#

From what im aware the text is usually aligned to the left by default. When lbSetTextRight is used, the text is just aligned to the opposite right side.

peak plover
#

Does Error:No Unit mean objNull ?

still forum
#

Think so yeah.
Try yourself name objNull in dbg console

peak plover
#

Thanks

austere granite
#

or a dead unit

#

just do setDamage 1 on someone and check it's name, no worky

lone glade
#

sanatize
COMMMMMYYYYY

little eagle
#

Could also mean the entity is a vehicle and not a person.

#

Blame says Pabst did this.

#

Ironically in a commit called "fix typo".

lone glade
#

huehuehuehue

proven crystal
#

how do i immobilize a player without disabling animation or user input?

little eagle
#

attach them to a game logic.

proven crystal
#

im running a few actions there, during which they are on the ground, but they are still able to move and glitch around on the floor

#

whats that with the game logic?

little eagle
#
private _dummy = "Building" createVehicle getPos _unit;
_unit attachTo [_dummy];
#

There. Can't move anymore.

#

Forgot a ;

proven crystal
#

ahh... :)

meager heart
#

lol

little eagle
#

What's so funny?

meager heart
#

all cool 😂

proven crystal
#

actually appears like i could just attach the guys to any static object that already is on the map, they will just freez in place

meager heart
#

commy option ^ is better

proven crystal
#

why?

meager heart
#

to any static object that already is on the map

#

did you actually tried it ?

proven crystal
#

yup

#

i have one object with a variable name. its somewhere on the map. if i attach the player to that object, without giving any offset, they freez. i suppose it requires to remote exec the attach command if i do it from server

meager heart
#

...

still forum
#

@meager heart did you actually try it*

meager heart
#

wut

proven crystal
#

he is dropping grammar on you

still forum
#

grammar

#

I'm a german so I have to grammar nazi

meager heart
#

oh lol

proven crystal
#

ahh thats why i thought the same ^^

meager heart
#

sank u

#

@still forum

proven crystal
#

thats all we are sinking about

still forum
#

if i attach the player to that object, without giving any offset, they freez
Yes. Attached objects can't move

proven crystal
#

yep that is intended.

#

he asked whether i had tested it, so i let him know my result

meager heart
#

es ofcause 😄

neon snow
#

Can I check via sqf what weaponLockSystem selected weapon has?

shadow sapphire
#

Does anyone know of an object grabber system that grabs objects and their orientations and stores them as attachto coordinates from a central object??

#

@hasty violet, I see! Well, I figured I’d end up having to do it myself, just was hoping a script or something already existed. My community has deployable defensive compositions and some of them can get quite distorted if they aren’t kept simple. Hoping to fix that.

hasty violet
#

So can you take me through a timeline of what you want to happen, just to be clear? I still may be able to help.

unborn ether
#

so you're converting from world coordinates to model coordinates?
Use modelToWorld and worldToModel

next lily
#

Just be aware that those coords are AGL, not ASL.

winter rose
#

sooo some time ago I made a Dark Souls like script, where you can heal at some bonfire but also respawn all other enemies (besides some you wouldn't want respawnable)
it's pretty basic actually but works pretty well, would anyone be interested in this concept or have an idea on how it could go further than a POC?

next lily
#

@winter rose
Would it be possible to integrate it into some sort of dynamic simulation script suite?
e.g. you and your spotter buddy are out over several days looking for a particular target, each time you rest it changes the world around you by generating/despawning enemies, while still having some pre-set entities still exist waiting for (condition) to show up?

austere granite
#

antistasi like thing

winter rose
#

it's not its purpose actually; it's really like that : your enemies follow you, they run after you trying to kill you... you access to the bonfire and their bodies, alive or not, disappear and respawn at their original location

#

the little "fun" part was about keeping track of everything, but basically it's a respawn for every AI units (keeping their groups, formations and waypoints)
on respawn bodies are cleaned, there is no "hack" that you could use by killing a lot at the same place to loot; as soon as you "bonfire" the bodies are gone.

next lily
#

Does your equipment persist?

#

i.e. you loot their bodies over and over again.

#

so you could cheese more ammo.

winter rose
#

I didn't specify anything on that yet...
if I wanted to make a POC mission, maybe I would clear their equipment as soon as they are dead, and only rarely spawn something

#

and get your original gear back on bonfire, depending on your equipped weapons maybe

next lily
#

The real question is, what does this reset button accomplish that a restart wouldn't?

winter rose
#

nothing actually; that's the point
one could think of Dark Souls like missions where you try your best with your equipment, and you unlock checkpoints aka bonfires step by step

#

the enemies aren't dumbed down, you have to get better in order to progress

next lily
#

So, checkpoints through a level?

winter rose
#

checkpoints, if you die you respawn at a checkpoint (the one you like), and enemies respawn as well

next lily
#

So it's the respawn/restart system, just where you get to pick the respawn.

winter rose
#

we could reuse this one yes

shadow sapphire
#

@hasty violet, sorry for not replying for so long. I didn't realize you were still trying to help me.

  1. I create a base in Eden.
  2. I grab the objects from the center of the base.
  3. The composition is output as a script that creates a central object, then creates all other base objects as objects that are attachto the central object, resembling the original composition perfectly, regardless of where it is deployed.
exotic tinsel
#

does anyone have a script that works in multiplayer, that prevents players from being killed, just makes them incapacitated?

shadow sapphire
#

@hasty violet, we've tried all kinds of things. I am aware of the risks. The problem is that our bases are deployable in game by players, and there are certain things, like stacked H barriers that just don't work out well, even when we try applying fixes. We are building the new compositions with the possibility of clipping in mind, so we are stacking H barriers one layer below ground and ensuring our buildings are high enough, etc.

next lily
#

@LifeSnatcher#6222
The ACE mod is open source and has a bit in their medical module that is 'prevent instant death'.

peak plover
#

How cancer are PVEH?

#

I've never used, should I steer clear and keep using RE and functions?

cedar kindle
#

cba EHs are easier to work than pveh

meager heart
#

guys was using "gvars whitelists" and some weird solutions to feel more safe...
but now we have cfgRemoteExec, plus extra functionality with RE... why use pveh 🤷

still forum
#

@cedar kindle CBA EH's are PVEH's...

#

PVEH's have their purpose. So does remoteExec

cedar kindle
#

they’re a wrapper, never said they weren’t pvehs. still easier to work with

still forum
#

If you want to execute something remotely. Use remoteExec because it does exactly that.
If you want to execute code when a variable is updated then use a PVEH. Because it does exactly that.

warm gorge
#

How could I go about checking the distance of a unit to the edge of an object rather than the center? Some of my distance checks aren't very accurate for larger objects for seeing if their close enough or not, so I want to use the edge instead.

still forum
#

How far away? Like a couple meters and you need exact distance from you to the first edge of the object between unit's eyes and the objects center?

warm gorge
#

For example the Blackfish. I have a distance check for an interaction on it for 5 metres which works fine for most vehicles like hatchbacks etc, but for large vehicle like the VTOL it doesnt

still forum
warm gorge
#

Okay thank you, ill give that a go

silent saffron
#

Police dog script buy ..

still forum
#

@silent saffron No

ornate pawn
#

lol

still forum
#

He's already spamming BIF with double/cross posts about it. Atleast I think it's the same guy.

winter rose
#

lays bones on the ground in a pentagram to summon a moderator

vague hull
#

just found out that:
getTerrainhightASL POS < 0
is faster than
surfaceIsWater POS

I dont even know what to say

dim terrace
#

surfaceIsWater is working with ponds as far as I remember

still forum
#

Yeah. surfaceIsWater checks the type of the surface below that position.

young current
#

ponds ❤

#

still makes me smile

vague hull
#

Well then the wiki is wrong

#

first comment says it doesnt work with inland water

unborn ether
#

First time I see BIMinions message here

still forum
#

reyhard wrote 80 messages in here.... 😄

little eagle
#

The wiki is wrong? Can't be...

vague hull
#

the allmighty sqf bible never lies!

still forum
#

bibbly boo

errant jasper
#

I am starting to wonder whether the BIKI has actually saved me time, or cost me.

#

I mean, I am sure in the long run it has saved me. But more recently on the more advanced stuff I am not sure....

tough abyss
#

Meh it’s the undocumented commands that get me

still forum
#

For these just ask people who know ^^

tough abyss
#

What commands are undocumented?

wary vine
#

just double checking something, is there a way to save the contents of a container, withing a container (ie, backpack content, inside a crate ?)

still forum
#

@tough abyss Every command that exists but you don't know that it exists.

#

@wary vine Depends. If it has weapons with attachments then no. You cannot copy/move them via normal script

wary vine
#

hmm ill get a gif to explain

still forum
#

That doesn't explain much

tough abyss
#

@Dedmen Well, supportInfo should return all commands, shouldn't it?

still forum
#

Ah you want to read what is in the container while it is in another container?

#

@tough abyss Yes it does

wary vine
#

yeah

still forum
#

but it doesn't tell you what they do

tough abyss
#

I am sure we can get the info if we ask someone at BI directly.

still forum
wary vine
#

returns array

#

just the backpack

still forum
#

Yeah. Or someone else that knows. Which is exactly what I told Cloud @tough abyss 😄

#

Yeah... I know that backpackCargo returns array