Skip to content

[TOOL] Resource Pool Kit Upgrade 2.2

yowaveyowave Member Posts: 67
edited September 2017 in General Modding
[LEGAL NOTICE]
You have permission to use this TOOL in your MODS if you follow the following:
  1. Give credit to yowavegamer@gmail.com.
  2. Give links to the discussions about this tool, those are the links:
    1. Link to this post
    2. http://gibberlings3.net/forums/index.php?showtopic=28988
[INTRODUCTION]
With this tool you'll be able to upgrade your own KIT abilities so they'll use a resource pool.
It goes without saying that planning your Kit with the resource pool in mind, will make the Kit much more engaging and fun to play with.

The method of Resource Pool was first developed for my KIT "Way Of The Fist",
check it out at: https://forums.beamdog.com/discussion/62445/kit-way-of-the-fist-1-3-testers-requiered

This Method introduces a new game mechanic which fuels the KIT abilities,
whenever you use an ability it subtracts number of resource points from the resource pool.
Taking my "Way Of The Fist" KIT as an example:
Say you currently have 10 points of resource pool.
You also have those abilities learned:
  • Enhence Self, cost 1 point
  • Ki Coat, cost 2 points
  • Quivering Palm, cost 5 points

casting Quivering Palm will subtract 5 ki points from the resource pool, which means you'll be left with
5 resource points, which can be used those to cast 1 Qivering Palm, 2 Ki Coat and 1 Enehnce Self, or 5 Enhence Self.

[INSTALLATION]
  1. place the zip file in your KIT installation folder, where all the ".spl",".2da",".eff",etc.. files are.
  2. right click the zip file and select Extract Here. Then move the zip file to another location.
  3. Open settings.ini and fill in the information, it'll be best to open it with NOTEPAD++, because it'll highlight the ever important instructions.
  4. double click BG_RESOURCE_TOOL_INSTALLER.exe
  5. When the installation will be DONE! you'll find those new things:
    1. ADD_THIS_TO_TP2.txt, will have new instructions that you'll need to copy to your installation.tp2 file. You might need to edit some things, so do make sure to go over it!
    2. RESOURCE_POOL_DATA folder, which will hold all the required files, in this folder you'll find:
      1. 2DA folder, holds your CLAB file with all the abilities and passives arranged in the most efficient way
      2. BAF folder, will hold all the scripts that have been created automatically according to settings.ini
      3. SPL folder, edited spells, do note that there are 2 version of the same spell "SPELL_NAME" and "SPELL_NAME_RES".
        "SPELL_NAME" - this spell is the one you'll cast and it casts "SPELL_NAME_RES", if needed only patch: name,description,icon,flags,exclusion flags,primary/secondary type
        "SPELL_NAME_RES" - the real spell with the real effects, patch whatever you want.
[Download]
http://www.shsforums.net/files/file/1192-resource-tool-installer/

[README]
You can find the README where you extracted the tool.

[Version History]

Version 2.2 - 11/09/2015:
* Added COPY CLAB to ADD_THIS_TO_TP2.txt
* Added Append RemoveSpellRES and ApplySpellRES to ACTSLEEP.IDS, added to ADD_THIS_TO_TP2.txt
* USERHPRES.SPL is now copied to RESOURCE_POOL_DATA\SPL
* "SPELL_NAME" - having the right number of abilities, before it had an ability for every ability in the original spell.

Version 2.1 - 10/09/2015:
* Fixed hp penalty.
* Changed settings_.ini to settings.ini

Version 2.0 - 10/09/2017
* Special thanks to kjeron and subtledoctore from BEAMDOG forums. Thank you both for asking the right
Questions, and giving your valuble insight, by doing so, you stimulated my nurons in the right direction.
* Some big changes under the hood.
* Now works with long casting spells.

Version 1.2 - 06/09/2017:
* Removed OUTPUT_DIRECTORY from settings.ini
* Fixed spell cost, casted spell cost 1 point more than it should be,
now substructing the right amonut of points.

Version 1.1 - 05/09/2017:
* Minor fix to readme

Version 1.0 - 05/09/2017:
* First public release

Post edited by yowave on

