| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		Omega0
 
 
  
  Joined: 27 Feb 2003 Posts: 37
 
  | 
		
			
				 Posted: Mon Sep 19, 2005 8:09 am    Post subject: Syntax Error, but where? | 
				     | 
			 
			
				
  | 
			 
			
				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 | 
		 | 
	
	
		  | 
	
	
		Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner
  
 
  
  Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
  | 
		
			
				 Posted: Mon Sep 19, 2005 9:30 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				Try "do, begin" instead of "do begin" in all instances of "do begin." _________________
  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Omega0
 
 
  
  Joined: 27 Feb 2003 Posts: 37
 
  | 
		
			
				 Posted: Tue Sep 20, 2005 6:31 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				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 | 
		 | 
	
	
		  | 
	
	
		Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner
  
 
  
  Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
  | 
		
			
				 Posted: Tue Sep 20, 2005 7:45 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				Couldn't tell you without the entire script. _________________
  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Mike Caron Technomancer
 
 
  
  Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
  | 
		
			
				 Posted: Wed Sep 21, 2005 7:55 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				 	  | 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 | 
		 | 
	
	
		  | 
	
	
		Bob the Hamster OHRRPGCE Developer
 
 
  
  Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
  | 
		
			
				 Posted: Wed Sep 21, 2005 10:15 am    Post subject: Interpreter overloaded | 
				     | 
			 
			
				
  | 
			 
			
				 	  | 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 | 
		 | 
	
	
		  | 
	
	
		Omega0
 
 
  
  Joined: 27 Feb 2003 Posts: 37
 
  | 
		 | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Ysoft_Entertainment VB Programmer
 
 
  
  Joined: 23 Sep 2003 Posts: 810 Location: Wherever There is a good game.
  | 
		
			
				 Posted: Thu Sep 22, 2005 8:06 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				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 | 
		 | 
	
	
		  | 
	
	
		Omega0
 
 
  
  Joined: 27 Feb 2003 Posts: 37
 
  | 
		
			
				 Posted: Fri Sep 23, 2005 9:13 am    Post subject:  | 
				     | 
			 
			
				
  | 
			 
			
				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 | 
		 | 
	
	
		  | 
	
	
		 |