Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Water
- Waters = ReadShort(F)
- For i = 1 To Waters
- W.Water = New Water
- ; Entity/Texture
- W\TexID = ReadShort(F)
- W\TexHandle = LoadAnimTexture ( "media\water_anim.jpg", 9, 64, 64, 0, 32 ) ;GetTexture(W\TexID, True)
- TextureBlend W\TexHandle, FE_BUMP ;this was not here
- W\TexScale# = ReadFloat#(F)
- ; Position/size
- X# = ReadFloat#(F) : Y# = ReadFloat#(F) : Z# = ReadFloat#(F)
- W\ScaleX# = ReadFloat#(F) : W\ScaleZ# = ReadFloat#(F)
- XDivs = Ceil(W\ScaleX# / 15.0)
- ZDivs = Ceil(W\ScaleZ# / 15.0)
- If XDivs > 70 Then XDivs = 70
- If ZDivs > 70 Then ZDivs = 70
- W\EN = CreateSubdividedPlane(XDivs, ZDivs, W\ScaleX#, W\ScaleZ#)
- ScaleEntity W\EN, W\ScaleX#, 1.0, W\ScaleZ#
- PositionEntity W\EN, X#, Y#, Z#
- ScaleTexture W\TexHandle, W\TexScale#, W\TexScale#
- EntityTexture W\EN, W\TexHandle
- ; Colour
- W\Red = ReadByte(F)
- W\Green = ReadByte(F)
- W\Blue = ReadByte(F)
- ; Opacity
- W\Opacity = ReadByte(F)
- If W\Opacity >= 100
- EntityFX(W\EN, 1 + 16)
- Else
- EntityFX(W\EN, 16)
- EndIf
- Alpha# = Float#(W\Opacity) / 100.0
- If Alpha# > 1.0 Then Alpha# = 1.0
- EntityAlpha(W\EN, Alpha#)
- ; Picking
- EntityBox W\EN, W\ScaleX# / -2.0, -1.0, W\ScaleZ# / -2.0, W\ScaleX#, 2.0, W\ScaleZ#
- ; Type handle
- NameEntity W\EN, Handle(W)
- ; If I am a walking only character, create a collision box here
- If DisplayItems = False And Me.ActorInstance <> Null
- If Me\Actor\Environment = Environment_Walk
- C.ColBox = New ColBox
- C\EN = CreateCube()
- EntityAlpha C\EN, 0.0
- ; Position/rotation/size
- Y# = Y# - 1000.0
- C\ScaleX# = Abs(W\ScaleX# / 2.0) : C\ScaleY# = 1000.0 : C\ScaleZ# = Abs(W\ScaleZ# / 2.0)
- PositionEntity C\EN, X#, Y#, Z#
- ScaleEntity C\EN, C\ScaleX#, C\ScaleY#, C\ScaleZ#
- ; Collisions
- EntityBox C\EN, -C\ScaleX#, -C\ScaleY#, -C\ScaleZ#, C\ScaleX# * 2.0, C\ScaleY# * 2.0, C\ScaleZ# * 2.0
- EntityType C\EN, C_Box
- ; Type handle
- NameEntity C\EN, Handle(C)
- EndIf
- EndIf
Add Comment
Please, Sign In to add comment