#arma3_scripting

1 messages · Page 485 of 1

tough abyss
#

Playing the mission in MP doesn't seem to work.

austere granite
#

you can start two clients

#

and connect to yourself just fine

#

There's usually two entries in the LAN tab with the non-host and one of them should work, it does for me at least

tough abyss
#

Wait

#

You can have 2 clients?

austere granite
#

Sure, maybe not with the vanilla arma launcher, but that one is shit anyway 👌

tough abyss
#

:(

#

Start persistent dedi and client

austere granite
#

I use arma3sync for dev related stuff launching, does everything you need

tough abyss
#

When you disconnect dedi will still run

#

You can have many clients depends on your hardware how many it can handle

meager heart
#

btw you can click play twice in launcher, also in b4 it was possible to join your own host

#

(iirc was disabled be and -noPause startup param 🤔)

meager heart
tough abyss
#

I'm confused, I'm getting Undefined variable in expression

#

but printing the variable with diag_log returns any

#

and isNil isn't working on it.

#

addMissionEventHandler ["PlayerConnected", {
params ["_id", "_uid", "_name", "_jip", "_owner"];

if(isNil _uid || isNil _id) exitWith {
    diag_log "isNil _uid || _id";
};

}];

still forum
#

isNil _uid that's not how isNil works

tough abyss
#

so how do I prevent the Undefined variable error?

still forum
#

Use isNil correctly.

meager heart
#

also maybe you will need filter __SERVER__ name 🤔

tough abyss
#

ah so I should surround the variable name with quotes then?

still forum
#

Yush

tough abyss
#

_uid and _id will always be defined inside PlayerConnected mission EH with that use of params, so why bother checking it?

still forum
#

because he get's nil errors so they apparently... wait...

#

undefined variable errors don't exist in unscheduled 🤔

tough abyss
#

Errors don’t match presented code

#

It might have complained trying to isNil a number

still forum
#

ERROR! Error not found

tough abyss
#

Hehe

unborn ether
#

Checking EVH params with isNil. That's new.

meager heart
#

dedicated _uid > ""

#
//--- local host 
[2,"76562198345855537","player_name",false,2] 
//--- dedicated
[2,"","__SERVER__",false,2] 
#

also you can have this >

[1.08018e+009,"76562198345855537","player_name",false,3] 
#

dedicated and client on the same pc ^

unborn ether
#

Still, how's that around isNil? 😄

austere granite
#

undefined variable errors don't exist in unscheduled

#

Why is this btw?

#

Its annoying as fuck

meager heart
#

@unborn ether i guess he was trying to fix that empty string uid by checking it with isNil 🤷

unborn ether
#

Can anyone tell if there is a way to add proxies? to a GroundWeaponHolder* like it has something in it?

still forum
#

Why is this btw? that's actually default

#

scheduled is the special one. It has a setting to handle all undefined variables as error

austere granite
#

There isnt some special coin i can insert to enable that for unscheduled im guessing?

still forum
#

uhhh.. Well.. Intercept... eh.. no.

#

Like.. yes. but no

#

u know?

meager heart
#

kinda*

#

or... 🤔

high marsh
#

sometimes, only on tuesdays.

meager heart
#

probably depends on the phases of the moon 🌚

austere granite
#

If the furry can't just give me a straight yes then I guess it's a no ;_;

outer fjord
#

How can I make a Addaction global?

sudden ember
#

I'm trying to figure out a way to ensure that looping code added to a units init EH is only called about once a second so as to reduce processing load. Does anyone have recomme rations on how to do this? Its sounding like I can't simply use waitUntil? Thanks in advance

outer fjord
#

huh, what exactly makes it global?

#

out of translation that is

#

So if I have something like _vehicle addAction ['Hello world',{hint 'hello world';}];

#

Also yea, so it's basically available to everybody.

#

Sorry if that was confusing.

tough abyss
#

Make a function that adds action to a local player then remoteExec it everywhere but dedicated server

meager heart
#
[_object, {
    _this addAction ["Action text",{ /* code */}];
}] remoteExec ["call"];
#

@outer fjord you can try this way 🙄

outer fjord
#

So reading up on remoteExec

#

That is what sends it to all clients yea?

meager heart
#

clients and server

unborn ether
#

@meager heart Not the best idea to remoteExec objects, Arma doesn't like it.

meager heart
#

wut

unborn ether
#

Apparently, it doesn't like it, since you will start getting Server|Client: object #:# not found on the other end. The more objects sent, the more of them.

#

It seems that remoteExec and any other way of "publication" has some issues with object pointers validity.

meager heart
#

OK... and your suggestion ? 😃

#

@unborn ether

unborn ether
#

You need to add action for every PC on a object?

outer fjord
#

Yea, so basically I have a object spawn in with a addaction, but said addaction is only local to the player that spawned it in.

unborn ether
#

Two ways, one is easier and less optimal, second is more complicated:

  1. Add addAction to a player on every PC (thru Event Scripts) with condition of specific object variable expected from something like cursorObject getVariable
  2. Using ... remoteExec ['addAction',-2,true] way, where you don't remoteExec the vehicle reference, using vehicles and getVariable.
tough abyss
#

If you make addAction JIP persistent you will get one for every joining player, why would you want that?

#

Also remoteExec and sending objects problem, sounds like a lot of unfounded assumptions

#

Object not found message was there before remoteExec and is to do with something else, don’t remember exactly what, but it has been investigated

frigid raven
#

@tough abyss I did not followed the whole conversation. What is wrong with using initPlayerLocal.sqf here? Or is the vehicle spawned by the server ?

#

In regards to the "all players receive the add action of the vehicle"

tough abyss
#

I understood it as being suggested to addAction to player and make it persistent

unborn ether
#

@tough abyss and any other way of "publication" means not just remoteExec

#

It's not an assumption it's a clarified, but undocumented issue, I was investigating this case since A2.

tough abyss
#

There was no remoteExec in A2

unborn ether
#

Oh srsly? So no publicVariable*s and no addPublicVariableEventHandler

tough abyss
#

I am referring to @meager heart Not the best idea to remoteExec objects, Arma doesn't like it.

#

Which is horseshit

unborn ether
#

Ok, horseshit. As for me a call a horseshit when mate is just speaking and giving no practical solution, but calling everything a horseshit.

#

Boom

tough abyss
#

Whatever

unborn ether
#

Definitely.

meager heart
#

😃

#

iirc in a2 was "remExWrite.sqf" ? (not 100% with the filename) aka RE aka functions module

#

(that what is real horseshit imo 😄)

frigid raven
#

can I enforce some kind of log rotation? Having my ALiVE Mission running for few days the friggin .rpt is heluva large and unopenable (< cool word)

still forum
#

@unborn ether Apparently, it doesn't like it, since you will start getting Server|Client: object #:# not found on the other end. The more objects sent, the more of them. that's not remoteExec.
There aren't any problems remoteExec'ing objects unless the object is local only
Your stuff is just plain horseshit

frigid raven
#

is there a arma server channel?

still forum
#

scroll down in the channellist.

frigid raven
#

ah skipped that thx

unborn ether
#

@still forum As I told - if you call it horseshit - ok. I will avoid using broadcast along with vehicles.

hollow thistle
#

I'll believe the guy that knows engine internals 👀

unborn ether
#

Still haven't seen any explicit explanation of that case for 7 years. 🤔

hollow thistle
#

There aren't any problems remoteExec'ing objects unless the object is local only remoteExecing on stuff that is not present on remoteclients.

still forum
#

remoteExec'ing an object is literally just sending a number

#

If the number cannot be resolved back it just turns into objNull

#

Just stop sending objects that don't exist.

unborn ether
#

Ok, ill just quit arguing, since object not found issue is still present and its not explained, while I checked it with not-null objects via remoteExec

#

You can continue putting your trust in RV Engine consistency.

still forum
#

it's explained

#

drop a backpack and pick it back up

#

and watch the serverlog

#

There is a feedback tracker entry about it. And bi "fixed" it.. kinda... Not really.
The changelog said "fixed lag caused by" not "fixed bug". And no one ever complained about any lag.. So really no idea what they did

hollow thistle
#

Also as we deviated from original question. this should be enough for "global" addaction.

[
            _entity,
            [localize "STR", <CODE>, nil, -801, false, true, "", <STRING>, 10]
        ] remoteExec ["addAction", 0, true];
still forum
#

It's that backpacks are not actually the containers that contain the items.
The actual container is at 0,0,0 and drops tons of errors when it disappears on server because it should be gone, but clients still send position updates

#

remoteExecCall makes no sense there really.
If you execute a command, remoteExec == remoteExecCall

#

but one is shorter.

hollow thistle
#

Fixed.

meager heart
hollow thistle
#

isnt this less performant?

#

you're creating a <CODE> with the array etc inside.

#

instead of just sending an array.

meager heart
#

(btw there are no arrays inside)

#

_object call {_this < object}

#

[_object] call {_this < array}

still forum
#

there are no arrays inside
_this addAction ["Action text",{ /* code */}];
looks at array

meager heart
#

oh... you mean that

hollow thistle
#

How can I make this better...
displayOnLoad

// Make display unclosable if player is dead
if (!alive player) then {
    _display displayAddEventHandler ["KeyDown", {
        params ["_display","_dik","_shift","_ctrl","_alt"];
        if (_dik == 1) exitWith {
            [] spawn {
                private _interruptDisplay = (findDisplay 46) createDisplay "RscDisplayInterrupt";
                waitUntil {_interruptDisplay isEqualTo displayNull};
                [] call KPLIB_fnc_respawn_open;
            };
        };
    }];
};
#

written at 1am after long day of work. 👀

#

💩

still forum
#

if (_dik != 1) exitWith {} and remove a level of indentation

hollow thistle
#

It's not exactly uncloseable as by blocking the ESC handler but by allowing to open the ESC menu over it and reopening the display after the menu will be closed.

still forum
#

do you use the spawn to delay?

hollow thistle
#

no, i tried once to do (findDisplay 46) createDisplay "RscDisplayInterrupt"; in KeyDown EH and my game crashed.

still forum
#

XD

meager heart
#

also you need disableSerialization here

hollow thistle
#

I do? Had no errors.

still forum
#

Ask yourself the question: Is it still there after a savegame load?

#

So.. Is the display exact display there after a savegame load? no.

hollow thistle
#

No.

still forum
#

Thus you don't wanna serialize

hollow thistle
#

enableSaving false 🙃

still forum
#

Problem solved.

hollow thistle
#

I'll add this tho.

#

I's even uglier now. 😄

meager heart
#

also maybe just >

if (!alive player) then {
    _display displayAddEventHandler ["KeyDown", {
        params ["_display", "_dik", "_shift", "_ctrl", "_alt"];
        if (_dik == 1) then {
            call KPLIB_fnc_respawn_open 
        };
    }];
};
```🤔
hollow thistle
#

no point i could return true if i would want that.

#

and it would block closing.

#

I want the "intteruptdisplay"

#

if you load into the mission you are supposed to be able to disonnect without having to respawn.

meager heart
#

create that display from the function ? 🤔

hollow thistle
#

Also as liberation is often modified by inexperienced people if you break something in the logic of the respawn you will have to `alt + f4" the game if the display will be unclosable 🤔

meager heart
#

enableSaving false > saving = 0; into description 👌

#

steals 🍪

hollow thistle
#

🍪 ノ( ゜-゜ノ)

worthy fox
#

Does anyone know if its possible to have a SubCat inside the 3D Audio module in zeus?

still forum
#

afaik no

#

I think I once tried that

mighty jackal
#

anybody know how i can add an action Id to this action? _heli addAction ["Toggle Basket","uh60m\scripts\toggleRescueBasket.sqf",[_basket,_heli],0,false,false,"",""];

still forum
#

add an action Id to this action you don't

#

addAction returns the ID

mighty jackal
#

then if its returning it why when i use the action its still there so when i deploy my basket and when its out i still have the deploy basket option but i want it to get taken away once the basket is outside the helicopter

still forum
#

remove the action

#

you should also get the ID inside your toggleRescueBasked via _this

mighty jackal
#

do i not need to have an id for the add action? so i'd just do _heli removeAction 0; at the end of the script?

still forum
#

you need the ID

void badge
#

Do you guys know why there is none remove functions for cargo ? Must remove content then add what we want ?

still forum
#

there are none because noone made them yet

#

It's also a bit hard when you get into removing weapons or magazines. Which one to remove if you wanna remove one and there are multiple with different attachments.

void badge
#

You can't really make them :/

still forum
#

I can...

#

But yeah.. with "noone" I meant BI devs

void badge
#

I mean without removing all magazines then adding back what you what

#

yes

#

that's kinda sad because adding stuff back must generates heavy traffic

still forum
#

Yeah kinda. If you do it in one batch in unscheduled it might batch the network messages together

void badge
#

wil try

#

thx for your responses

unborn ether
#

Is there any engine solution to stop exact WeaponHolder* to be cleaned up, besides creating _scripted variant?

still forum
#

Creating the scripted variant 😄

#

Or just add a dummy item

unborn ether
#

Eh. Dummy item will still be listed and can be taken 😦

still forum
#

Oh engine solution? You can just hook the simulation method and make it skip sim

#

not if it's a DLC item of a dlc that doesn't exist

unborn ether
#

🤔 dirty but will work

#

I just tried to override InventoryOpened with creating a _scripted variant and then using player action ["Gear", _scriptedholder]

#

Well that didn't go well 😄

unborn ether
#

@still forum You can just hook the simulation method and make it skip sim more detailed on that?

still forum
#

No

#

EULA violation

tame lion
#

hey guys, what config property determines if a weapon is gonna show in the arsenal or not? it doesn't seem to be scopeArsenal like i thought cause that returns far fewer results than what i have present

unborn ether
#

@still forum pink panter music

austere hawk
#

@tame lion my crystal ball says that 1) wrong channel 2) cfgPatches is incomplete

