#arma3_scripting

1 messages Β· Page 129 of 1

granite sky
#

As long as it's just informational and doesn't need to be clicked on then cutRsc is appropriate, I think.

flint topaz
#

You need to put the Reference in the config in a different spot ye

#

Rather than putting it at the base level you put it in class RscTitles

kindred zephyr
tender sable
#

I can say that if more and more hashmaps are passed into functions or hashmap objects become a more used thing, createhashmap will become just as widely used as objnull for params validation and such. Is it performance hindering? Is it more work than creating a 0 when validating numbers, etc.. ? I guess that would be the most widely used version of empty createhashmap for most people, I would think. So far in my projects, I have not seen it cause issue. Interesting question though.

granite sky
#

@kindred zephyr The Antistasi status bar does it by setting a UI namespace var for the display with an onLoad EH.

#

I don't know if there are more reasonable ways.

#

A similar method is described by Kronzky in the findDisplay wiki.

young whale
#

Hey all, I'm currently working on a cinematic and trying to spawn an explosion. I see this code being recommended but I don't know how to use it.

To spawn
bomb = "Bo_GBU12_LGB" createVehicle (getMarkerPos "bombmrk");

and

To Detonate
bomb setDamage1

#

From what i understand bombmrk is the props/variable name where the bomb should spawn, and the detonate function is set to the trigger

#

but I don't know where the bomb variable goes or what it belongs to

#

Does anyone have a suggestion on spawning a simple explosion?

hallow mortar
#

In this example, "bombmrk" is not a variable name, it's the name of a marker, hence it being a "string" and using getMarkerPos. However, if you don't want to use a marker, you could replace it with getPosATL and an object reference, or with a specific ATL position.

#

The bomb variable is being created to contain a reference to the bomb object itself. You might want to use a more unique name to avoid conflicts, but otherwise you don't need to do much with it.
In fact, you might not need to use it, or triggerAmmo, at all. Bombs have contact fuzes and will detonate instantly when they touch the ground or an object.

manic sigil
#

Is that a vanilla bomb? If theyre using a script they found online it may be using a modded bomb.

terse tinsel
#

hey, I have a script that shows enemy units on the map, how can I overwrite it to show friendly ones? [] spawn {

while {true} do {

{ if(!isPlayer _x && side _x != playerSide) then { player reveal [_x,4] } }forEach allUnits;

sleep 60;

}

};

still forum
terse tinsel
terse tinsel
stable dune
terse tinsel
nocturne bluff
#

gawd

#

I want to hump ya.

kindred zephyr
# granite sky A similar method is described by Kronzky in the findDisplay wiki.

Yeah, I was trying to do that but the picture I need to update doesnt really let me to.

I assumed it was due my relative path to the addon but im loading other images in other non-titles controls just fine without any issue.
Is there any limitation to controls set in titles?

Asking since setting the picture control with a default image works, but just not changing it when my script launches. Im almost sure it's an issue with getting the control itself and nothing more.

grizzled cliff
#

:D

#

i need to write some documentation and stuff before i make the github public

#

obviously ive only written those three wrappers so far

#

:D

#

need to figure out how to make a bunch of them into macros or something

#
        float random(float max_) {
            game_value max = functions.new_scalar(max_);
            game_value rand_val = functions.invoke_raw_unary(client::__sqf::unary__random__scalar_nan__ret__scalar_nan, &max);
            functions.free_value(&max);
            float rand = ((game_data_number *)rand_val.data)->number;
            functions.free_value(&rand_val);
            return rand;
        }

        object player() {
            game_value player_obj = functions.invoke_raw_nular(client::__sqf::nular__player__ret__object);
            return std::make_shared<object_ptr>(player_obj);
        }

        void side_chat(object obj_, const std::string &message_) {
            game_value message = functions.new_string(message_.c_str());
            functions.invoke_raw_binary(client::__sqf::binary__sidechat__object_array__string__ret__nothing, &obj_->rv_obj, &message);
            functions.free_value(&message);
        }
#

those are how simple the wrappers are though

#

but yea, memory is being freed perfectly, multiple threads (ran 300 threads at once earlier in testing with no races/deadlocks)

#

good shit

plush summit
#

Hey guys, just wanted to know how I would set a variable to an object in game, this is a preplaced object.

proven charm
plush summit
#

so I would do something like

land_ChaosStar1 SetVariable ["_chaos", chaos];
#

would this mean the item named land_chaosStar1 would have the variable name of chaos? or would it be _chaos

proven charm
#

_ is only if you are declaring local variable in script

still forum
#

Would be valid there too. unusual but would be fine to use

proven charm
#

so remove that

plush summit
#

I see, so am I able to just have chaos and chaos and that wont cause problems? I assume

proven charm
#

yea you can code like that if you wish but no need to have it

plush summit
proven charm
#

nope you get the variable with the getVariable command

#
private _theChaosVar = land_ChaosStar1 getVariable "chaos";
plush summit
#

ahhhhh yes this is all coming together, thank you heaps im just so close to getting the variable stuff, thank you for letting me know

proven charm
#

yw

nocturne bluff
#

Niiice.

plush summit
plush summit
proven charm
#

sure

#

or script

plush summit
#

hmm okay, im just getting an undefined variable in expression error is all, I put it in a game logic too and did the code provided - I just changed _theChaosVar to just _chaos

proven charm
#

hard to say without the full error message

plush summit
#

Sorry was trying to get image

proven charm
#

looks like you havent done setVariable before the getVariable

#

order is crucial

hallow mortar
#

This isn't right and doesn't address the original problem

#

There's been a misunderstanding

plush summit
#

How do you mean

hallow mortar
#

GC8 is trying to show you how to use setVariable to store a variable in the object's namespace. You want to set the object's global variable name. These are different things

#

If you have an Editor-placed object, you can open its Attributes and change its variable name in the appropriate field at the top

#

You then refer to that name in scripts

plush summit
#

Sorry if I didn't explain what I was after properly, im trying to understand how to do this specific thing and i've only got it barely working just this part seems to get me messed up

flint topaz
nocturne bluff
#

From my gatherings, it dosent look like you need to load it with arma 3 extstentions, can i run it from another dll?

plush summit
#

I thought if I gave it a variable name it would fix this issue

hallow mortar
#

When you set the variable name in the Editor Attributes, you are giving it a variable name, and that variable contains an Object reference

#

If you did that and got a wrong type error, then the problem was probably wrong syntax for the command you tried to use it with

plush summit
#

I see, ill try doing more research then and if I get stuck ill come back, sorry for the fuckabout - thank you @proven charm for trying to help

proven charm
#

hope you get it sorted

kindred zephyr
proven charm
#

titles can have onLoad/onUnload in the config

grizzled cliff
#

you have to load dlls through my dll

granite sky
#

Note that unscheduled onLoad is always a bit weird because it fires before the controls are created.

#

Hence people often spawn it for the probably-one-frame delay.

kindred zephyr
winter field
#

Pretty damn cool!

sturdy kernel
#

So I have a onPlayerRespawn sqf that does the moveOut command when a player respawns. In testing it works in sp/mp but when testing it in the dedicated server it does not. Is there something extra that I'm missing to make it work on the dedicated server?

molten yacht
#

Is there a way to enable the underwater sound filter on things that aren't actually underwater?

winter rose
#

no

molten yacht
#

Is there a way to enable a custom sound filter on a player by script?

winter rose
#

no

molten yacht
#

....Is there any way to make gunshots sound muffled with a script

#

without actually being underwater

fair drum
molten yacht
#

No, sorry... Ugh, this feels impossible.

fair drum
#

Nah just a lot of work lol

molten yacht
#

No I mean it's only supposed to activate while they're "outside" aka in space.

#

I'll just skip it.

#

Different question... You can override parts of CfgWorlds in the description.ext, but is there any listing of what parts you can do this to and what parts you can't?

fair drum
#

The ones listed on the wiki page for description.ext are what you can change. You can't really modify much without making your own version of the map in world builder and configs.

#

The modifications in the description file are mainly just for presentation

molten yacht
#

As part of an addon, could one essentially duplicate a world and only change a few things about it?

#

For instance, a copy of the same map with all of the town names changed.

fair drum
#

Yes

#

You can even patch maps already there to change their originals

#

You can also change all the locations/names by script too btw

molten yacht
#

We did that for fapovo because one of the locations had a slur in it - wait what

#

you can??

fair drum
#

Standby for pastebin

fair drum
molten yacht
#

ohhh beast

#

That's great

fair drum
#

ignore the script_component thing, I just use CBA framework for most of my stuff, but it looks like I don't use it in this function

granite sky
sturdy kernel
#

All testing works in sp/mp but when spawning using the mission on the dedicated server it does not kick me out

granite sky
#

Are you kicking out the old unit/corpse or not?

#

Because that sounds like you're trying to kick out a completely different player?

sturdy kernel
#

im not sure. the only thing in my respawnsqf is moveout player;

hallow mortar
#

If you literally use player then it's probably moving out the new player unit

#

Oh, that's what you want to do....I think?

sturdy kernel
#

Is that ot what i want though? When aplayer spawns intot he vic to kick them out and the repeat if another player sapwns into it?

#

Yea exactly whena player spawns i want it to kickthem out and free up the vic to be able to spawn in agian

hallow mortar
#

Then possibly it's doing the opposite of what I said

granite sky
#

hmm. My recollection is that player is the new unit at the point of onPlayerRespawn, and it's also local. So I'm not sure why it'd break.

#

Maybe if the player being moved into the vehicle happens afterwards.

#

Sounds like diag_log debugging time anyway.

hallow mortar
sturdy kernel
#

thanks for the info will dig into it more

kindred zephyr
sturdy kernel
#

Sorted my issue seems it was a network delay on dedicated server what fixed it was adding a small delay before executign sqf

granite sky
#

network delay of what though...

fair drum
#

its probably a execute next frame kinda thing

kindred zephyr
opal zephyr
#

Does anyone know what this line actually means from the getTextureInfo page? "Multiply the pixel values by pixelW and pixelH to get screen coordinates."

the wording seems to imply a coordinate on the screen, but the value they seem to be suggesting to multiply by pixelW is the resolution of the texture? that doesnt sound right...

granite sky
#

For what purpose?

#

wiki seems to be making an assumption there.

#

Texels are texels, just ignore it.

opal zephyr
#

I thought I might be able to use it to get the on screen location of the texture, but that seemed a little outlandish given the purpose of the command, thought id ask anyway though

granite sky
#

yeah it's not gonna do anything like that.

opal zephyr
#

You don't happen to know of any way to do something like that? Or get the color of a 3d point?

#

ie, I shoot a ray at a wall, and get the color of that point, not the avg color of the whole texture

granite sky
#

Nah, it's not actually very plausible.

#

Rendering doesn't happen in-line.

opal zephyr
#

Hm

#

Thats annoying, I'll keep looking for a method to achieve something similar though

meager granite
opal zephyr
#

Ah, thankyou

granite sky
#

hmm. Is there even an SQF command to sample the colour of an image at a point?

opal zephyr
#

I wonder if you could split the image into parts using ui2texture and then get the colors of those parts perhaps

meager granite
opal zephyr
#

Thats a good point

#

wait, yes I think you can calculate the avg color of a texture made with ui2texture, I think I've done it before

opal zephyr
#

ya.. that gets the average texture, and I believe it works for textures created with ui2tex

granite sky
#

huh, although I suppose you could use ui2texture to do a single-pixel sample. What a horrible idea.

opal zephyr
#

In short terms I wanted to find a way to sort of convert a 3d position into a texture coordinate. A unfortunate way I thought of was to use a color grid on the uv and then get the colors at 3d points to find the corresponding uv location

granite sky
#

If you know where the object is in 3d space then you can just do the projection yourself.

still forum
still forum
still forum
#

Sounds similar to what I was doing with in-world 3D UI

#

You have a plane in the world. With a texture stretched from corner to corner.

You can raytrace to find what position you're aiming at.

You know where the top left corner is and which orientation the plane is.

Using that you can calculate the X/Y of the ray trace hit, in percent of the plane.
The U/V coordinates.

Like 50%/50% is right in middle.

Then if you know texture size, you can multiply by the percentage to get pixel coordinates.
Tadaa mouse cursor on a texture controlled by where you're aiming

oblique arrow
#

Helloh I need help again
I just wanted to do a neat little detail of a guy standing on the road looping an animation pointing to the road the players have to take ("Acts_JetsMarshallingRight_loop")
I hath failed πŸ˜…

I joinked this from the internet which made sense to me

this switchMove "Acts_JetsMarshallingRight_loop";  
this addEventHandler [ "AnimDone", {  
  params[ "_unit", "_anim" ];  
  if ( _anim == "Acts_JetsMarshallingRight_loop" ) then {  
    this playMove "Acts_JetsMarshallingRight_loop";  
  };  
}];  
this disableAI "ANIM";

However it dont work, it plays once and then never again for the entirety of the rest of the mission πŸ˜…
Interestingly when I try executing it on the unit as zeus it does work, but then it throws an error about switchMove getting an array(??) but thats propably some behind the scenes magic problems I dont understand
Any chance you smart peeps can fix it for me πŸ˜… πŸ˜„ ?

stable dune
#

this , you have in eh this, should be _unit

oblique arrow
#

ooh yeah

#

no worky πŸ€”

warm hedge
#

_this there in the EH is an array, and params defines what you need - _unit

oblique arrow
#

Yee no worky with _unit either though

warm hedge
#

Hm then, make sure your EH is actually working

