Announcement

Collapse
No announcement yet.

Unit Orders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unit Orders

    How is it possible to find out if a unit has been given an order?

    What I want to do is run a check each turn to find out if a unit has already been given a pathed move order. If it doesn't have a pathed move order, I want to give it one. But I don't want to give it one if it already has one.

    Anyone have any ideas?

  • #2
    There's a MovePathOrder event in SLIC. You'd probably have to hold all the units in an array, and check each turn if they have a move order. I'm not entirely sure how the move ordering works, but its a starting point...
    Concrete, Abstract, or Squoingy?
    "I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis

    Comment


    • #3
      Originally posted by Immortal Wombat
      There's a MovePathOrder event in SLIC. You'd probably have to hold all the units in an array, and check each turn if they have a move order. I'm not entirely sure how the move ordering works, but its a starting point...
      Thanks, IW. I've already tried several different arrays, but they won't do the trick. I'll have to find a different work around. Oh well, back to the drawing board.

      Comment


      • #4
        IMO, anything to do with moving units is a pain in the neck.

        I *think* the move order:

        MoveOrder(army_t, GEA_Path, location_t, int_t)
        triggers when army[0] makes one move along the given GEA_Path. But as I recall, when I tried to write a handler that watched for this so that I could change their orders, I ran into trouble (can't remember what happened).

        If you're trying to move AI armys that aren't doing anything, try the Entrench event. The AI will entrench armys when it's got nothing better to do with them.

        Comment


        • #5
          I forgot to ask: What are you working on?

          Comment


          • #6
            Originally posted by Peter Triggs
            I forgot to ask: What are you working on?
            A Rome mod. No big whup. I'm tackling the most difficult problems first to see what will be the limits of what can be done. I don't want it to get array heavy otherwise it will take 10 minutes to cycle a turn.

            The question below was about a low priority wishlist addition. If it requires another array, forget it.

            Comment


            • #7
              Some ideas to check the slic and the move-path of armies:

              I had the same problem some month ago.
              When I prepared my first slic program I build in a message-box command. This helped me to see if a line in slic works. If the message-box (in the game) appears the program works to that line.
              If you clear the fog of war - you can see the move path orders of units from all nations.

              I have build up a very simple scenario to check my slic-codes (slic-tester on my homepage). It was useful for me to learn slic- movements through very simple commands (e.g. I let all units of the game go to the south or to the north or to a special declared point).

              Locutus and Dale are the great slic experts of ctp2 you find a lot of stuff in Locutus `Guide to Slic for ctp2`'

              Fritz

              Comment


              • #8
                Originally posted by FRITZ
                When I prepared my first slic program I build in a message-box command. This helped me to see if a line in slic works. If the message-box (in the game) appears the program works to that line.
                I use these to see when if(..) statements become true. I've caught many bugs by using this technique.

                Locutus and Dale are the great slic experts of ctp2 you find a lot of stuff in Locutus `Guide to Slic for ctp2`'

                Fritz
                Gee..... now I'm blushing......

                Comment

                Working...
                X