#arma3_scripting

1 messages ยท Page 216 of 1

hushed turtle
#

It smells like AI

pallid palm
#

no, no Ai, i did it myself

#

i dont use Ai crap

#

Ai crap cant do shit in Arma 3

#

im just not that good thats all

#

like i said i always need help

#

btw thx for your help my brothers @hushed turtle and @fleet sand

hushed turtle
#

Local trigger is going to activate only locally

pallid palm
#

roger that m8

split ruin
#

@pallid palm this is all true, the only thing to add is player units variable name so it activates only "his" radio trigger

if (str player != "delta1") exitWith {};

and of course you have to add this radio trigger to delta1 unit ...

//in initPlayerLocal.sqf
if (str player == "delta1") then {
_tr1 = createTrigger ["EmptyDetector", getPos player, false]; 
_tr1 setTriggerArea [0, 0, 0, true];
_tr1 setTriggerActivation ["Juliet", "NONE", true]; 
_tr1 setTriggerStatements ["this", "if (str player != 'delta1') exitWith {}; //bla-bla", ""];
} else {}; 
light musk
#

In multiplay I'm trying to make a trigger activation display Title Text to all my players at once.

#

In my trigger I have on activation I have
titleText ["Show this text", "PLAIN"];

#

but it only shows up for the player who activates the triggers

proven charm
#
{ titleText ["Show this text", "PLAIN"]; } remoteExecCall ["call",0];```
#

something like that

split ruin
#

@hushed turtle something wrong ? ๐Ÿ™‚

light musk
#

or just into the trigger

proven charm
light musk
#

thanks you're the best, much appreciated

hushed turtle
#

Dunno what are you trying to do. What do you need str for? And of course trigger will activate only for local player when trigger is local

proven charm
#

hoping everything works...

split ruin
#

@hushed turtle this needs testing ... local radio triggers could have global execution

hushed turtle
#

No trigger has global execution

warm ore
#

In the fired event handler for a vehicle weapon, what code can be used to continue running the script if only a particular weapon is fired please?

hushed turtle
#

Check if weapon is the particular weapon

warm ore
split ruin
#

@hushed turtle ecxept when they run on the server of course ...

hallow mortar
tulip ridge
warm ore
light musk
# proven charm put it in the trigger where you had the "titleText"

ok so that seems to work for the hint. The second thing I'm trying to do is make sure the trigger changes the alpha on a bunch of map markers.

This was the original code, but I'm trying to make sure it will execute for all my players and change the markers for all their maps. Will this work (old code without remote exec).

titleText ["NEW LOCATION INFORMATION HAS BEEN ADDED TO YOUR MAP", "PLAIN"];
["marker_6", "marker_7", "marker_8"] apply {_x setMarkerAlpha 1};

hushed turtle
warm ore
hallow mortar
light musk
hushed turtle
#

I thought setMarkerAplha local, my mistake

#

It's global

proven charm
#

@light musk setMarkerAlpha being global i dont see why it wouldnt work

split ruin
#

@pallid palm , @hushed turtle no matter, when something is unclear testing is the only viable option, now I made triggers to be local to every player (initPlayerLocal.sqf) and testing will show if they trigger for everyone

pallid palm
#

roger that m8

hushed turtle
split ruin
#

the other reason is porting the mission to other map is easier ๐Ÿ˜†

#

@hushed turtle yes I think

split ruin
#

the problem is their "on act" field execute the code for everyone (aka globally )๐Ÿ™‚

pallid palm
#

right

#

thats a good thing

split ruin
#

and now we try to mitigate this by creating the trigger "locally" on everyones machine ... I hope it will work

hushed turtle
#

Why would it execute code globally though? Global trigger is going to execute under same conditions, so what the point of global execution, when they all execute anyway?

split ruin
#

I really don't know why they are made like this ๐Ÿคท
and why we don't have the option "local execution" next to "server only" option ...

hallow mortar
hushed turtle
fair drum
#

unless needed, if i do end up using a trigger, its server only. put the processing on the server, not the client. each trigger copy takes away performance from every machine its on. also keeps server authority.

hallow mortar
fair drum
#

I don't use scripted triggers. no point.

#

you can make more performance friendly things via script

split ruin
#

there is point, for example to add change view distance to players

hushed turtle
#

Can we create radios using scripting? (like without creating radio trigger) Like radio alpha under 0 in command menu

hushed turtle
pallid palm
#

i use scripted triggers lots in my missions and delete them as well

old owl
#

I don't use triggers all that often but honestly I do feel like they have their situational utility. A trigger condition will only be evaluated if you're within distance where as you'd have to consistently check it in a script depending on what you're doing. Kinda just depends on what you're going for

split ruin
#

I really use radio triggers only, that's it, and they are the weirdest ones ๐Ÿง

fair drum
hallow mortar
hushed turtle
errant jasper
#

Triggers are useful if their dimensions can be used, but even that is not hard to replace in a script.

fair drum
#

areas are the only thing i use triggers for (using their area in a custom script). and they are immediately activated at start so they dont tick

hallow mortar
old owl
errant jasper
#

Hypothetically, it could look at the options, and check whether this is even part of the expression, and do analysis on it to optimize the checking.... But that it don't and won't.

errant jasper
hallow mortar
old owl
#

Same with the addAction though no? You can run anything inside of it's condition string

pallid palm
#

i use triggers to end lose: and win: my missions

hushed turtle
#

You can script mission end just fine

old owl
#

I've ran systemChat inside of trigger conditions and to me I've never seen it run outside of it's given distance

hushed turtle
#

Triggers are really good for scripting beginners

errant jasper
#

Action are attached to an object, and the condition field is not checked unless you are in an "interactable" place relative to that object.

#

Exceptions like adding the action to yourself.

old owl
#

A trigger is an object though also right?

hallow mortar
#

addAction and triggers are not the same system and you cannot infer things about one of them based on the other.

pallid palm
#

yes trigger is an object

errant jasper
#

Action have an inherent engine-based proximity check, triggers do not, that must be satisfies before condition evaluation.

hallow mortar
#

If I set a trigger's condition code to !alive someDude, it will detect someDude's death and activate the trigger, regardless of whether anyone is in or near the trigger.

old owl
pallid palm
#

thats a good thing right

hallow mortar
#

Trigger condition code is essentially a secret waitUntil

errant jasper
#

But anyway this is all quite academic.. The main point is that by not using a trigger you can choose a different check interval, usually one much greater than every 0.5 s

hallow mortar
pallid palm
#

agree

old owl
#

It sounds like I am entirely mistaken, just making the point everything I've seen indicates the opposite and have looked into this myself specifically for performance

errant jasper
hushed turtle
hallow mortar
errant jasper
#

Ah, yeah, way past my Arma 3 prime days. That must have been after the Eden editor.

#

Think I only used triggers for area indication since Arma 2.

hushed turtle
#

I thought trigger interval was present in OFP...

errant jasper
#

Neither Arma 2 had it, nor Arma 3 in its 2D editor days.

pallid palm
#

i hardly ever use Area triggers

#

most my triggers are condition triggers only

hallow mortar
hushed turtle
#

Triggers in OFP have some min, max and avarage delay stuff

errant jasper
#

I just Saving Private Ryan, Matt Damon aged....

hushed turtle
#

Maybe delayed activation?

pallid palm
#

lol i remember when OFP cam out ๐Ÿ™‚

#

it was awsome ๐Ÿ™‚

#

well the way the choppers flew was anyway

hushed turtle
#

So, they dont' have intervals, it's delayed activation I guesss ๐Ÿ˜„

hallow mortar
errant jasper
#

Given how random syntax #2 works, I no longer trust any non-linear usage of min, max average on triggers.

hushed turtle
#

What a piece of history

pallid palm
#

wow nice lol

light musk
#

Wait do radio triggers not activate globally?

#

So if I have a task start or complete on a radio trigger will it not complete for everyone?

drowsy geyser
errant jasper
#

On the other hand I found this note in my knowledge base:

Radio triggers works global - not confirmed.

light musk
errant jasper
#

I usually just start a dedicated using .bat file and join it

light musk
#

yeah i hate it. Missions work perfectly for me then I put my squadron in them and it all goes to hell cause of fucking locality

hushed turtle
old owl
split ruin
#

@errant jasper unfortunately no, players change each other view distance with

setTerrainGrid 50;
setViewDistance 6000;
setObjectViewDistance [4000, 50];

ran on radio trigger placed in eden
now I am trying with local scripted ones ...

light musk
hushed turtle
#

Task framework is set of functions to simplfly tasks. I guess if you have created tasks in editor, then they use task framework. At least I hope so

split ruin
#

local briefing tabs are also possibility ...

hushed turtle
#

Yes these are local too

light musk
hushed turtle
#

Tasks are local by default. Task Framework was created to simplify it all. E.g. you create tasks for certain units and Tasks Framework handles all the networking. Later you call complete funciton from one machine and frameworks handles all the networking and completes task everywhere

split ruin
#

tasks are waypoints on steroids ๐Ÿ’ช

hushed turtle
pallid palm
#

lol hahahah'

#

@split ruin

hushed turtle
#

Waypoints are for AI

#

Players don't need them at all

light musk
#

one trigger can be synced to multiple things right, I'm not losing my mind cause of lack of sleep right.

#

and if I synch two triggers to one thing it's treated as an "AND" condition or an "OR" condition?

split ruin
#

tasks origin is from waypoints and they are the waypoint for players in some way ...

#

I know what you will say, "there are tasks without position" ๐Ÿ™‚

hushed turtle
#

It sounds like it's true, but tasks are just information in your task list. It doesn't do anything functionally. It's just there to tell you what to do. Not that waypoints do anything functionally for players though. ๐Ÿ˜€

#

I guess you can sync task and waypoint, so when you compelete waypoint, it compeletes task along with it?

split ruin
#

in other milsim games ("Dagger Directive") waypoints are very much used to show to player where he must go and what type of task he has to do there

hushed turtle
#

I remember using waypoints in OFP, but at that time we didn't have tasks yet. Only way to display marker to show player's objective in 3D, was to create waypoint

split ruin
#

yes, player waypoints evolved into tasks in a3 or a2 I don't remember

hushed turtle
#

These days I don't have a reason to add waypoints to player lead group

#

I think it's Arma 2 thing

#

You can delete task's notifications

split ruin
#

yes and better disable 3d markers ๐Ÿคฎ

pallid palm
#

yeah that stuff takes away my emersion

#

i really don't like anything poping up on schreen sep for maybe side Chat stuff

hushed turtle
pallid palm
#

its like on my phone all notifications off ๐Ÿ™‚

#

oh nice @hushed turtle thx m8

frail skiff
#

Hello there, hope I'm not interrupting. I'm working on a helicopter script that needs tiny variations between different different chopper types. I'm currently using

if(vehicle player isKindOf "B_Heli_transport_01_F")

to distinguish between helos, but I'd also like to use the UH-80's variants (CTRG, jungle, Reaction Forces...). How could I go about creating such a condition?

light musk
stable dune
#
[["Show this text", "PLAIN"]] remoteExecCall ["titleText",-2]
#

aa

#

i wast sure about double, but from wiki ->

cutRsc ["", "BLACK OUT"];
// becomes
[["", "BLACK OUT"]] remoteExec ["cutRsc"]; // double brackets are needed as the unary command takes an array
little raptor
# frail skiff Hello there, hope I'm not interrupting. I'm working on a helicopter script that ...

if they have a common parent you can use that. most heli variants have a common parent (for example it can be something like B_Heli_transport_base_F, check in config viewer)
otherwise, you can use an array and check all of them:

private _heliTypes = ["B_Heli_transport_01_F", "something else"];
private _veh = vehicle player;
private _matchesType = _heliTypes findIf {_veh isKindOf _x} >= 0;
if (_matchesType) then {

}
frail skiff
little raptor
#

no

#

but you can use that array like I showed

wicked roostBOT
#
How to use SQF syntax highlighting in Discord

```sqf
// your code here
hint "good!";
```
โ†“ turns into โ†“

// your code here
hint "good!";
stable dune
#

It's just
Description:
Unscheduled version of remoteExec. The only difference between remoteExec and remoteExecCall is that remoteExecCall will run functions in unscheduled environment.

fading gorge
#

even with shift-enter I can't send a message after using code tags, wtf

frail skiff
#

Also had another question, so far, the script I've got adds a scroll-down action for the player using addAction.

It does so only if certain conditions are met: helo speed inferior to 10kps and altitude inferior to 20m. That part works fine, but I'd like to make it so that if those conditions are no longer met, the action disappears and reappears once the conditions are met again.

Can that be achieved without cremating my FPS? I tried using while instead of if, PC did not approve because it just created a million actions, but I don't know how to make it work only once when conditions are detected.

I can post the whole script if need be.

#

Would waitUntil work?

stable dune
#

you only need add that in part of addaction -> Condition

frail skiff
#

Oh wow I'm getting slow lmao

Thank you!

frail skiff
#

I've just tried it out in game, got some weird results

The relevant part of the script is

[player, ["action name", { 
            //do stuff
         },
         nil, //arguments
         1.5, //priority
         true, //showWindow
         true, //hideOnUse
         "", //shortcut
         "speed vehicle player <= 25 && _altitude0 <= 50", //condition
         50, //radius
         false, //unconscious
         "", //selection
         "" //memorypoint
        ]] remoteExec ["addAction"];```

It would seem that there is an error in the way I'm trying to have two conditions. I've tried using them separately and it works, but idk how to make them both work together
tulip ridge
thin fox
#

not sure if works but try it

tulip ridge
#

Looks fine, though you can just do the vehicle _this once

light musk
tulip ridge
#
// toString isn't required, but makes it easier to understand
toString {
    private _vehicle = vehicle _this;
    speed _vehicle <= 25 && (
        ((getPosATL _vehicle) select 2) <= 50
    );
};
#

Haven't tested but lazy eval probably isn't worth it there

thin fox
tulip ridge
#

Whenever it's more performant to do so

#

For simple stuff it takes more time to create the code type than to just run the condition

granite sky
#

Also depends how often the first condition is true.

tulip ridge
#

Yeah

frail skiff
#

That seems to have done the trick

Thank you all very much, now on to the actual hard part for me

Will probably do it ~~never ~~later tbh

hushed turtle
#

I always use lazy eval. Had no idea creating code would cost performance ๐Ÿ˜†

stable dune
light musk
#

Yeah i understand that will work that same but i'm hoping you could explain a little more about what the difference so I can't try and wrap my head around remoteExec

modern plank
#

To get all human players in a given side, there is no more optimized implem than (allPlayers arrayIntersect units west) for example?

errant jasper
#

Probably not. Would personally use select instead. allPlayers < 150 anyway. It doesn't matter unless you intend to run it per frame.

modern plank
#

oh no. Just to get survivors at the end of the no-respawn game

#

Maybe this implem is better since I need them for the 4 sides. Only one browsing of allPlayers..

#

hum, i want the list, not the numbers only.

pallid palm
#

oh ok

#

i just need the numbers ๐Ÿ™‚

modern plank
#

There is countSide if you just want figures.

pallid palm
#

hmm

modern plank
#

west countSide (allPlayers select {alive _x})

pallid palm
#

oh cool i see

#

what about payable

#

or as in Ai playable

#

like if we have Ai playable units with us

modern plank
#

use the list that you need.... allUnits|playableUnits|allPlayers|units _side

pallid palm
#

i guess i need both

modern plank
#

In my case it is for TvT, so no AI to be considered here.

pallid palm
#

oh i see yeah im all PvE

#

i can only use them 2 there allPlayers playableUnits cuz i might have a chopper pilot that i dont want to include

dark viper
#

Who here knows about PhysX?
are player chars PhysX objects?

biki said AI infantry are not PhysX, not sure about player

someone was trying do some physics with the player yday but GetMass return 0 iirc

If they are not PhysX obj, how does gravity in the game work then?

modern plank
#

You can also operate on the lists. If you need the AI that are playable but no human inside, you can do (playableUnits - allPlayers)

dark viper
#

Cause you do fall from heights in ARMA 3 so something clearly acts on the units

pallid palm
#

@modern plank i need both

modern plank
#

getMass player; returns 0.

hallow mortar
modern plank
#

To come back on this afternoon topic, do you confirm that
missionNamespace setVariable["VAR",1,true] is identical to: missionNamespace setVariable["VAR",1,false] ; publicVariable "VAR";

dark viper
modern plank
#

just an answer to your 'not sure about player' remark.

dark viper
# hallow mortar Players are not PhysX objects unless they are ragdolled. There is another, more ...

Hmm so how do you counter gravity then, the person was doing setVelocity with the Z being mass * 9.8 * dt per frame

Now that I think about it, they were setting the velocity every frame to 0 since mass was 0. then all they had was their input movement vectors

I assume setting velocity directly like that would directly interfere with the engine physics simulation, as it did appear to be a working 0 gravity

light musk
#

If I put a "hint" into a triggers On Activation field will it show for all players in MP even though "hint" is local?

#

I thought i read earlier on here the trigger will propagate it out to all clients when it activates.

hushed turtle
#

Trigger runs on all machines

#

Unless you check server only.

tender fossil
light musk
#

So just putting this in the On Activation field works?

Hint "Message Here"

all players will see it?

#

So triggers only run and execute locally?

#

Im seriously not getting this.

hallow mortar
hushed turtle
#

Global trigger will run everywhere, since it exists everywhere ๐Ÿ˜€

hallow mortar
# hallow mortar If a trigger is not specifically created only on one machine (e.g. server-only c...

For example, a trigger that's set to simply "OPFOR Present" with this in its condition code, will appear to act globally, because every machine's local copy of the trigger will go "oh, there's an OPFOR there" at the same time, because that's global knowledge. But if you set it to player in thisList in its condition code, then each machine's local copy can activate at different times, because they're only checking for their local player.

dark viper
tender fossil
hallow mortar
light musk
hallow mortar
# light musk Does that work on Multi-player i thought something about player being null in th...

player is not null in MP. player always returns the local player unit of the machine executing the command. The potential issue in multiplayer is that Dedicated Server and Headless Client machines, by nature, do not have player units. That means that if the command is executed on those machines, it will return objNull. It's perfectly safe to use on player machines, and in most cases it's "safe" to use on DS and HC as well unless you're specifically expecting it to return a real unit.

dark viper
#

assuming the gravity constant of arma 3 is 9.8 and that the engine physics runs at the same rate as the frame handler

errant jasper
modern plank
#

Humm.

#

Ok for the addPublicVariableEventHandler, I don't know if the broadcasting flag in setVariable also throws an Event.

#

But... as for performances/reliability?

tender fossil
modern plank
#

Okay, but I don't care much about the EH. My concern is more about the implem behind, if there is one more reliable or not.

hallow mortar
#

What do you mean by reliable? They both work.

modern plank
#

same perf, one not outdated, idk

#

My bet was it is identical....

tender fossil
#

I recall reading from somewhere that publicVariable is considered a priority and broadcasted to the relevant clients as soon as possible, but no idea how that compares to the setVariable broadcast

modern plank
#

same here, so I wil lconsider the diff should not be that big.

dark viper
#

We trolled you really hard last night with this so I will try to clarify now.

  1. There is no mass for your unit, it uses an engine based physics system for non-PhysX objects, which the player [_unit] is
    GetMass and SetMass are strictly PhysX commands.

  2. So you had zero gravity because you set the Z component for velocity by multiplying by zero (_unitMass is 0)

  3. You were directly adding to _vX, _vY, and _vZ every frame for input, then feeding that to _unit setVelocityModelSpace _force, so your input is using model relative vectors. Because your character rotates around in world space, these model relative vectors are rotated the same. If are moving directly left in model space, if you rotate 90 deg left, your velocity is still directly left relative to your model, but it has rotated 90 in the world now. You go from moving in world space what was direct left, to now what was originally directly backwards in world space.

  4. You should not be reinterpreting your velocity vector like that every frame, instead you should be adding your input vectors transformed to world space to the current velocity, (getVelocity and setVelocity are world space). As of right now, you are treating _vX, _vY, and _vZ as axially locked to your model's basis, which would be [1, 0, 0] , [0, 1, 0], [0, 0, 1]. and directly adding scalar values to these with input. If you added these individual vectors transformed to world space to what your velocity is, you would maintain model relative input movement. However this would result in what are called "tank controls", where almost all games use camera relative movement. (W goes foes forward where your camera is looking, and your character rotates and goes there)

  5. From #4, transforming the input to world space would involve the following operations:

#

_dX = [1, 0, 0] * (inputAction "TurnRight") * dt * 5
_dX = _dX + [-1,0,0] * (inputAction "TurnLeft") * dt * 5;
_dX = _unit vectorModelToWorldSpace _dX
_dY = [0, 1, 0] * (inputAction "MoveForward") * dt * 5
_dY = _dY + [0, -1, 0] * (inputAction "MoveBackward") * dt * 5
_dY = _unit vectorModelToWorldSpace _dY
_dZ = [0, 0, 1] * (inputAction "HeliCollectiveRaise") * dt * 5
_dZ = _dZ + [0, 0, -1] * (inputAction "HeliCollectiveLower") * dt * 5
_dZ = _unit vectorModelToWorldSpace _dZ

// in one pass you could do, instead of 3x
_totalMovement = (_unit vectorModelToWorld (_dX + _dY + _dZ));

#5, would give you model relative input controls (tank controls)

  1. You can get camera relative input easily by doing this instead:
    either
_camForward = getCameraViewDirection _unit; // yaw and pitch
_camUp = vectorUp _unit; // accounts for roll of the _unit
_camRight = _camForward vectorCrossProduct _camUp;
_accelScale = 5 // arbitrary amount of acceleration for the inputs (velocity added per second)
// You would then add your input vectors:
_totalMovement = [0, 0, 0];
_totalMovement = _totalMovement + (inputAction "TurnRight") * _camRight * _accelScale * dt;
_totalMovement = _totalMovement + -(inputAction "TurnLeft") * _camRight * _accelScale * dt;
// repeat for the 6 directional inputs
_unit setVelocity ((_unit getVelocity) + _totalMovement)

// Or, model relative input controls, as discussed before:
// from #5
_totalMovement = _dX + _dY + _dZ; // already transformed from model to world, just add
_unit setVelocity ((unit getVelocity) + _totalMovement);
still forum
#

you have to click outside the code tags and then press enter

dark viper
#

See this edited example from yesterday: #arma3_scripting message

