Uh.. noob here, need some help
I'm aspiring to make a Mega Man fangame, but there are some basic things I don't even know about so before I try to build a stage or something stupid, a few questions.
1. Making Enemies Take Damage
I read a topic about this earlier, but I tried the method of using Alterable Values to make health for an enemy, I have the events in this order:
"1 Collision between (enemy) and (bullet)
Play sample attack
Sub 1 from Alterable Value(20)
2 Alterable Value(20) of (enemy) <=0
Destroy (enemy)"
Well, the enemy never shows up! It's like the AV is automatically set to 0.
2. Invincibility time and Sprite
I made it so when Mega Man touches an enemy, he'll take damage, while this works, I don't know how to give him invincibility time. I also have a problem with him changing his sprite to him being stunned and flashing, it only works half of the time.
3. Stumbling Back a Little Bit
I don't know how to make Mega Man stumble/move back for about 1 second when he's hit.
4. Sliding
In the games, Mega Man can slide if you hold down and the jump button, how do you make Mega Man slide if you hold down the down arrow and z at once? Also, when he slides, he slides forward a bit, probably 2 tiles, unless he slides into a crevice, in which he can slide as long as he wants until he's out of the crevice, so how do I change his height so he can fit in the crevice, and how to I make him go forward?
I hope you could understand all of this and I hope it wasn't too unbearable to read. ><
Re: Uh.. noob here, need some help
Hi there!
1. Is the alterable value of the enemy 0 at the start of the frame? You can set them by going to the "A...Z" tab of the Properties pane while the enemy is selected - click "New" to add another. (I'm not sure what your (20) notation is - are you using the 20th of the 26 available alterable values?)
For invincibility time, you would need to add some variable that you can use to keep track of invincibility - perhaps an alterable value of your Player object. You could set this to, say, 500 when an invincibility pickup is touched, and have an "Alterable Value of Player > 0 ... Subtract 1 from alterable value" event to continually decrease it. Then, you would check for this alterable value being above 0 as a condition added to the event that checks for the player touching the enemy - right-click on the event and choose "Insert".
For most of the rest of the questions I would probably recommend making a custom movement entirely through the events list, but depending on how familiar you are with MMF this may be a little advanced at this stage. You can find a couple of tutorials on how to do this in the Tutorials page, linked on the sidebar on the right.
Re: Uh.. noob here, need some help
1.
what you're doing is essentially right.
if your alt value was eg: alt value A, make sure its set to 20 either at the beginning of the frame, or when he's created.
you can set this in the object's properties too if you want so it will start at 20.
sound like the alt you are checking to see if its <=0 is not beginning at value 20.
2. for a time of invincibility, you maye have to add a line to the collision:
ie bullet collides with enemy
+ enemy animatiuon (flashing) is {not} playing
(or i would do + alt value S (for stunned) = 0 )
when the enemy is hit, set his alt value S to 25 for example.
also add a line to decrease this:
if enemys alt value S >0 sub 1
this would effectively make the collision NOT occur for about 1 sec, if your frames per sec were at 50.
each game cycle happens approx 2ms so 25 would be 1 sec, 50 2 secs ect.
this is approximate and can vary depending on how your game is running on any one system.
3.
could be incorporated into the alt S thing..
add to the sub 1 if alt S >0, play animation stumble, and move him back a bit, depending on how your movement is set up
4. you'll need customized movement set up so add these sort of features.. start with the basics first. get a solid custom running around and jumping engine going before looking at things like sliding etc.
lol david - i got interputed with my reply. :)
Re: Uh.. noob here, need some help
I have the first one solved, so thanks guys, but I don't follow on the second one.
I have it like this,
"1 Collision between (Mega Man) and (Enemy)
'Subract 7 from counter
Change animation to disappearing
Set S to 25'
S of (Mega Man) >0
'Sub 1 from S'"
All in the same line.
Also, danjo I do have a custom engine (which was made by someone else), guess who was stupid and forgot he could ask the maker of the engine about the sliding.
Re: Uh.. noob here, need some help
you need to seperate those lines:
megaman collide with enemy
+ alt s(megaman) = 0 <- its this part which wont allow a new collision to register until the alt s is back to 0
result is:
set megaman alt s to 25
play animation
subtract 7 from counter (im assuming that is a hitpoint system)
next line:
megaman alt s >0
result:
sub 1 from megamans alt s
also try a different animation to disapearing. that normally is reserved for destroyed objects, and may
cause a problem.. just make another animation called
"getting hit"
Re: Uh.. noob here, need some help
Who's custom engine are you using? It'd be helpful to know how it's set up.