YesNoOk
avatar

KH2 Style Panel System- Anyone know how to code something like this? (Read 1241 times)

Started by Fayτ, December 19, 2009, 10:25:50 pm
Share this topic:
KH2 Style Panel System- Anyone know how to code something like this?
New #1  December 19, 2009, 10:25:50 pm
  • ****
  • Coder and Voice Actor
    • USA
    • Skype - byakuyaownsyou
    • www.youtube.com/vicmigderpaderp

  • Online
Anyone have any idea how I could code something like this
Spoiler, click to toggle visibilty

The command panel in particular...I already have the sprites I want to use for it as well...just dont know how to code it... Heres the sprites for the panel system
Spoiler, click to toggle visibilty

all help is greatly appreciated those who help out will be credited in the read me
Last Edit: December 21, 2009, 05:29:55 am by Getsuga Tensho
Re: KH2 Style Panel System- Anyone know how to code something like this?
#2  December 19, 2009, 10:46:13 pm
  • ******
? What's hard about that ?
Create a helper to display the panel, and then... well how do you move around and how do you pick up which command to do ? Have the panel detect the parent's commands to... I don't know, what does the panel do, move around, highlight the various commands ? Then have the parent react to the action determined by his helper (the panel).

First figure out EXACTLY the DETAILS of WHAT you want to do, and then translate that to code. You can't do much if you don't know exactly WHAT you want to do. You can't just say "I want the same thing as in this game" if you don't know everything about how that game works. What does your panel do ? How does it react to your key inputs ? How does your character react to your key inputs ? How do the actions of the character relate to the panel's situation ? Make sure yo know all that.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: KH2 Style Panel System- Anyone know how to code something like this?
#3  December 19, 2009, 10:55:06 pm
  • ****
  • Coder and Voice Actor
    • USA
    • Skype - byakuyaownsyou
    • www.youtube.com/vicmigderpaderp

  • Online
? What's hard about that ?
Create a helper to display the panel, and then... well how do you move around and how do you pick up which command to do ? Have the panel detect the parent's commands to... I don't know, what does the panel do, move around, highlight the various commands ? Then have the parent react to the action determined by his helper (the panel).

First figure out EXACTLY the DETAILS of WHAT you want to do, and then translate that to code. You can't do much if you don't know exactly WHAT you want to do. You can't just say "I want the same thing as in this game" if you don't know everything about how that game works. What does your panel do ? How does it react to your key inputs ? How does your character react to your key inputs ? How do the actions of the character relate to the panel's situation ? Make sure yo know all that.

Okay well Ill try some random things and post it later okay  :P
Re: KH2 Style Panel System- Anyone know how to code something like this?
#4  December 20, 2009, 07:03:39 am
  • ****
  • Coder and Voice Actor
    • USA
    • Skype - byakuyaownsyou
    • www.youtube.com/vicmigderpaderp

  • Online
Sorry for double posting but this is kind of a bump/ update

Heres my first attempt to make a panel system similar to KH2

http://www.youtube.com/watch?v=hWDDCjn1uZQ

Now...Seems to be working perfectly in the vid...But Attacking isnt triggered off of where the cursor is placed..Anyone know how to make it so that it is?
Last Edit: December 20, 2009, 09:08:29 am by Getsuga Tensho
Re: KH2 Style Panel System- Anyone know how to code something like this?
#5  December 20, 2009, 08:16:36 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Explain more. You want him to attack AFTER you select it, or no matter which panel you select you attack?

I mean, you have attack selected in the vid, and afterwards you attack. If you wanted us to see a problem you should have shown something that LOOKED like a problem. All i see there is something that's apparently working.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: KH2 Style Panel System- Anyone know how to code something like this?
#6  December 20, 2009, 09:09:14 am
  • ****
  • Coder and Voice Actor
    • USA
    • Skype - byakuyaownsyou
    • www.youtube.com/vicmigderpaderp

  • Online
Explain more. You want him to attack AFTER you select it, or no matter which panel you select you attack?

I mean, you have attack selected in the vid, and afterwards you attack. If you wanted us to see a problem you should have shown something that LOOKED like a problem. All i see there is something that's apparently working.

Quote
Now...Seems to be working perfectly in the vid...But Attacking isnt triggered off of where the cursor is placed..Anyone know how to make it so that it is?

