Problem adding new command

Posted by Dbaker84 on Wed 06 Aug 2008 08:54 PM — 22 posts, 87,937 views.

#0
I wanted to get a sayto command going, so I found an appropriate snippet and got it put in. Everything is compiling great, the problem I've having is that the command I created in commands.dat isn't being picked up. I rechecked and recompiled everything; the command is definitely in the file and pointing to the right function, it's just not being picked up within the game for some reason. Any advice?

Also, side question...a current command in the game was changed to one that starts with the letter 'n', now every time you type 'n' as if to go north, it thinks you are trying to use that new command. Is there any way to explicitly state that 'n' = north? I tried setting it in the commands.dat similar to how se, sw, etc are set up, still not working.

Thanks again!
USA #1
Did you make sure to use cedit?
#2
Hrm, says it can't find the code in the symbol table. I added the function and its definition, what else would I be missing here?
USA #3
2 entires in tables.c
1 entry in mud.h

Although you don't need some entries if you are using FUSS.
#4
I am using FUSS, 1.9.

I did the one entry to mud.h, and I'm not seeing anywhere appropriate in the tables.c...at least nothing mentioning say, tell, or any other comm comannds.
USA #5
Did you make sure to make clean?
#6
Indeed I did, just reopened, checked for changes, saved, closed, make clean, and recompiled, still not flying.
USA #7
What does the line look like in mud.h?

What are you typing with cedit?
#8
mud.h:

DECLARE_DO_FUN( do_say_to_char );


cedit:

cedit sayto create do_say_to_char



This is exactly what I'm getting ingame:

Log: Trevlyn: cedit sayto create do_say_to_char
Log: [*****] BUG: Error locating do_say_to_char in symbol table. Resource temporarily unavailable
Command added.
Code do_say_to_char not found. Set to no code.
Amended on Wed 06 Aug 2008 09:38 PM by Dbaker84
USA #9
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=8247&page=1

That's all I found find about it.

Are you using Cygwin?
#10
Yeah, I am using Cygwin. I'm 110% sure that I'm using a clean compile, so I really have no idea what is going on here. Could it have anything to do with do_say and do_say_to_char sharing the do_say part? Other than that, I can't think of anything that would be causing an issue.
#11
My cygwin is doing this after it makes all the o files


/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../1686-pc-cygwin/bin/ld: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant datat structures referencing symbols from auto-imported DLLs.Info: resolving __timezone by linking to __imp__timezone (auto-import)


I assume that this could cause an issue due to the dynamic linking.
USA #12
What file is the function in? What does the function header look like?
#13
It's in act_comm.c

#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "mud.h"
USA #14
Er, the function header. Not file header.
#15
gah, sorry. I've changed the name from say_to_char to stc, but it's still not working. I assume this is enough.


void do_stc( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH];
char buf[MAX_STRING_LENGTH];
const char *sbuf;
CHAR_DATA *victim;
EXT_BV actflags;
/*int arglen;*/
CHAR_DATA *vch;
#ifndef SCRAMBLE
int speaking = -1, lang;

for( lang = 0; lang_array[lang] != LANG_UNKNOWN; lang++ )
if( ch->speaking & lang_array[lang] )
{
speaking = lang;
break;
}
#endif

argument = one_argument( argument, arg );

USA #16
The function name has to match the line in mud.h, so if mud.h is say_to_char and the fn is stc it won't work.

My only other thought is something funky going on with Cygwin and dynamic linking.
#17
yeah, I changed mud.h to stc as well.

I'm downloading andlinux as we speak; I'm also beginning to think it has something to do with cygwin due to that error message I posted earlier.
#18
I'm pulling my hair out over here.

Somehow, I got that sayto function/command to work. I tried to add another new function.......same story as before. I figured, maybe it's the coding again, so I tried yet another function..same. I have absolutely no idea what in the heck is going on. If someone could be so very kind as to look this code over for me and maybe try to compile/run it on their setup, I would be very very appreciative. Here's a link to a zip of the source.

http://www.quickfilepost.com/download.do?get=e71589804edeb6a033bde198b3cba193

The function I'm trying to get to work are do_suicide in act_comm.c and do_invade in act_wiz.c.
#19
I hate bringing up such an old thread but I am having the same problem when trying to add a command to the game.

Its an old mapper function i came across.

this function found in act_move.c:
void do_map ( CHAR_DATA * ch, char *argument ) {

i have this in mud.h
DECLARE_DO_FUN( do_map );



commands.dat shows
#COMMAND
Name map~
Code do_map
Position 100
Level 64
Log 0
End




I get this error message when i tried cedit create:
Log: [*****] BUG: Error locating do_map in symbol table. Resource temporarily unavailable
Command added.
Code do_map not found. Set to no code.

I get this error message when booting up the mud:
Sun Jul 3 18:43:52 2011 :: [*****] BUG: Error locating do_map in symbol table. No error
Sun Jul 3 18:43:52 2011 :: [*****] BUG: fread_command: Function do_map not found for map



since making changes I did 'make clean' and 'make' all compiles no problem. What am I missing?

Thanks,
Nargs


USA #20
I'm not familiar with the dynamic mapping, might want to ask on the FUSS forums.
#21
Thanks Zeno -

Here is the link to the Fuss forum in case a resolution is found there:

http://www.smaugmuds.org/index.php?a=topic&t=4558&p=21840#p21840