#arma3_scripting

1 messages Β· Page 255 of 1

tough abyss
#

Anyone else having the issue with the new revive by BI that people directly respawn at a random spawn point after dying in an exploded vehicle?

tough abyss
#

@native hemlock Sorry about that, there is some wierd version of Publisher released. (facepalm) I'll poke @icy herald to re-release it with correct files.

native hemlock
#

@tough abyss thanks, you're the best. Is it correct that it's your birthday? If so, happy birthday as well

little eagle
#

this "proper" escaping of str / format...

tough abyss
#

@Daishiknyte thankyou.

fallen skiff
#

I have made a little script that does something with addAction (scroll wheel menu). Can I do the same thing with keyboard keys?

dusk sage
#

To call scripts?

fallen skiff
#

yes

dusk sage
#

Yes

fallen skiff
#

or to perform the same action as in the script (perhaps the same thing really)?

dusk sage
#
(findDisplay 46) displayAddEventHandler ["KeyDown", "_this call somefunction"];
#

In some function handle the KeyDown EVH

fallen skiff
#

cool -- how about while holding the key down, one thing, and when key released, another thing?

dusk sage
#
(findDisplay 46) displayAddEventHandler ["KeyUp", "_this call somefunction2"];```
fallen skiff
#

excellent I will start researching those, thanks

#

erm what does the 46 mean?

nocturne bluff
#

Its the main display.

fallen skiff
#

oh yes here it is in the docs

dusk sage
#

Pseudo code for keydown:

#
params ["_ctrl","_key","_shift","_ctrl","_alt"];

if (_key isEqualTo 19 && {_shift} && {!_ctrl} && {!_alt}) exitWith {
    //code
    true    
};
fallen skiff
#

right

dusk sage
#

That would be SHIFT+R

little eagle
#

ohh

#

please don't use the dik codes in code like that

nocturne bluff
#

#include "\a3\editor_f\Data\Scripts\dikCodes.h"

dusk sage
#

πŸ˜‰

nocturne bluff
#

Is what you need.

little eagle
#

put this into line 1:
#include "\a3\editor_f\Data\Scripts\dikCodes.h"

nocturne bluff
#

HAH

#

I beat ya

little eagle
#

grr

nocturne bluff
#

throws ADVANCED THROWING GRENADE

fallen skiff
#

so without the include it would still work, but not be optimized or something?

little eagle
#

picks it up and throws it back

nocturne bluff
#

throws it at @warped thicket

little eagle
#

so without the include it would still work, but not be optimized or something?
it would make the code look horrible

#

way easier to work with the macro library

dusk sage
#

The numbers are ambigious, the header file lets you have pretty names

#

DIK_R

#

Etc

little eagle
#

yes, this ^

dusk sage
#

The pseudo code would then become:

params ["_ctrl","_key","_shift","_ctrl","_alt"];

if (_key isEqualTo DIK_R && {_shift} && {!_ctrl} && {!_alt}) exitWith {
    //code
    true    
};
fallen skiff
#

yes I think i get that

dusk sage
#

As for the boolean, please note:

#

Returning true in EH code will override default engine handling for keyboard events.

fallen skiff
#

I don't suppose anyone can think of an existing example online of this sort of thing, that I could study

little eagle
#

I know one, but it's very ugly, so I won't show it.

dusk sage
#

resists urge to post the most cancerous keyhandler known to man

fallen skiff
#

hahaha

#

can I put the #include line in description.ext and write the rest elsewhere?

dusk sage
#

Google: fn_keyHandler

fallen skiff
#

ok

dusk sage
#

Erm, no

#

It needs to be included in that file

fallen skiff
#

ok

dusk sage
#

Just remember what include actually does

fallen skiff
#

It reads in a bunch of stuff that the subsequent script can call by convenient names, among other things, I think

dusk sage
#

Of which will exist only in the file it is included in πŸ˜‰

little eagle
#

the line with include get's replaced with the file you are including during preprocessing of the function

fallen skiff
#

gotcha

dusk sage
#

Layman's copy pasta

little eagle
#

I just made that up on the spot. It explains it sufficiently enough for myself

fallen skiff
#

BTW I succeeded in scripting my heli gauges filter for night flying if anyone wants to see it, cheapo solution but works quickly and well, if anyone wants to see it

#

I want to put it up for public use and consideration, perhaps Armaholic, what's the correct way to do this?

tough abyss
#

Oh, did I show you all the result of my airstrike script?

fallen skiff
#

It's not a proposal, it's a finished product, it actually does what it says it does

tough abyss
fallen skiff
#

hehehe vauun now you don't have to do any real fighting

tough abyss
#

[THUMP]
"COORDINATES RECIEVED."
[BOOM]
[THUMP]

dusk sage
#

I like how chilled the AI are

tough abyss
#

I just took away all their ammo since the first time I crested the hill I was instantly domed

#

I don't know why the IR flare is visible in the visible light spectrum, though...

fallen skiff
#

I found something called fn_keyHandler.sqf but I don't have Altis -- if anyone has it and could send it to me that would be nice -- it's in /MPMissions/Altis_Life.Altis/core/functions/

dusk sage
#

It should be on some GitHub, there are 100's

fallen skiff
#

ok

dusk sage
#

Check PM

warped thicket
#

_runs away from @nocturne bluff _

humble frost
#

Hey guys got a question about helo's

little eagle
#

they will always blow up, stop trying

#

jk

humble frost
#

Is there a way to make them hover at a certain height such as 30m above the ground? I've tried setting flyinhieght and using different waypoints but the helicopter almost always comes in like it should but within the last little bit it pulls aup a lot

#

lol

#

pulls up a lot*

shy bear
#

Hey guys, im trying to host an Exile Esseker server and im having some trouble with my mission.sqm file does these say anything to any of you:
19:16:54 Warning Message: Cannot load mission
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Type is not VehicleType
19:16:55 Side !!!
19:16:55 Side 778989417
and later (in rpt) there is some: No more slot to add connection at 032008 (3258.4,7991.3) a few rows
this happened after i have added headless client logic (then it still loads the mission ) and added Zeus Curator_F module, but the strange thing is if i remove the HC - mission will load with zeus... and if i remove zeus mission will load with HC =
here is my mission . sqm file : http://pastebin.com/CA1MX0Kd

tough abyss
#

Guys I am not sure if this is the best way to keep track of my tasks in a mission using init.sqf

_missionTasks = [];

_missionTasks = _missionTasks append [[demo1, demo2],"Demolitions"] call GhostFunctions_fnc_Demolitions; // +2 tasks
_missionTasks = _missionTasks append [[hostage1], "Capture pilot"] call GhostFunction_fnc_Hostage; // +1 tasks

//infinite loop array to check all task states are SUCCEEDED

({[_x] call BIS_fnc_taskState == "SUCCEEDED"} count _missionTasks) < 3;

Is there no global variable or helper function in ArmA that knows all tasks?

#

I feel like I am reinventing the wheel in some parts and just don't realise there is an easier way to do this

#

I mean, if you look on the Map screen in Tasks you can see all tasks. So if ArmA knows all tasks created, there must be a way to get them all through an accessor function

tough abyss
#

Looks like I am going to have to create something myself πŸ˜ƒ

tough abyss
#
testFunc = { 
 
    params ["_taskArray"]; 
 
    ghostTasksGlobal = ghostTasksGlobal append _taskArray; 
    hint str count ghostTasksGlobal; 
}; 
ghostTasksGlobal = [];

When I call testFunc like so it empties my global variable ghostTasksGlobal

e.g.

[[1,2]] call testFunc;

tough abyss
#

Hmmm I couldnt find those in the Tasks Framework

#

Thanks @halcyon crypt

halcyon crypt
#

np πŸ‘

tough abyss
#

Hmmm doing this hint str count currentTasks teamMember player; returns 0 but there are two assigned tasks in the mission

#

Same goes with registeredTasks

halcyon crypt
#

I'd try BIS_fnc_tasksUnit first since that's probably part of the tasks framework

#

private _tasks = [player] call BIS_fnc_tasksUnit;

tough abyss
#

Ok that gives 1 task for the player but there are 2 assigned

halcyon crypt
#

try with [side player]

tough abyss
#

No dice 😦

halcyon crypt
#

hmm how are you creating the tasks?

tough abyss
#

In a compiled addon function I wrote

#

e.g.

[west,
        _demoTask,
        [_targetDescription,"Demolition"],
        getMarkerPos _demoMarker,
        1,
        2,
        true] call BIS_fnc_taskCreate;

///more code here

halcyon crypt
#

[west] call BIS_fnc_tasksUnit; should work but that's probably the same as side player :/

tough abyss
#

Nope,. try this if you can

    [west,["task1"],["test 1","Find Cookie","cookiemarker2"],objNull,1,3,true] call BIS_fnc_taskCreate;
    [west,["task2"],["test 2","Find Cookie","cookiemarker2"],objNull,1,3,true] call BIS_fnc_taskCreate;
    hint str count [west] call BIS_fnc_tasksUnit;
#

It should be 2 right?

halcyon crypt
#

mhm

tough abyss
#

Well its not on my game πŸ˜ƒ

#

Coming back with 1

halcyon crypt
#

weird

#

I guess you'll have to keep track of them yourself then 😦

tough abyss
#

This is the code inside BIS_fnc_tasksUnit

private ["_target"];

_target = _this param [0,objNull,[objNull]];

_target getvariable ["BIS_fnc_setTaskLocal_tasks",[]];
#

Yea even this doesn't work

    [player,["task1"],["test 1","Find Cookie","cookiemarker2"],objNull,1,3,true] call BIS_fnc_taskCreate;
    [player,["task2"],["test 2","Find Cookie","cookiemarker2"],objNull,1,3,true] call BIS_fnc_taskCreate;
    hint str count registeredTasks teamMember player;
   
#

uh, your first variable is supposed to be a side, not 'player'

#

Yea I tried that further up πŸ˜ƒ

#

oh

#

mb

#

[west,"Task4",["Survive the counterattack.","Survive.","kill"],[16001.016,18176.424,50.773],1,2,true] call BIS_fnc_taskCreate;

Here's a working example from one of my missions

#

you put brackets around the task variable

#

Nope, still saying 1 instead of 2

#
    [west,"task1",["test 1","Find Cookie","cookiemarker2"],objNull,1,3,true] call BIS_fnc_taskCreate; 
    [west,"task2",["test 2","Find Cookie","cookiemarker2"],objNull,1,3,true] call BIS_fnc_taskCreate; 
    hint str count [west] call BIS_fnc_tasksUnit; 
#

Perhaps I found a bug in the game?

#

no, i don't think your code is right

#

oh

#

put brakcets around objNull maybe

#

[west,"task1",["test 1","Find Cookie","cookiemarker2"],[objNull],1,3,true] call BIS_fnc_taskCreate;

halcyon crypt
tough abyss
#

Still 1

halcyon crypt
#

is that directed at Vauun, me or both? πŸ˜›

tough abyss
#

Both πŸ˜ƒ

halcyon crypt
#

damn, must be a bug then. Doesn't seem right.

tough abyss
#

I think I will write my own helper functions and store all my created tasks in a global variable.

#

Gonna post on BIS forums see what people say

shy bear
#

hmm..?

tough abyss
#

Ok if you dont create any tasks and still execute hint str count [west] call BIS_fnc_tasksUnit;

It still gives the value 1

#

At least we have consistency now

halcyon crypt
#

wait

#

hint str count ([west] call BIS_fnc_tasksUnit);

#

try that

#

it's probably counting [west] instead of the output of the function πŸ˜›

tough abyss
#

Yay, it works if you use player

#

Thanks @halcyon crypt again, one question for COOP is player safe to use for all people on a game?

halcyon crypt
#

np πŸ˜ƒ

#

if that scripts runs locally on the players machine then yes

#

it most likely does since tasks are local

#

but locality issues are something you'll have to run in to before one can really understand it IMO ^^

#

but I think player, in this case, is safe

tough abyss
#

Ok that works great just need to keep iterating through them and checking if they are either Succeeded, failed or completed

grizzled cliff
#

damn, now i am getting that stupid publisher bug on my CI server too

#

was working last night now its bitching about that generic .NET error

native hemlock
#

Wizard, who I believe is the Publisher's programmer, said this earlier today

@Pennyworth Sorry about that, there is some weird version of Publisher released. (facepalm) I'll poke @Tom_48_97 to re-release it with correct files.
#

Was your CI server definitely on the latest version of Arma 3 Tools last night?

grizzled cliff
#

not sure

#

it might have updated

#

bah who knows, im going to bed, and ill fuck with it again in a couple days and see if things have resolved themselves on BI's end

native hemlock
#

Doesn't look like you can revert to a "legacy" version of Arma 3 Tools either, so looks like we'll have to wait. I'll shoot you a message when they resolve it

grizzled cliff
#

that'd be nice, thanks

#

we're so close to getting very automated releases for ACE, CBA, and sooooon ACRE.

#

and the build/collect/publish CI stuff is going to be made generic and released under CBA for others to setup their own CI services with github if they want

native hemlock
#

Yeah that'll be cool, CUP has wanted to do something along those lines but no one has gotten around to setting it all up

tough abyss
#

@grizzled cliff Could you please create a ticket on Feedback Tracker and describe what happened?

vital onyx
vital onyx
#

finished a syntax file for vim, which support all commands, BIS and CBA functions

round scroll
#

nice, any download location for it yet?

vital onyx
#

couple of minutes

velvet merlin
#

@vital onyx welcome back! you had holiday from arma?

vital onyx
#

@velvet merlin almost :)

#

enjoy

#

post to issues for any problems

#

this is my very first vimscript

round scroll
#

ok, thanks a lot, just replaced my old sqf syntax file with it πŸ˜ƒ

vital onyx
#

it has the latest list of commands/and functions

#

credits go to /bin/sed :)

round scroll
#

lol

vital onyx
#

2k+ commands + 1k+ BIS_fnc_ * ~350 CBA_fnc_*

round scroll
#

oh, even CBA support, wow

#

SQF is such a nightmare, he he

vital onyx
#

I am just not sure if wildmenu will work for completion

round scroll
#

tbh I use sublime/poseidon on windows for sqf, but occasionally this mac is used too, so the vim syntax file comes in handy

vital onyx
#

yes, I did it, since I spend most of time on macbook

#

but in Windows I use gvim

#

tired of NP++

round scroll
#

never really got into NP++

vital onyx
#

simple and good for starters, NP++ was the choice because of ready to use syntax hilight

#

will post to forum as well

vital onyx
#

ok, now let's play with completion of all these commands

tough abyss
#

KK's syntax highlighter for NP++ truly is one of my best tools.

tame portal
#

Poseidon all the way

dusk sage
#

Atom πŸ˜‰

buoyant heath
#

I used Zenophon's completion stuff for n++ for the longest time. Atom is nice, but doens't handle larger files well.

tame portal
#

It crashes

dusk sage
#

Atom handles large files in a similar manner to N++ on my computer

#

Never crashed

tame portal
#

Well it never really does for me ha

dusk sage
#

Poseidon crashes on me alot with large RPTs

buoyant heath
#

I've never been able to use atom for rpt's because of their length

dusk sage
#

Lags hardcore

buoyant heath
#

n++ handles everything you throw at it

tame portal
#

I use notepad for large files

#

Everything else is opened in either VS code or Poseidon

buoyant heath
#

How is vs code? Haven't tried it yet.

tame portal
#

It's pretty nice I guess

#

Although it could be lighter like notepad++

dusk sage
#

Similar idea to Atom, I prefer Atom over VSC, in that category

#

It's not made to be a simple text editor like N++ is though

tame portal
#

Yeah

buoyant heath
#

You mean you can't have your cake and eat it too? πŸ˜›

tame portal
#

Isn't VSC written in Java?

dusk sage
#

Compiling code in N++ πŸ˜‰ ?

#

Na ah

#

Electron @tame portal

tame portal
#

Ayayay

dusk sage
#

TypeScript/JS

#

etc

tame portal
#

Damnnn

#

I just drove past a KFC

#

Now I'm hungry

dusk sage
#

Are you driving..?

tame portal
#

Sadly no :,(

#

It doesn't make sense to get a driving license in berlin

#

You get everywhere faster with public transport

buoyant heath
#

I just wrapped up ~18 hours of driving since Sunday. Can't imagine not having a car. Distinct lack of capable public transport here though.

dusk sage
#

here

#

?

buoyant heath
#

Anyway, scripting question to stay relevant: Is the list returned by everyContainer always in the order of the bags/vests/uniforms shown in the inventory screen's ground container? I'd look but work...

tame portal
#

Well in berlin there's public transport everywhere with intervals of 2-20 minutes and as a student I can ride them in the zones A B and C meaning whole berlin plus great parts outside it

buoyant heath
#

TX-OK-AL. A bit of a hike for a couple wells my company is working on.

dusk sage
#

That would suggest no*

#

the first example contradicts

tame portal
#

@buoyant heath I guess it returns the same order for the same type of objects but doesn't include non existing ones

buoyant heath
#

I'm trying to come up with a reliable way of telling which inventory is being shown in the SOLDIER list (the one next to ground). If it's consistent, then it's not as hard of a problem as I worried about.

dusk sage
#

You could always just order them regardless of the array

tame portal
#

Inventory in the soldier list?

#

Oh you mean the listbox that represents a container in your inventory

buoyant heath
#

Aye

tame portal
#

Well

buoyant heath
#

inventoryOpened takes care of what container you were looking at initially, but tracking which one you opened from the ground list has been a headache

tame portal
#

You could always just read which icon is highlighted

buoyant heath
#

How does the icon help?

tame portal
#

Uh

#

Would you mind showing a Screenshot of what you mean?

#

I think I misunderstood

#

I'm sure I will come up with a more reliable solution

buoyant heath
tame portal
#

Oh

#

Well

#

You could get the text it displays at the top

#

"Vest"

buoyant heath
#

Fails if there are 2 vests

halcyon crypt
#

what's your intent?

buoyant heath
#

Move items to and from inventories as a first step

halcyon crypt
#

and why would the list of items have to be in the right order to do that?

buoyant heath
#

Go back to the original question: How do you know which inventory is the one you're interacting with? vehicles, boxes, ground containers are easy enough since they're identified when inventoryOpened fires. But to track which of the backpacks you opened after that... If the list of items stays the same, I can cross reference the everyContainer with the list shown in the inventory screen.

halcyon crypt
#

yeah tough one

#

the engine must have a reference to the opened container somewhere

halcyon crypt
#

everyContainer returns IDs for the objects inside it maybe (hopefully) the LB item has that same ID attached somewhere. Best bet would be to check what lbData returns when selecting an item in the container list.

halcyon crypt
#

at least in A2OA the GUI has a lot of information IIRC. I was able fix the pesky partial magazines in backpack exploit in DayZMod and I think it relied on the GUI big time. Don't think it made it in though.. 😦 https://youtu.be/XCIx-5DcETA

jade abyss
buoyant heath
#

I was really hopeful for a moment that lbData had the id of the container being opened.

jade abyss
#

The EH does?!

buoyant heath
#

Only if you're opening directly from the ground, not if you're opening it through the inventory screen

jade abyss
#

Of course

#

What you want to achieve?

#

+That was just an example, there are other things for the EH like onMouseButtonClick, onMouseButtonDown etc.

austere granite
#

Anyone knows if the sound you get from setUnconscious is engine-side or is there a .fsm somewhere hidden away that plays it?

#

Can't seem to find it

little eagle
#

engine

austere granite
#

Perfect implemtation then

little eagle
#

well

#

You just die in cars. Apart from that it's good

austere granite
#

That's the revive code, not the setUnconscious command though

little eagle
#

true

austere granite
#

Vehicle wise you can still fire and drive foward, everything else seems to be fine

little eagle
#

half assed

austere granite
#

Purely the command that is. Still wish I could disable the switching to animations though

little eagle
#

give me a force ragdoll command. thanks

austere granite
#

πŸ˜„

#

maybe in another 2 years

vital onyx
#

@little eagle not satisfied by KK's work around?

little eagle
#

lol no. you ever tried that?

#

it makes for a good blog post, but it's annoying when it's cited as possible method in another feature request ticket. it's not.

vital onyx
#

yes, tried, worked for me

#

not ideal, but yet, no other options so far

austere granite
#

it's not a good way at all

#

That's what i was trying to use originally for my medical shit. Instead i ended up with my revive system just keep units dead and working that

#

It works okayish, but the respawning units is not ideal performance wise, so trying to make a proper ragdolled system using setUnconscious now. Still not happy though

#

arma ultimate moddable game... unless you actually try and make something different.

jade abyss
#

different = correct.

#

workarounds, patching it... thats basicly arma

little eagle
#

yes, tried, worked for me
no you didn't

vital onyx
#

you are wrong, @little eagle

austere granite
#

how well does it work inside buildligns?

#

how well does it work when you're bunched up with other players?

#

how well does it work when you're sprinting at full speed?

vital onyx
#

I am more concerned about while dricing in vehicles

#

as any w/a it should be applied carefully

austere granite
#

ye, so its not something that can be used as replacement for ragdoll command

vital onyx
#

sure, more likely for scripted scenes and when you are sure about consequences

little eagle
#

it doesn't even work when just standing there

#

it does ragdoll you like 5 % of the time

vital onyx
#

well, indeed KK's script stopped working, but I assure it did some time ago

little eagle
#

Well, at least the game ragdolls you if you run into someones backpack...

vital onyx
#

Anyone is aware how to find with SQF what directory Eden is using for saving scenarios?

native hemlock
runic heart
#

Im attempting to script a sliding door that opens two doors simultaneously in opposite directions

#

can anyone point me to an example or maybe what I'm doing wrong? I can post a pastebin if need be

native hemlock
broken forge
#

@native hemlock that was me, lol, because I was using a messed up way that would work in previous builds, then BI was like... not anymore, lol

native hemlock
#

I remember, and the spam you apologized for as well πŸ˜›

broken forge
#

lol, yep, I was a bit irritated, well maybe more then just a bit, but what would one expect when the way I was scripting sliding doors worked for 3 years, then all of a sudden no more, lol.

native hemlock
#

The good old BISeroo

runic heart
#

trying it now penny

runic heart
#

I love you @native hemlock it works like a charm

#

definitely that one is going in the tool belt

grizzled cliff
jade abyss
#

Change note: boobs <-- πŸ˜„

grizzled cliff
#

yup

#

πŸ˜„

vapid frigate
#

is there a known bug with placing static objects in 3den not using their classes properly?

#

for example if I place a sandbag in 3den and name it S1

#

seems like it's no longer (as of 1.64) possible to get the class of a static object?

meager granite
#

looks like createSimpleObject object

vapid frigate
#

yeah, or a map object with no related class

#

but it's an object placed in 3den

#

do some objects get placed as simple objects automatically or something?

#

(this is vanilla)

#

pre-1.64, you could just do typeOf s1 but now you would have to do something like if(typeof s1 == "") then { private _p3d = ((str s1) splitString " " select 1); private _class = "Land_" + (_p3d select [0, (count _p3d)-4]); if(isClass (configFile >> "CfgVehicles" >> _class )) then { _class } else { "" }; } else { typeof s1 }

#

ah nvm, 'simple object' is ticked by default.. that'll do it

tame portal
#

@jade abyss So relieved that the performance issue is a bug in the current version and not the fault of my mission πŸ˜„

jade abyss
#

@tame portal At least πŸ˜„

tame portal
#

I was about to say

#

I fuck up missions, but not at 40 players

jade abyss
#

πŸ˜„

vapid frigate
#

what's the performance bug?

#

is it RHS vehicles per chance? we've had a big issue with them with our last few ops

#

the 'RHS_fnc_GearSound' function seems to run thousands of times and stack up as if the 'engine' event is being fired repetitively.. haven't worked out what triggers it yet though.

lime tangle
#

What's ASIS equipment level?

vernal rune
#

@vapid frigate the slow decrease of fps over time until game restart is the one being mentioned by optix

tough abyss
#

I will slow down my work with Arma 3 whille i wait for new updates.

clear tendon
#

Right, can anybody help me why i can't set playervariables from a sqf that's run on a action?

#

checking the value gives 'any' instead of false or right

indigo snow
#

give us the code

#

any means nil

clear tendon
#

Yeah, gimme a sec, throwing it in pastebin

#

or maybe this is enough

// spawn timeout timer
player setVariable ["_VVS_restrictSpawn",false];
player setVariable ["_VVS_restrictTimer",false];
if (player getVariable "_VVS_restrictSpawn" == true) then {hint "Can't spawn yet."; player setVariable ["_VVS_restrictTimer",true]}; 
while (player getVariable "_VVS_restrictTimer" ==  true || player getVariable "_VVS_restrictSpawn" == true ) do 
exitWith
{
sleep 175;
player setVariable ["_VVS_restrictSpawn",false];
player setVariable ["_VVS_restrictTimer",false];
hint "Vehicle spawn available";
};
#

it's an attempt to add a timeout to VVS

#

i.e player can spawn a vehicle only once every set x seconds else it's on cooldown

#

Yet, checking the variables is always Any, or Nil as you then point out

indigo snow
#

global vars can't start with an underscore

#

also you cant do `BOOLVAR == true1

