- May 23, 2017
-
-
DarkGod authored
Object resolvers update Summary: This updates object resolvers, eliminating redundant code to ensure consistent behaviour and integrating them into the debugging object creation interface -- allowing resolver filters to be debugged directly within the debugging dialogs. It adds a new system for NPCs choosing equipment to wear based on filters, and updates ToME character class descriptors and Entity definitions to ensure only appropriate equipment is worn (to prevent wearing Objects that interfere with talents). This fixes the issue of NPCs getting added random classes with many unusable talents. (Embers and Ashes class descriptors and Entities work as before, but need to be updated to benefit from the changes.) Details: New utility functions (useful for debugging): string.fromFunction(fct, fmt) returns a string abbreviation for a function, including filepath, line numbers string.fromValue(v, recurse, offset, prefix, suffix) -- enhancement of tostring function with more thorough handling of tables and functions string.fromTable(src, recurse, offset, prefix, suffix, key_recurse): returns a single-line string representation of a table, including string representations of subtables and functions. The recursion level for both keys and values can be set. The converted string is lua source code compatible, depending on arguments. engine.Zone:checkFilter: Added documentation, can set filter.allow_uniques to allow unique items to pass the filter, special function takes the filter as its 2nd argument engine.Zone:filterToString: updated -- handles subtables, functions, and other complex values engine.Zone:makeEntity: the type parameter can be a list of entities engine.Zone:makeEntityByName: Added documentation, type can be a string descriptor used to load a base list (follows makeEntity filter.base_list) engine.Entity:resolve: Added documentation engine.Birther: Bugfix: the order of resolvers is preserved when applying birth descriptors (causes resolver.attachtinker to fail with no equipment to attach to) engine.interface.ActorInventory:initBody() May be reapplied to an actor without overwriting existing inventories (merges properties), copies the inventory definition short_name dialogs.debug.SummonCreature, dialogs.debug.RandomActor: Actors are fully resolved before added: including "addedToLevel", "on_added", "on_added_to_level" (except spawning escorts) updating for game difficulty, etc. on generation, before adding Uniques (including inventory items) are not registered in the game until the actor is actually placed. dialogs.debug:RandomObject: Can set the working actor to be a NPC (defaults to the player) New button/hotkeys to open the working actor character sheet and inventory screens Can select from one of several object resolvers, which will call the appropriate code and resolve the object. This works like other object generation, allowing preview/inspection before adding the object to the game, which is controlled by the selected resolver as normal Uniques created are not registered until actually added to the game. CharacterSheet: can always open the inventory dialog in debug mode Actor:resolveLevelTalents: code to apply self.learn_tids moved from createRandomBoss to this function (enabling this function for all Actors) New function Object:wornLocations(use_actor, weight_fn, filter_field, no_type_check) (This functionality replaces the no_npc_weapon_equip flag.) Returns a table if inventory locations where an object can be worn, filtered and sorted The "best" locations appear first, permitting Actors to automatically optimize their equipment. The default criteria are simple (based on object "power", from material level and getPowerRank), but can be updated to be more sophisticated. New function Actor:wearAllInventory(force, ...) Attempts to wear all items in main inventory, using Object:wornLocations to find the best locations (currently does not attempt to attach tinkers, aggressively remove worn items, or support psionic focus) New function Actor:updateObjectRequirements(o) Returns object requirements modified by actor talents Used by Actor:canWearObject, Object:getRequirementDesc, and resolvers.resolveObject New function Actor:searchAllInventories(o, fct) Searches all inventories for an object (including attached tinkers). Triggers an optional callback on found items. NPC:addedToLevel: classes added from higher difficulty settings allow equipment to be updated and autolevel stats (if more than one class added) calls Actor:wearAllInventory to equip objects game.state:entityFilterAlter: Added documentation, updated RandomObject help game.state:entityFilter: Added documentation, updated RandomObject help game.state:entityFilterPost: Added documentation, updated RandomObject and RandomActor help game.state:egoFilter: Added documentation game.state:applyRandomClass: Fixed a bug causing starting class stats to not be added properly Copies all class resolvers with _allow_random_boss set true (resolvers.equip: ignore_material_restriction=true) Resolvers enabled: inscription, inscriptions, auto_equip_filters, attach_tinker, inventory, drops, drop_randart The can_tinker table is copied (allows resolvers.attach_tinker to work properly) autolevel set to "random_boss" unless data.autolevel == false May set data.update_body to force adding inventory slots to the actor May set data.spend_points to spend all unspent stat points data.force_classes can take numerical indexes. Fixed a bug causing multiple forced classes to be applied in definition order rather than randomly. (Example: {"Rogue", Alchemist=true, Necromancer=true} always adds the Rogue class first then Alchemist and Necromancer in random order, before adding any other random classes) game.state:createRandomBoss: Allows learn_tids to be applied by resolveLevelTalents (random class talents are learned before attempting to wear equipment with NPC:addedToLevel) No longer removes equip and drops resolvers from the base NPC This preserves important drops and equipment (updated to "boss" levels) required for NPC talents (i.e. randelite Naga Mymidons are not spawned disarmed/improperly armed with certain classes) -- applyRandomClass replaces equipment and updates inventory filters as needed. New resolver -- resolvers.auto_equip_filters(t, readonly): Sets filters by inventory slot to be checked before automatically wearing objects. Can be used by class descriptors and general npc definitions to ensure that equipment automatically equipped will not interfere with talents. Input is either a table of filters or a class descriptor name to load the filters from the referenced birth descriptors (i.e. resolvers.auto_equip_filters("Archmage")). As usual, multiple copies of this resolver overwrite each other by inventory slot (use readonly to prevent), so randbosses with more than one class will generally use the filters for the last class applied. (i.e. Alchemist (applied first), Rogue (applied second) will preferentially equip daggers in MAINHAND/OFFHAND and alchemist gems in QUIVER) New general object resolver function -- resolvers.resolveObject(e, filter, do_wear, tries): Called by all filter-based object resolvers for consistency, interprets the filter fields: base_list, random_art_replace, alter (takes the resolving actor as an argument), autoreq (can trigger actor levelup and learning talents in addition to stats), force_inven, force_item, force_drop, never_drop, _use_object (sets a pre-resolved object to use, skipping random generation), replace_unique (filter for generating a replacement for a specific object) Uses Object:wornLocations to find the best locations in which to wear objects. Correctly handles replaced objects and always places unworn objects into main inventory unless explicitly forbidden. (Calls game.zone:addObject only for objects that are actually added to the actor.) Documentation serves as core help in RandomObject dialog for resolvers. resolvers.equip: updated to use resolvers.resolveObject resolvers.inventory: updated to use resolvers.resolveObject resolvers.drops: updated to use resolvers.resolveObject resolvers.attachtinker: updated to use resolvers.resolveObject, will place the tinker in main inventory if .keep_object is set resolvers.drop_randart: interprets .data field as input to game.state:generateRandart, may set ._use_object to use a pre-resolved object and .no_add to return the generated object instead of adding it to inventory Class Descriptors updated with inventory filters: Spellpower based casters (Anorithil, Paradox Mage, Archmage, Alchemist, Necromancer, Corruptor): MAINHAND: staff OFFHAND: none unless a 1H weapon is equipped in MAINHAND Alchemist: QUIVER: alchemist-gem Oozemancer, Summoner, Doomed: MAINHAND/OFFHAND: mindstars Stone Warden: MAINHAND/OFFHAND: shield or weapon with the block combat field Brawler: MAINHAND/OFFHAND: unarmed Reaver: MAINHAND/OFFHAND: 1H weapon Archer: MAINHAND: Archery weapon QUIVER: Ammo must match type of MAINHAND weapon Temporal Warden: MAINHAND: longbow OFFHAND: none QUIVER: Ammo must match type of MAINHAND weapon QS_MAINHAND: 1H weapon Sun Paladin, Bullwark: MAINHAND: 1H weapon OFFHAND: shield or weapon with the block combat field BODY: heavy or massive armor Berzerker: MAINHAND: 2H weapon OFFHAND: unarmed Rogue, Shadowblade, Marauder: MAINHAND/OFFHAND: dagger Rogue, Shadowblade: BODY: light or cloth armor Skirmisher: MAINHAND: sling OFFHAND: shield or weapon with the block combat field QUIVER: Ammo must match type of MAINHAND weapon Some NPC Entity updates: Bosses in Trollmire, The Maze, Daikara, Dreadfell, Elven Ruins, High Peak, Orc Prides, Assassin Lord, Tannen, Golbug, Corrupted Oozemancer, Some major and minor demons, various caster npcs, many orcs, thieves, minotaurs, yaechs, naga See merge request !455
-
Hachem_Muche authored
string.fromValue can take negative recursion level to get std tostring Remove debugging code
-
- May 22, 2017
-
-
Hachem_Muche authored
-
Hachem_Muche authored
-
Hachem_Muche authored
New function: Object:wornLocations(use_actor, weight_fn, filter_field, no_type_check) Replaces Actor:getFilteredInventories Returns a table if locations (inventory and slot) where an object can be worn, filtered and sorted The locations are sorted ("best" first), permitting Actors to automatically optimize their equipment. The default weight_fn is a simple formula (based on object "power" from material level and getPowerRank), but can be updated to be more sophisticated. no_type_check can be specified to allow different type replacement equipment for unfiltered inventories game.state:applyRandomClass: data.update_body can be a list of inventory slots specifying which inventories to define/update when applying a class game.state:createRandomBoss: Base actor equipment resolvers are updated to "boss" level drops. resolvers.generateObject renamed resolvers.resolveObject: new filter fields supported: replace_unique: specifies a filter to replace a unique that could not be created (similar to randart_replace, but the replacement object is equipped rather than the existing unique) check_antimagic: force an antimagic check even if the object will not be worn resolvers.auto_equip_filters(t, readonly): set readonly to specify an inventory filter that cannot be overwritten (to ensure specific equipment is not removed, i.e. Elandar will not replace the Staff of Absorption if he gets extra classes from higher game difficulties) Object resolvers add the field _resolver_type to the objects they create. dialogs.debug.RandomObject: fixed a bug causing resolvers.equip to preview ineligible equipment (antimagic check) dialogs.debug.SummonCreature: fixed a bug causing summoned actors to try to wear equipment before being fully resolved Added/updated auto_equip_filters for a number of NPCs
-
- May 21, 2017
-
-
Hachem_Muche authored
-
- May 17, 2017
-
-
Hachem_Muche authored
Spellpower based casters (Anorithil, Paradox Mage, Archmage, Alchemist, Necromancer, Corruptor): MAINHAND: staff OFFHAND: none unless a 1H weapon is equipped in MAINHAND Alchemist: QUIVER: alchemist-gem Oozemancer, Summoner, Doomed: MAINHAND/OFFHAND: mindstars Stone Warden: MAINHAND/OFFHAND: shield or weapon with the block combat field Brawler: MAINHAND/OFFHAND: unarmed Reaver: MAINHAND/OFFHAND: 1H weapon Archer: MAINHAND: Archery weapon QUIVER: Ammo must match type of MAINHAND weapon Temporal Warden: MAINHAND: longbow OFFHAND: none QUIVER: Ammo must match type of MAINHAND weapon QS_MAINHAND: 1H weapon Sun Paladin, Bullwark: MAINHAND: 1H weapon OFFHAND: shield or weapon with the block combat field Berzerker: MAINHAND: 2H weapon OFFHAND: unarmed Rogue, Shadowblade, Marauder: MAINHAND/OFFHAND: dagger Rogue, Shadowblade: BODY: light or cloth armor Skirmisher: MAINHAND: sling OFFHAND: shield or weapon with the block combat field QUIVER: Ammo must match type of MAINHAND weapon Some NPC Entity updates: Bosses in Trollmire, The Maze, Daikara, Dreadfell, Elven Ruins, High Peak, Orc Prides, Assassin Lord, Tannen, Golbug, Corrupted Oozemancer, Some major and minor demons, various caster npcs, many orcs, thieves, minotaurs, yaechs, naga
-
Hachem_Muche authored
Actors are fully resolved before added: including "addedToLevel", "on_added", "on_added_to_level" (except spawning escorts) updating for game difficulty, etc. on generation, before adding Uniques (including inventory items) are not registered in the game until the actor is actually placed. dialogs.debug:RandomObject: Can set the working actor to be a NPC (defaults to the player) New button/hotkeys to open the working actor character sheet and inventory screens Can select from one of several object resolvers, which will call the appropriate code and resolve the object. This works like other object generation, allowing preview/inspection before adding the object to the game, which is controlled by the selected resolver as normal Uniques created are not registered until actually added to the game. CharacterSheet: can always open the inventory dialog in debug mode
-
- May 16, 2017
-
-
Hachem_Muche authored
engine.Zone:checkFilter: Added documentation, can set filter.allow_uniques to allow unique items to pass the filter, special function takes the filter as its 2nd argument engine.Zone:filterToString: updated -- handles subtables, functions, and other complex values engine.Zone:makeEntity: the type parameter can be a list of entities engine.Zone:makeEntityByName: Added documentation, type can be a string descriptor used to load a base list (follows makeEntity filter.base_list) engine.Entity:resolve: Added documentation engine.Birther: Bugfix: the order of resolvers is preserved when applying birth descriptors (causes resolver.attachtinker to fail with no equipment to attach to)
-
Hachem_Muche authored
engine.interface.ActorInventory:initBody may be reapplied to an actor without overwriting existing inventories (merges properties)
-
Hachem_Muche authored
string.fromFunction(fct, fmt) returns a string abbreviation for a function, including filepath, line numbers string.fromValue(v, recurse, offset, prefix, suffix) -- enhancement of tostring function with more thorough handling of tables and functions string.fromTable(src, recurse, offset, prefix, suffix, key_recurse): returns a single-line string representation of a table, including string representations of subtables and functions. The recursion level for both keys and values can be set. The converted string is lua source code compatible, depending on arguments.
-
- May 02, 2017
-
-
DarkGod authored
-
- Apr 28, 2017
-
-
DarkGod authored
-
- Apr 27, 2017
- Apr 25, 2017
-
-
DarkGod authored
Added support for visible talents, items and playerdoll images on online character sheets on te4.org
-
- Apr 22, 2017
-
-
DarkGod authored
Fixed joining chat channels on star in some rare cases, one of the reason for "server doesnt work: it did work you just didnt saw it
-
- Apr 20, 2017
-
-
DarkGod authored
-
DarkGod authored
Talents that generate resources state "FOO gain: X" instead of "FOO cost: -X"
-
DarkGod authored
-
DarkGod authored
TextKeyBindings Updated Textbox.lua and DebugConsole.lua to handle ctrl-BACKSPACE (delete to beginning of line) and ctrl-DELETE (delete to end of line) keybindings. Updated the RandomActor and RandomObject dialogs. The RandomActor.lua: autofocuses on the random actor placement button when opened. Placed actors are full clones for the currently generated actor, with special handling for escorts. See merge request !453
-
- Apr 17, 2017
-
-
Hachem_Muche authored
Updated Textbox.lua and DebugConsole.lua to handle ctrl-BACKSPACE (delete to beginning of line) and ctrl-DELETE (delete to end of line) keybindings. Updated the RandomActor and RandomObject dialogs. The RandomActor.lua: autofocuses on the random actor placement button when opened. Placed actors are full clones for the currently generated actor, with special handling for escorts.
-
DarkGod authored
New static method Object:descCombat() to let addons pass a custom combat table and get a correct description
-
- Apr 15, 2017
-
-
DarkGod authored
-
DarkGod authored
Debugging update: Random Actors and Objects Added the copy keybinding (ctrl-c) to the Textbox ui element. The multiButtonPopup takes a default choice, the choice function is optional, and only valid choices can be focused. engine.zone:addEntity will not apply actor_adjust_level more than once Updated resolvers.talented_ai_tactic to work correctly after multiple calls (solves an upvalue issue) AdvanceActor dialog: Stat values are split into base and bonus values, and base (maximum allowed by level) and bonus stat values (estimated, +40 at level 50) and are automatically updated when the character level is updated. Check boxes enable/disable character level and stat values independently. By default, the actor (player) level is set to 50 and all stats are forced to 60 base, 40 bonus (100 Total), matching standard scaling limits. Added a new Dialog: RandomActor accessible as (" Random Actor") from the SummonCreature dialog: Randomly generates actors based on an input filter or Randombosses based on generation data and the current random actor (if available). Added a new Dialog: RandomObject accessible as (" Random Object") from the CreateItem dialog: Randomly generates objects based on an input filter, randomly generates base objects ready for conversion to Randarts, and creates Randarts based on the base object (if available or random) plus generation data. The new dialogs include context sensitive help and allow generated actors and objects to be previewed via tooltip, character sheet, and lua inspect. Keybinds ctrl-c and ctrl-v allow Filters and Data (text) to be copied and pasted to/from the appropriate dialog inputs, facilitating development and testing of source code. Entity generation for the new dialogs uses the current zone's npc and object lists and runs in the Lua Console environment. The destination of objects created in the debugging dialogs can be selected from either Player Inventory (default), Drop at player position, or NPC inventory for a target actor. The debug dialogs are not cancelled when placing creatures or objects, allowing multiple entities to be created without reopening them. See merge request !452
-
Hachem_Muche authored
Updated resolvers.talented_ai_tactic to work correctly after multiple calls (solves an upvalue issue) Added a new Dialog: RandomActor accessible from the SummonCreature dialog (" Random Actor"): Randomly generates actors based on an input filter or Randombosses based on generation data and the current random actor (if available). Added a new Dialog: RandomObject accessible from the CreateItem dialog (" Random Object"): Randomly generates objects based on an input filter, randomly generates base objects ready for conversion to Randarts, and creates Randarts based on the base object (if available or random) plus generation data. The new dialogs include context sensitive help and allow generated actors and objects to be previewed via tooltip, character sheet, and lua inspect. Keybinds ctrl-c and ctrl-v allow Filters and Data (text) to be copied and pasted to/from the appropriate dialog inputs, facilitating development and testing of source code. Entity generation uses the current zone's npc and object lists and runs in the Lua Console environment. The destination of objects in the debugging dialogs can be selected: either Player Inventory (default), Drop at player position, or NPC inventory for a target actor. The debug dialogs are not cancelled when placing creatures or objects, allowing multiple entities to be created without reopening them.
-
- Apr 14, 2017
-
-
Hachem_Muche authored
multiButtonPopup: takes a default choice, the choice function is optional, and only on valid choices can be focused.
-
- Apr 13, 2017
-
-
DarkGod authored
-
DarkGod authored
-
DarkGod authored
Saves update Updated Actor.on_set_temporary_effect to use Combat:checkHitOld instead of Combat:checkHit, which uses a broader curve when making saves for temporary effects. This results in saves for temporary effects (when .apply_power is set) always having a chance both to succeed or to fail, and bonuses to save values are always useful (more is always better) regardless of the power of the attack saved against. In addition, if a save is failed, there is always a chance to reduce the duration of the effect, even if the save is less than the applied power. The expected duration on a failed save steadily decreases as a save increases versus the power applied. (This is an evolution of the changess discussed in http://forums.te4.org/viewtopic.php?f=36&t=36715.) The effect of saves on durations can be easily tuned by modifying the variables mean_fact and std_dev as documented in the code. Overall, these changes are a modest buff to saves against temporary effects, while making them less reliable at high values. This should help curb chain CC issues that can happen against higher level NPCs, since not all effects will land with full duration, while helping prevent effective immunity for the same NPCs. Additional Fixes: The duration of an existing effect will not be reduced by setting a new effect with a shorter duration (controlled by on_merge for some effects). This means that an effect will not be removed if you save against another application of the same effect. Examples (these values can be tuned): 80 save vs 60 power (end game levels): Current: 95% chance to save. Save duration 100% (Always reduces duration to 0 even on a failed save.) As proposed: 76% chance to save. Mean save duration is ~26% increasing save from 20 to 30 vs 50 power: Current: 5% -> 5% (no change) chance to save, save duration 100% -> 100% (no change) As proposed: 15% -> 21% chance to save, Mean save duration 94% -> 86% increasing save from 45 to 55 vs 50 power: Current: 38% -> 63% chance to save, save duration 100% -> 75% As proposed: 40% -> 60% chance to save, Mean save duration 66% -> 44% See merge request !448
-
- Apr 12, 2017
-
-
Hachem_Muche authored
-
Hachem_Muche authored
Stat values are split into base and bonus values, and base (maximum allowed by level) and bonus stat values (estimated, +40 at level 50) are automatically updated when the character level is updated. Check boxes enable/disable character level and stat values. By default, the actor (player) level is set to 50 and all stats are forced to 60 base, 40 bonus (100 Total), matching standard scaling limits.
-
DarkGod authored
-
- Apr 10, 2017
- Apr 08, 2017
-
-
DarkGod authored
Additional Melee Scaling Updated Combat:combatDamage to add total weapon stat bonuses to the combatDamagPower (affecting the multiplier). The effect is to curb runaway scaling of very high stat bonuses (e.g. Temporal Hounds, etc.) while restoring most combat damage to previous levels. Added an extra line in the Character sheet (active when debug mode is enabled) showing the original combat damage for comparison. (This is intended to be temporary -- remove the marked code after rescaling of melee damage is set.) See merge request !451
-
Hachem_Muche authored
-
DarkGod authored
-