Background for Skyrim SE
Member of the PapyrusUtil script
intfunctionWrapInt(intvalue, intend, intstart=0)NativeGlobal

Description

Documentation Comment

Similar to the clamp functions, only values wrap around to the other side of range instead.

Mostly useful for traversing around array values by wrapping the index from end to end without having to check for it being out of range first.

i.e.: Form var = myFormArray[WrapInt(i, (myFormArray.Length - 1))]


Caveats


Parameters

intvalue

intend

intstart=0


Examples

Auto-Generated Example

int myInt__value
int myInt__end
int myInt__start

int returnedValue = PapyrusUtil.WrapInt(myInt__value, myInt__end, myInt__start)
Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.