Custom scripts (Script Define)

baardbi

Well-known member
I tried to find something here on the forums, but couldn't find exactly what I was looking for.

My question is split in two:

1. When I make my own custom ASM script and add it to Script Defines (Script Settings), how do I call the script from other asm scripts? ...or have I misunderstood something, and should be making a macros instead?

2. When I add this custom script, I found out the other scripts used "SCR_ something something" as Define, so I did it with my script as well. What is this define used for (is this the answer to my first question? :lol: )...?
 

Bucket Mouse

Active member
I'm no Dale, but I believe what you want to do is call a subroutine. Like.....

JSR Nameofcustomscript

Just be sure the script itself returns you back. For that it needs RTS at the end.
 

Mugi

Member
the define is the calling name of the script.

using JMP like bucket mouse said, can be used to jump into a LABEL of a code (something that ends with : in code)
the SCR_***** define given to the script in script settings defines how the compiler sees this file. this define is used to include the .asm into the project (.include SCR_whatever)

when you make a script define in nesmaker UI, the script will become wisible in the scripts list, but it is not actually added to the project and is not usable before the include has been made
to include a script you simply do

Code:
.include SCR_whateveryourscriptdefinenameis


this needs to be done in a bank which you wish to use to store the script (for userscripts, this is bank14)
bank defines can be found from gameenginedata/routines/basic/bankdata
 

Bucket Mouse

Active member
JMP and JSR are two different things though. JMP is a permanent move to the script. If he's trying to call his script from another script, then I'm assuming he wants to return to that other script after it's done its thing, so he would want JSR.
 

baardbi

Well-known member
Thanks a lot guys. This was really helpful :) I also found out that most of the time I could just make macros to do the things I want.
 

Mugi

Member
Bucket Mouse said:
JMP and JSR are two different things though. JMP is a permanent move to the script. If he's trying to call his script from another script, then I'm assuming he wants to return to that other script after it's done its thing, so he would want JSR.

thanks for confifming that im dyslexic :p

either way the point stands. if you wish to add a completely new assembly to the project, it has to be included into the bank asm in order to be usable.
you cannot JMP (or JSR for that matter) to something that does not exist.
 
Top Bottom