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.
 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Town Snippet and Pager ON

Town Snippet and Pager ON

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


Pages: 1 2  

Posted by Alkarindil   Brazil  (70 posts)  Bio
Date Fri 15 Jun 2007 10:53 PM (UTC)
Message
Hello!

I am trying to install the town's snippet from crimson blade, here is the link:

http://www.afkmud.com/index.php?a=files&s=viewfile&fid=118

...but I get 4 or 5 problems:

1 - the command do_mpmakecitizen doesn't work, I had to comment the line on tables.c.
2 - the same with the command do_mprevokecitizen.
3 - the function do_makehometown have an "if(!IS_IMMORTAL(ch)...". This condition doesn't work and my immortals always are considered mortals.
4 - the hometowns are in the file hometowns.dat inside system folder. When I create a hometown directly in the file, only the first one is listed in the MUD. When I create a new hometown inside the MUD, it erases all the towns, except the first one and read the two towns. Horever, if I restart the MUD, it will read only the first one again!

And, at least, the pager option.
Inside nanny function, I found these lines:
xSET_BIT( ch->act, PLR_AUTOGOLD );
xSET_BIT( ch->act, PLR_AUTOEXIT );
So I added this:
xSET_BIT( ch->act, PCFLAG_PAGERON );
It doesn't work. Anyone know why?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Fri 15 Jun 2007 10:58 PM (UTC)
Message
Did you make sure you cedit in the commands (mpmakecitizen etc)?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Alkarindil   Brazil  (70 posts)  Bio
Date Reply #2 on Sat 16 Jun 2007 01:44 AM (UTC)

Amended on Sat 16 Jun 2007 01:47 AM (UTC) by Alkarindil

Message
Thanks Zeno, but answer me if it isn't a stupid question: how do I "cedit" it? If it is to write in commands.dat, I've done that already. If not, where do I put those things?

Okay! There are only 3 problems left.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #3 on Sat 16 Jun 2007 01:52 AM (UTC)
Message
Type: cedit mpmakecitizen

Paste here what it says.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Alkarindil   Brazil  (70 posts)  Bio
Date Reply #4 on Sat 16 Jun 2007 01:54 AM (UTC)
Message
<4000hp 104m 110mv> cedit mpmakecitizen
Command: mpmakecitizen
Level: 55
Position: 0
Log: 0
Code: (00401884)
Flags:

<4000hp 104m 110mv> mpmakecitizen
Huh?

<4000hp 104m 110mv>
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #5 on Sat 16 Jun 2007 02:09 AM (UTC)
Message
The reason is the code is set to nothing. You need to set it to the function name. Also, players/Imms cannot use mp commands.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Alkarindil   Brazil  (70 posts)  Bio
Date Reply #6 on Sat 16 Jun 2007 02:41 AM (UTC)

Amended on Sat 16 Jun 2007 02:42 AM (UTC) by Alkarindil

Message
Oh no! The problem is in the code:

Example: the following tables.c's line:

if ( !str_cmp( name, "do_mpmakecitizen" )) return do_mpmakecitizen;

returns:

...\tables.c(465) : error C2065: 'do_mpmakecitizen' : undeclared identifier
...\tables.c(465) : warning C4047: 'return' : 'void (__cdecl *)(struct char_data *,char *)' differs in levels of indirection from 'int '

the same to the other command..
But I've done the same with all the commands!

Horever, the biggest problem is the hometowns.dat file, it simple doesn't work with more than one town.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #7 on Sat 16 Jun 2007 03:14 AM (UTC)
Message
Did you remember to add the line for do_mpmakecitizen in mud.h? And there are 2 lines for it in tables.c.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Alkarindil   Brazil  (70 posts)  Bio
Date Reply #8 on Sat 16 Jun 2007 03:53 AM (UTC)

Amended on Sat 16 Jun 2007 05:53 AM (UTC) by Alkarindil

Message
Well... I followed the instructions.

The file hometowns.h have these lines:

DECLARE_DO_FUN(do_mp_makecitizen);
DECLARE_DO_FUN(do_mp_revokecitizen);

It's something missing? What must I do?

// EDIT ------------------>

