Full Version : Controlled Mount PickUp
xmlspawner >>Scripting Support >>Controlled Mount PickUp


<< Prev | Next >>

DrussRob- 04-01-2006
I scripted a beetle that does the same thing as the familiar horde minion, but it only picks up what it's standing on. When I add the beetle in game on top of a tiled area of ore, it picks up the ore as it walks on it no prob, but as soon as that beetle becomes controlled it no longer picks up. You can also release the beetle and it still wont pick up anymore. I looked through the 1.0 source and other scripts but I cant find a solution. Got any ideas? thx

CODE
//darkstone edit
       private DateTime m_NextPickup;

       public override void OnThink()
       {
           base.OnThink();

           if (DateTime.Now < m_NextPickup)
               return;

           m_NextPickup = DateTime.Now + TimeSpan.FromSeconds(3);

           Container pack = this.Backpack;

           if (pack == null)
               return;

           ArrayList list = new ArrayList();

           foreach (Item item in this.GetItemsInRange(0))
           {
               if (item.Movable && item.Stackable)
                   list.Add(item);
           }

           for (int i = 0; i < list.Count; ++i)
           {
               Item item = (Item)list[i];

               if (!pack.CheckHold(this, item, false, true))
                   return;

               bool rejected;
               LRReason reject;

               NextActionTime = DateTime.Now;

               Lift(item, item.Amount, out rejected, out reject);

               if (rejected)
                   continue;

               Drop(this, Point3D.Zero);
           }
       }


ArteGordon- 04-02-2006
Your OnThink method looks find. You must have made other modifications to the AI or taming code.
The normal AI behavior should continue to call OnThink after they are tamed or released and so it should work as you describe even after being tamed.

I would guess that somewhere your AI timer is being stopped.

DrussRob- 04-03-2006
I would think so too, but it was compiled on a totally unedited distro version of runuo 1.0 huh.gif

ArteGordon- 04-03-2006
I would post the entire beetle script then. There must be something else going on.

DrussRob- 04-05-2006
Well, this is odd. It just started working. No changes made or anything. I fired up the test server again and added one just to see and it worked fine... no idea... beta 36... meh...

(yes I'm going to 2.0 when it comes out)

thx again for trying to help, but sry I wasted your time lol smile.gif