2D Movement Script (wall jumping, combat etc)

Posted By: DavidLancaster

2D Movement Script (wall jumping, combat etc) - 12/02/05 03:39

Hey All

I'm working on making a small Axys mini game, that'll be a free download. I've just finished most of the basic movement code and am submiting the code for free to the community. If you've ever played the Captain Quark mini game in Ratchet & Clank 3, I was going for that type of movement. Features multiple wall jumping, ledge grabbing and combat. I've put it together in a small level, so you can just load up and run, download here:

www.accessphenomenon.com/2DAxysMovement.zip

Biggest feature is the blending of the animtions, you can use normal verticy animations yet have them blended so things look very nice and smooth.

Instructions are in ReadMe.txt.

Enjoy!

David
Posted By: Ambassador

Re: 2D Movement Script (wall jumping, combat etc) - 12/02/05 14:39

The demo code works like a dream! Thank you man!
Posted By: Bilbo

Re: 2D Movement Script (wall jumping, combat etc) - 12/02/05 15:57

that is 100% madness!!! i cant believe u didnt wrs ur model up though!!
Posted By: Mondivirtuali

Re: 2D Movement Script (wall jumping, combat etc) - 12/02/05 19:49

It is great! May I ask for another feature? A basic enemy (shoots or punch and die) ..being a 2d games we do not need of a realisti AI.
Posted By: DavidLancaster

Re: 2D Movement Script (wall jumping, combat etc) - 12/02/05 22:29

Quote:

that is 100% madness!!! i cant believe u didnt wrs ur model up though!!



The wrs file fell down a hole when I was eating some cheese
Posted By: Bilbo

Re: 2D Movement Script (wall jumping, combat etc) - 12/02/05 23:28

mm cheese still think ur mental for giving access to ur games model
Posted By: DavidLancaster

Re: 2D Movement Script (wall jumping, combat etc) - 12/03/05 02:27

Disadvantage of using Commercial edition.
Posted By: nikboy

Re: 2D Movement Script (wall jumping, combat etc) - 12/03/05 07:16

This script is great ! Thanks for sharing it !
Posted By: Ambassador

Re: 2D Movement Script (wall jumping, combat etc) - 12/03/05 11:24

Quote:

Quote:

that is 100% madness!!! i cant believe u didnt wrs ur model up though!!



The wrs file fell down a hole when I was eating some cheese




naa... I think it was the super AI who decompiled the wrs file...
Posted By: Iglarion

Re: 2D Movement Script (wall jumping, combat etc) - 12/04/05 12:15

This is great contribution!

David you are really hero on this comunity. First Zelda and RPG movement script, now 2D platform script, you have something for everbody.

Maybe in future you will update this script with jumping on the enemy head? We will see . I belive in you !

Keep up with good work!
Posted By: Hellcrypt

Re: 2D Movement Script (wall jumping, combat etc) - 12/04/05 19:14

Hey, this is a great contribution. Unforunatly Without comment's to most of the code it's a little bit hard to modify. Would it be possible for you to create a 3d instead of 2d movement? Post it for all of us. The same code just free 3d movement.

Sincerely
Posted By: Nadester

Re: 2D Movement Script (wall jumping, combat etc) - 12/05/05 01:38

Great script, thanks for the contribution!
Posted By: BoH_Havoc

Re: 2D Movement Script (wall jumping, combat etc) - 12/05/05 15:46

woaaahh dude, absolutely cool

great contribution *thumbsup*
btw: Your modeling/texturing/animating skills kick a**
Posted By: Lion_Ts

Re: 2D Movement Script (wall jumping, combat etc) - 12/07/05 13:22

Thanks for sharing your code. I like it.
Posted By: nuclear_winter

Re: 2D Movement Script (wall jumping, combat etc) - 12/07/05 14:53

Excellent!!!!!1
Posted By: sriram

Re: 2D Movement Script (wall jumping, combat etc) - 12/08/05 17:12

Excellent !! Thank for the contribution,really cool...

BTW,I second this
Quote:

It is great! May I ask for another feature? A basic enemy (shoots or punch and die) ..being a 2d games we do not need of a realisti AI.




It would be really cool if we have some mindless,basic enemies running towards us
Posted By: Stansmedia

Re: 2D Movement Script (wall jumping, combat etc) - 12/10/05 18:03

Thats fricken sweet! The animations in that model are excellent. Must have took alot of work. Awesome job.
Posted By: Josh_Arldt

Re: 2D Movement Script (wall jumping, combat etc) - 12/10/05 18:39

Very nice work.
Thanks for sharing.
Posted By: VPrime

Re: 2D Movement Script (wall jumping, combat etc) - 12/10/05 22:43

wow,that was great!!!
I think conitec should look into this and try an make a set of templates out of this. that way it would be easier to modify.. and more variety than just FPS, or otehr generic PC games.
Posted By: Wiz

Re: 2D Movement Script (wall jumping, combat etc) - 12/11/05 13:00

Great contribution! Keep 'em comming!
Posted By: Kotakide

