Forum begins after the advertisement:


[Part 18] Area start with +100%

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #15238
    Silvian
    Silver Supporter (Patron)

    After following your Part 18 I’ve noticed that for me if both the character and the weapon have the value for Area set to 1, all my weapons will start with 100% increased (double the size). I’ve tried with 0 as the base for Area on both the weapons and the characters, either at the the same time, or separately. The other stats look to be working fine. I’ve looked at the Part 18 files and on your end seems to work with both set at 1.

    #15239
    Terence
    Keymaster

    What is your character’s area stat set to?

    You also want to add the highlighted line here and see what result you get whenever a new weapon spawns:

    public virtual float GetArea()
    {
        print("Current Area of " + name + ": " + (currentStats.area + owner.Stats.area));
        return currentStats.area + owner.Stats.area;
    }
    #15240
    Silvian
    Silver Supporter (Patron)

    If I leave the Area set to 1 on both the characters and the weapons, I get this:
    AreaBoth

    If the character has the Area set to 0 and the weapon to 1:
    AreaWeapon

    I could provide the codes here, but if it’s easier for you I will provide the link to my project on github (Not sure if links are allowed, we’ll see):

    Also, should Area affect the whip as well? Because it doesn’t look like it does for me. I named the Whip Slasher.

    #15241
    Silvian
    Silver Supporter (Patron)

    The thing is it kinda “works” visually and mechanically if I set the value of Area in the character data to 0 (as in it’s the actual starting size), but the value in the pause screen is shown as negative %.
    Stats

    #15243
    Terence
    Keymaster

    For the area issue, my bad, it appears the article was wrong. It should be:

    public virtual float GetArea()
    {
        return currentStats.area * owner.Stats.area;
    }

    Once you change the operator from + to *, the issue should go away, and you can set the player’s Area stat to 1.

    For the area not increasing, check whether the above changes fixes your issue. Otherwise:

    1. Check whether the spawned effect has a scale of above 1 when your area stat is increased. It might be that the scale is increased, but the particle effect is not set to scale.
    2. If the scale remains 1, check your Whip’s script has a portion that sets the spawned projectile’s scale.

    Refer to the video to see how to get the whip effect to scale. There is a variable you need to set (sorry, I forget its name at this moment) for it to scale.

    #15244
    Terence
    Keymaster

    I’ve also given you a Content Contributor on your profile here as thanks for finding this typo in our article.

    Content Contributor

    #15245
    Silvian
    Silver Supporter (Patron)

    Thanks for the fix on the wrong operator used. And regarding the other issues, my bad. I’ve meant to say if the Area in character data and passives should affect the Garlic (Spike Aura in my game) as well, not the Whip. The other are scaling accordingly with the Area, but the Garlic area only scales with it’s own bonus through the level up, not the character/passives.

    #15246
    Silvian
    Silver Supporter (Patron)

    Also, non-related, there is also a slight typo, although not crucial since the script is written as it should right underneath, on the section 6.a. on Part 19 article. You’ve crossed the wrong line ChangeState(GameState.Paused); instead of previousState = currentState; :
    Typo

    Again, not crucial, the whole script is good immediately after.

    #15254
    Terence
    Keymaster

    Thanks for highlighting this with such detail Silvian. Really appreciate it! I’ve listed you as a Contributor to the article.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: