Easygoing Eyebeast Thralni Posted June 16, 2006 Share Posted June 16, 2006 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 More sharing options...
Magnificent Ornk Swimmin' Salmon Posted June 16, 2006 Share Posted June 16, 2006 Please post more than one line of script at a time. That said, look to your last line containing parentheses. It is missing a right parenthesis. Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted June 16, 2006 Share Posted June 16, 2006 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 More sharing options...
Magnificent Ornk Kelandon Posted June 16, 2006 Share Posted June 16, 2006 The Numeric Input script is in the latest version of the High Level Party Maker, in t2Raiser.txt, in state 12. This is available from my website. I recommend borrowing it wholesale. Link to comment Share on other sites More sharing options...
Well-Actually War Trall Fort Posted June 16, 2006 Share Posted June 16, 2006 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 More sharing options...
Easygoing Eyebeast Thralni Posted June 17, 2006 Author Share Posted June 17, 2006 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 More sharing options...
Hatchling Cockatrice Lilith Posted June 17, 2006 Share Posted June 17, 2006 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 More sharing options...
Easygoing Eyebeast Dintiradan Posted June 17, 2006 Share Posted June 17, 2006 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 More sharing options...
Easygoing Eyebeast Thralni Posted June 17, 2006 Author Share Posted June 17, 2006 There's no real need in quoting the same post over and over again, you know. Link to comment Share on other sites More sharing options...
Hatchling Cockatrice Lilith Posted June 17, 2006 Share Posted June 17, 2006 Um, what? I don't see where the same post got quoted twice in this thread. I replied to your post, and Dintiradan replied to mine. Link to comment Share on other sites More sharing options...
Understated Ur-Drakon The Almighty Doer of Stuff Posted June 17, 2006 Share Posted June 17, 2006 He was probably confused because for some reason, Dintiridan used the "signature hyphen row" between the quoted text and his response, making it seem like he simply quoted the post without saying anything else, and the response seemed like part of the signature. Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Thralni Posted June 18, 2006 Author Share Posted June 18, 2006 I got it working now. Thanks, kelandon, for letting me copy a part of that script. Maybe, when i feel very bored, I'll extend the range of 1 - 100 coins to 1 - 250 coins. Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted June 18, 2006 Share Posted June 18, 2006 You could, of course, change it to 10-coin increments or something. That way it wouldn't be too hard to make it much more flexible. Link to comment Share on other sites More sharing options...
Recommended Posts