#arma3_scripting

1 messages ยท Page 337 of 1

lusty canyon
#

can we get back on topic please?
is there a way to make the player and/or AI units clip through all objects / terrain without the unintended effect of

enableSimulationGlobal false

i need to clip while player group is attach to a rope being winched up a chopper

_myRope = ropeCreate [ _heli, [0,0,0], _myPlayer, "Pelvis", (_targetDistance - 2)];
ropeUnwind [ _myRope, (_targetDistance * 9), ((_targetDistance * -1) + 3), true ];

the above code works as intended but during this wind up period if a structure or hill is in between the _player and _heli, the player will stick to it like a fly on honey. thoughts?

tender fossil
#

@peak plover Yeah, the only reason we wanted to keep it closed source until v1.0 was that we wanted to avoid a troublematic situation where another RP community starts to use the framework before it's ready (resulting in compatibility issues), but we might indeed change it to open source from now on then

#

@tough abyss Well, I've been working on RP projects since summer 2012, but this one has been in development for 2 months

tough abyss
#

@lusty canyon I'm pretty sure I saw AI doing that already ๐Ÿ˜„

lusty canyon
#

please stick to SQF please, there is a channel for your stuff

#

is there a way to make the player and/or AI units clip through all objects / terrain without the unintended effect of

enableSimulationGlobal false

i need to clip while player group is attach to a rope being winched up a chopper

_myRope = ropeCreate [ _heli, [0,0,0], _myPlayer, "Pelvis", (_targetDistance - 2)];
ropeUnwind [ _myRope, (_targetDistance * 9), ((_targetDistance * -1) + 3), true ];

the above code works as intended but during this wind up period if a structure or hill is in between the _player and _heli, the player will stick to it like a fly on honey. thoughts?

#

is there a way to make the player and/or AI units clip through all objects / terrain without the unintended effect of

enableSimulationGlobal false

i need to clip while player group is attach to a rope being winched up a chopper

_myRope = ropeCreate [ _heli, [0,0,0], _myPlayer, "Pelvis", (_targetDistance - 2)];
ropeUnwind [ _myRope, (_targetDistance * 9), ((_targetDistance * -1) + 3), true ];

the above code works as intended but during this wind up period if a structure or hill is in between the _player and _heli, the player will stick to it like a fly on honey. thoughts?

tender fossil
#

@tough abyss (Last post, DM me if you want to continue discussion) I've been working on various projects, I started as complete noob and the results were quite horrible, but I've done game design for thousands of hours now and I've become pretty good at it, semi-professional I'd say... The project we're working on now (with new team) has been in development for 2 months

lusty canyon
#

@tough abyss yeah i can do hideObjectGlobal but if only it kept the object visible.
ive tried setVelocityModelSpace [0, 1, 1]; jus to keep the player off the ground but then it interferes with the rope wind up process

#

same as enablesim false, player cannot control of even move the camera

#

what i need is something like when you try to walk on a vehicle without walkable LOD your player just floats. i need that!

polar folio
#

are you sure about hideObject freezing movement? i could swear i tested this to see how AI reacts to it and i could move around invis while AI didn't see me.

#

maybe a change they did with that simulation cahcing stuff?

lusty canyon
#

hideobject does make stuff clip but i cant use it since i want ppl to still see the object

#

btw great work bb on your walkable LODS for vehicles

peak plover
#

Run hideObject on client that needs it only

polar folio
#

thx

lusty canyon
#

i do still want the player to see himself tho

polar folio
#

so the issue is kind of the player rubbing against surfaces and thus getting stuck while being lifted up?

lusty canyon
#

yes

polar folio
#

did you play aroudn with setMass or setCenterOfMass? you will probably get freak results but you never know

lusty canyon
#

yeah i did setmass 1 - 0 but still sticks

polar folio
#

hm. how about lerping the player pos along the rope segments at the same speed as the rope is shortened?

lusty canyon
#

velocity does get it off the ground/structure but for some reason there is now another force making the winch stop

#

like looping player setpos rope point ?

polar folio
#

yea

lusty canyon
#

wont that have a stuttering effect?

polar folio
#

pretty sure duda doesn't rely just on rope physX in his mod. i think he does similiar. maybe ask him

#

yer this^

lusty canyon
#

ah i havent tried that one

#

illl check it out

polar folio
#

even looks good in MP from what i can tell

#

someone make him aware of setVelocityTransformation then ๐Ÿ˜„

#

i thought it was useless until i found it it smoothes things

lusty canyon
#

yeah i guess ill have to go that route eventually. wanted to try direct attaching to rope first. duda attaches hidden cans to each rope endpoint to get his stuff working

polar folio
#

oh yea do that too. character collision is all kinds of fucked in arma. better to use dummies imho

lusty canyon
#

bb did you ever got into working with madcheese (c2 mod)? i heard somewhere you guys wer gonna do something together?

icy raft
#

Do not use setPos loops if you don't want to desync the whole server

polar folio
#

yer i made all the needed functions non player centric so he can use them for C2. and he already does. there were some remaining issues so i went further with it. so now just waiting for him to implement it.

personally don't really play with AI but i made an open offer for AI modders to do all that and i'm glad he went for it.

lusty canyon
indigo snow
#

yep

lusty canyon
#

i got that wrong, i need 3 objects _startObject_A _endObject_B and my player. so what it does is places the player inbetween _A and _B like in the middile of the vector of _A and _B?

#
Places an object at an interpolated position between two other objects,
and sets its vectors in proportion to the relative position.

The final position/vector is determined by the "interval" specified in the command.
This assumes an imaginary path between the two reference objects, where,
at the beginning of the path (interval:0) the position and vector are identical to the first reference object,
at the end of the path (interval:1) they're identical to the second reference object,
and at 0.5 they're halfway in-between. 
#

so say the player is the first reference object and the _heli is the second and interval is 0.1
will the player be nudged slightly towards the heli?

indigo snow
#

you have two positions, and the object wil be placed somewhere in between the two positions based on the last number (0-1)

#

so you have to have a loop and loop that number from 0 to 1 over time

#

so you start with [object, pos1, pos2,... , 0] and end with [object, pos1, pos2, ..., 1]

lusty canyon
#

then do _interval = interval + 0.1 loop?

#

to make it get closer? how is that different from just doing setpos?

#

is there even an actual setvelocity applied to the object? or just setdirUp setpos?

#

i guess even just setpos z + 1 will get my player off the ground, but i take it the point of transformation command is to make it not look like the object is micro teleporting?

indigo snow
#

youd have to play with it a bit, i guess. i havent used it before myself.

polar folio
#

it might be a bit more tricky for your purpose since you also have the rope physX to account for. as in the thing at the end of the rope dangling around and stuff. i jsut use it to make a vehicle follow a fixed path and, while it might be placebo, i feel like it is smoother than just doing setpos even in MP. so there is maybe some engine interpolation happening. i dunno.

so in my case i just use [0,0,0] for velocity parameters. not sure if that would make sense for your case though. unless you use it to move to the next rope segment instead of straight towards the chopper i guess

lusty canyon
#

ok so i ran


                _myPlayer setVelocityTransformation 
                [
                getPosASL _myPlayer,
                getPosASL _targetObject,
                velocity _myPlayer,
                velocity _targetObject,
                vectorDir _myPlayer,
                vectorDir _targetObject,
                vectorUp _myPlayer,
                vectorUp _targetObject,
                0.01
                ];

IT WORKS! but the funny thing is the player is moving faster than the rope he is attached to, reaching the chopper before the rope completes its wind up

#

i dont see a way of passing the rope as arg to the command since a rope is a special animal right?

polar folio
#

hm. i thought you could get all the segments somehow. last tiem i messed with it was right after it got added though

lusty canyon
#

just tried passing the rope object as well, still works similar to passing the heli but still too fast even at interval 0.0001

obsidian chasm
#

So I was wondering...is there like a limit on how many scripts you can have?

lusty canyon
#

just limited by the 3ms window to run em?

obsidian chasm
#

I have 18 currently

lusty canyon
#

you can have as many scripts as your hdd has free space ๐Ÿ˜‰

polar folio
#

hm. isn't it jsut a lerp thing. so the last parameter is percentage from 0-1?

#

that's how i use it atleast

still forum
#

by "how many scripts you have" what do you mean by that?

#

You can have as many scripts as your Ram and Disk space allow

obsidian chasm
#

Well I'm new to all this so I don't know if there is like a 'safe' number before it starts to effect performance etc

still forum
#

What do you mean by "how many scripts" ?

#

a script is literally a text document

#

And you can have as many as you can till your disk space runs out

obsidian chasm
#

there

lusty canyon
#

i guess his question is how many scripts can be running at the same time (sched+unsched)?

still forum
#

Yes.. a bunch of textfiles. There is no "limit"

#

there can always only be one script running unscheduled

#

and also scheduled

lusty canyon
#

so if you do spawn {run stuff}; spawn {run stuff}; spawn {run stuff}; spawn {run stuff}; spawn {run stuff}; spawn {run stuff}; spawn {run stuff}; spawn {run stuff}; spawn {run stuff}; spawn {run stuff}; spawn {run stuff}; spawn {run stuff}; spawn {run stuff}; spawn {run stuff};

#

only 1 spawn will be running inside each frame?

still forum
#

The limit of scripts is length of (filename + a couple dozen) in bytes for each file. That's for Ram.
And the size of the script files in disk space. If you run out of Ram or Disk space it's over.

#

no

little eagle
#

No, as many as fit in 3ms, but one after another.

still forum
#

spawned scripts run one after another. Never more than one at the same time

#

And there is also no performance impact. Spawned scripts can run a maximum of 3ms per frame. You literally can't make the performance worse

lusty canyon
#

ah ic so then how do you do a spawn that runs another arma_3.exe ๐Ÿ˜‰

obsidian chasm
#

Nice time to add more triggers lol

#

๐Ÿ˜„

still forum
#

triggers run unscheduled do they?

obsidian chasm
#

