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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  Compiling the server
. . -> [Subject]  Unarmed

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Unarmed
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Wed 06 Jul 2011 02:31 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Zyxir   (6 posts)  [Biography] bio
Date Wed 06 Jul 2011 02:27 AM (UTC)  quote  ]
Message
where would i define a number for unarmed?
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Wed 06 Jul 2011 01:11 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Zyxir   (6 posts)  [Biography] bio
Date Tue 05 Jul 2011 11:45 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Tue 05 Jul 2011 11:32 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Zyxir   (6 posts)  [Biography] bio
Date Tue 05 Jul 2011 10:11 PM (UTC)  quote  ]

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?
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Tue 05 Jul 2011 10:02 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Zyxir   (6 posts)  [Biography] bio
Date Tue 05 Jul 2011 09:44 PM (UTC)  quote  ]

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.
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Tue 05 Jul 2011 09:39 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Zyxir   (6 posts)  [Biography] bio
Date Tue 05 Jul 2011 08:32 PM (UTC)  quote  ]
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.
[Go to top] top

Posted by Zeno   USA  (2,867 posts)  [Biography] bio   Moderator
Date Tue 05 Jul 2011 07:30 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Zyxir   (6 posts)  [Biography] bio
Date Tue 05 Jul 2011 07:10 PM (UTC)  quote  ]
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.
[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.


2,329 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]