Ooooow Now I saw!
DECLARE_DO_FUN(do_mp_revokecitizen);
it have an underline after "mp".
Horever, I erased the underline. It is in the function's name too!
The same for both functions.
The file from internet is with this error, maybe this topic may be usefull in the future.

Thanks Zeno!

Now, let's see the other problems!
The MUD still doesn't read the full file hometowns.dat.
Any ideas?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #9 on Sun 17 Jun 2007 04:54 PM (UTC)
Message
Did you check the log files to see if there are any errors? Perhaps the format for the line in the file is wrong.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Alkarindil   Brazil  (70 posts)  Bio
Date Reply #10 on Mon 18 Jun 2007 01:26 AM (UTC)
Message
Nothing zeno..
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #11 on Mon 18 Jun 2007 02:37 AM (UTC)
Message
Can you show me how the file looks before (all data there), and then after (only the one line)?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Alkarindil   Brazil  (70 posts)  Bio
Date Reply #12 on Mon 18 Jun 2007 07:26 PM (UTC)

Amended on Mon 18 Jun 2007 07:33 PM (UTC) by Alkarindil

Message
Sure!
Imagine that we followed all the directions on the read-me file. Then we changed that underline we talked about and the immortal's condition to the makehometown's command.
Then, executing the smaug.exe, using an immortal inside the mud we use the createnation's command.
This nation will be Tolkien's "Shire". In the nation's folder is now a new file called Shire.nation, and "nations.lst" have a new line pointing to it.
Everything works fine until here.
So we use <makehometown bree>.
The file hometowns.dat becomes this:


#HOMETOWN
Name Bree~
Recall -1
Vnum 1
Citizens -1
Description None~
End
#END


Then we do <hometown> command in the mud. It returns this (ow, I used dots ".", but just because it doesn't work fine with spaces " " in the forum):



Hometown................Nation...............Citizens
_____________________________________________________
Bree.....................None....................-1
For more information use 'hometowns <name>'


Everything is ok.
So, we shutdown the MUD. Start it again and use <hometown> command again. It returns the same.
So we use <makehometown hobbiton>. The file becomes this:

#HOMETOWN
Name Bree~
Recall -1
Vnum 1
Citizens -1
Nation 0
Description None~
End
#HOMETOWN
Name Hobbiton~
Recall -1
Vnum 1
Citizens -1
Description None~
End
#END

Inside the MUD:


<1802hp 104m 110mv> homet
Hometown................Nation...............Citizens
_____________________________________________________
Bree.....................None....................-1
Hobbiton.................None....................-1
For more information use 'hometowns <name>'


Now, shutdown the MUD, restart it again.
Use the <hometown> command again!


<1802hp 104m 110mv> homet
Hometown................Nation...............Citizens
_____________________________________________________
Bree.....................None....................-1
For more information use 'hometowns <name>'


Where is Hobbiton?
Opening the hometowns.dat, there is hobbiton!
Horever, imagine that I try again, with a new hometown:
<makehometown buckland>
then the file will become this:

#HOMETOWN
Name Bree~
Recall -1
Vnum 1
Citizens -1
Nation 0
Description None~
End
#HOMETOWN
Name Buckland~
Recall -1
Vnum 1
Citizens -1
Description None~
End
#END

Everything will work the same way. If I restart the MUD, Buckland will be ignored.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #13 on Mon 18 Jun 2007 08:02 PM (UTC)
Message
From that format, it seems to me that there shouldn't be more than one #HOMETOWN in the file. The number of #END's doesn't match the number of #HOMETOWN's.

Note that all snippets are not perfect and may need some tweaking to get it working correctly.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Alkarindil   Brazil  (70 posts)  Bio
Date Reply #14 on Mon 18 Jun 2007 08:18 PM (UTC)
Message
Do you suggest I use more #END lines and try to make the code understand it?
I believe it works just as commands.dat:

#COMMAND
Name '~
Code do_say
Position 106
Level 0
Log 0
End

#COMMAND
Name ,~
Code do_emote
Position 106
Level 0
Log 0
End

(...)

Note that there's only one #END line, there in the bottom of file, so it doesn't match the #COMMAND lines.
Well, it doesn't work correctly.. this is sad, I must change everything.

Thanks anyway Zeno.
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.


40,123 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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.