i have no idea

#

i make things and dont ask how they work

still forum
#

unscheduled scripts don't have the 3ms timelimit. If you make a unscheduled script that runs for 20 seconds your game is gonna freeze for 20 seconds

#

It's not the count of scripts that slows you down. It's the content of them

little eagle
#

I want to be the count of scripts.

lusty canyon
#

or a Duke of scripts?

warm hearth
#

is there a "zeus vs zeus vs zeus" server script?

little eagle
#

I've never seen one.

lusty canyon
#

i cant seem to attach dummy cans Land_Can_V3_F to a rope but when you attach a darter B_UAV_01_F it works.
im assuming its a physics simulation thing, the can is a thingX so you cannot attach it while darter is vehicle that has simulation.

what is then the smallest physics enabled object i can attach to a rope?

little eagle
#

The UAV?

lusty canyon
#

anything smaller than the darter?

#

just for performance sake

still forum
#

performance sake? Smaller doesn't mean more performance

#

I think the fuel drums have physx

polar folio
#

as the parent or the child object? i remember people using the darter as parent for stuff like grappling hooks because it has to be an actual vehicle. the child just needs to be X i think. is why the can is used

peak plover
#

Ohh yeah. I've had an impact on frames from those

#

Also slows down other scritps

sand pivot
#

is there a command that returns a general object type. getObjectType object isn't what i'm looking for

indigo snow
#

typeOf gives the classname, if thats what you mean?

sand pivot
#

Nah, i mean more in general. whereobjectType object would return something like "Rifle", "Car", "Tank", "Missille", etc.

still forum
#

not really

#

what data do you want exactly? What are you trying to do

indigo snow
#

you can write a function that checks the more common types with isKindOf and some strategically chosen base classes

sand pivot
#

detect if a shot is a rocket or missile

#

i want to write an event handler to detect all fired rpgs and missiles since incomingMissile only works with AI

still forum
#

a rpg is not a rocket or a missle. It's a grenade.. technically

sand pivot
#

how would i drill up the base classes @indigo snow ?

still forum
#

ingame config viewer

sand pivot
#

but would iskindof detect inhereted classes? that might work...

still forum
#

That's exactly what it does

sand pivot
#

cool, that isn't ideal but it might works @still forum

little eagle
#
getText (configFile >> "CfgAmmo" >> typeOf _projectile >> "simulation") // "shotRocket", "shotMissile"
sand pivot
#

there it is. thanks @little eagle

little eagle
#

yw

hollow lantern
#

is there a simple solution to remove some bullets from a weapon? Instead of removing a magazine and add one with less ammo

indigo snow
#

fire it

hollow lantern
#

its AI controlled and the AI is dead after 10 seconds. I could but if there is a better way I would use that instead

indigo snow
#

if its only one magazine you could trick setAmmo into doing it for you I guess

little eagle
#
private _unit = player;
private _muzzle = currentMuzzle _unit;
private _ammo = _unit ammo _muzzle;

_ammo = _ammo - 1;

_unit setAmmo [_muzzle, _ammo];
hollow lantern
#

thanks commy2

tough abyss
#

Say I want to find a number of obscured positions in a certain radius from the player. Are there any commands I should be aware of?

still forum
#

findSafePos finds unobscured positions

tough abyss
#

Well there's that script figured out. Thanks @still forum.

#

Or not ๐Ÿคท

#

lineIntercects is probably better for this.

subtle ore
#

Why is that? Are you actually checking for enemies or certain objects?

tough abyss
#

Checking if the player cannot see the position.

#

I guess find positions using getSafePos and checking whether or not the player LOS' intercets with them.

#

Do the above in a loop.

#

Until I have enough positions.

subtle ore
#

That sounds very headache inducing and discrete. Why not just throw out the position if its not valid instead of just piling on more information?

winged narwhal
#

Dose anyone here know how to use User texture?

subtle ore
#

@winged narwhal do you mean the user texture object you can place? There is an attribute field for the path to your .paa or .jpg

winged narwhal
#

yes

#

Dose JPeg

#

work

subtle ore
#

Jpeg does work.

winged narwhal
#

okay so what do i need to do?

#

and can you join my group discord so it makes it easyier to talk?

subtle ore
#

Input your jpg path starting from your mission root in the attributes of the user texture

#

No you can pm me at the very most

winged narwhal
#

look at your pm

quasi rover
#
{ deleteVehicle _x } forEach allDead;

allDead includes destroyed house ?

quasi rover
#

thx

tough abyss
#

@Midnight#4592 that's what I meant.

tough abyss
#

When using lineIntersects do I have to use both objIgnore1 and 2?

little eagle
#

I think so, but you can put objNull there.

tough abyss
#

The game claims this is 2 elements if (lineIntersects [eyePos player, _aiPos, player]) exitWith {}; ๐Ÿคท

little eagle
#

Maybe _aiPos is Pos2D ?

tough abyss
#

It's [x, y], returned by BIS_fnc_findSafePos.

#

Yeah it's _aiPos ๐Ÿ˜›

little eagle
#

Wiki says it needs PosASL

#
_aiPos pushBack getTerrainHeightASL _aiPos;

somewhere

tough abyss
#

Thanks.

#

Lol.

#

The AI is spawing in mid-air.

indigo snow
#

Did you convert your coordinate systems properly?

tough abyss
#

As in...?

indigo snow
#

Mid air spawning could typically be a sign of using posASL when posATL should be used, for example

#

The difference in Z offset would give you a position in mid air

little eagle
#

createVehicle is PosAGL

#

I think

tough abyss
#

So I need to use a 3d position for lineIntercects, but a 2d one for BIS_fnc_spawnGroup?

little eagle
#

Just convert it with ASLToAGL

#

or cut the Z. Probably uses z=0 then

tough abyss
#

Biki claims Returns true if intersects with an object for lineIntecects.

#

What about positions, though?

indigo snow
#

Uh how would you intersect a position

tough abyss
#

if (lineIntersects [eyePos player, _aiPos, player]) exitWith {};?

vapid frigate
#

it's a line between the 2 positions

#

intersecting with an object

indigo snow
#

What do you mean? You feed it two positions and up to two objects to ignore. If theres any other object that intersects the line, it returns true

vapid frigate
#

you want the position of the intersection?

tough abyss
#

No, I need to find obscured positions.

#

Positions that the player cannot see.

#

Behind hills, buildings, etc.

vapid frigate
#

what you have looks right then

#

(not sure about hills?)

#

might need the terrainIntersects one too

tough abyss
#

Well it doesn't work, AI are spawning in positions visible to the player.

indigo snow
#

I think you want terrainIntersect too, then?

little eagle
tough abyss
#

So use that and check if the amount of intercections is more than 1?

vapid frigate
#

more than 0

#

ignoring player

little eagle
#

If you want a all in one solution for terrain and vehicles, and one that works with soldiers, then this is the command to use.

tough abyss
#

if (count (lineIntersectsSurfaces [eyePos player, _aiPos, player, objNull]) > 0) exitWith {};?

little eagle
#

Sure

tough abyss
#

Same result, just less AI spawning.

#

Here's the whole thing, maybe I'm doing something else wrong ```SQF
#include "script_component.hpp"

_spawnedGroups = [];
_codeTargetUnits = [];

// Group spawning loop
for [{_i = 0}, {_i <= 5}, {_i = _i + 1}] do {
// Select random pos
_aiPos = [player, GVAR(minDistance), GVAR(maxDistance), 0, 0, 0, 0, [], []] call BIS_fnc_findSafePos;

// Because lineIntercets needs ASL
_aiPos pushBack getTerrainHeightASL _aiPos;

// Check if the player sees the position
if (count (lineIntersectsSurfaces [eyePos player, _aiPos, player, objNull]) > 0) exitWith {};

// Convert _aiPos back to AGL
_aiPos = ASLToAGL _aiPos;

// Spawn defined groups
_dummyGroup = [_aiPos, GVAR(groupSide), GVAR(groupArray)] call BIS_fnc_spawnGroup;

// Move spawned group into array, for which code will be ran on each element
_spawnedGroups pushBack _dummyGroup;

};

// Apply code to spawned units
if (GVAR(unitCode) != "") then {
{
{
call compile GVAR(unitCode);
} forEach units _x;
} forEach _spawnedGroups;
};

little eagle
#

You do realize that once there is one intersection, the exitWith ends the for loop?

tough abyss
#

Yes.

#

I run it multiple times, though.

little eagle
#

If you have an intersection in the first iteration, it continues after the do-block.

#

No group will be spawned.

tough abyss
#

I know...

little eagle
#

Then what is the problem?

tough abyss
#

I run it using a button in dialog like 20 times.

little eagle
#

But what's the problem then?

tough abyss
#

AI is spawning in positions visible to the player.

peak plover
#

And you want them to only spawn in positions not visible?

tough abyss
#

Yes.

peak plover
#

Select a random position and then do a lineIntersect to player from that pos?

little eagle
#

Uhm, Invert the > logic?

#

You continue to spawn groups as long as there is 0 intersects between the player and the position.

#

So clear view.

tough abyss
#
[12:12 PM] Neviothr: So use that and check if the amount of intercections is more than 1?
[12:14 PM] Lecks: more than 0
[12:15 PM] Lecks: ignoring player
``` ๐Ÿคฆ
little eagle
#

Well, that is correct. No one knew what you're doing exactly.

tough abyss
#

I explained it multiple times...

peak plover
#

Explained it multiple times..., this however while being aware of all the facts and not revealing them

little eagle
#

You have to rework the script. Just inverting the logic will not be enough.

indigo snow
#

Never blame those who take time to help you

tough abyss
#

Guess I'm not clear enought.

indigo snow
#

They wont help you next time

little eagle
#

Assuming you want to spawn groups only behind obstructions.

tough abyss
#

@indigo snow I'm not blaming anyone.

peak plover
#

If you want someone to understand you have to give all facts of the subject you got about it. If we had the same exact information we would always come to the same conclusion

