Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Is it possible to make REALLY jump a hero ?

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Tue Jun 28, 2005 12:31 am    Post subject: Is it possible to make REALLY jump a hero ? Reply with quote

Hi ! Sorry to post a message again. I know I had sworn to do it but I think it is a important question:
Can we make really jump a hero ?

What do I mean by that ? Well I mean the aviability to go from (1(x),2(y) to 3(x), 2(Y) without beeing influenced by what is in 2(x), 2(Y) in particular if there is a hole.

Many rpgs are half rpg-plateform game. E.g Landstalker; Zelda...
Zelda is a special example but I think it would be good if we good make maps on which you can do as nearly many things as on Zelda's ,even if the engine can be limited sometimes.

If not I think it would be good to try to develop such abitilities...
Thanks for reading my umpteenth message and sorry for posting so many messages but I sincerly think it worths it!

Bis_senchi
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Rimudora
Psychopath yandere
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 26 May 2005
Posts: 335

PostPosted: Tue Jun 28, 2005 5:42 am    Post subject: Reply with quote

set hero Z (who,Z)
Sets the Z location of the specified hero. The Z location is the number of pixels above the tile they are standing on. Useful for scripts where you want a hero to jump or levitate.
Back to top
View user's profile Send private message Send e-mail
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Tue Jun 28, 2005 8:12 am    Post subject: Reply with quote

That's not what he's really asking.

Yes, you can make it so your hero can jump small gaps... but it'll require a bit more plotscripting than you think.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
TwinHamster
♫ Furious souls, burn eternally! ♫




Joined: 07 Mar 2004
Posts: 1352

PostPosted: Tue Jun 28, 2005 11:25 am    Post subject: Reply with quote

Wait...

So you're trying to make a script with something like:

Code:


if(
Key is pressed (Spacebar)
)
then(
walk hero(me, up, 1)
walk hero (me, right, 1)
wait for hero (me)
walk hero (me, left, 1)
walk hero (me, down, 1)
wait for hero (me)
)



?

*In this example, your hero can only jump one tile high and one tile far. And, you can't turn backwards. If you wanted to jump both directions, you'd need to make a variable which is the same value as the direction that your hero is facing (Left or right)*

Edit: Forgot Code tag.
Back to top
View user's profile Send private message Send e-mail AIM Address
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Wed Jun 29, 2005 3:45 am    Post subject: Reply with quote

Again, that's not what he's asking.


Here is a little script I wrote just now. I have tested it and it works, feel free to use it or ask questions about it.

Code:

define script (-1, jump forward, 0)
script, jump forward, begin
  variable (i, walkx, walky, hx, hy, jump)
  suspend player
  if (hero direction(me) == north) then (walky := -4) #walk at normal speed north
  if (hero direction(me) == south) then (walky := 4)
  if (hero direction(me) == east) then (walkx := 4)
  if (hero direction(me) == west) then (walkx := -4)
  jump := -5
  hx := hero pixel x(me)
  hy := hero pixel y(me)
  for (i, 0, 10) do (
    put hero (me, hx, hy + jump)
    hx := hero pixel x(me) + walkx
    hy := hero pixel y(me) + walk y
    jump += 1
    wait
  )
  resume player
end


This will make the hero jump 16 pixels high. You can change this to 32 with
jump := -5 --> jump := -10
jump += 1 --> jump += 2
but besides that there's no easy way to change the jump height.

This does NOT actually check if the tile 2 tiles ahead can be stood on. You should call this script from another. For example, if tile 10 is a platform tile, this might be your on keypress script:

Code:

global variable(1, jumping)

define script(1, onkeypress, 0)

script, onkeypress, begin
  #check if the player wants to jump
  if (key is pressed(key: Z), and, jumping == false, and, hero is walking(me) == false) then (
    variable (tilex, tiley)
    tilex := hero x(me)
    tiley := hero y(me)
    if (hero direction(me) == north) then (tiley -= 2)
    if (hero direction(me) == south) then (tiley += 2)
    if (hero direction(me) == east) then (tilex += 2)
    if (hero direction(me) == west) then (tilex -= 2)
    #now check if they can jump to the tile 2 spaces ahead
    if (readmapblock(tilex, tiley) == 10) then (
      jumping := true
      jump forward
      jumping := false
    )
  )
end


You can use a tag instead of a global variable but you should have a check in there. Also feel free to change the key used (currently z to jump).

Now if you want to make it look good, you should draw a jumping walkabout for your hero, and change the hero's walkabout.
Back to top
View user's profile Send private message Send e-mail
bis_senchi




Joined: 08 Jun 2004
Posts: 460
Location: Reims, France

PostPosted: Fri Jul 01, 2005 12:58 am    Post subject: Reply with quote

Ok! Ive tested the following and it unfortunatelly doesn't make the jump effect .
It makes the hero going down on the diagonal. So be carefull if you use it!
Thanks the same to TwinHamster for posting it and trying to solve the problem!

Be carefull with the folllowing code!if(
Key is pressed (Spacebar)
)
then(
walk hero(me, up, 1)
walk hero (me, right, 1)
wait for hero (me)
walk hero (me, left, 1)
walk hero (me, down, 1)
wait for hero (me)
)

I think I will use the Mad Cacti code. It works very well. Thanks very much !
Shall I post it? I am sure that many people will be interested! Before I will add an alter command so that the hero really give the impression that he (or she) jump!

Thank once again to Mad Cacti and good luck to everyone in making your game!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group