#arma3_scripting

1 messages ยท Page 643 of 1

little raptor
#

or just use the event handler I told you

open star
#

Never used Event Handlers that I know of or remember doing at least, but when I try looking for nearest object nothing comes up

little raptor
#

do a full world search

open star
#
nearestObjects [player, ModuleCurator_F];```
willow hound
#

...

little raptor
#

@open star

nearestObjects [[worldSize/2,worldSize/2], ["ModuleCurator_F"], 1+worldSize/sqrt 2]
#

and please don't remote exec that meowsweats

still forum
#

And player is nullObj

little raptor
#

not anymore, he's respawned

still forum
#

We have a command called allCurators

little raptor
#

we do?

#

damn

still forum
little raptor
still forum
#

There is no player on server

#

And he's running server exec

little raptor
#

yeah

#

true

still forum
#

Do such stuff I always have a "dedmen" variable for myself

winter rose
still forum
#

How's that related?

winter rose
#

sliding that into the convo, muhahaha
I noticed that a few days ago

open star
#

Still nothing comes up though

#

just {}

little raptor
#

did you use allCurators?

open star
#

Mhm

still forum
#

Show what you are executing

open star
#

just allCurators like the wiki showed.

still forum
#

If "nothing" would come up, it would be [], not {}

open star
#

Yeah, my things are backwards not used to it it is just square brackets.

still forum
#

Oof. Maybe the module was deleted :D

open star
#

I'm convinced of it at this point mate.

#

It's happened before when I use the vanilla respawn, and I was in Zeus when I die it either breaks and doesn't come back or gets deleted.

#

I don't think it gets deleted but I don't know enough on how the respawn system works in vanilla to know what happens when you die and respawn in the same character position.

#

Or well, Character Slot* not position.

#

So what happens if it comes up blank.

#

with no brackets.

little raptor
#

where are you executing it?

#

local right?

open star
#

I tried parsing it into an array this time.

#

I've done Local and Server

still forum
open star
#

just empty or square brackets.

still forum
#

Well I'd call it's gone then.

open star
#

It's gone, I'm convinced it's gone.

little raptor
#

next time use the event handler

open star
#

I know very little about ASL to do that properly without mucking something up.

still forum
#

You mean SQF? :D

open star
#

You guys have your own version of SQF

still forum
#

You can create a Zeus via script that you just local exec in debug console

tough abyss
#

Hello, I have a question

still forum
#

There is one on my github from like 4 Years ago that'll still work, but I think it's not super efficient anymore

open star
#

OH yeah no it's gone

#

I went into the fake zeus and added the objects of where it should be, it's gone.

little raptor
#
this addMPEventHandler ["MPRespawn", {
  [_this, {
    params ["_unit", "_corpse"];
    _curator = getAssignedCuratorLogic _corpse;
    unassignCurator _curator;
    //_curator setVariable ["Owner", getPlayerUID _unit, true];
    _unit assignCurator _curator;
  }] remoteExec ["call", 2];
}];
open star
#

Only my triggers are left behind.

tough abyss
#

not entirely new to sqf, but I'm having trouble finding what I need. So, basically. I want to script in a blood spray effect without the bullet actually hitting the enemy, do I need to create my own particle effect for this? or is there an easier way. I did a little bit of digging couldn't find what I needed.

still forum
#

Just plunk in debug console, local exec. But needs CBA

open star
#

Aye have that.

still forum
tough abyss
#

? drop

#

is that a preset function

still forum
#

No, as I said it's a command

ebon citrus
#

Damn, sniped

still forum
tough abyss
#

hmm, i'm just going to have to dig around for the parameters for the blood

fair drum
#

any particular reason why in an aircraft with AI in the cargo space, unit action ["Eject", vehicle unit] it does not kick out the AI but will kick out players, but unit action ["getOut", vehicle unit] will eject all players and AI when run

still forum
#

Yeah. Maybe you can find a old post about it on the BI Forums listing the parameters for blood

little raptor
#

most actions are at least

tough abyss
#

also, can I make enemy ai target specific body parts with doFire or commandFire

tough abyss
#

shame

little raptor
#

unless you use helper targets

ebon citrus
#

If i recall correctly, Eject wont work on AI

fair drum
#

its arma AI, its hit the head or nothing, every time haha

ebon citrus
#

You will just have to tp them out of the vehicle

tough abyss
#

wiki link

#

helper targets

little raptor
#

none

tough abyss
#

ahh

little raptor
#

make it yourself

ebon citrus
#

Make another object and have the AI fire at that

little raptor
#

B_target_F or something is the base class

fair drum
little raptor
#

but its scope is 0

tough abyss
#

ah mk thanks

fair drum
#

exploring the CBA function library. which are some that I should definitely be using that are more useful than the BI version?

still forum
#

Don't know of anything that's duplicated there.

fair drum
#

i guess most of this was before things were added to the default library in the early days?

still forum
#

Don't think so

#

CBA remote events can be replaced by remoteExec, but neither is really better than the other

#

I guess their Eventhandler system is same as the vanilla scriptedEH, the CBA system is better performance wise, but different feature wise

fair drum
#

thats usually the one i see people use

#

cba event handlers

ebon citrus
#

How can CBA EHs be better performance wise than Vanilla EHs?

little raptor
#

the functions are cleaner. EHs are the same

ebon citrus
#

And is there a particular reason BI doesnt clean up their functions?

still forum
ebon citrus
#

Dont the EHs on vanilla run engine-side?

still forum
#

And no need to if basically no one uses it nor cares

little raptor
#

all EHs do

finite sail
#

๐Ÿ˜ฆ I dont use CBA

still forum
ebon citrus
#

Which are?

still forum
#

Scripted EHs.

austere granite
#

scripted? ๐Ÿ˜„

ebon citrus
#

Nothing coming up with that query, so i assume there is an actual name for it

austere granite
#

addScriptedEventHandler

still forum
#

The name is scriptedEventhandler

austere granite
#

๐Ÿ˜ฆ

ebon citrus
still forum
austere granite
#

They're just a generic scripted system to have events / signals / etc whatever you want to call them for the framework you have

#

Easy way of using some modular functionality that can be gud

ebon citrus
#

So these are essentially deprecated by the more modern engine side ones

austere granite
#

No they're completely different

oblique arrow
austere granite
#

A scripted system isn't "real" you can create any arbitrary event and call it any arbitrary time and pass in arbitrary data when calling it

still forum
#

You can make scripted events all you want.
You cannot make engine events

austere granite
#

They're a completely different thing. Some people hate them, I love them

still forum
#

Don't know why anyone would hate them :u besides hating themselves for not understanding the concept

ebon citrus
#

Ummmm...

austere granite
#

I think because there's a little overhead in calling them, instead of just calling whatever functionality you want to happen directly

ebon citrus
#

How exactly is this different from the engine event handlers?

austere granite
#

........

still forum
#

They are not engine. They are scripted

#

Engine Eventhandlers are not scripted. They are engine

ebon citrus
#

How are they different in application

winter rose
still forum
#

As the name says

still forum
austere granite
#

A scripted system isn't "real" you can create any arbitrary event and call it any arbitrary time and pass in arbitrary data when calling it

#

You can't just randomly add new "engine" events to your mod

ebon citrus
#

How can you add new scrioted event handlers

austere granite
#

but you can call a scripted system for example "OnBandageFinished" in your medical system

still forum
#

It was linked above 3 times

austere granite
#

And then if you create another mod for "Scoreboard" you could for example to +5 score on the "OnBandageFinished" EH

ebon citrus
#

And it looks for a variable change?

still forum
winter rose
#

nope, it's an EH
fired by code

ebon citrus
#

How do you fire the event?

winter rose
#

wikiii

ebon citrus
#

Not documented

still forum
#

(just a guess)

#

Wrong guess

winter rose
#

BIS_fnc_addScriptedEventHandler
BIS_fnc_callScriptedEventHandler
BIS_fnc_removeScriptedEventHandler
BIS_fnc_removeAllScriptedEventHandlers

still forum
#

To be expected that they didn't use "normal" naming

ebon citrus
#

Instead of calling... why wouodnt you just define a script function and call that?

still forum
#

Because you can only have one

austere granite
#

I think because there's a little overhead in calling them, instead of just calling whatever functionality you want to happen directly
๐Ÿ˜„

#

Modularity among other things

still forum
#

I don't quite understand why it seems that things need to repeated 3 times

austere granite
#

For example again the 'Scoreboard' plugin that i made for my mod

#

I have scripted events for just about every 'event' that happens

ebon citrus
#

Because i dont get the application of it

still forum
#

You don't know what Eventhandlers are?

ebon citrus
#

Well, i guess a chef will never understand the application of an angle grinder

austere granite
#

That means rather than me needing ot add "Scoreboard" related to code to my medic system, my spawn system, my killing system, etc etc etc

#

I can just tie into events easily and keep things neat

ebon citrus
#

I mean that i have never needed anything this specific without having another smarter way of doing it

austere granite
#

smarter way of doing it
Ok lol

still forum
#

Just try to apply your "why not call function directly" to engine Eventhandlers.
Do you want the engine Fired Eventhandler to call a hardcoded BIS_fnc_firedEvent function, that's empty and that you cannot overwrite or hook into?

ebon citrus
#

I know what event handlers are and i've used the engine side EHs many many times

#

But i dont get what this is trying to be

still forum
#

That would make the event useless if you can't add a handler to it when you need it

austere granite
#

There's a ton of different reasons you'd want to do it. For me the main one has always been modularity

still forum
#

Scripted Eventhandlers are the same thing as engine eventhandlers.

Application wise.

#

Want to know if someone shot their gun? You can check every frame if gun is being shot currently, or you can just add a fired Eventhandler.

ebon citrus
#

yes, but that part is already taken care of by the engine side eventhandlers

still forum
#

Want to know if someone placed a explosive with ACE?
You can check every frame if someone is placing a explosive. Or you can add a ACE_explosives_placed eventhandler.

ebon citrus
#

what more is there for the scripted EHs to do?

austere granite
#

Want to know if someone finished bandaging with ACE?

still forum
#

No it's not

austere granite
#

We already explained like 4 times now

winter rose
ebon citrus
#

oh, so it's for mod API use

austere granite
#

It feels like somehow these messages are not being received on your end

ebon citrus
#

i see

#

๐Ÿค”

still forum
#

That's the general programming wide concept of Eventhandlers or signal/slot systems.

ebon citrus
#

i never even thought about that

still forum
winter rose
austere granite
#

sectorEnter / sectorLeave / sectorCaptured etc etc. Plenty of different gamemodes and mods use it in different ways

ebon citrus
#

i can see its application being for modded eventhandlers now

austere granite
#

My terrain making mod uses it for each "Tool" it has. onActivate / onDeactive events

winter rose
ebon citrus
#

or, user defined eventhandlers

austere hawk
#

is there a command to determine if a building is mission placed or map placed ?

ebon citrus
#

the Biki article lead me astray a bit

austere granite
#

It means that someone can easily make a new tool for that mod, without needing to touch any existing code, he can just register onActivate / onDeactivate script events

ebon citrus
#

๐Ÿ˜…

#

i thought that the events could only be ADDED by BI modules

#

similar to how the engine side events are

austere granite
#

No the point of scripted event systems is that they're 100% scripoted

ebon citrus
#

yes, i got that part already

#

๐Ÿคฆโ€โ™‚๏ธ

winter rose
#

so we're clear, noice ๐Ÿ˜„

still forum
#

We only repeated that like 6 times now.
Better make it a round 10

#

Or a round 8

ebon citrus
#

this aprt had me confused:
Scripted Event Handlers are triggered by some of BI's modules and functions.

winter rose
#

some could be engine-side yes

#

e.g opening pause menu

still forum
#

Or Arsenal

winter rose
ebon citrus
#

yeah, but it does say that they are triggered by BI's systems

still forum
#

Arsenal has open scripted EH

winter rose
#

and here I though Arsenal is SQF only

ebon citrus
#

the whole thing flips around now that i know user scripts can trigger them just aswell

still forum
ebon citrus
#

isnt that the whole point

#

to allow SQF to trigger EHs

still forum
winter rose
still forum
#

It's not?

ebon citrus
#

why does the first sentence lead you astray then?

still forum
#

It's scriptedEH

winter rose
#

some could be engine-side yes
e.g opening pause menu

Or Arsenal

technically, Arsenal can not?

still forum
#

People are expected to read on. And not just give up after the first sentence.
It doesn't lead you astray, it says what is fact

#

Pause menu is not engine side

#

The scriptedEH is scripted

ebon citrus
#

when writing a summary, you want to summarize the information

#

not sprinkle it around

austere granite
#

oh god

#

stop

still forum
#

Yes. But it does that

ebon citrus
#

it kind of does not

winter rose
still forum
#

Barely anyone uses scriptedEH.
So the most important thing that people reading that page should get is that BI uses them

ebon citrus
#

Scripted Event Handlers are triggered by some of BI's modules and functions or by user defined scripts

Something like that

still forum
#

Because thats what most people looking for the info are looking for

ebon citrus
#

But i digress, appreciate the explanation.

winter rose
still forum
#

Zeus ping is addEventHandler on curatorLogic no?

#

Engine doesn't know that scriptedEHs are a thing

#

It's purely all script

winter rose
#

yeah, but isn't ping a scripted thing?

still forum
winter rose
#

good enough answer I guess ๐Ÿ˜„

winged wing
#

What does the "marker" in the description parameter of BIS_fnc_taskCreate change in-game? I've tried generic text, marker variable name, and marker type in it and haven't noticed any changes.

winged wing
#

Task description in the format ["description", "title", "marker"]

winter rose
#

I suppose the marker's text

#

as in, the task's marker

#

the little v pointing to where the task is

#

if the task has no destination, you won't see it

#

@winged wing โ†‘

winged wing
winter rose
#

might be the old vs new task?

tough abyss
#

I'm trying to do setDir when I have AI inside a boat. won't let me do it, anyone know a way around this?

winged wing
tough abyss
#

is it even possible to setDir when AI is in the speedboat?

still forum
#

No. Units in vehicles always sit in their seat in the seats direction

tough abyss
#

darn

#

what about attaching objects to the vehicles and then attaching the AI to that object

winter rose
#

it would mess with the first person view I believe, but I am not sure

tough abyss
#

that's fine, don't need the first person view

finite sail
#

It would mess with hitpoints too

#

the rotating crew would be invulnerable

tough abyss
#

not a problem, i'm just trying to make a cinematic. so, the functionality doesn't bother me

winter rose
#

then yeah, attachTo ๐Ÿ™‚

tough abyss
#

Thanks!

#

my ai, keeps "walking in place" when i attach him

#

even when i change the animation

#

i don't know if using a flashdrive as my attachable object was the best idea

#

tried using unit DisableAI "MOVE"; and it fixed it

drifting sky
#

Arma2OA. How can I respawn a player in multiplayer via script? I.e., not using the "respawn" in description.ext.

winter rose
#

kill & createUnit a new one then selectPlayer?

drifting sky
#

does isPlayer work on a "killed" unit?

winter rose
#

unsure really

#

what do you want to do?

drifting sky
#

Ok. There are playable units in the mission. If not player, then they are ai controlled. When any of them die, a new unit will be created for them. Now, if it is a player, the player must take control of the new unit.

#

I'm not using the built-in respawn because it causes unintended garbage collection problems

#

So I just gotta check that I can detect that a local player had controlled the killed unit

tough abyss
#

also, question. Last one for today. I promise. Why does forceWeaponfire work on some animations and not others

#

is it just a dev thing or do i need to play around with the different force fires to get what i need working.

winter rose
winter rose
drifting sky
#

safety script? I searched and found no way to disable the garbage collector

winter rose
#

isn't GC a module in Arma 2 (OA)? ๐Ÿค”

tough abyss
#

oh like cfgmoves

drifting sky
#

In A2OA, when you enable respawns and have playable ai slots, the garbage collector starts automatically

#

No way to turn it off as far as I can tell

winter rose
#

and what are the issues encountered?

drifting sky
#

it causes bodies to be removed prematurely

#

I think I can do my respawns with if (player == killed) and then create a unit and do selectPlayer

#

in this situation what happens if the player leaves the game? Would a newly joining player be able to take that unit?

winter rose
#

nope

#

(to the last question)

drifting sky
#

I'm not able to take control of the newly created unit using selectPlayer. maybe it doesn't work if the player has died?

robust hollow
#

if you are using no engine respawn template, wouldnt the slot become unusable after death?

#

thats how it is in a3, though i havent tried scripting unit respawning.

drifting sky
#

uhm... i've not used a respawn template before, but I presume I would have to enable respawns in order to use them.

#

I'll just make the ai non playable. That seems to fix the garbage collector problem with respawns.

fair drum
#

im not sure if I understand the comparison with flyInHeight and flyInHeightASL do I have to use both?

winter rose
#

flyInHeight flies X meters above the ground, whereas flyInHeightASL flies X meters above sea level
depending on which one is "higher", it will use that one

fair drum
#

mk i just want my plane to fly at 200m ASL and ignore terrain changes

winter rose
#

then set to 1 ATL and 200 ASL ๐Ÿ™‚

fair drum
#

lol so I did that and when my plane went to bank turn it got stuck in a never ending bank. guess i might have to leave some room for variance in there

winter rose
#

give it some space from the ground yes

#

I'm wondering if it's possible to destroy or shutdown an engine mid flight just to add some immersion and yeah alright
@covert crow YES it's possible ๐Ÿ™‚

austere hawk
#

without major effect (pfx and sfx) work its however a bit... underwhelming if u're after immersion

covert crow
#

Yeah I did a bit of Googling, its more like I just want to piloting crew to uhh

#

Let's just say draw the short stick and hope they know enough that they are able to autorotate to safety

winter rose
#

ah yes, autorotation ๐Ÿ˜„ I did a training mission about that during the alpha

covert crow
#

More curiously I'm wondering about things like large fixed wing aircraft with 2 or more jet engines

austere hawk
#

with helo, yeah that works. With planes - not really, they fall like bricks and bleed speed with the smallest turn

winter rose
#

like "random location + random time + random damages" = deal with it ๐Ÿ˜„

winter rose
covert crow
#

Its realistic in that there's enough thrust provided to atleast glide right

winter rose
#

glide forward, I don't know how realistic Arma is about engineless fixed wings (I don't play flight sims much)

austere hawk
#

you cant make a banking turn - which is a big "oof" for simulation. You can addForce and addTorque, which is very powerfull... if you are into more complex stuff, flight mechanics and so on. I was considering trying to make my own flight model, but had to sacrifice it

covert crow
#

Yeah I dont know a damn thing about anything

austere hawk
winter rose
#

or you can bring an idea and see with us how it could be doable (or not) ๐Ÿ˜‰

#

I usually only see a possibility from the scripting end, not from the "real need" end, so a fresh look/idea is always good

covert crow
#

Well I mean for a second I thought of "hey let's give it the smoke particle effect" then I realised performance issues

winter rose
#

smoke is not that expensive, so why not! plus exist some already made effects ๐Ÿ™‚

covert crow
#

Yeah ive seen those but it feels like with armas fun tendencies to just not be logical sometimes it might backfire

austere hawk
#

i dont think particles can be applied in-cockpit view. The cockpit view is always "displayed on top" over anything else

covert crow
#

Heyooo

#

There we go,

#

The first thats not gonna work, its a great start but im sure I'll figure something out later

austere hawk
#

alert sounds + peepee (post processing overlays) could get you a fair bit in invoking a bit of terror/anciety. A few random nudges with addForce /addTorque and it should already feel like you are wrangling controls. Though without proper control over cockpit warning dials it will feel a bit stale. Maybe some custom plane mods have animatable warning cockpit indicators. I know i have ๐Ÿ™‚

winter rose
#

color desat + additional contrast always do the job!

fair drum
#

is it possible to do your own custom post process? the brown one is a litttttle too dark

winter rose
#

totally yes

fair drum
#

miiiight be a little over my head atm

winter rose
#

not that much really ^^
as soon as you get what the values are, you only need to tweak to your liking

fair drum
#

yeah had to look up what a few of those things meant as far as photos go

#

do you know off hand the class name of the parachutes that you can attach vehicles and crates to?

winter rose
#

not off-hand, but the wiki might have intel ^^

#

you hear my voice now, and only my voiceโ€ฆ
you will do as my voice saysโ€ฆ

Use the wiki!!

๐Ÿ˜„

fair drum
#

this MIGHT be the most stupid way of doing things I've done so far... but I'm guessing that the reason only 1 marker is created for one of the crates is that I somehow need to make the marker name unique for each of them?

blah blah blah

for "_i" from 1 to 2 do {

    [_vehicle] spawn {

        params ["_vehicle"];
        private _supply = "B_supplyCrate_F" createVehicle [0,0,50];
        _supply setPosATL getPosATL _vehicle;
        private _cargoParachute = "B_Parachute_02_F" createVehicle [0,0,5];
        _cargoParachute setPosATL getPosATL _supply;
        _supply attachTo [_cargoParachute,[0,0,0]];

        private _marker = createMarker ["Supply Crate", _supply];
        _marker setMarkerType "hd_dot";
        _marker setMarkerText "Supply Crate";

        [_supply,_marker] spawn {

            params ["_box","_marker"];

            while {getPosATL _box select 2 > 2.0} do {
                _marker setMarkerPos _box;
                sleep 1;
            };
        };

        waitUntil {getPosATL _supply select 2 < 2.0};
        sleep 0.3;
        detach _supply;
    };
};
winter rose
#

correct

winter rose
fair drum
#

without the "do"?

robust hollow
#

with the do.

#

lou just writing to show context

#

incase it isnt clear, you'd also need to provide _i as a parameter for the spawn, and then get it with params before using it

fair drum
#

yeah this is what I did and it works

for "_i" from 1 to 2 do {

    [_vehicle, _i] spawn {

        params ["_vehicle", "_i"];
        private _supply = "B_supplyCrate_F" createVehicle [0,0,50];
        _supply setPosATL getPosATL _vehicle;
        private _cargoParachute = "B_Parachute_02_F" createVehicle [0,0,5];
        _cargoParachute setPosATL getPosATL _supply;
        _supply attachTo [_cargoParachute,[0,0,0]];

        private _markerName = format ["myMarker_%1", _i];
        private _marker = createMarker [_markerName, _supply];
        _marker setMarkerType "hd_dot";
        _marker setMarkerText "Supply Crate";

        [_supply,_marker] spawn {

            params ["_box","_marker"];

            while {getPosATL _box select 2 > 2.0} do {
                _marker setMarkerPos _box;
                sleep 1;
            };
        };

        waitUntil {getPosATL _supply select 2 < 2.0};
        sleep 0.3;
        detach _supply;
    };
};
robust hollow
#

does _vehicle change before that spawn in the loop?

fair drum
#

no

robust hollow
#

so you do all that twice for the same vehicle?

fair drum
#

kind of creates a nice... static line effect

jade tendon
#

Don't know if anyone here has played with Aliascartoon's Smoke Signal scripts, but i was wondering how i can make ai fire the scripts when they spot me.

The basic of the script allows the player to fire the scripts with the action menu.
TIA

little raptor
whole light
#

What is the best way to detect if an object or unit has spawned inside geometry? For example, spawning inside a house object instead of at one of the building positions.

tough abyss
#

is there a way to to magically spawn in a bullet

#

and make it hit a target

#

or an enemy rather.

little raptor
little raptor
#

look up setVelocity and setVectorDirAndUp commands

whole light
#

@little raptor Thank you.

little raptor
# whole light <@!360154905148653568> Thank you.

np. also, if the unit's getPos select 2 is negative, it's clipping inside the floor of the building (roadway LOD). you can use that too.
similarly, if getPos select 2 is larger than ~0.1 m, it's floating in the air above the surface

whole light
#

Ah, that getPos select 2 is very handy to know, I'll give that a whirl.

jade tendon
#

I keep getting waitUntill return nil. Expected true or false

little raptor
#

@jade tendon see the pinned messages

#

that's not how you define a unit

#

a unit is an object

#

you're providing an array

#

also it's not defined inside the spawn

#

and your code is all wrong (types and stuff)
for example, what is smoke_obj?

#

you should read
https://community.bistudio.com/wiki/Introduction_to_Arma_Scripting
an example:

[] spawn
{
  _unit = SoldierEB; //i'm assuming that's what you named your unit in editor
  waitUntil
{
    sleep 5;
    time - (_unit targetKnowledge player select 2) < 1
};
    //not sure what smoke_obj is, but I'm 99% sure it's not even the right type (and probably not defined either)
    [smoke_obj,"red"] execVM "scripts\AL_smokeSign\al_object_smoke.sqf";
};
jade tendon
#

[smoke_obj,"red"] execVM "scripts\AL_smokeSign\al_object_smoke.sqf"; actually came from Alias. Its commented inside al_object_smoke.sqf

little raptor
#

so? doesn't mean it's defined

jade tendon
#

and i thought the [] was wrong

little raptor
#

so was the ""

real tartan
#

{ alive _x && count (fullCrew [_x, "driver", true]) > 0 } count vehicles will return drivable (real) vehicles

tough abyss
#

I'm having an issue, where my AI stops the boat each time it gets into combat, yet I want it to keep moving

#

tried disableAI "autocombat"; set it to careless and hold fire

#

nevermind, figured it out.

worn forge
#

Anybody have any neat solutions for dealing with AI who spawn in / move into /get stuck in rocks?

tough abyss
#

if you set the formation as file it might not happen as often @worn forge

#

the more spread out they are the more likely that is to happen.

distant oyster
#

hm interesting. executing:

parseText "<t size=2>TITLE</t><br/><br/>Body." remoteExec ["hint", remoteExecutedOwner];
``` logs the following to rpt:
```Performance warning: SimpleSerialization::Write 'params' is using type of ',TEXT' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types```
tight shoal
#

