• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Tool: Cosarara97's tools - Map and script editor

78
Posts
15
Years
Yeah, same here. It's a shame- I can get Advance Map working in Wine just fine, but XSE and PKSV won't work with it when I try. I was hoping this was the solution, but it seems I will have to look elsewhere.

Well, this is the solution for scripting on a mac, since his script editor can work with XSE style. I greatly regret that I can't get the hang of installing it.
 
23
Posts
13
Years
  • Seen Jun 19, 2020
Yeah, same here. It's a shame- I can get Advance Map working in Wine just fine, but XSE and PKSV won't work with it when I try. I was hoping this was the solution, but it seems I will have to look elsewhere.

Well, this is the solution for scripting on a mac, since his script editor can work with XSE style. I greatly regret that I can't get the hang of installing it.

I don't own a Mac, but I'll try to use a virtual machine to try to see what I can do (when I have the time, and that will probably be next week). Meanwhile, both PKSV and the Windows version of Red Alien should work using wine (at least they do on Linux).
 
78
Posts
15
Years
I don't own a Mac, but I'll try to use a virtual machine to try to see what I can do (when I have the time, and that will probably be next week). Meanwhile, both PKSV and the Windows version of Red Alien should work using wine (at least they do on Linux).

Yes! It does work with wine! I can't because I didn't try that! Thanks so much! It works perfectly. I'll definitely be using this.
 
22
Posts
8
Years
  • Age 27
  • Seen Aug 18, 2017
I don't own a Mac, but I'll try to use a virtual machine to try to see what I can do (when I have the time, and that will probably be next week). Meanwhile, both PKSV and the Windows version of Red Alien should work using wine (at least they do on Linux).

Awesome! Thanks!
 
78
Posts
15
Years
Just discovered something - it seems that RedAlien doesn't identify the commands waitstate and subvar. Are there other commands I should use to replace these?

Here's the script I tried to compile:

Spoiler:


I find this a bit odd since it has no problem identifying copyvar. Any ideas?
 

Touched

Resident ASMAGICIAN
625
Posts
9
Years
  • Age 122
  • Seen Feb 1, 2018
Just discovered something - it seems that RedAlien doesn't identify the commands waitstate and subvar. Are there other commands I should use to replace these?

"subvar" appears to be called "subtractvar" and "waitstate" is "waitspecial". Find the hex value of the command from the XSE command name here http://sphericalice.com/romhacking/documents/script/index.html and match it up to the red alien name here https://github.com/cosarara97/red-alien/blob/master/asc/data/commands.txt
 
78
Posts
15
Years
"subvar" appears to be called "subtractvar" and "waitstate" is "waitspecial". Find the hex value of the command from the XSE command name here http://sphericalice.com/romhacking/documents/script/index.html and match it up to the red alien name here https://github.com/cosarara97/red-alien/blob/master/asc/data/commands.txt

Wow! That's awesome! I was always wondering if there was a document that had the hex values of the commands. Oh man. So awesome. Thanks a bunch. You've been very helpful throughout this whole process!

I mean, this literally makes it so that my compatibility with any script editor is not a problem anymore! If I don't know a command, psh, I'll just write it in hex. This is great!
 

Solumbran

Lurker
6
Posts
7
Years
  • Age 29
  • Seen Jul 6, 2019
Hi,

I must say that from what I saw, these tools are awesome. However, I'm getting some wierd errors on Red Alien. Being a beginner in romhacking, please forgive me if I'm saying stupid stuff.

When decompiling, the first thing I noticed was wierd #include (duplicated and with the wrong path (#include "stdmoves.rbh" when stdmoves.rbh is located in stdlib folder).
Moreover, when changing the includes, I get errors concerning movements (Either the face_default and similar don't work in OW script mode, either that's the lockall command in Al script mode).

I'm using windows, which is in itself not the best thing to get programs working, but I'd appreciate it if I could choose my OS without being forced by errors I don't understand :3

Thanks in advance =)
 
23
Posts
13
Years
  • Seen Jun 19, 2020
Hi,

I must say that from what I saw, these tools are awesome. However, I'm getting some wierd errors on Red Alien. Being a beginner in romhacking, please forgive me if I'm saying stupid stuff.