#

also id recommand using the alternative syntax of getVariable

#

OBJECT getVariable ["NAME",DEFAULTVALUE];

clear tendon
#

I.e player getVariable ["myvar_notunderscored",false]; this checks if it is the default value or if it isn't?

little eagle
#

technically you can create and use global variables with setVariable/getVariable, but it's very confusing so don't

clear tendon
#

That's fine with me, just trying to get a simple timout based on if a player spawned it through the box so they dont spawnspam vehicles, hahaha

#

But the question then still remains, does
if (player getVariable ["VVS_restrictSpawnNotSet",false) then {//dowhatever}
check if it's true or false?

#

the default is false, set on init of the script/playerinit

#

This should become true when having spawned a vehicle and enable the timer/sleep

indigo snow
#

The return of that is a boolean, so yes

clear tendon
#

so it wont fire when it's set to true later in this case, right?

indigo snow
#

the return then would be true, which is boolean, so ye

#

true == true has no meaning for arma

clear tendon
#

Ah, so i need to turn around my logic

indigo snow
#

its just syntax, ye

coarse ocean
#

Good day all, I'm having a problem with a EH. I'm adding the HandleDamage event to a ammo box but the code doesn't fire when damage is done on the ammo box.

indigo snow
#

well then imma go ahead and say theyres something wrong with the EH or the way you add it

#

or if its in MP, it might be executing in a different place where youre expecting it to

clear tendon
#

@indigo snow mind if i send you the edited code to see if it makes sense?

zenith bramble
#

player setVariable ["LastSpawnedVeh",diag_tickTime];
do this on the spawn of the vehicle

#

to complete it in full do a check against that var with current ticktime

#

_lastSpawn= player getVariable "LastSpawnedVeh";
if ((diag_tickTime - _lastSpawn) < 300) then {
hint "you have not waited the 300 to spawn another vehicle";
}else{
code to call or execVM here;
player setVariable ["LastSpawnedVeh",diag_tickTime];
};

#

^ @clear tendon

#

very similar to the suicide limiter I had in place for exile some months ago

clear tendon
#

@zenith bramble ill pm you hold on

clear tendon
#

It worked...

#

if anybody wants a timer function for VVS, hit me up - got it working 100%, thnx there @zenith bramble

tough abyss
#

I would LOVE to know why this is telling me I'm missing an ] on line 5.

#

This is going in my init.sqf.

#

I don't know where that span class="re5"> comes from. That's not in my init.sqf.

#

nevermind, i got it.

buoyant heath
#

Double decimal at the end.

tough abyss
#

Ah, shit, thanks

zenith bramble
#

@clear tendon hell yeah man good deal on the working at it to get it working for your situation πŸ˜ƒ

tough abyss
#

Arma debug commands make me want to die

zenith bramble
#

?why they fun

zealous arrow
#

Heya guys, whats the best way if there is any to go about detecting if a player was killed by a grenade in MP env?

#

I guess I could use a Fired EH and setVariable containing the "projectile" and check that in the MPKilled EH, bit "hacky" but should work I guess

tough abyss
#
{
 if (side _x == west) then
{
                _x unassignItem "NVGoggles";
                _x removeItem "NVGoggles";
};
}];

Missing ]

