Guest User

Untitled

a guest
Feb 18th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Water
  2.         Waters = ReadShort(F)
  3.         For i = 1 To Waters
  4.             W.Water = New Water
  5.             ; Entity/Texture
  6.             W\TexID = ReadShort(F)
  7.             W\TexHandle = LoadAnimTexture ( "media\water_anim.jpg", 9, 64, 64, 0, 32 ) ;GetTexture(W\TexID, True)
  8.             TextureBlend W\TexHandle, FE_BUMP ;this was not here
  9.             W\TexScale# = ReadFloat#(F)
  10.            
  11.             ; Position/size
  12.             X# = ReadFloat#(F) : Y# = ReadFloat#(F) : Z# = ReadFloat#(F)
  13.             W\ScaleX# = ReadFloat#(F) : W\ScaleZ# = ReadFloat#(F)
  14.             XDivs = Ceil(W\ScaleX# / 15.0)
  15.             ZDivs = Ceil(W\ScaleZ# / 15.0)
  16.             If XDivs > 70 Then XDivs = 70
  17.             If ZDivs > 70 Then ZDivs = 70
  18.             W\EN = CreateSubdividedPlane(XDivs, ZDivs, W\ScaleX#, W\ScaleZ#)
  19.             ScaleEntity W\EN, W\ScaleX#, 1.0, W\ScaleZ#
  20.             PositionEntity W\EN, X#, Y#, Z#
  21.             ScaleTexture W\TexHandle, W\TexScale#, W\TexScale#
  22.             EntityTexture W\EN, W\TexHandle
  23.             ; Colour
  24.             W\Red = ReadByte(F)
  25.             W\Green = ReadByte(F)
  26.             W\Blue = ReadByte(F)
  27.             ; Opacity
  28.             W\Opacity = ReadByte(F)
  29.             If W\Opacity >= 100
  30.                 EntityFX(W\EN, 1 + 16)
  31.             Else
  32.                 EntityFX(W\EN, 16)
  33.             EndIf
  34.             Alpha# = Float#(W\Opacity) / 100.0
  35.             If Alpha# > 1.0 Then Alpha# = 1.0
  36.             EntityAlpha(W\EN, Alpha#)
  37.             ; Picking
  38.             EntityBox W\EN, W\ScaleX# / -2.0, -1.0, W\ScaleZ# / -2.0, W\ScaleX#, 2.0, W\ScaleZ#
  39.             ; Type handle
  40.             NameEntity W\EN, Handle(W)
  41.             ; If I am a walking only character, create a collision box here
  42.             If DisplayItems = False And Me.ActorInstance <> Null
  43.                 If Me\Actor\Environment = Environment_Walk
  44.                     C.ColBox = New ColBox
  45.                     C\EN = CreateCube()
  46.                     EntityAlpha C\EN, 0.0
  47.                     ; Position/rotation/size
  48.                     Y# = Y# - 1000.0
  49.                     C\ScaleX# = Abs(W\ScaleX# / 2.0) : C\ScaleY# = 1000.0 : C\ScaleZ# = Abs(W\ScaleZ# / 2.0)
  50.                     PositionEntity C\EN, X#, Y#, Z#
  51.                     ScaleEntity C\EN, C\ScaleX#, C\ScaleY#, C\ScaleZ#
  52.                     ; Collisions
  53.                     EntityBox C\EN, -C\ScaleX#, -C\ScaleY#, -C\ScaleZ#, C\ScaleX# * 2.0, C\ScaleY# * 2.0, C\ScaleZ# * 2.0
  54.                     EntityType C\EN, C_Box
  55.                     ; Type handle
  56.                     NameEntity C\EN, Handle(C)
  57.                 EndIf
  58.             EndIf
Add Comment
Please, Sign In to add comment