Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Nightmare on Elm Street 4-Player
- --July 10, 2012
- --goofydylan8
- function draw()
- ---- Get Player 1 relavent details
- -- X-Position. Pixel value and a subpixel representation rounded down to 3 decimal places.
- -- Y-Position. Pixel Value
- -- X-Velocity. Pixel value and a subpixel representation rounded down to 3 decimal places.
- -- Ability to jump? 0 if able to jump, otherwise not. If function used to change to Y and N representations
- X1Pos = memory.readbyte(0x40B)
- X1Sub = memory.readbyte(0x3F4)
- X1 = X1Pos+math.floor(X1Sub/.256)/1000
- V1X = memory.readbyte(0x450)
- V1Sub = memory.readbyte(0x439)
- V1 = V1X+math.floor(V1Sub/.256)/1000
- Y1 = memory.readbyte(0x47E)
- J1 = memory.readbyte(0x57B)
- if J1 == 0 then
- Ju1 = "Y"
- else
- Ju1 = "N"
- end
- ---- Get Player 2 relavent details
- -- Same as Player 1
- X2Pos = memory.readbyte(0x40C)
- X2Sub = memory.readbyte(0x3F5)
- X2 = X2Pos+math.floor(X2Sub/.256)/1000
- V2X = memory.readbyte(0x451)
- V2Sub = memory.readbyte(0x43A)
- V2 = V2X+math.floor(V2Sub/.256)/1000
- Y2 = memory.readbyte(0x47F)
- J2 = memory.readbyte(0x57C)
- if J2 == 0 then
- Ju2 = "Y"
- else
- Ju2 = "N"
- end
- ---- Get Player 3 relavent details
- -- Same as Player 1
- X3Pos = memory.readbyte(0x40D)
- X3Sub = memory.readbyte(0x3F6)
- X3 = X3Pos+math.floor(X3Sub/.256)/1000
- V3X = memory.readbyte(0x452)
- V3Sub = memory.readbyte(0x43B)
- V3 = V3X+math.floor(V3Sub/.256)/1000
- Y3 = memory.readbyte(0x480)
- J3 = memory.readbyte(0x57D)
- if J3 == 0 then
- Ju3 = "Y"
- else
- Ju3 = "N"
- end
- ---- Get Player 4 relavent details
- -- Same as Player 1
- X4Pos = memory.readbyte(0x40E)
- X4Sub = memory.readbyte(0x3F7)
- X4 = X4Pos+math.floor(X4Sub/.256)/1000
- V4X = memory.readbyte(0x453)
- V4Sub = memory.readbyte(0x43C)
- V4 = V4X+math.floor(V4Sub/.256)/1000
- Y4 = memory.readbyte(0x481)
- J4 = memory.readbyte(0x57E)
- if J4 == 0 then
- Ju4 = "Y"
- else
- Ju4 = "N"
- end
- --Get enemy HP values, Stolen from adelikat's 2009 "Nightmare on Elm Street 4-Player TAS, lua script."
- HP1 = memory.readbyte(0x0113);
- HP2 = memory.readbyte(0x0114);
- if ( (HP1 > 0 and HP1 < 255) or (HP2 > 0 and HP2 < 255) ) then
- gui.text(200,24,"HP:"..HP1..","..HP2);
- end
- -- Get screen position
- Sx = memory.readbyte(0x0E8);
- -- Get the movable platform Y position.
- P = memory.readbyte(0x486);
- -- Displays all of the relavent data
- gui.text(1, 8, "X1:"..X1.."\nX2:"..X2.."\nX3:"..X3.."\nX4:"..X4)
- gui.text(57,8, "Y1:"..Y1.."\nY2:"..Y2.."\nY3:"..Y3.."\nY4:"..Y4)
- gui.text(93,8, "V1:"..V1.."\nV2:"..V2.."\nV3:"..V3.."\nV4:"..V4)
- gui.text(139,8, "J1:"..Ju1.."\nJ2:"..Ju2.."\nJ3:"..Ju3.."\nJ4:"..Ju4)
- gui.text(200,8, "Sx:"..Sx.."\nPy:"..P)
- end
- emu.registerafter(draw);
Advertisement
Add Comment
Please, Sign In to add comment