#arma3_scripting

1 messages ยท Page 387 of 1

sour saffron
#

unitplay /record

#

it records data to playback

candid jay
#
  1. that presumes a vehicle with physx simulation so GRAVITY
little eagle
#

This is for creating a lift rope for a map. There is no play here.

candid jay
#
  1. unitplay in MP does anyway onEachFrame stuff
sour saffron
#

but you are asking about linear set of vectors nd positions whe you not ?

candid jay
#

which is what I'm doing linearly

sour saffron
#

or are they dynamic position ?

candid jay
#

no, commy is talking about drawing cables, not about the chairs themselves

little eagle
#

Yes.

candid jay
#

that's a completely different story that I'm dealing with on another thread in my head

sour saffron
#

oh that was done for early fastropes , looked like dog shite

#

even cloudlets were used ๐Ÿ˜ฎ

candid jay
#

I wish we could have a VEHICLE in arma that is not pulled by gravity

#

but nooooooooooOOOOOOO

sour saffron
#

there are chairs that are cars

#

i have made some and they are not physx

#

wont they do it ?

candid jay
#

no

#

because then you cannot have cargo

little eagle
#

Buildings are not pulled by gravity.

sour saffron
#

yes you can

candid jay
#

yes but you cannot have a cargo in buildings

little eagle
#

True, but you could attach the car on a helper building.

candid jay
#

I disable Simulation when chairs are empty

sour saffron
#

just use the card chair

little eagle
#

attachTo to a dummy object, maybe class Building.

sour saffron
#

car

candid jay
#

but you need to enable it when people get in or they are stuck

sour saffron
#

get in handler on the chair

candid jay
#

commy anyway you need to compute the position of the object onEachFrame because if it's static there's no way to just move it

little eagle
#

True.

candid jay
#

so back to square 0 unfortunately

#

tried them all

little eagle
#

The problem is that all the scripting is done on the SQF level, but all of the physics is done on the C++ level that can't be accessed. So we only have so much to work with.

candid jay
#

I wish I could have a VEHICLE I could say: go EXACTLY from point A to B in a straight line, then to C still in a STRAIGHT line and so on

little eagle
#

Amazing things could've been made otherwise.

candid jay
#

yep

#

still

#

I mean, we already have a fully working cablecar with 60 chairs going up and down on a 1.3km line

sour saffron
#

try witht that kind of chair , even has turret

candid jay
#

I already have that, as I said my chairs are vehicles

#

except that I didn't inherit from Car because gravity there is stronger in the simulation

#

so I use planex

sour saffron
#

you said Building i thought

candid jay
#

no, commy suggested that for other reasons

sour saffron
#

well i think personally if its linear i would attach it to an animaterd vertices

candid jay
#

to wut

sour saffron
#

the chair to an animated vertices that animates between pylons in line with the cable resolution lod

candid jay
#

you can't have a 1.3km model

sour saffron
#

then detach and reattach at eacxh pylon as necessary

#

nah seperate models

candid jay
#

go ahead ๐Ÿ˜„

sour saffron
#

like Bis electrisity in cnernarus

little eagle
#

you can't have a 1.3km model
Sounds like you tried.

candid jay
#

hem no

sour saffron
#

lol i thought same ๐Ÿ˜ƒ

candid jay
#

models have limits

sour saffron
#

you can animate models tho lol its just they disspaear t uv stretch = __x times original space

#

i had an house that animated from 1 floor to two once over to see if i could make a modular village

#

disaster but fun

candid jay
#

for instance the geometry LOD: The exact value of the limit is not yet known, but it's somewhere around 50-60 meter from the center of origin (meaning that your object can be 100m wide/long at max if it is symmetrical to the center of origin) https://community.bistudio.com/wiki/LOD

sour saffron
#

yeah altho Suma said he had added code to surpass 5o meetrs i think he meant in the vertical

candid jay
#

vertical, no limits

rancid ruin
#

models are limited in size in every direction except vertically?

#

what in the fuck

#

just why

young current
#

because how the model detection is 2-dimensional grid @rancid ruin

little eagle
#

Make it very tall and topple it to the side. Win.

rancid ruin
#

that's what i was thinking

little eagle
#

inb4 ctd

sour saffron
#

vertical geo broke too at 50 meter

dim terrace
#

geo physx apparently works beyond 50 meter limit?

sour saffron
#

no

young current
#

I got rocks/cliff stuff 260m tall and they seem to work ok

sour saffron
#

probably roadway lod

candid jay
sour saffron
#

#getfucked

astral tendon
#

how do i make civilians not run away? even wtih allowFleeing 0 they still run away

candid jay
#

try

    _newGroup setBehaviour "CARELESS";
    _newGroup allowFleeing 0;
    _worker disableAI "FSM";
    _worker disableAI "COVER";
    _worker setSkill ["courage", 1];
    _worker setSkill ["spotDistance", 0];
    _worker setSkill ["spotTime", 0];
#

where _newGroup is the group of the civilians

gleaming cedar
#

How do you attach a module to a helicopter

#

I tried this : mfire attachTo [feed2, [11, 0, -1] ];

#

But when I move the helicopter the module stays

jade abyss
#
ObjToAttch attachTo [AttachToMe,[coords]];```
astral tendon
#

thanks

gleaming cedar
#

yeah I tried that

jade abyss
#

is feed2 known/existing?

gleaming cedar
#

When I move it stays

#

yes its the helicopter

jade abyss
#

same for mfire

little eagle
#

Is it one of those sfx modules?

gleaming cedar
#

Thats the module

jade abyss
#

ah

little eagle
#

The module moves, but the effect doesn't.

#

The effect is created where the module is at the start and is not attached to the modules position.

gleaming cedar
#

I've seen people make it so it attaches to something like an AI

little eagle
#

They're probably not using the module. The module itself is just a vehicle to execute a script. They probably scripted the effects themselves.

compact maple
#

@jade abyss Thanks i change your code a bit its working well ! ๐Ÿ˜ƒ

jade abyss
#

๐Ÿ‘

little eagle
#

@candid jay can you post a bit more of your script. I want to get this right.

#
// compute pos
private _vdir = _pos vectorFromTo _end;
private _vlat = vectorNormalized (_vdir vectorCrossProduct [0, 0, 1]);
private _vup  = _vlat vectorCrossProduct _vdir;

// create cable
private _cable = "Bosnia_Cablecar_Cable" createVehicleLocal _pos;
_cable setPosASL _pos;
_cable setVectorDirAndUp [_vdir, _vup];

// get to next position
_pos = _pos vectorAdd _vdir;

^ this is what you posted before, but there is no _start here.

candid jay
#

sure, not on my pc now will write you an mp

edgy dune
#

is there away to change an AI faction with scripts? ive been trying ```
_this setSide independent;

jade abyss
#
_Grp = createGroup WEST;
[_SelectedAI] joinSilent _Grp;```
little eagle
edgy dune
#

so

#

is there way to attach just like the tank barrel to a helicopter for.........science O.O

#

dang

#

I was thinking in the name of science

#

adding like a tank barrel to the pawnee

#

"another one bites the dust"

#

well with addweapon It does give it massive recoil

#

Dang well I tried XD

#

cause I was adding like sidewinders to the pawnee,thought it be nice if I could see it visualy

#

would it be possible to do so with scripts in zeus?

#

rip

#

oh yea I have no clue on how to make a mod

#

oh yo

#

no clue wat that is

hollow raft
#

Hopefully this is the right place to ask. Is anyone aware of a script that deploys the bipod of something automatically, e.g. on an AI?

little eagle
#

AI can't deploy or rest the weapon, only players.

hollow raft
#

Ah, that's a shame. Thanks for responding so quickly.

tulip cloud
#

Hope everyone had a good Thanksgiving.

I asked a question earlier that hasn't been answered yet. Can one client make a call directly to another client or does the server have to be involved?

small iron
#

How do you get a reference to other players other than yourself?

small iron
#

World space.

#

Sorry, I need to clarify. Not the actual player position.

#

Just the player's client @subtle ore

#

Oh

#

Yes.

#

Sorry, a bit new to scripting.

#

@subtle ore Oh I don't need anything returned. I just want to manipulate the player, such as disabling fatigue.

meager granite
#

To disable fatigue you'll need to do it on the player's client

#

So just do player enableStamina false globally

small iron
#

I see, thank you.

robust hollow
#

dont think that would work. it would take the player object from where ur executing it from, not the JIP player

meager granite
#

Just have it in init.sqf if you want it disabled everywhere all the time

#
0 spawn {
    waitUntil {player == player};
    player enableStamina false;
    player addEventHandler ["Respawn", {_this select 0 enableStamina false}];
};
robust hollow
#

init.sqf executes every time u join...

meager granite
#

client start

robust hollow
#

init.sqf runs on client and server when they load the mission

meager granite
#

(and server as it is sort of client too)

robust hollow
#

not really. u use it for things you want both the server and client to do

meager granite
#

Init.sqf been there and worked like this since dawn of arma

#

Nothing odd about it, it does what it says, inits stuff in the mission

#

What "it"?

#

It just executes everywhere early in the mission, that's it

#

If you mean objects, then yes locality of entites is already setup at this point

#

newly created player unit might not be local or even sent to player though so you need to do waitUntil

#

It runs for JIP as well, because their mission just starts and so init runs

dark heron
#

Hey guys, I was hoping someone could help me with a spectator script.

I currently have an addaction that calls the following line:
["Initialize", [player, [], true, true, true, true, true, true, true, true]] call BIS_fnc_EGSpectator;

This puts the player in spectator mode and is working fine... The problem is that I'm unable to exit the spectator. Ideally I would like to do this with a keypress. Any help would be very appreciated!

#

Yes that works, however I need to be able to use it without the console

meager granite
#

Init.sqf:

0 spawn {
    waitUntil{!isNull findDisplay 46};
    findDisplay 46 displayAddEventHandler ["KeyDown", {
        if(_this select 1 == 1) then {
            ["Terminate"] call BIS_fnc_EGSpectator;
        };
        false
    }];
};
#

Adds event handler that checks if ESC is pressed and executes spectator stop

jaunty zephyr
#

pretty sure that doesn't work

#

eg defines its own keyhandler on its own display

meager granite
#

Display 46 events should still run, needs double checking though

jaunty zephyr
#

in the end i did that same thing with a mod, overwriting the keydown or something of that display. โ€” but I'd be very happy to be proven wrong

meager granite
#

Yeah, you're right it uses its own display through createDisplay, not createDialog

jaunty zephyr
#

ah no, i put a handler to the EG display using displayAddEventhandler

#

yip

meager granite
#

Might be easier to just add event handler after you start the spectator

#

@dark heron

player addAction ["Spectator", {
    ["Initialize", [player, [], true, true, true, true, true, true, true, true]] call BIS_fnc_EGSpectator;

    waitUntil {!isNull(["GetDisplay"] call BIS_fnc_EGSpectator)};

    ["GetDisplay"] call BIS_fnc_EGSpectator displayAddEventHandler ["KeyDown", {
        if(_this select 1 == 1) then {
            ["Terminate"] call BIS_fnc_EGSpectator;
            true
        } else {
            false
        };
    }];
}];
dark heron
#

That works, thank you so much!

meager granite
#

scheduled

jaunty zephyr
#

uhEG even has a GetDisplay method? sweet :)

small iron
#

Oh, I have another question

#

Does AmmoboxExit of BIS_fnc_arsenal work at all?

small iron
#

A mode called AmmoboxExit.

compact maple
#

@jade abyss hello, i tried to create a RscListbox with ctrlCreate and I can't get it working. Just read https://community.bistudio.com/wiki/ctrlCreate and it there is no Listbox in the available Rsc, how should I proceed to create my Lb inside my dynamic dialog ?

meager granite
#

@compact maple RscListBox

compact maple
#

Yea my bad I am actually on mobile ๐Ÿ˜„

meager granite
#

Well the class is there, you must be doing something else wrong then

compact maple
#

Okay tought I couldn't create it cause it's wasn't in the wiki list, I must have missed something

meager granite
#

To see what classes there are just open Config Viewer and look at classes that start with Rsc, RscListBox is there.

compact maple
#

I mean classes which can be created with ctrlCreate

#

Thanks for the tip btw

meager heart
candid jay
#

all, I'm using say3D to loop a sound in game

#

however, there's always a small interruption in the loop

#

what is the best way to have a sound loop seamlessly?

#

Im using a simple:

while { alive _source } do {
    _source say3D _sound;
    sleep 0.8;
};
#

however every time the sound loops there's a slight interruption.

still forum
#

Do you have CBA?

little eagle
#

Certainly not with the scheduler, but I wouldn't use a pfh either.
createSoundSource with a CfgSFX + CfgVehicles class abusing the sound config entry.

#

That will loop it endlessly.

#

Until the sound source is destroyed. createSoundSource has global effects, which makes it even easier to use.

candid jay
#

yes thank you commy2 that works beautifully

#

I couldn't see if it's JIP compatible

slender halo
#

@3rK#4254 you can create any Rsc with ctrlCreate.
BIS_fnc_exportGUIBaseClasses will copy in your clipboard all default Rsc classes you can use, there are some usefull preconfigured controls you won't find anywhere else

compact maple
#

Thanks you @slender halo

jovial prism
#

Trying to detect all dead units nearby, Is there anything I can use in place of player nearEntities ["Man", 10]; as nearEntities doesn't work on dead things.

cosmic kettle
#

There is allDead?

#
{
  if (player distance _x <= 10) then {
    // Do something
  };
}forEach allDead;
jovial prism
#

hopefully that works, spent hours pulling my hair out wondering why nearentites wasn't doing it's job unless unit was alive. I'll give it a try thanks

copper raven
#

AllDead will return dead vehicles too, use allDeadMen

cosmic kettle
#

^Doesn't that return civ only?

#

my bad, dead men are civ ๐Ÿ˜ฉ

candid jay
#

is it possible to add an action to a static object?

#

For some reason the addAction command is not working

#

it does have geometry...

#

ok thank you

meager granite
#

Add action to player with condition that checks if you're looking at needed object (cursorObject == ...) and close to it

candid jay
#

hum

#

i'd rather create a hidden gamelogic

#

it's working now, there was an issue in the model (geometry without mass)

#

thank you

still forum
#

FINALLY Thank you BI!

slender halo
#

@jovial prism @cosmic kettle might be better/faster (?)

allDeadMen inAreaArray [getPosWorld player, 10, 10];
still forum
#

๐Ÿ˜ฎ If that works you deserve a medal

cosmic kettle
#

Dat fix ๐Ÿ‘Œ

little eagle
#

According to the wiki... he fixed it.

slender halo
#

^^

little eagle
#

whistle nothin

slender halo
#

inAreaArray fisrt param must be a position array, so i added getPosASL

little eagle
#

getPosWorld !

slender halo
#

faster ?

little eagle
#

Yep.

#

And we only need 2d anyway.

#

z is ignored.

slender halo
#

nice

little eagle
#

๐Ÿƒ ๐Ÿ’จ

#

Still looks like a fart.

slender halo
#

getPosWorld player //0.0014 ms getPosASL player //0.0014 ms
between 0.00000 and 0.00004 ms faster ^^

#

(according to BIS code optimisation, didn't tested)

little eagle
#

Yeah, we should just choose the worse one if we're not satisfied with the difference between two options.

slender halo
#

i will too now

little eagle
#

They should've just made a getPos2D command.

meager granite
#

Or made commands disregard Z every time when not needed

jovial prism
#

Any hints to why this doesn't work ```{
{vehicle player addWeaponCargo[_x,1];} forEach (weapons _x);
}
forEach (player nearEntities ["weaponholdersimulated",10]);

meager granite
#

By the purpose of command itself

#

@jovial prism weapons command works for units and vehicles equipped weapons, not vehicle cargo

#

You need weaponCargo or getWeaponCargo

jovial prism
#

@meager granite Nice, it worked! Thanks.

little eagle
#

You need addWeaponCargoGlobal for this to work in MP.

jovial prism
#

@little eagle Yeh I guessed, Just working in editor atm.

#

