mohabhassan / NightFall

MOHAA/MOHSH/MOHBT dgamex86 wrapper.
https://www.x-null.net/forums/forum.php
12 stars 5 forks source link

Duplicated Reborn/Nightfall-Breakthrough functions #17

Open eduzappa18 opened 2 years ago

eduzappa18 commented 2 years ago

This is not really an issue but just something to have in mind if there is ever a client version of Reborn/Nightfall for Breakthrough
Or for old mods/maps that make use of this functions

The trigonometric functions atan, cos, sin and tan are different than the ones in the vanilla game Reborn functions expects radians, while Breakthrough functions expects degrees So the same imput gives different results

The scripting documentation for Breakthrough, should have a warning about this


This are the scripts that use some of this functions in Breakthrough

# global/parachuteDrop.scr
line 116:    local.swayY = local.d*(sin local.angle)
line 119:    local.dZ = local.d*(cos local.angle)

# maps/e1l4/SunkShip.scr
line  93:    local.t1 = sin (local.t*180)

# maps/e2l3/FinalHouse.scr
line 543:    local.xup = atan local.towards[0] local.towards[2]
line 562:    local.zup = atan local.towards[1] local.towards[2]

Other duplicated functions like sqrt or netname works the same or don't cause any conflict with old scripts

mohabhassan commented 1 year ago

This seems to be mainly a compatibility issue. BT only has sin, cos, tan and atan. The rest of the math functions are are new additions from NF. I think the best way to solve this would be to keep original BT behavior, and display a (suppressible) warning for modders regarding this exact problem. Let me know if you have a better suggestion.