kaiovas said:uhm.. failed to initialize, no errors, no messages, only "random encounters... failed to initialize" uhm.. what can i do?
i have done everything you wrote
thanks
Teh Gamer said:I made one of these before, but it had too many errors.
RandomEncounters: Exception encountered attempting to load file: ./Scripts/Custom/RandomEncounters/RandomEncounters.xml
System.FormatException: Input string was not in a correct format.
at System.Number.ParseSingle(String s, NumberStyles style, NumberFormatInfo i
nfo)
at System.Single.Parse(String s, NumberStyles style, IFormatProvider provider
)
at Server.Misc.RandomEncounterEngine.LoadXml()
at Server.Misc.RandomEncounterEngine.MaybeLoadXml()
RandomEncounters: failed initialization!
cefyl said:i'm unable to win against that :
I'm using your xml file without editing it.Code:RandomEncounters: Exception encountered attempting to load file: ./Scripts/Custom/RandomEncounters/RandomEncounters.xml System.FormatException: Input string was not in a correct format. at System.Number.ParseSingle(String s, NumberStyles style, NumberFormatInfo i nfo) at System.Single.Parse(String s, NumberStyles style, IFormatProvider provider ) at Server.Misc.RandomEncounterEngine.LoadXml() at Server.Misc.RandomEncounterEngine.MaybeLoadXml() RandomEncounters: failed initialization!
please, save me !
arul said:I've found a bug in your script.
Code:29.11.-19:20:15 System.FormatException: Input string was not in a correct format . at System.Number.ParseSingle(String s, NumberStyles style, NumberFormatInfo i nfo) at System.Single.Parse(String s, NumberStyles style, IFormatProvider provider ) at Server.Misc.RandomEncounterEngine.LoadXml() at Server.Misc.RandomEncounterEngine.MaybeLoadXml() 29.11.-19:20:15 RandomEncounters: failed initialization!
This will need a little fix for non-US people.
Open the RandomEncounters.cs, then put at the above of the script this
then search through the file for this ( it's there four times )Code:using System.Globalization;
and replace it withCode:float.Parse( [I]something[/I] );
also there is Single.Parse() method in use at the line +/- 150 so find it and replace with thisCode:float.Parse([I]something[/I], new CultureInfo("en-US"));
Code:Single.Parse(probability, new CultureInfo("en-US"));
and.... it works now, although it would be better to make the cultureinfo static in the configuration class and refer to it instead of creating the new instance every time it's needed.
However, great idea and well coded, good job Courageous.
cefyl said:in fact, i tried that one with no succes :'(
Single.Parse(probability, new CultureInfo("en-US"));
(yes, i kept the things that were at the "something" place ^^ )float.Parse( something );
cefyl said:seems that changing only this one is working :
random encounters... failed to initialize
IdahoLynxx said:Great script! first one i have messed with adding in a long time to my server! but i have a question. So I understand how to add regions to the XML file in the script, my question is what file is it refrencing that i need to work on to add small new regions. Like i want to set up a small region around that small island connected to trinsic?
Thanks!
kaiovas said:nothing to do... failed initialization:/
//--------------------------------------------------------------
// some core items won't decay, but we need them to:
// the code is in the core, and we don't want to modify that,
// so we will do it here instead
//--------------------------------------------------------------
if ( created is Container && !item.Movable )
{
cleanupList.Add(created);
}
//--------------------------------------------------------------
// some core items won't decay, but we need them to:
// the code is in the core, and we don't want to modify that,
// so we will do it here instead
//--------------------------------------------------------------
//This only deletes Container, I need it to delete all items.
//if ( created is Container && !item.Movable )
{
cleanupList.Add(created);
}
using System;
using Server;
namespace Server.Regions
{
public class MalasDungeon : DungeonRegion
{
public static void Initialize()
{
Region.AddRegion( new MalasDungeon( "Doom" ) );
Region.AddRegion( new MalasDungeon( "Doom Gauntlet" ) );
[COLOR="Blue"] //added Regions...
Region.AddRegion(new MalasDungeon("DoomEntrance"));
Region.AddRegion(new MalasDungeon("DoomExit"));
Region.AddRegion(new MalasDungeon("DoomC"));
Region.AddRegion(new MalasDungeon("DoomD"));
Region.AddRegion(new MalasDungeon("DoomE"));
Region.AddRegion(new MalasDungeon("DoomF"));
Region.AddRegion(new MalasDungeon("DoomG"));
Region.AddRegion(new MalasDungeon("DoomH"));
Region.AddRegion(new MalasDungeon("DoomI"));
[/COLOR] }
public MalasDungeon( string name ) : base( name, Map.Malas )
{
}
}
}
//This only deletes Container, I need it to delete all items.
//if ( created is Container && !item.Movable )
{
cleanupList.Add(created);
}