Shining Force II Hacking: [GitHub] ShiningForceCentral/SF2TextManager

A simple Java GUI with text import/export functions

A place for Shining Force 2 hack discussion, editing tools, new hacks etc.

Moderator: Shining Moderators

Post Reply
User avatar
Wiz
Shining Member
Shining Member
Posts: 181
Joined: Sun Mar 18 2007 2:43pm
Location: Blois, France
Contact:
Status: Offline

[GitHub] ShiningForceCentral/SF2TextManager

Post by Wiz »

Hi guys,

Here's a tool that I'd like to share, SF2TextManager.

This is a small Java GUI with only import/export functions for the game's compressed text.
It also acts as a Java API for future use in other disassembly-oriented tools.

Image

Latest release available here :
https://github.com/ShiningForceCentral/ ... ses/latest

And more importantly, sourcecode available here under the SFC GitHub organization :
https://github.com/ShiningForceCentral/SF2TextManager
Contributions are welcome !

Technical notes :
- This tool is able to re-generate Huffman trees, so any two-character combination is now possible.
It unlocks the use of characters previously unavailable, like the {COLOR;#} special character !
(any color from the base palette is available, even the transparent one :excited: )
Spoiler
Image
Available characters :
Spoiler
" ",
"0","1","2","3","4","5","6","7","8","9",
"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",
"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z",
"_","-",".",",","!","?",
"<", /* Represents character '“' (ALT 0147) for easier writing in game script */
">", /* Represents character '”' (ALT 0148) for easier writing in game script*/
"'","(",")","#","%","&","+","/",":",
"{DICT}",
"{N}",
"{D2}",
"{#}",
"{NAME}",
"{LEADER}",
"{ITEM}",
"{SPELL}",
"{CLASS}",
"{W2}",
"{D1}",
"{D3}",
"{W1}",
"{CLEAR}",
"{NAME;#}",
"{COLOR;#}"
Special thanks to :
- romhacking.net user 'g8z et al' for his trace analysis : http://www.romhacking.net/documents/267/
- BigNailCow who had already done most of the work with the Caravan editor
Last edited by Wiz on Wed Sep 14 2016 7:55pm, edited 2 times in total.
RedShine
Shining Member
Shining Member
Posts: 173
Joined: Sat Apr 05 2014 6:22am
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by RedShine »

That's pretty neat. I wonder if it would be possible to integrate other functions down the road, like font editing in an easier way than Caravan offers currently. I never did like the italic font for SF when it comes to readability. Call me picky, but yeah.
ronnen
Shining Member
Shining Member
Posts: 162
Joined: Fri Jan 20 2012 9:01pm
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by ronnen »

Nice Wiz :)
User avatar
Stordarth
The L-Block Anomaly
Administrator
Posts: 19916
Joined: Thu Sep 16 2004 3:30pm
Location: The Midlands, Staffordshire, England
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by Stordarth »

Freakin' well done, man! This is fantastic! The only thing I'd consider adding would be a search function. Occasionally you want to edit a line, and remember certain phrases used in the line (such as evil spilit, for instance), but scrolling through several hundred lines of code is tedious. I have all the lines in a text file to allow me to search, but an inbuilt search for this would make this much more cohesive and useful.
Image
Hacks
Milestone: Shining Force 2: Milestone Edition {25/06/11} / 12 Man Marathon {25/06/11}
------
RPG Gallery
LoV-Dark Dominion: Character Stats / Rebel Base Managment / Rebel Base Map/ Spell Damage Calculator

SFCW-A: Durandar, Sedor Silverwing
SFCW Gaiden- Shining Souls: Ragengo Image
User avatar
Wiz
Shining Member
Shining Member
Posts: 181
Joined: Sun Mar 18 2007 2:43pm
Location: Blois, France
Contact:
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by Wiz »

Thanks guys, glad you like it ! :)

I prefer to make lots of simple tiny tools instead of creating a unmaintainable monster.

So this one will not include a font editor, but that could well be the next tiny tool I'll make, because it seems to be quite simple to do actually ...
Once again though, I'll do my best to avoid to loose time by re-inventing the wheel, so this might just become a "Font Manager", with import/export functions to/from a 2BPP PNG format, something like that. I just need to know if I can store the character's width as some kind of metadata somewhere in the PNG format. :shifty: We'll see !