tame lion
#

i was asking for a way in scripting because i need to know which property to pull from a weapon config via getText/getNumber

austere hawk
#

oh then it is scope first, and scopeArsenal second

#

if something has scope=2 it appears automatically

tame lion
#

Yeah problem is scope ==2 also returnsall weapons that are derived from arsenal weapons for ai. EX: arifle_mx_aco_f wouldshow up in a query but wouldn't show up in arsenal

meager heart
#

afaik weapons with predefined attachments "private/hidden" in the arsenal, only base classes there...

tame lion
#

I know that @meager heart but what im trying to do is get all these classnames in an array using something to the extent of

_weapons = "getNumber (_x >> 'scopeArsenal' ==2)"  configClasses (configFile >> "CfgWeapons"); //This line returns a very small, incomplete list which is missing even some vanilla weapons.

vs

_weapons = "getNumber (_x >> 'scope' ==2)"  configClasses (configFile >> "CfgWeapons"); //This line returns every weapon, including all the AI weapons and the vehicle weapons.```
#

im gonna use this to create a shop system that accommodates for whatever mods are currently loaded where a player can purchase weapons

cedar kindle
#

does setDriveOnPath work for anyone? it does nothing for me

dusky pier
#

hello, i have on my mission a lot of objects - and getting low fps in the towns. is possible to use script for better FPS?

inner swallow
#

Make them simple objects

#

Or disable simulation

dusky pier
#

i try'ed sqf {_x enableSimulation false;} forEach objects; but fps is still low

inner swallow
#

Or use dynamic simulation

dusky pier
#

@inner swallow ty, i will read about simple objects and dynamic simulation

tough abyss
#

Last time I tried driveOnPath it was broken, so never touched it again

proven crystal
#

My mission keeps kicking me out of zeus after a while. Has anyone encountered that before? Im running it via lan or internet

#

Kicks me out of zeus interface and doesnt let me back in

#

Could it have to do with cleanup functions?

inner swallow
austere granite
#

Anyone happen to know why AI are so obsessed with vehicles and always want to reenter them?

#

I don't assign vehicle through script anywhere, but just checking assignedVehicleRole quite a bit of units have a role assigned

dusky pier
#

@inner swallow thank you!

meager heart
#

@austere granite afaik that happens only if you kicked them out but the vehicle is still "added" to a group and not "unassigned" for the crew...
you can try [_x] allowGetIn false; > kick them out (with action for example) or just use leaveVehicle that is the same as "remove vehicle from the group" + unassignVehicle + order get out

austere granite
#

Yep thanks, decided to go with a GetOutMan EH and leaveVehicle with that

proven crystal
#

So this message seems to be related to the issue that kicks me from zeus>
15:08:09 A null object passed as a target to RemoteExec(Call) 'bis_fnc_objectvar'

#

i have no clue what might cause it

junior stone
#

hi,

Anybody know why that has only a local effect?

ropesegmentX = player nearObjects ["ropesegment", 20];
{if (typeOf _x == "ropesegment") then {_x setObjectTextureGlobal [0, ""]; _x setObjectTextureGlobal [1, ""]; _x setObjectTextureGlobal [2, "#(argb,8,8,3)color(0.752941,0.752941,0.752941,0.5,CA)"];};} foreach ropesegmentX;
still forum
#