Re: 2D Movement Script (wall jumping, combat etc) - 02/14/06 06:31

superb......
can you make the movement not only left and right, but he can move
left,right,front and back ,etc (ex: bomberman hero/Nintendo 64 system)
and the jump heigh affected by how long you press the key. ( more long you press the key then you jump more high )
if you can make it, then
nothing else to say, you a trully GENIUS!!!
Posted By: arsdigita

Re: 2D Movement Script (wall jumping, combat etc) - 03/13/06 00:58

Has anyone had issues trying this in the beta?

It crashes out with an error when I attempt to preview it from wed.

Am I missing some setup procedures?
Posted By: Mondivirtuali

Re: 2D Movement Script (wall jumping, combat etc) - 03/13/06 01:39

Quote:

wow,that was great!!!
I think conitec should look into this and try an make a set of templates out of this. that way it would be easier to modify.. and more variety than just FPS, or otehr generic PC games.



Totally agree!
Posted By: frazzle

Re: 2D Movement Script (wall jumping, combat etc) - 03/13/06 11:51

Really great contibution AxysPhenomenon !!!!
I have also seen your demo of Phenomenon and
I liked the movement in their so this
script should be exellent as well

Nice job

Frazzle
Posted By: DavidLancaster

Re: 2D Movement Script (wall jumping, combat etc) - 03/13/06 13:09

Thanks for your kind words, I really appreciate it.


Quote:

Has anyone had issues trying this in the beta?

It crashes out with an error when I attempt to preview it from wed.

Am I missing some setup procedures?



What is the error that you get? Does the error occur from opening the level in WED or does it occur when you go to run the level? What 3DGS version do you have?
Posted By: Drew

Re: 2D Movement Script (wall jumping, combat etc) - 04/13/06 21:29

THANK YOU!! AWESOME
Posted By: darkstein

Re: 2D Movement Script (wall jumping, combat etc) - 04/14/06 21:27

this is a great code but some enemys is also great
Posted By: aztec

Re: 2D Movement Script (wall jumping, combat etc) - 04/17/06 09:32

it doesnt work with a5
Posted By: Ludochrist

Re: 2D Movement Script (wall jumping, combat etc) - 05/02/06 07:22

Quote:

Thanks for your kind words, I really appreciate it.


Quote:

Has anyone had issues trying this in the beta?

It crashes out with an error when I attempt to preview it from wed.

Am I missing some setup procedures?



What is the error that you get? Does the error occur from opening the level in WED or does it occur when you go to run the level? What 3DGS version do you have?




I am having problems with this and the beta as well. when you try and run it from WED it dosent give you much info, it just says E355 Startup failure, but when i tried to run it from Sed it gave a more specific error, it said Error(97):Syntax error -nonexistent/empty function remove.


Posted By: HeelX

Re: 2D Movement Script (wall jumping, combat etc) - 05/02/06 09:27

I cant do the superjump and I cant climb ledges with the current beta release, plus, please use next time ent_remove() instead of remove() - I wasnt able to start the code the first time.
Posted By: slacker

Re: 2D Movement Script (wall jumping, combat etc) - 05/12/06 15:11

Quote:

I cant do the superjump and I cant climb ledges with the current beta release, plus, please use next time ent_remove() instead of remove() - I wasnt able to start the code the first time.




I am not able to do the wall jump or ledge grab either - maybe it is a 6.4 issue?
Posted By: DavidLancaster

Re: 2D Movement Script (wall jumping, combat etc) - 05/23/06 08:20

I made this with 6.314 so I have no idea if it is compatible with 6.4 or not...link is going to die like in a few days, if it does let me know and I'll reupload somewhere.
Posted By: D3D

Re: 2D Movement Script (wall jumping, combat etc) - 05/25/06 15:01

Thank you for sharing the 2D movement code I'd already tried the rpgturn and zeldacode, those are much apriciate too. From reading your scripts and study the code; I hope to learn howto write better code myself one day.

All the best,

Dusty
Posted By: DavidLancaster

Re: 2D Movement Script (wall jumping, combat etc) - 06/01/06 11:30

Download in first post no longer exists, try this link instead:

http://www.churness.com/axys/2DAxysMovement.zip

Thanks for your kind words dusty, I'm glad to see the scripts are helpful for you.
Posted By: D3D

Re: 2D Movement Script (wall jumping, combat etc) - 06/17/06 09:11

Replaced remove() with ent_remove(), but also having problem with walljump and ledge grabbing/climbing after updating GStudio to A6.40.5 Tried checking the syntax and found error on line 375 in level1.wdl in the 2D Movement Script.

Error(50): Parameter unknown c_move_x Parameter.

Now i'm not really expert c-script programmer. However it would be nice if someone who is and has already fixed these problems, could give me a little hint about the error and why it isn't working. So I can learn from it and try to fix myself.


All the best,

Dusty
Posted By: DavidLancaster

Re: 2D Movement Script (wall jumping, combat etc) - 06/17/06 12:28

Hello Dusty