Hej People!
wish to all u a great 2021!
i need help, i was trying to make some scripting with the Editor for equipment from my unit, but i have an issue:
i trying to force to load a predefined loadout that i made, and for that, i this script in the Init from the Unit's that are oficial's entities.(as well as for the other's with their specific script): null = [this] execVM "loadouts\Oficial.sqf"; this addeventhandler ["respawn","_this execVM 'loadouts\Oficial.sqf'"];
But it's not working, what am i'm doing wrong? i made a File name *onPlayerRespawn.sqf *with the script's, as well for the Loadouts script, they are at the "right" place i think.
The worst of this is that in de VR map work's it perfectly, but if i change to a Map it's not working, what am i'm doing wrongยฟ?(and yes, all mi mission's have the files in the order's) could someone help me a little bit?? I'm really sorry if this is really simple, but i'm looking in Biki as YouTube tutorial's, and none has the solution or works well :S
regards!

frail egret
#

Can you take a screenshot of the folder structure of the script?

#

Actually never mind, just realized you can't post pictures here.

tight shoal
#

me too

#

can i send it to you per DM?

frail egret
#

Sure

tight shoal
#

thanks Tail! and sorry for taking u time :S

frail egret
#

Don't thank me yet, we haven't solved the problem lol

willow hound
#

If the units you want to set the loadout of are all players, it should be enough to have execVM "loadouts\Oficial.sqf"; in onPlayerRespawn.sqf. In that case you also don't need a parameter in Oficial.sqf because you can just use player (instead of _this # 0).

tight shoal
sudden bear
#

Excuse me I am really a noob at scripting... but I would like to understand where can I find the Cfgammo for modify for the RPG-42 the allowAgainstInfantry ๐Ÿ˜–

spiral temple
#

is there a way to get worldName in a hpp script?

still forum
#

hpp's are not scripts

#

What is your hpp?
If you #include it in a script you can just use worldName

worn forge
#

@tough abyss as soon as they engage enemy units (ie players) they don't respect formations.

little raptor
grizzled lagoon
#

Hello, I have a little problem and I find it quite bizarre, I explain myself, I defined the name of the item and I set a variable on it, however when I cursortobject on it and I do a get variable above all works without problem but when I take the result of the cursortobject and try it it only tells me that the variable is not defined. Do you have any idea where this could come from?

little raptor
grizzled lagoon
#
_drg = "Hazendarck_Canabis" createVehicle position player;
_drg setVehicleVarName _name;
_drg setVariable [_name, [0,10,5], false];``` the crรฉation, if i try this (i look object) ```sqf
var = cursorObject getVariable "drg_0";``` its right this but ```sqf
var = drg_0 getVariable "drg_0";``` is not right
#

cursortobject done -> drg_0

little raptor
#

@grizzled lagoon setVehicleVarName doesn't create a new variable for you

#

also I don't see why you're doing that

#

anyway what that means is:

drg_0 = _drg;

you must put this at the end of that

grizzled lagoon
#

to automate the growth of plants and if they are not treated well have effects on them

#

Yes but with that 20 plants = global var

little raptor
#

then create an array
I don't see why you think 20 global vars is bad

still forum
#

How else did you intend to set a vehicle var name, without having a global var?

little raptor
#

if you think you have to put in all of them one by one, look at missionNamespace and setVariable
but as a I mentioned an array is the best way to do that

still forum
#

Why do you want to store the object on its own var space, you'll already have the object. Big confuse

little raptor
#

if the variable name was the same it would make sense. but right now it doesn't, as Dedmen said.

_drg setVariable ["pos", [0,10,5], false];
grizzled lagoon
#

the all script is this : ```sqf
_pos = position player;
_px = _pos select 0;
_px = _px + 1.5;
_py = _pos select 1;
_pz = _pos select 2;
_pz = _pz - 1.8;
_pos = [_px, _py, _pz];

_drg = "Hazendarck_Canabis" createVehicle position player;
_drg setpos _pos;

if (isnil "ndrogue") then {ndrogue = 0;}else {ndrogue = ndrogue + 1;};
private name = "drg";
_name = _name + (str ndrogue);

_drg setVehicleVarName _name;
_drg setVariable [_name, [0,10,5], false];

if (isnil "drg") then {drg = [];};
drg pushBack _drg;

sleep 2;
if (isnil "verif") then {[] spawn john_fnc_verifetat;};```

#

verifetat

#
verif = 0;
_nombre = 0;
_name = "drg_" + (str _nombre);

_ndrg = drg select _nombre;


varr = _ndrg getVariable _name;```
#

I think it's best like that I only use a global var

#

I have always been advised to use the least global variable

still forum
#

If you use global variables, always prefix them so they are unique to you

#

And yes. Tons of globals often shows bad code...

#

Why not put all plants into ONE array?

grizzled lagoon
#

the names of the plants will be put progressively in the table drg

still forum
#

Also your whole block at the top, can be done in a one liner

_pos = position player vectorAdd [1.5, 0, -1.8];

still forum
#

I don't see the need for globals here

grizzled lagoon
#

Thank you, I didn't know the vector add

still forum
#

You the. Don't need ndrogue anymore. As you can just count your array.

#

You already have the array "drg" why not just use that?

tough abyss
#

so for arrays, would I need to do { _x disableAI "MOVE" } forEach

#

would i put the unit name at the end?

still forum
#

Your code above doesn't need a global variable per plant.

still forum
tough abyss
#

no, an entire squad

#

or a group.

#

yeah, a group of units.

still forum
#

Then you put the group after the forEach

#

Did you give your group a name?

tough abyss
#

group being like alpha1-1

#

that's what i was wondering

#

erm, isn't that the default name

#

like when a you put down a squad and its callsign is alpha1-1 or whatever. would I put that as the group?

grizzled lagoon
#

Yes add all in 1 var global, to save a variable outside the file there is better than the global var?

still forum
#

You need a variable name for the group.
A single unit in the group would work too though @Aux#7865 .
Where did you put your code

still forum
#

Save what variable? For what reason?

#

I would just fix and rewrite your whole script. But I'm on phone :u

tough abyss
#

right, so I would assign like squad = group alpha1-1?

#

and use squad as my variable?

#

like that

still forum
#

Mo

#

No

#

Answer my question

grizzled lagoon
#

i save number of vehicle for create vehicle drg_0 drg_1 ... and drg for save all name of plants and up after in getvariable, and var verif for say if the script to up plants its done

tough abyss
#

talking to me or jon

still forum
#

Yes I see that you do that. But I don't see any reason for it. WHY do you need a global variable for every plant.
Why can you not just store them in an array?
@Jonastex#2733

tough abyss
#

i put my code in the init for the ditor

#

editor

#

yeah man, forEach bro

#

forEach time sqf breaks my god damn soul

little raptor
#

that's it

tough abyss
#

_group is a private variable for the callsign correct?

#

like alpha1-1

#

i'm sorry, I just started learning sqf.

still forum
grizzled lagoon
#

yes i make all information in array i work on that, I leave the setvarialbe ... on the plant so that the players can then look at their stats when they aim at it @still forum

tough abyss
#

editor

#

eden

little raptor
tough abyss
#

ok I gotcha, so like _group = group 1,2,3,4,5,6,7,8. the numbers being the variables i assigned in the eden editor

little raptor
still forum
tough abyss
#

I said I was using the eden editor

still forum
#

Yes I know that

#

But that wasn't my question

tough abyss
#

what's your question again.

still forum
#

Which init

tough abyss
#

object

#

server rather

little raptor
#

@still forum btw disableAI doesn't work in init

tough abyss
#

Server init

still forum
#

Unit init
Group init
Composition init
Game logic init
Mission init

#

Object or server? What now?

#

Server init is not in 3den

grizzled lagoon
#

its done this ```sqf
if (isnil "drg") then {drg = [0, 0, []];};
_pos = position player vectorAdd [1.5, 0, -1.8];

_drg = "Hazendarck_Canabis" createVehicle position player;
_drg setpos _pos;

_ndrogue = drg select 1;
private name = "drg";
_name = _name + (str _ndrogue);

_drg setVehicleVarName _name;
_drg setVariable [_name, [0,10,5], false];

(drg select 2) pushBack _drg;

sleep 2;
_verif = drg select 0;
if (_verif == 0) then {[] spawn john_fnc_verifetat;};```

tough abyss
#

object: init. in eden

still forum
#

@grizzled lagoon
_ndrogue = count drg.

drg pushBack _drg

tough abyss
#

I also have a file open that i'm using called server.sqf I'm calling it via execVM

still forum
#

Also arrays start at 0

still forum
tough abyss
#

yeah.

#

the squad leader

still forum
#

@grizzled lagoon also get rid of the setVehicleVarName, you don't need that anymore I think?

grizzled lagoon
#

Yes drg = [verif, ndrogue, [drg_0, drg_1 ...]];

little raptor
tough abyss
#

so like, assign a variable for the squad leader then set that to _group = group variable

#

would that work.

still forum
# tough abyss the squad leader

That means, in that units init the "this" variable points to the unit.

So you can use "units this" to get all the units in the squad leaders group

#

So

.. forEach units this;

tough abyss
#

ok, thanks, but would what I said work?

#

like _group = group squadLeader

still forum
#

Not variable

#

Ni

tough abyss
#

no ok.

still forum
#

group this

Is the group of the current unit

#

Who's init script you are writing

#

But don't use a local variable, and you don't need group either in this case.

tough abyss
#

I don't even know what that means. no ones man. I'm making my own thing.

grizzled lagoon
still forum
still forum
little raptor
#

Not 100% sure but can't test right now. I think it was either that or doStop.

still forum
grizzled lagoon
little raptor
#

exactly

#

use the same name

#

why do you change the name

#

do you even know how setVariable works?

still forum
#

You can just store the index of the plant in "drg" array, as variable onto the object.
Then you can get it with cursorObject and know which plant it is

little raptor
#

each variable is unique to each object, even if their names are the same

grizzled lagoon
still forum
grizzled lagoon
still forum
#

Yes

#

So?

#

That variable only exists once. So makes sense to be global

grizzled lagoon
#

var global for stock 0 or 1

#

I use that var Once

still forum
#

Yep. Then do that

#

But adding it into array creates more problems than it solves

#

Just make it a global var

tough abyss
#

okay, so can't i just make an array using _group = ["a", "b", "c"]; and then { _x disableAI "MOVE"} forEach _group

grizzled lagoon
little raptor
tough abyss
#

right, removing the ""

little raptor
#

you need objects

#

just removing it doesn't give you objects

tough abyss
#

no, I get that. What I mean was I assign a variable to a unit, that variable is x1. Next, I do _group = [x1, x2, x3]; the next ones being other units.

grizzled lagoon
#

The problem with the getVehicleId is that after how it is retrieved using the player cursor ?

still forum
grizzled lagoon
#

cursortobject done the model and not id

tough abyss
#

actually it's cool. Ill just use the array way for now since I understand it.

#

thanks for the help Dedmen and the Leopard20.

still forum
#

cursorObject returns the object. As the name says

grizzled lagoon
#

i have make this in object sqf _drg setVehicleId _ndrogue;

#

and cursortoject done this sqf 297b6cf9600# 8: hazendarck_canabis.p3d

still forum
#

setVehicleId? Wat?
Did you not read the wiki page?

Get rid of your setVehicleId and read it's wiki page.

still forum
#

I don't see a problem

grizzled lagoon
#

Yes I just watched and it's not appropriate for what I need, the problem is that if I delete the setVehicle VarName I can no longer identify the plants between it

still forum
#

Which is why I set set variable the number

#

_drg setVariable ["plant number", _ndrogue]

...

_ndrogue = cursorObject getVariable "plant number";

#

Then you know which number plant you are aiming at

grizzled lagoon
#

Yes, but then how to recover the number of the plant, if there are several plants, the drug is no longer good

still forum
#

I just showed you how

grizzled lagoon
#

I'm confused but if I do a setVehicleVarName on it and store the info in the global var and don't use the set variable anymore it works. And suddenly I use the cursortobject to identify it

still forum
#

cursorObject always returns you the object.

#

The setVehicleVarName only changes the displayed name, but it's still the same object. You don't need to set a vehicle var name or global var

grizzled lagoon
#

I think I understood what you advise me but the concern is that if I just do a setvariablen then the objective is to make the plant rise so I could not except if I aim at it but the goal is it's automatic

still forum
#

You have the array

#

Just iterate through your array.
Your "drg" array

#

It has all the plants

grizzled lagoon
#

Yes but for say plant number

still forum
#

You know the number

#

It's the index in your array

#

And you have it stored as variable on the plant (if you did what I told you)

grizzled lagoon
#

if i have 3 plants the array is [drg_0, drg_1, drg_2], I can make script to try all combination but i think is not best idea

still forum
#

What combination?

#

Why combination?

grizzled lagoon
#

exemple this : sqf _nombre = 0; while {true} do { _name = "drg_0" + (str _nombre); _var = cursorObject getVariable _name; if (!isnil "_var") exitwith { its done }; _nombre = _nombre + 1; };

still forum
#

{
_var = _x;
Do stuff with _var...
} forEach drg;

Here, same thing

grizzled lagoon
#

Thanks

jade tendon
#

Am i on the right track or should i just give up.

Ref for code.
Trying to have ai run a script* when they spot an enemy, mainly the player.

  • script is from Aliascartoon's Smoke signal
    All ai are spawned dynamically by mod after mission start, no placed units in editor other than players.
{
    
    _unit = (sideEnemy);
    _target = (sideFriendly);  
    _knowledge = _unit knowsAbout _target;

    waitUntil
    {
        sleep 5;
        time - (_unit _knowledge _target select 2) < 1
    };
    [smoke_obj,"red"] execVM "scripts\AL_smokeSign\al_object_smoke.sqf";
    };
};```
exotic flax
#

not sure, but I doubt that (_unit _knowledge _target select 2) will return anything useful

still forum
#

it returns #syntax error

robust hollow
#

knowsAbout returns a number, you're after targetKnowledge where 2 is last time the target was seen by the unit

#

also there is one too many }; on the end of that snippet

jade tendon
robust hollow
#

also also, the _target should be a unit, not a side. _unit should be a unit too if using targetKnowledge

little raptor
#

@exotic flax it wont work at all

#

@jade tendon why did you modify that?

#

and you never answered what smoke_obj is

#

But I'm gonna guess it is actually the unit

exotic flax
drifting sky
#

A2OA: What are some solid ways to make AI group leaders not take point position? Is the V formation the only way?

finite sail
#

A4: How to work the railgun?

#

and the frickin lasers

hollow lantern
#

how would one display a message in a "proximity" chat? I have a unit that should tell the player something via chat, however this should be only happening when near the unit. sideChat is a bad option here as it is side global:

            [format ["%1: %2", groupId _watchGuard, "Slow Down and stop your vehicle, your entering a security checkpoint." ]] remoteExecCall ["sideChat"];```
