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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  ROM
. -> [Folder]  Compiling the server
. . -> [Subject]  AutoDamage Help

AutoDamage Help

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


Posted by LunaticStriker   USA  (17 posts)  [Biography] bio
Date Thu 25 Aug 2005 02:48 AM (UTC)
Message
else
{
if {IS_SET(ch->act,PLR_AUTODAMAGE))
{
sprintf( buf1, "$n's %s %s $N%c", attack, vp, punct );
sprintf( buf2, "Your %s %s $N%c [%d]", attack, vp, punct, dam );
sprintf( buf3, "$n's %s %s you%c [%d]", attack, vp, punct, dam );
}

Compilier spits out this error.

C:\MUD ROM\src\fight.c(2202) : error C2059: syntax error : '{'

ROM 2.4b6 Help is greatly appreciated!
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #1 on Thu 25 Aug 2005 03:28 AM (UTC)

Amended on Thu 25 Aug 2005 03:29 AM (UTC) by Zeno

Message
Could you use the code tag to make it easier from now on?

You have a bracket in the line. Before IS_SET should be a (, not a { to look like this:
 if (IS_SET(ch->act,PLR_AUTODAMAGE))

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

Posted by LunaticStriker   USA  (17 posts)  [Biography] bio
Date Reply #2 on Thu 25 Aug 2005 11:12 AM (UTC)

Amended on Thu 25 Aug 2005 11:19 AM (UTC) by LunaticStriker

Message

 void disarm( CHAR_DATA *ch, CHAR_DATA *victim )
{
    OBJ_DATA *obj;

    if ( ( obj = get_eq_char( victim, WEAR_WIELD ) ) == NULL )
	return;

    if ( IS_OBJ_STAT(obj,ITEM_NOREMOVE))
    {
	act("$S weapon won't budge!",ch,NULL,victim,TO_CHAR);
	act("$n tries to disarm you, but your weapon won't budge!",
	    ch,NULL,victim,TO_VICT);
	act("$n tries to disarm $N, but fails.",ch,NULL,victim,TO_NOTVICT);
	return;
    }

    act( "$n DISARMS you and sends your weapon flying!", 
	 ch, NULL, victim, TO_VICT    );
    act( "You disarm $N!",  ch, NULL, victim, TO_CHAR    );
    act( "$n disarms $N!",  ch, NULL, victim, TO_NOTVICT );

    obj_from_char( obj );
    if ( IS_OBJ_STAT(obj,ITEM_NODROP) || IS_OBJ_STAT(obj,ITEM_INVENTORY) )
	obj_to_char( obj, victim );
    else
    {
	obj_to_room( obj, victim->in_room );
	if (IS_NPC(victim) && victim->wait == 0 && can_see_obj(victim,obj))
	    get_obj(victim,obj,NULL);
    }

    return;
}


I did what you said and like now all of disarm is buggy dont know if this was like it before or what not but here are the errors.

C:\MUD ROM\src\fight.c(2232) : error C2143: syntax error : missing ';' before 'type'
C:\MUD ROM\src\fight.c(2236) : error C2065: 'obj' : undeclared identifier
C:\MUD ROM\src\fight.c(2236) : warning C4047: '=' : 'int ' differs in levels of indirection from 'struct obj_data *'
C:\MUD ROM\src\fight.c(2236) : warning C4047: '==' : 'int ' differs in levels of indirection from 'void *'
C:\MUD ROM\src\fight.c(2239) : error C2223: left of '->extra_flags' must point to struct/union
C:\MUD ROM\src\fight.c(2253) : warning C4047: 'function' : 'struct obj_data *' differs in levels of indirection from 'int '
C:\MUD ROM\src\fight.c(2253) : warning C4024: 'obj_from_char' : different types for formal and actual parameter 1
C:\MUD ROM\src\fight.c(2254) : error C2223: left of '->extra_flags' must point to struct/union
C:\MUD ROM\src\fight.c(2254) : error C2223: left of '->extra_flags' must point to struct/union
C:\MUD ROM\src\fight.c(2255) : warning C4047: 'function' : 'struct obj_data *' differs in levels of indirection from 'int '
C:\MUD ROM\src\fight.c(2255) : warning C4024: 'obj_to_char' : different types for formal and actual parameter 1
C:\MUD ROM\src\fight.c(2258) : warning C4047: 'function' : 'struct obj_data *' differs in levels of indirection from 'int '
C:\MUD ROM\src\fight.c(2258) : warning C4024: 'obj_to_room' : different types for formal and actual parameter 1
C:\MUD ROM\src\fight.c(2259) : warning C4047: 'function' : 'struct obj_data *' differs in levels of indirection from 'int '
C:\MUD ROM\src\fight.c(2259) : warning C4024: 'can_see_obj' : different types for formal and actual parameter 2
C:\MUD ROM\src\fight.c(2260) : warning C4047: 'function' : 'struct obj_data *' differs in levels of indirection from 'int '
C:\MUD ROM\src\fight.c(2260) : warning C4024: 'get_obj' : different types for formal and actual parameter 2

I am sorry for not using the code tag too it didnt show with tags and stuff didnt know there where some.
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #3 on Thu 25 Aug 2005 02:43 PM (UTC)
Message
Looks like if the function declaration is messed up, you have the syntax error above it. Check to see that the function above it has the proper brace pairs.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by LunaticStriker   USA  (17 posts)  [Biography] bio
Date Reply #4 on Thu 25 Aug 2005 08:23 PM (UTC)
Message
Alright now it compiles but when I attack someone it will spit out these weird characters such as <ò and stuff. Lemme get a small round of it happening.

Your punch misses Hassan. [0]
Hassan parries your attack.
You dodge Hassan's attack.
<ò
That really did HURT!
You sure are BLEEDING!
<ò
That really did HURT!
You sure are BLEEDING!
Hassan sends you sprawling with a powerful bash!
That really did HURT!
You sure are BLEEDING!
Hassan has a few scratches.

<1/20HP><100/100Mana><99/100Mv>< ><0Gp>
Hassan parries your attack.
Hassan parries your attack.
You dodge Hassan's attack.
<ò
That really did HURT!
You sure are BLEEDING!
Hassan has a few scratches.

<1/20HP><100/100Mana><99/100Mv>< ><0Gp>
Hassan dodges your attack.
Your body phases to avoid Hassan's attack.
Your body phases to avoid Hassan's attack.
You dodge Hassan's attack.
Hassan has a few scratches.

Its not in all the rounds though so its odd.
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #5 on Thu 25 Aug 2005 08:29 PM (UTC)

Amended on Thu 25 Aug 2005 08:30 PM (UTC) by Greven

Message
Try to find where "You sure are BLEEDING!" and "That really did HURT!" are being printed from,and see if there is something wrong there. This looks completely different issue from the disarm one.

[EDIT] looking more closely, it is the "that really did HURT" message

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by LunaticStriker   USA  (17 posts)  [Biography] bio
Date Reply #6 on Thu 25 Aug 2005 10:47 PM (UTC)
Message
default:
	if ( dam > victim->max_hit / 4 )
	    send_to_char( "That really did HURT!\n\r", victim );
	if ( victim->hit < victim->max_hit / 4 )
	    send_to_char( "You sure are BLEEDING!\n\r", victim );
	break;
    }

anything wrong there?
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #7 on Thu 25 Aug 2005 10:49 PM (UTC)
Message
Looks alright. You'll have to look around a bit above and below.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by LunaticStriker   USA  (17 posts)  [Biography] bio
Date Reply #8 on Thu 25 Aug 2005 11:38 PM (UTC)

Amended on Thu 25 Aug 2005 11:48 PM (UTC) by LunaticStriker

Message
Alright I think its displaying the damage done from the mob to the character. I dont know where to look though...
[Edit] I dont even think its displaying the damage at all from the mob.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #9 on Fri 26 Aug 2005 12:06 AM (UTC)
Message
I'm not sure I understand what you're doing... I said that you'll have to look above and below those lines of code to see where things are being printed.

Another thing to do would be to look at all the code you added and see which print/send statements you changed.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by LunaticStriker   USA  (17 posts)  [Biography] bio
Date Reply #10 on Sat 27 Aug 2005 12:31 AM (UTC)
Message
Alright all fixed just decided to add the fight.c code instead of all the auto things and it worked out fine.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #11 on Sat 27 Aug 2005 12:40 AM (UTC)
Message
I don't understand what you mean - did you go back to stock fight.c code? - but I'm glad that your problem is fixed. :)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by LunaticStriker   USA  (17 posts)  [Biography] bio
Date Reply #12 on Sat 27 Aug 2005 03:13 PM (UTC)
Message
Nah I just used the modified fight.c code they put in there and just skipped all the little things for the autodam to turn it off or on.
[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.


31,017 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 HostDash]