Register forum user name Search FAQ

Gammon Forum

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 ➜ Just a little help with SMAUG

Just a little help with SMAUG

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


Pages: 1  2 3  4  

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #15 on Tue 21 Mar 2006 10:38 PM (UTC)
Message
Please use the [code] tag when posting so many lines of code. Not having the lines formatted correctly makes them irritating to read. And please post the compiler output, also using the [code] tag, so that we can know exactly what the compiler is saying -- and then use comments in the code to indicate which line is which. (Don't post the code again, just edit your previous posts)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #16 on Tue 21 Mar 2006 11:00 PM (UTC)
Message
in the comments, i have exactly what is being said by the compiler
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #17 on Tue 21 Mar 2006 11:05 PM (UTC)
Message
Look at this code:

	for ( iClass = 0; iClass < MAX_PC_CLASS; iClass++ )
	{
	  if ( class_table[iClass]->who_name &&
	       class_table[iClass]->who_name[0] != '\0' && !class_table[iClass]->remort_class)

	    {
		ch->class =  iClass;
		break;
	    }
	  }
	}
Looks like you have one brace too many.

This kind of problem is very easy to find if code is indented properly. If you're using vi, go to the top of the function and type =a{. That means format the current block of code.

It will then be immediately apparent where the braces are missing.

You can also put the cursor over a brace, and press % to jump to the matching brace. If you do that and find yourself somewhere you didn't expect, then you have too many/too few braces.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #18 on Tue 21 Mar 2006 11:12 PM (UTC)
Message
thank you much!
um where would i change the code to show how much damage you do during a fight.
Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #19 on Tue 21 Mar 2006 11:24 PM (UTC)

Amended on Tue 21 Mar 2006 11:25 PM (UTC) by Killfoobar

Message
and what about the parse error at end of input
it is in bool pager_output
Top

Posted by Dace K   Canada  (169 posts)  Bio
Date Reply #20 on Wed 22 Mar 2006 12:38 AM (UTC)
Message
Quote:
Killfoobar (12 posts) [Biography] bio
Date Tue 21 Mar 2006 11:24 PM (UTC)

Amended on Tue 21 Mar 2006 11:25 PM (UTC) by Killfoobar
Message
and what about the parse error at end of input
it is in bool pager_output


The probable cause of that is because your pager isn't parsing. Try replacing the batteries.

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #21 on Wed 22 Mar 2006 01:52 AM (UTC)
Message
Quote:

... and what about the parse error at end of input ...


You have probably added a brace too many. This example program will generate that error:


#include <stdio.h>

int main ()
  {
  printf ("hello, world\n");
  return 0;

  {  // <--- this shouldn't be here

  }


This generates:


test.c: In function `main':
test.c:11: parse error at end of input


You want an editor (vi is an example) that will match braces, so you can see which function has a brace too many.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #22 on Wed 22 Mar 2006 07:12 PM (UTC)
Message
thanks, but what about the showing the damage during a fight
Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #23 on Wed 22 Mar 2006 09:26 PM (UTC)
Message
and also i cant seem to find the non-matching brace
Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #24 on Wed 22 Mar 2006 09:41 PM (UTC)
Message
and what do you mean replacing the batteries
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #25 on Wed 22 Mar 2006 09:56 PM (UTC)
Message
The batteries part was a joke.

For the braces, did you try using the auto-indent? Or using '%' to match braces? What editor are you using?

For damage in combat: why don't we fix one thing at a time? :)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #26 on Wed 22 Mar 2006 10:04 PM (UTC)

Amended on Wed 22 Mar 2006 10:05 PM (UTC) by Killfoobar

Message
im using vi, and i tried the % thing, and the auto-indent, but i didnt find anything
Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #27 on Wed 22 Mar 2006 10:27 PM (UTC)
Message
let me know if you need something to find out what it is that is wrong, i can gladly give it to you
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #28 on Wed 22 Mar 2006 10:32 PM (UTC)
Message
The '%' command only works when you have your cursor over a brace.

Also, Nick suggested using vi's bracket highlighting feature. This is a very good idea. To enable this you might have to type the command ":syntax enable". It should then start highlighting mismatched braces.

I'm not sure how else to solve your problem, really. Basically you have to go find which brace doesn't have a matching brace. It's probably going to be in code you added.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Killfoobar   USA  (27 posts)  Bio
Date Reply #29 on Thu 23 Mar 2006 12:51 AM (UTC)
Message
the problem is that it doesnt highlight any mismatched braces, or anything when i do any of those

let me know if you want me to send you my copy of comm.c
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.


109,416 views.

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

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

Go to topic:           Search the forum


[Go to top] top

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