#arma3_scripting

1 messages ยท Page 237 of 1

wispy cosmos
#

thanks, will try this out!

#

FYI, this is a snippet of my current code:

#

_splatter setDir (random 360);
_splatter setPosASL (_surfacePosition vectorAdd (_surfaceNormal vectorMultiply (0.02 + (random 0.01)))); //Place splatter slightly offset from surface to prevent Z-Fighting.
_splatter setVectorUp _surfaceNormal;

#

and of course, the setDir is reset upon setting vectorUp

wispy cosmos
#

it works!

#

thanks a ton NetFusion -- I'll be sure to credit you on the forums!

#

and in the code ๐Ÿ˜ƒ

#

Been pulling my hair out trying to think out the trig behind this

wispy cosmos
#

almost worked -- had to modify your solution a bit. Here's what I came up with:

_splatter setVectorDirAndUp [[sin _angle, 0, cos _angle] vectorCrossProduct _surfaceNormal, _surfaceNormal];

#

thanks again

carmine galleon
#

Hey guys, trying to make a little script to make ambient aerial combats. Created 2 groups, 1 with 3 blufor F/A18 and 1 with 3 opfor SU25 spawning above water, and then having random waypoints on map. Problem is that they cross but do not engage. Here is how I make waypoints ;
_wp = USGrp addWaypoint [_cord1, 200];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "COMBAT";
_wp setWaypointSpeed "FULL";

I think it coulb be because of the waypoing type "Move" but how to make a waypoint that says "Move, if you see something, engage, then when engagement over, continue the waypoint" ? I already checked waypoint type on wiki, but did not found my solution

#

THx by advance ๐Ÿ˜ƒ

carmine galleon
#

Fixed sry

wispy cosmos
#

yea

#

I do
_object = "OBJECT CLASSNAME" createVehicle [0, 0, 0];
_object setPosASL _POSITION;

#

supposedly more optimized this way

#

I figure it has something to do with createVehicle's algorithm for placing the object at a clear position and aligning the vectorUp to the terrain surface.

agile pumice
#

trying to use roadsConnectedTo but its only eve returning 2 roads

vapid frigate
#

that's right?

#

unless you're on an intersection

agile pumice
#

maybe i misunderstood what the command was for lol

wispy cosmos
#

sup

#

Never used that command, it might be checking the individual road objects that are adjacent to the road tile being compared to

#

perhaps for AI navigation

#

Maybe you thought it was checking a long stretch of road?

agile pumice
#

i did ๐Ÿ˜ฆ Ideally I was looking for an easy way to get all road segments between two positions

tough abyss
#

this might help you

queen cargo
#

@agile pumice easy ... arma ...
good one

to get all segments of a road you will have to run over all segments using "roadsConnectedTo"
however, that will (as already mentioned) not provide you with intersections due to the way roads in arma work (which is pretty much also why it is PITA to write a proper "navigation" script which would guide you through the streets of whatever map)

tough abyss
#

if you execute nearRoads with a radius as big as the map you would end up with the whole road network, other than that one could proably parse the roads.shp and go on from there

empty harbor
#

not provide you with intersections

#

for Tjunctions it should, (never seen a Xroad actually used). runways have no 'intersection', and you are quite correct that two roads crossing over each other, you'll only get/see your two connection points

nocturne bluff
#

Note, really early version i improved it quite a bit

deft zealot
nocturne bluff
#

amazing

#

What is this? a wikipedia link.

#

What useful input

deft zealot
#

an algorythm fpr pathfinding

nocturne bluff
#

Really?, why i never heard of the most used pathfinding algroithm.

deft zealot
#

it would improve your script and prob fix the issue in your video

nocturne bluff
#

You have failed the reading test.

#

Congratz. you get one "Dork" tag.

#

Please smash nearest door into your face several times to cement this fact.

deft zealot
#

no i just try to give you input (and especially others who read here)
if you dont need help feel free to ignore it

nocturne bluff
#

If you are feeling uneasy about smashing the door in your face.
Don't worry, it be over soon enoguh.

deft zealot
#

and i am sorry that i dont know what algos you ve heard of

nocturne bluff
#

The last version i produced was fully functioing expect for issues with arma road network.

tough abyss
#

i assume you have problems finding a contected road that is a independant polyline from the one your are following, is that right?

deft zealot
#

@nocturne bluff hope you find something useful in my code

nocturne bluff
#

@tough abyss that was the gist of it, the issue makes it pretty impossible to path into certain areas.

#

@deft zealot congrats.

#

or something

#

I dont know what you want?

#

a medal?

tough abyss
#

did you try to check a small radius with nearRoads on each road object and filter out the two roadsConnectedTo + the one you are executing the check on, if there is another one it is the start of a new road polyline.

just a idea..

nocturne bluff
#

Yea.

#

That's what i did in the end.

#

It worked fineish

#

I was waiting for getRoad command.

#

We got that in 1.58

tough abyss
#

can't find it on the wiki..
does it return the whole road ployline?

nocturne bluff
#

they named it roadAt.

#

Cant remember why i needed it tho

#

Oh well~

tough abyss
#

do checks left and right of your road segment

#

at least it could be used for that

#

are you doing AI pathfinding or what is this for?

nocturne bluff
#

I aint doing anything anymore

#

that was like 6 months ago, was working on convoys and the like.

#

Used it for one mission to generate roadblocks

empty pagoda
#

hey guys, ive made a online sqf tool. thought some of you guys here might like it ๐Ÿ˜ƒ http://sqf.io/

agile pumice
#

great tool!

empty pagoda
#

ty. im working on adding an sqm to sqf converter too atm

agile pumice
#

is the source for the iseco encrypt/decrypt available somewhere?

empty pagoda
#

i can give you my javascript function if you want?

agile pumice
#

was looking for something in SQF

#

to use in my mission/server

empty pagoda
#

my friend made a sqf version once

#

its the "Molaron's edit" encryption of iseco on my site

wispy cosmos
#

site looks nice

#

very good tool Speedy

#

Bookmarked!

empty pagoda
#

ty! the design is inspired by google's material design

wispy cosmos
#

I like the gui to sqf

empty pagoda
#

me too. i just hate hpp. ctrlcreate is so much simpler and easy to use

wispy cosmos
#

I'm still a noob at ArmA GUIs -- it's a pain in the ass so far

#

I prefer having full control over everything -- so going the SQF route would be a better way to handle this for me

#

also gives me a quicker preview of any changes

#

-- honestly didn't know you could create GUIs from SQF -- never bothered to look into those commands -- so thanks for bringing that to light as well ๐Ÿ˜ƒ

empty pagoda
#

youre welcome haha ^^

wispy cosmos
#

is there anything in your tool that relies on back-end code?

#

just wondering if it's possible to download your tool to use offline

thin pine
#

Hpp gives more control than just sqf dialog wise

#

Just afakk

#

Afaik

wispy cosmos
#

fak

#

lol

lone glade
#

commands only allow you to create BIS defined dialogs and controls

thin pine
#

Phone

#

Im walking my dog forgive me u spelling Nazi ๐Ÿ’œ๐Ÿ’œ๐Ÿ’œ

wispy cosmos
#

lol

lone glade
#

You're forced to use config if you want to create anything specific.

thin pine
#

^

wispy cosmos
#

@lone glade What about user-added controls in the configs?

thin pine
#

I been busy hpping today

empty pagoda
#

i allways create the ctrls using hpp and animate/change them a bit up with sqf ๐Ÿ˜ƒ

lone glade
#

That's what I meant zooloo

wispy cosmos
#

alrighty

lone glade
#

you're forced to include them in the description.ext of your mission of you want to use them.

#

(or use an addon)

thin pine
#

Any proper dialog combines sqf and hpp

wispy cosmos
#

of course -- wouldn't be much point to have a dialog that does nothing, lol

empty pagoda
#

exactly ^^

thin pine
#

Lol

vapid frigate
#

you don't really need hpps much any more

#

can do it all with sqf

vapid frigate
#

you don't really need to? you're already in a script when you createDialog

wispy cosmos
#

would you need to?

#

^^

#

Ninja'd

vapid frigate
#

I made an empty dialog config for the main dialog class because I'm not sure if there's a built in blank one, so could've used onLoad, but not really any point

marsh lodge
#

Nice, what's the script called?

vapid frigate
#

not released publically yet.. asor gear selector

#

the old version is released, but it uses the standard config based controls

lavish ocean
#

@rancid ruin defintiely not because rule 18. right @empty pagoda and @wispy cosmos ... read #info_help_tips

rancid ruin
#

thought so. keep up the good work

thin pine
#

@vapid frigate while on the subject, how do you get coordinates of where you want your controls to be? I usually use the in game GUI editor, create the positions and sizes, export and use only the x y w h values...just wondering if there's other ways

vapid frigate
#

using maths/defines

#

stuff like #define primary_weapon_pos (top + title_height + top_spacing)

thin pine
#

But that goes with a bit of trial n error right?

vapid frigate
#

i guess, i find it easier/faster than fiddling with the ui editor though

thin pine
#

Ah

vapid frigate
thin pine
#

But having to constantly restart back to Eden to see if my control is in the perfect position would be tedious I reckon

vapid frigate
#

that's the macros for all the positions in that ui

queen cargo
#

its most basic calculations ... nothing with trial and error

#

"trial and error" is it only if you either have no idea where to place them (which means you did not created a basic UI document first which you can use as reference) or that you have no idea how to do math

vapid frigate
#

yeah, you're right.. it's not really trial and error (although I won't pretend i didn't make some errors along the way)

#

it's just thinking it out logically

thin pine
#

I usually don't come up with an ui layout until I'm actively making it lol I guess a bad habit o mine

vapid frigate
thin pine
#

But yeah seems there are two ways...ima stick to the ui editor since it works faster for me...but thanks for the insight

queen cargo
#

just fire up your paint @thin pine

#

thats also not needed forever :3

thin pine
#

I have done a template once before for my mp gamemode

#

With paint :D

queen cargo
thin pine
#

made this about 3 months ago

#

the end result is a lot different ๐Ÿ˜„ - well a few things

fallen locust
#

@queen cargo is it done yet?

