YesNoOk
avatar

Sorry for the long winded post errr... Help? (Read 1067 times)

Started by StormCrow, December 02, 2007, 04:33:41 pm
Share this topic:
Sorry for the long winded post errr... Help?
#1  December 02, 2007, 04:33:41 pm
  • *
  • The last metroid is in captivity
Alright here's the deal. I've been browsing the net a lot trying to learn character creation. So far I've learned a good deal and have a few working characters, nothing too technical (supers, projectiles everything working). I'm working on a new project now though, I want to make the original three classes from the first Diablo. I've got a lot of good ideas: when the character has enough special meter making the level up button appear and after you preform a sequence it will increase your damage multipliers. I don't need help with that part. What I do need help with is this:

1.) I want the character to move freely about the screen (no jump). I've searched the state controller reference and I'm honestly a bit lost with this. Do I override the default jump and crouch states with velset or posadd and do the same for diagonals?

2.) In order for it to work correctly the projectiles will have to go at different angles so can I put trigger = stateno in the cmd for coding multiple projectiles for one button? (Is this a valid trigger)

   Any help will be much appreciated! I've been to several other forums and honestly I didn't want to post after I saw how some people were treated for asking simple questions, but after looking over mugenguild you guys seem a lot friendlier so I figured what the hell?

Thnx
S /\/\/\.
Re: Sorry for the long winded post errr... Help?
#2  December 02, 2007, 08:04:56 pm
  • *****
    • Peru
    • www.mugenguild.com/renzo
1. Overriding Stand and walk state won't work, since the jumpo ChangeState is coded into the engine and it is not controllable by the programmers. But, you can create a set of "parallel" states for stand and walk. And send your character to that states.

2.Yes, It is a valid trigger. Completely possible. I sugest using a variable that tracks the orientation of your character so you can define the projectile state in a parametric way (i.e.: No need to code 8 projectile states if you want to shoot projectiles in 8 directions).

Sorry for being so vague, but can you elaborate the behavior of your character a bit more?
Re: Sorry for the long winded post errr... Help?
#3  December 03, 2007, 04:52:09 pm
  • *
  • The last metroid is in captivity
Thanks for the quick response. Yeah its kinda simple I just want the character to move similar to mike tyson or sir godber, where the character essentially moves through the background and is not bound to the bottom of the screen like most characters. I've looked at some codes for flying and thought that I could use that to somehow make it work but implementing it only gave weird effects.

I want the char to move (be able to walk in these directions) like this:



Similar to this char:

S /\/\/\.
Last Edit: December 03, 2007, 05:23:42 pm by StormCrow
Re: Sorry for the long winded post errr... Help?
#4  December 03, 2007, 06:35:09 pm
  • ******
  • [E]
    • Mexico

  • Online
1.you will have to use physics = N in all your states, so mguen won't try to improperly applu gravity and friction.

2. you can either override the comon states, or just set ctrl to always 0, and code the movement your self.. whichever you find easier; it is just an exchange of headaches.
Re: Sorry for the long winded post errr... Help?
#5  December 04, 2007, 03:41:06 am
  • *
  • The last metroid is in captivity
Thanks adding the physics = N helped. I got it to work using this code (I'm posting in case anyone else has trouble trying to do what I'm doing)

This will allow your character to move down through the screen instead of crouching. Doing the same thing with state 40 will allow you to move upward

   [statedef 10]
type    = A
movetype= A
physics = N
poweradd= 0
ctrl = 0
anim = 11

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElem = 1
trigger2 = AnimElem = 2
trigger3 = AnimElem = 3
trigger4 = AnimElem = 4
trigger5 = AnimElem = 5
trigger6 = AnimElem = 6
trigger7 = AnimElem = 7
trigger8 = AnimElem = 8
x = 0
y = 5
;ignorehitpause =
;persistent =


[State 10,2]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1


The only problem is that the character can just continue walking indefinately off the screen. How can I stop this?
S /\/\/\.
Last Edit: December 04, 2007, 03:51:09 am by StormCrow
Re: Sorry for the long winded post errr... Help?
#6  December 04, 2007, 05:59:27 pm
  • ******
  • [E]
    • Mexico

  • Online
instead of posadd you might want to use velset... also, post your state 11 code.
Re: Sorry for the long winded post errr... Help?
#7  December 04, 2007, 06:09:09 pm
  • *
  • The last metroid is in captivity
