Jump to content


Porting BoE Scenarios Problems


  • Please log in to reply
33 replies to this topic
Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 13 January 2013 - 10:22 PM #1 Porting BoE Scenarios Problems

Solving individual problems

Town 18 in Falling Stars, The Wizard's Bazaar, is full of doors. There are over a hundred of them, when ported each door will require a script of its own but a BoA town has a maximum of only one hundred possible scripts. Now some of these doors are Impassable, a door with no script attached in BoA is likewise impassible. As luck would have it, if you remove all impassable doors you need less than 100 scripts!
(1) In the Exs file, change all Basalt Impassable doors (terrain type 145) to some terrain type not found in town 18, an outdoor terrain is ideal. I chose type 234 as the replacement.
(2) Port the scenario as usual. Here type 234 gets translated as some BoA outdoor type 329.
(3) Edit the town and replace type 329 with type 12, closed door. Nearly all doors are properly translated by this. Without a script attached these doors are wholly impassable.
(4) If you need to open the impassable doors just replace type 12 with an open door type like type 16. This will be handled in the town script.
Another approach is a script that works for several doors at once. Door actually opened depends upon some numeric input or upon possession of a special item. It replaces the terrain type from a distance, so you won't need one script per door.

If you have creatures being assigned personality numbers from outside their own towns the set name part in creating BoA town scripts then becomes flawed. Currently you get stuff like:
set_name(18,"Paulop");
set_name(19,"10");
set_name(20,"10");
set_name(21,"11");
set_name(22,"12");
set_name(23,"142");
set_name(24,"113");
set_name(25,"114");
Fortunately you have the (Scenario Name) - BoE Town Personalities.txt, this lists all the personality names. Have a spreadsheet automate the process.

change
Personality 0 - Mackie
Personality 1 - Roland
Personality 2 - Soldier
Personality 3 - Soldier
Personality 4 - Darah
...........

to
Personality 0:Mackie
Personality 1:Roland
Personality 2:Soldier
Personality 3:Soldier
Personality 4:Darah
...............

Change each colon into a tab. Paste this into a spreadsheet. (Open Office, in the Calc program have the text separated by a colon, when the pasting dialog screen comes up.) Then use the Replace function to delete, (replace with nothing) "Personality ". This sets up the reference table for the VLookup function.

Now for the set name text.
     set_name(18,"Paulop");
     set_name(19,"10");
     set_name(20,"10");

Make sure the character names or numbers occur
in a column by themselves. There are many ways to do this, for instance, in Word change the quotes to tabs using the Replace function. Paste this into a spreadsheet. (Open Office, in the Calc program have the text separated by a quotation mark, when the pasting dialog screen comes up.)

I added a Personality page to the OGE Translations.xls spreadsheet in the Exs Decrypts upload to handle this.
http://www.freewebs....EXSDecrypts.zip

BainIhrno BainIhrno

Hand of Avadon

  • Moderator
    • Member ID: 3,311
  • 1,312 posts

Posted 13 January 2013 - 10:30 PM #2 Porting BoE Scenarios Problems

Another potential problem - apparently, outdoor sections can only have 7 town entrances (instead of 8), am I right? Probably a bug, because the editor says "eight". I've counted my town entrances in the section numerous times.

