Login
User Name:

Password:



Register

Forgot your password?
do_owhere recursive
Author: Khonsu
Submitted by: Khonsu
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
Users Online
AhrefsBot

Members: 0
Guests: 18
Stats
Files
Topics
Posts
Members
Newest Member
489
3,793
19,650
597
Aileenutz

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » General » Smaug Snippets » Samsons Bank Code Questions
Forum Rules | Mark all | Recent Posts

Samsons Bank Code Questions
< Newer Topic :: Older Topic >

Pages:<< prev 1, 2 next >>
Post is unread #1 Dec 27, 2007 4:36 pm   
Go to the top of the page
Go to the bottom of the page

Raine
Magician
GroupMembers
Posts126
JoinedDec 11, 2007

 
ok so far I've managed to get through it all easily but this part kind of confuses me :/.

5. Make the appropriate additions to tables.c for
do_balance, do_withdraw, and do_deposit.


No idea how to do that, or what to type... I've look through the file and found no hints to it :/..

Any help would be appreciated :)! thanks in advance!

Post is unread #2 Dec 27, 2007 4:49 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,917
JoinedJul 26, 2005

 
Well back before they added in for commands to be handled a different way you had to add in things so it could handle them correctly in tables.c. Chances are if you have a fairly recent download (Hmm I'd say one in the last 6-9 Months) you won't need to add in stuff for tables.c

Post is unread #3 Dec 27, 2007 4:59 pm   
Go to the top of the page
Go to the bottom of the page

Raine
Magician
GroupMembers
Posts126
JoinedDec 11, 2007

 
hrm... Well ok I've got the code in, I can set the flags correctly yet when I go to do "cedit balance create" it gives me this error

Log: Raine: cedit balance create
Log: [*****] BUG: Error locating do_balance in symbol table. smaug: undefined symbol: do_balance
Command added.
Code do_balance not found.  Set to no code.


Any idea how to fix this? I have the same problem with withdraw and deposit as well =[

Post is unread #4 Dec 27, 2007 5:19 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,917
JoinedJul 26, 2005

 
in mud.h try adding in near other DECLARE_DO_FUNs
DECLARE_DO_FUN( do_balance );
DECLARE_DO_FUN( do_deposit );
DECLARE_DO_FUN( do_withdrawl );

Post is unread #5 Dec 27, 2007 5:25 pm   Last edited Dec 27, 2007 5:27 pm by Raine
Go to the top of the page
Go to the bottom of the page

Raine
Magician
GroupMembers
Posts126
JoinedDec 11, 2007

 
Those are redundent variables from bank.h.

cc1: warnings being treated as errors
In file included from imc.c:60:
mud.h:3545: warning: redundant redeclaration of ΓÇÿdo_balanceΓÇÖ
bank.h:40: warning: previous declaration of ΓÇÿdo_balanceΓÇÖ was here
mud.h:3598: warning: redundant redeclaration of ΓÇÿdo_depositΓÇÖ
bank.h:41: warning: previous declaration of ΓÇÿdo_depositΓÇÖ was here
mud.h:3921: warning: redundant redeclaration of ΓÇÿdo_withdrawΓÇÖ
bank.h:42: warning: previous declaration of ΓÇÿdo_withdrawΓÇÖ was here
make[1]: *** [o/imc.o] Error 1
make: *** [all] Error 2

Post is unread #6 Dec 27, 2007 5:45 pm   
Go to the top of the page
Go to the bottom of the page

Raine
Magician
GroupMembers
Posts126
JoinedDec 11, 2007

 
Hrm I think the problem is that the mud.h isn't picking up the bank.h code =\. Should I hardcode it in?

Post is unread #7 Dec 27, 2007 6:32 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,917
JoinedJul 26, 2005

 
make sure you have an include to bank.h in mud.h and yea you can remove them since its complaining about them. I don't think it would complain unless it was already included so you might want to check your tables.c and see if you do need to add stuff in there. The way tables.c worked is thus
for commands there has to be 2 additions per command
look for something like this
      if ( !str_cmp( name, "do_balzhur"                   ))    return do_balzhur;

and this
      if ( skill == do_balzhur                     )    return "do_balzhur";

If you have the old type tables then you will have to add 2 lines like that for each command addition in the correct spot. Like for balance doing it around the balzhur's will be fine. For deposit look for do_deities and put it around them and for withdrawl look for do_worth and put it around them.

Post is unread #8 Dec 27, 2007 6:46 pm   
Go to the top of the page
Go to the bottom of the page

Raine
Magician
GroupMembers
Posts126
JoinedDec 11, 2007

 
Ok mud.h does have a link to bank.h, and the document did say to add stuff to tables.c but I don't know how to add them which is my problem from one of my previous posts it says what I'm too add, but I have no idea how to to be completely honest. Here it is again if you have any idea.

5. Make the appropriate additions to tables.c for
   do_balance, do_withdraw, and do_deposit.


but I couldn't find an area to add them, or much less what to include on them =\

Post is unread #9 Dec 27, 2007 6:59 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,917
JoinedJul 26, 2005

 
Well thought I had made it clear in the previous post, but to clarify:

in tables.c
find
      if ( !str_cmp( name, "do_balzhur"                   ))    return do_balzhur;

after that add
      if ( !str_cmp( name, "do_balance"                   ))    return do_balance;

find
      if ( !str_cmp( name, "do_deities"                   ))    return do_deities;

after that add
      if ( !str_cmp( name, "do_deposit"                   ))    return do_deposit;

find
      if ( !str_cmp( name, "do_worth"                     ))    return do_worth;

after that add
      if ( !str_cmp( name, "do_withdrawl"                 ))    return do_withdrawl;


find
      if ( skill == do_balzhur                     )    return "do_balzhur";

after that add
      if ( skill == do_balance                     )    return "do_balance";

find
      if ( skill == do_deities                     )    return "do_deities";

after that add
      if ( skill == do_deposit                     )    return "do_deposit";

find
      if ( skill == do_worth                       )    return "do_worth";

after that add
      if ( skill == do_withdrawl                   )    return "do_withdrawl";

Post is unread #10 Dec 27, 2007 7:09 pm   
Go to the top of the page
Go to the bottom of the page

Raine
Magician
GroupMembers
Posts126
JoinedDec 11, 2007

 
Reason why I had asked is because in my tables.c there is no area to find those if functions :/ I'm using SMAUGFUSS 1.8 if that helps :/

Post is unread #11 Dec 27, 2007 7:15 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,917
JoinedJul 26, 2005

 
Yea that does help lol :) and then no you don't need to mess with the tables.c part :)
Make sure you do a make clean and give it another try.
While I've not actually tried running 1.8 (short of testing out the classes thing you were asking about) it should work fine on adding a new command.

Post is unread #12 Dec 27, 2007 7:18 pm   
Go to the top of the page
Go to the bottom of the page

Raine
Magician
GroupMembers
Posts126
JoinedDec 11, 2007

 
Heh =p, well doing such would loop me back to post #3. =]

Post is unread #13 Dec 27, 2007 7:28 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,917
JoinedJul 26, 2005

 
Ok, well on to testing this out in 1.8 (Not actually installing the bank code but just creating a command).
<24hp 145m 110mv> <#1200> cedit testing create
Log: Admin: cedit testing create
Command added.

<24hp 145m 110mv> <#1200> testing
You have used the testing command.

I only added a DECLARE_DO_FUN( do_testing ); to mud.h
added in the code for do_testing (it just simply sent a line saying you have used the testing command
and doing a make

As you can tell adding a command was very simple and went over without a single problem.
Best I can think of is to make sure bank.c is added into the Makefile to be compiled.

Post is unread #14 Dec 27, 2007 7:30 pm   
Go to the top of the page
Go to the bottom of the page

Raine
Magician
GroupMembers
Posts126
JoinedDec 11, 2007

 
that's the problem, bank.c isn't being made into a bank.o heh... So I guess I need to go in and do it by hand =p. And here I was going to take today easy and just do some "simple" coding XD

Post is unread #15 Dec 27, 2007 8:57 pm   
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

 
Um, no, you don't want to "go in and do it by hand", you want to open the Makefile and add it to the list of c files.

Post is unread #16 Dec 27, 2007 8:59 pm   
Go to the top of the page
Go to the bottom of the page

Raine
Magician
GroupMembers
Posts126
JoinedDec 11, 2007

 
How do I open the make file?

Post is unread #17 Dec 27, 2007 9:14 pm   Last edited Dec 27, 2007 9:14 pm by Conner
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

 
The same way that you'd open any of the other source files, with your text editor of choice. You open the file named Makefile and add
 bank.c
to the list of .c files which should look something like (mine undoubtedly has .c files that yours doesn't):
C_FILES = act_comm.c act_info.c act_move.c act_obj.c act_wiz.c alias.c arena.c ban.c \
          backup.c bank.c boards.c build.c buidty.c clans.c color.c comm.c comments.c \
          const.c db.c deity.c finger.c fight.c grub.c handler.c hashstr.c hiscores.c \
          hotboot.c imm_host.c interp.c magic.c makeobjs.c mapout.c mccp.c md5.c misc.c \
          mpxset.c mud_comm.c mud_prog.c news.c pfix.c planes.c player.c polymorph.c \
          quest.c ratings.c renumber.c reset.c save.c services.c shops.c skills.c slay.c \
          special.c sudoku.c tables.c tattoo.c track.c transfer.c update.c wedding.c

Post is unread #18 Dec 28, 2007 11:55 am   
Go to the top of the page
Go to the bottom of the page

Raine
Magician
GroupMembers
Posts126
JoinedDec 11, 2007

 
Yeah, that was the problem (not adding it to the list of make files) thanks everyone for your help =]

Post is unread #19 Dec 29, 2007 6:41 pm   
Go to the top of the page
Go to the bottom of the page

Conner
Sorcerer
GroupMembers
Posts870
JoinedMay 8, 2005

 
Glad to help where/when I can. Though I have to admit that you had me worried about you when you asked how to open the Makefile...

Post is unread #20 Dec 29, 2007 11:32 pm   
Go to the top of the page
Go to the bottom of the page

Raine
Magician
GroupMembers
Posts126
JoinedDec 11, 2007

 
Does it help when I say I have no idea what I'm doing =p, I'm trying to learn C while building a mud at the same time (likes more hands on learning). =D!

Pages:<< prev 1, 2 next >>