ACE3 icon indicating copy to clipboard operation
ACE3 copied to clipboard

1.56 New Commands Conversion

Open jonpas opened this issue 11 years ago • 27 comments

  • https://community.bistudio.com/wiki/selectRandom selectRandom _arr _arr select floor random count _arr
  • https://community.bistudio.com/wiki/apply [1,2,3] apply {_x * 2} [[1,2,3], {_this * 2}] call ACE_common_fnc_map
  • https://community.bistudio.com/wiki/select [1,2,3,4] select {_x > 2} [[1,2,3,4], {_this > 2}] call ACE_common_fnc_filter
  • http://feedback.arma3.com/view.php?id=26682 ["one", "two", "three"] param [[1, 2, 3] find 5, "not found"] ["not found", "one", "two", "three"] select (([1, 2, 3] find 5) + 1) Note: param does not set the variable to private like params

Direct conversions:

  • [x] To joinString from
    • [x] CBA_fnc_join
  • [x] To splitString from
    • [x] CBA_fnc_split
    • [x] BIS_fnc_splitString
  • [ ] To AGLToASL from
    • [ ] FUNC(positionToASL)
    • [ ] EFUNC(common,positionToASL)
  • [ ] To ASLToAGL from
    • [ ] FUNC(ASLToPosition)
    • [ ] EFUNC(common,ASLToPosition)
  • [x] ~~To #include "..\"script_component.hpp" (inside function folders) from~~
    • [x] ~~#include "\z\ace\addons\<component>\script_component.hpp"~~
    • We won't be doing this :+1:

Other improvements (just for reference, not necessary to complete this issue):

  • lineIntersectsSurfaces - major improvements (attach, frag, missile guideance, laser ...)
  • getAllHitPointsDamage / setHitIndex / getHitIndex - can make repair work on sub turrets that have identical hitpoint names
  • getModelInfo - should improve wire cutters
  • didJIP - JIP detect in common
  • magazinesAllTurrets - rearming
  • objectParent

Add others in comments. Those checked off above are either done or not found in ACE3 codebase.

jonpas avatar Aug 23 '15 17:08 jonpas

I don't know if remoteExec is a great idea. I haven't looked into the "security" functionality of it yet, could users theoretically break code that uses it?

kymckay avatar Aug 23 '15 17:08 kymckay

@SilentSpike They've added a great deal of security functionality to it, from quick BIKI read you can now white-list things through CfgRemoteExec. I was just thinking it could be a better replacement in terms of performance for the current remote execution framework in ACE3.

jonpas avatar Aug 23 '15 17:08 jonpas

I mean to say, would the "security" functionality result in ACE scripts being blocked if the user configures it a certain way

kymckay avatar Aug 23 '15 19:08 kymckay

Afaik, it would. Server admins can disable RemoteExec completely.

bux avatar Aug 23 '15 19:08 bux

Ah, I see.

jonpas avatar Aug 23 '15 19:08 jonpas

Kinda defeats the whole purpose of the command :stuck_out_tongue: Good job BI :star2:

(Will have to look into to check that is the case, but from what I've read in passing it sounds that way too)

kymckay avatar Aug 23 '15 19:08 kymckay

It's for Alive, Koth, Epoch etc... servers

bux avatar Aug 23 '15 19:08 bux

Easy, drop-in stuff:

  • [ ] AGLToASL replaces fnc_positionToASL.sqf
  • [ ] ASLToAGL replaces fnc_ASLToPosition.sqf
  • [ ] # include supports parent folders #include "..\scriptComponent"

Non-trivial:

  • [ ] lineIntersectsSurfaces - amazing (attach, frag, missle guideance, laser) can all be improved
  • [ ] getAllHitPointsDamage / setHitIndex / getHitIndex - can make repair work on sub turrets that have identical hitpoint names
  • [ ] getModelInfo should improve wire cutters

PabstMirror avatar Aug 23 '15 21:08 PabstMirror

isJIP can probably be used for something in common

kymckay avatar Aug 24 '15 09:08 kymckay

shownHUD, showHUD for https://github.com/acemod/ACE3/pull/1857 Propably magazinesAllTurrets for rearming ? @GitHawk ?

SzwedzikPL avatar Aug 24 '15 11:08 SzwedzikPL

Thanks @SzwedzikPL May make determining if a vehicle can be rearmed easier

GitHawk avatar Aug 24 '15 13:08 GitHawk

common's jip detect on line 320 in postInit is wrong and runs on all clients, replace with new isJip and then verify that fixing doesn't break anything in medical which uses that event

PabstMirror avatar Aug 24 '15 19:08 PabstMirror

getAllHitPointsDamage for common_fnc_getHitPoints. I think it can solve https://github.com/acemod/ACE3/issues/2259

SzwedzikPL avatar Aug 25 '15 14:08 SzwedzikPL

Can someone confirm how exactly remoteExec works? If used from the server it should still be allowed no matter what, is that correct? And so only client execution of it can be restricted.

jonpas avatar Aug 27 '15 20:08 jonpas

From https://community.bistudio.com/wiki/Arma_3_Remote_Execution

Note: Server doesn’t have any limitations at place, everything is enabled and opened for him. All limitations and rules apply only for client(s).

SzwedzikPL avatar Aug 27 '15 20:08 SzwedzikPL

Seems that magazinesAllTurrets and shownHUD are not available in 1.50 :|

SzwedzikPL avatar Aug 28 '15 07:08 SzwedzikPL

AGLToASL - positionToASL are not equal

Our positionToASL is wrong, it converts to ASLW.

When standing on docks: (player modelToWorld [0,0,0]) = getPosASLW player //Moves with waves (ASLW) (player modelToWorld [0,0,0]) call ace_common_fnc_positionToASL returns ASLW

getPosASL player == aglToAsl (player modelToWorld [0,0,0]) //Static, not moving

https://community.bistudio.com/wiki/Position#PositionAGL is a great reference.

modelToWorld, worldToModel, modelToWorldVisual, worldToModelVisual, positionCameraToWorld, intersect, terrainIntersect, isOnRoad, drawIcon3D, drawLine3D, distance, moveTo, doMove, move, setDestination, buildingPos, screenToWorld, worldToScreen, AGLToASL, ASLToAGL

are all "AGL".

Because our function isn't right, we need to be careful when converting (EG, interaction menu expects the "wrong" value)

PabstMirror avatar Aug 29 '15 18:08 PabstMirror

I recommend renaming positionToASL to positionToASLW during the conversion process.

jonpas avatar Aug 29 '15 18:08 jonpas

#2319 #2311

jonpas avatar Aug 30 '15 19:08 jonpas

Edited OP as we won't be using the relative filepaths

kymckay avatar Aug 30 '15 21:08 kymckay