J
jianmingyong
Guest
Describe the bug you experienced here.
What I expected to happen:
The computer to be smarter than a human in doing math.
What actually happened:
Totally screwed up and I have no idea how to reproduce this. It work properly in v0.52.1 but now all fails.
Debug Logs:
A Debug Script:
What I expected to happen:
The computer to be smarter than a human in doing math.
What actually happened:
Totally screwed up and I have no idea how to reproduce this. It work properly in v0.52.1 but now all fails.
Debug Logs:
Code:
Chat.vb: @Player.warp(15\test.dat)
Debug (21:44:57): 26000000+20 = 26000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 26000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 26
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 20
Debug (21:44:57): 27000000+20 = 27000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 27000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 27
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 20
Debug (21:44:57): 28000000+20 = 28000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 28000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 28
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 20
Debug (21:44:57): 29000000+20 = 29000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 29000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 29
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 20
Debug (21:44:57): 30000000+20 = 30000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 30000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 30
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 20
Debug (21:44:57): 31000000+20 = 31000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 31000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 31
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 20
Debug (21:44:57): 32000000+20 = 32000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 32000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 32
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 20
Debug (21:44:57): 33000000+20 = 33000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 33000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 33
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 20
Debug (21:44:57): 34000000+20 = 34000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 34000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 34
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 20
Debug (21:44:57): 35000000+20 = 35000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 35000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 35
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 20
Debug (21:44:57): 26000000+21 = 26000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 26000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 26
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 21
Debug (21:44:57): 27000000+21 = 27000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 27000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 27
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 21
Debug (21:44:57): 28000000+21 = 28000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 28000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 28
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 21
Debug (21:44:57): 29000000+21 = 29000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 29000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 29
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 21
Debug (21:44:57): 30000000+21 = 30000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 30000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 30
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 21
Debug (21:44:57): 31000000+21 = 31000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 31000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 31
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 21
Debug (21:44:57): 32000000+21 = 32000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 32000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 32
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 21
Debug (21:44:57): 33000000+21 = 33000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 33000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 33
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 21
Debug (21:44:57): 34000000+21 = 34000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 34000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 34
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 21
Debug (21:44:57): 35000000+21 = 35000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 35000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 35
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 21
Debug (21:44:57): 26000000+22 = 26000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 26000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 26
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 22
Debug (21:44:57): 27000000+22 = 27000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 27000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 27
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 22
Debug (21:44:57): 28000000+22 = 28000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 28000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 28
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 22
Debug (21:44:57): 29000000+22 = 29000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 29000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 29
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 22
Debug (21:44:57): 30000000+22 = 30000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 30000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 30
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 22
Debug (21:44:57): 31000000+22 = 31000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 31000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 31
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 22
Debug (21:44:57): 32000000+22 = 32000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 32000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 32
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 22
Debug (21:44:57): 33000000+22 = 33000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 33000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 33
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 22
Debug (21:44:57): 34000000+22 = 34000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 34000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 34
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 22
Debug (21:44:57): 35000000+22 = 35000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 35000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 35
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 22
Debug (21:44:57): 26000000+23 = 26000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 26000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 26
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 23
Debug (21:44:57): 27000000+23 = 27000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 27000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 27
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 23
Debug (21:44:57): 28000000+23 = 28000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 28000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 28
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 23
Debug (21:44:57): 29000000+23 = 29000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 29000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 29
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 23
Debug (21:44:57): 30000000+23 = 30000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 30000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 30
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 23
Debug (21:44:57): 31000000+23 = 31000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 31000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 31
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 23
Debug (21:44:57): 32000000+23 = 32000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 32000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 32
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 23
Debug (21:44:57): 33000000+23 = 33000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 33000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 33
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 23
Debug (21:44:57): 34000000+23 = 34000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 34000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 34
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 23
Debug (21:44:57): 35000000+23 = 35000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 35000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 35
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 23
Debug (21:44:57): 26000000+24 = 26000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 26000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 26
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 24
Debug (21:44:57): 27000000+24 = 27000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 27000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 27
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 24
Debug (21:44:57): 28000000+24 = 28000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 28000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 28
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 24
Debug (21:44:57): 29000000+24 = 29000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 29000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 29
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 24
Debug (21:44:57): 30000000+24 = 30000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 30000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 30
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 24
Debug (21:44:57): 31000000+24 = 31000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 31000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 31
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 24
Debug (21:44:57): 32000000+24 = 32000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 32000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 32
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 24
Debug (21:44:57): 33000000+24 = 33000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 33000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 33
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 24
Debug (21:44:57): 34000000+24 = 34000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 34000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 34
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 24
Debug (21:44:57): 35000000+24 = 35000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomID.1: 35000020
Debug (21:44:57): MysteryDungeon.CurrentDigRoomX: 35
Debug (21:44:57): MysteryDungeon.CurrentDigRoomZ: 24
Code:
version=2
# This is a API for Random Dungeon Generator.
# You will require a compatible map to run this.
##############################
# Main Settings
##############################
# Define Map Size.
@Storage.set(int,MysteryDungeon.MapSizeX,50)
@Storage.set(int,MysteryDungeon.MapSizeZ,50)
# Define Room Size.
# By default, Min Room Size is 5 by 5.
@Storage.set(int,MysteryDungeon.MaxRoomSizeX,10)
@Storage.set(int,MysteryDungeon.MaxRoomSizeZ,10)
# Define Number of Tiles to be Removed at the same time.
# The bigger the value, the faster it process.
# Max value is 10.
@Storage.set(int,MysteryDungeon.Processor,1)
##############################
# Do not touch anything below here
##############################
# Init Variable.
@Storage.set(int,MysteryDungeon.NumberOfRoomGenerated,0)
@Storage.set(int,MysteryDungeon.Processor,<Math.clamp(<Storage.get(int,MysteryDungeon.Processor)>,1,10)>)
@Storage.set(int,MysteryDungeon.MaxRoomSizeX,<Math.clamp(<Storage.get(int,MysteryDungeon.MaxRoomSizeX)>,5,<Storage.get(int,MysteryDungeon.MapSizeX)>-1)>)
@Storage.set(int,MysteryDungeon.MaxRoomSizeZ,<Math.clamp(<Storage.get(int,MysteryDungeon.MaxRoomSizeZ)>,5,<Storage.get(int,MysteryDungeon.MapSizeZ)>-1)>)
@Storage.set(int,MysteryDungeon.RoomSizeX,<System.random(5,<Storage.get(int,MysteryDungeon.MaxRoomSizeX)>)>)
@Storage.set(int,MysteryDungeon.RoomSizeZ,<System.random(5,<Storage.get(int,MysteryDungeon.MaxRoomSizeZ)>)>)
@Storage.set(int,MysteryDungeon.RoomPositionX,<System.random(1,<Storage.get(int,MysteryDungeon.MapSizeX)>-<Storage.get(int,MysteryDungeon.RoomSizeX)>-1)>)
@Storage.set(int,MysteryDungeon.RoomPositionZ,<System.random(1,<Storage.get(int,MysteryDungeon.MapSizeZ)>-<Storage.get(int,MysteryDungeon.RoomSizeZ)>-1)>)
# This is part of the Mystery Dungeon Generator API.
# Init Variable.
@Storage.set(int,MysteryDungeon.CurrentDigRoomX,<Storage.get(int,MysteryDungeon.RoomPositionX)>)
@Storage.set(int,MysteryDungeon.CurrentDigRoomZ,<Storage.get(int,MysteryDungeon.RoomPositionZ)>)
@Storage.set(int,MysteryDungeon.CurrentDigRoomID.1,0)
@Storage.set(bool,MysteryDungeon.RoomDigCompleted,false)
# Dig Room Procedure.
:while:<Storage.get(bool,MysteryDungeon.RoomDigCompleted)>=false
:if:<Math.int(<Storage.get(int,MysteryDungeon.CurrentDigRoomX)>)><<Math.int(<Storage.get(int,MysteryDungeon.RoomPositionX)>+<Math.int(<Storage.get(int,MysteryDungeon.RoomSizeX)>*1)>)>
@Storage.set(int,MysteryDungeon.CurrentDigRoomID.1,<Math.int(<Math.int(<Storage.get(int,MysteryDungeon.CurrentDigRoomX)>)>*1000000)>+<Storage.get(int,MysteryDungeon.CurrentDigRoomZ)>)
@text.log(<Math.int(<Storage.get(int,MysteryDungeon.CurrentDigRoomX)>*1000000)>+<Storage.get(int,MysteryDungeon.CurrentDigRoomZ)> = <Storage.get(int,MysteryDungeon.CurrentDigRoomID.1)>)
:endif
# Digging Algorithm.
@Text.log(MysteryDungeon.CurrentDigRoomID.1: <Storage.get(int,MysteryDungeon.CurrentDigRoomID.1)>)
@Text.log(MysteryDungeon.CurrentDigRoomX: <Storage.get(int,MysteryDungeon.CurrentDigRoomX)>)
@Text.log(MysteryDungeon.CurrentDigRoomZ: <Storage.get(int,MysteryDungeon.CurrentDigRoomZ)>)
:if:<Storage.get(int,MysteryDungeon.Processor)>>0 <and> <Storage.get(bool,MysteryDungeon.RoomDigCompleted)>=false
@Entity.remove(<Storage.get(int,MysteryDungeon.CurrentDigRoomID.1)>)
:if:<Storage.get(int,MysteryDungeon.CurrentDigRoomX)><<Math.int(<Storage.get(int,MysteryDungeon.RoomPositionX)>+<Storage.get(int,MysteryDungeon.RoomSizeX)>-1)>
@Storage.update(int,MysteryDungeon.CurrentDigRoomX,add,1)
:else
@Storage.update(int,MysteryDungeon.CurrentDigRoomZ,add,1)
@Storage.set(int,MysteryDungeon.CurrentDigRoomX,<Storage.get(int,MysteryDungeon.RoomPositionX)>)
:if:<Storage.get(int,MysteryDungeon.CurrentDigRoomZ)>><Math.int(<Storage.get(int,MysteryDungeon.RoomPositionZ)>+<Storage.get(int,MysteryDungeon.RoomSizeZ)>-1)>
@Storage.set(bool,MysteryDungeon.RoomDigCompleted,true)
:exitwhile
:endif
:endif
:endif
:endwhile
:end
Last edited by a moderator: