Unarmed

Posted by Zyxir on Tue 05 Jul 2011 07:10 PM — 12 posts, 45,089 views.

#0
Okay guys Im having issues and I've looked all over the forums for a solution and can't seem to find one. My issue is making the default weapontype to automatically be unarmed combat, so I can actually make monks useful in my MUD. The attacksystem is completely different then the normal MUD and uses attackspeed. When I go to compile I get:

/src/fight.c:1057: undefined reference to `gsn_unarmed'

So how would I define the reference? The line of code reads as:

*gsn_ptr = -1;
switch ( wield->value[4] )
{
default:
*gsn_ptr = gsn_unarmed;
break;
case WEP_MAGIC:
*gsn_ptr = gsn_magic;
break;
case WEP_LARGE_SWORD:
*gsn_ptr = gsn_large_swords;
break;
case WEP_LIGHT_SWORD:
*gsn_ptr = gsn_light_swords;
break;
case WEP_DAGGER:
*gsn_ptr = gsn_daggers;
break;
case WEP_AXE:
*gsn_ptr = gsn_axes;
break;
case WEP_HAMMER:
*gsn_ptr = gsn_hammers;

and so on down my variuos weapontypes.
USA #1
Probably want to make sure you post in the right section.

Anyway, what codebase are you using?
#2
Ooops, It isn't. I wasn't paying attention to where I was at in the forum I just hit add topic.

It's originally a smaugfuss but a lot of the code has been stripped and redone for the attackspeed. It was done by a friend and I got the leftovers because I loved it so much. From what I can tell the only major differences are that there are more defined weapontypes and that when you design a weapon in-game it doesn't automatically get a damage type based on its weapon.

So... for the most part the file location for everything is still the basic smaugfuss setup.
Australia Forum Administrator #3
Moved thread.


Do you mean only gsn_unarmed is undefined? If so search the .h files for (say) gsn_magic, and add gsn_unarmed to the define or enum where that is.
#4
I've gone in and added gsn_unarmed into mud.h, is it defined in another .h file that I'm not aware of?

That is to say I've defined an extern short gsn_unarmed, though since it is extern i'm curious as to where it's actually given any value.
Amended on Tue 05 Jul 2011 10:02 PM by Zyxir
Australia Forum Administrator #5
Why do you ask? It is probably adjacent to the other definitions. Try using grep if you are using Linux or Cygwin, or a "find in files" feature in a Windows-based editor.
#6
It compiled correctly.

It still isn't working the way I want it to though. My monk isn't gaining any proficiency in unarmed. This may have something to do with the fact I may need a weapon with type unarmed... suggestions?
Amended on Tue 05 Jul 2011 11:04 PM by Zyxir
USA #7
If the code was redone a lot, not sure what to say.

Try adding debug lines in the code. Something that prints out to the log channel and throw some of those into the learning function, etc. Find out where it stops.
#8
Let's put it this way. From what I can tell from the code, is that it requires there to be a weapon in the hand of the player to determine a weapontype and thus an attackspeed for it. So my question would be how to tell the game that someone who wasn't wielding a weapon is using unarmed. I found the bit of code that needs to be fixed for unarmed to gain proficiency but not sure what to add in... here's the code:


if( wield->item_type == ITEM_WEAPON )
prof_bonus = weapon_prof_bonus_check( ch, wield, &prof_gsn );
else if( wield->item_type == ITEM_ARMOR )
prof_bonus = ( ( LEARNED( ch, gsn_shield_bash ) - 49 ) / 5 ); //will add monk Class later
else
prof_bonus = -10; //will add monk Class later
USA #9
In Smaug, there's this in fight.c:
    if ( prof_gsn != -1 )
    {
        if ( dam > 0 )
            learn_from_success( ch, prof_gsn );
        else
            learn_from_failure( ch, prof_gsn );
    }


So you just want to make sure prof_gsn matches up to the gsn ID of unarmed once it gets there.
#10
where would i define a number for unarmed?
USA #11
gsn_unarmed is the number. You should be able to do something like
prof_gsn = gsn_unarmed;

In an appropriate ifcheck.