Need help for a skill

Discussion in 'Javascript/Plugin Support' started by Iliassine, Feb 12, 2019.

  1. Iliassine

    Iliassine Rider. Veteran

    Messages:
    90
    Likes Received:
    3
    First Language:
    French
    Primarily Uses:
    N/A
    Hey guys ! I use the action sequence pack (1-2-3) want to make a skill which power goes harder depending of the stacks of the States the enemy has been infected.

    What I made. The skill executed adds once the state to the target (Let's call it minibomb)
    and I made the skill trigger a common event "bomb counter" (ID : 27). Every times it is executed, it adds 1 to the variable [110], with the text (The enemy now has \v[110] minibombs)

    And I want the "Kaboom" skill stronger or weaker depending of the variable, so, then remove them form the enemi. For this, I made the Kaboom skill trigger the 28th common event that put the counter down to 0 and removes them. But, I need to work the formula and the action sequence scheme. Here is what I made.

    formula (I'm quite a noob concerning formulas, I'm quite sure it is wrong tho) :
    if (b.isStateAffected(50)) {200 * v[110] + a.mat * 2 - b.mdf} else {0}; b.removeState(15)

    Action sequence :
    <setup action>

    perform start

    animation 149: user

    wait: 40

    </setup action>

    <target action>

    hide Battle Hud

    wait: 40

    motion chant: user

    wait: 40

    animation 283: user

    animation 283: target

    \\Si 0 bud

    if ($gameVariables.value[110] == (0))

    ADD STATE 26: user

    elseif ($gameVariables.value[110] == (1))

    wait: 30

    motion attack: user

    wait: 5

    animation 57: target

    wait: 15

    motion chant: user

    wait: 30

    animation 170: target

    wait: 40

    action affect: target

    elseif ($gameVariables.value[110] == (2))

    wait: 30

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    motion missile: user, no weapon

    wait: 5

    animation 57: target

    wait : 30

    animation 170: target

    wait : 40

    action effect: target

    elseif ($gameVariables.value[110] == (3))

    wait: 30

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    motion missile: user, no weapon

    wait: 5

    animation 57: target

    wait : 25

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    animation 170: target

    wait : 40

    action effect: target

    elseif ($gameVariables.value[110] == (4))

    wait: 30

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    motion missile: user, no weapon

    wait: 5

    animation 57: target

    wait : 25

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    motion missile: user, no weapon

    wait: 5

    animation 57: target

    wait : 25

    animation 170: target

    wait : 40

    action effect: target

    elseif ($gameVariables.value[110] == (5))

    wait: 30

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    motion missile: user, no weapon

    wait: 5

    animation 57: target

    wait : 25

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    motion missile: user, no weapon

    wait: 5

    animation 57: target

    wait : 25

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    animation 170: target

    wait : 40

    action effect: target

    show Battle Hud

    </target action>

    <finish action>

    perform finish

    </finish action>


    There is no enter between them, but I hope you guys got it anyways. Thanks in advance.
     
    #1
  2. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    652
    Likes Received:
    497
    First Language:
    French
    You haven't stated what's actually wrong.
    What happens when you execute the skill? What works and what doesn't ?

    There are a lot of things wrong in design btw, for starters right now all enemies share the same minibomb counter (v110). I don't think that's what you want, but I can't be sure, and that's why I need you to state the exact design of your skill and what happens right now vs what should happen.
     
    #2
  3. Iliassine

    Iliassine Rider. Veteran

    Messages:
    90
    Likes Received:
    3
    First Language:
    French
    Primarily Uses:
    N/A
    Oh sorry ! When I execute it, it goes the same way, regardless of the count of bombs. It does not even make the action I'm looking for.
    Normally, it should go :

    if 0 bud :
    Inflict burn state to user (state id 26)
    no animation
    no damage to target
    end

    if one bud :
    motion attack: user
    animation on target
    action effect: target
    end

    if two buds :
    motion attack: user
    animation on target
    wait
    motion missile: user, no weapon
    animation on target
    action effect: target
    end

    if three buds :
    motion attack: user
    animation on target
    wait
    motion missile: user, no weapon
    animation on target
    wait
    motion attack: user
    animation on target
    end

    if four buds :
    motion attack: user
    animation on target
    wait
    motion missile: user, no weapon
    animation on target
    wait
    motion attack: user
    animation on target
    wait
    motion missile: user, no weapon
    animation on target
    wait
    action effect: target
    end

    if five buds :
    motion attack: user
    animation on target
    wait
    motion missile: user, no weapon
    animation on target
    wait
    motion attack: user
    animation on target
    wait
    motion missile: user, no weapon
    animation on target
    wait
    motion attack: user
    animation on target
    action effect: target
    end

    Have I been clear enough ?
     
    #3
  4. Iliassine

    Iliassine Rider. Veteran

    Messages:
    90
    Likes Received:
    3
    First Language:
    French
    Primarily Uses:
    N/A
    And both of the skills are 1-targeted skills.
    The bomb you let on them are stacked and the number of stack is stocked in a variable.
     
    #4
  5. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    652
    Likes Received:
    497
    First Language:
    French
    You haven't answered the second question. Are enemies supposed to share the same minibomb counter v110?

    Your javascript conditions are wrong btw:
    It's
    Code:
    $gameVariables.value(variableId)
    
    with parentheses, not with brackets.
     
    #5
  6. Iliassine

    Iliassine Rider. Veteran

    Messages:
    90
    Likes Received:
    3
    First Language:
    French
    Primarily Uses:
    N/A
    I tried with paranth├Ęses, not with brackets too and had the same thing.

    Nope, Just one monster for one counter.
     
    #6
  7. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    652
    Likes Received:
    497
    First Language:
    French
    The actual syntax for if else statement taken from yanfly's help file:
    Code:
    if $gameSwitches.value(1)
             action effect
         else if $gameSwitches.value(2)
             action effect
            action effect
         else
            action effect
             action effect
             action effect
         end
    
    You're writing elseif instead of else if.

    So now that you've realized that all your enemies share the same minibomb counter, how do you plan to fix that?
     
    #7
  8. Iliassine

    Iliassine Rider. Veteran

    Messages:
    90
    Likes Received:
    3
    First Language:
    French
    Primarily Uses:
    N/A
    I guess I will work on it, I didn't for now, as I chose first to figure out how the skill could work.
     
    #8
  9. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    652
    Likes Received:
    497
    First Language:
    French
    With the proper syntax fixes I've shown you, your action sequence should now actually process.
    Now you'll need to find a way to make every enemy use a different minibomb counter and that's likely to be a tougher issue. Don't hesitate to share what you've tried if you need some pointers!
     
    #9
  10. Iliassine

    Iliassine Rider. Veteran

    Messages:
    90
    Likes Received:
    3
    First Language:
    French
    Primarily Uses:
    N/A
    In case it does not work, I'll take the initial setup and make the second one an aoe that will reach as much as the bomb have been laid first.

    If I understand it, I must use "else if $gameSwitches.value(110) == X", it would work ?
     
    #10
  11. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    652
    Likes Received:
    497
    First Language:
    French
    Code:
    else if $gameVariables.value(110) == X
    
    That should work.
    You made two mistakes in your first post: you used elseif and $gameVariables.value[110]
     
    #11
  12. Iliassine

    Iliassine Rider. Veteran

    Messages:
    90
    Likes Received:
    3
    First Language:
    French
    Primarily Uses:
    N/A
    <setup action>

    perform start

    animation 149: user

    wait: 40

    </setup action>

    <target action>

    hide Battle Hud

    wait: 40

    motion chant: user

    wait: 40

    animation 283: user

    animation 283: target

    \\Si 0 bud

    if $gameVariables.value(110) == 0

    ADD STATE 26: user

    else if $gameVariables.value(110) == 1

    wait: 30

    motion attack: user

    wait: 5

    animation 57: target

    wait: 15

    motion chant: user

    wait: 30

    animation 170: target

    wait: 40

    action affect: target

    else if $gameVariables.value(110) == 2

    wait: 30

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    motion missile: user, no weapon

    wait: 5

    animation 57: target

    wait : 30

    animation 170: target

    wait : 40

    action effect: target

    else if $gameVariables.value(110) == 3

    wait: 30

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    motion missile: user, no weapon

    wait: 5

    animation 57: target

    wait : 25

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    animation 170: target

    wait : 40

    action effect: target

    else if $gameVariables.value(110) == 4

    wait: 30

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    motion missile: user, no weapon

    wait: 5

    animation 57: target

    wait : 25

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    motion missile: user, no weapon

    wait: 5

    animation 57: target

    wait : 25

    animation 170: target

    wait : 40

    action effect: target

    else if $gameVariables.value(110) == 5

    wait: 30

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    motion missile: user, no weapon

    wait: 5

    animation 57: target

    wait : 25

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    motion missile: user, no weapon

    wait: 5

    animation 57: target

    wait : 25

    motion attack: user

    wait: 5

    animation 57: target

    wait: 25

    animation 170: target

    wait : 40

    action effect: target

    show Battle Hud

    </target action>

    <finish action>

    perform finish

    </finish action>




    I used it and still, it does not work. It just performs start, then the animation 283 on actor and user as asked, then nothing. What should I do ?
     
    #12
  13. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    652
    Likes Received:
    497
    First Language:
    French
    So the part of your sequence before the if triggers, but not after.
    What could be wrong ?
     
    #13
  14. Iliassine

    Iliassine Rider. Veteran

    Messages:
    90
    Likes Received:
    3
    First Language:
    French
    Primarily Uses:
    N/A
    I don't know. Want me to take a video and give you the link, so you see ?
     
    #14
  15. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    652
    Likes Received:
    497
    First Language:
    French
    No, I have the answer to that question. I want you to go through the debugging process on your own.
    What would cause the if statement to fail?
     
    #15
  16. Iliassine

    Iliassine Rider. Veteran

    Messages:
    90
    Likes Received:
    3
    First Language:
    French
    Primarily Uses:
    N/A
    To be honest, I really do not know where it could mess, still, it does not work. I'll try it on a test skill.
     
    #16
  17. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    652
    Likes Received:
    497
    First Language:
    French
    How do you debug things?

    Go through your action sequence line by line, check for syntax errors and points that could be the source of errors.
    What's actually inside variable 110, maybe it's just not a value you've checked and thus nothing happens, maybe your syntax is wrong again, maybe it's both?
     
    #17
  18. Iliassine

    Iliassine Rider. Veteran

    Messages:
    90
    Likes Received:
    3
    First Language:
    French
    Primarily Uses:
    N/A
    Found a typo in the number of the variables. It should work now ! Thanks for your help !
     
    #18
  19. Astfgl66

    Astfgl66 Veteran Veteran

    Messages:
    652
    Likes Received:
    497
    First Language:
    French
    You're missing the "end" keyword in your action sequence too, for your if statements.
     
    #19
  20. Iliassine

    Iliassine Rider. Veteran

    Messages:
    90
    Likes Received:
    3
    First Language:
    French
    Primarily Uses:
    N/A
    Thanks. Last question : I'm not english so I have quite some problems with plugin understanding but : The "Change Variable X = Y", how does it work ? Must I put "Change variable 0 = 153" if I want the 153rd variable to be set to 0 ?
     
    #20

Share This Page