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 ➜ Really need help this time.

Really need help this time.

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


Pages: 1 2  

Posted by Manakra   (27 posts)  Bio
Date Wed 22 Jun 2005 01:27 AM (UTC)
Message
I tried adding in the furniture code to SmaugFuSS. After doing everything correctly, I get this error, and I dont know how to fix it

$ make
make -s smaug
Compiling o/act_info.o....
act_info.c: In function `show_char_to_char_0':
act_info.c:724: error: parse error before '}' token
make[1]: *** [o/act_info.o] Error 1
make: *** [all] Error 2

Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Wed 22 Jun 2005 02:02 AM (UTC)
Message
Could you show us those lines (give or take a few above and down)?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Manakra   (27 posts)  Bio
Date Reply #2 on Wed 22 Jun 2005 02:25 AM (UTC)
Message
else if (IS_SET(victim->on->value[2],SLEEP_ON))
{
sprintf(message,"&P is sleeping on %s.",
victim->on->short_descr);
strcat(buf,message);
}
else
{
sprintf(message, "&P is sleeping in %s.",
victim->on->short_descr);
strcat(buf,message);
}
}
else
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #3 on Wed 22 Jun 2005 02:28 AM (UTC)
Message
That last else/bracket, what is the else for? What ifcheck? Same questions for the bracket.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Manakra   (27 posts)  Bio
Date Reply #4 on Wed 22 Jun 2005 03:19 AM (UTC)

Amended on Wed 22 Jun 2005 03:21 AM (UTC) by Manakra

Message
Umm, Id have to re-check again, but its all for the Furniture script, so if you look at the furniture script (1.01 I believe), you can find out


(otherwise) this is the full part
case POS_SLEEPING:
if (victim->on != NULL)
{
if (IS_SET(victim->on->value[2],SLEEP_AT))
{
sprintf(message,"&P is sleeping at %s.",
victim->on->short_descr);
strcat(buf,message);
}
else if (IS_SET(victim->on->value[2],SLEEP_ON))
{
sprintf(message,"&P is sleeping on %s.",
victim->on->short_descr);
strcat(buf,message);
}
else
{
sprintf(message, "&P is sleeping in %s.",
victim->on->short_descr);
strcat(buf,message);
}
}
else
{
if (ch->position == POS_SITTING
|| ch->position == POS_RESTING )
strcat( buf, "&P is sleeping nearby.&G" );
else
strcat( buf, "&P is deep in slumber here.&G" )
}
break;
case POS_RESTING:
if (victim->on != NULL)
{
if (IS_SET(victim->on->value[2],REST_AT))
{
sprintf(message,"&P is resting at %s.",
victim->on->short_descr);
strcat(buf,message);
}
else if (IS_SET(victim->on->value[2],REST_ON))
{
sprintf(message,"&P is resting on %s.",
victim->on->short_descr);
strcat(buf,message);
}
else
{
sprintf(message, "&P is resting in %s.",
victim->on->short_descr);
strcat(buf,message);
}
}
else
{
if (ch->position == POS_RESTING)
strcat ( buf, "&P is sprawled out alongside you.&G" );
else
if (ch->position == POS_MOUNTED)
strcat ( buf, "&P is sprawled out at the foot of your mount.&G" );
else
strcat (buf, "&P is sprawled out here.&G" );
}
break;
case POS_SITTING:
if (victim->on != NULL)
{
if (IS_SET(victim->on->value[2],SIT_AT))
{
sprintf(message,"&P is sitting at %s.",
victim->on->short_descr);
strcat(buf,message);
}
else if (IS_SET(victim->on->value[2],SIT_ON))
{
sprintf(message,"&P is sitting on %s.",
victim->on->short_descr);
strcat(buf,message);
}
else
{
sprintf(message, "&P is sitting in %s.",
victim->on->short_descr);
strcat(buf,message);
}
}
else
strcat(buf, "&P is sitting here.");
break;
case POS_STANDING:
if (victim->on != NULL)
{
if (IS_SET(victim->on->value[2],STAND_AT))
{
sprintf(message,"&P is standing at %s.",
victim->on->short_descr);
strcat(buf,message);
}
else if (IS_SET(victim->on->value[2],STAND_ON))
{
sprintf(message,"&P is standing on %s.",
victim->on->short_descr);
strcat(buf,message);
}
else
{
sprintf(message, "&P is standing in %s.",
victim->on->short_descr);
strcat(buf,message);
}
}
else
if ( IS_IMMORTAL(victim) )
strcat( buf, "&P is here before you.&G" );
else
if ( ( victim->in_room->sector_type == SECT_UNDERWATER )
&& !IS_AFFECTED(victim, AFF_AQUA_BREATH) && !IS_NPC(victim) )
strcat( buf, "&P is drowning here.&G" );
else
if ( victim->in_room->sector_type == SECT_UNDERWATER )
strcat( buf, "&P is here in the water.&G" );
else
if ( ( victim->in_room->sector_type == SECT_OCEANFLOOR )
&& !IS_AFFECTED(victim, AFF_AQUA_BREATH) && !IS_NPC(victim) )
strcat( buf, "&P is drowning here.&G" );
else
if ( victim->in_room->sector_type == SECT_OCEANFLOOR )
strcat( buf, "&P is standing here in the water.&G" );
else
if ( IS_AFFECTED(victim, AFF_FLOATING)
|| IS_AFFECTED(victim, AFF_FLYING) )
strcat( buf, "&P is hovering here.&G" );
else
strcat( buf, "&P is standing here.&G" );
break;
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #5 on Wed 22 Jun 2005 04:01 AM (UTC)

Amended on Wed 22 Jun 2005 04:02 AM (UTC) by Zeno

Message
Please try to use the code tag to make it easier to view. What is line 724? So far I checked the brackets and saw nothing wrong.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Manakra   (27 posts)  Bio
Date Reply #6 on Wed 22 Jun 2005 04:03 AM (UTC)

Amended on Wed 22 Jun 2005 04:04 AM (UTC) by Manakra

Message

      case POS_SLEEPING:
       if (victim->on != NULL)
           {
               if (IS_SET(victim->on->value[2],SLEEP_AT))
               {
                   sprintf(message,"&P is sleeping at %s.",
                       victim->on->short_descr);
                   strcat(buf,message);
               }
               else if (IS_SET(victim->on->value[2],SLEEP_ON))
               {
                   sprintf(message,"&P is sleeping on %s.",
                       victim->on->short_descr);
                   strcat(buf,message);
               }
               else
               {
                   sprintf(message, "&P is sleeping in %s.",
                       victim->on->short_descr);
                   strcat(buf,message);
               }
           }
           else
           {
             if (ch->position == POS_SITTING
             ||  ch->position == POS_RESTING )
                 strcat( buf, "&P is sleeping nearby.&G" );
	     else
                 strcat( buf, "&P is deep in slumber here.&G" )
           }
             break;
       case POS_RESTING:
           if (victim->on != NULL)
           {
               if (IS_SET(victim->on->value[2],REST_AT))
               {
                   sprintf(message,"&P is resting at %s.",
                       victim->on->short_descr);
                   strcat(buf,message);
               }
               else if (IS_SET(victim->on->value[2],REST_ON))
               {
                   sprintf(message,"&P is resting on %s.",
                       victim->on->short_descr);
                   strcat(buf,message);
               }
               else
               {
                   sprintf(message, "&P is resting in %s.",
                       victim->on->short_descr);
                   strcat(buf,message);
               }
           }
           else
           {
             if (ch->position == POS_RESTING)
                 strcat ( buf, "&P is sprawled out alongside you.&G" );
             else
	     if (ch->position == POS_MOUNTED)
	         strcat ( buf, "&P is sprawled out at the foot of your mount.&G" );
	     else
                 strcat (buf, "&P is sprawled out here.&G" );
           }
             break;
       case POS_SITTING:
           if (victim->on != NULL)
           {
               if (IS_SET(victim->on->value[2],SIT_AT))
               {
                   sprintf(message,"&P is sitting at %s.",
                       victim->on->short_descr);
                   strcat(buf,message);
               }
               else if (IS_SET(victim->on->value[2],SIT_ON))
               {
                   sprintf(message,"&P is sitting on %s.",
                       victim->on->short_descr);
                   strcat(buf,message);
               }
               else
               {
                   sprintf(message, "&P is sitting in %s.",
                       victim->on->short_descr);
                   strcat(buf,message);
               }
           }
           else
	       strcat(buf, "&P is sitting here.");
           break;
       case POS_STANDING:
        if (victim->on != NULL)
           {
               if (IS_SET(victim->on->value[2],STAND_AT))
               {
                   sprintf(message,"&P is standing at %s.",
                       victim->on->short_descr);
                   strcat(buf,message);
               }
               else if (IS_SET(victim->on->value[2],STAND_ON))
               {
                   sprintf(message,"&P is standing on %s.",
                       victim->on->short_descr);
                   strcat(buf,message);
               }
               else
               {
                   sprintf(message, "&P is standing in %s.",
                       victim->on->short_descr);
                   strcat(buf,message);
               }
           }
         else
           if ( IS_IMMORTAL(victim) )
               strcat( buf, "&P is here before you.&G" );
	   else
           if ( ( victim->in_room->sector_type == SECT_UNDERWATER )
           && !IS_AFFECTED(victim, AFF_AQUA_BREATH) && !IS_NPC(victim) )
               strcat( buf, "&P is drowning here.&G" );
	   else
           if ( victim->in_room->sector_type == SECT_UNDERWATER )
               strcat( buf, "&P is here in the water.&G" );
	   else
           if ( ( victim->in_room->sector_type == SECT_OCEANFLOOR )
	   && !IS_AFFECTED(victim, AFF_AQUA_BREATH) && !IS_NPC(victim) )
	       strcat( buf, "&P is drowning here.&G" );
	   else
	   if ( victim->in_room->sector_type == SECT_OCEANFLOOR )
	       strcat( buf, "&P is standing here in the water.&G" );
           else
	   if ( IS_AFFECTED(victim, AFF_FLOATING)
           || IS_AFFECTED(victim, AFF_FLYING) )
             strcat( buf, "&P is hovering here.&G" );
           else
             strcat( buf, "&P is standing here.&G" );
             break;



As well, Ive tried playing with the indentation all the time, and nothing seems to work. bah, isnt there a way I can Make/Make Clean with cygwyn, that can bypass it?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #7 on Wed 22 Jun 2005 04:06 AM (UTC)
Message
Changing indentation won't change how the code compiles. Bypass what? Cygwin should be able to make clean.

Can you tell me what line 724 is?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Manakra   (27 posts)  Bio
Date Reply #8 on Wed 22 Jun 2005 04:10 AM (UTC)

Amended on Wed 22 Jun 2005 04:12 AM (UTC) by Manakra

Message
{
sprintf(message, "&P is sleeping in %s.",
victim->on->short_descr);
strcat(buf,message); 724
} or this is 724
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #9 on Wed 22 Jun 2005 04:13 AM (UTC)

Amended on Wed 22 Jun 2005 04:15 AM (UTC) by Zeno

Message
Well the whole code there looks fine. What happens when you comment it out? If the error still happens, it is elsewhere. Sometimes missing a bracket/quote can do that.

[EDIT] Well I see this line, which is wrong:
strcat( buf, "&P is deep in slumber here.&G" )

Need a ; at the end.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Manakra   (27 posts)  Bio
Date Reply #10 on Wed 22 Jun 2005 04:20 AM (UTC)
Message
when I comment it out, I get a error for 725 and 713, parsing as well....
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #11 on Wed 22 Jun 2005 04:21 AM (UTC)
Message
So after you comment out the whole code (the full part you posted) you still get that error? Then it is a trailing missing bracket or the sort.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Manakra   (27 posts)  Bio
Date Reply #12 on Wed 22 Jun 2005 04:24 AM (UTC)
Message
What happened is, I commented out the

{
sprintf(message, "&P is sleeping in %s.",
victim->on->short_descr);
strcat(buf,message);
}
part where it was giving the error

but now I get a new error when I put the ; at the end of the one thing

$ make
make -s smaug
Compiling o/act_info.o....
Compiling o/act_move.o....
act_move.c:2410: error: redefinition of `do_stand'
act_move.c:1982: error: `do_stand' previously defined here
act_move.c:2554: error: redefinition of `do_sit'
act_move.c:2027: error: `do_sit' previously defined here
act_move.c:2707: error: redefinition of `do_rest'
act_move.c:2074: error: `do_rest' previously defined here
act_move.c:2871: error: redefinition of `do_sleep'
act_move.c:2123: error: `do_sleep' previously defined here
make[1]: *** [o/act_move.o] Error 1
make: *** [all] Error 2
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #13 on Wed 22 Jun 2005 04:26 AM (UTC)
Message
Remove any comments you just added. Are there any parse errors? If not on to the next issue.

You were suppose to replace the existing sit/stand etc with the new ones I believe.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Manakra   (27 posts)  Bio
Date Reply #14 on Wed 22 Jun 2005 04:28 AM (UTC)
Message
How do I replace the old ones? I thought I got them. and I cant find them in the info, so it must be in the (?)(?)
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.


63,352 views.

This is page 1, subject is 2 pages long: 1 2  [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.