When decompiling, the first thing I noticed was wierd #include (duplicated and with the wrong path (#include "stdmoves.rbh" when stdmoves.rbh is located in stdlib folder).
Moreover, when changing the includes, I get errors concerning movements (Either the face_default and similar don't work in OW script mode, either that's the lockall command in Al script mode).

I'm using windows, which is in itself not the best thing to get programs working, but I'd appreciate it if I could choose my OS without being forced by errors I don't understand :3

Thanks in advance =)
Hey, thanks for trying out my stuff. What you found were real issues in my program - thanks for taking the time to describe them here. I have fixed them all and uploaded a new version: http://www.cosarara.me/jaume/files/RedAlien_nigtly_07-08-2016.zip

Oh, by the way, the AI script mode is used for the opponent's AI when in battle, so your script not compiling in that mode is the right behavior (all the commands are different in AI scripts).
 

Solumbran

Lurker
6
Posts
7
Years
  • Age 29
  • Seen Jul 6, 2019
Wow, thanks, I didn't expect such a fast answer ^^
It seems to be working now, thanks. And great job again, because I love your software :D

For the AI script mode, it's good to know, but since it didn't work in the first mode I thought it couldn't hurt to try both ^^

Thanks a lot, and keep being awesome :p

Edit : Not sure if a bug, an incompatibility, or that I'm doing things the wrong way, but when I compile a pksv-style talking trainer, the compiled script is... wierd. faceplayer is replaced by a checkitem, and the message call is replaced by a nop0. In-game, it just crashes.
Not really important since red alien scripting works, but I thought you might want to know in case that's a bug (and not a bad manipulation from me ^^')

Re-Edit : My bad, it was my fault. I kept the "callstd MSG_NORMAL", which apparently caused the bug. With callstd 6 it works, but it removes the spaces in the string it seems. I'm probably still doind something wrong, I'll keep searching a bit more.
 
Last edited:
23
Posts
13
Years
  • Seen Jun 19, 2020
Ouch, the lack of testing is starting to show.
Here is a new release fixing the space issue: http://www.cosarara.me/jaume/files/RedAlien_nigtly_08-08-2016.zip
You should be able to use MSG_NORMAL, here is an example script which I've tested:
Code:
#define PKSV
#include "stdlib/std.rbh"

#dyn 0x800000

#org @script
lock
faceplayer
msgbox @message
callstd MSG_NORMAL
release
end

#org @message
= this is my message with spaces and stuff\xFF

MSG_NORMAL is defined in stdlib/std.rbh. I'm putting the "#define PKSV" in there because that way you tell the compiler you don't want the XSE-style msgbox. Even so, the proper command should be "loadpointer", since that's more descriptive of what the command does (and that's what you will get when decompiling).

Whenever you find a problem, don't hesitate to post. Even if it happened to be an error on your part, I'd probably be able to spot it sooner, and if it is on my part, then I can fix it right away.
 

Solumbran

Lurker
6
Posts
7
Years
  • Age 29
  • Seen Jul 6, 2019
Well you're in luck, it seems I'm good to find problems x)

Yeah, I started to think it was probably not me when I saw than the documentation's exemples didn't work either. And even decompiling, adding spaces, and recompiling, still removed spaces no matter what.

That's what I'll do then. Since I didn't know if you were still actively working on this or not, I didn't want to bother too much ^^'

Edit : So, I found compilation errors when I used all the "imports" present by default on a new file. The error is "Bad number $2 at current_script:15 - ['callstd', '$2'] msgbox @message". As I said, nothing ever works normally in my hands :p
 
Last edited:
23
Posts
13
Years
  • Seen Jun 19, 2020
So, I found compilation errors when I used all the "imports" present by default on a new file. The error is "Bad number $2 at current_script:15 - ['callstd', '$2'] msgbox @message". As I said, nothing ever works normally in my hands :p
That one's expected, not a bug :)
Like I said in my last post, unless you specifically disable it by setting "#define PKSV" before the #include's, msgbox is treated as a macro (see the std.rbh file), which expands as loadpointer + callstd, so that it can be used like this:
Code:
#include "stdlib/std.rbh"
#dyn 0x800000
#org @main
msgbox @msg MSG_NORMAL
end
#org @msg
= message

Though I guess the error message could give a better explanation.
 

Solumbran

Lurker
6
Posts
7
Years
  • Age 29
  • Seen Jul 6, 2019
