View previous topic :: View next topic |
Author |
Message |
Battleblaze Warrior Thread Monk

Joined: 19 Dec 2003 Posts: 782 Location: IndY OHR
|
Posted: Mon Jan 19, 2004 10:07 am Post subject: On keypress scripts??? |
|
|
I just wrote an on keypress script for jumping... but I dont know exactly how to trigger them...
scan code 30 is for A but I press button and nothing happens neh? _________________ Indy OHR! and National OHR Month Contest going on now!
"Aeth calls PHC an anti-semite; PHC blames anti-semitism"
-squall |
|
Back to top |
|
 |
Cube Dimensional Traveller

Joined: 02 Feb 2003 Posts: 294
|
Posted: Mon Jan 19, 2004 11:55 am Post subject: |
|
|
Well, when you make a on key press script you need to use "key is pressed (key)" in an if statement for it to work correctly. So:
Code: |
include, scancode.hsi
define script (01, key press, none)
script, key press, begin
if (key is pressed(key:a)) then (
#do the stuff you want below
)
end
|
So after you compile and import that script, you then need to go to the map you want to use it on and place that script in the "on key press" script section, which is in the general map options. This should work, so if it doesn't please post the script so we can take a look at it. |
|
Back to top |
|
 |
Battleblaze Warrior Thread Monk

Joined: 19 Dec 2003 Posts: 782 Location: IndY OHR
|
Posted: Mon Jan 19, 2004 3:50 pm Post subject: |
|
|
ok some how I got his mabugger workin with just
on keypress (30)
bla bla bala
end
BUT is there a way when you raise the z pixel to display a shadow at the bottom??? because when theres no shadow it looks like its just movig up. _________________ Indy OHR! and National OHR Month Contest going on now!
"Aeth calls PHC an anti-semite; PHC blames anti-semitism"
-squall |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Jan 19, 2004 9:37 pm Post subject: |
|
|
You could create an npc below the hero quite easily.. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Setu_Firestorm Music Composer

Joined: 26 Mar 2003 Posts: 2566 Location: Holiday. FL
|
Posted: Tue Jan 20, 2004 9:03 am Post subject: |
|
|
I was always under the impression that the OHR already had a shadow underneath you when you are lifted on the Z-axis. It works that way with vehicles anyway.
I try not to mess with keypress scripts that much. They drive me up the wall, too. _________________
Facebook: http://www.facebook.com/georgerpowell
Newgrounds: http://setu-firestorm.newgrounds.com |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Jan 20, 2004 8:43 pm Post subject: |
|
|
That's vehicals only. BB, whats that coe you posted? _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Battleblaze Warrior Thread Monk

Joined: 19 Dec 2003 Posts: 782 Location: IndY OHR
|
Posted: Thu Jan 22, 2004 10:39 am Post subject: |
|
|
How would a npace directly under it (no mader where the hero is on the map) and have it follow the hero!?
This is getting annoying. All I wanted was a few simple on keypress scripts to make some of my games more interactive (jumping, running, slashing etc.) I can't be;ive shadows are for vehicles only! If I didn't want a shadow I could have just use the walk NPC command!
I guess I'll just draw "Jump" walk abouts... _________________ Indy OHR! and National OHR Month Contest going on now!
"Aeth calls PHC an anti-semite; PHC blames anti-semitism"
-squall |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Jan 22, 2004 1:18 pm Post subject: |
|
|
Like this.
Code: |
script, jump, begin
variable (shadow, height, height add)
shadow := create npc (4) #change this number
height := 0 #set this to the default x pixel offset on the map
for (height add, 5, -5, -1) do (
increment (height, height add)
set hero z (me, height)
put npc (shadow, hero x, hero y + 10)
wait (1)
)
end |
_________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|