Stordarth, while this is not an editor and you can't edit lines inside the program (I prefer to delegate that to existing text editors with the TXT format), I was still curious to try a "filter" feature ... and it's great fun to use !
So thanks for the idea, and here's the new 1.1.0 release (updated first post) :
https://github.com/ShiningForceCentral/ ... /tag/1.1.0

Evil Spilit indeed !
Image
User avatar
Stordarth
The L-Block Anomaly
Administrator
Posts: 19916
Joined: Thu Sep 16 2004 3:30pm
Location: The Midlands, Staffordshire, England
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by Stordarth »

Brilliant! The fact that you can see multiple lines at once will make searching for specific words or phrases far easier than searching in notepad. A real shame that this can't edit the text directly though. If it could do that whilst also regenerating the huffman trees it would even surpass the textbank editor in the caravan, and that's saying something.
Image
Hacks
Milestone: Shining Force 2: Milestone Edition {25/06/11} / 12 Man Marathon {25/06/11}
------
RPG Gallery
LoV-Dark Dominion: Character Stats / Rebel Base Managment / Rebel Base Map/ Spell Damage Calculator

SFCW-A: Durandar, Sedor Silverwing
SFCW Gaiden- Shining Souls: Ragengo Image
Sir Astral
The White Wizard
Shining Member
Posts: 360
Joined: Thu Sep 16 2004 7:52pm
Location: Ohio
Contact:
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by Sir Astral »

This is great work, and opens up a lot of possibilities. I'll personally find it very useful for an ambitious project. :thumbsup:
User avatar
Wiz
Shining Member
Shining Member
Posts: 181
Joined: Sun Mar 18 2007 2:43pm
Location: Blois, France
Contact:
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by Wiz »

I thought an external editor would be much more convenient, but oh well :) ...
Spoiler
Image
Image
Release 1.2.0 :
https://github.com/ShiningForceCentral/ ... /tag/1.2.0

Actually, this is also quite fun to use !
Really efficient process, no need to switch between this and the text editor anymore, silly results appear in emulator quicker than ever ! :excited:

Please be aware I don't want to re-implement a text editor in here though, so I hope this will be enough, ergonomically speaking ! ;)
RedShine
Shining Member
Shining Member
Posts: 173
Joined: Sat Apr 05 2014 6:22am
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by RedShine »

Wow, awesome progress Wiz! your efforts with the disassembly are really paving the way for an eventual retranslation of SF2, much closer to the source material, not to mention games with entirely new stories, if you are able to get deep enough into the heart of the game to be able to edit events.
User avatar
Stordarth
The L-Block Anomaly
Administrator
Posts: 19916
Joined: Thu Sep 16 2004 3:30pm
Location: The Midlands, Staffordshire, England
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by Stordarth »

Awesome. I can see very little that would improve this, except perhaps a glossary or buttons of some of the coded functions, like the formatting buttons used for making posts here. It'd be so awesome to have buttons that you hover over, have a tooltip explaining them, and then press to insert it into the text at the cursor. I always forget which codes exist, so having them all to hand would be fantabulous.

Still, I don't want to keep adding more work for you to do. This is a fine achievement as it is. :thumbsup: :thumbsup:
Image
Hacks
Milestone: Shining Force 2: Milestone Edition {25/06/11} / 12 Man Marathon {25/06/11}
------
RPG Gallery
LoV-Dark Dominion: Character Stats / Rebel Base Managment / Rebel Base Map/ Spell Damage Calculator

SFCW-A: Durandar, Sedor Silverwing
SFCW Gaiden- Shining Souls: Ragengo Image
User avatar
Assassins
Mentat
Shining Legend
Posts: 10280
Joined: Thu Sep 16 2004 8:08pm
Location: Medina OH
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by Assassins »

Wiz living up to the name
The failblood.

"I am very poorly and very stupid and I hate everyone and everything" -Charles Darwin
User avatar
Wiz
Shining Member
Shining Member
Posts: 181
Joined: Sun Mar 18 2007 2:43pm
Location: Blois, France
Contact:
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by Wiz »

:excited: So many kind words, thank you so much guys, it really motivates me ! :)

Yes RedShine, in my mind this is only the beginning and the true target is to create whole new adventures to enjoy.
But with this first tool, indeed a re-translation seems already quite feasible right now, which is nice !

Thank you for your feedback Stordarth, and yeah, now that the tool works well, you already guessed that I prefer to focus on more essential stuff for the moment, instead of polishing a GUI.

I'll take this example as an opportunity to express what I feel about things like that more generally.
I don't want to seem elitist or condescending with what I'm going to say, but in a few (shocking) words ... I don't want make my tools user friendly. I just want to make them developer-friendly ! :damnit:
I feel like making a user-friendly tool sometimes needs more work than the tool's essential features themselves (in terms of GUI conception, documentation, and user support ...), and as long as we've not reached our primary, technical goals, I don't want to spread myself on too much user-comfort considerations.
But ... I'm not sharing my work on the SFC GitHub account for nothing. :shifty: Anybody is free to contribute and polish stuff here and there ! :)

So I'm counting on you guys to understand that you will mostly see me provide rough Proof-of-Concept GUIs, and pass to the next thing I think is most essential to go on. Or sometimes simply the most fun/rewarding/relaxing to work on. :shifty:
RedShine
Shining Member
Shining Member
Posts: 173
Joined: Sat Apr 05 2014 6:22am
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by RedShine »

Oh that's definitely understandable!
I'm not a developer by any stretch, but I completely agree that ease of development, clean code and modular, extensible functionality should come before any GUI considerations.

When you feel everything is sufficiently solidified and documented, then prettying it up for the general public becomes a consideration. Be as it may, you on the SF2 front and Rubixcuber/b] on the SF1 front are attaining amazing progress.
User avatar
Earl
Shining Legend
Shining Legend
Posts: 3018
Joined: Sat Apr 24 2004 6:39am
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by Earl »

One thing that would be absolutely fantastic - the ability to add additional lines.

I know from dicking around that the game can handle more than the original alottment of lines... but it wasn't convenient to add text banks and fill them with dialogues (I did it through copy/pasting in a hex editor, which got cumbersome).
User avatar
Wiz
Shining Member
Shining Member
Posts: 181
Joined: Sun Mar 18 2007 2:43pm
Location: Blois, France
Contact:
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by Wiz »

Well, I've designed this tool with that kind of thing in mind, so I'm pretty sure that's already feasible if you use the TXT file.
Just add new lines at the end !
Ideally you should follow the hex index values with 4 digits, but actually I believe that you can just put the equal character with no index before, then import it in SF2TextManager, and then export it back into TXT file, and the tool itself will write proper indexes just by following order of appearance of text lines.
Of course, when exporting to ROM files you will encounter big problems if you get a bigger last textbank. (EDIT : err actually not so much, as only the ending credits would get overwritten :shifty: )
But when exporting to disassembly files, the tool should be able to produce any size of textbank, even for the last one, and even better, it must be already able to produce any number of new textbanks.
At least up to 100, considering current file naming convention. ;)
Since I've not taken the time to test all of this myself, this is purely theoretical at the moment, but I really believe it already allows new lines so please, give it a try ! :)
Last edited by Wiz on Mon Oct 03 2016 4:23pm, edited 2 times in total.
User avatar
Earl
Shining Legend
Shining Legend
Posts: 3018
Joined: Sat Apr 24 2004 6:39am
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by Earl »

I don't know when I'll have the time, but still, <3 <3 <3
User avatar
SirHedge
Shining Hero
Shining Hero
Posts: 1189
Joined: Sat Mar 15 2008 4:10am
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by SirHedge »

I'm sorry for the necro, but I just came across this, and had to share my thanks. Maybe some others who missed this the first time will see it now too.
User avatar
greyskies
Shining Member
Shining Member
Posts: 438
Joined: Wed Feb 02 2011 11:55am
Location: Seebenstein, Austria
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by greyskies »

Woah, I totally did. Gotta take this for a drive sometime soon. That said, this should really be on the front page of the hack library thread. Great work, Wiz!
.
Check out Return to Grans - A Shining Force II hack which features a completely
reworked story, numerous visual improvements, and tons of balance changes.

Also available as storymode hack only.
User avatar
MXC
1090
Shining Legend
Posts: 27345
Joined: Fri Sep 17 2004 1:48am
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by MXC »

I'll send Drakonis a PM to update the library in general.
User avatar
Wiz
Shining Member
Shining Member
Posts: 181
Joined: Sun Mar 18 2007 2:43pm
Location: Blois, France
Contact:
Status: Offline

Re: [GitHub] ShiningForceCentral/SF2TextManager

Post by Wiz »

Just created a new thread actually !
Thanks for the kind words guys, I'm back into this since a few days ago and I hope to make good progress in the next few weeks ! :)


EDIT (7th March 2019) :

I just pushed SF2TextManager-1.5.0 on SF2DISASM with this new feature :
After loading a game script from any source, you can now update it by importing ASM files which will be parsed automatically.
Spoiler
Image
This way, you can easily update code, cutscenes and map setups without having to manage text back and forth between the whole game script and the places where your are referencing those lines. Just write the text line as a comment directly in the ASM file ! :)

Examples :

- Code :
All macros named "txt" can be parsed.

Code: Select all

; ASM FILE code\specialscreens\witch\witchactions.asm :
; 0x7406..0x75C4 : Witch actions

; =============== S U B R O U T I N E =======================================

WitchNew:
                
                 
                txt     $DE             ; "What should I call you?{W2}"
                move.b  (SAVE_FLAGS).l,d2
                andi.w  #3,d2
                eori.w  #3,d2
                lsl.w   #1,d2
                btst    #1,d2
                beq.s   loc_7424
                moveq   #1,d0
                bra.s   loc_7426
loc_7424:
                
                moveq   #2,d0
loc_7426:
                
                moveq   #1,d1
loc_7428:
                
                jsr     j_WitchMainMenu
                tst.w   d0
                bmi.s   byte_73C2       
                subq.w  #1,d0
                move.w  d0,((SAVE_SLOT_INDEX-$1000000)).w
                jsr     j_NewGame
                clsTxt
                clr.w   d0
                jsr     j_NameCharacter
                btst    #7,(SAVE_FLAGS).l; "Game completed" bit
                beq.w   byte_7476       
                btst    #INPUT_A_START_BIT,((P1_INPUT-$1000000)).w
                beq.w   byte_7476       
                moveq   #1,d0
                moveq   #$1B,d7
loc_7464:
                
                jsr     j_NameCharacter
loc_746A:
                
                addq.w  #1,d0
                cmpi.w  #6,d0
                beq.s   loc_746A
                dbf     d7,loc_7464
byte_7476:
                
                txt     $DF             ; "{NAME;0}....{N}Nice name, huh?{W2}"
                bsr.w   CheatModeConfiguration
                txt     $E8             ; "I'll let you decide the{N}difficulty level at this time."
                clr.w   d0
                moveq   #3,d1
                moveq   #$F,d2
                jsr     j_WitchMainMenu
                tst.w   d0
                bpl.s   loc_7494
                clr.w   d0
loc_7494:
                
                btst    #0,d0
                beq.s   loc_749E
                setFlg  $4E             ; Difficulty bit 0
loc_749E:
                
                btst    #1,d0
                beq.s   loc_74A8        
                setFlg  $4F             ; Difficulty bit 1
loc_74A8:
                
                addi.w  #$E9,d0 ; HARDCODED text index for difficulty choice reactions
                bsr.w   DisplayText     
                txt     $E0             ; "Now, good luck!{N}You have no time to waste!{W1}"
loc_74B4:
                
                move.w  ((SAVE_SLOT_INDEX-$1000000)).w,d0
                move.b  #3,((CURRENT_MAP-$1000000)).w
                move.b  #3,((EGRESS_MAP_INDEX-$1000000)).w
                bsr.w   SaveGame
                disableSram
                clsTxt
                move.b  #3,d0           ; HARDCODED new game starting map
                move.w  #$38,d1 ; HARDCODED main entity starting X
                move.w  #3,d2           ; HARDCODED main entity starting Y
                move.w  #3,d3           ; HARDCODED main entity starting facing
                moveq   #1,d4
loc_74DE:
                
                bra.w   MainLoop        

	; End of function WitchNew


; =============== S U B R O U T I N E =======================================

WitchLoad:
                
                 
                txt     $E1             ; "By the way, who are you?"
                move.b  (SAVE_FLAGS).l,d2
                andi.w  #3,d2
                lsl.w   #1,d2
                btst    #1,d2
                beq.s   loc_74FC
                moveq   #1,d0
                bra.s   loc_74FE
loc_74FC:
                
                moveq   #2,d0
loc_74FE:
                
                moveq   #2,d1
                jsr     j_WitchMainMenu
                tst.w   d0
                bmi.w   byte_73C2       
                subq.w  #1,d0
                move.w  d0,((SAVE_SLOT_INDEX-$1000000)).w
                bsr.w   LoadGame
                disableSram
                txt     $E2             ; "{NAME;0}, yes!  I knew it!{W2}"
                bsr.w   CheatModeConfiguration
                txt     $E0             ; "Now, good luck!{N}You have no time to waste!{W1}"
                clsTxt
                clr.b   ((DEACTIVATE_WINDOW_HIDING-$1000000)).w
                chkFlg  $58             ; checks if a game has been saved for copying purposes ? (or if saved from battle?)
                beq.s   loc_753A
                jsr     j_BattleLoop
                bra.w   loc_75E0        
loc_753A:
                
                clr.w   d0
                move.b  ((CURRENT_MAP-$1000000)).w,d0
                jsr     GetSavePointForMap(pc)
                nop
                moveq   #$FFFFFFFF,d4
                bra.w   loc_75E0        

	; End of function WitchLoad


; =============== S U B R O U T I N E =======================================

WitchCopy:
                
                 
                txt     $E3             ; "Copy?  Really?"
                jsr     j_YesNoChoiceBox
                tst.w   d0
                bne.w   byte_73C2       
                move.b  (SAVE_FLAGS).l,d0
                andi.w  #3,d0
                subq.w  #1,d0
                bsr.w   CopySave
                txt     $E4             ; "Hee, hee!  It's done.{W2}"
                bra.w   byte_73C2       

	; End of function WitchCopy


; =============== S U B R O U T I N E =======================================

WitchDel:
                
                 
                txt     $E5             ; "Delete which one?"
                move.b  (SAVE_FLAGS).l,d2
                andi.w  #3,d2
                lsl.w   #1,d2
                btst    #1,d2
                beq.s   loc_758E
                moveq   #1,d0
                bra.s   loc_7590
loc_758E:
                
                moveq   #2,d0
loc_7590:
                
                moveq   #2,d1
                jsr     j_WitchMainMenu
                tst.w   d0
                bmi.w   byte_73C2       
                subq.w  #1,d0
                move.w  d0,((SAVE_SLOT_INDEX-$1000000)).w
                txt     $E6             ; "Delete?  Are you sure?"
                jsr     j_YesNoChoiceBox
                tst.w   d0
                bne.w   byte_73C2       
                move.w  ((SAVE_SLOT_INDEX-$1000000)).w,d0
                bsr.w   ClearSaveSlotFlag
                txt     $E7             ; "Hee, hee!  It's gone!{W2}"
                bra.w   byte_73C2       

	; End of function WitchDel

Properly formatted txt commands with text line between double quotes will be parsed to update the script at indicated index.

- Cutscenes :
Cutscenes rely on 5 text-related macros :
- textCursor : defines new cursor position with a line index from the script
- nextSingleText, nextSingleTextVar, nextText, nextTextVar : displays next text lines while pushing text cursor forward.

Code: Select all

; ASM FILE data\scripting\map\cs_intro1.asm :
; 0x47F7E..0x48380 : Intro cutscene 1
IntroCutscene1: textCursor $105A
                mapLoad 42,2,5
                csWait 1
                loadMapEntities ce_48340
                setActscriptWait $0,eas_Init
                setActscriptWait $83,eas_Init3
                setActscriptWait $84,eas_Init3
                setActscriptWait $85,eas_Init3
                setActscript $82,eas_Transparent
                fadeInFromBlackHalf
                csWait 30
                setPos $5,7,15,UP
                setPos $80,7,16,UP
                setPos $81,7,17,UP
                entityActions $5
                 moveUp 6
                endActions
                entityActions $80
                 moveUp 6
                endActions
                entityActionsWait $81
                 moveUp 6
                endActions
                playSound SFX_INTRO_LIGHTNING
                setQuake 1
                setPos $83,7,12,LEFT
                setPos $84,7,13,UP
                setPos $85,7,14,UP
                csWait 5
                setQuake 0
                setPos $83,63,63,LEFT
                setPos $84,63,63,UP
                setPos $85,63,63,UP
                csWait 10
                setFacing $5,DOWN
                setFacing $80,DOWN
                setFacing $81,DOWN
                setPos $83,7,12,LEFT
                setPos $84,7,13,UP
                setPos $85,7,14,UP
                csWait 5
                setPos $83,63,63,LEFT
                setPos $84,63,63,UP
                setPos $85,63,63,UP
                csWait 10
                setPos $83,7,12,LEFT
                setPos $84,7,13,UP
                setPos $85,7,14,UP
                csWait 5
                setPos $83,63,63,LEFT
                setPos $84,63,63,UP
                setPos $85,63,63,UP
                csWait 10
                setActscript $5,eas_Jump
                setActscript $80,eas_Jump
                setActscriptWait $81,eas_Jump
                setActscript $5,eas_Jump
                setActscript $80,eas_Jump
                setActscriptWait $81,eas_Jump
                csWait 30
                setCameraEntity $5
                entityActions $5
                 moveUp 4
                endActions
                entityActions $80
                 moveUp 4
                endActions
                entityActionsWait $81
                 moveUp 4
                endActions
                setActscriptWait $80,eas_BumpUp
                setActscriptWait $81,eas_BumpUp
                csWait 30
                setFacing $5,DOWN
                nextSingleText $80,$5   ; "Stay here, OK?{D2}"
                nod $80
                entityActionsWait $5
                 moveRight 5
                endActions
                setFacing $80,RIGHT
                setFacing $81,RIGHT
                entityActionsWait $5
                 moveDown 3
                endActions
                csWait 30
                shiver $5
                csWait 30
                nextSingleText $80,$5   ; "Oops, a dead end!{D2}"
                entityActionsWait $5
                 moveUp 3
                 moveLeft 5
                endActions
                setFacing $80,UP
                setFacing $81,UP
                setFacing $5,DOWN
                csWait 20
                headshake $5
                csWait 20
                entityActionsWait $5
                 moveLeft 5
                endActions
                setFacing $80,LEFT
                setFacing $81,LEFT
                entityActionsWait $5
                 moveDown 3
                endActions
                csWait 40
                shiver $5
                csWait 40
                nextSingleText $80,$5   ; "Hey!  I found some hidden{N}stairs!{D2}"
                entityActionsWait $5
                 moveUp 2
                 faceRight 1
                endActions
                nextSingleText $80,$5   ; "Hey, guys!{N}Follow me!{D2}"
                nextSingleText $0,$80   ; "Alright!{D2}"
                setActscript $80,eas_Jump
                setActscriptWait $81,eas_Jump
                setActscript $80,eas_Jump
                setActscriptWait $81,eas_Jump
                entityActions $80
                 moveUp 1
                 moveLeft 5
                 faceDown 1
                endActions
                entityActionsWait $81
                 moveUp 2
                 moveLeft 4
                 faceDown 1
                endActions
                setFacing $5,UP
                csWait 20
                entityActions $5
                 moveDown 3
                endActions
                entityActions $80
                 moveDown 3
                endActions
                entityActionsWait $81
                 moveLeft 1
                 moveDown 2
                endActions
                playSound SFX_WARP
                fadeOutToBlackHalf
                setCameraEntity $FFFF
                setPos $5,19,3,DOWN
                setPos $80,19,3,DOWN
                setPos $81,19,3,DOWN
                reloadMap 15,0
                csWait 10
                fadeInFromBlackHalf
                setCameraEntity $5
                entityActionsWait $5
                 moveDown 1
                endActions
                csWait 10
                nextSingleText $80,$5   ; "Finally, I found the hidden{N}room of the Ancient Shrine!{D2}"
                entityActions $5
                 moveDown 1
                endActions
                entityActionsWait $80
                 moveDown 1
                endActions
                entityActions $5
                 moveDown 2
                endActions
                entityActions $80
                 moveDown 2
                endActions
                entityActionsWait $81
                 moveDown 2
                endActions
                csWait 30
                setActscriptWait $5,eas_Jump
                setActscriptWait $5,eas_Jump
                nextSingleText $80,$5   ; "A treasure chest!{D2}"
                customActscriptWait $5
                 ac_setSpeed 48,48      ;   
                 ac_jump eas_Idle       ;   
                ac_end
                customActscriptWait $80
                 ac_setSpeed 48,48      ;   
                 ac_jump eas_Idle       ;   
                ac_end
                customActscriptWait $81
                 ac_setSpeed 48,48      ;   
                 ac_jump eas_Idle       ;   
                ac_end
                entityActions $5
                 moveDown 2
                endActions
                entityActions $80
                 moveDown 2
                endActions
                entityActionsWait $81
                 moveDown 2
                endActions
                setCamDest 15,5
                shiver $5
                nextSingleText $80,$5   ; "I wonder if they're here?{D2}"
                nextSingleText $FF,$FF  ; "{NAME;5} the thief opened{N}the chest.{D2}"
                setBlocks 7,3,1,1,19,10
                nextSingleText $FF,$FF  ; "He found Power Water.{D2}"
                headshake $5
                nextSingleText $80,$5   ; "No, I don't want this!{D2}"
                nextSingleText $FF,$FF  ; "{NAME;5} discarded the{N}Power Water.{D2}"
                setBlocks 4,3,1,1,19,10
                csWait 30
                setActscriptWait $5,eas_Init
                setActscriptWait $80,eas_Init
                setActscriptWait $81,eas_Init
                entityActionsWait $81
                 moveLeft 1
                 moveDown 2
                 faceRight 1
                endActions
                nextSingleText $0,$81   ; "Where on Earth are those{N}jewels?{D2}"
                csWait 10
                setFacing $5,LEFT
                nextSingleText $80,$5   ; "I'm not sure.{D2}"
                csWait 20
                setCameraEntity $5
                entityActions $5
                 moveRight 5
                endActions
                entityActions $80
                 moveDown 1
                 moveRight 4
                endActions
                entityActionsWait $81
                 eaWait 20
                 moveRight 4
                endActions
                csWait 5
                setActscript $5,eas_461E4
                csWait 5
                setActscript $80,eas_461B6
                csWait 5
                setActscript $81,eas_461B6
                csWait 60
                entityActionsWait $5
                 moveRight 2
                 moveUp 1
                endActions
                nextSingleText $80,$5   ; "Something is shining over{N}there...!{D2}"
                setFacing $80,UP
                setFacing $81,UP
                setCamDest 21,1
                nextSingleText $80,$5   ; "Oh, they must be the jewels{N}of light and evil!{D2}"
                csWait 20
                fadeOutToBlackHalf
                csc_end