#

Honestly, I hate arma 3 debug messages.

cinder cloud
#

@tough abyss, first line. The comma , is inside - not outside - of the quotation marks ".

tough abyss
#

How about that. Thanks, I thought it went on the inside.

cinder cloud
tough abyss
#

Yeah, I misread it. Now I get to figure out why my code isn't working. Do I need to foreach allunits; with this? I don't think I do, but it's not working

tough abyss
#

Still no avail. I've tried everything I can think of.

native hemlock
#

What's your question? How to run that code when the Zeus places a unit on west?

tough abyss
#

Yes. This is what I've written: ```funhater addEventHandler ["CuratorGroupPlaced",
{
if (side _x == west) then
_this spawn{
sleep 3;
this unlinkItem "NVGoggles";

};
}];```

#

I was thinking that maybe the script was executing too early, so I put in a sleep.

#

But that doesn't work either.

native hemlock
#

Lots of things wrong with that. _x is a reserved variable for things like {} count, {} foreach, and similar commands. You need to look on the right side of the event handler wiki for the arguments for the event handler. CuratorGroupPlaced has the first argument of curator: Object, and the second argument of entity: Group. Also, this wouldn't be defined in this context.

Assuming funhater is the name of the curator object, then this should work;

funhater addEventHandler ["CuratorGroupPlaced",
{
    params ["_zeus", "_group"];
    if (side _group isEqualTo west) then
    {
        {
            _x unlinkItem "NVGoggles";
        } foreach units _group;
    };
}];
#

Let me know if there is anything you'd like me to explain further about that

tough abyss
#

penny, you are a lifesaver

#

could you replace isEqualTo with == ?

#

also, that doesn't look like it's working. is the init.sqf just not the right place to put this? should it be initserver?

#

oh god i am a huge dummy

#

this is what happens when you do shit half-sober
i've been using the logged in admin zeus module i place ( i put a normal mission curator one down, and then one that the logged in administrator can access) and

#

i'm only defining it for the normal mission curator

native hemlock
#

You could use == instead of isEqualTo, but isEqualTo is fractions of a millisecond faster, and I it really is fractions of a millisecond

#

You just need to be careful with using isEqualTo with strings, since it is case-sensitive

tough abyss
#

an absolute speed demon

#

oh christ it's still not going

#

i might just make it so that when the unit dies the NVGs despawn

#

at this rate it's just easier to remove them from the game entirely

native hemlock
#

If it's still not going then funhater is probably not the name of the Zeus

tough abyss
#

you know what

#

i think that NVGoggles is NVGoggles_Item now

#

Item_NVGoggles, even

jade abyss
#

nope

tough abyss
#

i'm looking at the classname in the editor rightn ow

#

that didn't work either

#

i'm so drunk and frustrated fuck this for

#

a few days

#

if palyers weren't so fucking grabbyhands with NVGs on night ops where i want them using flares i'd be spared the headache

#

thank you

jade abyss
#
player unassignItem (hmd player);
player removeItem (hmd player);```
#

