4Dimensions Forum

General Category => Suggestions & Ideas => Topic started by: Zsijn on May 13, 2012, 04:25:46 pm

Title: fix this please....
Post by: Zsijn 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.
Title: Re: fix this please....
Post by: Prometheus 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
Title: Re: fix this please....
Post by: Kvetch 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).
Title: Re: fix this please....
Post by: Molly 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.
Title: Re: fix this please....
Post by: Virisin 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.
Title: Re: fix this please....
Post by: Kvetch 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.
Title: Re: fix this please....
Post by: Molly 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.
Title: Re: fix this please....
Post by: Prometheus 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
Title: Re: fix this please....
Post by: Zsijn 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...
Title: Re: fix this please....
Post by: Virisin 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"}
Title: Re: fix this please....
Post by: Molly 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?
Title: Re: fix this please....
Post by: Prometheus 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
Title: Re: fix this please....
Post by: Kvetch on May 20, 2012, 05:28:07 pm
so.... all swords are shortswords since we can't change length?
Title: Re: fix this please....
Post by: Virisin 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;
}
Title: Re: fix this please....
Post by: Virisin 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.
Title: Re: fix this please....
Post by: Prometheus on May 20, 2012, 09:55:28 pm
@ Virisin -> See what I mean by messed up code lol. And it being all over the freaking place too :)

When I get a chance I will take a look and see how much of a headache it will be to add greatsword. Don't want to mess up OLC or Molly won't be happy hehe.

Prom
Title: Re: fix this please....
Post by: Virisin on May 20, 2012, 11:29:55 pm
Fixing greatsword shouldn't be bad, adding controls to OLC would be eugh
Title: Re: fix this please....
Post by: Molly on May 21, 2012, 02:38:42 am
Bloody code - no wonder I hate it! :P
Title: Re: fix this please....
Post by: Tocharaeh on May 21, 2012, 01:23:55 pm
So why such a huge variety? Is it all based on the item names?

Any chance we could make weapon building easier on OLC, by choosing a weapon type (katana, rapier, whatever) and bam, the sizes, "hit types", and weight is automatically set? The all there would be left to do is setting the dice, effects, and such.
Title: Re: fix this please....
Post by: Kvetch on May 21, 2012, 02:07:50 pm
I agree with Toch.  It seems we should be able to choose the type of weapon instead of choosing the hit type because all swords should slash, all whips should whip  - though I suppose if you have something odd, like a chainsaw, it may require choosing a hit type.  I wouldn't mind weight being set either by type of weapon - but then again, you may have to be able to edit it for weird things - like the elven sword which weighs less than a normal sword...or a chainsaw.
Title: Re: fix this please....
Post by: Molly on May 21, 2012, 03:18:04 pm
I agree with Kvetch.
The weapon type should really be set in OLC, or at least with a lucid way to understand what sets it.

On the flip side, I don't fancy having to go through a gazillion weapons to fix them in case there is a code change.
Title: Re: fix this please....
Post by: Tocharaeh on May 21, 2012, 09:15:24 pm
I would totally help ^^

