Author Topic: Change where level training text displays  (Read 489 times)

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1873
Change where level training text displays
« on: June 19, 2016, 04:47:35 AM »
I've got some new classes, some of which have much longer names than the standard FRUA class names. The longest is "Wizard of High Sorcery". This is working well almost everywhere, but creates a minor glitch when a wizard is eligible to train to advance to the next level (see screenshot).

So, what I am looking to do, if possible, is to change the location where the text "A level [xx] [class]" and "And a level [xx] [class]" are displayed on the screen. I assume that there is a byte somewhere in CKIT.EXE that fixes these. I want to move the horizontal position of this text left by about 4 spots. Does anyone know how to locate the relevant byte?

The "A level [xx] [class]" text is at offset 562676, and the "And a level [xx] [class]" text is at offset 562605; not sure if that helps at all.

Offline hans

  • Hero Member
  • *****
  • Posts: 2569
Re: Change where level training text displays
« Reply #1 on: June 19, 2016, 03:23:34 PM »
What if, instead of the very long "Wizard of High Sorcery," you changed the name to the simpler and shorter "High Sorcerer"...?    ???

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1873
Re: Change where level training text displays
« Reply #2 on: June 19, 2016, 05:12:25 PM »
I'll admit there is a certain logic and pragmatism to that, but I'd like to stick with the longer name (it is shortened to "wizard" in character creation). A new "sorcerer" class was in fact introduced into dragonlance at around D&D 3e, which was distinct from the existing wizard class.

Offline Simeon Pilgrim

  • Full Member
  • ***
  • Posts: 163
    • simeonpilgrim.com
Re: Change where level training text displays
« Reply #3 on: June 20, 2016, 12:28:13 AM »
I assume that the trainer code is the same as in curse, and it loops across the levels then referring code will look something like:

Code: [Select]
                for (int _class = 0; _class <= 7; _class++)
                {
                    if (player.ClassLevel[_class] > 0 &&
                        (classMasks[_class] & actualTrainingClassesMask) != 0)
                    {
                        y_offset++;

                        if (y_offset == 5)
                        {
                            string text = System.String.Format("    a level {0} {1}",
                                player.ClassLevel[_class] + 1, ovr020.classString[_class]);

                            seg041.displayString(text, 0, 10, y_offset, 6);
                        }
                        else
                        {
                            string text = System.String.Format("and a level {0} {1}",
                                player.ClassLevel[_class] + 1, ovr020.classString[_class]);

                            seg041.displayString(text, 0, 10, y_offset, 6);
                        }
                    }
                }

which is in assembly

Code: [Select]
ovr018:53DB     mov     al, 6
ovr018:53DD     push    ax
ovr018:53DE     mov     al, [bp+var_16]
ovr018:53E1     push    ax
ovr018:53E2     mov     al, 0Ah
ovr018:53E4     push    ax
ovr018:53E5     mov     al, 0
ovr018:53E7     push    ax
ovr018:53E8     lea     di, [bp+var_228]
ovr018:53EC     push    ss
ovr018:53ED     push    di
ovr018:53EE     mov     di, offset aAndALevel ; "and a level "
ovr018:53F1     push    cs
ovr018:53F2     push    di
ovr018:53F3     call    @$basg$qm6Stringt1 ; leaves dest String far* on the stack

but if you change the 6 to 1 it will be less indented.



Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1873
Re: Change where level training text displays
« Reply #4 on: June 20, 2016, 07:09:27 AM »
Thanks Simeon. I'm afraid I'm not sure how that translates into bytes in ckit.exe. Is there something in particular I should be looking for in UGE?

Offline Simeon Pilgrim

  • Full Member
  • ***
  • Posts: 163
    • simeonpilgrim.com
Re: Change where level training text displays
« Reply #5 on: June 20, 2016, 06:21:38 PM »
I was trying (at work) looking into the curse bin, to find the byte pattern you would most likely be looking for, but didn't have the correct tools, would need to do from home later...

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1873
Re: Change where level training text displays
« Reply #6 on: July 05, 2016, 09:55:12 PM »
Hi Simeon. Any luck with this yet?

Offline Simeon Pilgrim

  • Full Member
  • ***
  • Posts: 163
    • simeonpilgrim.com
Re: Change where level training text displays
« Reply #7 on: July 06, 2016, 05:35:21 AM »
looks at navel, nope....  :-[

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2068
    • Nol Drek's Web Site
Re: Change where level training text displays
« Reply #8 on: July 06, 2016, 12:38:10 PM »
When you level up, it does not say Ice will become "a level 3 Wizard..."

it actually says Ice will become "    a level 3 Wizard..."

notice the 4 leading spaces, which are part of the text string. I assume this is so that the text on the next line can say "and a level 3 Thief..." with the class names lining up vertically.

You could remove those 4 leading spaces and the word "and " and your class name would fit on the screen.

Here is the relevant information from CKIT.EXE. All offsets are in decimal:

Code: [Select]
17837 (0x45AD) value of pointer to "    a level"
17850 (0x45BA) value of pointer to "and a level"
29587 (0x7393) value of pointer to "    a level %s"
29605 (0x73A5) value of pointer to "and a level %s"

562701 "    a level"
562714 "and a level"
574451 "    a level %s"
574469 "and a level %s"

264032 (2 bytes hex value 93 73) pointer to "    a level %s"
264107 (2 bytes hex value A5 73) pointer to "and a level %s"

559932 (2 bytes hex value AD 45) pointer to "    a level"
559936 (2 bytes hex value BA 45) pointer to "and a level"
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1873
Re: Change where level training text displays
« Reply #9 on: July 07, 2016, 07:38:21 PM »
Thanks for the tip Nol, I will try it out!

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1873
Re: Change where level training text displays
« Reply #10 on: July 07, 2016, 08:01:04 PM »
Thanks Nol. That works nicely.

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2068
    • Nol Drek's Web Site
Re: Change where level training text displays
« Reply #11 on: July 08, 2016, 04:45:32 AM »
Nice!
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

 

anything