oblique arrow
#
this switchMove "Acts_JetsMarshallingRight_loop";   
this addEventHandler [ "AnimDone", {   
  params[ "_unit", "_anim" ];   
  if ( _anim == "Acts_JetsMarshallingRight_loop" ) then {   
    _unit playMove "Acts_JetsMarshallingRight_loop";   
  };   
}];   
this disableAI "ANIM";
#

Tried adding a hint to the EH but it doesnt fire either

little raptor
#

so it never gets "done"

#
this switchMove "Acts_JetsMarshallingRight_loop";
this playMoveNow "Acts_JetsMarshallingRight_loop";
this addEventHandler [ "AnimDone", {   
  params[ "_unit", "_anim" ];   
  if ( _anim == "Acts_JetsMarshallingRight_loop" ) then {   
    _unit playMoveNow "Acts_JetsMarshallingRight_loop";   
  };   
}];   
this disableAI "ANIM";
#

this is also stated on the wiki page for switchMove

oblique arrow
#

But still no luck I think

little raptor
#

what if you add a switchMove in the EH too?

oblique arrow
#
this switchMove "Acts_JetsMarshallingRight_loop"; 
this playMoveNow "Acts_JetsMarshallingRight_loop"; 
this addEventHandler [ "AnimDone", {    
  params[ "_unit", "_anim" ];    
  if ( _anim == "Acts_JetsMarshallingRight_loop" ) then {    
_unit playMoveNow "Acts_JetsMarshallingRight_loop";   
 _unit switchMove "Acts_JetsMarshallingRight_loop"; 
  };    
}];    
this disableAI "ANIM";
little raptor
#

switch comes before play

oblique arrow
#

"Oh I'll add a cool little immersive guy pointing down the road" I thought
"I'm sure it wont take long to make, propably a command or two" I thought πŸ˜„

#

NΓΆp

little raptor
#

just do disableAI "ALL" instead of ANIM

oblique arrow
#

He's still standing there, menacingly!

little raptor
#

can you try it via debug console while mission is running to see if it works at all?

#

(use the variable name of the unit isntead of this)

oblique arrow
#

owoYay debug console seems to work

#

now the question is why init no worki

oblique arrow
#

tbh since dev console works I might just start it that way at mission start and delete him if the script acts up πŸ˜…

#

they're supposed to drive past him like once

stable dune
little raptor
# oblique arrow now the question is why init no worki

just add some delay

this spawn {
  _this switchMove "Acts_JetsMarshallingRight_loop"; 
  _this playMoveNow "Acts_JetsMarshallingRight_loop"; 
  _this  addEventHandler [ "AnimDone", {    
    params[ "_unit", "_anim" ];    
    if ( _anim == "Acts_JetsMarshallingRight_loop" ) then {
      _unit switchMove "Acts_JetsMarshallingRight_loop"; 
      _unit playMoveNow "Acts_JetsMarshallingRight_loop";   
    };    
  }];    
  _this disableAI "ANIM";
}
oblique arrow
#

thanku <3

#

You get another one of my big smart coder man stars ⭐

grim pasture
#

Hi, I could use some help.
I got a helicopter with an agent as pilot. I want to make it move to and hover over a certain object.
I'm using setDestination to make it move there but I can't figure out how to actually make it stop and over over the object.
How can I do this?

grim pasture
#

vehicle planned

#

This is what I'm trying rn.
Limiting speed doesn't help, different planning modes don't make a difference, the hint "stopped" shows when I use VEHICLE PLANNED but it still doesn't stop.
It just circles around the object every time.

_heli = createVehicle ["B_CTRG_Heli_Transport_01_sand_F", getPos this, [], 0, "FLY"];
_agent = createAgent ["B_Helipilot_F", getPos this, [], 0, "NONE"];
_agent moveInDriver _heli;
_heli limitSpeed 50;
_agent setDestination [getPos box, "VEHICLE PLANNED", false];
[_agent] spawn { params ["_agent"];
    waitUntil{ moveToCompleted _agent};
    doStop _agent;
    hint "stopped";
};```
#

("this" is a logic object and "box" is the object I want it to hover above)

proven charm
#

with move waypoint you could probably make the heli move towards the WP but not precisely above it (don't know if thats good enough for you)

grim pasture
#

unfortunately hovering above the object is exactly what I'm trying to achieve

proven charm
#

well if you put invisible landing pad there the heli can land on that but idk about hover...

grim pasture
#

I guess that'll be my solution if I can't make it hover

hallow mortar
#

Unfortunately, vehicle AI in Arma is simply not capable of being perfectly precise outside of some very specific circumstances.
There are a couple of alternate modes for the land command (and in 2.18, landAt) that allegedly cause the helo to enter a low-level hover over the chosen pad, so that might be useful for you. However, until the landAt alt syntax arrives, there's no way to force the AI to choose a particular pad, so if there are several nearby it's an exercise in hoping they choose the right one on their own.

grim pasture
#

Well, maybe it works in the future then. I'll play around with speed limits. Maybe that'll deliver satisfying results.
Thanks anyway for trying to help.

cosmic lichen
#

If it's singleplayer you could record your own path and play it.

errant jay
errant jay
#

ah, it goes there

#

thanks

grim pasture
# cosmic lichen If it's singleplayer you could record your own path and play it.

Not singleplayer and I want to be able to adapt it to different objects, so that's also not an option.
This is a satisfying solution so far if anyone's interested.

_heli = createVehicle ["B_CTRG_Heli_Transport_01_sand_F", getPos this, [], 0, "FLY"]; 
_agent = createAgent ["B_Helipilot_F", getPos this, [], 0, "NONE"]; 
_agent moveInDriver _heli; 
_agent setDestination [getPos box, "VEHICLE PLANNED", false];
[_agent] spawn { 
    params ["_agent"];
    waitUntil{ sleep 0.1; vehicle _agent distance2D box < (speed vehicle _agent) * 2;};
    hint "hitting brakes";
    vehicle _agent limitSpeed 15;
    waitUntil{ sleep 0.1; vehicle _agent distance2D box < 5;};
    hint "decending";    
    vehicle _agent limitSpeed 0;
    vehicle _agent flyInHeight [10, true];
};```
Only the flyInHeight doesn't seem to work.
proven charm
#

probably not since you create the heli in same script

#

maybe limitSpeed prevents flyInHeight from working

grim pasture
# proven charm maybe locality issue? are you running on dedi?

Just testing it in the editor.
Setting the height to 5 or 7 worked for some reason. I haven't tried setting it to anything higher than 10.
I wanted it to go a bit lower than the regular flying height but considering that the script I have now makes it hover only close to the object and not right above it, any tree or building in the area becomes a risk. So I'll just leave it at the standard height.

proven charm
#

cool

opal zephyr
real tartan
#

looking for some performance increase using event handlers, where I am checking if player enter some area ( player inArea "marker" ). I usually do some loop, while/waitUntill with player inArea "marker" and some sleep time. Wondering if using AnimDone is a good idea for this or some nice alternative, other than loop.

fair drum
real tartan
#

I don't need to check position that often, so trigger ( 0.5s ) or each frame is out of option, as I usually do loop with 1+ seconds.

#

CBA is nice, but looking for missions with dependency

still forum
opal zephyr
cosmic lichen
#

Maybe I am imagining that, but wasn't there a function to turn a number representing a month into the localized month name?

still forum
#

str_3den_attributes_date_month7_text is July
pretty easy to make yourself with one format

winter rose
cosmic lichen
#

Oh I see now, it's even month<Number>...well that's too easy. I am not used to that πŸ˜„

steep verge
#

Hello gents. I am trying to hide an object locally for just only one particular player in MP via the remoteExec function, but it doesn't seem to work.

#

[s1,false] remoteExec ["hideObject",player2,false];

#

Someone maybe has an advice? Cheers.

little raptor
#

where do you run it from?

steep verge
#

The object is already hidden via // s1 hideObject true

#

And it should unhide it for player2

steep verge
#

With Any Player present activation

little raptor
#

print s1 and player2 to see if they're defined at all

steep verge
#

I don't know how to print those, but i can assure they are both defined in the object attributes

little raptor
#

systemChat str [s1, player2]

steep verge
#

The remoteExec which should unhide the object (a green VR arrow marker) works also, but it does unhide the object for every player slot that i am trying to test.

#

As it should unhide it only for player2, at least that's what i am trying to achieve πŸ™‚

proven charm
steep verge
#

To avoid further confusion:

proven charm
#

oh ok

steep verge
#

The object (s1) is already hidden via // s1 hideObject true;

#

now i have a trigger which calls // [s1,false] remoteExec ["hideObject",player2,false];

#

on activation

#

and it does work in this way, that it unhides the object (s1) but for everyone

#

I am trying to achieve, that the object (s1) unhides only locally for player2

little raptor
#

what you wrote should only unhide it locally.
is there anything else that could affect the object?
also what kind of object is it?

little raptor
proven charm
#

^^^^ could be timing

steep verge
#

This is the object which i am trying to hide, a simple green VR arrow:

steep verge
little raptor
#

well that's the issue then

steep verge
#

oh

#

How could it be run properly? I am sorry for such obvious questions, but i am fairly new to arma scripting.

little raptor
#

I need more details. what are you trying to do exactly?

steep verge
#

I have some interactions on a crashed vehicle, which i want to highlight with a green VR arrow for particular, specialized player slots.

#

So that the arrow is hidden, till a particular player object (player2) is in proximity, so it unhides, but only for him locally, so that others don't see it.

#

I don't know if that makes sense

little raptor
#

if the object is hidden by default, why do you run s1 hideObject true via a trigger tho?

steep verge
#

my bad once again, i apologize

#

s1 hideObject true; is run in the object init

#

only remoteExec to unhide the object is run via the trigger

little raptor
# steep verge

it should be correct then
tho you don't really write the var name in the init field of objects. you write this instead
also you can just uncheck the Show Model (iirc) option in special state

how do you test this?

jade acorn
#

I wanted to attach a lamp to inside of a car to simulate interior lighting, but the vehicle does not move anymore apparently due to collision? which I though is disabled when attaching an object. What do?

#

disableCollisionWith does not work when I set it between all three objects (driver, car, lamp) so I guess it's tied to physx but that's all I figured out

jade acorn
#

nvm once it's above the driver it's all good, even if within the vehicle boundaries. shrug

molten yacht
#

Does setText not work anymore?

#
private _nearestCity = nearestLocation [getPos player, "nameCity"];
systemChat str _nearestCity;
systemChat str text _nearestCity;
_nearestCity setText "Test City";```
#

Stays the same after running the command.

granite sky
#

If it's not a location you created in script then you may need to clone it with createLocation first.

molten yacht
#

Hmm.

granite sky
#

terrain locations aren't directly editable.

molten yacht
#

Ohh, I see.

#

Thanks!

steep verge
fleet sand
molten yacht
#

Yeah, I got it working

formal stirrup
#

Could one theoretcly make something float in the air/ float forward in the air smoothly?

granite sky
#

Given a completely open interpretation of "something", yes.

formal stirrup
#

Something that would fall otherwise

granite sky
#

If it's a physX object then you can either attach it to something invisible or disable simulation on it.

formal stirrup
#

That would work for keeping it still, but moving it forward while still looking smooth wouldnt work with that

granite sky
#

Well, the attach one does. Disabling simulation can mess with network updates, yes.

#

If the question is "Is there a method that isn't a pain in the arse" then probably no.

formal stirrup
#

Im fine with pain the arse, I need it to mainly work with scripted movement

granite sky
#

eachFrame handler + setVelocityTransformation would probably work too.

formal stirrup
#

Would using CBA keybinds then applying the frame eventhandler while the key is down, be viable

manic kettle
errant jay
#

This may be somehwat of a complicated task perhaps, and dont know if its possible, but:

Making only certain players get Infinite Stamina/No Fatigue (ACE3), during mission.
I'd guess it's roughly that the players would be in 1 group, and then work with that somehow, if its possible?

proven charm
jade acorn
#

this does not disable ACE fatigue

proven charm
#

oh ace... havent used that my self

#

well dig up the ace stamina functions and do the same as above πŸ™‚

errant jay
proven charm
#

just one player, but you can make all players run that code with remoteExec for example

#

if you want it for players and not AIs you can simply run fatigue enable for each player in client start up scripts

errant jay
#

each player that is supposed to have it, having to run remoteexec is not the thing i'm looking for

proven charm
errant jay
#

but that does for all players that join mission?

proven charm
#

yes

errant jay
#

so its not the thing im looking for

proven charm
#

put if conditions there...

errant jay
#

and with those, how i do it so that only the certain players get it, steamids?

proven charm
#
// disable fatigue 
};```
#

something like that

#

where those numbers are player ids

errant jay
#

hmm, thanks, will try that out

stable dune
#

And see info of fatieque
"When the player dies enableFatigue is set to true after the respawn"

proper sigil
#

I have an "reloaded "EH in onPlayerRespawn.sqf file. Inside of it I have piece of code, which requires to be run server side, as it's an write operation on inidb2 ini file.

        params ["_unit", "_weapon", "_muzzle", "_newMagazine", "_oldMagazine"];
...

                dnt_ammoCount = dnt_ammoCount - 1; 
                publicVariable "dnt_ammoCount"; //This is broadcasted fine
                            
                _inidbi = ["new","Quartermasters_logbook"] call OO_INIDBI; 
                ["write", ["Supply count", "Ammo", dnt_ammoCount]] call _inidbi; // This one isn't
...

I understand, as both event file and EH are local the operation is only done on client but I need this writing operation to happen after this EH fires. Any ideas how to go around it? Tried remoteExec but to no effect

stiff kiln
#

I'm currently trying to create a custom supply drop with ACE Rearm enabled using "ace_rearm_fnc_makeSource". But I'm running in to trouble getting it to work as it should on a dedicated server. The option doesn't show up "live" for connected clients. But if you back out to lobby and load back in again, the option now shows.

I've been trying to solve this for several weeks now, with no luck. If anyone has any ideas on this, I would really appreciate it.

My starting point was to simply put this line in the "Crate Init" field of the supply drop support module: [_this, 1200] call ace_rearm_fnc_makeSource;Works fine when testing through the editor, but doesn't work on a dedicated server.

I've tried running it using remoteExec, remoteExecCall, BIS_fnc_MP.
Suspected for a while that there might a locality issue with the '_this' variable, and tried this to make sure it gets recognized. Also in combination with the above methods.private _vehSupplyBox = _this; _vehSupplyBox setVehicleVarName "VehSupplyBox"; VehSupplyBox = _vehSupplyBox; publicVariable "VehSupplyBox"; [VehSupplyBox,1200] call ace_rearm_fnc_makeSource;

Running it through the debug console has the same result.

fleet sand
stiff kiln
fleet sand
#

And where are you calling the script from ?

#

If you are calling from the Zeus you would do something like this:

private _veh = _this;
[_veh,1200] remoteExec ["ace_rearm_fnc_makeSource",[0,-2] select isDedicated];
stiff kiln
#

I've tested serveral different ways. The most basic one being [_this,1200] remoteExec ["ace_rearm_fnc_makeSource",2];

stiff kiln
stiff kiln
fleet sand
#

Try this with debug console while looking at the object.

private _veh = cursorTarget;
[_veh,1200] remoteExec ["ace_rearm_fnc_makeSource",2];
stiff kiln
#

Every place, and every way I run it. The option doesn't appear until you reinit.

fleet sand
stiff kiln
stiff kiln
fleet sand
stiff kiln
fleet sand
#

If this dosent work then its the fnc that is preventing and you need to reinit the settings to be able to see it.

stiff kiln
foggy hedge
#

How can I automatically go from a objectsGrabber output to a objectsMapper input? My problem is that objectsGrabber appends a header multiline comment with various debug information, and objectsMapper just wants the array that comes after the comment in objectsGrabber. I tried using compile to translate between objectsGrabber's string output to code, but that doesn't seem to support comments.

TLDR: I have a string that contains a multiline comment and an array, how do I strip the comment from the string and return only the array

granite sky
#

Might work:
_string select [(_string find "*/") + 2];

fleet sand
granite sky
#

well, you'd need to parse the array afterwards I guess.

#

I don't know how picky parseSimpleArray is.

#

You could skip the comment stripping and just run call compile on the whole thing, I guess. Depends how much you trust it.

fleet sand
foggy hedge
#

output from objectsGrabber

"/*Grab data:
Mission: tas_ricky_the-graveyard-of-empires_v11
World: takistan
Anchor position: [4686.19, 9504.07]
Area size: 10
Using orientation of objects: yes
*/

