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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Problem adding commands
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Problem adding commands

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


Posted by Rhayne   (14 posts)  [Biography] bio
Date Sun 03 Jul 2011 05:44 PM (UTC)
Message
It's probably needless to say, but I'm completely new to coding. I'm trying to add a few snippets to the SmaugFUSS 1.9 codebase, such as Samson's delete code and running into some problems. In tables.c, I'm not quite sure where to add the statements. In previous searches I've seen instructions for adding it in the case by lines such as:

if ( !str_cmp( name, "do_cast" )) return do_cast;

but I'm not seeing anything like that in my tables.c. I tried adding:

KEY( "Delete", skill->delete, fread_string_nohash( fp ) );

but get the compile error:

tables.c:1125:6: error: expected unqualified-id before ‘delete’
tables.c:1125:6: error: expected ‘)’ before ‘delete’

Thanks in advance for any advice.
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #1 on Sun 03 Jul 2011 08:05 PM (UTC)
Message
I have no experience with SMAUG, but 'delete' is a reserved word in C++. You might want to make sure you're compiling it as C, not C++.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #2 on Sun 03 Jul 2011 08:22 PM (UTC)
Message
SmaugFUSS doesn't have tables stuff anymore it's all dynamic.

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

Posted by Rhayne   (14 posts)  [Biography] bio
Date Reply #3 on Mon 04 Jul 2011 04:25 PM (UTC)
Message
Zeno said:

SmaugFUSS doesn't have tables stuff anymore it's all dynamic.



Ah, that makes sense. Any clue how to implement the delete code then? I get everything put in with no compile errors and it always returns Huh? I downloaded the fuss 1.6 codebase yesterday and it installed and worked no problem. I'd rather use 1.9 for obvious reasons though if I could get it working.
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #4 on Mon 04 Jul 2011 08:46 PM (UTC)
Message
Just follow how the existing commands are set up. One new line in mud.h, make clean, use cedit to create etc.

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

Posted by Nick Cash   USA  (626 posts)  [Biography] bio
Date Reply #5 on Tue 05 Jul 2011 11:08 PM (UTC)
Message
As Zeno said, once you have installed the code and recompiled (make), you need to use cedit to add the command in the game. Otherwise you'll always get 'Huh?' because the game won't know to call the code.

~Nick Cash
http://www.nick-cash.com
[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.


5,056 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 FutureQuest]