maybe ropes are local?

meager heart
#

also player

#

also x2 bad idea setObjectTextureGlobal on the client

still forum
#

also player I don't see any relation to the asked question

meager heart
#

you will see it later... maybe 😃

#

(i guess)

still forum
#

I don't know where I would

meager heart
#

well... we can ask where that code was running

still forum
#

As he says "only a local effect" I would assume on the.. player.

meager heart
#

i think that was trigger... or logic

#

lets see

still forum
#

and... why does that matter?

junior stone
#

its not a trigger or logic

#

its if someone throws a fishing rod

#

everybody can see the ropes, but not the texture changes

still forum
#

Only reason I can see is if ropes are local. Maybe the rope commands say something about that on biki?

junior stone
#

thing is, everybody can see the created ropes

#

only the texture change is shitty

still forum
#

I know..

#

doesn't change anything on my statement

#

like. Everyone has their own local only ropes

junior stone
#

ah that you mean

#

hm...

#

then i probably need to do it via remoteexec 😄

meager heart
#

tadam

still forum
#

you could check by getting the netID's of the different rope segments on different clients. If they are not the same then everyone has their own ropes

junior stone
#

will check that in a hour

calm bloom
#

Hello, guys. I have a strange problem: items in the players uniform, which are written into the mission.sqm manualy (just like 3den set loadout), can not be looted in a multiplayer. Same goes for the backpack, but anyone can equip it and make it local for self. Did anyone encountered that?

still forum
#

which are written into the mission.sqm manualy what? how?
but anyone can equip it and make it local for self what? Don't understand what you mean

calm bloom
#

class uniform {
typename="TRYK_U_B_3CD_Delta_BDUTshirt";
isBackpack=0;
class ItemCargo {
items=11;
class Item0 {
name="ACE_fieldDressing";
count=4;
};

#

this stuff

#

theese items can not be looted. My second guess is that it happens because the client gets this in the cur_mp folder

#

Which i am checking right now)

still forum
#

gets this what?
And why are you doing that manually? why not use Arsenal to specify the loadouts

calm bloom
#

well, i am wrighitng mission.sqm from the game state

#

adding slots instead dead guys and scenario goes on

#

it is like a respawn but mission can be played next week

#

with a bit of realiability, not to spawn all the things at our 200 people size

meager heart
#

🤔

calm bloom
#

so basicaly you cant loot dead body just like items there are not local to you

#

You get its backpack, and items are lootable since it is on your back

tough abyss
#

How do I open vanilla arsenal without all items unlocked?

#

Do i need the code (["Open", true] call BIS_fnc_arsenal;) in an addAction?

still forum
#

without all items unlocked you just posted the code to open the arsenal WITH all items unlocked

tough abyss
#

Yeah

#

I tried both, but neither worked.

still forum
#

"both"?

tough abyss
#

yeah, one with all itmesd unlocked, and one without items unlocke

still forum
#

which one is without?

#

And what's the problem with it?

#

what does it mean that they don't work?

calm bloom
#

Ok to symplify the case, guys, you basicaly cant loot items from dead body with custom 3den inventory

#

unless you put on the container on yourself

#

Just reproduced it on clean mission

#

And sorry for my articles)

tough abyss
#

Does the vanilla arsenal support item amounts? Like 5 AK74s, 3 Pistols etc.
Or can it only have infinite item amounts?

still forum
#

no

tough abyss
#

Ok thanks

calm bloom
#

[[cursorObject,clientOwner], {(_this select 0) setOwner (_this select 1)}] remoteexec ['bis_fnc_spawn',2,false]

set owner works it

#

just, its really strange that you have to do this for mission object though

#

sorry to bother and thanks for the answers)

tough abyss
#

Quick question about remoteExec: when remoteExec'ing from one player to one other player, is there any network impact at all on the server or the other players not receiving this?

still forum
#

messages goes from sender->server->receiver

#

receiver can be a specific player, or multiple, or all, or none

tough abyss
#

Thanks

#

I've got a second question, but this one might be a little too vague to really answer, how big is the overall impact of sending a position(posASL) over remoteExec 2-3x per second to a 5ish people on something like a server with 30-40 players on it.

While I've done this without really seeing any negative impact, I've got absolutely no frame of reference for at which point sending data becomes problematic, and am not sure how crazy I should go with the degree of optimisation.

still forum
#

The impact is X

#

where X is between 0 and infinite

#

And the unit of X is unknown

tough abyss
#

as expected 😄

paper cove
#

Need help writing scripts for the Life project

meager heart
#

that comment on the BIS_fnc_arsenal page... you can get the arsenal action id with bis_fnc_arsenal_action variable

knotty arrow
#

when u use a Publicvariableclient to get a var from the server... is it necessary putting a waituntil for waiting the response?

still forum
#

I think yes

#

You give too little information to provide a definitive answer

knotty arrow
#

ok

#

thanks u ❤

tough abyss
#

No no waiting. Server sends it and carries on

knotty arrow
#

do u think that its not needed to put a waituntil?

tough abyss
#

What do you want to wait until?

knotty arrow
#

If u want to ask a var to the server and use the var in the script

#

the server do not send the var instatly

#

u need to put a waituntil to wait for receive the var

tough abyss
#

You mean you send request to the server from client and want the server to send back reply?

knotty arrow
#

yep

#

i do it with publicvariableclient and publicvariableserver

tough abyss
#

You can set event handler so you don’t have to wait and put your code in it or make server call a function on your client with the result

knotty arrow
#

but u need wait for the server do the call

#

so.. u need to put a waituntil to receive the var

tough abyss
#

Server can know who sent request and can reply back

knotty arrow
#

i know

#

thats not the question

tough abyss
#

No you don’t need wait until you can call function on the client from the server

knotty arrow
#

with remoteexec right?

tough abyss
#

Yeah

knotty arrow
#

its better do a waituntil

tough abyss
#

No it is not

knotty arrow
#

because remoteexec last 0.0191MS

#

and publicvariablesclient

#

last 0.003 ms

tough abyss
#

Wait until can last longer there is no guarantee it is executed in scheduled could take ages

#

What?????

knotty arrow
#

?

tough abyss
#

You are worried about a hundreds of a millisecond while advocating the use of wait until? I don’t even...

knotty arrow
#

in other ways cannot avoid use it

tough abyss
#

Not to mention that the use of public variables brings insecurity

knotty arrow
#

where is publicvariables?

tough abyss
#

Don't be shy, I saw you typing

knotty arrow
#

no, i use publicvariableserver

#

its not the same like publicvariable friend

calm bloom
#

Anyone knows good multiplayer framework for making agent running cycled animations?

unborn ether
#

@calm bloom AnimDone|AnimChanged EVH for example.

calm bloom
#

Yep, i was just thinking if anyone made this together already

tough abyss
#

somevariable = compileFinal "fucked"; publicVariable "somevariable"; If you used somevariable with publicVariableServer it is now fucked

unborn ether
#

^ also things like remoteExecutedOwner and isRemoteExecuted gives some benefits to remoteExec family commands not present for publicVariable*

tough abyss
#

Arma 3 is so far ahead of Arma 2 in terms of scripting improvements you might as well stop looking at old code

#

How do I use the playerConnected EH correctly?

#

Right now I have this:

#
addMissionEventHandler 
["PlayerConnected", 
{
[] spawn {

    params ["_id", "_uid", "_name", "_jip", "_owner"];
    
    if(!isServer)
    exitWith { diag_log "Not a server."; };
    
    diag_log [format["HLG: playerConnected.sqf: %1 %2 %3 %4 %5", _id, _uid, _name, _jip, _owner]]; 
    };
}
];```
#

and it returns "HLG: playerConnected.sqf: any any any any any"

meager heart
#

```sqf
your cool code
```

tough abyss
#

done

meager heart
#

you need filter server there ^ ?

tough abyss
#

?

meager heart
#

you are trying to get the "real client" and filter the server with that eh ^ ?

tough abyss
#

no i just want to get the uid, id, name, etc. of the player that joins

#

the isServer is there so it doesnt try to do that in SP

meager heart
#
private _mehID = addMissionEventHandler ["PlayerConnected", {
    params ["_id", "_uid", "_name", "_jip", "_owner"];
    if !(_name isEqualTo "__SERVER__") then {
        diag_log format ["HLG: playerConnected.sqf: %1 %2 %3 %4 %5", _id, _uid, _name, _jip, _owner]; 
    };
}];
```something like that maybe ^
tough abyss
#

@meager heart thanks that worked! I guess I need to name all my EH now.

meager heart
#

I need to name all my EH now
sorry wut ?

tough abyss
#

well all you did was add private _mehID right?

#

oh and you removed spawn

meager heart
#

oh ok i see...

#

that "name" is > Return Value: Number - The index of the currently added mission event handler is returned. 😃

tough abyss
#

yeah return value

unborn ether
#

@tough abyss You don't actually need to store them, unless you are willing to remove them later.

frigid raven
#

hey peeps

hollow thistle
#

👋

velvet merlin
#

is there some way to break out the loadingscreen if gets stuck by an script error? (to avoid restarting the game)

#

i know back in the A2 days the dev version, had a special key combo for that

compact maple
#

press echap ?

velvet merlin
#

doesnt work during preloading/loading screen

frigid raven
#

Is there a script snippet for a login procedere out there ?

#

I would like to have some kind of character login - where it loads state from the servers profile out of a cba hash

#

Just wanna take a look at some examples how others implement a login procedere to get some persisted Player state

compact maple
#

@frigid raven i dont think so, i did mine tbh

carmine maple
#

is there a way to get the pp handle of the Halo jump "RadialBlur" ppEffect? Its created by arma itself, and i need to destroy it.

compact maple
#

why do you want to do this ? curious lol

carmine maple
#

arma sometimes fails to cancel the effect after a halo jump was done. You have to run around forever with that effect and its kind of annoying

#

so the fix would be to make sure the player does not die? hm

velvet merlin
#

@carmine maple gotta check the A3 scripts and see if the FX leaves a GV to operate with

#

otherwise not sure if you can overwrite the blur with a second call and then kill it off

carmine maple
#

ah i see. Handles are just numbers so you boot force kill all effects

#

@tough abyss thanks that helps alot

spring stone
#

Heyho, I have a little question. For a little weather script I want it to create some wind but I don't want to specify the wind direction. I currently have this:
[0,[(random [-5,0,5]),(random [-5,0,5]), true]] remoteExec ["setWind", 2];
Its not working though. I'm sure I missunderstand how random works here. Can someone help me?

compact maple
#

there is a comment that explain the function

tough abyss
#

setWind has only right hand side argument

#

Why not check wiki for syntax when it doesn’t work?

wary vine
#

could someone confirm that with

if (params [
    ["_type", -1, [0]]
]) exitWith {systemChat format ["{DEBUGGING} {ERROR} {%1}", _type]};
``` the default value would be -1 
because when I send 0 through with it, its exiting with the error
#

omfg

#

im a damn idiot

#

i forgot the !

frigid raven
#

Show the working example pls

wary vine
#
if !(params [
    ["_type", -1, [0]]
]) exitWith {systemChat format ["{DEBUGGING} {ERROR} {%1}", _type]};
hollow thistle
#

I don't see the point of manualy checking params with if. It is logged to RPT anyway if you pass wrong param.

#

Also you can enable script errors in launcher so they will be printed in your face.

still forum
#

@velvet merlin is there some way to break out the loadingscreen if gets stuck by an script error
endLoadingScreen

spring stone
#

@tough abyss While you are right...I'm sorry that I overlooked something, tze!

wary vine
#

@hollow thistle why go into the script at all if not needed ?

#

and for what im doing with this, it wont error

tame stream
#

Hi, i'd like some help with a script to remove all NVG's form all spawned in AI. Any suggestion on how to do this?

tough abyss
#

@tame stream ```sqf
{
if ((side _x) == WEST)then
{
_x unassignItem "NVGoggles";
_x removeItem "NVGoggles";

};
} forEach allUnits select {!isPlayer _x};```

#

this only needs to be run on server

#

replace WEST with whatever faction, obviously

still forum
#

and maybe filter by AI because he asked for AI ^^

tough abyss
#

@still forum audit that change because i'm not 100% certain that's the way to go

#

moar parenthesis

still forum
#

isPlayer takes object as argument

tough abyss
#

wait

#

i need to look at biki

drowsy axle
#

How can I set a variable to a spawned unit? ```sqf
for "_w" from 1 to 11 do {
wave = false;

for "_ei" from 1 to 11 do {
    sleep 2;
    hint format["Wave %2: Enemy %1.",_ei,_w];
    _unit = "O_Soldier_F" createUnit [position spawnObj, UnitGroup];
    _unit setVehicleVarName format["%1_%2_%3",_unit,_ei,_w];
    _unit join UnitGroup;
};

if !(alive UnitGroup) then {
    deleteVehicle UnitGroup;
    wave = true;
};

waitUntil {wave};

};```

still forum
#

How can I set a variable to a spawned unit?

setVariable

#

¯_(ツ)_/¯

tame stream
#

@tough abyss nice one mate..cheers

tough abyss
#

👍

drowsy axle
#

_unit isn't an object.

tough abyss
#

yes it is

still forum
#

it is...

tough abyss
#

createUnit returns the object it made

drowsy axle
#

Well how come Arma is telling me isn't?

ruby breach
#

createUnit - Return Value:
Object - The reference to created unit

wary vine
#

(allUnits - playableUnits) @tough abyss

still forum
#

¯_(ツ)_/¯

drowsy axle
#

I saw that @ruby breach

tough abyss
#

@wary vine expensive to run allUnits twice, you just need to check isPlayer

#

much cheaper

#

afaik

wary vine
#

do the foreach

tough abyss
#

oh

velvet merlin
#

@still forum how to call endLoadingScreen via console/etc when stuck and blackscreen?

tough abyss
#

yeah i guess you could do that too

still forum
#

@tough abyss Much more expensive to loop through many units instead of.. not doing that

#

@velvet merlin Bind a hotkey to it

tough abyss
#

there's multiple ways

tame stream
#

@tough abyss should i run that via init.sqf?

velvet merlin
#

neat idea. ty

tough abyss
#

no @tame stream

#

initServer.sqf

tame stream
#

thx

ruby breach
#

allUnits select {!isPlayer _x};

tough abyss
#

but it will only remove NVGs for units present at init

wary vine
#
private _units = (allUnits - playableUnits);
private _units = allUnits select {!isPlayer _x};
tough abyss
#

that's a better way to do it

#

gnashes has it best

wary vine
#

i was litteraly just writing that xD

still forum
#

playableUnits that excludes some AI tho

wary vine
#
private _units = (allUnits - allPlayers);
drowsy axle
#

How can I add these? as the + operator doesn't work for variable "merging". _var = _unit + _ei + _w

ruby breach
#

Use an array?

wary vine
#

capwell

#

what are the variables ?

tame stream
#

im want to use this script to remove NVG's from units that get spawned in as players move into an area (Liberation Gamemode), will that script remove AI NVG's if run via initServer.sqf?

wary vine
#

if they are strings use format

drowsy axle
#
UnitGroup = createGroup east;

for "_w" from 1 to 11 do {
    wave = false;

    for "_ei" from 1 to 11 do {
        sleep 2;
        hint format["Wave %2: Enemy %1.",_ei,_w];
        _unit = "O_Soldier_F" createUnit [position spawnObj, UnitGroup];
        _unit + _ei + _w;
        _unit setVariable ["", nil];
        _unit join UnitGroup;
    };

    if !(alive UnitGroup) then {
        deleteVehicle UnitGroup;
        wave = true;
    };

    waitUntil {wave};
};```
tough abyss
#

@tame stream you can remove the NVGs as you spawn in units then

ruby breach
#

Object, Number, Number respectively

#

If you want to make a "name", use format

wary vine
#

private _string = format ["%1%2%3", _unit, _ei, _w];

drowsy axle
#

That's what I tried, but within the setVariable area. Thanks

still forum
#

_unit + _ei + _w what is that even supposed to do?

#

make the variable name?

drowsy axle
#

Yes.

ruby breach
#

He's trying to make "Unit_1_1" style identifiers

drowsy axle
#

Yes. So that I can delete them

wary vine
#
private _unitsWithNVGS = allUnits select {(!(isPlayer _x)) && {"NVGoggles" in (assignedItems _x)}};
meager heart
#

