Well whaddya know?

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

Remove all ads!
  1. Ax Thrower

    Ax Thrower Blood Lust

    Joined:
    Apr 3, 2006
    Messages:
    892
    Likes Received:
    0
    Thanks Gaear... this I will use...
     
  2. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,008
    Likes Received:
    28
    Fact: ToEE won't reliably play more than two (2) sound files on any given map with the 'loop' command applied to them in schemelist.mes. This is true regardless of whether you have one or two schemes assigned to a map.

    Workaround: if you have more than two audio tracks that you want to loop for any single map (such as music, crickets, and wind), mix down two ambient tracks (wind and crickets in this case) to a single audio file and then loop it. This should function fine with your second looped track, and you'll essentially still have three looped sounds inside two tracks. :)
     
    Last edited: Jan 14, 2008
  3. Shiningted

    Shiningted I want my goat back Global Moderator

    Joined:
    Oct 23, 2004
    Messages:
    12,205
    Likes Received:
    174
    Fact: While you can mob objects to exact coordinates, spawning things by script can be locationally haphazard. The game moves any spawned object away from anything sectored (even if thats not what you want), and often just plain creates things in subtly different places each time (consider the different places that the sheep and rooster appear near Mary each time you play).

    The move command that Blue discovered, on the other hand, is a script that will happily move things to exact coordinates (even stacking things on top of each other f you don't take this into account). It can therefore be used to more accurately reposition spawned objects, as the following example shows:

    ________el1 = game.random_range(14831,14834)
    ________el2 = game.obj_create( el1, location_from_axis (482L, 474L) )
    ________el2.rotation = 5.1
    ________el2.move(location_from_axis(482, 474))
     
  4. krunch

    krunch moving on in life

    Joined:
    Aug 9, 2005
    Messages:
    3,280
    Likes Received:
    0
    SpellSlinger various changes to the Temple.DLL

    ----------------------------------------------------------------------
    Release: Dllfix16
    ----------------------------------------------------------------------
    -Fixes the crash bug at rogue feat selection introduced in v15.

    -Adds calls to the functions load and save in module _co8init to the internal save and load routines. This allows the use of the Co8PersistentData class as a scripting sided Co8-savegame.

    -Fixes the non-proficient penalty suffered when using the dwarven waraxe two-handed with Martial Weapons All proficiency but without the EWP.

    -Brings spell Righteous Might to RAW. Bonuses to STR and CON are lowered to 4 and 2, respectively. Bonus type of AC is changed so that it no longer stacks with amulets of natural armor. DR was changed from 5 fixed to scaling per caster level.

    -Enables defending weapon property as craftable. Downsides: The crafting system does not support differentiating between ranged and melee weapons, so it can be crafted on ranged weapons. The range you can select with the slider is fixed and not dependent on the enhancement bonus of the weapon. The range maximum is set to 3 (highest enhancement bonus in the game). So show some discipline, people.

    Scripting content in this release:
    -PersistentData and various support/utility scripts.
    -Enlarge and Righteous Might spells changed to provide reach per RAW.

    ----------------------------------------------------------------------
    Release: Dllfix15
    ----------------------------------------------------------------------
    -Increases the range of random encounter maps by 1, so that the caravan encounter can be correctly handled as random encounter. (This needs scripts updates from Blue)
    -Fixes that the portrait UI at character creation did only display a part of the potraits listed in portraits.mes.

    *UPDATE(v15)*
    -Fixes the misalignment of buttons in the worldmap GUI when using non-standard resolutions.

    Testing, feedback. Thanks to Agetian for bringing the worldmap bug to my attention. The scripting part of the caravan fix is Blue's domain, as is cursing me for fixing the portrait bug.

    Requires latest CMF and dllfixes not yet included in that CMF.

    ----------------------------------------------------------------------
    Release: Dllfix14
    ----------------------------------------------------------------------
    -Fixes no break free attempt for AI controlled NPCs on entanglement. Needs updated Spell734 - Elexir of break free.py script to work correctly.
    -Reputation no. 19 now causes paladins to become fallen paladins.

    Testing, feedback. Credit for the scripting part of the paladin related fix goes to Allyx. Thanks to Blue for providing testing, feedback and scripting expertise for the entanglement fix.

    ----------------------------------------------------------------------
    Release: Dllfix13
    ----------------------------------------------------------------------
    Crafting related fixes:
    -Fixes damage type of icy burst and shocking burst.
    -Crafting SR on armors now actually produces armors that provide SR 13.
    -Changes to the SR system:
    The spell spell resistance now provides SR of the same bonus type as the items, so that SR provided by spell and items are no longer added up.
    The SR by the spell causes now only SR checks when incoming spells are non-party (like with the items). This was done to prevent 2 SR checks per incoming spell at highest SR (one for the spell, one for the items).
    -Fixes the odd bug that crafting on a +1 armor or shield would give you +2 and +3 for free.

    Movement speed related fixes:
    -Fixes the immunity of dwarves to entangle and web effects.
    -Fixes moving at 5 speed when overburdened and entangled/webbed for all critters (credit for finding that bug goes to Allyx, I wasn't even aware of that).

    As usual, these fixes might have unforeseen side effects. Testing, feedback. Special thanks go to Allyx for general pestering () and testing the fixes. And of course for spoiling the release in advance...

    *EDIT*
    v13_2:
    -Fixes specialized school spell slots being cleared by the remove surplus spell slots function.

    ----------------------------------------------------------------------
    Release: Dllfix12
    ----------------------------------------------------------------------
    -Fixes the Inspire Courage bardic music ability. Boni provided now scale correctly with bard level, and in synergy with the D20STD_F related fixes the boni for save and charm saves are now enabled.

    -Fixes the generation of the D20STD_F flags inside the dll. The original algorithm introduced a shift of all descriptor flags by 1, thus breaking all checks via these flags. The fixed algorithm enables the application of fear save bonuses, e.g. provided by Bless, Aid, Inspire Courage or Halfling racial bonus.

    While working on the courage fix I noticed that the flag for charm effects wasn't set for the appropriate effects. Hazelnut pointed out to me that the D20STD_F flags were also used in python scripting. With him providing the scripting expertise, we were able to understand and fix the problem. Hazelnut will release the updated scripts that are needed to enable the charm save bonuses of Inspire Courage. He has already released a fix for the POISON flag in the "5.0.1 Mods and Fixes" thread.

    ----------------------------------------------------------------------
    Release: Dllfix11
    ----------------------------------------------------------------------
    Update for the bonus spell slot fix:
    -TOEE gives you bonus spells for spell levels you have not yet access to, allowing you to put lower lvl spells in there. I changed my onRest surplus spell removal to cover this. TOEE will still display them as empty slots and lets you fill them, but after rest the illegal slots are empty once again.

    V11 also includes a limit worldmap fix:
    -adds the possibility to add up to 6 new travel locations to the game (but without clickable icons on the map, you can access them over the known locations list on the worldmap screen)

    BEWARE! Because the game now has to keep track of more known locations, I had to change the save/load routines for savegames. And that means all old savegames will be rendered unusable with this dll. If you still have games going on you want to finish up, don't use this for now. The new locations (speak Verbobonc and Hickory Branch) still need quite some work on behalf of the modders until they can be correctly travelled to. But should you be on the verge of starting a new game, I'd recommend using this dll. It is fully functional even though the new locations are not completely integrated.

    Note to the modders:
    I have hacked up a little console app that gives you the possibility to patch the dll according to your location changes, instead of me having to do it all by hand everytime. This tool is released in an extra thread.

    P.S. This is the heaviest modification to the dll so far, so I might have overseen possible problems. Feedback and testing...

    ----------------------------------------------------------------------
    Release: Dllfix10
    ----------------------------------------------------------------------
    -added functionality for spell slot check, making it possible to remove surplus spell slots
    -on rest all surplus spells are removed, rendering buff bonus spell slots useless and fixing spell slots from having worn stat enhancing items before

    ----------------------------------------------------------------------
    Release: Dllfix9
    ----------------------------------------------------------------------
    -rgr can now take new favored enemy at lvl15/20
    -UI is still the same, so you can only apply your bonus increase to the newly added favored enemy and the last two before that. This limits the maximum bonus you can achieve on one particular enemy.

    ----------------------------------------------------------------------
    Release: Dllfix8
    ----------------------------------------------------------------------
    -fixes lvl3+4 spells of the class spell lists of ranger and paladin not being added to known spells

    ----------------------------------------------------------------------
    Release: Dllfix7
    ----------------------------------------------------------------------
    1. The most annoying thing to a spellslinger like me: No bonus spells with enhancement items like headband of intellect etc. This is now repaired, but there's a slight disadvantage. AFAIK the items should give you spells, but not the buff spells. The fix I did gives you bonus spells for buff spells too, but: You cannot fill prepared empty spell slots in 15 mins in TOEE and you have to rest 8 hrs to prepare spells per se. And the buff spells won't hold as long.
    To all rules lawyers and experts: Have a look if the spell bonuses for the stat modifier are ok.
    To everyone: Try this out with all casters and their stats please.

    2. The reported bug with sorcerors (and I believe bards too) that all spells cast count towards the sorceror spell per lvl per day limit. Though I don't usually multiclass caster classes (caster lvl is everything), now anyone who wants can do so without some additional arbitrary penalty added by troika.
    I didn't test this with all possible combinations, so feedback would be very welcome. Looking at it from the code point of view it should work everywhere... (right, as if that would mean anything... ).

    And please (kind of repetitive, eh?): testing and feedback. So far I can count the feedback still on one hand (nearly). But then, if I go with the saying "No news is good news"... Hooray for no feedback!

    @Blue
    Should I post the dll in the mods and fixes thread, or do you want to do that?

    *edit*
    Ah, crickety. I've found another disadvantage of fix 1.: Since they never intended to give you bonus spells, there is no intrinsic update function for the memorized spells. Speak: reducing caster stats (bonus or via console) does not remove surplus spell slots. The spell per day display at the bottom is correct, but the additional spell slot will only disappear when you clear one slot of that level and leave/reenter spell selection tab. I'll see if I can do something about it, but since there is no internal function to do that it probably means lots of coding. And I don't think I have all the functions I need for that.

    If I can't fix it, do you think that this state is better than the old state? I personally think so, no respectable wizard will give up his headband of intellect. And anyone who wants to do that and is honest can fix the surplus slots as mentioned above. Any thoughts?

    ----------------------------------------------------------------------
    SpellSlinger various other changes to the Temple.DLL
    ----------------------------------------------------------------------
    monk belt abilities added
    multicaster sorcerer spellcount fix
    NPC uses Potion and gets AoO fix
    party pool with 5 PCs in-game crash fix
    Co8PersistentData class save added
    Rogue > Level 10 feats made RAW
    Discern Lies spell +30 check fix
    cleric spontaneous summoning for spell lvls 6-9 fix
    druid spontaneous summoning for spell lvls 6-9 fix

    ----------------------------------------------------------------------
    ----------------------------------------------------------------------
     
    Last edited: Jan 14, 2008
  5. krunch

    krunch moving on in life

    Joined:
    Aug 9, 2005
    Messages:
    3,280
    Likes Received:
    0
    per Allyx, Master Crafter

     
  6. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    2,958
    Likes Received:
    194
    PCs can be assigned scripts, too!

    Darmagon mentioned in one of the posts here that you can change NPCs' scripts directly via script, e.g.

    attachee.scripts[9] = 12

    To make an NPC talk like Jaroo.

    However, it seems that for some scripts, this works for PCs as well!

    So far, I've successfully attached working scripts for:

    san_dialog
    san_new_map
    san_dying
    san_exit_combat

    Unfortunately most of the others don't work, including:
    san_heartbeat
    san_first_heartbeat
    san_enter_combat
    san_end_combat
    san_start_combat
    san_hit, san_miss, san_critter_hits, san_critical_hit, etc.
    san_spell_cast, san_resurrect, san_unlock_attempt
    san_destroy
    san_disband
    san_new_sector

    Also, when you initiate dialogue with a PC, the voice doesn't play, and the pc is always marked as being not 'met' (i.e. has_met returns 0).
     

    Attached Files:

  7. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,008
    Likes Received:
    28
    Sectoring Tip

    Did you know that in order to achieve a nice consistent fade effect on the outer edges of your maps as the areas become visible, you should use a 4 - 5 coordinate wide band of impassable/flyover designations? (These are dark green in World Builder.)

    Image 1 below is an example of what a bad sectoring edge looks like.

    Image 2 below is an example of what a good sectoring edge looks like.

    Image 3 below is what your map edges should look like in WB's Visual Sector Analyzer/Painter.

    Presumably your aerial familiars could fly off into oblivion this way, but I can't think of any reason they'd want to. This is how the Troika gang seems to have done it. :thumbsup:
     

    Attached Files:

  8. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,008
    Likes Received:
    28
    Fact: using the most recent version of temple.dll with pertinent Spellslinger modifications, there is no limit to the amount of portraits ToEE can process. The limit within portraits.mes itself would seem to be 1,000 (maybe ... actually it just says '6000 -' for the NPC range, so maybe it could go even higher), but don't worry about being close to maxed out in the 500s anymore.
     
  9. Shiningted

    Shiningted I want my goat back Global Moderator

    Joined:
    Oct 23, 2004
    Messages:
    12,205
    Likes Received:
    174
    Here's an interesting thing everyone else may be aware of by I only just noticed:

    poison_dc = 10 + (spell.caster_level / 2) + game.get_stat_mod( spell.caster.stat_level_get( stat_wisdom ) )

    The relevant part is that last element: game.get_stat_mod(). This will return the modifier of the attribute.

    And to think I was calculating it by hand!
     
  10. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    2,958
    Likes Received:
    194
    A more elegant conditional test for alignment:

    It often occurs in dialogue scripting that you just want to check if the party or PC's alignment is evil or not. Usually the condition is written out this way:
    Code:
    {game.party_alignment == CHAOTIC_EVIL or game.party_alignment == NEUTRAL_EVIL or game.party_alignment == LAWFUL_EVIL}
    
    There is a more compact form for this -
    Code:
    {game.party_alignment & ALIGNMENT_EVIL != 0}
    
    Likewise, to test for goodness:
    Code:
    game.party_alignment & ALIGNMENT_GOOD != 0
    
    Lawfulness:
    Code:
    game.party_alignment & ALIGNMENT_LAWFUL != 0
    
    Chaoticness:
    Code:
    game.party_alignment & ALIGNMENT_CHAOTIC != 0
    
    This also applies to individual PCs' alignment, e.g.
    Code:
    pc.stat_level_get(stat_alignment) & ALIGNMENT_EVIL != 0
    
    A bit more indepth explanation:
    ToEE codes alignment into 4 bits - From LSB to MSB:
    Lawfulness, Chaoticness, Good, Evil

    So it's just a matter of applying a logical AND operator (&).

    You may also verify that LAWFUL_GOOD equals 5, LAWFUL_EVIL equals 9, etc. by typing it in the console.
     
  11. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,008
    Likes Received:
    28
    Caveat to Playing Movies From Dialogue

    Fact: in dialogue files, whereas having a "go to this line of dialogue" instruction in a line of dialogue that has a "carry out this script" instruction included in it as well will often cause problems (for example, with bartering), you can happily include both in a line in which you want to instruct the game to play a movie. Like so:

    Code:
    {501}{[dialogue]}{}{1}{}{510}{game.fade(0,0,311,0)}
    The movie will play, and when its done you'll return to the normal interface at the indicated line of dialogue (510 in this case). No need for any heartbeat scripts or anything like that to pick up where you left off. Very nice.
     
    Last edited: Jul 5, 2009
  12. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,008
    Likes Received:
    28
    Playing single endlsides from dialogue

    Fact: you can instruct the game to play an endslide from dialogue just like you would a movie. Like so: (enslides are in the 200 - 299 range)

    Neat!

    The endslide will play for exactly one second. Not so neat.

    If the duration of playback had been manipulatable, all sorts of possibilities would have been opened up for advancing plot through alternative non-dialogue related methods.
     
  13. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    2,958
    Likes Received:
    194
    Scout points do not seem to work from within combat mode.

    E.g. try sneaking up to Feldrin's scout and shooting him with a bow, he'll just attack you as usual. Same goes if you attack the guy behind him (he is probably also a scout). So it seems combat prevents scout points from working.
     
  14. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,008
    Likes Received:
    28
    This (or some improvisation like it) is probably already well-known amongst our finer modders, but I thought I'd post it here for reference anyway: if you want to have an NPC recover from their wounds between fights (think Smigmal Redhand in temple level 3, waiting around for you to come back so she can "finish you off" but not bothering to heal herself in the meantime), do a little script like this:

    Code:
    def get_better( attachee, pc ):
    	dice = dice_new("1d10+1000")
    	attachee.heal( OBJ_HANDLE_NULL, dice )
    	attachee.healsubdual( OBJ_HANDLE_NULL, dice )
    	return RUN_DEFAULT
    Presto, your NPC is back at full health and ready to rock again. Fire "get_better" from somewhere in a dialog line, obviously.

    (I didn't 'invent' this script, of course - just recovered it on a scavenging mission like usual. We should keep a repository of useful scripts somewhere that people can just cut and paste if they want to.)
     
  15. Shiningted

    Shiningted I want my goat back Global Moderator

    Joined:
    Oct 23, 2004
    Messages:
    12,205
    Likes Received:
    174
    In ToEEWB, there is an interesting box that allow you to change the 'name' (the col 22 number that identifies objects in many scripts). Hence, you can have many mobs of one prototype, and distinguish them with different names, allowing them to be individually identified.

    Here is an example: Rannos and Gremag's inventory box. I couldn't work out why the damn thing didn't show uo for a respawn, using its prototype number (1001) and found it had the unique name 1204. Now it respawns :)
     

    Attached Files:

Our Host!