Making a lord party "jump out" of a castle when an enemy party comes close to it

Users who are viewing this thread

This should by all means be possible. I just need help.

Here's the basic idea:

#try every 0.2 second

(try_for_range: all lord parties)###
  ("lord_party" is in a castle),###
  (define "castle_lord_party_is_in"),###

  (try_for_range: all enemy parties),###
    (is_between, "castle_lord_party_is_in", mountain_passes_begin, mountain_passes_end),
    (store_distance_to_party_from_party, ":distance", "castle_lord_party_is_in", "enemy_party"),
    (lt, "distance", 10),
    (command ai "lord_party" follow "enemy_party"),###
    (try_end),

(try_end),


Something like this will make mountain passes(which I have a lot of in my map) actually do something. Right now parties go through them like nothing's there which just ends up having parties all over the place, passing through enemy territory unchallenged.

If a castle's garrison could come out and stop an enemy party from passing chokepoints the world map will become far more strategical.

I am certain something like this will work but I'll need a lot of help to get it working(would also appreciate it if someone could just make it for me :smile: though)


All the ###ed lines I don't currently know how to write(I could figure it out after I read some other scripts but it would help me a lot if someone could give me some hints :smile:)
 
Back
Top Bottom