#arma3_scripting

1 messages ยท Page 235 of 1

jade abyss
#

"DetachObject" Doesn't work all the time

lone glade
#

thefuck.

jade abyss
#

had several issues with it (not detecting the attached Objects)

lone glade
#

well.... you need to use detach not this......

jade abyss
#

Even that.

lone glade
#

Also, the debug console uses BIS_fnc_call for global and server execution, if you disable it both don't work, found that out earlier.

jade abyss
#

What are you talking about atm?

lone glade
#

I was playing with remoteExec whitelisting earlier

#

mother of god arsenal loop itself.

#

For a single player I had it try 9 times to use remoteExec.

jade abyss
#

Okay, i totaly lost you. From attachTo -> to console -> To RemoteExec -> now Arseanl.

#

In 4 Postings. I am out. o7

lone glade
#

huehuehue

lone glade
#

The units start moving again when enemies are detected and they return to fomration, which shouldn't happen.

indigo snow
#

try adding (group _unit) enableAttack false;

lone glade
#

thing is, the leader should NOT issues ANY commands at all after commandStop

#

eh, guess I'll leave it like it is, the AI will get out and engage whatever is outside of the house.

indigo snow
#

configClasses doesn't return inherited subclasses?

lone glade
#

it does

indigo snow
#

"true" configClasses (configFile >> "CfgWeapons" >> "arifle_MX_GL_ACO_F") returns only [bin\config.bin/CfgWeapons/arifle_MX_GL_ACO_F/LinkedItems] for me

lone glade
#

well yeah, there's no subclasses for that.

#

use arifle_MX_base or whatever the base class is

indigo snow
#

yea so no inherited subclasses?

lone glade
#

well I unless you added one this weapon doesn't have any.

indigo snow
#

It's a GL rifle, it should have the UGL weapon as subclass

lone glade
#

Really? lemme check the game's config then.

indigo snow
#

most weapons have tons of subclasses

#

(ok ASR spams that list a bit)

lone glade
#

Those don't get returned by configClasses indeed.

indigo snow
#

:/

lone glade
indigo snow
#

aight, any good intuitive way to find out if a weapon is a grenadier rifle then?

#

I'm a bit stumped, its all turned into one big config trawl atm ๐Ÿ˜›

lone glade
#

If the weapon got GL in the classname ?

indigo snow
#

not reliable with mods (M203, GP25, etc)

#

same with the muzzles[] property

#

maybe the UiPicture property but i'm not sure how diligent most weapon mod makers are ๐Ÿ˜„

lone glade
#

I was going to say check for underbarrel slot but some small weapons don't have those either.

#

Can't you count muzzles and if there's more than one consider it a GL?

indigo snow
#

some weapons like the SMAW have spotting rounds

#

yes its quite a puzzle ๐Ÿ˜„

lone glade
#

check for primary weapons

#

if the weapon is a primary and has 2 muzzles it's a GL

indigo snow
#

hm that seems fairly watertight, thanks

#

i still feel configClasses should properly return inherited sub classes but im pretty sure thats never gonna change

lone glade
#

eeeeeeeeh, nah

#

maybe an other command for that?

#

also I want the alternative syntax of attachTo from VBS, like naow.

pliant stream
#

isClass (_weaponConfig >> "whatever_the_gl_class_you_are_trying_to_find_is_called") ?

lone glade
#

he want to get an array of GL weapons, not a specific one.

#

oh and @indigo snow make sure the weapon has scope = 2 too

pliant stream
#

i mean like รฌsClass ("some_weapon_f" >> "gl")

#

or does the gl class name also vary i can't remember ๐Ÿ˜„

lone glade
#

doesn't work like that.

indigo snow
#

mods can add their own GL weapons

#

so i cant hardcode it

#

ideally id grab all subclasses, check if "GrenadeLauncher" is a parent and be done with it

pliant stream
#

well i guess you have to just go through the inheritance hierarchy then easy enough

indigo snow
#

Yea its just a fair bit of crawling, hence me looking for a more intuitive solution.

#

sadly there isnt always one ๐Ÿ˜„

#

For anyone interested, I think the smallest i can get it the proper way is

([configFile >> "CfgWeapons" >> _someWeapon,0,true] call BIS_fnc_returnChildren) select { "GrenadeLauncher" in ([_x,true] call BIS_fnc_returnParents)};

lone glade
#

"GrenadeLauncher" isn't always called that way

indigo snow
#

god damn it really?

lone glade
#

could also be EGLM or whatever the mod author want it to be.

indigo snow
#

no no thats a base class

#

hence me returning all parents

lone glade
#

oh.

indigo snow
lone glade
#

ooh you're going that far.

indigo snow
#

yea

#

fairly intensive tho so not sure if im even gonan use it

#

now i just wish returnChildren and returnParents were proper commands

lone glade
#

welcome to the club of "I want in engine version of X" please pick a chair

indigo snow
#

i think all are taken, ill just stand in the back ๐Ÿ˜„

pliant stream
#

intercept is that way ๐Ÿ‘‰

indigo snow
#

is this something Intercept can do? interacting with the configFile?

lone glade
pliant stream
#

๐Ÿ˜„ weeeeeell probably not out of the box

#

but start hacking around the engine and sky's the limit

indigo snow
#

im leaving that to those who took the front seats of the club haha

warped thicket
#

@lone glade you had to link the archive didn't you ๐Ÿ˜›

lone glade
#

fuuuuuck.

ivory nova
#

@jade abyss Thank you so much!

ivory nova
#

@indigo snow Also thank you! ๐Ÿ˜ƒ

ivory nova
#

Just trying to wrap my head around something; I can use createVehicle to spawn an object, like a smoke grenade; does createVehicle just spawn whatever object is passed to it and nothing to do with actually creating vehicles?

#

Should probably just look that up but on mobile

ivory nova
#

Anyone know the variable for 'any player' in a multiplayer mission? I want to call a script every time any player gets into any heli

somber vessel
#

{}forEach playableUnits;
perhaps this is something for you? ๐Ÿ˜ƒ

ivory nova
#

@somber vessel Thanks! I will try this out! ๐Ÿ˜ƒ

somber vessel
#

@ivory nova Np. Just put your code you want to execute for each player which sits in a heli into the {} with use of the magic variable _x .

earnest valve
#

Hey guys. I am writing behaviour code/engine for my Xenomorph that is a WIP for the Alien mod, and I have a question regarding character waypoints and movement. Is there a way to speed up an AI's reaction to move somewhere (It takes like 1-2 seconds for it to turn in a direction before moving, and I am wondering if there is a way to combat the problem)? Thanks ๐Ÿ˜ƒ (I am also using FSM to write up its code and behaviour)

somber vessel
#

^^

#

FSM is a good deal... but i will give u a hint, dont overload the FSM with codes otherwise the script could fuck up the srv.

#

for your question i havent a special answer because i dont know your main code

#

perhaps a wrong behaviour variable in the AI query where you create the units?

ivory nova
#

@somber vessel Great, thank you again!

somber vessel
#

๐Ÿป

#

ah and another one, i totally forgot @ivory nova ... what about Eventhandlers? GetIn .

earnest valve
#

Also, I compared both .sqf and .fsm, and AI seem to slightly work faster with .sqf than the code of .fsm. ๐Ÿ˜•

#

But I chose to use .fsm, mainly because I want the Xenomorph to do more things than just act like a zombie that follows you. ๐Ÿ˜›

somber vessel
#

you should use FSM only for checking something, not for execute bigger codes... thats all i can say at this point. ๐Ÿ˜ƒ

earnest valve
#

Ah, okay ๐Ÿ˜† . Yeah the Devs did use FSM for their AI behaviour, but I guess that's why later on they implemented it into their engine. This is the FSM I did last night ( http://imgur.com/a/eNRbY ), which handles stuff such as: scanning for targets and determining if they are alone, and hiding from the alone unit until the right moment to attack. ๐Ÿ˜›

#

So in conclusion, this is something that I plan to manipulate for ArmA 3 (And yes, the game is of course.. Aliens: Colonial Marines. But the Xenomorph Lurker is the most unique alien that has gotten me interested.) https://www.youtube.com/watch?v=q_XrFEiyrzw

#

but once I get that kind of behaviour going for ArmA 3, I can then extend its behaviour to things like: guiding targets to exposed/vulnerable areas to attack, hiding in various areas such as bushes, and even team up with other AI or Player Xenomorphs to attack groups. ๐Ÿ˜ƒ

ivory nova
#

Is it possible to use the getIn Event Handler for all players in a multiplayer mission?

#

Trying to run a script that attaches smoke to a heli and pops it when a player enters, smoke trails, etc.

ivory nova
#

Anyone know how I can run a scrip on a multiplayer mission every time a player enteres a type of vehicle?

#

Tried running a loop that checks if player is in any type of vehicle but I must be doing something wrong

jade abyss
#

if(vehicle player != player)then{Exec Code};

ivory nova
#

Alright will try this now, thank you!

#

