Page 1 of 1

Just a few quick questions.

PostPosted: Fri Nov 30, 2007 3:14 pm
by Bannock
Ahoy there!

I'm making a test game so as to learn the ropes, and I've just got a few questions to ask. Before I start, I might mention that I've had a pretty thorough look about, and I've cobbled together some script, so none of my questions are aboutmoonwalking or that infinite jump thing.

Now then.

1. My main Actor has two different speeds (and animations to go with them) at which he can move. One is just pressing left and right, the other is holding the left shift key while pressing left and right.
My problem is this:

When moving fast by holding down the shift key and a direction, if I let go of the shift key but keep holding the directional button down, the character will move at the slower speed assigned to just the movement keys, but retain the animation for the faster movements. (Did that even make sense?)


2. My main Actor can double jump. This works perfectly but for one, strange thing.
My problem is this:

While going at the default speed(holding the directional button without holding the shift button), if my Actor jumps to the right, it cannot change direction and move to the left while in the air.
If the shift button is held, even in the same jump as the problem occuring, the Actor can move to the left just fine.
This problem doesn't occur if you jump left in the first place.

3. I have two pillars that are broken. I have collision assigned to the top of the broken pillar sprites, so that they can act as platforms.
My problem is this:

If my Actor jumps up to them from beneath, he teleports up onto them.
This isn't meant to happen, dammit. ><

4. Those pillars I was talking about.
My problem is this:

A minor one. I can't seem to make them go in front of my main Actor, no matter how much I fiddle with the Zdepth.

5. The ground.
My problem is this:

Only a minor one again. In a lot of places on the ground, my main Actor seems to shift about and sort of tremble a bit. I think I might know what causes it, and the solution, but if someone knows for sure, that'd be great.



Okay, so they weren't all short. But still. Any help would be greatly appreciated. =)
I'll attach my files as of now for those of you who want to fiddle about before answering.

Re: Just a few quick questions.

PostPosted: Fri Nov 30, 2007 3:48 pm
by Fuzzy
Bannock wrote:Ahoy there!

I'm making a test game so as to learn the ropes, and I've just got a few questions to ask. Before I start, I might mention that I've had a pretty thorough look about, and I've cobbled together some script, so none of my questions are aboutmoonwalking or that infinite jump thing.

You don't know how much we like hearing that someone new did some reading before asking questions! I'm giving you +1 point right now.

Now then.

1. My main Actor has two different speeds (and animations to go with them) at which he can move. One is just pressing left and right, the other is holding the left shift key while pressing left and right.
My problem is this:

When moving fast by holding down the shift key and a direction, if I let go of the shift key but keep holding the directional button down, the character will move at the slower speed assigned to just the movement keys, but retain the animation for the faster movements. (Did that even make sense?)


Sounds like you found a bug. Rest assured Makslane will take note of it. Hes good like that! What you need to work around this is a key up event for the shift key. Use the script edit after that and double check that the arrow key(s) are still pressed, and if so, use ChangeAnimation within the script editor to select the slower set. Please note that left and right shift are considered differently by GE. You will need to account for both.
2. My main Actor can double jump. This works perfectly but for one, strange thing.
My problem is this:

While going at the default speed(holding the directional button without holding the shift button), if my Actor jumps to the right, it cannot change direction and move to the left while in the air.
If the shift button is held, even in the same jump as the problem occuring, the Actor can move to the left just fine.
This problem doesn't occur if you jump left in the first place.

that sounds like a bug or bias in your script. I'll have a look and get back to you on it.
3. I have two pillars that are broken. I have collision assigned to the top of the broken pillar sprites, so that they can act as platforms.
My problem is this:

If my Actor jumps up to them from beneath, he teleports up onto them.
This isn't meant to happen, dammit. ><

You need to be sneaky here. I would put a wire frame actor above the platform. check your collision against that. The platform has collision turned off. When your actor collides against the bottom side of the wire frame actor, have it use an activation event to turn on collisions with the platform. One of the caveman tutorials shows how to do activation events, but if you have trouble with it, ask here.
4. Those pillars I was talking about.
My problem is this:

