View previous topic :: View next topic |
Author |
Message |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sun Mar 27, 2005 11:46 pm Post subject: How do I make jump an Npc or and a hero ? |
|
|
I would like Npcs or and heroes to jump because they are very much surprised. Does somoene know if there is a way to do that ? I am searching to compare different plotscripting commands so feel free to post any scripts that you think would be a good idea to do that !
As always thanks very much for the help ! |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Mon Mar 28, 2005 8:51 am Post subject: |
|
|
set hero z
and
set npc z _________________
|
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Mon Mar 28, 2005 10:26 am Post subject: |
|
|
Ooh, useful!
Code: | set hero z(hero, z) |
and
Code: | set npc z(npc ref, z) |
To use these, you would have a script like this:
Code: |
# put some supprising text box here!!!!!!1one
# hero freaks out:
set hero z(me, 4)
wait(5) #adjust this to however long you want the jump to last.
set hero z(me, 0)
|
_________________ I stand corrected. No rivers ran blood today. At least, none that were caused by us.
Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Mon Mar 28, 2005 2:31 pm Post subject: |
|
|
First of all, there is no "set npc z".
Second, another possibly smoother way to do it is with the "walk" command.
Code: | #say we're trying to make hero 0 jump.
set hero speed (0,10) #we want his jump to be very fast.
walk hero (0,up,1)
#let's say he's facing west, eh?
set hero direction (0,west) #you'll want the directional argument here to be the same as whatever way the hero was facing before.
wait for hero (0)
walk hero (0,down,1)
set hero direction (0,west)
wait for hero (0) |
Alternatively, you could always make it an autonumber script.
Code: | define script (autonumber,jump,1,0)
script,jump,who,begin
variable (d)
d := hero direction (who)
set hero speed (who,10)
walk hero (who,up,1)
set hero direction (who,d)
wait for hero (who)
walk hero (who,down,1)
set hero direction (who,d)
wait for hero (who) |
And to use that for hero 0, you'd just use |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Mon Mar 28, 2005 3:04 pm Post subject: |
|
|
Ah, so you're right. set hero z is a real command though. _________________
|
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
|
Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Wed Mar 30, 2005 3:24 am Post subject: Ok... There are various ways to do it ! |
|
|
Why does the topic on the faq website is called "how do I make an npc look like it's jumping? " The topic should be how I make a npc jumping ?
When you made tests: are they differences when you make an hero jumping using the set hero (z ) command and put hero (hero, hero pixel x (hero), hero pixel y (hero)--pixels)
Thank you all for the help! It's very usefull ! |
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Wed Mar 30, 2005 5:15 am Post subject: |
|
|
Technically yes. However, for most purposes, no.
Now, you have to use a bit more magic to get a hero to jump *over* something. You need to "suspend obstruction" (I think, someone correct me if I'm wrong) so that the hero can move through walls, and thus "jump over" something. _________________ I stand corrected. No rivers ran blood today. At least, none that were caused by us.
Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ |
|
Back to top |
|
 |
Uncommon His legend will never die

Joined: 10 Mar 2003 Posts: 2503
|
Posted: Wed Mar 30, 2005 10:47 am Post subject: |
|
|
Damned kids and your new-fangled pixel movement! Why, back in my day, we moved sprites a tile at a time, and we liked it, too!
But seriously, like I said, it's a smoother method. To have it move one pixel at a time would be impractical, and there's absolutely nothing wrong with using tile-based methods. |
|
Back to top |
|
 |
|