#

๐Ÿ˜‰

queen cargo
#

nope @fallen locust but it is currently in progress
a lot of thinking now started properly
head over to #arma3_tools and follow the discord invite there if you want to keep a lil more track ๐Ÿ˜ƒ

#

right now ... what you see is just the front-end which is already designed (i hate unfinished work in that shit)

rancid ruin
#

i'm running in to performance issues using allMissionObjects....presumably it's not a command which i should really be using throughout a mission? better to refactor with a more sensible command?

vapid frigate
#

i wouldn't use it every frame or anything

#

might be what you're doing with all the objects?

#

rather than the command on its own

rancid ruin
#

i'm calling it every minute or so to find objects of certain classes which i want to save to a database

vapid frigate
#

it's noticable when it's running?

rancid ruin
#

it just causes a noticeable lag of at least a few frames, no matter if i call it with allMissionObjects "classname" or "all"

#

yeah it totally locks up for a few frames

vapid frigate
#

have you tried taking out the contents of the loop or whatever you're doing?

#

to see if it's that slowing it down rather than 'allmissionobjects'

#

and you spawning the script, not calling it?

rancid ruin
#

i'm execVMing this file

#
    _objects = allMissionObjects _x;
    
    {
            if (_x isKindOf "GroundWeaponHolder") then {
            // small code block
            };
            
            if ((_x isKindOf "Car") || (_x isKindOf "Helicopter") || (_x isKindOf "Plane")) then {
            // small code block
            };
            
            if (_x isKindOf "ReammoBox_F") then {
            // small code block
            };

    } forEach _objects;
} forEach ["GroundWeaponHolder","Car","Helicopter","Plane","ReammoBox_F"];```
#

fully open to the idea that that ^ is shit code, logic is not my strong point

#

i mean, it all works, but the time has come to refactor and optimise the mission

vapid frigate
#

not certain, but i think spawning a compiled function is quicker than execvm (but probably not that much)

#

did you see the note on the wiki that it's much faster on the dedicated server?

#

performance wise you would also be better off running separate loops (so you're not doing the isKindOf comparisons on every object)

#

for "Car","Helicopter","Plane", you could just use "vehicles" instead of allMissionObjects.. then you'd be calling it 2 times rather than 5

rancid ruin
#

i'm gonna test that right now

#

also gonna test the "entities" command which i hadn't noticed before but is linked on the allMissionObjects wiki page

#

i don't really want to rely on the mission performing badly on anything except a dedi as it'll probably not be run from a dedi most of the time

vapid frigate
#

i think entities is living things

#

people/animals

thin pine
#

I believe entities also picks up weaponholders

#

The physx ones at least I think.....

#

at least near(est)Entities does that so yeah not sure

rancid ruin
#

damn, entities does seem to be faster for "proper" vehicles like cars, etc, but i can't get any of the entities commands to return weaponholders, which is kinda crucial

wispy cosmos
#

oneoh -- that search can be optimized

#

I don't think you need that outer foreach. You're already checking against that list through your conditions within the inner loop.

#

One factor for the lag you notice is due to you searching all objects 5 times when you could just do it once

dull parrot
#

null = [this] execVM "LO\JTF2OperatorGear.sqf";

#

So, why does the above not do anything?

#

The above is pasted into the init field of an offroad./

#

Was hoping to have it be script based, to make it a bit more modular.

#

Want to avoid using the EDEN menu.

wispy cosmos
#

hmm

#

null = [this] execVM "LO\JTF2OperatorGear.sqf";

#

try this instead:
_s = this execVM "LO\JTF2OperatorGear.sqf";

#

@dull parrot

dull parrot
#

comment "25thMEU JTF2 Operators Gear - vehicle Cargo Script";

hint format["Set _veh to jtf2_truck"]
private ["_veh"];
_veh = _this;
// _veh = jtf2_truck;
hint format["Works"]

comment "CLEAR";
hint format["Clear"]
clearBackpackCargoGlobal _veh;
clearItemCargoGlobal _veh;
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
hint format["Works"]

comment "MAGAZINES CARGO";
_veh addMagazineCargoGlobal ["rhsusf_mag_17Rnd_9x19_JHP", 12];
_veh addMagazineCargoGlobal ["CUP_30Rnd_556x45_Stanag", 24];

comment "BACKPACK CARGO";
_veh addBackpackCargoGlobal "tf_rt1523g_black";

comment "WEAPONS CARGO";
_veh addWeaponCargoGlobal ["CUP_arifle_M4A1_desert",5];
_veh addWeaponCargoGlobal ["rhsusf_weap_glock17g4",6];
_veh addWeaponCargoGlobal ["CUP_SOFLAM",1];

comment "ITEMS CARGO";
_veh addItemCargoGlobal ["CUP_HandGrenade_M67",6];

#

_s = this execVM "LO\JTF2OperatorGear.sqf";

wispy cosmos
#

hmm?

#

Add
_s= this execVM "LO\JTF2OperatorGear.sqf";
to your unit's init line

dull parrot
#

Fixed stupidly placed syntax error, also this is being called on a Offroad

wispy cosmos
#

got it working?

dull parrot
#

No, no errors.

#

But the offroad in question is still empty.

#

What is _s?

wispy cosmos
#

just a var to store the return value from the execVM

#

it's needed when executing scripts in the init line (for some reason)

dull parrot
#

ahh

wispy cosmos
#

I'm assuming you're running with CUP and RHS?

dull parrot
#

Yeah

#

comment "25thMEU JTF2 Operators Gear - vehicle Cargo Script";

private ["_veh"];
_veh = _this select 0;
// _veh = jtf2_truck;

comment "CLEAR";
clearBackpackCargoGlobal _veh;
clearItemCargoGlobal _veh;
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;

comment "MAGAZINES CARGO";
_veh addMagazineCargoGlobal ["rhsusf_mag_17Rnd_9x19_JHP", 12];
_veh addMagazineCargoGlobal ["CUP_30Rnd_556x45_Stanag", 24];

comment "BACKPACK CARGO";
_veh addBackpackCargoGlobal "tf_rt1523g_black";

comment "WEAPONS CARGO";
_veh addWeaponCargoGlobal ["CUP_arifle_M4A1_desert",5];
_veh addWeaponCargoGlobal ["rhsusf_weap_glock17g4",6];
_veh addWeaponCargoGlobal ["CUP_SOFLAM",1];

comment "ITEMS CARGO";
_veh addItemCargoGlobal ["CUP_HandGrenade_M67",6];

#

Tried passing it a global variable, and using the init.sqf

#

Did not work.

#

Tried assuring I was selecting the correct object, still nothing.

#

Getting no script errors as well.

wispy cosmos
#

can you test it out using vanilla gear?

#

/ normal arma weapons and stuff

dull parrot
#

Can you give me four classnames

#

I will just pop tthem in

wispy cosmos
#

weapon: "arifle_MX_ACO_pointer_F"

#

weapon: "hgun_P07_F"

#

magazine: "30Rnd_65x39_caseless_mag"

#

magazine: "HandGrenade"

dull parrot
#

Well, fixed that

#

// JTF2 Operators Captive Timer.

private ["_jtf2group"];
private ["_jtf2units"];
_jtf2group = group comp1;
_jtf2units = units _jtf2group;

// set all JTF2 operators to captive to emulate being sneaky bastards
{_x setCaptive true;} forEach _jtf2units;
// Sleep while not armed.
while {isNull currentWeapon forEach _jtf2units;} do {sleep 30;};
// Shit gets real.
{_x setCaptive false;} forEach _jtf2units;

#

This however is throwing a syntax error at line 11

#

That's the while{isnull...

#

Saying I am missing a ;

thin pine
#

yeah check the isNull currentWeapon forEach _jtf2units; part

#

thats not how u forEach

#

:p

plucky beacon
#

need the {}

#

Also I don't really know what this is being used for?

#

but syntax wise

prime valve
#

{ isNull currentWeapon } forEach _jtf2units;

vapid frigate
#

i think he meant to do something like waitUntil {sleep 30; ({!isNull currentWeapon _x} count _jtf2units) > 0 }

wispy cosmos
#

Anyone wanna collab bro?

plucky beacon
#

Collab on?

#

You gotta sell it!

dull parrot
#

I got her figured out all, essentially I can now - Dynamicly populate vehc contents via scripts, and make groups captive (Undercover) based on conditions IE not holding a weapon.

marsh lodge
#

I can't make this code work on a dedicated server :
_chute = "Steerable_Parachute_F" createVehicle [0,0,0]; _chute setDir random 360; _chute setPos (PilotSpawnPosition vectorAdd [0,0,100]); player moveInDriver _chute;

#

I can see the chute spawn, but I never get in the chute. The code even use to work on a local host

vapid frigate
#

there is no 'player' on dedicated server

marsh lodge
#

It runs locally

vapid frigate
#

should work then afaik

marsh lodge
#

hint player works, hint Position works, but I can't figure it out ๐Ÿ˜ฆ

#

I can see the empty chute spawn

vapid frigate
#

i assume discord has screwed up the underscores?

marsh lodge
#

where at?

vapid frigate
#

when i copy/paste it it looks right

marsh lodge
#

Ok

#

for some reason moveInDriver does not work and it use to

#

oh

#

I am dumb

#

I had died somehow

#

when testing

#

-_-

wispy cosmos
#

chute != _chute

noble ether
#

So I have a question for y'all

#

In the context of objects in the game, like a player's unit, is it possible to add my own variables to each unit

#

I'm guessing it is, well hoping to be honest

split coral
noble ether
#

Ooo nice

#

thanks very much

marsh lodge
#

@noble ether you can add a variable to almost anything

severe pollen
#

@lavish ocean

#

Are you avaliable to help, atm.

stable wave
#

how do I temporarily disable a trigger?

split coral
#

try:
yourTrigger enableSimulation false

zealous solstice
#

there was a command for that

#

that was introduce befor some updates

outer laurel
#

hello all

#

in the past i have mod some cars , in class vehicle => Event handler init = "_this execVM '\LAPS_FrankCaptainPuff_Cars\Scripts\init.sqf'";

#

but when i load the vehicle ingame thats show me error cannot find "\LAPS_FrankCaptainPuff_Cars\Scripts\init.sqf"

#

my folder is exactly Same

#

i have the init.sqf inside Scripts folder

#

maybe this command : "_this execVM '\LAPS_FrankCaptainPuff_Cars\Scripts\init.sqf'"; is old and they have replace byy a fonction for performance code issue ?

outer laurel
#

lol , ok thats was my bad , i always use pbo project from mikero for creating addon , but i got error when i create vehicle : model cfg do not want external class , then i used addon builder but this program never copied my sqf files , then on field => list of files to copyy directly in addon builder i wrrite .pac;.paa;.rtm;.sqf;.sqs;.bikb;.fsm;.wss;* .ogg;.wav;.fxy;.csv;.html;.lip;.txt;.bisurf;.sqm;.ext;.dbf;.prj;.shx;*.shp and then all is fine sorry was myy bad

severe pollen
#

@lavish ocean

#

could you kindly help me

#

or anyone that has knowledge of SQF?

indigo snow
#

just ask your question man

#

someone will answer it

severe pollen
#

okey

#

get ready for this 4 page essay lmao

#

i need to make a rappel script for like throwing rope and climbing off of building etc, where do i start with this

indigo snow
#

have you ever scripted in SQF before?

severe pollen
#

once

lavish ocean
#

no need to post all the sqf here, use pastebin/pastie or such

severe pollen
#

but nothing like this

lavish ocean
#

also i will answer when i get time, mood, the stars position is right and such ๐Ÿ˜‰

severe pollen
#

ye i get it

indigo snow
#

if youre a beginner, start smaller

severe pollen
#

ive been reading up for like 4 weeks

#

or so

#

christ did steam just go down?

lavish ocean
#

remember that BIKI and BIForum and OFPEC and google is always your friend

indigo snow
#

start making stuff and youll learn

severe pollen
#

well google has failed me

#

because everytime i google rappel i get fast rope

#

like

#

ffs

indigo snow
#

start smaller

#

try making ropes attach to stuff

cursive whale
#

way too ambitious for a first project

severe pollen
#

this will be my thrid

#

third

indigo snow
#

then start connecting stuff to a full script when youre more condifent

severe pollen
#

not that it makes me any better

#

but

#

yknow

cursive whale
#

come back to it after 30

wispy cosmos
#

wondering if it can be done with an invisible vehicle with only a passenger seat that the unit can shoot from

severe pollen
#

wat

wispy cosmos
#

and then attach a rope from the rappel point to that vehicle

severe pollen
#

that would be cool tho

#

can i be a muted troll?

wispy cosmos
#

yes

#

just annoy the living hell out of Dwarden

severe pollen
#

no

#

that will get me no where

#

or nowere

#

how ever you english people do it

#

ffs

outer laurel
#

wells i'm working on a car for my LAPS addon , but i'm stuck on gearbox , the problem is my gear move from -1 (reverse) ,0(null) and 1 (first speed) but never move to 2, 3,4 etc... redline = 7500 omega = 785.4 #define MAX_RPM 7500 #define RPM(rpm) (rpm/MAX_RPM)

#

GearboxRatios[] = {"R1",-2.97,"N",0,"D1",2.97,"D2",2.1,"D3",1.46,"D4",1,"D5",0.74,"D6",0.50};

#

maybe latency or switchTime i must change

stable wave
#

how do I play a sound for a given number of times?

torn jungle
#

anyone here familiar with ACE medical? My problem is im trying to get something to happen upon pressing a key while you are unconscious (put a beacon or marker for medics to see). But the keypress doesnt work while you are aceunconscious. it works fine while conscious.

#

if (!isDedicated) then {
keyPressed = {
_key = _this select 1;
_handled = false;
if (_key == 55) then {
hint "test placeholder";
};
};

#

waituntil {!(IsNull (findDisplay 46))};
(findDisplay 46) displaySetEventHandler ["KeyDown", "_this call keyPressed"];
};

cold quartz
#

Anyone know if locations always have a name? Example, if I were to use createLocation, is a 'name' automatically assigned to it or do I lose all references to the location if I don't store a reference to it at the time createLocation is called?

#

I'm just wondering if there's a way to retrieve access to a location if you haven't created a reference for the purposes of checking for duplicates or to see if a given location has been modified after it has been created.

queen cargo
#

the "name" of an object is just the global variable it represents

#

in other words: without you actually assigning the value returned by createLocation ... the location will just be lost

#

((in fact ... you still can receive it ... but you still can assume it as lost))

cold quartz
#

Yea, that's what I was afraid of.

#

Thanks!

queen cargo
#

why "afraid"?
just save it to a var and publish the var afterwards ... there is no real problem here

cold quartz
#

Oh, I'm not the one creating the locations.

queen cargo
#

only thing you have to take care is due to some weirdo shit at BI with setVariable and/or getVariable

cold quartz
#

I'm tracking the locations that are created and displaying them separately.

queen cargo
#

still do not rly get your problem

cold quartz
#

It just has to do with the way my application works.

#

and how I store data

queen cargo
#

there is no possible scenario where the variable name could solve/cause problems

#

anyway ...

cold quartz
#

Not worth getting into. Thanks for info.

wispy cosmos
#

hey @cold quartz , need some help?

#

shoot me a PM and I'll help you get everything sorted out -- and I won't belittle you in the process! ๐Ÿ˜„

thin pine
wispy cosmos
#

apply salt to wound

cold quartz
#

@wispy cosmos I don't think I was belittled but I appreciate the offer. My situation is non-standard and I figured out a way around the problem that worked for me. Thanks!

wispy cosmos
#

Congrats!

carmine galleon
#

@Jermin#1414use for

tender fossil
#

Any idea of the charset that A3 uses?

frank cedar
#

@tender fossil , UTF-8 probably

tender fossil
#

@frank cedar Alright, thanks. ๐Ÿ˜ƒ

agile pumice
#

should I be using an exit command to break out of a spawned function that calls itself at the end?

thin pine
#

Recursion...good question

#

@agile pumice If you call the same function at the end it will keep running until one of the called functions stops using exitWith

agile pumice
#

should I just stick exit at the end?

thin pine
#

that's ignored in SQF afaik

agile pumice
#

aw

thin pine
#

The script ends automatically already doesn't it

#

if it reaches the end of the scope it ends afaik

agile pumice
#

i would think so

#

just double checking ๐Ÿ˜›

thin pine
#

Ah alright ๐Ÿ˜›

#

@agile pumice I am curious though, I've never ever had to use a recursive function using calls in ArmA before, are you sure you need to?

agile pumice
#

its a makeshift eventhandler

thin pine
#

hmm that doesn't tell me much but it's fine, I can imagine you're busy ๐Ÿ˜ƒ

agile pumice
#

i could share the source if you want

#

dont worry about the MG_ACE_MouzeZEvent, I know its not in use atm ๐Ÿ˜›

agile pumice
#

can someone give me a hand with some line intersection stuff?

#

trying to use boundingboxreal with lineintersectswith

light berry
#

im new and helping out a buddy hear what looks wrong in this

#

_health = round((1 - (damage player)) * 100);

agile pumice
#

i was thinking 100 * (damage player)

#

round (100 * (damage player))

#

half damage would be 50

#

full health would be 100

#

is that what you wanted?

light berry
#

i have no idea man he gave me a broken mission file for arma 2 and asked why his health bar wasn't working. im not a coder im a m,odeler and mapper but i dabbled in code for arma 2 not really sure how to fix it

vapid frigate
#

round((1 - (damage player)) * 100); is correct for health

#

you had it backwards eagledude, that would show the damage from 0-100 (so 100 = dead)

light berry
#

this sqf is so messy

#

i cant find whats wrong, if anyone is feeling helpful it would be much appreciated

vapid frigate
#

what's happening?

light berry
#

the health isn't updating

vapid frigate
#

nothing looks wrong there that I can see.. but uses a lot of functions/vars that aren't in that script

#

other stuff is updating, but not the health?

light berry
#

ya

#

im not sure this hole file is the worst ones iv ever seen

vapid frigate
#

i don't see why health wouldn't update.. that's the one thing there that you can see all the code

#

maybe try putting this in a watch box in the debug console? round((1 - (damage player)) * 100)

#

err i haven't done any dev in A2.. i'm assuming it has a debug console

light berry
#

there is about 80 sqf files in the main file i think im just gonna tell him i dont know, and neither have i most i ever did was run a day server way back in the day

agile pumice
#

it seems that havingwaitUntil {!(isNull (findDisplay 46))}; waitUntil {!isNull player && player == player}; //Wait till the player is ready in my addon is causing my game to hang when loading in

thin pine
#

uhhm

#

@agile pumice where is this executed then?

polar folio
#

maybe running it in non scheduled space? (might be mixing it up but i hope you know what i mean)

agile pumice
#

i ended up not needing it, but it was in scheduled space

#

ran from cfgfunctions with postInit = 1

tough abyss
#

Afaik postInit should give you the same result as the code above. But looks like you found that out

lone glade
#

Don't use waitUntil in unscheduled.... it's going to run the 10 000 loops in a single frame bruh

agile pumice
#

sorry my mistake, it was scheduled (as far as I know, all functions in cfgfunctions are spawned)

zealous solstice
#

what cfgFunctions?

#

preStart preInit or postInit

agile pumice
#

i would imagine all of them, as far as I know, execvm is the only non-scheudled environment by default, no?

zealous solstice
#

no?

#

preStart and PreInit a unscheduled and postInit is scheduled

agile pumice
#

im prob not explaining myself properly, confused or both lol

#

I have another waituntil below the other ones I posted in the same function that doesnt cause the hang

wispy cosmos
#

on a side note, add a sleep inside your waituntils to prevent it from executing an excessive amount each frame -- frees up some cycles

lone glade
#

Or use a PFH :p

vapid frigate
#

you can run functions defined in CfgFunctions either way.. spawn = unscheduled, call = scheduled

native hemlock
#

What? I think you have those reversed, spawn is scheduled and call is sometimes unscheduled. If you use call from a scheduled environment it will also be run from a scheduled environment.

native hemlock
#

Some clarification on a little misinformation stated here about waitUntil...
Even if it's run from unscheduled it should only excute one time and then you'll get your "generic error in expression" and "suspsending is not allowed in this context" error.
Secondly, when waitUntil is run from the scheduled environment without a sleep it can only execute once per frame at most, but it's not guaranteed to run every frame. On the other hand a while loop without a sleep can execute multiple times a frame and will wreak havoc on other scheduled scripts, hence why a sleep is very important if using a while loop.

vapid frigate
#

err yeah, sorry, got those backwards

wispy cosmos
#

yo alganthe

#

is there a built-in way to remove a PFH (provided by CBA) from within the embodied code?

#

From what I've seen, it doesn't pass a handle to the PFH as one of the arguments to the code being executed, but only returns the handle to the caller

#

The reason I'm asking is if I have some code I want to run in a PFH and then want to end its execution based off of certain conditions within the embodied code, how would I go about doing that? Or would this require a bit of a rewrite of the parent solution?

#

@lone glade

native hemlock
wispy cosmos
#

ah!

#

Thanks @native hemlock

#

That answers my question ๐Ÿ˜ƒ

agile pumice
#

thanks for the tips boys

queen cargo
#

@native hemlock while without sleep is totally fine ... sleep just will interrupt the scheduled earlier

#

the scheduler will "take care" that your spawned function wont stay in "running "mode for too long

#

and you cannot rly wreck the scheduler unless you spawn a ton of loops

dull parrot
#

// Not 100% on the syntax here, the examples kinda sucked...
_nc = if ( _nearby_count > 0 ) [{hint ["No Sectors!"]},{ _nc str _nearby_count}];

#

Fix my if statement haha.

#

This line gets a missing ; error thrown

#

I have tried allot of variations, and I am pulling this from the BI wiki

jaunty drift
#
private _nc = ""; 
if (_nearby_count > 0) then {
    hint "No Sectors!"; 
    _nc = str(_nearby_count);
};
dull parrot
#

private _nc = "";
if (_nearby_count > 0) then {
exitWith {hint "No Sectors!";};
};

#

This is giving me a "Missing SemiColon" on line exitWith

vapid frigate
#

@dull parrot exitWith is the one time you don't use 'then'

#

if (_nearby_count > 0) exitWith {hint "No Sectors!"; };

#

not sure that syntax for private works either?

#

would usually be private ["_nc"]; _nc = ""; afaik

jaunty drift
#

It's also faster than using the private array command.

dull parrot
#

Hmm, such weird syntax conventions for a silly if statement.

#

Well, I am stepping out of my rookie exeVM world and into a new one, so I expect some bumps in the road.

#

But, why then, would it give me a missing ; error?

jaunty drift
#

The error messages aren't always the most helpful.

vapid frigate
#

@jaunty drift interesting, ta

#

much nice syntax imo.. means you don't need the list up the top at all

dull parrot
#

params [ "_current_player" ]; // Needs to take a SINGLE player as a param.

_pos getPos _this select 0; // get position of player and set it to x
// check to see if sectors in sectors_allsectors is in range of player, in realiton to the SECTOR_SPAWNRADIUS, store in array _is_nearby
// Count _is_nearby
_is_nearby = [ sectors_allSectors , { (markerPos _x) distance _pos < SECTOR_SPAWNRADIUS } ] call BIS_fnc_conditionalSelect; // sort through ALL sectors, and get the ones within range of _pos put them into _is_nearby
_nearby_count = count _is_nearby; // Count what IS nearby
hint format ["_nearby_count %1", _nearby_count];
_nearby_count; // Return nearby_count

#

Here is another wonderful error by me.

#

This, produces nothing, I tried with hints at every step, to see if I could step through, it simply never happens. I am thinking my params is messed up.

#

I was trying to call it via addAction

#

player addAction ["<t color='#FF0000'>GET ESTIMATED CURRENTLY SPAWNED SECTORS(ONSELF)", { [player] execVM "debug/dfunc/DF_debugNearbySectors.sqf" }];

#

A way to test small bits of code before I integrate it into the project.

vapid frigate
#

@dull parrot i think you want _pos = getpos _current_player;

#

or you can use _pos = getPos (_this select 0); and omit the params line.. they'll do the same thing if you provide the correct input

#

make sure you have script errors turned on.. you shouldve got one for _pos there i think

#

this: _pos getPos _this select 0; would try to get the position of the player relative to _pos (which is nil) and do nothing with it (so even if _pos existed, that line wouldn't do anything)

dull parrot
#

Thank you so much lecks, I am busy with the kid right now, but I will plug this in a keep debugging in a bit.

tough abyss
#

Is there some secret way to make RscPicture images look good?

#

I've got an 1024x1024 texture which i want to show ingame

#

At the moment I'm just creating the image with ctrlCreate ["RscPicture"...

#

But what confuses me is how I can get the picture to look good on 16:9 monitors, 4:3 monitors, and so forth

#

On 4:3 1024x1024 should fill the whole screen

#

But on 16:9 it should be centered

#

Or rather, I think it works fine on 4:3 monitors, but the heigth scaled on 16:9 monitors

#

gets scaled*

turbid jolt
#

I haven't really done much in the way of serious GUI editing, but IIRC maintaining aspect ratio etc. it's a matter of using safezone or absolute screenspace when defining the UI coordinates https://community.bistudio.com/wiki/SafeZone

vapid frigate
#

@tough abyss: RscPictureKeepAspect might be what you need?

#

and the aspect ratio is always 4:3

#

so 1 x (4/3) or (3/4) x 1 is always a square

queen cargo
vapid frigate
#

@tough abyss Not sure you need the aspect ratio to do what you want, but you can use (safeZoneW/safeZoneH)

plucky beacon
#

@Quiksilver#5042are you using rain or cloudy weather? I think that automatically ups the wind a lot.

tough abyss
#

I will look in to RscPictureKeepAspect today, though when I tested on another computer with the interface size set to large, the image was again warped and not where it is supposed to be. I'm using SafeZone values as well, so it makes me wonder..

rancid ruin
#

@queen cargo initial impressions are good. eagerly awaiting the finished product ๐Ÿ˜ƒ

queen cargo
#

if you got feature request or something like that @rancid ruin post them at the issues page ๐Ÿ˜ƒ

carmine galleon
#

Hey guys

#

Any idea about how to make AI defend a place, engage hostiles incomming, then get back to the place to defend ? I usefdBIS_fnc_taskDefend, but if I shoot on AI, they all seek me, then if they do not find me, they stay where they are and do not fall back to the point to defend

little eagle
#

setWind doesn't really work if your mission has auto wind enabled

plucky beacon
#

@Quiksilver#5042could the wind be multiplying per user joining?

#

@carmine galleon put them in buildings and use doStop

tender fossil
#

Can you recognize damage taken from fire with HandleDamage event handler? (Or do you need to write your own hacky solution?)

little eagle
#

No, it will be reported as <objNull>, same as crashes, setDamage, drowning damage etc.

#

You can guess drowning damage - the damage added will be exactly 0.1 and oxygenRemaining will be below a threshold I don't remember (0.3 ?)

tender fossil
#

Alright, thanks for advice @little eagle

brazen sparrow
#

hey does anyone have any idea how test_EmptyObjectForBubbles/test_EmptyObjectForFireBig/test_EmptyObjectForSmoke define the actual particle effect?

plucky beacon
#

I've seen a lot of people try and replicate it but they never seem to get it right.

native hemlock
#

Look in weapons_f\data\scripts\ and there are 3 scripts in there that seem to create the effects

#

All of those objects use empty p3ds and have calls to those scripts in their init

plucky beacon
#

it doesn't tell the actualy values and settings of hte particle source though, just the light?

native hemlock
#

You'd have to check in a3\data_f\particleeffects\config.cpp for what each is

brazen sparrow
#

ahh ok cheers

plucky beacon
#

@Quiksilver#5042 look back at those recent pastebins. They have the values to different light settings for standard vehicle fires.

tranquil nymph
#

Do map controls have a minimum size or something?

rancid ruin
#

nope, i've made tiny maps before

plucky beacon
#

I've never had tiny maps before. No Idea

#

What's that search area in the background?

rancid ruin
#

fuck knows. he should pastebin his code though or it'll always be a mystery

plucky beacon
#

Forever mystery of the lost UI elements.

#

Indiana Jones can't even find this shit

rancid ruin
#

raiders of the lost Rsc

plucky beacon
#

Temple of the forgotten semicolon

#

Temple of the forgotten definitions probably better

tranquil nymph
#

Sorry, I went bouldering ๐Ÿ˜› Will pastebin the relevant configs in a sec here

#

Tried setting the size really small via ctrlSetPosition when it initalizes and it still was the size in the screenshot

#

My theory is that it's related to the map being in that controls group

jade abyss
#

_Ctrl CtrlCommit 1; done?

tranquil nymph
#

Yep

#

I'll mess with it again now that I've been away from the code for a while

tranquil nymph
#

Okay, I've half figured out the problem, I think you're right and I must have forgot to add in the ctrlCommit earlier

#

Now that I've got that working, it looks like the map control position is relative to a different origin from the other controls

#

(Not the controls group position like it should be, possibly defaulting to absolute position)

#

Which actually seems like a bug

#

Perhaps not absolute, using the position of the controls group and adding it to the position of the map control didn't fix it

#

Okay no, definitely using absolute, I wonder why that didn't fix it then

tranquil nymph
#

๐Ÿ˜„ Well at least I know why it's broken now, can figure out how to fix it tomorrow

little eagle
#

Reading the control is the only way I know of. That will only work when the control is shown though. Never actually tried to do it, but I see no reason why it wouldn't work. You can even read the chat.

winged thistle
#

If I add an action to a player with a boolean variable in the visibility argument, will its visibility toggle with the variable?

#

well shit

#

Ok, then I need help.

#

Oh

#

Right

#

๐Ÿ˜›

#

I think I've been at this too long today

#

Goal is to try to get an action associated to players that only Gunners can use

#

I'm assigning player classes to the player namespace

#

Need the action to only be visible to gunners, so would I just put in the condition:

#

==

#

er, yeah

#

omg

#

Brain... melting...

#

Trying to do too many things at once

#

I think you may be onto something.

#

Back in 5 ๐Ÿ˜›

lone glade
#

@winged thistle use getUnitTrait for that medic detection.

little eagle
#

should've used a function for this in the first place

#

to read the medic=1 from config

lone glade
#

It's just a glorified setVar tho

winged thistle
#

@lone glade I am where it is necessary. My system is complex and that command isn't an ultimate solution for script compatibility with other custom classes I've created.

#

One day, you guys will be able to see it ๐Ÿ˜›

#

Hopefully one day soon...

#

For now, I've been awake entirely too long.

dull parrot
#

if(_cnt <= (_cnt - 35)) then { // qf5 sets out.

#

Is this line doing what I think it does.

#

if _cnt is less than or equal to the value of _cnt -35 then do code.

#

???

naive fractal
#

how can the value be less than or equal to the value, minus a number?

dull parrot
#

Basicly, I wana get a count

naive fractal
#

it would always execute

dull parrot
#

Ahh.

#

So, I would have to assign new variables, every time I wana check thyis.

#

say _cnt <= _cnt2

naive fractal
#

yeah

dull parrot
#

The value of cnt to be set before hand.

#

Okay.

#

Well shiite.

dull parrot
#

while {!_qrf_sent} do {
_cnt = {(side _x) == east} count allUnits)}; // Get _cnt
if(_cnt <= _cnt1) then { // qf1 sets out.
// CODE
if(_cnt <= _cnt2) then { // qf2 sets out.
// CODE
};
if(_cnt <= _cnt3) then { // qf3 sets out.
// CODE
};
if(_cnt <= _cnt4) then { // qf4 sets out.
// CODE
};
if(_cnt <= _cnt5) then { // qf5 sets out.
// CODE
};
if(_cnt <= _cnt6) then { // qf6 sets out.
// CODE
};
sleep 60; // Check every minute
};

#

Another question, does this work a switch statement?

#

Or will it do them all, every time...

#

I mean, I could run a check that sets cnt4complete = false

#

and then in its relative part of code, set it to true

#

and do a && conditional

#

Honestly, unless I am missing something that's all I can think to do, to keep this from re-running itself every 60 minutes.

#

is realtively new to sqf

naive fractal
#

what values do _cnt1 represent, are they calculated or fixed?

vapid frigate
#

@dull parrot as Plebeian implied, can't really answer what that'll do without knowing what _cnt1 etc are. Maybe you want to use if/else rather than just if? That would make it behave more like a switch (only 1 would run each time).

dull parrot
#

^ This answers my question

fickle plover
#

Hello, I know the overall opinion of Altis Life has shifted but does anyone know anything about modifying 4.4? I've taken on the project out of boredom and I was looking to add new drugs and resources.

#

However no guides seem to exist.

naive fractal
#

Kinky, instead of forever looping and sleeping, you could execute the code in an event handler for when an east side unit is killed.

hasty pond
#

So extdb2 has been taken down from everywhere and you can't get it anymore. Anyone have any alternatives for it?

#

#realProblemsForArmaRightHere

queen cargo
#

extdb2 down again?

#

poor boy

hasty pond
#

Taken offline everywhere

queen cargo
hasty pond
#

I have no C++ skills so I might not be the right person but the community will sooner or later need an updated DB extension to replace extDB2

rancid ruin
#

why was extdb2 taken down?

queen cargo
#

anyway ... i might should finalize that stupid extension at some point ...

#

not even sure why i never finished it out

hasty pond
#

Well if you do finalize it, it would be a big thing for everybody needing MySQL connection

fickle plover
#

@queen cargo I have a version I can give you when I'm home if you like

queen cargo
#

which version of what @fickle plover ?

fickle plover
#

@queen cargo I have a version I can give you when I'm home if you like

#

Extdb2

queen cargo
#

Ahh well ... not in need dude :) but ty (others here would need though ...)

#

Just starting to think about continuing an ancient time waster project besides other time waste projects

tough abyss
hasty pond
#

@tough abyss Can not express my relief enough.

#

Is it ready to go right now?

tough abyss
#

Will require minor edits to SQF Setup Stage & SQL_CUSTOM ini file.
But yeah it should be fine.
It will complain about everything that is wrong(changes) with the SQL_CUSTOM file.
Just pm if you get stuck / confused.

hasty pond
#

Alrighty โค

#

Glad you also included the debug exe with the release ๐Ÿ˜ƒ

agile pumice
#

can someone point me in the right direction of returning objects in a particular direction, relative to an object?

little eagle
#

nearestObjects, getPosASL, vectorFromTo and vector math

agile pumice
#

thanks

prime valve
#

Will this ever be MP Compatible ?

little eagle
#

make it so

winged thistle
#

I'm having difficulty getting an addAction to use the right parameters.

#

(_this select 0) and (_this select 1) in the action don't have the correct values.

#

They are pulling from the script instead of from the action arguments

#

I expect that (_this select 3) == ["reload",player,_ammoBox] but it instead returns ["reload",B Alpha 1-1:1 (pigneedle) REMOTE,"init"]

#

The REMOTE is because I have 2 clients connected on the same machine

#

It's returning the wrong player and the last parameter should be equal to _ammoBox from the paste

#

What am I doing wrong?

zealous solstice
#

_this select 0 == _mode?

winged thistle
#

But it isn't supposed to be

zealous solstice
#

what mean in the retzrn you dont get ammobox you get _mode

winged thistle
#

It's supposed to be pulling _this from the action arguments

zealous solstice
#

you parse it?

winged thistle
#

Did you look at the pastebin link?

zealous solstice
#

yes

winged thistle
#

In the addAction, I define arguments to pass to the script in the action.

zealous solstice
#

["reload",(_this select 1),(_this select 0)]

#

this is what the addaction get

winged thistle
#

so _this should be ["reload",(_this select 1),(_this select 0)]

#

I'm expecting that _this in that scope is pulled from the addaction

zealous solstice
#

_this in a addaction is [_object, _caller, _id, _arguements]

winged thistle
#

well, ID, then arguments

#

yeah

#

so (_this select 3) spawn ... should use ["reload",(_this select 1),(_this select 0)]

zealous solstice
#

yes from the function where the remote exec get called

winged thistle
#

which it seems to, but (_this select 1) and (_this select 0) pull from the wrong scope

vapid frigate
#

those will run when you add the action

#

in that scope

winged thistle
#

So why is it wrong?

zealous solstice
#

because you get it in the wrong scope

winged thistle
#

Sure, but how can I fix it?

#

I want to pull the arguments from addaction, not from the script

zealous solstice
#

?

winged thistle
#

Currently, the arguments are pulling from params in the script

#

I want to use the arguments from addaction

#

[_object, _caller, _id, _arguements]

zealous solstice
#

yes use it in the code?

winged thistle
#

The action should be present for each player, allowing them to reload at an ammobox

zealous solstice
#

yes?

#

come on please dont be that stupid

winged thistle
#

Woah, man.

vapid frigate
#

what is _target?

winged thistle
#

Please don't be that presumptuous.

zealous solstice
#

_target is the object target where the action is attached to

winged thistle
#

_target changes

#

first it's the gunner placing the box

#

later it is used to identify the player using the box

#

_newBox is the object

zealous solstice
#

@winged thistle {["reload", _this select 1, _this select 0] spawn FOR_fnc_ammo_doReload;}

#

this is you so hard solution and you dont get it da fuck

winged thistle
#

Calm down man. I don't come here to be criticized. I come here for help just like everyone else.

#

@zealous solstice Thank you. That's what I needed.

zealous solstice
#

did you understand what was wrong with your code?

winged thistle
#

I do.

#

Honestly though, I believe this should be an area conducive to supporting learning and development.

#

Please understand that not everyone knows everything.

wispy cosmos
#

Agreed @winged thistle. The childlike mannerisms that seem to be presented here often only do harm to the overall community.

#

I see your post as someone who likely has little experience with scripting, or at least in SQF. Of course I wouldn't expect you to understand much of the low-level details, and won't hold you accountable to do so either.

#

Everyone has to start somewhere.

#

And a word to everyone of all levels of experience: there's always a bigger fish

#

Be humble.

cursive whale
#

...and one day you too can be a Muted Troll ๐Ÿ˜œ

#

Just kidding. Hot pink suits you.

wispy cosmos
#

I like to troll, so it fits me well.

#

It's my own little trophy :>

cursive whale
#

It's quite fetching. Slightly jelly.

nocturne bluff
#

Be blue and cool like me instead.

#

"mutiplayer not support"

wispy cosmos
#

Rofl @Head

grizzled cliff
#

hmmm

deft zealot
#

how can i simulate a lock, lockDriver, lockTurret, lockCargo with local effect
i know the command i need dont exist so workarounds welcome

#

my first idea is to lock a vehicle completly and code custom GetInX actions but i think its impossible to make them work exactly like the vanilla ones

little eagle
#

It's not possible. The only way is to moveOut with the getIn event handler

#

emulating the getIn actions is a huuuuge pain in the ass. not possible to make it work exactly like vanilla without the VBS version of selectionPosition

#

I tried in AGM and ACE (to add those to our menu), but I failed

naive fractal
#

Is there an event raised, or function I can call, to determine if shots are landing near a unit/group? or a non-performance intrusive third party script?

nocturne bluff
#

yes

#

well no.

little eagle
#

the only way would be to track projectiles with an EachFrame handler until they are <null>
that has two problems:

  • no way to reliably detect ricochets
  • really bad performance hit when AIs have a bigger fire fight
naive fractal
#

okay, what I feared - thank you both for answering

tough abyss
#

AI FSM you can have it behave to nearby shots, requires an addon though

#

Believe its the danger.fsm

tough abyss
#

you could a invisible sphere model with a firegeometry and 100% penetrability, then just add a hit eventhandler to it.
don't know if it works but would require a custom .p3d

wispy cosmos
#

@tough abyss that may be the most efficient method

shadow sapphire
#

Okay. Would anyone be willing to look over my garbage script and tell me how to make it work? I don't understand the sqf language much at all, but I've had a simple idea for a while and I just can't get it to work. Maybe someone who understands code can look over it and understand what I was trying to do.

vagrant kite
#

you haven't posted the sript ๐Ÿ˜‰

tough abyss
#

isn't there a function or command to get all running scripts?

vapid frigate
tough abyss
#

thanks!

shadow sapphire
#

@vagrant kite, do I paste the text in here or can I drop the .sqf in here for download?

vagrant kite
shadow sapphire
#

It's pretty bad. Like, the code isn't even close to working, I more or less wrote this to explain what I'm trying to do.

vagrant kite
#

it would be better if variable names meant anything

#

lines 20-22 make no sense

#

if (side = GUER) side of what?

#

should be sth like: side player or side _unit

#

C3A == true -> C3A

#

C2A == false -> !C2A

#

also: you're creating a lot of triggers and markers? can't they be placed in the editor?

#

what is that you're trying to accomplish?

shadow sapphire
#

@vagrant kite, fixing first two issues now.

As far as I can tell, the trigger conditions are too complex to place in the editor, because the triggers are being created by trigger pairs, when both trigger conditions are true.

What I'm trying to do is have a central point that acts like a two way capture point. When the point is captured, then a point is spawned for the other side to defend. Whenever the second point is captured, the defending side defends one more point. So basically, it starts off with a neutral point. When that point is captured, the side that captured the point has to capture two more points to win.

#

So, whenever a point is captured, it deletes itself and creates a new point. Each point has two triggers, one to check if a side is present and one to make sure a side is not present.

carmine galleon
#

cCould also use playerSide

#

BTW

#

Guer is no more supported on Arma 3

#

resistance or independent

#

instead

shadow sapphire
#

I think I am going to remote execute on all clients to create the markers. Thanks for letting me know about independent.

carmine galleon
#

Well in fact I'm not sure guer is no more working

#

But using independent

#

And working

shadow sapphire
#

Replaced all instances of GUER with independent.

snow pecan
#

When running code on an independent side unit,
side _unit == independent
but
str side _unit == "GUER"

shadow sapphire
#

@snow pecan, thanks!

little eagle
#

I suggest using side group player over side player and playerSide because those cause potential problems

#

playerSide doesn't report the side the players unit is on. It reports which side you joined in the mission. It is totally possible to change that side by joining a group of an enemy side.
It's an edge case, but why make your code intentionally less powerfull.
side player (side <OBJECT>) can return different sides than west, east, civilian or independant. It will report sideFriendly if your unit is treated as captive and sideEnemy if you killed to many friendly units.

jaunty sandal
#

hi, is there a way to disable "Rearm" at an ammo box without removing the items it contains that trigger the rearm option?

still forum
#

There is a way to do everything in arma.. question is wheather its hard or easy ^^... Hard way would be creating your own pbo and overwriting Armas configs which create the Rearm action on the ammoboxes...

shadow sapphire
#

I have been wanting to get rid of that HORRIBLE design decision myself. It's utterly worthless and completely annoying.

#

Screw that rearm option.

jaunty sandal
#

that answers it... im saddened by it. it can be annoying when you accidentally hit rearm and pause for a few seconds when you intended to inspect the inventory

placid root
#

Does anybody know if there is a config entry inside a weapon's class that refers to the side it is used? Eg. katiba -> opfor

#

Or at least some value referring indirectly to the side

#

Eg. If it has a magazines array it is probably a weapon. This logic just with the side

west lantern
#

weapons dont have side, nor faction only vehicles do, including soldiers/characters

still forum
#

I got used to never using the mousewheel menu on containers.. i always just use the inventory key

little eagle
#

It will also disable the action for every ammo box, vehicle etc.

shadow sapphire
#

@little eagle, can this be done via a server side mod or only client side mod?

jade abyss
#

Client @shadow sapphire

shadow sapphire
#

Rats!!

little eagle
#

client

prime valve
#

Only way to change handAnims on the fly is to apparently create another weapon class with different handAnim. Well..

west lantern
#

better than another model or dupe the existing, right

queen cargo
#

my arma just crashed ... AGAIN ... DBG_PRINTEXCEPTION_C ... you have to fucking kid me ...

prime valve
#

@west lantern Imagine you have a verti grip accessory. Now you have multiple weapons compatible. Now you have multiple camo variants on these weapons. Now I'm gonna kill myself

lone glade
#

If you follow some naming convetion (you should) it should be easy

ebon onyx
#

this script isnt working for a loadout any pointers?

prime valve
#

Yes, I have set up some rules regarding my class names. But still, that would do more variants and stuff, just for the handAnims[] line..

vapid frigate
#

@ebon onyx : have you set _unit ? like _unit = this; if you're calling it with "this execvm 'myscript.sqf'"

ebon onyx
#

i am trying to use names now

#

so for example removeAllWeapons CO; but still no luck, named player in editor also

#

only way i have got this to work is by making an arsenal, exporting it and applying directly to init line

marsh lodge
#

@McCarthy I notice you are using ace, you can set and get loadouts using functions provided by them

#

ace_common_fnc_getAllGear and ace_common_fnc_setAllGear

ebon onyx
#

that confused the shit out of me, bare in mind I have only added respawns before, i have no experience scripting.

little eagle
#

You'll have to learn it if you want to edit soldier loadouts ; )
Or you use the 3den arsenal and do it by hand. That can take hours with enough units, while a script can be written and tested in probably 30 minutes.

velvet merlin
#

anyone see this yet (from rpt - when launching arsenal)?

ModParams - can't find mod:

#

i suspect its some logging/info system to notify faulty configs, yet it doesnt list the class or anything

#

couldnt find it in the A3 source either (was searching all scripts, configs and xml)

tough abyss
#

could it be related to cfgMods so the arsenal wants to get the "dlc" icon and other infos to display?

west lantern
#
> ModParams - can't find mod:``` yeah was wondering if this was caused by my mod cfgPatches or cfgMods...could it be the `cfgPatches overhaul`? Anyone know whats the change there?
west lantern
#