(If this is the case, it'll just be a matter of switching one "town" to a special encounter outdoors for OG&E).

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 14 January 2013 - 03:46 AM #3 Porting BoE Scenarios Problems

It is always eight per zone.
If you are referring to zone X=1,Y=1 then there is a problem with something at X=38,Y=0. The thing is the entrance for town 86, Nebulous Grotto, it is not ported.
Now is it listed in the Of Good And Evil - BoE Concise Outdoor Report.txt
   Town Entrance 7:  x = 38, y = 0, Town entered: 86
Maybe the Y=0 is the cause of the trouble? It is one of the hidden towns.

BainIhrno BainIhrno

Hand of Avadon

  • Moderator
    • Member ID: 3,311
  • 1,312 posts

Posted 14 January 2013 - 12:55 PM #4 Porting BoE Scenarios Problems

I was actually referring to X=1, Y=0. The towns I have set are:

t2 Caldiris
t5 Grand Temple
t6 Dark Cave
t8 Mountain Pass
t20 Checkpoint
t55 Hidden Grotto
t83 Thasmaskon

by my count that's seven, I can't place t82 Mountain Pass, but if there's no way to do it, I'll just make it an outdoor special encounter.

That being said, thanks for pointing out t86 Nebulous Grotto. When that town entrance was not translated, I had it set for t87 Chilly Cavern, which would have skipped a level of gameplay and would have been a mistake. Thank you.

Niemand Niemand

Hand of Avadon

  • Moderator
    • Member ID: 3,580
  • 2,138 posts
  • LocationWisconsin

Posted 14 January 2013 - 04:32 PM #5 Porting BoE Scenarios Problems

A BoA outdoor section is definitely capable of holding 8 town entrances, which appears to be the same as BoE. Entrances are only ported if both of their coordinates (in BoE) are greater than 0, and if the town to which they connect is non-negative. I'll see if I can take a look at this case later and tell what's going on.
Possibly you suppose that [he] is a harmless fellow, who with vacant mind recites some empty formula,
traces a wandering sign in the air, and with palsied hand shakes a wand the while he gibbers his insanity at the yawning moon.

BainIhrno BainIhrno

Hand of Avadon

  • Moderator
    • Member ID: 3,311
  • 1,312 posts

Posted 14 January 2013 - 07:20 PM #6 Porting BoE Scenarios Problems

I have identified the problem - there was an extra town entrance for t83 I didn't catch, probably because I had a large fortress drawn over it. So, sorry for the false alarm. Thanks everyone.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 15 January 2013 - 06:05 PM #7 Porting BoE Scenarios Problems

One key problem, in BoE exploration mode the party is always contained within the one square, whereas in BoA they are always spread out. Placed specials sometimes are found in this pattern:
AAA
ABA
AAA
A is a square with a placed special and B is a square without one. This problem is found right at the start of Of Good and Evil. Two solutions are:
(1) Move the placed special to a town or terrain script. Init state is a good place for this.
(2) Create a great big hollow rectangle surrounded by special #A. The special is found on every square on the outside edge of the rectangle and is not found inside it. Said rectangle must be large enough to hold the party so it will definitely walk through a placed special on its way out.


This is the place for Copy and Paste Terrain. When the porting happens, the terrain is messed up. I fix up the first version of this town, then I can fix up all the others. In a few minutes I was able to fix up all the versions of the Briefing Area.
Town scripts need to be checked when you fix up the terrain. It could be bad if terrain is altered on the wrong square, a square affected by a terrain alteration node.

Edited by Ishad Nha, 16 January 2013 - 04:14 PM.


Niemand Niemand

Hand of Avadon

  • Moderator
    • Member ID: 3,580
  • 2,138 posts
  • LocationWisconsin

Posted 16 January 2013 - 07:27 AM #8 Porting BoE Scenarios Problems

I would say that your option 1 is probably usually better if I understand the original purpose of this construction correctly, that is, to trigger the special more-or-less immediately, regardless of what the party does. This won't work, however, if one of the things you need it to do is to move the party to another town, as that is only allowed as a result of the party stepping into a special rectangle.

For option 2, I think it may be sufficient to surround the first member of the party (although I don't remember for certain whether special rectangles are triggered if a later party member is already inside and the party leader switches places with that character, that would have to be checked). This can still be a bit tricky, though, since you would need to deal with the party placement rules, which as I recall begin by placing the last party member and then laying out the rest where there is space.
Possibly you suppose that [he] is a harmless fellow, who with vacant mind recites some empty formula,
traces a wandering sign in the air, and with palsied hand shakes a wand the while he gibbers his insanity at the yawning moon.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 16 January 2013 - 04:02 PM #9 Porting BoE Scenarios Problems

Another example is in Calderwood:
SSS
GTG
GGG
S is the special, T is the Town Entrance and G is a grass square.
This is okay for BoE and not easy for BoA. People doing porting will need to be big-league experts on party placement in BoA towns.
Thank goodness it is not a problem in the outdoors.

Niemand Niemand

Hand of Avadon

  • Moderator
    • Member ID: 3,580
  • 2,138 posts
  • LocationWisconsin

Posted 16 January 2013 - 05:44 PM #10 Porting BoE Scenarios Problems

I don't quite see why this example is hard, unless space is very constrained; the 'S's are replaced by a single special rectangle, which is moved away from point T until the party is guaranteed not to cross it (4 spaces away for if there are no joinable NPCs in the scenario). This would only fail if for some reason there isn't enough room to move T and S apart.
Possibly you suppose that [he] is a harmless fellow, who with vacant mind recites some empty formula,
traces a wandering sign in the air, and with palsied hand shakes a wand the while he gibbers his insanity at the yawning moon.

Kelandon Kelandon

!!!

  • Global Moderator
    • Member ID: 2,682
  • 9,786 posts

Posted 16 January 2013 - 08:43 PM #11 Porting BoE Scenarios Problems

Basically, when porting from BoE, you just have to spread stuff out a bit. You can't put it in exactly the same square as before. As long as you're okay with that, there are no problems.
VCH: I believe we settled this way back when: Kelandon was the most attractive.
SoT: You'd be happy, too, if you were such a clever spider.
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 17 January 2013 - 02:25 AM #12 Porting BoE Scenarios Problems

It is hard because the party may be booted from the town by guards hence they can't come into the town too much.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 17 January 2013 - 08:00 PM #13 Porting BoE Scenarios Problems

From the source file Bl A Fileio.c:
Boolean is_old_wall(short ter)
{
short i;
    if ((ter >= 5) && (ter <= 35))       return TRUE;
if ((ter >= 122) && (ter <= 169))       return TRUE;
return FALSE;
}
This is okay for a scenario where the terrain has not been customized that much.

Of Good and Evil:
Terrain type 162 is a Throne, as far as I know it only occurs twice, once each in towns 61 and 84. (I checked the towns with Zoom Editor.) On both occasions it was correctly translated as a BoA Throne, terrain type 278. As an experiment I altered Of Good and Evil to create a rectangle of BoE terrain type 162, this was placed in town 0, Northern Outpost:
TTT
TGT
TTT
T is terrain type 162, G is terrain type 2. What was ended up in BoA was:
278,028,028
029,000,029
029,028,008
In default BoE, type 162 is an adobe Closed Portcullis
Non-wall Terrain occurring in the terrain zone can be handled by alteration of the Boolean is_old_wall(short ter) function in the editor. You need a version of the editor source code that will actually produce an editor that ports.

Types 223 thru 228 are walls. I suspect they only occur in the Checkpoint towns.
I just altered the translation arrays to have them replaced by type 2. They can be manually altered in the editing of the towns.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 17 January 2013 - 11:42 PM #14 Porting BoE Scenarios Problems

Here is a draft that uses Blazing Blades graphics whenever possible:
http://www.freewebs....ha/GoodEvil.zip
Most of the towns are still not done.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 18 January 2013 - 10:56 PM #15 Porting BoE Scenarios Problems

The set_name problem comes from creatures in a town frequently using personality names from other towns at will.
Only ten of those names will be found in the current town. I found a solution by using the file Of Good And Evil - BoE Town Personalities.txt to create an array of personality names:
char *old_blades_personality_names[1000] = {
"Mackie","Roland","Soldier","Soldier","Darah","Gerald","Nicias the Other","Nicias the Other","Unused","Unused",
(98 other similar lines...)
"Archer","Soldier","Cook","Soldier","Pancho","Unused","Unused","Unused","Unused","Unused",
};

This was compiled into the Editor, then accessed by an alteration to
void port_town_script(char *script_name,char *directory_id,short which_town)
Alteration is:
   for (short i = 0; i < 60; i++) {
if ((boe_big_town.creatures[i].personality >= 0) && (boe_big_town.creatures[i].number > 0)) {
sprintf(str,"\t set_name(%d,\"%s\");", i + 6,
old_blades_personality_names[boe_big_town.creatures[i].personality]);
add_string(file_id,str);
}
}

I am checking the scripts to make sure there are no errors, so far so good.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 19 January 2013 - 06:23 AM #16 Porting BoE Scenarios Problems

Terrain types 6:21 and 24:35 are directional, like BoA walls and unlike the default BoE walls in slots 122:169. Conventional wall conversion routine is meant for non-directional walls, hence it is not really suitable for Cave Walls and Moutains.* Hence the porting leads to nasty messes.
Boolean is_old_wall(short ter) got altered to:
{
if ((ter >= 122) && (ter <= 161)) return TRUE;
if ((ter >= 164) && (ter <= 169)) return TRUE;
if ((ter >= 223) && (ter <= 228)) return TRUE;
return FALSE;
}

*They can use a straight one-to-one translation from BoE to BoA terrain.

nikki. nikki.

Humany-Wumany

  • Global Moderator
    • Member ID: 2,313
  • 7,445 posts

Posted 19 January 2013 - 11:25 AM #17 Porting BoE Scenarios Problems

Ishad, could you make more of an effort to edit posts when adding information to this thread and you're the last poster? I realise that you are adding new stuff, but 5 consecutive posts is a bit much. Ta.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 21 January 2013 - 12:00 AM #18 Porting BoE Scenarios Problems

Two approaches to translating the mountains terrain sequence, types 22 thru 35.
(1) Use hills graphic tehlmnt.png for the terrain, suppress the floor for types 24:35. For types 22,23 you can use the first two graphics from the floor graphic flboemnt.png. (These two are Blazing Blades graphics which are easily converted to Bitmap format.)
(2) Use conventional BoA wall types, this is the current practice. There is no good wallset to match the floor graphics of flboemnt.png.

Special node 4: Secret Passage, in theory the author could have used dozens of terrain types with this node. In practice, this seems to be only used with a few types of terrain. Examples include 71: water, 112: tree, 191: bookcase.
I checked for this with the Find in Files function of Crimson Editor, I searched for the string 'OBSOLETE NODE: Secret door special encounters '...Isaac/Notus original 3D Editor can be used for porting, you need to fix a few bugs first.Alternately disable the porting of BoE nodes or the creation of dialog scripts, one or both of these things is what actually causes the crashes.Scripts have already been done with my own Variant 3D Editor. This leaves more tricky stuff like terrain. So I created my own version of the original editor. I can alter the porting process to reflect the individual nature of Of Good and Evil. Here I have decreed that certain squares will start with a height of 10 rather than the usual 9. Said squares have mountain floor types, 194 or 195 in my version of the scenario.
 for (i = 0; i < 48; i++)
for (j = 0; j < 48; j++) {
current_terrain.floor[i][j] = (unsigned char)old_ter_to_floor[boe_outdoor.terrain[i][j]];
current_terrain.terrain[i][j] = old_ter_to_ter[boe_outdoor.terrain[i][j]];
if ((current_terrain.floor[i][j] == 194) || (current_terrain.floor[i][j] == 195))
current_terrain.height[i][j] = 10;
else
current_terrain.height[i][j] = 9;
}
For towns it would look like this:
 for (i = 0; i < town_size; i++)
for (j = 0; j < town_size; j++)
if ((t_d.floor[i][j] == 194) || (t_d.floor[i][j] == 195))
t_d.height[i][j] = 16;
else
t_d.height[i][j] = 15;

I am also making town is on surface into a function of town lighting, cause lighting is affected by the on surface variable.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 22 January 2013 - 11:49 PM #19 Porting BoE Scenarios Problems

All terrain is ported as type 1 walls, never type 2. You can alter the code to always port a wall type (Stone, Basalt, Adobe) as type 2, that is easy to do.
With three basic wall types in BoE and only two types being allowed in any given BoA town, you may need to occasionally convert one wall type to another. For example Molidax uses all three BoE wall types, you could change the Basalt to Stone.

Porting roads, a binary approach:
X1X
8A2
X4X
A is square [i][j], it is a road-type BoE terrain. 1,2,4,8 are roads that may or may not occur next to square A. (Ignore the Xs, they are substitutes for tab stops.) Here a road is present or it is not, this leaves 2^4 =16 possible arrangements.
Conventional porting process does not cater for five of the sixteen cases:
(0) No roads adjoin square A
(1) Only one road adjoins, one to the North.
(2) Only one road adjoins, one to the East.
(4) Only one road adjoins, one to the South.
(8) Only one road adjoins, one to the West.
I have altered the code to allow for all five cases.

How to get a road to curve around to meet a town, for example the road that curves around from the south to meet the Northern Outpost.(1) Include all town entrance terrain types in the function:Boolean is_old_wall(short ter)(2) In the function void port_boe_out_data() change: if ((is_old_road(i,j)) && (boe_outdoor.terrain[i][j] > 70)) {
to something that excludes anything that is not a real road:
if ((is_old_road(i,j)) && (boe_outdoor.terrain[i][j] > 78) && (boe_outdoor.terrain[i][j] < 82)) {
This is the procedure used to avoid bridges being turned into roads, even though bridges are classified as roads during the creation of roads. (That way roads come up to meet bridges.)  
Next, roads on edge of outdoor zones. This won't be perfect as the Editor reads only one old outdoor zone at a time. I am still working on this.

Edit:
Tracking where unusual terrain types occur, types 106, 107 and 223 to 228:
change editor icon to a solid red square, this will show immediately in the editor.
Types 106, 107 are damaged walls found in:
35 Caldiris, 44 Evergreen, 45 Old Hut, 66 Refugee Camp, 69 Evergreen, 84 The Tower of Heraclitus, 91 Molidax, 92 Molidax

Types 223 thru 228 are walls, found in:
15 Forgotten Laboratory, 40 Slith Fort, 20 Checkpoint, 27 Checkpoint, 39 Checkpoint, 81 Checkpoint, 99 Checkpoint

I uploaded a new copy of the scenario, it features a lot of the Blazing Blades graphics. It is about half done. Have not gotten around to translating monsters or items.
http://www.freewebs....ha/GoodEvil.zip

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 25 January 2013 - 07:03 AM #20 Porting BoE Scenarios Problems

Using the information in class item_record_type {}, it is possible to create a BoE-style array of data about the items in a scenario. This will be the uncompressed printout of the information from the Scenario Data file. I will use that to check that I got the Special Classes right.

Terrain type 220 calls a local special, special #4, but uses the same graphic as the routine type 113, which has no special abilities at all. It is impossible to tell one terrain type apart from the other. My solution is to port 220 as a BoA terrain type of its own, number 510. This has a distinctive editor icon bearing the number of the special: 4. This way you know where the type 220 occurs and you know what special it should call.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 30 January 2013 - 10:53 PM #21 Porting BoE Scenarios Problems

I drew up a function to print out the list of timers and nodes calling timers. Here is the printout for Of Good and Evil.
Town,   6,   Node,   1,   Scen Timer,   Number of moves...,   15,   Scen Special,   0
Scen,   ,   Node: ,   20,   Scen Timer,   Number of moves...,   2200,   Scen Special,   21
Town,   12,   Node,   1,   Scen Timer,   Number of moves...,   800,   Scen Special,   32
Town,   28,   Node,   1,   Scen Timer,   Number of moves...,   7800,   Scen Special,   32
Town,   29,   Node,   1,   Scen Timer,   Number of moves...,   2300,   Scen Special,   32
Town,   32,   Node,   1,   Scen Timer,   Number of moves...,   800,   Scen Special,   32
Town,   78,   Node,   1,   Scen Timer,   Number of moves...,   800,   Scen Special,   32
Town,   96,   Node,   1,   Scen Timer,   Number of moves...,   800,   Scen Special,   32
Town,   97,   Node,   1,   Scen Timer,   Number of moves...,   800,   Scen Special,   32
Scen,   ,   Node: ,   33,   Scen Timer,   Number of moves...,   900,   Scen Special,   34
Town,   30,   Node,   25,   Scen Timer,   Number of moves...,   15,   Scen Special,   37
Town,   46,   Node,   18,   Scen Timer,   Number of moves...,   2200,   Scen Special,   61
Town,   81,   Node,   11,   Scen Timer,   Number of moves...,   155,   Scen Special,   71
Town,   99,   Node,   11,   Scen Timer,   Number of moves...,   155,   Scen Special,   71
Town,   42,   Node,   19,   Scen Timer,   Number of moves...,   11,   Scen Special,   73
Town,   67,   Node,   0,   Scen Timer,   Number of moves...,   1200,   Scen Special,   89
Outdoor,   2,   Node,   1,   Scen Timer,   Number of moves...,   3000,   Scen Special,   95

Town,   8,   Node,   15,   Town Timer,   Number of moves...,   2,   Town Special,   14
Town,   9,   Node,   41,   Town Timer,   Number of moves...,   5,   Town Special,   7
Town,   9,   Node,   5,   Town Timer,   Number of moves...,   9,   Town Special,   8
Town,   10,   Node,   15,   Town Timer,   Number of moves...,   2,   Town Special,   14
Town,   40,   Node,   19,   Town Timer,   Number of moves...,   8,   Town Special,   20
Town,   40,   Node,   21,   Town Timer,   Number of moves...,   3,   Town Special,   22
Town,   40,   Node,   28,   Town Timer,   Number of moves...,   5,   Town Special,   29
Town,   44,   Node,   13,   Town Timer,   Number of moves...,   3,   Town Special,   14
Town,   48,   Timer,   0,   Town Timer,   Number of Moves,   5,   Town Special,   10
Town,   48,   Timer,   1,   Town Timer,   Number of Moves,   3,   Town Special,   27
Town,   56,   Node,   0,   Town Timer,   Number of moves...,   2,   Town Special,   1
Town,   56,   Node,   22,   Town Timer,   Number of moves...,   4,   Town Special,   12
Town,   59,   Node,   2,   Town Timer,   Number of moves...,   2,   Town Special,   3
Town,   60,   Node,   8,   Town Timer,   Number of moves...,   3,   Town Special,   9
Town,   60,   Node,   15,   Town Timer,   Number of moves...,   6,   Town Special,   16
Town,   61,   Node,   1,   Town Timer,   Number of moves...,   15,   Town Special,   2
Town,   61,   Node,   14,   Town Timer,   Number of moves...,   2,   Town Special,   13
Town,   63,   Node,   1,   Town Timer,   Number of moves...,   17,   Town Special,   2
Town,   66,   Node,   4,   Town Timer,   Number of moves...,   17,   Town Special,   5
Town,   74,   Timer,   0,   Town Timer,   Number of Moves,   55,   Town Special,   2
Town,   82,   Node,   8,   Town Timer,   Number of moves...,   2,   Town Special,   0
Town,   91,   Node,   22,   Town Timer,   Number of moves...,   8,   Town Special,   24
Timers are a problem in porting cause they have no exact BoA equivalent. Each timer means a separate decrement of an SDF.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 03 February 2013 - 11:26 PM #22 Porting BoE Scenarios Problems

I count around 36 shops. There are around 128 shopping nodes that need to be covered in the scenario script but most of them are duplicates.
In all of these nodes, Extra A is unused or deals with the price adjustment. The latter is handled in the dialog scripts anyway. Ditto, selling is handled in the dialog scripts too. Hence there is no need to have separate shops for those cases.
It might be possible to create a function to automate the creation of the add_item_to_shop entries.

Today I altered the Scenario Shopping Text Dump file to print a data array at the end.
Town #:Town Name:Node:Person:Person#:Type:Extra A:Extra B:Extra C
0:Northern Outpost:2:Roland:1:7:3:383:6
0:Northern Outpost:26:Roland:1:7:1:350:1
0:Northern Outpost:30:Roland:1:7:6:242:1
1:Genmar:11:Charles:17:7:3:172:3
13:Genmar:13:The Rusty Cobbler:138:7:2:1:3
17:Molidax:1:Donna:170:7:4:253:6
24:Under Evergreen:7:Ratmaster:240:23:6:3:0
37:Genmar:13:Billington:378:7:3:1:3
41:Slith Tunnels:1:Katherine:410:7:4:253:10
48:Dark Tunnels:18:Phokmog:484:23:6:2:0
49:Garlvavish:19:Cadfogmok:498:7:6:3:1
49:Garlvavish:26:Critias:499:9:5:1:9
52:Molidax:20:Edgar:524:7:5:382:7
53:Genmar:16:Gerald:379:7:5:51:13
53:Genmar:15:Gerald:379:7:5:389:9
67:Goblin Grotto:2:Brita:670:7:2:51:13
67:Goblin Grotto:9:Brita:670:7:2:196:9
67:Goblin Grotto:3:Brita:670:7:2:389:9
67:Goblin Grotto:10:Brita:670:7:2:260:6
67:Goblin Grotto:12:Brita:670:7:2:383:6
67:Goblin Grotto:4:Brita:670:9:2:0:10
67:Goblin Grotto:5:Brita:670:10:2:0:10
71:Genmar:9:Laurine:135:7:2:98:22
83:Thasmaskon:5:Sovash-Thinox:835:9:6:0:8
83:Thasmaskon:12:Revistra:836:10:6:9:7
89:Genmar:2:Catherine:892:7:4:383:6
89:Genmar:10:Maxine:896:7:5:4:5
91:Molidax:11:Renalda:173:11:3:0:6
91:Molidax:25:Alford:176:9:4:6:3
91:Molidax:34:Chaerephon:178:9:5:12:6
92:Molidax:33:Chaerephon:188:7:3:196:8
92:Molidax:9:Protagoras:922:9:4:14:9
92:Molidax:20:Mackie:924:7:5:382:7
93:Evergreen:17:Jenny:224:7:3:1:3
94:Caldiris:29:Ralka:945:10:2:16:4
95:Faerie Temple:5:Daynlae:791:10:6:0:6

Celtic Minstrel Celtic Minstrel

Eye of Avadon

  • Global Moderator
    • Member ID: 5,296
  • 3,868 posts

Posted 04 February 2013 - 05:37 PM #23 Porting BoE Scenarios Problems

View PostIshad Nha, on 22 January 2013 - 11:49 PM, said:

With three basic wall types in BoE and only two types being allowed in any given BoA town, you may need to occasionally convert one wall type to another. For example Molidax uses all three BoE wall types, you could change the Basalt to Stone.
Or if you have sufficient empty terrain slots, you could define a third wall type that's fixed. I suspect it wouldn't work quite as well, since corners probably wouldn't be filled in automatically, but I'm sure it could be made to work.
Exile 2 Book of Items (I didn't create it, I just converted it to HTML.)

"Man, I know how you feel. I once spent an hour playing WordPad before realising that it was a text editor." – Thuryl

"Dikiyoba just hopes no one ever blows up Saturn. Getting those rings back into their proper position would take hours."

"—Alorael, who spells phoenetically. No matter how much his orthography is a wreck, intelligibility rises from the ashes."

"I've never played a Spiderweb game. I didn't even know SW made games until I saw this thread." —Nikki

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 04 February 2013 - 10:33 PM #24 Porting BoE Scenarios Problems

None too pretty I am sure. It would be okay if you could hide it in a corner someplace...

Celtic Minstrel Celtic Minstrel

Eye of Avadon

  • Global Moderator
    • Member ID: 5,296
  • 3,868 posts

Posted 05 February 2013 - 06:45 AM #25 Porting BoE Scenarios Problems

I think it would look fine as long as you avoid layouts where corner-filling would be necessary. If you absolutely coudln't avoid such layouts though, there'd always be the option to manually fill the corners with additional terrain types.
Exile 2 Book of Items (I didn't create it, I just converted it to HTML.)

"Man, I know how you feel. I once spent an hour playing WordPad before realising that it was a text editor." – Thuryl

"Dikiyoba just hopes no one ever blows up Saturn. Getting those rings back into their proper position would take hours."

"—Alorael, who spells phoenetically. No matter how much his orthography is a wreck, intelligibility rises from the ashes."

"I've never played a Spiderweb game. I didn't even know SW made games until I saw this thread." —Nikki

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 05 February 2013 - 03:51 PM #26 Porting BoE Scenarios Problems

If it worked, one wall set would always be ported as independent varieties of terrain not as a wall set. Simply borrow the code from the type 1 wall set in Corescendata2.txt file.
It is possible to rewrite the code so that one wallset (say Stone) is always ported as type 1, another (say Basalt) is always ported as type 2 and the third (say Adobe) is ported as straight terrain.
I will have to check how it looks in practice, a bit of the wall display is hard coded.

Edit:
Arranging the code is easy enough, just copy, paste and renumber the code for terrain types 2 through 37. Then insert code for new graphics sheets in the first wall record and then whenever you find an import =
Basic layouts, all walls joining, look okay. I will need to check what works and what does not. This approach requires 36 terrain slots, which need not be in one sequence.
I created my own version of G690.bmp for the adobe walls. The "SD" secret door little icon won't show up, maybe I can add that directly to my version of G690.bmp, secret doors have their own editor icon after all.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 08 February 2013 - 03:25 AM #27 Porting BoE Scenarios Problems

Most varities of BoE terrain properties have their own little icon. One notable exception is variety 12: Call Local Special. It would be useful if this property had its own icon because you can see where it occurs in a town map. There is an empty place to the right of the S and C little icons in EdBtns.bmp. I created an icon of horizontal red and aqua lines.

This is easy enough to program, in the source file Graphics.cpp:
void set_up_terrain_buttons()
...
if ((small_i == 31) && (scenario.ter_types[i].flag2 == 10))
small_i = 32;
(my code inserted here)
if (i == 82)
small_i = 3;
my code was:
if (scenario.ter_types[i].special == 12)
small_i = 25;

void draw_terrain()
...
if ((small_i == 31) && (scenario.ter_types[t_to_draw].flag2 == 10))
small_i = 32;
(my code inserted here)
tiny_from = base_small_button_from;
OffsetRect(&tiny_from,7 * (small_i % 10),7 * (small_i / 10));

my code was:
if (scenario.ter_types[t_to_draw].special == 12)
small_i = 25;

Property 12 is not easy to translate into BoA terms, you can make it a scenario state if you have the state to spare.

Celtic Minstrel Celtic Minstrel

Eye of Avadon

  • Global Moderator
    • Member ID: 5,296
  • 3,868 posts

Posted 08 February 2013 - 10:32 AM #28 Porting BoE Scenarios Problems

View PostIshad Nha, on 08 February 2013 - 03:25 AM, said:

        
Property 12 is not easy to translate into BoA terms, you can make it a scenario state if you have the state to spare.
Actually, I think the best translation would usually be to make it a terrain script, though there may be cases when this won't work well. Sometimes you might just have to use special encounter rectangles. (This applies to "Call Global Special" as well.)
Exile 2 Book of Items (I didn't create it, I just converted it to HTML.)

"Man, I know how you feel. I once spent an hour playing WordPad before realising that it was a text editor." – Thuryl

"Dikiyoba just hopes no one ever blows up Saturn. Getting those rings back into their proper position would take hours."

"—Alorael, who spells phoenetically. No matter how much his orthography is a wreck, intelligibility rises from the ashes."

"I've never played a Spiderweb game. I didn't even know SW made games until I saw this thread." —Nikki

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 08 February 2013 - 04:43 PM #29 Porting BoE Scenarios Problems

Sometimes there are hundreds of instances of these types of terrain in the one town!
In which case go for a lot of small rectangles for placed specials or a script. That is assuming that you have scripts to spare. In BoE you can have as many doors in a town as you like.
Of Good and Evil only has 2 of the type 12 terrains but other scenarios have a lot more and used more often, Shadow of the Stranger comes to mind.

Celtic Minstrel Celtic Minstrel

Eye of Avadon

  • Global Moderator
    • Member ID: 5,296
  • 3,868 posts

Posted 09 February 2013 - 06:50 PM #30 Porting BoE Scenarios Problems

It does depend on how the terrain was used, yeah. For example, if it tended to be used in clumps, then changing it to a special encounter rectangle would probably be best.
Exile 2 Book of Items (I didn't create it, I just converted it to HTML.)

"Man, I know how you feel. I once spent an hour playing WordPad before realising that it was a text editor." – Thuryl

"Dikiyoba just hopes no one ever blows up Saturn. Getting those rings back into their proper position would take hours."

"—Alorael, who spells phoenetically. No matter how much his orthography is a wreck, intelligibility rises from the ashes."

"I've never played a Spiderweb game. I didn't even know SW made games until I saw this thread." —Nikki

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 12 February 2013 - 06:31 AM #31 Porting BoE Scenarios Problems

Occasionally the editor just crashes to desktop when porting. Halfway through Shadow of the Stranger is one example. I don't know what is happening or why. You have nested For functions, this makes it hard to keep track of exactly what is happening. Porting process is fairly quick.
What I am doing is creating a ported node script function inside the BoE Editor, this may make it all easier to follow. It will only port nodes for the current town, this may make it easy to spot shere crashes are happening.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 26 February 2013 - 11:36 PM #32 Porting BoE Scenarios Problems

Previously the 3D Editor always crashed when porting Wormwood.exs, Shadow of the Stranger. The crash seemed to happen at town 26. So I altered the editor so that town 26 did not have its special nodes ported:
if (which_town != 26) {
for (short i = 0; i < 100; i++) {
if ((boe_town.specials[i].type > 0) || (boe_town.specials[i].jumpto > 0))
port_a_special_node(&boe_town.specials[i],i,file_id,1);
}
}
this stopped the crashes totally.
Having confirmed that town 26 was the only town that caused a crash I needed to pin down which node was causing the crashes.
for (short i = #; i < 100; i++) {
if ((boe_town.specials[i].type > 0) || (boe_town.specials[i].jumpto > 0))
port_a_special_node(&boe_town.specials[i],i,file_id,1);
}
For #, values of i = 0 and i = 1 did not stop the crashes but i=2 did the trick. Hence node number 1 was the culprit. This was confirmed by altering the for clause, now node number 1 is of type 54. Stopping porting of type 54 stopped the crashes.
for (short i = 0; i < 100; i++) {
if (boe_town.specials[i].type != 54) {
if ((boe_town.specials[i].type > 0) || (boe_town.specials[i].jumpto > 0))
port_a_special_node(&boe_town.specials[i],i,file_id,1);
}
}

Now I will need to see exactly what the problem is here.
Edit:
I am assuming that it is my alterations to the source code that caused the mysterious crashes to the desktop. It might also be the old compiler that I use. Or both.
Edit:
I compiled the 3D Editor code using Code::Blocks and the Gnu compiler. Editor still crashes at the end but the scenario is properly ported before this happens. Crash has been traced back to my attempts to stop/trace the crashes in Shadow of the Stranger.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 08 June 2013 - 09:37 PM #33 Porting BoE Scenarios Problems

BoE towns can access out of town dialog and BoA towns can't, porting only ports dialog in the current town. This can create game-breaking problems with lack of dialog for key (BoA) NPCs.  It seems like various NPCs, in a given town, may draw their dialog from various other towns. So it is not as simple as importing another town's dialog script.
If NPCs have dialog from other towns but there are no native Personalities in the current town, there won't even be a dialog script. As a consequence, Memory Cell 3 won't be filled in so all creatures will have a value of 0 for this cell and thus dialog won't happen.
A second big problem is that BoE dialog simply has Personality whereas BoA dialog has layered States... You can't just copy and paste someone's dialog from another town's dialog script because the states of that dialog may conflict with the dialog states in the current town's dialog script.

Ishad Nha Ishad Nha

Hand of Avadon

  • Member
    • Member ID: 4,773
  • 2,366 posts

Posted 01 August 2013 - 01:00 AM #34 Porting BoE Scenarios Problems

Genmar, four Townspersons use the dialog of the trainer, this is due to the Townspersons using Personality 61 from town 6, Dark Cave. Porting process is based upon loading one town at a time:
"// STEP 4 Load in towns, one at a time, and port them." Hence porting of dialog ports dialog from the Personalities of the current town only. But in BoE people in a given town could use dialog from any other town!

void port_boe_town_data(short which_town,Boolean is_mac_scen)
town.creatures[i].personality = 20 * which_town + (boe_big_town.creatures[i].personality % 10);
For the current town the "20 * which_town" part is constant, the variable part is "(boe_big_town.creatures[i].personality % 10)". Now (BoE personality mod 10) does not distinguish between BoE one town and another. This is where the problem comes from.

// which_slot is 0 .. 9. it is which of the 10 personalities in the town being ported
void port_dialogue_intro_text(short *current_dialogue_node,short which_slot,FILE *file_id,short town_being_ported)
// see if we can find wharacter who ties into this and set its memory cell
for (short i = 0; i < 60; i++)
if ((town.creatures[i].personality >= 0) &&
(boe_big_town.creatures[i].number > 0) &&
(town.creatures[i].personality == 20 * town_being_ported + which_slot)) {
town.creatures[i].memory_cells[3] = *current_dialogue_node;
}
Memory Cell 3 is set for a given NPC even if he has no dialog in the current town's dialog script. This value for cell 3 will need to be altered.
My Town Monster Data file shows which monsters use dialog from other towns and where it comes from.

BoE personality = 10*town number + i
i = slot number (0 thru 9) = (BoE personality) mod 10
2*(BoE personality) = 2(10*town + i) = 20*town + 2i = BoA_personality + i
2*(BoE personality) - i = BoA_personality
Hence I will be using the formulation:
town.creatures[i].personality = 2 * boe_big_town.creatures[i].personality - (boe_big_town.creatures[i].personality % 10);
This avoids mention of "which_town", which means that you won't have dialog from any other town being given the same personality number as dialog from the current town.
For out of town dialog you can't set Memory Cell 3 until you know where that dialog will be placed in the current town script.
No need to alter void port_dialogue_intro_text(short *current_dialogue_node,short which_slot,FILE *file_id,short town_being_ported), it is now only being passed personality values for the town currently being ported.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users