Having a bit of trouble with this script, It's not mine i got it somewhere here in the forums. i butchered it a bit but it works as intended, when i add it in game "[RunebookTownsTammel" it will pop down one or more books on the ground depending on how many locations i have in my text file, but if i try to add this to a new players backpack in charactercreation.cs

Code:
            PackItem(new RedBook("a book", m.Name, 20, true));
			PackItem(new Gold(1000)); // Starting gold can be customized here
			PackItem(new SkillBall());
			PackItem(new StatBall());
            PackItem(new RunebookTownsTrammel());
			PackItem(new Candle());

I get this error.

[article]
ServUO - [https://www.servuo.com] Version 0.5, Build 6864.17389 - Build on 10/17/2018 9:39:38 AM UTC - Release
Core: Optimizing for 4 64-bit processors
Core: Compiled for .NET 4.0
RandomImpl: CSPRandom (Software)
Core: Loading config...
Scripts: Compiling C# scripts...Failed with: 1 errors, 0 warnings
Errors:
+ Misc/CharacterCreation.cs:
CS1729: Line 70: 'Server.Items.RunebookTownsTrammel' does not contain a constructor that takes 0 arguments
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
[/article]

This is RunebookTownsTrammel.cs
Code:
#region AuthorHeader
// 
//    Runebook Library Changed by Partystuffcloseouts/Soultaker
//  GraveYards Ver. 1.0
// 
//  Based on Runebook T-Hunting Files Original Ideas and code by // A_Li_N // Senior Member
// 
#endregion AuthorHeader
using System;
using System.IO;
using Server.Commands;
using System.Collections;
using Server;
using Server.Items;

namespace Server.Items
{
    public class RunebookTownsTrammel : Item
    {
        private static string pathlist = "Scripts/customrunebooks/Data/TownsFT.txt";
        private static string entry = "Name X Y Z";
        private static string[] mapNames;
        private static string[] xs;
        private static string[] ys;
        private static string[] zs;
        private static int size = 0;

        private static ArrayList library;

      public static void Initialize()
      {
         CommandSystem.Register( "RunebookTownsTrammel", AccessLevel.Administrator, new CommandEventHandler( RunebookTownsTrammel_OnCommand ) );
      }

        public static void RunebookTownsTrammel_OnCommand( CommandEventArgs args )
        {
            Mobile m = args.Mobile;
             RunebookTownsTrammel rl = new RunebookTownsTrammel(m);
        }

        private static void readLine()
        {
            if( File.Exists( pathlist ) )
            {
                size = 0;
                string name = "";
                string x = "";
                string y = "";
                string z = "";

                StreamReader f = new StreamReader( pathlist );
                while( (entry = f.ReadLine()) != null )
                {
                    string[] parts = null;
                    parts = entry.Split();

                    name += parts[0]+" ";
                    x += parts[1]+" ";
                    y += parts[2]+" ";
                    z += parts[3]+" ";
                    size++;
                }
                f.Close();

                mapNames = name.Split();
                xs = x.Split();
                ys = y.Split();
                zs = z.Split();
            }
        }

        [Constructable]
        public RunebookTownsTrammel (Mobile from)
        {
            library = new ArrayList();

            readLine();
            Runebook rb = new Runebook(0);
            int nameStart = 1;
            int nameEnd = 1;
            for( int i=0; i<size; i++ )
            {
                if( rb.Entries.Count == 16 )
                {
                    rb.Name = "Towns Trammel";
                    library.Add(rb);
                    rb = new Runebook(0);
                    nameStart = nameEnd;
                }
                int x = int.Parse(xs[i]);
                int y = int.Parse(ys[i]);
                int z = int.Parse(zs[i]);
                Point3D targ = new Point3D(x, y, z);
                RecallRune rr = new RecallRune();
                rr.Target = targ;
                rr.TargetMap = Map.Trammel;
                rr.Description = mapNames[i];
                rr.House = null;
                rr.Marked = true;
                rb.OnDragDrop(from, rr );
                nameEnd++;
            }
            rb.Name = "Towns Trammel";
            library.Add(rb);

            int height = 6;
            int offx;
            int offy;
            int offz;
            for(int p=0; p<library.Count; p++)
            {
                Runebook librarybook = (Runebook)library[p];
                librarybook.Movable = true;
                librarybook.MaxCharges = 12;
                librarybook.CurCharges = 12;               
                if(p < 4)
                {
                    offx = from.Location.X-1;
                    offy = from.Location.Y-1;
                    offz = from.Location.Z+height;
                }
                else if(p >= 4 && p < 5)
                {
                    offx = from.Location.X;
                    offy = from.Location.Y-1;
                    offz = from.Location.Z+height+2;
                    height += 2;
                }
                else if(p >= 5 && p < 9)
                {
                    offx = from.Location.X;
                    offy = from.Location.Y-1;
                    offz = from.Location.Z+height;
                }
                else
                {
                    offx = from.Location.X+1;
                    offy = from.Location.Y-1;
                    offz = from.Location.Z+height;
                }
                Point3D loc = new Point3D(offx, offy, offz);
                librarybook.MoveToWorld(loc, from.Map);
                if( height == 0 )
                    height = 8;
                height -= 2;
            }
        }

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

        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();
        }
    }
}

I'm sorry if i didn't add these files and descriptions of the problem properly. this is very new to me. Thank you in advance for any help.
 
Well this doesnt work since you dont supply an mobile there, this shouldnt even be an Item in the first place since all it does is spawn runebooks on the ground. Additionally if it is called at a unlucky timing as in 2 times at the same time it will probably throw errors, and it will definitly do odd behaviours because every variable is static.
 
So any suggestions on where I can find a script that has a full runebook with moddable locations?
when you are in the method that's packing the items, you should have access to the mobile you are going to be using, this is normally defined as Mobile m or Mobile from, but other names exist, you need to figure out which name you have, I'll assume the name of the mobile variable is "from" in this case you would just need to change:
Code:
PackItem(new RunebookTownsTrammel());
to
Code:
PackItem(new RunebookTownsTrammel(from));

The error is telling you that there is no constructor for "RunebookTownsTrammel" that has no arguments. The constructor (that's useful to you) for the class is
Code:
public RunebookTownsTrammel (Mobile from)
and the part inside the parentheses are the arguments to it. Thus providing the mobile when you create a new instance is required.
 
Talow yes sure, but the "Item" itself is not an item at all, it generates further books and drops them on the ground
 
Thats what i've been using. great script, but i really dont like the fact that it doesn't operate like a rune book, using charges or gate or sacred journey.
 
Back