Thread Tools
Old April 1, 2001, 15:55   #1
St Leo
Scenario League / Civ2-CreationApolytoners Hall of Fame
 
St Leo's Avatar
 
Local Time: 02:14
Local Date: October 31, 2010
Join Date: Jul 2005
Location: In search of pants
Posts: 5,085
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/
St Leo is offline  
Old April 3, 2001, 08:19   #2
Mercator
Scenario League / Civ2-Creation
Emperor
 
Mercator's Avatar
 
Local Time: 08:14
Local Date: October 31, 2010
Join Date: Dec 1969
Posts: 3,079
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.
Mercator is offline  
Old April 3, 2001, 22:14   #3
St Leo
Scenario League / Civ2-CreationApolytoners Hall of Fame
 
St Leo's Avatar
 
Local Time: 02:14
Local Date: October 31, 2010
Join Date: Jul 2005
Location: In search of pants
Posts: 5,085
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/
St Leo is offline  
Old April 4, 2001, 08:42   #4
Gothmog
Scenario League / Civ2-Creation
Prince
 
Gothmog's Avatar
 
Local Time: 02:14
Local Date: October 31, 2010
Join Date: Dec 1969
Location: Minas Morgul
Posts: 421
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."
Gothmog is offline  
Old April 4, 2001, 17:43   #5
St Leo
Scenario League / Civ2-CreationApolytoners Hall of Fame
 
St Leo's Avatar
 
Local Time: 02:14
Local Date: October 31, 2010
Join Date: Jul 2005
Location: In search of pants
Posts: 5,085
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/
St Leo is offline  
Old April 9, 2001, 06:16   #6
Mercator
Scenario League / Civ2-Creation
Emperor
 
Mercator's Avatar
 
Local Time: 08:14
Local Date: October 31, 2010
Join Date: Dec 1969
Posts: 3,079
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.
Mercator is offline  
Old April 10, 2001, 07:21   #7
Gothmog
Scenario League / Civ2-Creation
Prince
 
Gothmog's Avatar
 
Local Time: 02:14
Local Date: October 31, 2010
Join Date: Dec 1969
Location: Minas Morgul
Posts: 421
Mercator,

That's it!

------------------
"There is no tiddle-taddle nor pibble-pabble in Pompey's camp."
Gothmog is offline  
Old April 10, 2001, 20:07   #8
Allard HS
Prince
 
Allard HS's Avatar
 
Local Time: 08:14
Local Date: October 31, 2010
Join Date: Dec 1969
Location: NL
Posts: 747
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..
Allard HS is offline  
Old April 10, 2001, 20:07   #9
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 00:14
Local Date: October 31, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
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.
techumseh is offline  
Old April 10, 2001, 20:14   #10
Allard HS
Prince
 
Allard HS's Avatar
 
Local Time: 08:14
Local Date: October 31, 2010
Join Date: Dec 1969
Location: NL
Posts: 747
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).]
Allard HS is offline  
Old April 10, 2001, 23:59   #11
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 00:14
Local Date: October 31, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
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?
techumseh is offline  
Old April 11, 2001, 19:15   #12
St Leo
Scenario League / Civ2-CreationApolytoners Hall of Fame
 
St Leo's Avatar
 
Local Time: 02:14
Local Date: October 31, 2010
Join Date: Jul 2005
Location: In search of pants
Posts: 5,085
Angello Scotto has written a memory-changing program for ToT.

------------------
Leons Petrazickis (St. Leo)
http://aventine.cf-developer.net/minizigg/
petrazi@sprint.ca
St Leo is offline  
Old April 11, 2001, 21:06   #13
Xin Yu
Apolytoners Hall of Fame
King
 
Xin Yu's Avatar
 
Local Time: 22:14
Local Date: October 30, 2010
Join Date: Dec 1969
Location: Emeryville, CA, USA
Posts: 1,658
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.
Xin Yu is offline  
Old April 12, 2001, 02:19   #14
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 00:14
Local Date: October 31, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
Was that an answer to St. Leos' question or mine?
techumseh is offline  
Old April 12, 2001, 06:14   #15
Mercator
Scenario League / Civ2-Creation
Emperor
 
Mercator's Avatar
 
Local Time: 08:14
Local Date: October 31, 2010
Join Date: Dec 1969
Posts: 3,079
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.
Mercator is offline  
Old April 12, 2001, 08:34   #16
Gothmog
Scenario League / Civ2-Creation
Prince
 
Gothmog's Avatar
 
Local Time: 02:14
Local Date: October 31, 2010
Join Date: Dec 1969
Location: Minas Morgul
Posts: 421
Techumseh,
I'm sorry, but I have to agree with Allard concerning the caravan thing. I wish it were true that you could set the commodity for caravans with events, but I don't see how hacking the saved game file could affect events. The save file is mere data, the civ2 executable is what interprets the event language (that's really what it is, a very limited programming language).

------------------
"There is no tiddle-taddle nor pibble-pabble in Pompey's camp."
Gothmog is offline  
Old April 21, 2001, 19:00   #17
Angelo Scotto
Scenario League / Civ2-Creation
Warlord
 
Local Time: 06:14
Local Date: October 31, 2010
Join Date: Oct 1999
Location: Milan, Italy
Posts: 127
Techumseh, Gothmog and Allard are right, these things are not possible... in classic Civ2.
But we were talking about Tot, right? well, then i'm happy to say you should be able to realize your event using CSPL (and BTW this is a VALID
reason to buy Tot instead of MGE but this is an old querelle...).
I would like to realize your event if you want, just send me an e-mail explaining exactly the kind of event you want to realize
(what causes those caravans to be created? and things like that).

Greetings,
Angelo
Angelo Scotto is offline  
Old April 22, 2001, 04:44   #18
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 00:14
Local Date: October 31, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
Woo Hoo! Angelo never ceases to amaze! Will do.
techumseh is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 02:14.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team