Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ Dawn of Time ➜ Configuration ➜ Changing order in creation

Changing order in creation

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Veshirak   USA  (5 posts)  Bio
Date Sun 27 Oct 2002 05:08 AM (UTC)
Message
I want to change around the order of creation so that a player chooses their class before rolling stats. This is so I can prioritize which values will go with what stat based on their chosed class. For example, strength is a warrior's most important stat, so it will be given the highest stat rolled. If anyone knows exactly what this will entail, whether just reordering function calls or something more complex, I'd appreciate the info.
Top

Posted by Veshirak   USA  (5 posts)  Bio
Date Reply #1 on Mon 28 Oct 2002 04:28 PM (UTC)
Message
Alright, nevermind, I figured it out. It just involves changing around the redirection function calls in nanny.cpp, though there are a few other changes that need to be made. If anyone wants to know, post a reply here, and I'll give the jist of the changes once I finish it up.
Top

Posted by Veshirak   USA  (5 posts)  Bio
Date Reply #2 on Tue 29 Oct 2002 03:34 AM (UTC)
Message
All right, new question, same idea. I want to add an array that has the stats priority order to the class_type struct, but I'm not sure which file has the code that imports the class info from file. If someone could fill me in on that, I'd appreciate it greatly.
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #3 on Tue 29 Oct 2002 08:17 PM (UTC)
Message
Veshirak, what it sounds like you want to do is going to very near require recoding the entire process of stat rolling at creation. Also, keep in mind the classedit function allows for 2 Major stats per class to complicate matters further. Personally, I'd recommend adjusting the bonuses each class gets to their primary stats rather than having the highest numbers automatically assigned to the prime stats for the class. Also consider that there are unusual players that will want a stat thats not a prime for the class to be higher than the primes before the class bonuses are applied. My mage on Stormbringer is one such creation.... he has a CO better than most warriors before eq bonuses are applied, and an even more impressive CO after eq bonuses. Just some friendly advise from a fellow coder.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Kalahn   United Kingdom  (138 posts)  Bio
Date Reply #4 on Sat 02 Nov 2002 11:55 AM (UTC)
Message
Quote:
All right, new question, same idea. I want to add an array that has the stats priority order to the class_type struct, but I'm not sure which file has the code that imports the class info from file. If someone could fill me in on that, I'd appreciate it greatly.


How I would probably tackle this.

In params.h, we have:

    // Stat stuff
    #define MAX_STATS   10
    #define STAT_ST     0
    #define STAT_QU     1
    #define STAT_PR     2
    #define STAT_EM     3
    #define STAT_IN     4
    #define STAT_CO     5
    #define STAT_AG     6
    #define STAT_SD     7
    #define STAT_ME     8
    #define STAT_RE     9


Add an array in the class_type struct (structs.h).
e.g.
sh_int stat_priority[MAX_STATS];


If strength is the highest priority for the warrior class, presence has second, quickness has the fourth, then the values would be defined a long the lines of:
class_table[warrior_class_index].stat_priority[STAT_ST]=1;
class_table[warrior_class_index].stat_priority[STAT_QU]=4;
class_table[warrior_class_index].stat_priority[STAT_PR]=2;

NOTE: You wouldn't use the above code though, you would write an olc editor to set this stuff, and don't use STAT_?? in the code, instead use a variable to reference by index and look up the index into a name using stat_flags[] defined in tables.cpp. Search for 'stat_flags' in raceedit.cpp you will see what I mean about using a variable to access stuff.

Assuming you manage to get in the class table, a sorted list of priorities...

Within roll_stats() (nanny.cpp), after the call to gen_rolemaster_stats(), there is a transfer of stats to the character. Just before that, sort them.

To achieve this, first sort the rm_stats_set, so highest stat is first in the array, lowest is last. Then use something like the following loop to transfer them to the character.


// i = transfers stats one by one
// p = locates the correct position to get stat from
int i,p;
for(i=0; i<MAX_STATS; i++){
  p=class_table[ch->clss].stat_priority;
  ch->perm_stats= rm_stats_set.perm[p];
  ch->potential_stats=rm_stats_set.potential[p];    
}


I would probably go a bit flasher than this in real development... e.g. make it so you can set a variable amount of prority for different classes, say for mage 5 stats are sorted in priority, warrior only has the first two stats in priority. To achieve this, I would most likely stop my sorting routine sorting after the specified number of values.

Also the above system assumes the priorities are unique... if not you have to develop a more extensive system.

In order to save the priority information, I would probably just put into the class_type gio structure in class (search for GIO_START(class_type) in dynamics.cpp),


  GIO_SHINTH(stat_priority[STAT_ST], "statprior_ST")
  GIO_SHINTH(stat_priority[STAT_QU], "statprior_QU")
  GIO_SHINTH(stat_priority[STAT_PR], "statprior_PR")
  GIO_SHINTH(stat_priority[STAT_EM], "statprior_EM")
  GIO_SHINTH(stat_priority[STAT_IN], "statprior_IN")
  GIO_SHINTH(stat_priority[STAT_CO], "statprior_CO")
  GIO_SHINTH(stat_priority[STAT_AG], "statprior_AG")
  GIO_SHINTH(stat_priority[STAT_SD], "statprior_SD")
  GIO_SHINTH(stat_priority[STAT_ME], "statprior_ME")
  GIO_SHINTH(stat_priority[STAT_RE], "statprior_RE")


I did something simular a long time ago with racial stat modifiers (search for GIO_START(race_data) in races.cpp).

Hope this helps, let us know how you get on.

- Kal

Kalahn
Developer of the Dawn of Time codebase
http://www.dawnoftime.org/
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


21,111 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.