Two Script Errors (Solved)
Author | Topic: Two Script Errors (Solved) |
---|---|
Guardian
Member # 6670
|
written Friday, April 21 2006 12:40
Profile
Homepage
Grrr. Peer editing time again. My first problem comes from a script intended to heal/charge a creature based on the current state of two SDFs. It worked fine when I linked it to some goblins to test it in a small scenario made for this purpose. Now, when I'm testing my scenario, I get: perheal Error: Bad term in expression in line 57. Here's the script:In all likelihood, it's a problem with that huge conditional. I already found one missing parenthesis. My second script tries to have a monster spawn in a random close location. When running it, I get: t4cmine Error: Missing integer in line 23. The script is:I think the line numbers are reported wrong... if you need me to clarify anything just ask. Now to see if the scripts are displayed right; Notepad botches them up. EDIT: Yep, it seems UBB likes my tabs better than Notepad. Sorry about the length, I wanted to include the entire scripts; I think the reported line errors are screwed up. Also, sorry about the current lack of useful comments. I can clarify something if you need me to. -------------------- (Bashes head against wall. Repeatedly.) [ Friday, April 21, 2006 14:27: Message edited by: Dintiradan ] Posts: 1509 | Registered: Tuesday, January 10 2006 08:00 |
Infiltrator
Member # 5576
|
written Friday, April 21 2006 13:22
Profile
Homepage
Try Alint. It shows a number of other errors in the first script alone. -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
Off With Their Heads
Member # 4045
|
written Friday, April 21 2006 13:58
Profile
Homepage
By the way, if you have an excessively large number of AND operators, you can break them up. if ((get_flag(50,2) == 1) && (get_flag(51,2) == 1)) is the same asBut the second one is probably easier to read, especially if there are lots of conditions. [ Friday, April 21, 2006 13:59: Message edited by: Kelandon ] -------------------- Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens. Smoo: Get ready to face the walls! Ephesos: In conclusion, yarr. Kelandon's Pink and Pretty Page!!: the authorized location for all things by me The Archive of all released BoE scenarios ever Posts: 7968 | Registered: Saturday, February 28 2004 08:00 |
Guardian
Member # 6670
|
written Friday, April 21 2006 14:26
Profile
Homepage
Okay, got it now after taking a break then looking at it again: In the first script, both conditionals had parens. problems. From now on, I'm going to solely rely on Programmer's Notepad. I played around with the second for a while; something I did made it work. Don't worry: before I release the scenario, I plan to re-do the scripts for readability. A bit more playing around with a creature script, and I'll have a dungeon where creatures spawn in random locations, while keeping a limit on the number of creatures (no more flooding dungeons). -------------------- IF I EVER BECOME AN EVIL OVERLORD: When arresting prisoners, my guards will not allow them to stop and grab a useless trinket of purely sentimental value. Posts: 1509 | Registered: Tuesday, January 10 2006 08:00 |
Lifecrafter
Member # 6193
|
written Friday, April 21 2006 19:21
Profile
Homepage
[rant] Creature scripts are by far the most difficult thing for me to work with. Doing anything beyond the most basic task is a lesson in futility and weird errors. [/rant] I'm sorry you all had to hear that, it's been a long day fiddling with defective creature scripts. -------------------- Guaranteed to blow your mind. Frostbite: Get It While It's...... Hot? Posts: 900 | Registered: Monday, August 8 2005 07:00 |
Master
Member # 5977
|
written Friday, April 21 2006 22:34
Profile
Homepage
quote:Oh... Is that how one writes them? I tried them multiple times, but I never succeeded in doing it the right way. Thanks, kelandon. -------------------- Play and rate my scenarios: Where the rivers meet View my upcoming scenario: The Nephil Search: Escape. Give us your drek! Posts: 3029 | Registered: Saturday, June 18 2005 07:00 |
Off With Their Heads
Member # 4045
|
written Saturday, April 22 2006 05:06
Profile
Homepage
How one writes what? Did you just say, "Is that how one writes conditions?" Or "Is that how one writes AND operators?" -------------------- Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens. Smoo: Get ready to face the walls! Ephesos: In conclusion, yarr. Kelandon's Pink and Pretty Page!!: the authorized location for all things by me The Archive of all released BoE scenarios ever Posts: 7968 | Registered: Saturday, February 28 2004 08:00 |
Lifecrafter
Member # 6193
|
written Saturday, April 22 2006 06:04
Profile
Homepage
For the sake of your beta testers I hope its the second. -------------------- Guaranteed to blow your mind. Frostbite: Get It While It's...... Hot? Posts: 900 | Registered: Monday, August 8 2005 07:00 |
Lifecrafter
Member # 6193
|
written Saturday, April 22 2006 06:07
Profile
Homepage
Edit: Stupid UBB makin me double post. I'll try to salvage this, Err, "How about those boolean opperators eh? What a group of characters!" [ Saturday, April 22, 2006 06:09: Message edited by: Lazarus. ] -------------------- Guaranteed to blow your mind. Frostbite: Get It While It's...... Hot? Posts: 900 | Registered: Monday, August 8 2005 07:00 |
Shaper
Member # 3442
|
written Saturday, April 22 2006 07:29
Profile
Homepage
quote:This bought me more joy than you can ever imagine... I need to get out more. And to add fuel to the "&&" argument (is it an argument yet?), I tend to do it like this: if((get_flag(x,y) == z) && (get_flag(a,b) != c)) { For some reason, I think it's more clearer than writing-------------------- And when you want to Live How do you start? Where do you go? Who do you need to know? Posts: 2864 | Registered: Monday, September 8 2003 07:00 |
Guardian
Member # 6670
|
written Saturday, April 22 2006 07:54
Profile
Homepage
Yeah, sorry about the huge, one-line conditionals. An unfortunate side-effect of taking a programming course where Perl was the language used. It became a friendly competition to see how few lines the assignments could be done in. Meh. I don't mind scripts. It's the moment of satisfaction when the thing finally works, after spending a few hours rooting out one bug. (And yes, the scripts work now. I've forgotten how scary black shades and guardians could be.) -------------------- IF I EVER BECOME AN EVIL OVERLORD: My door mechanisms will be designed so that blasting the control panel on the outside seals the door and blasting the control panel on the inside opens the door, not vice versa. Posts: 1509 | Registered: Tuesday, January 10 2006 08:00 |
Master
Member # 5977
|
written Saturday, April 22 2006 11:11
Profile
Homepage
quote:I don't really know how that would help the beta-tester. they are all as in the first example that Kelandon gave, and I really hope you don't expect that I start changing it now. kelandon: I meant the AND-operators. -------------------- Play and rate my scenarios: Where the rivers meet View my upcoming scenario: The Nephil Search: Escape. Give us your drek! Posts: 3029 | Registered: Saturday, June 18 2005 07:00 |
Lifecrafter
Member # 6193
|
written Saturday, April 22 2006 12:08
Profile
Homepage
I read it as Kel thinking you might be thanking him for showing you how to write boolean statements in general, maybe I was wrong. My reply about "for the sake of your bea testers" was me thinking of bea-testing a scenario without any boolean statements (probably not even possible.) -------------------- Guaranteed to blow your mind. Frostbite: Get It While It's...... Hot? Posts: 900 | Registered: Monday, August 8 2005 07:00 |