  | 
				Castle Paradox
    
				 | 
			 
		 
		 
	
		| View previous topic :: View next topic   | 
	 
	
	
		| Author | 
		Message | 
	 
	
		NateIns Guest
 
 
 
 
 
 
  | 
		
			
				 Posted: Fri May 23, 2014 4:23 pm    Post subject: Plotscripting Help | 
				     | 
			 
			
				
  | 
			 
			
				How do I make a map that players can't access until they hit a certain level, say, five?
 
 
I'm planning on making this map that you teleport to after activating a NPC, so keep that in mind.
 
 
Thanks. | 
			 
		  | 
	 
	
		| Back to top | 
		 | 
	 
	
		  | 
	 
	
		NateIns Guest
 
 
 
 
 
 
  | 
		
			
				 Posted: Fri May 23, 2014 4:32 pm    Post subject: Plotscripting Help Continued | 
				     | 
			 
			
				
  | 
			 
			
				Here's what I have so far. I only started on this engine and this game about a month ago so I'm still somewhat of a n00b. The problem that the compiler tells me makes no sense to me.
 
 
plotscript, BeamToGyrus, begin
 
 if (get hero level (find hero(hero:Jim))>>5, then, begin
 
  suspend player
 
  suspend box advance
 
  fade screen out
 
  add hero (0)
 
  swap out hero (2)
 
  teleport to map (7, 16, 20)
 
  fade screen in
 
  resume player
 
  resume box advance
 
 if (get hero level (find hero(hero:Jim))<<5, then, begin
 
 show text box (130)
 
 end
 
end | 
			 
		  | 
	 
	
		| Back to top | 
		 | 
	 
	
		  | 
	 
	
		TMC On the Verge of Insanity
 
 
 
  Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
  | 
		
			
				 Posted: Fri May 23, 2014 7:00 pm    Post subject: Re: Plotscripting Help Continued | 
				     | 
			 
			
				
  | 
			 
			
				Hi! The syntax problems in your script are firstly that you forgot the closing bracket of both if conditions, and secondly that the first 'then' block is missing its closing bracket. An if statement has the form "if (a) then (b) else (c)" where the else is optional. Numbers of opening and closing brackets must always be equal. begin and end are equivalent to ( and ). Yes, it can unfortunately be hard to figure out where you've missed one.
 
 
Also, you have one block for level > 5, and another for level < 5, but this doesn't handle the case level = 5. So I changed it to use an else instead.
 
 
Also, 'suspend box advance' apparently achieves nothing here because there are no boxes for the player to advance.
 
 
 	  | Code: | 	 		  plotscript, BeamToGyrus, begin
 
 if (get hero level (find hero(hero:Jim)) >= 5) then, begin
 
  suspend player
 
  suspend box advance
 
  fade screen out
 
  add hero (0)
 
  swap out hero (2)
 
  teleport to map (7, 16, 20)
 
  fade screen in
 
  resume player
 
  resume box advance
 
 end, else, begin
 
  show text box (130)
 
 end
 
end | 	 
  _________________ "It is so great it is insanely great." | 
			 
		  | 
	 
	
		| 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
 
  
		 |