I already established that it is not triggered off of Attack being highlighted...I was wondering how to make it so that it is
Last Edit: December 20, 2009, 09:24:52 pm by Getsuga Tensho
Re: KH2 Style Panel System- Anyone know how to code something like this?
#7  December 20, 2009, 01:24:21 pm
  • ******
Read my previous post, I explained how to use a changestate triggered by the position of the helper. You can't do that ? Well that's too fucking bad because you're not telling us ANYTHING that would let us help you. You're not posting your code, you are NOT giving us enough details on how it should work, you are not telling us anything. You want help ? Talk. Nobody is going to magically guess your solution.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: KH2 Style Panel System- Anyone know how to code something like this?
#8  December 20, 2009, 08:43:21 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Actually, you didn't make the function you desired plain. As i said, attack is selected, and you're attacking.

do you

A: Want him to attack while it's selected with no input from you
or
B: Want to be able to use the keys and do physical attacks when it's selected and changing to magic would give you magic ones?

EXplain


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: KH2 Style Panel System- Anyone know how to code something like this?
#9  December 20, 2009, 09:27:59 pm
  • ****
  • Coder and Voice Actor
    • USA
    • Skype - byakuyaownsyou
    • www.youtube.com/vicmigderpaderp

  • Online
Quote
Now...Seems to be working perfectly in the vid...But Attacking isnt triggered off of where the cursor is placed..Anyone know how to make it so that it is?
That would be the 3rd time ive explained what I wanted...

Heres the coding that I have

I more than likely will have to change the explod to a helper though

Spoiler, click to toggle visibilty
Re: KH2 Style Panel System- Anyone know how to code something like this?
#10  December 20, 2009, 09:34:51 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
And this will be the 3rd time i've told you that's not an explanation.

More than 2 sentences thanks. WHAT DO YOU WANT TO HAPPEN?

I'm sure that code works. It looks clean. I see nothing in there that does more than set a variable though.

Do you want

A: If attack is selected your character attacks based on buttons you press
OR
B: If attack is selected your character will proceed to do attacks because attack is selected with no input from you


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: KH2 Style Panel System- Anyone know how to code something like this?
#11  December 20, 2009, 09:45:58 pm
  • ****
  • Coder and Voice Actor
    • USA
    • Skype - byakuyaownsyou
    • www.youtube.com/vicmigderpaderp

  • Online
Option A...I thought that was already established.... I said that already... I want attack to be triggered off of when attack is highlighted and only work when it is highlighted...and same for everything else on that list...

Heres an example from the actual game....

http://www.youtube.com/watch?v=p4ki7CCg1BI
Last Edit: December 20, 2009, 09:54:38 pm by Getsuga Tensho
Re: KH2 Style Panel System- Anyone know how to code something like this?
#12  December 20, 2009, 10:04:35 pm
  • ******
Quote
I thought that was already established.... I said that already...
And I said already what you needed to do for that. And yet you keep saying the same thing. So what, did you not read what I was telling you to do ? You rather keep telling us the same thing and act like we weren't reading you the first time around ? If you didn't understand, why don't you say it ?
The helper checks the parent's commands and selects the right action according to your direction inputs.
When you press a button, in your cmd file, you check what the helper is currently selecting, and then you make a changestate depending on that. What else do you want ? This is as clear as it can be. What do you not understand in that ? If you don't know how to do it, can't you say it instead of acting like that ?
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: KH2 Style Panel System- Anyone know how to code something like this?
#13  December 20, 2009, 10:18:50 pm
  • ****
  • Coder and Voice Actor
    • USA
    • Skype - byakuyaownsyou
    • www.youtube.com/vicmigderpaderp

  • Online
Quote
I thought that was already established.... I said that already...
And I said already what you needed to do for that. And yet you keep saying the same thing. So what, did you not read what I was telling you to do ? You rather keep telling us the same thing and act like we weren't reading you the first time around ? If you didn't understand, why don't you say it ?
The helper checks the parent's commands and selects the right action according to your direction inputs.
When you press a button, in your cmd file, you check what the helper is currently selecting, and then you make a changestate depending on that. What else do you want ? This is as clear as it can be. What do you not understand in that ? If you don't know how to do it, can't you say it instead of acting like that ?

Well Im sorry ...Excuse me for not knowing how to do things and coming to you guys for help....Now..I dont have a helper set..I'm using an explod..so...could you please provide an example..in code that uses the method your talking about explaining what each part does and means so that I can learn
Re: KH2 Style Panel System- Anyone know how to code something like this?
#14  December 20, 2009, 10:40:30 pm
  • ******