Hm, getting no errors with if (vehicle player != player) then {("SmokeShellBlue" createVehicle [0,0,0]) attachTo [(vehicle player),[0,-1.1,0]]} forEach playableUnits; but doesn't seem to work unfortunately

#

Is it obvious what I'm doing wrong?

thin pine
#

Ive never seen someone use createvehicle as first param of attachto. Id advise splitting those and use the handle of cv for attachto instead. Also is this a mp script? Where's it being executed ?

ivory nova
#

I see, thanks, I'll try it

#

I was just executing it in init

#

Just for use while hosting games myself; should I execute it differently?

thin pine
#

You need an eh or loop if you want it to execute every time someone enters a vehicle

#

Try the getinman eh

jade abyss
#

+atm you would create a SmokeShell on YOU for every player (4 Player = 4 Smokes on YOU )

earnest valve
#

why would u attach smoke on a character, anyways? ๐Ÿ˜‹

ivory nova
#

smoke trails during dog fight ๐Ÿ˜ƒ

#

just trying to learn my way around scripting with dumb ideas like this ๐Ÿ˜ƒ

jade abyss
#

The Code above would create a mess

ivory nova
#

@thin pine Thank you for the advice, I'll try it

#

@jade abyss It didn't even do anything lol I am bad at this

jade abyss
#

Thats why i said it ๐Ÿ˜‰

ivory nova
#

Ahh ๐Ÿ˜ƒ

jade abyss
#
  1. for better Overview:
    ("SmokeShellBlue" createVehicle [0,0,0]) attachTo [(vehicle player),[0,-1.1,0]]
    nonono
_Smoke attachTo  [(vehicle player),[0,-1.1,0]];```
(as i wrote before)
#
  • Do you have any clue, how forEach works?
ivory nova
#

Not beyond the wiki page

jade abyss
#

k

#

Example:
{ _x setDamage 1; } forEach [Player1, Player2, Player3];
forEach goes to every entry in the Array (Player1,Player2,etc)
_x = the current selected thing.
So basicly it is like this:

Player1 setDamage 1;
Player2 setDamage 1;
Player3 setDamage 1;
ivory nova
#

i see!

jade abyss
#

{ systemchat str _x} foreach [0,1,2];
Result: 3x chat msg with 0,1 and 2

#

Should be enough, to get the idea, or? ๐Ÿ˜‰

ivory nova
#

totally, thank you!

jade abyss
#

Ah, that example is also in the Wiki^^

#

(kinda like)

earnest valve
#

or... you could do: for "_i" from 0 To 2 do {systemChat str _i};

jade abyss
#

imho, makes no sense in that Case.

#

But yeah, possible.

earnest valve
#

yeah

ivory nova
#

Does forEach only take an array?

#

Not quite sure if an eventhandler will apply to all players in a mission, or if i need to use forEach in some way

earnest valve
#

Yes, but it can on certain ways, such as an array itself... or.. doing something like: { } forEach (nearestObjects [player, ["House_F", "CAManBase"], 500])

#

I believe eventhandlers will have to be applied to each unit within the editor, but in the init.sqf it can be written only once

ivory nova
#

I see, thank you

#

omg it works

#

@jade abyss @earnest valve Thank you so much!

earnest valve
#

Your welcome ๐Ÿ˜ƒ

ivory nova
#

๐Ÿ˜ƒ

#

Will this player addEventHandler ["GetInMan", {_this execVM "spawn_smoke.sqf"}]; which calls this _Smoke = "SmokeShellBlue" createVehicle [0,0,0]; _Smoke attachTo [(vehicle player),[0,-1.2,0]]; work for all players on a multiplayer mission?

jade abyss
#

Should work.
+keep in mind: The Smokes deplete after X Seconds.

ivory nova
#

I see thanks

#

Yeah, I'm trying to figure out a way to repeat the Event Handler after x amount of time

jade abyss
#

or

earnest valve
#

you made a typo with Smoke = "SmokeShellBlue" createVehicle [0,0,0];

ivory nova
#

The script I mean

earnest valve
#

it should be _Smoke

jade abyss
#

Its discord, rawner

earnest valve
#

just fixing a typo that might cause the script to fail. ๐Ÿ˜›

#

{ _Smoke = "SmokeShellBlue" createVehicle [0,0,0];
_Smoke attachTo [(vehicle player),[0,-1.2,0]] } forEach allUnits;

#

that might work, I think

jade abyss
#

nope

#

Since, as i wrote before, you create a Smoke for Each player on the Server

#

On YOU

#

I mean, yeah, it works, but its not the result you want.

earnest valve
#

yeah

jade abyss
#

Remember what i wrote before ( using " _x " )

earnest valve
#

I would presume it would have to be initialized by the init.sqf or initPlayerLocal.sqf

ivory nova
#

yes ๐Ÿ˜ฆ

#

Okay, I will get back to trying ๐Ÿ˜ƒ

jade abyss
#
  • Go to your init.sqf
earnest valve
#

or you could just simply have: if (!isServer) exitWith {}; in the init.sqf to initialize the smoke script

ivory nova
#

๐Ÿ˜ฎ

earnest valve
#

if (!isServer) exitWith {};
_Smoke = "SmokeShellBlue" createVehicle [0,0,0];
_Smoke attachTo [(vehicle player),[0,-1.2,0]];

#

would that work?

#

for the init.sqf?

jade abyss
#

(following is quick and dirty, but works)
Add this to your init.sqf

MyTag_fnc_SpawnSmoke = {_handle = execVM "spawn_smoke.qsf";};

player addEventHandler ["GetInMan", { [] spawn MyTag_fnc_SpawnSmoke; } ];
ivory nova
#

Let me try ๐Ÿ˜ƒ

#

it appears to work ๐Ÿ˜ƒ

#

I will get someone to join me and see if it works for them too

jade abyss
#

Now, your task:
Ask yourself, what could be the Problem?

ivory nova
#

Hm, let me think

jade abyss
#

Lets say, i am a retarded fkr. I get in the vehicle, get out, get in, get out.

#

What is happening?

ivory nova
#

Well, wouldn't the event handler be called constantly?

jade abyss
#

Exactly

#

Whats the result of it?

ivory nova
#

You would spawn multiple smokes inside the heli

#

Guess that could cause performance problems after some time

jade abyss
#

Yes. Soo, whats a way around it?

#

(hint: an EH again)

ivory nova
#

GetOutMan? ๐Ÿ˜ƒ

jade abyss
#

๐Ÿ˜‰

ivory nova
#

I will try it now ๐Ÿ˜ƒ

ivory nova
#

Can anyone recommend the best way to loop through this so that the smoke respawns once depleted?

#
_Smoke = "SmokeShellBlue" createVehicle [0,0,0];
_Smoke attachTo [(vehicle player),[0,-1.2,0]];
sleep 60;
deleteVehicle _Smoke;
};```
lone glade
#

You do realise that if the player gets out of the vehicle he'll have a smoke attached to him, right?

timber shore
#

Uh after the sleep 60 paste it again

#

Hahaha he will you've attached it to the person

lone glade
#

no, it's not that

ivory nova
#

Hm, I see

jade abyss
#

psst @lone glade Let him find that out on his own ๐Ÿ˜›

timber shore
#

AttachTo vehicle player is the player when he is out of the car?

lone glade
#

nope, it's because of scheduled

timber shore
#

@jade abyss evil

jade abyss
#

The way to learn it ๐Ÿ˜‰

lone glade
#

thing is, generally people don't learn and then make workaround with while

ivory nova
#

I was going to try while lol

jade abyss
#

@ivory nova Remember this:

MyTag_fnc_SpawnSmoke = {_handle = execVM "spawn_smoke.qsf";};

player addEventHandler ["GetInMan", { [] spawn MyTag_fnc_SpawnSmoke; } ];

AND " _Smoke "

timber shore
#

Hahaha

jade abyss
#

+remember what i wrote before: " (following is quick and dirty, but works) " ๐Ÿ˜›

timber shore
#

Mm I'm suck on something

ivory nova
#

Yes I am using that in init ๐Ÿ˜ƒ

jade abyss
#

i meant: "" [] spawn MyTag_fnc_SpawnSmoke; ""

lone glade
#

So every player will spawn a smoke ....

ivory nova
#

Do you mean, I could just loop the event handler instead?

#

@lone glade yes

jade abyss
#

You can make a check, if the smoke still exists or not

#

for example: Add this behind the existing script.sqf:

waitUntil{ isNull _Smoke OR (vehicle Player isEqualTo player); sleep 1;};
if( vehicle Player isEqualTo player) exitWith{};
if(isNull _Smoke)exitWith{[] spawn MyTag_fnc_SpawnSmoke;};
ivory nova
#

Thank you! I will try it now!

timber shore
#

I need to have scripts (or functions) run when a player is at a certain damage. For example when a player getDamage >= 0.6 run bleeding.sqf and when >= 0.9 run unconscious.sqf

#

Any idea on how?

lone glade
#

Use handleDamage

timber shore
#

that will constantly monitor their health?

lone glade
#

no

#

it's an eventHandler

