AutoDamage Help

Posted by LunaticStriker on Thu 25 Aug 2005 02:48 AM — 13 posts, 46,569 views.

USA #0
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!
USA #1
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))
Amended on Thu 25 Aug 2005 03:29 AM by Zeno
USA #2

 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.
Amended on Thu 25 Aug 2005 11:19 AM by LunaticStriker
Canada #3
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.
USA #4
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.
Canada #5
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
Amended on Thu 25 Aug 2005 08:30 PM by Greven
USA #6
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?
USA #7
Looks alright. You'll have to look around a bit above and below.
USA #8
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.
Amended on Thu 25 Aug 2005 11:48 PM by LunaticStriker
USA #9
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.
USA #10
Alright all fixed just decided to add the fight.c code instead of all the auto things and it worked out fine.
USA #11
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. :)
USA #12
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.