any chance of beig able to set that up perhaps, and then possibly getting into new skill sets that create weapon specialization/focus? Ive always felt longsrm and shortarm were far too simplistic. Id relly lime to see staff, shortblade, logblade, mace (bludgeon), and so on. Each class having a focus of a weapkn type but not being limited to it. Ya mnow, skill perk or something. Anyway ill stop derailing your thread now :D
Title: Re: fix this please....
Post by: Virisin on May 22, 2012, 10:50:21 pm
I'm fairly sure the fix in this case should be as I stated above, which shouldn't cause any extra builder work (unless maybe there is a weapon in the game somewhere with 'greatsword' in the name that is not meant to be a broadsword..

Adding capability to OLC.. like I said earlier, that can be left to Once or someone :P
Title: Re: fix this please....
Post by: Kvetch on May 23, 2012, 06:48:35 am
The only problem I can see is if the code would read "this is a really great sword" as "this is a really greatsword".  But, code sounds/looks like a more advanced/better form of scripts which already seem to be able to tell the difference between the two (ask anyone that's tried to say a sentence slightly wrong for a trigger).  If it can already take the words we have in any of the descriptions then it sounds like a great plan to me.  And I would've helped with the tracking down too, but better if its not needed.
Title: Re: fix this please....
Post by: Once on May 27, 2012, 12:12:48 am
Attention span lacking:  Essentially we're looking for the ability to set weapon type in OLC? Rather surprised it can't do that as it is. I'll try to look into that soon.
Title: Re: fix this please....
Post by: Molly on May 27, 2012, 12:52:54 am
I agree that weapon types should be possible to set in OLC, and that it's surprising that you cannot do that already.

I also think that being able to master different weapon types might be a good way to add diversity to combat.

However, I have to point out again that having to go through a gazillion already exosting weapons in OLC, to set the right type, would be very unsatisfactory, to say the least.

If a code change is made, there must also be some mass change made to fix all the existing weapons.
Title: Re: fix this please....
Post by: Prometheus on June 01, 2012, 11:28:12 am
Thotter might be able to write a script that goes through the text files of all objects and fixes things which would be faster than doing it manually. But I don't know how hard it would be to do a script.

Prom
Title: Re: fix this please....
Post by: Prometheus on June 29, 2012, 11:05:33 am
Okay I added WEP_GREATSWORD with a length of 140. Not sure about the length difference of a broadsword vs greatsword. Longsword and broadsword are 120. But I could be wrong hehe.

{TWO_HANDED, 40, -130, 60, -90, 120, -160, 60, "Greatsword"}

Need to figure out what these values are but I will get this added as well.

Prometheus
Title: Re: fix this please....
Post by: Once on June 29, 2012, 01:30:53 pm
Code: [Select]
struct weapon_type_data {
int hands;
int speedtop;
int speedbot;
int evasiontop;
int evasionbot;
int accuracytop;
int accuracybot;
int balance;
const char *name;
};


In sequential order.
Title: Re: fix this please....
Post by: Prometheus on June 29, 2012, 02:22:49 pm
I remarked out my changes till it can be tested by a builder since I don't build and I don't want to unbalance anything. If another coder wants to take this and run with it. :)

Prometheus
Title: Re: fix this please....
Post by: Jaros on July 08, 2012, 10:20:37 pm
Apparently weapon type is determined in OLC under values:

WEAPON
     value 0: The weapon type, one of:
              0) GENERIC - no weapon proficiency will take effect.
              1) Axe
              2) Hammer
              3) Club - and other 'non-weapons'
              4) Polearm
              5) Sword - also daggers, knives, small sword
              6) Large Sword - also bastard swords, twohanded swords
              7) Whip - and flail
              8) Knuckles - and other 'hand' weapons.
     value 1: Number of damage dice
     value 2: Size of damage dice
     value 3: Weapon type for damage messages, one of:
               0    hit/hits
               1    sting/stings
               2    whip/whips
               3    slash/slashes
               4    bite/bites
               5    bludgeon/bludgeons
               6    crush/crushes
               7    pound/pounds
               8    claw/claws
               9    maul/mauls
               10   thrash/thrashes
               11   pierce/pierces
               12   blast/blasts
               13   punch/punches
               14   stab/stabs
               15   impale/impales

Except that when choosing values for a weapon in OLC:

-- Item number : [19106]
1) Namelist : cutter
2) S-Desc   : cutter
3) L-Desc   :-
This is a cutter
4) A-Desc   :-
<not set>
5) Type        : weapon
6) Extra flags : NOBITS
7) Wear flags  : TAKE WIELD
8) Weight      : 0
9) Cost        : 0
A) Cost/Day    : 0
B) Timer       : -1
C) Values      : 0 0 0 0 0 0
D) Menu --->   : Applies
E) Menu --->   : Extra Desc
F) Innate      : (0) UNDEFINED
G) Smell Desc  :
It doesn't smell too interesting.
H) Taste Desc  :
It tastes just like it should.
I) Feel Desc   :
It feels normal, as far as you can tell.
J) Material    : base-material
  M) Min Level   : 0
S) Script      : Not Set.
Q) Quit
Enter choice :
c
Number of damage dice :
20
Size of damage dice :
50
 0) hit                   1) sting               
 2) whip                  3) slash               
 4) bite                  5) bludgeon             
 6) crush                 7) pound               
 8) claw                  9) maul                 
10) thrash               11) pierce               
12) blast                13) punch               
14) stab                 15) kick                 
16) gore                 
Enter weapon type :
8

You can choose damage dice and hit type but it skips Value 0, leaving weapon type set at the default value of 0.  I don't know why OLC would do that.
Title: Re: fix this please....
Post by: Molly on July 09, 2012, 12:31:39 pm
Actually the code is even stupider than that.

The only choice I get to make except for damade dice is the damage message.
I generally choose slash for sword, stab for knife and pierce for dagger.
 
But if type 5 sword equals daggers, knives and small swords, the damage message won't necessarily fit the weapon type.
So there is really no chance to get irt right with our current OLC.