Daggerfall Mod:DFRemake/DFEGetNextRegionLocation

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search

integer DFEGetNextRegionLocation ( DWORD MemblockPtr, DWORD RegionIndex )[edit]

Inputs[edit]

  • MemblockPtr: Pointer to the memblock (from GET MEMBLOCK POINTER) to receive the location data. The memblock should be allocated with at least 256 bytes.
  • RegionIndex: The region index to start iterating locations in.

Outputs[edit]

Returns 0 if there are no more locations in the given region (or on any error). Returns 1 on success.

Description[edit]

Use this function to continue iterating through all locations in a given region after an initial call to DFEGetFirstRegionLocation. The memblock format is as follows:

Field Type Byte Pos Description
XPos float 0 X position of the location in the world
YPos float 4 Y position of the location in the world
Type DWORD 8 Type of location (see Location Types).

Example[edit]

  Local Result as integer
  Local XPos   as float
  Local YPos   as float
  Local Type   as DWORD

  make memblock 1, 256
  Result = DFEGetFirstRegionLocation(get memblock ptr(1), 19)

  while (Result)
     XPos = memblock float(1, 0)
     YPos = memblock float(1, 4)
     Type = memblock DWORD(1, 8)

     print "Found location at ", XPos, ", ", YPos, " of type ", Type

     Result = DFEGetNextRegionLocation(get memblock ptr(1), 19)
  endwhile

See Also[edit]