Here is a version that should be compatible with 6.4:

http://www.churness.com/axys/2DAxysMovement6.4.zip

I've replaced remove() with ent_remove() and also added a new variable my.z_offset, which I mainly used as a shortcut to correction the hull of the player z wise rather than playing around with hull values in WED till I get it right. The z_offset changes the start position of the trace z wise in regards to traces that are used for gravity and wall jumping etc. I've set it to -7 at the start of the player action, I also had to change a few values around as 6.4 hull seems to be different and if I didn't change them wall jumping and ledge grabbing don't work.

Let me know if you have any problems.

David
Posted By: D3D

Re: 2D Movement Script (wall jumping, combat etc) - 06/17/06 14:33

Hello David,


Thank you for your reply, i've tried to run the updated code with A6.40.5 and walljump/climb is working again this is really awesome Also i'dd like to thank you for telling me why the code didn't worked anymore after 6.31.4, this way I can learn from it.

All the best,

Dusty
Posted By: Anonymous

Re: 2D Movement Script (wall jumping, combat etc) - 09/06/06 12:50

Wow great script, but how would I go about putting in kill able enemies?

--Edit - Also how would I put in a point collection system with onscreen display and health bar also could I make the guy climb rope and ladders?
Also is it possible to put in static items that hurt the player like fire.
and is there a drop distance that kills the player, like the holes in Mario?
I know there are loads of questions but i no nothing about scripting.
Thnx

--Tom_02345
Posted By: sPlKe

Re: 2D Movement Script (wall jumping, combat etc) - 09/06/06 14:44

therese no drop distance, so you would have to overwork it.
also, inserting killable enemies is possible by a very few easy lines of code...

if my pal finds the time to go with me through this code (IF) i will comment it, maybe bring it into a nice form and add stuff like enemies and health...

IF...
Posted By: Anonymous

Re: 2D Movement Script (wall jumping, combat etc) - 09/07/06 07:52

Ok kool, don't worry if you can't but it would be nice if you did.
Also how would be a good way to learn how to code becuase I would love to be able to do all of this myself but I need serious pointers.
--Tom_02345
Posted By: D3D

Re: 2D Movement Script (wall jumping, combat etc) - 09/07/06 08:28

If you need starting point to c-script syntax in order to program these things yourself, I highly recommend the gamestudio manual and George Pirvu's C-Script Workshops on the download page. Also the Acknex User Magazine may come in hand, there are already 58 available for you to dive in!

Anyways like Frank_G said in another topic: update your gamestudio version. The one your using atm is full of bugs and will lead to problems along the road.

Dusty
Posted By: Anonymous

Re: 2D Movement Script (wall jumping, combat etc) - 09/07/06 08:32

It's uptodate just didin't change my thing to say it is yet, lol I'm a bit lazy.
--Tom_02345
Posted By: Drew

Re: 2D Movement Script (wall jumping, combat etc) - 10/11/06 01:40

if you update to 6.50.2 you will see this code no longer runs... JCL posted a fix in beta:
(works for me now, added my_ to those key_cul and curs...
then added vars and the code below...)

quote:
fraid not - it's a hardwired feature of the C-Script compiler and I'm not allowed to touch this part of the code. I even do not know why you haven't seen those errors indicated before, as this error message is in place since A4.

But it should be easy to fix your script in 5 minutes:

1. search-and-replace all "key_" in your code by "my_key_".

2. Define a var "my_key_a", "my_key_b" etc. for all keys you are using.

3. Start the following piece of code from your main function:

while(1) {
my_key_a = key_a;
my_key_b = key_b;
...
wait(1);
}

Then you can still use all your key code and it's even legal.
Posted By: Bananatech

Re: 2D Movement Script (wall jumping, combat etc) - 10/27/06 10:25


There is no need to change all of the keys in this script
It is legal to "compare" a value to "read only" keys as long as you do not try to write to the "read only" keys.
Only six keys need a new replacement.

var my_key_cuu = key_cuu;
var my_key_cud = key_cud;
var my_key_cul = key_cul;
var my_key_cur = key_cur;
var my_key_ctrl =key_ctrl;

var mouse_movement_direction[3];

FUNCTION handle_movement() {
IF (mouse_right == 1) {
IF (mouse_force.x > 0 || mouse_movement_direction.x == 1) { mouse_movement_direction.x = 1; my_key_cur = 1; }
IF (mouse_force.x < 0 || mouse_movement_direction.x == -1) { mouse_movement_direction.x = -1; my_key_cul = 1; }
}
IF (mouse_left == 1) { my_key_ctrl = 1; }
IF (mouse_force.y > 0) { my_key_cuu = 1; }
IF (mouse_force.y < 0) { my_key_cud = 1; }
IF (key_w == 1) { my_key_cuu = 1; }
IF (key_s == 1) { my_key_cud = 1; }
IF (key_a == 1) { my_key_cul = 1; }
IF (key_d == 1) { my_key_cur = 1; }
....
....
....


that's all.
Allways trust the compiler
© 2023 lite-C Forums