UPLOAD, SHARE, PRESERVE MUGEN FOR ETERNITY!

Results 1 to 5 of 5

Thread: Need help coding a bomb helper to be tossed around by any hit.

  1. #1
    Join Date
    Jun 2016
    Location
    Posts
    37
    Uploads
    3
    Comments
    65

    Question Need help coding a bomb helper to be tossed around by any hit.

    What I'm trying to do is a move that is very similar to Lei-Lei's bomb. I want my bomb able to be hit by any attack, including by the character who created it and their partner, and be moved around in this fashion. Ideally, it would be pushed around farther than a character would since the bomb is lighter than a person, assuming this can be done with the VelAdd state controller.

    What I did is like this: the bomb is a helper with collision boxes, when the idle animation is finished it will go into the exploding state, the explosion is still the same helper but with a HitDef and goes away when the animation is finished. So far the bomb is functional, but can't be interacted otherwise. I figure it obviously needs a proper HitOverride but that requires the helper to be put in another state, which resets the timing because the exploding requires the idle animation to reach its end. Maybe somehow the bomb can be moved around without changing its state? Using another helper, perhaps to drag it around? Any advice and suggestions are appreciated but keep in mind that I am somewhat terrible at coding.



  2. #2
    mulambo is offline wicked and toxic user banned for repeated defamation, spreading plain lies with clear intent to damage people's reputation and/or ruin people's motivation
    Join Date
    Aug 2016
    Location
    Posts
    1,733
    Uploads
    70
    Comments
    55

    Default Re: Need help coding a bomb helper to be tossed around by any hit.

    My suggestion is to plainly copy-paste/adapt Lei-lei's bomb, then edit it if you're totally new to coding
    I think you'll need a state when the bomb is launched, a state when it's idle, a state for exlosion/cancel (unless it's supposed to be a contact bomb like you launch and it explodes if it reaches the opponent or the floor, in this case you just need 2 states: one for launching, the other for explosion).
    According to how you want the bomb to act it can be a time bomb, a proximity bomb.
    For the time bomb, the changestate between idle and explosion can just have "time" as trigger.
    For the proximity bomb, the changestate can be triggered with "P2BodyDist".
    For a customized bomb more triggers for the changestate between idle and explosion may work (like P2BodyDist and P2MoveType).
    It's all about sctrls and triggers, after you decide how the bomb should act.
    Last edited by mulambo; Feb 15, 2018 at 22:18.

  3. #3
    Join Date
    Jun 2016
    Location
    Posts
    37
    Uploads
    3
    Comments
    65

    Default Re: Need help coding a bomb helper to be tossed around by any hit.

    I already looked into Lei-Lei for coding inspiration when making my bomb, even if some of the stuff is complex and hard to understand. Anyway, my biggest trouble is getting the bomb to be moved around without putting it in a different state because of how it is set to explode when its idle animation is over. Lei-Lei's has some kind of timer set somehow and the bomb has a number of looping animations that change depending on the remaining time and when it is hit. The HitOverride state controller needs to put my bomb into a different state, so the when the bomb reenters the idle state the time until it explodes resets. Maybe I can get the bomb to be moved using VelSet in the idle state instead of an HitOverride? I'm going to try if that works. I feel that the trickiest part will be to make the bomb able to be hit by your side of the team.

  4. #4
    mulambo is offline wicked and toxic user banned for repeated defamation, spreading plain lies with clear intent to damage people's reputation and/or ruin people's motivation
    Join Date
    Aug 2016
    Location
    Posts
    1,733
    Uploads
    70
    Comments
    55

    Default Re: Need help coding a bomb helper to be tossed around by any hit.

    some of the stuff is complex and hard to understand.
    well, you can take your time and check the state controller reference if there's anything to help you understanding ( http://www.elecbyte.com/mugendocs-11b1/sctrls.html ).
    Anyway, my biggest trouble is getting the bomb to be moved around without putting it in a different state because of how it is set to explode when its idle animation is over.
    Well basically you can make some cheap stuff like

    [State1111,movebycontact)
    type = VelSet
    trigger1 = P2BodyDist x = 0
    x = -2-random%2

  5. #5
    Join Date
    Jun 2016
    Location
    Posts
    37
    Uploads
    3
    Comments
    65

    Default Re: Need help coding a bomb helper to be tossed around by any hit.

    Okay, I managed to get some progress. I found a solution to make the bomb able to get hit without changing its state. Basically, the player spawns an invisible helper with the same hitbox as the bomb and as soon as this helper gets created it spawns its own helper, which is the bomb's visual animation. I used the BindToParent sctrl to attach the visual helper to the invisible one. The invisible one now can enter a different state when hit without changing the visual helper's state, dragging the visible helper along with it. The visual helper when it reaches the end of its animation it will explode, the explosion being a state with a HitDef. It works fine so far, but I don't know how to make the bomb increase the received hit's velocities a little bit to make it feel lighter. Here's the code for the get hit state I made:

    Code:
    [Statedef 1151]
    type = A
    physics = N
    movetype = H
    anim = 1150
    ctrl = 0
    
    [State 1151, VelAdd]
    type = VelAdd
    trigger1 = 1
    y = GetHitVar(yaccel)
    
    [State 1151, HitVelSet]
    type = HitVelSet
    trigger1 = !Time
    x = 1
    y = 1
    
    [State 1151, End]
    type = selfstate
    trigger1 = vel y > 0 && pos y >= -10
    value = 1152
    
    [State 1151, DestroySelf]
    type = DestroySelf
    trigger1 = NumHelper(1050) < 1
    If I made some mistakes here, let me know.

Similar Threads

  1. How do I allow Helper to move within stop time
    By DarkChocolate in forum MUGEN Development Help
    Replies: 3
    Last Post: Apr 10, 2019, 05:14
  2. Coding: Helper type with attr to denote a Projectile
    By RedAsh in forum MUGEN Development Help
    Replies: 3
    Last Post: Feb 06, 2018, 11:21
  3. Advanced Coding
    By mulambo in forum MUGEN Development Help
    Replies: 2
    Last Post: Jan 30, 2018, 13:04
  4. CODING: Helper and Projectile Type
    By RedAsh in forum MUGEN Development Help
    Replies: 2
    Last Post: Jan 28, 2018, 11:34
  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
  •