December 21, 2024, 18:00:47

Author Topic: Ships on patrol ignore "tMoveTo" commands  (Read 6088 times)

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Ships on patrol ignore "tMoveTo" commands
« on: July 13, 2011, 01:54:07 »
I've assigned to a group of AI ships this command:
Code: [Select]
s.this:tSetTerritory(m.Station, m.Station:radius*2, m.Station:radius*3, m.Station:radius*5, floor(rnd(50,150)), 2);
Where m.station is the identifier of a station insystem.
Afterwards, I want to have them break their patrol and engage the player's fleet, and for them to do that I assign them a tMoveTo command, more specifically:
Code: [Select]
e.auxShip:tSetForbid(#FORBID_MOTION_MOTIVATION_AWAY);
e.auxShip:tSetForbid(#FORBID_FIRE_FREE);
e.auxShip:tMoveTo(e.closestShip,2,0);
e.auxShip:tMoveToIntensity:=1000000000000;
Where this code is placed inside an Execlist loop that goes through the ships assigned the previous patrol.
The ships, however, won't be bothered with this new command and will continue their patrol.

I've already tested that if the ships are not given the patrol duty they'll move towards my ships.

Anyone got any ideas?

Offline The Old Dragon

  • Ensign
  • ***
  • Posts: 362
  • Karma: 6
    • View Profile
    • http://
Re: Ships on patrol ignore "tMoveTo" commands
« Reply #1 on: July 13, 2011, 08:49:37 »
Hi Mularac,

Have you tried clearing the older territory command before issuing the new order?

Not used it yet, but this may help...

   obj:tClearTerritory();

Just a thought...
Better to look the fool by asking, then prove them right with ignorance.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: Ships on patrol ignore "tMoveTo" commands
« Reply #2 on: July 13, 2011, 11:35:17 »
Thanks! that did it. I had completely forgotten about that particular command....