Samsons Bank Code Questions
< Newer Topic
:: Older Topic >
#1 Dec 27, 2007 4:36 pm
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 :/.
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!
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!
#2 Dec 27, 2007 4:49 pm
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
#3 Dec 27, 2007 4:59 pm
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
Any idea how to fix this? I have the same problem with withdraw and deposit as well =[
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 =[
#4 Dec 27, 2007 5:19 pm
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 );
#5 Dec 27, 2007 5:25 pm
Last edited Dec 27, 2007 5:27 pm by 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
#6 Dec 27, 2007 5:45 pm
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?
#7 Dec 27, 2007 6:32 pm
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
and this
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.
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.
#8 Dec 27, 2007 6:46 pm
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.
but I couldn't find an area to add them, or much less what to include on them =\
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 =\
#9 Dec 27, 2007 6:59 pm
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
after that add
find
after that add
find
after that add
find
after that add
find
after that add
find
after that add
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";
#10 Dec 27, 2007 7:09 pm
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 :/
#11 Dec 27, 2007 7:15 pm
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.
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.
#12 Dec 27, 2007 7:18 pm
Magician
GroupMembers
Posts126
JoinedDec 11, 2007
Heh =p, well doing such would loop me back to post #3. =]
#13 Dec 27, 2007 7:28 pm
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).
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.
<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.
#14 Dec 27, 2007 7:30 pm
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
#15 Dec 27, 2007 8:57 pm
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.
#16 Dec 27, 2007 8:59 pm
Magician
GroupMembers
Posts126
JoinedDec 11, 2007
How do I open the make file?
#17 Dec 27, 2007 9:14 pm
Last edited Dec 27, 2007 9:14 pm by 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.cto 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
#18 Dec 28, 2007 11:55 am
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 =]
#19 Dec 29, 2007 6:41 pm
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...
#20 Dec 29, 2007 11:32 pm
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!