#arma3_scripting

1 messages ยท Page 397 of 1

peak plover
#

Can't put it in the first scope and only use in the 5th one

tame portal
#

I'm talking about this topic in general, I don't like people doing wooki wooki stuff because they heard it somewhere sometime and then their code ends up looking like spaghetti and obviously they don't comment ยฏ_(ใƒ„)_/ยฏ

#

"Pseudoimprovements" I'd call it

peak plover
#

I usually do it after I run in through the performance thing or actual loop that needs to run a lot

still forum
#

I profile my code. Find problems and fix them

peak plover
#

What's "profile"

still forum
#

And not in debug console trying to optimize microseconds. But in real missions with other players under real conditions

#

Checking which code runs when how long and where the slow parts are

tame portal
#

Code profiling without tools in ArmA is ehhh ๐Ÿ˜„

still forum
#

without tools?

#

No. with tools.

tame portal
#

With tools

#

Y e s

still forum
#

Without proper profiling tools it wouldn't make much sense

tame portal
#

Slap some diag_log diag_tickTime in there ( อกยฐ อœส– อกยฐ)

still forum
#

no..

peak plover
#

w h a t tools

still forum
#

That's not a proper tool

tame portal
#

Thats why the lenny face

#

@peak plover dedmen uses his own tools

still forum
#

Profiling branch is called that for a reason

peak plover
#

Me and probably majority don't got no clues how to use that

still forum
#

At first I used my subtree method that I wrote on the profiling wiki. It works well but is tedious

peak plover
#

So i need this mod

#

and also the profile build

still forum
#

You don't really need profiling build

#

But it has an easy way to display the data in a nicely readable form

peak plover
#

I gots to check this out

#

Find a couple of ms

still forum
#

Please don't run it with TFAR or ACRE. You'll probably find many ms's

peak plover
#

Sooo

#

How do I work this?

still forum
#

All explained in the forum post :u

peak plover
#

profilerCaptureFrame

#

nothing happens

still forum
#

enter profilerCaptureFrame and press F1 in the debug console

#

If it doesn't tell you anything then the mod didn't load. Maybe forgot to load Intercept?

peak plover
#

captures teh next frame

#

it works

still forum
#

Oh eh.

peak plover
#

profilerCaptureFrames 10; kinda works when I run it like a coupel of times

#

This look correct?

still forum
#

Maybe you don't have enough unscheduled scripts running. If there are none it won't trigger

#

you have to press on "PASTE ALL" on the bottom

peak plover
#

cba and ace are running

#

says copy 0000ms

still forum
#

PM me your clipboard content

#

No data captured at all

peak plover
#

ill try a differentm isison

still forum
#

put compile "test" into debug console watch

#

The code that generates should be different than "test"

peak plover
#

empty

still forum
#

wut

#

but compile has to return something ๐Ÿ˜ฎ

peak plover
still forum
#

typoed compile

peak plover
#

hahahaha

#

Ohh okay it's a {CODE}

still forum
#

it should contain a _scooope

tame portal
#

lol complie

peak plover
#

shieeed

#

๐Ÿคท๐Ÿฟ

still forum
#

(โ•ฏยฐโ–กยฐ๏ผ‰โ•ฏ๏ธต โ”ปโ”โ”ป

peak plover
#

maybe upate revolved or sth

#

maybe i got the wrong profile branch

still forum
#

I used it 3 days ago

#

one min

peak plover
#

I got the latest profiler exe

#

I got laterst intercept

#

I gotr latest script profiler

#

Run it all together with ace and cba

#

Run command in debug

#

Did I goof up?

still forum
#

onEachFrame {profilerTrigger} run that in debug console

#

And then do profilerCaptureTrigger

#

It should pop up the UI thingy and when you PASTE ALL it should.. display stuff

#

Although... no

peak plover
#

okay thanks

#

Imma try

still forum
#

onEachFrame (compile "profilerTrigger") do that

#

that should definetly create enough data to display

peak plover
#

profilerCaptureTrigger

#

dont pop up

still forum
#

That is interesting.

#

I'll try myself

peak plover
#

okay, I'm probably missing sth 'tho

#

Well I'll brb gotta update my custom ace

still forum
#

I usually try just hopping into Eden preview on VR. That's enough to get some ACE functions running and create enough data each frame to display

peak plover
#

I was in editor and in va

still forum
#

Every script function you look at in Debug console watch field should start with private _scoooope = ...

peak plover
#

Both have ace running

still forum
#

Oh! And if it doesn't I know why

peak plover
#

ok tell me

still forum
#

The profiler is overwriting the compile script command to add the profiling code

peak plover
#

Aah, so disable profiel branch?

still forum
#

It can only do that if the Intercept plugin is digitally signed with my key. That is probably not working

#

I made a fix on the signature verification after the last release

peak plover
#

gotcha, I'll do that after I'm done updating

still forum
#

Definetly works correctly for me with intercept dev build. Guess I have to look more into why the signature thingy fails sometimes

winter dune
#

whats the difference in doing this -->

private _var = 10;

and 

private "_var";
_var = 10;
#

is it the same thing?

still forum
#

It does the same thing

winter dune
#

ok, thanks

still forum
#

but the second one is infinetly slower than the first

halcyon crypt
#

awww did someone get a fancy color? ๐Ÿ˜‹

still forum
#

No

#

Sadly no pink

halcyon crypt
#

hehe

quartz coyote
#

Hello, is there a way of getting the RHS's (or aznyother mod's) CfgWeapons for me to display a Sghting item on a weapon
like this type of script line :

ConfigFile >> "CfgWeapons" >> Currentweapon Player >> .......
still forum
#

Uh... what?

quartz coyote
#

I have a Script that calls a set of scops (that I set) form an other script, when the mission is run with no mods, it works perfectly. But when I adapt the mission with RHS mod the the weapons show up but not the Scops, as if it couldn't detect a compatible scope for a modded weapon.

meager heart
#
configfile >> "CfgWeapons" >> _your_weapon_here >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems"//--- Optics
#

That one ?

quartz coyote
#

I have this one

ConfigFile >> "CfgWeapons" >> Currentweapon Player >> "WeaponSlotsInfo" >> "CowsSlot" >> "CompatibleItems"
#

but yes, same thing

#

The display doesn't work but the Scope is on the weapon. the player just can't see it

meager heart
#

The display doesn't work but the Scope is on the weapon

#

wut

quartz coyote
#

give me a sec

meager heart
#

501

quartz coyote
#

So I have a Weapon Menu with an external cam that displays the weapon/Scope that the player is choosing. This all works I've been playing with it for years with no mods on. But now i'd like to a RHS in my mission.