[mcode]type = Helper[/mcode]Create a helper, create a statedef to start the helper at. In that statedef, you display the panel's animations.
In the helper's state, you dedicate a variable to the current position of the arrow. Helpers have their own sets of variables separated from the character's, so you don't worry about that.
Still in the helper's state, you constantly check for the parent's command (with trigger redirection). If the parent (your character, i.e. yourself) presses up or down, you change the helper's variable accordingly.
When you press a button and you have control and everything, you also add a trigger that looks for the current value of the helper's variable (trigger redirection again). And so you can make the changestate to whatever action you want. If the helper's variable says the panel is pointing at "attack", then you have the changestate send you to the attack state, and so on.

If there is anything (something specific) in this that you don't understand in this or don't know how to do, you should say it (and have a look at the docs if you don't find something about it if you look for the right keywords, I believe what I say up here should give you enough of these keywords to find info about it in the docs).
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: KH2 Style Panel System- Anyone know how to code something like this?
#15  December 20, 2009, 11:57:56 pm
  • ****
  • Coder and Voice Actor
    • USA
    • Skype - byakuyaownsyou
    • www.youtube.com/vicmigderpaderp

  • Online
[mcode]type = Helper[/mcode]Create a helper, create a statedef to start the helper at. In that statedef, you display the panel's animations.
In the helper's state, you dedicate a variable to the current position of the arrow. Helpers have their own sets of variables separated from the character's, so you don't worry about that.
Still in the helper's state, you constantly check for the parent's command (with trigger redirection). If the parent (your character, i.e. yourself) presses up or down, you change the helper's variable accordingly.
When you press a button and you have control and everything, you also add a trigger that looks for the current value of the helper's variable (trigger redirection again). And so you can make the changestate to whatever action you want. If the helper's variable says the panel is pointing at "attack", then you have the changestate send you to the attack state, and so on.

If there is anything (something specific) in this that you don't understand in this or don't know how to do, you should say it (and have a look at the docs if you don't find something about it if you look for the right keywords, I believe what I say up here should give you enough of these keywords to find info about it in the docs).

Okay that all seems to be working so far...but how do I make it so that it checks where The parent is...?
Like how do I make it so that attacks cannot be initiated unless attack his highlighted? I have no idea how to work with helpers  :P
Re: KH2 Style Panel System- Anyone know how to code something like this?
#16  December 21, 2009, 12:03:40 am
  • ******
Helpers work exactly the same way as the character, they go through statedefs the same way as the character.
The variable for the helper is used to know what the cursor is currently highlighting. Say, if var(1) = 1, you declare that "attack" is highlighted. If var(1) = 2, it's "magic".
In your cmd, you make the changestate triggered by the key press - adding the trigger "helper([the ID of your helper]),var(1) = 1" because you know that "attack" is highlighted if the helper's var(1) is 1.
Quote
but how do I make it so that it checks where The parent is...?
What do you mean by "where the parent is" ? Your character creates a helper. So the helper is the panel, and the panel's parent is the character - that is, you. So you have two "objects", the character and the helper. The panel is the one that knows what is currently highlighted.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: KH2 Style Panel System- Anyone know how to code something like this?
#17  December 21, 2009, 12:11:00 am
  • ****
  • Coder and Voice Actor
    • USA
    • Skype - byakuyaownsyou
    • www.youtube.com/vicmigderpaderp

  • Online
Helpers work exactly the same way as the character, they go through statedefs the same way as the character.
The variable for the helper is used to know what the cursor is currently highlighting. Say, if var(1) = 1, you declare that "attack" is highlighted. If var(1) = 2, it's "magic".
In your cmd, you make the changestate triggered by the key press - adding the trigger "helper([the ID of your helper]),var(1) = 1" because you know that "attack" is highlighted if the helper's var(1) is 1.
Quote
but how do I make it so that it checks where The parent is...?
What do you mean by "where the parent is" ? Your character creates a helper. So the helper is the panel, and the panel's parent is the character - that is, you. So you have two "objects", the character and the helper. The panel is the one that knows what is currently highlighted.

So where in particular would the vars go?
Spoiler, click to toggle visibilty


Sorry if i am becoming irritating its jus ha I have no clue how to use helpers in his fashion  :P
Re: KH2 Style Panel System- Anyone know how to code something like this?
#18  December 21, 2009, 12:33:50 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Nope, that's bad.

With your current state, (entered with Y) create a helper. Changestate out when it's released, as you had previously. Create a SECOND state for the helper.

Enter all your previous code there.

Also add the following to make things simple

[state parentvarset]
type = parentvarset
trigger1 = 1
v = 0
value = var(0)

We don't need to fuck round with redirects that way. Once you have THAT.

Lets invent some values. Attack is highlighted. Your var(0) = 0. All attacks that  are allowed when attack is highlighted are triggered normally but you add

triggerall = var(0) = 0 to them as well, this is in your .cmd file.

I preferred your previous one due to simplicity. But as we're onto helpers now we may as well stick with them.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: KH2 Style Panel System- Anyone know how to code something like this?
#19  December 21, 2009, 12:45:01 am
  • ****
  • Coder and Voice Actor
    • USA
    • Skype - byakuyaownsyou
    • www.youtube.com/vicmigderpaderp

  • Online
Nope, that's bad.

With your current state, (entered with Y) create a helper. Changestate out when it's released, as you had previously. Create a SECOND state for the helper.

Enter all your previous code there.

Also add the following to make things simple

[state parentvarset]
type = parentvarset
trigger1 = 1
v = 0
value = var(0)

We don't need to fuck round with redirects that way. Once you have THAT.

Lets invent some values. Attack is highlighted. Your var(0) = 0. All attacks that  are allowed when attack is highlighted are triggered normally but you add

triggerall = var(0) = 0 to them as well, this is in your .cmd file.

I preferred your previous one due to simplicity. But as we're onto helpers now we may as well stick with them.
Okay thank you that worked  :sugoi:

Now...for magic attacks  would I just add triggerall = var(0) = 2  for all magic attacks?
Re: KH2 Style Panel System- Anyone know how to code something like this?
#20  December 21, 2009, 01:19:53 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Is var(0) = 2 when you have magic selected? As you're making use of var(0) = 0, you're probably using var(0) = 1 for magic.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: KH2 Style Panel System- Anyone know how to code something like this?
#21  December 21, 2009, 01:22:39 am
  • ****
  • Coder and Voice Actor
    • USA
    • Skype - byakuyaownsyou
    • www.youtube.com/vicmigderpaderp

  • Online
Re: KH2 Style Panel System- Anyone know how to code something like this?
#22  December 21, 2009, 02:46:01 am
  • ****
  • Coder and Voice Actor
    • USA
    • Skype - byakuyaownsyou
    • www.youtube.com/vicmigderpaderp

  • Online
Sorry for double post..but Something rally screwy is happening now  o_O

A first i tried adding in a magic attack worked the first time through...but then i relaligned soem stuff in the air file and now its all fucked up...like when i hold y o bring up the menu...it doesnt show up and the screen freezes with the open and close sound playing over and over again...

heres the coding

Spoiler, click to toggle visibilty


And heres the coding in my main cns for the magic attack

Spoiler, click to toggle visibilty


Heres whats in the cmd

Spoiler, click to toggle visibilty
Last Edit: December 21, 2009, 02:53:31 am by Getsuga Tensho
Re: KH2 Style Panel System- Anyone know how to code something like this?
#23  December 21, 2009, 03:01:10 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Told you what you had earlier was bad. Your helper creates a helper which creates a helper ad infinitum

Basically, not good.

Create the helper in the .cmd when Y is pressed. Remove the helper creation from state 1500.

Use all the explod code you had before. That was fine. It's just inside a helper now rather than your parent so you can enter that menu and string stuff together without interrupting what the parent does.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.
Re: KH2 Style Panel System- Anyone know how to code something like this?
#24  December 21, 2009, 03:39:42 am
  • ****
  • Coder and Voice Actor
    • USA
    • Skype - byakuyaownsyou
    • www.youtube.com/vicmigderpaderp

  • Online
Told you what you had earlier was bad. Your helper creates a helper which creates a helper ad infinitum

Basically, not good.

Create the helper in the .cmd when Y is pressed. Remove the helper creation from state 1500.

Use all the explod code you had before. That was fine. It's just inside a helper now rather than your parent so you can enter that menu and string stuff together without interrupting what the parent does.
Okay that worked... thank you  :sugoi: Ill leave this topic unsolved just incase i need help with it in the future
Re: KH2 Style Panel System- Anyone know how to code something like this?
#25  December 21, 2009, 03:55:11 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
I'd prefer it left solved, you can always unsolve it if you need it.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.