Ineffable Wingbolt Dahak Posted October 6, 2008 Share Posted October 6, 2008 I have a script: Code: // bandersnatch.txt - Controls the invisibility of a bandersnatch creature.// Memory Cells - // 0 - Creature typebeginterrainscript; variables; short i = 6;body;beginstate INIT_STATE; set_script_mode(3);break;beginstate START_STATE; i = 6; while (i <= 199) { print_str_color("Looping",2); if ( creature_type(i) = get_memory_cell(0) ) { print_str_color("Found BS",2); if (get_health(i) < get_max_health(i)) { print_str_color("Changing",2); set_special_ability(i, 0); print_str_color("Changed",2); } } i = i + 1; }break; The second line print_str_color("Found BS",2); is giving me the following message: "Unmatched left parenthesis in line 22." I've tried to figure it, but I'm stuck. Quote Link to comment Share on other sites More sharing options...
Hatchling Cockatrice Lilith Posted October 6, 2008 Share Posted October 6, 2008 if ( creature_type(i) = get_memory_cell(0) ) { There's your problem. Should be a double-equals (==), not a single (=). Remember, double-equals checks if something is equal, single-equals sets it to be equal. Quote Link to comment Share on other sites More sharing options...
Ineffable Wingbolt Dahak Posted October 6, 2008 Author Share Posted October 6, 2008 Now I get "Function Call error (unary) on line 21" Edit: As gar as I can tell the problem is that I have the "i" variable. If I replace "i" with a hard number, the script is correct. Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Nioca Posted October 6, 2008 Share Posted October 6, 2008 There are only 119 creature slots available in the game. So that top loop shouldn't run all the way to 199. (unary) usually shows up when an invalid value has been plugged into a call, and if you're trying to get the health of creature 163, I can very well see it spitting that out. Quote Link to comment Share on other sites More sharing options...
Ineffable Wingbolt Dahak Posted October 6, 2008 Author Share Posted October 6, 2008 Perfect! Thanks to the both of you. I would have sworn I had typed in 119, but that was my mistake. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.