Is there another option? Apparently directSay needs a audio file
robust hollow
#

remoteExec target units near a position. eg:
remoteExec ["sideChat",allPlayers select {_x distance player < 10}];

hollow lantern
#

that's neat. My next option I would have tried was to create a custom Radio channel and for the time being add the player into it.

#

but that works as well

robust hollow
#

side notes:
commands always remoteexec execute in unscheduled, so remoteExecCall can just be remoteExec.
and yea, there is no directChat command ๐Ÿ˜ฆ

supple cove
#

Is there an alternative for playSound3D but local to the player?

#

Not sure if sound sources can play music

#

I can't seem to find a way to attach a music to an object locally

robust hollow
#

if you define the music file in a CfgSounds class you could use say3D

supple cove
#

oh! thats it! ty

austere hawk
#

Can you bring markers to the foreground? I have some icons that created first. Then a bunch of area markers with transparency get created. But now the icons are darkened by the area markers

winter rose
#

@austere hawk order of insertion I believe

austere hawk
#

guess the only way is to delete and readd?

winter rose
#

Ctrl+X, Ctrl+V I believe

austere hawk
#

well, scripted

winter rose
#

(I'm a believer)
If scripted, well, yep

velvet merlin
#

setVehicleReportRemoteTargets, setVehicleReceiveRemoteTargets, and setVehicleReportOwnPosition

#

what are these actually about on the low level? it seems not about sharing group to group knowledge (ref knowsAbout/reveal), but only(?) about sensor (display?) information

#

in other words no relevance for AI, but only to the player as receiver

winter rose
#

sensors only yes

#

and no, AI can receive shared info as well

velvet merlin
#

whats the difference between "sensor" and entity knowledge?

#

but even then its not really confirmed information

winter rose
#

sensors share knowledge, that's about it I guess

velvet merlin
#

unfortunately the whole "sensor" upgrade with JETs DLC and around that time is worded so cloudy and unspecific (both config parameters and scripting) to really have any good understanding what all these do and how they relate to each other

#

like even when we disabled config wise every radar relevant parameter, AI vehicles still have perfect 360ยฐ scanning vision if something is irTarget=1 (only blocked by obstruction and concealment, plus affected things like viewdistance, daytime, fog, AI skill, etc)

drifting sky
#

A2OA. Is there a way to suspend the game so that a lengthy piece of code is allowed to execute quickly?

robust hollow
#

execute in an unscheduled environment?

little raptor
drifting sky
#

does alldead compile a new list of dead units, or does it just return a reference to an already existing list?

#

entry into init is an unscheduled environment, isn't it?

robust hollow
#

You can test allDead by saving the result to one variable, killing a unit, then executing it again and comparing the current value against the saved variable value.
I believe it would return a new array every time.

#

not sure what you mean by "entry into init", but you can test that by trying to suspend the script. eg: do sleep 5;, if it waits for the duration then it is scheduled.

drifting sky
#

I mean the init.sqf... when you enter into it

robust hollow
#

if it is like a3, it is scheduled.

little raptor
pliant stream
#

of course

civic pine
#

Is there a way to change the sound controller for footsteps on a single unit without needing to mess with configs?

#

For example I'm wanting to make a single units footsteps silent for a horror mission
But everyone else to be normal

winter rose
#

@civic pine nope, afaik

civic pine
#

Sads, hoped there would be a round about way to do it within the mission file

still forum
robust hollow
#

thats what i said... "i believe it would return a new array every time".

still forum
#

I don't know wany script command that returns a reference

#

SQF arrays are pretty inefficient

#

so it doesn't make sense to use them for engine internals

#

player command also doesn't return the player object, it creates a new object value and returns that new one

timid niche
#

Whats the point of the new HashMap?

#

Saw it on the dev branch and wanted to understand it a bit more.

still forum
#

its a hashmap

#

thats the whole point ๐Ÿ™ƒ

#

see HashTable on Wikipedia

winter rose
austere hawk
#

in eden, everytime i use https://community.bistudio.com/wiki/create3DENEntity in my script i get
Trying to create an invalid center EMPTY in RPT. Is this normal? It executed normally, throws no error but still confusing.

e.g. with inputs

diag_log ["input:", ["Object", _flagClass,[_xpos+0, _ypos+2, 0]]];
_flag = create3DENEntity ["Object", _flagClass,[_xpos+0, _ypos+2, 0]];
["input:",["Object","Flag_White_F",[530,5002,0]]]
Trying to create an invalid center EMPTY
 โžฅ Context:     [] L154 (scripts\GridpointSystem_eden_setup.sqf)
    [] L155 (scripts\GridpointSystem_eden_setup.sqf)
    [] L173 (scripts\GridpointSystem_eden_setup.sqf)
#

diag.exe i might add

brave jungle
#

@winter rose Don't suppose you remember helping me out with a waituntil, getting an error with it :D

private "_side_lbText";
waitUntil {
  private _cursorIndex = lbCurSel _ctrl_Players_Side_Combo;
  _side_lbText = _ctrl_Players_Side_Combo lbText _cursorIndex;
  _side_lbText |#|!= ""
};

waituntil returned nil when it run the second time, but this side listbox is never empty?

#

It works perfectly okay the first time around however.

winter rose
#

duu eet bettah!

brave jungle
#

:c

winter rose
#

@brave jungle check that cursorIndex is within range? and that returned string is not nil

manic grail
#

is there a way to put a custom texture on the Liberty?

winter rose
manic grail
#

there must be a way right?

#

setObjectTexture doesnt work as far as i know

winter rose
manic grail
#

modding shouldnt be too hard tho, not gonna bother doing it tho

#

ill settle with flag and name

warm blaze
#

How could I open virtual arsenal ( [mode,params] call BIS_fnc_arsenal ) with my array of gear only ? Have a feeling I am missing something but can't find the proper answer still...

little raptor
little raptor
brave jungle
warm blaze
little raptor
#

dunno. the ACE one has an option for that. the wiki doesn't say anything about the vanilla one.
but you can open the function file and see if it uses some sort of input for that

bold mica
#

does anyone know a disable line to disable a specific unit's weaponry to be intercepted by ITC?

young current
#

itc?

austere hawk
#

@still forum how do i typecheck if something is a hashmap? Its close to array, so i thought
_hmap isEqualType [] might return true, but its false

robust hollow
#

_hmap isEqualType createHashMap ๐Ÿคท

austere hawk
#

uh forgot about typeName... typename says "HASHMAP"

drifting sky
#

A2OA. Is it possible to force AI group leaders to Not take point position within the group formtaion?

young current
#

gut feeling says, no

robust hollow
#

the description on formLeader says

Returns the formation leader of a given unit. This is often the same as the group leader, but not always, for example in cases when a unit is ordered to follow another unit. 

so it might have been intended to be possible, but I cant seem to achieve it (in a3)

drifting sky
#

what heppens if you set the group leader to follow one of his subordinates

winter rose
#

the game implodes

robust hollow
#

in my test, nothing

#

should try it for yourself though, a2 may behave differently

winter rose
little raptor
#

@robust hollow @drifting sky formLeader can only change if the unit has a different order than the leader.
For example, assuming none of these are leaders:

[unit1, unit2, unit3] commandMove _pos;

now units 1, 2, and 3 have their own "formation", and one of them is the formLeader (probably unit1)

#

that's why when you try unit1 doFollow unit2 and unit2 is following the leader, you don't see anything happening

drifting sky
#

so if none of the units are the group leader, do they form their own separate mini squad?

winter rose
robust hollow
#

he is saying in leopardโ€™s example where none of the units commanded to move are the leader of the group.

drifting sky
#

bottom line is I don't want the group leader in point position, because then they almost always die first.

winter rose
#

set them in "V" formation? they would be last

distant oyster
#

is there any event to detect if a vehicle got repaired?

dusty badger
#

Is there any way to control where mags are taken from in a players inventory when they reload?

exotic flax
#

the default order is uniform -> vest -> backpack, and afaik is it not possible to change that

dusty badger
#

Hmm, player inventories are segregated into what are essentially containers, can you prevent players from taking things from these individual containers, like say just their backpack?

#

And specifically preventing access to their own backpack

#

This would assume that when a mag item is moved for a reload that it even checks if the player has access to that container

exotic flax
#

I guess the main issue is that there is no event handler which runs before a reload, only afterwards.

#

perhaps the 'Put' EH works

This EH could also trigger when unit replaces magazine in weapon with another magazine from unit containers (uniform, vest, backpack) during reload.
although I believe that only works when replacing a magazine which still has ammo in it, not an empty one

#

or the 'Take' EH, which should work when grabbing a magazine to replace the old one

dusty badger
#

yeah im pretty much trying to figure out how to prevent players from reloading mags from their backpack

#

if its even possible

exotic flax
#

I don't think so... perhaps you could hook on the "reload" keybind, and ignore it when there is no valid magazine in the uniform and/or vest

robust hollow
#

wouldnt catch scroll wheel reload actions though

#

which doesnt seem to exist now that i try it. must have seen it in a mission ๐Ÿค”

exotic flax
#

it does when you have different types of ammo (eg. no tracer and tracer)

robust hollow
#

ah yes, there it is.

ebon citrus
#

It is possible and i did it by rewriting the entire reloading as a scripted logic

dusty badger
#

oof

ebon citrus
#

I had to do it to make my Arma 2 inventory function

#

Dont mind the other stuff, this was literally the only video of it i had stored on my old disk ๐Ÿ˜…

civic pine
ebon citrus
#

But yeah, what @exotic flax probably fits your purpise best

#

But you need extra logic if you want to make sure the mag gets taken from the Uniform of Vest

#

I dont think Arma bothers to prioritize any piece over another

#

You also need to check if the magazine the weapon wants to reload is present in unifrom, not just any

#

So you'd need to do a query for the magazines a weapon accepts

#

It gets all really complicated so that's why i just scripted my own reload logic

ripe sapphire
#

hi every body what is up

#

im trying to make a dialogue, that is played through playSound, here is my cfgSounds

class CfgSounds
{
    class wholedialogue
    {
        name = "Sound with advanced subtitle options";
        sound[] = { "sounds\wholedialogue.ogg", db + 10, 1 };

        forceTitles = true;            // will display titles even if global show titles option is off
        titlesFont = "PuristaMedium";        // titles font family
        titlesSize = 0.1;            // titles font size
        titlesStructured = true;    // treat titles as Structured Text (see below)

        titles[] = {
            0, "<t color='#ff0000'><t font='PuristaBold'><t align='left'><t valign='top'>RED ALERT!</t></t></t></t>",
            2, "<t color=""#00ff00""><t valign='top'>Green text</t></t>"
        };
    };
};
#

everything works except the vertical alignment, i want to make text appear on top but its always displayed on the bottom no matter what i put in valign

#

is it not possible to set valign when used through cfgsounds?

ebon citrus
#

why are you doing this through CfgSounds again?

ripe sapphire
#

why not?

robust hollow
#

valign is relative to the position of the text box, not the screen. it will probably be easiest to use BIS_fnc_dynamicText instead.

still forum
neon gulch
#

i it posible to fix the taru so you can pull the pods in

#

without a mod

winter rose
neon gulch
#

original

#

i cannot script ๐Ÿ˜ฆ

slate cypress
#

If I want to make a map marker which displays the server FPS to all clients, what is a good minimum global marker update interval as to not overload the network? I was thinking maybe every 3 or 5 seconds?

still forum
#

yes that

slate cypress
#

Thanks

tough abyss
#

hey can someone tell me why this isn't working ?
soldierOne addMagazine ["HandGrenade", 4];
soldierOne forceWeaponFire ["HandGrenadeMuzzle","HandGrenadeMuzzle"];

winter rose
tough abyss
#

the problem i'm having is the grenade isn't actually getting thrown

winter rose
#

if the unit does not have grenades, it cannot throw anything
be sure they get added

tough abyss
#

Yeah, still not working. I'm trying to do the cinematic grenade throw by the Ai. This is what I got.
soldierOne addMagazine ["HandGrenade", 1];
soldierOne switchMove "AwopPercMstpSgthWrflDnon_Start2";
sleep 1;
soldierOne forceWeaponFire ["HandGrenadeMuzzle","HandGrenadeMuzzle"];

#

simple enough and it has worked before.

#

even without the switchMove doesn't work.

winter rose
#

soldierOne addMagazine ["HandGrenade", 1]; โ† I don't think this works

tough abyss
#

no?

#

it's on arma wiki

#

tried doing selectWeapon "handgrenade"

#

and a bunch of other stuff, at a loss.

winter rose
#

that's why I say "check that the grenade is added"

soldierOne addMagazine ["HandGrenade", 1]; // that's "one bullet in grenade"
soldierOne addMagazine "HandGrenade"; // one grenade
#

I am not sure it doesn't work, but please check

tough abyss
#

I will

opal sand
winter rose
#

what "screen thing"? multiple textures, I guess

oblique arrow
#

^ propably multiple setObjectTextures's with sleeps between them

split coral
#

Or a video

oblique arrow
#

ye

tough abyss
#

Yeah, no. I'm also attaching the AI to a moving boat. Even when the AI is on the ground it doesn't throw a grenade.

#

could server mods possibly impact why it's not working?

winter rose
#

should not, try in Eden without MP (and ideally without mods) at least

tough abyss
#

I'm doing this all in eden, Tried executing it through execVM and also through the debug console.

winter rose
#

why mentioning server mods then?

still forum
tough abyss
#

well, I didn't mean server mods. It's just my mods lol.

#

I don't know why I said that, yeah, this is all in eden.

winter rose
#

try vanilla

tough abyss
#

yeah, ill do that right now

hollow lantern
#
        private ["_animEH"];
        _animEH = [_inspectGuard, ["AnimDone", 
        {
            params["_unit", "_anim"];
            if (_anim == "Acts_WalkingChecking") then 
            {
                // Remove eventhandler
                _unit removeEventHandler ["AnimDone", (_unit getVariable ["KI_animEH", 0])];
                {_unit enableAI _x} forEach ["ANIM", "AUTOTARGET", "FSM", "MOVE", "TARGET"];
                            
                // Ensure correct ending
                _unit switchMove "AmovPercMstpSlowWrflDnon";
            }
        }]] remoteExecCall ["addEventHandler", 0, _inspectGuard];
        _inspectGuard setVariable ["KI_animEH", _animEH];```
Can someone explain to me where the string is coming from?:

_unit removeEventHandler ["AnimDone", (_unit g>
15:53:06 Error position: <removeEventHandler ["AnimDone", (_unit g>
15:53:06 Error Type String, expected Number```
addEventHandler should return a number which then can be used to remove the action from the unit. However in my case something seems not right

#

seems like _animEH instead returns a string if I recall the error msg right

willow hound
#

Hehehehe

#

_animEH is what remoteExecCall returns my friend.

#

Just use _thisEventHandler: _unit removeEventHandler ["AnimDone", _thisEventHandler];

opal sand
winter rose
#

jpg & paa only (iirc)

tough abyss
#

yeah

#

it works in vanilla

#

god damnit

#

any clue as to what mods could fuck with something so basic?

#

CUP weapons maybe?

hollow lantern
#

what Mods do you have loaded?

tough abyss
#

Mods

Archipelago,
B61 Nuclear Bomb,
CBA_A3,
Cinematic Lens Flare,
Civilian Airliners,
Cookie's Animations, 6
CUP Terrains - Core,
CUP Terrains - CWA,
CUP Terrains -
CUP Units,
CUP Vehicles,
CUP Weapons,
Death Zone,
Eden 2.0,
Eden Extended Objects,
Eden Objects,
G.O.S Song Bin Tahn,
GCam Cinematic Camera Tool,
GGE: Core, http:
Helicopter Dust Efx Mod,
Improved Melee System,
MCC Sandbox 4 - Mission Making The Easy Way,
nikoaton's Animations Pack
RDS Civilian Pack
Rismarck's Static Animations
Ruha,
task_force_radio,
Tschernobyl Zone Redux,
ZEI - Zeus and Eden Interiors,
Zombies and Demons,

winter rose
#

โ€ฆone of them ๐Ÿ˜„

tough abyss
#

yeah

#

maybe two

#

time to just go down the line and try and figure it out which one by individually loading them xD

#

oh fuck me this is going to suck

split coral
hollow lantern
#

MCC Sandbox, scary. Yeah seems like the best appraoch is to de-select the mods 1-by-1 and check again

tough abyss
#

what's wrong with sandbox

hollow lantern
#

the coding behind it is bad.

tough abyss
#

well, I will start with that one

#

and CUP weapons, I got a hunch.

opal sand
#

@winter rose @still forum Thankyou guys so far for the helpful advice, but one more question please

videos working on a briefing screen/tv/pc screen object, woud that work? if yes, how please? ๐Ÿ˜„

winter rose
#

hacky way and not working for players without PIP

split coral
#

That doesn't need PiP

hollow lantern
#
    _object setObjectTexture [0,"media\ourwar.ogv"];``` - http://killzonekid.com/arma-scripting-tutorials-ogv-to-texture/
#

whoops Lou was faster

winter rose
split coral
#

well it is a kind of "picture-in- picture", but not in Arma's terms

oblique arrow
#

Hm, is there a way to make an object face another object/a player?

oblique arrow
#

Like one of the light cones facing a player as an example

winter rose
#
obj1 setDir (obj1 getDir obj2); // iirc
oblique arrow
#

thank you

sour coyote
#

Hi

winter rose
#

\o/

young current
tough abyss
#

welp

#

you were right

#

it was sandbox

#

gg

#

@hollow lantern

still forum
hollow lantern
#

@tough abyss glad you sorted it

opal sand
winter rose
#

with drawbacks, see the link I sent

still forum
#

yes

ripe sapphire
#

Why not use BIS_fnc_playVideo?

#

I think i used this one before to play video on a screen

_video = "<Video_file.ogv>";
_screen = <screen_name>;
_screen setObjectTexture [0, _video]; 
[_video, [10, 10]] call BIS_fnc_playVideo;
velvet umbra
#

Hey guys short question is there allready any solution to exec code from a website on an arma server? Like from a support panel?

exotic flax
#

Depends on what you want to do

velvet umbra
#

like refunding a destroyed car by spawning it in with last trunk

#

only idea was do it by db an a worker checking for new code to execute but this cant be the best way

exotic flax
#

whut? Simply reset the database and let the game check the DB once in a while

#

The game does not have some API which you can call directly (unless you make an extension for it). So unless you want to go very deep into programming stuff the only thing you can do is check every once in a while for updates and execute that on the server and/or clients.

velvet umbra
#

kk ๐Ÿ™‚ that was my question wether there is allready an existing extension or not ๐Ÿ™‚

#

but then i'll write one for my purpose ๐Ÿ™‚ thank you

still forum
#

I have one yes

#

it uses websocket server

#

but its pretty crappy

#

and annoying to get working and I think uses intercept..
you can surely do better than that with a purpose built thing

eager prawn
#

Anyone have a lightweight script/method to safezone a particular region? I'd like to make it so our headquarters/arsenal area can't risk accidental teamkill.

#

Can't use the Protection Zones because TFAR detects the "Protection Zone" as a solid object and when you're inside it all voice comms are incredibly muffled and and broken

winter rose
smoky verge
#

are there known cases of playMusic not working?

winter rose
smoky verge
#

seemed to work in the debug console
maybe I did something wrong in my trigger

#

it seems that after a certain point in the mission I can't play music anymore

#

isn't LeadTrack02_F_EPA Aegis Blues?

willow hound
smoky verge
#

nope

blissful oyster
#

Hey maybe someone can help me. I want to use "doArtilleryFire" on the Zamak MRL but it does not work. Tried it with the Nato MRL Tank and it worked without problems. I checked the ammotype and the range and everything is fine. Any Ideas?

slate cypress
#

Multiplayer optimisation: Global marker commands always broadcast the entire marker state over the network. As such, the number of network messages exchanged when creating or editing a marker can be reduced by performing all but the last operation using local marker commands, then using a global marker command for the last change (and subsequent global broadcast of all changes applied to the marker).

#

Once I have made the marker on the server and applied all the necessary changes to it, how can I then make it global?

#

It says perform the last change using a global so does this mean I could do:

#

"markerName" setMarkerText "markerText";

winter rose
#

yes

#

do all the changes but one with *Local variants, then the last change with a global command

slate cypress
#

Yep thanks

velvet umbra
#

@still forum thanks for sharing i'll look into it ๐Ÿ™‚

slate cypress
#

How do I see the output of my init.sqf file in order to debug?

winter rose
slate cypress
#

Oh I mean to check for errors sorry

#

I'm not getting errors when I join the game.

winter rose
#

the game should tell you script errors in a black box, and log in the arma.rpt

slate cypress
#

Is there any noticeable error in this?

#
previousRate = round diag_log diag_fps;

createMarkerLocal ["FPS", [200, 200]];
"FPS" setMarkerColorLocal "ColorGreen";
"FPS" setMarkerText formatText ["Server FPS: %1", initialRate];

[] spawn {
    while {true} do {
        rate = round diag_log diag_fps;
        if (rate != previous) then {
            "FPS" setMarkerText formatText ["Server FPS: %1", rate];
            previousRate = rate;
        }
        sleep 3;
    }
}
winter rose
#

previousRate = round diag_log diag_fps;

slate cypress
#

ah, brackets?

winter rose
#

no; wrong order

#

you want to round the fps, and log the result of that operation

#

so log round fps

slate cypress
#

Oh I see

winter rose
#

is initialRate defined, too?

slate cypress
#

ah yes, initialRate was defined but I changed the variable name after that

still forum
#

formatText ["Server FPS: %1", initialRate]; no
setMarkerText takes string, not structured text

little raptor
#

@slate cypress ```sqf

slate cypress
#

so i've changed initialRate to previousRate

little raptor
#

not cpp

slate cypress
#

ok

slate cypress
#

any way to turn structured text to string?

#

or should I concatenate a bunch of strings

winter rose
#

format?

little raptor
still forum
#

but we don't want to do that here as it would be stupid

little raptor
#

yes, just answering the question

slate cypress
#
_previousRate = diag_log round diag_fps;

createMarkerLocal ["FPS", [200, 200]];
"FPS" setMarkerColorLocal "ColorGreen";
"FPS" setMarkerText format ["Server FPS: %1", _previousRate];

It says I am missing ; in line 5 and that there is a syntax error where I have used the _previousRate variable in setMarkerText.

winter rose
#
_previousRate = diag_log round diag_fps;
```diag_log does not return anythingโ€ฆ ๐Ÿคจ
#

if you do not want to log FPS to the rpt, remove diag_log @slate cypress

slate cypress
#

ohhh ok

#

so I seem to no longer get any errors but the marker does not appear for me

#
_initialRate = round diag_fps;
createMarkerLocal ["FPS", [200, 200]];
"FPS" setMarkerColorLocal "ColorGreen";
"FPS" setMarkerText (format ["Server FPS: %1", _initialRate]);
slate cypress
#

I got it working now

#

thanks Lou, dedmen and leopard

#

so it turns out you don't get a default type

#

hence you have to set a type manually

#

๐Ÿคฆโ€โ™‚๏ธ

winter rose
#

ah, yep
"Icon"

slate cypress
#

one other thing... is there a way to detect once the briefing screen is over?

#

the marker doesn't get updated as I assume the script is paused at this time

winter rose
#

you could use uiSleep

#

(though in MP sleep and uiSleep would almost act the same)

slate cypress
#

how long would I sleep for though?

#

what I mean to say is, is there an event which fires once the briefing screen has gone

winter rose
#

I meant: you can use uiSleep if you want it to refresh during briefing

slate cypress
#

Ohh

tender fossil
slate cypress
#

Yep this works thanks

winter rose
tender fossil
#

From what I found is that I need dot product and matrices @winter rose

winter rose
#

sin, cos, vectorDir & vectorUp might be the only things you need though

winter rose
#

I am NOT clicking that

tender fossil
#

It's manageable but maybe too PITA for the designed functionality

brave jungle
#

rewriting some waitUntils to work as EHs instead, got a question about onLoad. Am I better adding this to the config or am I better off using displayAddEventHandler? Also on the latter it continues the trend on removing on, so it would be "load" correct?

robust hollow
#

onLoad should be added in the config. there isnt much opportunity to add display/ctrl onLoad events via script.

brave jungle
#

Okay that was my plan so correct there ๐Ÿ˜„

#

Thanks ๐Ÿ˜„

fair drum
#

what would be the best way to have an AI track a player and purposefully shoot and miss the ground around them? say the AI is in a heli

#

create invisible objects at players position that are updated every sec and have the AI target that?

ebon citrus
#

Remember to give the AI 100% skill

#

So it wont miss the target and accidentally hit the player

#

No, i think the best way would be to have the AI in the helicopter fire at the player and then delete the bullets. Then spawn a particle effect/sound of the bullet near the player

#

Maybe even teleport the bullet near the player and make it face at the ground

fair drum
#

i have never messed with altering projectiles before. where should i start?

ebon citrus
#

Eventhandlers

#

You can attach an eventhandler to the AI that triggers every time it fires

#

You then get the projectile and you can manipulate it like any other object

#

Set its position and direction

fair drum
#

hmmm okay ill check it out then

ebon citrus
#

There are many ways, but relying on the AI to not miss the fake target is one of the worse ones, in my opinion

#

Im more of a person to do scripted sequences, though, so if you dont like those, feel free to implement your own method

fair drum
#

you use the event handler method for your sequences?

ebon citrus
#

I use whatever method that gets me as far away from anything Arma AI or Physics

#

Never rely on arma AI or physics to function as expected

fair drum
#

wouldnt have it any other way

#

i think ill do something like a projectile distance 3d player comparison then veer it off at some angle

ebon citrus
#

Infact, i went as far as to remove ragdoll from the game entirely because i hate it

#

@fair drum remember bullet travel time

#

If you want to be 100% sure the player wont be hit, then i would teleport the bullet at their feet

#

And slightly away

fair drum
#

mk noted

ebon citrus
#

Otherwise you risk having the player move to where they previously werent

#

And the bullet hitting them regardless

fair drum
#

hmmm using HE rounds from helis so I have to take splash into effect too

ebon citrus
#

If you dont need the simulation aspect of Arma, then dont use it

#

Oh no

#

HE is bad...

#

Uhhhh...

fair drum
#

maybe... is there a way i can grab a class of a .50 cal bullet? and replace?

#

during the teleport

ebon citrus
#

Why not just use particle effects instead?

#

You obviously dont need the simulation aspect

#

So just spawn particle effects and SFX of the explosion

#

Near the player when the heli fires

#

And just remove the projectile

fair drum
#

looks like I'll have to pull the CfgCloudlets config, I don't think there is a master list of them on the wiki atm

supple cove
#

hey hmmm, was trying to make a simple script to attach vehicles on a boat carrier, everything is fine except one visual bug in first person.. once the player enters one seat, the boat's Z (textures) will always be at the top of everything that was attached.. any idea if it's possible to fix this?

#

I'm actually not sure if it's a Z problem

#

I've attached the cars to a memory point of the vehicle and it seems to be changing once the player enters the boat

supple cove
#

yep surelly a visual bug, got giant cars by sitting as passenger ๐Ÿ˜‚

ripe sapphire
#

hey what is up guys

#

is it possible to script periscopes going up ? (like in the strider / remote deisgnator you can press q to bring them up)

loud birch
#

I wanna have a hold action that hides 1 object and shows another

#

for an mp mission

#

but hide object global says to call it on the server only

#

so idk if its better just exec hide object

#

and for reference I'm using 3den enhanced's hold action creator

robust hollow
#

should the objects be hidden/shown for everyone or just the person using the action?

ebon citrus
#

@loud birch you can always just move the object somewhere

loud birch
#

for everyone

#

my idea is like a barricade you take down

#

and it appears on the floor

ebon citrus
#

move it like 50cm down

#

if you want, you can even try some pseudo-animations

loud birch
#

well I'd have to rotate it and get the exact xyz of the floor

ebon citrus
#

why?

#

just get the surface of the floor at the 2d pos of the barricade

#

move it there and set the rotation

robust hollow
#

i'd just use hideobjectglobal. getting the message to the server isnt exactly a challenge.

ebon citrus
#

if you just need to lower a "gate" then it's best to use that same gate

#

instead of make 2 gates