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

Gammon Software Solutions 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]  Adding Commands to SWR

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Adding Commands to SWR
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Pages: 1 2  

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Tue 23 Sep 2003 05:02 AM (UTC)  quote  ]
Message
Is this relevant to the subject "Adding Commands to SWR"? If not can you please start a new subject? Tacking questions onto the end of a different thread - in this case started in June 2003 - is just confusing.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Cory   (2 posts)  [Biography] bio
Date Mon 22 Sep 2003 11:47 PM (UTC)  quote  ]
Message
could somone email me instructions on how to build and program on lots.wolfpaw.net? it would be greatly appreciated
[Go to top] top

Posted by Celestine   (29 posts)  [Biography] bio
Date Tue 17 Jun 2003 04:58 AM (UTC)  quote  ]

Amended on Tue 17 Jun 2003 05:01 AM (UTC) by Celestine

Message
Yet another question regarding commands. For withdraw/deposit/donate, it says that I need to have a bank. I stripped down most of the areas which I deemed unnecessary (they weren't needed to compile properly). I was wondering how to make a bank? makebank doesn't seem to work...Any help?

EDIT: Nevermind, I found out that bank is nothing more than a roomflag.
[Go to top] top

Posted by Boborak   USA  (228 posts)  [Biography] bio
Date Sat 14 Jun 2003 07:59 PM (UTC)  quote  ]
Message
You would also need to remove the appropriate lines from db.c that assigns the skills a GSN. I don't think the Smaug authors ever intended to make it easy to remove skills/spells. It may be best to just disable the skills instead of removing them. Setting the skills code to 'skill_null' and removing any affects it may have, would do the trick.
[Go to top] top

Posted by Meerclar   USA  (554 posts)  [Biography] bio
Date Sat 14 Jun 2003 06:13 PM (UTC)  quote  ]
Message
In addition to the skills.dat file entries you would need to remove the spells/skills from every class. Needless to say, this is an insanely time consuming ordeal.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

Posted by Celestine   (29 posts)  [Biography] bio
Date Thu 12 Jun 2003 11:19 PM (UTC)  quote  ]
Message
Thanks, the setclan worked, but I'm still not understanding some of the components of setstarsystem. Can someone explain the x/y to me a little bit?

Also, I want to remove a majority of the spells/skills. Is there any way to do this? I realized (the hard way), that simply deleting the spells from skills.dat doesn't work.
[Go to top] top

Posted by Boborak   USA  (228 posts)  [Biography] bio
Date Thu 12 Jun 2003 05:02 PM (UTC)  quote  ]
Message
Only have a few moments so I'll make this quick.

First, it would be easier to create and set both clans and starsystems online, using the commands 'setclan' and 'setstarsystem' respectively. They're pretty easy to figure out, so I I won't go into detail.

Secondly, how did you go about setting the player in the clan? Simply setting the player as the leader won't cut it. You also have to make sure the player is set to the clan. Sounds redundant (which it is), but that's the way it works. do a 'mset (player) clan phoenix' and you should be good. If not, I'd point fingers at do_who. I personally snipped out the clan part of the code long ago :-\
[Go to top] top

Posted by Celestine   (29 posts)  [Biography] bio
Date Thu 12 Jun 2003 03:19 PM (UTC)  quote  ]

Amended on Thu 12 Jun 2003 04:03 PM (UTC) by Celestine

Message
A little question not exactly related to the coding part. More like building. How do the new starsystems work? Is it easier to manually code the new "space" in, and if so, how would I go about doing this?

Edit: Once again, another question. On the who list, I want it to be something like:

[Name] [Title] [Clan if possible]

Right now, I'm having a hard time just understanding what's going on. Actually, I can't even put someone in a clan properly. I put someone into a clan I manually coded called "Phoenix," and they show up as the leader (which I set) for the clan when I type 'clan.' However, if I type 'who phoenix,' it says 0 players are online even though that character is in the clan file. I used setclan phoenix leader [player name] to put them in the clan. Am I doing something wrong here?
[Go to top] top

Posted by Boborak   USA  (228 posts)  [Biography] bio
Date Thu 12 Jun 2003 01:34 PM (UTC)  quote  ]
Message
Unfortunately, there is no handy dandy trick-of-the-trade to format the output of strings created by the editor. It relys on the user to format it the way they want it.

