The Warlords II Players' Encyclopedia -   Info, Tactics | FAQ | Demos, Patches | Scenarios | Army Sets (+) | Scenario Editing | WarBOT | Tournament | League | Remailer | Other Sites - This page last revised 27-Apr-02 by Bob Heeter


Ruin Contents Editing Tricks

For more information, email Ivan Baird (ijb@nbnet.nb.ca) (Mac) Barry Brook (bbrook@rna.bio.mq.edu.au) (PC-Deluxe) or Pat Domning (pdomning@bigfoot.com) (PC-Classic). Sorry this is not more organized, but if people are interested enough to ask, I will sort it out better. (I've done the editing too.) -- Bob
Mac Information First:

Editing Tricks to customize scenarios / games:

(0) Editing gold within the gamefile:


(1) Making the scenario unique:

Open a copy of the scenario with ResEdit, and customize
the following resources:
	NAME (both the name resource and the name of the name resource,
		which you can change via Get Info!)
	SCEN (you can fix the text in the various places)
	
It's strongly recommended that you not change the *length* of the name,
as there are many byte-headers that indicate the length which also
need to be changed in that case.


(2) Editing Player Starting Gold:

[ Max gold for one side is at least 16309 in Classic. ]

(Notes from Matt Hills)
>  I poked around the SCENARIO file last night and confirmed what I
>suspected might have been going on -- the @#! SSG folks encoded
>the data with  low-byte first.  (the mac usually has high-byte first,
>so they must have done something weird to aim for more similarity to
>the DOS scheme)
>
>  Anyways, I haven't gotten around to fixing WarCart yet, and I
>need to find out where else this is a factor.  You can edit it by
>hand in the SCENARIO file, if you want:
>
>  Open the scenario file with ResEdit, and open the 'SCN ' resource.
>  The side information begins at address 0x000182
>  Each side has a record of 20 bytes.
>  The first 2 bytes, I believe, encode the side # (0 .. 7)
>  The next byte should be 00 <== I was using this byte as the high byte
>                                 for gold, before
>  The 4th byte is the low byte of the starting gold
>      (set it to 0x0..ff to correspond to 0..255)
>  The 5th byte is the high byte of the starting gold
>      (set it to 0x1..7f to correspond to 256..32576 + low_byte)
>
>Let me know if you need any help in this (in case you aren't familiar
>with hex, ResEdit, etc...)


(3) Editing the Ruin Contents:

Open the saved game file with HexEdit (NOT ResEdit, you need the data fork).
Around 0x000330 you should start to see (slightly garbled) the names of all
the ruins.  Before the names are the ruin map coordinates and after the
names are the codes for the ruin contents.  I've dissected most of the format:

Ruin Data Format:

the hex data for each ruin looks like this:

00 xx 00 yy Name-of-Ruin Fn 00 rs ct it ut ?? ?????? FF

Where:
xx = x coordinate of ruin on map
yy = y coordinate of ruin on map
Name-of-Ruin = variable # of characters for ruin name, with gibberish
Fn = some high hex number (1st char F, 2nd some number n, where n+3 =
         total characters in name-of-ruin).
rs = code for ruin or stronghold.
          Ruins have rs = 02 or 03 (02 can't ever be strongholds, and 03 can?)
          Strongholds 0E,0D,15,17, etc.; (maybe keyed to sage assignments?)

****NOTE: There can be technical problems if you change a 02 ruin to a
	  stronghold, because the nature of the rest of the ruin data
	  depends on the 02/03 code.  See below for details...

ct = content type.  (KEY!)
          02 = item,
          03 = sage,
          04 = gold, and
          05 = allies.

it = item code  (KEY!)
          00 = no item
	  08,09,0A,...0F,10,...,15 = item codes (in hex)
	  To determine the item code for a particular item,
		scan down below the ruin data in the game file.
	    	There's a list of items (Knight Standard, ..., etc.).
		The items are listed *in numerical order*, so just
		count down to the item you want (starting with 00 for
		the Knight Standard, so the Evil Standard is 07,
		and then the rest of the items start at 08)

ut = type of unit;  (KEY!)
          This code specifies either the defender encountered
               01=troll,
               02=giant,
               03=wolf,
               04=goblin,
               05=dragon,
               06=demon,
               07=devil,
               08=wizard, and
               09=ghost

          or the ally found (using the ally's picture code from army set)
          For army sets based on the default army pictures, these are:
		        17 = Wizards            14 = Giant Worms
		        18 = Ghosts             1A = Demons
		        16 = Elementals         1B = Devils
		        13 = Archons            19 = Dragons

?? = some invariant hex code that doesn't change from game to game,
      but isn't exactly unique to the ruin either.  Disappears if rs=02.

?????? = 3 hex codes of unknown meaning
         If rs=02 or 03, have something high-hex, 00, some low-hex.
         If stronghold, goes 00, 01, 00.
         These codes do not change from one game to another using
            a fixed scenario, except insofar as the location flips
            from ruin to stronghold; and even then the initial
            high-hex spot stays the same (for rs = 3 ruins).

FF = end code.


**** Note on converting ruin types
	(1) You can't make extra temples this way.
	(2) You can't switch rs=02 and rs=03 ruins around except by
		moving them around in the scenario.
	(3) Try to avoid converting strongholds into ruins.  If you
		do need to do this, you have to create a *new* game
		where that place *is* a ruin, and extract the ??
		and ?????? codes for that ruin.  Use whatever rs code
		you get in that game file.  If rs = 02, you have to delete the
		00 ?? code from the stronghold.  That shortens the game
		data, which means somewhere else you have to find an rs=02
		ruin and convert it to a stronghold (which adds a 00 back)
		in order to keep the size of the ruin data constant.
	(4) To convert an rs=03 ruin into a stronghold, simply
		change rs to 0E (etc.) and ?????? to 00 01 00.
		You *must* look up what the stronghold code (0E, etc) is
		from a saved game where that ruin is a stronghold.
	(5) Try not to convert rs=02 ruins into strongholds.  If you
		do need to do this, you have to add a "00" for the ?? code
		which the stronghold has but the ruin doesn't, you have to
		change the ?????? code to 00 01 00, and (as with rs=03 ruins)
		you have to get the rs code for the stronghold from another 
		incarnation of the game where that site *is* a stronghold.  
		But *then* you have to find *another* stronghold with a 00 
		for the ?? code and convert that to an rs=02 ruin, in order 
		to keep the size of the ruin data constant.   
		
**** Game File note:
	If you have trouble opening the saved-game file after making a change,
	(typically an out-of-memory error at around 70% loaded), you goofed
	something up.  Back up to the last working copy and try again, perhaps
	being more careful to follow the rules!  The best (but most tedious)
	way to do it is to make incremental changes, a few ruins at a time,
	and open the game file up after each change to see if it still works.

	Also, it's often difficult to open a newly-edited saved-game file from
another machine.  Before sending the game file to anyone else it's best
to open it and re-save it on your own machine.  That usually fixes the
problem.



PC-Deluxe Information:

X-Sender: bbrook@rna.bio.mq.edu.au
Date: Mon, 19 Jan 1998 16:34:45
To: , rfheeter@phoenix.princeton.edu, Bob.Heeter
From: "Barry W. Brook" 
Subject: Hex editing the ruins / items
Mime-Version: 1.0

Hi Ivan, Bob -

>If you get a chance Barry, can you write me up a brief description?
>I'm not sure whether the differences in a Mac or PC game file will make
>any difference - but I was informed at one point that changing ruins
>and strongholds can be a problem (strongholds had an extra byte or two,
>if I remember correctly....)

In the PC version at least, strongholds and ruins contain the same number
of bytes, A
single hex byte specifies whether it is a ruin or stronghold. 
The hex data for each "ruin" looks like this:

00 xx 00 yy Name-of-Ruin+blank filler "00" then rs ct it ut 00 00 FF 
(this may be in a different order in the Mac).

xx = x coordinate of ruin on map
yy = y coordinate of ruin on map

rs = code for ruin or stronghold. Ruins have an rs of 02, strongholds can
be lots of 
different values (maybe keyed to sage assignments?)

The rest you must already know. However, as I just discovered the, end "00
00 FF" is
missing in "invisible" strongholds. So, with quests on, when you change a
stronghold to
a ruin, you must ensure that the "00 00 FF" is there, or their descriptions
will remain
invisible...

For editing items: make sure you keep the string lenghts the same. 
20 bytes are allowed for the name. On the 21st byte after the name begins,
the hex
looks like this: 
Flight items: 05 00 00 00 00 00 00 00 00
Other items: tp bn ?? no 00 00 00 00 00, where tp = item type (eg 02 for
command items),
bn = item bonus (eg. 01, 02), no = Item number in the list (for ruin
reference, so you
won't need to change this).

That's it! Any questions, just ask.

>> Thus the only really solution is for the gamefile
>>editors to edit the item list, but as I said, this will not be a problem as

>Cool - I'll just cheat and use cut and paste from the gamefile you send
>me! ;-)  In fact, I'll try a couple of gamefiles with the beta
>gamefiles for practice....

Lazy! ;)

Regards,
Bazz

Barry W. Brook
Key Centre for Biodiversity and Bioresources
School of Biological Sciences, Macquarie University
N.S.W. 2109 AUSTRALIA   Ph: +61 2 9850-9266



For PC-Classic:


X-Sender: patd@209.136.173.5
Date: Wed, 28 Jan 1998 10:07:23 -0600
To: "Robert F. Heeter" 
From: "Patrick W. Domning" 
Subject: Re: Hex editing the ruins / items
Mime-Version: 1.0

Hey Bob, this isn't right! Look at my changes...

In the PC version at least, strongholds and ruins contain the same number
of bytes, A single hex byte specifies whether it is a ruin or stronghold
The hex data for each "ruin" looks like this:

00 xx 00 yy Name-of-Ruin+blank filler "00" then rc it ut r/s 00 FF
>>
>>xx = x coordinate of ruin on map
>>yy = y coordinate of ruin on map
>>
rc = ruin contents where:
  	01 = nothing?
	02 = an item
	03 = sage
	04 = gold
	05 = allies

it = item number (type index)
   Each of the items has a different hex code. To work this out, 
   scroll down to the items list, and *count* from the first standard (ie.
   white standard is hex 00, first non-standard item is hex 08 etc.).

ut =  defender type (hex between 01 and 09) Defender list is located after 
   items.
   If rc=05 (Allies) ut=code for which ally. This code changes based on
   army set. For tournament army set use codes below.

r/s = ruin or stronghold.
    00 = ruin
    01 = stronghold (if stronghold and quests are on. Some may be hidden)

00 FF = ruin terminator sequence.



>>>Ally codes:
>>>Giant Worms = 14
>>>Elementals  = 16
>>>Demons  = 1A
>>>Dragons = 19
>>>Wizards = 17
>>>Archons = 13
>>>Devils  = 1B
>>>Ghosts  = 18
>>>

In my save file, I have editted the guardian names. Such that:
  Guardian Angel   - guards - Miraculous & Angel's Eyrie
  Chosen People    - guards - Moses' Tomb  &  The Lost Ark
  Hera's Maiden    - guards - Hermeshome  &  Vulcan's Forge
  Apollo's Guard   - guards - Apollonia
  Pharoah's Snake  - guards - Alexandria  &  Ra's Pyramid
  Genie            - guards - AeroSmithy
  Mad Scientist    - guards - Smithsonian and Physics Lab
  Politician       - guards - Pentagone  &  Fort Knox
  Hellhound        - guards - Satan's Den and Hades' Gate


At 07:54 PM 1/19/1998 +0000, you wrote:
>>X-Sender: bbrook@rna.bio.mq.edu.au
>>Date: Mon, 19 Jan 1998 16:34:45
>>To: , rfheeter@phoenix.princeton.edu, Bob.Heeter
>>From: "Barry W. Brook" 
>>Subject: Hex editing the ruins / items
>>Mime-Version: 1.0
>>
>>Hi Ivan, Bob -
>>
>>>If you get a chance Barry, can you write me up a brief description?
>>>I'm not sure whether the differences in a Mac or PC game file will make
>>>any difference - but I was informed at one point that changing ruins
>>>and strongholds can be a problem (strongholds had an extra byte or two,
>>>if I remember correctly....)
>>
>>In the PC version at least, strongholds and ruins contain the same number
>>of bytes, A
>>single hex byte specifies whether it is a ruin or stronghold.
>>The hex data for each "ruin" looks like this:
>>
>>00 xx 00 yy Name-of-Ruin+blank filler "00" then rs ct it ut 00 00 FF
>>(this may be in a different order in the Mac).
>>
>>xx = x coordinate of ruin on map
>>yy = y coordinate of ruin on map
>>
>>rs = code for ruin or stronghold. Ruins have an rs of 02, strongholds can
>>be lots of
>>different values (maybe keyed to sage assignments?)
>>
>>The rest you must already know. However, as I just discovered the, end "00
>>00 FF" is
>>missing in "invisible" strongholds. So, with quests on, when you change a
>>stronghold to
>>a ruin, you must ensure that the "00 00 FF" is there, or their descriptions
>>will remain
>>invisible...
>>
>>For editing items: make sure you keep the string lenghts the same.

Make sure you terminate your names with a Null <00> character.

>>20 bytes are allowed for the name. On the 21st byte after the name begins,
>>the hex
>>looks like this:
>>Flight items: 05 00 00 00 00 00 00 00 00
>>Other items: tp bn ?? no 00 00 00 00 00, where tp = item type (eg 02 for
>>command items),
>>bn = item bonus (eg. 01, 02), no = Item number in the list (for ruin
>>reference, so you
>>won't need to change this).
>>
>>That's it! Any questions, just ask.
>>
>>>> Thus the only really solution is for the gamefile
>>>>editors to edit the item list, but as I said, this will not be a
problem as
>>
>>>Cool - I'll just cheat and use cut and paste from the gamefile you send
>>>me! ;-)  In fact, I'll try a couple of gamefiles with the beta
>>>gamefiles for practice....
>>
>>Lazy! ;)
>>
>>Regards,
>>Bazz
>>
>>Barry W. Brook
>>Key Centre for Biodiversity and Bioresources
>>School of Biological Sciences, Macquarie University
>>N.S.W. 2109 AUSTRALIA   Ph: +61 2 9850-9266
>>
>
>** Robert F. Heeter (Bob) | Email: rheeter@pppl.gov / rheeter@jet.uk **
>** PPPL/JET Collaboration | Phone: 609-243-2856  (PPPL Office S222)  **
>** Fusion Energy Researcher, Princeton Plasma Physics Laboratory     **
>** http://FusEdWeb.pppl.gov       http://www.princeton.edu/~rfheeter **
>
>


Google Search in heeter.net (including all Warlords sites):

Back to the W2 Players' Encyclopedia

For bug reports, questions, comments, suggestions, etc, my email address is:

Legal and Historical Disclaimers:

This site began in 1994 as Eugene Lee's Warlords II Home Page in Australia. It has evolved steadily since then, and now includes material by a variety of authors, including Bob Heeter, Eugene Lee, Elam Birnbaum, Glen Barnett, Dirk Pellett, Vern Vaillancourt, Gary Best, and others where indicated. A number of graphics are copyright by SSG; copyright and other rights to the Web source are reserved by the appropriate authors. (This site is not the Official Warlords Site by SSG.)