Thread

[VB] Terrain editing (Sdk)

[VB] Terrain editing // Sdk

1  |  

scuz

Nov 14, 2002, 3:34am
how do i have a VB bot edit terrain, is all confuzing!

kah

Nov 14, 2002, 4:05pm
"scuz" <webmaster at awscape.com> wrote in news:3dd335fe$1
at server1.Activeworlds.com:

> how do i have a VB bot edit terrain, is all confuzing!

Maybe this sample code will make it clearer to you:

Public Sub GenerateRandom()
PrevHeight = 0
For i = -50 To 50
For j = -50 To 50
RandomNum = Int((200 - 1 + 1) * Rnd + 1)
If RandomNum <= 20 Then
GoUp = True
ElseIf RandomNum > 20 And RandomNum <= 40 Then
GoUp = False
ElseIf RandomNum > 40 And RandomNum <= 60 Then
GoUp = True
ElseIf RandomNum > 60 And RandomNum <= 80 Then
GoUp = False
ElseIf RandomNum > 80 And RandomNum <= 100 Then
GoUp = True
ElseIf RandomNum > 100 And RandomNum <= 120 Then
GoUp = False
ElseIf RandomNum > 120 And RandomNum <= 140 Then
GoUp = True
ElseIf RandomNum > 140 And RandomNum <= 160 Then
GoUp = False
ElseIf RandomNum > 160 And RandomNum <= 180 Then
GoUp = True
Else
GoUp = False
End If

HeightDifference = Int((250 - 0 + 1) * Rnd + 0)
If GoUp Then
sdk.aw_terrain_heights(0) = PrevHeight + HeightDifference
Else
sdk.aw_terrain_heights(0) = PrevHeight - HeightDifference
End If

sdk.aw_terrain_set i, j, 1, 0

Next j
Next i
End Sub

Edits a 100x100 coord area (centered at 0n 0w).

KAH

scuz

Nov 15, 2002, 2:10am
Thankyou so very much!

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn