Newbie alert! Help needed... (movement)

A place for tutorials on how to get the most out of Flash

Newbie alert! Help needed... (movement)

Postby GoichiHollow » Wed Jun 09, 2010 6:13 pm

Hello,
joined this today, as I started to learn how to use flash so I could help out with this awesome game :D
So, I fired up flash, used some sprites from LoK, used some AS, blablabla
Now to the point, I first wanted to find out how to move Krystal. Watched 3 tuts and one of them included movement, but not enough it seems... I can let the sprite move, but them she keeps walking while shes standing still or she just freezes and I cant get the tail to move smoothly.. Mostly I find out things by myself, but I'm to unexperienced yet. I also tried to look after the AS in the game itself, but thats a bit too complicated yet...
So I wondered if somebody could help or maybe just link me a tut with movement.
Thanks in advance,
GoichiHollow
Everytime you look behind you your screen will come closer O.O
By you reading this i have succesfully wasted your time >:3
Image
User avatar
GoichiHollow
 
Joined: Wed Jun 09, 2010 10:23 am
Location: HERE!

Re: Newbie alert! Help needed... (movement)

Postby Kryger » Wed Jun 09, 2010 7:09 pm

Applause on being a bleach fan :D
As for movement, I haven't tried much, but I've pieced together a bits of codes, Plus I asked the same question :D
viewtopic.php?f=6&t=221
You are no God to me. This is a Reckoning.
You are nothing to me. This is a Reckoning.
User avatar
Kryger
 
Joined: Sun Mar 14, 2010 9:04 pm
Location: Hell

Re: Newbie alert! Help needed... (movement)

Postby GoichiHollow » Wed Jun 09, 2010 9:17 pm

Kryger Wrote:Applause on being a bleach fan :D
As for movement, I haven't tried much, but I've pieced together a bits of codes, Plus I asked the same question :D
viewtopic.php?f=6&t=221

Oh sry -.-
Didn't mean to bug you either, lol, but thnx :)
PS: youre avatar is awsome
Everytime you look behind you your screen will come closer O.O
By you reading this i have succesfully wasted your time >:3
Image
User avatar
GoichiHollow
 
Joined: Wed Jun 09, 2010 10:23 am
Location: HERE!

Re: Newbie alert! Help needed... (movement)

Postby Kryger » Wed Jun 09, 2010 11:26 pm

Thanks :D and you didn't bug me at all :3
and Bleach related, I just watched the episode where Ichigo kicked Ulquiorra's ass :D though I did like seeing Nel turn badass more, especially with all the ripped clothing.
You are no God to me. This is a Reckoning.
You are nothing to me. This is a Reckoning.
User avatar
Kryger
 
Joined: Sun Mar 14, 2010 9:04 pm
Location: Hell

Re: Newbie alert! Help needed... (movement)

Postby GoichiHollow » Thu Jun 10, 2010 10:36 am

Kryger Wrote:Thanks :D and you didn't bug me at all :3
and Bleach related, I just watched the episode where Ichigo kicked Ulquiorra's ass :D though I did like seeing Nel turn badass more, especially with all the ripped clothing.

I'm 2 eps further :P And Ichigo should've stayed Vasto Lorde and use a Garganta to kick Aizens ass, but noooo...
But I'm wondering about Grimmjow, did he die? Didn't actually see him disappear or really die. Last thing was a stab from Noitorra...
Everytime you look behind you your screen will come closer O.O
By you reading this i have succesfully wasted your time >:3
Image
User avatar
GoichiHollow
 
Joined: Wed Jun 09, 2010 10:23 am
Location: HERE!

Re: Newbie alert! Help needed... (movement)

Postby Renara » Thu Jun 10, 2010 3:01 pm

The code for Krystal's movement is contained within each character symbol; looking at a an area there should be a character symbol at each side, just select one to see the movement code.

Basically it's just a case of having a named symbol, and then manipulating its ._x property (it's horizontal position), then triggering a different frame within it in order to activate the appropriate animation for whatever direction she's moving in. For reference, here's what the code looks like:

Code: Select All Code
onClipEvent(enterFrame) {
    if(_root.movement or _root.movementright) {
        if(Key.isDown(Key.RIGHT)) {
            _x += _root.movespeed;
            right = true;
            gotoAndStop(2); // Walking right animation
        } else if(right)
             gotoAndStop(1); // Standing animation facing right
    }
    if (_root.movement or _root.movementleft) {
        if(Key.isDown(Key.LEFT)) {
            _x -= _root.movespeed;
            right = false;
            gotoAndStop(4); // Walking left animation
        } else if(!right)
            gotoAndStop(3); // Standing animation, facing left
    }
}
Renara (team twitter | newgrounds)
Team Lead Programmer
Lok Team Member
Site Administrator
User avatar
Renara
Foxy Admin
 
Joined: Fri Jan 08, 2010 4:16 pm

Re: Newbie alert! Help needed... (movement)

Postby Kryger » Thu Jun 10, 2010 7:20 pm

Yay. Thanks Renara :D
You are no God to me. This is a Reckoning.
You are nothing to me. This is a Reckoning.
User avatar
Kryger
 
Joined: Sun Mar 14, 2010 9:04 pm
Location: Hell

Re: Newbie alert! Help needed... (movement)

Postby GoichiHollow » Fri Jun 11, 2010 9:29 am

