Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: holden24 on Thu 29/03/2007 07:57:14

Title: 1213 type scripting?
Post by: holden24 on Thu 29/03/2007 07:57:14
Firstly, sorry if this is in the wrong forum, I didn't know where else to put it (except for maybe the Technical Forum).
Could someone please help me to script these actions?

1. When you press the Spacebar 1213 jumps forward, how would I script the animation for jumping forwards, because my character jumps back to his original position eg. if (keycode == 32) {
player.LockView(5);
player.Animate(player.Loop, 5);
player.UnlockView();
}


2. For jumping up and grabbing onto ledges, how would you script that?

and 3. For falling down when you jump and theres no walkable areas underneath you?

any help would be appreciated, thanks in advance.
Title: Re: 1213 type scripting?
Post by: Ashen on Thu 29/03/2007 10:06:49
This thread (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=29266.0) has a link to Bernie's platform module. It's been a while since I used it, but I think it works OK. It might be a little complicated, but you should be able to either use it as-is, or extract woring 'jumping' code from it. (A forum search for 'jumping' should turn up a few other options, that was just the first and best.)
Title: Re: 1213 type scripting?
Post by: holden24 on Thu 29/03/2007 11:09:36
I'll try the jumping module tommorrow. I'll let yous know how it was later.

EDIT- I tried it now and there is no instructions, and the forum post dont explain it in that forum!!! ???  :o
Title: Re: 1213 type scripting?
Post by: R4L on Thu 29/03/2007 12:02:08
To tell you, there isn't one function that will just make the character jump. Bernie's platform model is probably the best way to achieve the style of gameplay you need. It just takes a little tweaking.
Title: Re: 1213 type scripting?
Post by: holden24 on Fri 30/03/2007 06:21:34
What kind of tweaking, my character keeps floating up into the sky and I don't know how to stop it!!!
Title: Re: 1213 type scripting?
Post by: R4L on Fri 30/03/2007 12:08:22
Then your doing something wrong with the code.

Seriously, study that code. You'll start to understand it if you understand the basics of variables and ints.
Title: Re: 1213 type scripting?
Post by: Ashen on Fri 30/03/2007 12:23:39
You're not going to be able to make a 1213-style game without some fairly advanced coding. AGS isn't meant for that kind of game, and while it's obviously possible there's no easy way to do it.

As R4L said, study the code, try to figure out what it does and where you've gone wrong. If that's a bit overwhelming - start with soemthing simpler, get to know the language and the commands used, until you feel comfortable enough to make it work. (Further questions specfically about Bernie's module should probably go in that thread, but try to get an idea where the problem is first.)
Title: Re: 1213 type scripting?
Post by: holden24 on Sat 31/03/2007 01:20:09
I'm preparded to do some hard scripting, there's only one problem with the module.
My character doesn't move in his walking view when i try to move him with the arrow keys.
Title: Re: 1213 type scripting?
Post by: R4L on Sat 31/03/2007 06:19:59
That might be because the module doesn't have that scripted in.

Search for a Keyboard Movement module. It takes no scripting, you just have to load the module. Although it will mess with Bernie's code a bit.
Title: Re: 1213 type scripting?
Post by: holden24 on Mon 02/04/2007 01:53:26
Okay I'll explain everything...

I have a KeyboardMovement Module that I'm using, in game start it has

KeyBoardMovement.SetMode(eMode_Pressing);

but still Bernies Module makes the character move left and right and up and down by pressing Up, Down, Left and Right arrow keys.
When I take the code out of Bernies module to stop the character from moving my character can now walk (in his walking view) but cannot jump (by pressing the space bar in Bernies Module).
That's my problem.
Title: Re: 1213 type scripting?
Post by: holden24 on Tue 03/04/2007 11:08:41
It's sure taking a loooooooooooooong time for a reply!!!
Title: Re: 1213 type scripting?
Post by: JD on Tue 03/04/2007 11:27:55
Quote from: holden24 on Sat 31/03/2007 01:20:09
I'm preparded to do some hard scripting

If you're prepared to do some 'hard scripting' then you should just code it yourself, from scratch. Probably easier than trying to merge different modules into what you want em to do.