Advertisement
Guest User

Untitled

a guest
Oct 24th, 2017
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.06 KB | None | 0 0
  1. This is going to be a very long post, apologies in advance. I also want to preface this with as much love as I can. This genre continues to be one of my favorites, and I have really been enjoying my time modding it. I only ask all of this so I can help contribute to the growth and survival of this genre, and thus, Divinity itself. As always, I appreciate any time Larian can take out of their schedule to discuss or read this feedback. Know that I make this feedback as a source of ideas to draw on not only for future Divinity 2 patches, but for the future of the engine/editor in general.
  2.  
  3. Also, I only use the word Iterator on some of these calls to denote a loop. You guys seem to view an Iteration as an async process in some spots, so choose whatever internal definition you need. I am simply using it to make it explicit that I am doing a loop.
  4.  
  5. First, I want to point to a post I made a few weeks back, http://larian.com/forums/ubbthreads.php?ubb=showflat&Number=628376#Post628376. I will be re-hashing some of the points made in this post as I have more perspective and can better articulate what I feel is required. That being said, here we go.
  6.  
  7.  
  8. Script
  9.  
  10. I will be providing proposed Osiris Script APIs in each section, but here I want to specifically address the absence of two very important methods.
  11.  
  12. String.Split() and String.SubStr()
  13.  
  14. These are important because it lets us create naming schemas. For example:
  15. ASC_PROC_75_LightningBolt
  16.  
  17. With String.Split, I could split something like this up into a projectile (LightningBolt) and a potency (75). This, combined with the suggested ApplyDamage calls, is incredibly powerful. I could achieve similar things with String.SubStr, but it would be more unwiedly. Thus, I propose the following Queries.
  18.  
  19. String -> StringSplit((STRING)_String, (STRING)_Delimiter, (INTEGER)_Index, [OUT](STRING)_Result)
  20. String -> StringSplitIterator((STRING)_String, (STRING)_Delimiter, [OUT](STRING)_Result)
  21. String -> StringSub((STRING)_String, (INTEGER)_Start, (INTEGER)_End, [OUT](STRING)_Result)
  22.  
  23. I would imagine these are both pretty simple implementations as they likely map to very simple underlying workflows.
  24.  
  25. To make my case stronger, here is a usecase I would actually use, right now.
  26.  
  27. Skillnames:
  28. ASC_FAKE_MODS_BOW-CROSSBOW_Ricochet
  29. ASC_BOW_Ricochet
  30. ASC_CROSSBOW_Ricochet
  31.  
  32. IF
  33. CharacterUsedSkillOnTarget(_Caster, (CHARACTERGUID)_Target, _Skill)
  34. AND
  35. StringContains(_Skill, "_FAKE_", 1)
  36. AND
  37. StringSplit(_Skill, "_", 4, _ModifierGroup)
  38. AND
  39. StringSplitIterator(_ModifierGroup, "-", _Status)
  40. AND
  41. StringConcatenate("ASC_", _Status, _Modifier)
  42. AND
  43. HasActiveStatus(_Modifier, 1)
  44. AND
  45. StringSplit(_Skill, "_", 5, _SkillName)
  46. AND
  47. StringConcatenate(_Modifier, "_" , _First)
  48. AND
  49. StringConcatenate(_First, _SkillName, _RicochetToUse)
  50. THEN
  51. CharacterUseSkill(_Caster, _RicochetToUse, _Target, 1, 1);
  52.  
  53.  
  54. This lets me designate skills as "Fake", and then based on criteria hotswap them with another skill, allowing me to dynamically change skills on the fly. The problem is, because I don't have a String.Split() call, I have to perform a number of lookup calls (One for status, One for Skills to map to, and possibly one for Animation not listed here. There might be more as well as I get further into this) I know it isn't easy to read, but it's a common structure I can use that would be efficient as hell both in performance and long-term resource usage as I expect some of these lists to grow very, very large.
  55.  
  56.  
  57. Runes
  58.  
  59. Stats -> Extra Properties -> Self:OnEquip
  60.  
  61. Runes either need to support OnEquip and have the act of socketing them trigger OnEquip, or there needs to be an event specific to runes (like OnSocket) that fires upon
  62. - Socketing a rune to an equipped item
  63. - Equipping an item with a rune
  64. - Unsocketing a rune on an equipped item
  65. - Unequipping an item with a rune
  66.  
  67. Ideally runes would just be metadata to equipment. Would make this very simple and intuitive.
  68.  
  69. The use case for this is drastically expanded itemization. Statuses are regarded by many as the best hook between an item and a script, and for good reason. Being able to have runes that grant OnEquip statuses would be huge.
  70.  
  71. [EVENTS]
  72. Script -> OnRuneSocketedInItem((CHARACTERGUID)_Socketer, (ITEMGUID)_Rune, (ITEMGUID)_Item), (STRING)_ItemSlot)
  73.  
  74. [QUERIES]
  75. Script -> GetItemRuneIterator((ITEMGUID)_Item, [OUT](ITEMGUID)_Rune)
  76. Script -> GetItemRuneAtSocket((ITEMGUID)_Item, (INTEGER)_Socket, [OUT](ITEMGUID)_Rune)
  77.  
  78. [CALLS]
  79. Script -> RemoveItemRuneAtSocket((ITEMGUID)_Item, (INTEGER)_Socket)
  80. Script -> AddItemRuneAtSocket((ITEMGUID)_Item, (INTEGER)_Socket)
  81.  
  82. The above assumes Runes would be treated as stand-alone instances of an Item Template. If Larian would prefer the approach of simply adding metadata to an Item Instance (I suspect this will be easier), see below as I have another issue to bring up with Item metadata.
  83.  
  84. The usecase for this I think is very simple. Being able to query and interact with an object in the game should not be something we are lacking. I think Runes have a lot of potential as customizable progression, but their current state as stat stones is causing them to not realize their full potential. Being able to query this data will let us do far more things, such as allowing Runes to add proc effects to gear. (I'm ignoring Tags for now because that's going to be it's own thing)
  85.  
  86.  
  87.  
  88.  
  89. Items
  90.  
  91. Stats -> Tags
  92. Script -> Item/Tag interaction
  93. See the Tags section below.
  94.  
  95. [QUERIES]
  96. Script -> GetItemStatIterator((ITEMGUID)_Item, [OUT](STRING)_StatName)
  97. Script -> GetItemProperty((ITEMGUID)_Item, (STRING)_StatName, [OUT](INTEGER)_Amount)
  98.  
  99. Script -> GetItemPropertyStatusIterator((ITEMGUID)_Item, (STRING)_Status, (STRING)_Trigger)
  100. Script -> GetItemPropertyStatus((ITEMGUID)_Item, (STRING)_Status, (STRING)_Trigger)
  101. _Trigger defined as one of the following: ["OnEquip", "OnHit", "OnAttacked", "OnBlock", etc] //Optional but would be nice
  102.  
  103. [CALL]
  104. Script -> SetItemLevel((ITEMGUID)_Item, (INTEGER)_Level)
  105. Script -> LevelUpItem((ITEMGUID)_Item)
  106.  
  107.  
  108. This is more what I think will be worthwhile in doing. Assuming Larian wants to treat Runes as metadata, calls like this make more sense. Ultimately, I don't think modders will care too much about what a rune does (Unless it's to add or remove one), so long as we can flag a weapon with a rune in some way that we can query. As of right now, finding out what an item does is very difficult due to the random generation.
  109.  
  110. Also, I think having a way to interact with item level in script would be a nice quality of life change, especially in Divinity 2 where level and tier are vastly more defined than Divinity 1.
  111.  
  112.  
  113. Combat
  114.  
  115. Stats -> Statuses
  116. Statuses are currently incapable of critical hits. That being said, if you guys implement the ApplyDamage calls, this ultimately won't matter (but would still be nice!).
  117.  
  118. This also applies to Healing.
  119.  
  120.  
  121. [EVENTS]
  122. Script -> OnObjectBeginAttack((GUIDSTRING)_Defender, (GUIDSTRING)_AttackerOwner, (GUIDSTRING)_Attacker)
  123.  
  124. We currently have a way to determine when someone attacked something, and when a skill was used. We have statuses to hook into when skills hit, so we are missing a way to determine when an attack is started. This is important because it gives us a hook that we can use to override an attack with something else. There are a ton of uses for this, from status effects to replacing what a "basic attack" does.
  125.  
  126.  
  127. Script -> CharacterReceivedDamage((GUIDSTRING)_Source, (CHARACTERGUID)_Target, (INTEGER)_Damage, (STRING)_DamageType)
  128.  
  129. Rimevan has already commented on this one, just re-listing it to keep it in everyones mind. This call was especially neglected, originally only listing _Target.
  130.  
  131.  
  132. Script -> CharacterVitalityChanged((CHARACTERGUID)_Target, (REAL)_Percentage, (INTEGER)_Amount)
  133.  
  134. Bugfix, imo. Percentage should be a REAL, not an Integer. Also, RecievedDamage returns an exact amount, but VitalityChanged does not. This seems arbitrarily limiting.
  135.  
  136.  
  137. Script -> CharacterRecievedHealing((GUIDSTRING)_Source, (CHARACTERGUID)_Target, (INTEGER)_Amount[, (STRING)_ArmorType])
  138.  
  139. Making this consistent with RecievedDamage. This call doesn't exist, but it would really be nice as VitalityChanged alone isn't enough design space due to it being an inaccurate percentage. What sets this apart from VitalityChanged is this is specifically a result of someone healing something, not an arbitrary change in health.
  140.  
  141.  
  142. Script -> CharacterArmorRecievedDamage((CHARACTERGUID)_Target, (GUIDSTRING)_Source, (INTEGER)_Damage, (STRING)_DamageType, (STRING)_ArmorType)
  143.  
  144. We currently have no way to know if armor was damaged. Checking on an onDamage event is only viable if we don't have something in place that heals
  145.  
  146. [QUERIES]
  147. Script -> GetStatusDuration((GUIDSTRING)_Target, (STRING)_Status, [OUT](REAL)_Duration)
  148. Script -> GetSurfaceGroundLifetime((GUIDSTRING)_Target, [OUT](REAL)_Lifetime)
  149. Script -> GetSurfaceCloudLifetime((GUIDSTRING)_Target, [OUT](REAL)_Lifetime)
  150. Script -> GetSurfaceGroundSize((GUIDSTRING)_Target, [OUT](INTEGER)_Size)
  151. Script -> GetSurfaceCloudSize((GUIDSTRING)_Target, [OUT](INTEGER)_Size)
  152.  
  153. For DoT playstyles, these calls would be amazing. Being able to create playstyles around feeding a surface or status and then exploding it based on size and/or duration sounds like a fun playstyle. Note that I am aware Shouts can consume surfaces with increasing potency of effects, but there is no way to Query for the "scale" of that effect, so there is no way to create an instance of remote damage with it.
  154.  
  155.  
  156.  
  157.  
  158. [CALLS]
  159. Script -> ApplyDamage((GUIDSTRING)_Source, (GUIDSTRING)_Target, (INTEGER)_Damage, (STRING)_DamageType[, (INTEGER)_DamageRange, (STRING)_AbilityType), (INTEGER)_CanCriticalHit, (INTEGER)_CanMiss])
  160.  
  161. Script -> ApplyDamageMod((GUIDSTRING)_Source, (GUIDSTRING)_Target, (INTEGER)_DamageMod, (STRING)_DamageType[, (INTEGER)_DamageRange, (STRING)_AbilityType), (INTEGER)_CanCriticalHit, (INTEGER)_CanMiss])
  162.  
  163. Script -> ApplyDamageWeaponMod((GUIDSTRING)_Source, (GUIDSTRING)_Target, (INTEGER)_DamageMod, (STRING)_DamageType[, (INTEGER)_DamageRange, (STRING)_AbilityType), (INTEGER)_CanCriticalHit, (INTEGER)_CanMiss])
  164.  
  165. Script -> ApplyDamagePercent((GUIDSTRING)_Target, (GUIDSTRING)_Source, (REAL)_Percent, (STRING)_DamageType)
  166.  
  167. Rehashed this greatly from the forum post and expanded on it now that I know what's going on. These 4 calls will be integral for more advanced effects and I already have a ton of use cases for these (Hybrid Damage, Damage Over Time, Scaling Damage).
  168.  
  169. I specifically am trying to not include a "Skill" definition here because I want these damage attributes to be variable, not static.
  170.  
  171. The last one is more to give us a percentile option that follows the semantics of dealing damage (It's dealt TO something, BY something). I wouldn't expect this one to scale, only to attribute the damage properly.
  172.  
  173.  
  174. Script -> ApplyHeal((GUIDSTRING)_Source, (GUIDSTRING)_Target, (INTEGER)_Heal[, (INTEGER)_CanCriticalHit, (STRING)_ArmorType]);
  175. Script -> ApplyHealMod((GUIDSTRING)_Source, (GUIDSTRING)_Target, (INTEGER)_HealMod[, (INTEGER)_CanCriticalHit, (STRING)_ArmorType]);
  176. Script -> ApplyPercentHeal((GUIDSTRING)_Source, (GUIDSTRING)_Target, (REAL)_Percent[, (STRING)_ArmorType]);
  177.  
  178. Same semantics as above. A flat heal, one that reflects the heal table, and one that is capable of percentile. I want these specifically so I can modify values dynamically, which I cannot do with something like REGENERATION. Is _ArmorType isn't possible, then just expand these 3 methods into 9, with each batch targeting health/armor/magic.
  179.  
  180.  
  181. Script -> ApplyStatus((GUIDSTRING)_Source, (GUIDSTRING)_Target, (STRING)_Status, (REAL)_Duration)
  182. Script -> CharacterDied((GUIDSTRING)_Source, (CHARACTERGUID)_Target)
  183. Script -> CharacterDie((GUIDSTRING)_Source, (CHARACTERGUID)_Target, (INTEGER)_GenerateTreasure, (STRING)_DeathType)
  184.  
  185. Adding a source to all these calls. (I specifically added Died/Die for Executioner interaction and it's like).
  186.  
  187.  
  188.  
  189. Tags
  190.  
  191. Tags have so much potential, and giving love to them would be the second thing I most want from this post. Tag support is single handedly destroying the (imo) true solution to bridging the gap between the game and script.
  192.  
  193. Stats -> Weapons/Armor/Etc
  194. Tag support doesn't exist here, despite there being a tag field. I have heard rumor that this was planned, and likely didn't make it in time. If the editor is going to see patches, seeing this patched would be amazing, especially if...
  195.  
  196. Stats -> Runes
  197. Tagging runes caused the item they were slotted in to receive the tag. This would let us key so many effects off gear without having to rely on hacky status solutions which I imagine are far, far lighter weight.
  198.  
  199. [QUERY]
  200. Script -> GetObjectTagIterator((GUIDSTRING)_Object, [OUT](STRING)_Tag)
  201.  
  202. This single query used in conjunction with ItemEquipped/ItemUnEquipped and proper tag support would be huge. We could build proc tables and make combat so much more dynamic, like a rune that causes you to cast a fireball at anyone who is FireLash'd (as an example).
  203.  
  204.  
  205.  
  206. Compatibility
  207.  
  208. Rather than re-hash what has already been discussed about this topic, I am instead going to link to http://larian.com/forums/ubbthreads.php?ubb=showflat&Main=77048&Number=626850#Post626850
  209.  
  210. With the advent of Add-ons, mod compatibility is now something that needs to be given more of a spotlight, otherwise we will have to rely on 3rd party support which will segment the modding community further and cause installing mods to become more difficult.
  211.  
  212.  
  213.  
  214.  
  215. Abilities
  216.  
  217. Polymorph -> data.txt
  218. Polymorph has no entry in data.txt to adjust the bonuses it provides like every other ability.
  219.  
  220.  
  221.  
  222. Missing Modifiers
  223. Alright, so I've been meaning to bring this up for awhile. I heavily dislike that modifiers are attached only to skills, and not as stand-alone stats. We could do so much more with abilities if the idea of Pyrokinetic and +%Fire Damage were separated into separate values. I hate that these two ideas are coupled. It really limits design space, makes itemization more difficult, and is abrasive to modding. I want to be able to give players bonuses without allowing them to increase their skill in something. If we had this, modders would be able to customize what attributes did very easily for very little cost.
  224.  
  225.  
  226. The Benefits of Rendering from a List
  227. Abilities, Civics, and Weapon Abilities should be rendered from a String Array internally (or perhaps some ENUM array), and that ENUM Array should be exposed to us. Most of the framework for this is in place already. Abilities are referenced via String in Requirements, Queries, and most other places I have seen. We just need a way to push and pop entries.
  228.  
  229. If you could just do this one thing, it would allow modders to add custom abilities and hook into the existing framework you have built around them. It likely wouldn't be THAT simple, but I also think this would be a huge gain for little work.
  230.  
  231. AddAbilityDefinition((STRING)_AbilityName, (STRING)_AbilityDescription)
  232. OnAbilityValueChange((CHARACTERGUID)_Learner, (STRING)_Ability, (INTEGER)_Value)
  233.  
  234.  
  235. Talents
  236.  
  237. Elemental Affinity -> data.txt
  238. Elemental Affinity has no entry in data.txt to adjust the bonus it provides like most other talents.
  239.  
  240. The Benefits of Rendering from a List
  241. Similar to Abilities, Talents need to be rendered from some keyed list that we can modify. Fields that interact with Talents are, again, strings. It honestly feels like Larian was moving both Talents and Abilities towards being moddable, and honestly it looks like it's so close to being complete. All we need is, assuming Talents are rendered from a list, the following:
  242.  
  243. AddTalent((STRING)_TalentName, (STRING)_TalentDescription, (STRING)_LearnEvent)
  244. OnTalentEvent((CHARACTERGUID)_Learner, (STRING)_LearnEvent, (INTEGER)_WasRemoved)
  245.  
  246.  
  247. If you made it this far, then all I can say is thank you for reading. I tried to only include what I thought was specifically limiting design space and seemed fairly straight-forward to address given the current systems in the game. Feel free to question any of this or add your own.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement