Newbie to modding in need of help - Hommlet sign post

Discussion in 'General Modification' started by Sitra Achara, Oct 28, 2006.

Remove all ads!
  1. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    Edit:

    /using this place as a sort of webpage for myself now :)

    Test Script - http://www.co8.org/forum/showthread.php?t=6041

    Changing Point Buy Points - http://www.co8.org/forum/showthread.php?t=7555

    Traders/Temple threads:
    http://www.co8.org/forum/showthread.php?t=4365 - traders part 1
    http://www.co8.org/forum/showthread.php?t=6082 - traders part 2
    http://www.co8.org/forum/showthread.php?t=6226 - reactive temple
    http://www.co8.org/forum/showthread.php?t=6281 - traders + reactive temple

    Less New Content Patch for v5.0.5 - http://www.co8.org/forum/showthread.php?t=6011

    Reduced XP testing:
    http://www.co8.org/forum/showthread.php?t=4348
    XP progress simulator script
    XP tests with NC vs. no NC
    Side by side comparison with Vanilla
    d20 encounter calculator - http://www.d20srd.org/extras/d20encountercalculator/

    Improving In-game Help: http://www.co8.org/forum/showthread.php?t=7603


    Persistent Flags and Vars: http://www.co8.org/forum/showthread.php?t=7588

    Random Encounter scripting guide - http://www.co8.org/forum/showthread.php?t=7831

    Blasphemy Fix - http://www.co8.org/forum/showthread.php?p=101621&highlight=holy#post101621


    Wish/To do list:


    1. Corpse Arranger for reactive temples
    2. Skole replacement (place needs a bartender, no?)
    3. Script workaround for Javelin of Lightning use by NPCs
    4. Looting people after drinking contest - make Badger react
    5. Royal Armor OP
    6. Chon, Otis' boy
    7. Salamanders:
    8. Errand boy(s) for Hommlet shopkeepers, near signpost - to streamline selling items.
    9. Efreeti deception as per the module.
    10. Rannos and Gremag's mercenary Raimol becomes loyal if resurrected.
    11. More area descriptions using the popup box script
      • needs discussion - would adding too many be annoying?
      • Also - combined with within_rect_by_corners, could be room specific!
    12. DLL stuff:
      1. Aid - doesn't give level bonus (it's just 1d8+1)
      2. Correct game.area for maps.
      3. Necklace of Adaptation to work right.
      4. Figure out what the AI command "partial charge" does. DONE (effectively nothing)
      5. Figure out what d20_send_signal is capable of actually doing. - DONE (Templeplus)
      6. Figure out a way to pan the camera without using dialogue.
      7. Reset Sorcerer / Bard used up spells.
      8. More than 5 dialogue replies.
      9. Fix bugbear strength bug.
      10. Make scrolls fail if silenced.
      11. Make scrolls take AOOs.
      12. Read and manipulate factions via script. - DONE (Templeplus)
      13. Better control of AI targetting. - DONE (TemplePlus)
      14. Repair Charm Person used by NPCs.

        Advanced Stuff:
      15. Correct XP table for level > 10 - DONE (Templeplus)
      16. AI ability to use item-stored spells / abilities (e.g. Javelin of Lightning, Rope of Entanglement)
      17. Fix scather bug - DONE (Templeplus)
      18. "Room Interaction" interface
      19. Curses (e.g. compulsion, charm, suggestions)
      20. Leave PCs at inn - DONE (Templeplus)
      21. Forcing the AI to move to a certain X,Y coordinate without predetermined Way Points.
      22. Add feats via script. - http://www.co8.org/forum/showthread.php?p=38390 - DONE (Templeplus)
      23. Add levels via script. - DONE (Templeplus)
      24. Allow for ally factions in combat (your party + faction X vs. faction Y)
      25. Redo NPC looting system.
      26. Situation specific targetting - e.g. Animate Dead, allow more than 1 target but only outside of combat
      27. Correct scrolls implementation re. caster level
        • Probably necessitates a system for handling "variants" in inventory, protos etc.
      28. Special Zombies/Skeletons for animated Giants / Ogres / Gnolls
        • When new models are possible - also bugbears
      29. Drelb special effect - chill causes victims to drop to the ground shivering


    -----------------------------------

    Howdy folks, I've been an occasional visitor to this site for a few years now, and after replaying ToEE recently with your wonderful modpack I decided to get a bit more involved in modding. I've read most of Ted's excellent tutorials and looked around a bit here on the forum, but didn't find any answer to my problem, so perhaps you can help me.

    For my first attempt at modding, I'm trying to create a signpost in Hommlet, to teleport your party to various locations in Hommlet via dialogue. It's meant to save time doing the Hommelet quests (all that running around can get tiresome!). I got it working for the most part, except for one thing. You see, I'm using the command fade_and_teleport(0,0,0,5001,#,#) to teleport my party to their destination, and while it does teleport them successfully to the right place, the camera doesn't follow - it stays where the conversation with the post took place. This doesn't seem to happen when teleporting to different areas, e.g. the Verbobonc travel agent or if I place the post in a starting vignette, so I guess the fade doesn't work when you're teleporting to the same area in the game. A possible workaround is to just click on a character portrait to pan the camera to them, but that seems rather crude (not to mention confusing - at first I thought my PCs were completely gone!).

    A possible solution that occured to me while writing this post is to create a script that does two subsequent teleports - one to some other arbitrary game area followed by another teleport to the right destination, to get the fade & camera focus effect from transitioning between different areas. Before going that route, however, I'd like to know if there's something simpler, like a camera pan command, or perhaps messing with the other parameters of fade_and_teleport (those zeroes at the beginning... I've tried changing them a little, but no luck yet). Thanks!
     
    Last edited: Jul 30, 2015
  2. krunch

    krunch moving on in life

    Joined:
    Aug 9, 2005
    Messages:
    3,280
    Likes Received:
    0
    You need to make two things to use dialogue teleports. You need to mod two protos entries plus the dialogue issuing the commands. You need to mod the item for the character inventory and you also need to mod an invisble character for the dialogue. The invisble character cannot be fought or engaged and disappears from the game after use, each time.
     
  3. Cerulean the Blue

    Cerulean the Blue Blue Meanie Veteran

    Joined:
    Apr 23, 2005
    Messages:
    1,962
    Likes Received:
    0
    Krunch, he's got the teleport working, so he must know all that. He wants to know how to get the camera to follow the party when teleporting to a different location on the same map. There may be some what to do it using jumppoints, but I'm not sure. AFAIK there is no console command to move the camera.
     
  4. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    If this can be worked out (and maybe even if it can't), I'd love to see it included in the next modpack. It would certainly make fedexing more bearable, in addition to general time-saving advantages.

    Do you have artwork for the sign post in-game?
     
    Last edited: Oct 28, 2006
  5. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    Just checking the obvious here so don't be offended if it accidentally insults your intelligence.

    Did you check that the dialogue option that triggers the teleport command does close the dialogue? and is a PC line that triggers it? EG...

    {1}{I'll teleport you far away sir...}{I'll teleport you far away maam.}{}{}{}{}
    {2}{Blah blah blah}{}{int}{}{0}{game.fade and teleport(0,0,0,map,x,y)}

    The goto line number 0 is needed to close the dialogue box, this should allow for the camera to move.

    On an (similar - yet strangely) unrelated note, I was discussing the possibility of adding dialogue to the Red Rooster in Hommlet, to auto complete the fed-ex quests for those of us who've done them all so many times and don't fancy wasting valuable game play time fixing every little problem everybody in the area has. ;)
     
  6. krunch

    krunch moving on in life

    Joined:
    Aug 9, 2005
    Messages:
    3,280
    Likes Received:
    0
    Like Allyx mentioned, there's the 0 to close the dialogue window and there is supposed to be npc.destroy() to get rid of the invisble npc if one is being used. I didn't see any mention of npc.destroy().

    {}{1}{}{0}{npc.destroy(); game.fade_and_teleport( 0,0,0,map,x,y)}

    Otherwise, there is the tp(map,x,y) command that can be tried in place of game.fade_and_teleport(0,0,0,map,x,y). Try the tp command, instead. That may not resolve the camera issue, though.
     
  7. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    DLL hacking / Reverse Engineering

    Let me preface this long awaited (?) thread by saying that I'm far from an expert on this and am learning as I go. The real pros from the past (SpellSlinger, Drifter, Moebius etc.) have been inactive for a long time - I'm just writing from my own experience.

    For those of you who don't know, DLL hacking in our context (usually) refers to the reverse engineering and direct manipulation of the ASM code stored in temple.dll, for purposes of fixing bugs or otherwise enhancing the mod / game.

    DLL hacking is usually required to fix hard-coded issues that can't be solved via scripting or editing the other simple files in the ToEE\data folder etc. Sometimes the changes are as simple as changing a couple of bytes, sometimes they involve adding complex function hooks.

    Anyway, the purpose of this thread is to concentrate documentation of the DLL functions that have been deciphered and/or altered by modders (past and present). Hopefully it will encourage other novices to pick up the art too, and perhaps spur others more knowledgeable to contribute and educate us simpletons as well :).

    Required Knowledge

    I am going to assume basic knowledge of ASM. High-school level should be sufficient, I guess. (pretty much my level :) )

    Tools

    I use a free debugger know as Ollydbg. The following is based on this tool, but I imagine other programs of the type should have similar facilities. Anyway, google and download it if you're not used to something else.

    DarkStorm has recommended IDA Pro for this task, but I haven't delved into it yet. One of the older versions is available for free (4.7 IIRC).

    Getting started with Ollydbg


    1. Run ToEE in windowed mode.
    2. Run Ollydbg. Then:
      • File -> Attach
      • Choose ToEE.EXE from the list of processes.
    3. The important module to look at is module temple (which is in fact Temple.dll, where most of the relevant game code is at)
      In Olly: View -> Executable Modules (Alt + E)
    4. Familiarize yourself with the basics:
      Step Into, Step Over (F7, F8)
      Run (F9 - careful! it's also ToEE's quickload hotkey!)
      Execute till return (Ctrl + F9)
      Set Breakpoint (F2)
      Set Conditional Logging Breakpoint (Shift + F4)
      Log Window (Alt + L)

    Techniques and Tips



    1. Set a breakpoint at the diceroller.
      Particularly useful while in combat mode, for combat rolls and such.
      For example:
      If you're expecting a 1d100 check, e.g. for a concealment check, look out for a dice roll called with parameters 1d100+0.
    2. Set a logging, non-pausing breakpoint. (Shift + F4)
      Sometimes relevant breakpoints are reached for many other uninteresting things.
      You can try to filter out some shit by using non-pausing logging conditional breakpoints. Then observe the Log window (Alt+L) for interesting instances.
      To emphasize: you can set "Pause Program" to "Never".
      It's also often useful to log some of the registers (EAX etc.)
    3. Set Memory Breakpoints for strings in the data area! (click on the bottom left window, Ctrl+B for binary search (enter the string, case sensitive), and then left click -> Breakpoint -> Memory)
      Could be dangerous sometimes, though.
    4. Don't go wandering outside temple.dll (and perhaps pyToEE22.dll in some cases).
      In general, try to filter out low-level stuff like Integer addition, random number generator, text display, etc. Of course, the primary difficulty is in identifying the important things :).
    5. Run Trace:
      You can create a log/history of all commands executed.
      Trace -> Run Hit Trace
      You should set appropriate breakpoints.
      Set Protocol for ToEE.dll stuff only.
      (Mark Protocol only the following EIP ranges , and add range 10001000 .. 1026C000 - which is where the DLL code resides).
    6. You can disable breakpoints without removing them (left click -> breakpoints -> disable)

    Temple.DLL Documentation

    Original Temple DLL code is stored at memory addresses 0x10001000 thru 0x1026BFFF. For the corresponding HEX address in the file, subtract 0x10000000. (i.e. omit the 1 at the beginning :))

    Note: Some function hooks have been added in the memory section, by SpellSlinger. It could cause crashes / weirdness in principal. But hey, it's been that way for a while, so it can't be TOO bad, right? :p

    Functions:

    • Dice Roller:
      • 10038B60
      • Args:
      • For XdY+B, call the function thusly:
        • Push B
        • Push Y
        • Push X
        • Call 10038B60
    • Random Number Generator:
      • 10038DF0

    • Combat to hit roll and subsequent result check:
      • 100B75F3
    • Damage Calculation (on successful hit, ofc):
      • 100E16F0

    • Dispel Magic:
      • 100B5211 - it rolled the dispel roll here
        Afterwards, it called: 10047E30
      • 10047E30 - then it input the roll, the DC and various other arguments inside here
        It seems like it's only called elsewhere once, on 10091912
        It seemingly returns one number with EAX. Last time I tried it - 75.
      • Afterwards, with the EAX as arg1, it calls 100DFFF0.
      • 100DFFF0 - Allocates 4096 bytes;
        checks if EAX is -1.
        If not:
        calls 10048960
        This apparently compiled some string that says "The Master attemps Dispel Magic - "Success!"[Roll_75]
        So 75 must be a hyperlink index for the roll breakdown!
        So all this bullshit was just for the help UI, it seems.
        Then CALL 1010EE00
        Seems to break it up to DWORDs and load it up into memory.
        So in short, this is seemingly related to the help UI (link ID and message) and not the actual substance.
        And 10047E30 probably does the number crunching for that link ID (gathering the roll, the DC, the caster level bonus, etc.)
      • Afterwards, it calls up CALL 100E65C0.
      • CALL 100E65C0 -
        arg is the experience level.
        Seems to also have the outcome of the roll in the memory.
        Not really sure what this does. Hmm.
      • Next, it finally subtracts the DC from the roll, it seems. (SUB EDI, ESI @ 100B5265)
      • Then it adds the dispeler's level to the result.
        Seems like this is what the function returns!
      • Then it returns to 100DB82E.
      • The call from the line before it was "CALL 100B51E0".
        So 100B51E0 returns the (roll + bonus - dc) result.
        Looking around, there seem to be hardcoded dispel-related error messages. So this area (vicinity of 100DB82E) must be the Dispel area!
      • Indeed a bit later it tests for EAX > 0 and jumps to the "success" area accordingly. I'm actually interested in the failure area because that's the bugged area, it seems.
        If it doesn't jump, it makes two comparisons.
        One of two very large numbers, and one of two small numbers (405 vs. 421).
      • Further down, at function 10076820:
        CALL 101E65E0 - loads up
        EAX = 06D02735 ASCII "Dispel Magic failed."
      • Kind of dead ended here...
      • So, I look at the log and I see something bizarre - it attempts to remove the spell 'Dispel Magic' from creatures.
      • Let's try seeing when it calls the _remove_spell() func.
      • It was called from the function 100D7620.
      • Dead ended there too. But I found out a string called "sp-Web Off" - at 102E0D9. So I set up a memory breakpoint there.
      • It always stopped at 100C321B, with EAX = 0xED (237)
    • Char Gen:
      • Related to PB/chargen: 1018B570
      • PB points:
        • 1018B534, 1018B576 (these are the X/Y in PB, possibly only X has to really be changed)

    Data:
    10280A00 - condition_add_with_args
    10283B1C - sp-Dispel Magic
    10281B50 - D20CAF_CONCEALMENT_MISS
    Look for string 06BCF1DA - obscuring mist stuff. Always just behind the 64.
    06CF8B00 - ASCII Dispel Magic (loaded from some file?)
    06D02735 - ASCII "Dispel Magic failed."
    Web:
    10282FC0 - String location "sp-Web"
    102E0C70 - Pointer to string "sp-Web", followed by the numbers: 5, 0x21 (33 dec.) - I have seen them referenced in the dispel thing!
    102E0D90 - Pointer to string "sp-Web Off"
    There's more in there...

    10282FA8

    How String Data is loaded:
    Code:
    MOV EAX,DWORD PTR DS:[....]
    often - [EAX*4 + ECX] 
    Links and references to other threads:


    http://www.co8.org/forum/showthread.php?p=14518#post14518 - fixed a bug where checks were made against absolute value of modifiers
    http://www.co8.org/forum/showthread.php?t=1031 - original thread for patching # of PCs
    http://www.co8.org/forum/showthread.php?p=13956 - fixed CON bonus issue for NPCs
    http://www.co8.org/forum/showthread.php?p=19470 - a suggestion for high-end HD levelup rolls, untested(?)
    http://www.co8.org/forum/showthread.php?p=13620 - Improved console output / debugging output
    http://www.co8.org/forum/showthread.php?p=12799 - a fix to a bard spellcasting bug
    http://www.co8.org/forum/showthread.php?t=1809 - Humble NPCs original thread
    http://www.co8.org/forum/showpost.php?p=8998&postcount=64 - Reverse engineering resource recommendation (other neat stuff in that thread too)
    http://www.co8.org/forum/showthread.php?t=2960 - a DLLhack wishlist thread (little DLL hacking substance here)
    Spellslinger's awesome contributions:
    http://www.co8.org/forum/showthread.php?t=3667 - Spellslinger rant that could prove useful
    thread - inserting a call into the save and load routine and more
    http://www.co8.org/forum/showthread.php?t=4660 - modified Humble NPCs
    http://www.co8.org/forum/showthread.php?t=3805 - party pool crash fix for > 5 PCs
    http://www.co8.org/forum/showthread.php?t=3605:

    • Fix for druid spont. casting for spell levels 6-9
    • Fix for potion drinking AoO for NPCs
    http://www.co8.org/forum/showthread.php?t=3841 - DLLfix 7:

    • Allows stat bonuses to count for extra spell slots
    • Fixes multiclassed casters spell slot consumption
    http://www.co8.org/forum/showthread.php?t=3940 - DLLfix 11:

    • Fix to higher-level-than-you-should-have bonus spell slots
    • Modified Worldmap location limit to add 6 more slots (includes modifying save/load routines)
    http://www.co8.org/forum/showthread.php?t=3998 - DLLfix 12:

    • Fixed level bonuses for Bard's Inspire Courage
    • Fixed related to D20STD_F flags
    http://www.co8.org/forum/showthread.php?t=4021 - DLLfix 13:

    • Fixed icy burst & shocking burst damage types
    • Fixed crafted SR
    • Fixed immunity of dwarves to entangle & web
    • and more
    http://www.co8.org/forum/showthread.php?t=4080 - DLLfix 14:

    • Allows NPCs to breakfree on entanglement
    • Modified reputation #19 to make Paladins fall
    http://www.co8.org/forum/showthread.php?t=4106 - DLLfix 15:

    • Portrait display UI fixed
    • and more
    http://www.co8.org/forum/showthread.php?p=46046 - DLLfix 16 release

    Credits:

    Stuff figured out thanks to Drifter:

    Dice Roller, RNG


    SpellSlinger modifications:

    Fix for potions provoking AOO: 10098DE7
    It is not called when the PC uses a potion!

    Fix for no breakfree attempt for AI controlled NPCs on entanglement: 100D4259


    • Function that returns game area: 1006EC30
      • Is called by:
      • 10176C35
    • Function that returns game data and area description: (for save/load menu?)
      • 10176C3B



    You return to this address from USER32 module: 101DE976

    Obscuring Mist shit: 1010C931
    100B73FE - calls Dice Roller for 1d100 roll - seems like this is it!
    100B71B4 - This writes to memory the damnd 100%, it seems!
    1004EBCF - A more inner function that writes the 32/64
    1004DF6E - The final function that returns that damned 32, among many other things. Seems correlated to EDX == 12CE68
    Dangit.



    Seems like it ultimately depends on 1004DF65
    EDI = 22 for melee attack (?)
    EBX = 7D69FE8, 89622F8, 7E1E690

    OK! GOT IT!
    100C920B - miss chance for partial concealment
    100C91FB - miss chance for total concealment
    Woohoo!
    (Test ok with Obscuring Mist; now, what about other fuckers, like Invisibilty?)

    What calls are used in combat with bugbear:
    1009E1D0 from 1009



    Damage calculation bit commentary:
    Code:
    100B75E9  |. 6A 00          PUSH 0                                   ;  +0
    100B75EB  |. 6A 14          PUSH 14                                  ;  d20
    100B75ED  |. 6A 01          PUSH 1                                   ;  roll 1 time (i.e. 1d20+0)
    100B75EF  |. 894424 64      MOV DWORD PTR SS:[ESP+64],EAX
    100B75F3  |. E8 6815F8FF    CALL temple.10038B60                     ;  call diceroller; seems combat related
    100B75F8     8BF0           MOV ESI,EAX                              ;  store diceroll result into ESI
    100B75FA     A1 B0A8BC10    MOV EAX,DWORD PTR DS:[10BCA8B0]          ;  ???
    100B75FF     83C4 48        ADD ESP,48                               ;  ???
    100B7602     85C0           TEST EAX,EAX                             ;  ???
    100B7604     897424 20      MOV DWORD PTR SS:[ESP+20],ESI            ;  ???
    100B7608  |. 0F85 13010000  JNZ temple.100B7721                      ;  ???
    100B760E  |. F74424 60 0000>TEST DWORD PTR SS:[ESP+60],2000000       ;  ???
    100B7616  |. 0F85 CB000000  JNZ temple.100B76E7                      ;  ???
    100B761C  |. 83FE 01        CMP ESI,1                                ;  test for critical failure
    100B761F  |. 74 20          JE SHORT temple.100B7641                 ;  go to failure area?
    100B7621  |. 83FE 14        CMP ESI,14                               ;  test critical success
    100B7624  |. 0F84 86000000  JE temple.100B76B0                       ;  go to success area
    100B762A  |. 8B4424 24      MOV EAX,DWORD PTR SS:[ESP+24]            ;  bring up bonus modifier?
    100B762E  |. 8B5424 1C      MOV EDX,DWORD PTR SS:[ESP+1C]            ;  bring up "vs." what we're rolling against?
    100B7632  |. 03C6           ADD EAX,ESI                              ;  add up bonus modifier to roll?
    100B7634  |. 33C9           XOR ECX,ECX                              ;  ECX = 0
    100B7636  |. 3BC2           CMP EAX,EDX
    100B7638  |. 0F9DC1         SETGE CL                                 ;  is EAX > ECX, i.e. did the roll pass?
    100B763B  |. 8BC1           MOV EAX,ECX                              ;  store result into EAX
    100B763D  |. 85C0           TEST EAX,EAX                             ;  test for JNZ in next line, to see if EAX is zero
    100B763F  |. 75 6F          JNZ SHORT temple.100B76B0                ;  if roll succeeded, go to success area
    
    
    Damage calculation section commentary:

    Code:
    100E174B  |. E8 F074F5FF    |CALL temple.10038C40                    ;  retrieves weapon's hit die size (the B in AdB)
    100E1750  |. 8B16           |MOV EDX,DWORD PTR DS:[ESI]
    100E1752  |. 83C4 04        |ADD ESP,4
    100E1755  |. 50             |PUSH EAX
    100E1756  |. 52             |PUSH EDX
    100E1757  |. E8 D474F5FF    |CALL temple.10038C30                    ;  retrieves weapon's # of hit die
    100E175C  |. 83C4 04        |ADD ESP,4
    100E175F  |. 50             |PUSH EAX
    100E1760  |. E8 FB73F5FF    |CALL temple.10038B60                    ;  damage dice roll; doesn't account for enchantment, at least
    100E1765  |. 83C4 0C        |ADD ESP,0C
    100E1768  |. 8946 08        |MOV DWORD PTR DS:[ESI+8],EAX
    100E176B  |> F687 10050000 >|TEST BYTE PTR DS:[EDI+510],2
    100E1772  |. 74 11          |JE SHORT temple.100E1785
    100E1774  |. DB46 08        |FILD DWORD PTR DS:[ESI+8]
    100E1777  |. D80D DCA62810  |FMUL DWORD PTR DS:[1028A6DC]
    100E177D  |. E8 3A281700    |CALL temple.10253FBC
    100E1782  |. 8946 08        |MOV DWORD PTR DS:[ESI+8],EAX
    100E1785  |> 8B47 6C        |MOV EAX,DWORD PTR DS:[EDI+6C]
    100E1788  |. 45             |INC EBP
    100E1789  |. 83C6 14        |ADD ESI,14
    100E178C  |. 3BE8           |CMP EBP,EAX
    100E178E  |.^0F82 74FFFFFF  \JB temple.100E1708
    100E1794  |. 5E             POP ESI
    100E1795  |. 5B             POP EBX
    100E1796  |> 6A FF          PUSH -1
    100E1798  |. 57             PUSH EDI
    100E1799  |. E8 72FAFFFF    CALL temple.100E1210                     ;  final damage calculation
    
    
    


    Point Buy:
    Code:
    1018B52E   C705 F453C410 1A>MOV DWORD PTR DS:[10C453F4],19           ; the Point Buy number of distributable points; default 19 (=25 in decimal)
    1018B538   F3:AB            REP STOS DWORD PTR ES:[EDI]
    1018B53A   E8 31000000      CALL temple.1018B570
    1018B53F   6A 00            PUSH 0
    1018B541   E8 2A07F9FF      CALL temple.1011BC70
    1018B546   83C4 04          ADD ESP,4
    1018B549   5F               POP EDI
    1018B54A   C3               RETN
    1018B54B   83C8 FF          OR EAX,FFFFFFFF
    1018B54E   C705 F453C410 00>MOV DWORD PTR DS:[10C453F4],0
    1018B558   F3:AB            REP STOS DWORD PTR ES:[EDI]
    1018B55A   E8 11000000      CALL temple.1018B570
    1018B55F   6A 00            PUSH 0
    1018B561   E8 0A07F9FF      CALL temple.1011BC70
    1018B566   83C4 04          ADD ESP,4
    1018B569   5F               POP EDI
    1018B56A   C3               RETN
    1018B56B   90               NOP
    1018B56C   90               NOP
    1018B56D   90               NOP
    1018B56E   90               NOP
    1018B56F   90               NOP
    1018B570   A1 F453C410      MOV EAX,DWORD PTR DS:[10C453F4]          ; Read # of PB points
    1018B575   6A 1A            PUSH 19                                  ; responsible for X in the "25 / X" in PB display; doesn't actually alter the number of available points, though
    



    Obscuring Mist Miss Chance Fix:

    Via Hex Edit Temple.dll:

    Change C91FC: From 64 to 32 (Total Concealment miss chance)
    Change C920C: From 32 to 14 (Partial Concealment miss chance)

    Seems simple, but it took me about 20 hours to track down this sucker...

    Code:
    Address   Hex dump          Command                                  Comments
    100C91E7  |.  D81D B4AE2710 FCOMP DWORD PTR DS:[1027AEB4]            ; FLOAT 5.000000 - used for checking if the opponent is more than 5 ft away, probably
    100C91ED  |.  68 EE000000   PUSH 0EE                                 ; Arg4 = 0EE
    100C91F2  |.  6A 13         PUSH 13                                  ; Arg3 = 13
    100C91F4  |.  DFE0          FSTSW AX
    100C91F6  |.  F6C4 41       TEST AH,41
    100C91F9  |.  75 10         JNE SHORT 100C920B
    100C91FB      6A 64         PUSH 32                                  ; Total Concealment Miss Chance; Was 0x64 (10%), now 0x32 (50%)
    100C91FD  |.  56            PUSH ESI                                 ; Arg1
    100C91FE  |.  E8 0DCF0100   CALL 100E6110
    100C9203  |.  83C4 10       ADD ESP,10
    100C9206  |.  33C0          XOR EAX,EAX
    100C9208  |.  5E            POP ESI
    100C9209  |.  59            POP ECX
    100C920A  |.  C3            RETN
    100C920B      6A 14         PUSH 14                                  ; Partial Concealment Miss Chance; Was 0x32 (50%), now 0x14 (20%)
    100C920D  |.  56            PUSH ESI                                 ; Arg1
    100C920E  |.  E8 FDCE0100   CALL 100E6110
    100C9213  |.  83C4 10       ADD ESP,10
    100C9216  |>  33C0          XOR EAX,EAX
    100C9218  |.  5E            POP ESI
    100C9219  |.  59            POP ECX
    100C921A  \.  C3            RETN
    
    
    

    Fog Cloud Miss Chance Fix:

    Much like Obscuring Mist (see above).

    Via Hex Edit Temple.dll:
    C7DFC: 64 - > 32
    C7E0C: 32 - > 14



    ---------------------------------------

    Well, what I suggested earlier didn't work - ToEE seems to ignore the second fade_and_teleport (and any others immediately following it). I'm not sure exactly why. It's certainly not because fade_and_teleport ends the running script - I've already set a global variable to test this. Perhaps it needs some pause between doing fades/teleports (to run a heartbeat maybe?). Running a very long while loop after the first teleport didn't solve this, but it did yield a new insight (for me at least) - ToEE didn't actually do the jump before completing the loop! (even though the loop started afterwards)
    So maybe the teleport command waits for the whole script to end before actually teleporting.


    Finally, I did manage to make a "tour guide" - basically, I spawned another instance of the "sign post" at the destination (same coordinates the party goes to, minus 5), and made it initiate dialogue after teleportation with a heartbeat script. This pans the camera automatically to the "tour guide" due to the dialogue, after which the tour guide says goodbye and self destructs (but not immediately - otherwise the camera doesn't pan to it, for some reason, so you gotta have a goodbye conversation - which is why the method works for a tour guide that "escorts" you, as opposed to a signpost). However, I'm not very fond of the heartbeat script - while it works, there's sometimes a lag between the teleportation and the next heartbeat (I'm guessing because heartbeats occur at regular intervals of a couple of seconds?). I didn't manage to initiate dialogue within the script - it seems that once again it does the actual teleportation only at the end of the script, so the dialogue initiation code fires when the party isn't at the destination yet, which fails to bring up the dialogue window due to the distance between the spawned object and the party.

    Gaear: I haven't created any artwork yet, for now I'm using the Planescape: Torment method - stuck a zombie post there instead :) I figured I'd do the same thing Ted did with the hollow stump here later on.

    Allyx: the 0 was already there, but thanks anyway. I also considered auto completing these quests, but it seemed like too much of a cheat, and besides, these quests might be altered/expanded in the future (possibly by me... we'll see :twitch: ).

    Krunch: the npc.destroy() didn't work either. As for the tp() command, if I'm not mistaken it's identical to game.fade_and_teleport, going by the ed.py file.

    Another possible workaround is to teleport to a different map and use a first heartbeat or newmap script for an NPC that's there all the time, or just teleport to an indoor area inside hommlet (but then you can't include the construction site).
     
    Last edited: Sep 24, 2011
  8. krunch

    krunch moving on in life

    Joined:
    Aug 9, 2005
    Messages:
    3,280
    Likes Received:
    0
    There are different maps for various places in Hommlet like the church, the tower, welcome wench inn, and others. You could teleport to the place with its own map that is closest to the destination and that should resolve the camera issue...is a possible workaround. There is the tower where Rufus is at next to the construction site. The tp command may have been a change provided by Agetian (or another modder) to have a shorter [easier] command to type.
     
    Last edited: Oct 29, 2006
  9. Lord_Spike

    Lord_Spike Senior Member Veteran

    Joined:
    Mar 25, 2005
    Messages:
    3,151
    Likes Received:
    1
    I'm liking the idea of all of this..especially multiple sign posts. Should make moving about way more tolerable than "endless" marching. Now...I wonder if this can be adapted to make it easier in places like the Temple or the nodes. A waypoint marker, if you will. Perhaps some type of magic item or a spell to allow such movement? Just thinking aloud; 'cause is GD annoying to have to do all that marching to get back to where you left off.

    EDIT: Just noticed that this was "Post 2K" for me....Yeah!!! :dance:
     
    Last edited: Oct 29, 2006
  10. Kalshane

    Kalshane Local Rules Geek

    Joined:
    Aug 6, 2004
    Messages:
    1,653
    Likes Received:
    4
    This is an excellent idea and had a similar musing while back, but forgot about it until you brought this up.

    I agree with the Temple being annoying as well, since you can't use the Teleport spell to go inside the temple itself. Once I'm ready to explore the temple, I normally buy the teleport scroll from Burne, grab Spuignor, have him with the party for a couple of fights to build up some XP, then take him back to town and have him churn out a bunch of Teleport scrolls for me before kicking him to the curb. It saves me having to back-track out of the Temple and hike back to Homlett when I need to rest and unload inventory, but I still have to hike back to the Temple and whereever I was before I left which isn't much fun.

    (I recruit Spoony because I normally use Sorcerers. If I have a Wizard, I just have them craft scrolls as I need them.)
     
  11. krunch

    krunch moving on in life

    Joined:
    Aug 9, 2005
    Messages:
    3,280
    Likes Received:
    0
    just a musing here - One thing I always have thought would be wonderful would be if more could be done with flags players can set on a game screen to mark where an adventuring party has been on a map.

    It would be sweet if the temple.dll could be edited to include a new set of variables for players to mark places on the in-game map that allows jump points to be determined where the flags are placed on the in-game map. Maybe there would only be 4 or 5 flags that can be used to mark a map and determine jump points. An inventory item along with scripts could issue a teleport command and use the jump points from the new set of variables where the flags are set on the in-game map.

    But alas, this is too much of a stretch and only wishful thinking.
     
  12. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,654
    Likes Received:
    352
    Bit late to the party, but if I may... (since I have had similar issues myself, such as if u use the Orb of the Moons to move to a map u r already on...)

    I had all the problems u suggested Sitra, and hence don't move characters around on a map that way - you have to go to a new map (such as inside the church, inside the Inn etc, as Krunch suggested).

    BUT... there should be a way to make this work, since the game happily moves the party around when it wants to. Examples: the secret doors in the Moathouse - they look like they r moving u 'up' and 'down' a level but its just shifting u around on the same map.

    This is by engine mechanics, of course, not by scripting, but what the engine can do, the scripter can call (or fake ;) ).
     
  13. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    So, is this worthy of inclusion in Co8?

    00270011.jpg

    00270011 - night.jpg
     
  14. smg225

    smg225 Gyro Captain

    Joined:
    Apr 15, 2005
    Messages:
    144
    Likes Received:
    0
    I don't know how much of a hassle it would be, but to me this seems like a great thing to include as a front-end option.
     
  15. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,654
    Likes Received:
    352
    Looks fine!

    I will get back to u soon about ur PM, what u mentioned iis a work-in-progress :)
     
Our Host!