Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- キャッスルヴァニア 暁月の円舞曲 米版
- 当たり判定表示luaスクリプト。
- Visual Boy Advance re-recording 23.5にて動きます。
- カメラ座標を元にしたグリッド、
- 自機のHPとMP、
- 自機のスピード、
- 敵機の残りHP、
- 自機及び敵機の当たり判定、
- 敵機のマップ上の絶対座標
- を表示するスクリプトです。
- ・現行の問題点
- 死神の鎌の柄の部分が触れても問題ないのに攻撃判定が表示されている問題。
- 自機ユリウスの判定表示には対応していない。
- --------
- Castlevania Aria of Sorrow (U)
- Lua script for showing hitbox.
- This script is tested on Visual Boy Advance re-recording v23.5
- This script shows
- Grid from Camera's position,
- HP and MP of Player,
- Speed of Player,
- HP of enemies,
- Hitbox for attacking and taking damage of Player and enemies,
- and absolute position of enemies on map.
- Now problems are these.
- -For grip of Death's sickle, it doesn't any hitbox for attacking,
- but this script shows it.
- -This script is not compatible with Julius Belmont as Player character.
- ]]--
- while (true) do
- --if(movie.active()==true) then
- currentHP=memory.readword(0x0201327A)
- MaxHP=memory.readword(0x0201327E)
- currentMP=memory.readword(0x0201327C)
- MaxMP=memory.readword(0x02013280)
- -- --0x40以上がLeft
- myspeedx=(memory.readdwordsigned(0x0200052C))/65536
- myspeedy=(memory.readdwordsigned(0x02000530))/65536
- gridcolor="#FF00FF88"
- gridsubcolor="#FF00FF33"
- camerax=memory.readwordsigned(0x0200A09A)
- cameray=memory.readwordsigned(0x0200A09E)
- gridx=camerax%16
- gridy=cameray%16
- for line=0,255,16 do
- gui.line(0,line-gridy,255,line-gridy,gridcolor)
- gui.line(line-gridx,0,line-gridx,255,gridcolor)
- gui.line(0,line-gridy+8,255,line-gridy+8,gridsubcolor)
- gui.line(line-gridx+8,0,line-gridx+8,255,gridsubcolor)
- gui.text(line-gridx,153,string.format("%d",camerax-gridx+line),"#00000044","#ffffff44")
- gui.text(0,line-gridy-3,string.format("%d",cameray-gridy+line),"#00000044","#ffffff44")
- end
- j=0
- k=0
- for i=1,200,1 do
- eneheader=0x020004E4+(i*0x00000084)
- Hitboxheader=0x03001A58+(i*0x00000008)
- ObjectStatus=eneheader+0x72
- isJulius1=memory.readdword(eneheader)
- isJulius2=memory.readdword(eneheader+0x04)
- enedispx=memory.readwordsigned(0x02000526+(i*0x00000084))
- enedispy=memory.readwordsigned(0x0200052A+(i*0x00000084))
- RightLeft=memory.readbyte(eneheader+0x58)
- if(RightLeft<40) then
- TouchingHitboxXOnset=enedispx+memory.readbytesigned(Hitboxheader+0x00)+1
- TouchingHitboxYOnset=enedispy+memory.readbytesigned(Hitboxheader+0x01)
- TouchingHitboxXOffset=TouchingHitboxXOnset+memory.readbyte(Hitboxheader+0x02)-3
- TouchingHitboxYOffset=TouchingHitboxYOnset+memory.readbyte(Hitboxheader+0x03)
- TouchedHitboxXOnset=enedispx+memory.readbytesigned(Hitboxheader+0x04)-1
- TouchedHitboxYOnset=enedispy+memory.readbytesigned(Hitboxheader+0x05)
- TouchedHitboxXOffset=TouchedHitboxXOnset+memory.readbyte(Hitboxheader+0x06)+1
- TouchedHitboxYOffset=TouchedHitboxYOnset+memory.readbyte(Hitboxheader+0x07)
- BodyAttackXOnset=enedispx+memory.readbytesigned(Hitboxheader+0x04)+1
- BodyAttackYOnset=enedispy+memory.readbytesigned(Hitboxheader+0x05)
- BodyAttackXOffset=BodyAttackXOnset+memory.readbyte(Hitboxheader+0x06)-3
- BodyAttackYOffset=BodyAttackYOnset+memory.readbyte(Hitboxheader+0x07)
- else
- TouchingHitboxXOnset=enedispx-memory.readbytesigned(Hitboxheader+0x00)-1
- TouchingHitboxYOnset=enedispy+memory.readbytesigned(Hitboxheader+0x01)
- TouchingHitboxXOffset=TouchingHitboxXOnset-memory.readbyte(Hitboxheader+0x02)+3
- TouchingHitboxYOffset=TouchingHitboxYOnset+memory.readbyte(Hitboxheader+0x03)
- TouchedHitboxXOnset=enedispx-memory.readbytesigned(Hitboxheader+0x04)+1
- TouchedHitboxYOnset=enedispy+memory.readbytesigned(Hitboxheader+0x05)
- TouchedHitboxXOffset=TouchedHitboxXOnset-memory.readbyte(Hitboxheader+0x06)-1
- TouchedHitboxYOffset=TouchedHitboxYOnset+memory.readbyte(Hitboxheader+0x07)
- BodyAttackXOnset=enedispx-memory.readbytesigned(Hitboxheader+0x04)-1
- BodyAttackYOnset=enedispy+memory.readbytesigned(Hitboxheader+0x05)
- BodyAttackXOffset=BodyAttackXOnset-memory.readbyte(Hitboxheader+0x06)+3
- BodyAttackYOffset=BodyAttackYOnset+memory.readbyte(Hitboxheader+0x07)
- end
- gui.line(enedispx-8,enedispy,enedispx+7,enedispy,"#00000088")
- gui.line(enedispx,enedispy-8,enedispx,enedispy+7,"#00000088")
- if(bit.band(memory.readbyte(ObjectStatus),0x00000001)==1) then
- if(bit.band(memory.readbyte(ObjectStatus),0x00000002)==0) then
- gui.box(TouchingHitboxXOnset,TouchingHitboxYOnset+1,TouchingHitboxXOffset,TouchingHitboxYOffset-1,"#00FF0033","#00ff00ff")
- end
- if(bit.band(memory.readbyte(ObjectStatus),0x00000004)==0) then
- gui.box(TouchedHitboxXOnset,TouchedHitboxYOnset,TouchedHitboxXOffset,TouchedHitboxYOffset,"#ff000033","#ff0000ff")
- end
- if(bit.band(memory.readbyte(ObjectStatus),0x00000006)==0) then
- if(memory.readbyte(eneheader+0x20)==0x01) then
- else
- gui.box(BodyAttackXOnset,BodyAttackYOnset+1,BodyAttackXOffset,BodyAttackYOffset-1,"#00ff0033","#00ff00ff")
- end
- end
- end
- --gui.text(enedispx,enedispy,RightLeft)
- enehp=memory.readwordsigned(0x02000518+(i*0x00000084))
- --eneinvc=memory.readbyte(0x02000024+(i*0x00000084)
- Status=memory.readbyte(ObjectStatus)
- --gui.box(enedispx-8,enedispy-8,enedispx+7,enedispy+7,0xffff0088)
- if(bit.band(Status,0x00000003)~=0x00000003 and Status ~= 0) then
- --gui.text(enedispx,enedispy,string.format("0x%02x,%02d\n0x%08x,0x%08x",i,Status,0x020004E4+(i*0x00000084),Hitboxheader))
- end
- if( enehp>0 ) then
- if( j>16 ) then
- k=k+1
- end
- camerax=memory.readwordsigned(0x0200A09A)
- cameray=memory.readwordsigned(0x0200A09E)
- gui.text(16+k*48,16+j*8,string.format("No.%02x,%4d,(%3d,%3d),0x%08x",i,enehp,camerax+enedispx,cameray+enedispy,eneheader),"#ffffff80","#00000080")
- gui.text(enedispx-8,enedispy,string.format("No,%02x",i),"#ffffff88","#00000088")
- --gui.text(enedispx,enedispy,string.format("%4d,0x%08x",enehp,eneheader),0x00ffffff))
- j=j+1
- end
- end
- i=0
- eneheader=0x020004E4+(i*0x00000084)
- Hitboxheader=0x03001A58+(i*0x00000008)
- ObjectStatus=eneheader+0x00000072
- enedispx=memory.readwordsigned(0x02000526+(i*0x00000084))
- enedispy=memory.readwordsigned(0x0200052A+(i*0x00000084))
- Mydispx=enedispx
- Mydispy=enedispy
- RightLeft=memory.readbyte(eneheader+0x58)
- if(RightLeft<40) then
- TouchingHitboxXOnset=enedispx+memory.readbytesigned(Hitboxheader+0x00)+1
- TouchingHitboxYOnset=enedispy+memory.readbytesigned(Hitboxheader+0x01)
- TouchingHitboxXOffset=TouchingHitboxXOnset+memory.readbyte(Hitboxheader+0x02)-2
- TouchingHitboxYOffset=TouchingHitboxYOnset+memory.readbyte(Hitboxheader+0x03)
- TouchedHitboxXOnset=enedispx+memory.readbytesigned(Hitboxheader+0x04)-1
- TouchedHitboxYOnset=enedispy+memory.readbytesigned(Hitboxheader+0x05)
- TouchedHitboxXOffset=TouchedHitboxXOnset+memory.readbyte(Hitboxheader+0x06)+1
- TouchedHitboxYOffset=TouchedHitboxYOnset+memory.readbyte(Hitboxheader+0x07)
- else
- TouchingHitboxXOnset=enedispx-memory.readbytesigned(Hitboxheader+0x00)-1
- TouchingHitboxYOnset=enedispy+memory.readbytesigned(Hitboxheader+0x01)
- TouchingHitboxXOffset=TouchingHitboxXOnset-memory.readbyte(Hitboxheader+0x02)+2
- TouchingHitboxYOffset=TouchingHitboxYOnset+memory.readbyte(Hitboxheader+0x03)
- TouchedHitboxXOnset=enedispx-memory.readbytesigned(Hitboxheader+0x04)+1
- TouchedHitboxYOnset=enedispy+memory.readbytesigned(Hitboxheader+0x05)
- TouchedHitboxXOffset=TouchedHitboxXOnset-memory.readbyte(Hitboxheader+0x06)-1
- TouchedHitboxYOffset=TouchedHitboxYOnset+memory.readbyte(Hitboxheader+0x07)
- end
- if(bit.band(memory.readbyte(ObjectStatus),0x00000002)==0) then
- gui.box(TouchingHitboxXOnset,TouchingHitboxYOnset+1,TouchingHitboxXOffset,TouchingHitboxYOffset-1,"#00ff0044","#00ff00ff")
- end
- Myright=Mydispx+8
- Myleft=Mydispx-7
- Mydown=Mydispy
- --Myup=memory.readwordsigned(0x03001A52)
- Myup=Mydispy-32
- gui.line(Mydispx-8,Mydispy,Mydispx+7,Mydispy,"#00000088")
- gui.line(Mydispx,Mydispy-8,Mydispx,Mydispy+7,"#00000088")
- MydispX1=memory.readwordsigned(0x03001A50)
- MydispX2=memory.readwordsigned(0x03001A54)
- MydispY1=memory.readwordsigned(0x03001A52)
- MydispY2=memory.readwordsigned(0x03001A56)
- if(bit.band(memory.readbyte(ObjectStatus),0x00000001)==1) then
- if(bit.band(memory.readbyte(ObjectStatus),0x00000002)==0) then
- gui.box(TouchingHitboxXOnset,TouchingHitboxYOnset+1,TouchingHitboxXOffset,TouchingHitboxYOffset-1,"#00ff0044","#00ff00ff")
- end
- if(bit.band(memory.readbyte(ObjectStatus),0x00000004)==0) then
- gui.box(MydispX1-1,MydispY1,MydispX2+1,MydispY2+1,"#ff000044","#ff0000ff")
- end
- end
- gui.box(Myright,Myup+1,Myleft,Mydown,"#00000000","#ffff00f88")
- gui.text(8,0,"X Speed:" .. myspeedx)
- gui.text(8,8,"Y Speed:" .. myspeedy)
- gui.text(110,0,"HP : " .. currentHP .. "/" .. MaxHP)
- gui.text(110,8,"MP : " .. currentMP .. "/" .. MaxMP)
- if (vba.lagged()==true) then
- gui.text(5,125,"Frames:" .. vba.framecount() .. ":*" .. vba.lagcount(),0xff0000ff)
- else
- gui.text(5,125,"Frames:" .. vba.framecount() .. ":" .. vba.lagcount())
- end
- --else
- --gui.fillbox(0,0,500,500,0x00000088)
- --gui.text(50,50,"Movie is NOT ACTIVE!!")
- --end
- vba.frameadvance()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement