Page 1 of 1

Is Ice Isle the only place a keep will fit?

Posted: Tue Jul 21, 2009 3:32 pm
by GuardianKnight
I just placed a Keep on ice isle a bit ago and i went running around beforehand trying to find anything but ice but no luck. I should say WAS ice island the last good place for a keep?

Re: Is Ice Isle the only place a keep will fit?

Posted: Tue Jul 21, 2009 4:39 pm
by ClowN
pretty much

Re: Is Ice Isle the only place a keep will fit?

Posted: Tue Jul 21, 2009 5:32 pm
by Ronk
I dunno about that, I can't imagine Derrick would have much difficulty in placing a keep anywhere he wants...

Re: Is Ice Isle the only place a keep will fit?

Posted: Wed Jul 22, 2009 12:26 am
by Corwin
Robot wrote:I just placed a Keep on ice isle a bit ago and i went running around beforehand trying to find anything but ice but no luck. I should say WAS ice island the last good place for a keep?
Did you find a map of every place a keep can be placed and go check?

It's amazing what can actually be fit if you have the patience (or a script) to go search for open spots. I actually recreated the houses in the wrong valley from AI on my home server just so I could use a house placement script I wrote to find housing spots.

Re: Is Ice Isle the only place a keep will fit?

Posted: Wed Jul 22, 2009 4:01 am
by Batlin
I actually recreated the houses in the wrong valley from AI on my home server just so I could use a house placement script I wrote to find housing spots.
What scripting program did you use? I don't think Razor allows automated placement of houses, some problem with the targetting cursor not being detected.

Re: Is Ice Isle the only place a keep will fit?

Posted: Wed Jul 22, 2009 5:24 pm
by Corwin
Batlin wrote:
I actually recreated the houses in the wrong valley from AI on my home server just so I could use a house placement script I wrote to find housing spots.
What scripting program did you use? I don't think Razor allows automated placement of houses, some problem with the targetting cursor not being detected.
I wrote the script on the server side, changing the beginning of the OnPlacement() method in HousePlacementTool.cs.

Code: Select all

public bool OnPlacement( Mobile from, Point3D p )
{
	if ( !from.CheckAlive() )
		return false;
	int xoff = 0;          // Corwin
	int yoff = 0;          // Corwin
	int xlim = 1;          // Corwin
	int ylim = 1;          // Corwin
	Point3D pp = p;        // Corwin
Corwin:
        p.X = pp.X + xoff;     // Corwin  
	p.Y = pp.Y - yoff;     // Corwin  
	if (xoff <= -xlim)     // Corwin  
	{
	   yoff--;             // Corwin  
	   if (yoff < 0)       // Corwin
	   {                   // Corwin  
		  xlim++;      // Corwin  
		  ylim++;      // Corwin  
		  xoff = xlim; // Corwin  
		  yoff = 0;    // Corwin  
	   };                  // Corwin  
	}
	else if (yoff < ylim)  // Corwin  
	{                      // Corwin  
	   if (xoff < xlim)    // Corwin  
	      xoff++;          // Corwin  
	   else                // Corwin  
	      yoff++;          // Corwin  
         }                     // Corwin  
          else                 // Corwin  
	     xoff--;           // Corwin  
	   
	      
	ArrayList toMove;
	Point3D center = new Point3D( p.X - m_Offset.X, p.Y - m_Offset.Y, p.Z - m_Offset.Z );
	HousePlacementResult res = HousePlacement.Check( from, m_MultiID, center, out toMove );
	if ((res != HousePlacementResult.Valid) && (ylim <= 100)) // Corwin
	   goto Corwin;                                           // Corwin  

         // the rest is unmodified

Before asking why no one builds something like this in to a production server, understand that it's very CPU intensive and the way I wrote it, it would bring the entire server to a stop until it finishes searching for a spot.

The code does something funky like starting from the spot you're standing on and expanding it's search in a reverse swirl for up to 100 spots away from your target cursor in all directions or perhaps just in the direction your facing (20,000 to 40,000 spots). I don't believe it deals with z-axis, though, so you need to do it on level ground.

Re: Is Ice Isle the only place a keep will fit?

Posted: Wed Jul 22, 2009 5:55 pm
by Hemperor
Corwin wrote:
Batlin wrote:
I actually recreated the houses in the wrong valley from AI on my home server just so I could use a house placement script I wrote to find housing spots.
What scripting program did you use? I don't think Razor allows automated placement of houses, some problem with the targetting cursor not being detected.
I wrote the script on the server side, changing the beginning of the OnPlacement() method in HousePlacementTool.cs.

Code: Select all

public bool OnPlacement( Mobile from, Point3D p )
{
	if ( !from.CheckAlive() )
		return false;
	int xoff = 0;          // Corwin
	int yoff = 0;          // Corwin
	int xlim = 1;          // Corwin
	int ylim = 1;          // Corwin
	Point3D pp = p;        // Corwin
Corwin:
        p.X = pp.X + xoff;     // Corwin  
	p.Y = pp.Y - yoff;     // Corwin  
	if (xoff <= -xlim)     // Corwin  
	{
	   yoff--;             // Corwin  
	   if (yoff < 0)       // Corwin
	   {                   // Corwin  
		  xlim++;      // Corwin  
		  ylim++;      // Corwin  
		  xoff = xlim; // Corwin  
		  yoff = 0;    // Corwin  
	   };                  // Corwin  
	}
	else if (yoff < ylim)  // Corwin  
	{                      // Corwin  
	   if (xoff < xlim)    // Corwin  
	      xoff++;          // Corwin  
	   else                // Corwin  
	      yoff++;          // Corwin  
         }                     // Corwin  
          else                 // Corwin  
	     xoff--;           // Corwin  
	   
	      
	ArrayList toMove;
	Point3D center = new Point3D( p.X - m_Offset.X, p.Y - m_Offset.Y, p.Z - m_Offset.Z );
	HousePlacementResult res = HousePlacement.Check( from, m_MultiID, center, out toMove );
	if ((res != HousePlacementResult.Valid) && (ylim <= 100)) // Corwin
	   goto Corwin;                                           // Corwin  

         // the rest is unmodified

Before asking why no one builds something like this in to a production server, understand that it's very CPU intensive and the way I wrote it, it would bring the entire server to a stop until it finishes searching for a spot.

The code does something funky like starting from the spot you're standing on and expanding it's search in a reverse swirl for up to 100 spots away from your target cursor in all directions or perhaps just in the direction your facing (20,000 to 40,000 spots). I don't believe it deals with z-axis, though, so you need to do it on level ground.
Now that is what programming is all about, innovative thinking! Very cool idea.