I tried overriding state 11 but the character just continuously walked down whenever I pressed any direction  ???. When I override state 10 it worked. Prolly cause I'm using a template and not doing this from scratch I know, but I'm still learning. Also Velset works about the same the character can still walk off the screen. Is there some sort of trigger I can add like:  pos !=       to fix this?
S /\/\/\.
Last Edit: December 04, 2007, 06:19:28 pm by StormCrow
Re: Sorry for the long winded post errr... Help?
#8  December 04, 2007, 09:10:06 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
All you're after is the flight code really.

If you set up an alternate state for it. A common one for flight IMO is 1900, all you need are 9 velsets based on the keys you're pressing. 8 for directional movement, and one for stop.

Physics of N is fine here. You'd then use (ctrl || stateno = 1900) for your commands you wanted activated while in this state. All you need do then is override the stand state to go to 1900 if Pos Y!= 0

Breaks stages like the MNES games but is otherwise very effective.


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: Sorry for the long winded post errr... Help?
#9  December 10, 2007, 02:33:32 am
  • *
  • The last metroid is in captivity
Ok I finally got it!

If theres anyone else out there who wants a character who moves throughout the screen like this, this is the way I did it:

1) First I override the jumping and crouching states, place this in your cns. Thnx Meeeeeeeerkat :) for the info.

 [statedef 40]   ;walking up
type    = A
movetype= A
physics = N ;thanks much R[E]ika :)
poweradd= 0
ctrl = 0
anim = 41

[State 0, PosAdd]
type = PosAdd

triggerall = Pos Y >= -183 ;Prevents the character from walking off the screen-Change to suit your chars size, position

trigger1 = AnimElem = 1 ;change the triggers to suit your char
trigger2 = AnimElem = 2
trigger3 = AnimElem = 3
trigger4 = AnimElem = 4
trigger5 = AnimElem = 5
trigger6 = AnimElem = 6
trigger7 = AnimElem = 7
trigger8 = AnimElem = 8
x = 0
y = -5
;ignorehitpause =
persistent = 1


[State 410, 5]
type = ChangeState
trigger1 = (command != "holdup") ;Thnx much Cyanide :) (will stop moving up when not holding up)
value = 0 ;changes to the default standing anim
ctrl = 1

   [statedef 10]    ;walking down ;pretty much same as previous
type    = A
movetype= A
physics = N
poweradd= 0
ctrl = 0
anim = 11

[State 0, PosAdd]
type = PosAdd
 triggerall = Pos Y <= 4
trigger1 = AnimElem = 1
trigger2 = AnimElem = 2
trigger3 = AnimElem = 3
trigger4 = AnimElem = 4
trigger5 = AnimElem = 5
trigger6 = AnimElem = 6
trigger7 = AnimElem = 7
trigger8 = AnimElem = 8
x = 0
y = 5
;ignorehitpause =
persistent = 1

[State 410, 5]
type = ChangeState
trigger1 = (command != "holddown")
value = 0
ctrl = 1

2.) Then I just made a new state for walking up-right, up-left, down-left, and down-right, and set the triggers to (command != hold whatever).

Thnx everyone for the help!!
S /\/\/\.
Last Edit: December 10, 2007, 02:47:30 am by StormCrow
Re: Sorry for the long winded post errr... Help?
#10  December 10, 2007, 04:45:06 pm
  • *
  • The last metroid is in captivity
Alright everything is going smoothly I just have one final question if anyone can help.
I'm using a transform state controlled by var(0). This is the code that sets the var to one and levels the rogue to level 2 changing her appearance types and attack multipliyer In my cmd :

 triggerall = Var (0) != 1
triggerall =  (Command = "level2")  &&  power >= 1500
trigger1 = (statetype = A) && ctrl 

The problem is that the player can always trigger the move as long as the power gauge is at 1500. what am I doing wrong?
S /\/\/\.
Re: Sorry for the long winded post errr... Help?
#11  December 10, 2007, 05:25:05 pm
  • ******
  • [E]
    • Mexico

  • Online
it looks like the var is not being set properly.
Re: Sorry for the long winded post errr... Help?
#12  December 10, 2007, 05:32:52 pm
  • *
  • The last metroid is in captivity
This is in the varset in the cmd

;reaches level 2

[Statedef 2900]
type    = S
movetype= A
physics = S
anim = 180
ctrl = 0
poweradd = -2000

[State 2900: AttackMulSet]
type = AttackMulSet
trigger1 = AnimElem = 1
value = 1.5

[State 2900: VarSet]
type = VarSet
trigger1 = AnimElem = 1
var(0) = 1


[State 2900: ChangeState]
type = ChangeState
trigger1 = (AnimTime = 0)
value = 0
ctrl = 1




