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

Joined: 19 Dec 2003 Posts: 782 Location: IndY OHR
|
Posted: Fri Nov 04, 2005 3:03 pm Post subject: R.E style cutscens eh? |
|
|
Just wondering if an interactive cutscene is possible. By interactive I mean you have a quick window to press a key, if you press it=good cutscene, u dont press it ontime= you get fucked up cutscene.
Possible yesh?No? _________________ 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: Sat Nov 05, 2005 2:25 am Post subject: |
|
|
Yes, easy. Just use key is pressed. Example:
Code: |
variable (counter, key)
counter := 18 #change this
#show an instruction
while (counter) do (
counter -= 1
if (key is pressed(key:space)) then (key := 1, counter := 0) #change the key
wait
)
if (key) then (
#good things
) else (
#bad things
)
|
_________________ "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: Mon Nov 07, 2005 6:37 pm Post subject: |
|
|
i get what the script is doin but I'm retarded so could u explain the use of the varibles...I wanna use this script more than once (alot actually) but with diffrent stuff every time.What do I need to change. _________________ Indy OHR! and National OHR Month Contest going on now!
"Aeth calls PHC an anti-semite; PHC blames anti-semitism"
-squall |
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Tue Nov 08, 2005 11:28 am Post subject: |
|
|
The variables are used to A) keep track of how long the player has, and B) to check whether they pressed the correct key.
Code: | variable (counter, key)
counter := 18 #change this |
This is how many ticks you want to give the player.
Code: | #show an instruction |
Don't forget to tell the player what they're doing
Code: | while (counter) do ( |
While counter is greater than 0...
...bump the timer down, and...
[/code] if (key is pressed(key:space)) then (key := 1, counter := 0) #change the key[/code]
...check to see whether they pressed a goodly key. If they did, set key to 1, and stop the timer.
Give the OHR some breathing room
Code: | if (key) then (
#good things
) else (
#bad things
) |
If key is set, then they pressed the key in time. Thus, do good things. Otherwise, they missed the mark, so do bad things.
You can more or less copy this every time you want to use it with impunity. Except, if you use it more than once in the same script, you don't need to re-declare the variables. And, you should clear key to 0, for the next time. _________________ 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 |
|
 |
*Worthy* Critical Thinker

Joined: 11 Aug 2003 Posts: 186
|
Posted: Tue Nov 08, 2005 12:26 pm Post subject: |
|
|
This is a more user-friendly version of the code that makes it easier to understand.
Code: | variable (counter, key)
conter:=18
while (counter>0) do
(
decrement (counter,1)
if (key is pressed(key:space)) then
(
key := 1
counter := 0
)
wait
)
if (key==1) then
(
#good things
)
else
(
#bad things
) |
Note how "key" will only equal one if the key is pressed, resulting in good things happening. If the counter is decremented to 0 without the key being pressed, the script will exit the while statement, but "key" will still equal 0, resulting in teh "else" statement being executed. Bad stuff *shivers*.
Hope that helps,
~Worthy _________________ You can do whatever you want...but prison is full of people who make bad decisions. |
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Tue Nov 08, 2005 10:14 pm Post subject: |
|
|
You call that user-friendly? I can bloat it even more!
Code: | variable (counter, key)
conter:=18
while (counter>0) do, begin
decrement (counter,1)
if (key is pressed(key:space)) then, begin
key := 1
counter := 0
end
wait
end
if (key==1) then, begin
#good things
end, else, begin
#bad things
end |
_________________ 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 |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Wed Nov 09, 2005 4:52 am Post subject: |
|
|
The parentheses are easier to understand.
Also, you guys managed to misspell "counter". _________________
|
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
|
Back to top |
|
 |
SilentAngel The Angel of Silence

Joined: 16 Dec 2003 Posts: 122 Location: The comfiest chair in #CastleParadox
|
Posted: Wed Nov 09, 2005 11:38 pm Post subject: |
|
|
The second line of the code, pkmnfrk  _________________ Current Projects:
Hikari no Senshi - Inperiaru Taisen: ~10% Complete
http://www.castleparadox.com/forum/download.php?game=392
Stepmania Online Stats:
Next song to pass on Stepmania: Paranoia Survivor Max (Heavy)
Next song to pass on DDR: MaxX Unlimited(Standard)
|
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Thu Nov 10, 2005 9:59 am Post subject: |
|
|
Either I'm stupid, an admin somehow edited our posts without leaving a mark, or you guys are BSing. Quote 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 |
|
 |
*Worthy* Critical Thinker

Joined: 11 Aug 2003 Posts: 186
|
Posted: Thu Nov 10, 2005 10:41 am Post subject: |
|
|
...
~Worthy _________________ You can do whatever you want...but prison is full of people who make bad decisions. |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Thu Nov 10, 2005 11:21 am Post subject: |
|
|
pkmnfrk wrote: | You call that user-friendly? I can bloat it even more!
Code: | variable (counter, key)
conter:=18
while (counter>0) do, begin
decrement (counter,1)
if (key is pressed(key:space)) then, begin
key := 1
counter := 0
end
wait
end
if (key==1) then, begin
#good things
end, else, begin
#bad things
end |
|
conter:=18
Well, we've ruled out BSing and admin edits... _________________
|
|
Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Fri Nov 11, 2005 2:39 pm Post subject: |
|
|
Ah, I see. Worthy made the mistake, and I missed it when I quoted him and chopped off all of his post. You'll notice that in the post before, it's spelled correctly. _________________ 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 |
|
 |
junahu Custom Title: 45 character limit

Joined: 13 Jan 2004 Posts: 369 Location: Hull, England
|
Posted: Fri Jan 13, 2006 8:00 am Post subject: |
|
|
There's a slight problem with this code.
Suppose that the player simply holds spacebar during the entire cutscene. You would want the script to progress to the bad cutscene becuase the player was cheating
Code: | variable (counter, key)
counter:=18
while (counter>0) do, begin
decrement (counter,1)
if (key is pressed(key:space)) then, begin
if(key == 1) then, begin
key := 2
counter := 0
end
end
else, begin
key == 1
end
wait(1)
end
if (key==2) then, begin
#good things
end
else, begin
#bad things
end |
with this code, the player has to press the key AFTER the counter has started.
Edit: I should check the dates on the previous posts more often. The last reply was like 2 months ago.  |
|
Back to top |
|
 |
FyreWulff Still Jaded

Joined: 02 Apr 2005 Posts: 406 Location: The Internet
|
Posted: Fri Jan 13, 2006 9:15 am Post subject: |
|
|
If you want to be evil like the actual RE4, you can also use random to make it change up the buttons/keys to press. |
|
Back to top |
|
 |
|