As for the wanted flag, a quick fix would be to search the destroy_ship function for refrences to raw_kill and change any refrence that looks like this:

raw_kill(ch, rch);

to this:

raw_kill(rch, rch);

This causes the function raw_kill to think the player killed themselves, and hence won't give anyone a 'wanted' flag.

This of course assumes you have stock SWR and haven't downloaded one of a variety of other compilations of SWR that may or may not have changed the destroy_ship functionality.
[Go to top] top

Posted by Celestine   (29 posts)  [Biography] bio
Date Wed 11 Jun 2003 11:56 PM (UTC)  quote  ]

Amended on Thu 12 Jun 2003 01:58 AM (UTC) by Celestine

Message
The line formatting from Greyson worked for the Name, Gender, Age, and Align. However, it did not work for the history, which is a text buffer thing (I copied it from the code for description). Any suggestions for the formatting there?

Edit: Also, I want to remove the wanted for murder flag when someone is killed in a battle with the spaceships. Only the spaceships. Normal killing still has murder flag, any tips here?
[Go to top] top

Posted by Greyson   (1 post)  [Biography] bio
Date Mon 09 Jun 2003 11:34 AM (UTC)  quote  ]
Message
Hey,

Yeah to make your lines display properly..

ch_printf(ch, "| %s |", string);
would become...
ch_printf(ch, "| %-20s |", string);

Now I'm pretty new at coding (March of this year) but I do know that the -x in between the % and the s forces it out 20 spaces. I think if you do a normal number inside, something like %20s it'll line up the word(s) to the left instead of the right hand side of the column. And negative numbers produce the opposite. But I've never used em as a positive so without testing I can't really be sure. Hope this helps somewhat...

Greyson
Legacy of the Sith
lots.wolfpaw.net 3000
http://www.swreality.org
[Go to top] top

Posted by Celestine   (29 posts)  [Biography] bio
Date Thu 05 Jun 2003 12:51 AM (UTC)  quote  ]
Message
The deleting/remaking of the files seemed to dispose of the crash. However, I'm still faced with the problem of the formatting. Basically, It'd work if I could find out how many lines there were in the history (which is created the same way a desc is. Any help?
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 04 Jun 2003 06:40 AM (UTC)  quote  ]
Message
Quote:

I'm not completely sure this would influence anything, but all commands return, to note when the do loop/function has ended.


"void" functions don't need a return statement, they will return anyway (what else can they do?).

Functions that are not declared void need a return, otherwise you have said you will return something but don't. eg.


int add (int a, int b)
  {
  return a + b;
  }



- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 04 Jun 2003 06:22 AM (UTC)  quote  ]
Message
Quote:

Thanks to Nick Gammon (or how should I refer to you?),


You can call me Nick. :)

As for the crash, try rebuilding everything, as it sounds like you have changed the layout in mud.h?

In other words, remove all object files:

rm *.o

(not the .c files).

Then do a "make".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Celestine   (29 posts)  [Biography] bio
Date Wed 04 Jun 2003 03:04 AM (UTC)  quote  ]

Amended on Wed 04 Jun 2003 04:26 AM (UTC) by Celestine

Message
Thanks Boborak, your addition made the command work. I have another question for this command regarding formatting, however. If you notice, the print has something like:

|Name: %s [a certain number of spaces] |

However, the location of the last | varies depending on how long the name (or whatever variable) is. Is there a way to fix this? And while I'm on that topic, I have the history data which is basically like a description. It's entered in the same way too. Is there a way to make a box which expands according to the length of that data (like the number of lines and such)?

Another question. I finished adding the history by itself, and that worked. Now I added yet another char field called 'personality'. I uncommented/commented each addition in and out, and I found that the problem was located at clear_char function in db.c

void clear_char( CHAR_DATA *ch )
{
ch->editor = NULL;
ch->hunting = NULL;
ch->fearing = NULL;
ch->hating = NULL;
ch->name = NULL;
ch->short_descr = NULL;
ch->long_descr = NULL;
ch->description = NULL;
ch->personality = NULL;
...
}

I basically took the history char field (which works if I take out the personality field), and copied each line and put it in the correct spot. On save.c, I did make sure to put it under the case 'P': as well. If I include this, the compilation is clean, but upon booting up the server, I receive another dumping stack trace like the access violation error posted above.
[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.


6,945 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]