Another issue i'm having is when I run ```{
if (player distance _x <= 10) then
{
vehicle player addBackpackCargo[(Backpack _x),1];

};

}forEach allDeadmen;``` It's causing bad object if the dead unit isn't actually wearing a backpack.

#

into vehicle inventory

little eagle
#

addBackpackCargo _backpack

#

๐Ÿค”

#

backpack ception?

jovial prism
#

It was duping items because I could empty the backpack into the vehicle but the backpack is always full

little eagle
#

Ah, prefilled backpacks. They are a joy.

#

You'll soon encounter the limitations of the sqf api.

#

Happens to all of us.

#

Although X39 will probably tell you that everything's fine.

queen cargo
#

Everytime I read things like this I think about stopping to develop sqf-vm

#

Never did stuff with backpacks besides polling items @little eagle

little eagle
#

Mine are triggers.

#

I've deleted more triggers from code than I've added.

jovial prism
#

Thing is, once i've had the popup of bad object it doesn't come back and you wouldn't even be able to tell.

manic sigil
#

Is it possible to lock an APC's crew positions, but allow players to spawn in the cargo bay, using the admin debug abilities? I tried with lockDriver and lockTurret, but I get the feeling this is a locality thing that I'm missing.

#

I'll give it a shot. Tried to give players a mobile bof and respawn point... ended up with them driving off into the sunset :/

#

Which I'm hoping to work on, for the sake of immersion ๐Ÿ˜› I try to take vehicle controls out of their hands when able - touchy, but the official servers are limited in scope by the 16 player count.

#

Would that script work with 'this' if used in the vehicle's init field?

#

Humm. I used >this lockDriver true; etc etc. From what i recall they couldn't get in the driver's seat, but had no problems with the turrets.

#

I may have made it invincible >3>

#

Which they weren't supposed to find out because I'd be directing it, but woop.

jovial prism
#

So, got my gear scavenging script working ๐Ÿ˜ด BUT is there a way to stop the action appearing unless inside vehicle? I've tried vehicle player addAction ["Scavenge","test.sqf",[], 7, true, true, "", "driver vehicle player == player"]; but the action is still avaliable from outside the vehicle. ๐Ÿ˜“

#

That sorted it thanks ๐Ÿ˜ƒ

half monolith
#

hey guys, quick question, is there an easy way to award points to the medic for a completed revive?

manic sigil
#

@tough abyss RemoteExec the code worked, players spawned into the cargo bay and could not switch with the AIs in crew positions ๐Ÿ˜„ Thanks again!

#

Hey, it's quick and easy to copy-paste into the exec box, it's all I need.

jovial prism
#

Can anybody see what's wrong with this vehicle player addAction ["Scavenge","Scavenge.sqf",[], 1, true, true, "", "driver _target == player"] On SP the action doesn't show till in driver seat (which is correct) on MP it's showing when out of vehicle as well as in driver seat.

edgy dune
#

this is wat I got

#

for that

#
_this  addAction ["Name of action",
{

},[1],0,false,true,""," driver  _target == _this"];

#

it and works in mp

#

Question,is there a way to detect when someone goes into autohover?

#

thx man

little eagle
#

is there any way to tell the position of a nearby explosion from handledamage?
I don't think so.

rotund cypress
#

@manic sigil you should probably not have call whitelisted. Stupidly unsecure.

#

Better to either make a function and remoteexec that or remoteexec the command directly.

astral tendon
#
[] spawn {
waitUntil {
 if (triggerActivated victor2regrouped) exitWith {
 { _x hideObjectGlobal false} forEach nearestObjects [Area_Deka, ["man"], 100];
 { _x enableSimulation true} forEach nearestObjects [Area_Deka, ["man"], 100];
 { _x setUnitPos up} forEach nearestObjects [Area_Deka, ["man"], 100];
 true}; 
  }; 
};```
#

in the

its giving a error undefined variable up, but that error does not apears when i execute this alone in the debug console

#

the lack of "" in the UP was the problem, funny that it did not give me a error in the console.

little eagle
#

Debug console runs unscheduled and in unscheduled environment you can use undefined variables without errors.

#

"UP" needs to be in quote marks.

astral tendon
#

Thanks for the heads up.

worldly locust
#

Best way to test if a returned array is empty or doesn't exist?

#
                        _profile = _profile select 2;```
manic sigil
#

@rotund cypress Ill confess that that goes over my head; what would I do to make it more secure? And how might it be exploited?

worldly locust
#

_active = _profile s>
19:58:05   Error Undefined variable in expression: _profile```
#

ordinarily it returns an array

#

but I'm looping through an array of profile names. Occasionally the profile has been entirely killed and ALiVE hasn't finished purging it from the system, so it's still in the array that generates my loop, but not returned from alive_fnc_profilehandler

#

I've tried isnull _profile and got Error isnull: Type Array, expected Object,Group,Script,Config entry,Display (dialog),Control,Network Object,Task,Location which seemed pretty self explanatory

#

OK. I'm getting a bunch of elements, so I think the last bit is probably too "belt and braces" for me. But the first two could definitely be on.

#

I've tried !isNil though and I got a very wierd error, must have a syntax error somewhere.