UnitGroup = createGroup east; ...if !(alive UnitGroup) then { 😮

#

deleteVehicle UnitGroup; 😱

drowsy axle
#
if !(alive UnitGroup) then {
        deleteVehicle UnitGroup;
        wave = true;
    };```
meager heart
#

hides

drowsy axle
#

lol

still forum
#

Also I don't see how waitUntil {wave}; is supposed to work. Unless wave is used elsewhere

#

Also didn't you already learn that you should use tags on global variables?

drowsy axle
#

wave = false; after the for _w

#

What do you mean by tags?

#

C_wave?? @still forum

ruby breach
#

Just get into the habit of putting cap_ before any global variable you make

drowsy axle
#

lol xD kk

ruby breach
#

or whatever tag you want

drowsy axle
#
CAP_UnitGroup = createGroup east;
CAP_UnitArray = [];

for "_w" from 1 to 11 do {
    CAP_wave = false;

    for "_ei" from 1 to 11 do {
        sleep 2;
        hint format["Wave %2: Enemy %1.",_ei,_w];
        private _unit = "O_Soldier_F" createUnit [position spawnObj, UnitGroup];
        private _string  = format ["Enemy_%1_%2", _ei, _w];
        _unit setVariable [_string, nil];
        _string join CAP_UnitGroup;
        CAP_UnitArray pushBack _string;
    };

    if !(alive CAP_UnitGroup) then {
        deleteVehicle CAP_UnitGroup;
        CAP_wave = true;
    };

    waitUntil {CAP_wave};
};```
still forum
#

private _string = format ["%1%2%3", _unit, _ei, _w]; that won't work

drowsy axle
#

😦

#

😢

still forum
#

_unit will stringify to the memory address and model filename of the unit

#

Means a variable with # and whitespace and dots.

drowsy axle
#

Changed

still forum
#

Also setVariable and setVehicleVarName are very different things

#

And I don't know anymore what your intention is

#

And as already hinted if !(alive CAP_UnitGroup) then { will never work.

#

You just spawned the group. If you are not insta killing the units then that won't work

#

_string join CAP_UnitGroup;

#

does join take a string?

#

no. it doesn't

#

Why don't you just take _unit? You already have it right there.

drowsy axle
#

O_Soldier_F is created. and given a unique "identifier" variable based on the wave and count within that wave.

#

I then want to delete all unit's created within that wave before I begin the next wave.

still forum
#

Still not clear if setVariable or setVehicleVarName

drowsy axle
#

??

#

I've chosen setVariable?

still forum
#

So i guess that's what you want then. Okey.

#

deleteVehicle CAP_UnitGroup; That will also never work

#

does deleteVehicle take a group as argument? no it doesn't

drowsy axle
#

Would this? sqf { deleteVehicle _x; } foreach CAP_UnitArray;

ruby breach
#

Might I suggest that rather than assigning IDs to the units within the group, you just... you know... cycle through the group?

still forum
#

Would this? UnitArray is an array of strings.
Does deleteVehicle take string as argument?

#

You already have the group

#

you can use

#

to get all units in the group

drowsy axle
#
CAP_UnitGroup = createGroup east;

for "_w" from 1 to 11 do {
    CAP_wave = false;

    for "_ei" from 1 to 11 do {
        sleep 2;
        hint format["Wave %2: Enemy %1.",_ei,_w];
        private _unit = "O_Soldier_F" createUnit [position spawnObj, CAP_UnitGroup];
        CAP_UnitCount = count units CAP_UnitGroup;
    };

    if !(alive CAP_UnitCount) then {
        {
            deleteVehicle _x;
        } foreach CAP_UnitCount;
        CAP_wave = true;
    };

    waitUntil {CAP_wave};
};```
still forum
#

alive CAP_UnitCount

#

does alive take a number?

#

Why do all your mistakes amount to you just not reading the wiki?

drowsy axle
#

How do I change the UnitCount into a variable?

still forum
#

What?

ruby breach
#

It's already a variable

still forum
#

it is a variable

drowsy axle
#

So why is it a number? (yes, it states it on the page, ik.)

still forum
#

because it's a variable that you've put a number inside

#

thus.. a number.

drowsy axle
#

Okay. I thought I was grabbing the units to then delete them..

still forum
#

I told you you can use units for that

#

and that's true

drowsy axle
#

I could delete the group.. but I would need to create it each wave.

still forum
#

I have no idea where you got that count from now

#

noone told you that

drowsy axle
#

CAP_Units = units in CAP_UnitGroup; taken and adapted from: _isInMyGroup = _soldier1 in units player;

ruby breach
#

It's probably also worth mentioning ahead of you wondering why this doesn't work, that you're creating these units and then immediately trying to delete them

drowsy axle
#

Well they are dead... @ruby breach

still forum
#

Again.. You just don't read

#

units in CAP_UnitGroup doesn't make ANY sense

drowsy axle
#

So what does make sense??

ruby breach
#

How are they dead? You just created them.

still forum
#

for one units is a command without argument. Syntax error.
Second in doesn't take array on the left anyway
Third in doesn't take group on right anyway

drowsy axle
#

How the fuck am I meant to get shit from this:

Examples
Example 1:
_myUnitCount = count units group player;
Example 2:
_isInMyGroup = _soldier1 in units player;

still forum
#

They are examples

#

How the command can be used

drowsy axle
#

units groupOrUnit (CAP_UnitGroup)

still forum
#

none of these matches what you are trying to do

drowsy axle
#

CAP_Units = units CAP_UnitGroup;

still forum
#

you cannot just take something out of thin air. Slam a hammer onto it and expect it to work ^^

drowsy axle
#

Why are the examples over complex?

hollow thistle
#

Well you could learn the basics and it would be a lot easier to understand the examples.

drowsy axle
#

Where from? Please give me a SQF book to buy and read... please

tough abyss
#

you could read the Biki

still forum
#

many youtube tutorials out there

drowsy axle
#

I've read that.. all of that all the DataTyoes

tough abyss
#

the one saving grace SQF has is the documentation

drowsy axle
#

All of the Operators

tough abyss
#

then apply it

tame stream
#

lotta google, youtube and trail and error...thats how most here have learned to do it

hollow thistle
#

Well then it means you do not understand what you read.

tough abyss
#

you asked for a book and you got text

drowsy axle
#

Whatever

#

Thanks for your help.

tough abyss
#

🍵

drowsy axle
#

I spent 2 hours. On the wiki, and trying BEFORE coming here.. 😃

ruby breach
#

What you have still isn't going to work

tough abyss
#

If this is your first foray into Arma 3 scripting you're trying to do something mildly complex

drowsy axle
#

It isn't @still forum and I have been "learning" for about 9 months??

ruby breach
#

Either you're going to delete your spawned units immediately after creating them. Or you're going to spawn your first wave and then never do anything else

hollow thistle
#

xD

still forum
#

Yeah.. And We've explained him everything 5 times already

drowsy axle
still forum
#

Who said that won't work?

#

it returns the list of units in that group

#

I don't see why that's not supposed to work

#

I even gave you a thumbs up when you posted that above to tell you that's good

drowsy axle
#

Right.. hmm

#

Check my stream, or not.

tame stream
#

@drowsy axle you are asking help for something thats simple for those with experience and immensely complicated for the uninitiated ... i was very much part of uninitiated and had no scripting knowledge, just wanted to make cool missions ... 100's of gaming hours later and as many frustrating hours of learning to script and only now i am getting some what proficient at scripting.

In crease you base knowledge to know how to use the more advanced scripts

ruby breach
#

He's probably still trying to do alive Group (or alive units Group)

drowsy axle
#

Sorted it.

#

😃

still forum
#

👏

drowsy axle
#
TrigOpfor = false;
CAP_UnitGroup = createGroup east;

for "_w" from 1 to 11 do {
    CAP_wave = false;

    for "_ei" from 1 to 11 do {
        sleep 2;
        hint format["Wave %2: Enemy %1.",_ei,_w];
        private _unit = "O_Soldier_F" createUnit [position spawnObj, CAP_UnitGroup];
        CAP_Units = units CAP_UnitGroup;
    };

    if (TrigOpfor) then {
        {
            deleteVehicle _x;
        } foreach CAP_Units;
        CAP_wave = true;
    };

    waitUntil {CAP_wave};
};``` Made a trigger with: https://gyazo.com/838730e14ab434db3aefc4b3c52b11cf
#

The trigger doesn't activate when all dead

#

😦

tough abyss
#

gime ve a swec

#

are you sure the trigger doesnt activate?

#

try putting something like:
hint "DEAD"; inside the trigger on activation

#

then try again

still forum
#

I know what's going on

#

and we already told you that before

ruby breach
#

Or you're going to spawn your first wave and then never do anything else

still forum
#

The trigger activates and works just fine

#

but it doesn't matter

tough abyss
#

yeah i see the problem now too,
it gets stuck on the waitUntil

still forum
#

the code is already past the if and at the waitUntil when the trigger fires

tough abyss
#

@drowsy axle what are you trying to do? Just tell us, there's probably an easier way to do all of this...

ruby breach
#

He wants to create a group, wait until they're dead, delete them, spawn another group, repeat

drowsy axle
#

Do I put a waituntil for the trigopfor?

tough abyss
#

@drowsy axle what are you trying to do? Just tell us, there's probably an easier way to do all of this...

still forum
#

If you want to wait until that's set

#

then you might want to do what you want to do

drowsy axle
#
CAP_UnitGroup = createGroup east;

for "_w" from 1 to 11 do {
    CAP_wave = false;
    TrigOpfor = false;

    for "_ei" from 1 to 11 do {
        sleep 2;
        hint format["Wave %2: Enemy %1.",_ei,_w];
        private _unit = "O_Soldier_F" createUnit [position spawnObj, CAP_UnitGroup];
        CAP_Units = units CAP_UnitGroup;
    };

    waitUntil {TrigOpfor};

    if (TrigOpfor) then {
        {
            deleteVehicle _x;
        } foreach CAP_Units;
        CAP_wave = true;
    };

    waitUntil {CAP_wave};
};```
tough abyss
#

ok this is a bit better, but now you have redundant code

drowsy axle
#

the if

still forum
#

and the second waitUntil

tough abyss
#

you're using waitUntil {TrigOpfor} which waits for TrigOpfor be to true, so the if isn't needed, and the second waitUntil also isn't needed.

still forum
#

You can also edit code instead of copy-paste spamming the same stuff over and over again :u

drowsy axle
#
CAP_UnitGroup = createGroup east;

for "_w" from 1 to 11 do {
    CAP_wave = false;
    TrigOpfor = false;

    for "_ei" from 1 to 11 do {
        sleep 2;
        hint format["Wave %2: Enemy %1.",_ei,_w];
        private _unit = "O_Soldier_F" createUnit [position spawnObj, CAP_UnitGroup];
        CAP_Units = units CAP_UnitGroup;
    };

    waitUntil {TrigOpfor};

    {
        deleteVehicle _x;
    } foreach CAP_Units;
    
    CAP_wave = true;

    waitUntil {CAP_wave};
};```
still forum
#
CAP_wave = true;

    waitUntil {CAP_wave};

wat

drowsy axle
#

I know

ruby breach
#

CAP_wave is useless. Get rid of it

drowsy axle
#

Yup Ik.

ruby breach
#

Also, instead of using a trigger, why not just check if all the units in the group are dead every (x) seconds?

still forum
#

He tried to do that

#

ended in alive GROUP or alive ARRAY

ruby breach
#

Well, he also wasn't properly waiting to check it, but yes, I agree

tough abyss
#

Trigger might be more efficient, and he would have to write a check for that (because alive GROUP doesn't actually check if they're alive fast enough, because it takes about 30s for it to update the alive status)

still forum
#

because it takes about 30s for it to update the alive status wat?

ruby breach
#

wut

still forum
#

That's not true

tough abyss
#

it is

still forum
#

and also how would a trigger change anything on that?

#

because alive GROUP doesn't actually check if they're alive fast enough That's also not true

tough abyss
#

it is

still forum
#

alive GROUP doesn't exist.

#

Where did you get non existant commands from?

#

Magic?

#

Well.. There is a alive GROUP in Intercept CBA.

#

But we are talking about vanilla Arma. And I know that noone here is using that.

#

sooo...

tough abyss
#

there was something for checking if the group is considered alive

still forum
#

Don't believe anything you say anymore 😄

ruby breach
#

Also, Dedmen can call me an idiot if I'm remembering wrong, but waitUntil is going to be exponentially more efficient for use here because the checks don't need to happen for the entire mission duration (only when utilizing the wave mechanic), and the fact that you can make it check less often than every half second.

still forum
#

true

#

trigger keeps checking if you don't delete or have it trigger once

#

triggers are actually known to not be efficient

#

so I have no idea where you got that from 😄

#

Got no idea where you got anything from tbh

tough abyss
#

:(

ruby breach
#

Easier to make for some people, yes. More efficient, not really

tough abyss
#

Is there a VIM plugin that ads SQF syntax highlighting?

still forum
#

3x SQF for vim. Is that enough or do you need more?

tough abyss
#

yeah its enough

#

1st result is 4y old, 2nd result is 2y old, 3rd is 1y old

hollow thistle
#

And vim is 27 y/o 🙃

tough abyss
#

yeah but VIM's syntax doesn't change

still forum
#

SQF syntax also doesn't change

tough abyss
#

yeah but new functions get added

#

and some of it does change

still forum
#

Haven't seen a single syntax change since SQF was introduced

hollow thistle
#

its a bit of nitpicking tho. You know what the guy meant 😛

still forum
#

¯_(ツ)_/¯

hollow thistle
still forum
drowsy axle
#

It does need to waituntil they are dead.

#

😦

digital hollow
#

Are you just trying to delete the bodies?

tough abyss
#

you also need spawn

still forum
#

Alternative solution would be

https://community.bistudio.com/wiki/waitUntil
https://community.bistudio.com/wiki/sleep
https://community.bistudio.com/wiki/units
https://community.bistudio.com/wiki/count
https://community.bistudio.com/wiki/alive
#

Why spawn?

#

for what?

tough abyss
#

cant sleep in scheduled

still forum
#

What?

#

Stop making up things that aren't true

#

Your third thing today that's just a lie 😄

ruby breach
#

I've actually never bothered to see which of those two ways is faster. Can't imagine there's much of a difference

#

Unless the group is extraordinarily large

still forum
#

spawn creates a new scheduled script.
So how does creating a scheduled script help for sleeping. If sleeping doesn't work in scheduled?

#

That doesn't make any sense

tough abyss
#

ok unscheduled then

still forum
#

He is using waitUntil

#

he is already in scheduled

#

So why is spawn needed again?

queen cargo
#

@ruby breach gonna check what commands of those are working in swfvm in a Minute 😂

still forum
#

When and why did you rename it to swfvm? already saw you writing that a couple days ago

queen cargo
#

Did not really renamed it
But it is simpler from mobilephone

#

The folders etc. On the other Hand are named like that because that tiny - gets annoying to write each time

#

Official project Name remains sqf-vm

ruby breach
#

The real reason is because the project has caused him to re-evaluate it as Status Woe Format (I'll see myself out)

queen cargo
#

Status woe Format? 😅

ruby breach
#

You typed swf intead of sqf. Actually, nevermind. It was as terrible in my head as it is written.

queen cargo
#

😂 😂

#

@ruby breach waitUntil and alive are missing

dusky pier
#

hello, i have low fps in the towns on my mission. Changed mission objects to simple. Disabed simulation. FPS now better, but still not enough 😦

#

i think if i disable damage for all map objects?

still forum
#

Less objects

#

no

gleaming cedar
#

I have a hard question. I have a campfire. I want it to have an inventory so you can add food in it to cook. I tried attaching an ammo box but it doesn't allow placing items. How do I make it so I can place normal items?

#

Anyone? 😦

meager heart
#

no

0 spawn {
    private _campFire = "Land_Campfire_F" createVehicle (player modelToWorld [0, 5, 0]);
    private _supply = "Supply500" createVehicle [0, 0, 0];
    _supply attachTo [_campFire, [0, 0, 0.5]];
    _supply addWeaponCargoGlobal ["launch_MRAWS_green_rail_F", 1];        
    _supply addMagazineCargoGlobal ["MRAWS_HEAT_F", 1];
};
#

better not use "global" commands on the clients, this is just "debug console example" ^

#

@gleaming cedar

gleaming cedar
#

Ok that works thank you

#

I tried it put did change the x y z to 0 0 0

meager heart
#

attachTo also has "auto offset" if you mean that

#

_supply attachTo [_campFire]; < auto offset

gleaming cedar
#

Thanks I put a pot on top of the campfire haha

#

Now I can open the pot

meager heart
#

ggwp 😃

tough abyss
#

Why do you need to attach it?

wary vine
#

is it possible to create a rope on a player ?

high marsh
#

Try it 🤷 ,
may not be possible since not a static or physx object.

wary vine
#

any small physxobjects I can create xD

high marsh
#

I've seen scripts where the player has to "drag" the rope to something else and "tie" it off. So I would imagine it's possible

wary vine
#

i cant get it working

high marsh
#

discord wtf
Soda can.

wary vine
#

didn't work 😦

high marsh
#

@tough abyss Desync can be caused by other people's slow connections to the server, turn on checks for slow connections and limit ping. Your mission could be sucking up net traffic with public variables being thrown at the server at a constant rate.

young current
#

600 is a lot

high marsh
#

your server.cfg

#

600 is way too much. 200 would be morr suitable

#

kickClientsOnSlowNetwork[] = { 0, 0, 0, 0 };

young current
#

👀 open

#

no

#

200 is alredy bad

#

200

#

also 70 players is quite a lot

#

and if you got some custom script stuff running those probably will also cause network strain

young current
#

ah then its likely just badly made.

#

cant do anything about that

meager heart
high marsh
#

Altis life is known for being badly made.

meager heart
#

bulli

young current
#

truth is not bullying 😛

high marsh
#

💩

meager heart
#

😃

frigid raven
#

Okay this drives me nuts. I renamed my constants.hpp to globals.hpp for reasons. Then I #include it to the files where needed. As I went into game I received the following error:
Include file ...\global.hpp not found. Then I realized that I named the includes wrong - so I renamed them global -> globals via replace.
Now Arma still throws this error even tho I renamed/removed every single occurrence of global. I don't know what to do now 😄

dusk sage
#

Are you using

#include "...\global.hpp"
```?
frigid raven
#

no globals

#

since the file is called globals.hpp

dusk sage
#

More talking about the ...

frigid raven
#

or u mean the 3 dots

#

nah ..

dusk sage
#

Is it one directory up?

frigid raven
#

oah wtf

#

yea

dusk sage
#

Are you using .. or ...?

frigid raven
#

christ just thought I wrote ... on one occurence

#

am using ..

#

2

dusk sage
#

Can you post your directory structure?

frigid raven
#

sec

#

just for the dir structure

#

did not yet pushed the refactoring/renaming of the includes

frigid raven
#

yes

#

As I said the repo state does not yet has the fixed naming of the #includes

#

I renamed them all - still arma tells me through an error that it cannot find global.hpp

#

even tho I do not reference it anymore

meager heart
#

dude, you have this >

#include "..\global.hpp"
```but your file is `globals.hpp`
frigid raven
#

wtf

high marsh
#

I think he is saying he renamed it already?

frigid raven
#

Sorry but I think I said I renamed that

ruby breach
#

He's saying his repo is useless for us to look for errors because it's not current

high marsh
#

^

frigid raven
ruby breach
frigid raven
#

@meager heart wtf this is... on my local working set it is changed ??!?!

#

@ruby breach uh fancy

meager heart
#

🤷

frigid raven
#

witchcraft

unborn ether
#

is _forEachIndex applicable inside apply?

high marsh
#

Noop.

meager heart
#
/*
typeName _first isEqualTo "OBJECT" or typeName _first == "GROUP"
*/
_first isEqualTypeAny [objNull, grpNull]
#

🤔

high marsh
#

Wew. Much fancy sld dick, much wow.

meager heart
#

#

wait

unborn ether
#

sld dick 🤣

#

bulli

meager heart
#

btw i hope nobody will read your nick wrong... man that turns horrible

high marsh
#

:^)

frigid raven
#

@meager heart ffs now I have to refactor again

#

stop triggering my clean code codex

meager heart
#

k

ruby breach
#

Also, you totally butchered the use of isEqualType

#

_first isEqualType "GROUP" is checking if it's equal to String, not Group

meager heart
#

yeah ^

#

that why i posted... what i posted... b4 the dicks things

ruby breach
#

Also @frigid raven , fair warning, if you intend to do that check on units, dead units are civilians

meager heart
#

looks like you have there nice loop(s)...

#

also iirc there was ticket about "observer" spam

high marsh
#

Atlis life loops.

halcyon crypt
#

hmmmm since when does param [0, [], [[]]] error out when param 0 isn't an array?

#

isn't it supposed to default to [] if type doesn't match?

#
Since Arma 3 v1.53.132691, onscreen errors are displayed for when the input is of the wrong type or size.
#

yet:

expectedDataTypes (Optional): Array of direct Data Types - checks if passed value is one of listed Data Types. If not, default value is used instead. Empty array [] means every data type is accepted.
#

🤔

ruby breach
#

That would be working as expected

#

You just defined default=[], allowed types = array

#

It's going to error if it's not an array, and will default to []

halcyon crypt
#

actually, it doesn't really error. It continues the script but does log the error msg

#

👍

ruby breach
#

It does error. It doesn't stop execution. But semantics.

#

Still not sure what you were saying in the first place, other than it works as it should

#

Unless you're thinking that param [0, [], [[]]] is the same as param [0, [], []]

tough abyss
#

If you don’t want it to error - isEqualType

#

Or even better isEqualTypeParams

halcyon crypt
#

no, I assumed it actually killed the script but it's fine 😃

#

all is good ☺

meager heart
#

bery gud

ornate ridge
#

how would you make a safe zone without using a VM?

high marsh
#

You can make a safezone without a virtual machine. I don't understand where you got the idea that you needed one

#
player addEventHandler["HandleDamage",
{
    if(player inArea "SAFEZONE") then {
        0
    };
}];
#

make a marker named "SAFEZONE" and execute this local to the client. Bam.

frigid raven
#

good morning peoples

high marsh
#

@frigid raven Waaaa. In the superior timezone (MDT) it's 11:40 PM thank you very much

still forum
#

MDT? MiDnighT ?

high marsh
#

Mountain Daylight Time, Midnight for short 😉

frigid raven
#

it is 07:43 AM for me :0

#

Because I am very sporty and sexy I was already doing sports... just saying... no bragging

#

modesty all over the place

#

First question of teh morning:

When I have a script benchmarked to under 3ms - can I kinda be sure it is executed within one frame of teh scheduler? and therefore is kinda perfect to use scheduled?

#

Just reading about scheduled environment tho

still forum
#

can I kinda be sure it is executed within one frame of teh scheduler no. You can never be sure about anything in the scheduler

#

also benchmarking scripts runs in unscheduled

#

in scheduled every script is slower

frigid raven
#

ok is there a relation? Like 2ms in unsheduled is ~ 4ms in scheduled?

#

just curious

still forum
#

no

frigid raven
#

alright

still forum
#

And you can't know where in the scheduler cycle your script starts

#

it might start when the scheduler already ran for 2.8ms

#

and your 3ms script will never fit into 0.2ms of time

frigid raven
#

Got it

tough abyss
#

Depends on what else is in scheduler, you script can be in front of the queue or in the middle or at the back, you don’t know how long other scripts in front of it will take. If you script is interrupted at 60FPS it will resume back in about 13ms so you cannot even be sure how long it will run let alone when it will start running

#

There is a fundamental flaw in scheduler though

#

It works better for faster PCs

#

3ms hardcoded makes no sense, it should be flexible value and depend on your FPS

frigid raven
#

Yea like lower fps should have longer frametime in scheduler eh?

tough abyss
#

The proportion of time allocated for scripts per frame goes up with faster PC and down with slower which are already struggling

#

Yes the script simulation duration should be proportionate. On slower PC you can clog the scheduler with too many scripts it will get stuck because by the time it does the sorting which script to execute next, there is no time left for execution

compact maple
#

🍿

frigid raven
#

🐵

tough abyss
#

So no script is executed except unscheduled but the game runs

frigid raven
#

funny

#

and not funny

tough abyss
#

This is why every bit of performance you could squeeze out of your script matters

frigid raven
#

aye - glad u mentioned that isEqualType keyword therefore 😄

#

New question: I kinda heard fragments of database usage via SQF. At the moment I store my player data in CBA Hashes. Did anybody has experience with this database stuff yet?

still forum
#

extDB3 iniDB and others

frigid raven
#

is it simple to use? or a pain in the 🍑

high marsh
#

extDB3 is pretty simple.

frigid raven
#

Do not need any full description here - just curious about your experiences

#

hm gonna take a peek then

tough abyss
#

MySQL has stored procedures, when I see ppl sending full fledge SQL queries to extension I’m like 🤦‍♂️

still forum
#

BAM! Suddenly male

compact maple
#

extDB3 is very easy to use

frigid raven
#

Do not find any wiki articles

#

sb. provide me with the right keywords pls 😄

frigid raven
#

uh thx

frigid raven
#

Is there any good reason to have a script not scheduled?

still forum
#

If you need reliable execution time

#

It needs to be executed right now and needs to finish right now

tough abyss
#

I don’t get it, you don’t think that discussion above brought up some reasons against scheduled execution?

still forum
#

Basically everything that you are not okey with if it takes a full minute till it executes the first line of code.

frigid raven
#

@tough abyss well in my opinion it did not sounded like sheduled execution will slow down the whole world for me. I havent written any heavy or time critical script yet so - no. For me scheduled still sounds like the better choice

tough abyss
#

I don’t know anything about your scripts or mission, but I know this, trying to choose one or the other and stick with it is equally bad, you need both, just have to be smart about what goes where

frigid raven
#

@tough abyss Thats why I asked Is there any good reason to have a script not scheduled?

compact maple
#

do you know where can i found some document about BE filters ?

frigid raven
#

@tough abyss But I am aware now. Just needed a bit more insight to play the cards right. Thx bud

#

@compact maple xcuse me what is a BE filter?

compact maple
tough abyss
#

I don’t think there is wiki page for it, would have been good to have with all the uptodate filters listed

compact maple
#

yes it would have been nice, cause this :
On a new line add a number from 1 to 7 followed by a single space and then a keyword. For example:

#

why 1 to 7 ?

still forum
compact maple
#

thank you

frigid raven
#
player setVariable ["someId", 23423];

Can anybody tell me the scope of this? I think it is only stored in memory as long the player is connected? After a reconnect it is gone eh?

compact maple
#

yep

frigid raven
#

am at work - so I can not try it out. Just so you can be sure I am not lazy 😄

compact maple
#

you can use missionNameSpace to keep a value even if the player is gone

#
missionNamespace setVariable ["YourString",3];//Same as: YourString = 3;
_yourString = missionNamespace getVariable "YourString";
frigid raven
#

Well I want to have some kind of login/userProfile

#

Having a CBA Hash on the server namespace

compact maple
#

i did a login system, but with extdb3

frigid raven
#

And when "logging" in - I want the player who successfully logged in to have id to the hash so setting new values is straightforward

#

Yea extdb3 will be my nxt step

#

first trying it with the hash and migrating to extdb3 if I have my own hosted server

compact maple
#

i've never tried cba hash

#

but, you can work in local with a local database

frigid raven
#

yea but want to have live QA after a new feature - so local is not satisfying 😄

tough abyss
#

Mission namespace is local if you disconnected it is gone unless it is on the server

frigid raven
#

aye

#

Did sb. of you ever implemented login with passwords?

#

To retrieve a user profile like an MMORPG would do

tough abyss
#

I don’t know how mmorpg works

#

Never played one

compact maple
#

what sb means lol

#

somebody ?

frigid raven
#

@tough abyss milsim only? 😄

#

yea @compact maple

still forum
#

login like stuff is used by lots of people. Basically everyone with a extDB backend. But no password.
Your login is just your steamID

compact maple
#

yes i did a login/password system

tough abyss
#

Anything but swords and wizards @frigid raven

frigid raven
#

what about players who dont play through steam?

compact maple
#

what

#

they have to be on steam

#

they cant play a3 otherwise ?

frigid raven
#

Ah really?

#

Never was aware of that

#

That is is a steam only game 😄

tough abyss
#

@compact maple steam mission?

compact maple
#

@tough abyss ?

tough abyss
#

Steam missions are different from normal missions maybe this is what xetra meant

compact maple
#

idk, he said that people could buy a3, but on another platform than steam

frigid raven
#

yea thats what I thought

still forum
#

you can buy steam codes elsewhere

tough abyss
#

Ah ok then no A3 is steam only

frigid raven
#

Therefore I was unsure how defensive it is to only use steamID

still forum
#

but you have to activate them in steam

frigid raven
#

got it

frigid raven
#

Is there some kind of input prompt ?

#

So I can force the player to type a name or something like this?!

#

or only "hacky way" with UI and clickable letters 😄

zenith edge
#

you can intercept chat messages

frigid raven
#

is this an intuitive approach?

zenith edge
#

there is obvious bad side of that, if someone typo's whatever you use to filter logins from normal messages

frigid raven
#

yea I get your point

#

so no way for a UI popup with input prompt?

meager heart
#

Is there some kind of input prompt ?
RscEdit < this

tough abyss
#

How do I put code into the dialogs? Like a hint when a button is pressed or something

#

Nevermind found it.

tough abyss
#

tons of ways to do dialogue in arma 3

#

though if you want hint type things i suggest using systemChat

compact maple
#

@frigid raven just create a dialog

frigid raven
#

check

tough abyss
#

Vauun i was giving hint as an example, also does all dialog code have to be SQS?

hollow thistle
#

umm. no.

tough abyss
#

I meant the code that a button would trigger for example

#

In the buttonSetAction biki page it says it has to be SQS

still forum
#

Just make a SQS script that calls a SQF script

#

Some few legacy things are still SQS only yes

meager heart
#

btw we have ctrlAddEventHandler

tough abyss
#

To call an SQF script with SQS would be execVM or call compile preprocess?

#

Oh, that makes it easier, thanks sldt1ck, didn't know about that one.

still forum
#

execVM. Or just call a function

meager heart
#

@tough abyss

tough abyss
#

Thanks guys!

hidden topaz
#

Is there a way to rotate an object around a given memory point?. The pivot point is the at the centre of the object by default, but i need it to somewhere else on the model.

peak plover
#

Uhh

#

?

frigid raven
#

I have this const

#define INSURGENT_FACTION "CFP_O_IS"

And want to use this as the type for the CBA_fnc_addClassEventHandler:

[INSURGENT_FACTION, "init", {call X11_fnc_addRandomIntelItem}] call CBA_fnc_addClassEventHandler;

But the handler is not triggered. Using "CAManBase"does work. What am I misunderstanding here?

tough abyss
#

How are you executing this code?

errant jasper
#

Is the faction actually a class parent?

tough abyss
#

Does it work with "CFP_O_IS" instead of INSURGENT_FACTION?

errant jasper
#

Of the CfgVehicle men that it is

#

I mean, looking at a glance it seems CFP_O_IS is a CfgFaction entry rather than a unit class.

frigid raven
#

@tough abyss no

tough abyss
#

well if it doesn't work with "CFP_O_IS" then it won't work with the INSURGENT_FACTION define

frigid raven
#

@errant jasper I think I mix up factions and unit classes then

#

@tough abyss yea my question was more why it does not work with CFP_O_IS

#

I thought it is like a subclass of CAManBase

#

never figure out how to list this unit class inheritance of a unit

errant jasper
#

In the editor, open the config viewer on one of the units, then it will list all parents (ancestors) in the bottom.

frigid raven
#

gonna try it

#

Is there a search function?

#

because I gonna scroll my head off

errant jasper
#

If you right-click on a unit in eden and open the config viewer that way you shouldn't need to scroll

frigid raven
#

oh neat

#

thx bud

errant jasper
#

I believe each unit has "faction" config entry. And there might not be a neat parent class for the units in the faction. So you can do something like this instead:

["CAManBase", "init", {
      if (getText (configFile >> "CfgVehicles" >> typeOf (_this select 0) >> "faction") == "CFP_O_IS") then {
             call X11_fnc_addRandomIntelItem;
      };
}] call CBA_fnc_addClassEventHandler;```
frigid raven
#

what is wrong with using only typeOf (_this select 0) isEqualTo "CFP_O_IS" ?

#

I never understood the use of configFile >> "CfgVehicles" ...

errant jasper
#

Again you are mixing CfgFaction entries with CfgVehicles

#

A tank or a soldier has a config of from CfgVehicles. A faction, like CFP_O_IS is under CfgFactions.

#

Wait, I am missing something, editing. But still you are mixing

#

K. updated it.

frigid raven
#

If the unit would be an CFP_O_IS unit wouldn't typeOf _this select 0 yield "CFP_O_IS" or something?

#

oh

#

still confused

#

😄

#

I dont get the >> operation actually

errant jasper
#

Well, I can't be sure, cause I don't have the mod or arma running right now. But it seems like CFP_O_IS is not the classname of a unit aka vehicle, but rather the classname of a faction.

#

configFile is the entire config. configFile >> "CfgVehicles" is the root config of all units and vehicles. configFile >> "CfgVehicles" >> "B_Soldier_F" is the config for a NATO rifleman.

ruby breach
frigid raven
#

I am kind of surprised there isn't a more convenient way to get the faction of a unit

#

that is why I am a bit confused you know

#

btw the config viewer shows me those parents: ["cfp_o_is_base","I_Soldier_A_F","I_Soldier_02_F","I_Soldier_base_F","SoldierGB","CAManBase","Man","Land","AllVehicles","All"]

#

So I can substitue CAManBase with cfp_o_is_base right?

errant jasper
#

Yeah, you should be able to do that.