Posts for Lil_Gecko

1 2
15 16 17
20 21
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
Oh I was eagerly waiting for this and it didn't disappoint ! Excellent work ! Very surprising solutions all along ! I enjoyed it very much. One quick question though, why did you get rid of Yoshi at the end of the maze since you get it back at the beginning of the very next level ?
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
Awesome run guys ! Loved what you've done to this poor game :) Easy yes vote !
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
--create the "display" variables. These will be used to display values when FieldID changes
stepid_disp=memory.readbyte(0x9C540)
danger_disp=memory.readword(0x7173C)
fraction_disp=memory.readbyte(0x9C6D8)
offset_disp=memory.readword(0x9AD2C)
timer_disp=memory.readword(0x9D264)

--previous fieldId and StepID values
fieldid_old=memory.readword(0x9A05C)
stepid_old=memory.readbyte(0x9C540)

--open up text file results will be dumped to. this text file should appear in your emulator folder
myfile1 = io.open("ff7_results.txt", "w")

--write text file header (tab separated)
myfile1:write("How;")
myfile1:write("\t")
myfile1:write("Field;")
myfile1:write("\t")
myfile1:write("StepID;")
myfile1:write("\t")
myfile1:write("Danger;")
myfile1:write("\t")
myfile1:write("Frac;")
myfile1:write("\t")
myfile1:write("Offset;")
myfile1:write("\t")
myfile1:write("Timer;")
myfile1:write("\t")
myfile1:write("Total steps in field")
myfile1:write("\n") --do not forget newline!

--text coordinates for displaying values on screen
x0=10 --x coordinate
y0=40 --y coordinate
dy=16 --pixels between each line

stepid_changes=0 --counter for stepID changes
stepid_old=memory.readbyte(0x0009C540) --stepID value the previous frame

while true do --main loop, executed once per frame

   --read in the values for this frame
   stepid=memory.readbyte(0x9C540)
   danger=memory.readword(0x7173C)
   fraction=memory.readbyte(0x9C6D8)
   offset=memory.readword(0x9AD2C)
   fieldid=memory.readword(0x9A05C)
   timer=memory.readword(0x9D264)
   how="Field"

   if fieldid ~= fieldid_old then  --when FieldID is not equal to its value the previous frame 
   
      --update the "disp"-variables
      stepid_disp=stepid
      danger_disp=danger
      fraction_disp=fraction
      offset_disp=offset
      timer_disp=timer
	 
      --also, dump to text file
      myfile1:write(how..";")
      myfile1:write("\t")
	  myfile1:write(fieldid..";")
      myfile1:write("\t")
      myfile1:write(stepid..";")
      myfile1:write("\t")
      myfile1:write(danger..";")
      myfile1:write("\t")
      myfile1:write(fraction..";")
      myfile1:write("\t")
      myfile1:write(offset..";")
      myfile1:write("\t")
      myfile1:write(timer..";")
      myfile1:write("\t")
      myfile1:write(stepid_changes)
      myfile1:write("\n") --do not forget newline!
    
     --reset stepid_changes, because we are in a new fieldID
      stepid_changes=0
    
   end   
   
   --display the disp variables
   gui.text(x0,y0+0*dy,"FieldID: ".. fieldid)
   gui.text(x0,y0+1*dy,"StepID: ".. stepid_disp)
   gui.text(x0,y0+2*dy,"Danger: ".. danger_disp)
   gui.text(x0,y0+3*dy,"Fraction: "..   fraction_disp)
   gui.text(x0,y0+4*dy,"Offset: ".. offset_disp)
   gui.text(x0,y0+5*dy,"Timer: ".. timer_disp)
   
   if ((stepid ~= stepid_old) and (memory.readbyte(0x696AF)~=191)) or memory.readbyte(0x696AF)==239 then --Check if StepID had changed while X not pressed or triangle is pressed
   
    if memory.readbyte(0x696AF)==239 then how="Menu" --If it's triangle that is pressed
	 else how="Walk" --If StepID has changed while x not pressed
	end
	
	 --Dump to text file
      myfile1:write(how..";")
      myfile1:write("\t")
	  myfile1:write(fieldid..";")
      myfile1:write("\t")
      myfile1:write(stepid..";")
      myfile1:write("\t")
      myfile1:write(danger..";")
      myfile1:write("\t")
      myfile1:write(fraction..";")
      myfile1:write("\t")
      myfile1:write(offset..";")
      myfile1:write("\t")
      myfile1:write(timer..";")
      myfile1:write("\t")
      myfile1:write(stepid_changes)
      myfile1:write("\n") --do not forget newline!
	  
	  end
   
   if stepid~=stepid_old then --if stepid has changed, increase counter by 1
      stepid_changes=stepid_changes+1
   end
   
   gui.text(x0,y0+7*dy,"StepID changes: " .. stepid_changes)
   
   --create the variables holding values for the previous frame
   fieldid_old=fieldid
   stepid_old=stepid
   
   emu.frameadvance() --frame advance
