Author Topic: fix this please....  (Read 29824 times)

0 Members and 1 Guest are viewing this topic.

Offline Zsijn

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
fix this please....
« on: May 13, 2012, 04:25:46 pm »
why is this not a long arm?  its a greatsword!  theres broadswords that are larger than this......

a scorched greatsword is a type of weapon made from base-material
It can be taken and worn on TAKE WIELD
It is magic blessed melt-on-drop
Its weight is 6 and its valued at 1800 coins.
If worn it will give you --
    -1 to your Intelligence
     3 to your Constitution
     2 to your Damroll

Wanted Weapon Balance: (base)-=====0===================-(tip)
Actual Weapon Balance: (base)-====0====================-(tip)
This balance gives the weapon 13 speed, 42 accuracy and 9 evasion.
The one handed weapon is a 60cm Shortsword that can slash at 10D10 damage.

Offline Prometheus

  • the bang your head against the wall coder.
  • Administrator
  • Sr. Member
  • *****
  • Posts: 365
    • View Profile
Re: fix this please....
« Reply #1 on: May 15, 2012, 04:09:18 pm »
What error does it give you when you try to dual wield?

Need to see if it is an code or building issue and go from there :)

Prometheus

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: fix this please....
« Reply #2 on: May 15, 2012, 09:48:13 pm »
His issue is that it's named a greatsword - which is a quite large weapon and in D&D terms is a hand and a half (read two handed unless you're really strong) weapon.  Which means the fact it's tagged as a shortsword is completely wrong.  I agree, but I also don't know if there is a reason the builder tagged it as a shortsword (like it's a greatsword for sprites, but a tiny shortsword for humans).

Offline Molly

  • Administrator
  • Hero Member
  • *****
  • Posts: 691
    • View Profile
Re: fix this please....
« Reply #3 on: May 16, 2012, 01:24:29 am »
I changed it to two-handed, don't know if that's what you are after.

Actually I have no idea how to set a sword as long or short, the length seems to be set by the code, but I have no clue what factor defines it.
Maybe Prom can explain that.

Offline Virisin

  • Hero Member
  • *****
  • Posts: 648
    • View Profile
    • Email
Re: fix this please....
« Reply #4 on: May 16, 2012, 05:21:23 am »
Shortsword is 60cm and under so if that thing was 1cm longer it'd be a longsword.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: fix this please....
« Reply #5 on: May 16, 2012, 06:29:49 am »
Yeah, I forgot there really isn't a way for us to specify length of a weapon in building.  I can only choose weapon and then whether or not its two handed.  But I can't say "this is a short sword"  "this is a long sword"  "this is a great sword" other than in the name of the item.  Or at least I don't see a way to do it.  I could be missing something.

Offline Molly

  • Administrator
  • Hero Member
  • *****
  • Posts: 691
    • View Profile
Re: fix this please....
« Reply #6 on: May 16, 2012, 07:26:16 am »
It probably has something to do with the dam dice, since there is no way to set the length in OLC.

Again, could one of the coders please explain how it works?
It would be helpful for us builders.

Offline Prometheus

  • the bang your head against the wall coder.
  • Administrator
  • Sr. Member
  • *****
  • Posts: 365
    • View Profile
Re: fix this please....
« Reply #7 on: May 18, 2012, 01:25:05 pm »
I can look at the code to see how it determines how long a weapon is (God that sounds so <blank>)

Or are we discussing long vs short sword?

And I will let you all know. Unless that isn't what is being asked.

Prometheus
« Last Edit: May 18, 2012, 02:29:43 pm by Prometheus »

Offline Zsijn

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Re: fix this please....
« Reply #8 on: May 18, 2012, 05:06:42 pm »
i got it thinking..."greatsword" awesome it will be a longarm weapon and work into my bonus as a warrior....also even as 2 handed it shows as a shortsword still...

Offline Virisin

  • Hero Member
  • *****
  • Posts: 648
    • View Profile
    • Email
Re: fix this please....
« Reply #9 on: May 18, 2012, 11:55:54 pm »
int is_short_wep ( struct obj_data *obj )
{
   if ( obj && ( GET_OBJ_TYPE ( obj ) == ITEM_WEAPON ) && GET_WEP_LENGTH ( obj ) <= 60 )
      return 1;
   else
      return 0;
}

   {ONE_HANDED,  0,   0,  0,   0,  0,   0, 25, "Standard},
   {ONE_HANDED, 30, -130,  0, 0, 40, -80, 25, "Knife"},
   {ONE_HANDED, 20, -90,  5, -20, 40, -80, 30, "Dagger"},
   {ONE_HANDED, 15, -70, 10, -30, 45, -90, 20, "Shortsword"},
   {TWO_HANDED, 30, -130, 40, -90, 120,  -160, 25, "Longsword"},
   {TWO_HANDED, 50, -130, 60, -90, 120,  -160, 25, "Lightsaber"},
   {ONE_HANDED, 40, -60, 45, -100, 100, -140, 25, "Katana"},
   {ONE_HANDED, 15, -70, 10, -30, 40, -80, 20, "Rapier"},
   {ONE_HANDED, 15, -70, 20, -50, 35, -70, 30, "Cutlass"},
   {TWO_HANDED, 30, -130, 55, -120, 140, -180, 45, "Broadsword"},
   {ONE_HANDED, 20, -90,  5, -20, 40, -80, 60, "HalfAxe"},
   {TWO_HANDED, 25, -110, 35, -80, 80, -100, 60, "Axe"},
   {ONE_HANDED, 15, -70,  5, -20, 40, -80, 60, "WarHammer"},
   {ONE_HANDED, 20, -60,  5, -20, 45, -80, 65, "Mace"},
   {TWO_HANDED,50, -210, 50, -110, 80, -90, 25, "Shortstaff"},
   {TWO_HANDED,50, -210, 60, -130, 120, -160, 40, "Staff"},
   {ONE_HANDED,  0,   0,  0,   0,  0,   -30, 15, "Whip"},
   {ONE_HANDED, 15, -70, 10, -30, 40, -80, 65, "Club"},
   {ONE_HANDED, 15, -70, 10, -30, 40, -80, 40, "Teeth"},
   {ONE_HANDED, 15, -70, 10, -30, 40, -80, 35, "Claws"},
   {ONE_HANDED, 15, -70, 10, -30, 40, -80, 40, "Projectile"}

Offline Molly

  • Administrator
  • Hero Member
  • *****
  • Posts: 691
    • View Profile
Re: fix this please....
« Reply #10 on: May 19, 2012, 01:59:26 am »
Nice coderish, but we still don't seem to be able to set the length in OLC.

The choices I get is first OBJECT TYPE, where WEAPON is the only applicable choice.

Then I get to VALUES, where I get to set the number and size of damage dice, plus a 'weapon type', which in this case means damage message, with  choices  like hit, sting, whip, slash, bite, bludgeon, crush  etc. For swords SLASH seems to be the only appropriate choice.

I can then set two choices related to weapon type in EXTRA FLAGS; either LIGHTSABRE or TWO-HANDED
(There are also choices liked TINKERED, RANDOMIZED, ENHANCED and  MODIFIED, but from what I learnt these are done by the code when the weapon is actually tampered with, and shouldn't be set in OLC
This particular weapon also has the flags MAGIC and BLESSED, and from what I remember, MAGIC is supposed to stop the weapon from being tinkered. I don't even know what BLESSED is supposed to do).

All of this seems rather cryptic in relation to what I get when statting and identifying the weapon:

L-Des: A scorched greatsword with intricate carvings is lying here.
Extra descs: [sword]
Can be worn on: TAKE WIELD
Set char bits : NOBITS
Extra flags   : magic blessed melt-on-drop two-handed
Weight: 6, Value: 1800, Cost/day: 0, Timer: -1, Min level: 0
In room: Nowhere, In object: None, Carried by: Molly, Worn by: Nobody
, In Locker: Nobody
VAR: 0 Todam: 10d10, Message type: 3, Length: 60cm
Balance: (46) ===========0=============
This balance gives the weapon -8 speed, 9 accuracy and -1 evasion.


Using an ident scroll gives the following result:

a scorched greatsword is a type of weapon made from base-material
It can be taken and worn on TAKE WIELD
It is magic blessed melt-on-drop two-handed
Its weight is 6 and its valued at 1800 coins.
If worn it will give you --
    -1 to your Intelligence
     3 to your Constitution
     2 to your Damroll

Wanted Weapon Balance: (base)-=====0===================-(tip)
Actual Weapon Balance: (base)-===========0=============-(tip)
This balance gives the weapon -8 speed, 9 accuracy and -1 evasion.
The one handed weapon is a 60cm Shortsword that can slash at 10D10 damage.

This weapon gives a chance of landing attacks to
                (Head)
                (10%)
            (Upper)-(Upper) 
  (20%)(Left)   (Torso)   (Right)(20%)
                (10%)
            (Lower)-(Lower)
         (Left )       (Right)
          (20%)         (20%)


As you can see it still says 'one handed weapon' , even though the twohanded flag is set. I take it the flag is pretty much meaningless.

So where on earth am I supposed to set the length?

Offline Prometheus

  • the bang your head against the wall coder.
  • Administrator
  • Sr. Member
  • *****
  • Posts: 365
    • View Profile
Re: fix this please....
« Reply #11 on: May 19, 2012, 12:52:05 pm »
I'm guessing that what Virisin put out there has the length preset. So I'm thinking it was meant to be a fixed value and not able to be set via OLC.

Just my guess.

When I get home I can take a closer look at the code and see what all of the values mean and see if we have a greatsword defined and if not maybe add one.

Prom

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 729
    • View Profile
    • Email
Re: fix this please....
« Reply #12 on: May 20, 2012, 05:28:07 pm »
so.... all swords are shortswords since we can't change length?

Offline Virisin

  • Hero Member
  • *****
  • Posts: 648
    • View Profile
    • Email
Re: fix this please....
« Reply #13 on: May 20, 2012, 06:38:45 pm »
Ughhhhh the code doesn't seem very consistent nor clear to do with weapon types, lots of little bits of code relevant to weapon type seem to ignore some weapon types.. And obviously what builders get to do is not much...

Looks like length is set based on what weapon type is given, default being 50, so that would obviously not be how a builder would set a weapon type (nor should it be).

   default:
         return 50;
         break;
      case WEP_KNIFE:
         return 20;
      case WEP_DAGGER:
         return 35;
      case WEP_SHORTSWORD:
         return 60;
      case WEP_LONGSWORD:
         return 120;
      case WEP_KATANA:
         return 110;
      case WEP_RAPIER:
         return 80;
      case WEP_CUTLASS:
         return 70;
      case WEP_BROADSWORD:
         return 120;
      case WEP_HALFAXE:
         return 60;
      case WEP_AXE:
         return 75;
      case WEP_WARHAMMER:
         return 50;
      case WEP_MACE:
         return 50;
      case WEP_SHORTSTAFF:
         return 120;
      case WEP_STAFF:
         return 195;
      case WEP_WHIP:
         return 200;
      case WEP_CLUB:
         return 60;
      case WEP_TEETH:
         return 15;
      case WEP_CLAWS:
         return 25;
      case WEP_PROJECTILE:
         return 25;

It looks like based on what Molly said before, that the only input builders get is the HIT TYPE, which does indeed have the following effects:

case TYPE_HIT:
         return WEP_CLUB;
      case TYPE_STING:
         return WEP_RAPIER;
      case TYPE_WHIP:
         return WEP_WHIP;
      case TYPE_SLASH:
         return WEP_SHORTSWORD;
      case TYPE_BITE:
         return WEP_TEETH;
      case TYPE_BLUDGEON:
         return WEP_WARHAMMER;
      case TYPE_CRUSH:
         return WEP_MACE;
      case TYPE_POUND:
         return WEP_SHORTSTAFF;
      case TYPE_CLAW:
         return WEP_CLAWS;
      case TYPE_MAUL:
         return WEP_HALFAXE;
      case TYPE_THRASH:
         return WEP_STAFF;
      case TYPE_PIERCE:
         return WEP_DAGGER;
      case TYPE_BLAST:
         return WEP_PROJECTILE;
      case TYPE_PUNCH:
         return WEP_CLAWS;
      case TYPE_STAB:
         return WEP_CUTLASS;
      case TYPE_KICK:
         return WEP_CLAWS;
      case TYPE_GORE:
         return WEP_AXE;
      default:
         return WEP_STANDARD;
   }

So yes, slash returns WEP_SHORTSWORD, but WEP_LONGSWORD is noticeably missing from that list...

Ahh, this must be where shit happens, however it's the one method I can't quite decipher.. So I'll let Prom or someone explain further.  :-\

   case 'a':
         if CHNAME ( "axe" )
            return WEP_AXE;
         break;
      case 'b':
         if CHNAME ( "broadsword" )
            return WEP_BROADSWORD;
         if CHNAME ( "branch" )
            return WEP_CLUB;
         break;
      case 'c':
         if CHNAME ( "claymore" )
            return WEP_BROADSWORD;
         if CHNAME ( "cutlass" )
            return WEP_CUTLASS;
         if CHNAME ( "club" )
            return WEP_CLUB;
         if CHNAME ( "claw" )
            return WEP_CLAWS;
         if CHNAME ( "claws" )
            return WEP_CLAWS;
         break;
      case 'd':
         if CHNAME ( "dagger" )
            return WEP_DAGGER;
         if CHNAME ( "dirk" )
            return WEP_DAGGER;
         break;
      case 'e':
         break;
      case 'f':
         if CHNAME ( "flintstone" )
            return WEP_HALFAXE;
         break;
      case 'g':
         if CHNAME ( "gun" )
            return WEP_PROJECTILE;
         break;
      case 'h':
         if CHNAME ( "halfaxe" )
            return WEP_HALFAXE;
         break;
      case 'i':
         break;
      case 'j':
         break;
      case 'k':
         if CHNAME ( "knife" )
            return WEP_KNIFE;
         if CHNAME ( "katana" )
            return WEP_KATANA;
         break;
      case 'l':
         if CHNAME ( "longsword" )
            return WEP_LONGSWORD;
         break;
      case 'm':
         if CHNAME ( "mace" )
            return WEP_MACE;
         break;
      case 'n':
         break;
      case 'o':
         break;
      case 'p':
         if CHNAME ( "post" )
            return WEP_CLUB;
         break;
      case 'q':
         break;
      case 'r':
         if CHNAME ( "rapier" )
            return WEP_RAPIER;
         break;
      case 's':
         if CHNAME ( "sword" )
            return WEP_SHORTSWORD;
         if CHNAME ( "shortsword" )
            return WEP_SHORTSWORD;
         if CHNAME ( "shortstaff" )
            return WEP_SHORTSTAFF;
         if CHNAME ( "staff" )
            return WEP_STAFF;
         break;
      case 't':
         if CHNAME ( "teeth" )
            return WEP_TEETH;
         break;
      case 'u':
         break;
      case 'v':
         break;
      case 'w':
         if CHNAME ( "warhammer" )
            return WEP_WARHAMMER;
         if CHNAME ( "war-hammer" )
            return WEP_WARHAMMER;
         if CHNAME ( "whip" )
            return WEP_WHIP;
         if CHNAME ( "wood" )
            return WEP_CLUB;
         break;
      case 'x':
         break;
      case 'y':
         break;
      case 'z':
         break;
      default:
         return WEP_STANDARD;
   }
   return WEP_STANDARD;
}

Offline Virisin

  • Hero Member
  • *****
  • Posts: 648
    • View Profile
    • Email
Re: fix this please....
« Reply #14 on: May 20, 2012, 06:41:15 pm »
I'm guessing that if someone were to add:

     if CHNAME ( "greatsword" )
            return WEP_BROADSWORD;
         break;

to case 'g' before gun, then it would turn all greatswords into broadswords, rather than letting them default to shortswords.