for example

#

Or for a full strip:

removeBackpackGlobal player;
removeUniform player;
removeVest player;
removeAllWeapons player;
player removeWeaponGlobal (primaryWeapon player);
player removeWeaponGlobal (secondaryWeapon player);
player removeWeaponGlobal (handgunWeapon player);
removeHeadgear player;
removeGoggles player;
player unassignItem (hmd player);
player removeItem (hmd player);```
tough abyss
#

i just need to look at this when i'm not so tired

jade abyss
#

*and drunk

tough abyss
#

i'm frustrated as hell right now tbh

little eagle
#

does this work on soldiers?

tough abyss
#

AAAAAAAAAAAAAAAUGH WHY WAS THIS NOT LINKED EARLIER

little eagle
#

I'm not sure if it's vehicles only

jade abyss
#

Don't think so.
Otherwise -> KeyHandler -> Negate the "Turn nvg on" input.

little eagle
#

rebind nvg to mouse : )

jade abyss
#

psst

tough abyss
#

i'm just genuinely surprised nobody has written this script before

little eagle
#

it's a one liner if you're using CBA

tough abyss
#

we are

#

i ma going to put my head through my desk

little eagle
#
["visionMode", {
    params ["_unit", "_mode"];

    if (_mode == 1) then {
        _unit unlinkItem hmd _unit;
    };
}] call CBA_fnc_addPlayerEventHandler;
#

untested, but that should be it

tough abyss
#

i just throw that in the init.sqf?

little eagle
#

yep

tough abyss
#

@little eagle i love you

#

thank you so much

#

oh my god i will treasure this piece of code for the rest of my mission-making days

little eagle
#

yw

#

lol

tough abyss
#

i'm a dirty man who gives people flares instead of NVGs

little eagle
#

Good. Gotta keep the players busy

tough abyss
#

the only times i ever hand out NVGs are for spec ops.

#

is there any way i can add exceptions to units with this?

little eagle
#

NVGs are too good. To bad they come equipped as default.

tough abyss
#

yeah

#

i have two units where i want them to have NVGs

little eagle
#

the code of the player event handler executes every time your avatar changes to nvg mode

#

you can add all kinds of exceptions in the function. it's just sqf

#

just remember that it runs in it's own scope since it's an event handler

#

so you can't carry over local variables from the init.sqf

tough abyss
#

right

#

good night, anyways. i'm not sure as to where to begin adding an exception, but maybe i'll think of something tomorrow

#

thank you again for the help

little eagle
#

where it says _mode == 1

#

good night

#

I hope you aren't trolling me at this hour

open vigil
#

Lol! @little eagle someone DM'd me last night about a troll on an entirely different server (while I was in a pub, not amused!)

nocturne basalt
#

Hi guys. How can I check if the landing gears are up or down?
I can't get the value this way it seems...
_gearValue = _VF1 animationSourcePhase "Gear";

vital onyx
#

Question mates

#

about ListNBox type

#

anyone else noticed that you are able to select (click and highlight) only first 7 lines? To select others you need to scroll it down

meager granite
#

it just means that other lines are obstructed by something that takes selection instead of your list

#

Since some version of A3 simple controls like static and picture started taking selection when you click on them and can change order and prevent pressing on more important controls if they're under them.

vital onyx
#

no, there is always some blank lines in the end to access all of them

#

my listnbox does not overlap with anything else

#

just

_control = findDisplay 12345 ctrlCreate ["RscListNBox", 123];
_control ctrlSetPosition [safeZoneX,(safeZoneY+safeZoneH*0.15),safeZoneW,(safeZoneH*0.6)];
for "_i" from 1 to 10 do {lnbAddRow [123,["COL1",(str _i),(str random 2)]];};
_control ctrlCommit 0;
meager granite
#

Hm, I don't have this problem with my custom lnbs

#

I guess something is messed up with default definition of RscListNBox?

vital onyx
#

probably, I create it dynamically with script

little eagle
#

you cannot load crates. Only other (compatible) vehicles

#

I know for a fact that marc_book had to do some things for the BWA3 Eagle to work with this.

#

Configs and memory points

#

Never used it, no idea. Sorry.

#

Maybe it's borked.

#

once again a 5 minute project blows up into a 3 hour investigation πŸ˜ƒ
business as usual

#

remember magazineGroups ?

#

BI made magazines to be configurable in groups, so your Addon A weapon would use group "556Stanag" (or whatever named) and it would be compatible with Addon B's 5.56 magazine from the same group. Currently you have to list all compatible mags in the weapon config, so it's impossible for different addons to support each other.

#

The addition even appeared in the changelog (1.42 ?)

#

And we tried to get it to work

#

We tried

#

It doesn't work. It's as if the feature doesn't actually exist.

#

None of the vanilla weapons use it. They don't need to after all. The feature is either broken or no one found how to actually use it. All docs are wrong

#

Or they forgot about it. No idea how it ended up in the change log though

#

here! it's total BS and doesn't work

tough abyss
#

Heya! Can i use images in mission file with drawIcon function?

#

I believe to have used mission images with drawIcon sucessfully... but now i'm not sure, this is why i ask. I'm a bit confused.

austere granite
#

Look at the comments on the wiki page for it. There's a link there that explains how to use them @tough abyss

tough abyss
grizzled cliff
#

@tough abyss thanks for looking into that bug! πŸ˜ƒ

tough abyss
#

General question here. _task = ["task1", "ASSIGNED",true] spawn BIS_fnc_taskSetState take this for example, and how it says spawn instead of something like call. What are the differences?

#

In between all of them, if there are more.

tough abyss
#

Ah, thank you!

dusk sage
#

That has the most basic description

#

For further reading

tough abyss
#

Are there any other things like spawn or call I should know about?

tough abyss
#

Oh, well I know about execVM. Thnaks, though!

dusk sage
#

The link above will give you an insight into (un)scheduled environments

#

Which is a large part of spawn/call

#

For even further understanding of how the environments relate to spawn/call:

#
Calling from an unscheduled environment -> unscheduled 
Calling from an scheduled environment -> scheduled 
Spawning from an unscheduled environment -> scheduled
Spawning from an scheduled environment -> scheduled
#

It's also worthwhile to read the remoteExec(call) wiki pages, to see how they handle environments, it's slightly different

#

Ultimately it boils down to not suspending in an unscheduled environment (and on the way in which you wish to execute your code, re wiki), which given all this info may seem confusing as to when you are, but there is a handy new command (https://community.bistudio.com/wiki/canSuspend)

tough abyss
#

Interesting.

#

Is there any difference engine-wise between vehicles and actual playable units that would cause //Marker reset position for Comvic (Respawn helicopter). while { alive ComVic } do { sleep 5; "respawn_1" setMarkerPosLocal position ComVic; }; //Marker reset position for Gregory. while { alive Gregory } do { sleep 5; "GregMark" setMarkerPosLocal position Gregory; }; the first half of this code to work, but not the reset pos for gregory to work?

#

Because the marker resets fine for comvic, but not for gregory. Gregory is a squad leader.

#

This is in my initPlayerLocal.

#

Really trick, you need to paradrop AI from heli with a very specific way (order of commands, that aparrently can be executed in any order, and sleep or not-sleep between commands also count).

#

Extremely unreliable, since there are many many combinations, only one works, and can stop to work in future updates.

#

Can't decide if use paradrop or not. Thankyou for listening me!

broken mural
#

is there a way to make respawnModules randomized? So if I have 5 respawn modules, the player just hits respawn and it picks one of them?

marsh lodge
#

You would probably have to disable MenuPosition

broken mural
#

Which is fine, but without menuposition the player respawns where it initially spawned on mission start.

#

basically ignoring any of the modules.

marsh lodge
#

found it

#

In case a marker is found, there will be further attempt to retrieve all similar named markers in order to select one random marker. For example if there are several markers for side β€œwestβ€œ, β€œrespawn_west1β€œ, β€œrespawn_west_blahblahβ€œ, β€œrespawn_westiliciousβ€œ, all 3 will be picked up and then one marker will be selected at random.

broken mural
#

Thanks!

#

Reading it now. Appreciate the link πŸ˜ƒ

marsh lodge
#

I think they should make it more clear on the wiki

#

what happens when you have multiple markers

broken mural
#

Checking it out now. What I'm curious about is the fact that the first link basically says "SIDE" is the last choice before any respawn position

#

Oh! nevermind the spawn point would be dictated by the squad leader's unit name

#

so we can stick with side delegations; respawn_west1, 2, 3. testing now

#

this could not have possibly worker smoother.

#

wow.

marsh lodge
#

Glad you got it working

broken mural
#

partly; I'd like to select an area where a random spawn then occurs. at first glance it looks like i need to figure out how to change body position after death but before respawn so it looks at the closest selected respawn markers.

marsh lodge
#

so you only want some spawn markers to be used?

#

the closest ones?

broken mural
#

yeah; so random spawn points within a selected area only. IE, player dies, player selects base to spawn at and player is spawned on one of several points in that area. The issue there is I need to set height of spawn point as well, hence modules and not markers

marsh lodge
#

Ah

broken mural
#

looking like I'll have to rebuild the built in function just for that added bit lol

marsh lodge
#

What you can do is enable the MenuPosition feature again, and then have only one module per area. Then you have a script that activates on respawn/spawn that moves the player to a random marker in the area

broken mural
#

yup.\

broken mural
#

hm. Any idea how I can grab the respawn position variable name on use? Init field for that fires as soon as the mission loads.

tough abyss
#

this should work?

#

[player, [missionNamespace, "inv"]] call BIS_fnc_saveInventory;

#

diag_log str inv;

broken mural
#

figured it out. sending the area name on spawn to a function that will then randomly choose where to move the player.

broken mural
#

alrighty.. next question;
trying to run this code in a trigger 'on activation' for each player in the area.
player setPos {[roofTop1, "dirt_airField"] call "movePlayer.sqf"];};

#

what I want it to do is when a player enters the trigger area, teleport them to a different location.
[roofTop1, "dirt_airField"] portion is for a switch case to identify which area the player selected and which area it will teleport them to. With the above code, however.. I'm getting a syntax error (missing πŸ˜‰

#

.. missing a semi colon somewhere. error specifically states

"..., "dirt_airField"] call "movePlayer.sqf"|#|];};

indigo snow
#

call "movePlayer.sqf" is not valid syntax

#

did you mean to use execVM?

broken mural
#

Im using call as I expect to get the xyz pos from the object roofTop1

#

Is that incorrect?

#

to add on to that; same syntax error when using execVM

vital onyx
#

call is used only for "CODE", "moveplayer.sqf" is a STRING

#

youneed call compile preprocessFileLineNumbers "somescript.sqf"
first script file must be loaded (preprocessFile) - then it will be available as TEXT, then it should be compiled to become CODE

broken mural
#

Thanks for the info; I found out I could use compile loadFile but went a different route all together and got the thing working with just execVM and 2 params

#

Thanks for the info, LongBow and Cptnnick

sweet patio
#

Sorry about this noob question, but what sort of script so I need to delete zeus editing areas when the object that it is connected to is destroyed or dies, and how can I Russian it with the object?

#

I know how to order things to remove themselves but I need to know how to tie it to death and have it return

west lantern
#

since this is more a scripting than config question I will ask here

#

will this

#
{
  "Camo",
  "left_arm",
  "right_arm",
  "chest"
};
hiddenSelectionsTextures[] =
{
  "\mod\addons\mod_t_uniform_m93\data\mod_uniform_co.paa",
  "\mod\addons\mod_decals\data\first_brigade_ca.paa",
  "\mod\addons\mod_decals\data\army_ca.paa",
  "\mod\addons\mod_decals\data\name_one.paa"
};
 
class EventHandlers: EventHandlers
{
    init = "(_this select 0) setObjectTexture
    [
        1,
        [
            ""\mod\addons\mod_decals\data\first_brigade_ca.paa"",
            ""\mod\addons\mod_decals\data\second_brigade_ca.paa"",
            ""\mod\addons\mod_decals\data\third_brigade_ca.paa"",
            ""\mod\addons\mod_decals\data\fourth_brigade_ca.paa""
        ]
        select floor random 4
    ]";
};``` work in soldier config?
#

