Two Usecode-related Questions

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Karlos
Posts: 149
Joined: Thu May 14, 2020 1:34 pm

Two Usecode-related Questions

Post by Karlos »

1) Conversations: How can I break from a nested conversation? If I'm in a nested converse, and I want the NPC to break-off the conversation for whatever reason, how can I do this? Using a break just returns me to the next outmost converse as one would expect.

2) Usecode and Numbering: Are there any particular conventions I should follow when assigning Usecode numbers to functions, eggs, etc? Are there any reserved numbers? How high can the numbers go? Do I have to worry about collisions between shape numbers and NPC numbers, at least for shapes other than flat tiles?



-Karl
drcode
Site Admin
Posts: 2267
Joined: Thu May 14, 2020 1:34 pm

Re: Two Usecode-related Questions

Post by drcode »

1. I don't know off-hand. Maybe we need an additional feature in ucc.

2. The conventions (from the original U7) are:

0-0x3ff Functions for the shapes, by shape #.
0x400-0x5ff NPC function. NPC #n gets code 0x400+n.
0x600-0x7ff? Eggs. Also spells start at one of these spots,
and Exult is currently hard-coded to find them
there.
0x800-0xfff Any other subroutines.

One recently added feature is that if you give a # for a routine, any unnumbered routines following it will be numbered consecutively.
Locked