2022-06-03 00:33:51 (edited by dbm 2022-06-12 20:54:02)

Hi, link for Pokemon Emerald Lua script for VBA is below.
This is version 1.2
I've only made it to the 8th gym. I'm assuming it's possible to get to the league with the script.
Path finder is unreliable after Lilycove City, it can’t handle water nor dive areas so you need to get around by trial and error, plus the maps have been designed in a way where if you follow pathfinder you go to the next map, but it’s a trap and you need to go back and go through a different way.

Below is a quick readme
all keys from PCA are present
The T key in Lua script no longer reads text on screen, it just reads dialogue message on screen.
Below are features I added that you can ignore.
Shift + R. Rotates the camera through different maps, I made this for analysis purposes
Pathfinder tiles – classic mode, this map contains the tiles path finder looks at.
Behavior tiles – this contains all the behaviour tiles no collision tiles
Collision tiles – this contains collisions tiles only so just ones and zeros
Meta tiles – this map has the raw Ids, which is used to get above maps

V key, this is a toggle that turns on and off reading tile and sprite names. I have no sounds for sprites and statues and I needed this for 7th gym.

G key, this reads out the cords of the camera, Route 111 has 3 West connections, Route 112 and Route 113, Route 113 has two connections, but pathfinder is faulty and just provides directions to one Route. I lack the ability to fix this one. But G key read out the cords, be mindful that if you accidentally press the G key it inserts this item into the path finder list so pressing P gives direction to the camera position, pressing the key to move to next item removes this entry. I would use this to find a dive spot, I would press G and then P for directions to that location.

O and U keys, when in a battle  reads out Pokemon nname, level, type and item number.
Avoid pressing 1, that switches to a different keyboard. I should have deleted it, but left it in case someone with technical expertise wishes to do debugging.

scripts works with french, german, italian, portuguese and spanish ROMs.

The link below contains multiple files.
you need PCA on your system first. File vba-over.ini goes next to vba.exe, remaining files go in Lua folder
File vba-over.ini is used to stop VBA displaying error message about not finding battery.
VBA looks for lua scripts in Lua folder, to avoid conflicts with other code base like pokemon.lua, my code is in emerald.lua. this is the script you need to execute. when you launch it an error message will appear saying script has been running for long time, press no, this is a required checksum to ensure we are all using the same ROM
https://drive.google.com/file/d/14wR6zS … sp=sharing

2022-06-03 01:08:50

I wouldn't say this is pointless. I much prefer the VBA scripts, so sad to hear that you're giving up on it. Couldn't imagine how much work it must be to maintain though. Thanks for what you did release!

2022-06-03 02:39:48

This is still exciting, and a taste of things to come from the other party. I'm so ready to move onto emerald after playing through so many versions of crystal. Thank you thank you! smile

2022-06-03 02:47:48

I don't know why, but an error appears after loading the script. It says output console script fail.

Greetings,
Janagirl!

2022-06-03 03:29:02

I got it to run but keys like g and t doesn't work.

End of Post!
Leos signing off.
CFN ID: LeosKhai. (Always looking to fight people)
Discord: leos_khai

2022-06-03 03:44:59

@1:
I will try this out thanks. I do have a question though. When I was setting this up as you instructed and getting everything ready to start it, I noticed something different from the gen 2 nuive scripts. There was a pokemon.lua file there used for that which I figured out got many things to work correctly. I don't see that with yours and wondering if it's needed is all. I'm gonna go check out your script though and see if I can get it working now.

2022-06-03 03:57:27

@1:
I can't get to work right. I used only the files you gave us, but it runs and then won't read any of the words on the screen. I tried adding pokemon.lua and nvda.dll from the nuive script to see if that would help, but nothing there either. Am I missing some files I don't know about or just missing something else in general here?

2022-06-03 07:05:51

Redsneasel12 wrote:

@1:
I can't get to work right. I used only the files you gave us, but it runs and then won't read any of the words on the screen. I tried adding pokemon.lua and nvda.dll from the nuive script to see if that would help, but nothing there either. Am I missing some files I don't know about or just missing something else in general here?

run emerald.lua

End of Post!
Leos signing off.
CFN ID: LeosKhai. (Always looking to fight people)
Discord: leos_khai

2022-06-03 07:42:21

oops. I forgot to give additional clear instructions. I’ve updated original post with below details.
File vba-over.ini is used to stop VBA displaying error message about not finding battery.
VBA looks for lua scripts in Lua folder, to avoid conflicts with other code base like pokemon.lua, my code is in emerald.lua. this is the script you need to execute

Leos, looks like you ran emerald.lua which is what you needed to do. surprised g and t keys don't work. g only works after you have activated the camera keys and t key only works if there is dialogue text, if you speak to another character and press t, does it still not work?

2022-06-03 08:19:29

@9:
I got everything situated where it's supposed to be like you said, but when I load the emerald.lua file it doesn't work. I get only restart and stop when I try loading it. I don't understand what the issue is now.

