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

Syntax Error, but where?

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Omega0




Joined: 27 Feb 2003
Posts: 37

PostPosted: Mon Sep 19, 2005 8:09 am    Post subject: Syntax Error, but where? Reply with quote

It's been a while since I did anything with OHR, but latly I decided to try a quick little script. For some reason, it gives me an error @ the while statement, but I can't figure out why or how to fix it.

Code:
include, plotscr.hsd

define script (1, create maze, 0)
define script (2, flood fill, 3, 0, 0, 0 )

define constant (16, mapx)
define constant (16, mapy)

script,create maze,begin
 variable(cx)
 variable(cy)
 variable(cc)
 variable(dir)
 variable(seg)
 variable(pass)

 seg := mapx * mapy
 
 for(cx,0,mapx-1,1) do begin
 for(cy,0,mapy-1,1) do begin
  write map block( cx, cy, cx * 16 + cy )
  write pass block( cx, cy, 15 )
 end
 end

 while( seg >> 1 ) do begin
  cx := random( 0, mapx-1 )
  cy := random( 0, mapy-1 )

  dir := random( 0, 3 )
  cc := read map block( cx, cy )
  .
  .
  .

_________________
JMS * BlackFox * Omega0
http://spots.flatland.com/jms/index.html
AIM: jmsQFtmp Y!M: jms_blkfox
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



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

PostPosted: Mon Sep 19, 2005 9:30 am    Post subject: Reply with quote

Try "do, begin" instead of "do begin" in all instances of "do begin."
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Omega0




Joined: 27 Feb 2003
Posts: 37

PostPosted: Tue Sep 20, 2005 6:31 am    Post subject: Reply with quote

Gratia! That & a few other quick errors fixed the compile trouble.

Though it seems errors breed.
What am I supposed to do to fix these:

Script Error: Interpreter Overloaded
Script Error: stnext encounter noop 3 at 1 in 127
_________________
JMS * BlackFox * Omega0
http://spots.flatland.com/jms/index.html
AIM: jmsQFtmp Y!M: jms_blkfox
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



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

PostPosted: Tue Sep 20, 2005 7:45 am    Post subject: Reply with quote

Couldn't tell you without the entire script.
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Mike Caron
Technomancer




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

PostPosted: Wed Sep 21, 2005 7:55 am    Post subject: Reply with quote

Omega0 wrote:
Script Error: Interpreter Overloaded
Script Error: stnext encounter noop 3 at 1 in 127


Those mean trouble. Without seeing the whole script (hint hint), I can only give these tips:

~ Make the scripts smaller
~ Becareful of recursion

If you could post the script that gives these errors, it would be much appreciated.
_________________
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
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Wed Sep 21, 2005 10:15 am    Post subject: Interpreter overloaded Reply with quote

Omega0 wrote:
Gratia! That & a few other quick errors fixed the compile trouble.

Though it seems errors breed.
What am I supposed to do to fix these:

Script Error: Interpreter Overloaded
Script Error: stnext encounter noop 3 at 1 in 127


That means that you are trying to run more than 127 scripts simultaneously. it is similar to a buffer overflow, it is just that yopu are overflowing a different buffer (the one the interpreter uses to keep track of running scripts, rather than the one that contains script code)

The most likely cause of this is a script that calls itself recursively, or a pair of scripts that call each-other endlessly.

An on-keypress script with "wait" commands in it could cause this too, if you held down a key long enough.

The stnext encounter noop 3 at 1 in 127 error is just a side effect of the script interpreter crashing because of the previous error.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Omega0




Joined: 27 Feb 2003
Posts: 37

PostPosted: Thu Sep 22, 2005 6:47 am    Post subject: Reply with quote

http://savi.cis.drexel.edu/~strom/ohr/ms.zip

I swapped the recursive function for an interitive one which keeps it from crashing, but now the behavior is getting weirder: the maptiles are changing to all light grey for some reason.
_________________
JMS * BlackFox * Omega0
http://spots.flatland.com/jms/index.html
AIM: jmsQFtmp Y!M: jms_blkfox
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Ysoft_Entertainment
VB Programmer




Joined: 23 Sep 2003
Posts: 810
Location: Wherever There is a good game.

PostPosted: Thu Sep 22, 2005 8:06 am    Post subject: Reply with quote

I do believe that the solution to your problem is the lack of wait(1) command in the while loop, I did just that, and random junk appears on the screen, constantly changing; which I do believe is your desired result for the script.
_________________
Try my OHR exporter/importer.
OHRGFX
Striving to become better pixel artist then Fenrir Lunaris. Unfortunately the laziness gets in the way of my goals.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Omega0




Joined: 27 Feb 2003
Posts: 37

PostPosted: Fri Sep 23, 2005 9:13 am    Post subject: Reply with quote

The "Random Junk" is just representations of the intermediate states while processing.

If you change the while statement to
Code:
 while( seg >> 16 ) do, begin

that will let it complete quicker (I need to find a better way than the random function to finish the last couple segments).



Found the problem...was using ,or, where I needed an ,xor,

I think I have it working now:
http://savi.cis.drexel.edu/~strom/ohr/ms.zip
Walk up to the GO NPC & trigger him, then wait about a minute or two for the textbox.
_________________
JMS * BlackFox * Omega0
http://spots.flatland.com/jms/index.html
AIM: jmsQFtmp Y!M: jms_blkfox
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
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