function look up & reverse function lookup - smaug 1.4 & FUSS

Posted by Nargsbrood on Wed 17 Oct 2007 03:47 AM — 6 posts, 21,106 views.

#0
in smaug1.4 - TABLES.C file contained the function lookups and reverse function lookups for various functions like skill or command functions.

IE: (lookup)
if( !str_cmp( name, "do_mdelete" ) )
return do_mdelete;
if( !str_cmp( name, "do_memory" ) )
return do_memory;
if( !str_cmp( name, "do_mfind" ) )
return do_mfind;
if( !str_cmp( name, "do_minvoke" ) )
return do_minvoke;
if( !str_cmp( name, "do_mistwalk" ) )
return do_mistwalk;
if( !str_cmp( name, "do_mlist" ) )
return do_mlist;

and: (reverse lookup)

if( skill == do_mdelete )
return "do_mdelete";
if( skill == do_memory )
return "do_memory";
if( skill == do_mfind )
return "do_mfind";
if( skill == do_minvoke )
return "do_minvoke";
if( skill == do_mistwalk )
return "do_mistwalk";
if( skill == do_mlist )
return "do_mlist";



This section is not in the TABLES.C for FUSS 1.8

How is the lookup system handled? Is it dynamic?
USA #1
Yep, it's dynamic.
#2
so just adding the functions and assigning them in the OLC of commands or spells works? just like that? nice nice :)
#3
i've added the function and now i add the command using:
cedit testing create do_map

and get this:

Log: Admin: cedit testing create do_map
Log: [*****] BUG: Error locating do_map in symbol table. Resource temporarily unavailable
Command added.
Code do_map not found. Set to no code.
USA #4
Quote:
Code do_map not found. Set to no code.

That's your problem there. Did you make sure to add do_map to mud.h?
#5
yes I did add it but you reminded me, thankyou, that i did not make clean :) hmm