Category:Math Functions

From NWN Lexicon
Jump to navigationJump to search

Math Function Category

Math functions.



Functions

Name Brief Description

abs

Get the absolute value of a number.

acos

Gets the arc cosine of a value.

asin

Gets the arc sine of a value.

atan

Gets the arc tangent of a value.

cos

Gets the cosine of a value.

fabs

Gets the absolute value of a number.

FeetToMeters

Returns how many meters are in fFeet.

FindSingleRangedTarget

Seeks out an enemy more than 3m away

GetChangedPosition

Convenience function that returns a vector that is fDistance away in fAngle direction

GetChangeInX

Convenience function to calculate the change in the X axis

GetChangeInY

Convenience function that calculates the change in the Y axis to the target

GetCustomLeftDirection

This function returns a normalized number that is the sum of the current facing and the angle to target

GetDistanceBetween

The distance in meters between two objects

GetDistanceBetweenLocations

The distance in meters between two locations in the game.

GetDistanceToObject

The distance from the caller of the script to the object in meters.

GetFacingFromLocation

Get the facing value from a location variable.

GetFactionAverageReputation

Get an integer between 0 and 100 (inclusive) that represents how an objects faction members collectively feel about the target object.

GetFactionAverageXP

Get the average amount of XPs for all members in an objects faction.

GetFarLeftDirection

This function returns a normalized number that is +135 from the current facing

GetFarRightDirection

Returns a normalized number that is -135 from the current facing

GetNormalizedDirection

This function returns a float that is constrained from 0 - 360

GetOppositeDirection

Returns a normalized direction that is -180 from fDirection

GetRandomDelay

Generates a random number between two values used for time delays.

GetRightDirection

Returns a normalized float that is -90 from the facing passed in

IntToFloat

This function converts an int to a float of the same value.

IntToHexString

This function converts an int to a string representation of the same hexadecimal value.

log

This function calculates the logarithmic value of fValue

pow

Calculates a number raised to a power.

Random

Returns a pseudo-random number with a range.

sin

Returns the sine of fValue.

sqrt

tan

Gets the tangent of a given angle.