[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  New command [solved]

New command [solved]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Aiseant   (33 posts)  [Biography] bio
Date Mon 27 Sep 2010 12:12 PM (UTC)

Amended on Mon 27 Sep 2010 01:02 PM (UTC) by Aiseant

Message
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
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #1 on Mon 27 Sep 2010 03:38 PM (UTC)
Message
Can you show the errors?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Aiseant   (33 posts)  [Biography] bio
Date Reply #2 on Mon 27 Sep 2010 04:07 PM (UTC)

Amended on Mon 27 Sep 2010 04:13 PM (UTC) by Aiseant

Message
Yep :

combine.c:17: error: conflicting types for do_combine
mud.h:3269: note: previous declaration of do_combine was here
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #3 on Mon 27 Sep 2010 04:23 PM (UTC)
Message
Can you show those 2 lines of code?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Aiseant   (33 posts)  [Biography] bio
Date Reply #4 on Mon 27 Sep 2010 05:52 PM (UTC)
Message
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
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #5 on Mon 27 Sep 2010 06:18 PM (UTC)
Message
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.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Aiseant   (33 posts)  [Biography] bio
Date Reply #6 on Mon 27 Sep 2010 06:49 PM (UTC)

Amended on Mon 27 Sep 2010 08:06 PM (UTC) by Aiseant

Message
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
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


19,300 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]