Well whaddya know?

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

  1. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    2,164
    Likes Received:
    18
    Summon Monster Spell

    1. You can summon multiple monsters with the same spell, by repeating the summon_monster command.
    E.g. to summon 3 monsters:
    Code:
    spell.summon_monsters( 1, spell_arg)
    spell.summon_monsters( 1, spell_arg)
    spell.summon_monsters( 1, spell_arg)
    
    2. You can make the summon a controllable NPC:
    Code:
    spell.summon_monsters( [color=red][b]0[/b][/color], spell_arg)
    



    Why is that, by the way?
     
  2. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    10,893
    Likes Received:
    7
    I can't remember anymore (must have blacked it out) but it must have been something pretty serious. ;)
     
  3. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    10,893
    Likes Received:
    7
    Fact: the game always looks for objects based on the object name first, as defined in oname.mes (as opposed to a proto number), even though not all objects have object names. If an object doesn't have an object name, the game will then look for its proto number.

    This means that if you have a script that is looking for a proto number but that proto has an object name assigned, the script will fail because the game is looking for that object's object name instead, and you probably won't have any idea why the script's not working for like an hour and a half.
     
  4. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    10,893
    Likes Received:
    7
    Tip: If the files townmap_ui_placed_flag_text.mes (data\mes) and townmap_ui_placed_flag_locations (data\rules) aren't synched, the game will crash at startup. (Must have identical map numbers, etc.)
     
  5. FGWquester

    FGWquester Member

    Joined:
    Jun 2, 2012
    Messages:
    4
    Likes Received:
    0
    With obj_f_weapon_damage_dice, the number translates to XdY using the following formula: 128Y + X

    The limit is 16383 or 127d127. Anything higher uses the remainder of dividing the number by 16384.

    Example: for a weapon that does 1d10, use obj_set_int(195, 1281)
    or use obj_set_int(obj_f_weapon_damage_dice, 1281)

    I have not found this by searching, but it is possible this is common knowledge. If this is too common, feel free to keep the thread clean by deletion.
     
    Last edited: Oct 15, 2012
  6. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    10,893
    Likes Received:
    7
    Just a heads-up: MapLimits.mes does not like empty map entries. e.g.

    Code:
    {5135}{1540,-11788,-1520,-15106}
    {5136}
    {5137}{2040,-11774,-2040,-15106}
    Will this crash the game? Of course not. ToEE's perversions work in mysterious ways, so that would be too overt. Instead, it subtlely creates bizarre behavior in map limits (the things that keep any map from scrolling to infinity in any direction) that fall after the empty entry.

    I noticed this when the Verbobonc sewers mysteriously stopped allowing access to the very bottom of the map. After hours of fiddling with the map limits numbers themselves to no effect, I filled in an empty entry (a Verbobonc shop that had been removed) with random figures from another entry and presto, everything below that (sewers included) worked properly again.
     
  7. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    10,893
    Likes Received:
    7
    Turns out I was wrong about this, and the implications are significant. The duration of an endlside, it seems, is determined by the duration of it's accompanying .mp3 file. This means we can indeed play set length endslides basically anywhere we want. I'll hold forth on more detail elsewhere.
     
  8. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    10,893
    Likes Received:
    7
    Fact: Want to play a queue of slides without ending the game? Use this:

    Code:
    game.moviequeue_play()
    Sample script:

    Code:
    def play_four_slides():
    	game.moviequeue_add(xxx)
    	game.moviequeue_add(xxx)
    	game.moviequeue_add(xxx)
    	game.moviequeue_add(xxx)
    	game.moviequeue_play()
    	return RUN_DEFAULT
    That's it.
     
  9. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    2,164
    Likes Received:
    18
    san_insert_item fires before you sell an item.

    This may allow you to manipulate prices / create refunds scripts for specific items / vendors / states etc.
     
  10. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    2,164
    Likes Received:
    18
    How to prevent AoO when stopping combat

    Sometimes you have spellcasters or the like who are set to drink a potion or cast a spell in their AI. If they also stop the combat to initiate dialog, your adjacent PCs may sneak in an AoO, making the scripting look weird. (in fact, sometimes the animation may loop idefinitely)

    To counter this, make the san_start_combat return SKIP_DEFAULT instead of RUN_DEFAULT. E.g. Falrinth's script will now be modified to be:

    Code:
    def san_start_combat(...):
        ....
        if (obj_percent_hp(attachee) < 50):
    		for pc in game.party:
    			attachee.ai_shitlist_remove( pc )
    #		game.global_flags[822] = 1
    		if (game.global_vars[901] == 0):
    			leader.begin_dialog( attachee, 200 )
    			[B]return SKIP_DEFAULT[/B]
    		elif (game.global_vars[901] == 1):
    			leader.begin_dialog( attachee, 130 )
    			[B]return SKIP_DEFAULT[/B]
    
    This will prevent the AI from taking action, and thus not provoke an AoO.

    (I also implemented this in the Traders' scripting a while back)
     
  11. Shiningted

    Shiningted I want my goat back Global Moderator

    Joined:
    Oct 23, 2004
    Messages:
    11,453
    Likes Received:
    6
    People probably know this, but consider this from #10:
    If you spawn an NPC with waypoint_day and waypoint_night flags set (or set the flags when you spawn them), then assign standpoints using Ag's method above, they will walk to those standpoints.

    Waypoint walking for spawned critters, not just mobs. Yay! Tested in several encounters in KotB.
     
  12. Shiningted

    Shiningted I want my goat back Global Moderator

    Joined:
    Oct 23, 2004
    Messages:
    11,453
    Likes Received:
    6
    Two things

    Firstly, a hideous bug that held me up for hours:

    I spawned a critter at the top of a climb, turned him toward the game leader, then used is_better_to_talk() to start the conversation (in case the game leader knocked himself out in the climb).

    It didn't work.

    Much swearing, screaming and abuse later, it turned out that speaker.can_see(listener) wasn't working: or, it was working too well. In fact, it was firing BEFORE the critter had turned toward the game leader, and thus couldn't 'see' him. Setting the critter's rotation in the general direction of the party when spawning, fixed it.

    Secondly, something more positive: this works right in dlg.

    pc.d20_query(Q_Critter_Is_Encumbered_Heavy) or pc.d20_query(Q_Critter_Is_Encumbered_Overburdened)
     
  13. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    2,164
    Likes Received:
    18
    Faction Reputation FUBAR:

    Apparently, if a critter belongs to two factions that are affected by the same reputation, only the first one will count.

    e.g. the KotB watchmen have factions 1, 10

    Enemy of the Keep reputation was:

    Code:
    {10}{0 0 0, -21 1 -61 10 -61 17 +10 2 +20 7 }	// Enemy of Keep - done
    I expected the watchmen to go KOS when the reputation was in effect, but they didn't.

    I checked their reaction_get, and it returned 29 - i.e. it only counted the -21 modifier, and not the -61 (which would make them go hostile).

    So I swapped the order in the reputation definition:

    Code:
    {10}{0 0 0, -61 10 -61 17 -21 1 +10 2 +20 7 }	// Enemy of Keep - done
    Et voila. (their reaction was now -11, which made them KOS)


    The takeaway is to be careful with reputation definitions and thoroughly test, with the above in mind!
     
  14. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    10,893
    Likes Received:
    7
    It looks like your effects aren't separated by commas, something I figured out the hard way in ToEE a while ago. Should look like this:

    Code:
    {1}{0 0 0, -100 49, -100 64, -30 9} //Butcher of Hommlet
    I discovered that eventually (it was a vanilla bug) by reading the commented text at the top of gamerep.mes, which says at one point:

    Code:
    // Each reputation can then have up to 5 effects, [B]separated by commas[/B]
    Then it all fell into place, lol.

    Sorry if I'm not comprehending what you're saying deeply enough or something - been out of the tech stuff for a while. ;)
     
  15. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    2,164
    Likes Received:
    18
    I had a feeling that wasn't the whole picture, thus the line at the bottom :)
     

Share This Page

Our Host!