UPLOAD, SHARE, PRESERVE MUGEN FOR ETERNITY!

Results 1 to 8 of 8

Thread: Looking for Life regan coding

  1. #1
    Join Date
    Jun 2017
    Location
    Posts
    4
    Uploads
    0
    Comments
    22

    Default Looking for Life regan coding

    Looking for help coding a Life regan
    looking for something that is consistant and doesn't require the player to cast a motion or enter a state
    any help or input will be greatly appreciated



  2. #2
    Join Date
    Sep 2016
    Location
    Age
    40
    Posts
    39
    Uploads
    2
    Comments
    6
    Blog Entries
    1

    Default Re: Looking for Life regan coding

    Try the following:

    ;Life Regen
    [Statedef -2]

    [State -4,0]
    type = LifeAdd
    trigger1 = Life < LifeMax
    trigger1 = RoundState = 2
    value = 50
    persistent = 10

    To add it constantly, replace "RoundState = 2" with:

    gametime%10 = 0
    Value 50 is how much life you will acquire. 10 is how many ticks will go by, before health is restored. That is currently set for 300 life per second. Adjust accordingly

  3. #3
    Join Date
    Jun 2017
    Location
    Posts
    4
    Uploads
    0
    Comments
    22

    Default Re: Looking for Life regan coding

    Awesome going to put this bad boy to the test! Thanks!

  4. #4
    Join Date
    Jun 2015
    Location
    Posts
    2,536
    Uploads
    1595
    Comments
    4514

    Default Re: Looking for Life regan coding

    Hello buddy, coding related stuff should be posted at the development help section, i am moving this one for you, a little more attention next time ;)

  5. #5
    Join Date
    Jun 2017
    Location
    Posts
    4
    Uploads
    0
    Comments
    22

    Default Re: Looking for Life regan coding

    Quote Originally Posted by DarkValentine View Post
    Try the following:

    ;Life Regen
    [Statedef -2]

    [State -4,0]
    type = LifeAdd
    trigger1 = Life < LifeMax
    trigger1 = RoundState = 2
    value = 50
    persistent = 10

    To add it constantly, replace "RoundState = 2" with:

    gametime%10 = 0
    Value 50 is how much life you will acquire. 10 is how many ticks will go by, before health is restored. That is currently set for 300 life per second. Adjust accordingly

    Okay so I place the code in the state -2 files and I could not get it to work... I'm not sure what I'm doing wrong...

  6. #6
    Join Date
    Sep 2016
    Location
    Age
    40
    Posts
    39
    Uploads
    2
    Comments
    6
    Blog Entries
    1

    Default Re: Looking for Life regan coding

    Hmm....if that didn't help, try doing this instead

    [State -3, Regeneration]
    type = LifeAdd
    triggerall = Alive = 1
    trigger1 = (GameTime%10) = 0
    ignorehitpause = 0
    value = 2

    Life Regen code is a bit tricky, as it has to be correct and specific. But the way mugen is structured, it's a bit difficult to tell. This below is pulled directly from the docs.

    ii. Trigger persistency

    In the case where you do not want the trigger to activate every single time the condition is true, you will need to add a "persistent" paramter. Let us begin with an example:

    [State 310, 1]
    type = PosAdd
    trigger1 = Vel Y > 1
    x = 10

    This state controller moves P1 forwards by 10 pixels for every tick of game time where P1's Y-velocity is greater than 1. That is, the controller is being activated everytime the trigger condition is true. If we want the controller to be activated only once, we will need to add a line:

    [State 310, 1]
    type = PosAdd
    trigger1 = Vel Y > 1
    persistent = 0 ;<-- Added this line
    x = 10

    "Persistent" has a default value of 1, meaning that the controller is activated everytime the trigger is true.
    Setting "persistent" to 0 allows the controller to be activated only once during that state. This holds true until P1 leaves that state. If P1 returns to that state later, the controller can be activated once again.

    The "persistent" parameter can also take values other than 0 and 1:

    [State 310, 1]
    type = PosAdd
    trigger1 = Vel Y > 1
    persistent = 2 ;<-- Modified this line
    x = 10

    In this case, setting "persistent" to 2 means the controller will be activated once of every two times the trigger is true. Setting "persistent" to 3 activates the controller every 3rd time, and so on.
    So the code I just put above this may achieve what you're looking for instead, and hopefully it works.

  7. #7
    Join Date
    Jun 2017
    Location
    Posts
    4
    Uploads
    0
    Comments
    22

    Default Re: Looking for Life regan coding

    Thank you so much for responding yet again and I'm happy to say it worked like a charm!

  8. #8
    Join Date
    Sep 2016
    Location
    Age
    40
    Posts
    39
    Uploads
    2
    Comments
    6
    Blog Entries
    1

    Default Re: Looking for Life regan coding

    No problem, glad I was able to help.

Similar Threads

  1. CODING: Projhit####
    By RedAsh in forum MUGEN Development Help
    Replies: 0
    Last Post: Feb 05, 2018, 08:09
  2. Advanced Coding
    By mulambo in forum MUGEN Development Help
    Replies: 2
    Last Post: Jan 30, 2018, 13:04
  3. Grab Coding Help
    By RPGLover in forum MUGEN Development Help
    Replies: 0
    Last Post: Aug 12, 2017, 19:18
  4. Life value?
    By jlr24lp in forum MUGEN Configuration Help
    Replies: 6
    Last Post: May 23, 2017, 10:10
  5. Need Help Coding
    By himegami in forum MUGEN Development Help
    Replies: 5
    Last Post: May 22, 2017, 16:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •