Eli Skill Costs - Gold, variables, Custom parameters, Items, Hp...

● ARCHIVED · READ-ONLY
Started by Eliaquim 55 posts Page 2 of 3 View original ↗
  1. ok, thanks to your advice to check the console tab, I saw a lot of "actor command window", which reminds me of a sector in visustellas battlecore plugin. in this there is a tab "show command costs true/false". setting this to false worked now ^^.
    thank you for your help :D
  2. watenkak said:
    ok, thanks to your advice to check the console tab, I saw a lot of "actor command window", which reminds me of a sector in visustellas battlecore plugin. in this there is a tab "show command costs true/false". setting this to false worked now ^^.
    thank you for your help :D
    Thanks for letting me know! Will update this on the plugin help file!
  3. EDIT:
    I have set a variable to use with this plugin, but I can't seem to get it to read it. I added it into the plugin parameters as well.
    So for example, I have a skill that cost an item (Item 122) but in the amount part of it I cannot get the variable to show up or even register that there is a variable there.

    I don't want it to cost both a variable and an item. I just want it to cost an Item with a variable amount.

    Something like this is what I'm trying to achieve:
    <ItemsCost: 122:(Variable)>

    Any help would be appreciated.
    Thanks,
    Oggy
  4. Oggy said:
    EDIT:
    I have set a variable to use with this plugin, but I can't seem to get it to read it. I added it into the plugin parameters as well.
    So for example, I have a skill that cost an item (Item 122) but in the amount part of it I cannot get the variable to show up or even register that there is a variable there.

    I don't want it to cost both a variable and an item. I just want it to cost an Item with a variable amount.

    Something like this is what I'm trying to achieve:
    <ItemsCost: 122:(Variable)>

    Any help would be appreciated.
    Thanks,
    Oggy
    Hi there!

    Well, 4 months later, :kaocry:
    Sorry about that, I guess I lost this comment Or maybe I saw it and then you edited and I didn't see it after that.

    Well, to answer your question...
    Currently, it does not work like that. But you can achieve the same results in a different way:
    Set the skill to cost a variable. Set the variable name the same as the item.

    So you set → <VarCost: varId:costValue> → <VarCost: 1:4>
    It will make the skill cost 4 of variable ID 1.

    Every time you use the item or the skill, use a common event to update that variable value with the number of items you have.
  5. No worries thanks for the reply!
  6. Excellent plugin! Thanks so much!

    I DO have a question about adjusting some y values.

    As you can see below, I'm using escape codes to color the cost value and cost type, which also affect the font type being displayed. However, since they're different fonts (and sizes), their line heights are drastically different from each other.

    Is there a way I would be able to adjust the y value of the cost and type individually to line 'em up nicely? A snippet that I could insert in the .js somewhere? I've definitely tried a number of ways, but to no avail.

    Thanks for any help!
  7. wonderjosh3000 said:
    Excellent plugin! Thanks so much!

    I DO have a question about adjusting some y values.

    As you can see below, I'm using escape codes to color the cost value and cost type, which also affect the font type being displayed. However, since they're different fonts (and sizes), their line heights are drastically different from each other.

    Is there a way I would be able to adjust the y value of the cost and type individually to line 'em up nicely? A snippet that I could insert in the .js somewhere? I've definitely tried a number of ways, but to no avail.

    Thanks for any help!
    Hi there!

    It is a little complicated I guess. Basically, this function, and the other ones inside, draws the skill cost:
    1709742578147.png

    The first one is the default from RPG Maker Code. The other ones I made for my plugin. You would need to find a way to split the cost and type, so you could change the Y coordinate of one of them to align with each other.
    On the screenshot below, the const "text" is holding all the skill cost and type text:
    1709742735123.png

    You could instead, split that text to separate the cost and the type, and call two drawTextEx with different Y coordinates.

    Either way, you gonna need some trial and error depending on how you created the cost text on the plugin parameter.

    I guess the best answer would be instead of changing the code, you adjust your font so they work better with each other.
  8. Ok cool! That's what I was looking at and playing around with, but your explanation of it gives me more clarification on what it all does, so thank you!

    I'll start messing around with it and see what happens, haha.

    EDIT: I think my issue is finding where the script is grabbing the skill cost type, and the cost itself! SO then I could separate those like you said. Hmmm... I'll keep on it!
  9. wonderjosh3000 said:
    Ok cool! That's what I was looking at and playing around with, but your explanation of it gives me more clarification on what it all does, so thank you!

    I'll start messing around with it and see what happens, haha.

    EDIT: I think my issue is finding where the script is grabbing the skill cost type, and the cost itself! SO then I could separate those like you said. Hmmm... I'll keep on it!
    I think you don't need to know that. Just grab the whole text, then split it in two texts: One with the cost and the other with the type.
    From that, you can use the DrawTextEx function to draw each one, on different Y coordinates.

    If you put a console.log(text) on my functions, you should be able to see the string inside the const "text". Then you can know how you will split it.
  10. Eliaquim said:
    I think you don't need to know that. Just grab the whole text, then split it in two texts: One with the cost and the other with the type.
    From that, you can use the DrawTextEx function to draw each one, on different Y coordinates.

    If you put a console.log(text) on my functions, you should be able to see the string inside the const "text". Then you can know how you will split it.
    Right on! Thanks for the guidance, Eliaquim! It's much appreciated!

    EDIT: GOT IT! After a time spent on Stack Overflow, here is what I got, with my y values and their adjustments.

    Code:
    Window_SkillList.prototype.drawSingleCost = function(skill, y, width){
        
        const index = this._data.indexOf(skill)
        const rect = this.getTextLineRect(index)
        const text = this.createSingleCostText(skill)
    
        const textCost = text.split('\\',2).join('\\')
        const textType = text.slice(textCost.length)
    
        const textCostWidth = this.getTextWidth(textCost)
        const textTypeWidth = this.getTextWidth(textType)
    
        const x = rect.right - textTypeWidth
        const x2 = rect.right - textTypeWidth - textCostWidth
    
        this.drawTextEx(textCost, x2, y + 3, width)
        this.drawTextEx(textType, x, y - 2, width)
    }
  11. I realize I'm double posting, but I did create a thread a last week asking about a thing, without thinking (again lol) of just asking here. SO HERE WE GO.

    I'm using Galv's Actor Equip Items, which enables you to create an item loadout for characters so that they can only use the items they have equipped vs using any and all items from the main inventory.

    Is there's a way for the item cost function of this plugin to handshake with Galv's so that a character using a skill that costs an item would require them to have said item equipped via Galv's plugin rather than using an item from the main inventory?
  12. Just saw your previous code, nice solution! Congrats! :D

    wonderjosh3000 said:
    I realize I'm double posting, but I did create a thread a last week asking about a thing, without thinking (again lol) of just asking here. SO HERE WE GO.

    I'm using Galv's Actor Equip Items, which enables you to create an item loadout for characters so that they can only use the items they have equipped vs using any and all items from the main inventory.

    Is there's a way for the item cost function of this plugin to handshake with Galv's so that a character using a skill that costs an item would require them to have said item equipped via Galv's plugin rather than using an item from the main inventory?
    Yeah, I guess I could make that work. But just for me to be sure, what you want is:

    - Instead of a Skill that costs an item, and consumes that item from inventory to be able to use, you want for the skill just requires that the character is equipping that item, right?

    So if the character is equipping that item, it will be able to cast the skill. If not, it will not be able to cast that skill. Correctly?
  13. Ah sort of! Although that is also a great idea.

    What I meant was for the skill to consume the item from the player's equipped items list rather than the main inventory. It's essentially the same as what you have already, except referencing the character's individual inventory a la Galv's Actor Equip Items.

    Ex: an alchemist has a skill, 'firebomb,' that consumes 2 black powder. If there's black powder in the main inventory but the alchemist doesn't have any equipped, the skill can't be used.
  14. wonderjosh3000 said:
    Ah sort of! Although that is also a great idea.

    What I meant was for the skill to consume the item from the player's equipped items list rather than the main inventory. It's essentially the same as what you have already, except referencing the character's individual inventory a la Galv's Actor Equip Items.

    Ex: an alchemist has a skill, 'firebomb,' that consumes 2 black powder. If there's black powder in the main inventory but the alchemist doesn't have any equipped, the skill can't be used.
    OHHHH I got it! Thanks for clarifying!
    I don't believe that would be hard to do! Will send you a patch here if I manage to do it!
  15. Eliaquim said:
    OHHHH I got it! Thanks for clarifying!
    I don't believe that would be hard to do! Will send you a patch here if I manage to do it!
    Right on! Thank you muchly!
  16. Eliaquim said:
    OHHHH I got it! Thanks for clarifying!
    I don't believe that would be hard to do! Will send you a patch here if I manage to do it!
    Hey there, Eliaquim! Not to hound you on this at all, but did you ever get a chance to look at Galv's Actor Equip Items for a patch?
  17. wonderjosh3000 said:
    Hey there, Eliaquim! Not to hound you on this at all, but did you ever get a chance to look at Galv's Actor Equip Items for a patch?
    Hi there!
    Not yet! Remember me next week, either by replying here or in my inbox please ^^''
  18. wonderjosh3000 said:
    Hey there, Eliaquim! Not to hound you on this at all, but did you ever get a chance to look at Galv's Actor Equip Items for a patch?
    Hi there!
    See if this will work. i didn't test it.
    if you run into any errors, send me the error logs from the console.
    Put below my plugin.

    It will work the same way as the Item cost. But the note tag will be GalvEqCost
  19. Eliaquim said:
    Hi there!
    See if this will work. i didn't test it.
    if you run into any errors, send me the error logs from the console.
    Put below my plugin.

    It will work the same way as the Item cost. But the note tag will be GalvEqCost
    Right on! Thanks Eli!

    After a quick test, there was a single lonely error. I screencapped it for you!

    This is line 78 & 79
    Code:
    Eli.SkillCost.costOrder.push("galvEq")
    Eli.SkillCost.parameters.typeSettings.galvEq = JSON.parse(PluginManager.parameters("Eli_SkillCostGalv").galvEq)

    In my plugin list, I have Galv's plugin a ways above yours, and then the patch below yours like you mentioned.
  20. wonderjosh3000 said:
    Right on! Thanks Eli!

    After a quick test, there was a single lonely error. I screencapped it for you!

    This is line 78 & 79
    Code:
    Eli.SkillCost.costOrder.push("galvEq")
    Eli.SkillCost.parameters.typeSettings.galvEq = JSON.parse(PluginManager.parameters("Eli_SkillCostGalv").galvEq)

    In my plugin list, I have Galv's plugin a ways above yours, and then the patch below yours like you mentioned.
    See if this works now.