Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, DotBot

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » Sexes
Forum Rules | Mark all | Recent Posts

Sexes
< Newer Topic :: Older Topic > Removing sexes

Pages:<< prev 1 next >>
Post is unread #1 Jul 12, 2002, 6:03 pm
Go to the top of the page
Go to the bottom of the page

BroRich

GroupMembers
Posts20
JoinedJul 12, 2002

I am new to AFKMud and I am planning for my MUD to only have male and female sexes. How can i remove Neutral and hermaphrodite from the code?
       
Post is unread #2 Jul 13, 2002, 1:38 pm
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

I am new to AFKMud and I am planning for my MUD to only have male and female sexes. How can i remove Neutral and hermaphrodite from the code?

Remove the enum entries in olc.h, then search for SEX_HERMAPHRODYTE and SEX_NEUTRAL in the code and adjust everything that makes use of it.

Word of warning though, you may want to adjust the load routines for the areas, as if you remove the enum entry for SEX_NEUTRAL (which would have a value of 0 I believe) you remove the 0 entry, in the enum the values all shift, male becomes 0 and female 1.. which can have serious changes and affects on the settings in the areas. Removing the enums will make SEX_MALE the default though (the 0 entry), where SEX_NEUTRAL was the default previously.

What you can do (after removing the enums in olc.h as I've mentioned above) is on load of the sex field -1 from it (as long as it isn't already 0) and if its >= SEX_MAX make it equal to SEX_MAX-1. That way, all SEX_NEUTRALs become male, and all SEX_HERMAPHRODYTEs become female. Only do this on the present version of your area files though, (I believe Samson put in file versioning into AFK) make the change and save with a new version number that knows to just load, rather than -1 everytime.

Hopefully that helps
       
Post is unread #3 Jul 14, 2002, 3:03 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Actually it should not even be necessary to do all that fancy subtraction since if you'll notice, area files save sex as text. So male is stored in the file as "male" rather than as a 1. This sort of thing was done long ago to make offline editing easier, but it should also have the benefit of being immune to this sort of change as well. You will still need to fix the references in the code to things like SEX_NEUTRAL though. But your area files should be safe.

Also, keep in mind that changing this will require changing the areaconvert command as well, assuming you plan to import stock Smaug zones.
       
Post is unread #4 Jul 14, 2002, 9:49 am
Go to the top of the page
Go to the bottom of the page

BroRich

GroupMembers
Posts20
JoinedJul 12, 2002

Isnt there a command to search within all files in a given directory? I was trying to use grep but it didnt seem to work. I am trying to find an easy way to find the neutral and hermaphrodite text in all of the source. Sorry, i know this is more Linux usage than mud coding. I catch on quick so hopefully wont be bothering you all for too long.
       
Post is unread #5 Jul 15, 2002, 3:00 am
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

Isnt there a command to search within all files in a given directory? I was trying to use grep but it didnt seem to work.

Grep is the right command, though it is case sensetive, so make sure you have the term you are searching for exactly right (its how I found the enum in olc.h, not an AFK expert me ), to my knowledge there isn't a flag to make it a case insensative (have just flipped through the man page) although as ever, could be wrong

But grep is the command you want.

grep "search terms" files to search through
       
Post is unread #6 Jul 15, 2002, 5:30 am
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

to my knowledge there isn't a flag to make it a case insensative (have just flipped through the man page) although as ever, could be wrong

Doh! And to prove myself wrong.. (or is that right as I am wrong?)

grep -i "search term" files to search through

seems to perform a case insensative search for your search term in the files specified.
       
Post is unread #7 Jul 15, 2002, 5:34 am
Go to the top of the page
Go to the bottom of the page

BroRich

GroupMembers
Posts20
JoinedJul 12, 2002

       
Post is unread #8 Jul 15, 2002, 7:50 am
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

       
Post is unread #9 Jul 15, 2002, 7:55 am
Go to the top of the page
Go to the bottom of the page

BroRich

GroupMembers
Posts20
JoinedJul 12, 2002

from the command line while in ther afkmud/src directory i would type:
grep -i sex_hermaphrodite *.c

Am I doing something wrong? I am running Linux Mandrake 8.2 on an AMD Duron 700 with 512 MB RAM and IDE Drive as well.
       
Pages:<< prev 1 next >>