[
    [""Land_Pillow_F"",[-0.231934,-1.67676,3.05176e-005],34.4123,1,0,[-0.97433,-2.78492],"""","""",true,false]
]"

end goal is to have the following as just an array:

[
    [""Land_Pillow_F"",[-0.231934,-1.67676,3.05176e-005],34.4123,1,0,[-0.97433,-2.78492],"""","""",true,false]
]
foggy hedge
#

lemme go rerun it to get exact error

#

call compile "/* test */ 1 + 1" results in "unsupported number in expression"

call compile "1 + 1" results in 2

granite sky
#

I guess you'd need the preprocess then.

#

but that only works on files, not strings.

foggy hedge
#

yeah, thats an issue

granite sky
#

Use the find/select method then. Assuming that the data format is consistent it should be fine.

foggy hedge
#

alrighty, checking that

granite sky
#

Might need a second one to chop to the first bracket afterwards.

foggy hedge
#

forgot about the wonders of select for strings

granite sky
#

In theory you could rewrite the whole preprocessor in SQF. I don't know if anyone's done that :P

foggy hedge
#

now that would be something lmao

fleet sand
foggy hedge
#

yep, currently using the select [start,end] syntax

kindred zephyr
#

can engine actions (ie inputActions) be monitored without having to loop or the only actual way to do it is with custom eventHandlers in vanilla A3?

foggy hedge
#

... adding any find command seems to break the script completely. For example, I added the following near the middle of my code:

private _rawObjectdata = [_position, _radius, true] call BIS_fnc_objectsGrabber;
private _start = (_rawObjectdata find "*/") + 2;
private _end = (_rawObjectdata find ']"');

Whenever I execute the function this is in, none of my debug print statements appear (even those at the very start before anything else) and the script never completes until I exit the mission (at which point I can see my debug prints and etc in my logs).

I have no idea what's going on.

granite sky
#

You don't need to find the end.

#

btw, you're not actually using BIS_fnc_objectsGrabber to string-process it immediately, are you?

foggy hedge
granite sky
#

I mean if you just want an array of nearby objects then there are better methods.

foggy hedge
#

My usage case is that I need to save and then at a later time precisely re-create objects within 10 meters of a given position, with their relative distances unchanged. I assumed objectsGrabber/Mapper would be the best tool to use given the relative positions part.

granite sky
#

Why are you processing the string in that case though?

#

oh, objectsMapper doesn't just take the string?

#

weird

foggy hedge
#

i will say, the header string with all the information is pretty useful for when you're doing it manually

#

just not good for automatic stuff like what I'm trying to do

hallow mortar
fleet sand
foggy hedge
#

it's a good practice to have, I think in some of my old script files I still have random local variables starting with a _ that I never added private to

#

and its more readable

#

if something breaks and you need to make debug prints of each step, segmenting it like that saves a lot of time

hallow mortar
# foggy hedge it's a good practice to have, I think in some of my old script files I still hav...

Making things private isn't what I'm getting at. I understand the purpose of that and why most variables should be private. And I understand the reason to declare variables all at once early on. What I'm questioning is assigning things to private variables that were already a private variable (private _vehicle = _this? Just use _this) or were already readable and should never be used again (if you need that file path more than once in the same file, you should've made a function). That's just adding a redundant private _blah = ... line, particularly in a simple example where a new player might think the private line was important to how it works.

prime ether
#

i cannot seem to get a script running using init.sqf and i cannot figure out why, first time using init.sqf and all that, im specifically trying to get a script folder working called SCCLoot-0.5 thats on the forums. if anyone could assist me that'd be dandy

fleet sand
# hallow mortar Making things private isn't what I'm getting at. I understand the purpose of tha...

Well primarly i use it so i can read it better code example:

private _unitsCheck = allUnits select {alive _x and typeOf _x == 'UK3CB_ADE_O_TL'};
private _areaCenter = [0,0,0];
private _unitsINArea = _unitsCheck inAreaArray [_areaCenter, 200, 200, 200, false, 200];
private _unitsClosesToCenter = _unitsInArea apply {[_areaCenter distanceSqr _x,_x]};
_unitsClosesToCenter sort true;
private _closesUnit = (_unitsClosesToCenter select 0) param [1,objNull];

//Above or Below

_unitsCheck = allUnits select {alive _x and typeOf _x == 'UK3CB_ADE_O_TL'};
_areaCenter = [0,0,0];
_unitsINArea = _unitsCheck inAreaArray [_areaCenter, 200, 200, 200, false, 200];
_unitsClosesToCenter = _unitsInArea apply {[_areaCenter distanceSqr _x,_x]};
_unitsClosesToCenter sort true;
_closesUnit = (_unitsClosesToCenter select 0) param [1,objNull];

Also i had couple of instances where it wouldnt read especialy in Init of a object for soem reasoun this wouldnt run until you declare it in a variable:

[this,25] spawn {
    params ["_vehicle","_maxSpeed"];
};

//
private _veh = this;
[_veh ,25] spawn {
    params ["_vehicle","_maxSpeed"];
};
fleet sand
prime ether
jade acorn
#

you might have missed the "Place the 'SCCLoot' folder inside the root mission directory." point

prime ether
#

is this the correct location then

#

or have I misunderstood where root mission directory is

jade acorn
#

open that SCCLoot folder, I think the one you are actually supposed to place in your mission is within it

prime ether
hallow mortar
#

In that case, remove the -0.5 from the folder name

#

You can see in the piece of code you pasted, the file path it's looking for has a folder called "SCCLoot" specifically

fleet sand
#

Yea what Nikko said remove -0.5 from the foler and it should work.

prime ether
#

i actually had a facepalm moment

#

like i know how to code

#

and i missed that

#

thanks so much

fleet sand
prime ether
#

cheers

kindred zephyr
prime ether
#

i have a new dillemma

#

this appears but there is neither of these undefined expressions are in the code

granite sky
#

One does not debug with showScriptErrors. Instead, find the RPT file and look for the first error in there.

prime ether
#

ok

#

where would i find that

granite sky
#

client/localhost? Users/[username]/AppData/Local/Arma 3

fleet sand
#

!rpt

wicked roostBOT
#
Arma RPT

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

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

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

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

prime ether
#

do i need to run the mission, as in not in Eden

#

to generate an .RPT

granite sky
#

No, running the mission in Eden is fine.

#

RPTs aren't per-mission, they're created each time you start Arma and log events whenever they occur.

#

Unless you have -noLogs set, which obviously you shouldn't.

prime ether
#
10:25:14 Error in expression <
scclootDefault = [
["ACE_CableTie",90]
["ACE_Chemlight_Orange",75]
[" ",75]
[" >
10:25:14   Error position: <["ACE_Chemlight_Orange",75]
[" ",75]
[" >
10:25:14   Error Missing ]
10:25:14 File C:\Users\Myles\Documents\Arma 3 - Other Profiles\Matress%20\missions\Prototype_Survivalist.Stratis\SCCLoot\Config\lootTables.sqf..., line 10
10:25:14 Error in expression <
scclootDefault = [
["ACE_CableTie",90]
["ACE_Chemlight_Orange",75]
[" ",75]
[" >
10:25:14   Error position: <["ACE_Chemlight_Orange",75]
[" ",75]
[" >
10:25:14   Error Missing ]
10:25:14 File C:\Users\Myles\Documents\Arma 3 - Other Profiles\Matress%20\missions\Prototype_Survivalist.Stratis\SCCLoot\Config\lootTables.sqf..., line 10
10:25:14 Error in expression <tIndustrial;
};

case 3: {
_lootArray = scclootMilitary;
};

case 4: {
_lootArra>
10:25:14   Error position: <scclootMilitary;
};

case 4: {
_lootArra>
10:25:14   Error Undefined variable in expression: scclootmilitary
10:25:14 File C:\Users\Myles\Documents\Arma 3 - Other Profiles\Matress%20\missions\Prototype_Survivalist.Stratis\SCCLoot\System\lootSpawn.sqf..., line 58
10:25:14 Error in expression < {
_lootArray = scclootDefault;
};

};

_lootArray;

};

while {scclootEnableSpa>
10:25:14   Error position: <_lootArray;

};

while {scclootEnableSpa>
10:25:14   Error Undefined variable in expression: _lootarray
10:25:14 File C:\Users\Myles\Documents\Arma 3 - Other Profiles\Matress%20\missions\Prototype_Survivalist.Stratis\SCCLoot\System\lootSpawn.sqf..., line 75
10:25:14 Error in expression <tIndustrial;
};

case 3: {
_lootArray = scclootMilitary;
};

case 4: {
_lootArra>
10:25:14   Error position: <scclootMilitary;
};

case 4: {
_lootArra>
hallow mortar
#

There's a syntax error in your loot table definitions

#

Array elements must be separated by , - even when those elements are themselves arrays

#

Because those arrays are wrong, the loot tables aren't being defined, and this is causing a cascade of errors as various things try to use the loot tables and fail

#

Example:

scclootDefault = [
  ["ACE_CableTie",90]
  ["ACE_Chemlight_Orange",75]
];```
should be:
```sqf
scclootDefault = [
  ["ACE_CableTie",90],
  ["ACE_Chemlight_Orange",75]
];```
prime ether
#

OK thanks

#

thats

#

dear god a lot of commas incoming

#

its 20 minutes pre-op, you saved my ass

#

thank you

tough abyss
#

Someone how to know how to put animation of environmental soldiers?

#

full vanila no mod

kindred zephyr
#

Hey fellas,

I'm trying to obtain the angle in degrees between 2 vectors that are usually opposite to each other. However I'm getting some weird results, could anyone give me a pointer in what could be going wrong?

_VecPosBeg = _unit weaponDirection (currentWeapon _unit);

systemChat format ["Weapon direction Vector: %1", _VecPosBeg];

_unitDirectionRelativeToCheck = _VecPosBeg vectorFromTo (eyeDirection _enemy);

systemChat (format ["Current calculated vector: %1", _unitDirectionRelativeToCheck]);
systemChat (format ["Current enemy direction vector: %1", eyeDirection _enemy]);

_dot = _VecPosBeg vectorDotProduct _unitDirectionRelativeToCheck;
_mag1 = vectorMagnitude _VecPosBeg ; 
_mag2 = vectorMagnitude _unitDirectionRelativeToCheck;
_calc = _dot / (_mag1 * _mag2);

_unitDirectionRelativeToCheck = (aCos _calc);

//_unitDirectionRelativeToCheck = _VecPosBeg vectorCos _unitDirectionRelativeToCheck;
//_unitDirectionRelativeToCheck = (aCos _unitDirectionRelativeToCheck);

systemChat (format ["Calculated angle between units is: %1deg", _unitDirectionRelativeToCheck]);

if (_unitDirectionRelativeToCheck < 200 && _unitDirectionRelativeToCheck > 160) then
{
    systemChat (format ["Unit %1 is within the threshold", _enemy]);
};
granite sky
#

Are you sure you mean eyeDirection? This doesn't make a lot of sense to me.

#

_flashLightPosBeg is undefined anyway, so I don't know what you're trying to do regardless.

kindred zephyr
#

oh whoops, incorrect naming, that variable mentioned is _vectorPosBeg

#

but yes, its eyeDirection****

granite sky
#

What is?

kindred zephyr
#

the script does what's its intended, I just have this really weird results when doing looping checks and getting close and personal with units, I suppose it could be that is a 3d calculation instead of a 2d vector

#

for example, getting 90deg when standing behind the unit being checked

granite sky
#

I still have no idea what's intended. Feels more likely that it's giving you plausible results by blind luck most of the time :P

kindred zephyr
#

the vector calculated is used to know if the units are or not within certain cone of a weapon

granite sky
#

what's that got to do with eyeDirection?

kindred zephyr
#

basically, i want to know if the unit is looking at the weapon

granite sky
#

You want to check the position of the weapon against the eyePos and eyeDirection of a unit then?

#

But there's no calculation here for the weapon position or the enemy unit position.

kindred zephyr
#

doesnt direction vectors have a position in space already?

Perhaps that is what im missing, but if they share [0,0,0] in space, wouldnt I still be able to calculate the direction difference of the vectors?

flint topaz
#

What are you exactly trying to do

#

As I’m a bit confused from reading the script what your intention is

drowsy geyser
#

I have a timer script that runs in a remoteExecuted server only trigger but the problem is that it doesn't run syncron for all, there is always a delay of a few seconds, any way to prevent the delay?
example:

[] spawn 
{ 
    //_para_timer = player getVariable ["para_timer", objNull];   
    //ctrlDelete _para_timer;
    //missionNamespace setVariable ["timerRunning", false, true];
    
    private _para_timer = findDisplay 46 ctrlCreate ["RscStructuredText", -1];
    player setVariable ["para_timer", _para_timer, true];
    
    _para_timer ctrlSetPosition [safezoneX + 0.471 * safezoneW, safezoneY + 0.08 * safezoneH, 1 * safezoneW, 1 * safezoneH];                
    _para_timer ctrlSetTextColor [1, 1, 1, 1];    
    _para_timer ctrlSetFont "LCD14";      
    _para_timer ctrlShow true;    
    _para_timer ctrlCommit 0;   
    _para_timer ctrlSetStructuredText parseText format ["<t align='left' size='2' shadow='2'>15:00</t>"];
    
    _duration = 900;
    _countdownEndTime = time + _duration;

    missionNamespace setVariable ["timerRunning", true, true];
    while {(missionNamespace getVariable ["timerRunning", true])} do   
    {
        private _remainingTime = _countdownEndTime - time; 
        private _timerText = [_remainingTime, "MM:SS", false] call BIS_fnc_secondsToString; 
        _para_timer ctrlSetStructuredText parseText format ["<t align='left' size='2' shadow='2'>%1</t>", _timerText]; 

        if (_remainingTime <= 0) then 
        { 
            missionNamespace setVariable ["remainingTime", 0, true];
            _para_timer ctrlSetStructuredText parseText format ["<t align='left' size='2' shadow='2'>00:00</t>"];
            break;
        };
        sleep 1;
    };
};
cosmic lichen
#

Create the UI on all clients and calculate remaining time only on the server and broadcast it to the clients.

meager granite
proven charm
#

i think there maybe bug in [_off,"SIT"] call BIS_fnc_ambientAnim; because every time I do that the _off's group icon appears on the map and not even clearGroupIcons is able to remove that group icon from the map

#

little sleep (atleast sec) after BIS_fnc_ambientAnim before calling clearGroupIcons seems to fix it

#

I was able to repro it in another mission but havent been able to fix it for my project, for some reason

prime ether
#

i cannot find where in a script im using sets if an item the script spawns in is being simulated, as all items are spawning as not simulated and thus players cannot pick them up

#

could it possibly be a mission setting?

fleet sand
# drowsy geyser I have a timer script that runs in a `remoteExecuted` `server only` trigger but ...

You could do something like this:

Para_fnc_Timer = {
    params ["_timer"];
    
     private _para_timer = findDisplay 46 ctrlCreate ["RscStructuredText", -1];
     _para_timer ctrlSetPosition [safezoneX + 0.471 * safezoneW, safezoneY + 0.08 * safezoneH, 1 * safezoneW, 1 * safezoneH];                
    _para_timer ctrlSetTextColor [1, 1, 1, 1];    
    _para_timer ctrlSetFont "LCD14";      
    _para_timer ctrlShow true;    
    _para_timer ctrlCommit 0;   
    _para_timer ctrlSetStructuredText parseText format ["<t align='left' size='2' shadow='2'>15:00</t>"];
    
    Para_endTime = ([ time, serverTime ] select isMultiplayer ) + _timer;
    publicVariable "Para_endTime";
    
    while{ ( [ time, serverTime ] select isMultiplayer ) < Para_endTime } do {
        private _timeLeft = Para_endTime - ( [ time, serverTime ] select isMultiplayer );
        _para_timer ctrlSetStructuredText parseText format ["<t size='3' align='center'>%1</t>",[(_timeLeft/3600),"HH:MM:SS"] call BIS_fnc_timetostring];
        _para_timer ctrlCommit 0;
        sleep 1;
    };
    
    _para_timer ctrlSetStructuredText parseText format ["<t color='#FFFFFF' size='1.5' align='center'>Timer Finished!!!</t>"];
    _para_timer ctrlCommit 0;
    sleep 5;
    ctrlDelete _para_timer;
};


[900] remoteExec ["Para_fnc_Timer",[0,-2] select isDedicated,true];
meager granite
#

Also that JIP flag, each JIP will start the countdown all over

#

You need to broadcast target time serverTime + 900

fleet sand
meager granite
#

You RE the server to do the timer when it should be the server broadcasting the timer to everyone

#

I think original post was RE'ing the function on everyone's client once server only trigger is triggered

plush summit
#

Fellas, is there a way to call an array? for example :

_posATL = _Arraye modelToWorld [0,10,0];
#

this is how ive done the array:

private _Arraye = ["part_0", "part_1", "part_2", "part_3", "part_4", "part_5", "part_6", "part_7", "part_8", "part_9", "part_10", "part_11", "part_12", "part_13", "part_14", "part_15"];
#

they are objects placed in eden editor

fleet sand
#

Also that array that you have is array of strings not objects.

#

To be array of objects remove "".

#

And give variable names to objects ofc.

plush summit
#

Thank you for that, ill give it a try

plush summit
fleet sand
plush summit
#

Ahhh i see I see, thank you heaps for that

fleet sand
# meager granite oh just noticed it

Question to run Timer on Server would it be something like this ?

Para_ServerTimer = {
    params["_timer"];
    
    Para_endTime = ([ time, serverTime ] select isMultiplayer ) + _timer;
    publicVariable "Para_endTime";
    
    while{ ( [ time, serverTime ] select isMultiplayer ) < Para_endTime } do {
    Para_Time = Para_endTime - ( [ time, serverTime ] select isMultiplayer );
    publicVariable "Para_Time";
    sleep 1;
    };
};

private _handle = 0 spawn {
    [900] remoteExec ["Para_ServerTimer",2];
    
     private _para_timer = findDisplay 46 ctrlCreate ["RscStructuredText", -1];
     _para_timer ctrlSetPosition [safezoneX + 0.471 * safezoneW, safezoneY + 0.08 * safezoneH, 1 * safezoneW, 1 * safezoneH];                
    _para_timer ctrlSetTextColor [1, 1, 1, 1];    
    _para_timer ctrlSetFont "LCD14";      
    _para_timer ctrlShow true;    
    _para_timer ctrlCommit 0;
    
    while {( [ time, serverTime ] select isMultiplayer ) < Para_endTime} do {
        _para_timer ctrlSetStructuredText parseText format ["<t size='3' align='center'>%1</t>",[(Para_Time/3600),"HH:MM:SS"] call BIS_fnc_timetostring];
        _para_timer ctrlCommit 0;
        sleep 1;
    };
    
    _para_timer ctrlSetStructuredText parseText format ["<t color='#FFFFFF' size='1.5' align='center'>Timer Finished!!!</t>"];
    _para_timer ctrlCommit 0;
    sleep 5;
    ctrlDelete _para_timer;
};
plush summit
#

Thanks for the help on that Legion, now I have another error 😦

Its just saying Undefined variable in expression: _posatl

_ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [["\A3\data_f\cl_exp", 1, 0, 1], "", "Billboard", 1, 2.5, [0, 0, 0], [0, 0, 0], 13, 10, 7.6, 0, [75, 125, 150, 125, 100], [[0.1, 0, 0.2, 1]], [0.08], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [10, 10, 0], [0.25, 0.25, 0], 0, 1.5, [0, 0, 0, 0], 0, 0];
_ps1 setDropInterval 0.05;

Im not sure why, the arraye looks right, maybe is it to do with how particles are made?

fleet sand
#

Can you show full script ?

plush summit
#
enableCamShake true;
addCamShake [2.5, 4, 40];
enableCamShake true;

private _Arraye = [part_0, part_1, part_2, part_3, part_4, part_5, part_6, part_7, part_8, part_9, part_10, part_11, part_12, part_13, part_14, part_15];

{
private _posATL = _x modelToWorld [0,10,0];
} foreach _Arraye;

_ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [["\A3\data_f\cl_exp", 1, 0, 1], "", "Billboard", 1, 2.5, [0, 0, 0], [0, 0, 0], 13, 10, 7.6, 0, [75, 125, 150, 125, 100], [[0.1, 0, 0.2, 1]], [0.08], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [10, 10, 0], [0.25, 0.25, 0], 0, 1.5, [0, 0, 0, 0], 0, 0];
_ps1 setDropInterval 0.05;

_ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [["\A3\data_f\blesk2", 16, 10, 32], "", "Spaceobject", 1, 1, [0, 0, 0], [0, 0, 0.5], 0.3, 1, 1, 3, [1.2, 0.8, 0.5, 0.3, 0.6, 1.3], [[1, 1, 1, 0.4], [1, 1, 1, 0.2], [1, 1, 1, 0]], [0.25, 1], 1, 1, "", "", _ps1];
_ps1 setParticleRandom [0, [10, 10, 0], [0.25, 0.25, 0], 0, 1.5, [0, 0, 0, 0], 0, 0];
_ps1 setDropInterval 0.05;

_ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [["\A3\data_f\blesk2", 16, 10, 32], "", "Spaceobject", 1, 1, [0, 0, 25], [0, 0, 0.5], 0.3, 1, 1, 3, [1.2, 0.8, 0.5, 0.3, 0.6, 1.3], [[1, 1, 1, 0.4], [1, 1, 1, 0.2], [1, 1, 1, 0]], [0.25, 1], 1, 1, "", "", _ps1];
_ps1 setParticleRandom [0, [10, 10, 0], [0.25, 0.25, 0], 0, 1.5, [0, 0, 0, 0], 0, 0];
_ps1 setDropInterval 0.05;

_ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [["\A3\data_f\VolumeLight", 1, 0, 1], "", "SpaceObject", 1, 3, [0, 0, 0], [0, 0, 0], 0, 10, 7.6, 0, [25, 350, 50, 200, 75], [[0, 0, 1, 0.2]], [0.08], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [10, 10, 0], [0.25, 0.25, 0], 0, 1.5, [0, 0, 0, 0], 0, 0];
_ps1 setDropInterval 0.05;

_lightSource = "#lightpoint" createVehicleLocal _posATL modelToWorld [0.2, 0, 0.1];
fleet sand
#

_posATL only lives in foreach scope. So put all those particles and lights inside the foreach scope.

plush summit
#

Ohhhh I see mate, okay im getting it thank you

#

first time working with arrays, thanks heaps

meager granite
fleet sand
#

am i not doing that with this ?

   [900] remoteExec ["Para_ServerTimer",2];
meager granite
#

OR, from server-only trigger context:

private _end = ([ time, serverTime ] select isMultiplayer) + 900;
[_end, {
    Para_endTime = _this;
    // ...
}] remoteExecCall ["spawn", 0, true];
meager granite
#

The idea is to display timer on each client, if you run your private _handle = ... code piece on each client, each client will ask the server to recalculate and rebroadcast Para_time

fleet sand
meager granite
#

For RE spawn it makes no difference, so its just a habit

plush summit
# fleet sand _posATL only lives in foreach scope. So put all those particles and lights insid...
enableCamShake true;
addCamShake [2.5, 4, 40];
enableCamShake true;

private _Arraye = [part_0, part_1, part_2, part_3, part_4, part_5, part_6, part_7, part_8, part_9, part_10, part_11, part_12, part_13, part_14, part_15];

{
private _posATL = _x modelToWorld [0,10,0];
} foreach _Arraye;

{
_ps1 = "#particlesource" createVehicleLocal _x;
_ps1 setParticleParams [["\A3\data_f\cl_exp", 1, 0, 1], "", "Billboard", 1, 2.5, [0, 0, 0], [0, 0, 0], 13, 10, 7.6, 0, [75, 125, 150, 125, 100], [[0.1, 0, 0.2, 1]], [0.08], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [10, 10, 0], [0.25, 0.25, 0], 0, 1.5, [0, 0, 0, 0], 0, 0];
_ps1 setDropInterval 0.05;
} foreach _posATL;

{
_ps1 = "#particlesource" createVehicleLocal _x;
_ps1 setParticleParams [["\A3\data_f\blesk2", 16, 10, 32], "", "Spaceobject", 1, 1, [0, 0, 0], [0, 0, 0.5], 0.3, 1, 1, 3, [1.2, 0.8, 0.5, 0.3, 0.6, 1.3], [[1, 1, 1, 0.4], [1, 1, 1, 0.2], [1, 1, 1, 0]], [0.25, 1], 1, 1, "", "", _ps1];
_ps1 setParticleRandom [0, [10, 10, 0], [0.25, 0.25, 0], 0, 1.5, [0, 0, 0, 0], 0, 0];
_ps1 setDropInterval 0.05;
} foreach _posATL;

{
_ps1 = "#particlesource" createVehicleLocal _x;
_ps1 setParticleParams [["\A3\data_f\blesk2", 16, 10, 32], "", "Spaceobject", 1, 1, [0, 0, 25], [0, 0, 0.5], 0.3, 1, 1, 3, [1.2, 0.8, 0.5, 0.3, 0.6, 1.3], [[1, 1, 1, 0.4], [1, 1, 1, 0.2], [1, 1, 1, 0]], [0.25, 1], 1, 1, "", "", _ps1];
_ps1 setParticleRandom [0, [10, 10, 0], [0.25, 0.25, 0], 0, 1.5, [0, 0, 0, 0], 0, 0];
_ps1 setDropInterval 0.05;
} foreach _posATL;

{
_ps1 = "#particlesource" createVehicleLocal _x;
_ps1 setParticleParams [["\A3\data_f\VolumeLight", 1, 0, 1], "", "SpaceObject", 1, 3, [0, 0, 0], [0, 0, 0], 0, 10, 7.6, 0, [25, 350, 50, 200, 75], [[0, 0, 1, 0.2]], [0.08], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [10, 10, 0], [0.25, 0.25, 0], 0, 1.5, [0, 0, 0, 0], 0, 0];
_ps1 setDropInterval 0.05;
} foreach _posATL;

{
_lightSource = "#lightpoint" createVehicleLocal _x modelToWorld [0.2, 0, 0.1];
} foreach _posATL;
#

Its still throwing up the same error, I think im doing it wrong tho - should I be adding private to the start of all of it too?

fleet sand
#
enableCamShake true;
addCamShake [2.5, 4, 40];
enableCamShake true;

private _Arraye = [part_0, part_1, part_2, part_3, part_4, part_5, part_6, part_7, part_8, part_9, part_10, part_11, part_12, part_13, part_14, part_15];

{
private _posATL = _x modelToWorld [0,10,0];
private _ps1 = "#particlesource" createVehicleLocal _posATL;
_ps1 setParticleParams [["\A3\data_f\cl_exp", 1, 0, 1], "", "Billboard", 1, 2.5, [0, 0, 0], [0, 0, 0], 13, 10, 7.6, 0, [75, 125, 150, 125, 100], [[0.1, 0, 0.2, 1]], [0.08], 1, 0, "", "", _ps1];
_ps1 setParticleRandom [0, [10, 10, 0], [0.25, 0.25, 0], 0, 1.5, [0, 0, 0, 0], 0, 0];
_ps1 setDropInterval 0.05;
} foreach _Arraye;
plush summit
#

Thats what you meant sorry mate

#

It worked, thanks for your help and all the info

meager mist
#

Herro. I've been trying to get a door scripted on a mission I'm making but I can't seem to get it to work. I have an Arma 3 trigger that locks a door if a player steps into the zone that is linked to a Game Logic with the name "Door1", now I want a trigger that unlocks the door whenever an explosion goes off in a 1m radius of said door. The door is located in a fixed structure with class name "Land_House_2W05_F" and it is door #4 in the house. Anyone able to help me out how to setup a proper trigger for this?

The init for the door lock trigger is as following: ((nearestobjects [Door1,["Land_House_2W05_F"], 8]) select 0) setVariable ['bis_disabled_Door_4',1,true]; systemChat "Door Locked";
FYI: this is for a multiplayer mission if that's helpful

fleet sand
# meager mist Herro. I've been trying to get a door scripted on a mission I'm making but I can...

Place like a helper object and put this code inside that helper object. Basicly in front of the door.
Also you are gonna need Animation name for the door and put anim name in animate witch you can get with this script:

animationNames cursorTarget;
this addEventHandler ["Explosion", {
    params ["_vehicle", "_damage", "_source"];
    
    Door1 setVariable ['bis_disabled_Door_4',0,true];
    Door1 animate ["Door_1_rot", 1, true];
    
    _vehicle removeEventHandler [_thisEvent, _thisEventHandler];
    deleteVehicle _vehicle;
}];
#

Basicly what this script dose is. It adds EH to a helper object witch will trigger when helper object gets damaged by explosion.
When that happends it will unlock the door and open the door with animate
And delete the eventHandler and helper object.

meager mist
#

Basically, the helper object could be anything? Something like a bunny?

fleet sand
#

It can be anything like invisible helipad or like a bunny what ever as long its the object.

meager mist
#

I'll have a crack at it, thanks.

#

I kinda assume, if I set the door in the initial script to #4.. I would use Door_4_rot for the Door1 animate line..

fleet sand
# meager mist I'll have a crack at it, thanks.

I told you to get the animation names of a object use this you can put this in watch field in debug console and just copy the output and one of those animation will be correct for the door:

animationNames cursorTarget;
meager mist
#

yea, that yielded a load of animations, so not super clear to me which one to use.
["door_1_rot","door_1_handle_rot_1","door_1_handle_rot_2","door_1_locked_rot","door_1_handle_locked_rot","door_2_rot","door_2_handle_rot_1","door_2_handle_rot_2","door_2_locked_rot","door_2_handle_locked_rot","door_3_rot","door_3_handle_rot_1","door_3_handle_rot_2","door_3_locked_rot","door_3_handle_locked_rot","door_4_rot","door_4_handle_rot_1","door_4_handle_rot_2","door_4_locked_rot","door_4_handle_locked_rot","door_5a_rot","door_5a_locked_rot","door_5b_rot","door_5b_locked_rot","glass_1_hide","glass_1_unhide","glass_2_hide","glass_2_unhide","glass_3_hide","glass_3_unhide","glass_4_hide","glass_4_unhide","glass_5_hide","glass_5_unhide","glass_6_hide","glass_6_unhide","glass_7_hide","glass_7_unhide","glass_8_hide","glass_8_unhide","glass_9_hide","glass_9_unhide","glass_10_hide","glass_10_unhide","glass_11_hide","glass_11_unhide"]

fleet sand
#

try this one:

meager mist
#

And I am right in front of the door

fleet sand
#

door_4_rot

meager mist
#

I think it's trial and error. THe script worked, almost. Helper got removed on explosion, door didn't open. Not sure if it also is because of the fact that the trigger is still being activated because I'm in the zone.

terse tinsel
#

hello, I have a question, will disablaAI RADIOPROTOCOL turn off the spoken voices? I can't check on PC at the moment.

fleet sand
# meager mist And I am right in front of the door

You could also play with animations and see witch one is correct in debug console you could do this and see what happends:

cursorTarget animate ["door_4_rot", 1];

And then just replace the string name for animation.

terse tinsel
#

I know "radioenable false is for radio, i need for speak for soldiers voices ai disable

meager mist
fleet sand
fleet sand
meager mist
fleet sand
meager mist
#

The reference is only to a Game Logic, not the object itself. So that's the only way I know on grabbing that data.

#

Unless there are better ideas to point towards the door within "Land_House_2W05_F" structure

small gyro
#

What is the best way to show custom text on briefing stage ? I need warn players by this way

fleet sand
small gyro
torpid mica
#

Hey, can somebody tell me ho to set up a simple mission using the Old Man Modules? I got the Old Man to initialize but i donΒ΄t really know how to use the Modules (what to sync, what to place e.g.) Is there a good tutorial about it?

small gyro
small gyro
meager mist
fleet sand
small gyro
fleet sand
kindred zephyr
# flint topaz As I’m a bit confused from reading the script what your intention is

getting the angle difference of 2 direction vectors.

Weapondirection delivers the direction vector of the muzzle in the origin unit and eyeDirection delivers (what i believe) the direction vector of the eye memory Point in the unit to evaluate which will be always different than origin.

The objective is to check how close to 180deg the vectors are aligned to when getting Theta compared from one another, the closer they are to 180 means how close the eye is aligned to the weapon since the system is intended to detect direct visibility on it. Its an instant check, not meant to loop.

The result is satisfactory when the units are approached from side or front as it is an angle that you would expect, its just when approached from the back that the results doesnt really make sense for me, basically I just want to make sure that the script would work properly from different approaches and I dont get why I get 90deg when standing behind the unit to check.

meager mist
iron tundra
#

So I had a script that disabled tfar radios in specific area and enabled it again on trigger, I used it 4 years ago and now I can't find it. Anyone recently used somethign similar?

winter rose
granite sky
#

You just set vars on the player. I think it's documented on the github. eg. tf_unable_to_use_radio, tf_voiceVolume

formal stirrup
#

Is it possible to "swim" in the air

sullen sigil
#

no

#

not without just setting anims hard and i think youd need to eachframe that too

formal stirrup
#

Which isn't very healthy to do

#

Is the animation itself what makes you float? Surely not

fair drum
#

We all float down here 🀑

sullen sigil
real tartan
#

is there a check, where I can filter if vehicle is actual vehicle and not a soldier ?
currently filtering classes like

private _cfg = configFile >> "cfgVehicles";
private _types = [ "C_Van_01_transport_F", "B_Soldier_F" ];

private _units = _types select { getNumber ( _cfg >> _x >> "isMan" ) isEqualTo 1 }; // [ "B_Soldier_F" ]
private _vehicles = _types select { getNumber ( _cfg >> _x >> "hasDriver" ) isNotEqualTo 0 }; // [ "C_Van_01_transport_F", "B_Soldier_F" ]

problem is, that CaManBase have in config also "hasDriver" = 1
so _vehicles is returning both, soldier and vehicle
is there any unique config value that I can use to determine driveble vehicle ( air, wheeled, tracked, ... not static MG )

formal stirrup
real tartan
formal stirrup
#

The parachute itself is a vehicle that is slowing you down, the animation has no effect

formal stirrup
real tartan
bitter oak
#

Does anyone know how to make a custom gernade throw? Ive tried many diffrent configs and so far im unsuccessful to make my gernade throw :/

gentle zenith
#

Strange question here, maybe somebody has had this same issue.
I have a large damage handler script that every player has running on them, at one point in the script it checks to see if the person doing the damage is in a vehicle (to detect if the player is being run over) and prevents damage from being done.

Anyway, for 99.9% of players, the script works fine, but for some, they were being hurt/killed when hit by vehicles.

I ran some tests on one of the affected players and for some reason, he is not detecting that the person doing the damage is in a vehicle, for example
(!isNull objectParent _shooter) returns false
((vehicle _shooter) isEqualTo _shooter) returns true
The shooter is the correct player (the person driving the vehicle), just for some reason these normal methods aren't working correctly.

Idea's anybody? It's an interesting case

fair drum
gentle zenith
meager granite
manic flame
#

What's a rule of thumb on when to put code in a unit's init box? The BI wiki seems to discourage its use.

gentle zenith
# meager granite do you have full HandleDamage log?

I don't have a log. I was investigating an issue on my server so through debug console I added our normal damageHandler to the player with the issue. I put debug text in there to print out the "_shooter" and to check if the _shooter was in a vehicle or not.
The people with the issue do not think the _shooter is in a vehicle, normal checks such as (vehicle _shooter) just return the _shooter, and not the vehicle he is in

#

I asked here in case this issue is already known

meager granite
#

Likely you were looking at unrelated damage log

#

Probably _shooter was the player

gentle zenith
meager granite
#

When player gets collision damage, unit == shooter

#

So maybe it was roadkill, just from a vehicle/object without a driver

gentle zenith
# meager granite So maybe it was roadkill, just from a vehicle/object without a driver

So I just ran him over with this simple damage handler


params ["_player","_part","_damage","_shooter","_projectile","_hitPartIndex","_instigator","_hitPoint"];

DS_test = [_shooter];
publicVariable "DS_test";

DS_test pushBack (vehicle _shooter);
publicVariable "DS_test";
}];```

DS_test equalled ```[O Charlie 2-1:1 (Huntah) (civ_55),O Charlie 2-1:1 (Huntah) (civ_55)]```

I am civ_55, He was civ_51.
So it's returning the vehicle as the _shooter, but then....
#

if(!isNull objectParent _shooter)
Is returning false, for everybody else, this returns true

pulsar bluff
#

systemchat str (typeof _shooter)

gentle zenith
#

I'll have to do some more testing later on, the guy I was testing on is playing now. It's strange because this works for almost everybody else, and has done for years.
But I'll look into it some more

meager granite
#

These debug outputs can be misleading

#

because it will return same string for vehicle and the unit

meager granite
#

its not in your DS_test

jade acorn
#

how do I make a unit leave incapacitation state? Wiki says setUnconscious takes boolean but it does nothing when I set it to false. Do I need to manually apply an animation? Is there one meant to be used specifically with the incapacitated one?

granite sky
#

If they were put into the animation with setUnconscious true then setUnconscious false will get them out of it.

#

Although it might break if you toggle too fast? Not sure.

#

I used _unit playMoveNow "unconsciousoutprone"; after the setUnconscious false because it doesn't have a weird 5-second pause after the roll-out.

manic flame
#

Is there a way to 'hook' onto the respawn event? Say I want to prevent certain players from respawning for a set ammount of time without removing the respawn button entirely.

last rain
#

Is it possible with scripts to check the user's graphical settings for gamma, brightness and contrast?

gentle zenith
# meager granite Where do you check this?

Hey, I've done some more testing and have an interesting result.

Here's the handler I added to two players


if(!isNil "DS_index")then {

    player removeEventHandler ["Killed", DS_index];
};

DS_eventIndex = player addEventHandler ["HandleDamage",{

params ["_player","_part","_damage","_shooter","_projectile","_hitPartIndex","_instigator","_hitPoint"];

if(_part isEqualTo "")then {

    DS_test1 = [_shooter, (vehicle _shooter)];
    DS_test1 pushBack (typeof _shooter);
    DS_test1 pushBack (driver _shooter);
    DS_test1 pushBack _instigator;
};
    
if(!isNull objectParent _shooter)then {

    if(_part isEqualTo "")then {

        DS_test1 pushBack "Was vehicle";
    };
    
    if(((driver (vehicle _shooter)) isEqualTo _shooter) && {!(_shooter isEqualTo player)})exitWith {

        if(_part isEqualTo "")then {

            DS_test1 pushBack "was driver of vehicle";
        };

        if(_part isEqualTo "")then {

            hint format ["You have been hit with a vehicle by %1",name _shooter];
        };
        _exit = true;
    };
};

if(_instigator != _shooter && {_shooter isKindOf "LandVehicle"})then {

    if(_part isEqualTo "")then {

        DS_test1 pushBack "was driver of vehicle other";
    };
};

publicVariable "DS_test1";

_damage;

}];

};||```

The only difference between these players is that one had logged in after I had the SUV vehicle had spawned in.

I ran over both players, one player seen the _shooter as a player, the other saw it as the vehicle, here is the output of that DS_test1 variable for each player

**_shooter was the vehicle**
```[29f2a126040# 673836: suv_01_f.p3d,29f2a126040# 673836: suv_01_f.p3d,"C_SUV_01_F",civ_55,civ_55,"was driver of vehicle other"]```

**_shooter was the driver**
```[civ_55,29f2a126040# 673836: suv_01_f.p3d,"C_man_polo_1_F",civ_55,<NULL-object>,"was vehicle","was driver of vehicle"]```

Repeating this over and over yields the same results, and each person will always get the same result, even with re-logging, choosing different slots, server restart, or anything.
dusky owl
#

I am trying to add an event handler when Zeus hides interface(backspace key) but my code doesn't do anything at all. Anybody have a clue?

addUserActionEventHandler ["curatorToggleInterface", "Activate", { systemChat "Hello world!"; }]; ```
little raptor
#

User action event handlers don't work when a display or dialog is active

dusky owl
little raptor
#

Yes

kindred zephyr
jade acorn
#

I was using it on a fully healthy player to trigger ragdoll for a falling from height event but then I couldn't make it recover from the incapacitated anim with setUnconscious false

#

John's workaround works though

meager granite
#

Is this latest dev or stable btw?

proper sigil
#

Could someone advise which event script should I put this in

    params ["_curator", "_entity"];
    publicVariable "dnt_curatorPlaced";
}];```

to properly activate this EH? (Starts in *initServer.sqf*)

```    "dnt_curatorPlaced" addPublicVariableEventHandler {
        
        null = execVM "DNT_supplies\DNT_autoSupplyActionZeus.sqf";
    
    };

I'm pretty sure addPublicVariableEventHandler acrivated code works fine as on dedicated server in debug console I broadcasted activator variable that way publicVariable "dnt_curatorPlaced"; and the script would launch but I just can't seem to correctly assign CuratorObjectPlaced EH to curator login

proper sigil
#

Nvm, just had to add waitUntil {!isNull (getAssignedCuratorLogic _newUnit)}; at the beginning so logic has time to get assigned. Fires from onPlayerRespawn just fine

bold comet
#

@fallen locust "@bold comet player allowSprint true;" -> I didn't test it yet but, really ? if it solves the issue then the wiki page needs to be updated :p

fallen locust
#

well it should but it kinda dosent work atm so yea

bold comet
#

yep

flint topaz
bold comet
#

I'm more waiting for a fix to the stamina system cause it feels like playing with "enableStamina false" should already allow you to move (not even sprint, just jog) with a ridiculous loadout

#

and currently you can't

hallow mortar
# flint topaz Why are you making an EH of an EH?

Expansion: you don't need an EH just to trigger another EH; you can simply have the first EH do everything you want.
e.g.

getAssignedCuratorLogic player addEventHandler ["CuratorObjectPlaced", {
    params ["_curator", "_entity"];
    ["DNT_supplies\DNT_autoSupplyActionZeus.sqf"] remoteExec ["execVM",2];
}];```
(ideally, the DNT_autoSupplyActionZeus.sqf file should be turned into a function since it'll be used a lot, rather than execVM'ing a "naked" SQF file every time - <https://community.bistudio.com/wiki/Arma_3:_Functions_Library>)
#

@proper sigil ⬆️

fleet sand
#

Question how can i get MachineNetwork ID of players ?

hallow mortar
#

owner (server), clientOwner (clients, self only)

#

Note that for common uses like remoteExec, you don't need the network ID itself, because the command accepts an object as a locality target

gentle zenith
# meager granite Your logs confuse me, can't understand what's going on

That's fine, this is stable.
The logs are just showing two people getting a totally different set of information from the damageHander while being hit by a vehicle. One person believes the driver is responsible, the other believes the vehicle is.
This isn't random, person A will always see the same thing, as will person B. Maybe framerate has something to do with it? I can't think of what other variables would remain persistent.

Anyway, I'll simply modify the script to suit both situations, it's just so strange because this has worked for a decade.

granite sky
#

I thought running over a unit with a vehicle generated more than one general-damage hit.

#

I have suspicions that the issue here is actually with your publicVariable.

#

Try calling a logging function on the server instead.

gentle zenith
granite sky
#

At least twice, typically.

#

I haven't tested vehicle impacts specifically though.

gentle zenith
#

Inside my normal script, there is an output systemchat and hint that tells the player that they have been hit by a vehicle by (name of driver). They only get this message once (it's called if _part isEqualTo "")

kindred zephyr
#

when hit by a vehicle you get multiple structural damages in the same frame so framerate is definitely a factor in your differences.
It could be a good idea to limit your detection per frame to avoid duplicates and get more consistent results

bold comet
#

ENGINE:
Fixed: No longer forcing walk when Stamina is switched off by script (http://feedback.arma...ew.php?id=26727)

#

well, ok

gentle zenith
granite sky
#

IME attempting to get good information out of HandleDamage has always been a disaster :P

faint trout
#

Heya all, does someone know how to enable the full debug mode on ACE3, so stuff writes logs?

kindred zephyr
fair drum
#

Just do a repository search

formal stirrup
meager granite
#
_log = str (_this apply {if(_x isEqualType objNull) then {format ["%1 (%2)", _x, typeOf _x]} else {_x}});
#

to log whole array, also class for entities

#

because vehicle name can be misleading

storm arch
#

CtrlSetText [1000, str (_array select 0)]; CtrlSetText [1001, str (_array select 1)]; CtrlSetText [1002, str (_array select 2)]; this goes on for a few more lines. Is it possible to condense this so it’s not so repetitive?

#

Also I’m typing on my phone currently so the format maybe wonky

winter rose
#
ctrlSetText [1000, str (_array select 0)];
ctrlSetText [1001, str (_array select 1)];
ctrlSetText [1002, str (_array select 2)];
```converted to```sqf
{
  ctrlSetText [1000 + _forEachIndex, str _x];
} forEach _array;
storm arch
agile pumice
#

Can I get help with a script? http://pastebin.com/raw.php?i=NTJesBxN The intention is to have the player attach to the vehicle (crouched) in the gunner position when they press the c key, and then return to manning the gun when they press it again

#

The behavior now is when I press C, i seem to attach for a second and then move below the vehicle under the ground

#

the detach isnt working unless i do it manually with the debug console

gentle zenith
# meager granite Just log the whole EH

Hey, again thanks for trying to assist me.

I've fixed my issue, I simply just check for both conditions. Player A and player B always get different results, but each player always gets the same result they had last time.

I couldn't find anything about it, but could playing on the 'profiling branch' change something here? That was a difference between player A and player B.

granite sky
#

That's possible, yes. It only takes a couple of minutes to switch branches, so it's easy to test.

quaint oyster
#

Anyone able to help me spot the issue with my script here? I'm trying to come up with a means to make this main menu song play, but externally i have a button which acts as a mute feature, to change the profilenamespace var to interupt and stop the song, but its not stopping, its repeating it.

stop button

_var = profileNameSpace getVariable ["mutedmaintheme",0];
if (_var isEqualTo 1) then {
profileNameSpace setVariable ["mutedmaintheme",0];
playsound "additemok";
//playmusic "";
1 fadeSound 1;
enableEnvironment [true, true];
saveProfileNamespace;
};
if (_var isEqualTo 0) then {
profileNameSpace setVariable ["mutedmaintheme",1];
playsound "additemfailed";
//playmusic "slay_intro";
stopSound the_sound;
1 fadeSound 0;
enableEnvironment [false, false];
saveProfileNamespace;
};

intro script

the_sound = nil;
while {true} do
{
  _value = (profileNameSpace getVariable ["mutedmaintheme",0]);
  if ((profileNameSpace getVariable ["mutedmaintheme",0]) isEqualTo 0) then {
  the_sound = playSoundUI ["IFA3WARMod_client\video\slay_intro.ogg", 0.5, 2.0];
  //publicVariable the_sound;
  1 fadeSound 0;
  enableEnvironment [false, false];
 waitUntil { (soundParams the_sound isEqualTo []) || ((profileNameSpace getVariable ["mutedmaintheme",0]) isEqualTo 1) };
    stopSound the_sound;
  } else {
  sleep 5;
  };
};
#

I'm using playSoundUI to bypass the music volume mixer.

terse tinsel
#

Is there any script like disable anim so that the injured soldier doesn't drag his legs and runs normally?

slim lion
#

would this be an effective way to pause a script if no players are connected to server? waitUntil {sleep 1; (count call BIS_fnc_listPlayers) > 0}; or would there be a better way?

granite sky
#

@terse tinsel You mean without actually healing the guy?

terse tinsel
#

can yu help me ?

granite sky
#

I don't know a way. You can force an animation but if you want them to otherwise act normally then the sensible way is to heal the hitpoint.

terse tinsel
#

ok but thx

#

the thing is that sometimes the ai commander gives the order to heal other ai and it annoys me, and is it possible to make the ai in the group heal themselves without receiving the order to heal himself?

granite sky
#

Not sure what you're asking. This is a scripting channel. You can just script-order them to heal themselves.

terse tinsel
granite sky
#

The eventual command is _unit action ["HealSoldierSelf", _unit];

#

But you'd want some sort of monitor loop to manage it.

terse tinsel
#

ok, understeand Thx dude πŸ™‚

terse tinsel
#

Unfortunately, this did not help me, if anyone knows how to write a script that would prevent the AI from animating the injured person, please help

warm hedge
#

disableAI?

terse tinsel
# warm hedge `disableAI`?

not entirely, I mean to disable only the injured animation for ai, but I don't see it in disable ai 😦

warm hedge
#

Wait, do you mean limping?

terse tinsel
#

yes

#

sorry

#

;p

warm hedge
#

Then I don't think there is. Also you can just edit your typo not spam Enter

terse tinsel
# warm hedge Then I don't think there is. Also you can just edit your typo not spam Enter

OK, thank you . Could you help me edit this script so that the unit receives actions in the script when it is wounded and does not have to wait for the commander's order? something like this but for one ai [] spawn { while {sleep 1; alive medic_1} do {{ if (damage _x *symbol of greater than 0) then { medic_1 action ["healsoldier", _x]}} forEach units team_1}}

warm hedge
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
warm hedge
#

And no, I can't help with a complex one ASAP

terse tinsel
candid sun
#

well BIS_fnc_lerp isn't as exciting as i'd hoped

grizzled cliff
#

dont use it if you need lerps

#

they have a SQF lerp function now

#

way faster

warped hound
#

(the chair in question)

#

I would use the script but 1: it only works on Altis and im using a different map 2: either the script is broken or im stupid cause i cant find the .sqf or the mission to load that scenario

meager granite
warped hound
meager granite
#

πŸ€”

#

Do you want it interactible?

warped hound
#

nah i just need it to float and rotate. its just to make the scene look a little more ominous

meager granite
#

Will you have lots of such objects?

warped hound
#

probably not at most like 5

#

at the very least just the chair

meager granite
#

Having it smooth is MP could be somewhat difficult πŸ€”

#

Probably gonna need a fake local version created on each client or something

warped hound
#

that should be fine because it wont be like super focused on in the film its just something to make the scene look a bit spooky

terse tinsel
#

does anyone have an idea how to make a bu a script out of it and if it gets 0.5 injuries, autoheal is turned on?? {{ if (damage _x > 0) then { this action ["healsoldier", _x]}}

meager granite
# warped hound that should be fine because it wont be like *super* focused on in the film its j...
private _real = this;
_real enableSimulation false;
_real hideObject true;
 
private _fake = createVehicleLocal [typeOf _real, ASLtoAGL getPosASL _real, [], 0, "CAN_COLLIDE"];
_fake setVectorDirAndUp [vectorDir _real, vectorUp _real];
_fake setPosWorld getPosWorld _real;
_fake enableSimulation false;

addMissionEventHandler ["EachFrame", {
    _thisArgs params ["_real", "_obj", "_pos", "_vdir", "_vup"];

    if(isNull _real) exitWith {
        deleteVehicle _obj;
        removeMissionEventHandler [_thisEvent, _thisEventHandler];
    };

    private _z_period = 3;
    private _z_amplitude = 1;
    private _z_offset = sin(serverTime % _z_period / _z_period * 360) * _z_amplitude / 2;
    _obj setPosWorld (_pos vectorAdd [0, 0, _z_offset]);

    private _rot_period = 5;
    private _rot_angle = serverTime % _rot_period / _rot_period * 360;
    private _rot_vdir = [_vdir, _rot_angle, 2] call BIS_fnc_rotateVector3D;
    private _rot_vup = [_vup, _rot_angle, 2] call BIS_fnc_rotateVector3D;
    _obj setVectorDirAndUp [_rot_vdir, _rot_vup];
}, [_real, _fake, getPosWorld _fake, vectorDir _fake, vectorUp _fake]];
#

Wrote this script for you, add into init field of object you want to float

warped hound
#

thank you so much!

meager granite
#

_z_period is how many seconds it takes for object to do full up&down float, _z_amplitude is how long full up&down float takes, _rot_period is how long it takes to do 360 rotation

warped hound
meager granite
#

!code

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
↓

// your code here
hint "good!";
meager granite
#

Just tested it, MP compatible

#

Object is not interatible though, some restrictions apply (like you can't delete it)

#

restrictions can be bypassed though, depending on what you need

#

Actually, let me improve it so its at least deleteable

#

Done, now it can be deleted

warped hound
meager granite
#

If its script related ask here so others can find it

warped hound
#

well i also need a specialized mod for the film. I dont want to go too much into detail in a public forum but there are mods that already exist that do what i need i just need certain paramaters changed and i can't read code nor do i really know how to write it

#

i can do retextures but thats about it

meager granite
#

Sorry, can't help, you'll need to learn it

warped hound
#

would you happen to know what channel i could ask for help in?

#

i do not have the time to learn code just for this short film

meager granite
warped hound
#

thank you

warped hound
#

@meager granite how would i make the chair rotate slower and just rotate without moving up and down?

#

i assume it would be changing the " private _rot_period = 5;" to a higher number?

meager granite
#

Yes

#

_z_amplitude to 0 to stop it from floating up and down

#

or to very small number for slight movement

#

Or increase _z_period to large value so it move very slowly

#

period is in seconds

warped hound
#

okay cool cool and then is there a way to get it to rotate up and down too or no?

#

so if the rot_period is the blue is there a way to rotate the red and maybe even green?

#

if not no worries just curious

meager granite
#

Right now it rotates around global Z axis

#

So yeah, blue handle

#

Its possible, just needs more code

warped hound
#

i'd hate to ask you to do more work but if you wouldnt mind it would be amazing

meager granite
#
    private _rot_vdir = [_vdir, _rot_angle, 2] call BIS_fnc_rotateVector3D;
    private _rot_vup = [_vup, _rot_angle, 2] call BIS_fnc_rotateVector3D;
```Change `2` to `1` or `0` in both functions here and see what happens
#

it will rotate around different axis but also do full 360 rotation

warped hound
#

will do

#

so changing them both to 1 made it rotate on the green axis only

meager granite
#

Yeah, its rotation by single axis right now

warped hound
#

ah would i just copy the rotation code to make it rotate on another axis then?

meager granite
#

you'll also need to change variables

#
    private _rot_period = 5;
    private _rot_angle = serverTime % _rot_period / _rot_period * 360;
    private _rot_vdir = [_vdir, _rot_angle, 2] call BIS_fnc_rotateVector3D;
    private _rot_vup = [_vup, _rot_angle, 2] call BIS_fnc_rotateVector3D;

to

    private _rot_period = 5;
    private _rot_angle = serverTime % _rot_period / _rot_period * 360;
    private _rot_vdir = [_vdir, _rot_angle, 2] call BIS_fnc_rotateVector3D;
    private _rot_vup = [_vup, _rot_angle, 2] call BIS_fnc_rotateVector3D;
    _rot_vdir = [_rot_vdir, _rot_angle, 1] call BIS_fnc_rotateVector3D;
    _rot_vup = [_rot_vup, _rot_angle, 1] call BIS_fnc_rotateVector3D;
```first rotates by Z axis, then by Y axis
#

it uses same angle for both though

#

if you want another rate of rotation you'll need new _rot_angle for another axis

#
    private _rot_x_period = 1;
    private _rot_x_angle = serverTime % _rot_x_period / _rot_x_period * 360;
    private _rot_vdir = [_vdir, _rot_x_angle, 0] call BIS_fnc_rotateVector3D;
    private _rot_vup = [_vup, _rot_x_angle, 0] call BIS_fnc_rotateVector3D;

    private _rot_y_period = 3;
    private _rot_y_angle = serverTime % _rot_y_period / _rot_y_period * 360;
    _rot_vdir = [_rot_vdir, _rot_y_angle, 1] call BIS_fnc_rotateVector3D;
    _rot_vup = [_rot_vup, _rot_y_angle, 1] call BIS_fnc_rotateVector3D;

    private _rot_z_period = 5;
    private _rot_z_angle = serverTime % _rot_z_period / _rot_z_period * 360;
    _rot_vdir = [_rot_vdir, _rot_z_angle, 2] call BIS_fnc_rotateVector3D;
    _rot_vup = [_rot_vup, _rot_z_angle, 2] call BIS_fnc_rotateVector3D;

    _obj setVectorDirAndUp [_rot_vdir, _rot_vup];
#

periodical rotation by all 3 axis

#

pendulum like rotation gonna need different code

#

this is full 360 around axis rotation

warped hound
#

i think just z and x might look best sorry

#

i just finally got it to load and see how it looked

#

the y rotation makes it look a bit odd but a do really appreciate all your help!

#
private _real = this; 
_real enableSimulation false; 
_real hideObject true; 
  
private _fake = createVehicleLocal [typeOf _real, ASLtoAGL getPosASL _real, [], 0, "CAN_COLLIDE"]; 
_fake setVectorDirAndUp [vectorDir _real, vectorUp _real]; 
_fake setPosWorld getPosWorld _real; 
_fake enableSimulation false; 
 
addMissionEventHandler ["EachFrame", { 
    _thisArgs params ["_real", "_obj", "_pos", "_vdir", "_vup"]; 
 
    if(isNull _real) exitWith { 
        deleteVehicle _obj; 
        removeMissionEventHandler [_thisEvent, _thisEventHandler]; 
    };

private _z_period = 3;
    private _z_amplitude = 0.25;
    private _z_offset = sin(serverTime % _z_period / _z_period * 360) * _z_amplitude / 2;
    _obj setPosWorld (_pos vectorAdd [0, 0, _z_offset]);

private _rot_x_period = 15;
    private _rot_x_angle = if(_rot_x_period != 0) then {serverTime % _rot_x_period / _rot_x_period * 360} else {0};
    private _rot_vdir = [_vdir, _rot_x_angle, 0] call BIS_fnc_rotateVector3D;
    private _rot_vup = [_vup, _rot_x_angle, 0] call BIS_fnc_rotateVector3D;

private _rot_y_period = 15;
    private _rot_y_angle = if(_rot_y_period != 0) then {serverTime % _rot_y_period / _rot_y_period * 360} else {0};
    _rot_vdir = [_rot_vdir, _rot_y_angle, 1] call BIS_fnc_rotateVector3D;
    _rot_vup = [_rot_vup, _rot_y_angle, 1] call BIS_fnc_rotateVector3D;

    private _rot_z_period = 15;
    private _rot_z_angle = if(_rot_z_period != 0) then {serverTime % _rot_z_period / _rot_z_period * 360} else {0};
    _rot_vdir = [_rot_vdir, _rot_z_angle, 2] call BIS_fnc_rotateVector3D;
    _rot_vup = [_rot_vup, _rot_z_angle, 2] call BIS_fnc_rotateVector3D;

    _obj setVectorDirAndUp [_rot_vdir, _rot_vup];
}, [_real, _fake, getPosWorld _fake, vectorDir _fake, vectorUp _fake]];
#

that would be the final product then yeah?

meager granite
#

yes

#

You removed up and down floating though

warped hound
#

oh shite thank you

#

how about now?

meager granite
#

yeah

warped hound
#

cool cool thank you!

#

gonna try it to be sure it works now

meager granite
#

Just tried it, doesn't support 0 period for no rotation

thin pine
#

@agile pumice you have if (_vcl == player) exitwith {}; - after player gets out the first time, vehicle player will be equal to player and thus the code is exitWith'ed right there when executed a second time

meager granite
#

Change rotation angle to these lines

    private _rot_x_angle = if(_rot_x_period != 0) then {serverTime % _rot_x_period / _rot_x_period * 360} else {0};
    private _rot_y_angle = if(_rot_y_period != 0) then {serverTime % _rot_y_period / _rot_y_period * 360} else {0};
    private _rot_z_angle = if(_rot_z_period != 0) then {serverTime % _rot_z_period / _rot_z_period * 360} else {0};
warped hound
#

updated and took out the y cause i forgot to earlier

meager granite
#

You could've just set _rot_y_period to 0 so it doesn't rotate

warped hound
#

oh duh sorry im stupid

meager granite
#

so in case you'll need different rotation in another object when you'll copy the script there

warped hound
#

fair

#

okay so like that then but for the chair just set _rot_y_period to 0 so it doesnt rotate on y

meager granite
#

Yes

warped hound
meager granite
#

It rotates the object by global axis, not object axis, so you end up with rotation also being applied on Y axis

warped hound
#

ah i see thats fine then im not too worried about it

meager granite
#

If you don't want your chair upside down you probably wanted pendulum-like rotation for X and Y

warped hound
#

yeah lets try that if you're okay with it

#

how would i do that again?

meager granite
#

_rot_x_angle formula needs to be changed

#
    private _rot_x_period = 1;
    private _rot_x_amplitude = 45;
    private _rot_x_angle = if(_rot_x_period != 0) then {sin(serverTime % _rot_x_period / _rot_x_period * 360) * _rot_x_amplitude} else {0};
    private _rot_vdir = [_vdir, _rot_x_angle, 0] call BIS_fnc_rotateVector3D;
    private _rot_vup = [_vup, _rot_x_angle, 0] call BIS_fnc_rotateVector3D;

    private _rot_y_period = 0;
    private _rot_y_amplitude = 45;
    private _rot_y_angle = if(_rot_y_period != 0) then {sin(serverTime % _rot_y_period / _rot_y_period * 360) * _rot_y_amplitude} else {0};
    _rot_vdir = [_rot_vdir, _rot_y_angle, 1] call BIS_fnc_rotateVector3D;
    _rot_vup = [_rot_vup, _rot_y_angle, 1] call BIS_fnc_rotateVector3D;

    private _rot_z_period = 15;
    private _rot_z_angle = if(_rot_z_period != 0) then {serverTime % _rot_z_period / _rot_z_period * 360} else {0};
    _rot_vdir = [_rot_vdir, _rot_z_angle, 2] call BIS_fnc_rotateVector3D;
    _rot_vup = [_rot_vup, _rot_z_angle, 2] call BIS_fnc_rotateVector3D;
#

X and Y are now pendulum rotations instead of 360 around axis rotations

#
    private _rot_x_period = 1;
    private _rot_x_amplitude = 45;
``` is 1 second for full back and forth -45 to 45 degrees swing
warped hound
#

i would try and confirm i have the whole thing right but i would need nitro for that XD

#

i assume that if i change the number of the amplitude it would go to whatever the number is back and forth right? so likeif i changed it to 15 it would swing from -15 to 15 just like you said with the -45 to 45?

meager granite
#

Yes

warped hound
#

cool cool just wanted to be sure

meager granite
#

And period is time for full swing both sides

warped hound
#

gotchya

meager granite
#

πŸ‘

warped hound
meager granite
#

Try adding very slight Y pendulum rotation too, might make it even better

agile pumice
#

good point, changing the line to read: if (_vcl == player && (isNull (attachedTo player))) exitwith {}; fixes the detach issue, but the player isnt put back in the gunner with the line below

warped hound
#

ouuu yeah it looks pretty good one sec im gonna add some sound design to it real quick and see how it sounds with ti

warped hound
#

this isnt how the film will look like at all but just as a spoiler i think its pretty decent

warped hound
#

@meager granite do you have a youtube or something you'd like to be mentioned in the credits of the film for the help?

meager granite
warped hound
#

thats about all I can offer at the moment this is an extremely low budget film lol

#

thats fine

meager granite
#

Just credit my nickname somewhere, should be enough

warped hound
#

In the credits of the film i'll just put

"Floating Chair Script by Sa-Matra"

does that work?

meager granite
#

πŸ‘

warped hound
#

thank you so much for your help i really do appreciate it!

#

will also put a thank you in the spoiler im posting

terse tinsel
candid sun
#

BIS_fnc_lerp is the sqf function isn't it?

pliant stream
#

not as exciting as you'd hoped? what exactly did you expect πŸ˜„

cyan dust
#

Good day. Quick question, if we do

object setVariable ["%VARNAME%",%VALUE%,true];

several times. Does it add to JIP or replace? Concern is whether or not we bloat JIP queue by doing that.

flint topaz
#

I would imagine it will replace but yeah not 100%

winter rose
#

(but I take %VALUE% is not a valid variable name 😜)

cyan dust
#

Thank you @flint topaz @winter rose . Tested with

exportJIPMessages ""

It is indeed replacing the value in JIP (at least not increasing the queue, that's for sure)

shadow lichen
#

Hello, can somebidy tell me how to see in realtime the camo coef and alert level of opford in editor? I need to test some mod regarding dinamic camo

proven charm
candid sun
#

excitement

shadow lichen
#

ok and how to know alert level?

proven charm
#

dunno

jaunty ravine
#

Hello, quick question, is there any easy-to-use method for moving pop-up targets? Note that it needs to blend into a regular mission and as such can not use a Firing Drill module.

oblique arrow
#

Herroh I am come to let you peeps double check my work πŸ˜„ , I'm working on turning my camera intro (see above ^) from the global exec mess it is currently into an initPlayerLocal script, I've gotten to this script thus far and it seems to be working when I test it on a locally hosted server but I havent tried a dedi one yet
If you have any tips for improvements / spot problems please do tell Eyes blobheart

initplayerlocal.sqf:
[] spawn
{
//switch to cam, start cinematic borders
[intro_camera, "INTERNAL"] remoteExec ["switchCamera"];
//[0, 0] remoteExec ["BIS_fnc_cinemaBorder"];

//enable AAN news borders
[
    parseText "<t size='2'>New high in rising tensions between NATO and CSAT</t><br/>
    <t size='1'>Mathew McMath reporting live from Malden </t>",
    parseText "--- CSAT rumoured to be breaching Mediterranean Arms Reduction treaty --- NATO politician Aron Swartz calling for combat readying of an intervention task force"
] spawn BIS_fnc_AAN;

//start timeline
[into_timeline] remoteExec ["BIS_fnc_timeline_play"];

//wait for duration
sleep 10;

//when done switch back camera to player, end cinematic borders
[player, "INTERNAL"] remoteExec ["switchCamera"];


//delete AAN UI
(uiNamespace getVariable "BIS_AAN") closeDisplay 1;
};
warm hedge
jaunty ravine
warm hedge
#

Handy to have I guess, but not sure it's worth it of official implementation nowadays

jaunty ravine
shadow lichen
kindred zephyr
#

do a while loop and have it written to a systemchat or a hint

#
while {true} do
{
  systemChat str (_someUnit getUnitTrait "camouflageCoef");
  sleep 0.5;
};
#

or something of that style

winter rose
#
onEachFrame {
  hintSilent format ["Player Camo: %1\nEnemy behaviour: %2", player getUnitTrait "camouflageCoef", combatBehaviour zeEnemy];
};
```:p
shadow lichen
#

ok so writing this in editor I will see in my screen while playing/testing?

#

sorry but I'm not expert on this

#

have this should be great + camocoef

kindred zephyr
#

that very specific info, are you testing ReEngine?

shadow lichen
#

yes

kindred zephyr
#

good mod, you can sneak up to like 1m with that enabled

shadow lichen
#

can you help me to have the correct sript in order to see this info?

#

or some of this . I'm interesting to see camocoef, distance, knowsabout, spot distance, behaviour

kindred zephyr
#

I believe that comes integrates in the mod, it might be a debug function. You might have to ask in the workshop entry

agile pumice
#

Going for a different approach

fleet sand
oblique arrow
agile pumice
#

need the code below the "add" hint to work tho :(

#

oh i think i see whats happening

#

_animation and _weapons is being overwritten when i dont want them to be

pliant stream
#

yeah i guess linear interpolation is pretty exciting :D

candid sun
#

dude i got excited for pushBack and params, must live a sad life

jaunty ravine
#

Having some problem setting up my macros. I keep getting this error on start up. I'm using an #include in my config.cpp from a different pbo with, as far as I can tell, correct paths.

#
#define SETPOS(CONTROL,SELECTOR)\
    (_ui displayCtrl CONTROL) ctrlSetPosition [_pos # SELECTOR # 0, _pos # SELECTOR # 1]; \
    (_ui displayCtrl CONTROL) ctrlCommit 0```
This is the macro
hallow mortar
#

You might need a ; after ctrlCommit 0.
Alternatively, using a macro with the same name as a command (setPos) might be freaking it out.

jaunty ravine
#

Ah, alright, I'll look into that, thank you for the swift reply.

hallow mortar
#

setText is also a command name so if it is the name that's doing it, you'll have the same issue there

jaunty ravine
#

Doesn't seem to have helped, I'm afraid.

agile pumice
#

I did too haha

still forum
#

either that script wasn't preprocessed at all, or it didn't detect that your macro exists

#

Also the error is in a .sqf. You said you ahve the include in a config.cpp

jaunty ravine
#

Correct, I am very new to macro usage so still getting the lay of the land so to speak. I've tried putting the #include in the .sqf files and got this error:

still forum
#

path is wrong

#

I think I'd expect a leading backslash

#

Also make sure the .hpp file is packed into the PBO

#

some pbo packing tools might exclude .hpp files by default

#

yes you need the include inside the .sqf file

jaunty ravine
#

Understood, I'll look into it, thank you Dedmen.

jaunty ravine
still forum
#

might be an error in the error message box thing

jaunty ravine
fair drum
#

I would suggest hemtt if you are gonna be using the cba system

still forum
jaunty ravine
#

I think I managed to figure out what the problem was:

  1. pboProject excluded .hpp.
  2. I used # in place of select in my macro.
still forum
#

jup that sounds right

jaunty ravine
#

That would be it, works flawlessly now, thank you for your patience.

molten yacht
#

Is there a way to make a custom chat channel that scripts can talk in but players can't?

#

For like, say, an "intercepted" transmission stream.

hallow mortar
#

Add the players to the channel with radioChannelAdd, then use enableChannel to prevent them from talking in it

analog mulch
#

need the me and my AI group that are falling from the sky (freak phenomenon) to have parachutes once they hit a trigger, and then once they land they get their original backpack and its custom contents back

agile pumice
#

Here's the completed code for anyone interested

#

works best with vanilla technicals

oblique arrow
#

Helloh, is the post processing effect or ui overlay etc. to add a vignette to the users ingame view?
I know arma can do it in the main menu, but couldnt figure out how

winter rose
#

both can do it, but for a static vignette I would recommend ui overlay

oblique arrow
winter rose
#

I don't want you to enable those in my head!

#

(if it isn't BIS_fnc_initWorldScene… lemme confirm)

oblique arrow
#

I think thats what it said on the wiki, I dont want the full fnc executed though I think

winter rose
oblique arrow
#

how I do dat Eyes

winter rose
#

Functions Viewer?

oblique arrow
#

oh right thats a thing

sharp grotto
oblique arrow
#

Huh interesting, apparently it just uses a color correction

winter rose
#

oh, I thought it was a RscDisplay for this one
then yep, PPEffects it is! ^^

oblique arrow
#
"colorCorrections" ppEffectAdjust [1,1,0,[0,0,0,0],[0,0,0,0.24],[1,1,1,0],[0.7,0.7,0,0,-0.1,0.4,0.8]]; 
"colorCorrections" ppEffectEnable TRUE; 
"colorCorrections" ppEffectCommit 0;
#

that the code from the fnc

#

it wΓΆrk

winter rose
#

it gives a very good "close photograph flash / lighting"

oblique arrow
#

Yee, quite nice

#

what arma modding/scripting does to a man

fair drum
winter rose
analog mulch
#

uuhhh wut

oblique arrow
#

You spotted it

#

man's also good at math

fair drum
analog mulch
#

πŸ€·πŸΏβ€β™‚οΈ

fair drum
#

I'll write you what you need. Just acknowledging your question before it gets buried.

oblique arrow
#

so many numbers harold

winter rose
#

optional numbers ^^

#

hey, that's not the (un)official Dark Theme!
using Dark Reader? πŸ™‚

oblique arrow
#

also I'm not sure what I expected, but here's a vignette at max radius (as much as possible)

#

or well min radius I guess?

oblique arrow
#

but yeah.. not sure what else I was expecting

oblique arrow
winter rose
#

but man is Enforce Script an eye murder xD

oblique arrow
#

I feel like a big boy mission maker now, using keyframe anims, cameras, inits, initplayerlocals, etc πŸ˜„

#

And fake light cones of course

winter rose
#

very noice! I don't use keyframe anims, I think I tried once or twice and didn't figure it out πŸ˜„ u gud!

oblique arrow
#

they can be finnicky to work with and annoying, but once you know how to use them right they're quite nice

#

for example the timeline has a built in feature to 'play at start', which apparently just doesnt work correctly, and so on

#

theres a good bit of stuff like that

#

and when you have a few curve keys your game can really slow down when selecting/moving it at all, since the keyframe path preview is re-rendered for each frame

#

you know, that cutscene could use a vignette πŸ˜„

winter rose
#

waaaaaait you can roll a camera with keyframe anims?? :)

oblique arrow
#

you have complete 3-axis control as with any object

#

the keyframe path adjusts to whatever the curve key is rotated to

oblique arrow
#

if you want I can throw you that mission file over in a bit, its got a fair few mods on it but since the keyframes are vanilla they should force-load fine I think

winter rose
#

maybe I will practice myself a bit later, it's been ages since I worked on an A3 mission

#

but thanks and kudos!

oblique arrow
#

There's a nifty german tutorial on it that helped me a good bit, not sure how good it'd be for you though πŸ˜„

#

also have fun encountering camera bugs, if you place it and your own camera gets stuck to the ground whats worked for me is deleting it and completely save/loading the mission file, sometimes even had to exit and reenter the 3den editor

sullen sigil
hallow mortar
sullen sigil
#

oh

#

thank you

oblique arrow
#

Yeah thats just the ⭐ vanilla arma 3 trawler ⭐ πŸ˜„

queen cargo
oblique arrow
#

I love scripting with things that have color attributes

#

accidentally turned the alpha for a 3d icon to 0 and have been trying to figure out for 10 minutes why it isnt showing up

hallow mortar
#

Is there a way to play a non-positional, non-UI sound, with pitch/volume parameters?
playSound3D has the parameters, but it's positional.
playSoundUI has the parameters, but it uses the UI volume channel.
playSound is non-positional and uses the Effects channel, but it doesn't have the parameters.

#

Oh, I see playSoundUI has an isEffect override. What an awkward way of doing it πŸ€”

fair drum
oblique arrow
#

owoYay Most of my stuff works, one problem though
for the big keyframe animation if I try to just call it in the initplayerlocal it doesnt seem to work at all, the camera only moves to a somewhat random spot and then not at all
If I remote exec it in the initplayerlocal it does work, however the first few seconds of it are quite glitchy which isnt great, I'd also like to avoid remoteexecing stuff if possible πŸ˜„
Anyone have an idea?

#

Ah throwing it in initServer seems to have done the trick, even if its a little wobbly owoYay

#

Ok now I just gotta figure out why my showHUD [false,false,false,false,false,false,false,false]; in initPlayerLocal isnt working in dedicated server mp
If someone has an idea let me know πŸ˜„

meager granite
#

Client is not fully init yet something-something

#

Add waitUntil {!isNull findDisplay 46}?

oblique arrow
#

Ooh yeah that could be it, I'll try that bongocat thanku

meager granite
#

Some for camera probably?

oblique arrow
#

everything else seems to be working more or less properly

#

just showHud/showChat dont work

#

but I think I'll leave trying the waituntil and further troubleshooting on that for tomorrow, been at this for 6+ hours now and need a break πŸ˜„

analog mulch
#

where do i put this ingame? And also will it respawn my original backpack once i land

candid sun
#

what's the best way to do a horizontal list box in a ui?

queen cargo
#

RscListBox?

#

ohh wait

#

see

#

forget what i wrote

candid sun
#

is it possible somehow? can't find anything useful from googling

queen cargo
#

dont think so

#

its not rly a common UI element tbh

#

closest you could ever get would be a tab

candid sun
#

tab or table?

queen cargo
#

tab

#

tabcontrol or something like that

#

not sure if something like that exists in arma though

fair drum
analog mulch
#

They start in the air and the chute opens when they are close to the ground, maybe 100m above ground

candid sun
#

god damn i hate making ui's in this engine

queen cargo
#

its fairly simple tbh ^^

candid sun
#

simple if you don't mind it looking shit yeah

queen cargo
#

gets even more simple if you use objective systems

candid sun
#

what's your workflow for ui's? gui editor?

queen cargo
#

configs

#

and ages of rage

#

even more then i tend to do in here

#

placing will be done with the ArmA ingame UI editor thingy

#

which is broken like shit

#

however, new UIs will be created dynamically by me

#

using OOS

#

((OOs mainly to make creating them easier :P))

cosmic lichen
#

That function was added recently..perhaps it can still be updated.

candid sun
#

that sounds like even more hassle tbh

queen cargo
#

not rly

#

less commands

#

more ui

#

but busy right now

#

can go into detail later in private talk

#

as its kinda ot

grizzled cliff
#

fuck configs, ctrlCreate for life

#

shit is so much nicer to use than configs

#

only time you need configs is when you need to tweak a base class

#

other than it is fucking easy mode, just close the display and reopen it with new code and voila, you can make dialogs in no time... no mission restarts, no game restarts

#

fucking pants on head easy

queen cargo
#

yup

#

but was introduced after i started my last UI

grizzled cliff
#

yah

#

if anyone is starting a new UI now though and NOT using it

deft zealot
grizzled cliff
#

they are just hurting themselves

#

yup, easy peasy

queen cargo
#

the reason why object oriented scripting stuff like yours and mine @grizzled cliff are helpfull for UIs is also kinda funny :P
you can create new UI elements and implement em properly