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 ➜ Compiling the server ➜ Unarmed

Unarmed

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


Posted by Zyxir   (6 posts)  Bio
Date Tue 05 Jul 2011 07:10 PM (UTC)
Message
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.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Tue 05 Jul 2011 07:30 PM (UTC)
Message
Probably want to make sure you post in the right section.

Anyway, what codebase are you using?

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

Posted by Zyxir   (6 posts)  Bio
Date Reply #2 on Tue 05 Jul 2011 08:32 PM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Tue 05 Jul 2011 09:39 PM (UTC)
Message
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.

- Nick Gammon

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

Posted by Zyxir   (6 posts)  Bio
Date Reply #4 on Tue 05 Jul 2011 09:44 PM (UTC)

Amended on Tue 05 Jul 2011 10:02 PM (UTC) by Zyxir

Message
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.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #5 on Tue 05 Jul 2011 10:02 PM (UTC)
Message
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.

- Nick Gammon

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

Posted by Zyxir   (6 posts)  Bio
Date Reply #6 on Tue 05 Jul 2011 10:11 PM (UTC)

Amended on Tue 05 Jul 2011 11:04 PM (UTC) by Zyxir

Message
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?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #7 on Tue 05 Jul 2011 11:32 PM (UTC)
Message
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.

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

Posted by Zyxir   (6 posts)  Bio
Date Reply #8 on Tue 05 Jul 2011 11:45 PM (UTC)
Message
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
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #9 on Wed 06 Jul 2011 01:11 AM (UTC)
Message
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.

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

Posted by Zyxir   (6 posts)  Bio
Date Reply #10 on Wed 06 Jul 2011 02:27 AM (UTC)
Message
where would i define a number for unarmed?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #11 on Wed 06 Jul 2011 02:31 AM (UTC)
Message
gsn_unarmed is the number. You should be able to do something like
prof_gsn = gsn_unarmed;

In an appropriate ifcheck.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
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.


33,819 views.

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.