HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Saving terrain to gamecache

10-30-2006, 03:41 AM#1
Zandose
Does anyone know how a way to save the terrain's type to gamecache? I can loop and check each one with a if statment but I'm looking for a better way.
10-30-2006, 04:10 AM#2
Vexorian
terrain types are just integers
10-30-2006, 04:25 AM#3
Zandose
Either your mistaken or I said something wrong? Terrain types use names. Maybe your thinking of terrain variances?

Trigger:
Untitled Trigger 001
Events
Conditions
Collapse Actions
Set TerrainType[1] = Lordaeron Summer - Dirt
Custom script: set udg_TerrainType[1] = 'Ldrt'
10-30-2006, 05:29 AM#4
Jazradel
'Ldrt' is an id code, which happens to be an integer.

Hidden information:
Example Natives:
Collapse JASS:
native SetTerrainType takes real x, real y, integer terrainType, integer variation, integer area, integer shape returns nothing

native GetTerrainType takes real x, real y returns integer

Examples from TriggerData.txt

terrainshape=1,1,1,WESTRING_TRIGTYPE_terrainshape,integer
terraintype=1,1,1,WESTRING_TRIGTYPE_terraintype,integer

// Tile IDs
TerrainTypeLdrt=1,terraintype,'Ldrt',WESTRING_TERRAINTYPE_Ldrt
TerrainTypeLdro=1,terraintype,'Ldro',WESTRING_TERRAINTYPE_Ldro
And a lot more.

SetTerrainTypeBJ=1,location,terraintype,integer,integer,terrainshape
_SetTerrainTypeBJ_Defaults=GetRectCenter,TerrainTypeLdrt,-1,1,TerrainShapeCircle
_SetTerrainTypeBJ_Category=TC_ENVIRONMENT
10-30-2006, 03:08 PM#5
Zandose
Ah, I see. But this still begs the question. There's no option in the GUI for saving the terrain type as a integer. Anyways I shall begin searching to understand the asnwer you gave me.
10-30-2006, 03:14 PM#6
Vexorian
There's where you are forced to use JASS, custom script : set udg_tempInt = udg_(terrain type variable)

then you store tempInt