I am trying to set arm patches to be random

#

this might work for one selection but I have no idea how to make it work for multiple ones.. if there is a way please ... and thank you

#

hiddenSelectionsRandomTextures[] now there is this also but I dont know if this works at all anymore

native hemlock
#

Why would it be _this select 1?

west lantern
#

mh typo should be 0 / fixed

fallen skiff
#

I'm studying Python programming, just starting to learn about OOP ... just curious if anyone has anything to say on this ... how similar to Python is SQF way of dealing with objects, classes, inheritance, etc.?

vital onyx
#

How are doing folks?

#

take a look at my current wip - namespace editor

zealous solstice
vital onyx
#

haha) cool one)

#

I knew that someone might have such idea earlier)

#

but I prefer ingame

zealous solstice
#

the issue is that you dont get access to Profile and UI namespace in MP

vital onyx
#

but I plan to support non-local namespaces as well

#

if it is enabled in mission - then yes

#

you can dump variable on a remote client and path over the network

#

would be slow as hell but should work

#

anyway filters should be applied

zealous solstice
#

no i mean allVariables is disabled in MP

#

for profile- and UI Namespace

vital onyx
#

seriously?

#

let me try

zealous solstice
#

yes

#

you need to dig in the memory to get it

vital onyx
#

okay, reasonable

west lantern
#

giuse? Before you burry me here with chatter can I ask if