#
                    if (!isNil _profile) then {
                        _profile = _profile select 2;
                        
                        _active = _profile select 1; //[_profile, "active"] call ALIVE_fnc_hashGet; 
                        _profileType = _profile select 6; //[_profile,"type"] call ALIVE_fnc_hashGet; 
                        // if (_debug) then {
                            // ["%1 - %2 ", _active, _profileType] call ALiVE_fnc_DumpR;
                        // };    
                        // _profile call ALiVE_fnc_InspectHash;
                        if(_profile select 5=="entity") then {
                            _iProfiles=_iProfiles+1;
                            _num = count (_profile select 11);
                            if(_active) then { 
                                _tree tvAdd [ [_iRoot,_iType,1], format [ "%1 - %2", _profileType, _num]];
                            }
                            else
                            {
                                _tree tvAdd [ [_iRoot,_iType,0], format [ "%1 - %2", _profileType, _num]];
                            }
                        }
                    };```
#

aha

#

right.

tulip cloud
#

has anyone tested performance difference between an object with simulation disabled and using dynamic simulation?

worldly locust
#

I'm assuming, hence the question. It would make sense it would be an empty array

#

so maybe just count _profile>0

tulip cloud
#

It seems that dynamically toggling the simulation would increase the load as each vehicle would be checking to see if the player is x distance from it.

#

compared to making a script that once a player enters then it toggles simulation.

worldly locust
#

cheers. will try that in the morning. too tired to fire up ARMA again. lol

jade abyss
#

What about collisions?

#

With a "server only" detection it come to way more "shitty jiggling" situations like it has now

#

No

#

It just doesn't move

#

Like a brick/house

#

Why should it have any checks in it, when the Sim is disabled? ^^

#

And what if the obj. had disabledSim for a purpose? ๐Ÿ˜„

rotund cypress
#

@manic sigil enables a hacker to remotely execute whatever code he wants

agile pumice
#

how can I force open the inventory (gear) window?

still forum
#

action command. With "Gear"

agile pumice
#

thank you ๐Ÿ˜ƒ

fluid radish
#

Is there a function for converting a decimal number to hex? More specifically, a color array [r, g, b, a] to a hex color code?

queen cargo
#

IIRC, no
But doing such things yourself is not that much work

#

As I said: not that hard
Using tostring command makes it even more simple as no actual string building is required

tulip cloud
#

Say I have 2 objects. Object 1 is the anchor and object 2 needs to maintain relative position as object 1 changes heading. How would I calculate this?

My first thought was to measure the distance between object 1 and 2 and then get the heading of object 1 and then get relative position base on that. Though is that the right way of doing this?

meager granite
#

modelToWorld ?

#

Unless you only need heading, not full orientation

jade abyss
tame portal
#

@jade abyss and based on the initial data he wants to reposition object 2 according to the offset and orientation

#

so object 2 always looks the same in object 1's eyes

jade abyss
#

measure the distance between object 1 and 2 and then get the heading of object 1 and then get relative position base on that.
hm? You sure?

tame portal
#

"object 2 needs to maintain relative position as object 1 changes heading"

#

i guess

jade abyss
#

Sounds more like "I want that object always 5m, 90ยฐ to the right"

tame portal
#

so basically if i see you infront of me and i turn around, i still see you infront of me

jade abyss
#

Hu?

tame portal
#

that would be my guess ๐Ÿ˜„

jade abyss
#

Thats erm, what getRelPos does^^

#

Like an attached Object

#

Just with setPos* stuff

tame portal
#

ah ok

jade abyss
#

๐Ÿ˜„

tame portal
#

what i thought he meant visualized with my AMAZING paint skills

jade abyss
#

Returns position, which is given distance and relative direction away from original object.

#

Yep. Either attachTo or getRelPos ( i would prefer attachTo)

#

Unless that Object should stay on the Surface (then getRelPos is better, since it takes AGL, so you just set 0 as Z-Axis)

#

That also. It depends what he wanna do with it ยฏ_(ใƒ„)_/ยฏ

#

+For MP -> constant setPos -> Erm... bad idea

tame portal
#

i mean if he wants to calculate it, id get the initial offset between the two models and then you can always use modeltoworld with the saved offset to get the theoretical position

jade abyss
#

Let's just wait for answer for the prev. questions, before we assume more and more and more and more... ... ... etc.

tame portal
#

no

#

fight till death

jade abyss
#

Yes

tame portal
#

๐ŸŒ

jade abyss
#

๐Ÿ‘‚

tame portal
#

๐Ÿ

jade abyss
#

๐Ÿคฆ

tame portal
#

๐Ÿ‡ณ ๐Ÿ‡ด

#

๐Ÿ‡ฉ ๐Ÿ‡ฆ ๐Ÿ‡ฒ ๐Ÿ‡ณ ๐Ÿ‡ฎ ๐Ÿ‡น

#

inb4 i get a timeout ๐Ÿ˜ข

jade abyss
#

So @tulip cloud , whats you pick.

tulip cloud
#

My kid interupted me sorry about that.

So modelToWorld works great for what I'm doing for calculating the initial position of objects. Though once I set a different heading for the parent object then I need to update the location and heading of all children objects. I think doing a forEach attach will be the most efficient method.

So all objects will spawn from an array and attach themselves to the parent object. Then I can set the parent object location. From my experience attached objects don't follow terrain so might have to experiment with this a bit to make sure nothing crazy happens.

#

I might be missing something here. Does modelToWorld XY grid change based on an objects heading?

tame portal
#

Any reason a light source's flare could be flickering?

#
    _light = "#lightpoint" createVehicle _randomPos;
    _light setLightColor [0.9,0.41,0];
    _light setLightBrightness 4;
    _light setLightAmbient [0.9,0.41,0];
    _light setLightFlareSize 0.4;
    _light setLightFlareMaxDistance 150;
    _light setLightUseFlare true;
    _light setLightDayLight true;
    _light setLightAttenuation [0.1, 0.8, 100, 70];
#

It's mostly on but sometimes quickly disappears and appears again (the flare effect)

#

The light itself and it's influence on the gameworld are fine

#

@tough abyss I thought that its that aswell at first (could still very well be) but now I feel stupid, it was because they were at height 0

#

anything above 0 works fine ๐Ÿ˜›

teal valley
#

arma 3 script to unlock vehicle chopper weapons to copilot ??

cedar kindle
#

what about it?

teal valley
#

does it exist? if so any help on it..

lapis mesa
#

why the hell would you complain about this when you can complain about something else?

#

No

#

No

#

I can't change the engine or how sqf functions

#

You're "allowed", but it won't change anything, your rambling is pointless

tulip cloud
#

Not to intrude on this important conversation...I have a question.

I see a functions to set or get direction. Though there is 1 function that is lookAt but it seems like it is designed for AI or something to look in a specific direction and not actually set the direction of any random object. Am I correct in this?

#

control what the unit(s) is/are looking at (target or position). It says looking at not the direction they are facing

#

that is why wanted to check with the community

#

no, looking to use it on a trigger...which wouldn't work because it's for AI and using on myself wouldn't help.

lapis mesa
#

What are you trying to accomplish?

teal valley
#

arma 3 script to unlock vehicle chopper weapons to copilot ?? , does it exist? if so please any help on it..

tulip cloud
#

I have point a and point b. I want point b to face point a.

lapis mesa
#

What's "point a"? Marker?

tulip cloud
#

both points are triggers

#

I overlooked the "since version x..." I actually think I've used this before. Thanks for the tip.

lapis mesa
#

_triggertwo setDir getDir _triggerone

tulip cloud
#

yeah got it

#

thanks

lapis mesa
#

it's different for markers

south pasture
#

How can i get spectator camera coordinates (while being in spectator mode with enabled debug console)? Thnx

#

What are the prerequisites to be able to compile functions from FunctionViewer (to not restart mission everytime after small edits).?

little eagle
#
AGLToASL positionCameraToWorld [0,0,0];
compact maple
#

Hello, i made some ppEffect to train, i got stuck with something, how do i do if i want the effects to come and leave "smoothy", cause when i create my effect, its comes instantly, not gradually

noble pond
#

makes it happen over time

rotund cypress
#

Its always good practise to think securely though @tough abyss

compact maple
#

@noble pond yes, this is what i do, but it cames instantly even with _rad1 ppEffectCommit 10;

gleaming cedar
#

Anyone uses unit capture? it seems unti fire is broken on helicopters

candid jay
#

is there any way to retrieve the current mission folder from an addon, or even the root of all the arma profile?

simple solstice
#

?

candid jay
#

that only returns the name, not the path

swift glen
#

Does anyone know how to enable crosshairs on players even if they are unarmed?

austere granite
#

@candid jay check comments on drawIcon3D

#

That has multiple methods

candid jay
#

what are you referring to? i do mot see any mission path reference in there

rotund cypress
#

Is civilian side not available in an objects init field? As I am currently getting undefined variable CIV

sour saffron
#

civ is a faction side = 0,1,2,3

rotund cypress
#

I know

#

Not my question.

#

civilian should be a side datatype

tame portal
#

@rotund cypress I think CIV is the stringified version

#

The command name is CIVILIAN

rotund cypress
#

civilian isEqualType ""

#

false

tame portal
#

That would be false

#

civilian is a side

rotund cypress
#

ye

tame portal
#

str civilian == "CIV" -> true

rotund cypress
#

ah ye exactly

#

However, in the objects init field

#

civilian does not -> side

winter dune
#

is there a way to take a look at the single player source code/

rotund cypress
#

civilian isEqualType sideUnknown

#

this is true

#

since its a side datatype, but for some reason i am getting a undefined variable civilian in object init field so maybe its a thing that doesnt work in the init field of objects?

tame portal
#

can you show me the init field content?

rotund cypress
#

Yes hold on one second please.

#

@tame portal init="[this, civilian, ""<t font='RobotoCondensed' color='#FFFFFF'>Ground Vehicle Garage</t>"", ""GW_client_fnc_vehicleOpenGarage"", [civilian, ""Ground"", [""civilian_groundvehiclegarage_spawnmarker_1""]], ""Ground Vehicle Garage"", ""Garage""] call GW_client_fnc_initWorldObject;";

jaunty zephyr
#

@candid jay pretty sure it is possible to get mission file path. trying to find an example, but it's been some time

tame portal
#

and whats the error message youre getting simzor?

rotund cypress
#

CIV undefined variable

#

Which is quite weird in my opinionยจ

candid jay
#

thank you fusselwurm

rotund cypress
#

I think I figured out my problem however, I am inserting a side datatype and calling it via string, so I think I have my problem there.

#

Alright I got it sorted. Thanks anyways @tame portal

tame portal
#

What was it?

rotund cypress
#

So I was taking in a param with side data type

#

then i used that to call another script

#

by parameter

#

but because of the way the addaction was being added (call through string)

#

it didnt work

#

format ["%1 call %2", _scriptArguments, _script], @tame portal

jaunty zephyr
candid jay
#

yes I'm familiar with that

jaunty zephyr
#

but you'd have to call it from mission file

candid jay
#

unfortunately it'd give me the path of the mod, not of the mission

#

right

jaunty zephyr
#

i m beginning to see your problem

candid jay
#

thank you for looking it up though ๐Ÿ˜ƒ

jaunty zephyr
#

at my group, we put lots of libs into missions (via package manager), so for us FILE was sufficient :/

little eagle
tame portal
#

@little eagle You have too much free time

still forum
#

So thats how a straight curve looks like

little eagle
#

It's two points 20 meters apart connected by a chain which is 20.2 m long.

fluid radish
#

does the valign attribute for RscStructuredText work? i can't get my text to align to the bottom with 12:46:09 "<t shadow=2 valign='bottom'><t shadowColor='#000000' align='center' valign='bottom' size='0.777856' font='PuristaBold' color='#FFFFFFFF'>SE<br />|</t>"

little eagle
#

It doesn't work from my experience.

#

I always just move the whole control downwards.

#

Or upwards in your case.

#

"bottom"

still forum
#

Well it's true.

#

There is no title

#

titles != title

#

That squiggly letter at the end is wrong

little eagle
#

titles[] should be title[]

#

lol

still forum
#

I wasn't specific enough? The error message says title doesn't exist and in your config you have titles

little eagle
#

I think it also has to be a string, not an array.

#

title = "";

still forum
#

Can be both apparently

little eagle
#

title = {$STR_RADIO_2};
This looks definitely wrong tho.

#

Don't trust the wiki!

still forum
#

It's because CfgSounds is something completly different

#

Radios != Sounds

#

And if you check wiki you'll see CfgSounds uses titles and CfgRadio uses title

#

Another consistency achivement from BI

little eagle
#

CfgRadio needs title and CfgSound sneeds titles[] - apparently. No reason in asking why. BI, that's why.

#

Computers be dumb.

still forum
#

If it says "no entry" something always check if that entry is there.

little eagle
#

Should just add both title and titles[] lol.

still forum
#

You still have titles?

#

But that screenshot shows titles

#

show what you have now

#

The code above is wrong

little eagle
#

Don't "restart", go back to 3den and save and load the mission.

still forum
#

I want to see the code you are using right in this exact moment that gives you problems

#

What is the error? still no entry for title in CfgRadio?

little eagle
#

Don't "restart", go back to 3den and save and load the mission.

still forum
#

Check that class in Config viewer

#

if it applied your change

little eagle
#

There's no point at getting angry at machines. They don't give af.

#

Which I can admire.

still forum
#

show me what config viewer shows on your CfgRadio class

#

It's not. if you do it right

#

Wiki shows your title cannot be an array. Somehow

#

And you have title[] which is an array

fluid radish
#

how would i get the rel dir a player is looking at (i.e in freelook) - i know eyeDirection returns a vector but im bad at math and dont know how to convert that into a number

still forum
#

@fluid radish you mean direction in degrees?

fluid radish
#

yes @still forum

still forum
#

I'm not sure if eyeDirection is correct. You might want cameraDirection

fluid radish
#

just found that CBA_fnc_headDir returns the value i'm looking for

#

ez pz

twilit bluff
#

Does find work with multi-dimensional arrays in A3?

little eagle
#

[[0,1]] find 1 // -1

#

[[0,1]] find [0,1] // 0

#

So, sorta?

rotund cypress
#

ew just noticed arma 3 is using tabs most places

twilit bluff
#

Thanks @little eagle

little eagle
#

Damn, discord compression is really bad.

still forum
#

That looks dope

tough abyss
#

what is it though? seems like its just drawing a curve from the heli to the head of the unit

#

oh its a CBA funciton

#

got it

fluid radish
#

does anyone have a function to convert a color in format [1, 1, 1, 1] to a HEX code like #ffffffff? trying to avoid writing my own if someone else already has one

still forum
#

No it's not a CBA function.
It's a "Catenary curve" It's how a rope would curve if that was a rope

tough abyss
#

@still forum yes, and according to the systemChat it seems to say its a function ๐Ÿ˜›

still forum
#

Apparently sir commy wants to make it one

little eagle
#

@fluid radish

"#A7A7A7" call { 
    params ["_color"]; 
 
    _color = [ 
        _color select [1,2], 
        _color select [3,2], 
        _color select [5,2] 
    ]; 
 
    _color apply {call compile format ["0x%1", _x] / 255} 
};
fluid radish
#

i think that's going in the opposite direction, but it a start

little eagle
#

Oh, lol

split coral
#

There's also the BIS_fnc_colorRGBAtoHTML

#

BIS 0.0417 ms
ACE 0.0261 ms
But does it matter really? You don't do color conversions very often I imagine

fluid radish
#

not at all. how did you manage to find that? it's not on the wiki

fluid radish
#

huh, must have missed it then. but that's exactly what i was looking for, thank you

split coral
#

๐Ÿ‘

little eagle
#

stringToColoredText uses toHex, which is only called by the magazine emptiness indicator and the grenading throwing hint top right.

#

So idk if it matters. Prolly not. ยฏ_(ใƒ„)_/ยฏ

#

Could also use the BI function instead and spawn that script. Would mean no worries about performance at all, and the indicator would pop only like half a minute later in MP.

#

/s

meager granite
#

Its 0.015 ms you could've spent playing the game!

sudden ravine
#

I'm having a bit of trouble with addDiaryRecord and MP. This is in the object players interact with: intel1pick addAction ["Download Information", remoteExec ["intel1.sqf"]]; and this is the running script: https://pastebin.com/zc3ccjPG

#

For some reason when I go to activate it, nothing hapens.

little eagle
#

I don't think you can use files with remoteExec.

still forum
#

yup you can't.
You can remoteExec execVM

little eagle
#
["Download Information", "intel1.sqf"]  remoteExec ["execVM"]; 
#

Something like that.

sudden ravine
#

Oh I see. Okay, so I just need to change the remoteExec section and it should run okay?

#

*run okay in MP

little eagle
#

Were you born this way Quiksilver or were you dropped as a kid?

#

I had to google "scurrying". I've never heard that one.

still forum
#

That's when you walk without lifting your feet right?

tulip cloud
#

is isKindOf the only way to get a vehicle's sub-class? I'm looking for the best way to return either an object or classname's sub-type. ("landvehicle","plane","helicopter","ship")

little eagle
#

Ah, I don't think that's the right one. I swear I had something like that somewhere.

#

Essentially you go backwards with inheritsFrom and configName.

tulip cloud
#

commy if only they would adopt CBA into the vanilla version :/

little eagle
#

Until you end up with <config null> = no more parent classes.

tulip cloud
#

that sounds like it would cost more than just nesting a few ifs.

meager granite
#

Wouldn't

while {isClass _config} do {

be better than

while {configName _config != ""} do {

?

little eagle
#

I think so.

#

But even for non CfgVehicles, they now have an alternative syntax for inheritsFrom.

#

Sry, isKindOf I mean.

#

currentWeapon player isKindOf ["Rifle", configFile >> "CfgWeapons"];

#

So who cares. Just use that instead.

agile pumice
little eagle
#

setPosASL AGLToASL
instead of setPos ?

#

Ah, nvm. None of the local variables are defined inside the eventhandlers scope.

#

They don't carry over, you need to pass them as arguments.

agile pumice
#

roger

#

I thought about that as a possibility

little eagle
agile pumice
#

if I'm using modelToWorld visual, setpos is okay right?

little eagle
#

modelToWorld is AGL. So setPos will do exactly what the vid shows above an aircraft carrier.

agile pumice
#

modelToWorldVisual as well?

little eagle
#

Yes.

#

It was the ONE time I used setPos and it came back to hunt me.

agile pumice
#

hehe

#

what I don't understand is, if modelToWorldVisual format is agl, and setpos is agl as well

#

why is that bad?

little eagle
#

setPos isn't AGL apparently. But only over roadway lods on the sea. Who the fuck knows.

#

It isn't listed on the wiki's page about the position formats anymore either.

#

So it's probably just special.

#

Not even AGLS like getPos. Special special.

agile pumice
#

perhaps using modeltoworldworld and setposworld?

#

if I'm using oneachframe, should I do modelToWorldVisualWorld?

#

alright, got it all figured out

#

_pos = _vehicle modelToWorldVisualWorld _pos;

#

(_this select 0) setposworld (_this select 1)

fluid radish
#

i'm trying to use @still forum 's arma script profiler, but i keep getting "Script core not found" when i launch with it. i'm on the profiling branch and have battleye disabled. any ideas?

still forum
#

What's the problem with that?

#

Not an error and also doesn't break anything.

#

Just tells you Intercept is working correctly.

#

I know I should write something else there ^^ But too lazy
Should change that to Script "Arma script profiler succesfully loaded" not found ๐Ÿ˜„

fluid radish
#

oh, i just assumed it wasn't working, didnt bother to try that. derp

cosmic kettle
#

if (script == true && 1==1 || "x" == "x") would be better.

still forum
#

Don't see anything to optimize

cosmic kettle
#

@still forum you once said something about you replacing cfgFunctions for ACE, I see that it's done with macros, but how exactly does this work?

still forum
#

ACE doesn't use cfgFunctions

cosmic kettle
#

yeah, was it something with scriptName?

still forum
#

They use CBA macros. I just modified the CBA macros for it

cosmic kettle
#

or am I mixing things up. hmm, I'll have a look into those. What is the benefit, apart from not having to go through the cfgFunctions on every iteration?

still forum
#

Being able to control yourself what to do. Instead of using a crappy BI function that you have no control over

fluid radish
#

so the forums appear to be up but i can't seem to log in, anyone else?

still forum
sudden ravine
#

Hello all. Another (quick) question. I am getting an error when running an execVM:
['#'execvm (_this)' Error execvm: Type Number, expected string.]

Furthermore, for some reason even though I have a createDiaryRecord, everything BUT that is working in the same script.

player createDiaryRecord ["Clues", ["Generator Location", "Local resistance cells have managed to <marker name='generatorloc'>loc ate</marker> a generator which is powering The Castle. If we destroy, it will knock out communication and power to the city, making our extraction easier. <br /><img image='generator.paa' />"]];

little eagle
#

What is the benefit, apart from not having to go through the cfgFunctions on every iteration?

  • It's easier to write PREP(myFunc) and then use FUNC(myFunc) instead of having to set up the CfgFunctions config.
  • You can add functions without having to go through config which requires a game restart or diag_mergeConfig which only works on dev branch.
  • You can make functions that compile only e.g. on machines with interface, so dedicated servers and hc's don't have to compile ui functions.
  • You can selectively enable debug mode for each component.
  • You can disable the functions cache for each component selectively instead for everything or nothing (faster mission restart while debugging).
warm gorge
#

Is it possible to avoid chat from channels added via radioChannelCreate to be visible in the lobby selection screen to anyone?

little eagle
#

Lobby or briefing?

warm gorge
#

@little eagle Sorry for the late reply. The lobby, so before the player has even selected a slot

candid jay
#

anyone using make_file.dll of KK from an addon: where do you save your output files? I havenโ€™t found a way to retrieve a path such as user profile and such

little eagle
#

@warm gorge Then the answer is no sadly.

tough abyss
#

@candid jay main arma directory for me

#

It will bring up a message box asking you to save the file

candid jay
#

so how do you do that? by passing just the filename and no other path?

still forum
#

@cosmic kettle Commy gave more details above

cosmic kettle
#

Thx for the notice! ๐Ÿ‘Œ

little eagle
still forum
#

No I didn't ^^ Someone else

cosmic kettle
#

@little eagle Which one is be less intensive? (ropeCreate vs. draw)

little eagle
#

Drawing them is not the problem. These are > 400 segments for my curve and, idk, 100 segments of rope?
The problem is calculating the rope tension, which wouldn't be feasible with SQF in real time. It needs some approximation algorithms that would be better off in C++ land.

barren magnet
cosmic kettle
#

What is the difference between:

if (!isNil "_var")

and

if (!isNil {_var}) 

Both result in the same output, so just wondering out loud, the latter is code the first a string?

still forum
#

Yes..... The first is a string and the second is code....

#

The second one has a lot more overhead

cosmic kettle
#

You already answered my next question thanks ๐Ÿ™‚

still forum
#

I know.. That's what I just did...

cosmic kettle
#

I found the atom sqflint package and it keeps saying that _var is not being used if I use the string check.

#

So was considering changing all string checks to code checks... just to get rid of those false flags

still forum
#

Tell the author of sqflint that that's happening and have him fix it

cosmic kettle
#

Might as well. Thanks for the info!

little eagle
#

Hmm,isNil STRING can only check variables, whileisNil CODE can check the return value of any expression.

#

If your expression is just one variable, you might as well use STRING.

pine wadi
#

Could someone pls help a noob with some real basic trigger stuff?

plucky beacon
#

What's the trigger

candid jay
#

@barren magnet thank you

barren magnet
#

@blissful wind ahahahahah, that is 10/10

#

You should post it + the mission with the code for it on the biforums

#

I think many would appreciate that idea

tame portal
#

@little eagle ArmA 3 SQFhysiX next?

little eagle
#

I mean, we DO have addForce and addTorque now...

#

I already forgot what it was about.

tame portal
#

Just remember to use SQFhysiX in case you make something

#

๐Ÿ‘

tulip cloud
#
_newTrigger = createTrigger ["EmptyDetector",[1,2,3],true];
missionNamespace setVariable ["_TriggerName",_newTrigger];
diag_log (getPosWorld _TriggerName);

I get error that _TriggerName is a string not an object.

little eagle
#

setVariable is for global variables. "_TriggerName" as name doesn't look right at all. Local variable begin with underscore, not global variables.

#

Just copy paste the whole error message.

lean tiger
#

@tulip cloud what @little eagle is saying is that the "_" prefix is reserved for local scope, either in a function or local to the .sqf file. Pushing that to missionNamespace probably silently fails

tulip cloud
#
_name = "myTestName"; 
_location = [4000,4000,0]; 
newSpawn3 = createTrigger ["EmptyDetector",_location,true]; 
newSpawn3 setDir 0; 
missionNamespace setVariable ["newSpawn3",_name]; 
{ 
diag_log _x; 
}foreach allVariables missionNamespace;

tried it this way too.

#

I looked through the missionNamespce and newSpawn3 still exists in there and there isn't any myTestName.

still forum
#

What are you trying to do?

#

You are doing newSpawn3 = "myTestName" and expect a variable "myTestName" to magically appear

lean tiger
#

I... have to look up to be sure

#

but I think your setVariable is backwards

#

with that setVariable, you'd able to call "newSpawn3" as a variable elsewhere, but it'd return "myTestName", which is not the trigger you've made

tulip cloud
#

I had it backwards...

#

What a waste of 3 hours....

lean tiger
#

๐ŸŽต just SQF things ๐ŸŽต

#

It's truly a black hole of time

#

Fastest way to debug anything is to just create a local server with the editor

#

then back out to the lobby and back in with each change

#

but on the other hand, that probably is zero help for the .ext and .cpp files

#

woohoo

tulip cloud
#

[name,value] ....if it was [newValue,value] on the wiki I wouldn't have made this rookie mistake.

still forum
#

but [newValue,value] would be wrong

#

It is [variableName, variableValue]

tulip cloud
#

isn't it changing the variable name to a new name?

still forum
#

You can't change a variable's name

tulip cloud
#

so how does it work if I'm creating multiple objects using the same variable = createVehicle

still forum
#

You overwrite the variable

tulip cloud
#

Ok so setVariable is more of a cloneVariable?

still forum
#

No.

#

It set's a variable.

#

creates new one if doesn't exist and overwrites if it does

tulip cloud
#

So both the old and new variable are set to the same object?

still forum
#

yes

#

Wait.. If you overwrite a variable there is no new variable

#

you overwrite the old one.

tulip cloud
#

it is still in the missionNamespace though

still forum
#

If you set it in missionNamespace... ofcause...

swift glen
#

hey is anyone around to help me with using checkvisibility?

#

I want to use it to check if a particular player is looking at a specific prop

#

I can't use cursorobject because that applies to any player

subtle ore
#

well no not exactly, you can use cursorObject when the script is being executed local to the player

swift glen
#

Okay, let me try and understand. I have 4 players 2 OPFOR and 2 Civilians named Terrorist 1 and Terrorist 2. I want to create a trigger that says, when Terrorist 1 is looking at a prop, it will explode. I don't know how to restrict cursorobject to just terrorist 1

#

[objnull, "FIRE"] checkVisibility [getPos IED1, eyepos Terrorist1] >0.5

#

is what I have in the condition

#

but doesn't fire

#

Even if I group CursorObject trigger to Terrorist1, the moment he satisfies the present condition any player can then look at the IED and it will explode

subtle ore
#

use the VIEW lod instead of fire, see if that makes any difference.

swift glen
#

I'm using this as a test [objnull, "FIRE"] checkVisibility [eyePos Terrorist2, eyepos Terrorist1] >0.5 this work, as soon as the two terrorists face each other it explodes

#

"VIEW" allows them to see through walls which isn't wnat I want

#

@tough abyss cool I was looking at that but I'm really new to this so do you ahve any advice on how to apply it to my specific case?

#

@subtle ore using getPos seems to be the issue, I can't use eyepos on a prop tho

subtle ore
#

have you googled quite yet?

#

there are a few tutorials already out there for that

swift glen
#

@tough abyss I think that worked! Man, after three hours of messing with this I think you might be my hero

#

thanks so much

#

god damn it no it's stopped working again

tulip cloud
#

missionNamespace setVariable on the server doesn't go to the client. I thought missionNamesspace was global. What do I need to do to push the variables to the client?


missionNamespace setVariable [newVariableName,sourceVariableName];
publicVariable newVariableName;
lean tiger
#

from the server?

#

just publicVariable

tulip cloud
#

ok

lean tiger
#

but publicVariable requires the string

#

of the name of the variable

#

this is where SQF is goofy as heck

cosmic kettle
#

@tulip cloud

    missionNamespace setVariable [newVariableName,sourceVariableName,true]; //?
lean tiger
#

alternatively that

tulip cloud
#

lol...I knew that...thanks I forgot about the optional element

lean tiger
#

iwantthisglobal = "my value";
publicvariable "iwantthisglobal"

#

as an inline alternative

tulip cloud
#

yeah, I've read that multiple times and my mind is just jello and useless this weekend

cosmic kettle
#

Get some rest, unjello it ๐Ÿ˜ƒ

still forum
#

second should too

little eagle
#

Both do.

#

Yes.

lean tiger
#

Goofy question: is there the inverse to the EH "handleDamage" like perhaps "damageDone"

#

tldr: need to know what buildings players hit

jade abyss
#

@lean tiger Nope

#

Sadly

tulip cloud
#

@lean tiger do you need to know every building they might hit or specifc ones?

lean tiger
#

if it was specific, I'd just EH handleDamage those ๐Ÿ˜‰

#

although those get hairy

little eagle
#

Don't think so.

jade abyss
#

Alternative:
HandleFired EH, lineIntersect where it watches, add a HandleDamage EH to that Object
@lean tiger

cosmic kettle
#
case "ARM_Quee":{
    private _value = 8;
    for "_x" from 0 to 7 do {
        private _toAdd = (_value + (_value * _x));
        // code
    };
};

Why would atom's linter-sqf flag _value as being an unused variable?

still forum
#

because it's dumb?

#

Nothing is perfect

lean tiger
#

Could be not trusting the for loop -- loads of editors throw warnings on conditional exection

jade abyss
#

@cosmic kettle is _value declared before the case?

cosmic kettle
#

@still forum lol I thought I was going nuts. All other cases are fine though, just this one specifically.

#

@jade abyss Yeah, but always private.

jade abyss
#

hm, strange.

little eagle
#

I think it makes player characters more sturdy, maybe also vehicles, but I know no details.

#

I remember something about RHS and this setting having to be disabled or the tanks would never blow up or something like that.

#

What's up with Chuck Norris and Pepsi?

cosmic kettle
#

@lean tiger Yeah seems to be the case.

little eagle
#

Decreases damage dealt to the player and members of his group.

lean tiger
#

The nearestObjects array of "kinds"/"types" is of strings -- can it listen to an array of configFile entries?

lean tiger
#

I'm looking at that goober ๐Ÿ˜ƒ

#

What I'm asking for clarification for, if anyone is familiar with it offhand...

#

Parameters:
types: Array - list of class name of the objects to search for.

#

Examples provided are only array of strings, can it take configFile notation as well, the way isKindOf can?

#

See Ex. 3

little eagle
#

I have no idea what you're trying to do.

#

Or where the problem is.

lean tiger
#

isKindOf returns if the object passed in parameter 1's "kind" matches parameter 2

#

alternatively, you can narrow it in scope to say "is it of this "kind", and also a member of this config tree"

#

Which is alt syntax 2

#

I'm asking if that alt syntax 2 is a [generic evaluation] that can be passed in the array of nearestObjects

#

or if nearestObjects just requires an array of strings describing the vehicleClass

little eagle
#

???

lean tiger
#

I'll just have to take enough samples for the string array

#

but thanks for letting me bounce it off ya

little eagle
#

Still no idea what's going on.

lean tiger
#

I was suffering for a way to bulk-reference "parents" for the array variant of nearestObjects

#

was hoping to just point to a configEntry, the way you can with isKindOf

little eagle
#

You don't need the parents for nearestObjects.

#

You want all cars? neareatObjects ["Car"]

#

All tank? neareatObjects ["Tank"]

#

etc.

lean tiger
#

well, quick question up front -- what do you call those strings

#

isKindOf suggests they're the "kind"

little eagle
#

Classnames.

lean tiger
#

Except that, in testing, I found isKindOf returns true as long as it matches any string found in the parents field of the splendid config viewer

little eagle
#

Yes, isKindOf reports true for any parent class, which is by design.

#

Otherwise you could just do:
typeOf _vehicle == "B_MBT_01_F"

lean tiger
#

right, and just nearestobject that MBT

little eagle
#

Yeah, that would report all the MBT's.

lean tiger
#

so, in short, I was looking for a way to pull all config parent entries down, to quickly dump as minimal a list of possible of all the types of objects I'm trying to pull with a huge radius nearestObjects

little eagle
#

Tank
Car
Ship
Helicopter

#

Plane

#

CAManBase (people)

#

Animal

lean tiger
#

yeah, I couldn't find a list anywhere

#

and I'd like to keep it dynamic

#

and be able to verify membership of objects to those types in the case of outliers

#

and I found this

#

whew

little eagle
#

You mean vehicle classes that don't appear in my list?

lean tiger
#

correct

#

there's like House, HouseBase, Strategic, Building, etc

little eagle
#

If you want every object regardless of class, why don't you just make the array of classnames empty.

#

Then it will list every near object.

lean tiger
#

because I don't want them all, I wanted all kinds, and be able to performance tweak my selection

#

all classes*

little eagle
#

Car, Tank, Helicopter, Plane, CAManBase, StaticWeapon
Those are pretty much all.

#

Ship

lean tiger
#

I wanted to be exhaustive and exact

#

but like I said, found that function

#

๐Ÿ˜ƒ

#

because, like I said, it's huge

#

100km radius -- and I've got it running under .1 seconds on stratis

little eagle
#

You could just open the ingame config browser to look at all classes.

lean tiger
#

yeah, that's a real pain in my behind, was looking to be able to hideObjectGlobal my results, then see what remains

#

then cursorObject it

#

tl;dr: Capturing every damaged building:

tulip cloud
#

how do you properly return a value from a function using exitWith?

returnedValue = [] call my_fnc_test;

fn_test.sqf

for "_i" from 0 to 10 do {
if(_i = 5) exitWith {_returnVal = _i};
};

_returnVal

returnedValue = any when I try this

#

do I need to put _i outside at the end of the fn_test.sqf?

jade abyss
#

define _returnVal before the for loop

tulip cloud
#

that did the trick!

little eagle
#

You needed to define _returnVal in the main scope of your script. i.e.:

private _returnVal = 0;

for "_i" from 0 to 10 do {
    if (_i == 5) exitWith {_returnVal = _i};
};

_returnVal
#

Ah, damn discord not updating the chatlog.

trail parrot
#

Anyone know how to add "addon free arma radio" by armaphronk to an official zeus server?

lapis mesa
#

@Quicksilver I had a mute 4x4 today on Dev

#

Yep, I_C_Offroad_02_unarmed_F and C_Offroad_02_unarmed_F don't have engine or driving sounds. Horn works though

inner swallow
tulip cloud
#

Is there a performance difference between using nearestobject and radius then using an area trigger?

still forum
#

Those are two different things.

#

nearestObjects a dozen times every frame is ofc more expensive than a trigger checking once every few seconds

south pasture
#

Strange data type: wtf is this - data of array elems, when array is extended.

_arr = [];
_arr set[4, "qqqq"];
systemChat str _arr;
_elem = _arr select 0;
systemChat format["Value type:%1,  type of type:%2, val:%3", typeName _elem, typeName typeName _elem, _elem];
#

typeName is ?, typeName typeName is ? - how to deal with those?

still forum
#

typeName _elem is Nil or Nothing.
typeName typeName is typeName of string.. so.. String.

south pasture
#

Actually typeName typeName gives ""

#

If to execute that code in debug console

still forum
#

Ahhh

#

typeName nil might not work

#

because nil parameters sometimes just fail silently

south pasture
#

but format["%1", _elem] gives "<null>" not "any"

still forum
#

There is a difference between Nil and Nothing

#

And there are actually two kinds of Nothing

#

One that is actually something and the other nothing is really nothing and often ends badly when it appears somewhere

south pasture
#

how to check for <null> nothing? will isNil work?

still forum
#

should

south pasture
#

is there a literal for <null>Nothing (as nil for any Nothing)?

meager granite
#

Not all nils are created equal

still forum
#

no there isn't

#

also nil != nil.
A nil can have values like strings or numbers have.

#

That's why when you stringify a nil you sometimes get scalar or similear. That means a nil that was supposed to be a number

#

Don't actually know if any is nil... But if it is then that would mean a nil of unknown type

#

I think getVariable with a non-existent variable name returns a Nothing

meager granite
#

I think scalar means that it is variable of Number type but it doesn't hold any value in it

#

Which is still nil

still forum
#

Number type itself can only contain numbers. And it can't contain no number

#
class nilType {
  variableType type;
}
class numberType {
  float value;
}

like that.

jaunty zephyr
#

ow. my head hurts.

#

and i thought it was bad enough we had null and nil

#

like null and undefined in javascript

meager granite
#

I mean nil is created off non-initialized Number type, as in expression supposed to return Number type but doesn't, so it makes nil of Number type.

#

format ["%1", ln var]

#

format ["%1", getPos var]

#

format ["%1", vehicle var]

still forum
#

I actually don't know if the engine automatically creates a nil with correct type or if the dev has to manually specify it... Theoretically the engine knows what type something returns.
If it's not automatic then we already know we can't trust it.. because BI..

meager granite
#

I think each command has expected return type and if it fails, nil with such type is created

still forum
#

I'll look it up

meager granite
#

Interesting, producing nils of try, if, etc return very close memory addresses

still forum
#

If the argument is nil then the function isn't even called and the return value is a Nil of the type of the return type of that function

#

nil can only stringify to scalar,bool,array,string,nothing
Else it returns the memory adress of that type.
And all types are in an array

#

So yeah.. It returns the memory address in that array. And as all.... 31? or 27 or smth like that types are in that one array it's close together

meager granite
#

Yeah I guess its just an address in that array

#

format ["%1 %2 %3", vehicle var, if var, try var] => "0xdb06b8 0xdc5384 0xdc6910" (OA)

still forum
#

wait...

#

nil stores an array of types.
Because there are compound types

#

so the memory adress is actually that array inside the Nil object

#

not the global types array

#
class NilVariable{
VariableType types[<dynamic array>];
};
#

For compound types it returns all types in a string seperated by a whitespace

#

addMissionEventHandler for example returns nothing and scalar

#

so the nil should be "nothing scalar"

#

returns Nothing if ID doesn't exist.

#

And I'd say -1 doesn't exist

meager granite
#

Where did you get addMissionEventHandler returning nothing and scalar? Thought it was supportInfo but it only shows argument types, not returned type.

meager granite
#

ok

still forum
#

asin returns scalar_nan

meager granite
#

Yeah just like ln in above example

#

Well, whatever the case checking if variable is nil by making a string out of it is a terrible idea

peak plover
#

isNil{}

still forum
#

So I think generally. If you pass a nil or nothing to a function it returns a nil.
If you pass a valid argument to a function and that function just returns nothing.. It returns a Nothing

#

and nil returns a Nothing I guess

peak plover
#

Can those be checked?

meager granite
#

There is also a Nothing type variable which isn't nil

still forum
#

Everything can be checked with isNil

peak plover
#

Can it be checked if its nothing or if it's nil?

still forum
#

no

peak plover
#

isEqualType with the nothing type variable maybe?

still forum
#

every variable is a "gamevalue". the gamevalue contains a pointer to the underlying data.
a Nil gamevalue points to a nil object that contains the type.
a nothing gamevalue contains a nullptr

#

isEqualType should be able to differentiate them.
as a nothing doesn't have a type at all

meager granite
#

It does, there is nothing type and it is very much useless

peak plover
#

Useless, more like

#

0.001ms

still forum
#

But.. as commands you pass "nothing" to just return nil... isEqualType probably just returns nil if you pass nil or nothing to it

meager granite
#

addMissionEventHandler ["Draw3D", {systemChat str [typeName _this, typeName objNull]}]

#

Draw3D has literal nothing type as _this for some reason

still forum
#

undefined variables are any right? Interesting..

#

Wasn't it that you can't actually delete variables from missionNamespace? just set them to nil?
So that way you could probably detect variables that have been set but "deleted"

meager granite
#

test = getPos var; format ["%1 %2", test, getPos var]; => "any array"

#

same with namespace setVariable

#

So setting to any nil kind seem to actually delete it

#

player setVariable ["test", getPos var]; format ["%1 %2", player getVariable "test", getPos var] => "array array"

#

entity setVariable is different though

still forum
#

Maybe the = operator as a special check

#

that setVariable doesn't have

#

how about missionNamespace setVariable ["test"...

meager granite
#

missionNamespace setVariable ["test", getPos var]; format ["%1 %2", test, getPos var] => "any array"

still forum
#

๐Ÿค”

meager granite
#

Yeah looks like its OBJECT setVariable ARRAY that doesn't delete on nil

#

GROUP setVariable ARRAY too

south pasture
#

How to discard any AI movements and put unit into READY state via API?
Problem is: the group is created with BIS_Fnc_spawnGroup and very shortly after it's teleported to the other place. between creation and setPos subordinates were moving to proper formation. After teleport they continue to move to formation position coordinates(which are from pre-teleport time). I need subordinates to just stop after teleportation and be ready for further orders

still forum
#

doStop maybe?

little eagle
#

and very shortly after
Why not create them in the right place to begin with?

south pasture
#

doStop

Order the given unit(s) to stop (without radio messages). The units stopped in this way will leave the groups formation. It will prevent them from moving around with their group (or formation leader), while still being able to turn around and even move to a new position if they see fit. 

looks like new commands will be ignored

still forum
#

give them a new command to get into formation after that

south pasture
#

@little eagle ,

Why not create them in the right place to begin with?
Group is created and then given to UPSMON control with "RANDOM" -> (teleport to rnd start position)

little eagle
#

Anything you could command them to do might interfere with Upsmon, so you should ask the dev to solve this problem.

#
{
    _x doMove getPosWorld _x;
} forEach units _group;

This should make them ready and not ignore orders like doStop.

south pasture
#

Maybe leader should issue sort of regroup on squad level (which API command?)? Supposedly that should recalculate formation coordinates

#

doStop- ...The units stopped in this way will leave the groups formation. How put unit back to group's formation?

#

^^^ doFollow
But experimenting with it, units continued to move to pre-teleport positions

peak plover
still forum
#

Yes.. But the code you linked isn't what you posted

little eagle
#

controlNull, not "ctrlNull"

peak plover
#

Yeah, but counting nulls works?

little eagle
#

count doesn't count anything. Reports the array size. Index of the last element + 1.

#

Has nothing to do with null or even nil.

peak plover
#

count [nil,nil,nil]; 3?

little eagle
#

Where do you see that in the code?

peak plover
#

I don't see it in code per say, but I'm updating my custom ace, and I'm going over changes and wondering why I did them

#

For some reason I changed that, maybe it was to fix the bug when bleeding would not cause bloody screen

#

Possibly pressing escape near the time bleeding starts

#

Would cause that

little eagle
#

Uhm, why not create an issue report describing when a bug happens, and then a dev looks at it if he can reproduce it?

peak plover
#

Im not entirely sure how to recreate it but I've heard other people complain about bleeding and not know about it too. I'm pretty sure I made a issue on github when I first found this.

little eagle
#

Yeah, that's useless then. You're essentially trying to debug this without even knowing when something happens. No point in doing so.

#

Ask for better information.

peak plover
#

Yeah, this is entriely on the assumption that it's a bug and that this fixed it. It might just be that I've not ran into the bug by luck since I "fixed" it

old basin
#

Any ideas on why my mission's cba_settings.sqf seems not to do anything? The values are editable in the editor and even if I don't do that, they are set to the defaults when I run the mission.

little eagle
#

I have an idea. Try this:

  • restart game
  • start mission, get bloody
  • return to main menu
  • start a different mission, get bloddy
#

Did you use 3den to pack the mission to pbo, Caranfin? Or did you use a tool to add the file?

old basin
#

I packed the mission wiht 3den

little eagle
#

The settings shouldn't be editable anymore under the mission tab if the file is there.

#

But they still are, right?

old basin
#

Hold on actually, the test mission I'm running atm isn't packed, I'm just running it from the source files in 3den

little eagle
#

The thing is this. You need to load or save the mission once with 3den AFTER the file was added. This game crashes if a file is not present, and my workaround only works if you save or load it with the file there.

old basin
#

Do you need to have CBA loaded when you load/save the mission, then? It's not enough to just have the file in the source when you export the mission running the game with no mods?

little eagle
#

Yes you do.

old basin
#

Ah, that explains a lot

#

I've been trying to use the cba_settings.sqf to get around mod dependencies while still having the mission configured in an optimal manner

little eagle
#

Give me a minute and I can give you a script to set the needed flag without cba present when saving the mission.

old basin
#

That would be excellent, thanks

little eagle
#

Ah, dang. You can't set 3den flags without the mod existing with script.

#

You'll have to edit the unbinarized mission.sqm ๐Ÿ˜ฆ

old basin
#

Eh, that's not an issue unless those edits get overwritten when I try to open+export the mission in 3DEN

little eagle
#

Try adding this entry to the description.ext:

cba_settings_hasSettingsFile = 1;
#

But don't if the file isn't there. The mission would crash on a dedicated server.

old basin
#

I'll try that, thanks

#

@little eagle damn:

13:14:28 Error in expression <mespace;

private _missionConfig = "";

if (getMissionConfigValue ["cba_settings>
13:14:28   Error position: <if (getMissionConfigValue ["cba_settings>
13:14:28   Error if: Type Number, expected Bool
13:14:28 File x\cba\addons\settings\initSettings.sqf, line 47
little eagle
#

Damn it D:

still forum
#

๐Ÿ˜„

little eagle
#

I like this solution though. Will definitely add this to the next version. Anyway, I'll give you the mission.sqm thingy in a minute.

old basin
#

Looking forward to it.

tough abyss
#

On a public server where people can bring any mod they want (and assume the server has no mods running) AI are killed by players, yet the server doesn't know the weapon/cartridge they use. Would it possible to tell the server to ignore any messages from a client regarding AI being damaged with modded weapons? ๐Ÿค”

#

TL:DR tell server to ignore any message that contain modded content

still forum
#

You can add handleDamage to the AI on serverside

#

Or Hit handlers

#

I think they get the projectile/weapon? Atleast you get the shooter and can check if the shooters weapon has a classname you know

little eagle
#
class CustomAttributes
{
    class Category0
    {
        name="Scenario";
        class Attribute0
        {
            property="cba_settings_hasSettingsFile";
            expression="false";
            class Value
            {
                class data
                {
                    class type
                    {
                        type[]=
                        {
                            "BOOL"
                        };
                    };
                    value=1;
                };
            };
        };
        nAttributes=1;
    };
};
#

Don't get confused by the "false". This is right.

#

I hope you know how to edit this PoS.

tough abyss
#

If it's modded, would the weapon return an undefined, null or something that would give away its a modded weapon/projectile?

#

I know the RPT at least spits out errors on them

old basin
#

@little eagle yeah, I'll try that

still forum
#

I think it might still give you the weapon classname. Just check if CfgWeapons >> classname exists. If not then.. it's not vanilla

tough abyss
#

Alright will see if that works. Thanks!

old basin
#

If it doesn't, I can always say the mission needs CBA. Who even plays the game without it anyway

#

Or make a two versions of everything I guess but that's dull

little eagle
#

Stupid game and it's stupid dependency handling.

#

Sadly none of this can be fixed by the community.

old basin
#

Yeah, most of the time it's pretty easy to just build stuff that autodetects supported mods and gives gear/crap as appropriate

#

But this issue has been annoying me for months

#

Who knew asking might help??

little eagle
#

Developers can't fix something they don't know about.

old basin
#

Yep

still forum
#

The community can fix it... With a Mod ๐Ÿ˜‚

south pasture
#

What is the preferred way to delete array elements by condition while iterating?
Something like this?

{if(cond)then {_x="toDelete"};}count arr;
arr= arr -["toDelete"];
little eagle
#
{
    _array set [_forEachIndex, objNull];
} forEach _array;

_array = _array - [objNull];
#

Alternatively:

_array = _array select {
    // do stuff

    !conditionToRemove
};
#

Method without copying the array^^:

private _delete = [];

{
    if (cond) then {
        _delete pushBack _forEachIndex;
    };
} forEach _array;

reverse _delete;

{
    _array deleteAt _x;
} forEach _delete;
south pasture
#

@little eagle Thnx, select example looks most elegant (and probably the best performance)

little eagle
#

Yeah. Sometimes you need to modify the array without copy. Then you have to bite the bullet and use method C.

south pasture
#

Is it possible to have debug console for dedicated server in telnet-like form? if at all

still forum
#

Yes. CBA has that. somewhat

south pasture
#

CBA?! is that documented? My first thought was RCon

swift glen
#

hi all,

#

I'm trying to use LineIntersectsObjs to return the closest object within 50m of a character's eyepos

#

not sure how to write the endPos in this case

#

as it's eyepos+50m

#

Originally I was using [IED1, "VIEW"] checkVisibility [eyepos Terrorist2, getPosASL IED1]>0.5 which almost does exactly what I want, however it comes as true even when Terrorist2 is looking in the opposite direction

#

and will not fire at all at values greater than 0.5 for reaasons I can't understand

still forum
#

CBA has watch fields for server and all other clients.
And can also exec code on server and get return value. All integrated into debug console.

#

@swift glen eyepos + eyeDir*50

little eagle
#

This?