S /\/\/\.
Re: Sorry for the long winded post errr... Help?
#13  December 10, 2007, 05:52:08 pm
  • ******
  • [E]
    • Mexico

  • Online
weird... remove the trailing space in the triggerall , and strict type Var (0) to var(0) .. if that still does not work change var0 to another number as you might be using it for something else, have a bug somewhere else.
Re: Sorry for the long winded post errr... Help?
#14  December 10, 2007, 06:12:57 pm
  • *
  • The last metroid is in captivity
Tried both, then tried the default

[State 0, VarSet]
type = VarSet
trigger1 = AnimElem = 1
v = 2    ;fv = 10
value = 1
;ignorehitpause =
;persistent =

It sets the variable (she still changes states) but apparently var(2) != 1 is not picking it up. Also tried Time = 0 as a trigger.... did not help
S /\/\/\.
Re: Sorry for the long winded post errr... Help?
#15  December 10, 2007, 06:23:27 pm
  • ******
  • [E]
    • Mexico

  • Online
i meant, in the trigger.
Re: Sorry for the long winded post errr... Help?
#16  December 10, 2007, 06:54:26 pm
  • *
  • The last metroid is in captivity
Yeah I know, tried changing the trigger to everything I could think of, and everything you recomended. it's wierd b/c it recognizes it within the constants but not within the commands...  ??? I have a helper coded to display the level up icon from the game whenever var(0) was set (I tried changing that to a diff number as well) In either case the helper knew not to display if the variable was correct but the player can still preform the level up move.
S /\/\/\.
Last Edit: December 10, 2007, 07:23:44 pm by StormCrow
Re: Sorry for the long winded post errr... Help?
#17  December 10, 2007, 09:25:49 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Your command should look like this

[state -1]
type = changestate
triggerall = command = "level2" && power >= 1500
triggerall = var(0) != 1
trigger1 = statetype = A && ctrl
value = 2900

Make sure it's not repeated anywhere else without the variable requirement. I see no reason why your variable wouldn't trigger at all, and it sounds like it is to me. The problem must be in the .cmd and is probably an extra state change you've forgotten about.


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: Sorry for the long winded post errr... Help?
#18  December 10, 2007, 09:50:21 pm
  • *
  • The last metroid is in captivity
Really sorry guys it was totally my fault you were both right. Somehow when I was using ff it coded in two commands for the same move. Prob my fault. After removing one it wurks now. I feel like a complete dumbass. It took me a while to find b/c I have a lot of conditional commands. Sorry again.

S /\/\/\.
Re: Sorry for the long winded post errr... Help?
#19  December 12, 2007, 09:23:53 am
  • *
  • The last metroid is in captivity
Ok movement is good. Now I have one more problem (I think after this I can finish the rest on my own). I'm trying to override the state to change the walking animations when the character has reached level 1. The change occurs but the animation does not play and the character moves wayyyyy to fast. I imagine the code for the changeanim is missing something.....this is the code I'm using for the up and right movement:

 ;up and right
    [statedef 991]
type    = A
movetype= A
physics = N
poweradd= 0
ctrl = 0
anim = 42

[State 0, 2]
type = ChangeAnim ;is there something else I should add to this?
trigger1 = var(0)=1
value = 9804

[State 0, PosAdd]
type = PosAdd
triggerall = Pos Y >= -183
trigger1 = AnimElem = 1
trigger2 = AnimElem = 2
trigger3 = AnimElem = 3
trigger4 = AnimElem = 4
trigger5 = AnimElem = 5
trigger6 = AnimElem = 6
trigger7 = AnimElem = 7
trigger8 = AnimElem = 8
x = 5
y = -5
;ignorehitpause =
persistent = 1


[State 410, 5]
type = ChangeState
trigger1 = (command != "walkur")
value = 0
ctrl = 1
S /\/\/\.
Re: Sorry for the long winded post errr... Help?
#20  December 12, 2007, 09:43:56 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
5,-5 isn't precisely slow. Try a smaller value if it's going too fast.

The animation isn't playing through because var(0) = 1 is always 1 during that state. As such, it's triggering every tick and replaying from the start. There's 2 ways around this

trigger1 = anim != 9804

OR add the line persistent = 0 to the end of the changeanim (i suggest the trigger method please)

Btw, you don't need so much in your velset, just pos Y>= -183 would do. Add a command = "walkur" if you want a bit more control there. Physics = N means that no friction is applied the character won't stop or slow down unless it comes into contact with something that makes it do so, ie a player or helper with playerpush. Not really bad what you have and it works, it's just unecessary.


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.