A minor one. I can't seem to make them go in front of my main Actor, no matter how much I fiddle with the Zdepth.


Is it possible that your main actor is set all the way forwards? if he is parented by the view or to the view, they will share a z-depth. There are several solutions to this. One is to just un-parent the actor and the view and synchronize the x and y(and maybe z-depth) by hand, possibly in the draw event. If you do this, place it in the draw event for the view, and it will get executed less often. Look for some of the posts on smooth scrolling and moving the view.
5. The ground.
My problem is this:

Only a minor one again. In a lot of places on the ground, my main Actor seems to shift about and sort of tremble a bit. I think I might know what causes it, and the solution, but if someone knows for sure, that'd be great.

Yeah, you figured it out.

Okay, so they weren't all short. But still. Any help would be greatly appreciated. =)
I'll attach my files as of now for those of you who want to fiddle about before answering.


Good questions, well written. Welcome to Game editor!

[edit]

its definately looking like a bug in GE. There may be a work around though. I'm thinking on it, but if someone else has a solution, please post.

Some things to note. When programming, it is proper to append a leading zero before a decimal place. for example, your .8 should be 0.8. While it works fine, getting in the habit of adding that zero will prevent a nasty little bug from ever showing up.

I'd also like to add that those are incredible sprites!

Re: Just a few quick questions.

PostPosted: Sat Dec 01, 2007 1:22 am
by Bannock
Well, I didn't draw the sprites, but I did track down the frames and put them together myself, so thanks. =P
Thanks for the point, too. ^_^

With the recommendation for the first problem, I created a variable called dir (because direction was taken).
I then set pressing the left key to make dir = 1.
Code: Select all
dir = 1;


I repeated this for the right key, making dir = 2.
Code: Select all
dir = 2;


I then set a key up event for the left shift key. It looks like this:
Code: Select all
if(dir = 1)
{ChangeAnimation("Event Actor", "MAGUSmoveLEFT", FORWARD);}
if(dir = 2)
{ChangeAnimation("Event Actor", "MAGUSmoveRIGHT", FORWARD);}


As far as I can see, this should work, but I guess I stuffed up somewhere.
It works if I'm moving to the right, but when moving to the left, letting go of the shift key while continuing to hold down the left key causes the MAGUSmoveRIGHT animation. Obviously, he looks a little silly doing this.

EDIT: I fixed the walking direction thing. Heh heh, what a stupid mistake. =P

Another minor problem is that if you hold the left shift button, then press a directional key, then let go of the direction key, then let go of the shift key, he gets stuck on the MAGUSmoveRIGHT/LEFT animation while standing still, until you move him.

I'm also having a little trouble using script to manage the jumping animation, if you've any recomendations for that.


Wow... no offence to anyone, but the tutorial on Activation Events is a little... convoluted.
I wouldn't mind some help on this one. I can create collision on the wire frame (I think I'll have it from all sides, so you can jump to it from above, as well), but I can't select Activation Event from there. So, I thought of creating a variable called PlatformCollision, and using the script editor upon collision with the wire frame, but then I realized that I don't know how to activate collision from within the script.

Fixed problem 4. and 5. easily enough, thanks for the help with those. =P

I've added the current version of my files as they stand now.

Re: Just a few quick questions.

PostPosted: Sat Dec 01, 2007 3:48 am
by Fuzzy
Well, I did do a activation event tutorial with youtube, but its a little crappy looking. perhaps you will not be able to see whats going on. I'll link anyway.
http://www.youtube.com/watch?v=qzeaTqdh-qU

As always, keep bugging me if I havent been clear.

Re: Just a few quick questions.

PostPosted: Sat Dec 01, 2007 5:47 am
by Bannock
I looked around the forums a bit more and I see that this particular problem has arisen before. I don't think I'm up to the challenge of tackling this just now, so I'll just make two of the pillars solid, and the middle one solid on the top only so you can run back to the first pillar if you fall.

Anywho, I'll continue looking about for past solutions to future (and current) problems.
Thank you for your help, and here's a point.
*Bows.*