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

Could somoene help me with a script ?
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



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

PostPosted: Thu Nov 24, 2005 9:03 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
msw188




Joined: 02 Jul 2003
Posts: 1041

PostPosted: Thu Nov 24, 2005 4:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Mike Caron
Technomancer




Joined: 26 Jul 2003
Posts: 889
Location: Why do you keep asking?

PostPosted: Thu Nov 24, 2005 6:46 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail 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
Goto page Previous  1, 2, 3
Page 3 of 3

 
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