Announcement

Collapse
No announcement yet.

DEBUG: Event Manager, adding events

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

  • #16
    Actual I wouldn't add it to the movement type, just an extra flag like:

    Immobile

    or

    CantMove

    Then this must be checked before, the actual move event. And of course if in a stack such a unit is, the move order button and the move order from the context menu must be removed.

    -Martin
    Civ2 military advisor: "No complaints, Sir!"

    Comment


    • #17
      Yea, it must be added as a separate flag, actually. I looked at the code that fills the build queues, and it checks units by movement type. So, a city wouldn't list "Immobile" units in its queue, unless that code was changed too.

      So I'll have to redo it as a separate flag. I just don't like that it's pretty hard to find the actual move event, as the order system is complex enough - though the place where I put it at least aborts movement for Immobile units the way I did them.
      Solver, WePlayCiv Co-Administrator
      Contact: solver-at-weplayciv-dot-com
      I can kill you whenever I please... but not today. - The Cigarette Smoking Man

      Comment


      • #18
        Originally posted by Solver
        I just don't like that it's pretty hard to find the actual move event, as the order system is complex enough
        It's depressing how difficult it is to locate what you want under circumstances like this. Often you find that the code you're searching for is scattered across dozens of files, in bizarre places... For the movement code I'd takle it by searching out all places that access a unit's movement point allowance and see what calls them.

        Comment


        • #19
          True, true. In that case, the SelectedItem class and files contain the code, as well as UnitData and UnitRecord, ArmyData and the Order classes. An army is looked from the selected item, where units are taken and indexed, and then they get an order to move, and the order processing is complex enough as it is, too.

          But at least I do now have quite some knowledge about how unit movement is handled in CtP2 .
          Solver, WePlayCiv Co-Administrator
          Contact: solver-at-weplayciv-dot-com
          I can kill you whenever I please... but not today. - The Cigarette Smoking Man

          Comment


          • #20
            If you're going at it through the Selected Item class, you're getting the human perspective. Soren Johnson once remarked "The AI can't push buttons."

            Comment


            • #21
              Yeah, but it has to be done both for the human and the AI. It leads to the same place after that, but tracing the function calls is easier from finding where the human initiates them. The AI just skips to the subsequent classes without Selected Item being used.
              Solver, WePlayCiv Co-Administrator
              Contact: solver-at-weplayciv-dot-com
              I can kill you whenever I please... but not today. - The Cigarette Smoking Man

              Comment

              Working...
              X