Oh, I see. The fact is, I had put the #define PKVS after the includes, not before :')
Told you I was probably doing things the wrong way too :D
Well, I'll keep using it then, I hope I don't find any more bugs :p
 

Solumbran

Lurker
6
Posts
7
Years
  • Age 29
  • Seen Jul 6, 2019
Ok, so I think I found a bug concerning trainer battles. When ou use a "trainerbattle" command, it looks like it doesn't compile the two messages linked to it. And the same behavior is present when decompiling.
Example :
With RedAlien :
Code:
#org 0x16eef1
trainerbattle 0x0 0x1ce 0x0 0x819b86a 0x819b8a8
loadpointer 0x819b8b9
callstd 0x6
end

#org 0x19b8b9
= In a battle of equals, the one\nwith the stronger will wins.\pIf you wish to bea
= t SABRINA, focus\nand will yourself to victory.
With PKSV :
Code:
#org 0x816EEF1
'-----------------------------------
trainerbattle 0x0 0x1CE 0x0 0x819B86A 0x819B8A8
msgbox 0x819B8B9 ' In a battle of equal...
callstd MSG_LOCK ' Built-in lock command
end


#org 0x819B86A
= SABRINA is far younger than I,\nbut she has earned my respect.

#org 0x819B8A8
= Not good enough!

#org 0x819B8B9
= In a battle of equals, the one\nwith the stronger will wins.\pIf you wish to beat SABRINA, focus\nand will yourself to victory.

If I compile the script with RA and then decompile with PKSV, the strings disappear too.

Maybe I'm doing a mistake again, but I can't get a trainerbattle to work, get a redscreen each time I talk to the trainer.
Sorry to bother ^^'
 
23
Posts
13
Years
  • Seen Jun 19, 2020
Ok, so I think I found a bug concerning trainer battles. When ou use a "trainerbattle" command, it looks like it doesn't compile the two messages linked to it. And the same behavior is present when decompiling.
Example :
With RedAlien :
Code:
#org 0x16eef1
trainerbattle 0x0 0x1ce 0x0 0x819b86a 0x819b8a8
loadpointer 0x819b8b9
callstd 0x6
end

#org 0x19b8b9
= In a battle of equals, the one\nwith the stronger will wins.\pIf you wish to bea
= t SABRINA, focus\nand will yourself to victory.
With PKSV :
Code:
#org 0x816EEF1
'-----------------------------------
trainerbattle 0x0 0x1CE 0x0 0x819B86A 0x819B8A8
msgbox 0x819B8B9 ' In a battle of equal...
callstd MSG_LOCK ' Built-in lock command
end


#org 0x819B86A
= SABRINA is far younger than I,\nbut she has earned my respect.

#org 0x819B8A8
= Not good enough!

#org 0x819B8B9
= In a battle of equals, the one\nwith the stronger will wins.\pIf you wish to beat SABRINA, focus\nand will yourself to victory.
If I compile the script with RA and then decompile with PKSV, the strings disappear too.
Right, I missed those. In the data/commands.txt file, which you can edit, at line 136 it reads:
Code:
    "trainerbattle": {"hex": 0x5C, "args": ("kind, num, ?, startmsg, defeatmsg",
                                             (1, 2, 2, 4, 4))},
And it should read:
Code:
    "trainerbattle": {"hex": 0x5C, "args": ("kind, num, ?, startmsg, defeatmsg", 
                                            (1, 2, 2, 4, 4)),
                       "offset": [(3, "text"), (4, "text")]},
This will be patched in the next release, meanwhile you can just download the file with the changes directly from https://raw.githubusercontent.com/cosarara97/red-alien/master/asc/data/commands.txt and replace the one you have.
Maybe I'm doing a mistake again, but I can't get a trainerbattle to work, get a redscreen each time I talk to the trainer.
Sorry to bother ^^'
Well, that's weird. What's your full script?
 

Solumbran

Lurker
6
Posts
7
Years
  • Age 29
  • Seen Jul 6, 2019
Actually, nevermind, I made it work somehow by changing parameters in A-Map. What's wierd is that it still work even if I revert the changes, so I'm a bit confused.
The script was as simple as possible, only a trainerbattle with the corresponding strings. Probably was my fault, but the reason will remain unknown :D
 
Back
Top