end
Since joypad.get doesn't record movie's input and I'm guessing you want to run the script while playing back a movie I had to search for the memory adress recording which key is pressed. I found 0x696AF that has 191 when X is pressed and 239 when Triangle is. I know it works for the beginning of the game but it may be a different adress and different values for where you're at, in which case you'll have to change it into the script. I don't know if it's possible to dump into excel right away but I've add semicolon into the text file so you can copy/paste it into Excel and use the semicolons as separator.
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
Thanks :) Yes it's an any% so I skipped the secret exit. The key is actually right above the exit, you have to bring a P-switch there to get it and go back to the beginning of the level. Also Mister and ISM are going to crush my time so there's no point in submitting this :p
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
I don't know if you still need this or not, but just in case. I changed Randil's lua to make it work on pcsx, and added total number of steps by field in the dumped file.
--create the "display" variables. These will be used to display values when FieldID changes
stepid_disp=memory.readbyte(0x9C540)
danger_disp=memory.readword(0x7173C)
fraction_disp=memory.readbyte(0x9C6D8)
offset_disp=memory.readword(0x9AD2C)
timer_disp=memory.readword(0x9D264)

--previous fieldId value
fieldid_old=memory.readword(0x9A05C)

--open up text file results will be dumped to. this text file should appear in your emulator folder
myfile1 = io.open("ff7_results.txt", "w")

--write text file header (tab separated)
myfile1:write("FieldID")
myfile1:write("\t")
myfile1:write("StepID")
myfile1:write("\t")
myfile1:write("Danger")
myfile1:write("\t")
myfile1:write("Fraction")
myfile1:write("\t")
myfile1:write("Offset")
myfile1:write("\t")
myfile1:write("Timer")
myfile1:write("\t")
myfile1:write("Total steps in field")
myfile1:write("\n") --do not forget newline!

--text coordinates for displaying values on screen
x0=10 --x coordinate
y0=40 --y coordinate
dy=16 --pixels between each line

stepid_changes=0 --counter for stepID changes
stepid_old=memory.readbyte(0x0009C540) --stepID value the previous frame

while true do --main loop, executed once per frame

   --read in the values for this frame
   stepid=memory.readbyte(0x9C540)
   danger=memory.readword(0x7173C)
   fraction=memory.readbyte(0x9C6D8)
   offset=memory.readword(0x9AD2C)
   fieldid=memory.readword(0x9A05C)
   timer=memory.readword(0x9D264)

   if fieldid ~= fieldid_old then --when FieldID is not equal to its value the previous frame
   
      --update the "disp"-variables
      stepid_disp=stepid
      danger_disp=danger
      fraction_disp=fraction
      offset_disp=offset
      timer_disp=timer
      
      --also, dump to text file
      myfile1:write(fieldid)
      myfile1:write("\t")
      myfile1:write(stepid)
      myfile1:write("\t")
      myfile1:write(danger)
      myfile1:write("\t")
      myfile1:write(fraction)
      myfile1:write("\t\t")
      myfile1:write(offset)
      myfile1:write("\t")
      myfile1:write(timer)
      myfile1:write("\t")
      myfile1:write(stepid_changes)
      myfile1:write("\n") --do not forget newline!
	  
	  --reset stepid_changes, because we are in a new fieldID
      stepid_changes=0
	  
   end   
   
   --display the disp variables
   gui.text(x0,y0+0*dy,"FieldID: ".. fieldid)
   gui.text(x0,y0+1*dy,"StepID: ".. stepid_disp)
   gui.text(x0,y0+2*dy,"Danger: ".. danger_disp)
   gui.text(x0,y0+3*dy,"Fraction: "..   fraction_disp)
   gui.text(x0,y0+4*dy,"Offset: ".. offset_disp)
   gui.text(x0,y0+5*dy,"Timer: ".. timer_disp)
   
   if stepid~=stepid_old then --if stepid has changed, increase counter by 1
      stepid_changes=stepid_changes+1
   end
   
   gui.text(x0,y0+7*dy,"StepID changes: " .. stepid_changes)
   
   --create the variables holding values for the previous frame
   fieldid_old=fieldid
   stepid_old=stepid
   
   emu.frameadvance() --frame advance
