View previous topic :: View next topic |
Author |
Message |
T.Hi

Joined: 20 Jun 2003 Posts: 24 Location: Ohio
|
Posted: Wed May 11, 2005 7:22 am Post subject: HSpeak Won't Accept My Script! |
|
|
I am trying to do a script with two "Check tag" options, but I keep getting this error:
"ERROR: In line 1456 of...script,AppleLady,begin
Expected top-level declaration, but found bracket ) end. Perhaps there is an extra end or ) earlier in the file."
Now, here's the thing - I copied this EXACT script from elsewhere in my .hss file and just changed the numbers, so it SHOULD work, I would think.
What I want is to have the game check tag 45 (yes or no choice), then check tag 34 (if the player has a clover) and respond with the correct text. Here is my script:
Code: | script,AppleLady,begin
if (check tag (45))
then
(if (check tag (34))
then (show text box (159))
wait for text box
else (show text box (490)))
end |
Can someone tell me why the exact script was accepted earlier but not now?
Also, I tried to do this using the "Conditional"s in Custom, but it's not possible to offer TWO
"If Tag 34 = On
Use [text box or script] instead"
-OR-
"If Tag 34 = Off
Use [text box or script] next"
options.
I know this has been lengthy, but any advice would be helpful. Thanx.
|
|
Back to top |
|
 |
Sephyroth Renegade Rebel Redmage Class A Minstrel

Joined: 04 Feb 2003 Posts: 644 Location: Schmocation
|
Posted: Wed May 11, 2005 7:39 am Post subject: |
|
|
Quote: | else (show text box (490))) |
There's your problem. There's an extra ending parenthesis. _________________ im realy ded  |
|
Back to top |
|
 |
T.Hi

Joined: 20 Jun 2003 Posts: 24 Location: Ohio
|
Posted: Wed May 11, 2005 8:19 am Post subject: RE: |
|
|
I got rid of the ) but get the same error. Like I said, I have that EXACT script elsewhere with no problems. Could it just be a glitch?
Is there a way to do it withOUT plotscripting? |
|
Back to top |
|
 |
Sephyroth Renegade Rebel Redmage Class A Minstrel

Joined: 04 Feb 2003 Posts: 644 Location: Schmocation
|
Posted: Wed May 11, 2005 9:52 am Post subject: |
|
|
Whoops, I didn't read through the entire script, so never mind on that last post. The ending parenthesis is supposed to be there.
Could you post the script directly preceding this one? As well as the other script that you copied this from? _________________ im realy ded  |
|
Back to top |
|
 |
Raekuul Delicious!

Joined: 31 Mar 2004 Posts: 641 Location: Nowhere
|
Posted: Wed May 11, 2005 10:52 am Post subject: |
|
|
Quote: | "ERROR: In line 1456 of...script,AppleLady,begin
Expected top-level declaration, but found bracket ) end. Perhaps there is an extra end or ) earlier in the file."
|
Can you find line 1456 for us? I think you need another begin after else. _________________ A broken clock is still right twice a day. |
|
Back to top |
|
 |
T.Hi

Joined: 20 Jun 2003 Posts: 24 Location: Ohio
|
Posted: Wed May 11, 2005 12:16 pm Post subject: RE: |
|
|
The script above it is a footprints script, so it's very long. But here's the script I'd copied from and successfully used.
Code: |
script,Igloo,begin
if (check tag (47))
then
(if (check tag (48))
then (show text box (173))
wait for text box
else (show text box (492)))
end
|
See? It's exactly the same as the one I'm have trouble with except for the numbers...
But asking about the script above it gives me an idea: maybe if I move the script in question, it'll be okay.
|
|
Back to top |
|
 |
T.Hi

