Jump to content

left parenthesis?


Thralni

Recommended Posts

I've started working ona better and newer version of my cashmachine script, this version letting the player enter an amount of money by themselves. However, I've run into a problem which I can't understand. The game gives the error: unmatched left parenthesis, at this line:

 

Code:
 amount_to_withdraw = get_text_response("") 
amount to withdraw being a vraiable which I defined as it should be.

 

Could anybody help me please?

Link to comment
Share on other sites

First, it looks like you're not using get_text_response correctly. If you look in the docs you will see that it has a void return type, so doing that assignment is meaningless. Basically to use it you need to call get_text_response and then repeatedly call check_text_response to see if the response was one of a set of particular strings. You should take a look at the numeric input script that someone made (Kelandon?). In any case, you can see a good example of numeric input in the part of the HLPM that asks for a level to make the party.

 

Another thing to keep in mind about debugging in general is that even a good compiler may be confused by an error on one line, not report it, and then start reporting nonsense errors on following lines. So if you really think a line is correct when you're told there is an error there, take a close look at the lines above it; they are often to blame.

Link to comment
Share on other sites

I am pretty sure Thralni wants to figure out how to do this numeric input script himself, though I do recommend at least looking at Kelandon's as a guide to help you along.

 

The parenthesis problem is not necessarily on the line given; this error just means that the "(" on that line does not have a matching ")" after it. Try looking at the lines after this one.

Link to comment
Share on other sites

I was trying to think of a script that had this, but couldn't remember one. Therefor I started from scratch. I will now certainly look at kelandon's script.

 

Niemand: the party enters a number, and I assumed that with this specific call and this variable, I could store a number in that variable, returned by that specific call. I also checked the other lines repeatedly, but couldn't find anything. That's why I decided to ask about it here.

 

EDIT: Okay, looked at kelandon's script, and I saw exactly that thing that I wanted to see if I can pass around it. Probably not *sighs*

Link to comment
Share on other sites

Quote:
Originally written by Mc 'mini' Thralni:
EDIT: Okay, looked at kelandon's script, and I saw exactly that thing that I wanted to see if I can pass around it. Probably not *sighs*
No, there's no way around checking for every number individually. The party's response to a text response call is stored as a string, and the engine isn't smart enough to tell whether a string contains a number.
Link to comment
Share on other sites

By Thuryl:

Quote:
No, there's no way around checking for every number individually. The party's response to a text response call is stored as a string, and the engine isn't smart enough to tell whether a string contains a number.
--------------------

Deep down inside, JV knows he should have programmed in Perl.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...