little eagle
#

Now you should have all the tools and just need to think about how to sort out the logic.

peak plover
#

for [{_i = 0}, {_i <= 5}, {_i = _i + 1}] this looks weird

vapid frigate
#

because sqf

peak plover
#

for "_i" from 0 to 1 step 1 do { is faster

vapid frigate
#

you don't need step 1

peak plover
#

yeah, exatly

vapid frigate
#

i prefer the first just because it's more familiar from other languages

peak plover
#

But you don't need for array unless you NEED it

#

If you need to do a code in there that does something more complex, it makes sense.

little eagle
#

Please don't ever do anything complex in those for ARRAY thingies.

tough abyss
#

Anyway, I'll ponder this some more later. Thanks guys.

peak plover
#

Ok, sounds very call of duty. ๐Ÿ˜„ Enemy spawning around the corner you just checked, good for tiny survival etc.

#

I always wondered if it was possible in arma, doesn't lineIntersect cost performance and would it work on server/hc?

vapid frigate
#

it's not perfect because it's just a line, but yeah it's not too inefficient

#

i wouldn't wanna do it every frame or anything

#

TPW Mods (civs/cars) has examples of it

#

to spawn civs out of view

#

it's single player though

peak plover
#

TPW mods has something else really cool that I'd need to do myself. It's got buidling interior script

#

Spawn interiors

vapid frigate
#

nice, didn't have that last time i used it

#

very cool script though.. pitty it doesn't support MP out of the box

peak plover
#

Yeah, very nice.

#

Also a something that I have on my todo list is ambient animals that are mp compatible. Now it's possible because default rabbits can be disabled

#

I don't think 10-30 rabbits synced over network would hurt, because usually there are 100s of units and 100s of projectiles which make the rabbits see smaller

grand berry
#

Would be nice to see the odd herd of goats or sheep too.

peak plover
#

Exactly

#

With a limit ofcourse, but that is something that's missing

#

The reason they have snakes and butterflies is to distract the player and this way everythign that moves is not a target. I guess script for that would be nice. But it's a little mission specific, so it's fine, but I feel like it should be a part of ambientLife by default

tough abyss
#

@little eagle what's so bad about for-do loops?

still forum
#

Commy never said anything about that

tough abyss
#
[12:43 PM] commy2: Please don't ever do anything complex in those for ARRAY thingies.
still forum
#

yes

#

for ARRAY

tough abyss
#

Yeah, these for [{_i = 0}, {_i <= 5}, {_i = _i + 1}] do {}.

little eagle
#

For-loops are fine, but don't use the ARRAY version to do some complex stuff in the first two code blocks. It will be unnecessarily difficult to read.

tough abyss
#
[12:48 PM] nigel: Ok, sounds very call of duty. :smile: Enemy spawning around the corner you just checked, good for tiny survival etc.
``` It's not really behind every cornor. The min and max distance can be edited on-the-fly.
little eagle
#

It's better than spawning them right in your face I guess.

tough abyss
#

What's withObj in lineIntersectsObjs?

#

systemChat format ["%1", count (lineIntersectsSurfaces [eyePos player, _aiPos, player, objNull])] outputs ```
0
0
0
1
0

#

I swear lineIntersectsSurfaces is broken.

#

Ok, going back a bit. if (count (lineIntersectsSurfaces [eyePos player, _aiPos, player, objNull]) < 0) exitWith {}; will exist the loop if _aiPos is right in front of the player, in the open, with no objs between the two, correct?

#
Array of intersections in format [[intersectPosASL, surfaceNormal, intersectObj, parentObject],...] where:
#

Wait... is [[]] an empty array? Or an array with 1 element...?

little eagle
#

[[]] is an array with one element

peak plover
#

๐Ÿ’ก

vague hull
#

some graphical work to do, but first results are working good:
on the fly weapon attachments changing
http://prntscr.com/g1fvhi

tough abyss
#

Wow that's really cool.

vague hull
#

same thing planned for pistols but the anim isnt done

tough abyss
#

how do you grab the position of the attachments?

vague hull
#

magic

tough abyss
#

i fiddeled with something similar years ago

#

used the inventory open anim ๐Ÿ˜„

vague hull
#

no ..but I took the hand memroy point and the weapon proxy to get a direction vector setup, the hand memeory was then used as an offset the rest is maths and world to screen

tough abyss
#

ok but you can't dynamically grab correct locations then

vague hull
#

I tryed that too but the weapon was just pointing to straight foroward

#

that is true. the only limitation

tough abyss
#

๐Ÿ‘

vague hull
#

but I have found some good offsets and factors to make that less obvious

tough abyss
#

you could read from configs senf_opticsPos[] = {x,y,z}; //offset from hand or weapon proxy
set up all vanilla weapons and document it for modders to add support for it

#

kek _ not working?

vague hull
#

sure thing

#

its currently just looking for wether the weapon is a sniper rifle to determine if the barrel is longer ^^

tough abyss
#

if you do so, keep in mind that for some weapond the UI could be pushed out of the screen

#

like sniper rifles

vague hull
#

what the longest rifle with barrelattachments?

tough abyss
#

No idea, but thinking of mods, any length can be possible

#

Does this exit the loop if there are no objs between the player and _aiPos? if !(lineIntersectsSurfaces [eyePos player, _aiPos, player, objNull] isEqualTo []) exitWith {};

vague hull
#

if it should stop when there are no objects, then remove the ! infront

#

because if the array is empty there are no objects (I assume that atleast)

tough abyss
#

I need it to stop if there are objects.

vague hull
#

then this should be correct if the command does that

tough abyss
#

Funny you saying that... ๐Ÿ˜„

vague hull
#

but this depends on which loop you are using I think

#

you could have it inside the loop condition anyways

tough abyss
#

I'm at a complete loss right now ๐Ÿคฆ

vague hull
#

@tough abyss this is a bit hacky now, but mayby I can do something with the icon positions of each slot

#

they all got their icon position to fit a miniature, I can probably adapt that relatively

tough abyss
#

Well, after over 6 hours of trying to figure this out. I think it's safe to say that it is, in fact, impossible.

vague hull
#

it it possible ^^

tough abyss
#

Than I'm too stupid to figure it out.

still forum
#

Well.. TFAR reliably detects surfaces between player and other players. So it's definetly not impossible ^^

tough abyss
#

@vague hull could be a intresting idea yea

#

do you intend to use it as pure UI and keep mouse input on the character so you can toggle trough the attachments with pressing the displayed number or do you want to take a way mouse from the character and use it as a button UI?

vague hull
#

it is planned to do this on the run, so better to just press buttons

tough abyss
#

๐Ÿ‘ i like that more aswell

vague hull
#

thats why I have it split up: select the attachmentslot and then the wanted attachment

#

so you need to use keys 1-4 which are in range of your normal movement

tough abyss
#

will this be part of a mod or standalone?

vague hull
#

its written all in a single file except the animation ofc, so I will probably release it standalone with some configs

tough abyss
#

cool!

#

btw keep in mind the magswitch

#

thats not in your screenshot

vague hull
#

yeah I already thought about something like that

#
  • that could be combined with the model switch on weapons that toadie has created
tough abyss
#

Yea

vague hull
#

is searching for memory lod possible on simple objects?
because I could try to create each weapon then and just look them up directly

tough abyss
#

@still forum no results for lineIntersectsSurfaces on TFAR.

dusk sage
#

Search is not enabled for non-default branches @tough abyss

tough abyss
#

Uh, that explains it.

#

@still forum what is _this inside that code?

still forum
#

Good catch though. Parameters is not listing that

tough abyss
#

Wait, so the begPos and endPos are both the player?

tough abyss
#

I to check intersects between a unit and a position.

#

Not a unit and a unit ๐Ÿ˜›

still forum
#

...

#

Dude

tough abyss
#

Unless eyePos _aiPos is somehow logical.

still forum
#

Are you serious?

tough abyss
#

I'm afraid to say yes.

tardy wagon
#

X Y problem?

tough abyss
#

As in?

still forum
#

What do you think eyePos returns? A Position? No.. Can't be.. Could you just replace that with your position? Noo way that's so easy.. It has to be hard.

tough abyss
#

That's what I did.

still forum
#

use DrawLine3D to draw a visual line to see what you are really doing

tough abyss
#

Ok.

#
onEachFrame {
drawLine3D [getPos player, _aiPos, [1, 1>
20:08:08   Error position: <drawLine3D [getPos player, _aiPos, [1, 1>
20:08:08   Error 0 elements provided, 3 expected
20:08:08 File NEV_Addons\addons\nev_debug_menu\functions\fnc_spawnGroup.sqf, line 17
20:08:08 Error in expression <rrainHeightASL _aiPos;
#

When you gotta debug the debug tools ๐Ÿ˜Ž๐Ÿ‘

still forum
#

Or you just look at the error message and immediatly see that someone hasn't understood how SQF works

#

undefined variable right in your second line of code

tough abyss
#

Usually it says "undefined variable", but ok.

indigo snow
#

Local variables dont carry over inseparate scopes like onEachFrame

#

Afaik

icy raft
#

Can you project stuff to the Skybox?

tough abyss
#

@still forum so you're telling that _aiPos is undefined?

still forum
#

No.. Well.. Besides.. I just said that..

#

@indigo snow wrong. They carry over to subscopes. But onEachFrame is not a subscope

indigo snow
#

yea thats how i meant it

tough abyss
#

How the hell can it be undefined?!

indigo snow
#

words are hard

still forum
#

Because it is undefined

indigo snow
#

its a separate scope

still forum
#

How can it not be?

indigo snow
#

it is like a normal event handler code block, its scope is independent of your current one

still forum
#

The code is being recompiled before every execution.
So at script start you have no local variables whatsoever

tough abyss
#
    _aiPos = [player, GVAR(minDistance), GVAR(maxDistance), 0, 0, 0, 0, [], []] call BIS_fnc_findSafePos;
    _aiPos pushBack getTerrainHeightASL _aiPos;
    if !(lineIntersectsSurfaces [eyePos player, _aiPos, player] isEqualTo [[]]) exitWith {};
``` It's *right there*.
still forum
#

That's not the code with the error..

#

The game complains that the variable is not here. And you argument with "But it's right over there in another castle completly unrelated to this one"

indigo snow
#

maybe the best non-correct way to explain it, is to say onEachFrame is like spawn

still forum
#

true

#

spawn creates a new script Instance so to say. onEachFrame does the same.. Except that onEachFrame deletes and recreates the instance every frame.

polar folio
#

just a side note: you can send params into the stacked EHs that are created with the BIS_fnc. it's probably common knowledge but i didn't know for the longest time because the wiki example doesn't use the parameter at all

tough abyss
#

I really don't understand how it can be undefined ```SQF
#include "script_component.hpp"

_spawnedGroups = [];
_codeTargetUnits = [];

// Group spawning loop
for "_i" from 0 to 100 step 1 do {
// Select random pos
_aiPos = [player, GVAR(minDistance), GVAR(maxDistance), 0, 0, 0, 0, [], []] call BIS_fnc_findSafePos;

// Because lineIntercets needs ASL
_aiPos pushBack getTerrainHeightASL _aiPos;

// Check if the player sees the position
if (count (lineIntersectsSurfaces [eyePos player, _aiPos, player, objNull]) < 0) exitWith {};

// Convert _aiPos back to AGL
_aiPos = ASLToAGL _aiPos;

// Spawn defined groups
_dummyGroup = [_aiPos, GVAR(groupSide), GVAR(groupArray)] call BIS_fnc_spawnGroup;

// Move spawned group into array, for which code will be ran on each element
_spawnedGroups pushBack _dummyGroup;

};

// Apply code to spawned units
if (GVAR(unitCode) != "") then {
{
{
call compile GVAR(unitCode);
} forEach units _x;
} forEach _spawnedGroups;
};

still forum
#

@polar folio That was recently completly broken in dev-branch. And I'm not sure if it was fully fixed yet

#

@tough abyss It is not.. That is a completly different part of the code

tough abyss
#

That is the whole thing.

still forum
#

You are like standing on your attic and wondering that your car isn't there while it's in the garage

polar folio
#

hm. i use it in very recent code i made so it should be fine on stable at least

#

either way. might aswell use setvar on player to be safe

still forum
#

@tough abyss The error was right after your onEachFrame

tough abyss
#

Forget about that, I removed it.

still forum
#

... wtf are you doing btw

#

    // Because lineIntercets needs ASL
    _aiPos pushBack getTerrainHeightASL _aiPos;

wtf?

polar folio
#

hm. in what case is the output of lineintersectsSurfaces < 0?

tough abyss
#

Commy told me to do that.

still forum
#

You know that lineInter.. typo.. needs ASL

#

It's correct

indigo snow
#

aiPos is pos2D at that point

still forum
#

But you need ASL.. You are doing absolute bullshit right there

#

no it's not

#

stop

indigo snow
#

it somehow was last night

#

array of size 2

polar folio
#

breath dedmen. he'll get there ๐Ÿ˜„

still forum
#

Okey

tough abyss
#

I doubt it @badbenson#0154. It's been like 8 hours.

polar folio
#

ok jsut give up then. problem solved ๐Ÿ˜„

indigo snow
#

just realize your local variables dont carry over into the onEachFrame

polar folio
#

still confused by < 0 though

still forum
#

Have you looked at what lineIntersectsSurfaces actually returns? Instead of blindly trying to get it to return nothing while not even knowing what's wrong?

indigo snow
#

that <0 part is pretty good haha

still forum
#

luul. yeah.. That's also total bullshit ๐Ÿ˜„

polar folio
#

do isEqualTo 0. makes more sense. unless i'm being dumb. didn't have much sleep

still forum
#

No it makes even less sense

#

lineIntersectsSurfaces [...] isEqualTo [] to check if it is empty

tough abyss
#

Already tried that ๐Ÿ˜›

still forum
#

yesterday the problem was that it never was empty. But for some reason no one even got the Idea to check what it actually returns

tough abyss
#

Will to again, for your sake.

polar folio
#

yea sure. but mine works too ๐Ÿ˜›

still forum
#

It's like you have 1+1=2 in your maths book and are wondering why it doesn't equal 3

indigo snow
#

the most common problem in here is that people dont debug

#

just post errors

polar folio
#

pretty sure it always returns an array. with stuff in it, if there are intersections

tough abyss
#

There are no errors @indigo snow.

#

It simply doesn't work as intended.

still forum
#

Well.. Besides that your script doesn't work as you want it to

#

which you could call an error

#

So please check what lineIntersectsSurfaces actually returns if it doesn't return []

indigo snow
#

which specific part doesnt work as intended?

#

at which line is it still ok, and at which line has it gone wrong?

#

we can see multiple issues but talking about the entire thing wont really help all that much

tough abyss
#

It stops to work at lineIntersectsSurfaces. If the player can see _aiPos, the loop doesn't stop.

indigo snow
#

and thats intended behaviour or?

tough abyss
#

No, it's the exact opposite.

polar folio
#

so go step by step then

#

what's up with _aipos. are you sure it's valid?

indigo snow
#

so the error is likely with the check for lineIntersectsSurfaces? whats the typical values for that look like?

polar folio
#

because if that safepos fnc returns a 3d postion, then the pushback in the next line is nonsense

tough abyss
#

@badbenson#0154 yes, I've diag_log it.

still forum
#

everything looks correct

tough abyss
#

safePos returns a 2d pos.

still forum
#

but apparently lineIntersectsSurfaces doesn't return an empty array. Which is why I'm saying to look what it returns

indigo snow
#

or does it return something when you wouldnt expect it to?

polar folio
#

it will return positions, if it intersects with terrain

tough abyss
#

Sec, testing atm.

polar folio
#

just the object part of the output will be null

#

so maybe try adding some height to the spawn position before the intersection test

#

to be sure it doesn't hit the terrain there

tough abyss
#

Some examples of what lineIntersectsSurfaces returns: ```SQF
20:42:30 "[[[3932.02,3905.93,5],[-0,-0,1],<NULL-object>,<NULL-object>]]"
20:42:30 "[]"
20:42:30 "[]"
20:42:30 "[[[4019.45,4088.6,5],[0,0,1],<NULL-object>,<NULL-object>]]"
20:42:30 "[[[3982.75,3763.27,5],[0,0,1],<NULL-object>,<NULL-object>]]"
20:42:30 "[[[4161.3,3861.66,5],[-0,-0,1],<NULL-object>,<NULL-object>]]"
20:42:30 "[[[3984.21,3718.16,5],[-0,-0,1],<NULL-object>,<NULL-object>]]"
20:42:30 "[]"
20:42:30 "[[[3862.99,4092.16,5],[-0,-0,1],<NULL-object>,<NULL-object>]]"
20:42:30 "[]"

still forum
#

yeah. It hit's the ground

polar folio
#

or alternatively count how many returns are not null in the object part

#

if there are any returns

indigo snow
#

thats a pretty wild occurance of -0 tho

#

dont see that all that often with sqf

tough abyss
#

It's surfaceNormal.

lusty canyon
#

can you use those surface normals as offsets like in attachto? or have to use worldToModel? i did a worldToModel test on an intersectPoint and its not accurate at all

indigo snow
#

no, normals are just a direction

#

specifically the direction the surface faces positively

still forum
#

A normal is literally the line that points away from a surface

lusty canyon
#

so you can use normals as bullet vectorDir like richochet effect?

indigo snow
#

if you make smart use of Snell's Law, yea

tough abyss
#

Note: I'm testing this on VR, not sure if that matters or not.

lusty canyon
#

i dont know any laws, im not a lawyer ๐Ÿ˜‰

polar folio
#

thinking about it you should lift the test pos up though rather than checking the output since terrain will block the players view too so you want the valid intersections considered

indigo snow
#

or demand a lineIntersectsSurfacesButNotTerrain ๐Ÿ˜›

polar folio
#

actually. i think you can do that

#

gotta use the longer syntax with specified LODS instead of using "NONE" put a lod there. or generally jsut read the wiki ๐Ÿ˜›

lusty canyon
#

cant you just do if _intersectArray select 2 not null then "you hit an object"

tough abyss
#

Terrain blocking the player's view is fine, it means hills will count as obstructions, allowing AI to spawn behind them.

polar folio
#

question is if the target position causes an intersection too

tough abyss
#

@badbenson#0154 endPosASL?

still forum
#

Nothing is at the target position. So what should intersect there?

polar folio
#

the ground. not sure if that is the case. either way. dedmen is right. we are all analysing the issue from directly out of our asses when you simply jsut need to debug it. there are some nice examples to do it visually too on the wiki page i think

still forum
#

yes. the ground. We already figured out that it hits the ground and intersects with it

polar folio
#

yes yes

still forum
#

Atleats I figured it out and said it. But seems like I was just ignored ^^

lusty canyon
#

if nev is good i have a general question about simulation vs render time scope:
when do you visual or not visual? (getpos vs getposvisual)

still forum
#

visual is more exact if you are close to it

polar folio
#

i'd also suggest using the max results parameter, could potentially make it less confusing to deal with

still forum
#

Use it if you are rendering an icon at that position for example

#

the non-visual pos might lag behind a bit

#

non-visual is not interpolated if that tells you something

lusty canyon
#

so then why bother with simulation if its laggy ? why not always use render time scope commands?

#

interpolated?

still forum
#

Dunno.. Guess they might be slower

polar folio
#

it means smoothed

#

so it's less jumpy

lusty canyon
#

ah ic, could it have a performance effect? like all render time scope commands take longer than simulation since its "stored" or something?

still forum
#

You only get position updates every few milliseconds. The interpolated position is predicting the movement and the current positon while you don't know the exact position

#

what do you mean by "simulation commands" ?

#

and "stored" stuff would logically be faster

lusty canyon
#

getPos (simulation based) getPosVisual (render)

still forum
#

try it out.. maybe getPosVisual is slower. if it's not there is no reason to use getPos

#

except on a Server that doesn't actually render anything. Don't know if the visual commands work there

lusty canyon
#

ah its a server thing too?

still forum
#

I don't know

#

I just know that the server doesn't render anything. So using a render thingy command would make sense without rendering

lusty canyon
#

this could be why my intersectPoint to worldtomodelvisual is not accurate since it tried to give my a predicted position but the engine was off?

still forum
#

maybe

lusty canyon
#

so lets say im trying to getPos of fast moving heli 500m away, should be visual then? but if its 3000m away and player has low drawdistance getposvisual would be null?

#

or has nothing to do with whats actually rendered on the players screen?

shadow sapphire
#

If I have a regearing script in my mission file, how can I most easily make editor placed units equip from that script? Just put something in their init fields or what?

indigo snow
#

yea or make a eden mod

shadow sapphire
#

No mods.

still forum
#

@lusty canyon try it out

lusty canyon
#

mkay, next question can i get the individual xyz of a memory point name? like _player "Pelvis" select 0 select 1 selct 2?

still forum
#

can you get the xyz in one array for a memory point?

lusty canyon
#

cuz the rope command only accepts either an mem name or offset i want to use a mem name but add like z + 1

indigo snow
#

i think youd need to attach a helper object then

lusty canyon
#

cant use hidden objects anymore since no physX

#

they just float in the air, rope is constantly rigid

still forum
#

hideObject? That disables physx?

lusty canyon
#

when i attach hidden objects like cans/darters to rope, rope is frozen like ice

#

but if its not hidden then works as normal

still forum
#

how do you hide them?

lusty canyon
#

hideobjectglobal

indigo snow
#

worst case you attachto, get the absolute offset. delete the helper object

lusty canyon
#

so like attach can to _player "pelvis" [0,0,1] (since i want pelvis + z + 1) then?

#

my biggest woe with arma is the damn model offsets, most of the time cant use memory names since my target could be any vehicle mod or vanilla. the trial and error getting the perfect offset location takes ages

#

can i make a model invisible like settexture = "";? or will that just leave me with a naked white model?

still forum
#

probably black

#

No. I think setObjectTexture with empty string just resets to default

lusty canyon
#

setModelAlpha = 0 would be great

still forum
#

you mean texture

#

That can be done with setObjectTexture

lusty canyon
#

if tex is transparent then i just end up with a black model?

still forum
#

just use a procedually generated texture that is transparent

#

no

lusty canyon
still forum
#

procedual texture..

subtle ore
#

Still has bounds. Materials dont affect collision

still forum
#

If you change the texture the physics don't change

#

You don't even change the material here

lusty canyon
#

im not a graphic guy, i dont know much about textures and models

still forum
#

I'm also not one

subtle ore
#

Still wouldn't make sense for it to affect the collision ๐Ÿคท

lusty canyon
#

i dont mind it still having collision

#

i need it to daisy chain ropes

still forum
#

Yeah.. Actually.. we never talked about collision.. You started that

subtle ore
#

Hey now Dedmen. It peaked my interest :)

lusty canyon
#

im trying to bypass the 100m rope length limit, i daisy chained visible darters and it works but then once you add anything to the very end of the chain it breaks so easily

subtle ore
#

You can disable rope breaking

lusty canyon
#

ex: _heli > rope > rig > rope > rig > rope > player

#

OHHHH HOW ? ive wanted to disable alot of rope properties

#

bypass length limit?

#

they have to be unsnappable and over 1000m

#

wiki doesnt have any commands to do it

subtle ore
#

I swear there was....

lusty canyon
#

your such a tease ๐Ÿ˜‰

subtle ore
#

Always! What's the fun in not being so? :P

#

Maybe return the rope and disable damage?

lusty canyon
#

hmm never thought of using that on ropes, ive always thought of them as special non-vehicle object

cobalt vine
#

why do you need 1000m+ ropes?

#

what for?

#

there is very likely a good reason ropes are limited to 100m

zenith edge
#

aren't rope physics pretty compute intensive

#

which scales with length

lusty canyon
#

spie ropes are known to go over 150m, and i want 1000m because..... because i wantz it!

zenith edge
#

I think most games try to avoid ropes for that

lusty canyon
#

yeah i tried reinforcing my daisy chain with 10 extra ropes on each chain, was great to watch but raped my fps

zenith edge
#

tbh, i dont think i even know where to start with trying to code rope physics....tons of tiny segments?

lusty canyon
#

didnt BIS just use third party physX?

#

bought the license, copy paste done! DLC TIME ๐Ÿ˜ƒ

zenith edge
#

mmmm the effects are prob local only then

#

pretend rope

#

doesn't act like real rope

lusty canyon
#

the ropes dont get tangled for instance

zenith edge
#

just a length attachment with like swivel

lusty canyon
#

cant make knots

#

would of loved to see a net launcher take down a heli

#

NATIVES VS NATO anyone?

#

the ropes do the job for slingloading but anything else you really gotta get hacky

zenith edge
#

afaik physx stuff is client only, so everthing else would be BI stuff

#

physx doesn't sync well

#

so you typically see it only use for effects

#

that don't need to by sync'd

lusty canyon
#

i didnt know that, hmm maybe they did make it from scratch? since if they had to do the locality stuff then might as well start from scratch

#

unless the vendor has network support

zenith edge
#

well the rope effect is prob physx

#

but both ropes don't need to look the same between clients

lusty canyon
#

ah true

zenith edge
#

the actual attachment stuff is prob BI code

#

the rope is just an effect that looks good

lusty canyon
#

so on someone else view rope can just be rigid?

zenith edge
#

well between 2 machines, side by side, same game, the rope may behave differently when it is loose

#

but the effect between the two attached objects would be the same

#

so one rope may form an S, and the other forms a different shape

lusty canyon
#

which then brings us to rope locality, there is no ropeGlobal commands so all must be global?

zenith edge
#

idk how it works ingame, but I was thinking rope length limitation is likely performance related ๐Ÿ˜ƒ

lusty canyon
#

i did lose around 10 fps with 30 ropes

little eagle
#

The joys of ropeX

lusty canyon
#

yeah fooling around with ropes is fun... in arma as well

zenith edge
#

yea, I think ropes aren't very common in games because they require a disproportionate amount of resources to do well

#

when they are taunt, they are easy

#

syncing complex math between machines(networked enviroment) is tricky

#

because different hardware can come up with slightly different answers

#

especially if you are relying on accelerators

#

like at what point is it rounding off numbers

#

or up, or down

#

in floats/decimals

#

I was curious and read up about it once, apparently networked physics tends to be wacky because of that

lusty canyon
#

if server client based, then would all the calc be done by server then just pass results to clients for them to render?

zenith edge
#

apparently you have to be super careful on the libraries you use and hope all the math functions operate the same on all machines

#

yea, but then you deal with latency issues

#

FPS games get hit hardest on FPS issues

lusty canyon
#

your saying given the same equation 2 machines can have different result?

zenith edge
#

yes, because the hardware

#

can implement the function very slightly differently

lusty canyon
#

you mean like a 0.00000000001 diff?

zenith edge
#

at large decimal lengths

#

yea

#

like one rounds off the number at .9999999999, and the other goes to .999999999999999

#

or something

lusty canyon
#

lucky then we live in intel dominance land, or manufacturer has nothing to do with it?

zenith edge
#

it does

#

like I said, accelerators too

#

SSE, etc

lusty canyon
#

surely at such precision, whatever difference it wont be tangible to the naked observer?

zenith edge
#

in physics it will slowly become more and more apparent

#

exponentially

#

because each computation is using the wrong answer

#

over and over

#

so you end up with desync

lusty canyon
#

so how do space agencies deal with it then? surely the simulator software they have is networked?

zenith edge
#

which also makes it hard to detect if it is hacking or just desync ๐Ÿ˜ƒ

#

in a controlled enviroment you can account for it

#

easily

#

use the same hardware, or just make sure your libraries account for it

#

but in the wild, across all computers

#

can still be done

#

but it is tricky, you have to know which libraries have the issues and which don't

#

I think related to the compiler translating to machine code

lusty canyon
#

use the same language and you have the same compiler?

#

javac to javac?

zenith edge
#

because the compiler translates your abstract code to machine code for that particular hardware

#

it is trying to optimize and make it run well

#

on that particular hardware

#

so if you tell it to, it will use SSE on CPU's that support it, if the code will benefit from it

lusty canyon
#

ah i get it now

zenith edge
#

so if you are really strict, you can get it all to do the same thing (ideally)

#

but you are taking away a lot of the optimizations

lusty canyon
#

so then why doesnt AMD have all the accels that intel does?

zenith edge
#

and I imagine if you are using mostly 3rd party libraries

#

it is really really tough to figure out

lusty canyon
#

i think for game physics optimization will always win out over accuracy

zenith edge
#

intel licenses their intellectual property, and AMD does too

#

lol

lusty canyon
#

had problems with virtualization, AMD ones suck balls, had to spend more on an intel chip just to vm

zenith edge
#

it can be purely compiler issues

#

lol

#

like with ryzen launch

lusty canyon
#

ryzen?

zenith edge
#

because the arch was so different on the new AMD CPU architecture programs were running abnormally slow on them

#

compilers weren't optimized for them afaik

#

yet

#

after updates, they are faster

lusty canyon
#

happens with intel too, they have to update else win10 BSOD loops

tough abyss
#

Ropes have physics? ๐Ÿ˜‚

zenith edge
#

the effect does

#

the local only effect, the actual attachment has got to be pure BI stuff

#

cuz like I said above, physx is local stuff afaik because syncing physics calculations can be goofy

lusty canyon
#

ropeCreate start leftHand end rightHand
then
STRANGLE SOMEONE WITH PHYSX!

zenith edge
#

so it is typically only used for special effects

#

like hair

#

๐Ÿ˜ƒ

#

things that noone will notice or care about if it isn't synced between machine

#

but still, your 1500m rope would prob crash the game

#

GL

lusty canyon
#

400m and engine was fine

zenith edge
#

itd only be clients locally that'd crash

lusty canyon
#

rope looked more like a flight of stairs tho

zenith edge
#

that are rendering it

#

hmm, unless physx does a really good job optimizing ropes at distances

#

by simplifying it

#

intensly

#

can't imagine the server itself would care much

#

gl gn, i get chatty when I'm tired

lusty canyon
#

no worries, at least the convo is educational

#

now i know why alot of language creators just hook stuff up to java c/vm, so they dont have to worry about compiler side

zenith edge
#

abstraction makes things shorter easier to write, but you rely more heavily on the compiler to make your terrible code work fast

lusty canyon
#

the accuracy problem is definitely a maufacturer issue, amd and intel are the only ones in the game now, all their shit should compute the same

zenith edge
#

standards issue

lusty canyon
#

everything should be abstracted away nothing is your responsibility just imagine it and the cpu will do it for you

zenith edge
#

if we all wanted fast optimized code, we'd have people write machine code. You'd just hvae to have a ton of different versions for each CPU line

lusty canyon
#

let assembler die already

zenith edge
#

languages that use intermediate languages are one farther step away than c++

#

like java/c# ๐Ÿ˜ฆ

#

the farther away, the less control

lusty canyon
#

but easier to write

zenith edge
#

and the less you know what it is doing

lusty canyon
#

i like c sharp syntax so much sugar

zenith edge
#

c# is lovely

#

you just have to deal with a lot of quirky things you have less control of

lusty canyon
#

but just because its microsoft ppl bash it and use old java instead

zenith edge
#

if you dive into optimizing

#

afaik c# is better than java, faster and better designed

lusty canyon
#

agree totally, oracle dropped the ball with java, c sharp is java FIXED

zenith edge
#

people hate on it because it realies on .NET libraries for everything

lusty canyon
#

you have dot core now

#

dont need full framework

#

they should of done it decades ago

zenith edge
#

its still nowhere near as fast as c/c++

#

but faster than java

lusty canyon
#

ofc, always something sacrificed

zenith edge
#

and c/c++ nowhere near as fast as well written assembly

#

๐Ÿ˜ƒ

#

abstraction comes at the cost of control, and control can be used to optimize to hell and back

#

which is why nasa was able to make it to the moon

lusty canyon
#

do ppl still have to write assembler? like hardware ppl?

zenith edge
#

on something as powerful as a watch

#

yes

#

there are mission critical, time sensitive hardware

#

in industrial use

#

etc

#

where you need ultimate control/optimization

#

stuff like that pays super well too because noone wants to code in it anymore ๐Ÿ˜ƒ

#

harder than sqf even

#

๐Ÿ˜ƒ

lusty canyon
#

surely a layer up from assembler can be used instead

#

isnt c++ close enough to meteal

zenith edge
#

it depends

#

some can, some cannot

dusk sage
#

@zenith edge You make a lot of assumptions about speed

lusty canyon
#

some banks are still using COBOL

dusk sage
#

It's purely dependent on what you're doing

zenith edge
#

my company uses cobol

#

yea

#

its hard to say definitively on a lot of this stuff

#

so I like to just use my opinion

lusty canyon
#

plz switch to F#

zenith edge
#

because its more fun

lusty canyon
#

your doing financial code?

zenith edge
#

my companies backend was well made in like the 80's

dusk sage
#

and c/c++ nowhere near as fast as well written assembly

#

That depends if you're better than the compiler

#

Which I'm going to say 99.99% of people aren't

zenith edge
#

and I doubt the code has been touched much in past 20 years

#

yea, that is why i said well written

#

most people prob can't write better than compiler

#

you'd have to know it inside and out

#

i certainly couldn't

#

I'll stick to my high level languages

#

but even with a good compiler, it can't do magic

#

you sacrifice knowing how the processors are working for the ability to program complex code via very simple easy language

#

which means you will likely be less efficient than if you knew exactly how the processor worked and coded towards it

lusty canyon
#

so the ppl that do stuff like hardware controllers for ssd/ram whats inside that?

zenith edge
#

someone has to write the compilers

#

and save us all

lusty canyon
#

firmware stuff like bios cmos ?

rancid ruin
#

javascript

lusty canyon
#

cant be

zenith edge
#

lol javascript

rancid ruin
#

i wouldn't lie

lusty canyon
#

seriously dont bring up javascript, ive had enough of all the traction trendy shit from the teenagers like angular this react that, fucking kids stop making an old man learn more languages that arent truly object oriented

zenith edge
#

ahh, an oo follower

#

one of us one of us

#

the cultism of programming languages

#

is funny

lusty canyon
#

its funny how they say "yes in version x its OO now just add framework X Y Z plus get a fork of A B C then your all good"

rancid ruin
#

old man
getting upset over a programming language

zenith edge
#

lol

rancid ruin
#

have you met x39?

#

you'd like him

lusty canyon
#

1000 hours later setting up your dev env now u can hello world

#

x39? who?

#

im not in the know about arma superstars, been playing since arma 2 but not only started modding arma3 like a year ago

#

the problem isnt the language really its all the social shit SLACK JIRA TRACKIT etc its not collaboration when your all just jacking off one another

little eagle
#

X39 is a Arma superstar

lusty canyon
#

bis dev? or modder?

sand pivot
#

Sorry to interrupt, but i'm going to... I have an Event Handler Question. I have a module that defines an event handler
{ _x addEventHandler ["FiredMan", {[_this,_objects] spawn tag_fnc_FUNCTION}]; } forEach allUnits;
However the passed variable _object doesn't exist in the missionNamespace because it is local to the module function. Does anyone know of a workaround other than declaring a public variable?

lusty canyon
#

sorry we went OT for a bit

still forum
#
{
  _x addEventHandler ["FiredMan", {[_this,_objects] spawn tag_fnc_FUNCTION}];
} forEach allUnits;
lusty canyon
#

i have questions too but forgot them, i blame you dd!

still forum
#

where does _objects come from? that is undefined

sand pivot
#

it is passed to the module function

still forum
#

you can try BIS_fnc_addStackedEventhandler

#

you can use that to pass parameters along

#

Well.. no

#

I guess that doesn't work for normal eventhandlers ^^

sand pivot
#

it is the _units parameter

little eagle
#

_objects is undefined. Local variables don't carry over to the eventhandler script scope.

sand pivot
#

so what you think? suck it up and make variable public?

#

er, global.

lusty canyon
#

always get vars from the _this select 0

#

i want to pass stuff to event too

still forum
#

Yes

#

No

sand pivot
#

yes, no, maybe so? which one? ๐Ÿ˜‰

still forum
#

yes use a global variable

#

No you can't use _this select 0 to get access to arbitrary variables that you want inside the EH. That is not applicable here

lusty canyon
#

i use mission namespace but maybe i shouldnt

little eagle
#
[_x, "firedMan", {
    [_this, _thisArgs] spawn tag_fnc_FUNCTION;
}, _objects] call CBA_fnc_addBISEventHandler;

This works with CBA. Otherwise global variable I guess.

sand pivot
#

i'll dive into that CBA EH and if that doesn't work, global it is. thanks all.

#

sidenote, what is the syntax you're using for syntax highlighting @little eagle ?

lusty canyon
#

im getting a stop using Fired EH use FiredBIS instead in rpt, is that a cba thing?

little eagle
#

```sqf

```

#

Is what I use.

sand pivot
#

neat

little eagle
#

@lusty canyon Yes, but unless you used a config XEH fired eventhandler yourself, it's probably another mod and I wouldn't worry about it.

#

cpp instead of sqf for config.

dusk sage
#
the problem isnt the language really its all the social shit SLACK JIRA TRACKIT etc its not collaboration when your all just jacking off one another

You saying BI jack off one another ๐Ÿ™ƒ ?

rancid ruin
#

jira is social?

little eagle
#

Where did that come from?

lusty canyon
#

i just like to call everyone social whores

#

ignore my rants when necessary

dusk sage
#

BI use Jira

little eagle
#

I approve of ranting and name-calling everyone around you.

lusty canyon
#

i need to vent from time to time, the world sucks when your not drunk

tough abyss
#

I mean... If you're in a group in which everyone is jacking each other off, you're collaborating.

little eagle
#

I like you already, jay.

dusk sage
#

Jacking off while making money? Neat

rancid ruin
#

he will evolve in to x39+1

tough abyss
#

Wow, the Commy badge of approval? What an honor!

lusty canyon
#

some times i just want to be left alone and code shit, no scrum shit no meetings no user story this feeling inside you?

still forum
#

I'd love to have JIRA at work.. We only have Redmine and are using SVN. No Code review no workflow.. nuthin

lusty canyon
#

dont knock SVN, its for real men!

rancid ruin
#

AGILE standups are designed to shame you in front of your other team members

lusty canyon
#

no hair no SVN for you

still forum
#

I only started Monday and was already assigned to take care to transfer everything to git. They just waited for someone that knows how to do it

lusty canyon
#

dont get me started on agiled gits ( those are the under 20's javascript worshippers)

rancid ruin
#

really though, what's with the javascript beef

#

why even care

tough abyss
#

Only 20 and already on such horrible drugs...

lusty canyon
#

i have lots of beef left with other languages but will keep it festering inside for a while longer, sorry to OT alot

little eagle
#

You will love SQF

lusty canyon
#

oh no dont get me wrong, i love SQF for some reason, i cant put it down

tough abyss
#

Note if you start to love SQF seek medical attention dont wait

lusty canyon
#

all my free time is now dedicated to SQF

#

conventional medicine cannot save me now

rancid ruin
#

seek help

#

maybe a mercy killing

tough abyss
#

Is there an SQF prevention hotline?

little eagle
#

There is no going back now.

lusty canyon
#

we must take SQF outside arma and supplant all other languages with it! one ring to rule them all

tough abyss
#

Glances at monitor
Sees lineIntersectsSurfaces wiki page open
Curls into a ball
Cries to sleep

little eagle
#

What are you? A baby?

tough abyss
#

Yes ๐Ÿšผ

little eagle
#
particleSource setParticleParams
[
    [
        particleShape,
        particleFSNtieth,
        particleFSIndex,
        particleFSFrameCount,
        particleFSLoop
    ],
    animationName,
    particleType,
    timerPeriod,
    lifeTime,
    position,
    moveVelocity,
    rotationVelocity,
    weight,
    volume,
    rubbing,
    size,
    color,
    animationSpeed,
    randomDirectionPeriod,
    randomDirectionIntensity,
    onTimerScript,
    beforeDestroyScript,
    this,
    angle,
    onSurface,
    bounceOnSurface,
    emissiveColor
];
#

This is something semi difficult. Not lineIntersectsSurfaces

brazen sparrow
#

why is the function sig in sqf arg1 funcname arg2-n

rancid ruin
#

particleFSNtieth wat is dis

tough abyss
#

It's the devil.

still forum
#

@brazen sparrow What do you mean by -n

#

And.. Because it is..

#

It's a normal binary operator

lusty canyon
#

i read that as "not negative"

brazen sparrow
#

arg2-n as in an array with arg 2 to arg n

#

any number of args

little eagle
#

You can also have arrays on the left side.

#

It's really just
arg1 command arg2

still forum
#

function signature in Arma is actually
nular
unary arg1
arg1 binary arg2

brazen sparrow
#

ye but why is it like that

little eagle
#

Just like every math or logic operator

still forum
#

arg2 sometimes being an array is unrelated to that

#

exactly

#

What else would you want?

brazen sparrow
#

most languages are func(arg0, arg1, argN)

still forum
#

That's a little harder to parse I guess

brazen sparrow
#

even sqf defined funcs are [args, args] call func

lusty canyon
#

been wondering how bis does the method overloading

still forum
#

@brazen sparrow That is also arg1 call arg2

#

what method overloading?

brazen sparrow
#

ye i guess so

little eagle
#

p v ยฌp

lusty canyon
#

the optional params, must be signature overloading right?

still forum
#

what optional params?

#

example please

rancid ruin
#

you lot were saying [arg,arg] call func is still only 1 argument the other day

little eagle
#

has been a binary operator since Aristotle

still forum
little eagle
#

@rancid ruin As far as the call is concerned, the array is one argument.

#

For the function it's two.

#

Context, buddy.

rancid ruin
#

contextualise deez nuts

lusty canyon
still forum
#

That is just an array

#

An array is just one argument

#

so arg1 attachTo arg2 nothing changes if you remove offset and memName

lusty canyon
#

right just realized all optionals are inside array arg

#

they just deal with it inside the single func

#

hah must be getting tired, 6am here

still forum
#

I like it when people ask deep questions about the engine and I know the answers :3

lusty canyon
#

now i want to ask a deep question that will stump you

little eagle
#

I am always here to nitpick your answers.

#

@still forum Dialetheism is the view that true contradictions exist. Please disprove Dialetheism.

still forum
#

googles Dialetheism

tough abyss
#

Sounds like a paradox.

little eagle
#

Maybe, but that doesn't mean it's not true (exists).

lusty canyon
#

when two Dialethists meet time will collapse on itself

tough abyss
#

About time.

lusty canyon
#

commy just trapped dedmen into an alternate universe, anyone that googles Dialetheism becomes a truly contradictory being, which cannot exist in our world. (hence why dedmen is no longer in discord chat)

tough abyss
#

A ceremony will be held tomorrow.

#

Hello, is the animate command local? if so how can I make it work globally with targets?
t1 animate["terc", 0];

indigo snow
little eagle
#

I think I fried dedmen's brain.

lusty canyon
#

i couldnt resist not googling Dialetheism, now I am a pure Dialethist. All my SQF code is now written like this


if ( (_num > 1) && (_num < 1) ) then 
{
    enableSimulation = true and false;
};

i am now im constant conflict and agreement will all statements. soon i will be joining dedmen in existing in non-existance.

little eagle
#

Just because some true contradictions exist, doesn't mean that everything is a contradiction.

frosty cave
#

reminds me of schroedingers cat

rancid ruin
#

what if num == 1

#

what then

cold pebble
#

It explodes

lusty canyon
#

enough clowning around i got a real non Dialetheism question!


            _start = diag_tickTime;
            _runTime = (_targetDistance / 3);
            waitUntil 
            {
                if ( (diag_tickTime - _start) > _runTime ) exitWith {true};
                if (isNull _player) exitWith {true};
                if (isNull _heli) exitWith {true};
                ((_player distance _heli) <= 4);
            };

i want to make sure my loop exits after a period of time if distance never met. is diag_tickTime enough?

oh right i missed 1, should of just did _num != 1 && _num == 1
im still a new Dialethist. please forgive and scorn me

little eagle
#

As long as you don't care about savegames, tick time should be enough.

#

Otherwise it can break in savegames...

lusty canyon
#

locality issues with diag_tickTime? sp mp ded

little eagle
#

tick time is different on every machine, so don't do any sync stuff that relies on the tick time

lusty canyon
#

i want it to work even when SP player has screen frozen with ESC

#

ah right all local stuff only for entire loop

little eagle
#

Yeah, tick time is not scaled by time acceleration or stopped by pausing.

lusty canyon
#

i could just use a simple counter, but SQF is supposed to be complicated and simple!

#

or how to get the format of a pos? so i can then do AGLtoASL ATLtoASL?

little eagle
#

By Pos3D they very likely mean PosAGL.

#

So AGLToASL

lusty canyon
#

ok ill test it out

still forum
#

I don't understand world anymore

tough abyss
#

๐Ÿ˜‚ ^^

lusty canyon
#

dedmen your back? how was the other side?

still forum
#

other side? Isn't that this side?

lusty canyon
#

yes another other side at the same time

#

please enlighten us on your Dialethist conversion

peak plover
#

Smoothg sliding dialog?
It will smoothly slide out from a 5x1 (gui_grid) to full screen.
Can this be done in any other way than ctrlSetPosition?

#

Is it possible to attach some controls to others?

warm spade
#

Does anyone know why units created with CreateUnit will always turn in direction 0 (at least in my missions)?
For example i set an Units direction to 90. As soon as the unit spawns the Unit will turn to direction 0.

#

Relevant code

#
_unit = group BanditGroup CreateUnit ["I_Survivor_F", position _pos, [], 0, "NONE"];
[_unit] join grpNULL;

_unit attachto [_pos, [0,0,0]];
detach _unit;
_unit setdir (random 360);
shadow sapphire
#

Does anyone @here know if the destroyed buildings on Altis/Stratis have class names that can be leveraged? I am trying to figure out if I can write a script that replaces all of the damaged and destroyed buildings with non destroyed versions and delete all of the trash and vehicle wrecks from the map.

#

Is Land_House_Big_01_V1_ruins_F the only classname for that destroyed building or are there different class names based on how much or what part of the building is destroyed?

little eagle
#

I think buildings are partially destructible, but when it's dead, it's replaced by the one ruin class.

jade abyss
#

yep

#

Complete replace.

shadow sapphire
#

Interesting... so the destroyed buildings on the map would just have the same classname as the version from the Eden editor?

jade abyss
#

Undamaged model -> Deleted -> Damaged model spawned in (simply spoken)

shadow sapphire
#

Right. I get that.

little eagle
#

Dunno about the classname, but why would that matter?

shadow sapphire
#

@little eagle... it matters because I'm trying to see if it's possible to write a script that finds and delets all of the damaged buildings on a map and replaces them with non destroyed versions.

little eagle
#
alive _building

?

shadow sapphire
#

Interesting take on this problem. Can I get a link to see how that would work?

#

Like, how would that know that it's a large house that was destroyed and to place a large house in that spot, instead of just deleting everything?

little eagle
#

I personally suspect that the classname stays and only the model is replaced. And those ruin classes are for already collapsed buildings.

shadow sapphire
#

I hope that's the case, but do you know if the map objects are named with those same classed, by chance?

#

At present, I've been placing gamelogics all over the map to clean it up, and manually placing replacement buildings anywhere I delete shit.

little eagle
#

No idea.

#

Depends on the assets I guess. It might be completely different on a CUP map.

shadow sapphire
#

I'm only using vanilla maps, so no stress there.

#

Ugh, I wonder why BIS place SO many destroyed buildings by default. They could have totally destroyed shit that was already placed much easier than it is for us to have to go through and clean it all up if we DON'T want the map already destroyed and filthy at the start of a campaign.

#

You can see what I'm trying to do here, but I'm tired of manually deleting and replacing buildings and fences and stuff all over the map. Map's pretty big and there are lots of buildings to look over and fix, ya know? Trying to automate.

warm spade
#

Alright i wrote a small script to replace every shop (Land_u_Shop_02_V1_F) with a new one (Land_I_Shop_02_V1_F) it's just an example on how you can solve the problem i also would recommend to use a switch instead of dozens of if statements

#

'''
_house = nearestObjects [player, ["house"], 2000];

{
if (typeof _x == "Land_u_Shop_02_V1_F") then {

    _dir = getdir _x;
    hideobject _x;
    _h = createvehicle ["Land_I_Shop_02_V1_F", position _x, [], 0, "NONE"];
    _h attachto [_x,[0,0,0]];
    detach _h;
    _h setdir _dir;
    deletevehicle _x;

};

} foreach _house;
'''

rancid ruin
#

should probably use hideObjectGlobal or whatever it is too

#

and is there any benefit in attachTo'ing instead of just setPos'ing?

warm spade
#

i used attachto to get the exact position i dont know if setPos does it too

#

nvm works to same result

#

reworked version:

#

_Center = _this select 0;
_distance = _this select 1;

_house = nearestObjects [_Center, ["house"], _distance];

{

switch (typeof _x) do {

    case "Land_u_Shop_02_V1_F": {
    
        _dir = getdir _x;
        HideObjectGlobal _x;
        _h = createvehicle ["Land_I_Shop_02_V1_F", position _x, [], 0, "NONE"];
        _h setPos position _x;
        _h setdir _dir;
        deletevehicle _x;
    
    };

};

} foreach _house;

shadow sapphire
#

@warm spade, you're a friggin hero!!

#

However, now I need to figure out the class names for these damaged, yet not destroyed map objects. Anyone know of a way to do that?

rancid ruin
#

i think that u in the classname means the building is a ruin maybe

#

or it's defined in the config

warm spade
#

you could run around and do copyToClipboard ["%1", typeOf cursorTarget] on every damaged building , would be some work

shadow sapphire
#

@warm spade, that's a great idea! There are only a few types of damaged buildings on the map and there are a couple of cities that contain most types.

warm spade
shadow sapphire
#

Seems to have what we need. Fingers crossed. I'll report back when I try it.

#

Thanks so friggin much!

warm spade
#

no problem, have fun!

shadow sapphire
#

@warm spade, Thanks. Cept when I tried running the script, I got error, zero divisor. I ran this from the debug just to get a quick test:

_distance = _this select 1;


_house = nearestObjects [_Center, ["house"], _distance];

{

    switch (typeof _x) do {

        case "Land_d_House_Big_01_V1_F": {

            _dir = getdir _x;
            HideObjectGlobal _x;
            _h = createvehicle ["Land_i_House_Big_01_b_white_F", position _x, [], 0, "NONE"];
            _h setPos position _x;
            _h setdir _dir;
            deletevehicle _x;

        };

    };

} foreach _house;```
#

Is that an inappropriate way to run it?

warm spade
#

yes, you need to give _center and _distance a variable to work with. it was meant to be an .sqf file. Save is as HouseReplacer.sqf in your mission folder, and run it with [player, 2000] execVM "HouseReplacer.sqf"; or you just remove _Center = _this select 0; _distance = _this select 1; and replacer _Center with player and _distance with 2000

#

```_house = nearestObjects [`player, ["house"], 2000];

{

switch (typeof _x) do {

    case "Land_d_House_Big_01_V1_F": {

        _dir = getdir _x;
        HideObjectGlobal _x;
        _h = createvehicle ["Land_i_House_Big_01_b_white_F", position _x, [], 0, "NONE"];
        _h setPos position _x;
        _h setdir _dir;
        deletevehicle _x;

    };

};

} foreach _house;```

shadow sapphire
#

Okay! Sorry for the trouble.

warm spade
#

{

    switch (typeof _x) do {

        case "Land_d_House_Big_01_V1_F": {

            _dir = getdir _x;
            HideObjectGlobal _x;
            _h = createvehicle ["Land_i_House_Big_01_b_white_F", position _x, [], 0, "NONE"];
            _h setPos position _x;
            _h setdir _dir;
            deletevehicle _x;

        };

    };

} foreach _house;``` *
shadow sapphire
#

Would there be a version that runs the script for the entire map on mission init?

#

Wow! It worked like a friggin charm!!

warm spade
#

yes, just place an object in the middle of the map (i always use an empty helipad) and call it Center, and instead of 2000 you enter 10000 This will check for everyobject in reach of 10000 meters around the object "Center";

#

But this will take some performance until its done

shadow sapphire
#

Okay! Simple enough!

#

@warm spade, I hate to be a bother, but how would we add the appropriate height to this script?

#

Since many of the ruins are on hills, their centers are above ground, so when the ruins are replaces, the new buildings are sunken into the ground.

warm spade
#

{

    switch (typeof _x) do {

        case "Land_d_House_Big_01_V1_F": {

            _dir = getdir _x;
            HideObjectGlobal _x;
            _h = createvehicle ["Land_i_House_Big_01_b_white_F", position _x, [], 0, "NONE"];
            _h attachto [_x,[0,0,0]];
      detach _h;
            _h setdir _dir;
            deletevehicle _x;

        };

    };

} foreach _house;```  i changed ```    _h setPos position _x;```  with ``` _h attachto [_x,[0,0,0]];
      detach _h; ``` this should solve it...hopefully
shadow sapphire
#

That seems to have done it!:


{

    switch (typeof _x) do {

        case "Land_d_House_Big_01_V1_F": {

            _dir = getdir _x;
            HideObjectGlobal _x;
            _h = createvehicle [(selectRandom ["Land_i_House_Big_01_b_blue_F","Land_i_House_Big_01_b_pink_F","Land_i_House_Big_01_b_whiteblue_F","Land_i_House_Big_01_b_white_F","Land_i_House_Big_01_b_yellow_F","Land_i_House_Big_01_b_brown_F"]), position _x, [], 0, "NONE"];
            _h attachto [_x,[0,0,0]];
            detach _h;
            _h setdir _dir;
            deletevehicle _x;

        };

        case "Land_u_House_Big_01_V1_F": {

            _dir = getdir _x;
            HideObjectGlobal _x;
            _h = createvehicle [(selectRandom ["Land_i_House_Big_01_b_blue_F","Land_i_House_Big_01_b_pink_F","Land_i_House_Big_01_b_whiteblue_F","Land_i_House_Big_01_b_white_F","Land_i_House_Big_01_b_yellow_F","Land_i_House_Big_01_b_brown_F"]), position _x, [], 0, "NONE"];
            _h attachto [_x,[0,0,0]];
            detach _h;
            _h setdir _dir;
            deletevehicle _x;

        };

    };

} foreach _house;```
#

Is what I'm working with now. I'll add in every object with which this works and just keep going.Thanks so much for the template!

warm spade
#

Happy to help ๐Ÿ˜ƒ

shadow sapphire
#

Haha, hahaha, I don't think I quite understand selectrandom's syntax. The way I have it set up, the houses are all the same color, it's just random what color ALL of the houses will end up.

#

It's probably better for me to not randomize the color at present, anyway.

#

Shit. I'm wrong. It's working.

warm spade
#

haha am i'm sitting here and wonder if i all the time misunderstood foreach

#

and* not am

shadow sapphire
#

Haha, nope, it was just happenstance that the buildings were the same colors a couple of test cycles.

shadow sapphire
#

Does anyone know how to get this script to run from a trigger without using global variables? ```_G1 = [(getPos thisTrigger), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_GL_F","I_Soldier_M_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G2 = [(getPos thisTrigger), INDEPENDENT, ["I_officer_F","I_soldier_UAV_F","I_Soldier_TL_F","I_Soldier_GL_F","I_Soldier_LAT_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
_G3 = [(getPos thisTrigger), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_GL_F","I_soldier_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;

{
{
_x execVM "Gear\FN_CentralGreen.sqf";
_x setBehaviour "SAFE";
} forEach units _x;
} forEach [_G1,_G2,_G3];

[_G1, getPos leader _G1, 3000] call BIS_fnc_taskPatrol;
Sleep 45;
_G2 copyWaypoints _G1;
Sleep 45;
_G3 copyWaypoints _G1;```

subtle ore
#

private

shadow sapphire
#

Private?? Thanks!

#

How would I define my private variables in this case, @subtle ore?

little eagle
#
private _G1 = [(getPos thisTrigger), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_GL_F","I_Soldier_M_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
private _G2 = [(getPos thisTrigger), INDEPENDENT, ["I_officer_F","I_soldier_UAV_F","I_Soldier_TL_F","I_Soldier_GL_F","I_Soldier_LAT_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;
private _G3 = [(getPos thisTrigger), INDEPENDENT, ["I_Soldier_SL_F","I_Soldier_GL_F","I_soldier_F","I_Soldier_AR_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
Sleep 1;

???

peak plover
#

Smoothg sliding dialog?
It will smoothly slide out from a 5x1 (gui_grid) to full screen.
Can this be done in any other way than ctrlSetPosition?
Is it possible to attach some controls to others?

little eagle
#

Have you check ctrlCommit?

peak plover
#

I've not tried it, but I guess there is no other way?
Would it be possible to attach a control to another?

little eagle
#

You can make control groups and move those, which will move all sub controls too.

#

Except for maps

tough abyss
#

Pretty sure I got yesterday's script to work ```SQF
#include "script_component.hpp"

_spawnedGroups = [];
_codeTargetUnits = [];

// Group spawning loop
for "_i" from 0 to 50 step 1 do {
// Select random pos
_aiPos = [player, GVAR(minDistance), GVAR(maxDistance), 0, 0, 0, 0, [], []] call BIS_fnc_findSafePos;

// Because lineIntercets needs ASL
_aiPos pushBack getTerrainHeightASL _aiPos;

// Check if the player sees the position
_intersections = lineIntersectsSurfaces [eyePos player, _aiPos vectorAdd [0, 0, 0.1], player, objNull];

// Convert AGL
_aiPos = ASLToAGL _aiPos;

// Spawn defined groups if there are intersections
if !(_intersections isEqualTo []) then {
    _dummyGroup = [_aiPos, GVAR(groupSide), GVAR(groupArray)] call BIS_fnc_spawnGroup;

    // Move spawned group into array, for which code will be ran on each element
    _spawnedGroups pushBack _dummyGroup;
};

};

// Apply code to spawned units
if (GVAR(unitCode) != "") then {
{
{
call compile GVAR(unitCode);
} forEach units _x;
} forEach _spawnedGroups;
};

#

Does anyboy know how high a unit is?

#

Alright, vectorAdd [0, 0, 1.85] seems to do it.

#

Can I detect semi-transparant objects like bushes or windows with lineIntersectsSurfaces as well?

regal geyser
#
BIS_startingPos setMarkerPos (BIS_spawn getMarkerPos select floor random count BIS_spawn);

what is wrong with this? It keeps giving me a generic expression error. BIS_spawn is an array I've defined.

mortal halo
#

Hello, quick question

#

using the 'params' command

#

does expecteddatatype and defaultvalue datatype must match?