Announcement

Collapse
No announcement yet.

Changing Allegiance of Units

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

  • Changing Allegiance of Units

    I need to change the allegiance of all the barbarian units (300+ of them) in the scenario I am developing to the second tribe. How should I go about doing it?

    ------------------
    St. Leo
    http://www.sidgames.com/hosted/ziggurat/
    http://www.sidgames.com/forums/
    Blog | Civ2 Scenario League | leo.petr at gmail.com

  • #2
    Using a hexeditor you could probably use some function like "replace all". You'll somehow have to prevent all values not related to the civ number to remain unchanged, however.
    Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

    Comment


    • #3
      Could you post somewhat more detailed instructions? I am not even green behind the ears when it comes to hex-editing. Alternatively, I could the save file to anyone who's interested in helping make a jaw-dropping scenario.

      ------------------
      St. Leo
      http://www.sidgames.com/hosted/ziggurat/
      http://www.sidgames.com/forums/
      Blog | Civ2 Scenario League | leo.petr at gmail.com

      Comment


      • #4
        I am surprised that an experienced scenario maker would ask such a question. So, I assume that you were looking for some quick way to do this and avoid the obvious solutions.
        1. Delete the units stack by stack and recreate them.
        2. Bribe them where you can.

        As for hex editing, I doubt this is the solution. I tried to implement such a function for changing unit ownership (when changing city ownership)in civcity, but I could never get it to work. Apparently unit ownership information is stored in more than 1 place.

        ------------------
        "There is no tiddle-taddle nor pibble-pabble in Pompey's camp."
        "Cease fire! Please! Cease fire. What a dreadful waste of ammunition!" -- General Horatio Herbert Kitchener
        --

        Comment


        • #5
          I guess I'll have to try bribing them, but that is not any more fun than deleting and placing them all over again.

          ------------------
          St. Leo
          http://www.sidgames.com/hosted/ziggurat/
          http://www.sidgames.com/forums/
          Blog | Civ2 Scenario League | leo.petr at gmail.com

          Comment


          • #6
            Am I too late? Otherwise you could send it over to me, and I'll see what I can do. It'll probably take a week or more before I've actually checked my mail again, solved the problem and resent it, though.

            Some specifics on what could (or should) solve the problem: I don't know if you're familiar with Allard's "Hex Editing" doc? Anyway, there's a unit section in the scenario file, but you knew that, I guess. For every unit its civ number is stored. Those all have to be changed from barbarian (0?) to 2nd civ. And I believe apart from that you need to change the owner of the squares they're on, too (which is probably the problem you ran into, Gothmog, because I don't think there's more than one place for unit ownership info). Each square is assigned an owner (which determines the color of an airbase, for one), all squares of which the unit changes from barb to 2nd need to be updated too, I think.
            Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

            Comment


            • #7
              Mercator,

              That's it!

              ------------------
              "There is no tiddle-taddle nor pibble-pabble in Pompey's camp."
              "Cease fire! Please! Cease fire. What a dreadful waste of ammunition!" -- General Horatio Herbert Kitchener
              --

              Comment


              • #8
                All very nice, but as far as my test results prove me, changing a unit ownership does not require the terrain ownership to be changed. Maybe that will force the game to a green unit on top of a white airbase, but who cares about that?

                No, no, I was able to change a unit to another owner without any trouble at all. The easiest way to do it:

                1) open the game with an hex editor
                2) convert the x and y coordinates to hex, eg. (63,53) becomes 3F 00 35 00 (note the 00's are behind the values not in front of them, that's because they are inverted, so a square (300,500) would become 2C 01 F4 01 instead of 01 2C 01 F4)
                3) search for that x and y coordinate in the file
                4) the 8th byte is the ownership of the unit (counting the first coordinate number as the 1st byte)

                This may seem a long and tedious process to do for 300 units, but in reality, as units created after each other are listed after each other, you need just jump down two lines and change the next unit.
                To do this, set the length of a line to 13 hex per line, and also, of course, the units indeed need to be created after each other (control this by checking their id: when the reveal complete map is enabled, right click on a unit).

                This is no doubt the fastest way to do it, most efficient too, as it has least chance of mistakes, and it works perfectly for me. no problem..

                so, hope this helps..

                Comment


                • #9
                  Gothmog, you might know the answer to this one. Can you hex-edit a scn. file so that Events produce FOOD caravans? I asked this in a previous thread, but no one knew the answer.
                  Tecumseh's Village, Home of Fine Civilization Scenarios

                  www.tecumseh.150m.com

                  Comment


                  • #10
                    Techumseh, let me take the liberty of answering your question, though it may not have been intended to me..

                    Well, I maybe have no right to answer, as I do not knów the answer, but I will just tell what I think of it.

                    The thing is, a saved game can be hex edited, no problem, and the caravan commodity can be edited. All very simple. And the future can be edited in events, but all except this thing.

                    As information regarding the events are not stored there (except when embedded), and as units to be created later on therefore are also not stored, we can't look for this into the hex edited file.

                    Impossible therefore? Unless the events embedded into the saved game will allow this, (you know, the annoying things that delevents removes). But that has not been done before, and frankly, I don't have the time to do so.
                    But I don't have much hope for this anyway, and scenarios loaded don't include any embedded events, just saved games. Might be different for ToT, though.

                    Another, the more serious work-around option might be to create an editor to change the memory, but now we're talking about real programming. Maybe Jorrit can explain us more about that.
                    [This message has been edited by Allard HS (edited April 10, 2001).]
                    [This message has been edited by Allard HS (edited April 10, 2001).]

                    Comment


                    • #11
                      Thank you Allard, of course I'm pleased for you to answer. But too bad about your answer! Does anyone else have a more encouraging one?
                      Tecumseh's Village, Home of Fine Civilization Scenarios

                      www.tecumseh.150m.com

                      Comment


                      • #12
                        Angello Scotto has written a memory-changing program for ToT.

                        ------------------
                        Leons Petrazickis (St. Leo)
                        http://aventine.cf-developer.net/minizigg/
                        petrazi@sprint.ca
                        Blog | Civ2 Scenario League | leo.petr at gmail.com

                        Comment


                        • #13
                          First, make a back up file of rules.txt;
                          Second, change rules.txt so that road modifier is 1 and all units are spies, domain 3 units with move 127 and cost 10;
                          Third, hex edit the saved file and play as barbarian, move barb units so that they are not stacked and not close to the perticular civ's cities; Fourth, Change back to human civ, give yourself 30k and bribe them!
                          Last, change back to the original rules.txt.

                          Comment


                          • #14
                            Was that an answer to St. Leos' question or mine?
                            Tecumseh's Village, Home of Fine Civilization Scenarios

                            www.tecumseh.150m.com

                            Comment


                            • #15
                              St. Leo's I'd say . By the way, have you tried entering "Food Supplies" as commodity in the events file? Sounds kinda stupid, but who knows.

                              quote:

                              Another, the more serious work-around option might be to create an editor to change the memory, but now we're talking about real programming. Maybe Jorrit can explain us more about that.

                              Hahaha! I think not. Not that I can't program, but that's a bit out of my league.
                              Civilization II: maps, guides, links, scenarios, patches and utilities (+ Civ2Tech and CivEngineer)

                              Comment

                              Working...
                              X