 |
Castle Paradox
|
| View previous topic :: View next topic |
| Author |
Message |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Thu Nov 24, 2005 9:03 am Post subject: |
|
|
wait for key: Stops everything until the specified key is pressed. Takes use key, any key, etc. as input.
key is pressed: Returns true if the specified key is pressed but continues execution either way. Takes constants from scancode.hsi as input. _________________
|
|
| Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Thu Nov 24, 2005 4:15 pm Post subject: |
|
|
I'm not sure how much this is affecting, but currently you have a line:
if (check tag(tag:pause)==ON) then (waiting:=false), begin
The problem is that right now, the block of code (waiting:=false) is the only thing that the if command is in charge of. It is like you are saying, if the pause tag is on, then set the waiting to false. Now, regardless of the pause tag, go ahead and do all this other stuff.
At least, I believe that that is what is going on here... |
|
| Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Thu Nov 24, 2005 6:46 pm Post subject: |
|
|
I'm a bit confused as to how your existing script is supposed to work. What triggers the tag:pause tag to be set? In fact, what triggers this whole script?
A few comments on your existing code before I write a new version for you:
1. What msw188 says is true.
2. | Code: | set variable (days, hours),
set variable (minutes, seconds), |
"set variable (foo, bar)" is the same as "foo := bar". You want "variable(foo, bar)", which declares the variables.
3. What's with all the commas after the lines? They don't do anything, but are odd.
Ok, here's a script I just wrote which (I shall re-state its function, to ensure I got it right):
1. Stop all NPCs, the player and textboxes.
2. Stores the current play time
3. Wait until Numlock is pressed.
4. Sets the play time to the saved value
5. Resumes all of #1.
(this assumes that you have a main loop (such as the one from the last time we helped you) which checks for pause. In that case, when it detects pause, it should call "my keyboard pause", and not expect it to return until the game resumes)
| Code: | script, my keyboard pause, begin
variable(d,h,m,s,w) #days, hours, minutes, seconds, waiting
suspend player
suspend npcs
suspend box advance
d:= days of play
h:= hours of play
m:= minutes of play
s:= read general (54) #ToDo: make an official seconds of play command
w:= true
while(waiting), begin
wait(1)
if(key is pressed(key:numlock)) (w:= false)
end
write general(51, d) #ToDo: Make official set days of play, etc. commands
write general(52, h)
write general(53, m)
write general(54, s)
resume player
resume npcs
resume box advance
#all done
end |
I suspect this is what you want. If not, please tell me. _________________ 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 |
|
 |
|
|
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
|