Full Version : Q - Shorter distance for monsters to players
xmlspawner >>Q&A >>Q - Shorter distance for monsters to players


<< Prev | Next >>

Carradine- 03-07-2007
I apologize for the kinda cryptic topic but it's late and i couldn't come up with a better one, on to the question:

I'm making a newbiedungeon for my new players, i've disabled the Young-system so all the monsters are attacking on sight - is there anywhere in the XMLSpawner system where i can change how many tiles the monsters can "see"?

Right now the attack from like 5-6 tiles making my small newbie dungeon into a veritable hellhole with dozens of creatures attacking at the same time.

ArteGordon- 03-07-2007
you should be able to change the RangePerception property on the creatures.
Try spawning it like

troll/rangeperception/4

The default is 16.

Carradine- 03-07-2007
QUOTE (ArteGordon @ March 08, 2007 12:20 am)
you should be able to change the RangePerception property on the creatures.
Try spawning it like

troll/rangeperception/4

The default is 16.

It works like a charm, thanks alot!


Edit: Another question on the matter, is it that i locally override the "rangeperception" in the creature.cs-file with this?

If so, can i do this with decaytime also?

ArteGordon- 03-07-2007
you are not actually overriding it, you are just changing it. RangePerception is a settable property on basecreatures

CODE

       [CommandProperty(AccessLevel.GameMaster)]
       public int RangePerception
       {
           get
           {
               return m_iRangePerception;
           }
           set
           {
               m_iRangePerception = value;
           }
       }



DecayTime on the otherhand is not settable by default

CODE

 public static TimeSpan DefaultDecayTime{ get{ return m_DDT; } set{ m_DDT = value; } }

 [CommandProperty( AccessLevel.GameMaster )]
 public virtual TimeSpan DecayTime
 {
  get
  {
   return m_DDT;
  }
 }


That is something that you would have to override in specific item scripts to make it settable for that item.

You can set the DefaultDecayTime, but that will affect the default decay for all items.