Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ New command [solved]
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Aiseant
(33 posts) 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 | Top |
|
Posted by
| Zeno
USA (2,871 posts) 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 | Top |
|
Posted by
| Aiseant
(33 posts) 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
| Top |
|
Posted by
| Zeno
USA (2,871 posts) 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 | Top |
|
Posted by
| Aiseant
(33 posts) 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 | Top |
|
Posted by
| David Haley
USA (3,881 posts) 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 | Top |
|
Posted by
| Aiseant
(33 posts) 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 | 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.
21,793 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top