could also be this what soul_assasin said there... in cfgMods dir = "@MOD"; will not work, should be dir = "MOD"; ... I thought it may be related to this since its whining how it "cant find mod:"

#

Will try this now and see if I get the error again. Change the dir property to not include @ there

#

yep fixed

#

error is gone will send rpt now so you can see @velvet merlin

#

the problem is all other things will not work if you try to fix it this way

#

solution may be to ditch @ everywhere and that is cfgMods and mod.cpp and actually use the file dir without @ prefix

#

Just realized I am not on RC build...lol need to switch and czech again ๐Ÿ˜‰

velvet merlin
#

@west lantern thanks!

west lantern
#

ah its not it.. tried on RC and its back, damn it

#

Ill try to do the same to mod.cpp and change mod folder name

#

no its not it definetly...was hoping it was that easy

#

its still whining cant find mod:

hasty pond
#

Would a hacker be usually able to change a variable that is only local to the server?

west lantern
#

If the server runs it then only the server knows about the variable unless publicvariable is used. So I read about it. And should be like that.

native hemlock
#

Local to a script or in the server's missionNamespace? If they knew the variable name and had the ability to execute some dangerous commands they could change it, but those are big ifs.
If you don't have properly setup filters/CfgRemoteExec they could do [{yourVar = -1}] remoteExecCall ["BIS_fnc_call", 2] to change a variable, they could even tell the server to execute allVariables missionNamespace and have the output sent back to themselves.

hasty pond
#

I was thinking of storing some player related variables like cash on the server and have the player fetch the money from the server

nocturne bluff
#

Thats a good idea.

shadow sapphire
#

Could anyone offer guidance on the use of BIS_fnc_setTask?

tough abyss
#

hey guys i could use some help/advice. i create a trigger via script or init event handler:

#

rf3080trigger = createTrigger ["EmptyDetector", getPos player];
rf3080trigger setTriggerArea [5, 5, 0, true];
rf3080trigger setTriggerActivation ["ANY", "PRESENT", true];
rf3080trigger setTriggerStatements ["this", "player setVariable ['tf_sendingDistanceMultiplicator', 1.5]", "hint 'Deactivation!'"];

#

and everything is working fine except the on deactivation part in the setTriggerStatements. I have no idea why. If I put the exact same statement in the debug console the on deactivation parts works just fine. Any ideas why?

prime valve
#

Quick question; is it possible to deactivate the "Get out" action from a vehicle crew member when the exit memory point is in collision with something ? For exemple, a guy takes a SUV and parks next to the building wall. He gets out, and is now in the building. how to fix pls

native hemlock
#

I don't know if you can disable that, but if you'd like to prevent it at all costs you could always use the GetOutMan eventhandler and check if the position they are getting out to is visible from the vehicle, if it's not then you move them back inside of the vehicle