{
    init = "(_this select 0) setObjectTexture
    [
        1,
        [
            ""\mod\addons\mod_decals\data\first_brigade_ca.paa"",
            ""\mod\addons\mod_decals\data\second_brigade_ca.paa"",
            ""\mod\addons\mod_decals\data\third_brigade_ca.paa"",
            ""\mod\addons\mod_decals\data\fourth_brigade_ca.paa""
        ]
        select floor random 4
    ]";
};``` I can use multiple selections here or do I need different approach?
#

guess no idea eh

native hemlock
#

I'm not sure if I know what you mean, and you could also use selectRandom

#

Are you saying you want to set multiple hiddenSelections?

west lantern
#

okay here is the deal... I have a uniform that has set some hiddenselections like I described above... one is camo its for general texture and I dont need help with that, other is the left_arm path and then goes right_arm patch and so on... the idea is to make these RANDOM trough init in eventhandlers

#

in example above I can set hiddenselection from array but just one of them, 0, 1, 2, or 3 ... nn but just ONE

#

is there a way to set multiples there

vital onyx
#

@zealous solstice I found a way to do allVariables in MP

#

nothing impossible :)

zealous solstice
#

how?

#

missionNamespace and ParsingNamespace and other things work

vital onyx
#

__EXEC(pns = allvariables profilenamespace)

#

works in MP

zealous solstice
#

aha πŸ˜„

vital onyx
#

;)

zealous solstice
#

cool

#

but its static or?

vital onyx
#

valid at the moment of preprocessing config

zealous solstice
#

ok yeah my method is Dynamic and accuret alle the time

vital onyx
#

it requires dll

zealous solstice
#

yes

vital onyx
#

well, my intention - is mostly ingame mission debugging

west lantern
#

nvm if you dont understand Ill rape my brain until I get it right

vital onyx
#

@zealous solstice also I guess _EXEC should work also for preprocessFileLineNumbers

#

so

zealous solstice
#

no

#

_EXEC only work in config

native hemlock
#

I don't know why selectRandom wouldn't work, you'd just do

selectRandom [
    '\mod\addons\mod_decals\data\first_brigade_ca.paa',
    '\mod\addons\mod_decals\data\second_brigade_ca.paa',
    '\mod\addons\mod_decals\data\third_brigade_ca.paa',
    '\mod\addons\mod_decals\data\fourth_brigade_ca.paa'
]
vital onyx
#

@zealous solstice yep, u r right, will not compile

west lantern
#

yeah that would work but its not answer to my question its a replacement command πŸ˜„

#

thanks for that anyway

native hemlock
#

I still don't know what you want to do. Do you want to assign multiple hidden selections, or you want to set one of them randomly?

west lantern
#

multiple of them randomly

vital onyx
#

@zealous solstice anyway profile and ui namespaces are not the case for such tools, if mission author/admin needs smth from this namespace - he should know what he needs

native hemlock
#

So is hiddenSelection 1 is on the left_arm and 2 is on the right? Do you want both of those hiddenSelections to be the same?

west lantern
#

no thats the point I want each to be set from separate array of textures

native hemlock
#

So you are alright with having the first_brigade on one arm and the third_brigade on the other arm?

west lantern
#

no the brigade things goes on right arm

#

I want to do it this way so I dont have to make separate textures for each brigade

#

randomize the hiddenselection so each soldier will spawn with different arm patch

#

from the given array of four textures

grizzled cliff
#

woot, just ran my first full CI build of ACRE2

west lantern
#

I can do that for one hiddenselection but for more I guess that would require a script and cant be done trough evenhandler like this...

native hemlock
#

Well if it works for one hiddenSelection it should work for two, I just don't know if you can do multiple lines like that in a config

west lantern
#

I know I cant have multiple inits so it has to be done all withing this one

native hemlock
#

It would be cleaner to just have your own script so in the init you just had _this call Jastreb_randomizePatches or something

west lantern
#

its a question of formatting it right I guess but its a bit over my head

#

yeah that sounds about right

#

just wanted to know if its possible in the init itself but it seems too complex

#

for inline scripting in the config

#

requires a separate script... gotcha.. thanks

fallen skiff
#

Just curious, one author of a well-known Python textbook say that multiple inheritance (at least in Python) is a minefield and should be avoided if possible. Is there such a thing in SQF? inheriting from multiple classes?

vapid frigate
#

there's not classes in SQF

#

so no πŸ˜ƒ

meager granite
#

@west lantern Knowing Arma I wouldn't be surprized if these will end up different on each client lol

jade abyss
#

My guess: it will, since its beeing called on the Clients also (OR: the car will constantly change its color/skin, when a player connects πŸ˜„ )

meager granite
#

Actually current BIS texture randomization is messed up too, ends up different on all clients

native hemlock
#

Would there be any issues with it only setting the texture where the object is local and using setObjectTextureGlobal?

tough abyss
#

@meager granite also if you leave the server and rejoin textures will change.

#

Voip: "Go near the blue Heli!"

meager granite
#

It is setObjectTextureGlobal already

#

The bug with current BIS texture randomization is that it uses "Init" event handler in the vehicle

#

All vehicles are local during Init execution moment

#

So script runs for each JIP player

tough abyss
#

It's like that for ages, never mistrusted it to be a bug.

#

@meager granite have you played BRPVP?

meager granite
#

Never heard of it

#

By description of it looks to be somewhat similar to Wasteland

#
  1. Player stay in game for 10 seconds after disconection of any type.
#

Planning on having it in Wasteland too to prevent combat logging

#

Actually had it prototyped even for OA which doesn't have HandleDisconnect

#

Careful with these huge screenshots in the thread, you'll get infraction for it, there is a rule against posting big images that break forum formatting

tough abyss
#

@meager granite oh, i will fix that big screenshots.

#

About 02) there is one trick. If player 2 join the slot that player 1 just disconnected, player 2 will control the player 1 soldier in anti-combatlog state. This is because the soldier object is attached to that slot. To avoid that you need to move the soldier object to another group, this will unattach it from the slot.

meager granite
#

Yeah, I am aware

little eagle
#

@west lantern
dunno if you figured it out yet, but you have to escape the newlines in configs

#
    init = "(_this select 0) setObjectTexture\
    [\
        1,\

etc. except for the last line (which you terminate with a semicolon)

tough abyss
#

Guys I am a bit confused on structuring my scripts take for example this script I made called tasksComplete.sqf

private _taskList = [player] call BIS_fnc_tasksUnit;
private _taskStates = ["failed", "succeeded", "canceled"];
private _tasksComplete = true;

{
    params ["_task"];

    if !([_task] call BIS_fnc_taskState in _taskStates) then {
        _tasksComplete = false;
    }
} forEach _taskList;

_tasksComplete

Its contract is just to return true or false

However I was thinking of adding CBA_fnc_addPerFrameHandler and the function would then be its own thread that keeps checking itself, or should I just have one thread handler that then calls this function and does the necesary logic depending on the result?

#

I am wondering if it is an antipattern to have each script running its own job versus having one controller function that checks all other functions?

dusk sage
#

Well, you should really be asking yourself this first:

Does it need to run on every frame?

tough abyss
#

Not every frame, maybe every 15 seconds, so if the player finishes all tasks the mission will end

#

I made a decision to create a new function called mission_controller.sqf which has a frame handler and checks various states of stuff and ends the mission, seems more sense to have one place were all mission vars are monitored

dusk sage
#

There will be no need to use an onEachFrame unless you have a large amount of functions in a similar boat

tough abyss
#

What would you suggest then to do checks every 15 seconds?

austere granite
#

Frame handler on a15 second check

austere granite
#

probably just add an isNil check to "_actionParams" then i guess?

#

there's more commands lke that that have no return (Or a return that's formatted differently) when it should be empty

#

Yeah I agree

#

I think it was somethign with normally it would return a nested array, but if nothing is found it would just return [] instead

#

like you'd mostly use it with { } (count (thatCommand select 0)); but then first you need to add a check that it's actually the nested command 😦

dusk sage
#

Yep, seems like bad design if it doesn't return an empty array tbh

tough abyss
#

Any idea what causes this error?

Error position: <== true) then

#

This is my code

[{
    if (GhostFunctions_fnc_missionTasksCompleted == true) then {
        "end1" call BIS_fnc_endMission;
    }
}, 15, []] call CBA_fnc_addPerFrameHandler;
austere granite
#

you don't compare to true

#

if (GhostFunctions_fnc_missionTasksCompleted) then {

#

but probably seeing that looks like a function if (call GhostFunctions_fnc_missionTasksCompleted) then {

#

anyway.... the real questions is, if that's the only reaosn you're constnatly doing that check, why not make that function end the misssion itself?

broken mural
#

Any idea if you can parameterize ticket count in the mission setup? I know I can do time of day for example, but if i want to be able to select on the fly "MenuPosition" or "Tickets", how would you pass that and return the need for a ticket amount?

tough abyss
#

Hmm getting this now

Error position: <if (GhostFunctions_fnc_missionTasksCompl> 15:49:03 Error if: Type code, expected Bool

indigo snow
#

Adanteh already explained to solution to that one for you

broken mural
#

@tough abyss you need to change if (GhostFunctions_fnc_missionTasksCompleted) to if(CALL GhostFunctions_fnc_missionTasksCompleted)

#

the addition of call expects a return from the code it's executing. Basically the error says its running a bit of code as if it isn't expected to return something, but placed in an if()do block.

tough abyss
#

Ok thnks

little eagle
#

yet? having some issues where it returns nothing (undefined var) if a bad ID # is given
@tough abyss
this is my go to work around for shit like this:
[player actionParams 0] param [0, <whatever your default value should be>]

broken mural
#

hmm. I found #include "\a3\functions_f\params\paramrespawntickets.hpp" but apparently that only allows me to set min and max for the whole server, not side specific. Where can I find source info on .hpp's like this? I'm wondering what other #define's I can use. There are only 3 listed on https://community.bistudio.com/wiki/Arma_3_Mission_Parameters

little eagle
#

I can open the file and take a peak at it for you at what you actually can overwrite via define

#

nope

#

#ifndef TICKETS_MIN
    #define TICKETS_MIN    100
#endif
#ifndef TICKETS_MAX
    #define TICKETS_MAX    1100
#endif
#ifndef TICKETS_DEFAULT
    #define TICKETS_DEFAULT    -1
#endif
#

these three. nothing more

broken mural
#

Hey thanks for that @little eagle . One more question; can you declare respawntemplates in the init.sqf? For example;
if (_BluForTicketCount != -1) then { respawnTemplatesWest[] = {"MenuPosition", "Tickets"}; [west, _BluForTicketCount] call BIS_fnc_respawnTickets; } else { respawnTemplatesWest[] = {"MenuPosition"}; };

#

where _BluForTicketCount is declared in paramsArray

#

Reason I ask is I'm getting a missing ; error in that section.

indigo snow
#

you cant do that, no

broken mural
#

any idea how I would parameterize respawn types then?

#

Or is that not a thing

#

templates, not types.

rocky cairn
#

Is it possible to remove a specific units ability to aim down site? Ie for a reporter who is discoraged from picking up a weapon because he wouldn't know how to use it

tough abyss
#

Make him shoot from the hip?

vague hull
#

is there any good way to make an enemy AI run exactly after/follow a player/ another AI?
Im currently running doMove in a loop but it seems kinda bugged when the unit to follow or runafter is inside a house and the other unit isnt (or vise versa)

rocky cairn
#

@tough abyss yes, I want to script it so he is forced to

west lantern
#

The bug with current BIS texture randomization is that it uses "Init" event handler in the vehicle
All vehicles are local during Init execution moment
So script runs for each JIP player

For a moment I had a glimpse of hope and then @meager granite reminds me ITS ARMA πŸ˜„

#

@little eagle thanks for that I completely forgot but I worked out a solution with a function call in init rather than putting it all in the config

#

any way to delay it and make it run after the spawn trough EH? I assume that rules out Init

zealous arrow
#

Hey everyone, Is there a way to use structured text in a list box?

tough abyss
#

@rocky cairn make him careless?

rocky cairn
#

Its a player, id like to prevent the player from aiming down his site

little eagle
#

@rocky cairn
there is no command to force or to switch a camera mode, so no

split coral
#

Yeah there's no switchCamera

#

You could try waiting until cameraView == "GUNNER" and then switchCamera or player action ["weaponOnBack",player].

little eagle
#

doesn't work. weaponOnBack lowers the weapon, but the avatar immediately raises it again, because there is no GUNNER mode for the lowered weapon

#

you cannot get out of GUNNER mode

#

even this puts you back in GUNNER mode:

0 spawn {_w = primaryWeapon player;
player removeWeapon _w;



sleep 1;

player addWeapon _w;
player selectWeapon _w}
split coral
#

oh, I see. bummer.

little eagle
#

well. I have one idea, but it's extremely clunky and has many problems

split coral
#

How about making the reporter's bullets go all over the place if he shoots from optics? πŸ˜ƒ

#

Or the view goes black as he closes his eyes when shooting?

#

Add a huge sway with setCustomAimCoef.

little eagle
#

nope doesn't even work

zealous arrow
#

If it slightly helps towards your issue you can always use a Fired EH and delete the bullet, its not quite what it seems like you're after but they won't be able to shoot anyone/thing πŸ˜„

little eagle
#

or you give him this action:

player addAction ["", {systemChat "commy was here"}, [], 1.5, false, false, "DefaultAction", "cameraView == 'GUNNER'"];
#

unit won't be able to shoot in GUNNER mode

tough abyss
#

Any one was able to activate the new revive? I put the vars on description.ext and.. don't work. I pass away directily, with no incapacitated state (using basic revive).

tough abyss
#

working fine on my servers

#

This is the official revive from BI, some mods create their own revive mechanic and may be they will not change it to BI deafult one.

#

And it's what i'm doing, creating my own... until someone help me here with the official one πŸ˜„

floral geyser
tough abyss
#

If someone know, will save me some time: When i use "player setVariable ["myVar",100,true]" on the player "respawn" Event Handler, the "myVar" is set on the dead body also? Thankyou.

tawny thunder
#

I've got a question about bis_fnc_liveFeed if anyone has any experience with it. I'm looking to create a feed of one player's view and broadcast it to a television or laptop using setTexture or something similar. I believe this function may allow me to do that, but the wiki article doesn't provide any sort of helpful feedback. Thanks in advance!

tough abyss
#

This "if (condition1 && {condition2} && {condition3}) then {..." can in any situation be slowest than "if (condition1 && condition2 && condition3) then {..."? Thankyou in advace!

little eagle
#

If all conditionN are trivial, or if condition1 (or 1 and 2) is true most of the time.

tough abyss
#

@little eagle thankyou!

#

Finished my Revive system. πŸ˜„

#

Hope i can do a video about it soon.

tough abyss
#

^ lol he meant using the End Game/ Campaign revive

halcyon crypt
#

anyone seeing issues with slingloading since 1.64? Or perhaps 1.62? Certain boxes can't be slingloaded anymore for some reason.

tough abyss
#

@tough abyss i tried to use oficial revive many times, no win. I changed to use my own and will use that for now. just limitation is that AI dont shot incapacitated players.

#

I needed to choose between 1 - have fake death animation, or 2 - AI dont shot incapacitated players.

#

they don't do that with the End Game version either

#

@tough abyss me and me tested it with 2 computers. Not so extensiiiively, yes, but i will try to break it the most as soon as i can.

#

Players is set to civialian side and AI can't be bothered with them anymore

austere granite
#

setCaptive true

shut trail
#

Hey, when I use lbData it removes all , from the String does anybody know why and how to work around?

dusk sage
#

Google short circuit evaluation @tough abyss

tough abyss
#

Apply Kirchoff's Voltage and Current Law.

#

Or did you mean another circuit evaluation?

halcyon crypt
zealous arrow
#

@shut trail do you mean like
"test, string, separated, with, commas"
becomes
"test string separated with commas"

I've not seen this, I do store arrays in lbData by converting them to string and if it were to remove the commas it'd break the array (when converting back to array with call compile)

crimson hawk
#

anyone know how to scritpt pop up targets to come back up and to be scored?

tough abyss
#

I'm pretty sure there's already pop-up targets that flip up and down

#

So you'd just need to add an event handler for when it's hit

crimson hawk
#

well yeah theres pop up targets but im trying to set up a range where my guys can shoot the targets and once there done i can hit a button and theyll all flip back up

vague hull
#

Is there any advantage in using netIds instead of directly passing objects?

tough abyss
#

@dusk sage i will look at that. Remember that from many years ago.

jade abyss
#

@vague hull I would say less stuff to broadcast

tough abyss
#

@dusk sage looked at @halcyon crypt link. I'm using it now because of comodity in some situations, and a bit because of performance... but's sounds a strange thing to me, the WIKI says "The use of short-circuit operators has been criticized as problematic". I think it can make us lazy since it solve some situations of bad code. For example, i don't like to have to check if a variable is defined before using it, this thing can make it more connom than water.

vague hull
#

@jade abyss ok thx :) I thought so yet couldnt find some official statement

jade abyss
#

As usual πŸ˜„

#

+The other benefit is: You can send over MapObject pretty easily.

tough abyss
#

When a unit die the weapon it was holding goes to the ground. How can i access this weapon by script?

#

"primaryWeapon _unit;" dont work.

#

Considering the weapon on ground is primary.

mint frost
#

@tough abyss I think you need to search for nearby weapon holder on the ground

tough abyss
#

@mint frost thanks. Strange is that the weapon get deleted if you delete the unit, so this weaponHolder must be tied to the unit.

mint frost
#

Okay didn't know that - maybe there is a other way

zenith bramble
#

create an MPKilled event handler, in the code do a nearestObjects check for GroundWeaponHolder.
or if you are using a database that keeps track of player info and stats, just pull the primary weapon from that data

clear tendon
#

This is a somewhat scripting based-ish question, but does it matter in which order you load things from init.sqf?

#

sometimes i have the feeling things do not load when set in a particular order...

radiant egret
#

Hey guys, short question (no access to arma atm to test), i need to check if the client has a addon activated.

    fox_suicide_bomber_fnc_remote_sound = {
      _object = _this select 0;
      _sound = _this select 1;

      if( isClass (configFile >> "CfgPatches" >> "fox_suicide_bomber") )then{
        _object say3D _sound;
      }else{
        ["<t color='#FF0000'>Man:", "Allahu Akbar"] call BIS_fnc_showSubtitle;
    };

    publicVariable "fox_suicide_bomber_fnc_remote_sound";
    [_bomber,"suicide_bomber"] remoteExec["fox_suicide_bomber_fnc_remote_sound", owner _x];
#

is this method valid ?

little eagle
#

probably not. owner only works on the server machine

#

just use _x. Also I'm not sure if remoteExec works if you pubVar the function in the same frame.

radiant egret
#

i loop trough a array with player object; from wiki

On server machine, returns the ID of the client where the object is local. Otherwise returns 0. For use on clients clientOwner command is available. To find out the owner of a Group, use groupOwner.

in 2h when im home i can test it.

little eagle
#

just use _x. remoteExec can take objects

#

or even better

#

use the array you are iterating through. remoteExec can take arrays of objects

#

what you really want to do is to define fox_suicide_bomber_fnc_remote_sound in the init.sqf and not send it over the network during the mission

#

also, might be my OCD, but please replace

      _object = _this select 0;
      _sound = _this select 1;

with:

params ["_object", "_sound"];
#

it's 2016

#

many sacrifices where made for this syntax

radiant egret
#

my aim is to add support for non addon user,
Example:
Server, addon installed
Guy A, addon installed
Guy B, no addon

The suicider addon runs on the server, now i want to check server sided if the players have the addon active if available, say3d ...., else bis_subtitle...., this is why i need the send the code over the network

little eagle
#

but don't do that in the middle of the mission. especially not x times while iterating through an array. everyone will notice the civilian trying to blow itself up by the red chain and desynch...

clear tendon
#

anybody who has a clue how to set-up sector's /w respawnpoints in combo /w alivemod?

tough abyss
#

@mint frost @zenith bramble thanks.

#

If i move a dead body, his weapon lying on the ground moved too?

little eagle
#

no

tough abyss
#

Wooooooo!!!

#

Thanks @little eagle !

little eagle
#

but if you delete the corpse the weapon will be deleted to for whatever reason

tough abyss
#

I will move the body to [0,0,0] and delete it after 1 minute

velvet merlin
#

Added: A new entities script command (with native filtering support)
Fixed: Crash when using the keyImage script command with a negative value
Fixed: Dropped equipment could become unobtainable in some cases
Added: Support for an optional parameter (include crew or not) for the entities script command

#

anyone tried the new entities stuff yet?

nocturne bluff
#

nope but sounds good

tough abyss
#

@kju thi is a mod?

#

How i put an AI unit in a B_static_AA_F static turret? moveInDriver?

tough abyss
#

So, is there a fix for the non working revive? Straight to respawn instead of incapacitated. Seems to be a bug from last update

snow pecan
#

@clear tendon What exactly are you trying to accomplish? Could be fairly difficult. We also have our own Discord channel that is probably more suited for this type of stuff if you want to ask us directly.

willow basin
#

@JayS_NL of course it matters in which order you load things. Functions and variables must always be declared before usage which is why such declarations should always go at the beginning of the init.

clear tendon
#

@willow basin i understand, i'm just wondering if there's an order to which you exec multiple scripts.

clear tendon
#

@snow pecan the gest of the idea would be to check if a sector is captured by blu or opfor, if it's captured (saying say on the map) give the player the option to spawn into that zone, close to the action.

tough abyss
#

_corpse setPosASL [0,0,0]; not works allways. Why?

#

The corpse move in some clients and not in anothers.

#

And one time the corpse neck gone to 1 meter

#

and it not moved

#

Where are you putting that command

#

Corpse is in a client

#

I exec the command on server

#

May be we can't move it because its gone ragdoll.

austere granite
#

you can move it

#

but afaik you gotta setPos local

tough abyss
#

^

#

setPosLocal
i assume it's in an event handler, so you should put the event handler in your initPlayerLocal

velvet merlin
#

dont use [0,0,0]

#

diag.exe warns about positions too close to it

#

use [-10000,-10000,0]

tough abyss
#

Thanks for the help.

vital onyx
#

@velvet merlin what's wrong with diag.exe and [0,0,0]. Any useful reading about this?

velvet merlin
#

the engine can have problems with that position, so its best to avoid it

vital onyx
#

btw, recently CCIP was introduced for planes and helis - anyone has a knowledge how to get CCIP data with script? eg get xyz of estimated impact position?

bitter magnet
#

kju: is 10,000 recommended value, or doesnt it matter once it goes away from zero?

#

away from zero and the size of created object of course.

velvet merlin
#

10k is arbitrary, yet far enough away

bitter magnet
#

roger, I'll change all my scripts using zero from now on then. thanks for the tip πŸ˜ƒ

velvet merlin
#

in OFP that position was very problematic; i think BI fixed most issues by now, yet AI stuff and some rare/very specific stuff still may cause issues

little eagle
#

it's not [0,0,0]. setPos on ragdolls is wonky

#

probably thinks the ragdoll was moved on some remote machines and the interpolation magic throws it back at it's original position

agile pumice
#

an someone throw me an example of creating a unique variable for a building on the map?

#

im having a brain fart

agile pumice
#

really wish we could use parameeters with addMissionEventHandler

native hemlock
#

What do you mean?

tough abyss
#

eagledude4, a variable that maps to a building, or a building that maps to a variable?

#

Thank you for elaborating more kju, I regularly use [0,0,0] for namespaces and such and I have had no problems.

#

@little eagle if you are having problems with positioning ragdolls, just make sure its done locally, and try utilizing it in unscheduled environment with enableSimulation false commands

#

for instance, _obj enableSimulation false; _obj setPos _pos; _obj enableSimulation true; _obj setPos _pos; Should work guaranteed, because second setpos will be interpolated correctly and broadcasted.

little eagle
#

cool method

#

We use createVehicle almost exclusively on [0,0,0] and then use setPosASL. The searching-for-a-free-space part of that command is hideously slow, even with the CAN_COLLIDE flag.

tough abyss
#

Btw, commy2, if this method does not work, post up bug repo. Nobody should take hacks too far

#

I revived a player 20 times and don't had the problem on the two clients. Just moving the body to [-10000,-10000,0] (ATL), no other changes. Will keep checking.

little eagle
#

yeah. it might also work with -10k, because the ragdolls are so far away that the interpolated movement becomes "invisible".

tough abyss
#

lol (funny pic)

#

i will try the other solution

tough abyss
#

It worked!!!

#

Thankyou @tough abyss.

little eagle
#

Yeah. Exactly the problem on the picture. Nice to know that there is a solution. Someone should put it on the wiki

tough abyss
#

I'm dealing with "mechanics" now. Player have life of 1, disabled player have life of 0.5. A sniper shot in the head can "kill the player 4 times" so he dies. Even one shot of a Medium Machine Gun kills directlly. SMG need some shots on the disabled player to kill. (for disabled body i consider only general damage, that is damage on part ""). But i'm increasing the disabled player life to 1. Thanks for watching.

vague hull
#

I have been searching for quite a while now, but is there a reliable way to force a unit without weapons to sprint?

tough abyss
#

I cant tag swinging.meatball on cel.

#

@little eagle the problem still happens. I'm using meatball code with [0,0,0].

nocturne bluff
#

@little eagle does this affect units too or only vehicles?

little eagle
#

spawning at [0,0,0] ? idk, but it does search for empty postions for units too. Someone should test

#

the problem still happens. I'm using meatball code with [0,0,0].
figures. was too good to be true. Ragdolls suck

tough wharf
#

hey guys, got a quick question; arma says i fucked up with my brackets there: _res = createVehicle ["CargoNet_01_box_F", (position [(getPos _obj select 0)+20,(getPos _obj select 1),(getPos _obj select 2)]); , [], 15, "NONE"];

#

but where

split coral
#

; ,

#

remove the semi-colon

tough wharf
#

oops how did that thing get there :S

#

thanks that was the whole problem

velvet merlin
#

whats the best framework to generate a road network these days?

vague hull
#

in terms of what?

velvet merlin
#

to dynamically scan a terrain, create the road network to give AI waypoints dynamically to drive around (cars/trucks)

vague hull
#

Depends, I would go for an dynamical approach if the performance allows it.. otherwise scan with connectedTo on call, however Idk if there is something premade for this already

tough abyss
#

@little eagle Sorry man, welcome to netcoding

tough abyss
#

@little eagle i did a test, i used "_corpse setPos ((getPos _corpse) vectorAdd [-50,-50,0]);" or in other words, moved it some meters away, and the problem happens allways! (i suspect you already expected that considering your comments on -10000)

#

Anyone know what is the farest away distance i can setPos things?

#

With [-10000,-10000,0] the problem happens 1 time in more than 20 deaths.

tall nacelle
#

anyone able to lend a hand to a mate of mine, hes got an idea for a gamemode but he cant do it himself

vital onyx
#

@velvet merlin do you have any examples of such frameworks? I have not heard of them

jovial nebula
#

Hello,does anyone know if waypoints are actually executed server side?

thin pine
#

You mean the waypoint condition and activation codes?

jovial nebula
#

Uhm

#

Activation

velvet merlin
#
Bohemia Interactive Forums

Page 13 of 13 - AI Driving - Feedback topic - posted in ARMA 3 - DEVELOPMENT BRANCH: I am confused. Latest changelog: Fixed: Using disableAI PATH and MOVE would not work correctly for vehicles driven by players (https://feedback.bistudio.com/T120346) The ticket says Since 1.64 update, wheeled vehicles cannot move when _veh disableAI MOVE is defined for vehicle. Isnt this exactly what should happen? I mean, if I disableAI MOVE -- why would I want t...

random estuary
#

Is there anyway to force a flush of the JIP queue in multiplayer?

tame portal
#

@random estuary I don't think so, unless there's a command to fetch the id's

#

You could always save the id's somewhere if you create a jip remoteExec and then just use them

tough abyss
#

Can i do that: "BRPVP_disabledSounds = BRPVP_disabledSounds apply {...};"

austere granite
#

yes

fiery shard
#

is there any reason a custom extension (.dll) won't load from the mod/addon folder but it will work in the root of the Arma directory?

tough abyss
#

@austere granite thanks!

tough abyss
austere granite
#

units actually die, and then you just respawn in same spot with gear copy right?

tough abyss
#

Yes

#

No "hack" or anything overcomplicated.

#

Still can polish it like make the unit revive in a better position and not standing.

#

But having some problem to make the unit revive in the position i want.

#

When the unit is far away from a client, this client does not record this unit animation state. So when the unit magically appears in front of this client (setPos) strange things happens.

#

"HandleDamage" continues to record damage after the unit is dead.

scarlet spoke
#

@tough abyss have you tried it with setUnitPos?

austere granite
#

I got that in my revive too, but the problem is that most commands that include dead units (for markers and so on) are slower

scarlet spoke
#

What do you perform on a dead unit?

austere granite
#

Dead in this case would mean incapped

#

But in that sorta revive the unit is dead to the engine.

#

So if you'd still want to markers for incapped units, you would need to use script commands that include dead units.

tough abyss
#

@scarlet spoke have tried switchMove and playMove, but it doens matter what you try if the unit is respawning in a distant island and the clients near the body dont record its animation.

#

When the "reviving" unit get teleported from the spawn island to the dead body its like if its animation is nil

scarlet spoke
#

And what if you spawn the unit somewhere remote, then use hideObjectGlobal then setPos and then the respective command to change the units stance?

#

And afterwards unhiding it of course

tough abyss
#

@austere granite i have no big problem with that, but i created a variable in player namespace that can be -1 for alive, 0 for incapacitated and waiting destine, 1 for killed, so respawn, and 2 to revive now.

#

@scarlet spoke i will try that.

tough abyss
tough abyss
#

@scarlet spoke your idea about hideobject worked perfectly!!

scarlet spoke
#

Haha... Glad that I could help 😁

tough abyss
#

A dead unit allways will have a "damage _unit" of 1?

thin pine
#

Afaik yes

tough abyss
#

@grave comet confirmed it is. Also if a dead body get hit the damage reset to zero and start again 0... 0.455... 0.896... 1.123... 1.643... 2.122...

#

Its not continue from 1 (death).

#

hello felas.

vital onyx
tough abyss
#

BRPVP Revive is well polished now.

#

Code & visual.

#

But its so much work to do another video.... πŸ˜›

tulip summit
#

Does anyone know what function is called when you open your inventory?

scarlet spoke
#

Afaik there is an event handler for this...

scarlet spoke
#

is it possible to pass parameter to the code of a addPublicVariableEventHandler?

#

And even more urgent: Is there a way to remove the EH when It's no longer needed?

#

Bad news :/

#

Do you know why you can't remove it?

#

I mean is there a particular reason for it?

#

Yeah but remoteExec is slower afaik

#

That's true... And apparently I don't have the option to choose as publicVariable does not fullfill my needss...

#

Thanks for the answer

jade abyss
#

oO

#

RE is slower? It gets executed right away.
RECall can be slower/delayed.

scarlet spoke
#

Why is that?

nocturne bluff
#

RE is better.

scarlet spoke
#

Than ReCall?

nocturne bluff
#

Then pubvars EH.

scarlet spoke
#

Ah okay... I had in mind that I have read otherwise

#

@jade abyss why can RECall be delayed and RE can't?

jade abyss
#

Nah, i mixed it.
RECall is instant, RE CAN have delay

#

@scarlet spoke

#

Just like "spawn" (RE) and "call" (RECall)

scarlet spoke
#

Ah okay... That's the way I expected it πŸ˜ƒ

#

Thx

nocturne bluff
#

"instant"

#

as instant as network traffic allows

scarlet spoke
#

Sure

#

That would be a neat trick to have instant execution over network πŸ˜„

#

If canSuspend returns true in a SQF-Script it's a save indicator that the code is executed in scheduled env isn't it?

jade abyss
#

Would be something new for me.

#

Whitelisting, of course it checks, whats in there and what not. Do your Tests with a Server under heavy load, then compare RE(C) with the PVS/PVC stuff.

#

Before REC? Don't think so.

nocturne bluff
#

Its the same talk when people use count for looping over elements.

#

Sure it might be 0.001% faster

#

But semantically it still sucks, just like PVEH's.

scarlet spoke
#

You mean PFEH's?

#

No forget it... I got it

tough abyss
#

I don't want to be a bag but i don't use Public Variables for Remote Execution :p

#

@nocturne bluff also the thing about spaces, the idea that spaces can make your code slowers... not sure if its something noticeable at the end.

#

Let me gain some performance with my code " if (_run) then {..." => "if(_run)then{..."

#

Yay!

tough abyss
#

Erm... can i use switchMove in a dead body?

#

(80% of the work in my revive now is to preserve the fallen weapon... AAAAA!)

#

(te current version can duplicate weapon items and refill the weapon magazines)

#

(so, back to setPos on dead body. What alley i preffer??)

scarlet spoke
#

Afaik you can do a nearestObject for a weaponHolder in order to find the weapon of the dead body... You might want to google a little more for this

#

@tough abyss

dusk sage
#

Indeed you can

#

Doesn't work so well from experience though

scarlet spoke
#

Hm okay... never tried it myself. I just remembered that I have read that you can do it like this

tough abyss
#

Ok, so i find the WeaponHolderSimulated, and now what? I would need to transfer the weapon to another weapon holder (weapon with exactly same items and mag count) so i can delete the body and don't lost the weapon. This "transfer of the weapon" is not possible.

#

Or i can use a invisible unit to assembly a new weapon (exactly same weapon, items and mag count) and drop it in the new holder with dorpWeapon action (3 seconds action)... too much hack..

#

I checked the body and the WeaponHolderSimulated with allVariables to try to find something that link the WeaponHolder to the body and try to remove this link, but found nothing.... The body get deleted, the weapon dissapears.