end
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
I also did a TAS of this, which can be seen here : Link to video
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
Easy yes vote. Great job guys !
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
You wrote dword instead of word which is 4 bytes, that's why it didn't work. The lua should be written like that :
while true
do
	memory.writeword(0x27250, 0x9cc4);
	memory.writeword(0x27252, 0x0800);
	emu.frameadvance();
end;
or
while true
do
	memory.writedword(0x27250, 0x08009cc4);
	emu.frameadvance();
end;
with dword.
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
Sure.
X = savestate.create();

while true do
if memory.readbyte(0x71E2C) == 1 then
savestate.save(X);
emu.frameadvance();
if memory.readbyte(0x1FFE4E) ~= 0 then
savestate.load(X);
joypad.set(1,{["circle"]=true});
emu.frameadvance();
end;
else
emu.frameadvance();
end;
end;
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
Can't wait to see a new TAS by Mister ^^
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
Really nice WIP ! Keep it up !
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
That was probably .net framework fault but after I installed it the first time it still didn't work. I tried to repair .net and got an unexpected error. Tried to desinstall it and reinstall it. Still got unexpected error and couldn't reinstall it. I used a restauration point on my computer and could reinstall it again, but it still didn't work. Last resort : Format C: Now everything works like a charm. Anyway thanks for your help :)
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
I got Windows 7. I tried compatibility mode checked and unchecked as well as running it as administrator it doesn't change a thing.
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
I can't seem to be able to make it start either. I tried the link Pasky13 give, doesn't change anything. I always got this message : Message means : The Program is ending now.
Post subject: Re: Lua help: press circle 1 frame before value changes (?)
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
antd wrote:
It seems I have found the memory address for when a text-box can be skipped. The value 001FFE4E becomes non-zero when a text-box can be skipped. The only problem is that it is 1 frame late. So I need to create a script that can press Circle 1 frame before 001FFE4E becomes non-zero. Can someone help me to accomplish this lua script? I guess the script could see when the value becomes non-zero, load, and then press circle 1-frame before?
X = savestate.create();

while true do
savestate.save(X);
emu.frameadvance();
if memory.readbyte(0x1FFE4E) ~= 0 then
savestate.load(X);
joypad.set(1,{["circle"]=true});
emu.frameadvance();
end;
end;
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
France aussi. Paris pour être exact.
Post subject: Record Lua drawings in avi with psxjin ?
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
Is it possible and how ? Thanks in advance.
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
Yeah I edited it. I meant a Perfect Game according to gamefaqs standard.
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
Before I launch myself in this gigantic project... Would there be an audience for a Perfect Game of FFIX ? http://www.gamefaqs.com/ps/197338-final-fantasy-ix/faqs/41181
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
Yeah, 0 when there's no text box. "Not Equal to" 0 when there is should do the trick just fine. 71E2C seems to be set on 1 when there's a message box, 0 otherwise.
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
Really awesome work pirohiko ! Keep it up !
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
I started recently a TAS of Super Puzzle World 3, and I encounter a little problem : I can't even with countless try, duplicate that block from distance. Is there a particular way to do it ? I know it's possible, but I just can't.
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
Remember it's just a test, I know at least one improvement in level 1 + there's ton of lag. I did it with vba-rr v23.5 svn421. vbm => http://dehacked.2y.net/microstorage.php/get/632742852/Crash%20Bandicoot%20-%20The%20Huge%20Adventure%20TAS%20test.vbm
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
I tried a quick TAS test of the first 2 levels. Saved around 4,5 seconds compared to VGR's WIP. Link to video
Lil_Gecko
He/Him
Experienced Forum User, Published Author, Player (94)
Joined: 4/7/2011
Posts: 520
My mistake. I didn't notice you could swim during the last 11 frames of the Spinning. So Spin-Swim is indeed a little bit faster but not much though.
1 2
15 16 17
20 21