ebon onyx
#

anyone know how to clear cargo of a box ClearItemCargoGlobal isn't working, sorry for noob question

carmine galleon
#

@native hemlock
Thx for idea. Script snippet (working as intended) :
player addEventHandler ["GetOutMan",{
_unit = _this select 0;
_position = _this select 1;
_vehicle = _this select 2;
if(lineIntersects[(getPosASL _unit),(getPosASL _vehicle),_unit,_vehicle]) then {
switch(_position) do {
case "driver": {_unit moveInDriver _vehicle};
case "gunner": {_unit moveInGunner _vehicle};
case "cargo": {_unit moveInCargo _vehicle};
default {};
};
};
}];

#

@ebon onyx
clearMagazineCargoGlobal _object;
clearWeaponCargoGlobal _object;
clearItemCargoGlobal _object;
clearBackpackCargoGlobal _object;

ebon onyx
#

Thanks Mash6, does Global parameters only work on MP? just curiosity it works fine

carmine galleon
#

Nope

#

Global always works

prime valve
#

Sad thing it's the only thing that always works

carmine galleon
#

Pro tip : These commands works even is objects is not local, and broadcasts over network

#

Pro tip 2 : If MP player in desynch when you execute the clear, then he will always see the inventory until desync ends

#

Just check on wiki because some commands have global effects but requires local arguments

#

Example : addMagazineTurret adds magazine in global, but only works if executed where vehicle is local

carmine galleon
#

@native hemlock
Little fix, because player wasn't able to get out of vehicle while inside building like hangar :
player addEventHandler ["GetOutMan",{
_unit = _this select 0;
_position = _this select 1;
_vehicle = _this select 2;
if(([_vehicle, "VIEW"] checkVisibility [eyePos _unit, eyePos _vehicle]) < 1) then {
switch(_position) do {
case "driver": {_unit moveInDriver _vehicle};
case "gunner": {_unit moveInGunner _vehicle};
case "cargo": {_unit moveInCargo _vehicle};
default {};
};
};
}];

carmine galleon
#

"What did you do today ? - Oh, nothing special, fixing BI stuff"

west lantern
#

Wouldnt that disable entire crew from getting out if one is blocked?

carmine galleon
#

Should not

#

Because event handler is on unit

#

And not on vehicle

#

it's a "GetOutMan" and not a "GetOut" eventhandler

#

So only applying to the unit getting out, and do not affect other crew members

west lantern
#

ah overlooked that one, good one thanks

carmine galleon
#

BTW, this eventhandler continues after respawn so only need to put it in like init.sqf

shadow sail
#

Is there any way to force the squad hexagons to be team-based instead of squad based? In co-op missions I'd like to separate the pilots and the infantry while letting them still see one another on the field.

vapid frigate
shadow sail
#

ah thank you

tough abyss
#

Whats the best way to package scripts up into a mod, so I can reuse them across many missions? I tried unpacking the CBA pbo but can't really make sense of the organisation of it.

hasty pond
#

just pack them into pbo and include cfgfunctions

tough abyss
#

Thanks

vocal lantern
#

Yo, I'm messing around with Eden right now, just trying to get a feel for things.

#

Is it possible to build a complex chain of command, where subordinates have subordinates?

#

for example, I have a High commander (Crossroads) and several fireteams of NPCs in a perimeter around the HQ. Hawk-1 to Hawk-6

#

I want All of Hawk to be controlled by one NPC, who is a subordinate to Crossroads, the player, without combining them into one big squad.

#

Can I do that?

#

Maybe the wrong channel to ask this, sorry

#

So no, it's not possible?

vocal mantle
#

I am trying to get all the sub classes of a weapon config but only 2 return
("true" configClasses (configFile >> "CfgWeapons" >> "SMG_02_F"));
Help?๐Ÿ˜ฉ

tough abyss
#

hey guys, i have an init event handler that runs a script with a while loop. Unfortunately i noticed that the script isn't canceled when the object is removed. Is there any way to destroy an init event handler for an object?

native hemlock
#

Is this an infinite loop? Exiting the loop when the object is null might work, or only running the loop when the object is not null

tough abyss
#

while {true} do {
_dist=player distance (_this select 0);
if (_dist < 6) then {
player setVariable ['tf_sendingDistanceMultiplicator', 1.5, true];
}
else { player setVariable ['tf_sendingDistanceMultiplicator', 1.0, true];
};
sleep 10;
};

#

yep the loop is infinite

native hemlock
#
while {!isNull(_this select 0)} do {
    _dist = player distance (_this select 0);
    if (_dist < 6) then { 
        player setVariable ['tf_sendingDistanceMultiplicator', 1.5, true];
    } else { 
        player setVariable ['tf_sendingDistanceMultiplicator', 1.0, true];
    };
    sleep 10;
};

You could give that a try

tough abyss
#

great idea! ill give it a try

#

Works like a charm! I wouldn't have tought about it. Thanks @native hemlock !

native hemlock
#

Good to hear

#

@vocal mantle I think I've found something that'll work for you

_config = configFile >> "CfgWeapons" >> "SMG_02_F"; 
_properties = configProperties [_config, "isClass _x", true];
_properties apply {diag_log _x};

The output of that was

bin\config.bin/CfgWeapons/SMG_02_F/WeaponSlotsInfo
bin\config.bin/CfgWeapons/SMG_02_F/Library
bin\config.bin/CfgWeapons/SMG_02_base_F/Single
bin\config.bin/CfgWeapons/SMG_02_base_F/Burst
bin\config.bin/CfgWeapons/SMG_02_base_F/FullAuto
bin\config.bin/CfgWeapons/SMG_02_base_F/UGL_F
bin\config.bin/CfgWeapons/Rifle_Base_F/GunParticles
bin\config.bin/CfgWeapons/Default/GunFire
bin\config.bin/CfgWeapons/Default/GunClouds
vocal mantle
#

@native hemlock Thanks. I just added a note to it's wiki page so that this information is more transparent.

agile pumice
#

whats the alternate syntax for call compile format for (str someobject) again?

vocal mantle
#

you have three commands in there. which one?

agile pumice
#

all of them I guess, I'm not sure how to answer that, here's an example: _to = call compile format[""%1"",(lbData[3004,(lbCurSel 3004)])];

#

%1 being an object

#

I get error position and error missing ;

vocal mantle
#

you cant call an object. what are you trying to do to said object?

#

it would be the same as _myObject = call {myObject};

agile pumice
#

its trying to compile a string for the object reference

#

lbdata is a string

#

i asked my question kind stupidly I admit

#

but yeah, lbData[3004,(lbCurSel 3004)] is (str someobject)

native hemlock
#

I feel like I ran into this in the past and I'm not sure if you can go from a string data type to object

agile pumice
#

I've seen it done in a lot of scripts, but it wont work for me anymore

vocal mantle
#

unless if the string matches the variable name of the object

agile pumice
#

its a stupid way to do it honestly

vapid frigate
#

might be easier to put all the objects in an array attached to the listbox

#

and put the indexs in either lbData or lbValue

#

since arma3 1.55 you can setVariable on a control

agile pumice
#

yeah, I've just recently started using setvariable for controls

#

was gonna do that for this instance as well

agile pumice
#

god bless BI for adding that setvariable lol

tough abyss
#