Comments

  • yowaveyowave Member Posts: 67
    Reserved.
  • The user and all related content has been deleted.
  • yowaveyowave Member Posts: 67
    edited September 2017

    Does it include a visual indicator showing how many points you have at any given time? Or does the player keep track themselves between rests?

    Yes, when you press your ability button you'll see every ability having the number of current points.

    It will be really nice if someone who knows how to create GUI components for BG, will work with me to create one for this TOOL.
    This tool is planned with a GUI component future addition, all the relevant GLOBALS are there to use, if one is ever created.
    Post edited by yowave on
  • RaduzielRaduziel Member Posts: 4,714
    That would be perfect for psionics.
  • [Deleted User][Deleted User] Posts: 0
    edited September 2017
    The user and all related content has been deleted.
  • yowaveyowave Member Posts: 67
    @Raduziel it would be perfect for a lot of KITS, it is a tool, and you make of it what you make of it.
    The resource pool mechanic is a new way to make boring KITS much more engaging.
    It can be thought of as stamina,mana,energy,ki,etc...

    For example, with this new mechanic you can make a new warrior KIT let's say, Dragon Born (yeah the same one from skyrim), that have meaningful abilities (shouts), all of those abilities share the same Resource Pool (let's say stamina), which makes the KIT much more engaging and fun to play. It brings about a new way to create a KIT that was never thought of before, the possibilities are ENDLESS.

    I am playing my "Way Of The Fist" KIT right now, and i enjoy it, monks were boring before, not anymore :)
    All those abilities, and the tactic aspect, do i want to use my remaining ability points to buff myself, or use those for an attack, then comes the question, which kind of attack.

    Done sensibly, the Resource Pool mechanic can pretty much UPGRADE any KIT.

    @subtledoctor is there a problem with invisible creatures and scripts? the player and also the modder never get to see those, or even interact with them.
    Also the modder doesn't need to think about the how, and have more room to concentrate on more important things, design of the KIT, abilities, power curve (i hope you know what that means), interactions with the enviorment\world, etc...

    As i said, it is a tool, and you make of it what you make of it, using it with an open mind and the result would be "The stuff of legends! Right Boo?".
  • kjeronkjeron Member Posts: 2,368
    yowave said:

    @subtledoctor is there a problem with invisible creatures and scripts? the player and also the modder never get to see those, or even interact with them.
    Also the modder doesn't need to think about the how, and have more room to concentrate on more important things, design of the KIT, abilities, power curve (i hope you know what that means), interactions with the enviorment\world, etc...

    The problem is ActionOverride, it's not 100% reliable, especially outside of dialog/cutscenes, and it is a hard interrupt, disrupting your current action, meaning you are forced to either :
    • summon the creature upon spell completion, but then you don't lose anything if the spell gets interrupted by damage
    • make the spell itself cast instantly, so you can summon the creature as a casting effect without it disrupting the very spell it's responding to.
    and then disable the caster so they cannot interrupt the ActionOverride with manual commands.

    But if you're okay putting up with those issues, you could simplify your kit a lot, and remove the Variable and baldur.bcs dependency entirely, by summoning multiple creatures instead of your current method. So if you cast a spell that used 3 points, you would summon 3 creatures, but regardless of the spell you cast, you would summon the same creature with the same script:
    
    IF
    	!TriggerOverride(LastSummonerOf(Myself),HaveSpellRES("KITOTAL"))
       // this is an placeholder spell, given to the player the same as the others but not castable/accessible to the player.
    THEN
    	RESPONSE #100
    		ReallyForceSpell(LastSummonerOf(Myself),WIZARD_MAGIC_MISSILE)  // Not enough points, Damage them
    		Continue()
    END
    IF
    	True()
    THEN
    	RESPONSE #100
    		ActionOverride(LastSummonerOf(Myself),RemoveSpellRES("KITOTAL"))
    		ActionOverride(LastSummonerOf(Myself),RemoveSpellRES("CUSTOM1"))
    		ActionOverride(LastSummonerOf(Myself),RemoveSpellRES("CUSTOM2"))
    		ActionOverride(LastSummonerOf(Myself),RemoveSpellRES("CUSTOM3"))
    		// etc...
    		Continue()
    END
    IF
    	True()
    THEN
    	RESPONSE #100
    		DestroySelf()
    END
    
    If the RemoveSpellRES() action could just take a target object, this whole endeavor would have been irrelevant years ago.
  • yowaveyowave Member Posts: 67
    edited September 2017
    @kjeron

    I am playing my Way Of The Fist KIT right now (part of it because i am working on a new thing), and i can't feel the interruptions.
    Also the player can't interrupt those ActionOverride or anything like that, because ActionOverride and RemoveSpellRES are instant effects.
    I pushed RemoveSpellRES into INSTANT.IDS

    So doing something like that, and as you cast the spell you move your char (which responds instantly), it'll still go through the script and RemoveSpellRES as many times as you told it too, and it works 100% of the times:

    IF
    True()
    THEN
    RESPONSE #100
    SetInterrupt(FALSE)
    // This is a neat way to remove memorised spell or innate from the target
    ActionOverride(Protagonist,RemoveSpellRES("STBLOW"))
    ActionOverride(Protagonist,RemoveSpellRES("STBLOW"))
    ActionOverride(Protagonist,RemoveSpellRES("STBLOW"))
    ActionOverride(Protagonist,RemoveSpellRES("STBLOW"))
    ActionOverride(Protagonist,RemoveSpellRES("STBLOW"))
    ActionOverride(Protagonist,RemoveSpellRES("STBLOW"))
    ActionOverride(Protagonist,RemoveSpellRES("ENSELF"))
    ActionOverride(Protagonist,RemoveSpellRES("ENSELF"))
    ActionOverride(Protagonist,RemoveSpellRES("ENSELF"))
    ActionOverride(Protagonist,RemoveSpellRES("ENSELF"))
    ActionOverride(Protagonist,RemoveSpellRES("ENSELF"))
    ActionOverride(Protagonist,RemoveSpellRES("ENSELF"))
    ActionOverride(Protagonist,RemoveSpellRES("WOTFIMDI"))
    ActionOverride(Protagonist,RemoveSpellRES("WOTFIMDI"))
    ActionOverride(Protagonist,RemoveSpellRES("WOTFIMDI"))
    ActionOverride(Protagonist,RemoveSpellRES("WOTFIMDI"))
    ActionOverride(Protagonist,RemoveSpellRES("WOTFIMDI"))
    ActionOverride(Protagonist,RemoveSpellRES("WOTFIMDI"))
    ActionOverride(Protagonist,RemoveSpellRES("SEARFST"))
    ActionOverride(Protagonist,RemoveSpellRES("SEARFST"))
    ActionOverride(Protagonist,RemoveSpellRES("SEARFST"))
    ActionOverride(Protagonist,RemoveSpellRES("SEARFST"))
    ActionOverride(Protagonist,RemoveSpellRES("SEARFST"))
    ActionOverride(Protagonist,RemoveSpellRES("SEARFST"))
    ActionOverride(Protagonist,RemoveSpellRES("WTFREGEN"))
    ActionOverride(Protagonist,RemoveSpellRES("WTFREGEN"))
    ActionOverride(Protagonist,RemoveSpellRES("WTFREGEN"))
    ActionOverride(Protagonist,RemoveSpellRES("WTFREGEN"))
    ActionOverride(Protagonist,RemoveSpellRES("WTFREGEN"))
    ActionOverride(Protagonist,RemoveSpellRES("WTFREGEN"))
    ActionOverride(Protagonist,RemoveSpellRES("WOTFCLON"))
    ActionOverride(Protagonist,RemoveSpellRES("WOTFCLON"))
    ActionOverride(Protagonist,RemoveSpellRES("WOTFCLON"))
    ActionOverride(Protagonist,RemoveSpellRES("WOTFCLON"))
    ActionOverride(Protagonist,RemoveSpellRES("WOTFCLON"))
    ActionOverride(Protagonist,RemoveSpellRES("WOTFCLON"))
    ActionOverride(Protagonist,RemoveSpellRES("QPALM"))
    ActionOverride(Protagonist,RemoveSpellRES("QPALM"))
    ActionOverride(Protagonist,RemoveSpellRES("QPALM"))
    ActionOverride(Protagonist,RemoveSpellRES("QPALM"))
    ActionOverride(Protagonist,RemoveSpellRES("QPALM"))
    ActionOverride(Protagonist,RemoveSpellRES("QPALM"))
    ActionOverride(Protagonist,RemoveSpellRES("KICOAT"))
    ActionOverride(Protagonist,RemoveSpellRES("KICOAT"))
    ActionOverride(Protagonist,RemoveSpellRES("KICOAT"))
    ActionOverride(Protagonist,RemoveSpellRES("KICOAT"))
    ActionOverride(Protagonist,RemoveSpellRES("KICOAT"))
    ActionOverride(Protagonist,RemoveSpellRES("KICOAT"))
    ActionOverride(Protagonist,RemoveSpellRES("SEISTEP"))
    ActionOverride(Protagonist,RemoveSpellRES("SEISTEP"))
    ActionOverride(Protagonist,RemoveSpellRES("SEISTEP"))
    ActionOverride(Protagonist,RemoveSpellRES("SEISTEP"))
    ActionOverride(Protagonist,RemoveSpellRES("SEISTEP"))
    IncrementGlobal("CURRENT_KI_POOL","GLOBAL",-6)
    SetInterrupt(TRUE)
    Continue()
    END
    I encourage you to install my "Way Of The Fist" KIT, and see how it works in reality.

    For long casting abilities, if you move you loose a point and nothing happens, say you currently have 4 resource points, you cast Enhence Self (it's instant, but let's say it takes 1 round to cast it), you move your char you loose the spell and also 1 point from that specific ability, but nothing else happens.

    It can't get any simpler than this, because the TOOL does everything that need to be done, and also does this in a very organized and efficient way, creating all the necessary cre,baf,eff,clab, and editing the spl for you.
  • yowaveyowave Member Posts: 67
    Updated to version 1.2:
    • Removed OUTPUT_DIRECTORY from settings.ini
    • Fixed spell cost, casted spell cost 1 point more than it should be, now substructing the right amonut of points.
  • kjeronkjeron Member Posts: 2,368
    yowave said:

    ActionOverride and RemoveSpellRES are instant effects.
    I pushed RemoveSpellRES into INSTANT.IDS

    Unfortunately I have tried this approach, it's just not enough, they can still be interrupted if you happen to order them at the right time. It doesn't really make them "instant", just quicker, and enables them to process between dialog states. Now, it should work perfectly for enemies, just not creatures the player can directly control.
    yowave said:

    you move your char you loose the spell and also 1 point from that specific ability, but nothing else happens.

    Nothing else happening would be my issue, ideally it would subtract its full point value from all skills in the pool, as if it weren't interrupted.
    yowave said:

    This tool is planned with a GUI component future addition, all the relevant GLOBALS are there to use, if one is ever created.

    Unfortunately Global variables are not visible to the UI, in fact very little is available.
  • yowaveyowave Member Posts: 67
    edited September 2017
    @kjeron
    kjeron said:


    Unfortunately I have tried this approach, it's just not enough, they can still be interrupted if you happen to order them at the right time.

    As i told you before, this never happened to me in any of my games, even with really long chain of actions as I've showed you in my previous post, so for me it works 100% of the time.

    If you can show me how it is interrupted by doing something specific, that actually happens in reality and not some controlled environment, means that a player have high chance of stumbling upon this situation, and it happens all the time, then I'll say you are right.
    kjeron said:


    Nothing else happening would be my issue, ideally it would subtract its full point value from all skills in the pool, as if it weren't interrupted.

    You are right about that.
    But actually there is another way to do it for long casting spells, and actually i am currently trying various ways to resolve some of the problems of this method.
    You summon a creature instantly, and this creature call SpellNoDecRES on the summoner, which cause it to cast the real spell.
    In all my tests it's a bit clunky, because even if the first spell is instant and with no animation, it still plays an animation, which cause the next spell to fire up at odd times.

    Also it'll not work for targeted spells, unless there's a way to get cursor P:Target* and then use SpellPointNoDecRES.


    Post edited by yowave on
  • The user and all related content has been deleted.
  • yowaveyowave Member Posts: 67
    edited September 2017
    @subtledoctor I see, didn't know that it was so hectic before the EE version of the game.
    I also think that i can take my Resource Pool method and make it work using HP, i'll try to get to it soon after i am done with version 2.0 of the Resource Pool Kit Upgrade.

    Anyway version 2.0 is in the works, and it'll bring with it some desired changes.

  • yowaveyowave Member Posts: 67
    @kjeron
    kjeron said:


    But if you're okay putting up with those issues, you could simplify your kit a lot, and remove the Variable and baldur.bcs dependency entirely, by summoning multiple creatures instead of your current method. So if you cast a spell that used 3 points, you would summon 3 creatures, but regardless of the spell you cast, you would summon the same creature with the same script:

    Forgot to comment on this, the reason being, Programming 101, you don't cause unnecessary overhead.
    Think about it like this, casting 3 instants back to back can pretty much swarm the game with summons, EACH running his own script, who knows when, and in what order, you can end up summoning 20 creatures, is this really the most efficient way? not for me!

    Also by removing Variables, i wouldn't be able to give HP penalty for missing points, or whatever other logic i want to introduce.

    @subtledoctor
    @kjeron
    Now for another topic, long casting spells, what do you think about the following:
    Replace the real spell with a spell that calls the real spell with a small delay, subtracting this small delay from the real spell (confused yet, no?, because I AM!)
    this will give time to ActionOverride to take effect.

    In my tests it works and works well.
    The only downside is the first animation, can explain it as collecting the resource to use for the long casting spells, and also give it some glow or what not.
    It also have a really cool side effect, say you collected the amount of resource, even if you move (you need to do it before the real spell is fired), it'll still cast the real spell.

    This method will be introduced in version 2.0 of the "Resource TOOL"

  • kjeronkjeron Member Posts: 2,368
    yowave said:

    Forgot to comment on this, the reason being, Programming 101, you don't cause unnecessary overhead.

    Anything in Baldur.bcs that can be done elsewhere or otherwise is unnecessary overhead, avoiding that file is really the only purpose for what I posted, but I would rather object to using scripts wherever possible. To compare their reliability - the game will hang/freeze until it finishes processing all spell/item effects for a given moment if it gets overwhelmed, while script blocks that don't process fast enough are just discarded.
    yowave said:

    Think about it like this, casting 3 instants back to back can pretty much swarm the game with summons, EACH running his own script, who knows when, and in what order,

    That was actually a feature, as separate script runs, they will each check/remove the spell one after the other, allowing that placeholder spell itself to become the actual variable. It would be more reliable for the same creature to run through a script several times, its just slower.

    Some more issues for you to consider:
    • PartyRested() doesn't return true for either the Rest() action or the Opcode 316(Rest).
    • ActionOverride will crash the game if it tries to force an action that cannot be run do to the targets current STATE (particularly STATE_SLEEPING and STATE_DEAD). Adding them (RemoveSpellRES() and any others) to "ACTSLEEP.IDS" will prevent this AFAIK.
  • yowaveyowave Member Posts: 67
    edited September 2017
    @kjeron Spawning host of new entities is a bigger overhead, each entity is much more than just an additional script, but let's leave that topic for now, i don't feel like delving into complicated stuff.

    I understand your fear of using baldur.bcs, but i haven't run into any issues so far, done sensibly it won't cause any problems.
    kjeron said:


    Some more issues for you to consider:

    • PartyRested() doesn't return true for either the Rest() action or the Opcode 316(Rest).
    • ActionOverride will crash the game if it tries to force an action that cannot be run do to the targets current STATE (particularly STATE_SLEEPING and STATE_DEAD). Adding them (RemoveSpellRES() and any others) to "ACTSLEEP.IDS" will prevent this AFAIK.
    Thanks alot for the heads up:
    1. Are there any other checks that can be done? if not, i can live with this.
    2. Will do so.
  • kjeronkjeron Member Posts: 2,368
    yowave said:

    let's leave that topic for now, i don't feel like delving into complicated stuff.

    Agreed.
    yowave said:

    1. Are there any other checks that can be done? if not, i can live with this.
    Not that I know of, other than patching the items/spells/scripts that use them.
  • yowaveyowave Member Posts: 67
    Version 2.0 is in testing phase, i hope to release it tonight.

    @Grammarsalad
    @kjeron
    kjeron said:

    Unfortunately Global variables are not visible to the UI, in fact very little is available.

    What if i wanted to display text somewhere in the screen, is it possible?
    For example i want it to show something like "5/10" in the character portrait, same as how HP is shown there.
    Found an old post about the subject:
    https://forums.beamdog.com/discussion/60023/can-you-alter-the-ui-to-display-user-created-global-and-or-local-variable-names-in-the

  • yowaveyowave Member Posts: 67
    edited September 2017
    Updated to Version 2.0:
    • Special thanks to kjeron and subtledoctore from BEAMDOG forums. Thank you both for asking the right Questions, and giving your valuble insight, by doing so, you stimulated my nurons in the right direction.
    • Some big changes under the hood.
    • Now works with long casting spells.
    Still waiting for an answer about displaying text...
  • yowaveyowave Member Posts: 67
    edited September 2017
    Updated to Version 2.2:
    • Added COPY CLAB to ADD_THIS_TO_TP2.txt
    • Added Append RemoveSpellRES and ApplySpellRES to ACTSLEEP.IDS, added to ADD_THIS_TO_TP2.tx
    • USERHPRES.SPL is now copied to RESOURCE_POOL_DATA\SPL
    • "SPELL_NAME" - having the right number of abilities, before it had an ability for every ability in the original spell.
Sign In or Register to comment.