Jump to content

Code Discussion Thread


Recommended Posts

  • Replies 990
  • Created
  • Last Reply

Top Posters In This Topic

Scenario Editor Suggestions

 

(Ishad Nha)Allow customization of the toolbar button hotkeys. (Done to some degree, no provision for user choice yet.)

(CM)Remove editing restrictions on the first 91 terrain types. (This looks easier than the others, Ishad Nha)

(CM)Allow the designer to resize the outdoors

(CM,Hrothgar)Allow the designer to import an outdoor section

(CM)An optional grid in the terrain editing screen so you can see where the edges of the spaces are.

(Miramor,Thuryl)Increase the maximum values for some of the fields in the monster, item, and (possibly) terrain editor.

(CM)When creating a new scenario, allow a choice of bladbase.exs files.

(Robsta)Allow two spaces to display the same sign text, without having to waste a sign space by duplicating the text.

(CM)A monsters palette and an items palette, so that the menus are no longer needed.

(w-dueck)A recent monsters/items palette

(Robsta)Allow the assignment of a default personality for monsters.

(w-dueck)Display custom graphics in the editing dialogs.

(w-dueck)Display custom graphics in the map view.

(Ishad Nha)Allow custom map icons.

Link to post
Share on other sites

The first two to be precise. I will still need to learn my way around the code. Today I will be adding more Ctrl + hot keys to avoid the need to go through the main screen all the time.

 

I don't need to know programming per se, I only need to be able to imitate what works.

 

"(Robsta)Allow two spaces to display the same sign text, without having to waste a sign space by duplicating the text." This one may be tough because the exs file only has provision for 15 sign locations and presumably only 15 sign strings.

 

Edit:

I have fixed the terrain editing restrictions for terrain types 0 through 90.

Link to post
Share on other sites
  • 2 weeks later...

As for the first part, bug fixes:

The Mindduel problem seems to be fixed in do_mindduel.

 

Potions are something else, there are several different sources of information, which differ from each other. Source only has provision for twenty different potions. I will use the information in the source code as the standard, it is collected below:

 

A short abil1_needed[20] = {

B short abil2_needed[20] = {

C short difficulty[20] = {

D short fail_chance[20] = {

E short potion_abils[20] = {

F short potion_strs[20] = {

G short potion_val[20] = {

 

 

Name~A~B~C~D~E~F~G

Weak Curing:~Holly/Toadstool~1~50~Cure/Cause Poison~2~40

Weak Healing:~Comfrey Root~1~40~Add/Lose Health~2~60

Weak Poison:~Holly/Toadstool~1~30~Poison Weapon~2~15

Weak Speed:~Comfrey Root~Crypt Shroom/Wormgr.~3~20~Speed/Slow User~2~50

Medium Poison:~Crypt Shroom/Wormgr.~3~10~Poison Weapon~4~50

Medium Healing:~Glowing Nettle~4~8~Add/Lose Health~5~180

Strong Curing:~Glowing Nettle~5~6~Cure/Cause Poison~8~200

Medium Speed:~Crypt Shroom/Wormgr.~Glowing Nettle~5~4~Speed/Slow User~5~100

Graymold Salve:~Graymold~7~2~Cause/Cure Disease~4~150

Weak Power:~Crypt Shroom/Wormgr.~Asptongue Mold~9~0~Add/Lose Spell Points~2~100

Potion of Clarity:~Graymold~Holly/Toadstool~9~0~Cure/Cause Dumbfound~8~200

Strong Poison:~Asptongue Mold~10~0~Poison Weapon~6~150

Strong Healing:~Graymold~Comfrey Root~12~0~Add/Lose Health~8~300

Killer Poison:~Mandrake~12~0~Poison Weapon~8~400

Resurrection Balm:~Ember Flowers~9~0~Resurrection Balm~0~100

Medium Power:~Mandrake~Asptongue Mold~14~0~Add/Lose Spell Points~5~300

Knowledge Brew:~Mandrake~Ember Flowers~19~0~Add/Lose Skill Pts.~2~500

Strong Strength:~Glowing Nettle~Ember Flowers~10~0~Curse/Bless User~8~175

Bliss:~Graymold~Asptongue Mold~16~0~Bliss~5~250

Strong Power:~Mandrake~Ember Flowers~20~0~Add/Lose Spell Points~8~500

 

Tildes, ~, are used to replace tab stops because this forum has problems with formatting tabs.

 

 

Html:
Name	A	B	C	D	E	F	GWeak Curing:	Holly/Toadstool	1	50	Cure/Cause Poison	2	40Weak Healing:	Comfrey Root	1	40	Add/Lose Health	2	60Weak Poison:	Holly/Toadstool	1	30	Poison Weapon	2	15Weak Speed:	Comfrey Root	Crypt Shroom/Wormgr.	3	20	Speed/Slow User	2	50Medium Poison:	Crypt Shroom/Wormgr.	3	10	Poison Weapon	4	50Medium Healing:	Glowing Nettle	4	8	Add/Lose Health	5	180Strong Curing:	Glowing Nettle	5	6	Cure/Cause Poison	8	200Medium Speed:	Crypt Shroom/Wormgr.	Glowing Nettle	5	4	Speed/Slow User	5	100Graymold Salve:	Graymold	7	2	Cause/Cure Disease	4	150Weak Power:	Crypt Shroom/Wormgr.	Asptongue Mold	9	0	Add/Lose Spell Points	2	100Potion of Clarity:	Graymold	Holly/Toadstool	9	0	Cure/Cause Dumbfound	8	200Strong Poison:	Asptongue Mold	10	0	Poison Weapon	6	150Strong Healing:	Graymold	Comfrey Root	12	0	Add/Lose Health	8	300Killer Poison:	Mandrake	12	0	Poison Weapon	8	400Resurrection Balm:	Ember Flowers	9	0	Resurrection Balm	0	100Medium Power:	Mandrake	Asptongue Mold	14	0	Add/Lose Spell Points	5	300Knowledge Brew:	Mandrake	Ember Flowers	19	0	Add/Lose Skill Pts.	2	500Strong Strength:	Glowing Nettle	Ember Flowers	10	0	Curse/Bless User	8	175Bliss:	Graymold	Asptongue Mold	16	0	Bliss	5	250Strong Power:	Mandrake	Ember Flowers	20	0	Add/Lose Spell Points	8	500
Link to post
Share on other sites
Originally Posted By: Ishad Nha

Tildes, ~, are used to replace tab stops because this forum has no provision for tabs.


Actuall, I've found that [ code ] works quite well for it.
Link to post
Share on other sites

Good, tabs are sorted out. It seems that most of the information given is correct, if you use the second lot, 7501 onwards of gamestr.rc, as your guide.

Now as for that non-functioning Strong Strength Potion button, it involves dialog 1047 of gamedlog.rc. I will have to look at each button in turn and decrypt the whole scheme.

 

Edit:

(ADoS)Strength Potion cannot be made via Alchemy on Windows? . Problem solved.

Offending line was 2,399 of party.cpp: “if (item_hit == 43) {”

This makes the “18” button the help button, still can’t get the help to work.

By contrast, in the Mac code it is the correct figure “if (item_hit == 49) {”

As the problem occurred only in the Windows version I should have just compared the two source files but I thought the resource script was to blame.

 

Edit:

Pop up help fixed with, "give_help(220,21,1047);", still a problem with the ampersand being turned into an underscore. As for line numbers, here I am using the original unaltered Ormus source code as a reference.

Link to post
Share on other sites

"(CM)Make the BoE Editor application open a .exs file when it is double-clicked or dragged and dropped on the application icon."

If CM means: double-clicking on an exs file will open it in BoE Editor. This is currently a bit tough for me. Only thing that can be done is to allow the exs files to use the Editor icon, this can be arranged in Windows Explorer by creating a relevant entry in Tools > Folder Options > File Types.

 

"(ADoS,CM)Fix the bug that prevents the use of the small Alien Beast graphic."

(This is a matter for the Scenario Editor, it has been done.)

Line 557 of Scenario.cpp reads: “147,148,149,150,151,152,152,154,155,159,”

The two 152s here refer to the normal Mind Crystal graphic, the line should thus read: “147,148,149,150,151,152,153,154,155,159,”. Alien Beast graphic will need to be manually changed to the proper one, currently it will still use the Pack Leader variety.

 

Methodology:

examine the relevant screen, choose a distinctive phrase, like "Select a graphic".

search in gamedlog.rc for that phrase, 819 DIALOG seems to be the one.

use the search all files function in Bloodshed Dev-C++ and look for "819"

find the function on line 299 of keydlgs.cpp

figure out that the function is okay

start looking elsewhere.

 

 

 

 

Link to post
Share on other sites
Originally Posted By: Ishad Nha
If CM means: double-clicking on an exs file will open it in BoE Editor. This is currently a bit tough for me.
Yes, that's what I mean. The other thing you did is a simple registry entry. I'm talking about making the editor handle open-file events.

Originally Posted By: Ishad Nha

Line 557 of Scenario.cpp reads: “147,148,149,150,151,152,152,154,155,159,”
The two 152s here refer to the normal Mind Crystal graphic, the line should thus read: “147,148,149,150,151,152,153,154,155,159,”. Alien Beast graphic will need to be manually changed to the proper one, currently it will still use the Pack Leader variety.
Well, that's an interesting pointless thing to do... rolleyes
(I'm referring to having a list like that in the first place, not to the change you made.)
Link to post
Share on other sites

I will leave the open file events till last. Much more pressing things to do.

Alien Beast graphic: I mean that you will still need to go into the Editor's Edit Monster Types screen and change the graphic manually. Starting with Bladbase.exs. I am not too clear what all those tables in scenario.cpp are there for, they mostly seem to have no effect on any new scenario.

 

Next item on the agenda is having custom graphics shown in editing screens.

Edit:

This is not looking too good, all that happens is that the last official graphic is repeated for terrain with custom graphics.

Link to post
Share on other sites

Hey, you know what would be sweet? If the editor could show the animations in animated terrain, not just the first frame. Also, it would be nice if the dialog for choosing a graphic included custom graphics, or maybe there was a 'Custom Graphic...' button.

Link to post
Share on other sites

Editor keeps crashing every time that I try and save! I will have to take time out to look at this. I was going to do something about the item abilities, that is straightforward. There seems to be a problem with a switch in specials.cpp. Fortunately there is hex editing in the meantime.

 

Edit:

(ADoS)Fix the Add/Lose Sanctuary item ability. (Done)

(Milla)Fix the acid weapon doubles as living saving charm deal. (Done)

There was a problem with both Add/Lose Sanctuary and Add/Lose Martyr's Shield. That can be fixed by adding "case 78: case 80:" to line 496 of specials.cpp. Hex-editing allowed me to alter the exs file to create items with the desired properties so that I could verify that there was a problem and also verify that the problem had been fixed.

Now there is something about Acid Weapons..

(Milla)Fix the acid weaspon doubles as living saving charm deal.

Line 28 of PC.cpp, "i = hasAbilEquip(9);", should read "i = hasAbilEquip(48);".

Link to post
Share on other sites

Scenario Editor fixed, see post in the relevant topic.

Back to the game itself, graphics I will leave for the moment, they will require more study of how they work.

 

I can have a stab at fixing the problem with a node killing the party and then they can't be resurrected.

Link to post
Share on other sites

Other Minor Changes

(Crynsos)Use the MaidenWork font that comes with it.

This already works, if you click on the ttf file when in Windows Explorer you should see a display come up showing the alphabet in the Maiden Word font. Simply copy the ttf file into the C:\Windows\Fonts directory.

Link to post
Share on other sites

Yes, it does, line 153 of Blades.cpp. Moving it to the folder is not a big deal, it's a one-off action that takes ten seconds

 

(Milu)When "Custom Scenario" is clicked and then cancelled, the following message appears: "This scenario was created by BoE v2.0 or later and can't be run using this copy..."

This is a legitimate message if you don't have v2.0 or later. Why it is being called wrongly I don't know.

Link to post
Share on other sites
Originally Posted By: Ishad Nha
Yes, it does, line 153 of Blades.cpp. Moving it to the folder is not a big deal, it's a one-off action that takes ten seconds
Yes, but it would be even better if the program could find the font regardless of whether it is in the font folder.
Link to post
Share on other sites

One bug I have not noticed in the above list is the non-functional Turn off terrain animation and Turn off frills on shore options. I don't know whether that affects only the latest version or not.

 

Another thing, on a few occasions the game uses flags like 296,0 and 181,6. These are part of the 300*10 block that are supposed to be open for use by designers. This could mess up a scenario or make it do strange things.

Link to post
Share on other sites
Originally Posted By: Ishad Nha
Another thing, on a few occasions the game uses flags like 296,0 and 181,6. These are part of the 300*10 block that are supposed to be open for use by designers. This could mess up a scenario or make it do strange things.


That's interesting, because there are reports of flag 0,0 behaving strangely in some scenarios. Is the game hard-coded to modify the value of that particular flag at any point?
Link to post
Share on other sites

A search for "0][0" has turned up nothing. It might be a case of the program looking for sdf(x) > 0 or sdf(y) > 0, only this flag would be affected by it.

 

Error detection:

If a problem occurs in the Ormus version of the game but not in the original Spiderweb version, the quickest way to spot the cause of the error is to compare the two source files. The problem with a node killing the party and then they can't be resurrected, I could have solved it much quicker with a comparison of the two versions of scenario.cpp.

 

Edit:

(Crynsos)Fix the Conceal Ability flag so that it actually conceals the ability.

This requires the creation of an isConcealed() item ability, currently there is a broken link between the BoE Scenario Editor's item editing screen and what the BoE game displays in its item information screen. I have amended this, concealed ability is now represented by "? ? ?". Infodlgs.cpp line 274 was amended.

 

Link to post
Share on other sites

It follows the same format as all the other item properties:

#define ITEM_PROP_IDENTIFIED 1

#define ITEM_PROP_PROPERTY 2

#define ITEM_PROP_MAGIC 4

#define ITEM_PROP_CONTAINED 8

#define ITEM_PROP_CURSED 16

Generally I would try to standardize approaches used for each item property.

There are still two possible slots, 64 and 128, if anyone can think of any other possible item properties.

 

New terrain, item and monster properties are quite easy to arrange. There is a lot of spare space available there.

 

Bitwise manipulation could be used too, you could create immunities to mental effects and place them in Breath Weapon type. The program would check as usual for the breath weapon, then it could use bitwise manipulation for mental effects. Binary powers 2 thru 7 would be free.

Link to post
Share on other sites

Bugs:

Comparing Consts.h and Combat.cpp it seems that demons do undead damage and vice versa.

 

Possible bugs:

Life saving items protect against:

Icy touch,

Experience draining touch,

Icy and draining touch

Slowing touch

 

Petrification touch causes disease

 

(CM)Make the waterfalls work in town.

This has been done, I have yet to test it though. In Actions.cpp the waterfall exists in the outd_move_party function but not in the town_move_party counterpart.

 

Edit:

"(Crynsos)Make it possible to make an item call a scenario special when used. (Implemented)"

Is this supported in the Windows Scenario Editor? As far as I can tell it is not.

"(CM)Align the labels for checkboxes to the right rather than the left so that it is easier to see which label corresponds to which checkbox."

You presumably could change the LTEXT in the gamedlog.rc file to RTEXT. Now I am getting better at decrypting the entries in that file you may not need to. I copy an entry into Word, change the commas and quotation marks to tab stops then paste it into Excel. After sorting the entries by y then by x it is quite easy to see what goes where. Especially when you can compare it with a screen shot of the relevant screen. The Race/Advantage/Disadvantages screen has already been tidied up a bit.

 

Resurrection of non-existant PCs, the source code uses the following phrasing:

for (i = 0; i < 6; i++)

if ((pc < 0) || (pc == i)) {

 

Magic resistance bugs:

http://www.ironycentral.com/forum/ubbthreads.php?ubb=showflat&Number=105589#Post105589

I will have to look into this when I get the chance.

Link to post
Share on other sites
  • 2 weeks later...

Just FWIW, the Will/Mindduel bug (Will items protect from dumbfounding but don't help minddueling) still seems to be unfixed. AFAIK, this should be an easy fix, since it's just the code referring to the wrong ability number... See here. (Apologies for the formatting problems.) The code in party.cpp should use ability 53 (Will) not ability 75 (add/lose magic resistance).

 

Edit: Nope, what I wrote there doesn't seem to apply any more, as ability 75 doesn't affect mindduel either in Ormus' OpenBoE (and the mindduel code is no longer in party.cpp).

 

Whatever the case, Will should affect minddueling ability...

 

Edit again: ah, I see the issue... No matter what the ability level of the Ring of Will, it will always make the mindduel work as if the PC has 20 Intelligence, so my 20-Int test singleton doesn't benefit. D'oh. Carry on.

Link to post
Share on other sites

Looks like the Conceal Ability flag had already been fixed by Ishad Nha ... I just assumed that the list was up-to-date, but doesn't seems so wink

 

Originally Posted By: Celtic Minstrel
Originally Posted By: Ishad Nha
Yes, it does, line 153 of Blades.cpp. Moving it to the folder is not a big deal, it's a one-off action that takes ten seconds
Yes, but it would be even better if the program could find the font regardless of whether it is in the font folder.

 

If you really want the font to be loaded from the game directory, you just needs to register the font when initialising BoE and unregistering it when closing. For that, only two lines of codes are to be added in BLADES.cpp :

 

Click to reveal..
void loadFonts()

{

AddFontResource("maidword.ttf"); // add font to the sytem font table

font = CreateFont(12,0,0,0,0, 0,0,0, 0,0, 0,0,0,"MS Sans Serif");

small_bold_font = CreateFont(12,0,0,0,700, 0,0,0, 0,0, 0,0,0,"MS Sans Serif");

italic_font = CreateFont(12,0,0,0,700, 1,0,0, 0,0, 0,0,0,"MS Sans Serif");

underline_font = CreateFont(12,0,0,0,0, 0,1,0, 0,0, 0,0,0,"MS Sans Serif");

bold_font = CreateFont(14,0,0,0,700, 0,0,0, 0,0, 0,0,0,"MS Sans Serif");

tiny_font = font;

fantasy_font = CreateFont(22,0,0,0,0, 0,0,0, 0,0, 0,0,0,"MaidenWord");

if (fantasy_font == NULL)

{

fantasy_font = CreateFont(22,0,0,0,0, 0,0,0, 0,0, 0,0,0,"MS Sans Serif");

}

}

 

and, at the end of the winmain() function

 

Click to reveal..
int WINAPI WinMain(...)

[...]

delete data_store2;

delete data_store;

 

RemoveFontResource("maidword.ttf"); // remove the font from the system font table

 

FreeLibrary((HMODULE) boeSoundsDLL);

 

 

return msg.wParam;

}

 

and BoE will find and use the MaidenWord font (if it fails to find "maidword.ttf" it uses MS Sans Serif instead).

 

Chokboyz

Link to post
Share on other sites

(ADoS)Fix recording of dialogue nodes which result from a special node sequence. (fixed)

 

This was a simple typo in the INFODLGS.cpp file.

In function put_talk(), line 1059, replace the line :

party.talk_save[store_page_on].str2 - 2000 + 20,(char *) place_str);

by :

party.talk_save[store_page_on].str2 - 2000,(char *) place_str);

 

Actually, only the second part of the message wasn't properly read (but was properly written). The random results could range from stranges symbols ("empty" pointed element in the array) to previously recorded dialogues. Interestingly, there is a test in the code preventing you from recording the Don't Understand Response ...

 

Unfortunately, I haven't been able to check if this bug was present in the Mac version of BoE. Should it be the case, the fix would be the same.

 

Chokboyz

Link to post
Share on other sites

As for the Mac, apparently the problem is there too, this is line 1,153 of info.dialogs.c, from the official Spiderweb source code:

party.talk_save[store_page_on].str2 - 2000 + 20,(char *) place_str);

 

As for updates, I will post any changes here, so this topic can be used as a notice board.

Link to post
Share on other sites

Another bug fix post.

Note: when i say a bug is present in the mac version, i refer to the latest sources of OBoE on Khoth's site (but i may be wrong since i can't compile or even test mac version of the game ...)

 

  • (Robsta)Fix masking on custom item graphics in the inventory? (present on windows, already fixed on mac)

     

    First, in place_item_button() (TEXT.cpp), the function rect_draw_some_item() (GRAPHUTL.cpp) is called with the transparency set to wrong.

     

    Replace line 480 in TEXT.cpp

    rect_draw_some_item (spec_scen_g, from_rect, item_stats_gworld, to_rect, 0, 0);

    by

    rect_draw_some_item (spec_scen_g, from_rect, item_stats_gworld, to_rect, 1, 0);

     

    Second, the called function is buggy for custom items (on windows only, as far as i can tell). In fact, the hdcMem2 object is given dest_rect size but later given the scr_rect size (smaller) which results in gibberish graphic in the items screen. The problem is transparent with base objects because the dest_rect and src_rect are the same size. Custom objects are on the other hand of different dest and src sizes, thus the function needs to be fixed.

     

    Replace lines 106-109 in GRAPHUTL.cpp

    Click to reveal..
    StretchBlt(hdcMem3,dest_rect.left,dest_rect.top,dest_rect.right - dest_rect.left,

    dest_rect.bottom - dest_rect.top,

    hdcMem2,0,0,src_rect.right - src_rect.left,

    src_rect.bottom - src_rect.top,SRCAND);

    by

    Click to reveal..
    StretchBlt(hdcMem3,dest_rect.left,dest_rect.top,dest_rect.right - dest_rect.left,

    dest_rect.bottom - dest_rect.top,

    hdcMem2,0,0,dest_rect.right - dest_rect.left,

    dest_rect.bottom - dest_rect.top,SRCAND);

     

    Note that the same error is done later in the file (lines 145-148), and should be fixed too.

  • (CommonGenius)Apparently the Defence skill rather than the Thrown Missiles skill is checked when firing missile weapons. (present on windows, present on mac)

     

    That is absolutely right.

    In COMBAT.cpp, line 1171 :

    skill = (overall_mode == 12) ? adven[current_pc].skills[7] : adven[current_pc].skills[8];

    should be replace by

    skill = (overall_mode == 12 ? adven[current_pc].skills[7] : adven[current_pc].skills[6];

     

    Now, Thissa, Adrianna, Feodoric and Michael should be able to make something out of the points they have by default in Thrown Missiles. wink

  • "Sleeping Ray" trap wasn't working (present on windows, present on mac)

     

    I found this bug while completing the CONSTS.h file in Ormus' build : the "Sleep Ray" trap (trap number 5 ; it actually paralyses the pc if he fails to disarm it) wasn't working.

     

    The culprit is a check done in the beginning of the class pc_record_type::runTrap() in the file PC.cpp (it is the function run_trap() in BLXTOWN_SPC.c in the mac sources), thats return TRUE if the called trap is either 5 ("sleep ray" trap) or 6 (oddly, an undefined trap).

     

    A fix is to simply replace line 92 in file PC.cpp (it is line 153 in BLXTOWN_SPC.c file for mac)

    if ((trap_type == 5) || (trap_type == 6))

    by

    if (trap_type == 6)

  • Petrification touch causes disease (Ishad Nha, others ?) (present on windows, present on mac)

     

    This one is a little different in nature.

    The petrification touch is actually checked in the cause disease effect in the function monster_attack_pc(), line 2011 (2307 on mac), in file COMBAT.cpp (it is the monster spec_skill 30) :

    if (((attacker->m_d.spec_skill == 25) || (attacker->m_d.spec_skill == 30))

     

    Fixing it requires two things on bot mac and :

     

    First, replace the previous line

    if (((attacker->m_d.spec_skill == 25) || (attacker->m_d.spec_skill == 30))

    by

    if ((attacker->m_d.spec_skill == 25)

    (note that it is a two lines wide check, hence the extra parenthesis ; this should be done on either the mac and the windows version)

     

    Then, create a petrificating touch effect in the function (after the disease effect for example).

    Click to reveal.. (Windows Version)
    // Petrification touch

    if (attacker->m_d.spec_skill == 30 && (adven[target].hasAbilEquip(49) == 24) && (get_ran(1,0,20) + adven[target].level / 4 + adven[target].status[1]) <= 14)

    {

    add_string_to_buf(" Petrificating touch!");

    print_buf();

    adven[target].kill(4); // 4 being the stoned (petrified, duh!) status

    }

    or, Mac Version (pure guess for the kill_pc line, just by looking at the code : might needs some tweaking)

     

    Click to reveal.. (Mac Version)
    // Petrification touch

    if (attacker->m_d.spec_skill == 30 && (pc_has_abil_equip(target,49) == 24) && (get_ran(1,0,20) + adven[target].level / 4 + adven[target].status[1]) <= 14)

    {

    add_string_to_buf(" Petrificating touch!");

    print_buf();

    kill_pc(target,4); // 4 being the stoned (petrified, duh!) status

    }

     

    (Note : the hasAbilEquip(49) test is a check to see if the pc has some protection from petrification items equipped.)

     

    Why is this one a little different ? Because i had to make an arbitrary decision. In fact, as you can see in the code, each time the monster hits you, you have the same chance of being petrified then when a basilisk gazes at you. This should be discussed (after all, it isn't a ranged attack anymore).

Finally a little completed CONSTS.h file for ormus' build tweakers out there :

 

Click to reveal..
#ifndef _CONSTS_H

#define _CONSTS_H

 

/*

This file contain numerous constans in form of #defines.

Almost all of this constants cannot be changed because

that would make the game work improperly.

*/

 

#define NUM_OF_PCS 6

#define INVALID_PC NUM_OF_PCS

 

#define INVALID_TOWN 200

 

#define NUM_OF_BOATS 30

#define NUM_OF_HORSES 30

 

#define SFX_SMALL_BLOOD 1

#define SFX_MEDIUM_BLOOD 2

#define SFX_LARGE_BLOOD 4

#define SFX_SMALL_SLIME 8

#define SFX_BIG_SLIME 16

#define SFX_ASH 32

#define SFX_BONES 64

#define SFX_RUBBLE 128

 

/* stuff done flags */

#define SDF_IS_PARTY_SPLIT 304][0

#define SDF_PARTY_SPLIT_X 304][1

#define SDF_PARTY_SPLIT_Y 304][2

#define SDF_NO_INSTANT_HELP 306][4 // boolean

 

/* overall mode */

#define MODE_OUTDOORS 0

#define MODE_TOWN 1

#define MODE_TALK_TOWN 2 // looking for someone to talk

#define MODE_COMBAT 10

#define MODE_FIRING 12 // firing from bow or crossbow

#define MODE_THROWING 13 // throwing missle

#define MODE_DROPPING 15

#define MODE_TALKING 20

#define MODE_SHOPPING 21

#define MODE_LOOK_OUTDOORS 35 // looking at something

#define MODE_LOOK_TOWN 36

#define MODE_LOOK_COMBAT 37

 

/* adven.main_status */ //complete

#define MAIN_STATUS_ABSENT 0 // absent, empty slot

#define MAIN_STATUS_ALIVE 1

#define MAIN_STATUS_DEAD 2

#define MAIN_STATUS_DUST 3

#define MAIN_STATUS_STONE 4

#define MAIN_STATUS_FLED 5

#define MAIN_STATUS_SURFACE 6 // fled to surface?

#define MAIN_STATUS_WON 7

/* main status modifiers */

#define MAIN_STATUS_SPLIT 10 // split from party

 

 

/* adven.skills */ //complete

#define SKILL_STRENGTH 0

#define SKILL_DEXTERITY 1

#define SKILL_INTELLIGENCE 2

#define SKILL_EDGED_WEAPONS 3

#define SKILL_BASHING_WEAPONS 4

#define SKILL_POLE_WEAPONS 5

#define SKILL_THROWN_MISSILES 6

#define SKILL_ARCHERY 7

#define SKILL_DEFENSE 8

#define SKILL_MAGE_SPELLS 9

#define SKILL_PRIEST_SPELLS 10

#define SKILL_MAGE_LORE 11

#define SKILL_ALCHEMY 12

#define SKILL_ITEM_LORE 13

#define SKILL_DISARM_TRAPS 14

#define SKILL_LOCKPICKING 15

#define SKILL_ASSASSINATION 16

#define SKILL_POISON 17

#define SKILL_LUCK 18

 

 

/* adven.traits */ //complete

#define TRAIT_TOUGHNESS 0

#define TRAIT_MAGICALLY_APT 1

#define TRAIT_AMBIDEXTROUS 2

#define TRAIT_NIMBLE 3

#define TRAIT_CAVE_LORE 4

#define TRAIT_WOODSMAN 5

#define TRAIT_GOOD_CONST 6

#define TRAIT_HIGHLY_ALERT 7

#define TRAIT_EXCEPTIONAL_STRENGTH 8

#define TRAIT_RECUPERATION 9

#define TRAIT_SLUGGISH 10

#define TRAIT_MAGICALLY_INEPT 11

#define TRAIT_FRAIL 12

#define TRAIT_CHRONIC_DISEASE 13

#define TRAIT_BAD_BACK 14

 

/* adven.race */ //complete

#define RACE_HUMAN 0

#define RACE_NEPHIL 1

#define RACE_SLITH 2

 

/* adven.status*/ //complete - assign a positive value for a help pc effect, a negative for harm pc

#define STATUS_POISONED_WEAPON 0

#define STATUS_BLESS 1

#define STATUS_POISON 2

#define STATUS_HASTE 3

#define STATUS_INVULNERABLE 4

#define STATUS_MAGIC_RESISTANCE 5

#define STATUS_WEBS 6

#define STATUS_DISEASE 7

#define STATUS_INVISIBLE 8 //sanctuary

#define STATUS_DUMB 9

#define STATUS_MARTYRS_SHIELD 10

#define STATUS_ASLEEP 11

#define STATUS_PARALYZED 12

#define STATUS_ACID 13

 

/* damage type*/

/* used as parameter to some functions */

#define DAMAGE_WEAPON 0

#define DAMAGE_FIRE 1

#define DAMAGE_POISON 2

#define DAMAGE_MAGIC 3

#define DAMAGE_UNBLOCKABLE 4 //from the source files - the display is the same as the magic one (damage_monst in SPECIALS.cpp)

#define DAMAGE_COLD 5

#define DAMAGE_UNDEAD 6 //from the source files - the display is the same as the weapon one

#define DAMAGE_DEMON 7 //from the source files - the display is the same as the weapon one

// 8 and 9 aren't defined : doesn't print any damage. According to the source files the 9 is DAMAGE_MARKED though. Wrong ?

#define DAMAGE_MARKED 10 // usage: DAMAGE_MARKED + damage_type

#define DAMAGE_NO_PRINT 30 // usage: DAMAGE_NO_PRINT + damage_type

 

/* trap type */

/* used in pc_record_type::runTrap(...) */

#define TRAP_RANDOM 0

#define TRAP_BLADE 1

#define TRAP_DART 2

#define TRAP_GAS 3 // poisons all

#define TRAP_EXPLOSION 4 // damages all => uses c_town.difficulty rather than trap_level to calculates damages (and even c_town.difficulty /13).

#define TRAP_SLEEP_RAY 5

// 6 isn't defined (see runtrap classe in PC.cpp

#define TRAP_DRAIN_XP 7

#define TRAP_ALERT 8 // makes town hostile

#define TRAP_FLAMES 9 // damages all => uses trap_level (*5) to calculates damages.

#define TRAP_DUMBFOUND 10 //dumbfound all

#define TRAP_DISEASE 11

#define TRAP_DISEASE_ALL 12

 

#endif

Chokboyz

 

Link to post
Share on other sites

Are you using the Ormus 32-bit source code or the official Spiderweb source? If you use both you might mix your metaphors with disastrous results.

I think "Replace line 1533 in TEXT.cpp" should read "Replace line 533 in TEXT.cpp".

In Ormus's code: "rect_draw_some_item (mixed_gworld, but_from_rect, item_stats_gworld, to_rect, 0, 0);"

In official code: rect_draw_some_item (spec_scen_g, from_rect, item_stats_gworld, to_rect, 0, 0);

Link to post
Share on other sites

You're right there is a typo in my post. The correct line is 480 in TEXT.cpp.

I've checked the others, they should be right.

 

And i'm using Ormus 32-bit source code (the windows official one is a nightmare to compile).

 

Thanks,

Chokboyz

Link to post
Share on other sites

That worked properly when I followed the revised instructions.

The biggest single problem is the way the Scenario Editor does not use custom graphics in its zoom out view, it is a wonder Jeff never fixed this himself.

Link to post
Share on other sites

I've seen several people complain that demons and undead pierce armor and that this is a bug, but I always thought it was a feature. Why else would there be separate damage types for demons and undead? I think it makes the game more interesting.

 

Just thought I should say that before anyone changes it, since nobody else seems to bring this up when people complain about it.

 

Carry on talking about stuff that's almost but not entirely above my head, I guess.

Link to post
Share on other sites
Originally Posted By: The Almighty Doer of Stuff
I've seen several people complain that demons and undead pierce armor and that this is a bug, but I always thought it was a feature. Why else would there be separate damage types for demons and undead? I think it makes the game more interesting.


The bizarre thing is that they seem to pierce the armour of other monsters, but not of PCs. If anything, it should be the other way round.
Link to post
Share on other sites

Actually, it does seems, from the code, that undead and demons have the same chance to hit you (or another monster) than others creatures and does not augmented damages (the undead or demon type is used only to check for undead/demons protecting items) ... confused

 

It was a quick glance though, so i may have overlooked something.

 

Quote:
Just thought I should say that before anyone changes it, since nobody else seems to bring this up when people complain about it.

Won't changes anything likes that wink In fact, the main goal is to produce a stable (relatively) bug-free release (hopefully cross-platform) before changing anything radical.

 

Quote:
Permanent Martyr's Shield is the other way around

You are right. From the code, when monster attacks monster (hand-to-hand), the following effects only are checked :

  • is attacker blessed/cursed ?
  • is attacker webbed ?
  • is target blessed/cursed ?
  • is target sleepy?
  • is target paralysed?
  • poisoned monster weapon ?
  • undead slowing effect
  • web target effect
  • put target to sleep
  • dumbfound target
  • paralyse target
  • acid touch
  • freezing touch
  • death touch

No disease, no stoning, etc ...

 

Quote:
The biggest single problem is the way the Scenario Editor does not use custom graphics in its zoom out view, it is a wonder Jeff never fixed this himself.

I will give it a try, but i won't promise anything ... after all, you're the expert of the Character/Scenario Editor here wink

 

Chokboyz

Link to post
Share on other sites

For the petrification touch, I added an if to the start of the clause and I generally followed the phrasing used by the other attack types:

if((attacker->m_d.spec_skill == 30) && (adven[target].hasAbilEquip(49) == 24) && ((get_ran(1,0,20) + adven[target].level / 4 + adven[target].status[1]) <= 14)) {

As for the Scenario Editor zoom out, this is a graphics problem and that is not my forte.

Link to post
Share on other sites
Originally Posted By: Chokboyz
Actually, it does seems, from the code, that undead and demons have the same chance to hit you (or another monster) than others creatures and does not augmented damages (the undead or demon type is used only to check for undead/demons protecting items) ... confused

It was a quick glance though, so i may have overlooked something.


Try creating a custom undead/demon monster with a 20d1 attack and having it attack another custom monster with 50 armour. Its attacks will do 20 damage every time.
Link to post
Share on other sites

You're right once again ... Oddly, i didn't forget the if in the mac version of code confused

Lacks of sleep i suppose ...

 

Ok, i added the zoom-out problem to my to-do list wink

 

Thanks again

 

To ADoS :

 

Quote:
If that's what the demon/undead damage types are for, then how do items that protect from humanoids, lizards, and giants work? There are abilities for those too. I thought it would just check the monster type.

 

It actually checks the type_of_attacker for the humanoids/reptiles/giants and the damage_type for normal/undead/demons. And it from the original sourcecode, not a homebrew one grin

Click to reveal.. (proof)
FILE : PARTY.cpp, function damage_pc()

[...]

if ((damage_type == 0) && ((level = get_prot_level(which_pc,30)) > 0))

how_much = how_much - level;

if ((damage_type == 6) && ((level = get_prot_level(which_pc,57)) > 0))

how_much = how_much / ((level >= 7) ? 4 : 2);

if ((damage_type == 7) && ((level = get_prot_level(which_pc,58)) > 0))

how_much = how_much / ((level >= 7) ? 4 : 2);

if ((type_of_attacker == 6) && ((level = get_prot_level(which_pc,59)) > 0))

how_much = how_much / ((level >= 7) ? 4 : 2);

if ((type_of_attacker == 1) && ((level = get_prot_level(which_pc,60)) > 0))

how_much = how_much / ((level >= 7) ? 4 : 2);

if ((type_of_attacker == 9) && ((level = get_prot_level(which_pc,61)) > 0))

how_much = how_much / ((level >= 7) ? 4 : 2);

 

To Thuryl :

 

Quote:
Try creating a custom undead/demon monster with a 20d1 attack and having it attack another custom monster with 50 armour. Its attacks will do 20 damage every time.

 

Indeed, you're right. The armor is not checked when an undead or a demon attacks another monster; as you said, it is when a pc is attacked though.

Click to reveal.. (proof)
file SPECIALS.cpp, function damage_monst()

[...]

r1 = get_ran(1,0,(victim->m_d.armor * 5) / 4); //get a random number between 0 and 5/4 victim monster armor

r1 += victim->m_d.level / 4; // add the victim monster level divided by 4 to this number

if (dam_type == 0) // if the damage type is 0 (normal) (undead is 6 and demon 7)

how_much -= r1; // substract the number to the damage done

 

Chokboyz

Link to post
Share on other sites

Another quick bug-fix :

 

Quote:
(Miramor,CM)Fix automap updating so that changes in terrain will appear on the automap.

Notice that this bug only happens in town (outside the terrain is changed on the automap automatically).

We need to do a full automap redraw as soon as the terrain is changed/swapped/transformed to fix this (as when the player close and reopen the automap).

 

To do so, open file SPECIALS.cpp, find function townmode_spec() and insert the line

draw_map(modeless_dialogs[5],10);

after lines 2337, 2344 and 2349 (the lines saying *redraw = 1;, in case 171, 172 and 173).

 

The 10 parameter in draw_map() forces the full update of the automap. Others values of interest : 5 (default) redraw adjacents to party terrains and 11 blanks everything except adjacents terrains (sort of "empty map" ...).

 

Chokboyz

Link to post
Share on other sites

While you're working on the automap, sometimes, when I move next to water, one edge of the water will be replaced with the tile that's next to it on the automap. It's kind of hard to describe what I mean, I guess. Maybe someone knows what I'm talking about and can explain it better.

 

Also, terrains that emit light are strange colored blocks on the automap, rather than small representations of themselves.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...