Make sure you understand why doing
_unit setVelocityModelSpace every frame with continuously saved velocity component causes your current velocity to be rotated with the model orientation

Also one last note, since I have little ARMA experience, I naively thought vectorToModelWorldVisual commands were doing some camera view matrix in world space. This is wrong and you can disregard any comments regarding it.

Visual vs non-visual commands have only to do with accessing either the linearly interpolated, smooth render frame versus the physics engine (slower updating, more jittery) positions and orientation. They run in different delta times

it's not relevant here

light musk
#

I'm trying to run this script and keep getting an error tha tI'm missing "[]" somewhere can anyone please help:
titleText ["NEW ENEMY LOCATIONS HAVE BEEN ADDED TO YOUR MAP, "PLAIN"]; ["marker_9", "marker_10"] apply {_x setMarkerAlpha 1}; titleText ["NEARBY ENEMY INSTALLATIONS HAVE BEEN FOUND. CONTACT COMMAND ON RADIO CODE FOXTROT IMMEDIATELY!", "PLAIN"];

dark viper
#

the first entry is missing a quote

light musk
#

opmg thank you

#

i have been staring at it for 20 minutes

dark viper
#

we've all been there

light musk
#

hmmmm now it says i'm missing a ";"

#

sigh this is rough or i'm terrible at it one of the two

dark viper
dark viper
#

you need to fit your last titleText on one line in the editor fields

#

It's pretty silly, because I believe you can write file .sqf scripts that do split code across lines and call the script using execVM perfectly fine

light musk
#

what is execVM?

dark viper
light musk
#

ok thanks, much appreciate all the help

dark viper
#

going through the arma 3 wiki is kind of a nightmare to find exactly what you are looking for, I was gonna try to explain more but can't find relevant page

#

anyway rather than working in the editor, it may be better to define these behaviors inside a script files and use execVM, or create your own modules. Modules can do even more things.

#

But you need to know the init order, or you may try to reference something that isn't defined yet

dark viper
# light musk oh interesting

And rather than typing everything in init fields I rather use, Advanced Developer Tools and debug console to test stuff

hallow mortar
dark viper
#

I'm not sure the behavior but I do remember it being annoying, I never used enter key in my scripts, I just type until the end and it makes it go to a newline once the end is reached. I guess that newline is different than pressing enter (which annoyingly closes the attribute window)

yeah that sounds infuriating

hallow mortar
#

Text wrapping to the next line to fit the field is just a visual thing, it's not a real new line and makes no difference to how the code is executed

dark viper
#

Hmm that doesn't track with my experiencewhere you get stuff like
titleText ["NEARBY ENEMY INSTALLATIONS HAVE BEEN FOUND. CONTACT COMMAND ON RADIO CODE FOXTROT IMMEDIATELY!", "PLAIN"];
syntax error because it stops parsing after RADIO CODE and doesn't make sense

#

kept happening to me

#

though it's possible I was using shift + enter, or enter and don't recall

hallow mortar
#

Init fields are tedious to work in for several reasons, but I promise you, the automatic text wrapping does not cause technical problems.
If you were manually inserting line breaks in odd places, that could potentially cause issues, like if you did it in the middle of a variable name or a command name or something, because it would be treated like a space.

#

One thing init fields (and all Editor code fields) do not support is comments. Comments require the code to be preprocessed, to remove them before the game tries to execute it, and Editor code fields don't go through the preprocessor. So if there's a comment in your code, the game will try to execute it and get confused.

dark viper
#

And that behavior is definitely unnatural for many as there are vast amount of languages where whitespace doesn't matter at all

Yeah I also noticed that there is no preprocessing

hallow mortar
#

Whitespace largely does not matter. However, the presence of any whitespace does indicate a gap between words. You can put as much space as you like, tabs or spaces or linebreaks, in any place where a whitespace is valid, but you can't add it in the middle of a word if you want the game to still recognise it as one word.

_varName setDamage 1; // Valid
_varName        setDamage   1; // Valid
_varName
setDamage 1; // Valid
_varName set Damage 1; // Not valid
_varName set
Damage 1; // Not valid```
#

Also it does matter in strings because strings are literal text, so if the game wants "PLAIN" you can't write "P L A I N", because those whitespace characters are taken literally.

fading gorge
#

for "_thanks" from 0 to 10 do {_appreciation = _thanks spawn {hint "thanks dedmen"}}

proven charm
pallid palm
#

well only if we have no sleeps: in the function right

proven charm
#

cant have sleeps in unscheduled code

pallid palm
#

roger that

#

can have sleeps in the spawn

proven charm
#

yes

pallid palm
#

roger

proven charm
#

because its scheduled

pallid palm
#

roger m8

#

thats the way i see it if there is sleeps in the function then i use spawn and if no sleeps then i can call

proven charm
#

canSuspend = scheduled

willow hound
proven charm
pallid palm
#

call just rips right though the function fast as hell

#

like in the blink of a eye

#

oh it will tell you if your not doing it right: ๐Ÿ™‚

#

believe me i know ๐Ÿ™‚

#

lol

#

i messed that up a few times befor i got it right ๐Ÿ™‚

willow hound
# proven charm it should be unscheduled and those scripts wont sleep...

Yes it's unscheduled, because call is a script command, and remoteExec always executes script commands in the unscheduled environment.
Because all script commands run unscheduled anyways, you might as well omit call ...

[{ systemChat "Test"; }] remoteExec ["call", 0]; //call and systemChat run unscheduled
"Test" remoteExec ["systemChat", 0]; //systemChat runs unscheduled
```... unless you need to remote execute multiple commands in one go.
Then again, if you do need to remote execute multiple commands in one go, you might as well put them into a proper function and remote execute that function. If the function needs to run unscheduled, use `remoteExecCall`, if it needs to run scheduled, use `remoteExec`.
pallid palm
#

that's the way i do it cool thx m8

proven charm
#

it makes sense call runs in unscheduled because its a command - i forgot that

#

if running rem exec function though you can choose between remoteExec / remoteExecCall to determine if it can suspend/be scheduled

obtuse crypt
#

Hello Gentlemen,

Here is part of my initPlayerLocal.sqf. It's task is to return gear to player on Respawn and return him to his side and group to which he was attached at the start of the mission.

_Target setVariable ["TAG_StartLoadout", getUnitLoadout player];
_Target setVariable ["TAG_StartSide", side player];
_Target setVariable ["TAG_StartGroup", group player];

_Target addEventHandler ["Respawn", { private _loadout = player getVariable "TAG_StartLoadout"; if (!isNil "_loadout") then { player setUnitLoadout _loadout; }; }];
_Target addEventHandler ["Respawn", { private _side = player getVariable "TAG_StartSide"; if (!isNil "_side") then { player join createGroup _side; }; }];
_Target addEventHandler ["Respawn", { private _group = player getVariable "TAG_StartGroup"; if (!isNil "_group") then { player joinSilent _group; }; }];

Gear thing works great and without issues, but side and group thing are not. Almost all the time, players are in Civilian faction instead of BLUFOR or OPFOR, and they are attached to a group of dead Players and AI and I cant find way to fix it.

Does anyone have any idea how this can work?

stable dune
proven charm
#

i would start by checking ```
player getVariable "TAG_StartGroup"

#

also player maybe null at the time but probably not here because the gear works

#

just put that line in debug console ^^^^

old owl
#
poll_question_text

Is this usage of CT_WEBBROWSER despicable

victor_answer_votes

5

total_votes

7

victor_answer_id

1

victor_answer_text

Yes

victor_answer_emoji_id

1306278458489569340

victor_answer_emoji_name

catnod

victor_answer_emoji_animated

true

proven charm
#

is there a 2D point rotation command? I have script implementation but could use faster engine command

obtuse crypt
obtuse crypt
hushed turtle
obtuse crypt
hushed turtle
#

Joining side? What?

obtuse crypt
# hushed turtle Joining side? What?

If you take a look at my code, I first have variable that stores Player side that he is on, on the beginning of the mission. Than after player respawns I first try and change his side from CIVILIAN (he is always respawning as CIVILIAN) to side he was on at the beginning of the mission.


_Target setVariable ["TAG_StartSide", side player];

_Target addEventHandler ["Respawn", { private _side = player getVariable "TAG_StartSide"; if (!isNil "_side") then { player join createGroup _side; }; }];

hushed turtle
#

Ah, I see. You don't need the second EH then.

#

Also why do you have same 3 EHs? You could put all of that code into one EH

obtuse crypt
hushed turtle
#
player join createGroup _side;
player joinSilent _group;

This would leave empty groups in the memory I'm afraid. I don't think engine would remove them automatically

obtuse crypt
#

Also, basicly I am not sure, why my players are respawning as civilians when they whould be on their initial side..

hushed turtle
#

They respawn as whatever unit they selected in lobby

#

Joining group just does that, it joins the group. It won't change anything else. Units will keep their voice, their gear, their head and so on.

#

Only side will change, if different

#

Not sure if scoreboard will reflect the side change though

obtuse crypt
#

You see, that is problem, in my case BLUFOR/OPFOR/INDFOR units respawn as Civilians for some reason, that is why I added side thing.

hushed turtle
obtuse crypt
#

Or joining group is not actually working.

hushed turtle
#

Don't know what spawn are you using there

#

Did you configure spawn type in editor under multiplayer settings?

obtuse crypt
#

respawn = 3;

Respawn on marker, set in descritpion.ext

hushed turtle
#

Strange for units to change their side on respawn

obtuse crypt
#

Possibly, problem is createt with this:

_Target setVariable ["TAG_StartGroup", group player];
_Target addEventHandler ["Respawn", { private _group = player getVariable "TAG_StartGroup"; if (!isNil "_group") then { player joinSilent _group; }; }];

Why I think so, its because all players that respawn are joining empty civilian group, group in which are dead AI's etc.

At the same moment, from Zeus they are displayed for example with green (independent) group icon, but when I open their group settings and check side, it is civilian.

#

Here is a screen from mission yesterday, and you can see that some IND players are grouped with dead bodies.

hushed turtle
#

You should be using params:

this addEventHandler ["Respawn", {
    params ["_unit", "_corpse"];
}];

Also this EH runs only on local machine

hushed turtle
stable dune
# obtuse crypt Possibly, problem is createt with this: ```sqf _Target setVariable ["TAG_StartG...

You could debug ->

params ["_player", "_didJip"];
_player setVariable ["FRK_startLoadout", getUnitLoadout _player];
_player setVariable ["FRK_startSide", side group _player];
_player setVariable ["FRK_startGroup", group _player];
systemChat format ["Start side: %1, Start group: %2", side group _player, group _player];

_player addEventHandler ["Respawn", {
    params ["_player", "_corpse"];
    private _loadout = _player getVariable "FRK_startLoadout";
    systemChat format ["IsNil _loadout: %1", isNil "_loadout"];
    if (!isNil "_loadout") then {
        _player setUnitLoadout _loadout;
    };

    private _group = _player getVariable "FRK_startGroup";
    private _side = _player getVariable "FRK_startSide";
    systemChat format ["Respawn side: %1, Respawn group: %2", _side, _group];
    systemChat format ["Player side: %1, side group player: %2", side _player, side group _player];
    if (!isNil "_side") then {
        systemChat format ["Side is not nil: %1", _side];
        if (!isNil "_group") then {
            systemChat format ["Group is not nil: %1", _group];
            if (side _group == _side) then {
                [_player] joinSilent _group;
            } else {
                _group = createGroup _side;
                [_player] joinSilent _group;
            };
        } else {
            systemChat "Group is nil";
            _group = createGroup _side;
            [_player] joinSilent _group;
            systemChat format ["Created new group: %1", _group];
        };
    } else {
        systemChat "Side is nil";
        _group = createGroup (side group _player);
        [_player] joinSilent _group;
        systemChat format ["Created new group %1 to %2", _group, side group _player];
    };
}];
#

and joinSilent need to be [] , it expect array not object

obtuse crypt
#

I will try to give it a shot later today, thank you guys ๐Ÿ™‚

lilac kernel
#

is there a way to dump all classnames of items and weapons from my server?

proven charm
#

which items you mean, the ones players have?

still forum
#

GA/LE
But I wonder why anyone would run it. Its for adding it into your action menu trigger list, nothing else?

It has no multiplayer effect, also the mine is not "owned" by the player. Multiple players can own the same mine

#

I don't see any point of running that command when you're gonna trigger the mine instantly anyways

#

private variables, are local variables in scopes. Which you cannot read with getVariable. So no, not the same

#

You can with hashmap objects

#

"Entity" is the name you're looking for

#

unit variables cannot be private, because they are not local/scope variables
I think this is just a big mixup of confusing "private" with "not-global"

hushed turtle
trim atlas
#

Anybody have installed the Advanced sling load mod? Into multiplayer server?

#

Want to have it as server mod but idk its not working

still forum
#

Ah, then the answer is. The script command doesn't know anything about whatever variable you pass to it (which is why isNil takes a string), it only knows the value that was inside it.
It doesn't know if its local, private, global, network-published, result from another command (like a getVariable)

hushed turtle
#

I like to use code in isNil rather then string, even when just checking if someVar is nil. It there anything wrong with it?

thin fox
trim atlas
hushed turtle
# still forum You can with hashmap objects

Which is technically just array or hashmap anyway. Used in createHashMapObject as template to create hashmap object. And hashmap object is just hashmap with some special functionality, which some special commands use. Really, very "workaround" way of making OOP.

Am I wrong? I don't think I'm ๐Ÿค”

errant jasper
#

It is not atypical in dynamic OOP languages. Many scripting languages, eg. Python and JS are basically fancy dictionaries with special keys.

#

Though Arma's version look more "prototypical" than class based.

#

Though, unless I am mistaken, there is no way to delegate to "super"-method in SQF's implementation ?

#
private _baseDecl = [
    ["#type", "Base"],
    ["foo", { "bar" }]
];
private _subDecl = [
    ["#base", _baseDecl],
    ["#type", "Sub"],
    ["foo", { 
        // How to run call _base.foo ?
    }]
];
hushed turtle
errant jasper
#

Well if is just copied into sub-objects, then you are right, this can't be called OOP.

#

Just dictionaries with some factory command.

#

But no, that isn't right because the example have delegated "chain-called" constructor/destructor, so there is some delegation

#

It's just not accessible to user-level methods.

hushed turtle
#

Normally you can refer to public and protected super methods from child object, even when child object itself does not have the method (it just has it because of inheritance). But because here we work with hashmaps, then hashmap needs to have copy of all super methods, otherwise you would have to do something like child.super.method to access inherited method, even when child didn't overload the method

errant jasper
#

Well I would hope that the special call variant did the super-look check to find the proper level for the method.

#

But I guess there is no such thing.

still forum
# still forum It is alot more expensive

isNil with varName, looks up varName by string.
isNil with code. Creates a new code context, a new scope, a new variable namespace for the scope, executes the script instruction to get the variable, which looks up varName by string, then destructs the scope, destructs the variable namespace, destructs the new context.

hushed turtle
#

Someone some time ago was saving copy of super in one of the members to be albe to access it.

#

isNil with code is much more complicated then

still forum
#

Yeah HashMapObject at the end, is basically flattened down. Because I didn't want to pay the cost of storing like.. all methods as array.
Or have a hashmap for every base-class in every instance which gets super messy

hushed turtle
granite sky
#

It even works on map objects until they get streamed out.

winter rose
willow hound
granite sky
#

We use addOwnedMine for reconnecting respawned players with their mines, but it's old code so I don't remember whether it's actually necessary.

hushed turtle
errant jasper
#

Args global but effect local? So adding a mine on Machine A to unit X and then running removeAllOwned X on Machine B will still have it owned by the unit on machine A ?

errant jasper
granite sky
#

Assuming that removeAllOwnedMines is also GA/LE, it'd just remove the local actions for that unit.

#

So yes.

hushed turtle
errant jasper
#

You would to run your own dispatch call, I guess it could work, but at that place not sure it is worth it.

hushed turtle
#

Assuming code type is passed as reference, then one could create child method, which would just refer to super method to create inheritance. That might not be that bad. Well the problem with it is, once you call super method like that, it will also have access super members and not child members. So, guess it won't work

#

It's just a hashmap after all

errant jasper
#

Well child members are still there in self.

vagrant cedar
#

is there a script to change the scale atribute in the eden, I am using 3den enhanced

#

I found it

ENH_objectScaling

pallid palm
#

hello all: can someone give a link to the key press wiki like if i want to set lets say the J key to spawn a function

pallid palm
#

oh nice thx m8

#

yes the 2ed 1 i was looking for thx

tall linden
#

does anyone of a script i can use with an AA vehicle to have it shoot into the air as if targeting random air assets

errant jasper
#

params doesn't under nil as optional value?

still forum
granite sky
#

yeah but I don't like to use it for SQF because there are commands that seem to define it differently.

errant jasper
# hushed turtle What I've described here

Just for curiosity, I tried doing JavaScript style prototype inheritance.

Base_Proto = createHashMapFromArray [
    ["#proto", nil],
    ["#new", {
        _self set ["myvar", 123];
    }],
    ["foo", {
        "bar" 
    }]
];

Child_Proto = createHashMapFromArray [
    ["#proto", +Base_Proto],
    ["baz", {
        ["foo"] call OOP_SuperCall;
    }]
];

OOP_New = {
    private _self = +_this;
    [_self, "#new"] call OOP_Call;
    _self;
};

OOP_SuperCall = {
    params ["_method", ["_args", []]];
    [_self get "#proto", _method, _args] call OOP__Call;
};

OOP_Call = {
    params ["_self", "_method", ["_args", []]];
    [_self, _method, _args] call OOP__Call;
};

OOP__Resolve = {
    params ["_context", "_name"];
    if (isNil "_context") exitWith {[false, nil]};
    private _entry = _context get _name;
    if (isNil "_entry") then {
        _context = _context get "#proto";
        [_context, _name] call OOP__Resolve;
    } else {
        [true, _entry];
    }
};

OOP__Call = {
    params ["_callContext", "_method", "_args"];
    ([_callContext, _method] call OOP__Resolve) params ["_found", "_body"];
    if (not _found) then {
        throw "Method not found";
    };
    _args call _body;
};

aChild = Child_Proto call OOP_New;
systemChat str ([aChild, "foo"] call OOP_Call == "bar");
systemChat str ([aChild, "baz"] call OOP_Call == "bar");
// Below doesn't follow prototype chain though.
systemChat str (aChild get "myvar"); 
placid spear
#

Anyone here mess around with arma 3 extensions, specifically the RVExtensionFillTextureSource function?

blissful current
#

The wiki says that BIS_fnc_taskCreate is a GA. So why then does that command not create tasks on the client or local host when I place that command within a function call: call FoxClub_fnc_create_tasks;?

I then tried to remoteExec the function (remoteExec ["FoxClub_fnc_create_tasks", 0];), which did create the tasks, but there were bizarre errors. The parent task, which normally has a title and description, was empty of text. And some of the tasks had default icons instead of the ones I chose for them.

This all works fine in SP.

blissful current
#

I added some 1 second sleeps between the task creations and that seems to help. They are ordered correctly now with the correct icons. Why did adding sleeps help?

granite sky
#

Are you re-using the same task ID or something?

modern plank
#

Question about JIP: Is there a way to test JIP code with a local server instance from Eden?

meager granite
modern plank
meager granite
#

multiplayer menu

modern plank
#

Not sure to understand. Do you propose to start a local server with Eden, then join with another cli instance?

hushed turtle
#

I have script creating 6 tasks in row without any issues and no sleep.

#

Only runs on server

#

Maybe you're using same ID like Jordan suggested

proven charm
fair drum
#

With battleye turned off, you can open multiple instances of the game @modern plank

modern plank
#

okay thnks

#

will give it a try soon.

winter rose
modern plank
dark viper
proven charm
#

thx ill keep that in mind

dark viper
#

should just be

  _point = [x, y];
  _theta = 90.0; //sin cos uses degrees
  _costheta = cos _theta;
  _sintheta = sin _theta;
  _point = [x * _costheta - y * _sintheta, x * _sintheta + y * _costheta];
#

I would use the matrices if you wanna rotate around an arbitrary plane, idk what ur doing

#

otherwise the matrices have a lot of unnecessary repeated operations, and you must account for floating point matrix creep, which is a lot more calculation

proven charm
dark viper
#

If there's quaternions available in the scripting, I can't find it on wiki

#

It would be fun to make your own quaternion API

proven charm
#

im trying to use the matrix. and i got this from objectmapper: ```sqf
_rotMatrix =
[
[cos _azi, sin _azi],
[-(sin _azi), cos _azi]
];

_multiplyMatrixFunc =
{
private ["_array1", "_array2", "_result"];
_array1 = _this select 0;
_array2 = _this select 1;

_result =
[
(((_array1 select 0) select 0) * (_array2 select 0)) + (((_array1 select 0) select 1) * (_array2 select 1)),
(((_array1 select 1) select 0) * (_array2 select 0)) + (((_array1 select 1) select 1) * (_array2 select 1))
];

_result
};

[_rotMatrix, _pos] call _multiplyMatrixFunc

#

I tried ```sqf
_rotMatrix matrixMultiply [_pos]

dark viper
#

swap -sin azi and sin _azi in _rotMatrix?

#

i don't know why matrixMultiply would give you something different, is there syntax error or is it a diff result?

proven charm
#

that didnt work. the values returned are oddly small and return my objects get placed in same pile

#

no syntax error

#

it actually returns empty array

dark viper
#

yep, _pos needs to be in this format btw, [[x],[y]]

#

array of arays with single elements to represent 1 x m or n x 1 matrix

proven charm
#

ok i tried ```sqf
_rotMatrix matrixMultiply [[_pos # 0],[_pos # 1]];

dark viper
#

what is _pos? is it just [x, y ,z]?

proven charm
#

yes

dark viper
#

ah yeah

#

i'm not sure, what's the error?

#

does _pos * 0 make it like this [[[x]], [[y]]]? that would be bad

proven charm
#

actually theres no error if i dont try to do something with the result

dark viper
#

the result is also in [ [], [], []] format

proven charm
#

ok

dark viper
#

Also I wanna point out your implementation is actually wrong if you haven't swapped -sin azi and sin azi

proven charm
#

k

#

yay it works now ๐Ÿ™‚

#

the final code: ```sqf
_ret = _rotMatrix matrixMultiply [[_pos # 0],[_pos # 1]];

(_ret # 0) + (_ret # 1)

#

thx a lot for the help! i dont want to argue but i got that _rotMatrix from BI object mapper so it should be good?

dark viper
#

I use my explanations for right hand coordinates

#

Idk what is BI object mapper tho

proven charm
#

BIS_fnc_ObjectsMapper you can check it out from functions viewer. it places compositions

dark viper
#

should just be that A3 is left handed, I know Reforger is left handed but I'm just guessing for A3

Your rotation was correct if it is left handed, otherwise it's just the transpose for right handed which is what I had

Instead of transposing you could also just negate theta to the function calls to get the effect of the other handed coordinate system

It just affects the rotation direction, clockwise or counter clockwise

proven charm
#

those things are bit over my head ๐Ÿ˜„ but im glad its working now

#

have to say the new function i made isnt any faster than the previous so thats a failed attemb

little raptor
dark viper
little raptor
#

I mean e.g if you use ai setPos [x,y,z] in your script, engine converts it to [x,z,y] internally.
that's not relevant tho, just extra info. for all you care A3 is right handed

dark viper
#

Yeah that's what I wondering

#

I usually think of swapping left to right handed as negating an axis (x-axis in my brain)

#

I see that swapping z and y does the same thing

dark viper
# proven charm have to say the new function i made isnt any faster than the previous so thats a...

there's nothing really to talk about except that I think #arma3_scripting message would be faster because you don't need to access in to arrays as much, I don't know how the scripts do stack vs heap allocation either

The array of arrays has potential to be inefficient memory redirection, but it's beating a dead horse for such a small implementation

I would be curious the real number of CPU operations

#

Notice in yours that you repeat the same (array select #) instead of having perhaps a local value

#

And I save two math operations by not calling sin and cos 2 extra times

proven charm
#

im using the performance tester to see which function is faster but they all are around 0.005 ms

proven charm
dark viper
proven charm
#

it runs the code 10k times

dark viper
proven charm
#

thx i understand the axis are different just not good with matrices

dark viper
#

no handedness with matrices just column major and row major.
on script side it looks column major

proven charm
#

ok

dark viper
#

col major: matrix * column vector -> column vector
row major: row vector * matrix -> row vector

The order matters and the matrices are the same but transposed

Done beating the dead horse for now, gl to you

proven charm
#

thx, i appreciate it ๐Ÿ™‚

still forum
manic sigil
#

Having a frustrating time with the dynamic simulation system.

I'm making compositions for an invasion, including a MI-6 full of troops - so we're talking like six full squads of infantry. Mostly automated, just place the invisible helipad and the helicopter spawns in way overhead then instantly TPs to where I want it to actually start, full of troops.

The problem is, the last squad or so doesn't seem to be simulated, leaving them hanging in the air over the TP spot, and the helicopter once it's in range of any landable spot immediately sets down and offloads just those troops, which can cause issues for obvious reasons.

The only way to circumvent it I've got so far is to make sure my Zeus-unit is nearby (the framework my group uses teleports the Zeus unit whenever you exit the interface) the invasion corridor spot as a player to activate all the units at moment of inception, which works but is tedious .

I'm debating just extending the script to spawn in the units once the helicopter is on it's final approach, but dont want to deny any lucky players the killfeed, yknow?

At the same time, I can't afford to just disable the dynamic simulation system, for performance reasons.

still forum
#

You can disable dynamic simulation only for the few units you're having issues with?
You can at least do that with Eden compositions, there is a checkbox for it

cosmic lichen
#

Just enable the simulation once you spawn in the helicopter

#

The thing I don't understand is. Why does it only happen for one group inside the helicopter. DS should work all groups inside the helicopter the same way.

manic sigil
placid spear
lilac kernel
#

what data point can i pull a vehicles current reserve ammo from?

granite sky
#

magazinesAmmo, magazinesTurret etc.

#

Apparently these return the loaded magazine as well, so you might want to subtract those. Best command I can see for that is the alt syntax of weaponItems.

gray raptor
#

okay so, finally got around to looking at the code, and put it together myself so I fully understood it but it's throwing a miss ; error at me and I just do not see where

#
this addEventHandler ["HandleDamage", {
    params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitPartIndex", "_instigator", "_hitPoint", "_directHit", "_context"];
    private _health = getVariable ["VamHealthState", 100];
    _health = _health - _damage;
    if (_health > 0) then {
         setVariable ["VamHealthState", _health]; 
         } else {
        _unit removeEventHandler [_thisEvent, _thisEventHandler];
        _unit globalChat "My unlife will not end like this! I will not suffer my final death like this!";
        };
}];```
granite sky
#

Your setVariable and getVariable are missing the _unit parameter on the left side.

gray raptor
gray raptor
granite sky
#

You're missing the 0 return value.

#

That's what actually blocks the damage.

gray raptor
#

_damage = 0?

granite sky
#

See the code I wrote.

#

No, just 0; at the end of the function.

#

In SQF, code returns the value of the last statement.

#

And setVariable returns nil so that won't block damage.

#

(HandleDamage needs to return a number to override)

gray raptor
#

ahhh okay so handle damage is just going to take the last number in the function as the return?

#

that isn't attached to some other bit of code that is

#

or is it that it takes the final "number" I forget the actual word that any code shows in the event handler

granite sky
#

It takes the value of the last statement.

gray raptor
#

gotcha

granite sky
#

You should always return a value explicitly, because otherwise you can get weird bugs where you don't notice that the last statement returned something.

#

For example if the last statement was an addAction, that would actually override the damage because addAction returns a number.

gray raptor
#

ahhh okay

#

speaking of, if I wanted to apply this through an interaction how would one do that?

meager granite
little raptor
hallow mortar
#

The _damage value provided by the HandleDamage EH, and which you can modify by returning a number at the end, is the total damage for the selection which results after this hit damage is applied - not the delta damage inflicted by the hit.

#
params ["_unit", "_selection", "_damage"];
private _currentDamage = _unit getHit _selection;
private _hitDamage = _damage - _currentDamage;```
granite sky
#

You're setting damage to 0 though, so they're the same.

little raptor
#

iirc selection can be empty

hallow mortar
#

Also, it is per selection in every HandleDamage event, which is sometimes the overall damage for the unit (selection is ""), but often is not. It can be just the damage for one particular selection, like an arm or something.

granite sky
#

Ignoring the selection is probably fine here though. Just means that it's counting the sum of part & general damages.

#

The end result is that if you shoot the guy a lot, he'll eventually start taking damage.

#

The more likely problem is that you'd want to use pre-armour damage, and that's pretty challenging.

hallow mortar
# granite sky Ignoring the selection is probably fine here though. Just means that it's counti...

If you want to do somewhat accurate maths with the _damage value, I think you have to pay attention to it. They're trying to subtract the hit damage from their custom health pool, which means they need to find out what the hit damage actually is, and in order to do that they need to get the current damage, and the only current damage value that will give a helpful result is the one for the same selection.

granite sky
#

They're all 0 because it's returning 0.

gray raptor
#

Worrying about armor at the scale of health these guys have isn't a matter, besides most of them don't use it, and it really doesn't need to be super accurate just light weight.

granite sky
#

Well, assuming that the unit isn't injured before it gets the shield.

hallow mortar
#

Oh I see

gray raptor
gray raptor
# hallow mortar Oh I see

it's more important they can take 15 guys shooting them for a couple seconds than it is that it's properly calculated.

gray raptor
granite sky
#

It is worth noting that if the unit has taken damage already then you'd want to setDamage 0 when you add the shield.

#

Otherwise the damage taken might be scaled up drastically.

gray raptor
#

I see.

granite sky
#

(because _damage is the current, not the added damage)

gray raptor
#

ahhhhhhhhh I see.

hushed turtle
granite sky
#

hmm, I guess the input damage does get capped at 1 too.

#

...probably

#

(_damage certainly isn't)

gray raptor
#

From a 5.56 rifle

#

The FIA one

#

Same unit without the script is one shot

granite sky
#

hit value of 5.56 is about 9. That's divided by armour to get the part damage.

#

If you don't have armour then it's just the uniform of 2.

#

Humans are very fragile in Arma.

#

(1 on the body is a kill)

#

In Antistasi we rescale the base armour so that unarmoured targets aren't a one-shot.

#

(except with large stuff)

gray raptor
granite sky
#

I think the part damage (like the result of getHit) is capped to 1. _damage in HandleDamage isn't though. It'll return 17 or whatever for a 50cal hit.

#

Oh, I have a little table here:

        unarm    lvl2    lvl3
50cal        17.5    2.5    1.94
MX        4.7    0.69    0.53
9mm        2.65    0.38    0.29
hushed turtle
#

Damage unit can have ranges from 0 to 1, same for body parts

#

At 0.5 damage on legs you're limping

proven charm
#

does anyone happen to know how to detect incapacitated message in HandleChatMessage ? wiki says chatMessageType 2 is the kill but what about the revive stuff?

gray raptor
#

thanks for the help yall, I'll make sure my players know to appreciate the geniuses in this discord for their ability to hunt vampires

lilac kernel
# granite sky Apparently these return the loaded magazine as well, so you might want to subtra...

yeah i looked into it but im breaking my code currently when trying to assign to do the below.

private _mags = magazinesTurret [_turret, false];

_turret is assigned earlier and works for the rest of my code to show current ammo etc and its being called here

private _label = format["%1 [ %2 / %3 ]", _wName, _ammo, _mags];

if i take out the first section and remove , _mags and the %3 from the label it works fine.

#

fixed it, it was missing the vehicle object from the declaration of _mags

#

only problem is that its showing amount of all mags left, not currentweapon

blissful current
blissful current
#

It's weird. The day before it was working just fine. I booted it up yesterday and test again, and it did that weird behavior. I do get an error message during the process for no picture found. I'll address that later. Could that be hindering the process?

It seems like putting the sleep there keeps the subtasks from getting processed before the parent task, which goes against my current understanding that lines are processed one by one.

blissful current
errant jasper
#

Well if sleeps are in there you are doing something weird like running them scheduled or something.

#

Wrapping multiple task creation individually in remoteExec is a no-go of course.

blissful current
hushed turtle
errant jasper
# blissful current Tell me more about this please. This sounds like what I am doing I think. I remo...

Functions are executed in the scheduled environment; suspension is allowed.
Suppose you do remoteExec 5 BIS_fnc_taskCreate (perhaps indirectly). That is "equivalent" to basically spawning them

... spawn { [...] call BIS_fnc_taskCreate;};
... spawn { [...] call BIS_fnc_taskCreate;};
... spawn { [...] call BIS_fnc_taskCreate;};
... spawn { [...] call BIS_fnc_taskCreate;};
... spawn { [...] call BIS_fnc_taskCreate;};

Without examining the source in detail for BIS_fnc_taskCreate, I would expect it to manipulate some machine global state that could get messed up.

analog mulch
#

hi
been trying to make a heli to land on a invisible helipad and want it land and shut off its engine but i can't make them do the last part
tried heli1 engineOn false;

errant jasper
#

as Jouklik says you don't even need to use remoteExec.. But there is a difference between remoteExec a function that does 5 calls to BIS_fnc_taskCreate versus remoteExec'ing 5 individual calls.

hushed turtle
analog mulch
#

in this case its a heli

blissful current
analog mulch
#

weird,
heli setFuel 0;
didn't work either

#

i put it in the LAND waypoints Activation

errant jasper
blissful current
#

Yeah I just tried doing a call of the function and the tasks did not create at all.

hushed turtle
#

I would put task creation into initServer.sqf

blissful current
#

How would I go about running the code in there when the time comes? About 30 mins into the mission, when the players get to a certain spot I call the funciton, as it is now.

hushed turtle
#

I see

#

I meant for tasks created at the start. If you need to create task later, then you need something else

#

But I don't see a point in remote executing some function to create tasks.

blissful current
hushed turtle
#

In theory it should work even if you created them on client. Only on one client. Task framework should handle the networking

analog mulch
#

no luck with this

blissful current
thin fox
analog mulch
#

even having 1 of them didn't work either

thin fox
#

did you even try it?

errant jasper
#

don't you need a Condition Expression?

analog mulch
#

sync'd it to heli as the trigger owner

blissful current
#

Good catch, it should say this for owner only present to work.

thin fox
blissful current
# errant jasper Well I don't know how that function is implemented. You implied earlier that put...

Okay I've narrowed it down some. Here's the full picture of what happens:

  1. I call my function from the activation field of a server-only, trigger.
  2. I create the tasks in the function and if I do it this way, they do get created in order without the weird issues I explained before. Hooray! Except I don't want to do it this way.

I'm trying to do this differently because I want the parent category, of the tasks to be at the bottom of the task list. As far as I know there is no way to specifically order them. They are ordered by creation order. So what I have been doing (that apparently won't work) is:

  1. Use BIS_fnc_deleteTask to delete the tasks at the top of the function (for the ones I want reordered)
  2. Then create them again with BIS_fnc_taskCreate. This is the part that doesn't work from the function. They get deleted just fine, but I can't create them again. Except I can create them from the debug console. I'm not sure why it works from there but not the function.
#

@hushed turtle

#

I made a workaround. Instead of trying to re-create a task that was deleted I just created some tasks with a new name and kept the description and title the same. The player won't know the difference.

#

Is there any issue with calling a function from inside a function?

blissful current
#

Does this X mean "This is a bad idea." or "No, there isn't any issue."?

granite sky
#

turret paths are just arrays of numbers like [0,1]. They don't contain any reference to the vehicle.

granite sky
blissful current
lilac kernel
granite sky
#

After you delete a task, never touch the ID again :P

#

This was the source of most task bugs in original Antistasi.

#

Obey that one rule and the task framework is pretty stable IME.

blissful current
#

Why doesn't deleting tasks modules work? I use:

deleteVehicle testTask;

But I can still see the task in my journal.

granite sky
#

Given that I have never created a task module, I would guess that it's just pushing commands to the task framework, and deleting it doesn't do anything.

blissful current
#

Guess I need to convert that one to the task framework now that I know how to use it.

granite sky
#

Eden and zeus need modules to do things and that's often the only reason that the module exists. It's not fundamental to how the logic works.

blissful current
#

So far I'm starting to get the feeling that scripting tasks and triggers is better than using the editor placed versions.

granite sky
#

Triggers just sound like a pain in the arse to me. Especially if your events don't fit well within the system.

blissful current
#

I appreciate with scripting triggers that I don't have to hunt for activation code within the editor and I can just ctrl+f in a sqf and get what I'm looking for.

hallow mortar
#

Scripted and Editor-placed triggers are exactly the same, in the Editor it's just a UI for doing the same commands and manipulating the same object.

#

The real thing that scripting unlocks is using other detection and waiting commands, and event handlers, instead of triggers at all

tulip ridge
blissful current
errant jasper
#

JIP entities are not synced so that is at least one reason not to use modules that require sync lines.

pallid palm
#

server side respawn Vehicles modules are ok

errant jasper
#

Vehicle respawn module had several bugs which took like five years before patching.

Resync also requires the module rechecks or is notified. Something I haven't really seen a BI module support.

If you need support JIP stay away from the combo of BI modules and synchronization.

pallid palm
#

hmm i never had 1 thing go wrong in that case hmmm

#

yeah m8 i have not seen 1 bug

#

but then i only use vanilla

errant jasper
pallid palm
#

well it works great now it respawns my chopper over and over and over

#

i do remember someone made a respawn Vehicles script back in the day

#

and we hade to use that yes

#

but the respawn Vehicles modules work really great now

#

i love Arma 3 woohoo

blissful current
#

Very cool! So what does respawn = 3 do? Is that 3 tickets?

#

Thanks! I'll start messing around with this to see how it works.

blissful current
#

No thanks, the code you gave is enough for me to play with. Having fun with it now.

vapid scarab
#

As a fun fact, when I have missions with limited respawns, I always give players at least 1 personal respawn and then the team their total respawns. It gives a personal buffer of respawns for reckless players or MASS CAS events

pallid palm
#

not me: i'm mean that way: lol just kidding ๐Ÿ™‚

#

i like to set it to 10 respawns really ๐Ÿ™‚ i only make 10 player missions ๐Ÿ™‚

#

then you are careful not to die

#

i like it when theres only 1 life left then your really careful ๐Ÿ™‚

#

took me a long time to get all that correct: and the onPlayerKilled.sqf also: so like when the tickets run out: i have it set that each player that dies goes into spectating mode ๐Ÿ™‚

#

so they can see the other guys fighting

fair drum
#

the best way is to give respawns as objectives are completed

#

to replenish the pool

#

sort of like old school insurgency/insurgency sandstorm

analog mulch
thin fox
#

it lands and turn off its engine

#

heli landAt [helipad, "LAND"]

analog mulch
#

Yeah I tried landat and it worked, I also had to raise the trigger that fires engineon false a bit above ground

analog mulch
analog mulch
thin fox
last cave
#

FSM OR SQF???

I'm currently making a looping script for a soldier. I have a question: is it better to use FSM or just SQF with waituntil?

warm hedge
#

Pick whichever you want/easier to write and maintain

last cave
#

He ordered an attack on an orange. The orange was killed. Now he's the terror of all fruits. What's funny is he can't forget that the target was destroyed. Apparently there's some kind of bug causing the object to disappear and turn into pieces.

_unit=cursorObject;
_unit doFire t2;

faint oasis
#

I have a question ? Is it possible to set the "owner" of a projectile ? Like if you spawn a grenade with "createvehicle" for example or even a bullet.

warm hedge
#

Do you mean setOwner or setShotParents?

faint oasis
faint oasis
granite sky
hallow mortar
granite sky
#

setShotParents being SE is so weird that I think I checked whether it was true.

#

Shot hit/damage is always assessed locally to the shooter, isn't it? So isn't that where the parent matters?

hushed turtle
faint oasis
# hallow mortar Be aware that `setShotParents` is a bit of a weird command that's heavily affect...

apparently yeah, is it supposed to work on grenades too ? Because i thought it was only setting who "threw" the grenade and that you will get kills when that grenade exploded and kill enemies but apparently it doesn't work. I was executing that command on the local side, after that i tried to "remote exec" on the server and even with a global exec it still doesn't work so as you said, i think it doesn't work like i thought ๐Ÿ˜„

faint oasis
tulip ridge
faint oasis
hallow mortar
#

Any EHs would be on the ammo, not the magazine

faint oasis
hallow mortar
#

Does the grenade create any submunitions?

#

I don't have SOGPF installed so I can't really investigate myself oh apparently I reinstalled it at some point

faint oasis
hallow mortar
#

It's the particle effects

#

The EffectsSmoke property in the ammo config leads to a particle type in CfgCloudlets which is configured to behave as fire

hushed turtle
#

Any way to detect when AI gets stuck?

hallow mortar
granite sky
#

But note that with vehicles they're often not permanently stuck in that case. Often driving AI will go into a state after a near-collision where they inch backward or forward while waggling their wheels from side to side. After a few minutes they reset and progress to their waypoints.

#

If a unit hasn't moved then it's a pretty safe bet that it's permanently stuck.

#

There are cases where a unit will loop between two positions when attempting to board a vehicle, however.

#

With vehicle AI there are also cases where it looks like it's trying to do a three-point turn but keeps turning the wrong way and hitting the same building in the same place.

hushed turtle
#

Sometimes "PathCalculated" EH fires with path of length of 0, but no always

granite sky
#

Yeah that's just one case of many possible ways that units or vehicles can fail to move.

hushed turtle
#

In one house AI was moving in circles, unable to leave the house

granite sky
#

They usually manage that unless they're actually wedged into scenery.

#

Moving into buildings and moving to upper floors are the usual fail cases.

#

upper floors is just a clear bug but good luck getting anyone to look at it.

hushed turtle
#

They failed move down stairway just couple steps long from ground floor

granite sky
#

I gave up trying to make a perfect replication because the other bugs kept getting in the way.

hushed turtle
#

I tested other houses of the same class on the terrain, but wasn't enable to reproduce it. Only this one in particular is broken ๐Ÿ˜†

granite sky
#

Terrain height underneath does matter.

#

It shouldn't. That's at least one of the bugs.

hushed turtle
#

I didn't notice any relation to floors

granite sky
#

You can watch it with calculatePath. When AIs cross room boundaries it often does a recalcuation for some reason, and the recalculation uses the wrong Z values.

#

But there are other issues. Even when the path is correct it doesn't mean AIs can traverse it reliably.

hushed turtle
#

Stuck on such small stairway.

#

๐Ÿคฃ

#

There is like no wall blocking them. Maybe it's the bench down there ๐Ÿ˜‚

granite sky
#

yeah likely. Minor Z transitions are a general risk factor though.

hushed turtle
#

What do you do when you detect stuck AI. Move them to the next position on their path?

granite sky
#

Depends.

#

I think the only stuck AI routine I currently have on units is for NPCs that are following a player, so I just yoink them.

#

There are a few for vehicles. Some bounce to next waypoint, some give up and go into the despawner.

#

Want to write some custom escape logic but the tools suck.

hushed turtle
#

How to check if units fits into position? I mean no other objects blocking

granite sky
#

No good way :P

hushed turtle
granite sky
#

It'll likely generate false negatives.

#

For vehicles it generates false positives but that seems less likely for units.

hushed turtle
#

Just trying it out, it seems to work well

#

And now I am in rock ๐Ÿคฃ

#

Technically it did find clearance on ground for "CAManBase" ๐Ÿ˜†

granite sky
#

Being completely inside an object is straight up difficult to check with Arma commands.

#

Raycasts won't necessarily hit anything.

#

If you're not placing in buildings then you can do a raycast from above.

#

But that will block valid cases like being under a canopy.

tender fossil
#

Or like this

granite sky
#

You can do a proximity check for objects but unless you're near the arbitrarily-defined center then it won't help.

hushed turtle
#

I check if object has building positions to get idea if it's a house, but it's not always good. Sometimes even terrace can have building positions or even craters

granite sky
#

Also AIs can't necessarily path from building positions. Common fail there is the middle position on the small cargo towers.

#

It's placed too close to the handrail or something.

blissful current
#

I want to use it to adjust the respawn delay from the MP lobby param screen. I played around with it a little, tried to pass 30 (seconds), but got an error for number, expected code.

hushed turtle
#

number is second param

blissful current
#

What is the first index for?

hushed turtle
#
[{true},30,"Delay in effect"] call BIS_fnc_setRespawnDelay; // Delays every respawn by 30 seconds
blissful current
#

Thanks! I'll give this a shot:

private _respawn_delay = [paramsArray, 1, -1, [0]] call BIS_fnc_param;
[{true}, _respawn_delay, "Delay in effect"] call BIS_fnc_setRespawnDelay; 
blissful current
hushed turtle
#

I've gave example based on wiki, which is pretty bad for this function

#

Can't help much more without spending time by tyring it myself

#

It uses setPlayerRespawnTime, which has local effect

jolly sierra
#

question that has been probably asked by so many players, but not many of them tried to ask online (found only 1 reddit post lol): is there any way to re-order units, that are still alive? If you have units 2, 3, 4, 5, 6 and unit 3 and 4 die, then you got 2, 5, 6. This becomes a problem is you got 10+ units, and sometimes you need to switch between pages to just select 1 guy, if let's say your squad is now 2, 3, 4, 5, 6, 7, 8, 9, 25. As far as I tried to study the wiki, there is no such function to like setUnitNumber but maybe I am missing something?

thin fox
blissful current
thin fox
#

so show me then, I couldn't find anywhere, can you change the respawn delay midgame?

pallid palm
#

you can change that 1 time to whatever

#

ok i made a little script whil we were talking

#

but keep in mind this is just part of my team respawn script ok

thin fox
#

?

granite sky
#

units group player joinSilent group player;

jolly sierra
#

i'll try it

#

it will work in MP?

granite sky
#

well, that's player-local.

jolly sierra
#

ok

granite sky
#

So it'd need to be executed on the player's client who needs their group re-ordered.

jolly sierra
#

oh yeah it works

granite sky
#

Might also reset some things that you don't want to reset :P

jolly sierra
#

yeah this will need to go through some testing, but this is what I needed! thanks

flint topaz
#

paramsArray#3 โค๏ธ

pallid palm
#

see i like to have many options for when im teaching Arma 3 to people so i can make it as hard as i want or as easy as i want

#

like that @flint topaz up there see

#

i never did it that way before ๐Ÿ™‚

#

what don't you like @fair drum ? i edited that thumbs down i forgot a line

#

like i said that only runs if all respawn tickests are gone

#

oh thx m8 @flint topaz

finite bone
#

How do I ensure players are falling from the sky with a parachute equipped? When I set the altitude (after force setting a parachute) the character just falls instead of going into the parachute / skydiving animation

pallid palm
#

well i can send you my para jump script if you like

finite bone
pallid palm
#

sure m8

finite bone
pallid palm
#

oh i have it set to a 70m Alt in mine so you never splat on the ground lol ๐Ÿ™‚

sly cape
finite bone
#

I've already added the parachute to them with addBackpack - I want them to be able to basically use it. When I teleport the character to say 2000m the character is in a default falling animation rather than the 'freefall' / skydive animation

hallow mortar
pallid palm
#

i think there is a default para jump thingy in Arma 3 right

#

but i made my own

#

lol i even made a para eject script: so you can eject out of a chopper and para to the ground ๐Ÿ™‚

blissful current
#

Is this valid?

while {!alive player} do {
// code
};
pallid palm
#

yup looks ok to me

#

you may want a sleep in there tho

#

but i would use _player

hallow mortar
pallid palm
#

well im not sure but i always did that way i forgot why

blissful current
#

I feel like it needs to be wrapped in a Killed EH.

pallid palm
#

i guess i was useing _player as a var

blissful current
#

If I just put it in a SQF it will only run once, not continuously right?

hallow mortar
#

You could also start it by any other means that happens to occur while the player is dead.

pallid palm
#

i would use a if statement inside the while do loop ๐Ÿ™‚

little raptor
flint topaz
#

Be very careful using loops generally, EHs are typically always a better idea for most use cases

errant jasper
#

I don't even remember, but I think for respawns you would need to readd the EH for the new object.

hallow mortar
blissful current
flint topaz
#

Most EHs placed on a player will persist

flint topaz
#

player addEventHandler ["Killed", {
params ["_unit", "_killer", "_instigator", "_useEffects"];
}];

hallow mortar
#

There's no EH for specifically detecting player deaths. You could use onPlayerKilled.sqf, or assign a killed function in the respawn template, or just have a check in your Killed EH.

#

I think people should really read the question more closely

flint topaz
#

Yes? If you want it to โ€œspecifically detect playersโ€ just assign it to the player?

old owl
#

Any instigated death should be handled in that

hallow mortar
pallid palm
#

i do it in the onPlayerKilled.sqf really tbh

old owl
flint topaz
#

Thatโ€™s semantics

pallid palm
#

ver name

flint topaz
#

Whatโ€™s his purpose? To get back on track

hallow mortar
# flint topaz Thatโ€™s semantics

It was the point of the question. The alternative they were considering is onPlayerKilled.sqf, which is essentially a mission EH; object EHs are not equivalent.

blissful current
#

Everyone gave valid solutions to my question but Nikko answered the actual question. But thank you everyone.

flint topaz
#

As long as you arenโ€™t using a loop for this Iโ€™m happy

hallow mortar
# old owl What do you mean by manually identify the player?

It's an object EH, not a mission EH. You can't just plop it in and let it automatically fire for any player death; you have to get player and attach the EH to it. It's not impossible, but it does require you to build something to do it right yourself. Also, the player unit can be switched in ways that object EHs don't follow.

flint topaz
#

So any EH solution works

pallid palm
#

lol plop ๐Ÿ™‚

hallow mortar
flint topaz
#

I do love development for how many different ways you can solve a problem, but also I do hate it for it aswell sometimes.

pallid palm
#

well we should all do as Nikko says hes the best imho

#

i mean i agree with you m8

hallow mortar
#

If there's one piece of advice from me you can follow, it's "don't uncritically trust me, I'm regularly wrong"

old owl
pallid palm
#

well you were never wroung with teaching me so well you know

granite sky
#

OnUserSelectedPlayer does appear to fire for all cases where the player unit changes btw. Joining, respawning, selectPlayer.

#

I don't think there's any similar client-side handler though, oddly enough.

pallid palm
#

wow that looks cool

#

well Actually i don't remember anyone being wrong when they were helping me

#

i love you guys ๐Ÿ™‚

blissful current
#

Are values required to be numbers?

class RespawnMode
    {
        title = "Respawn Tickets Mode";
        values[] = { player, missionNamespace };
        texts[] = 
        {
            "Per Player",
            "Global"
        };
        default = missionNamespace; 
        code = "";
    };
tulip ridge
#

Those are just going to be strings when evaluated

hallow mortar
#

Parameters values can only be numbers

#

Just use 0 and 1 and select from an array in whatever script uses them

blissful current
#

Ok, so I will set them to a number then do a check based on the number and assign the variable what I want.

blissful current
# hallow mortar \* or `if`, `switch` etc
private _respawn_mode = [paramsArray, 2, -1, [0]] call BIS_fnc_param;
if respawn_mode = 0 then { respawn_mode = player } else { respawn_mode = missionNamespace };
#

Is select better than this?

hallow mortar
#

You should use param or params rather than BIS_fnc_param. Those are the command implementations of the same thing; they're inherently faster.
Personally I like to use e.g. respawn_mode = [player, missionNamespace] select _respawn_mode as I find it's tidier. It's also more easily extensible if you decide to add more than 2 options.

old owl
#

Using select as a ternary operator is also faster than using an if in circumstances of a generic string, int, etc due to if being considered a type.

blissful current
hallow mortar
#

Looks fine

blissful current
# hallow mortar Looks fine

I was running that code initially from initServer.sqf, but since player won't work on the server I moved it to initPlayerLocal.sqf. But now that I think about it if someone JIP then it probably would reset the tickets that were chosen at the start of the mission. Having a hard time thinking of the solution here.

private _ticket_amount = paramsArray param [1];
private _respawn_mode = paramsArray param [2];
_respawn_mode = [player, missionNamespace] select _respawn_mode;
[_respawn_mode, _ticket_amount] call BIS_fnc_respawnTickets;
#

I can pass an object to the function. When I do player it keeps track of them from initPlayerLocal. But I have 8 players so how could I put 8 variable names in there?

hallow mortar
#

BIS_fnc_respawnTickets is global effect and it's an adder, not a setter. In shared ticket mode you should run it on the server only. (Or on one machine only; the server is the best machine to pick for initialisation)

blissful current
#

Is there different command if I wanted to give each player only 3 tickets?

hallow mortar
#

In per-player mode it's fine for every machine to run it, using player as the object. Each machine will handle its own player's tickets.

#

It's only in shared ticket mode that you want to make sure only one machine runs it for each ticket modification event (e.g. initialisation). If every machine does it for the same event, they're all modifying the same counter, so you could end up with tickets * machines being added

blissful current
#

Okay yeah, that's what I was thinking too. But as you can see I've attempted to give the players a choice on the params at the lobby.

#

And I can't put it on the server if I want per player mode right? So that means I need to also put it in initPlayerLocal.sqf with some sort of gate to stop it from running if players JIP, I guess?

#

Am I explaining myself well enough?

hallow mortar
#

No, it just means you make it run only on the server if it's in shared mode

#

Use something that also runs on the server (init.sqf for example) and have a check

#

This is one way, there are others:

if ((_respawn_mode == 1) && !isServer) exitWith{};```
blissful current
#

Hmmm, I think I understand. I'll give this a shot tomorrow! Thank you.

finite bone
#

If playSound3D is created in the server, can it be terminated using stopSound and it terminates the sound for all?

warm hedge
#

Likely not according to BIKI. It should be better to playSound3D locally and let clients handle it, IMO

versed trail
#

Does anyone have a working example of how they use kbTell for something in vanilla? I'm struggling to get the parameters right here; my current line is
BIS_ardefenderc kbTell [TNY_Dummy, "ta_tanks_m03_am_incoming", "ta_tanks_m03_010_am_incoming_ARDEFENDERC_0"];
which matches with what the BIS_fnc_kbTell kicks out, which works fine and plays the correct audio; I confirmed that the right topic was added with kbHasTopic afterwards. But I'm trying to write my own wrapper function for kbTell right now and I cant get any variation of the line to properly output audio. As far as I can tell I've done everything right:

  • The sender and reciever are both units in the game world and both have the topic added to them
  • The topic is _mission + "_" + _topicName which after I ran BIS_fnc_kbTell and it worked normally, that topic was added to both units
  • The sentence ID line is visible in the log from BIS_fnc_kbTell:
    ["%1 / %2 / %3: %4 > %5 (channel: %6; variant: %7)",_mission,_topicName,_sentenceId,_from,_to,_channel,_listSentencesVariants select _s] call bis_fnc_logFormat;
    "ta_tanks_m03 / am_incoming / ta_tanks_m03_010_am_incoming_ardefenderc_0: BIS_ardefenderc > BIS_arhq (channel: radio; variant: )"
    No clue what's going on here. I really just need one working example of how to use the command and what exact config values it references so I can build something off of it; I havent gotten anything outputting properly with just the command yet.
hallow mortar
#

Don't forget you can open BIS_fnc_kbTell in the function viewer to see how it does it

remote cobalt
#

Hey folks, does anyone know a good way to check if a playerslot is used in a multiplayer session?

I was thinking about giving all playerslots some variable and checking if alive, but it throws an error when the slot is not in use (because obviously the variable does not exist) but I can't think of anything more clever than that, so I was hoping maybe one of you would have a better idea.

tulip ridge
remote cobalt
pallid palm
#

yes Tiny what did you want to say ?

versed trail
pallid palm
#

oh that stuff i don't know about

#

i never used kbTell stuff

#

i hope someone in here replys to you mate

vagrant cargo
#

Hello, does anyone have a script to respawn with gear that was on death? I'm new to mission building things and ACE and 3den didn't work a few times, so i kinda need a script just in case

radiant lark
#

A player can hear from two radio channels simultaneously, right?
But can it speak in two channels simultaneously too?

hallow mortar
#
  1. yes 2) you can try binding two channel PTT keybinds and pressing them both at the same time, and seeing what happens, but I'm almost certain the answer is no; only one channel can be selected at a time
versed trail
ocean birch
#

Hello, i have a question about AI falling out of vehicle when they die, i dont really know how to make them stay inside. Does anybody have a solution to this problem?

sly cape
ocean birch
#

It just looks ugly for screenshots

ocean birch
#

Im not using that at the moment.

pallid palm
#

yeah by default they stay in the vehicle

ocean birch
#

Maybe its ACE medical, that would make sense for multiplayer purposes

sly cape
pallid palm
#

so do we play a wss sound file: the same way we play a ogg sound file ?

#

or is it diff

ocean birch
sly cape
pallid palm
#

most peopl want them to fall out

#

but by default vanilla game they stay in the vehicla

hushed turtle
#

Until someone gets in

pallid palm
#

roger yes

pallid palm
#

i always look at thier dead body burning up in the vhicle lol

unkempt flame
#

Hey, I need help with CBA events for the DIRT mod. I'm trying to make the textures appear on units using the init so I can make a screenshot but I have no idea how to make use of the features. There is documentation on his Github (though I cannot send links apparently). Any help is appreciated.

ocean birch
pallid palm
#

well i don't use any mods so you know my game works perfretly ๐Ÿ™‚

sly cape
pallid palm
#

omg 40 holy

ocean birch
ocean birch
pallid palm
#

oh man

sly cape
ocean birch
#

its some maps and like basic mods like ACE cup, some maps, gear mods

pallid palm
#

good luck with that m8

#

them mods seem to be ok tho

#

i always have 3 people for sure in my community : me myself and i: and other people join lol ๐Ÿ™‚

ocean birch
#

I mean i listed trough all off them and none seems to be doing falling out of vehicle

pallid palm
#

lol

ocean birch
#

my community was on a break for like a year and no one wants to play anymore except 4 of us๐Ÿ˜ญ

pallid palm
#

nice

#

4 is fun

#

you just have to shoot more enemy thats all ๐Ÿ™‚

#

i found 2 of the most Awsome Terrains in the workshop: really nice : no cup or anything:

ocean birch
pallid palm
#

1 is called Lybor and the other is called prei_khmaoch_luong

ocean birch
#

khmaoch is great for vietnam missions

pallid palm
#

yes really cool map

#

but i would like to take them really thick tress out of the map i always get stuck on them when im prone lol

ocean birch
#

hahahaha yea that happens sometimes

pallid palm
#

lol ๐Ÿ™‚

#

but all in all its a great Terrain

#

other then them Terrain: i only use vanilla game and i can make the enemy look like VC ๐Ÿ™‚

#

or really close anyway

#

i use the weapoms for the Old Man DLC on the enemy ; but i don't own the DLC ๐Ÿ™‚

ocean birch
#

Thats great, i must use mods cause i cannot make like serbian or yugoslav forces with vanilla game

ocean birch
pallid palm
#

yes sir

sly cape
pallid palm
#

i don't want to go that far they may take that stuff away if i do lol ๐Ÿ™‚

sly cape
pallid palm
#

who knows

#

i'll most likely buy that stuff some day ๐Ÿ™‚

sly cape
pallid palm
#

the amount its not a worry: its if i want to clog up my clean vanilla game ๐Ÿ™‚

blissful current
hallow mortar
pallid palm
#

oh yeah nice right

versed trail
pallid palm
#

i do Actually have 1 mod and its a Huey Chopper mod but i never use it ๐Ÿ™‚

#

unless i feel frogy

#

i think my vanilla vietnam missions look better then the DLC's

#

if you can use a littel brain washing kinda lol ๐Ÿ™‚

hushed turtle
#

Vanilla Vietnam what?

pallid palm
#

i found that no one really cares what any thing looks close to: when the bullets start flying ๐Ÿ™‚

#

@hushed turtle Vanilla Vietnam missions

#

from selecting great places on the terrains and useing all the stuff in the vanilla game i can make it appear like vietnam

hushed turtle
#

On Tanoa?

pallid palm
#

no no even Altis

#

or the other terrains i talked about

#

i can make you feel like you are anywhere: with my command of the editor ๐Ÿ™‚ well i cant make you feel like your in space ๐Ÿ™‚ or can i ๐Ÿ™‚

#

lol Awsome ๐Ÿ™‚

#

what i find helpful is the hide modules

#

like some of the names of my missions are USMC Insertion Nam: NVA VC Attack: and ummm COOP Nam USMC: oh and VC Island: ๐Ÿ™‚

#

them missions a very well liked i was told by my clients

#

as a matter of fact i had the most fun in them Arma 3 missions

#

each time we had 9 guys

#

i think the fun-est Mission was the USMC Insertion Nam:

#

and theres only like 78 enemy in the whole mission But: well you know ๐Ÿ™‚

#

oh hay guys don't get me wrong none of this would be posiable with out all the help i got from you guys here in this channel:

#

thx so much for all the help from you Awsome people

#

to many to name'

steady matrix
#

Decided to bring an old project back to life. Working on some command and control stuff for a special mission/sandbox campaign I've been working on. Might eventually make the command and control things just its own damn mod at some point. But here's a little sneak peak of some script work.

split tulip
#

Hey everyone, I hope that out of all the channels, I hit the right one here. I'm currently trying to edit the radar values of the CSAT Chronos Radar, the short of it is, that the thing is way too powerful and is picking up assets in my mission, it has no right too (Objects completely obscured by terrain for example). My simple solution, well I thought it was simple, was to look for resources that would allow me to edit the radar, that is where I stumbled across the Sensors Config Reference, which does exactly what I'm looking for. I want the radar system to basically ignore anything that is below a certain altitude, and whilst were at it id love to change some other values.

From my admittedly extremely limited knowledge of scripting, Ive at least been able to understand that this is not something I can set in the assets ini, in eden, but it something I need to set in the config. Considering this if for MP that is well above my level of competency. Here is the question, does anyone know a work around to achieve what im looking for, or has any further resources I could look into (I have not been able to really find anything relevant that isn't majorly outdated in regards to how to set up a SAM / Radar system in the way I'm looking to do it)

I should add that I've also been throwing these questions into multiple AIs like GPT and have not gotten any further, they just don't have that in-depth level of understanding about Arma I guess.

Thanks ๐Ÿ˜„

chrome wigeon
#

hey guys

#

I've been trying to set up a "regular" camera position for a playable dog unit

#

however I get a lot of stuttering and weird movement...any other ways?

manic sigil
#

Making a function to replace some composition-based spawning, and it works except that the helicopters full of troops arrive at the landing zone, hover, then mark the waypoint complete.

Scripted-in passengers inside have "GET OUT" waypoints at the planned LZ, tried both adding at moment of creation and when the helicopter was shortly to arrive, makes no difference.

Even when I manually work the helicopter around to touch down via new waypoints, the passengers dont disembark, though I added a little loop to force them out faster than the default speed for utility's sake.

I swesr I read something about Get Out waypoints and vehicle or groups needing a commander/leader, but they both do z the helicopters are fully crewed, the teams are properly grouped.

Any thoughts?

thin fox
split tulip
split tulip
#

That's fine. This is for a Campaign we are starting mid January, so I got plenty of time. I might be able to figure it out, I didn't think of that approach. Did you do this direct in eden init or did you handle it with an sqf?

thin fox
#

that's basically what my script does

split tulip
manic sigil
split tulip
# thin fox All you need to do is to have a loop to check the radar's sensor, like **getSens...

I just wanted to let you know that this worked like a charm! Thank you so much man, the only wierd thing is when using the radar + sam, the sam lock drops and relocks with the loop, which the tungusta I used to test with didnt. But its not a huge deal as its still able to fire and the missle tracks just fine. So I can just call that, broken outdated tech doing wierd things and call it a day. Thank you again, this saved me so much time!

thin fox
manic sigil
# manic sigil Alright, managed to fix the infantry transport somehow, but now the slingload he...
//within a Switch type

_vicType = selectRandom ["cwr3_o_uaz_dshkm","cwr3_o_uaz_ags30","cwr3_o_uaz_spg9"];
_vic = createVehicle [_vicType, (getposasl _trans vectoradd [0,0,-10]),[],0,"none"];
_trans setSlingLoad _vic;

//After the switch type

_vic = getslingload _trans;
_vicGroup = createGroup [east,true];
_vicGroup createVehicleCrew _vic;
_trans setSlingLoad _vic;
_wp1 = _vicGroup addWaypoint [_tgt,0];
_wp1 setwaypointtype "MOVE";

//_crewGroup is the _trans pilot group

_wp1 = _crewGroup addWaypoint [_halfwayThere,0];
_wp1 setWaypointType "MOVE";

_wp2 = _crewGroup addWaypoint [_tgt,0];
_wp2Type = "UNHOOK";
if (isNull getSlingLoad _trans) then {_wp2type = "TR UNLOAD"};
_wp2 setWaypointType _wp2type;

//Loitering gunship
if (_type == "MI24") then {
_wp5 = _crewGroup addWaypoint [_tgt,0];
_wp5 setWaypointType "LOITER";
[_crewGroup,_wp5] setWaypointLoiterAltitude 100;
[_crewGroup,_wp5] setWaypointLoiterRadius 500;
[_crewGroup,_wp5] setWaypointtimeout [180,180,180];
_trans limitSpeed 75;};

//Bugging out
_wp3 = _crewGroup addWaypoint [_halfwayBack,0];
_wp3 setWaypointType "MOVE";

_wp4 = _crewGroup addWaypoint [_endPos,0];
_wp4 setWaypointType "MOVE";


//final approach
waitUntil {_trans distance _tgt <500};

_helipad = createVehicle ["Land_HelipadEmpty_F",_tgt,[],0,"none"];
{_x addCuratorEditableObjects [[_helipad], true]} foreach allcurators;   


If (isNull getSlingLoad _trans) 
then
    {
    _trans landAt [_heliPad,"Get Out"];
    //Yes, I have to use this or it flies off

    WaitUntil {isTouchingGround _trans};
    {doGetOut _x} foreach (crew _trans - units group driver _trans); 
    {moveOut _x; unassignVehicle _x; sleep 1} foreach (crew _trans - units group driver _trans);  

    waitUntil {sleep 1;    
    count fullCrew [_trans,""] == count units group driver _trans;}; 
    }   

Else
    {
    Waituntil {isNull getSlingLoad _trans};
    };

//Exfil orders and deletion when back to the starting point
analog mulch
faint burrow
#

It's most likely LE since almost all UI commands/functions are LE.

pallid palm
#

holy shit my RPT file whent down to 47 lines: after i defined the Roles in My missions: wow Awsome

thin fox
#

?

pallid palm
#

i was not defining the roles in the Description.ext in my missions before and my RPT file was like 190 lines or more

#

now its 47 lines

#

which is Awsome