SM64 Enhanced Text Engine
#4
I have fixed some bugs with the text engine:
  • Camera focus sweep accidentally set cam location sweep
  • Second dialog options were able to be selected before options were shown
Some other changes:
  • Everything has been aligned using labels. Now you should be able to change the hook, and everything will line up automagically. e.x. change .org from 80403800 to 80403900 and the entire engine will shift to match
  • Define custom keyboards easily. Simply change the "keyboard.bin" for your own keyboard and it will compile. Just make sure the upper and lowercase sets are the same length. You'll also have to make sure that space, shift and end are in the same locations at the bottom, but you can rearrange the order of letters however you want.
  • functions are now based on labels instead of addresses. To call a function to make a string, you must include the string engine. Use .include "print string notes.txt" to include the string.


Here are the functions you should use to call strings:
Code:
//SETUPSTRING
//sets up string
//a0=x
//a1=y
//a2=*string
Code:
//STARTDIALOGWITHTHISOBJFUNC
//enable dialog with this object
//a0=x
//a1=y
//a2=*string
//everything but this object and mario will freeze, when dialog ends, everything will unfreeze (aka a 7C or a 7B cmd)

Here are some tips for using the engine that I might have failed to mention previously. When you use dialog options, you should end every option with an FF (labeled end [FF] on the HTML tool).
When you use the jump string cmd, you should input a segmented address. If you want to put a ram address, just drop the 80, e.x. 80405600 should be 00405600.
If you use the cmd to enable fast dialog when holding A, you must set the normal text speed before using that cmd, in that box.
Now onto new cmds.
Code:
//a0 call function once, V0 is stored to array starting at 0x6d90, current string pos is stored to A1, 9 bytes -  4 bytes A1 arg, 4 bytes function Vaddresss, 1 byte return index

//a1 call function every frame while in box, V0 is stored to array starting at 0x6d90, current string pos is stored to A1, 9 bytes - 4 bytes A1 arg, 4 bytes function Vaddresss, 1 byte return index

//a2 display following only on matching function return, 1 byte - index of combined array (0 to 7 for A0 returns, 8 to 15 for A1 returns)
Returns are stored in an array of values starting at 0x807f6d90. They are stored automatically from the returned value of your function.
I have also made a basic dialog NPC for people who are not too great with asm, this means if you don't know asm at all, you should still be able to use the engine. Just compile the file "text engine dialog bob omb.txt" which is included in the zip attached while making sure the text engine and keyboard are in the same directory and you will have your object. I have just placed him at 0x1205600 for my own convenience. To use it in game, just give the object a bob omb model, use the behavior 00405600 and then set the Bparam equal to the ram address of your string. If you don't know how to get ram addresses, you should read my tutorial here: https://docs.google.com/document/d/1JnPT...Qis1c/edit
I have shown off this exact object in the community collab videos, check them out in this thread:https://hack64.net/Thread-SM64-Community-Hack-Project


Also if there is a cmd that you create please post in this thread as well. I have a few more planned that you may see on the top of the file with all my notes. The format should be easy enough to follow so feel free to make my code better or add some new things Smile
As always, if you find any bugs, please notify me.

edit:9/9/2019

found a bug with the buffer. It is fixed in newest attach


Attached Files
.zip   ADVANCED TEXT ENGINE.zip (Size: 20.68 KB / Downloads: 560)
Reply


Messages In This Thread
SM64 Enhanced Text Engine - by jesusyoshi54 - 07-27-2019, 12:29 PM
RE: SM64 Enhanced Text Engine - by jesusyoshi54 - 08-17-2019, 06:27 PM
RE: SM64 Enhanced Text Engine - by jesusyoshi54 - 08-20-2019, 11:14 PM
RE: SM64 Enhanced Text Engine - by jesusyoshi54 - 09-02-2019, 06:25 PM
RE: SM64 Enhanced Text Engine - by jesusyoshi54 - 09-22-2019, 08:13 PM



Users browsing this thread: 1 Guest(s)