timber shore
#

Mm however they can lose health from bleeding, ( player on 0.85 damage and bleeding.sqf then goes setDamage _currentDamage + 0.05 ) so they'll hit 0.9 that way

#

A HandleDamage EVH wouldn't pick that up?

lone glade
#

it would

timber shore
#

Oh fantastic, saves a lot of time

jade abyss
#

@coral pasture Remember: 0.9 Dmg to the head -> Player is dead

timber shore
#

I've used setDamage 0.9 on player before and it hasn't killed the unit

jade abyss
#

"to the head"

timber shore
#

My belief was just setHitPointDamage to head would be the one which kills the player

jade abyss
#

player setHitpointDamage ["HitHead",0.9];

#

Yeah

#

nvm, missread the line

timber shore
#

Haha all good, also if someone is shot in the head I don't want them unconscious, they should be dead

ivory nova
#

@jade abyss It works perfectly, thank you for all your help ๐Ÿ˜ƒ

jade abyss
#

Now find out the rest, on your own.

ivory nova
#

Will do, apologies for so many requests

jade abyss
#

np, i am in good mood today ๐Ÿ˜›

#
  • wth? setHitpointDamage doesn't update "damage"? oO aw cmon bis
timber shore
#

@lone glade worked out, thanks bud didn't think it'd work with an EVH

jade abyss
#

Can anybody test this: Place yourself and an AI in the editor (not grouped) -> Try to get closer than 1m to it (from the front)

ivory nova
jade abyss
lone glade
#

dev branch, RC or stable ?

jade abyss
#

stable

lone glade
#

That looks like normal behavior to me

jade abyss
#

Haven't tested Vanilla yet.

lone glade
#

What mods are you using?

jade abyss
#

2017

#

Can you test it in vanilla?

lone glade
#

Best way to know would be to show the boundingBoxReal on you and the ai and comapre vanilla vs modded if there's a difference

#

I highly doubt there is.

jade abyss
#

Congrats @ivory nova

blazing zodiac
#

Anyone have any ideas on the best way to go about getting an AI unit to get to cover?

leaden turtle
#

anyone have a Evade and Escape check I tried using F3 but its not working

ivory nova
#

I would like to attach a custom particle effect to a position on 'whatever vehicle any player just got into'

#

Would it be incorrect to use createVehicle to do that?

#

I can get the particle effect to work fine, but having trouble attaching

ivory nova
#

Guess I'm just stoopid

#

Fixed it ๐Ÿ˜ƒ

#
_object = "Land_Bucket_F" createVehicle _pos1;
_object attachTo [(vehicle player),[0,-1.2,0]];```
#

Anyone know if anyone's ever made like a particle effect editor?

ivory nova
#

I have a script that calls a custom particle effect every time someone gets in a helicopter

#

Anyone know how I could randomly assign a colour to the effect?

#

The colours are represented like this [[0.4,0.4,0.4,0.7], [0.6,0.6,0.6,0.4], [0.8,0.8,0.8,0.2],[1,1,1,0.1]]

#

Would it be possible to create a list of options in that format, and replace the colour [] with something that picks something from the list randomly?

indigo snow
#

_color = selectRandom [my,list,of,colors]

ivory nova
#

๐Ÿ˜ฎ

#

Thank you I will try it now!

#

@indigo snow It worked, thank you so much ๐Ÿ˜ƒ

jade abyss
ivory nova
#

Woah, good idea, thank you

ivory nova
#

Anyone know why a script would run when I hit the "Play in Singleplayer" button, but not when I right click > play from here or right click > play as this character?

marsh lodge
#

Where is the script called?

ivory nova
#

Called from init.sqf

marsh lodge
#

I would assume that nothing is initialized when playing as a character

ivory nova
#

I see, interesting

#

Thanks!

marsh lodge
#

I can't say for sure, but I am making that assumption

valid dew
#

A quick question

#

if I am using execVM in a units init line to call a respawn script

#

how do I reference the unit?

#

with "this"

#

or to I use _this select x?

indigo snow
#

That depends entirely on what your execVM arguments are

valid dew
#

just execVM "respawn.sqf";

#

placed in the init line of each unit

indigo snow
#

Look at the wiki page for execVM

#

You pass arguments with the array in front of it

valid dew
#

so it'd be null = {this} execVM "respawn.sqf";

#

?

jaunty drift
#

null = [this] execVM "respawn.sqf";

valid dew
#

Awesome

#

Thanks mann

#

man*

indigo snow
#

Inside your sqf, the unit is now _this select 0

valid dew
#

Alright awesome

earnest valve
#

Hey guys. I am creating custom behaviour for the Xenomorph that is a WIP, and I am not sure whether this idea can be possible. So far, I have made it look for lonely targets and then stalk them, but I am wondering if it is possible to create code that will outsmart players. ๐Ÿ˜› . Obviously if a Xeno ran away and hid in a little bush, the players would know what direction to shoot when it comes back. So the xeno needs to calculate (or load some custom waypoint script) how to attack the player, without making it obvious.

winged thistle
#

In Arma 3, is there a function in script equivalent to clicking the "Toggle Map Textures" button in the top right of the main map that I could use for a custom map control?

#

I have a custom minimap and want to be able to switch textures like the main map.

#

I am aware of Nimrod's Map Texture script, but I need the actual functionality of the Toggle Map Textures button, not just a script that automatically clicks the button.

agile pumice
#

Had a question in regards to lazy eval: Is it okay to use lazy eval with or statements? if (!(isNil VehicleShopTempCar) or !{isNull VehicleShopTempCar}) then {

vapid frigate
#

yeah

#

it will only try the isNull if the !isNil is true

agile pumice
#

thanks

winged thistle
#

I just finished browsing the configs, but didn't see anything that might be associated with the "Toggle Map Textures" button. Any help would be much appreciated. ๐Ÿ˜„

vapid frigate
#

@winged thistle: looks like it calls this
onbuttonclick = "with uinamespace do {['ButtonTextures',_this,''] call RscDiary_script};";

winged thistle
#

I just found the control in the config, but I didn't see that onbuttonclick. How did you find it?

#

Thanks, btw ๐Ÿ˜„

vapid frigate
#

ui_f\config.cpp

#

line 12427

#

in class RscDisplayMainMap

winged thistle
#

You're my hero, @vapid frigate ๐Ÿ˜„

#

Hmm, I can find config.bin but not config.cpp

vapid frigate
#

need to unbinarize it i guess

#

i used mikero's arma3p to make my P:

#

it automatically unbinarizes the configs

winged thistle
#

Ah, I'll search for that

#

Thanks again. ๐Ÿ˜„

vapid frigate
#

aka 'derapifies' the configs

winged thistle
#

lol

vapid frigate
#

you can see it in the config viewer too

winged thistle
#

That'd be much easier for me.

vapid frigate
#

configFile >> RscDisplayMainMap >> controls >> TopRight >> controls >> ButtonTextures

winged thistle
#

I was so close. Was in:
configFile >> RscDisplayMainMap >> controls >> ButtonTextures

#

It still doesn't tell me how to switch the control display mode.

vapid frigate
#

yeah, I saw that too, not sure what it is

winged thistle
#

I tried feeding it a control instead of _this

#

It didn't like it

#

There are only two lines of code in RscDiary.sqf for that condition, too ๐Ÿ˜ฆ

vapid frigate
#

having a look.. not sure what RscDiary_script is

winged thistle
#

Thanks a lot man ๐Ÿ˜„

#

I'm thinking it's gotta be RscDiary.sqf, using ButtonPlayer as a guide

#

But it's weird because all that the textures button would do is activate itself when clicked...

vapid frigate
#

it looks like it 'activates' control with idc 107, which is RscDisplayMainMap >> controls >> ButtonTexturesReal

#

can't find what the event for that is though

winged thistle
#

That's where I was stuck. I didn't see an onbuttonclick or action for ButtonTexturesReal

#

Maybe the action is added to that button during the onLoad from RscDiary.sqf

#

?

#

That's so weird. I don't see any action being added to it. There has to be an event somewhere because it does something in the game...

#

Instead, it just looks like it calls itself when you click it...

vapid frigate
#

Yeah I don't know sorry, I can't find what it does

#

Looking at the ACE3 microdagr though, it looks like they use 2 separate controls

#

and hide/show when you toggle

winged thistle
#

I'll have to give it a shot. Do you know where the map images might be?

#

ui_f_data maybe?

vapid frigate
#

not sure, but you don't need to specify them

winged thistle
#

Oh?

vapid frigate
#

you just use maxSatelliteAlpha = 0;

#

in the config for the map control

winged thistle
#

What is this wizardry?

vapid frigate
#

are you making your own map controls (in a config.cpp or description.ext? )

winged thistle
#

Yeah

#

It's all built with buttons already

vapid frigate
#

then yeah, basically just make 2

winged thistle
#

Just need this last thing to work ๐Ÿ˜›

vapid frigate
#

one with maxSatelliteAlpha = 0.5; or 1, one with maxSatelliteAlpha = 0;

winged thistle
#

I'm assuming the maxSatelliteAlpha is what makes the trees and features show/hide?

vapid frigate
#

just the satmap texture afaik

#

like the map screen does

winged thistle
#

That's a beautiful way of doing it ๐Ÿ˜„

#

Then I can just ctrlEnable true/false between the two?

vapid frigate
#

ctrlShow, but yeah

#

enable would just 'grey it out'

winged thistle
#

Too bad there isn't a function to just set that value manually

#

Oh, my bad. Thanks ๐Ÿ˜›

vapid frigate
#

yeah, there's a lot of things lacking with UI scripting, but it's a hell of a lot better than it was a year ago

winged thistle
#

While we're on the topic, got any idea how to have my UI refresh automatically?

vapid frigate
#

you can make most UI stuff dynamically without configs now, where it wasn't possible a year ago

winged thistle
#

I tried researching how to do it but came up pretty dry

vapid frigate
#

depends how often i guess

#

every frame?

winged thistle
#

Once per second

#

It's supposed to show a timer counting backwards

vapid frigate
#

don't think there's any sort of event handlers for timers, so i think you'd just have to use a spawned infinite loop with a sleep 1;

#

Be aware that timing won't be accurate though

winged thistle
#

I tried messing with a while loop while the display was open but didn't get any success

vapid frigate
#

should work fine, just make sure you spawn it (don't call it)

winged thistle
#

If I can get these two things to work, my spawn menu will be basically done ๐Ÿ˜„

#

I'll give it another shot. Maybe I was just doing something wrong earlier.

#

I bet what happened was when I spawned the loop, I forgot to pass parameters to the function

vapid frigate
#

if it's a spawn menu, make sure the loop ends when you close it too

#

to save some performance (even if it's not much)

winged thistle
#

How do I format code on here?

vapid frigate
#

not sure

winged thistle
#

Hm. Well, in any case, could I do this:
while {findDisplay 60542} do {/.../};

#

Or no, that won't work. The menu would then have to be open to open itself >.<

#

My problem is the switch that controls the menu

#

Either way, you've been amazingly helpful, and I genuinely appreciate it ๐Ÿ˜„

grizzled cliff
#

lol

#

use backticks for inline code

#

like `

#

if you want to do a block of code do ```

#

and then again to end it

#

some inline code ```
and a block of code

vapid frigate
#

test

#

cool ๐Ÿ˜ƒ

winged thistle
#

@grizzled cliff Thanks ๐Ÿ˜„

agile pumice
#

Just a warning to all life mod developers, there's a guy named travis butts going from community to community stealing content

grizzled cliff
#

lulz life mods

agile pumice
#

under the guise of helping with development

#

this is what one of his apps looks like

deft lion
#

"Sure, we can give you a shot.. We are looking for a new Dougnut shop."
There's a joke here somewhere...

winged thistle
#

How can I make this loop while the menu is open?

agile pumice
#

while {dialog}

winged thistle
#

I got it to work with some help from @vapid frigate

#

Thanks ๐Ÿ˜„

agile pumice
#

glad to hear it

hasty pond
#

My brain isn't working now but ExtDB is returning an array like this [1,[["[ItemMap,ItemCompass,ItemWatch,ItemRadio,NVGoggles]","[U_B_CombatUniform_mcam,V_PlateCarrier1_rgr,H_HelmetB]"]]] And I just realised that I have a problem because every array inserted that has strings inside those arrays is itself transormed into a string and I can indeed call compile that string to get the array but then I'm faced with an issue of having an array full of some strange stuff that is supposed to be strings

vapid frigate
#

it's removing the quotes around each item?

#

maybe using ' would work? (haven't used ExtDB)

warped oak
#

Anybody have a script for the AI to use fast rope

#

I really like the ACE3 one module, but it doesnt work for the AI

hasty pond
#

Lecks it could work, I've never used ' with SQF though

vapid frigate
#

it works the same

#

as "

#