Woohoo!
That's what I've been searching for :D :D Thnx,thnx
Only a shame I messed up my project, corrupted the file and have to start over again.. :cry:
But by messing up I came up with some ideas (for my own game, using the sprites of LoK) and need help with the scripting again -.-'
So, my first idea is to make some more armour and kinda make something like an arrow dress-up, my problem is: how do I make them appear like that in the game after personal customazing? Do I have to make MC's for all variants and link them to them or is there a simpler way?
Everytime you look behind you your screen will come closer O.O
By you reading this i have succesfully wasted your time >:3
Image
User avatar
GoichiHollow
 
Joined: Wed Jun 09, 2010 10:23 am
Location: HERE!

Re: Newbie alert! Help needed... (movement)

Postby Renara » Fri Jun 11, 2010 12:04 pm

In each of Krystal's body part sprites you'll find a layer with an armour symbol on it, these symbols are fairly straightforward, as each pair of frames contains a different style of armour. The fiddly part is the script as adding a new type of armour (adding more frames), requires you to update the scripting for all frames so that you can switch from any armour type to any other. I tidied it up a tiny bit, but it's it still involves a lot of copy pasting and adjusting of the if-statements to add in checks for your new armour type(s). So you might want to try and decide what armour types you want before you touch the scripting so you only have to do it once, and only update the script for one body part to begin with till you get it right, otherwise you end up debugging all the body parts which isn't fun!

Unfortunately the scripting for all this is very fiddly, not difficult exactly but it's very easy to make a mistake and have it not behave quite as you'd like, which coincidentally is how the ass-rape crash bug came about with a silly typo on my part! v0.3 will be a lot easier in many ways, but the internal scripting is far more complex, though if I'm doing my job right then content creators won't ever touch a script window except to call a function to make something happen :)
Renara (team twitter | newgrounds)
Team Lead Programmer
Lok Team Member
Site Administrator
User avatar
Renara
Foxy Admin
 
Joined: Fri Jan 08, 2010 4:16 pm

Re: Newbie alert! Help needed... (movement)

Postby GoichiHollow » Fri Jun 11, 2010 1:10 pm

Renara Wrote:In each of Krystal's body part sprites you'll find a layer with an armour symbol on it, these symbols are fairly straightforward, as each pair of frames contains a different style of armour. The fiddly part is the script as adding a new type of armour (adding more frames), requires you to update the scripting for all frames so that you can switch from any armour type to any other. I tidied it up a tiny bit, but it's it still involves a lot of copy pasting and adjusting of the if-statements to add in checks for your new armour type(s). So you might want to try and decide what armour types you want before you touch the scripting so you only have to do it once, and only update the script for one body part to begin with till you get it right, otherwise you end up debugging all the body parts which isn't fun!

Unfortunately the scripting for all this is very fiddly, not difficult exactly but it's very easy to make a mistake and have it not behave quite as you'd like, which coincidentally is how the ass-rape crash bug came about with a silly typo on my part! v0.3 will be a lot easier in many ways, but the internal scripting is far more complex, though if I'm doing my job right then content creators won't ever touch a script window except to call a function to make something happen :)

WOW, that's a lot at once... I managed to fish up some previews of my project so I'm back on it again.
My biggest prob is possibly I'm only at this for some days and don't understand too much YET. I already noticed they were all separate layers with armour and that's how I came up with the custumizing idea, cuz I like some parts of the one armour and then again like other parts from another armour better (will try to make my own too). But I still don't understand how she appears customized in the game... -.-? I'll just mess around a bit with the scripts and see how far I can get and upload it when I'm completely stuck or maybe freaked out by it not working
Everytime you look behind you your screen will come closer O.O
By you reading this i have succesfully wasted your time >:3
Image
User avatar
GoichiHollow
 
Joined: Wed Jun 09, 2010 10:23 am
Location: HERE!

Re: Newbie alert! Help needed... (movement)

Postby Renara » Fri Jun 11, 2010 2:22 pm

GoichiHollow Wrote:WOW, that's a lot at once... I managed to fish up some previews of my project so I'm back on it again.
My biggest prob is possibly I'm only at this for some days and don't understand too much YET. I already noticed they were all separate layers with armour and that's how I came up with the custumizing idea, cuz I like some parts of the one armour and then again like other parts from another armour better (will try to make my own too). But I still don't understand how she appears customized in the game... -.-? I'll just mess around a bit with the scripts and see how far I can get and upload it when I'm completely stuck or maybe freaked out by it not working

Right, well, in each armour symbol there are pairs of frames. The first frame of each pair contains the code for switching to another armour type, while the second simply loops, the result is that the actionscript within each symbol is constantly looping, every time it does it checks to see if a global variable has changed, and either remains in the loop (staying the same), or switches to another frame and thus another piece of armour. The armour is therefore controlled by the global variables you see in the code. Unfortunately these aren't easy to tweak, in order to control individual armour pieces, as they currently change a whole set of armour.

If you want to create a set of armour using existing pieces, then what you can do is customise the code to look for a new variable, and switch (and stay at) the correct piece if that variable is set to true. Like I say though it's extremely fiddly.
Renara (team twitter | newgrounds)
Team Lead Programmer
Lok Team Member
Site Administrator
User avatar
Renara
Foxy Admin
 
Joined: Fri Jan 08, 2010 4:16 pm

Re: Newbie alert! Help needed... (movement)

Postby GoichiHollow » Fri Jun 11, 2010 2:31 pm

GoichiHollow Wrote:I managed to fish up some previews of my project so I'm back on it again.

Couldn't get it back after all... :cry:
Everytime you look behind you your screen will come closer O.O
By you reading this i have succesfully wasted your time >:3
Image
User avatar
GoichiHollow
 
Joined: Wed Jun 09, 2010 10:23 am
Location: HERE!


Return to Tutorials



Who is online

Users browsing this forum: No registered users