YesNoOk
avatar

Implementing a Granblue Fantasy Versus-like skill icon (Read 2148 times)

Started by Slivern, November 06, 2020, 11:35:16 am
Share this topic:
Implementing a Granblue Fantasy Versus-like skill icon
#1  November 06, 2020, 11:35:16 am
  • **
  • WE ARE NESTS: THE NEW WORLD ORDER
    • USA
I've been studying code from other MUGEN characters and there is something I want to do. In Granblue Fantasy Versus, there are skill buttons in that game where if you press a button, the skill is used and you have to wait until the cooldown timer for that ability is up.

My issue however, in addition to implementing that feature, is ensuring that the skill icon stays on the screen throughout a match. Similar to how a Warusaki3 CvS2 character would choose a groove at Round 1, and then the groove would remain on the screen (except the character I'm making isn't choosing a groove).

I'm not sure how to implement this yet. What I'm doing is that I'm studying code from NeoGouki's Chris (using his Orochi Mode), specifically where a meter would appear after the input for Orochi no chikara o mezameru, then the meter would empty over time. It has the kind of functionality I need for what I'm trying to do here, and the code is much more simpler to read and modify. Again, I just don't know how to make sure the icon itself remains throughout a match. The meter that appears during Orochi Mode disappears once the meter runs out. What else should I know or do?

The interface looks like this at the moment. The four squares just below the timer are where the skill icons will go.


Left: Skill Icon, full
Right: Skill Icon, empty
Last Edit: November 06, 2020, 11:39:57 am by Slivern
Re: Implementing a Granblue Fantasy Versus-like skill icon
#2  November 07, 2020, 12:40:02 am
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
You need to learn about Explods and persistent variables usage. This is all you need to basically code what you asked
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: Implementing a Granblue Fantasy Versus-like skill icon
#3  November 07, 2020, 08:55:50 am
  • **
  • WE ARE NESTS: THE NEW WORLD ORDER
    • USA
I messed a bit with the code. I think I'm getting what I want from it so far, but the skill icon keeps moving with the player though. How do I keep the position of the skill icon static so that it doesn't move with the player?

EDIT: I forgot to include what i'm doing so far. I did try manipulating the postype variable. To keep it on the screen, I kept the variable to p1. Setting the position to other parts of the screen otherwise causes the Explod animation to disappear.
Last Edit: November 07, 2020, 09:03:34 am by Slivern
Re: Implementing a Granblue Fantasy Versus-like skill icon
#4  November 07, 2020, 09:27:47 am
  • **
  • WE ARE NESTS: THE NEW WORLD ORDER
    • USA
I made some progress with the static positioning of the icon so disregard my question above.

Personally, I'd much prefer to keep this thread open as much as I can since I'm going to be implementing a feature people may be interested in. So just letting you all know that the problem isn't "solved".

Anyways, this is what I learned. To have a static icon on the screen, you can set the postype to left. When that happens, you should notice your icon at the very top left corner of the screen. Here is a snippet of that:



When setting the position using the "pos" variable, positive values make the icon move down and right. The results so far are a test so for now I have the icon at the bottom left.



With that said, here's my code so far. I recommend that no one who is learning MUGEN uses this but if you're just learning feel free to mess around. I have it set to State -3 just so I can test the positioning...that's the least you can do to mess around with the variables.

Code:
[State -3, Skill 1 Icon]
type = Explod
trigger1 = Time - 0
anim = 1500
ID = 1500
pos = 5, 145
postype = left  ;p2,front,back,left,right
facing = 0
vfacing = 1
bindtime = -1
ontop = 1
persistent = 1
ownpal = 1
ignorehitpause = 1