(and for quotes inside quotes you can do "one 'two'" or 'one "two"'

hasty pond
#

Ah ok. I don't know how I would work that in though, because I have for example the clothes array like this inserted into the db: _clothes = [(uniform _player), (vest _player), (backpack _player), (headgear _player)];

vapid frigate
#

i guess

#

clothes=format["['%1', '%2', '%3', '%4']", (uniform _player), (vest _player), (backpack _player), (headgear _player)];

hasty pond
#

That works let me see if it still works when it's out of the DB ๐Ÿ˜„

vapid frigate
#

clothes won't be a normal array until you call compile it

hasty pond
#

Yeap

vapid frigate
#

seems wierd that you have to do that though, I thought ExtDB would

hasty pond
#

I don't know but I've been debugging my saving for like a couple of days now and I think this could be the final thing that's holding it up

hasty pond
#

@vapid frigate I think I might be able to solve this by only inserting strings into the database, maybe

vapid frigate
#

yeah, maybe that's how ExtDB is designed, not sure

hasty pond
#

Welp, thanks for all the help ๐Ÿ˜ƒ

hasty pond
#

I think I found the solution.

ivory nova
#

I would like to call a different particle effect based on a players distance to the ground; currently I call the particle effect based on the GetInMan parameter in init

#
player addEventHandler ["GetInMan", { [] spawn MyTag_fnc_ParticleEffect; } ];```
#

Am I wrong in thinking I could put an argument before spawn, like ((getPosATL (vehicle Player) select 2) < 5) to only spawn that script based on distance to ground?

winged thistle
#

You can.

#

Just surround it with an if statement

ivory nova
#

awesome, i will give it a shot, thank you!

winged thistle
#

np

#

Alright, 16 hours is enough coding for today.

#

Thanks for the help today guys

ivory nova
#

Woah ๐Ÿ˜ฎ

#

What are you scripting?

tough abyss
#

@hasty pond Looks like you fucked up ๐Ÿ˜ƒ
I am assuming you are using SQL_RAW_V2 with added quotes options turned.
Because extDB2 doesn't add quotes unless you tell it to. You really should look at using SQL_CUSTOM_V2 more control & alot safer since its using prepared statements

hasty pond
#

It was me being stupid af tbh ๐Ÿ˜„

#

I was using sql custom v2 but I somehow made arrays strings in the prepared statement or smth.... Anyways it's fixed now

tough abyss
#

What you guys working on

hasty pond
#

Getting my server to interact with DB correctly and I think I am pretty much done

agile pumice
#

need a bit of help with getarray to get some configfile details

#

my config structure looks like this: ```class CfgFunctions
{
class MG_System
{
class Protected

#

but (getArray (configFile >> "CfgFunctions" >> "MG_System" >> "Protected")) returns []

vapid frigate
#

Protected is a class, not an array

#

you can loop through it's members like an array though

agile pumice
#

ah shit

#

your right

#

get children right?

vapid frigate
#

{ _protected pushback [configName _x, getText _x] } foreach (configFile >> "CfgFunctions" >> "MG_System" >> "Protected")

agile pumice
#

} forEach (configClasses (configFile >> "CfgFunctions" >> "MG_System" >> "Protected")); ?

vapid frigate
#

depends what is in protected

agile pumice
#

gimme 2 mins

vapid frigate
#

if it's classes, yours. If it's text variables, mine

agile pumice
#

its classes

#

no clue whey I tried to get an array lol

vapid frigate
#

err is configClasses a command?

agile pumice
#

yeah

vapid frigate
#

ah yeh

agile pumice
#

ive used it before

vapid frigate
#

i think you need the "true" at the start

agile pumice
#

which is why I'm disappointed

#

you're right

zealous arrow
#

Would I be right in saying that marker names cannot have spaces in them? i.e createMarker ["name of marker", [0,0,0]];

ivory nova
#

Sorry for newby question. I'm trying to get a couple of particle effects to fire based on distance to the ground. I currently fire the first effect via a GetInMan event handler but have had some trouble working out how to then transition between this and another effect later on. http://i.imgur.com/K49YN7T.png

#

Anyone able to give me some clues as to where I'm going wrong, or point me in the right direction?

ivory nova
agile pumice
#

where's the sleep in your while loop

ivory nova
#

Ahh, so I need to sleep the while condition so it has time to check the height? I'll try it now thank you

#

@agile pumice Theoretically with sleep in the while loops should what I have there work?

agile pumice
#

I'm not entirely sure, sorry

ivory nova
#

@agile pumice No problem, I'll keep trying ๐Ÿ˜ƒ

blazing zodiac
#

The reason buckets are spawning like that is because you have the buckets being created in your while loop

#

So you are creating a bucket every second @ivory nova

ivory nova
#

I see ๐Ÿ˜ฎ

#

Is while inappropriate for what I'm trying to do?

blazing zodiac
#

Well as far as the bucket goes, is the particle effect supposed to be coming out of it?

ivory nova
#

(It also created buckets in a uniform grid over the entire map)

#

Yes, normally it works fine. The PE is attached to the bucket

#

And the bucket is attached to the player

blazing zodiac
#

Do you want the bucket to be able to be seen?

#

or is that offset inside the vehicle model?

ivory nova
#

It is offset yeah

#

I have an example

blazing zodiac
#

So as far as the buckets goes I would create it in the eventhandler, not the loop.

ivory nova
#

Basically I just want to have it switch between two PEs depending on height

#

Ahh, I see

blazing zodiac
#

Then pass it to the function as a param if you wanna attach it still

#

so create the bucket and attach it to the vehicle in the eventhandler

#

and pass _object as a param to the function MyTag_fnc_particleEffect or whatever the name was

#

Then you can use it in the loop with _object = _this select 0; in the beginning of the function

#

That way only one will be created

ivory nova
#

I see, thank you!

#

When I only call the one PE, I don't run into the bucket issue

#

Is not declaring this in the EH causing issues having two PEs?

blazing zodiac
#

so only the ground one is firing correct?

#

That would make sense looking at the way it's written

ivory nova
#

Yes, only the ground PE fires

blazing zodiac
#

Ok so you need the check you are using for you loop in a loop

#

Because that eventHandler is only firing once when you get in

#

so _ground is always true and _sky is always false

ivory nova
#

Ahh!

blazing zodiac
#

So to get it to work maybe put those two checks in a while loop with like a 2 second sleep or something since it's not critcal

#

maybe longer

#

I'm sure there's a better way to go about the whole process but It's 7 am here and I've been goin all night

#

But that should work for now I would think

ivory nova
#

I really appreciate the help!

#

I will try a while loop

#

And sorry, very new to scripting

blazing zodiac
#

No problem

#

You can name those functions in any way you want they way you are doing it as well

#

The MyTag_fnc_Function name structure is an example assuming you are delcaring the in via cfgFunctions

#

The way you are delcaring them as global variables

#

You should do something like Roundlay_ParticleEffectGround = call compile preproccessfilelinenumbers "particle_effect_ground.sqf";

#

in your init

#

Then you can call those from whereever with either spawn Roundlay_ParticleEffectGround or call Roundlay_ParticleEffectGround

ivory nova
#

Woah, awesome tip! I will do that now

blazing zodiac
#

and you can obviously still pass params to them with [_paramToPass] spawn Roundlay_ParticleEffectGround;

ivory nova
#

Would parameters include an argument? Sorry, even my vocabulary isn't up to it yet. Could I pass something like ((getPosATL (vehicle Player) select 2) <= 2); into it?

blazing zodiac
#

Ok so looking at this just putting those conditions into a while loop isn't gonna work

#

No it would be variables only I think

ivory nova
#

Ahh, I getcha

#

I also tried just using one file for the PEs, and using if (condition) then [ { code }, { code } ]

#

so if (right_height) then [{pe1}, {pe2}]

#

But also didn't have any luck

#

But it might be because it's tied to a GetInMan ?

#

I figured the if(isNull _object) exitWith {[] spawn MyTag_fnc_ParticleEffect;}; at the end of the file must loop back to the top but I must be wrong

blazing zodiac
#

so you should be able to handle that in the eventhandler itself I think

ivory nova
#

Ahh, I see

blazing zodiac
#

Give me a sec, I'll put something together

ivory nova
#

๐Ÿ˜ฎ Thank you so much!

blazing zodiac
#
_object attachTo [(vehicle player), [0, -1.2, 0]];
while { vehicle player != player } do {
  if ((getPosATL (vehicle player) select 2) <= 2) then {
    //ground particle effect here
  } else {
    //sky particle effect here
  };
  sleep 1;
};```
#

That's obviously untested but it should accomplish everything you were trying to do I believe

#

That replaces the code you have in the eventhandler itself

ivory nova
#

๐Ÿ˜ฎ Thank you!! I will try it out now

blazing zodiac
#

O wait

#

forgot a few things

#
_object attachTo [(vehicle player), [0, -1.2, 0]];
while { vehicle player != player } do {
  if ((getPosATL (vehicle player) select 2) <= 2) then {
    //ground particle effect here
  } else {
    //sky particle effect here
  };
  sleep 1;
};
deleteVehicle _object;```
#

Ok just that actually I think

#

So basically, this will trigger when you get in a vehicle

#

it will create the bucket

#

attach it to your vehicle at the offset you set

#

while you are still in the vehicle it will run this loop

#

and keep checking the conditions you set

#

every second

#

and depending on the height above ground it will either play the ground or sky particle effect

#

and once you leave a vehicle it will kill the loop

#

and cleanup the bucket

ivory nova
#

Awesome, I really appreciate the explanation too! I will try it out now!

blazing zodiac
#

And should be triggerable again by the eventhandler firing again

ivory nova
#

I can call it from the original event handler you mean?

#

In init I mean

blazing zodiac
#

You won't have to manually

#

Also in the init

#
player addEventHandler ["GetInMan", { spawn Roundlay_ParticleEffect; } ];```
jade abyss
#

MyTag_

#

!!

blazing zodiac
#

That way if you have show script errors checked in the launcher (you should) it will tell you where errors are and what line number they are at

#

I know @jade abyss lol

#

At least we know he looked up the functions page on the biki

ivory nova
#

I think @jade abyss helped me with that originally ๐Ÿ˜ƒ

#

Testing it out now

jade abyss
#

Me? I did nuttin

#

nonononononononononono

ivory nova
#

An interesting thing

#

This init MyTag_fnc_ParticleEffect = call compile preprocessFileLineNumbers "particle_effect.sqf"; player addEventHandler ["GetInMan", { [] spawn MyTag_fnc_ParticleEffect; } ];

#

doesn't seem to do anything, and MyTag_fnc_ParticleEffect = {_handle = execVM "particle_effect.sqf";}; player addEventHandler ["GetInMan", { [] spawn MyTag_fnc_ParticleEffect; }]; seems to call both at once ๐Ÿ˜„

#

I don't want to be a nuisance though, you've already helped me so much

#

Thanks so much @blazing zodiac !

jade abyss
#

Alternative:

MyTag_fnc_ParticleEffect = 
{
Copy everything from the .sqf File in here
};

player addEventHandler ["GetInMan", { [] spawn MyTag_fnc_ParticleEffect; }];
ivory nova
#

Woah

blazing zodiac
#

Yes, you can definitely do it like that as well

#

And what do you mean both at once?

#

both particle effects?

ivory nova
#

Once at 2m or above both PEs are active ๐Ÿ˜ƒ

#

does sqf support elseIf?

#

Maybe I could put another height equation in there

blazing zodiac
#

I've never worked with particle effects but can you set the length on them

#

if so the length would need to be 1 second

#

or they would need to be stopped every second

ivory nova
#

I can set the lifetime yes, but hoping to keep their life times quite long, for smoke trails

blazing zodiac
#

Yes but they condition checks will keep them going

#

and it checks the condition every 1 second

#

then executes the code effect

ivory nova
#

alright, I will try it now ๐Ÿ˜ƒ

blazing zodiac
#

so make them last 1 second and they will be continous but they should "toggle" between the 2 depending which condition is met every second

ivory nova
#

now there are 2 PEs, but they are huge lol

jade abyss
#

if( ((getPosATL player) select 2) < 2)then{}else{};

blazing zodiac
#
_object attachTo [(vehicle player), [0, -1.2, 0]];
while { vehicle player != player } do {
  if ((getPosATL player) select 2) < 2) then {
    //ground particle effect here
  } else {
    //sky particle effect here
  };
  sleep 1;
};
deleteVehicle _object;```
#

That's it redone using his check

#

are you calling the scripts you wrote still or doing the particle effects directly in there?

#

I would probably just create the particle effect directly in there

ivory nova
#

Calling from directly in there now yep

#

Thank you once again!

#

Trying it this way

blazing zodiac
#

woops

#
_object attachTo [(vehicle player), [0, -1.2, 0]];
while { vehicle player != player } do {
  if ((getPosATL (vehicle player) select 2) <= 2) then {
    //ground particle effect here
    systemChat "Below 2";
  } else {
    //sky particle effect here
    systemChat "Above 2";
  };
  sleep 1;
};
deleteVehicle _object;```
#

There fixed it

#

You can use that to make sure it's toggling and nail down where the bug is

#

It'll come up in the bottom left

ivory nova
#

Awesome! Trying again ๐Ÿ˜ƒ

#

With this one, it no longer calls the PEs when I get in a vehicle

blazing zodiac
#
_object attachTo [(vehicle player), [0, -1.2, 0]];
while { vehicle player != player } do {
  if ((getPosATL player) select 2) <= 2) then {
    //ground particle effect here
    systemChat "Below 2";
  } else {
    //sky particle effect here
    systemChat "Above 2";
  };
  sleep 1;
};
deleteVehicle _object;```
#

Use that one exactly how it is

#

It won't spawn the PEs

#

Just check the bottom left for the text that says Below 2 or Above 2

#

Depending on your height

ivory nova
#

Ahh, sorry! I understand now

#

Trying now

blazing zodiac
#

And they should trigger every 1 second

ivory nova
#

Hm, no text appears ๐Ÿ˜ฆ

#

Oh, wait

#

Nevermind, trying again

#

Switches between above and below perfectly ๐Ÿ˜ƒ

blazing zodiac
#

Ok that's good

#

What that means is the eventhandler condition and loop is working properly

#

So the problem is somewhere in the particle effects

#

I've never done anything with particle effects personally so I don't have any experience in that

#

Can you show me the particle effect scripts expanded out

#

?

ivory nova
#

Sure!

#
_ps1 setParticleCircle [0, [0, 0, 0]];
_ps1 setParticleRandom [5, [0.1, 0.1, 0], [0.1, 0.1, 0.0], 0.3, 0.5, [0, 0, 0, 0.5], 0, 0];
_ps1 setParticleParams [["\A3\data_f\ParticleEffects\Universal\Universal", 16, 12, 8,0], "",
/*Type*/ "Billboard",
/*TimmerPer*/ 3,
/*Lifetime*/ 60,
/*Position*/ [0, 0, 0],
/*MoveVelocity*/ [0, 0, 0],
/*Simulation*/ 0, 11.48, 9, 0.03, //rotationVel,weight,volume,rubbing
/*Scale*/ [1, 6, 12],
/*Color*/ _colour,
/*AnimSpeed*/ [0.125],
/*randDirPeriod*/ 1,
/*randDirIntesity*/ 0,
/*onTimerScript*/ "",
/*DestroyScript*/ "",
/*Follow*/ _object];
_ps1 setDropInterval 0.012;```
#

And the colour is set with _colour = selectRandom [ [[0.90, 0.90, 0.90, 0.50], [1.00, 1.00, 1.00, 0.20], [1.00, 1.00, 1.00, 0.001]] ];

blazing zodiac
#

Ok do you want the color changing?

ivory nova
#

Between air and ground, I was hoping to only change rubbing and lifetime

jade abyss
#

_colour = [ random[0,0.5,1], random[0,0.5,1], random[0,0.5,1] ]; cough

ivory nova
#

lol, oh god, i didn't know

#

Thank you!

blazing zodiac
#

So without looking up these commands it looks fine except lifetime should be 1

#

And what's rubbing?

ivory nova
#

Rubbing seems to be how responsive the particel effect is to environmental factors like wind

#

when I set it high, wind blows it around a lot, when it's low, it stays almost in place

#

low good for smoke trails, but makes sense to blow around a lot on ground, if ya get me

blazing zodiac
#

Yea I gotcha

#

What happens right now if you put your two different particle effects in the eventhandler _object = "Land_Bucket_F" createVehicle [0,0,0]; _object attachTo [(vehicle player), [0, -1.2, 0]]; while { vehicle player != player } do { if ((getPosATL player) select 2) < 2) then { //ground particle effect here systemChat "Below 2"; } else { //sky particle effect here systemChat "Above 2"; }; sleep 1; }; deleteVehicle _object;

#

One where it says //ground particle effect here, and the other where it says //sky particle effect here?

ivory nova
#

I will try now ๐Ÿ˜ƒ

#

Just to clarify, this should all be within MyTag_fnc_ParticleEffect = { } right?

#

That's how I've been testing it

#

Then calling with GetInMan

blazing zodiac
#

Oh yea set the duration to 1 for the particle effect

#

Yea you can do it that way

ivory nova
#

Alrighty

blazing zodiac
#

Do you have showScriptErrors enabled?

#

in your launcher

ivory nova
#

yep!

blazing zodiac
#

Ok good

ivory nova
#

So when I set the lifetime to 1, the effects grow huge, move very quickly, and both effects appear at the same time

#

ill try changing timmerper from 3 to 1 instead

#

hm, and when I change timerper to 1, the effect only lasts 1s and doesn't swap between effects, lemme try both at 1 ๐Ÿ˜ƒ

#

only reason i had lifetime at 60 is because i assumed it was seconds

#

seems to work out that way

blazing zodiac
#

Yea I would assume it's seconds as well

ivory nova
#

yeah when both are 1 it's the huge effects, short period thing

blazing zodiac
#

I guess if you want the trails to stay though it would be a longer lifetime,

ivory nova
#

Mm

#

In the context of a dogfight scenario

#

Just thought it would make things interesting, and wanted to see if I could swap between particle effects, but it's so far over my head at the moment

blazing zodiac
#

Right, the condition check is working so it should be possible

#

Just need to figured out what you need to do with the rest

#

Well the particle effects themselves

ivory nova
#

It actually works! It just doesn't remove the relevant PE at height

#

maybe at the beginning of else

#

remove object?

#

oh, but then nothing to attach to

blazing zodiac
#

Oh so they are working just both are firing at once?

ivory nova
#

yes, it actually works correctly, but both remain active

blazing zodiac
#

The one when you are on the ground is staying active

ivory nova
#

maybe if i link both to two seperate objects?

jade abyss
#

Q: Why create 2?

blazing zodiac
#

Yea can't you modify the properties

jade abyss
#

I assume, you use "while{true}", right?

#

?! oO

blazing zodiac
#

Create one particle effect and change the color when the condition changes

jade abyss
#

_name = blabla
while
{
if (Condition) then { _name setcolor blabla } else {_name setcolor blabla2 };
};
Why not, like that?!

blazing zodiac
#

Yea which particle effect did you give me?

#

ground or sky?

ivory nova
#

I gave you sky

#

I tried attaching each PE to a different object and deleting the first upon else but also didn't work

#

@jade abyss Was hoping to just change rubbing and lifetime ๐Ÿ˜ƒ

blazing zodiac
#

It's too long to post in here

jade abyss
#

Color was just an example

ivory nova
#

Ahh I getcha, sorry

#

I will experiement with it

blazing zodiac
#

Try something like that

#

Where you create the particle effect when the event handler triggers

#

and then you only modify the params when the conditions change

jade abyss
#

Should work.

blazing zodiac
#

deleteVehicle _ps1;

#

add that to the end

#

after deleteVehicle _object;

ivory nova
#

giving it a shot now!

blazing zodiac
#

I added that attachTo to attach it to your bucket object

#

since it will only be created once?

ivory nova
#

Yep!

blazing zodiac
#

Also if that bucket was only a helper object you don't even need it

#

You can just use the same code with the particlesource

#

I would've caught that before but I'm a little burnt lol, it's 8:30 am here.

jade abyss
#

I smell mimimi here ๐Ÿ˜›

ivory nova
#

@blazing zodiac I really do appreciate your help ๐Ÿ˜ƒ

blazing zodiac
#

Like that cleaned up a bit

ivory nova
#

Should deleteVehicle _object; deleteVehicle _ps1; always go within MyTag_fnc_ParticleEffect = {}? I get an error message in game if not

blazing zodiac
#

Yes what I just sent should all be within MyTag_fnc_ParticleEffect = { };

ivory nova
#

@blazing zodiac mate...

#

It works perfectly now

#

Thank you so, so much!

blazing zodiac
#

No problem man, we all started out somewhere.

#

Just pay it forward, that's what makes this discord channel so incredibly valuable

ivory nova
#

๐Ÿ˜ƒ I know I'm really annoying taking up the channel, I will look through everything and make sure I understand it

#

Really appreciate your help!

blazing zodiac
#

Familiarize your self with the cfgFunctions class in description.ext to properly setup functions as well.

#

Looks like you got halfway there with the naming convention you are using.

ivory nova
#

๐Ÿ˜ƒ

ivory nova
#

Alright, I will certainly do that!

#

Woah, very useful, will read through this

jade abyss
#
  • For Testing stuff -> Continue using fncName = {};
    So you can easily edit that stuff on the fly, in the editor Console.
blazing zodiac
#

Yes, the debug console is your best friend!

#
{
    class Roundlay
    {
        class debug
        {
            class resetLoadouts { file = "fnc\debug\resetLoadouts.sqf"; };
            class getSpawnPos { file = "fnc\debug\getSpawnPos.sqf"; };
        };
    };
};```
#

Quick sample for you

ivory nova
#

๐Ÿ˜ฎ

#

Didn't even know there was a debug console in the game!

jade abyss
#

Editor?

#

Pressing Esc?

ivory nova
#

Oh wait, yes I did

#

๐Ÿ˜ƒ

jade abyss
#

badumm tss

ivory nova
#

mashes tilde

blazing zodiac
#

the function resetLoadouts would call the file at "fnc\debug\resetLoadouts.sqf" with call Roundlay_fnc_resetLoadouts;

ivory nova
#

ahh, so that is like class inheritance?

blazing zodiac
#

well it's a little misleading in that example actually

#

but the class Roundlay dictates your function tag

#

So the Roundlay part of Roundlay_fnc_function name

#

the class debug can be named anything

#

and the class resetLoadouts dictates the resetLoadouts part of Roundlay_fnc_resetLoadouts

jade abyss
#

It could aslo be
class CfgFunction
{
class MySuperDuperExtremlyNiceFunction
{
class Yeah {};
FNC name:
MySuperDuperExtremlyNiceFunction_fnc_Yeah

ivory nova
#

Ahh I think I understand

#

I will have to do some reading!

jade abyss
#

wait a sec

blazing zodiac
#

Like Dscha said before though, use inline functions the way you did in the init in the debug to test stuff on the fly

#

But it's good to move them into that structure when they are more finalized as they are loaded first when in cfgFunctions

#

Only important for things that need to come before the init runs

#

Like object inits and what not

ivory nova
#

I see!

#

That sounds like a huge time saver

#

I was editing in an editor and restarting mission every time

jade abyss
#

Might be a better example:

class CfgFunctions
{
    class YourName
    {

        class Core
        {
            file = "Functions"; //Folder where the fn_NameOfFunction.sqf is in (Addon)
            file = "\Functions"; //Folder where the fn_NameOfFunction.sqf is in (for MissionFile)
            class NameOfFunction     {};

        };
    };
};
blazing zodiac
#

Wait are you a 2017 mod dev @jade abyss?

jade abyss
#

whistle

blazing zodiac
#

Also important for you Roundlay in the future

#

Shiit, I didn't know that @jade abyss. 2017 looks great man, can't wait to get my hands on it!

jade abyss
#

Check my example again @ivory nova

#

I am just a coding&Config bitch, the Visual stuff is Uro and Schultz's work ๐Ÿ˜‰

ivory nova
#

@jade abyss For sure, trying to take all of it in ๐Ÿ˜ƒ

blazing zodiac
#

Well I mean the mod as a whole but yes the visual stuff is also very impressive

#

Without that config work none of that visual stuff would be there either!

jade abyss
#

Most of the stuff isn't even announced/made public.

blazing zodiac
#

Well now I'm even more excited, damn you!!

jade abyss
#

I know, i am an a****le ๐Ÿ˜„

blazing zodiac
#

Goodluck with everything @ivory nova, never be afraid to ask the simple stuff on here either. Many of us are very active here and I know I personally love teaching and love learning and there is still plenty of learning to do when it comes to sqf for me.

ivory nova
#

@blazing zodiac Thank you so much! I really do appreciate it! Very exciting to learn for me ๐Ÿ˜ƒ I just have to learn to try for longer without taking up too much space here ๐Ÿ˜ƒ

ivory nova
jade abyss
#

Lifetime should be reduced + the amount, how often it gets kicked out. Could become a Perf Prob

ivory nova
#

Totally!

#

Wanted it to be very obvious for test ๐Ÿ˜ƒ

#

But I will do that now

ivory nova
#

I have a function defined and an event handler that calls it in init. Would using remoteExec be appropriate if I want the function to be called on all machines in a multiplayer environment?

earnest valve
#

Did you try the function BIS_fnc_MP?

ivory nova
#

Nope! Just want to get an idea of what I should try! Have to find someone to test with

#

Will read up on BIS_fnc_MP now, thank you!

earnest valve
#

Ah, ok. Yeah I haven't used remoteExec, but AFAIK, it can be initialized off individual players. (I believe it was also used to create the Altis Life messaging system, too)

ivory nova
#

I see! Interesting

#

Is it also required to set all variables to public, even inside a function?

earnest valve
#

Nope

ivory nova
#

Something like publicVariable "da_fnc";?

#

Oh, great, thank you

earnest valve
#

If you want to broadcast a variable throughout the whole server and players (e.g. a tree has fallen down after cutting it, and you don't want other players cutting it down again), then you would use publicVariable. But anything initialized on the side of the player it can be global or local.

#

For me, I think of the players in a MP server as individual Single Player cubes. Each cube (or player) has its own global and local variables. If I want to broadcast a variable to all these cubes, I would use publicVariable. So after the variable is broadcasted, all cubes will now have that variable.

ivory nova
#

Good to know, and great example! Thank you!

#

I see!

earnest valve
#

No problem. :)

ivory nova
#

So even an event handler like a GetInMan automatically works for all players?

earnest valve
#

Not entirely sure, but I do know if the EH was initialized from the init.sqf (or the EH was initialized in a script, initialized by the init.sqf), then it will locally run on each player that joins.

ivory nova
#

Awesome, thank you ๐Ÿ˜ƒ

vapid frigate
#

most event handlers are local only

#

GetInMan is applied to a unit and sounds like it could be assigned from anywhere, but only 'Persistent on respawn if assigned where unit was local.'

#

GetIn is assigned to a vehicle. The code for both will only run where the event handler was added

blazing zodiac
#

Anybody have a good way to check if a randomly generated position is inside of another object (like rocks or whatever)?

earnest valve
#

nearestTerrainObjects and/or nearestObjects

blazing zodiac
#

I had tried nearestTerrainObjects and nearestObjects but wasn't getting consistent results without blocking more areas then I would've liked. I ended up using terrainIntersect and checking the line from the position to the same position straight above it a few hundred meters in combination with findEmptyPosition to keep me out from under buildings

#

Seems to be working now

#

Running some tests to make sure

native hemlock
#

Alternatively one of the intersect/lineIntersects commands as well

blazing zodiac
#

Yes they are but I wanted them to be able to spawn in the woods and whatnot as well. The whole mission is a template that is designed to be easily moved anywhere on anymap to someone inexperienced with the editor.

#

I just ran 1000 tests with the terrainIntersect method and it seems to work fine thankfully. Was starting to get frustrated after a few hours of messing with it.

#

I do like the idea of checkVisibility for an AI system though.

#

Especially that smoke grenades effect it

ivory nova
#

@vapid frigate Thank you for the extra info

hasty pond
austere granite
#

what is it

#

Like tdoes it just change vars and stuff to random names to 'encrypt' or does it actually do anythiung?

hasty pond
#

It changes I think each character into numbers and then adds your secret variable to each number and you can't make out the code without knowing the secret variable you need to subtract

indigo snow
#

but its reversible, arma needs to be able to read it

hasty pond
#

Only thing I see is that if you can somehow keep that one variable safe, it's pretty much not readable

zealous solstice
#

that is to easy to get around i think i can decrypt this in 10 min

indigo snow
#

you cant keep that variable safe

#

every client would need it

hasty pond
#

exactly

zealous solstice
#

you can decrypt this without the variable

hasty pond
#

Yeah that could also be an issue

indigo snow
#

"could"

#

xD

hasty pond
#

๐Ÿ˜‰

turbid jolt
#

Well 66857 is the lowest number in that code sequence, there's a fair chance the secret variable is 66856, if the method of decription is simply _num = _x - aSecretVariable;

indigo snow
#

toArray minimum value is 32 (toArray " ")

#

for the code sample, the secret number is 66831

#
_code = [...]; 
_offset = ((A call CBA_fnc_findMin) select 0)+9;
_code apply {_x - _offset};
zealous solstice
#

๐Ÿ˜ƒ

indigo snow
#

just imagine some formatting

#

the biggest tell tale were the spaces actually

zealous solstice
#

haha Nice the findMin function i wrote a while ago for ace

indigo snow
#

[{_x == 32} count _code,count _code] = [919,2618]

#

๐Ÿ˜„

austere granite
#

Complete encryption

#

Unbreakable

indigo snow
#

formatting makes up 35.1% of the entire code

austere granite
#

FBI needs to contact BIS to decrypt your code

indigo snow
#

now i wonder if there is effective code to find the longest sequence of identical values in a given array?

zealous solstice
#

so my encrytped code look like

hasty pond
#

This is how I will test everything from now on. I'll just do it and then pastebin it and give it to you guys to break xD Amazing what you guys can do actually ๐Ÿ˜„

indigo snow
#

bottom line is that encryption and arma do not go together for very practical reasons

zealous solstice
#

๐Ÿ˜ƒ

#

yeah i write for my a extension to decrypt it

hasty pond
#

cptnnick I truly believe that is actually an awesome thing

#

I feel like a community like arma's amazing community should be open

austere granite
#

Till the moment some arma life kiddies grab your hard work to make money of it

hasty pond
#

Welp

royal coral
#

Saving map edits in 3Den as .sqf? Possible?

austere granite
#

No.

#

You generally shouldn't be using that anyway

royal coral
#

Its

#

just i want to add soem map edits server side

winged thistle
#

Hi guys. ๐Ÿ˜„ I have a question about stacked event handlers. How would I need to format one to remove the player's corpse vehicle onPlayerDisconnected?

#

I guess I'm just not sure about the syntax.

#

["corpseCleanup", "onPlayerDisconnected", {deleteVehicle (vehicle _this)}, player] call BIS_fnc_addStackedEventHandler;

#

Would this work?

ivory nova
#

I'm having trouble getting a particle effect to appear for all players on a multiplayer server (only appears in single player); would it be theoretically possible to look at the way smoke grenades function, or other particle effects, so I can try and figure out why this is?

winged thistle
#

Thanks @tough abyss

winged thistle
#

Has anyone made a GUI menu with a character model that displays the loadout on that model while the player switches through loadouts?

winged thistle
#

It's something to go off of, I guess.

native hemlock
#

There is always the virtual arsenal

#

Tonic also made a similar system for Altis Life

winged thistle
#

I'm trying to find one that has a paper doll in a dialog control. Not having any luck. Most people just use the 3D character.

winged thistle
#

I found KK's guide where he put a can 3D model in the GUI. Wondering if there's something like that for player menus.

marsh lodge
#

for MP missions

#

I assume that it happens after everything

austere granite
#

Depends.... :p

#

It's different for sever (Local hosted) and client, plus JIP

ivory nova
#

Is it theoretically possible to stop a particle effect, like smoke, from clipping through the terrain?

marsh lodge
#

What is it you want to do?

ivory nova
#

Stop a particle effect from clipping through the terrain ๐Ÿ˜ƒ

#

"Our current particle system is not able to compute collisions between particles and objects. Particle collisions would have huge impact on performance, that's the reason. There are only collisions between particles and the ground available at this moment." Nevermind ๐Ÿ˜ƒ

marsh lodge
#

but why would you want to do that?

ivory nova
#

I have a heli spitting out a custom particle effect

#

The blades force the particle effect through the terrain occasionally

#

Resulting in the effect rising up out of it at a later point

marsh lodge
#

ok

ivory nova
#

Looks like I should try bounceOnSurface and bounceOnSurfaceVar

hallow spear
#

is there anyway to check to total carrying capacity of a unit?

hallow spear
#

im looking through configs and dont see that value. I also would want to be getting the loadout of a unit using alternating gear, on the fly. thanks for the thought

royal coral
#

Any way i can make somthign that says If a file example: [@life_server\Protect.sqf] isnt found then exec [core\filename.sqf] in mission file

indigo snow
#

This is the best you can do

tough abyss
#

Is there any boostrap UI dialog template for ArmA 3 to get you started quickly?

native hemlock
austere granite
#

Not really

#

I'd recommend dePBOing 3DEN pbo in arma addons and taking a look th ere

#

It has a reliable grid mostly, which is the mian problem you're going to have

austere hawk
#

is it possible to override the animationsource of a turret's elevation/traverse when a player is in the turret? I'd like to have a reload animation, where the gunbarrel has to be lowered - slowly, it's a large arty piece - and with all the additional animations that come with it (turning the elevation wheels etc).

austere granite
#

Nope

#

Actually maybe it is these days. I remember they did some stuff there, but in the past I've tried turret movement with scripts and no luck

austere hawk
#

bollocks! sigh well i could do a workaround with model.cfg, but that would require basically double the animation classes for the gun

austere granite
#

well if you have model access I'm guessing you could

austere hawk
#

its my model, so yes

austere granite
#

I remember in Iron Front some of the statics had a moving gun barrel on reload or so

austere hawk
#

the problem in this case is that the reload is very long, the barrel has to be moved level from any position. If it was just a modern mbt-type barrel movement it wouldn't be that big of a deal. But i have modelled stuff like analog dials for gun elevation, as well as turning wheels/ gearing for the gun mechanism.

#

using animateSource works for the ugv with turret (as written in examples), but the same does not work for a regular vehicle (like vanilla howitzer) apparently

tough abyss
#

Man, creating dialogs for ArmA 3 is a pain

austere granite
#

๐Ÿ˜„

nocturne bluff
#

:D

#

Try doing a specator

#

its fun

thin pine
#

Or a custom zeus-like editing interface ^^

proper shuttle
#

anyoen know wher ei can find a decent script for roaming ai to add to a wasteland server? its a personal private server that has a limited number of users on at any time (up to 6 at most)

keen stream
#

Just plug-in ALiVE? ๐Ÿ˜ƒ

#

Or use something like UPS or UPSMON

thin pine
#

Enemy occupation system perhaps

keen stream
#

Or Zombies and Demons has some modules that allows you to achieve the same.

thin pine
#

Err...wasteland does not necessarily have z&d and our roaming module isn't for regular ai nor does it cover the entire map @keen stream ๐Ÿ˜Š

keen stream
#

@thin pine You can use my Undead Sandbox I wrote. It is meant for the entire map. ๐Ÿ˜ƒ

thin pine
#

Fair enough :P

austere granite
#

Is there a way to get non-localized string config entries? Basically i want to export the localized names in gear script I have for the vanilla soldiers

#

I can get them from configs, but I'd prefer having it get the stringtable name so others can just use the export function instead of looking them in up configs

austere granite
#

Anyone knows how you can group units by script in current Stable arma 3 released in Eden?

#

add3DENConnection doesn't work with "Group" type

nocturne bluff
#

Should be Group

#

Do you mean entity type group?

austere granite
#

Basically after createEntity of a soldier class I want to be able to group them all...

nocturne bluff
#
_parent = playableunits select 0;
{
    add3DENConnection ["Group",_parent,_x];
} foreach playableunits;
#

?

austere granite
#

add3DENConnection ["Group", [(get3denselected "object" select 0)], (get3denselected "object" select 1)];

#

Same thing basically, doesn't work

indigo snow
#

add3DENConnection ["Group",[group B],A]

#

Joins A to B

austere granite
#

Sweet. Thanks

indigo snow
#

I'm actually not sure how it handles rank

#

Ah it groups B to A if (rank A) > (rank B)

#

but not reliably

#

hm

#

\_o_/

nocturne bluff
#

Huuuuuuh

indigo snow
#

It grouped B to A for me at first when I set the rank of A to colonel or so

#

not anymore

nocturne bluff
#
_parent = playableunits select 0; 
 {     
  add3DENConnection ["Group",[group _parent],_x];  
} foreach playableunits;
indigo snow
#

BTW that idea is pretty smart

#

but why not use the compositions?

austere granite
#

Basically want to have a single button a mission maker can click to prepare mission for the gamemode

indigo snow
#

good luck with frontline! ๐Ÿ˜‰

austere granite
#

Thanks :3

knotty drift
#

Whats Frontline cptnnick?

indigo snow
#

good question!

austere granite
#

It's a place whre you can get capes and wear m too

austere granite
#

Anyone know waddap with this in server RPT (Local host)

 0:25:14 Server: Object 2:292 not found (message Type_91)
 0:25:14 Server: Object 2:297 not found (message Type_91)
 0:25:14 Server: Object 2:296 not found (message Type_91)
 0:25:14 Server: Object 2:290 not found (message Type_91)
 0:25:14 Server: Object 2:289 not found (message Type_91)
 0:25:17 Server: Object 2:297 not found (message Type_119)
 0:25:18 Server: Object 2:296 not found (message Type_119)
 0:25:18 Server: Object 2:263 not found (message Type_91)
spring kindle
#

okay so I've made some stringtables for multiple confgis and i know it can be read but I don't think it is. so the question is and the string be read if its placed like this

#

D41_BasicMass = "$STR_Mass_TCG_CVPI";

#

or does it need to be just the string and the string table have all that

jade abyss
#

oO D41_BasicMass = Vanilla Mass of the Vehicle.
Why a Stringtable?!?!?!

#

Still interesting to see, where stuff lands.

winged thistle
#

How can I display two dialogs at once using inheritance?

#

I've been trying to do this all day with no luck.

#

The goal is to have a main menu display and change the dialog below the menu when main menu buttons are clicked.

winged thistle
#

Also, side topic, does anyone know the IDD for the information that displays in the top-right of the HUD?

earnest valve
#

Ummm.... use the createDialog command twice?!?

winged thistle
#

Inheritance was the key there.

#

I need them to be created simultaneously.

#

Right now, I have it working by having the same buttons appear in each menu. I'd like to make my menu more modular.

#

I was told I could have a dialog that could pull controls from another class with inheritance, allowing me to only call one menu and have the two separate parts appear. In this case, I'd like to have the navigation menu in one .hpp and all my separate menu pages in individual .hpp files.

#

I have about 6-10 menu pages, so not having to repeat the nav menu code in each file would be grand.

blazing zodiac
#

#include maybe? @winged thistle

winged thistle
#

I've been using includes.

#

I have all my files in individual .hpp files

#

My goal is to not have to call two dialogs at once.

#

Can inheritance not pass controls to a different display?

winged thistle
#

Guess I'll stick with the bulky way for now.

nocturne bluff
#

put your subdialogs in rscontrolgroups

winged thistle
#

Thank you.

#

I was just looking into that a bit ago

#

I've not been able to find an example.

#

Or maybe I have and didn't realize that was what I was looking for...

#

UI makes my brain melt.

vagrant kite
#

UI is kinda fucked up indeed

vapid frigate
#

class YourDialog { class controls { class container : RscControlsGroup { class controls { class controlInContainer{}; }; }; }; };

winged thistle
#

@vapid frigate You're my favorite ๐Ÿ˜›

vapid frigate
#

you can almost do controls exclusively in SQF now

#

it's a lot better than it was

winged thistle
#

It seems that way. My only problem is catching up to the new things I can do.

#

Luckily I have you guys ๐Ÿ˜„

vapid frigate
#

keep in mind positions in the control group are relative to the top left of the group too

#

not relative to the screen any more

#

0,0 is the top left

winged thistle
#

Very nice. I figured that out the hard way when I was making buttons earlier ๐Ÿ˜›