Jump to content

Recommended Posts

Is there any documentation about all possible "map types" used with nearestTerrainObjects?

It seems to work with such filters as "tree", "rock", "bush", "chapel" etc. But I can't find anything like these in configs? Or are they defined in the map itself or something?

 

Have a look in class RscMapControl

Share this post


Link to post
Share on other sites

Have a look in class RscMapControl

I thought I did, but apparently not closely enough. Found them now.

Thanks!

Share this post


Link to post
Share on other sites

is there any ETA on when GetMousePosition is going to make it into Stable?

 

i kind of don't want to make a workaround that is going to be obsolete for sure very soon.

Share this post


Link to post
Share on other sites

An overview of some recent scripting changes/additions

Private keyword

A pretty much unknown keyword has existed in Arma series for a long time called "local" (not to mistake for "local" MP command), that allowed creation of private variables on the fly. Considering that this functionality has not been documented anywhere until recently and practically not used by the community, it has been decided to rename this keyword to "private" for clarity and convenience. If you happened to start using it recently, please update your scripts (see example usage: private).

Param, params

param and params commands have been modified and will now show error message on screen and log to .rpt when wrong type of argument is passed. The difference to the original functionality is only that type mismatch errors cannot be suppressed. If you would like to handle data types by yourself, several handy type comparing commands have been also added:

isEqualType - compare types of 2 values
isEqualTypeAll - match type of all array values to type of a value
isEqualTypeArray - compare types and order of values from one array to another
isEqualTypeParams - compare types of passed params to a given template
isEqualTypeAny - match type of a value to any type of value in array
as well as configNull - non-existent config

In other news:

addWeaponItem command had a long awaited fix (and all addXXXWeaponItem counterparts).
productVersion now also returns platform (Windows..etc)
throw and try commands have been extended so it is now possible to pass argument to try {} scope and use if () throw ... construct instead of if () then {throw ...}.

New Commands

Stamina implementation

allowSprint
enableStamina
getAnimSpeedCoef
getStamina
isSprintAllowed
isStaminaEnabled
setAnimSpeedCoef
setStamina

UI

pixelH - UI height of a pixel
pixelW - UI width of a pixel
ctrlAngle - rotation angle of control ST_PICTURE
ctrlSetAngle - set rotation angle of control ST_PICTURE

Misc

nearestTerrainObjects - allows to return map objects, such as "Rock", "Tree", "Bush"...etc
getAimingCoef
flagSide - return current flag side, to complement setFlagSide
flagTexture - return current flag texture, to complement setFlagTexture
checkVisibility
inPolygon - command for finding point inside polygon, fast algorithm
setObjectMaterialGlobal - JIP persistent object material setting, to complement setObjectTextureGlobal
disableNVGEquipment - disables Night Vision equipment of a vehicle, disableTIEquipment now only disables Thermal Vision
getMousePosition - to complement setMousePosition

  • Like 8

Share this post


Link to post
Share on other sites
New Commands

 

Stamina implementation

getAnimSpeedCoef

isSprintAllowed

setAnimSpeedCoef

 

UI

ctrlAngle - rotation angle of control

ctrlSetAngle - set rotation angle of control

getMousePosition - to complement setMousePosition

 

awesome stuff!

 

quick (possibly stupid) questions.

 

ctrlSetAngle is for 2d controls? :o

 

setAnimSpeedCoef will actually allow anim speed change at runtime? :o

Share this post


Link to post
Share on other sites
ctrlSetAngle is for 2d controls? :o

 

setAnimSpeedCoef will actually allow anim speed change at runtime? :o

I guess the angle is for 2d controls, yes.

I briefly tried it with default RscText: the angle values change but visually it stays the same, so I guess there's some prerequisites. Some config values? Style?

 

player setAnimSpeedCoef 15; //enter Road Runner mode. Meep meep!

Doesn't seem to apply to all animations though.

Share this post


Link to post
Share on other sites

Private keyword

A pretty much unknown keyword has existed in Arma series for a long time called "local" (not to mistake for "local" MP command), that allowed creation of private variables on the fly. Considering that this functionality has not been documented anywhere until recently and practically not used by the community, it has been decided to rename this keyword to "private" for clarity and convenience. If you happened to start using it recently, please update your scripts (see example usage: private).

 

You confuse me. Private is documented since OFP, was used since then in almost every script I could see, and without it functionality is compromised most of the time.

Share this post


Link to post
Share on other sites

I'm curious about inPolygon. Does this mean we'll be getting something along the lines of drawPolygon as well? It would be neat if we could draw sectors on maps without using elipses or rectangles.

Share this post


Link to post
Share on other sites

  • Added: execVM and spawn command now define a _thisScript variable containg a handle to the SQF script
  • Added: execFSM now defines _thisFSM parameter containing a handle to the FSM file

Had to actually like a post because this is just awesome sauce :627:

Share this post


Link to post
Share on other sites

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

Why was this change made to the params command? It kinda negates the entire point of having an elegant way to safely handle incorrect input.  :mellow:

Share this post


Link to post
Share on other sites

To be honest I sort of like it, though the RPT error is backwards, it complains about the type provided being the type expected, and the type expected being the type provided. But yea, it gives hard validation to input in a way that matches the rest of the language. I just wish there was a way to do it on non-optional params. Right now you can not define non-optional params as having a required type (which I guess kinda makes sense in terms of the SQF engine, in that it doesn't stop the actual execution, though that'd be nice too).

The best would be if it threw the RPT error and threw an exception as well.

Share this post


Link to post
Share on other sites

To be honest I sort of like it, though the RPT error is backwards, it complains about the type provided being the type expected, and the type expected being the type provided. But yea, it gives hard validation to input in a way that matches the rest of the language. I just wish there was a way to do it on non-optional params. Right now you can not define non-optional params as having a required type (which I guess kinda makes sense in terms of the SQF engine, in that it doesn't stop the actual execution, though that'd be nice too).The best would be if it threw the RPT error and threw an exception as well.

you mean optional? you can use param commad separately for optional params, or use isEqualTypexxx commands to handle optional param type

Share this post


Link to post
Share on other sites

Tweaked: The random command now accepts an array as alternate syntax to support Gaussian distribution

That's nice. :lol:

 

However, I'd really prefer to use mean and variance instead of min, mid, max.

Any chance this could be implemented as well?

 

random x: uniform distribution

random [mu,variance]: gauss

random [min, mid, max]: non-symmetric gauss? How is this even implemented? Like a piecewise function that isn't really C2 continuous at mid? :wacko:

 

Edit: okay, either I'm too dense, or the given examples might need some more explanation.

random [0,5,10]: okay, I guess I can imagine what's happening here. Mean at 5, with a variance of ~5/4.

random [0,10,0]: so now max < mid. What does this mean? Is max simply irrelevant here? Or is the actual max mid+max or something? From the given data, mean is simply at 10 now, but what about the variance?

random [0,10,5]: uhm... okay what now? Variance got smaller (with a larger max.)?!

 

I don't get it. :(

 

Double edit: oh... so that just flips/mirrors back around the mean? I.e. random[0,10,0] is actually the left side of mu=10, variance=5/4... just with twice the amplitude? And random[0,10,5] works similar, just that the flipped right side is now also skewed (or has a different variance) before it merges/overlaps with the righthand side? Okay, that makes kind of sense, I guess...

Share this post


Link to post
Share on other sites

Missed this new random thingy completely, BIS is on a awesome roll right now :)

Share this post


Link to post
Share on other sites

With terrainSpeedCoef finally public now, we can affect vehicle movement depending on weather conditions or any special custom cases?

 

Does the engine handle the terrainSpeedCoef already depending on weather?

 

Any insight welcome.

Share this post


Link to post
Share on other sites

Can we have a missionEventHandler entityCreated so we can tell when things have been spawned.

Would solve all those scripts that iterate allUnits waiting for units to be spawned.

I realise there is the init eventHandler but this is of little use to mission makers.

And i realise that things should be added when you spawn something but if your trying to catch units that are spawned by someone else's script package and they have not given you a sciptedEvent your either stuck iterating allUnits or editing others scripts.

I think it would be quite a handy feature, not just for units but anything from CfgVehicles/CfgNonAIVehicles.

What do the rest of you think? worth while? or am i missing something?

  • Like 5

Share this post


Link to post
Share on other sites

-snip-

Nevermind :) I thought VBS had that functionality, but I must have misremembered. Seems like a reasonable request to me.

Share this post


Link to post
Share on other sites

...

What do the rest of you think? worth while? or am i missing something?

 

Do want.

Share this post


Link to post
Share on other sites

An overview of some recent scripting changes/additions

nearestTerrainObjects - allows to return map objects, such as "Rock", "Tree", "Bush"...etc

inPolygon - command for finding point inside polygon, fast algorithm

 

Anybody know if there's going to be a BIKI document on these two?

 

Also as stated before, I do hope they're adding in a drawPolygon command to complement being able to check if a position is within one. We'd finally be able to draw sectors on maps that aren't rectangles or ellipses!

  • Like 1

Share this post


Link to post
Share on other sites
Changed: setVariable and getVariable now also work with <display> and <control>

allVariables doesn't seem work with these.

The Biki claims it should work with controls but seems to just return empty array (or I'm doing something wrong)..

 

In case of display gives an error about display not supported obviously.

 

So if at all possible allVariables should be amended accordingly.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×