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
➜ SMAUG
➜ SMAUG coding
➜ removing classes - races / having a flat file
|
removing classes - races / having a flat file
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Blindmute
South Africa (5 posts) Bio
|
| Date
| Wed 09 Jun 2004 12:32 PM (UTC) Amended on Wed 09 Jun 2004 02:46 PM (UTC) by Blindmute
|
| Message
| Hi,
I have searched this forum and found a couple of things that points into the direction of what I want to achieve. I can read code a bit and so forth. I would like to know if anyone might perhaps have implemented that you use flatfiles only for any class/race rather than it being in the source code itself. Or something very close to that. I see this works with when you try add a race/class via the setclass/setrace commands. But I would want a clean smaug with no classes or races defined. I know this is allot to ask but I have to start somewhere.
I would also like to know if someone maybe already changed the selction screen script wise so when connecting to first be able to sellect the race and then the class the chosen race can be...iow just the other way around.
Help would be muchly appreciated.
Regards
The Mute |
blindmute aka c
Jason van den Berg
*nix Administrator | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #1 on Wed 09 Jun 2004 02:50 PM (UTC) |
| Message
|
Quote: I can read code a bit and so forth. Forgive me for asking the question but can you write it? :)
What you are attempting is non-trivial. Basically you need to make all the race/class structures dynamically read. You will have trouble when it comes to anti-X flags. You will need to store all the racial data in const.c in files, and read it all into dynamic structures at loadup. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | Top |
|
| Posted by
| Blindmute
South Africa (5 posts) Bio
|
| Date
| Reply #2 on Wed 09 Jun 2004 02:56 PM (UTC) |
| Message
| Well,
Thats the problem. I can write a little bit..but if I can generaly be pushed in the right direction if someone has not done it already..I am sure I would be able to get the hang of it.
Will just get me longer to do what I would like to do tho :)
I know where most of the things are in the sources..and as I realised and why I asked the question here it is not as simple as just doing it...because I might up more inline of breaking things than building things.
|
blindmute aka c
Jason van den Berg
*nix Administrator | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #3 on Wed 09 Jun 2004 03:09 PM (UTC) |
| Message
| | Well, you need to understand dynamic arrays, you need to understand looking up things in said arrays, you need to understand the save/load from file process. This last one is fairly easy since it's all there for other things and you just have to look at it and emulate it. The first two depend on your knowledge of programming, and I suspect that these are what will make or break your success here. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | Top |
|
| Posted by
| Nick Gammon
Australia (23,166 posts) Bio
Forum Administrator |
| Date
| Reply #4 on Wed 09 Jun 2004 09:31 PM (UTC) |
| Message
|
Quote:
I would like to know if anyone might perhaps have implemented that you use flatfiles only for any class/race rather than it being in the source code itself ...
I thought each race and class *was* in its own file in the appropriate directories. eg. in classes:
$ ls
Augurer.class Cleric.class Mage.class Ranger.class Vampire.class
class.lst Druid.class Paladin.class Thief.class Warrior.class
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #5 on Thu 10 Jun 2004 12:41 AM (UTC) |
| Message
| | Most class attributes are stored in a file, but a lot of the racial stuff is in const.c - e.g. the stat modifiers, the default languages, affected_by flags, etc. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | Top |
|
| Posted by
| Blindmute
South Africa (5 posts) Bio
|
| Date
| Reply #6 on Thu 10 Jun 2004 07:24 AM (UTC) Amended on Thu 10 Jun 2004 08:37 AM (UTC) by Blindmute
|
| Message
| | Thanks for the help Ksilyan. I will try and implement all of this on the weekend. Any ideas on the race before class when logging on item? Is there such a patch yet? |
blindmute aka c
Jason van den Berg
*nix Administrator | | Top |
|
| Posted by
| Blindmute
South Africa (5 posts) Bio
|
| Date
| Reply #7 on Thu 10 Jun 2004 02:22 PM (UTC) |
| Message
| Hi again,
I have done some things to the source and I would appreciate if anyone that knows their stuff can have a look and see if what I did breaks anything and or everything is ok.
What I have done;
* Removed all classes from the sources except for vampire class cause I think i will use it as is for what I intend.
* Removed all races from the sources except for human cause that I will use aswell.
- I tried to removed the vampire race but it seems after I removed it that for some reason i do not see the human option displayed in the select menu when creating a new character but it can still be picked. Is there any particular reason that the race is there? Maybe someone can look into it and perhaps push me in the general direction of what to do there.
If the size seems larger it is because I left backups of all the files called whatever.c.backup in src.
Also this is the version I got from the files section of gammon.
The sources are here;
http://www.candyman.org/files/smaug14afuss.blindmute.tgz
I will just call this phase one for now on my attempt.
Thanks again... |
blindmute aka c
Jason van den Berg
*nix Administrator | | Top |
|
| Posted by
| Nick Gammon
Australia (23,166 posts) Bio
Forum Administrator |
| Date
| Reply #8 on Thu 10 Jun 2004 09:26 PM (UTC) |
| Message
|
Quote:
Any ideas on the race before class when logging on item?
You need to change slightly the way the "nanny" function works. After asking for your sex it "looks for" your class, then your race, and then your colour preference, like this:
case CON_GET_NEW_SEX:
// yadda yadda
d->connected = CON_GET_NEW_CLASS;
break;
case CON_GET_NEW_CLASS:
// yadda yadda
d->connected = CON_GET_NEW_RACE;
break;
case CON_GET_NEW_RACE:
// yadda yadda
d->connected = CON_GET_WANT_RIPANSI;
break;
Just change the d->connected things around, and also change the prompts just before that to ask for the appropriate things as well, eg.
case CON_GET_NEW_SEX:
// yadda yadda
// show race list
d->connected = CON_GET_NEW_RACE;
break;
case CON_GET_NEW_CLASS:
// yadda yadda
// ask if you want ANSI or RIP etc.
d->connected = CON_GET_WANT_RIPANSI;
break;
case CON_GET_NEW_RACE:
// yadda yadda
// show class list
d->connected = CON_GET_NEW_CLASS;
break;
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Blindmute
South Africa (5 posts) Bio
|
| Date
| Reply #9 on Fri 11 Jun 2004 07:20 AM (UTC) |
| Message
| Hi,
I had a look at changing the connect to your suggestion which is what I need to do in the end. But I realised that as I looked at the source that one needs to change the routines associated with the case statements aswell due to the code checking for races/classes.
This is all and well and I am sure I would not have a hassle to change it appropriately. My question tho is the when selecting a class with the current way thinsg work, and according to rules only certain races can be that class. Now how would this work in reverse. I know this is related to the specific case statements but I just need to make sure that I do this correctly and hack at it from the right way.
Thanks again for all the help as I appreciate the pushing into the right direction :)
|
blindmute aka c
Jason van den Berg
*nix Administrator | | Top |
|
| Posted by
| Nick Gammon
Australia (23,166 posts) Bio
Forum Administrator |
| Date
| Reply #10 on Fri 11 Jun 2004 11:11 PM (UTC) |
| Message
| | You are right, you need to change the "if" tests where it works out which class to display depending on which race they selected. It is hard to give exact suggestions but you are right, depending on what you want you need to rejig it a bit. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | 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.
27,160 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top