New command [solved]

Posted by Aiseant on Mon 27 Sep 2010 12:12 PM — 7 posts, 29,614 views.

#0
Hi all,

As I said in my previous post, i'm helping a friend with his mud, SWR based.

I've created a little command which allow players to combine items (if they're compatible) to create new stuffs or improve existant ones.

I add the two lines in tables.c, the one in mud.h, my command do_combine is written in combine.c, which is taken by the Makefile to make the combine.o, though I think everything is right.
But the make is whinning about do_combine redefined : once in the beginning of combine.c and the other in mud.h. It says that there's a conflicting types ... (i also try to add gns_combine everywhere i found a gsn_punch, but still the same problem)

I dunno what to do, I'm lost

Thanks (and sorry for my english)
Aiseant
Amended on Mon 27 Sep 2010 01:02 PM by Aiseant
USA #1
Can you show the errors?
#2
Yep :

combine.c:17: error: conflicting types for do_combine
mud.h:3269: note: previous declaration of do_combine was here
Amended on Mon 27 Sep 2010 04:13 PM by Aiseant
USA #3
Can you show those 2 lines of code?
#4
Yep

mud.h, line 3269 : DECLARE_DO_FUN( do_combine );
combine.c, line 17 : void do_combine(CHAR_DATA * ch ,OBJ_DATA * source1, OBJ_DATA* source2 ){

thanks for your help
USA #5
Commands take a character and a string as only parameters; you need to parse the string into objects. Take a look at how nearly any other object-related command works, like do_give, do_take, etc.
#6
Dammit ! Captain obvious is obvious ... when I think that i was able to figure out this parsing thing with do_tell and never made the link with my problem ...

ok, many thanks for you lighting reading on this.

Now I suppose that I've to do something more, since if I type 'combine', I get an 'invalid input' and 'sset self combine' returns 'No such skill or spell'
EDIT : cedit command discovered, now it's fine :)

Aiseant