Joined: 20 Jun 2003 Posts: 24 Location: Ohio
|
Posted: Wed May 11, 2005 12:36 pm Post subject: RE: |
|
|
YAY! Moving the script did in fact do the trick...now I have to figure out what's wrong with the end of the footprints script I mentioned so if I add anything else, I don't have the same problem.
Thanx for the help...and one more question...if I want to add in one more option - for a different text - how exactly would I do that? Should I add in
Code: | else (show text box (160) |
so that it looks like this:
Code: | script,AppleLady,begin
if (check tag (45))
then
(if (check tag (34))
then (show text box (159))
wait for text box
else (show text box (490)))
else (show text box (160)
end |
or should I have a different number of parenthesis at the end or have them somewhere else or another "end" or what? Just to clarify, this last "else" is the opposite of/alternate to the first "if (check tag(45))"... |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Wed May 11, 2005 10:51 pm Post subject: |
|
|
I can guess that though your script might now compile, it doesn't actually work.
TIP: INDENT
Lets see what I mean, and find out what this script actually does in the process.
Code: |
script,AppleLady,begin
if (check tag (45)) then (
if (check tag (34)) then (
show text box (159)
)
wait for text box
else (show text box (490))
)
end
|
The else is misplaced. I assume it was meant to go with the second if?
Anyway, the new piece of code should look like
Code: |
script,AppleLady,begin
if (check tag (45)) then (
if (check tag (34)) then (
show text box (159)
wait for text box
) else (
show text box (490)
)
) else (show text box (160))
end
|
|
|
Back to top |
|
 |
T.Hi

Joined: 20 Jun 2003 Posts: 24 Location: Ohio
|
Posted: Thu May 12, 2005 5:58 am Post subject: RE: |
|
|
Thank you so much! I did come here today to ask why my script wasn't doing what I wanted it to.
What I want is for the script to see if the player says 'yes' (tag #45), then if they do, to see if they have the clover (tag #34). If they do have the clover, then it would show text #159, but if they do not have the clover, it would show text #490. BUT, if the player originally said 'no', it would just show text #160. Is that in fact what the script you gave me will do? And if I wanted to add in "use shop", would I just put that after "wait for text box", like so?...
Code: |
script,AppleLady,begin
if (check tag (45)) then (
if (check tag (34)) then (
show text box (159)
wait for text box
use shop (7)
) else (
show text box (490)
)
) else (show text box (160))
end |
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu May 12, 2005 3:57 pm Post subject: |
|
|
That should work. Actually, if it weren't for the shop, you wouldn't need a waitfortextbox command at all (I assume that this script is called from a textbox - if it was called from another script, you would need them) |
|
Back to top |
|
 |
T.Hi

Joined: 20 Jun 2003 Posts: 24 Location: Ohio
|
Posted: Fri May 13, 2005 7:06 am Post subject: RE: |
|
|
Sorry to post yet again, but now I'm ready to tear my hair out! The applelady script works perfect and I copied it for another script - littlegirl - and that one also works perfect. Then I copied it again and this one - igloo - won't work right! How in the world could it be okay in two instances and not work in the third? I copied and pasted the correct script and just changed the numbers, so it's not a matter of me missing something. I also made sure everything was correct in Custom.
Below is a copy of the script in question along with the scripts before and after it, in case I goofed there somewhere.
Code: |
#different one here
script,AppleLady,begin
if (check tag (45))
then (if (check tag (34))
then (use shop (7)
show text box (159)
wait for text box)
else (show text box (490)))
else (show text box (160))
end
#different one here
script,LittleGirl,begin
if (check tag (117))
then (if (check tag (75))
then (show text box (134)
wait for text box)
else (show text box (491)))
else (show text box (117))
end
#different one here
#THIS IS THE ONE THAT KEEPS MESSING UP...IT NEVER GOES TO TEXT BOX 173 OR 492,
#BUT ALWAYS TO TEXT BOX 174
script,Igloo,begin
if (check tag (47))
then (if (check tag (48))
then (show text box (173)
wait for text box)
else (show text box (492)))
else (show text box (174))
end
#different one here
script,Footprints-I,begin
variable (a) #checks which direction the hero is facing.
variable (b) #checks which X coordinate the hero is standing.
variable (c) #checks which Y coordinate the hero is standing.
variable (d) #defines which maptile(s) footprints can be made.
variable (b1) #if the hero faces west
variable (b2) #if the hero faces east
variable (c1) #if the hero faces north
variable (c2) #if the hero faces south...REST OF SCRIPT |
Any ideas on why that one won't work while the others do? |
|
Back to top |
|
 |
rpgspotKahn Lets see...

Joined: 16 May 2004 Posts: 720 Location: South Africa
|
Posted: Fri May 13, 2005 7:41 am Post subject: |
|
|
How can you have 2 "then"s after one another? Is that legal?
Check that all the tags and text boxes exist - It happens that this happens with huge games and you lose contact on some areas. _________________
2nd Edition out now! |
|
Back to top |
|
 |
Raekuul Delicious!

Joined: 31 Mar 2004 Posts: 641 Location: Nowhere
|
Posted: Fri May 13, 2005 8:00 am Post subject: |
|
|
Sounds like it's skipping over the entire inner set of conditionals... Try removing the inner if-then-else and see if it works right. This might all work better if you clump the individual parts into autonumber scripts, and then make master scripts for each set of related scripts. _________________ A broken clock is still right twice a day. |
|
Back to top |
|
 |
Moogle1 Scourge of the Seas Halloween 2006 Creativity Winner


Joined: 15 Jul 2004 Posts: 3377 Location: Seattle, WA
|
Posted: Fri May 13, 2005 9:03 am Post subject: |
|
|
No, Kahn's right. You have "(if (condition)) then ..." in there, which should be "(if (condition) then ...)" _________________
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri May 13, 2005 3:23 pm Post subject: |
|
|
Moogle1 wrote: | No, Kahn's right. You have "(if (condition)) then ..." in there, which should be "(if (condition) then ...)" |
No it doesn't. Very strange, I checked the script through and found no errors, then I tried compiling it myself and it worked! What is the exact error message you get? There is possibly an error somewhere else in your scripts file. |
|
Back to top |
|
 |
|