2022-06-03 08:36:10

When you load the emerald.lua script do you get speech output saying ready?
If so just alt tab and back in. If not is there any error message in the console window?

2022-06-03 09:17:02

dbm wrote:

Leos, looks like you ran emerald.lua which is what you needed to do. surprised g and t keys don't work. g only works after you have activated the camera keys and t key only works if there is dialogue text, if you speak to another character and press t, does it still not work?

It work, but the first time it wasn't but i restart and it works fine.

End of Post!
Leos signing off.
CFN ID: LeosKhai. (Always looking to fight people)
Discord: leos_khai

2022-06-03 12:02:15

@11:
I don't get anything that says ready at all, just the restart and stop messages. I then back out of the window, thinking it's gonna work, and the start up screen for the game starts. After that, when I try and have the intro text with prof. birch playing, it doesn't read anything. I'll try it again just in case, but I think there's still some issue here unfortunately.

2022-06-03 12:12:00

@11:
I tried it out again and now I get VBA freezing up and making my screen reader stop working. This is really bizarre, since I'm pretty sure I've done everything I'm supposed to per your instructions.

2022-06-03 12:41:15

yep, super bizarre. Looks like Leos is the only person to report script works fine, which isn’t a good sign.  Are you using a blank unpatched rom? The way I wrote the code relies on hard coded values, if your screen reader is crashing it sounds like something weird is being passed to it from my script. I can’t recall where I got my rom file. So the fact I hardcoded values and the rom could be different to your one could be the explanation. Can you do me a favour and do the following.

Open emerald.lua and search for debug_mode = false and change it to debug_mode = true.
Launch the game and pass through all the menus until you get to the game and you can move and stuff.
Launch the script, do any error appear in the console or does your screen reader start reading random stuff? I need to know if one of the memory.registerwrite functions is firing.

2022-06-03 17:34:58

Ok, I got an error in the console window. It says the following:

.\clipboard32.lua:5: cannot load module 'clipboard32': The specified procedure could not be found.

I put, vba-over.ini next to vba.exe, and the rest in the lua folder as instructed, then ran emerald.lua.

2022-06-04 00:41:54 (edited by zargonbr 2022-06-04 00:55:06)

weee! worcs!

once upon a time, a beautiful little girl who wore a beautiful red hood.  while she was passing through a forest, she was killed by Captain America.  The end...

2022-06-04 01:48:29

the screen to put the name of the player was not accessible for me.  Other than that, I'm in awe of your effort, man!  like, it's gen 3!

once upon a time, a beautiful little girl who wore a beautiful red hood.  while she was passing through a forest, she was killed by Captain America.  The end...

2022-06-04 02:48:33 (edited by Redsneasel12 2022-06-04 02:49:56)

@15:
I'm using a blank pokemon-emerald version(u) rom. I also have the emerald trashman rom if you think I should try that out too? I've got stuff going on for the rest of the day, but I'll try out this debugging thing tonight and let you know what happens.

2022-06-04 07:43:09

@15:
I tried the debug mode and the screen reader didn't freeze anymore, but the script also wouldn't run. What I basically get is a regular emerald game without your scripts cause they don't work. I got the same restart and stop message too when I tried loading the scripts too. I also increased the emulator's speed cause the speed lower than 150 annoys me anymore, so maybe that helped a bit with part of things too. Script still doesn't work though unfortunately like I said.

2022-06-04 09:00:31

Thanks to those confirming scripts are working and apologies for those that have not got it to work. Give me a couple more days. I wasn't able to find a checksum like you get for GBC, I downloaded mGBA and check ROM Info and came across this CRC32 checksum I need to write it so that we can ensure we are talking about the same ROM that will help with debugging. Surprised zargonbr reports issue with naming screen, but everything else is working fine. Clipboard32.dll isn’t needed I only included it in case halfway through the game someone had an issue and needed to report something to me. Not sure why its an issue for some and not others, I will create code to stop it crashing it there is issues with it. I will provide updated code ASAP.

2022-06-04 11:37:06

Dbm, the vba script is much better than a bizhafk! Vba is more accessible, and bizhafk script don't have a pathfinder similar to this from pca. Of course, bizhafk script isn't bad, but vba is much, much better. Maybe contact with Nuive and you will work together?

ice, fire, water, thunder.

2022-06-04 20:58:25 (edited by zargonbr 2022-06-04 20:59:53)

the only screens that are not accessible to me are the game settings screen, and the continue/new game screen.  luckily the game already focuses on the continue option.  so far I'm loving the work done on it, and I'm already capturing the monsters, weeee!

once upon a time, a beautiful little girl who wore a beautiful red hood.  while she was passing through a forest, she was killed by Captain America.  The end...

2022-06-05 05:51:22

hi. how do i fix this? I manage to get the scrip working. however when i try to press anything it won't work, the scrip does read anything though.

2022-06-05 17:30:37

Hi,
Thank you so much for this.  having an accessible emulator to play this in makes a huge difference.