NWNX:EE  8193.36.12
nwnx_tileset.nss
Go to the documentation of this file.
1 #include "nwnx"
6 
7 const string NWNX_Tileset = "NWNX_Tileset";
8 
11 {
16  int nNumGroups;
17  string sBorderTerrain;
18  string sDefaultTerrain;
19  string sFloorTerrain;
22  int bInterior;
24 };
25 
28 {
29  string sName;
30  int nStrRef;
31  int nRows;
32  int nColumns;
33 };
34 
37 {
38  string sTopLeft;
39  string sTop;
40  string sTopRight;
41  string sRight;
42  string sBottomRight;
43  string sBottom;
44  string sBottomLeft;
45  string sLeft;
46 };
47 
50 {
51  int nType;
52  float fX;
53  float fY;
54  float fZ;
55  float fOrientation;
56 };
57 
60 {
61  int nTileID;
63  int nHeight;
64 
69 
70  int bAnimLoop1;
71  int bAnimLoop2;
72  int bAnimLoop3;
73 };
74 
79 
84 string NWNX_Tileset_GetTilesetTerrain(string sTileset, int nIndex);
85 
90 string NWNX_Tileset_GetTilesetCrosser(string sTileset, int nIndex);
91 
96 struct NWNX_Tileset_TilesetGroupData NWNX_Tileset_GetTilesetGroupData(string sTileset, int nIndex);
97 
103 int NWNX_Tileset_GetTilesetGroupTile(string sTileset, int nGroupIndex, int nTileIndex);
104 
109 string NWNX_Tileset_GetTileModel(string sTileset, int nTileID);
110 
115 string NWNX_Tileset_GetTileMinimapTexture(string sTileset, int nTileID);
116 
121 struct NWNX_Tileset_TileEdgesAndCorners NWNX_Tileset_GetTileEdgesAndCorners(string sTileset, int nTileID);
122 
127 int NWNX_Tileset_GetTileNumDoors(string sTileset, int nTileID);
128 
134 struct NWNX_Tileset_TileDoorData NWNX_Tileset_GetTileDoorData(string sTileset, int nTileID, int nIndex = 0);
135 
139 void NWNX_Tileset_SetAreaTileOverride(string sAreaResRef, string sOverrideName);
140 
146 void NWNX_Tileset_CreateTileOverride(string sOverrideName, string sTileSet, int nWidth, int nHeight);
147 
151 void NWNX_Tileset_DeleteTileOverride(string sOverrideName);
152 
158 void NWNX_Tileset_SetOverrideTileData(string sOverrideName, int nIndex, struct NWNX_Tileset_CustomTileData strCustomTileData);
159 
163 void NWNX_Tileset_DeleteOverrideTileData(string sOverrideName, int nIndex);
164 
166 
168 {
169  NWNX_PushArgumentString(sTileset);
170  NWNX_CallFunction(NWNX_Tileset, "GetTilesetData");
171 
172  struct NWNX_Tileset_TilesetData str;
185 
186  return str;
187 }
188 
189 string NWNX_Tileset_GetTilesetTerrain(string sTileset, int nIndex)
190 {
191  NWNX_PushArgumentInt(nIndex);
192  NWNX_PushArgumentString(sTileset);
193  NWNX_CallFunction(NWNX_Tileset, "GetTilesetTerrain");
194 
195  return NWNX_GetReturnValueString();
196 }
197 
198 string NWNX_Tileset_GetTilesetCrosser(string sTileset, int nIndex)
199 {
200  NWNX_PushArgumentInt(nIndex);
201  NWNX_PushArgumentString(sTileset);
202  NWNX_CallFunction(NWNX_Tileset, "GetTilesetCrosser");
203 
204  return NWNX_GetReturnValueString();
205 }
206 
208 {
209  NWNX_PushArgumentInt(nIndex);
210  NWNX_PushArgumentString(sTileset);
211  NWNX_CallFunction(NWNX_Tileset, "GetTilesetGroupData");
212 
218 
219  return str;
220 }
221 
222 int NWNX_Tileset_GetTilesetGroupTile(string sTileset, int nGroupIndex, int nTileIndex)
223 {
224  NWNX_PushArgumentInt(nTileIndex);
225  NWNX_PushArgumentInt(nGroupIndex);
226  NWNX_PushArgumentString(sTileset);
227  NWNX_CallFunction(NWNX_Tileset, "GetTilesetGroupTile");
228 
229  return NWNX_GetReturnValueInt();
230 }
231 
232 string NWNX_Tileset_GetTileModel(string sTileset, int nTileID)
233 {
234  NWNX_PushArgumentInt(nTileID);
235  NWNX_PushArgumentString(sTileset);
236  NWNX_CallFunction(NWNX_Tileset, "GetTileModel");
237 
238  return NWNX_GetReturnValueString();
239 }
240 
241 string NWNX_Tileset_GetTileMinimapTexture(string sTileset, int nTileID)
242 {
243  NWNX_PushArgumentInt(nTileID);
244  NWNX_PushArgumentString(sTileset);
245  NWNX_CallFunction(NWNX_Tileset, "GetTileMinimapTexture");
246 
247  return NWNX_GetReturnValueString();
248 }
249 
251 {
252  NWNX_PushArgumentInt(nTileID);
253  NWNX_PushArgumentString(sTileset);
254  NWNX_CallFunction(NWNX_Tileset, "GetTileEdgesAndCorners");
255 
265 
266  return str;
267 }
268 
269 int NWNX_Tileset_GetTileNumDoors(string sTileset, int nTileID)
270 {
271  NWNX_PushArgumentInt(nTileID);
272  NWNX_PushArgumentString(sTileset);
273  NWNX_CallFunction(NWNX_Tileset, "GetTileNumDoors");
274 
275  return NWNX_GetReturnValueInt();
276 }
277 
278 struct NWNX_Tileset_TileDoorData NWNX_Tileset_GetTileDoorData(string sTileset, int nTileID, int nIndex = 0)
279 {
280  NWNX_PushArgumentInt(nIndex);
281  NWNX_PushArgumentInt(nTileID);
282  NWNX_PushArgumentString(sTileset);
283  NWNX_CallFunction(NWNX_Tileset, "GetTileDoorData");
284 
285  struct NWNX_Tileset_TileDoorData str;
291 
292  return str;
293 }
294 
295 void NWNX_Tileset_SetAreaTileOverride(string sAreaResRef, string sOverrideName)
296 {
297  NWNX_PushArgumentString(sOverrideName);
298  NWNX_PushArgumentString(sAreaResRef);
299  NWNX_CallFunction(NWNX_Tileset, "SetAreaTileOverride");
300 }
301 
302 void NWNX_Tileset_CreateTileOverride(string sOverrideName, string sTileSet, int nWidth, int nHeight)
303 {
304  NWNX_PushArgumentInt(nHeight);
305  NWNX_PushArgumentInt(nWidth);
306  NWNX_PushArgumentString(sTileSet);
307  NWNX_PushArgumentString(sOverrideName);
308  NWNX_CallFunction(NWNX_Tileset, "CreateTileOverride");
309 }
310 
311 void NWNX_Tileset_DeleteTileOverride(string sOverrideName)
312 {
313  NWNX_PushArgumentString(sOverrideName);
314  NWNX_CallFunction(NWNX_Tileset, "DeleteTileOverride");
315 }
316 
317 void NWNX_Tileset_SetOverrideTileData(string sOverrideName, int nIndex, struct NWNX_Tileset_CustomTileData strCustomTileData)
318 {
319  NWNX_PushArgumentInt(strCustomTileData.bAnimLoop3);
320  NWNX_PushArgumentInt(strCustomTileData.bAnimLoop2);
321  NWNX_PushArgumentInt(strCustomTileData.bAnimLoop1);
322  NWNX_PushArgumentInt(strCustomTileData.nSourceLightColor2);
323  NWNX_PushArgumentInt(strCustomTileData.nSourceLightColor1);
324  NWNX_PushArgumentInt(strCustomTileData.nMainLightColor2);
325  NWNX_PushArgumentInt(strCustomTileData.nMainLightColor1);
326  NWNX_PushArgumentInt(strCustomTileData.nHeight);
327  NWNX_PushArgumentInt(strCustomTileData.nOrientation);
328  NWNX_PushArgumentInt(strCustomTileData.nTileID);
329  NWNX_PushArgumentInt(nIndex);
330  NWNX_PushArgumentString(sOverrideName);
331  NWNX_CallFunction(NWNX_Tileset, "SetOverrideTileData");
332 }
333 
334 void NWNX_Tileset_DeleteOverrideTileData(string sOverrideName, int nIndex)
335 {
336  NWNX_PushArgumentInt(nIndex);
337  NWNX_PushArgumentString(sOverrideName);
338  NWNX_CallFunction(NWNX_Tileset, "DeleteOverrideTileData");
339 }
NWNX_Tileset_CustomTileData
A structure containing custom tile data,.
Definition: nwnx_tileset.nss:59
NWNX_Tileset_TilesetData::bInterior
int bInterior
The type of tileset. TRUE for interior, FALSE for exterior.
Definition: nwnx_tileset.nss:22
NWNX_GetReturnValueInt
int NWNX_GetReturnValueInt()
Returns the specified type from the c++ side.
Definition: nwnx.nss:94
NWNX_Tileset_TileEdgesAndCorners::sBottomLeft
string sBottomLeft
The bottom left corner.
Definition: nwnx_tileset.nss:44
NWNX_Tileset_TilesetData::sDefaultTerrain
string sDefaultTerrain
The default terrain of the tileset.
Definition: nwnx_tileset.nss:18
NWNX_Tileset_TilesetData
A structure containing general tileset data.
Definition: nwnx_tileset.nss:10
NWNX_Tileset_GetTileMinimapTexture
string NWNX_Tileset_GetTileMinimapTexture(string sTileset, int nTileID)
Get the minimap texture name of a tile in sTileset.
Definition: nwnx_tileset.nss:241
NWNX_Tileset_CustomTileData::nTileID
int nTileID
The tile ID. See the tileset's .set file.
Definition: nwnx_tileset.nss:61
NWNX_Tileset_TileEdgesAndCorners::sTopLeft
string sTopLeft
The top left corner.
Definition: nwnx_tileset.nss:38
NWNX_Tileset_GetTilesetCrosser
string NWNX_Tileset_GetTilesetCrosser(string sTileset, int nIndex)
Get the name of sTileset's crosser at nIndex.
Definition: nwnx_tileset.nss:198
NWNX_Tileset_GetTileDoorData
struct NWNX_Tileset_TileDoorData NWNX_Tileset_GetTileDoorData(string sTileset, int nTileID, int nIndex=0)
Get the door data of a tile in sTileset.
Definition: nwnx_tileset.nss:278
NWNX_Tileset_GetTileEdgesAndCorners
struct NWNX_Tileset_TileEdgesAndCorners NWNX_Tileset_GetTileEdgesAndCorners(string sTileset, int nTileID)
Get the edges and corners of a tile in sTileset.
Definition: nwnx_tileset.nss:250
NWNX_Tileset_GetTilesetTerrain
string NWNX_Tileset_GetTilesetTerrain(string sTileset, int nIndex)
Get the name of sTileset's terrain at nIndex.
Definition: nwnx_tileset.nss:189
NWNX_Tileset_TileEdgesAndCorners::sBottomRight
string sBottomRight
The bottom right corner.
Definition: nwnx_tileset.nss:42
NWNX_Tileset_SetAreaTileOverride
void NWNX_Tileset_SetAreaTileOverride(string sAreaResRef, string sOverrideName)
Override the tiles of sAreaResRef with data in sOverrideName.
Definition: nwnx_tileset.nss:295
NWNX_Tileset_TileDoorData::fZ
float fZ
The Z position of the door.
Definition: nwnx_tileset.nss:54
NWNX_Tileset_TilesetData::nNumGroups
int nNumGroups
The number of groups in the tileset.
Definition: nwnx_tileset.nss:16
NWNX_Tileset_SetOverrideTileData
void NWNX_Tileset_SetOverrideTileData(string sOverrideName, int nIndex, struct NWNX_Tileset_CustomTileData strCustomTileData)
Set custom tile data for the tile at nIndex in sOverrideName.
Definition: nwnx_tileset.nss:317
NWNX_Tileset_TilesetGroupData::sName
string sName
The name of the group.
Definition: nwnx_tileset.nss:29
NWNX_Tileset_TileEdgesAndCorners::sLeft
string sLeft
The left edge.
Definition: nwnx_tileset.nss:45
NWNX_Tileset_CustomTileData::bAnimLoop3
int bAnimLoop3
A bool to enable or disable the tile's third anim loop.
Definition: nwnx_tileset.nss:72
NWNX_Tileset_TilesetData::bHasHeightTransition
int bHasHeightTransition
TRUE if the tileset supports multiple height levels. FALSE if not.
Definition: nwnx_tileset.nss:23
NWNX_Tileset_TilesetGroupData::nRows
int nRows
The number of rows the group has.
Definition: nwnx_tileset.nss:31
NWNX_Tileset_CustomTileData::nMainLightColor1
int nMainLightColor1
A TILE_MAIN_LIGHT_COLOR_* value.
Definition: nwnx_tileset.nss:65
NWNX_Tileset_CustomTileData::nOrientation
int nOrientation
The orientation of the tile. Valid values: 0-3.
Definition: nwnx_tileset.nss:62
NWNX_Tileset_DeleteTileOverride
void NWNX_Tileset_DeleteTileOverride(string sOverrideName)
Delete a tile override named sOverrideName.
Definition: nwnx_tileset.nss:311
NWNX_Tileset_TilesetGroupData
A structure containing the group data for a tileset.
Definition: nwnx_tileset.nss:27
NWNX_Tileset_CustomTileData::nSourceLightColor1
int nSourceLightColor1
A TILE_SOURCE_LIGHT_COLOR_* value.
Definition: nwnx_tileset.nss:67
NWNX_GetReturnValueFloat
float NWNX_GetReturnValueFloat()
Returns the specified type from the c++ side.
Definition: nwnx.nss:99
NWNX_Tileset_TilesetGroupData::nStrRef
int nStrRef
The StrRef of the group.
Definition: nwnx_tileset.nss:30
NWNX_Tileset_GetTileNumDoors
int NWNX_Tileset_GetTileNumDoors(string sTileset, int nTileID)
Get the number of doors of a tile in sTileset.
Definition: nwnx_tileset.nss:269
NWNX_CallFunction
void NWNX_CallFunction(string pluginName, string functionName)
Scripting interface to NWNX.
Definition: nwnx.nss:54
NWNX_GetReturnValueString
string NWNX_GetReturnValueString()
Returns the specified type from the c++ side.
Definition: nwnx.nss:109
NWNX_PushArgumentString
void NWNX_PushArgumentString(string value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:74
NWNX_Tileset_TileEdgesAndCorners::sTop
string sTop
The top edge.
Definition: nwnx_tileset.nss:39
NWNX_Tileset_TilesetData::nNumCrossers
int nNumCrossers
The number of crossers in the tileset.
Definition: nwnx_tileset.nss:15
NWNX_Tileset_GetTilesetData
struct NWNX_Tileset_TilesetData NWNX_Tileset_GetTilesetData(string sTileset)
Get general data of sTileset.
Definition: nwnx_tileset.nss:167
NWNX_Tileset_TilesetData::fHeightTransition
float fHeightTransition
The height difference between tiles on different heights.
Definition: nwnx_tileset.nss:13
NWNX_Tileset_TileEdgesAndCorners::sTopRight
string sTopRight
The top right corner.
Definition: nwnx_tileset.nss:40
NWNX_Tileset_CreateTileOverride
void NWNX_Tileset_CreateTileOverride(string sOverrideName, string sTileSet, int nWidth, int nHeight)
Create a tile override named sOverrideName.
Definition: nwnx_tileset.nss:302
NWNX_PushArgumentInt
void NWNX_PushArgumentInt(int value)
Pushes the specified type to the c++ side.
Definition: nwnx.nss:59
NWNX_Tileset_CustomTileData::bAnimLoop2
int bAnimLoop2
A bool to enable or disable the tile's second anim loop.
Definition: nwnx_tileset.nss:71
NWNX_Tileset_CustomTileData::nMainLightColor2
int nMainLightColor2
A TILE_MAIN_LIGHT_COLOR_* value.
Definition: nwnx_tileset.nss:66
NWNX_Tileset_TilesetData::sBorderTerrain
string sBorderTerrain
The default border terrain of the tileset.
Definition: nwnx_tileset.nss:17
NWNX_Tileset_TilesetData::nNumTileData
int nNumTileData
The number of tiles in the tileset.
Definition: nwnx_tileset.nss:12
NWNX_Tileset_TileEdgesAndCorners::sBottom
string sBottom
The bottom edge.
Definition: nwnx_tileset.nss:43
NWNX_Tileset_CustomTileData::nSourceLightColor2
int nSourceLightColor2
A TILE_SOURCE_LIGHT_COLOR_* value.
Definition: nwnx_tileset.nss:68
NWNX_Tileset_TileDoorData::fY
float fY
The Y position of the door.
Definition: nwnx_tileset.nss:53
NWNX_Tileset_CustomTileData::nHeight
int nHeight
The height of the tile.
Definition: nwnx_tileset.nss:63
NWNX_Tileset_TilesetData::sUnlocalizedName
string sUnlocalizedName
The unlocalized name of the tileset, "" if not set.
Definition: nwnx_tileset.nss:21
NWNX_Tileset_TileDoorData::fOrientation
float fOrientation
The orientation of the door.
Definition: nwnx_tileset.nss:55
NWNX_Tileset_TileEdgesAndCorners::sRight
string sRight
The right edge.
Definition: nwnx_tileset.nss:41
NWNX_Tileset_GetTileModel
string NWNX_Tileset_GetTileModel(string sTileset, int nTileID)
Get the model name of a tile in sTileset.
Definition: nwnx_tileset.nss:232
NWNX_Tileset_GetTilesetGroupTile
int NWNX_Tileset_GetTilesetGroupTile(string sTileset, int nGroupIndex, int nTileIndex)
Get the tile ID at nTileIndex in nGroupIndex of sTileset.
Definition: nwnx_tileset.nss:222
NWNX_Tileset_TileDoorData::fX
float fX
The X position of the door.
Definition: nwnx_tileset.nss:52
NWNX_Tileset_TileDoorData::nType
int nType
The type of door, returns an index into doortypes.2da.
Definition: nwnx_tileset.nss:51
NWNX_Tileset_TilesetData::nDisplayNameStrRef
int nDisplayNameStrRef
The name of the tileset as strref, -1 if not set.
Definition: nwnx_tileset.nss:20
NWNX_Tileset_TilesetGroupData::nColumns
int nColumns
The number of columns the group has.
Definition: nwnx_tileset.nss:32
NWNX_Tileset_TilesetData::sFloorTerrain
string sFloorTerrain
The default floor terrain of the tileset.
Definition: nwnx_tileset.nss:19
NWNX_Tileset_TileDoorData
A structure containing the door data for a tile.
Definition: nwnx_tileset.nss:49
NWNX_Tileset_DeleteOverrideTileData
void NWNX_Tileset_DeleteOverrideTileData(string sOverrideName, int nIndex)
Delete custom tile data of the tile at nIndex in sOverrideName.
Definition: nwnx_tileset.nss:334
NWNX_Tileset_CustomTileData::bAnimLoop1
int bAnimLoop1
A bool to enable or disable the tile's first anim loop.
Definition: nwnx_tileset.nss:70
NWNX_Tileset_TilesetData::nNumTerrain
int nNumTerrain
The number of terrains in the tileset.
Definition: nwnx_tileset.nss:14
NWNX_Tileset_GetTilesetGroupData
struct NWNX_Tileset_TilesetGroupData NWNX_Tileset_GetTilesetGroupData(string sTileset, int nIndex)
Get general data of the group at nIndex in sTileset.
Definition: nwnx_tileset.nss:207
NWNX_Tileset_TileEdgesAndCorners
A structure containing the edge and corner types of a tile.
Definition: nwnx_tileset.nss:36