Problem adding commands

Posted by Rhayne on Sun 03 Jul 2011 05:44 PM — 6 posts, 27,057 views.

#0
It's probably needless to say, but I'm completely new to coding. I'm trying to add a few snippets to the SmaugFUSS 1.9 codebase, such as Samson's delete code and running into some problems. In tables.c, I'm not quite sure where to add the statements. In previous searches I've seen instructions for adding it in the case by lines such as:

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

but I'm not seeing anything like that in my tables.c. I tried adding:

KEY( "Delete", skill->delete, fread_string_nohash( fp ) );

but get the compile error:

tables.c:1125:6: error: expected unqualified-id before ‘delete’
tables.c:1125:6: error: expected ‘)’ before ‘delete’

Thanks in advance for any advice.
USA #1
I have no experience with SMAUG, but 'delete' is a reserved word in C++. You might want to make sure you're compiling it as C, not C++.
USA #2
SmaugFUSS doesn't have tables stuff anymore it's all dynamic.
#3
Zeno said:

SmaugFUSS doesn't have tables stuff anymore it's all dynamic.



Ah, that makes sense. Any clue how to implement the delete code then? I get everything put in with no compile errors and it always returns Huh? I downloaded the fuss 1.6 codebase yesterday and it installed and worked no problem. I'd rather use 1.9 for obvious reasons though if I could get it working.
USA #4
Just follow how the existing commands are set up. One new line in mud.h, make clean, use cedit to create etc.
USA #5
As Zeno said, once you have installed the code and recompiled (make), you need to use cedit to add the command in the game. Otherwise you'll always get 'Huh?' because the game won't know to call the code.