Little error in script

Archive of posts related to former distro versions. Be aware that posts here do not refer to the current distro and may not work.

Moderators: POL Developer, Distro Developer

Locked
User avatar
ELSoft
Journeyman Poster
Posts: 61
Joined: Sun Jun 18, 2006 7:45 pm

Little error in script

Post by ELSoft »

In Distro 097 "pkg/items/sysbook/commands/gm/readonly.src" the cfgfile.em is not declared and the script use ReadConfigFile and GetConfigString.

Code: Select all

use uo;
use os;

program textcmd_readonly(character)
	SendSysMessage(character, "Target a book to switch between read-only and read/write");
	var book := Target(character);
	if ( !book or book.errortext )
		SendSysMessage(character, "Cancelled.");
		return 0;
	endif

	// check to see if it's an itemdesc based book. If so, exit
	var cfg := ReadConfigFile(":*:itemdesc");
	cfg := cfg[book.objtype];
	var author := GetConfigString(cfg, "Author");
	if ( author and !author.errortext )
		SendSysMessage(character, "This is a shared book and cannot be changed.");
		return 0;
	endif

	if ( book.IsWritable() )
		book.ReadOnly(1);
		SendSysMessage(character, "This book is now read-only.");
	else
		book.ReadOnly(0);
		SendSysMessage(character, "This book is now read-write.");
	endif
endprogram
User avatar
ELSoft
Journeyman Poster
Posts: 61
Joined: Sun Jun 18, 2006 7:45 pm

Post by ELSoft »

Code: Select all

checkpoint: load_itemdesc
Couldn't find an Armor Zone in armrzone.cfg for layer 0
Error in ObjType 0x1b72. Package armor.
Server Shutdown: load_itemdesc
Execution aborted due to: Configuration file error

Code: Select all

Armor 0x1B72
{
	//Main Stuff
	Name		BronzeShield
	Desc		round shield
	VendorBuysFor	45
	VendorSellsFor	91

	//Equipment Info
	MaxHP		28
	StrRequired	20

	//Armor Info
	AR		10
	Coverage	Shield

	//Scripts
	DestroyScript	onDestroy

	//Custom Values
	Repairable	1
	MedLoss		nomed
}
I search in armzone.cfg for a "Coverage Shield" but is not defined?
User avatar
tekproxy
Forum Regular
Posts: 352
Joined: Thu Apr 06, 2006 5:11 pm
Location: Nederland, Texas

Re: Little error in script

Post by tekproxy »

ELSoft wrote:In Distro 097 "pkg/items/sysbook/commands/gm/readonly.src" the cfgfile.em is not declared and the script use ReadConfigFile and GetConfigString.
Thanks for this. It has been fixed in the distro.
User avatar
tekproxy
Forum Regular
Posts: 352
Joined: Thu Apr 06, 2006 5:11 pm
Location: Nederland, Texas

Post by tekproxy »

ELSoft wrote:checkpoint: load_itemdesc
Couldn't find an Armor Zone in armrzone.cfg for layer 0
Error in ObjType 0x1b72. Package armor.
Server Shutdown: load_itemdesc
Execution aborted due to: Configuration file error

This is strange because in the distro there is no coverage defined for the bronze shield. How did it get there?

Maybe someone added an armor zone for shields and then set that shield to use that armor zone. I'm not sure how that would work but if you find out let me know.

Just remove it and see if everything works correctly.

Oh and please limit each thread to 1 problem. Thanks.
User avatar
ELSoft
Journeyman Poster
Posts: 61
Joined: Sun Jun 18, 2006 7:45 pm

Post by ELSoft »

In pkg/items/clothing/config/itemdesc.cfg

Code: Select all

Armor 0x1515
{
	//Main Stuff	
	Name	cloak
	VendorBuysFor	21
	VendorSellsFor	43
	
	//Equipment Info	
	MaxHP	20
	
	//Armor Info	
	AR	1

	//Scripts	
	DestroyScript	clothOnDestroy
	
	//Custom Values	
	candye	1
}
The "Coverage Body" is not defined and throws the same problem with layer 0
User avatar
tekproxy
Forum Regular
Posts: 352
Joined: Thu Apr 06, 2006 5:11 pm
Location: Nederland, Texas

Post by tekproxy »

The string "coverage" is not found in any script or config file in the distro. Not sure how I got there for you.

It seems this is not a distro bug but a problem with your distro.

I also don't know what that itemdesc.cfg entry is for.
Locked