Full Version : Guns
xmlspawner >>Scripting Support >>Guns


<< Prev | Next >>

olsyke- 06-26-2006
hey everyone... i came to the idea of trying to exchange bows for guns

anone heard anythign on that topic or maybe know some sites ?


id really love a lot of input since i never tried anthing of that kind

ArteGordon- 06-26-2006
check this out
http://runuo.com/forums/showthread.php?t=69374

olsyke- 06-27-2006
great i diddnt hit that post yet !


startet working on anims to make xbows to shotguns already so this really fits perfect into my plans smile.gif too bad this weapon pack doesnt include "handgun" animations but still you did me a great favour !

olsyke- 06-27-2006
hey... i set everything up like its said in the "readme" of that guns pack... also everything seems to be working fine just when i start runuo.exe i get the following


"Errors:
+ Gunclip.cs:
CS0115: Line 32: 'Server.Items.Gunclip.dupe<int>': no suitable method found to override"


probalby a pretty simple issue but i have no idea yet about this - my first thought is that the scripts that came with the package are not in the right place (i put them all into "scripts" folder but not within a certain folder in there (weapons,items.. ) since there is nothing statet about this in the readme


oh and this is the new runuo 2.0 version im working on btw if thats important

ArteGordon- 06-27-2006
Dupe is not supported as an Item class method under RunUO 2.0

If there was something special done in that Dupe method, it should be moved to the new OnAfterDupe method, otherwise just get rid of it.

olsyke- 06-27-2006
CODE

using System;

namespace Server.Items
{
public class Gunclip : Item, ICommodity
{
 string ICommodity.Description
 {
  get
  {
   return String.Format( Amount == 1 ? "{0} gunclip" : "{0} gunclips", Amount );
  }
 }

 [Constructable]
 public Gunclip() : this( 1 )
 {
 }

 [Constructable]
 public Gunclip( int amount ) : base( 0xAFC )
 {
  Stackable = true;
  Weight = 0.1;
  Amount = amount;
 }

 public Gunclip( Serial serial ) : base( serial )
 {
 }

 public override Item Dupe( int amount )
 {
  return base.Dupe( new Gunclip( amount ), amount );
 }

 public override void Serialize( GenericWriter writer )
 {
  base.Serialize( writer );

  writer.Write( (int) 0 ); // version
 }

 public override void Deserialize( GenericReader reader )
 {
  base.Deserialize( reader );

  int version = reader.ReadInt();
 }
}
}



ah almost forgot this is the file

olsyke- 06-27-2006
erm... if im not completely mistaken this is a tweaked version of runuo 1.0 arrow.cs so i would have to compare it with the new 2.0 arrow.cs and modify to fit it ?

ArteGordon- 06-27-2006
right. You can basically just remove the Dupe override.

olsyke- 06-27-2006
oh my god tongue.gif


now after having removed that :


CODE

public override Item Dupe( int amount )
{
 return base.Dupe( new Gunclip( amount ), amount );
}


im getting the errors shown in the attachment


ArteGordon- 06-27-2006
these all look like 1.0->2.0 conversion issues.

olsyke- 06-27-2006
.... time to learn scripting tongue.gif

olsyke- 06-27-2006
well okay now i fixed the Gunclip.cs using Arrow.cs and fixed one of the Handguns using Bow.cs (will only need 1 gun)

but im getting the error shown on the image...

Gunclip.cs is put to scripts/items/ressources/arrows
(also tried having it just in /scripts)


any idea ?







ArteGordon- 06-27-2006
your class is named 'Gunclip' not 'GunClip'. You need to change that reference.

olsyke- 06-27-2006
hm

here some results on my first objective smile.gif


offcourse that beam is only for testing ill replace it with a better one later
but im pretty proud of the gun.



ArteGordon- 06-28-2006
looks good.