Nexus Modding > Scripting
Ships on patrol ignore "tMoveTo" commands
(1/1)
Mularac:
I've assigned to a group of AI ships this command:
--- Code: ---s.this:tSetTerritory(m.Station, m.Station:radius*2, m.Station:radius*3, m.Station:radius*5, floor(rnd(50,150)), 2);
--- End code ---
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: ---e.auxShip:tSetForbid(#FORBID_MOTION_MOTIVATION_AWAY);
e.auxShip:tSetForbid(#FORBID_FIRE_FREE);
e.auxShip:tMoveTo(e.closestShip,2,0);
e.auxShip:tMoveToIntensity:=1000000000000;
--- End code ---
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?
The Old Dragon:
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...
Mularac:
Thanks! that did it. I had completely forgotten about that particular command....
Navigation
[0] Message Index
Go to full version