OsGetTerrainHeight
De DigiWiki.
(Différences entre les versions)
(Page créée avec « <lsl> // ---------------------------------------------------------------- // Example / Sample Script to show function use. // // Script Title: osSetTerrainHeight_osGetTerr… ») |
|||
Ligne 39 : | Ligne 39 : | ||
touched = FALSE; | touched = FALSE; | ||
osSetTerrainHeight(iX, iY, CurValue); | osSetTerrainHeight(iX, iY, CurValue); | ||
+ | osTerrainFlush(); | ||
llOwnerSay("osSetTerrainHeight @ coordinates X-["+(string)iX+"] Y-["+(string)iY+"] set to ["+(string)osGetTerrainHeight(iX, iY)+"]"); | llOwnerSay("osSetTerrainHeight @ coordinates X-["+(string)iX+"] Y-["+(string)iY+"] set to ["+(string)osGetTerrainHeight(iX, iY)+"]"); | ||
} | } | ||
Ligne 46 : | Ligne 47 : | ||
float NewValue = CurValue + 4.5; | float NewValue = CurValue + 4.5; | ||
osSetTerrainHeight(iX, iY, NewValue); | osSetTerrainHeight(iX, iY, NewValue); | ||
+ | osTerrainFlush(); | ||
llOwnerSay("osSetTerrainHeight @ coordinates X-["+(string)iX+"] Y-["+(string)iY+"] set to ["+(string)osGetTerrainHeight(iX, iY)+"]\nTouch to restore to Original Height"); | llOwnerSay("osSetTerrainHeight @ coordinates X-["+(string)iX+"] Y-["+(string)iY+"] set to ["+(string)osGetTerrainHeight(iX, iY)+"]\nTouch to restore to Original Height"); | ||
} | } |
Version actuelle en date du 19 novembre 2013 à 23:29
// ---------------------------------------------------------------- // Example / Sample Script to show function use. // // Script Title: osSetTerrainHeight_osGetTerrainHeight.lsl // Script Author: WhiteStar Magic // Threat Level: High // Script Source: // // Notes: See Script Source reference for more detailed information // This sample is full opensource and available to use as you see fit and desire. // Threat Levels only apply to OSSL & AA Functions // // ================================================================ // C# Source Line: public LSL_Integer osSetTerrainHeight(int x, int y, double val) // Inworld Script Line: osSetTerrainHeight(int X, int Y, float value); // // C# Source Line: public LSL_Float osGetTerrainHeight(int x, int y) // Inworld Script Line: osGetTerrainHeight(int x, int y); // // Example of osSetTerrainHeight & osGetTerrainHeight // integer touched = FALSE; integer iX = 128; integer iY = 128; float CurValue; // default { state_entry() { llSay(0,"Touch to see osSetTerrainHeight & osGetTerrainHeight work."); CurValue = osGetTerrainHeight(iX, iY); } touch_end(integer num) { if(touched) { touched = FALSE; osSetTerrainHeight(iX, iY, CurValue); osTerrainFlush(); llOwnerSay("osSetTerrainHeight @ coordinates X-["+(string)iX+"] Y-["+(string)iY+"] set to ["+(string)osGetTerrainHeight(iX, iY)+"]"); } else { touched = TRUE; float NewValue = CurValue + 4.5; osSetTerrainHeight(iX, iY, NewValue); osTerrainFlush(); llOwnerSay("osSetTerrainHeight @ coordinates X-["+(string)iX+"] Y-["+(string)iY+"] set to ["+(string)osGetTerrainHeight(iX, iY)+"]\nTouch to restore to Original Height"); } } }