#arma3_scripting

1 messages ยท Page 460 of 1

meager heart
#

๐Ÿค”

unborn ether
#

HC has a lot of issues

#

Some of them are really floating

meager heart
#

the floatingness* intensifies, when you doing some weird things ๐Ÿ˜€

unborn ether
#

Well its just enough when HC suddenly stops reconnecting if session was lost due to restart

#

Or when he suddenly change some port which can occupy server port.

royal abyss
#

i found a script on Armaholic wich allows to save player stats and position and everything without a db how is that possible? ^^

#

i cant see where it saves user data so far and would like to know how far does that saving work without a db

late gull
#

not impossible

#

you can get player data, and then store in plain text

#

or in player profile

royal abyss
#

but playerprofile is clientside right?

late gull
#

yes, he can edit it

royal abyss
#

and plain text creates a document?

late gull
#

i guess

#

never did a thing like this

#

but should be possible

royal abyss
#

Thats the whole script for saving

#

found it it saves in profile

#

so cheating would be easy

late gull
#

๐Ÿ˜‚

royal abyss
#

even teleporting if u know coords

late gull
#

It's ok for Coop servers

royal abyss
#

but not for public coop ๐Ÿ˜„

#

even tho the chance of someone noticing it and chaning it would be small i wonder how many servers make use of such system ๐Ÿค”

late gull
#

Meh, Who want cheat agaist ai?

#

Xd

royal abyss
#

i did it ๐Ÿ™ƒ

#

not in arma but still lol

#

Dying Light was to scary without unlimited ammo lol ๐Ÿ™ˆ xD

late gull
#

๐Ÿคท

royal abyss
#

in the dark when all these super fast zombies come >.<

#

i dont see a problem against ai but in PvP its just lame i dont see any reason to betray myself and i know i got sloooow the last few years all these 12 year olds with their dam reflex XD

tough abyss
#

If enableAI is used on a client, how does it affect other clients and the server?

fringe yoke
#

iirc it only works where the unit is local, disableAI requires a local unit and I'm sure enableAI is the same

kindred lichen
#

Hey, I'm trying to Make a mission where teams have limited respawn tickets, but I don't want the mission to end when 1 team reaches 0, I just want them to lose the ability to respawn.

#

respawnTemplates[] = {"Counter","tickets","MenuPosition","Spectator"};

Trying this, but I still get Mission Failed when I hit 0 tickets.

#

Seems like the "endMission" template is still enabled.
Maybe i should try, respawnTemplates[] = respawnTemplates[] - {"EndMission"};

meager heart
#

tickets are local ?

#

how you add them ?

#

@kindred lichen

kindred lichen
#

I'm just using the ticket module in the editor.

meager heart
#

ok

#

wait a bit

kindred lichen
#

I played it with other people Saturday and when 1 team hit 0 tickets it ended even though players were still alive.

meager heart
#
//--- initPlayerLocal.sqf
private _tickets = "Tickets" call BIS_fnc_getParamValue; //--- set it as mission params imo better option
[player, _tickets] call BIS_fnc_respawnTickets; //--- add local tickets to player

add event handler or you can use default onPlayerKilled.sqf

params ["_unit"];
private _tickets = [_unit, 0, true] call BIS_fnc_respawnTickets;
if (_tickets == 0) then {
    setPlayerRespawnTime 1e10;
};
kindred lichen
#

This gives players individual respawns, I want a team pool of tickets.

meager heart
#

you can add tickets for that team/group...

kindred lichen
#

Mission ends when tickets hit 0 though.

#

The problem is it triggers an ending when a team hits 0

meager heart
#

remove that module... and everything will work ๐Ÿ˜€

kindred lichen
#

I don't need the onPlayer killed stuff because it's handled int the tickets respawn template.
Thanks, Removing that module did fix it.

meager heart
#

lol

kindred lichen
#

Only issue now, is that the spectate feature doesn't really work, because you get stuck on the Select Spawn position menu, and if you click spectate you just get your death view, like staring at the dirt.

meager heart
#

yeah, when will be players on the server, it will work fine

#

or allow 3d person view for the spectator

violet gull
#

Is it possible to order an AGENT (createAgent) to target a position/object with a weapon?

meager heart
#

afaik only if you will enable ai for them (might be wrong)

#

weaponaim and targetmaybe something else

dry egret
#

is their any way to update the text in a dialog windows rscStructuredText box upon a button click on that window?

ivory nova
#

is missionnamespace setvariable [format[etc]]; the best way to prefix a local variable and spit out a global one?

#

Well, for any locality I spose

#

Kind of wrapping my head around dynamic variables by reading other scripts, but not quite there yet. Want to be able to call a function and pass a โ€œTypeโ€ parameter to it, so that global vars are prefixed with it

#

Generic global vars generated in the function thatโ€™s called

little eagle
#

Dynamically generated variable names are a sign of a bad script most of the time.

#

Spiegel, probably MouseButtonDown eventhandler.

warm gorge
#

Is it possible to check who is accessing a given container/inventory? Or would I need to set that up myself with setVariables with InventoryOpened/InventoryClosed? I'm trying to prevent multiple people from accessing them, to try and prevent Arma's well known inventory duping exploits.

robust hollow
#

i think ive looked for that before and found nothing good, i use setvariable on vehicles only allowing one unit in at a time.

warm gorge
#

Yeah these issues have been around for years... Not sure why they dont get prioritised to be fixed

still forum
#

you can setVariable.. But I don't think it will prevent the duping exploit. If the variable doesn't arrive at the second client before he takes and dupes the item...

robust hollow
#

especially with one man dupes setting a variable wont help anyway.

warm gorge
#

Yeah, I mean this might help... But definitely won't eliminate the issue entirely. I guess theres really nothing else that can be done.

still forum
#

you can use the takeEH on every unit. Then notify the server about it. If the server see's two takeEH's for the same item although there was only one inside the box.

ivory nova
#

@little eagle Got it, will avoid then, cheers!

unborn ether
#

pity that takeEH only specify a classname of taken item, not count. So that can't help really much. ๐Ÿ˜ฆ

robust hollow
#

you could probably save all puts and takes on the server so it can keep track of a containers contents, but its probably a bit much of a hassle.

#

thats along the lines of what dedmen was saying

still forum
#

takeEH fires for each item afaik. So count is always one

unborn ether
#

It fires once for 1x of items or once for 9x indiferently.

still forum
#

gives CPR.. It seems to have no effect

quaint turtle
#

lol

still forum
#

As the error message says. life_dispatcher was bool and it was not supposed to be that.
Common sense would dictate that a "dispatcher" should be of type Object.

quaint turtle
#

@tough abyss i'd recommend doing the isNull check as another if statement

#

for instance if (isNull life_dispatcher) exitWith {};

#

Then do the if (_toString isEqualTo "911") then {};

#

Sure

still forum
#

@tough abyss It doesn't seem that it's your script. Meaning you are using someone elses script incorrectly

#

you might be able to fix that one line that's throwing the error. But that won't fix the rest of the script

dry egret
#

@little eagle What im doing is having a button change the text in the structured text field to give multiple pages of text. Problem is i cant update the text field in the rscStructuredText. I am using the mouse down event in the dialog via

action = "";

but the issue is i dont know how to use the ctrlSetStructuredText command as ctrlSetText does not work on rscStructuredText dialogs.

dry egret
#

only work around i can think of is making a bunch of paa images to swap out on a rscPicture frame

robust hollow
#

_ctrl ctrlSetStructuredText parseText โ€œwords and stuffโ€

dry egret
#

i think my problem is how to get the display

#

for the _ctrl

robust hollow
#

what do you mean

dry egret
#

the _ctrl expects a control so i cant pass the idc number of the rscStructuredText box i want to edit

robust hollow
#

the button ur clicking, thats a different control on the same display?

dry egret
#

its all in the same dialog display but the box i want to edit is a different idc number than the button being clicked

#

its all in the same idd

robust hollow
#

easiest way if the display has an idd is to just do findDisplay idd displayCtrl idc

dry egret
#

is there a way i can inline it

#

say idd = 9999 and idc = 5555

robust hollow
#

(findDisplay 9999 displayCtrl 5555) ctrlSetStructuredText parsetext โ€œhiโ€?

meager heart
robust hollow
#

i was going to go that way but dont know what params โ€œactionโ€ gives ๐Ÿ˜ฆ

dry egret
#

im still new to scripting but im learning a lot,

#

@robust hollow that fixed it, thank you so much man

robust hollow
#

๐Ÿ‘๐Ÿป

dry egret
#

๐Ÿ’ฏ

meager heart
#

@dry egret

dry egret
#

ooo downloading that one now

#

been a year since i have been on arma... only game i can never get away from lol

#

hold the damn phone... is that text on a 3d pane ๐Ÿ˜ฒ

tender root
#

Hey,
I ran into two problems:

  1. Is there a way to check whether a player is combat pace? (Maybe possible by checking the speed of the player, but is there an easier solution?)
  2. Is there a way to check whether a player is leaning? (I already checked animationState and the animation eventhandlers which won't recognize leaning in any way ๐Ÿ˜ฆ )

I thought about checking for key presses but it's a really hacky solution in both cases.

Thanks in advance! ๐Ÿ™‚

still forum
#

for leaning you can math it. eyePos relative to feetPos and view direction.

#

If player looks north. But eyePos is to the west of the players feet. Then he is leaning

tender root
#

@still forum the math solution looks good. I'm gonna give it a try. Thanks ๐Ÿ˜ƒ

#

Any ideas for combat pace?

still forum
#

waits for error

#

because the variable is not defined as it is telling you

#

It's very mod specific stuff. You'd be better off asking that in a life forum

tender root
#

@still forum Why haven't I found that? ๐Ÿค”
Thanks a lot ๐Ÿ˜ƒ

still forum
#

the full script would be useful I guess

#

but I think life_alive is a global variable from the life framework. And not specific to that script

#

yeah. Cannot see anything from that (terribly ugly btw) script.

#

how do you "add it" ?

digital jacinth
#

life_alive is nil you need to check before if that variable is nil or not

#

it is not a compile error, but a runtime error

#

nah

#

just add infront of the if this

if(isNil 'life_alive') then { life_alive = false};
#

one solution can be, that it is assumed that if life_alive is nil it should be actually be falase, so

if ((time - _callStart > 55)  || {!(missionNamespace getVariable ['life_alive',false])}) exitWith { life_phone_status = 0 };`
still forum
#

If you don't know what that variable is doing. And don't care. And that variable isn't working anyway. Why don't you just remove it?

if (time - _callStart > 55) exitWith { life_phone_status = 0 };
winter rose
#

โ†‘

quasi rover
#
call compile format ["addMissionEventHandler [""Draw3D"", {
    _distance = cameraOn distance %1;
    _alpha = 1-(_distance/5);
    _boxNode = boundingBoxReal %1; 
    _postick = getPosATL %1; 
    _boxHeight = (abs (((_boxNode select 1) select 2) - ((_boxNode select 0) select 2))) * 1.15; 
    _postick set[2,(_postick select 2) + _boxHeight];
    drawIcon3D[
        'a3\ui_f\data\igui\cfg\cursors\select_ca.paa',  
        [0,125,255,_alpha],   
        _postick,  
        0.8,     
        0.8,    
        0,        
        ""%2"", 
        1,         
        0.0315, 
        ""EtelkaMonospacePro"" 
    ];
}];", _selunit,_tasktopic];

I run this script, but only Server can see the Draw3D icon & text.
How can I run Draw3D on all machines in MP with a dedi?

still forum
#

call compile format why dude?

#

call compile format is in 99% of cases useless.

#

Same here. Just use addMissionEventHandler normally. And give it a string instead of code

quasi rover
#

to get the _selunit,_tasktopic variable

still forum
#

re-read what I said

#

but only Server can see the Draw3D icon & text. well except that dedicated servers don't see anything.

quasi rover
#

I mean Hosted server.

still forum
#

you can use BIS_fnc_addStackedEventHandler to pass parameters

#

you have to use remoteExec to execute it on all clients

#

passing _selunit like that won't work if any unit doesn't have a vehicleVarName assigned. Just use BIS stackedEH function.

quasi rover
#

need study more, thx.

#

and _selunit have a vehicleVarName.

still forum
#

And you are 100% sure that all possible _selunit have the var name assigned on all clients even shortly after JIP?

#

Then it's probably fine. But still no reason for call compile you only "need" the format

#

Yes.

#

That is exactly what I have been trying to tell your from the beginning.

#

You didn't implement the script correctly. Ripping all the stuff out that doesn't work won't make it work better

#

A car with a broken motor doesn't work better when you take the motor out.

#

if life_ringer is a variable used to disable the ringing sound then.. Yeah. it will "work" in that it always ignores if the user doesn't want the ringing sound.

tender root
#

@still forum fyi the math solution didn't work that great, because the angles (view dir to eypos) just wont work out:
Weapon up + no lean = ~25ยฐ
Weapon up + left lean = ~25ยฐ (but in other direction)
When shouldering the weapon on the left shoulder same problem but different sides etc.
Seems like checking for key presses is the only solution ๐Ÿ˜ญ

#

The eye pos isn't directly above the feet pos especially when ads

#

which fucks it all up ๐Ÿ˜ฆ

unborn ether
#

@tender root eyePos doesnt respect Z coordinate until you ALT when looking. So ๐Ÿ˜„ ๐Ÿ˜ƒ ๐Ÿ™‚ ๐Ÿ˜ ๐Ÿ˜ถ ๐Ÿ‘€

#

Its better to trace a ray from "rwwrist" selectionPosition (+ 0.1 to Z) so it almost does look like a lasersight position.

#

Ah and use weaponDirection instead

tender root
#

The z wasnโ€˜t the problem

#

How do you want to use Weapon direction for detecting leaning? @unborn ether

gleaming oyster
#

lineIntersects

tender root
#

lineIntersects with what?

gleaming oyster
#

its a command

tender root
#

I donโ€™t really get it ๐Ÿ˜…

#

I know

#

But how would that help?

gleaming oyster
#

weapon direction and pos being one param, your end distance being your second, if it returns true then yay

tender root
#

I want to detect wether a player is leaning.

#

Which end distance ๐Ÿ˜…

#

I think you misunderstood the problem ๐Ÿ˜ฌ

gleaming oyster
#

Use a animStateChanged EH

winter rose
#

leaning (left/right) doesn't trigger that I believe

#

@tender root "just" leaning? not left/right stance ?

tender root
#

just leaning. I want to know whether hes leaning left or right (direction would be awesome) but the stance are completely irrelevant

winter rose
#

what about eyePos and worldToModel?

gleaming oyster
#

I think that was the idea above

winter rose
#

maybe a skeleton point then, should do the trick
but true, there isn't a command to check that.

gleaming oyster
#

Like what? The chest? Arm? Lol

winter rose
#

L/R shoulder?

#

shoulder distance2D unit

#

may not be precise enough for TrackIR users, but still

tender root
#

Honestly I doubt, that that would work

#

Probably same problem as eyepos

winter rose
#

worth a shot, unless a better solution arises

tender root
#

The problem is that, when a player has his weapon up like this:

#

the whole upper body moves a little bit to the right

#

so there is always a offset, because the player doesn't stand completely straight

#

And I can't even rely on that "standard" offset, because when shouldering the weapon on the left shoulder the whole problem just back-to-front

#

I i can't even check whether the player is in combat stance left so

#

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

#

Do you get the problem?

winter rose
#

set a floor to raise above, I mean
ok, it moves between value1 and value2, maybe (surely) it's different between animations (crouched, stance left, etc) and you would have to do a correspondance table, but still, doable

unborn ether
#

WeaponDirection mates

#

Draw a ray from right wrist selection

winter rose
#

no offense meant, but how would that help? the ray would move with leaning?

unborn ether
#

Yes it will since the weapon vector will change

winter rose
#

horizontal plan would "incline"?

unborn ether
#

Beg it from right wrist to full length you need with weapon direction

winter rose
#

if so, then yes (beware of ground inclination though ^^)

unborn ether
#

Yes it will

#

I can't throw a snippet sorry not at home now

still forum
#

@tender root if eyePos doesn't work then use positionCameraToWorld. That usees the camera position. And that one definetly leans to the side.

#

I know it can be mathed. But I don't know the formula. You basically have to find out where a player is facing. And checking if there is any "roll" from feet to head. And you probably want to check for a minimum z difference. It might false positive when laying on the ground..
positionCameraToWorld only works first person tho

gleaming oyster
#

Eh....context please?

#

What phone? Pressing 9? How is the receiving supposed to work? Where is the code? It'a all in the cake

still forum
#

conversation from an hour ago

#

he took some script. Implemented it incorrectly and then started ripping things out till it doesn't error anymore

winter rose
#

contact the author maybe?

#

maybe the variables were useful, after all

still forum
#

Should I repost my metaphor?
A car with a broken motor doesn't work better if you take the motor out

#

"Okey so... My motor is not broken anymore. But the car doesn't move now"

errant jasper
#

Alternative for entities "All" ? It does not capture a sphere object.

still forum
#

nearObjects maybe

tender root
#

@still forum the eyepos moves when leaning. That isn't the problem. The problem is, that the player doesn't stand completely straight.

still forum
#

well. Use some threshold then ^^

errant jasper
#

Thanks. nearEntities does not work either, but nearObjects does.

tender root
#

There is no room for threshold ^^

#

Weapon up + no lean = ~25ยฐ
Weapon up + left lean = ~25ยฐ (but in other direction)

still forum
#

Easy idea. Check if Z from feet->eyes is big enough to get rid of player laying down.

#

then measure the distance in 2D ignoring the z so you get the distance head->feet.

#

at that point you should be able to get a sufficient threshold

tender root
#

Yeah laying down isn't the problem you can just eliminate that by stance player

#

That was the idea but I didn't get that to work sadly...

#

Try if you like ๐Ÿ˜ƒ I didn't work out for me

still forum
#

how big is the 2D distance leaning vs not leaning

tender root
#

I don't know exactly but wait one second

#

Let me try to show you ^^

gleaming oyster
#

Tick. Okay, where is me rezultz

still forum
#

your 25ยฐ doesn't sound that right. If standing up the head shouldn't be thaat far away

#

maybe the positions are not exact enough

tender root
#

normal stance:

#

20-25ยฐ depending on how much you look up and if you're in the upper / lower stance

#

same for normal stance + leaning left

#

22-27ยฐ

still forum
#

sounds like you are taking forward/backward into account

tender root
#

so overlapping

still forum
#

I'll start arma ^^

tender root
#

One other thing: When you look up (ergo lean back), so that your head is behind the body the whole system fails anyway ๐Ÿ˜ญ

harsh pike
#

@tough abyss You snippets and description of what you're asking for look and sound exactly like Asylum Life's phone system

#

You shouldn't steal other peoples code and call it your own

still forum
#

Oh wow interesting

#

He sent me the files in PM and one of them had the header about who is the author

#

he edited that to a version without the author so I cannot look at it anymore

#

and his answer to "ask the author for help" was "I have permission" which seemed suspicious anyway

#

@tough abyss We don't support thieves here. You are free to go elsewhere to get help.

#

The author of the files is John "Paratus" VanderZwet

harsh pike
#

Only way of contact him is donating a large sum of money to a failing game

subtle ginkgo
#

Lmao

#

Thats the asylum owner

#

Paratus is

#

And there is no way you got permission

harsh pike
#

I highly doubt he even contacted you unless you donated to Identity

still forum
#

@tough abyss don't spam please.

#

What?

#

@graceful pewter then

#

Wow. even PM spam ๐Ÿ˜„

harsh pike
#

Sounds like one of those Indian scammers after you call him a scammer

graceful pewter
#

some people

winter dune
#

should I use BIS_fnc_createSimpleObjects or just createSimpleObject but providing the path?

#

if I need to create a simpleObject via script

still forum
#

if you can use createSimpleObject and it does what you need then use that

winter dune
#

ok

#

I thought that spawning 1000 simple objects would be less pain in the ass if I know only the classname

open vigil
#

I was driving....

subtle ginkgo
#

Does bohemia own this discord?

open vigil
#

For all intents and purposes, yes.

gleaming oyster
#

๐Ÿš™ ๐Ÿ’จ

astral tendon
#

Does killing a unit with setCaptive true will count as killing civilian and can send the killer to the enemy side?

gleaming oyster
#

@astral tendon I doubt it. It's probably some AI brain flag and probably has nothing to do with sides

astral tendon
#

Is there also other command that makes the AI avoid fire at the enemy besides have to do changes to the shooter AI like captive does?

gleaming oyster
#

setFriendly ?

astral tendon
#

well, that is to the hole side

#

though, any way to set the unit side in mid game?

gleaming oyster
#

could have the unit join a group of N enemy

astral tendon
#

does not really seens to work, if i create a Opfour unit in my group my team still shoots at him

#
_unit = group player createUnit ["O_G_Soldier_F", position player, [], 0, "FORM"];
meager heart
#

๐Ÿค”

late gull
#

@astral tendon dude u need set the side, does not matter the group

astral tendon
#

how?

gleaming oyster
#

dude. bro man. dwoowed

hollow thistle
#

Have you tried to first create unit and then joinSilent (or join) it to your group?

#

@astral tendon

_grp = createGroup [WEST, true];
_unit = _grp createUnit ["O_G_Soldier_F", position player, [], 0, "FORM"];
[_unit] join _grp;
#

You need to join unit to group after creating it. (despite passing the group in createUnit)

#

If i refer to global variable multiple times in called function will putting it in private make the script faster? Private scope is "closer" isnt it?

still forum
#

yes

#

only worth if you are optimizing for microseconds. which you probably don't have to do

hollow thistle
#

Assigning it to private will help readability and in potential refactoring so I will do it anyway ๐Ÿ˜‰

#

Thanks!

still forum
#

scopes for local variables are walked upwards from current scope till it's found or the end

#

I think.. Global variables might also do that. as there are local variables without _

jade imp
#

when it says a script will be run locally, does that mean on the PC that activated it? or on the server

still forum
#

first one

#

the server is in most cases not local.

#

local means where you are. So unless you are the server it's not local

jade imp
#

so, if I was making an action, 'local' would be considered the person who activated it?

winter rose
#

An action executes locally. If you want all players to see the action, be sure to addAction locally on all players first

jade imp
#

I'm trying to make a button in the game that strips all the gear from every player, and teleports them to a given spot

#

is it possible to even do that?

winter rose
#

Everything is possible ยฎ

meager heart
#

Your imagination is the only one limit ยฉ

#

Second one is SQF ยฉ

winter rose
#

^ (and hehehe)

hollow thistle
#

@jade imp read about remoteExec/remoteExecCall on wiki.

#

.
Debugger window performance "benchmark" gives these results:

[[player], {hint str _this select 0}] remoteExec ["call", 0]; // 0.0036ms
[player] call {hint str _this select 0}; // 0.0144ms

I guess it is due to remoteExec just "delegating" function to be executed and not waiting for result?

jade imp
#

if (_faction = "BLU_F") then { player setPos (6138.897, 16279.87, 0) } else { player setPos (6373.256, 16250.704, 0) };```
#

this is what ive got going for the teleport part

robust hollow
#

_faction == "BLU_F"
setpos [x,y,z] not setpos (x,y,z)

jade imp
#

ok

#

thanks ๐Ÿ˜›

#

that worked ๐Ÿ˜›

astral tendon
robust hollow
#

look at the color attribute in the class?

#

pictureColor

tall dock
#

if I want to make the following if-statement work in sqf, how do I need to set the curly brackets? if ((somevar == 1) && (something || somethingElse)) then {xxx};
I know that you need to use something like if(this && {that && {anotherThing}}) ... but how does it work with an OR statement thats in combination with an AND ?

astral tendon
#

pictureColor[] = {};

meager heart
#

@tall dock

tall dock
#

Oh nice, thank you very much

late gull
#

yup guys

#

can anyone explaind me/link me, how a addon works?

#

i mean

#

when you create you own addon for server side @myaddon

#

then config.cpp, pboprefix.txt and so

#

i been trying to search in google, but no lucky for me, maybe i can't find the correct query

still forum
#

@astral tendon is that logo paa format?

gray thistle
#

Alright big Question i just found out about

get3DENEntityID

is it possible to trigger scripts when opening the Eden editor? To give each object a unique ID this way?
Or to give the ID into the Campaign? Because those ids are definatly unique and won't change since i looked into the mission.sqm which stores the values

cosmic lichen
#

They are set automatically and are used by Eden only so far I know.

gray thistle
#

Alright are there actions which can give those into a mission? also are there Eventscripts like init.sqf for eden too?

#

I am searching right now but can't find the informations i need just the commands

cosmic lichen
#

There is likely everything you need to no.

gray thistle
#

Okay then i am at the same point then before with the search...

cosmic lichen
#

You said you are looking for commands and actions

#

They are all there

quasi rover
#

Color Format: [r, g, b, a] where a is alpha(opacity) and range from 0 to 1.
what if alpha has minus value e.g. -50 ?

cosmic lichen
gray thistle
#

Okay the top line was the most important so there are no init scripts and you can not keep the values

cosmic lichen
#

@quasi rover It will be set to 0 I assume

#

@gray thistle You could store the values via an attribute and exec setVariable at mission start

winter rose
#

@gray thistle see also the config part

gray thistle
#

hm maybe i am able to set something up which works just as

get3denEntityID 

to get my object ID set.
or espacially https://puu.sh/ArnLQ.jpg this id which is the same

quasi rover
#

thx, R3vo

cosmic lichen
#

Can't you work with variable names? I have worked alot with Eden but can't think of a reason why one would need the eden ID during mission.

gray thistle
#

well target is a Database with possible option to add editor objects.

#

The thing is the objects itself are able to change the value if you get the object itself [ 57f02040# -->1675328 <--: truck_02_box_f.p3d] with map changes. The mission.sqm has those values i would need. Those won't change because those are the auto increment values of eden placed objects

#

The object i posted gets is id in relation to the world objects so it would change if the Terrain gets changed example: one tree is added or removed.

cosmic lichen
#

I see.

gray thistle
winter rose
gray thistle
#

I can try to extract it but this is a shot in the blue still thanks

winter rose
#

oh!
BIS_fnc_objectFromNetId

#

โ†‘ @gray thistle

gray thistle
#

If i remember right those change for each mission load

winter rose
#

โ€ฆor parse mission.sqm :3 (j/k, don't do it)

gray thistle
#

this is something i was able too but i don't know how i refer to the object in a script which works a 100% at any time

still forum
#

you won't get around setting some variable out of Eden

#

you can run a script in eden that collects all of these EntityID's and then creates a hash map of entityID->object and stores that in a variable.. I guess.
Don't actually know if you can store the object inside of eden and have it still work ingame...

gray thistle
#

I am not sure if you are able to modify the loading of a mission to set an Variable from the mission.sqm like ace is doing it. They can get their vars from the mission sqm.

#

Sadly nil to none experience

late gull
#

guys, where is the correct place to execute these:

BIS_fnc_addRespawnInventory // initServer
BIS_fnc_addRespawnPosition // initServer
BIS_fnc_moduleRespawnVehicle // initPlayerLocal
BIS_fnc_arsenal // ?
BIS_fnc_garage // ?
#

InitPlayerLocal?

still forum
#

wherever you want to. The last one is twice btw

#

the first 3 could be placed in initPlayerLocal yeah.

#

arsenal.. Depends on what the arguments are

late gull
#

so initServer

still forum
#

yeah

late gull
#

the thing it's, i was executing all in initServer

#

when i join i have the respawn working

#

but not for other players

still forum
late gull
#

i'm using missionNamespace

#

so everyone should get it

#

but will siwtch to west, since players are only west

#

BIS_fnc_addRespawnPosition it's also global

inner swallow
#

I didn't read through the whole thing but:
If you are local hosting, and you have the thing but other people do not, then that is as expected

#

Use initPlayerLocal, maybe?

#

That should guarantee that the code runs for them after they have loaded in/been initialized

late gull
#

bue by example BIS_fnc_addRespawnPosition it's global

#

so the respawn positions will overload every time a player join the server

#

?

#

since they are broadcasted to every client

inner swallow
#

Yeah that's true

#

Interesting

late gull
#

and i'm running dedicated

inner swallow
#

I don't know know how mission namespace is handled for people who haven't joined yet ๐Ÿค”

late gull
#

does that take my client like a server?

inner swallow
#

No

late gull
#

so, point back to: why i get it and other players wont

inner swallow
#

If it works for you, it should work for others I think

late gull
#

and next one

#

i fixed it temporally restarting the server with other players online

#

then they get the spawn menu

#

but they are like error no unit ๐Ÿคท

inner swallow
#

Really weird. All I can think of is that it's a timing issue.

#

Try this maybe

#

Get everyone to connect

#

And execute it from console

#

See what happens then

late gull
#

hmm

#

what about the last 3 functions, bohemia wiki does not have info about locallity

inner swallow
#

Arsenal and garage should be local

late gull
#

oki

#

i will assume module respawn it's global

#

since the respawnable vehicle it's owned by server at start

spark sun
#

Hello, why the emptyPositions "cargo" return 10 for the "O_G_Van_02_vehicle_F" when there is no place (intended: 0) ?

winter rose
#

Maybe 10 possible, as you can animate it and set the seat in the rear space

#

Same should apply on the MH-6 with no back bench too

still forum
#

They probably just copied the model from the one with seats and just left the seat points in there

spark sun
#

Even the BIS_fnc_spawnCrew fail:

private _veh = createVehicle ["O_G_Van_02_vehicle_F", [23098.7,17351.4,0.00143886], [], 0, "FLY"];

private _units = [_veh, _group, false, "", "O_G_Soldier_F"] call BIS_fnc_spawnCrew;```
still forum
#

what "fail"?

spark sun
#

Create 5 crerw when only two are necessary if I am not wrong

still forum
#

what happens with the rest? Do they just stand around?

spark sun
#

yes

still forum
spark sun
#

god dam ...

late gull
#

so yes, i'm still with the respawn menu issue

#

this is RPT client side, no errors in server side

late gull
#

ok, it seems only to work in init.sqf

errant jasper
#

The RPT suggests bad usage of the respawn API.

late gull
#

yes, already fixed

#

just using it in init.sqf

#

otherwise wont work

inner swallow
#

that would suggest that either it's not effect global, or it's an initialisation issue

sand pivot
#

basically, the functionality that pressing [F] or [CTRL]+[F] gives zeus

verbal otter
#

hello, is possible to createTrigger on server?

still forum
#

yes

verbal otter
#

thank you, Dedmen!

sand pivot
#

i'm assuming i'm going to just need to set position, target, offset, etc. of curatorCamera

velvet merlin
#

is it known under what circumstances cursorObject cannot pick up a terrain object?

#

maybe bugged or missing geo LOD, or another?

winter dune
#
if (
    (player getVariable ["firstVariable",false] ||
    (player getVariable ["secondVariable",false] || 
    (player getVariable ["thirdVariable",false] ||
    (player getVariable ["fourthVariable",false] ||
    (player getVariable ["fifthVariable",false] ||
    (player getVariable ["sixthVariable",false] ||
) then { /*Do stuff*/ };

If I have this IF right here, is there a way to write it better?

#

lazy eval?

dusk sage
#

Lazy eval would be one way, yeah

#

Question more is, why on earth are you checking 6 variables at once

winter dune
#

random stuff in my head

still forum
#
if (["first","second","third","fourth"] findIf {player getVariable [_x, false]} != -1) then {
#

there

rancid pecan
#

hello, how to create buttonmenu without diaglog

#

dialog

winter dune
#

@still forum I'll check that out thanks both

dusk sage
#

Not sure if you're seriously going to accept that as 'better'

still forum
#

it is better

unborn ether
#

@rancid pecan You cant do that. But you can use display, such as findDisplay 46

dusk sage
#

Maybe that's subjective then

still forum
#

it's more compact and has lazy eval builtin

winter dune
#

maybe nested ifs should be another solution?

hollow thistle
#

pls no.

dusk sage
#

Taking a shit and wrapping it in a blanket of shit

winter dune
#

๐Ÿ˜ƒ

dusk sage
#

I think you need to define what you mean by better, does that mean performance, readability/look?

still forum
#

Or do you seriously prefer

if (
    (player getVariable ["firstVariable",false] ||
    {(player getVariable ["secondVariable",false]) || 
    {(player getVariable ["thirdVariable",false]) ||
    {(player getVariable ["fourthVariable",false]) ||
    {(player getVariable ["fifthVariable",false]) ||
    {(player getVariable ["sixthVariable",false]}}}}
) then { /*Do stuff*/ };

?

winter dune
#

both performance and readability

hollow thistle
#

Well we don't have whole context why he needs to check six variables.

unborn ether
#

Thatas not the best way of evaluating anyways.

winter dune
#

it's inhuman reading that bunch of code

dusk sage
#

I'd prefer not checking 6 variables at once, but performance vs readability differ quite a lot here ๐Ÿ˜ƒ

unborn ether
#

Kinda better ways of doing that with some kind of modes .

hollow thistle
#

What Dedmen posted has answered his question and will lazy eval.

still forum
#

My solution is IMO better to read

#

"If any of these variables is true"

dusk sage
#

It's less readable than what he initially wrote

unborn ether
#
switch (player getVariable ['someModeVar',-1]) do {
...
}:
dusk sage
#

Oh dear

digital jacinth
#

I am having issues rotating a particle source. I have created a trigger which i am rotating 30ยฐ and want the particles to be in that area. So I set the angle within the setParticleParams, yet the area of the particles is not rotated.
Any idea how to do that? I also tried rotating the particle source itself, yet it does not work. I set the particle area I want with setParticleRandom and the rnadom position value.

winter dune
#

hmm, interesting

hollow thistle
#

Lazy eval is slower if every variable will be false in this case.

#

If first var will be true it will stop evaluating other variables so is should be faster with it in this case.

#

Lazy eval in if will not magically make your code faster.

winter dune
#

๐Ÿ‘Œ

hollow thistle
#

Also:

//0.0032 ms
[true, false, false, false, false, false] findIf {_x} != -1
// 0.0059 ms
[false, false, false, false, false, true] findIf {_x} != -1
dusk sage
#

We can ignore when testing that I used mission namespace set variables

#

Still holds in a few cases though

hollow thistle
#

And you are right it should propably be used when getting of value is more expensive.

#

just true and false is not the best to test this.

gleaming cedar
#

How to delete objects in a small radius like 10?

#

I mean map objects

#

{deleteVehicle _x} forEach nearestObjects [this, ["all"], 20]

#

I tried this

#

Anyone?

digital hollow
#

Map objects are nearestTerrainObjects

gleaming cedar
#

Ok thanks

#

Still doesnt work

#

I put it in a trigger

#

And set it to true

#

This hurts my brain why do I suck omg

#

{deleteVehicle _x} forEach nearestTerrainObjects [trigger1, ["all"], 20]

#

This is what I do

#

Doesnt work ๐Ÿ˜ฆ

hollow lantern
#

is it possible to disabler AI chatter on a server without a addon?

unborn ether
#

@hollow lantern You can use setSpeaker to set it to "NoVoice" if talking about actual talking.

cold pebble
#

@gleaming cedar โ€œallโ€ is your issue

gleaming cedar
#

i got it

#

i changed it ๐Ÿ˜„

cold pebble
#

If you want all terrain objects leave the array blank

gleaming cedar
#

if (isServer) then
{
{
_x hideObjectGlobal true;
}
forEach nearestTerrainObjects
[
[12795.4,4776.25,0],
[],
50,
false
];
};

#

I use this in console

little eagle
#

This chat is horrible now.

unborn ether
#

bulli

outer fjord
#

How do I add the cage armor to a tank via script?

#
    ["showTools",1,"showCamonetHull",0,"showBags",1,"showSLATHull",1]
] call BIS_fnc_initVehicle;``` I snagged this from the vehicle garage, but It didn't seem to work on spawn.
hollow lantern
#

@unborn ether Yes but I don't want to do this on every placed unit. ;)

unborn ether
#

@hollow lantern enableRadio then

meager heart
#
cursorTarget animateSource ["showslathull", 1, 1];
outer fjord
#

sweet it worked, last question.

#

How do I combine multiple things into one line. Instead of say declaring this SetObject; this SetTexture;. Ect

#

case "I_LT_01_scout_F": {_vehicle animateSource ["showslathull", 1, 1]; setObjectTexture [0, "A3\armor_f_tank\lt_01\data\lt_01_main_olive_co.paa"]; setObjectTexture [1, "A3\armor_f_tank\lt_01\data\lt_01_radar_olive_co.paa"];};

little eagle
#

How do I combine multiple things into one line
You don't. Line breaks are good for making your code readable.

outer fjord
#

I met so I don't have to declare the intended target of the script each time

little eagle
#

uhm

outer fjord
#

So I do have to say, _Vehicle for each chunk

little eagle
#

forEach?

outer fjord
#

You know like how people do basic edits in the inti box. It will be like
This SetObject
This SetTexture
ect

little eagle
#

Yes.

outer fjord
#

So I would just put that after _Vehicle?

little eagle
#

Put what after vehicle?

#

Sorry I am trying.

#

I think I get it, but you can't do that.

case "I_LT_01_scout_F": {
    _vehicle animateSource ["showslathull", 1, 1];
    _vehicle setObjectTexture [0, "A3\armor_f_tank\lt_01\data\lt_01_main_olive_co.paa"];
    _vehicle setObjectTexture [1, "A3\armor_f_tank\lt_01\data\lt_01_radar_olive_co.paa"];
};

This is how you will have to write it.

outer fjord
#

Ah, so no other way. Got it.

meager heart
#

"combine multiple things into one line" ๐Ÿค”

unborn ether
#

How is it possible that Arma doesn't react to arrowkeys even if ScrLk is off?

#

yeah that happens when you block them in KeyDown.. shiet ๐Ÿ˜„

fiery lynx
#

Is there a way to just do vehicles and not characters in this script "0 = [5,"vehicles"] spawn BIS_fnc_exportEditorPreviews;"

dry owl
#
class CfgCustomFunctions {
    class custom1 {
        type = 1;    // just execute
        name = "Zombie Shield";
        code = "[] execVM 'custom_functions\zombie_shield.sqf'";
#

Is the syntax correct as far as " & '

little eagle
#

CfgCustomFunctions does not exist in the game. If this is from a mod or mission, then no one here knows if it is correct, so ask the authors of that mod or mission.

dry owl
#

its infistar, im just checking for the formatting ๐Ÿ˜„

little eagle
#

It is missing the closing brackets in any case.

#

Otherwise it is correct as far as syntax goes.

dry owl
#

okie ill try it out ty

digital jacinth
#

Is there a way to make particles that are defined in script unaffected by wind AND gravity? I already made the particles unaffected by wind, tho they still either fall or fly up. I kind of need them to stay exactly where they spawned.

still forum
#

@digital jacinth you can configure the particle weight. I guess a weight of 0 means no gravity

digital jacinth
#

hm. I can try, tho to my experience everything under 9.8 will just fly upwards. It is weird and confusing.

#

So far I made a binary search for the correct weight, so they stay kind of in place. but that result gave me the issue of having a float with many decimals and i thought that there must be a better way.

lone glade
#

everything under 9.8 will just fly upwards.
oh gee I wonder why

digital jacinth
#

I take it, because that is the gravital acceleration

#

but still it is weird to call that parameter "weight"

lone glade
#

so why call it "weird and confusing"?

digital jacinth
#

because everyone over 0 weight normally falls down in real life?

lone glade
#

considering how old some of those config entries are ....

still forum
#

then set it to the gravity constant and it shouldn't move ^^

digital jacinth
#

and so far I am at weight 10.001354865 etc and they kind of do not move up or down

still forum
#

9.80665

digital jacinth
#

that is why I said confusing

#

if it just were teh gravital constant then no biggie

#

this I thought there must be a better way then trial and error until you have a kind of right value

cold pebble
#

Can I use attachTo on terrain objects?

winter rose
#

I would say so yes

cold pebble
#

Then my next question, anyone know why it might not be working? ๐Ÿ˜„

winter rose
#

show me your script, mortal!

cold pebble
#
params [
    ["_time",0,[0]],
    ["_wall",objNull,[objNull]]
];

private _bomb = createVehicle ["DemoCharge_Remote_Ammo_Scripted",[0,0,0],[],0,"CAN_COLLIDE"];
_bomb attachTo [_wall,[1,0.8,2.2]];
_bomb setVectorDirAndUp [[0,0,-1],[0,1,0]];
#

it just stays at 0,0,0

#

And turns a bit ๐Ÿ˜„

winter rose
#

what does stay at [0,0,0] and turns?

cold pebble
#

DemoCharge_Remote_Ammo_Scripted

winter rose
#

did you check that _wall isn't objNull?

cold pebble
#

Yup

#

It comes from cursorObject, and cursorObject correctly returns the wall when checked in watch field

winter rose
#

[0,0,0] from map, not [0,0,0] from object?

cold pebble
#

Yeah on map

winter rose
#

hm, funny

#

I would try butโ€ฆ my home computer is off ๐Ÿ˜„

cold pebble
#

๐Ÿ˜„

#

This just results in lots of bombs at co-ords 0,0,0 ๐Ÿ˜„

compact maple
#

Iโ€™d try to attach it first, then when itโ€™s working, adding the setVector

cold pebble
#

Werid thing, it works when I spawn it in editor, just not on terrain ๐Ÿ˜ฆ

meager heart
#

cough lineIntersectsSurfaces cough

young current
#

nevermind read it wrong

cold pebble
#

So yeah defo not returning objNull

#

diag_log'ing the _wall returns the correct p3d's

marble basalt
#

hello was wondering how one would playSound3D when they open their gear

young current
#

tie it to evenhandler

cold pebble
#

onInventoryOpened eventhandler

young current
#

just needs some sick beat and we got ourselves a song

marble basalt
#

tried but not working am i missing something if (!isServer) exitWith {};

player addEventHandler ["InventoryOpened", {
playSound3D ["bagzip.wav", player],
;

cold pebble
#

Is that it? :L

marble basalt
#

just trying to do something simple

cold pebble
#

so the semicolon should be where the comma is, the comma shouldn't be there

digital jacinth
#

playsound3d requires full path or addon path to a sound file

cold pebble
#

Then you haven't closed the curly braces

#

Haven't closed the square brackets

marble basalt
#

ok

cold pebble
#

And also, as diwako said

marble basalt
#

what if its in the mission file

cold pebble
#

path relative to the mission

marble basalt
#

ok

cold pebble
#

Interestingly, it literally mentions that in one of the comments

digital jacinth
#

be careful if you want to use this example on a dedicated server. Its missionConfigFile cannot really be used determine the mission root folder.

marble basalt
#

i plan to how would i call it then, would i need to make a addon folder for it?

#

i plan to make a custom addon for the server anyways but be nice to pull from mission dir

digital jacinth
#

it is a lot easier to get them to play from an addon.

#

as the dir is the same for client and server

marble basalt
#

ok so might do that then

#

also when i run the script atm im getting error 1 elements provided expected 2

digital jacinth
#

it is possible to play the sounds form mission root as well but it is a bit hacky

#

can you provide the whole script so we can see what you see?

#

or rather the snippet

marble basalt
#

if (!isServer) exitWith {};

player addEventHandler ["InventoryOpened"]; {
playSound3D ["Arma 3\missions\sounds.Stratis\bagzip.wav", player, false, getPosASL player, 1, 1, 10]};

#

still early on in learning arma codeing

#

any errors you can see?

unborn ether
#

First error is no SQF markup

sand pivot
#

should be...

 player addEventHandler ["InventoryOpened", {playSound3D ["Arma 3\missions\sounds.Stratis\bagzip.wav", player, false, getPosASL player, 1, 1, 10]};

the error i see is the ]; before the code block @marble basalt

#

does anyone know the functions/scripts/addons that control the vehicle damage indicators? i'd like to tap into that logic to make my own dashboard. I've been looking in ui_f to no avail.

still forum
#

probably hardcoded I'd say

#

but you can just use getHitpointDamage

tough abyss
#

Hey guys

#

how customizable is the combat patrol module?

sand pivot
#

yea, i was trying to simplify and avoid filtering only hitpoints i want

tough abyss
#

I mean is it possible to kinda change the way it works?

#

let's say for example

winter rose
tough abyss
#

it wouldn't end the mission once the objective is done

#

not yet, thanks, i check it

#

Well it doesn't mention anything like that it seems

winter rose
#

I hoped it had more links

tough abyss
#

so it might be not possible?

meager heart
winter rose
#

sorry, butโ€ฆ how?

tough abyss
#

Guys in that case

#

do you know any good mission generator modules?

winter rose
tough abyss
#

I would be looking for something simpler like the MCC but a working version instead

#

or have they fixed MCC yet?

#

some missions it generated were impossible to complete

winter rose
#

don't know then (maybe others here do)

tough abyss
#

What would be the best place to ask about that here?

winter rose
#

โ•ฎ(โ•ฏ_โ•ฐ-)โ•ญ

meager heart
#

sorry, butโ€ฆ how?
i'd like to tap into that logic to make my own dashboard
like that _vehicle getSoundController "rpm"; ๐Ÿ˜€
@winter rose

winter rose
#

@meager heart

does anyone know the functions/scripts/addons that control the vehicle damage indicators

hence the question ^^

meager heart
#

ok... and ?... nvm

tough abyss
#

also

#

are there any experienced arma modders arround here?

winter rose
#

@meager heart I don't see the link between vehicle damage indicator and getSoundController?

still forum
#

@meager heart wtf? "I want to make a custom hud to display vehicle damage" "Here is info about environmental sound controllers for you"

#

๐Ÿ˜„

#

There is none. you could use rpm for speed. but you can also just use speed for speed

meager heart
#

lol

#

you sure ?

winter rose
#

please, someone explain - I'm lost here! ๐Ÿ˜„

meager heart
#

he was asking about anything helpful for his "dashboard" for the "vehicles"... right ? ๐Ÿ˜€

#
does anyone know the functions/scripts/addons that control the vehicle damage indicators? i'd like to tap into that logic to make my own dashboard. I've been looking in ui_f to no avail.
#

he kinda looking for....

#

something

winter rose
#

โ€ฆUI damage logic?

still forum
#

control the vehicle damage indicators He asked about what controls the damage indicators ^^ Very specifically.

unborn ether
#

He probably means the vehicle IGUI that is to the left top by default.

#

But i don't get why would you control that?

still forum
#

He doesn't want to control it.

#

Seems like no one can read properly today ๐Ÿ˜„

unborn ether
#

@sand pivot anyways its just easier to change that

showHUD[] = {
    true,    // Scripted HUD (same as showHUD command)
    true,    // Vehicle + soldier info
    false,    // Vehicle radar [HIDDEN]
    false,    // Vehicle compass [HIDDEN]
    true,    // Tank direction indicator
    false,    // Commanding menu
    false,    // Group Bar
    true,    // HUD Weapon Cursors
    true    // HUD Squad Radar
};

in description.ext and script your own GUI, since there is some kinky shit around RscUnitInfo where vehicle panel is a different controls for cars, tanks and helicopters sometimes and you can just hide them away properly without making a while loop.

#

@still forum I've been looking in ui_f to no avail. means he is seeking for UI data and ^ is pretty correct

still forum
#

That is exactly what he is trying to do @unborn ether

unborn ether
#

Oh sorry then

still forum
#

i'd like to tap into that logic to make my own dashboard He wants to know how to get the information that the old one displays. And replace it

unborn ether
#

Well as I said its really nasty, I don't know why but you can't even properly grab the zeroing control for example, its a different control everytime. AFAIK the are 3 zeroing text controls, one for unit, one for vehicle and one for something like mortars (cant remember exactly). This goes mosly for everything... BIS.

winter rose
#

@meager heart โ€ฆ was it a play on words with a car dashboard?
If so, I am sorry but not being a native speaker, this one really flew over my head ๐Ÿ™ƒ

meager heart
#

there was car ? or vehicle ? ๐Ÿ˜„ (and no problem dude ๐Ÿ˜‰)

#

correct... was vehicle !!!11

unborn ether
#

noobs

#

๐Ÿ˜„

winter rose
#

mi no spik engrich

#

(correct me, I dare ya!)

still forum
#

me no speak english*

meager heart
#

semay hir... ๐Ÿ˜”

winter rose
#

y'ourโ€ฆ a ded man รจ_รฉ

cosmic lichen
#

Your*

#

๐Ÿ˜‰

meager heart
#

๐Ÿ™„

#

rage quit

winter rose
#

๐Ÿ˜„

cosmic lichen
#

@meager heart cya

meager heart
#

piss*

little eagle
#

๐Ÿ•

winter rose
#

pizza'n'love, bros

cold pebble
#

Dedmen, you got any idea why I wouldn't be able to attach an explosive charge to a wall (on the terrain) with attachTo? ๐Ÿค”

meager heart
#

was reference to "peace" btw... not pizza ๐Ÿ˜”

still forum
#

negative

cold pebble
#

So it should be possible? ๐Ÿ˜ฆ

still forum
#

ye

cold pebble
#

Damn ๐Ÿ˜„

#

It works if its down in the SQM :L

winter rose
#

try without any other script
like

player attachTo [cursorObject, [0,0,0]];
cold pebble
#

Aight I'll try that when I can get on ๐Ÿ˜ƒ

winter rose
#

@still forum any way to use sqf syntaxic coloration for Discord one-liners?

unborn ether
#

: mi no spik engrich ะฟะพะฝะธะผะฐัŽ, ะฑั‹ะฒะฐะตั‚.

#

๐Ÿ˜„

winter rose
#

huuuhโ€ฆ Priviet, wodka, dasvidania!

still forum
#

yes. Just don't do one-liners

winter rose
#

well, thanks for NOTHING

#

๐Ÿ˜„

still forum
#

nil

little eagle
#

bad chat

unborn ether
winter rose
#

Error: Any, expected String

little eagle
#

Error 167750984 elements provided, -1362697488 expected

unborn ether
#

Will 1/0 be NaN or nil in Arma?

little eagle
#

NaN with popup error

#

Well, the black box. Not the confirm error popup.

meager heart
#

Type: Number, expected: Number, not a Number the best imo

unborn ether
#

It could be nice to have RscMessageBox pop-up on 1/0 asking if you are retarded ๐Ÿ˜„

#

bullo

winter rose
#

@cold pebble update? ๐Ÿ™‚

half laurel
#

question - for best performance how would i check nearby for ammo box types? nearSupplies returns helmets and planes and all kinds of stuff

#

would it be nearestobject?

little eagle
#

How many ammo boxes are there on the map?

#

Do you have their exact clasnames?

#

I think either nearSupplies or nearObjects would be fine tbh.

half laurel
#

_list = _plane nearSupplies 30;
_list = (position _plane) nearObjects ["ReammoBox", 30];

#

replacing the former with the latter i guess

cold pebble
#

@winter rose haven't been able to test yet, when I do I'll say! ๐Ÿ˜ƒ

half laurel
#

it's for a plane rearm function looking for ammo boxes or ammo trucks on the map

winter rose
#

purrrfect ๐Ÿ˜บ

half laurel
#

so maybe

#

_list = nearestObjects [_plane, ["ReammoBox","Truck_F"], 30];

#

it doesn't run in a loop, just once on selecting an action

little eagle
#

Then it won't matter which command you use. Just make sure you detect everything and everything you detect is valid for your purposes.

half laurel
#

๐Ÿ‘

#

i can live wit hit just detecting any truck class

#

i'd sooner keep it to checking base classes

gleaming oyster
#

You doin scenario stuff now rob?

half laurel
#

forforward compatibility

#

im updating an old cockpit rearm script i released about 5 yearsago

gleaming oyster
#

Oh.

little eagle
#

Ouch, that must be painful to look at.

half laurel
#

adding it to unsung mod to make use of al ltheshiny new pylon presets

#

yeah tell me about it

#

it used t orun as a permanent loop added to each player ๐Ÿ˜ฆ

#

doing nearestobject checks in a constant loop o nevery player lol

gleaming oyster
#

Are there preloaded missions with unsung like you guys had loaded on the test servers?

half laurel
#

hehe

#

now it has a useraction in the plane that checks if youre the driver and the engine is off

#

and then you spawn a function to check the locality for a supply, and then it reads the presets to a sideaction menu

#

i use removeallactions instead of needing to monitor loads of actionids

#

so its about 50 lines of code

winter rose
#

โ†‘ Zeus is onto you

half laurel
#

well i had to learn somehow

#

we had so many loops running in unsung back i narma 2

little eagle
#

Love it when you rewrite a script and it ends up being half as long with twice the features.

half laurel
#

i remember airplanes had init EH's running perma loops even if nobody was in them

#

stick 30 planes on your runway and fps -->0

winter rose
#

@still forum ๐Ÿ”จ plz

digital hollow
#

They should make a show like Fear Factor but it's ReFactor, where devs overcome the horror of their old code.

half laurel
#

jesus yeah

little eagle
#

Nieche audience .

half laurel
#

it's why i didnt import my bayonet and melee stuff yet

#

that was a massive spiralling set of nested loops running on every player. and i think i did it as an initEH so it ran on every player, increasing the number of loops with EVERY JIP

cold pebble
#

@winter rose nothing ๐Ÿ˜ฆ

winter rose
#

=\

half laurel
#

game --> soup

cold pebble
#

I can attach myself to SQM spawned one though

little eagle
#

Endless loops

half laurel
#

i'm a shitty programmer, but i try. i tend to let TeTeT sort out my pseudo code

gleaming oyster
#
while{true} do 
{
    if(true) then
    {
        _spagetCode = true;
    };
};
still forum
#

spaghet

gleaming oyster
#

Shiet, and you're the German here Ded.

cosmic lichen
#

German Oo

gleaming oyster
#

โ—‹โ€ขโ—‹

half laurel
#

if (A) && (B) && (C) && (D) && (E) && !(F) && (G) && (H) && (I) || (J) || (K) && (L) && (M) then {hint "serverdeath"};

#

that was more like my old stuff - checks like that in a perma loop

gleaming oyster
#

Pls no rob. This actually looks like something would write

cosmic lichen
#

All that life time wasted for that piece of code

gleaming oyster
#

But how much does Rob value that time is the question

#

was it worth it?

half laurel
#

"but it works great in the editor. must be the server hardware..."

little eagle
#

if (A) && (B)

#

Error &&; type IF expected BOOL

gleaming oyster
#

Heh. Wow.

cosmic lichen
#

Just run it in a loop the error will disappear when the server crashes

gleaming oyster
#
if(A && B)
still forum
#

you sure? && has higher precendence than some other things

little eagle
#

if is unary, it has higher precendence than all binary commands.

#

And no, && has lower precedence than "normal" binary command. || is below that. >> is too.

still forum
#

oh.

#

confusing

little eagle
#

But not the bulk.

winter rose
#

so could we do

if alive player then {}```
?
little eagle
#

Yes.

gleaming oyster
#

When you say it has higher or lower precedence than another operator what does that mean exactly?

little eagle
#

unary unary nullary binary
->
(unary(unary(nullary))) binary ()

half laurel
#

i was being lazy. i always put my conditions inside brackets to be safe

cosmic lichen
little eagle
#

if should always use parenthesis, same for switch... Just a style question.

half laurel
#

but these days i tend to use nested conditions to reduce redundant checks

cosmic lichen
#

@half laurel If it improves legibility it's not a bad idea

half laurel
#

though how t odo that and use else is a littletricky to work out sometimes

gleaming oyster
#
switch _var do {}; //bad style?
switch (_var) do {}; //good style?
half laurel
#

it's abouttime i opened up my evo missions and removed the hideous infini-loops

#

still a lot in there

little eagle
#

Yes, imo, mudnut.

half laurel
#

like respawn monitoring on maybe 50 vehicles

#

can just use the respawn module now

cosmic lichen
#

@gleaming oyster I think so, too

half laurel
#

but not enough hours in the day

gleaming oyster
#

Hmm. Alright, fair.

#

Is respawn module just as fkd as the vehicle respawn module?

meager heart
#

someone said was duplicating markers and if position is added on object (unit) and unit in some building/construction, was some weirdness

#

so in short yes

gleaming oyster
#

This kind of crap just makes me want to write my own solution. I don't like inconsistencies. I had this problem with apex release where the respawn markers would move to [0,0,0] or they would move to a random player position. (like you speak above)

meager heart
#

afaik bis_fnc_addRespawnPosition works...

#

just script it

#

without those modules

cold pebble
#

@winter rose I think you just can't attachTo any terrain objects now :L

gleaming oyster
#

the module fncs are the ones that are fckd. But yeah, addRespawnPosition seems to work reliably

winter rose
#

@cold pebble it might very well be possible! check houses though

cold pebble
#

I tried it on loads of random things at Kamino firing range

#

I'll try just on normal houses in a bit ๐Ÿ˜ƒ

digital hollow
#

I recall not being able to attach stuff to houses or walls to make a breaching charge stick. I made an extra wire loop object which didn't care about physics and attached the charge to that.

cold pebble
#

Damn

#

Thats basically what I'm wanting to do ๐Ÿ˜„

winter rose
#

you could get house model and switch on it and setPos getRelPos the charge

#

(I have a script like that to populate homes on Tanoa ๐Ÿ‘€ )

cold pebble
#

Well its walls I wanna blow up ๐Ÿ˜„

winter rose
#

you still can :p
buildingExit or something, add 1 meter to Z, then setpos and BOOM ๐Ÿ˜„

cold pebble
#

then im dead ๐Ÿ˜„

#

didn't sleep

#

๐Ÿ˜›

winter rose
#

are ya a wall ๐Ÿ‘€

cold pebble
#

exposed

#

Well

#

its a shame we can't attachto terrain objects

#

but whatever d00d

#

Workarounds begin ๐Ÿ˜›

winter rose
#

\o/

#

usually the best/worst part!

cold pebble
#

๐Ÿ˜„

hollow thistle
#

Is there a way to #include file from mission root?

#

As far as i understand it is only possible in addons?

still forum
#

from mission yes

#

from addon no

gleaming oyster
#

@hollow thistle Yep.

//if your current script is in /script/blah  say
#include "../blah.h"
#

blah.h would be in the lowest of mission root

#

But if you are including something say in your description.ext no need for the ../

hollow thistle
#

I know i can go upwards

gleaming oyster
#

just /blah/blah

hollow thistle
#

But with multiple nests it would be tedious.

gleaming oyster
#

#include "blah/blah/blah.h"

#

Not really

#

Backwards would be my first examppe

hollow thistle
#

so lets say i have:

#
Missionframework/
โ”œโ”€โ”€ defines.hpp
โ””โ”€โ”€ modules/
    โ””โ”€โ”€ 01_core/
        โ””โ”€โ”€ fnc/
            โ”œโ”€โ”€ fn_fnc1.sqf
            โ”œโ”€โ”€ fn_fnc2.sqf
            โ””โ”€โ”€ fn_fnc3.sqf
#

I want to use my defines.hpp in functions file.

#

Can i define include them without going upwards?

still forum
#

make a local include. Like ACE/CBA

#

that local include then includes the main one

#

So you only have a single include going upwards

gleaming oyster
#

^^^

hollow thistle
#

Ok so this answers my question. I hoped there is some var that denotes mission fs root like #include missionRoot/defines.hpp

#

Thanks for answers!

late gull
#

guys, i'm back again with my fails

#

๐Ÿ˜„

#

i'm trying to make work this trigger

// init.sqf
serviceVehicle = compile preprocessFileLineNumbers "scripts\serviceVehicle.sqf";

// initPlayerLocal.sqf
[] execVm "scripts\serviceTrg.sqf";

// scripts\serviceTrg.sqf
_trg = createTrigger ["EmptyDetector", (getPos vehicleServiceArea), false];
_trg  setTriggerArea [5, 5, 0, false, 1];
_trg setTriggerActivation ["ANYPLAYER", "PRESENT", true];
_trg setTriggerStatements ["this", "[]spawn serviceVehicle;", ""];
#

i know the trigger it's well created, it works if i use activation/deactivation hints

#

but wont call this script

#

it's maybe locallity again? i'm doing at initPlayerLocal

still forum
#

the trigger will trigger where it was created

#

if you create it on client in initPlayerLocal. It will fire on the client

#

are you sure that the serviceVehicle variable is defined properly?

late gull
#

i want it for player only, the vehicle owner

#

will reach it if is defined in init.sqf? it should huh?

still forum
#

ye

#

why are you specifying the trigger height to be 1m?

late gull
#

dont neet it bigger, it works

still forum
#

so the trigger works and fires? just the script doesn't get executed?

late gull
#

already tested with hints

#

yes

still forum
#

then I don't know. Everything looks correct

#

Wait. You edited the script snippet above. You are never creating the trigger

#

and the trigger statement creates the trigger itself as soon as it triggers. But it can't because you never create it

late gull
#

yes, in initPlayer

still forum
#

Not according to your script no.

late gull
#

ahh but that's a mistake type xD

still forum
#

๐Ÿคฆ

late gull
#

i just copy paste wrong, i'ts updated

still forum
#

Ah.. looks perfectly fine now. Should work

late gull
#

it's not xD

#

the mistake was writing here in discord

#

not in the script

still forum
#

the script that right now is right up there. Doesn't have any errors that I can spot

#

so as long as that is really what you are using then that's correct

#

might of course be that you typoed it again and typoed exactly what your error is and accidentally fixed it through the typo

late gull
#

no xD, told ya, was working with hints

dry egret
#

how do i pull out the path to group units

configfile >> "CfgGroups" >> "INDEP" >> "LOP_ISTS" >> "Infantry" >> "LOP_ISTS_Patrol_section"

i want to know how to do this for the default groups and units

late gull
#

i don't understand the question mate

#

what do you wanna do with that group?

dry egret
#

im trying to learn how to spawn groups of units and the way i want to do it is via the config path

late gull
#

ahh ok

#

there's a function from BI_fnc

#

sec

dry egret
#
    _grp1A = [getMarkerPos _markerAO, RESISTANCE, (configfile >> "CfgGroups" >> "INDEP" >> "LOP_ISTS" >> "Infantry" >> "LOP_ISTS_Patrol_section")] call BIS_fnc_spawnGroup;

thats the code im looking at and i want to know how to pull the stuff from bis units

late gull
#

ahh ok

#

go on editor

dry egret
#

learning by reverse engineering lol

#

k

late gull
#

editor > tools > config viewer

#

as you can see, there is a "path"

dry egret
#

configfile >> "CfgVehicles" >> "O_crew_F"

late gull
#

ignore configFile and follow rest of the path

astral tendon
#

Any tip for the HitPart event handle? i cant make it work in MP even with remote exec

[_this, ["HitPart",{}]] remoteExec ["addEventHandler", 0, true];
dry egret
#

looking at the CSAT for crewman

late gull
#

no, cfgGroups, since u are looking for groups

dry egret
#

ahh

late gull
#

follow the path

shadow sapphire
#

In SQF, how do you do plus/minus for like a random direction?

late gull
#

wut? don't understand the question again xD

dry egret
#

sweet man, thank you

late gull
#

np

shadow sapphire
#
_G2 addwaypoint [(leader (_G3) getpos [50, (getdir leader (_G3)) +/- 60]), 5];```
late gull
#

you want random between 0 and 60?

shadow sapphire
#

Between -60 and 60.

#

Between 300 and 60.

late gull
#
round(random( -60, 60 ))
#

never tested with -

#

random cannot use negative i guess

shadow sapphire
#

Okay. Will try that kind of thing.

late gull
#

so do another random and switch

#

to choose negative or positive number

#

but there should be something to work with negatives, but not in my knoledge

#

check the comment in the wiki

astral tendon
#

Any tip for the HitPart event handle? i cant make it work in MP even with remote exec

winter rose
#
round(random( -60, 60 )); // NO
round (-60 + random 120); // YES
shadow sapphire
#

Hmm... azimuths don't appear to actually do anything in BIS_fnc_spawnGroup

#

@winter rose, thanks! What's up? How ya been?

winter rose
#

fine thanks, and you? ^^ I'm still lurking around, as you see

late gull
#

you can spawn the group in 000 with damage dissabled, then set pos and enable damage

shadow sapphire
#

I'm well. Chipping away at some different things.

#
(_this getpos [2200,(_this (getdir (getmarkerpos "Origin") round (-60 + random 120)))])```

This doesn't look right...
late gull
#

get?

#

maybe u want use setPos instead of getPos

shadow sapphire
#

Why?

late gull
#

is not for set the group possition?

shadow sapphire
#

The script is working perfectly as it is now, I'm just trying to get a little bit of unpredictability in there.

winter rose
#
_this setPos [2200, (_this getDir (getmarkerpos "Origin")) -60 + round random 120];
#

the round is not even needed, it's up to you

shadow sapphire
#

I probably wouldn't use round, then.

meager heart
#

look at your compass once again... 0 - 60 = 300 and 20 - 60 = 320 so maybe 1+ (random 359) ๐Ÿ˜€

late gull
#

+1 xD

#

you can spawn the group in 000 with damage dissabled, then set pos and enable damage

#

BIS_fnc_spawnGroup is not accepting degrees i guess

gleaming oyster
#

(even thought it should)

late gull
#

so u may set the positon and then the degree

shadow sapphire
#

It's not that it's a bad idea, but you're hung up on the wrong thing. I'm not as concerned about that and I'm on a different problem now, haha. Sorry.

#

Shoot. I posted the wrong context script.

late gull
#

same thing, you can't do that

#

BIS_fnc_spawnGroup spect an array[3]
you using array[3,[2]]

gleaming oyster
#

yes it spect an array

shadow sapphire
#

What do you mean expects an array? What do you mean I can't do that? The script is working fine, I just want to add some unpredictability to it.

meager heart
#

you trying to make platoon formation column with squads formations wedge or ?

late gull
#

he's trying to play with vectors

#

thing that it's alot more complicated xD

shadow sapphire
#

No. I already have a platoon in wedge with squads in column and teams in wedge. That part is done. Full stop.

late gull
#

btw, talking about that

#

do anyone know a script for vector?

#

i want to make one, but my mind it's like crashing every time haha

dry egret
late gull
#

ah thanks

#

yes, but i want some to generate random xD

dry egret
late gull
#

will save it for bed reading

dry egret
#

are you trying to randomly position an object by vector orientation ?

late gull
#

yes, i'm doing a graphic scheme

#

because i dont even know how to explan it in my native lang (Spanish)

#

so will be x2 harder to explain in English

dry egret
#

lol

#

graphic scheme? are you trying to do vector based graphics?

late gull
#

just wait

#

xD

dry egret
#

< vector can mean so many different things its not even funny

late gull
#

yes, that's why i want to show what i mean with a image

dry egret
#

are you trying to get the Ai to patroll around the center?

late gull
#

nope

#

think about a air drop

#

with helicopter patroll