Hello everyone o/ Is there a possibility to make a lightening flare to start at a specific altitude (let's say 10) ? Because flyInHeight obviously doesn't work for anything else than planes or helis ^^

agile pumice
#

hope this helps

tough abyss
#

Anybody got any good examples to disable the normal ArmA radio chatter and use your own.
For example when a unit spots an enemy instead of saying "Enemy Man at 007252, 100 metres". Can I just play a sound instead?

austere hawk
#

how can i stop the AI from lying down/running away when they or units near them are wounded? I need static human targets for a testing mission

#

or more specifically, is there a way to disable all AI functions with 1 command? Or does it only work by using disableAI multiple times to achieve total braindead-ness?

jade abyss
#

Wasn't there an ArrayVersion?

austere hawk
#

havent seen it in scripting commands biki list

split coral
#

would disableAI "MOVE" work?

#

or set behaviour to CARELESS?

austere hawk
#

move - they still change stance though

split coral
#

setunitpos "UP"/"MIDDLE"?

austere hawk
#

and anim freezes them completely, but i want them to fall over dead / go autoprone when their legs are gone

split coral
austere hawk
#

ok careless seems to do the trick

#

i want to test indirect damage... unfortunately human shield is a thing in Arma, so i have to come up with some circle script so that the targets are not shielded by each other xD

split coral
#

You mean placing them in a circle around an explosive and comparing damage?

austere hawk
#

yeah

split coral
#

Completely untested snippet:

_center = getmarkerpos "centermarker";
_distanceMin = 5;
_distanceMax = 50;
_count = count _units;
{
    _step = _foreachIndex +1;
    _distance = _distanceMin + (_step * ((_distanceMax - _distanceMin) / _count));
    _pos = _center getPos [_distance, 360 / _count * _step ];
    _x setpos _pos;
    _dir = (_pos getDir _center) + 0; // 0 degree angle to center. Ie. facing it directly. edit. this was wrong first
    _x setdir _dir;
    (group _x) setFormDir _dir
} foreach _units;```
little eagle
#

_to = call compile format[""%1"",(lbData[3004,(lbCurSel 3004)])];

#

just store the object reference as string in the list box controls namesspace and use str _index as identifier

#
private _index = _listbox lbAdd _objectName;
_listbox setVariable [str _index, _object];
onLBSelChanged:

params ["_listbox", "_index"];
private _object = _listbox getVariable str _index;

something like that

tough abyss
#

Hey all, I am trying to make a functions addon, this is my config.cpp however it can't get it to work in game by doing `call GhostFunctions_fnc_HelloWorld;"

{
    class GhostFunctions
    {
        class Test
        {
            class HelloWorld {file = "\the_ghosts\functions\misc\hello_world.sqf";};
        };
    };
};

little eagle
#

does it complain about not finding the file?

tough abyss
#

Not in the editor no

little eagle
#

So the function is just undefined?

tough abyss
#

No warnings . no errors. I will check the rpt file. It should do this

hint "Hello World!";

little eagle
#

-showScriptErrors used? any errors during preprocessing in RPT?

#

you can enter GhostFunctions_fnc_HelloWorld in one of the four "watch" fields in the debug console

#

that should show you your function

tough abyss
#

Ok I added it to the watch field, do I need to press something?

#

I just checked the functions browser and I can't find it in there

#

There are no errors in the RPT ๐Ÿ˜ฆ

#

Hmm do I need to have a CfgAddons ontop of my CfgFunctions ?

little eagle
#

no, but CfgPatches

tough abyss
#

I will try that

little eagle
#

also try to find your function in CfgFunctions in the config viewer

#

is this for a mission or addon?

tough abyss
#

A full addon, I have sounds, textures just need to add scripts

little eagle
#

dumb, question, but did you #include the CfgFunctions.hpp ?

tough abyss
#

Yay! I added the CfgPatches now I am getting an error.

#

15:15:58 Warning Message: Script \the_ghosts\functions\misc\hello_world.sqf not found

#

At least it is progress, thanks @little eagle

little eagle
#

Oh, did you add *.sqf to the "files to copy directly" ?

tough abyss
#

Sorry I don't understand

little eagle
#

mikeros tools or BI tools?

#

Because the "Addon builder" from BI removes *.sqf files by default

tough abyss
#

BI Tools

little eagle
#

ok, wait

tough abyss
#

*.p3d;*.paa,*.wav,*.ogg

little eagle
#

yeah. add *.sqf to that

#

otherwise it will not put them into the packed file

tough abyss
#

Anything else while I am at it?

little eagle
#

bw mod uses these:

#

*.pac;*.paa;*.sqf;*.sqs;*.bikb;*.fsm;*.wss;*.ogg;*.wav;*.fxy;*.csv;*.html;*.lip;*.txt;*.wrp;*.bisurf;*.xml;*.h;

tough abyss
#

Thanks

little eagle
#

yw

tough abyss
#

Yea, I started out making Ghost recon as missions but I realised this has to be an addon. So I am repackaging everything into an addon.

#

hmmm

--------------------------------
Build result
--------------------------------
Build failed. Result code=1
CfgConvert task failed.

--------------------------------
OK

#

Maybe syntax issue

little eagle
#

Shouldn't be a problem with the SQF file

#

those are preprocessed on game start

#

not when you binarize or pack the file

#

you'll have to check the log file

tough abyss
#

I just removed all the file extensions you gave me, it works now ๐Ÿ˜›

little eagle
#

shrug

tough abyss
#

Yay, it works now. Once again thank you.

tough abyss
#

Thank you @agile pumice

little eagle
#

what's wrong with it?

#
_v = "B_APC_Tracked_01_AA_F";
_a = configProperties [configfile >> "CfgVehicles" >> _v >> "AnimationSources", "isClass _x", true] apply {configName _x};
copyToClipboard str _a;
_a
#

["Missiles_revolving","muzzle_rot","HideTurret"]

#

not all of those can be used with animate though. You'll have to replace
"isClass _x"
with:
"isClass _x && {getText (_x >> ""source"") == ""user""}"
to only get those

tough abyss
#

With the config identities, I can set an identity of a unit. However how do I find out what identity the unit is, I cannot see any getIdentity function. Any ideas?

class CfgIdentities
{
    class Moss
    {
        name="Corey";
        country="USA";
        speciality="rifleman";
        ghostSound="male_1"
        fullName = "Corey Moss";
        nameSound = ""; // Arma 3 only!
        face="WhiteHead_10";
        glasses="G_Combat";
        speaker="Male05ENG";
        pitch=1.0;
    };
}

Say if I want to access the identities member variables?

native hemlock
#

Are you setting the identity in a config, description.ext or in game?

tough abyss
#

Setting them from init.sqf

native hemlock
#

It's a hacky solution of

_identity = "MyLittleSoldier";
_solider setIdentity _identity;
_soldier setVariable [ "identity", _identity ];
tough abyss
#

Ok, what would be better way do you think. I am making a mod where I want to create a roster of units like you get in Ghost Recon / Rainbow six. Each identity will have attributes which will affect gameplay e.g. radio chatter, what kit they can select.

I need to know if they are a rifleman, support, demolitions etc

#

I will have scripts with dependencies on those attributes

#

Maybe that is a bad thing in fact, however I have no idea how else to go about implementing that

native hemlock
#

Do you care what their faces look like?

tough abyss
#

At this point, not really

native hemlock
#

I think you would be better off having specific slots have roles

tough abyss
#

True however it will be dynamic roster / slots. The user picks their team with a dialog after mission starts and then they spawn in.

native hemlock
#

Yeah so that wouldn't work

tough abyss
#

In Ghost Recon 1, they have a huge XML with all these identities, I was hoping I could do the same in ArmA , I guess not lol ๐Ÿ˜ฆ

shadow sapphire
#

Can someone proof my script?

_GreenChopper = [];

if (isServer) then {

_GreenPilots = creategroup independent;
_GreenChopper = [getMarkerPos "GreenSpawn", 0, "I_Heli_Transport_02_F", _GreenPilots] call BIS_fnc_spawnVehicle;

_WP1 = _GreenPilots addWaypoint [(getmarkerpos "M1"), 0];
_WP1 setWayPointBehaviour "CARELESS";
_WP1 setWaypointType "TR UNLOAD";
_WP1 setWaypointSpeed "FULL";
_WP1 setWayPointCombatMode "BLUE";
_WP1 setwaypointstatements ["_GreenPilots 'land'; _GreenChopper AnimateDoor ['CargoRamp_Open',1];"];

_WP2 = _GreenPilots addWaypoint [(getmarkerpos "GreenSpawn"), 0];
_WP2 setWayPointBehaviour "CARELESS";
_WP2 setWaypointType "MOVE";
_WP2 setWayPointCombatMode "BLUE";
_WP2 setWaypointSpeed "FULL";
};```

Doesn't throw any errors, but it doesn't open the cargo ramp, either. I can open the cargo ramp in that particular object by having a named mohawk on the map and using a trigger with the statement 

```Mohawk AnimateDoor ['CargoRamp_Open',1];```

Can anyone educate me on the difference?
native hemlock
#

Isn't that much prettier? ๐Ÿ‘

shadow sapphire
#

Indeed.

native hemlock
#

Does the helicopter actually land?

shadow sapphire
#

Yep!

austere hawk
native hemlock
#

@shadow sapphire

  1. setWaypointStatements isn't actually being executed but it's not giving you any errors to show that, it's landing because of the waypoint type. The syntax for setWaypointStatements can be seen here https://community.bistudio.com/wiki/setWaypointStatements
  2. setWaypointStatements can't use local variables like other commands because it is not executed in the same scope as where the local variable is, if instead the variables were global (GreenPilots and GreenChopper) it would work, except that there are a couple of other issues.
  3. Wrong usage of land, it seems redundant but it should be object land "LAND" (capitalization doesn't matter) https://community.bistudio.com/wiki/land
  4. You are using the land command with _GreenPilots which is a group, not an object
  5. You are using the animate command with an array, but it only works for objects. This is because BIS_fnc_spawnVehicle returns you an array that contains [Created Vehicle, [Crew1, Crew2], Group of Vehicle]. In order to execute animate you would need to refer to an object, which in this case would be _GreenChopper select 0
#

My suggestion would be to keep _GreenPilots and _GreenChopper as local variables, but to replace your setWaypointStatement with the following

_WP1 setwaypointstatements ["true", "(vehicle this) land 'land'; (vehicle this) AnimateDoor ['CargoRamp_Open',1]"]; 
#

Within setWaypointStatements the word this refers to the group leader, so the vehicle of the group leader will be the helicopter

shadow sapphire
#

Holy. Balls. @native hemlock, that worked perfectly!

tough abyss
#

Whats the syntax for calling a compiled function with arguments?

call GhostFunctions_fnc_Chatter {"normal";}; ?

#

I want to pass it a string called "normal"

little eagle
#

"normal" call GhostFunctions_fnc_Chatter

#

???

tough abyss
#

Thanks,

It is complaining now about my syntax although the intellij plugin isn't saying anything :/

/*
    chatter.sqf
    This function provides sounds effects causing the squad to begin chatting at the start of the mission to add some ambience
*/

private _scenario = _this select 0;
private _conversation1 = [];
private _conversation2 = [];

switch (_scenario) do
{
    case "normal": {
            _conversation1 = ["tm1_start1a", "tm2_start1a"] call BIS_fnc_selectRandom;
            _conversation2 = ["tm1_start1b", "tm2_start2b"] call BIS_fnc_selectRandom;
    };
    default { hint "Cannot find chatter for this scenario" };
};

playSound _conversation1;
sleep 1;
playSound _conversation2;

little eagle
#

replace:

#

private _scenario = _this select 0;

#

with:
params ["_scenario"];

tough abyss
#

Can I do that inside the switch?

little eagle
#

no, replace line 1

#

it also set's the variable to private

tough abyss
#

That's useful to know

little eagle
tough abyss
#

Is the sleep function asynchronous to the game or does it actually interrupt anything outside the function?

little eagle
#

depending on the environment you are working in

#

there is scheduled and unscheduled environment

#

you cannot use suspension commands (sleep, uiSleep and waitUntil) in unscheduled environment

#

using execVM, spawn, remoteExec (with a function, not command) will enter scheduled (or suspendable) environment

#

you can check the current environment with canSuspend

shadow sapphire
#

@native hemlock, What would I do if I wanted to make sure that the helicopter was landed before it opened the cargo?

little eagle
#

unscheduled (not suspendable) is the default

tough abyss
#

Hmm it seems say or say3d might be better as it forces synchronicity of sounds being played.

shadow sapphire
#

In this code:

_GreenChopper = [];

if (isServer) then {

_GreenPilots = creategroup independent;
_GreenChopper = [getMarkerPos "GreenSpawn", 0, "I_Heli_Transport_02_F", _GreenPilots] call BIS_fnc_spawnVehicle;

_WP1 = _GreenPilots addWaypoint [(getmarkerpos "M1"), 0];
_WP1 setWayPointBehaviour "CARELESS";
_WP1 setWaypointType "TR UNLOAD";
_WP1 setWaypointSpeed "FULL";
_WP1 setWayPointCombatMode "BLUE";
_WP1 setwaypointstatements ["true", "(vehicle this) land 'land'; (vehicle this) AnimateDoor ['Door_Back_R',1]; (vehicle this) AnimateDoor ['Door_Back_L',1]; (vehicle this) AnimateDoor ['CargoRamp_Open',1]"];

waitUntil {sleep 0.5; getPOS _GreenPilots <= 0.5;};

_GreenChopper land "NONE";{_x action ["Eject", vehicle _x]; unassignVehicle _x;} forEach _assigned;

waitUntil {sleep 10; {_x in _GreenChopper} count _assigned == 0;};

_GreenChopper AnimateDoor ['Door_Back_R', 0];
_GreenChopper AnimateDoor ['Door_Back_L', 0];
_GreenChopper AnimateDoor ['CargoRamp_Open', 0];

_WP2 = _GreenPilots addWaypoint [(getmarkerpos "GreenSpawn"), 0];
_WP2 setWayPointBehaviour "CARELESS";
_WP2 setWaypointType "MOVE";
_WP2 setWayPointCombatMode "BLUE";
_WP2 setWaypointSpeed "FULL";
};```

In my waituntils, I need to make _GreenPilots and _Greenchopper work. I am unaware of why it won't work.
dusk sage
#

getPOS _GreenPilots

#

Returns an array