What happen is :
1 : I select a weapon > Thats OK I see the RHS weapon.
2 : I select a Scope > That doesn't work, I doesn't display the scope I have chosen.
3 : But if I click OK so confirm the Scope (that I can't see) and the Weapon, then TADAAAM, the scope miraculously shows up on my weapon out of the WeaponMenu.

#

So i'm thinking maybe i'm not selecting the right CfgWeapon file ?

meager heart
#

Some locality issues maybe ? How you add weapon items ?

quartz coyote
#

AddPrimaryWeaponItem

meager heart
#

Also with rhsusf_acc_specter something was bug

peak plover
#

switch (stance _unit) do {
    case ("CROUCH"): {
        _unit setCustomAimCoef (1.0 + _fatigue ^ 2 * 0.1);
    };
    case ("PRONE"): {
        _unit setCustomAimCoef (1.0 + _fatigue ^ 2 * 2.0);
    };
    default {
        _unit setCustomAimCoef (1.5 + _fatigue ^ 2 * 3.0);
    };
};

proneing has more shake than crouching in ace3

meager heart
#

Check that scope in arsenal @quartz coyote

quartz coyote
#

I tested with rhsusf_acc_ACOG_RMR

#

but I also tested with vanilla scopes like optic_Holosight and I does the same

#

as if the RHS weapon didn't detect a compatibleItem Slot

meager heart
#

Is it works with vanila weapons and weapon items ?

quartz coyote
#

Yes, i've been using it for years without problems

meager heart
#

Maybe some bug in addon

quartz coyote
#

mmmh ...

#

probably

dim terrace
#

you have 3 variant of scopes

#

2d, 3d & pip

#

it's changed automatically ingame so you don't have arsenal clogged up with bazillion variants of same scopes but in different techs

#

@quartz coyote

quartz coyote
#

What the fuck does that mean ?

dim terrace
#

you are using wrong class name

quartz coyote
#

ah ?

#

you mean of the scopes ?

dim terrace
#

yes

quartz coyote
#

I know only of one ...

#

so for rhsusf_acc_ACOG_RMR what would be the right classname

dim terrace
#

just check ingame which scope do you have with some script command

#

you can have different variants depending on which mode did you selected in RHS Options Menu

#

There is prefered optic list box & you can switch between variants that I mentioned before

quartz coyote
dim terrace
#

no, it's outdated

#

use this in ingame debug console

quartz coyote
#

Ok thanks

#

give me a sec

#

["","","rhsusf_acc_ACOG_RMR",""]

#

this is what I get

dim terrace
#

you are checking your own accessories or some AI units?

quartz coyote
#

my own

lone glade
#

So, anyone interested in a func to port VA loadouts to ACE Arsenal ones?

dim terrace
meager heart
#

@dim terrace Is that mean that "compatible Items" return from config is incorrect ?

dim terrace
#

depends, RHS weapons are using class compatibleItems instead of compatibleItems[] array

quartz coyote
#

Sooooo what shall i do ???

dim terrace
#

you can paste your script

inner swallow
#

i suppose you could also export Arsenal loadouts?

lone glade
#

nope

#

BI loadout format is so fucked up I don't want to deal with it

inner swallow
#

it was directed at Flash-Ranger

quartz coyote
#

@inner swallow it's same problem, but don't bother, I went for a VArsenal solution lol

quartz coyote
#

Would there be a way of executing this in initplayerlocal with item and weapon restrictions ?

["Open",true] spawn BIS_fnc_arsenal;
#

without going through the command

[myBox,["arifle_MX_F","arifle_MX_SW_F","arifle_MXC_F"],true] call BIS_fnc_addVirtualWeaponCargo;
#

maybe a class Arsenal in Description.ext or something

subtle ore
#

@quartz coyote You can add that to a box or unit and whitelist items with functions like BIS_fnc_addVirtualWeaponCargo and it's reciprical BIS_fnc_removeVirtualWeaponCargo

still forum
#

Not aware of a way without it

subtle ore
#

But i'm sure Dedmen has a intercept solution packed and ready to go

still forum
#

Welll........ You could replicate what addVirtual... commands do manually

subtle ore
#

Meh

lone glade
#

inb4 I self plug ACE Arsenal

still forum
#

Just use ACE arsenal. It can do that

quartz coyote
#

@subtle ore my interest is to nypass the "object"

lone glade
#

plus you don't have to wait 20s for it to load ๐Ÿ˜„

still forum
#

Yeah. I'm proud :3

quartz coyote
#

right so how to I summon the ACE arsenal from my InitPlayerLocal

lone glade
#

arsenal documentation

subtle ore
#

what a bunch of schills

lone glade
#

ah fuck we don't have the slackbot

#

hey, i'm not shilling I wrote the damn thing

#

it's more of a self plug ๐Ÿ˜„

subtle ore
#

ADVTING

lone glade
#

SHAMELESSLY

#

damn imgur compression isn't nice to BI fonts

subtle ore
#

@lone glade You and your ACE fairy dust, sprinkle it on and it magically works. Kick the team's butter into action with that medical rework. #testersForMedicalRewrite

lone glade
#

I rewrote arsenal from scratch

#

it's arsenal only in name

peak plover
#

Can u link framework in the feature page?

lone glade
#

I could've called it alganthe's weapon cave

#

and in hindsight I shouldn't have used the word arsenal

peak plover
#

I tihnk it's good. it's similar

lone glade
#

but it get people confused

peak plover
#

I thouyght it's a replacement 'tho

quartz coyote
#

@lone glade PM

lone glade
#

it is.

peak plover
#

It's not the same as the normal one it's next to it. it does nto replace it comepletly

subtle ore
#

@lone glade Alganthe Weapons Cave works

quartz coyote
#

omg please someone understand me ...
["Open",true] spawn BIS_fnc_arsenal;
this works perfectly, no need for ACE for that !
What I want is for it to ALREADY have the restrictions when it opens !

subtle ore
#

@quartz coyote Withought a virtual box or unit with it added to, then it's not possible

still forum
#

A player is a unit tho

subtle ore
#

That's what i'm saying

quartz coyote
#

Ok well BIS if you're reading this : Thats Dumb !

subtle ore
#

Although others would be able to use it off of you

lone glade
#

nah, don't need to add the interaction

subtle ore
#

That wasn't their initial plans for it @quartz coyote

lone glade
#

add the virtual items and call openBox on your ass

#

no idea how it's done in BIS VA

subtle ore
#

Huh

winter dune
#

what does this mean? "extDB3: Protocol Error: [0,""Error MariaDBQueryException Exception""]"

#

the query that I'm trying to do is like the others, but this one doesn't work

#

nvm, found why

subtle ore
#

Mind posting why?

winter dune
#

SQL syntax error

subtle ore
#

Okay, what would that error be? What's the correct syntax? Just for the better of myselt

tough abyss
#

It just means check extDB3 logs for more info why it failed. Only generic error info is available in sqf

#

Could be anything from typo mistake to that database table doesn't exist

kindred bane
#

my server keeps restarting, could this be the cause? 20:29:05 Attempt to override final function - bis_fnc_storeparamsvalues_data

river meteor
#

@kindred bane are you trying to define that as your own function?

kindred bane
#

I dont believe so, hold on

#

But could thisi also be a cause of the problem, @river meteor ?
20:35:57 File tmf_police_and_ems_gear\config.cpp, line 362: '/cfgWeapons/TWF_SWAT_1_vest.author': Missing ';' at the end of line

#

Im getting tons of those from a mod i use

river meteor
#

did you create any of the scripts you are trying to load or are they all external downloads?

winter dune
#

you have to correct the config.cpp and place a ";" where it's supposed to be

kindred bane
#

well im using a life miission

#

all right ill do that xAndreei is that the problem though u think

#

Also i dont think im even using the bis_fnc_storeparamsvalues_data function anywhere it must be in a mod

river meteor
#

I'm reading that it could be the order you load mods. If you are using CBA, make sure it is being loaded first

kindred bane
#

aight its being loaded like this: (CBA) is in the archonrp folder so ill try and load that first

@life_server;@ArchonRP;@extDB;@infiSTAR_A3

#

@river meteor

river meteor
#

In any case you definitely want to fix the other syntax errors that are reported. If you didn't make the mod yourself you should also consider that a developer who released code with syntax errors may have other bugs and problems with their mod.

kindred bane
#

aight, i fixed them, ill see if it works, if not ill report back and also yeah im not even sure when i added that addon so i guess ill remove it if im not using it in the mission

#

@river meteor ok, so sadly did not fix the problem. However i tried something else, and took the rpt file before and after i joined, after i join i get this:
21:05:25 Unsupported language English in stringtable
21:05:25 Unsupported language English in stringtable
21:05:25 Error: Weapon[arifle_MX_pointer_F]: max attachments slots count reached(maximum = 5)! Attachment slot[asdg_OpticRail_MX] for weapon's proxy[\a3\data_f\proxies\weapon_slots\TOP]
21:05:25 Mission Archon.LakesideValley: Number of roles (110) is different from 'description.ext::Header::maxPlayer' (200)
21:05:26 BEServer: registering a new player #8281630

#

Would the max roles thing matter?

winter dune
#

have you modified the config.cpp ?

kindred bane
#

which one?

winter dune
#

20:35:57 File tmf_police_and_ems_gear\config.cpp, line 362: '/cfgWeapons/TWF_SWAT_1_vest.author': Missing ';' at the end of line

kindred bane
#

yeah i fixed that

winter dune
#

any other errors?

kindred bane
#

theres all the rpt after i join the mission

#

it doesnt crash before i start connecting and receiving mission file,

#

@river meteor

river meteor
#

Where did you get these mods that you are using from? Were there server setup instructions?

kindred bane
#

those are altislife

#

i think

#

that the new arma update acctually made this crash

#

cause there was an update like 2 days ago and its been down for around 2-3

#

@river meteor what could this be 21:05:27 Server error: Player without identity Alex Newman (id 8281630)

river meteor
#

@kindred bane Not sure, but I get that when I start my server and it hasn't caused problems for me. It seems like you have a broken mod installed. I would just go to the author of the mod for help themselves. You have never gotten this mod working correct?

tough abyss
#

Hey folks, is there any known solution for the UI flickering which occurs if you load the .paa into your title via ctrlSetText? FYI: the image is changing every 1s through a looping script and then its flickering like the system doesn't cache it.

lone glade
#

because it doesn't

#

there's 0 caching

peak plover
#

@still forum profiler works now

#

With the new one you posted

#

Good stuff

#

nonee of my scripts are there 'tho becaues I don't have unscheduled scripts

kindred bane
#

Yo, Manason i cant tag u cause ur offline, but it seems that the new arma 3 update from a few days 2-4 that has caused this, i have the update just before that on my pc and server doesnt crash

#

I believe this might be the problem, im not sure how to fix it though,
21:05:42 Attempt to override final function - bis_fnc_storeparamsvalues_data

peak plover
#

Make your own life from scratch instead of copying the existing ones?

kindred bane
#

If your not gonna help dont

#

but then stop giving me a reply i cant use, as im not gonna recreate a whole mission that already exists..

peak plover
#

But you are recreating a server that already exists

#

Description.ext: allowFunctionsRecompile = 1

#

Y
It's a lot easier to debug it if you made it yourself

subtle ore
#

21:05:42 Attempt to override final function - bis_fnc_storeparamsvalues_data this is a normal log

kindred bane
#

whaats allowFunctionsRecompile do? also Midnight i never seen that before and its a message right before server crashes

#

@peak plover @subtle ore

subtle ore
#

it's a normal log

kindred bane
#

okay weird

subtle ore
#

allowFunctionsRecompile disables recompiling functions during runtime for security

#

0 = disallow

#

1 = allow

kindred bane
#

but the newest arma update from like max 4 days ago made this crashing thing happend

#

so i should have it allowed?

subtle ore
#

don't allow it, the arma update did not change anything that'd make your game crash

#

at all

kindred bane
#

no the game doesnt crash

#

the server does

#

after the update

#

nothing changed on the mission or addons

subtle ore
#

So log it

lone glade
#

let me guess, did you update the server?

kindred bane
#

Yes

subtle ore
#

Do you have any RPT to show for?

kindred bane
#

log what? u told me not to enable it

#

yes

#

hold on

peak plover
#

Did you update your mods / missions?

#

Check them for errors?

kindred bane
#

what would i update in them i dont get it

subtle ore
#

I told you to disable what?

kindred bane
#

wait nvm

#

heres the rpt

#

it crashes first when you start receiving mission thats where i gave the rpt from^^

peak plover
#

First try to see if the server works without mods and custom contnet

kindred bane
#

it does

subtle ore
#

๐Ÿคฆ

kindred bane
#

?

#

:?

lone glade
#

did it not cross your mind that the mods may be the issue?

kindred bane
#

yeah it did, but how can i know which ones the issue ๐Ÿ˜ฎ

lone glade
#

THE ONES THAT UPDATED WHEN THE CRASHES STARTED

#

GOD DAMMIT

kindred bane
#

none did lmao

#

๐Ÿ˜›

peak plover
#

disable them 1 by 1. I've don that with ~50 mods before

kindred bane
#

500 mods..

#

D:

peak plover
#

You have 500 mods?

lone glade
#

wouldn't you reach over the PBO limit?

kindred bane
#

about 540

lone glade
#

and you're wondering why the fuck it crashes?

kindred bane
#

yeah i am

#

it crashes when you join the mission

#

not when the mods load or when you start your game

subtle ore
#

Why do you think you need 540 mods?

peak plover
#

I find that hard to believe

subtle ore
#

I do too

lone glade
#

that's an insane amount of PBOs

kindred bane
#

its 540 pbos

peak plover
#

Ohh

subtle ore
#

PBOS != Mods

peak plover
#

It's 1 mod

subtle ore
#

christ man

kindred bane
#

oh lmao sry my mistake

#

XD

peak plover
#

I hope you have permission to use all of them before I continue to assist

lone glade
#

so, how many minutes do you need to load arsenal?

kindred bane
#

what you mean

subtle ore
#

~30 I would imagine

#

Especially BIS

kindred bane
#

?????

subtle ore
#

Since doesn't it parse upon load Alganthe?

lone glade
#

My arsenal doesn't have loading times ๐Ÿ˜„

kindred bane
#

arsenal? takes about 30 or 40 seconds to upload

#

load

peak plover
#

Alganthe how did you do that?

#

Does it load before

lone glade
#

Caching on game startup

peak plover
#

Good job ๐Ÿ˜„ that's like so nice

lone glade
#

and that's dedmen who made the caching

#

even without it loading times were under 400ms

kindred bane
#

anyways what changed in the new arma update

#

that could cause this

subtle ore
#

Nothing

lone glade
#

outside of fixing enum errors, nothing, and those errors weren't even errors, just RPT spam

kindred bane
#

e.e

#

it just doesnt make sence to me, its first when player starts receiving mission it crashes, wouldnt it output logs ?

subtle ore
#

In your console sure, I'm not sure about the rpt

peak plover
#

Does a different mission load with the mods?

#

Probably not even the mods

lone glade
#

if it's a crash it should create a dump and show an error in the RPT

kindred bane
#

no, also where do i find the dump files, also i dont have access to console

#

i use nitrado

subtle ore
#

...........

peak plover
#

What is nitrado?

#

Is it a dedicated server?

subtle ore
#

Hoster

peak plover
#

Just try if it's the mission. if it's not the mission. delete half of the mods and see if it works. Continue halving it until you find out which half breaks it and so on.

kindred bane
#

im considering suicide lmao

#

the servers ip had for some unknown reason changed so it was unwhitelisted with infistar

#

and i never checked that cause why would the ip not be whitelisted suddenlyy :::

jade abyss
#

That's Life ยฏ_(ใƒ„)_/ยฏ

little eagle
#

Literally?

tough abyss
#

hey anyone good at scripting?

jade abyss
#

Literally! @little eagle

little eagle
#

hey anyone good at scripting?
No.

jade abyss
#

nope

peak plover
#

What about koffein flummi

lone glade
#

No

peak plover
#

@tough abyss bring it

#

I'm sure everyone's IQ combined will be over 80 so we can figure something out

tough abyss
#

Here take 1iq from me

peak plover
#

up to 81 already

#

I've got an idea

#

Not sure how goood it is, I'm guessing ~65-70% good

tough abyss
#

Woah, thatโ€™s 65-70% more than me o_o

peak plover
#

For my next ai script I will have an _extra parameter when spawning in the units and this will be attached to the unit for future.

['pool', ['B_Soldier_SL_F']                    // array, classanmes
['area',[a,b,angle,isrectangle]                // array, based on cba_fnc_randPosArea
['perim',true]                                // bool, spawn on perimieter of area
['areaMarker','markerName']                    // area marker name as string
['areaTrigger', triggerName]                // variable name of the trigger
['house', bool]                                // patrol houses instead

So I can put one of these in there

#

THe order won't matter

#

because I will match the first element to a search later

#

So then I can save this for safe keeping later

tough abyss
#

shit i had it muted

#

anyway

#

class Extended_Init_EventHandlers {
class Man {
init = "_this call {(myCurator select 0) removeCuratorEditableObjects [[this],true]}";
};
};

#

^^^^ that right there keeps zues from fucking with units it isnt suppose to be messing with, but i keep getting a generic error.

still forum
#

the dreaded generic error....

#

Why do you have that call there?

tough abyss
#

Yeah i shorted it

#

Idk, i was going to refine it once it actually worked.

still forum
peak plover
#
    ["All", "initPost", {_this call loadout_fnc_auto}] call CBA_fnc_addClassEventHandler;
#

This is to add a eh to everything that's added

#

Just make a function that uses ```sqf
removeCuratorEditableObjects

tough abyss
#

where would that go again? in init or description?

peak plover
#

Ohh

#

btw your code

#

class Extended_Init_EventHandlers {
 class Man {
  init = "_this call {(myCurator select 0) removeCuratorEditableObjects [[this],true]}";
 };
};
#

[thise],true

#

this does not exist

#

could be youyr generic error

#

Why is it _this call btw?

tough abyss
#

I kinda took what this guy did, without really knowing what he did

peak plover
#

ok @tough abyss are you using hc in any form for zeus objects? will szeus be able to spawn in objects at all?

tough abyss
#

Nope

peak plover
#

objhects and units*

tough abyss
#

[] spawn {
while {true} do {
sleep 10;
{
if !((side _x) == west) then {
(allCurators select 0) removeCuratorEditableObjects [[_x],true];
};
} foreach allUnits + vehicles;
};
};

peak plover
#

But do you want a curator to be able to control certain units?

tough abyss
#

and then using classes in the description.ext I used _this because its local

peak plover
#

allCurators select 0 is unreliable

#

allCurators select 0 is the first zeus to load in

#

it could be different every game

#

How many zeus slots do you have?

tough abyss
#

I dont use that code, i just changed it

#

right now i have 4

peak plover
#

ok what are the variable names to those?

tough abyss
#

I just use a for each

peak plover
#

You need to name them seperately

#

They need variable names

tough abyss
#
{_x addEventHandler ["CuratorObjectPlaced",{

    // spawn to allow suspension
    _this spawn {

        // sleep, this keeps AI clothes one on ownership transfer
        sleep 5 + (random 5);

        private _target = param [1];

        // Changeowner
        _target remoteExec ["headless_fnc_changeOwner",2];
    };
}];
} forEach allCurators;
peak plover
#

unles you want to remove them from all zeus?

tough abyss
#

yes I want them removed from all zues

#

zeuses

peak plover
#

aaah

#

gotcha

#

then it's ez

#

I thought it's blufor zeus vs opfor zeus ๐Ÿ˜„

#


if (isServer) then {
    ["All", "initPost", {
        private _object = _this param [0];
        {
            _x removeCuratorEditableObjects [[_object],true];
        } forEach allCurators;
    },true,[],true] call CBA_fnc_addClassEventHandler;
};

#

When a unit is spawned in or an object

tough abyss
#

Nah its a singleplayer RTS, the multiple zeuses are because i use switch units and the strategic map to give my mission that Tac ops feel to it, You get to pick where you are in the battle field

peak plover
#

It's automatically removed from all zeus

#

I don't understand that much

#

So you want zeus to be able to do nothing ?

tough abyss
#

No, with the class system i had set up. Any unit spawned that wasnt spawned by zues, was uneditable

#

Well aslong as it was a man, vehicles still were editable

peak plover
#

ohh not a west unit

#

You want all west units to be editable?

tough abyss
#

I want all units that are not west to be removeCuratorEditableObjects

#

right now alive, as well as arma 3 sites modules, spawn in units that my zueses can manipulate

peak plover
#
if (isServer) then {
    ["All", "initPost", {
        private _object = _this param [0];
        {
            if !((side _x) isEqualTo west) then {
                _x removeCuratorEditableObjects [[_object],true];
            };
        } forEach allCurators;
    },true,[],true] call CBA_fnc_addClassEventHandler;
};

tough abyss
#

do i need a high command module for this to work

#
{_x addEventHandler ["CuratorObjectPlaced",{

    // spawn to allow suspension
    _this spawn {

        // sleep, this keeps AI clothes one on ownership transfer
        sleep 5 + (random 5);

        private _target = param [1];

        // Changeowner
        _target remoteExec ["headless_fnc_changeOwner",2];
    };
}];
} forEach allCurators;
peak plover
#

that one won't work for you

#

It's just an example

#

headless_fnc_changeOwner is a custom function

#

But that one only works for zeus objects

tough abyss
#

i dont understand what ur init post is doing

#

and it doesnt seem to work

#

the CBA_fnc_addClassEventHandler

#
{_x addEventHandler [
    "CuratorObjectRegistered",
    {
    _x removeCuratorEditingArea 0;
    (getAssignedCuratorLogic player) addCuratorEditingArea [0,position player,100];
    }
];
} forEach allCurators;
#

that works, It makes it so that when ever the curator opens his interface, the edditng area is placed 100 meeters around him

#

But for some reason when i add your cba add class event handler, into the same script, that is included in my init. It doesnt seem to do anything

#

and when alive spawns units to fill in the surrounding areas, they are still editable

still forum
#

Why don't you just disable the curators ability to edit anything?

peak plover
#

Needs to edit blufors

tough abyss
#

Yeah, and like ace adds garrison modules, thats going to be hella useful

#

but im interested, You have a way to add all placed groups & units to high command?

peak plover
#

Not really

#

But I assume it's possible

lone glade
#

honestly I have around 4K hours in arma, I never touched High command

#

and i'm fairly sure it's abandonned / unfinished

peak plover
#

LOL

#

I touched it

#

It's actually good

#

Gave task for a few groups to attack a town

#

They actually do some cool shit

lone glade
#

I saw the interface (drone view) disabled the key and ignored it for the rest of my playtime

tough abyss
#

lol

#

Well im trying to make zeus, the ultimate highcommand experience.

peak plover
#
if (isServer) then { 
    ["All", "initPost", {
        private _object = _this param [0]; 
        { 
            if !((side _object) isEqualTo west) then { 
                _x removeCuratorEditableObjects [[_object],true]; 
            }; 
        } forEach allCurators; 
    },true,[],true] call CBA_fnc_addClassEventHandler; 
};
#

I messed up the side check

#

before

#

this works

#

testedโ„ข

#

Only blufor units will be editable

#

I know there's a mod for HC

tough abyss
#

hmm

meager heart
tough abyss
#
class Extended_Init_EventHandlers {
 class Man {
  init = "_this call {(myCurator select 0) removeCuratorEditableObjects [[this],true]}";
 };
};
#

Thats the closest ive ever gotten to it working, And all it does is Make infantry un editable. Anyway it hates the "mycurator select 0" but everytime i change it, it doesnt give any errors but it doesnt work

#

Anyway if i wanted it to make all units, then i just have to change the class man to something that incorperates everything

#

But im not going to work on that till i get rid of the generic error

peak plover
#

On the end of the longest line

#

change this to _this

#

fixed

#

Just use the initPost i posted

#

Put that into init.sqf

#

mhmm

#

hmm

#

I wonder

#

'tho

#

If it will work if you are not in the curator...

tough abyss
#

your init post doesnt seem to work ๐Ÿ˜ฆ

peak plover
#

put it into debug once you are in zeus

#

I think that's that

tough abyss
#

good idea, hold on

#

it came back with true....

#

but yeah it works

#

Just you have to be in zeus, Or maybe if i add a sleep

#

let me try out of zues

peak plover
#
{_x addEventHandler [
    "CuratorObjectRegistered",
    {
    _x removeCuratorEditingArea 0;
    (getAssignedCuratorLogic player) addCuratorEditingArea [0,position player,100];
    {(getAssignedCuratorLogic player) removeCuratorEditableObjects [[_x],true];} forEach (allUnits + vehicles);
    }
];
} forEach allCurators;
#

Add that as well

#

I guess replace the

#

distanceo ne

#

(edited)

#

wait

#

You gotta do the check for west as well but that should do it

#
if (isServer) then { 
    ["All", "initPost", {
        private _object = _this param [0]; 
        { 
            if !((side _object) isEqualTo west) then { 
                _x removeCuratorEditableObjects [[_object],true]; 
            }; 
        } forEach allCurators; 
    },true,[],true] call CBA_fnc_addClassEventHandler; 
    {
        _x addEventHandler [
            "CuratorObjectRegistered",
            {
                _x removeCuratorEditingArea 0;
                (getAssignedCuratorLogic player) addCuratorEditingArea [0,position player,100];
                {
                    if !((side _x) isEqualTo west) then {
                        (getAssignedCuratorLogic player) removeCuratorEditableObjects [[_x],true];
                    };
                } forEach (allUnits + vehicles);
            }
        ];
    } forEach allCurators;
};
#

Both combined

#

This way when you load zeus, it removes everything that's there nad if something gets added while you are in zeus it will get removed too

#

try it

tough abyss
#

The opened interface part works, but once it open, when units are spawned they are still editable

peak plover
#

west/east?

tough abyss
#

east

#

I havent spawned any west units

#

man if alive would of just not automatically include all units it placed as editable

peak plover
#

That code

#

I put in the debug before going into zeus

#

spawned in some blufr oand opfor

#

only had blufor

tough abyss
#

yeah it works flawlessly in debug

peak plover
#

so where did you put the code?

#

before debu

tough abyss
#

my init has a #include

#

so i put it in my init

tough abyss
#

i wish i knew what your [all init post was

#

welp

#

I did it

#

i think

#

yup

#

private "_this";
_this = _this select 0;
[] spawn {
{
if !((side _x) == west) then {
(allCurators select 0) removeCuratorEditableObjects [[_x],true];
};
} foreach allUnits + vehicles;
};

#

fuck....

#
class Extended_Init_EventHandlers {
class Man {

init = "_this call (compile preprocessFileLineNumbers 'classes\unitInit.sqf')";

};

};
#

thats my description.ext

#
private "_this";
_this = _this select 0;

[] spawn {
        {
            if !((side _x) == west) then {
                (allCurators select 0) removeCuratorEditableObjects [[_x],true];
                    };
        } foreach allUnits + vehicles;
};
#

thats my unitInit.sqf

still forum
#

That won't work

peak plover
#

Wouldn't that compile it everytime it runs?

still forum
#

private "_this"; makes no sense

#

and you never even use _this

#

so it does work because you don't use it. That's just weird and confusing

peak plover
#

๐Ÿค”

#

_this = _this select 0

still forum
#

and yes that compiles it everytime it runs.

peak plover
#

What did he mean by this

jade abyss
#

Hands on the Table:
Do you know ANYTHING about scripting @tough abyss ?

peak plover
#

Apparently no ๐Ÿ˜„

#

The code I posted is ok

#

It worked on my machine โ„ข

jade abyss
#

Nah, it's a different thing to say "I need help, my knowledge is limited" and "uhm, i know everything" (and knows nothing in the end)

still forum
#
class Extended_Init_EventHandlers {
class Man {
init = "if !((side _this) == west) then {(allCurators select 0) removeCuratorEditableObjects [[_this],true];};";
};
};

Why does that not work? Looks fine to me

jade abyss
#

I mean, everyone starts, no shame to know fkn nothing^^

peak plover
#

It's that psychology thing that you are so inadped that you think you are good at something

tough abyss
#

No i dont really no a whole lot about scripting

peak plover
#

You have no idea about the concept of understanding it yet. study more ๐Ÿ˜„

tough abyss
#

But umm like, Yeah when ever a unit is spawned, it runs that code

jade abyss
#

Good, now we know where we are =}

peak plover
#

It compiles the code

#

Very bad

#

every tiome

still forum
#

Just like every Engine eventhandler ๐Ÿ˜„

tough abyss
#

Alive offered their snippet, and thats the code it used to like change stuff on the units it spawns

subtle ore
#

Hey Dscha, found out today that switch with very basic and simple variables is faster than three if statements by 0.003 ms.

#

So it's not Slow Af mayn

peak plover
#

switch with very basic and simple variables

#

What

subtle ore
#

_1 = 2; :/

#

or

#

_1 = "B";

jade abyss
#
Hey Dscha, found out today that switch with very basic and simple variables is faster than three if statements by 0.003 ms.
So it's not Slow Af mayn```
Whats: "very basic"
subtle ore
#

"Simple"

still forum
#

@subtle ore 0.003ms is a single script command call.

peak plover
#

3 nanoseconds WOHOO

still forum
#

microseconds

tough abyss
#

anyway, yeah i got rid of the private stuff at the top

subtle ore
#

Sure

jade abyss
#

You probalby had the first entry on true the whole time and added another 20 behind it.
Then yeah: Of course it's faster

tough abyss
#
[] spawn {
        {
            if !((side _x) == west) then {
                (allCurators select 0) removeCuratorEditableObjects [[_x],true];
                    };
        } foreach allUnits + vehicles;
};
subtle ore
#

@jade abyss No, it's technically still not "Faster"

jade abyss
#

Do me a favor pls:
Add 5 cases to the switch, all false, except the last one. Then the same with IF statements ๐Ÿ˜›

peak plover
#
call {
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
if (blah)exitWith {}
};
#

faster

jade abyss
#

nigel

subtle ore
#

Yeah there would never be a case where you'd make me do that Nigel

#

not even three cases in a switch do

#

That's just...

jade abyss
#

switch = slow af. period

subtle ore
#

Sure

jade abyss
#

damn testers

subtle ore
#

But swittch = very neat

jade abyss
#

always arguing

peak plover
#
// Determine position coordinates
private _position = call {
    if (_pos isEqualType objNull) exitWith {
        getPosATL _pos
    };
    if (_pos isEqualType "") exitWith {
        getMarkerPos _pos
    };
    if (_pos isEqualType []) exitWith {
        _pos
    };
};
subtle ore
#

ITS NEAT DSCHA

jade abyss
#

I AM! NOT SWITCH!

subtle ore
#

:/

peak plover
#

Switch == lagswitch

jade abyss
#

It looks "cleaner", but in the end... meh

peak plover
#

swith looks dumb af man

subtle ore
#

But in the end, it's negligable for not heavy commands

tough abyss
#

man i dont even know what you guys are talking about, wanna try an key me in?

peak plover
#

speed

#

nano seconds

still forum
#

microseconds you idiot

#

stop that shit

subtle ore
#
switch _switchGlorious do 
{
    case true:
    {
        hintSilent "This is a switch do";
    };
}:
#

ยฏ_(ใƒ„)_/ยฏ

peak plover
#

0.003 ms == 3 ns

jade abyss
#

@tough abyss The speed difference between: switch(case)do{} and a line of if(case)exitWithstatements

#

switch = Slow af

#

Don't use it

peak plover
#

oooh

jade abyss
#

ignore what midnight says

subtle ore
#

Dscha is just jealous

peak plover
#

Nvm @still forum right

jade abyss
#

Yo mama is jealous

subtle ore
#

My mama might be jealous, but ur like x2 jealous

jade abyss
#

I might be 2x jealous, but you are just a peasant tester.

#

BOOOOOOOOM

#

So, stop the spamming now

subtle ore
#

๐Ÿ˜

jade abyss
#

there was a diff topic going on here

#

what was it anyway?

peak plover
#

how to get HC units

subtle ore
#
[] spawn {
        {
            if !((side _x) == west) then {
                (allCurators select 0) removeCuratorEditableObjects [[_x],true];
                    };
        } foreach allUnits + vehicles;
};
peak plover
#

das et

subtle ore
#

That was what was posted

#

Errr...you shouldn't be updating a publicVariable super often

peak plover
#

publicVariableEventHandler I saw this a bunch of times now, but I (((think))) having tons of code there would run it all every new publicvar?

still forum
#

remoteExec is probably better. Probably.

peak plover
#

What kind of event are you talking about @wraith cloud

#

Many times per minute

#

That's insane

tough abyss
#

quick question

#
[] spawn {
        {
            if !((side _x) == west) then {
                (allCurators select 0) removeCuratorEditableObjects [[_x],true];
                    };
        } foreach allUnits + vehicles;
};
#

So all curators select 0 kinda only picks 1

#

How would i go about throwing all the curators in there?

peak plover
#

Yeah, works like it's written

tough abyss
#

So like would I have to do an _x for each again?

peak plover
#

You won't need all curators there

tough abyss
#

i switched my zues slots, And well so yeah for one zues slot, it works

#

for the rest it doesnt

peak plover
#
                {
                    if !((side _x) isEqualTo west) then {
                        (getAssignedCuratorLogic player) removeCuratorEditableObjects [[_x],true];
                    };
                } forEach (allUnits + vehicles);
#

(getAssignedCuratorLogic player)

#

Charges?

#

Like bombs?

still forum
#

remoteExec was made for exactly what you are trying to do

#

PVEH is just a ducttape solution that BI added before they made the real solution with remoteExec

peak plover
#
[player,'Racist'] remoteExec ['nig_fnc_addCharges',2];```
#

Whoa

#

CANT DETECT IF IT'S > 1?!?!!?

#

IT'S THE C U R R E N T Y E A R

#

How is this acceptable?!

#

count(s)

#

Why!?!?

#

But yeah

#

You want to use remoteExec instead

subtle ore
#
['nig_fnc_addCharges',2];

@peak plover ๐Ÿค”

#

What are you adding charges for?

#

Is Nigel a lifer?

#

Is this a conspiracy theory in the making?

peak plover
#

LOL no

subtle ore
#

That's what they all say ๐Ÿค”

peak plover
#

one of my dreams is to have a huge gamemode that I make myself that's got RPG elements, but picking apples is just downright booring

subtle ore
#

LOL

peak plover
#

takistan life was cool 'tho

#

Back in the good old a2 days

subtle ore
#

Yeah no....

#

I hated that shti

peak plover
#

It was terribly coded and filled with bugs and exploits ( which made it more fun for me ) ๐Ÿ˜„

subtle ore
#

I question your sense of humor there Nigel, it may be used a means of evi

peak plover
#

I only played resistance because I knew all the glitches for ex. manufacturing -100 lockpicks and getting money insteaad of losing it ๐Ÿ˜„

#

No worries about money so I can just kill blufor ๐Ÿ˜„

tough abyss
#

Man, im disappointed with the tac ops dlc

peak plover
#

Why

tough abyss
#

Idk, just whole lotta altis was so amazing. I thought they were going to do something to that extent, especially with the direction they went with apex. I love what they did with the load out screen, i have a line of code that will add Cfg groups to it so you dont have to manually plug in loadouts.

#

But yeah, whole lotta altis was buggy, i wonder how amazing it would of been if a real development team took a crack at it

peak plover
#

Some modded missions are sick yeah

tough abyss
#

Anyway, the coolest aspec that i fucking love about arma 3, that no other game has captured

#

The anticipation and looting. Like You will spend a good hour getting to your destination, and when your there, you gotta set up to get the best advantage over your enemy as possible. And then the looting... Omg

subtle ore
#

....

tough abyss
#

Especially when one of your teamates dies, and you gotta figure out which fucker needs to carry the Explosives

peak plover
#

my favourite part is roleplaying as controversial armies

tough abyss
#

controversial armies? how so?

subtle ore
#

Russia, Pakistani

tough abyss
#

oh

subtle ore
#

Iran

peak plover
#

ISIS, Irish, separatists - the good stuff

subtle ore
#

Space Monkies

#

(Viper)

tough abyss
#

Any of you guys fuck around with the iron front mod?

peak plover
#

Role playing as an actual greek god is cool too

tough abyss
#

wait what?

#

Greek god?

peak plover
#

Zeus

subtle ore
#

Zeus ๐Ÿ™„

tough abyss
#

Sorry, im making it into an rts, that just went over my head

#

I dont consider it you being god, Just a general

#

hey is there a way i can connect 4 units to one zeus module?

#

The only reason i have 4 units is because of the switching

subtle ore
#

what

tough abyss
#

Tac ops allows you to jump into the shoes of other units

subtle ore
#

just asssign it to a uid

tough abyss
#

but when i upload it to the workshop, thats gonna be an issue

peak plover
#

getPlayerUID or sth

tough abyss
#

also i think that only works on the PLayer slot

#

So like if the player switches to another unit

#

His uid might still be tied to his previous body

subtle ore
#

What?

#

UID is specific to each net player

peak plover
#

UID is steam id

subtle ore
#

^

tough abyss
#

anyway the reason i ask, is because there are ace modules that i can only access on the player unit, and not the units that the player can switch into

subtle ore
#

What module?

peak plover
#
(getPlayerUID player)```
tough abyss
#

like garrison and other stuff

#

is there a switch eventhandler?

#

like something that can trigger when ever you take control of another unit

#

switch units*

peak plover
#

should be

#

Called teamSwitch

still forum
#

CBA has

#

teamSwitch is only for teamSwitch

tough abyss
#

hey so whats the difference between exec and execvm?

peak plover
#

Both are terrible ๐Ÿ˜‰

still forum
#

Both are completly different things

#

on is SQS other is SQF.

tough abyss
#

then whats your alternative?

peak plover
#

execVM
C U R R E N T Y E A R

subtle ore
#

Watch out Nigel, you may be thrown rocks at for downing execVM

still forum
#

Alternative? Intercept

tough abyss
#

i know nothing of functions

#

looks scary

#

wait hold up i have an example

peak plover
#

functions are simpler and more readable

tough abyss
#

onTeamSwitch {[_from, _to] execVM "myTeamSwitchScript.sqf";};

#

So how would i go about using your superior method ^_^

peak plover
#

onTeamSwitch {[_from, _to] call nig_fnc_teamSwitchEH;};

tough abyss
#

why do you add EH to the end?

peak plover
#

just naming it like that so I know that function is used in the Event Handler

#

lazy

#

is all

tough abyss
#

so umm when i make my function, i can just add _from and _to anywhere in it?

#

and it will automatically know

peak plover
#

no

#

The function will have a special variable _this

#

so

tough abyss
#
fnc_teamSwitch = {
 unassignCurator myCurator; 
 _to assignCurator myCurator;
}
peak plover
#

A

[1,2,3] call nig_fnc_gucci;

in func

params ["_first","_second","_third"];

B

'Gucci' call nig_fnc_displayGangName;
_name = _this;
hint format ["%1 Gang",_name];

would output Gucci Gang

tough abyss
#

lol

jade abyss
#

Hint: If you write functions: Always add a Tag before (mostly 3 letters, nut not fixed to that)
e.g.:
bli_fnc_MyFunction

#

Same should be done with Vars (adding a tag)

subtle ore
#

@peak plover Now you can't hide that shit. Hand over the lifer code now!

peak plover
#

๐Ÿ˜ณ

jade abyss
#

Nigel...

peak plover
#

๐Ÿ˜จ

jade abyss
#

i never knew you were mentaly disabled

#

nig_fnc_displayGangName
also, you should consider another Tag ๐Ÿ˜‚

peak plover
#

best tag ever โค

subtle ore
#

nig_fnc_sendToJail ๐Ÿ˜‘

peak plover
#

My germany translation function is great

jade abyss
#

My germany translation function is great
Yeah.... no

subtle ore
#

It's not like you're any better with english dchsa

peak plover
#
nig_fnc_translateEngToGer
subtle ore
#

๐Ÿƒ ๐Ÿ’จ

#

Run away

#

@peak plover each individual letter translated? ๐Ÿ˜›

jade abyss
subtle ore
#

Dscha

tough abyss
#

im still alittle confused, [_from, _to] call fnc_teamSwitch; So ? ```
fnc_teamSwitch = {
params ["_from","_to"];
unassignCurator myCurator;
_to assignCurator myCurator;
}

jade abyss
#

params would be correct

#

But: Why is _from in there, when you don't use it?

tough abyss
#
addMissionEventHandler["TeamSwitch", {
onTeamSwitch {[_from, _to] call fnc_teamSwitch; };
}];```
#

thats why

jade abyss
#

If you don't need it, just don't send it

peak plover
#
nig_fnc_teamSwitch = {
params ["_gucci","_gang"];
 unassignCurator myCurator; 
 _gang assignCurator myCurator;
}
// same as
nig_fnc_teamSwitch = {
private _gang = _this param [1];
 unassignCurator myCurator; 
 _gang assignCurator myCurator;
}


subtle ore
#
params["_cool","","_notCool"];
peak plover
#

just param if only 1 parameter

jade abyss
#

params["_cool","","_notCool"];

params[0,1,2];

peak plover
#

Does that not error?

jade abyss
#

and 1 is not assigned

subtle ore
#

Ah

jade abyss
#

just showed index positions

subtle ore
#

yes I'm fucking retarded

jade abyss
#

Yep

tough abyss
#
fnc_teamSwitch = {
private _to = _this param [1];
 unassignCurator myCurator; 
 _to assignCurator myCurator;
}```
#

so would that work?

peak plover
#

I dont know what the commands do and what you wanna do but the param part adds up

jade abyss
#

When using _this, you don't need _this param

#

_to = param [0]; iirc

peak plover
#

even with param ? I thought tht was params only

jade abyss
#

lemme check

peak plover
#

๐Ÿค”

jade abyss
#

Yep

peak plover
#
When used without argument, as shown in main syntax, internal variable _this, which is usually available inside functions and event handlers, is used as argument
jade abyss
#

_HandleBlocked = false;
    _Container = param[0,ObjNull,[ObjNull]];```
peak plover
#

damn cool

jade abyss
#

Only when you select a different _Array than _this

peak plover
#

Can we vote the cutest command for 2017 ?

jade abyss
#

e.g.
_abc = [1,2,3]
_a = _abc param [0];

#

otherwise it's _this

tough abyss
#
addMissionEventHandler["TeamSwitch", {
onTeamSwitch {[_from, _to] call fnc_teamSwitch; };
}];
#
fnc_teamSwitch = {
 _to = param [1];
 unassignCurator myCurator; 
 _to assignCurator myCurator;
};
#

that didnt work

jade abyss
#

the Param part should work

tough abyss
#

idk i need to plug a hint in there, maybe its my Event not working

peak plover
#

yeah

jade abyss
#

btw... does
addMissionEventHandler["TeamSwitch",
give's you _from and _to as LocalVars? ๐Ÿค”

tough abyss
#

hmm

jade abyss
#

Anyway, just to be sure:

addMissionEventHandler["TeamSwitch", {
onTeamSwitch {[param[1]] call fnc_teamSwitch; };
}];```
#

and
fnc_teamSwitch = {
_to = param [0];

#

OR:

#
addMissionEventHandler["TeamSwitch", {
onTeamSwitch {(param[1]) call fnc_teamSwitch; };
}];```
```sqf
fnc_teamSwitch = {
 unassignCurator myCurator; 
_this assignCurator myCurator;
};```
#

Should also work

#

Also: Did you start your game with "Show script Errors"? If not: Do it. If it pops up: the # indicates the place of the error

tough abyss
#

yeah, it shows script errors. But no like.... SO when i go to map, and i click on team, and click switch unit

#

nothing seems to be firing

#

i doubt its the code, maybe the eventhandler is for Multiplayer?

peak plover
#

What's your goal btw

#

to have different zones?

tough abyss
#

When you switch units, the zues module follows you.

#

And yeah, kinda

peak plover
#

Isn't it easier to have 1 zeus and just change the area every time you switch?

tough abyss
#

there is only 1 zeus

#

what do you mean change the area? it needs to follow the unit. When you switch units, you are no longer "player"

peak plover
#

count allCurators

#

put that in your watch on debug

tough abyss
#

you know how the strategic map module works?

#

will i have it synced to missions,

peak plover
#

nope

tough abyss
#

selectPlayer fireTeam; unassignCurator myCurator; fireTeam assignCurator myCurator;

#

that works

#

the unit is fireTeam

peak plover
#

thats a weird name for a unit

#

Anyway

tough abyss
#

well i named them after the group.

#

You know how in the tac ops dlc, you can play as Special operatives Or Infantry

peak plover
#

I never played it

tough abyss
#

lol well your lucky, you werent disappointed when it came out

#

i mean it added some cool features

peak plover
#

I would be dissapointed if it was not dissapointing

#

So either way I win

tough abyss
#

But arma 3 vanilla missions are such a wet blanket compared to the community created missions

#

wouldn't i love to get paid to create missions

peak plover
#

Wouldn't be the same

tough abyss
#
addMissionEventHandler["TeamSwitch", {
onTeamSwitch {(param[1]) call fnc_teamSwitch; };
}];
#

So i dont understand

#
fnc_teamSwitch = {
 unassignCurator myCurator; 
_this assignCurator myCurator;
};
#

How does param [1] = _this

peak plover
#

onTeamSwitch {(param[1]) call fnc_teamSwitch; };

#

Is just like a function

#

so in there exists _this

#

which is equal to [oldUnit,newUnit]

#

But only way to get the oldUnit and New unit is param/params

tough abyss
#

well anyway it doesnt work, But i dont know if its even calling so let me add a hint

peak plover
#

[oldUnit,newUnit] param[1] //newUnit

#

 unassignCurator myCurator; 
_this assignCurator myCurator;
#

You are removing the same curator

#

and adding it back again

#

It won't change anything

tough abyss
#

You have to remove the curator before you can readd it to a different unit

river meteor
#

What resource can I look at to find out how to make custom items?

peak plover
#
unasssingCurator curator_a;
_this assignCurator curator_b;```
#

@river meteor I'd start by unpacking some items that people have made before

#

Maybe even bis stuff

tough abyss
#

lol good luck, their dlc stuff is locked

peak plover
#

It'll probably be unlocked in a few months

tough abyss
#

anyway yeah its not firing, i need a new event handler that detects when player switches

peak plover
#

cba

#

Probably has the solution

tough abyss
#

where can i find all the cba event handlers?

peak plover
#

Not sure if they have it but it's gotta be on the github

still forum
#

CBA_fnc_addPlayerEventhandler. The handler is called unit

tough abyss
#

i was just being dumb

#
addMissionEventHandler["TeamSwitch", {
    unassignCurator myCurator; 
    player assignCurator myCurator;
}];
#

this actually follows the player around regardless of what unit he takes

#

anyone on?

plucky willow
#

i want to move a player out of a moving vehicle but not inherit that vehicles velocity

still forum
#

@tough abyss Only 1600 people. But otherwise. No.

tough abyss
#

Lol

#

@plucky willow I could see how that would be Un ideal

#

@still forum know anything about zeus and high command?

still forum
#

No

tough abyss
#

Dang

plucky willow
#

@tough abyss any ideas on how i could accomplish that?

#

i suppose a workaround would be to simply set the players velocity to zero

#

but i am not aware how to do that

#

vehicles use velocity but I cant find what players get

tough abyss
#

hold up i think i know how

#
player addeventhandler ["fired", { 
  _bullet = nearestObject [_this select 0,_this select 4]; 
  _bulletpos = getPosASL _bullet; 
  _o = "M_AT" createVehicle _bulletpos; 
  _weapdir = player weaponDirection currentWeapon player; 
  _dist = 1; 
  _o setPosASL [ 
    (_bulletpos select 0) + (_weapdir select 0)*_dist, 
    (_bulletpos select 1) + (_weapdir select 1)*_dist, 
    (_bulletpos select 2) + (_weapdir select 2)*_dist 
  ]; 
  _up = vectorUp _bullet; 
  _o setVectorDirAndUp[_weapdir,_up]; 
  _o setVelocity velocity _bullet; 
}];
#

I played with this soo much

#

THis turns your bullets into missles

#

Anyway look _o set velocity velocity _bullet;

#

sometimes id change it into a plane, and then move the player into cargo...... Lol

#

IF ur wondering what happened... umm you still crash, because the plane is going so fast that you cant leave the arc

plucky willow
#

setVelocity only works on vehicles, not players

peak plover
#

players are vehicles

tough abyss
#

move the player into a vehicle? then set that vehicle velocity and delete it?

plucky willow
#

my setvelocity isnt working on players for some reason

tough abyss
#

anyway so nigel, what are you working on?

plucky willow
#
{
    if((side _x) == CIVILIAN) then {
        moveOut _x;
        _x setVelocity [0,0,0];
        _x setPos getmarkerpos(_myMarker);
    };
}foreach allUnits;
#

this is roughly what i have

tough abyss
#

but it works on non players?

plucky willow
#

yeah i use setvelocity all the time

#

works fine

tough abyss
#

can i ask what the context is?

plucky willow
#

so i want the player to be driving around in vehicles and after a set amount of time I want to boot the players out of their vehicles and teleport them to a different location

#

I'm trying a workaround where I stop their vehicles but I would prefer the vehicles to continue moving

peak plover
#

u dont need moveout

#

setpos already gets oyu out of vehicle

plucky willow
#

will setpos reset velocity?

peak plover
#

It should

#

I can be flying in the air with a plane and setpos to somewhere

#

take no damage

#

so yeah

plucky willow
#

tested it, seems to work, thank you

tough abyss
#
{_x addEventHandler [
    "CuratorGroupPlaced",
    {
     player hcsetgroup [(_this select 1)];
    }
];} forEach allCurators;
#

that right there, creates an hc group, but when i set a waypoint, The guys dont move, its like their empty HC groups

#

eh i dont want to do that anymore

#

lol nobody work on that

#

hc is worthless

plucky willow
#

i have a local script that checks if a player is in a given area, but the area is very small and the player will be moving very fast. is there a way to guarantee that the inArea script will go off without increasing the amount of checks per second?

#

specifically, i do not want to check every few seconds at all

#

id rather it work like a trigger or something

#

fuck it im too tired to improve this, if it works it works

little eagle
#

There are plenty people that implemented hcs. I know jonpas did for acex.

nocturne iron
#

hm

#

I've been doing some digging to intercept how the curator draws unit icons

#

and it seems it passes icons to a variable in the curator object namespace

#

except when I grab that data, it's just the number '1'

#

does anyone know how curator handles the drawIcon3D event handlers it must be running?

dry egret
#

i need a bit of help with a script spawning in a vehicle on a dedicated server

_Raider_1 = [];
_extractChopper_1 = [];

if (isServer) then 
{
    _Raider_1 = createGroup WEST;
    _extractChopper_1 = [getMarkerPos "extractionSpawn_1", 0, "B_Heli_Transport_03_F", _Raider_1] call BIS_fnc_spawnVehicle;

    extractChopperGlobal = _extractChopper_1 select 0;
    publicVariable "extractChopperGlobal";

    
//Extraction Waypoints
    _wp = _Raider_1 addWaypoint [wp_POS, 0];
    _wp setWaypointType 'MOVE';
    _wp setWaypointSpeed "FULL";

    _wp1 = _Raider_1 addWaypoint [position ab1, 1];
    [_Raider_1, 2] waypointAttachVehicle vehicle ab1;
    _wp1 setWaypointType 'MOVE';
    _wp1 setWaypointSpeed "FULL";
};

the script is called from a trigger via execVM

#

Its no longer spawning after the last few arma 3 updates and it was working like 6 months ago on my dedicated server... any idea whats wrong?

nocturne iron
#

try calling it as a function first

little eagle
#

wp_POS is undefined.

#

ab1 is undefined.

#

Probably deleted those two in the mission and the script is bad and depends on global variables.

dry egret
#

ab1 is a boat in the mission and wp_POS is an invisable helipad

stable wave
#

I'm starting to learn scripting. I've got some questions. The first one is - What does compile do actually? It seems to me that it just encloses an expression with a pair of curly braces, which is quite different from what the compiler does in C++.

tulip cloud
#

Anyone know why this doesn't work?


while {true || 900 < 600}

The script runs but doesn't stop. Shouldn't the second operator throw false and cause the while to exit?

#

...nvm dumb question. brain dead

#

It would work if I used &&

little eagle
#

๐Ÿ˜ƒ

tulip cloud
#

gotta love that

little eagle
#

Why though?

#

true &&
seems redundant.

tulip cloud
#

I just did that to figure out why it wasn't work

#

lol

little eagle
#

I see, playing with logic.

tulip cloud
#

yup

#

Because appearantly my brain is so dumb that I gotta really dumb it down before It clicks ๐Ÿ˜„

little eagle
#

Footage of justin playing with logic elements.

tulip cloud
#

haha seriously...

cedar kindle
#

@little eagle There are plenty people that implemented hcs. I know jonpas did for acex.
he's talking about high command

#

confusing that they have the same abbreviation

little eagle
#

Ouch -.-

dry egret
#

so how can i fix my script?

still forum
#

@stable wave compile compiles your script. You cannot see binary.. so when you stringify it it displays you the actual script that was compiled. So what you see is curly braces with code inbetween.

little eagle
#

Add some debugging log to it and check the intermediate values of the variables. systemChat str [_var] and/or diag_log [_var].

jade abyss
#

Why [_var]? [] not needed

little eagle
#

To catch undefined variables.

jade abyss
#

hm, good point

little eagle
#

systemChat str _undefined
just fails silently.

#

Just something I got used to after being confused one too many times.

jade abyss
#

Yeah, fully agree.

stable wave
#

@still forum Thanks for the explanation. But why would one compile an expression instead of using plain code?

still forum
#

Every code is compiled

#

If you load a file it's a string that has to be compiled

#

If you copy-paste a script into the debug console it is a string that has to be compiled before you can execute it

#

so "using plain code" is just not possible. Arma doesn't provide the ability to load pre-compiled binary code

#

I could do that though.

#

I guess that would be a neat side project ๐Ÿ˜„

stable wave
#
_descExtPath = str missionConfigFile;
currMissionDir = compileFinal str (_descExtPath select [0, count _descExtPath - 15]);
still forum
#

Maybe even build a very basic optimizer.
That turns a static array from
push element, push element, push element, build array. To just a constant value

stable wave
#

Take this code for example. Why does it compile the string holding the current missiong directory?

still forum
#

I don't know why the author decided to do that

#

He probably wanted to prevent the variable from being overwritten

#

you can't overwrite variables marked as Final

#

and the only way to create final variables in plain SQF is using compileFinal

#

Actually only the CODE variable type even has the possibility to be final in engine

stable wave
#

Ah. That makes sense

candid jay
#

all, how can i get the relative position _posRel of an object A to another object B, so that I can move object C in the same position as object A by using _posC = ATLToASL(B modelToWorldVisual _posRel);?