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

How does autonumber work?

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Machu
Righter, a person who rights wrongs




Joined: 09 Jul 2003
Posts: 737

PostPosted: Thu Jun 10, 2004 5:26 pm    Post subject: How does autonumber work? Reply with quote

Okay, here's some psuedo-code; tell me how this will work out:
Code:

main script,begin
 while (true),begin
  loopy1
  loopy2
  turn off tag2
  turn off tag3
  wait
 end
end

loopy1,begin
 while(tag2 is off),begin
  stuff
  a certain keypress might turn tag2 on
  wait
 end
end

loopy2,begin
 while(tag3 is off),begin
  stuff
  a certain keypress might turn tag3 on
  wait
 end
end

So, will it:
A. run loopy1's while-loop until the keypress turns tag2 on, then do the same with loopy2, then repeat.
or B. run both loopy1 and loopy2 simultaneously every tick, in which "stuff" will constantly trigger (thus making this script worthless or even overflow).

Most programing languages would do A, but there's something crazy I noticed about plotscripting which would make sense if it were case B. If it is case B, does that mean that running another method/autonumber script will run that script and continue, even if the autonumber script has waits or a while-loop?
_________________
Code:
[*]That's it
[*]I'm done reasoning with you
[*]Starting now, there's going to be a lot less conversation and a lot more killing
Back to top
View user's profile Send private message
MultiColoredWizard
Come back, baby!
The Breastmaster



Joined: 01 Feb 2003
Posts: 1232

PostPosted: Thu Jun 10, 2004 5:46 pm    Post subject: Reply with quote

A, of course.
I think plotscripting waits for nested loops to finish first.
Back to top
View user's profile Send private message
Dan the Man Entertainment




Joined: 31 May 2003
Posts: 204

PostPosted: Thu Jun 10, 2004 6:04 pm    Post subject: Reply with quote

The while command doesn't work with Begin
You'll have to do it like this

Code:

loopy1,begin
while(tag2 is off) do
(
  stuff
  a certain keypress might turn tag2 on
  wait
)
end


And when it comes to doing things like that, you should use
if instead of while since there's already a while in the main
loop script.
Back to top
View user's profile Send private message
Machu
Righter, a person who rights wrongs




Joined: 09 Jul 2003
Posts: 737

PostPosted: Thu Jun 10, 2004 6:12 pm    Post subject: Reply with quote

The idea behind putting a while-loop inside of another is that the "stuff" in loopy1 is supposed to constantly trigger until tag2 is on, then the "stuff" in loopy2 will constantly trigger, and after tag3 is on, we go back to loopy1.

Well, I hope MCW is right, but I'll backup my script just-in-case.
_________________
Code:
[*]That's it
[*]I'm done reasoning with you
[*]Starting now, there's going to be a lot less conversation and a lot more killing
Back to top
View user's profile Send private message
JSH357




Joined: 02 Feb 2003
Posts: 1705

PostPosted: Thu Jun 10, 2004 6:24 pm    Post subject: Reply with quote

Dan: In Hamsterspeak, begin and ( are synonyms. You never even have to type 'begin' if you don't want to.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MultiColoredWizard
Come back, baby!
The Breastmaster



Joined: 01 Feb 2003
Posts: 1232

PostPosted: Thu Jun 10, 2004 6:44 pm    Post subject: Reply with quote

dan, it's called pseudo code, so of course it's not right.
and jsh, he meant he used while(ds)begin(shit)
it's while(si)do(shit)
Back to top
View user's profile Send private message
JSH357




Joined: 02 Feb 2003
Posts: 1705

PostPosted: Thu Jun 10, 2004 7:29 pm    Post subject: Reply with quote

oh.. you thought I read the rest of the post? :p

My mistake though; I haven't done any plotscripting in a while.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Thu Jun 10, 2004 9:03 pm    Post subject: Reply with quote

A is the right one.

The plotscript interpreter only ever runs one script at a time, the active script on top of the script heap. When the script finishs, the interpreter gos to next one down, if a script is loaded the active one is paused and the new one put on top of the 'heap'. If you stick a while loop in one of the called scripts, it'll stay on that script until its finished.

Wait commands cause the interpreter to pause the script, and game.exe does other stuff until it gets back to interpreting.

Your pseudo code looks fine.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Machu
Righter, a person who rights wrongs




Joined: 09 Jul 2003
Posts: 737

PostPosted: Thu Jun 10, 2004 9:26 pm    Post subject: Reply with quote

Ah. I guess whatever the problem I saw was caused by something else. Thanks for the help, everyone.
_________________
Code:
[*]That's it
[*]I'm done reasoning with you
[*]Starting now, there's going to be a lot less conversation and a lot more killing
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
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