ce_48340:       mainEntity 63,63,UP
                entity 63,63,DOWN,5,eas_Init
                entity 63,63,UP,202,eas_Init
                entity 63,63,UP,202,eas_Init
                entity 26,4,DOWN,173,eas_Init
                entity 63,63,LEFT,183,eas_Init
                entity 63,63,UP,183,eas_Init
                entity 63,63,UP,183,eas_Init
                dc.w $FFFF
- Map setups :
Most map setup sections rely on both code and cutscenes, which you can edit as explained just above.
But area descriptions can also be edited now :

Code: Select all

; ASM FILE data\maps\entries\map03\mapsetups\s4_descriptions.asm :
; 0x512E0..0x51358 : 

; =============== S U B R O U T I N E =======================================

ms_map3_AreaDescriptions:
                
                move.w  #$FC3,d3        ; "Welcome!{N}WEAPONS and ITEMS{W1}"
                lea     byte_512F0(pc), a0
                nop
                jmp     DisplayAreaDescription

	; End of function ms_map3_AreaDescriptions

byte_512F0:     msDesc 9, 22, 2, 0      ; "{NAME} investigated{N}the sign.{W2}{CLEAR}"
                                        ; "Welcome!{N}WEAPONS and ITEMS{W1}"
                msDesc 7, 4, 4, 1       ; "{NAME} investigated{N}the book shelves.{W2}{CLEAR}"
                                        ; "A book...{N}ATTITUDE OF SOLDIERS{W1}"
                msDesc 7, 9, 3, 2       ; "{NAME} investigated{N}the wash basin.{W2}{CLEAR}"
                                        ; "Soapy water...{N}(gulp, gulp)...yuck!{N}That tastes disgusting!{W1}"
                msDesc 26, 13, 5, 3     ; "{NAME} looked into{N}the well.{W2}{CLEAR}"
                                        ; "A deep well.{W1}"
                msDesc 40, 6, 4, 4      ; "{NAME} investigated{N}the book shelves.{W2}{CLEAR}"
                                        ; "A book...{N}HEALING MAGIC{W1}"
                msDesc 41, 6, 4, 5      ; "{NAME} investigated{N}the book shelves.{W2}{CLEAR}"
                                        ; "A book...{N}BEGINNER SWORDSMANSHIP{W1}"
                msDesc 42, 6, 6, 6      ; "{NAME} looked at{N}the paper.{W2}{CLEAR}"
                                        ; "It reads...{N}Nothing to fear but fear{N}itself.{W1}"
                msDesc 43, 6, 6, 7      ; "{NAME} looked at{N}the paper.{W2}{CLEAR}"
                                        ; "It reads...{N}Look before you leap.{W1}"
                msDesc 44, 6, 6, 8      ; "{NAME} looked at{N}the paper.{W2}{CLEAR}"
                                        ; "It reads...{N}No pain, no gain.{N}...is this true?{W1}"
                msDesc 53, 13, 4, 9     ; "{NAME} investigated{N}the book shelves.{W2}{CLEAR}"
                                        ; "A book...{N}THE LEGEND OF MAX{W1}"
                msDesc 54, 13, 4, 10    ; "{NAME} investigated{N}the book shelves.{W2}{CLEAR}"
                                        ; "A book...{N}BE GOOD{W1}"
                msDesc 55, 13, 4, 11    ; "{NAME} investigated{N}the book shelves.{W2}{CLEAR}"
                                        ; "A book...{N}LITTLE DINOSAURS{W1}"
                msDesc 56, 13, 4, 12    ; "{NAME} investigated{N}the book shelves.{W2}{CLEAR}"
                                        ; "A book...{N}SEGA GUIDE{N}...sounds good.{W1}"
                msDesc 56, 15, 4, 13    ; "{NAME} investigated{N}the book shelves.{W2}{CLEAR}"
                                        ; "A book...{N}AN OLD GOAT{N}...Sir Astral?{W1}"
                msDesc 57, 15, 4, 14    ; "{NAME} investigated{N}the book shelves.{W2}{CLEAR}"
                                        ; "A book...{N}GUIDE TO THE CASTLE{W1}"
                msDesc 58, 15, 4, 15    ; "{NAME} investigated{N}the book shelves.{W2}{CLEAR}"
                                        ; "A book...{N}STUDY OF YOGURT{W1}"
                msDesc 59, 15, 4, 16    ; "{NAME} investigated{N}the book shelves.{W2}{CLEAR}"
                                        ; "A book...{N}SCIENCE 101{W1}"
                msDescEnd
For each entry :
- First line represents the investigation line, which is generally shared by a lot of entries, so be careful about the impact
- Second line is the actual description line which you can generally edit with no impact on anything else
For a more detailed explanation on this map setup section please refer to the map setup documentation.


You can also extend the game's script size by defining line indexes above the game's maximum ($10AA) : SF2TextManager will automatically expand the array of lines and create any number of needed textbanks. Beware though : any new textbank after textbank 16 has to be declared in the textbank entry list in disasm\data\scripting\text\entries.asm

So yeah, changing lines in existing cutscenes and code (or declaring new lines to use in new cutscenes) is now quite easy and fun. :)
Post Reply