Well whaddya know?

Discussion in 'ToEE Toolset Project Documentation' started by Shiningted, Jul 2, 2005.

Remove all ads!
  1. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    How to recombine and split the massive Hommlet map with World Builder for later use

    Let's say you want to make a gigantic map for ToEE. Like most people, you'll probably want to do this by making a template from an existing map so that map limits and all that other silly stuff can just be transfered right over to your new map. Easy - we just have WB recombine the Hommlet map and go from there. But wait! We get an out of memory message or something similar since the map is so damn large. Now what?

    Here's what to do, using the mysterious 'recombine partially' feature in WB:

    1. Enter these exact figures into WB (under the 2D Maps tab) and click Recombine Partially. Then navigate to the Hommlet ground art folder, select the first .jpeg there, and click OK.

    wb1.jpg

    2. Enter these exact figures into WB (under the 2D Maps tab) and click Recombine Partially. Then navigate to the Hommlet ground art folder, select the first .jpeg there, and click OK.

    wb2.jpg

    3. Enter these exact figures into WB (under the 2D Maps tab) and click Recombine Partially. Then navigate to the Hommlet ground art folder, select the first .jpeg there, and click OK.

    wb3.jpg

    4. Enter these exact figures into WB (under the 2D Maps tab) and click Recombine Partially. Then navigate to the Hommlet ground art folder, select the first .jpeg there, and click OK.

    wb4.jpg

    This will give you four separate .jpegs that when combined will make up the entirety of the Hommlet map. The chunks look like this (bottom left and top right are the night version of the map, just to make the distinction somewhat clearer):

    hommy ex.jpg

    Now you can put these back together in your art program of choice, make a gigantic new art landscape overtop to your heart's content, split them again into the four pieces, and use WB to split the four pieces back into the little pieces that are used for maps in-game. The only thing you have to bear in mind when splitting them with WB is that the corresponding text file with the two figures in it has to have the same two figures you entered in the 'starting at' line when you recombined each piece originally. That means change the text file for each of the four pieces.

    This is not theory btw: if you do it exactly as stated above, it will work. :yes:
     
  2. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Reseting a Heartbeat

    There are any number of situations in which you may wish to change or reset a heartbeat. For instance, you may want a proactive NPC that initiates conversation when he has line-of-sight, each time, but you also want the PCs to be able to just walk away from him without getting dragged into another conversation instantly.

    There are various ways to achieve this with flags, timed scripts etc. But the easiest I have found is simply to reset the heartbeat at the start of the map, with the first heartbeat. Put something like this in:

    def san_first_heartbeat( attachee, triggerer ):
    ________attachee.scripts[19] = 612
    ________return RUN_DEFAULT

    612 in this case is the number of the Bugbear Chief (ie py00612Bugbear.py). If you wish to have some other heartbeat kick in (a generic one or whatever) from another file, use another number.

    This way you can switch off the heartbeat when it initiates (game.new_sid = 0) and it will be back next time the PCs arrives on the map :)
     
  3. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    daylight.mes

    Heh, while I had to research this brute-force style (I replaced a map tile with a completely while JPEG, then took screenshots every hour of the day, and compared to daylight.mes),
    I still want to share my results here:

    daylight.mes controls the coloring of the background map and 3D lighting separately.

    The entries for the background coloring of a map have the following style:

    {MMMMXX}{R,G,B}

    where MMMM is the map id, XX is the hour of the day and R,G,B is the color with which the background map is multiplied.
    For XX=06, the entry is {Rn,Gn,Bn,Rd,Gd,Bd}, where Rn,Gn,Bn is multiplied with the nighttime map, while Rd,Gd,Bd is multiplied with the daytime map. Actually this is not entirely accurate, since at hour 6:00, the daylight map is already visible, the night-time value is only used to smooth out transitions. For XX=18, the entry is reversed.

    The second set of entries are:
    {MMMMXX}{R,G,B}

    where MMMM is the map id and XX is 24+hour of the day. These entries are multiplied with the 3d lighting color (from global.lit). Otherwise the same rules as above apply.

    In addition, the game uses linear interpolation between entries.

    I don't know whether someone wrote this down already somewhere else, but I couldn't find anything like this description.

    Regards,
    Storm
     
  4. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Fun Fact:

    If you have an NPC with waypoints, and he is scripted to stop combat at some point in his san start_combat script and launch a dialog, but he has no san dialog script defined, he will instead stop combat and run his waypoints route. :grin:

    Seems like lots of potential there.
     
  5. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    0
    How fun would it be to have villagers run from the Hommlet invaders?
    :evilgrin:
     
  6. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    How to make an NPC stop combat

    If you've got an NPC that has no business getting into combat (like a static object that is masquerading as an NPC, e.g. the shop map chests) and you want it to stop combat if it gets attacked, do this:

    • First, flag it as invulnerable and no flee.

    • Second, make sure its proto has san_start_combat defined in its scripts file.

    • Third, invoke the following at the start of the NPC's scripts file:

      Code:
      from Co8 import *
      This loads the file that contains Cerulean the Blue's script to stop combat.

    • Fourth, add the following to the san_start_combat entry in the NPC's scripts file:

      Code:
      def san_start_combat( attachee, triggerer ):
      	leader = game.party[0]
      	StopCombat(attachee, 0)
      	leader.begin_dialog( attachee, x )
      	return RUN_DEFAULT
      This will make the NPC stop combat on its turn and start dialog at the indicated line number in his dialog file (x). You have to point to a dialog or else combat won't stop. Since the NPC is invulnerable, it won't be any worse for wear from any hits it may have taken, and it won't try to run away and deliver and panicky float lines with its no flee flag set.
    Note that this will also stop combat for any other battles that are going on that the NPC may have just happened to get pulled into, such as via an AoE spell.
     
  7. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Observation: mobile objects don't like to be destroyed.

    Or more specifically, the game doesn't like it and it may cause crashes on save, even though the save can be loaded successfully later, strangely.

    Case in point: Captain Asaph's ghostly guards in Welkwood Bog got destroyed via script if you denied him three times. (Also the giant and the spirit.) If you then tried to save, the game would CTD, but you could load the save later without apparent issue. Changing it so that the mobs just got turned off instead of destroyed fixed it - no more CTDs.

    Who knows why this is, but it's probably best not to destroy any mobile objects.

    Speculation ... it might be that when you save, the game looks for the mobs that used to be there and can't find them - crash. But when you load the save, since the mob data wasn't saved, the game no longer looks for them - no crash. :shrug:
     
    Last edited: Aug 25, 2010
  8. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Less High-Strung NPCs

    If you want to create a scenario where an NPC initiates conversation on his heartbeat when PCs come in range (like when you first arrive on a map, if it's a small map), but you don't want the talking NPC to start talking the very instant you arrive on that map like they're inclined to do (if, for example, you want other NPCs to do things on their heartbeat like cast spells :roll:), you can use the timevent thing effectively to make them wait:

    Code:
    def san_heartbeat( attachee, triggerer ):
    	if (not game.combat_is_active()):
    		if (is_better_to_talk(attachee, game.party[0])):
    			game.timevent_add( relax_and_wait_a_second, ( attachee, triggerer ), 3000 )	
    	return RUN_DEFAULT
    
    def relax_and_wait_a_second( attachee, triggerer ):
    	attachee.turn_towards(game.party[0])
    	game.party[0].begin_dialog( attachee, 1 )
    	game.new_sid = 0
    The above scripts make the talking NPC wait a mere three seconds before they start in, allowing other NPCs to do whatever.

    The vanilla timevent function seems to work flawlessly as long as you don't switch maps. If you do switch maps, the timed event will only occur when you return to the map where the event was scheduled.
     
  9. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Just putting this out there so I don't have to re-figure-it-out everytime I do it ...

    Unidentified Items

    If you want to make a magical item unidentified, it must have the OIF_IS_MAGICAL item flag, and an entry for Unidentified Description ID in description.mes. Also, if you use the 'give' console command to test, the item will come identified. Use 'create' instead.
     
  10. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    This is probably well-known already, but ...

    Secret Doors

    Secret doors don't show up properly for testing (correct DC or any DC at all) without starting a new game.

    Also, the only detect secret doors roll that will show in the rolls history window is a successful auto-check (e.g., not an active search via the radial menu, and not a failed auto-check).
     
  11. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    I'm a little surprised by this, but it appears to be a fact: there is a limit of 200 game maps useable in the game (5000 - 5199). If you try to add map #5200, the game will crash upon trying to access it. :(

    (This is bad news as far as the notion of making all those doorways in Verbo lead to somewhere goes.)
     
  12. Kneller1

    Kneller1 Established Member

    Joined:
    Feb 25, 2006
    Messages:
    196
    Likes Received:
    1
    Unless you use 1 large map with lots of small non-interconnected rooms?
     
  13. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    So you want to give the PCs a specific disease or poisoning? I know I do, I didn't add dragon bile so people poisoned by it could get a tag saying 'Carrion Crawler Brain juice'. Thats just silly.

    Here are the poisons and diseases by number (ie the number used by say protos.tab, or poison_index, or whatever). I only copied this from combat.mes, but it took me a while to find so I figured I might save someone else the trouble. I also have a vague recollection of a new critter with poison giving an error message so this may help track that down if it shows again.

    // Poisons
    0 - Small Centipede
    1 - Greenblood Oil
    2 - Spider Venom
    3 - Blood Root
    4 - Purple Worm
    5 - Large Scorpion ----- Type: Injury; DC 18 ; Initial: 1d6 Str ; Secondary: 1d6 Str
    6 - Wyvern
    7 - Giant Wasp
    8 - Black Adder
    9 - Malyss Root Paste
    10 - Dragon Bile
    11 - Sassone Leaf Residue
    12 - Terinav Root
    13 - Carrion Crawler Brain Juice
    14 - Black Lotus Extract
    15 - Id Moss
    16 - Striped Toadstool
    17 - Lich Dust
    18 - Dark Reaver Powder
    19 - Burnt Othur Fumes
    20 - Quasit
    21 - Violet Fungi
    22 - Yellow Mold
    23 - Mystical
    24 - Other
    25 - Blue Whinnis
    26 - Shadow Essence
    27 - Deathblade
    28 - Nitharit
    29 - Oil of Taggit
    30 - Arsenic
    31 - Ungol Dust
    32 - Insanity Mist

    // Diseases
    0 - Blinding Sickness
    1 - Cackle Fever
    2 - Demon Fever
    3 - Devil Chills
    4 - Filth Fever
    5 - Mindfire
    6 - Mummy Rot
    7 - Red Ache
    8 - Shakes
    9 - Slimy Doom

    EDIT: Note: the DCs and effects appear to be quite consistent with the SRD (see HERE) even though the use of the poison spell and poison potion both currently only give #23, Mystical Poison. (22 in some cases in KotB). Monsters can be set to deliver any sort of poison, so they all work, even ones not in the Help.tab like Striped Toadstool. :) Mysitcal is NOT in the SRD and they seem to have made it up or something (and a couple of others, like 'other'). Mystical, as the spell description says, is DC 10 + 1/2 caster level, Initial Damage: 1d10 Con, Secondary Damage: 1d10 Con. Nasty!
     
    Last edited: Mar 25, 2014
  14. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Tip: Never, ever, EVER leave return SKIP_DEFAULT off the end of a san dialog script. :smarty:
     
  15. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Shedding some light on predetermined encounters

    Fact: You can use the code 'game.encounter_queue' in the console to return whatever predetermined encounters are scheduled by number. This can be useful if your scheduled encounter has failed somehow, because it seems to no longer appear in the queue if it has.

    e.g., you schedule an encounter and the above code returns 3010 or whatever. You go on a little trip and instead of 3010 get a normal random encounter with crayfish or something. You then run the code again and 3010 is no longer listed. Something is wrong! But at least you know that and don't have to worry that the game is just goofing off.
     
Our Host!