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

Plotscripting Help

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






PostPosted: Fri May 23, 2014 4:23 pm    Post subject: Plotscripting Help Reply with quote

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






PostPosted: Fri May 23, 2014 4:32 pm    Post subject: Plotscripting Help Continued Reply with quote

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

PostPosted: Fri May 23, 2014 7:00 pm    Post subject: Re: Plotscripting Help Continued Reply with quote

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
View user's profile Send private message Send e-mail
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