RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[1.0] A few story books

David

Moderate
[1.0] A few story books

Summary:
These scripts provide a simple way to add story books as a scripted object which can be used as loot.

Description:
This is two stories told in six books. Lovers Lament is the story of a couple cursed to spend eternity apart--told from two viewpoints. The Death of Rhan is one story told in four volumes (intended to be increasingly rare.)

1.0 Notes:
This script works fine in 1.0, moving from Archives to Submissions on 05/05/06.

Installation:
Extract to your Scripts\Custom folder and restart the server.
 

Attachments

  • LoversLamentBook.zip
    5.2 KB · Views: 124

darkoverlord

Sorceror
Hello haveing a problem

I was trying to add a book for instructions to new people and this is the messages I got:

Scripts: Compiling C# scripts...failed (5 errors, )

- Error: Scripts\Customs\TheBook\InstructionBook.cs: CS1502: (line 16, column 4
) The best overloaded method match for 'Server.Items.BaseBook.BaseBook(int, stri
ng, string, int, bool)' has some invalid arguments
- Error: Scripts\Customs\TheBook\InstructionBook.cs: CS1503: (line 17, column 4
2) Argument '1': cannot convert from 'string' to 'int'
- Error: Scripts\Customs\TheBook\InstructionBook.cs: CS1503: (line 17, column 5
7) Argument '3': cannot convert from 'int' to 'string'
- Error: Scripts\Customs\TheBook\InstructionBook.cs: CS1503: (line 17, column 6
4) Argument '4': cannot convert from 'bool' to 'int'
- Error: Scripts\Customs\TheBook\InstructionBook.cs: CS1503: (line 17, column 7
4) Argument '5': cannot convert from 'int' to 'bool'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

Thanks
deryk
 

Attachments

  • InstructionBook.cs
    4.3 KB · Views: 13
H

hudel

Guest
darkoverlord said:
I was trying to add a book for instructions to new people and this is the messages I got:

Scripts: Compiling C# scripts...failed (5 errors, )

- Error: Scripts\Customs\TheBook\InstructionBook.cs: CS1502: (line 16, column 4
) The best overloaded method match for 'Server.Items.BaseBook.BaseBook(int, stri
ng, string, int, bool)' has some invalid arguments
- Error: Scripts\Customs\TheBook\InstructionBook.cs: CS1503: (line 17, column 4
2) Argument '1': cannot convert from 'string' to 'int'
- Error: Scripts\Customs\TheBook\InstructionBook.cs: CS1503: (line 17, column 5
7) Argument '3': cannot convert from 'int' to 'string'
- Error: Scripts\Customs\TheBook\InstructionBook.cs: CS1503: (line 17, column 6
4) Argument '4': cannot convert from 'bool' to 'int'
- Error: Scripts\Customs\TheBook\InstructionBook.cs: CS1503: (line 17, column 7
4) Argument '5': cannot convert from 'int' to 'bool'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

Thanks
deryk


Hmm,... I'm sitting on the work at the moment and can't test it but it could be that the "style" have to be the first argument. It should be "int, string, string, int, bool" and at the moment it is "string, string, int, bool, int".

You could also try to change this part in the script:
Code:
using System;
using Server;
namespace Server.Items
{
	public class InstructionBook : BaseBook
	{
		private const string TITLE = "Instruction Book";
		private const string AUTHOR = "Deryk";
		private const int PAGES = 11;
		private const bool WRITABLE = false;
		private const int STYLE = 0xFF1 ;
		// books: Brown 0xFEF, Tan 0xFF0, Red 0xFF1, Blue 0xFF2, 
		// OpenSmall 0xFF3, Open 0xFF4, OpenOld 0xFBD, 0xFBE
        
		[Constructable]
        public InstructionBook() : base( TITLE, AUTHOR, PAGES, WRITABLE, STYLE )

to this:
Code:
using System;
using Server;

namespace Server.Items
{
	public class InstructionBook : BrownBook
	{
	[Constructable]
                public InstructionBook() : base( "Instruction Book", "Deryk", 11, false )

hope this helps.
- Hudel -
 

darkoverlord

Sorceror
hmmmm

I tried it and I get an exception error after the final parenthesis on the line after "false"... Im confused lol but thanks...

deryk
 

David

Moderate
The STYLE constant should be the first argument in the constructor not the last.
Code:
        public InstructionBook() : base( STYLE, TITLE, AUTHOR, PAGES, WRITABLE )
After that one change I was able to compile the script and add the book ingame.
 
Nice idea but:

Code:
Scripts: Compiling C# scripts...failed (6 errors, 0 warnings)
 - Error: Scripts\A0-Custom\A0 - Books\RahnBook.cs: CS0133: (line 13, column 21)
 The expression being assigned to 'Server.Items.RhanBook1.STYLE' must be constant
 - Error: Scripts\A0-Custom\A0 - Books\RahnBook.cs: CS0133: (line 78, column 21)
 The expression being assigned to 'Server.Items.RhanBook2.STYLE' must be constant
 - Error: Scripts\A0-Custom\A0 - Books\RahnBook.cs: CS0133: (line 182, column 21
) The expression being assigned to 'Server.Items.RhanBook3.STYLE' must be constant
 - Error: Scripts\A0-Custom\A0 - Books\RahnBook.cs: CS0133: (line 325, column 21
) The expression being assigned to 'Server.Items.RhanBook4.STYLE' must be constant
 - Error: Scripts\A0-Custom\A0 - Books\LoversLamentBook.cs: CS0133: (line 12, column 21) The expression being assigned to 'Server.Items.LoversLamentBook.STYLE' must be constant
 - Error: Scripts\A0-Custom\A0 - Books\LoversLamentBook.cs: CS0133: (line 194, column 21) The expression being assigned to 'Server.Items.GerthlandBook.STYLE' must be constant
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
 
Top