Jump to content

Scripting Problems


Recommended Posts

I'm having some trouble with scripting. A couple of problems, at the moment. The first one is something that I've really been working around. I'll put a party in my scenario to check if there are script problems (which there often are) and it gives me an error message for a specific line. I'll quit and go check the script that it tells me to check, on the line it gives me. I count them and recount them, but for some reason, sometimes it's not accurate. I have to find the problem on my own. Then, just to make sure, I count what line it was on. Sure enough, it's not the one the game told me. I'm wondering if I'm just not counting the way it does.

 

The other problem is with variables. I tried to apply some in to the variables section of the dialogue script, the town script, and even the scenario script. When I put a party in, it says that the word I use is an unknown command.

 

Anyone know what to do?

Link to comment
Share on other sites

For the first, see Spiderweb's bugs page , particularly under "Some Words About Error Line Numbers," which is itself slightly misleading. BoA counts line numbers the way that BBEdit (for Mac) and Crimson Editor (for Windows) do, although the actual count can be buggy.

 

For the second, post a script and we can tell you what's wrong with it.

Link to comment
Share on other sites

If you're having trouble pinpointing errors using line numbers, you can insert blank spaces into the script. These will move the error down.

 

So if you get an error on line 90, you can enter two blank spaces. If the error line doesn't change, the spaces were both after line 90. If the error line changed to 91, the error is between the two spaces. If the error line changed to 92, the error line is after both blank lines.

Link to comment
Share on other sites

I used to use Editpad, but I've switched over to Programmer's Notepad 2 for everything code related, and I'm not going back. In my opinion, it's the next best thing after an AvernumScript IDE. Once they release the documentation for making schemes on the site , I'll make one for AvernumScript.

 

--------------------

IF I EVER BECOME AN EVIL OVERLORD:

All crones with the ability to prophesy will be given free facelifts, permanents, manicures, and Donna Karan wardrobes. That should pretty well destroy their credibility.

Link to comment
Share on other sites

Okay, the variables problem is solved, I think. At least, it's leaving me alone right now. Just to make sure, is the variable 'dam' one of those reserved for another purpose?

 

As for the line counts, well, I have to count them manually, because I'm using Simple Text for Mac. I'd get one of the text editors you guys recommended, but they won't run on my computer. (It's OS 9.1) So yeah, I basically need a new computer, or at least an upgrade eventually. Until then, things will just take forever and be inconvenient.

Link to comment
Share on other sites

Oh right… thanks.

 

Anyway… yeah, more questions, because I'm just so clueless. The first one is about animated graphics. I've got custom terrain design down, but when I put animated graphics in the scenario (even premade graphics) they don't move.

 

The other question might be more complicated. I'm trying to initialize custom special abilities. I feel like I have it down, except for one problem: the button doesn't appear in the special abilities window.

Link to comment
Share on other sites

After you've initialized a special ability you have to make sure to give the ability to the party. Use:

change_custom_abil_uses(char,ability,ammount);

 

As for terrain animation, make sure you've properly defined the terrain and make sure the sheet its on is properly set up.

Quote:
From the BoA Editor Docs:

te_anim_steps - Lets you set this terrain type to be animated. if left at 0 or 1, no effect. If greater than 1, when drawing this terrain type, the icon cycles between its base icon (set above) and the te_anim_steps next icons in the sheet. (Example: If the terrain type’s set icon in the sheet is 5 and te_anim_steps is 4, the game alternates between icons 5, 6, 7, and 8 to draw the terrain.)

Note that, if the terrain type has a cutaway view or second icon (or both), you need to provide animation frames for them too.

I can't imagine what else could be the problem.
Link to comment
Share on other sites

Alright then, if I want to give the ability at the beginning of the scenario, where do I put change_custom_abil_uses? I've tried putting it in LOAD_STATE, START_STATE, and START_SCEN_STATE, as well as in the numbered state where I defined the ability. I still can't figure out how to get it to work.

Link to comment
Share on other sites

Quote:
Originally written by Nemesis:
Alright then, if I want to give the ability at the beginning of the scenario, where do I put change_custom_abil_uses? I've tried putting it in LOAD_STATE, START_STATE, and START_SCEN_STATE
START_SCEN_STATE is the one you want. Look at Bahssikava (among others) for an example of this.
Link to comment
Share on other sites

Alright, here it is. Warning: May contain cheater tips, for if I should ever finish the scenario.

 

Code:
// SCENARIO SCRIPT// This is the special script for your entire scenario. It contains// special encounters and code accessable from anywhere in the scenario. it also// contains the code that initializes important special things in the// scenario (like shops and names and descriptions of special items).// You can create your own states, but you should give all of them numbers greater than// or equal to 10.beginscenarioscript;variables;int i,j,k,lvl,choice,gamble,user;body;// This is the state that is called every time the scenario is loaded,// even when a save file in the scenario is loaded. Some things that should go here://    Names and descriptions of special items.//    Names and effects of custom special abilities.beginstate LOAD_SCEN_STATE;//SPECIAL ABILITIES	init_special_abil(0,"Invoke Spell",12);break;// This is the state that is called only once at the very beginning of // the scenario. Some things that should go here://    The stuff in shops.//    Creating horses and boats.beginstate START_SCEN_STATE;//SHOPS// Shop 0 - armor	add_item_to_shop(0,25,25);	add_item_to_shop(0,26,20);	add_item_to_shop(0,30,20);	add_item_to_shop(0,31,10);	add_item_to_shop(0,35,10);	add_item_to_shop(0,121,15);	add_item_to_shop(0,122,15);	add_item_to_shop(0,126,3);	add_item_to_shop(0,131,2);	add_item_to_shop(0,111,15);	add_item_to_shop(0,16,10);	add_item_to_shop(0,136,10);	add_item_to_shop(0,137,10);	add_item_to_shop(0,141,5);		// Shop 1 - weapons	add_item_to_shop(1,45,25);	add_item_to_shop(1,46,20);	add_item_to_shop(1,50,15);	add_item_to_shop(1,51,10);	add_item_to_shop(1,55,5);	add_item_to_shop(1,65,20);	add_item_to_shop(1,66,10);	add_item_to_shop(1,70,5);		// Shop 2 - tools	add_item_to_shop(2,170,500);	add_item_to_shop(2,171,500);	add_item_to_shop(2,172,30);	add_item_to_shop(2,174,500);	add_item_to_shop(2,164,500);	add_item_to_shop(2,177,500);		// Shop 3 - missiles	add_item_to_shop(3,85,500);	add_item_to_shop(3,86,10);	add_item_to_shop(3,90,10);	add_item_to_shop(3,95,3);	add_item_to_shop(3,100,20);	add_item_to_shop(3,101,10);	add_item_to_shop(3,105,10);	// Shop 4 - potions	add_item_to_shop(4,220,4);	add_item_to_shop(4,221,3);	add_item_to_shop(4,222,3);	add_item_to_shop(4,223,2);	// Shop 5 - food	add_item_to_shop(5,4,500);	add_item_to_shop(5,6,500);	add_item_to_shop(5,7,500);	add_item_to_shop(5,10,500);	add_item_to_shop(5,11,500);	add_item_to_shop(5,12,500);	// Shop 6 - Pronto	add_item_to_shop(6,101,500)	add_item_to_shop(6,102,500)	add_item_to_shop(6,106,500)	add_item_to_shop(6,107,500)	add_item_to_shop(6,109,500)	add_item_to_shop(6,175,500)	add_item_to_shop(6,178,500)	add_item_to_shop(6,220,500)	add_item_to_shop(6,221,500)	add_item_to_shop(6,223,500)	add_item_to_shop(6,241,500)//BOATS	create_boat(0,1,4,17,0)	create_boat(1,1,4,13,1)	create_boat(2,1,11,4,1)	change_custom_abil_uses(0,0,1);	change_custom_abil_uses(1,0,1);	change_custom_abil_uses(2,0,1);	change_custom_abil_uses(3,0,1);break;// This state is called every tick wherever the party is in the scenario.// You can use the set_statebeginstate START_STATE;break;// Place your own states below. Give each a number at least 10.beginstate 10;//leavebreak;beginstate 11;//exit scenbreak;beginstate 12;//invoke spell	change_custom_abil_uses(who_used_custom_abil(),0,1);	get_text_response("What spell do you want to invoke?");	check_text_response_match("Faux Pas");	if (got_text_match()) {		run_animation_sound(113);		begin_shop_mode("Faux Pas","This convenient little shop just showed up when you called. However, convenience comes with a price.",5,6,-1);		end();	}	check_text_response_match("Pronto");	if (got_text_match()) {		run_animation_sound(113);		begin_shop_mode("Pronto","This convenient little shop just showed up when you called. However, convenience comes with a price.",6,6,0);		end();	}	check_text_response_match("Kiss Me");	if (got_text_match()) {		run_animation_sound(35);		force_status_nearby(250,1,8,1);//charm adjacent enemies		print_str_color("How sweet.",3);		end();		}	check_text_response_match("Gamble");	if (got_text_match()) {		gamble = get_ran(1,-1000,1000);		change_coins(gamble);		if gamble > 0 {			run_animation_sound(39);			print_str_color("You gain some coins.",4);			end();		}		if gamble < 0 {			run_animation_sound(38);			print_str_color("You lose some coins.",4);			end();		}		if gamble == 0			print_str_color("You don't gain or lose anything.",4);			end();	}	check_text_response_match("Psycheup");	if (got_text_match()) {		user = who_used_custom_abil();		if(get_energy(user) >= 50) {			change_char_energy(user,-50);			run_animation_sound(60);			put_sparkles_on_char(0,6,0);			put_sparkles_on_char(1,6,0);			put_sparkles_on_char(2,6,0);			put_sparkles_on_char(3,6,0);			set_party_status(1,255,0);			set_party_status(2,255,0);			set_party_status(3,255,0);			set_party_status(5,255,0);			set_party_status(15,255,0);			set_party_status(16,255,0);			set_party_status(17,255,0);			set_party_status(22,255,0);			set_party_status(27,255,0);			print_str_color("Get PSYCHED!",2);			end();			}		else print_str_color("Not enough MP.",2);		end();		}break;
Also, since I went ahead and posted the whole scenario script, I'm open to suggestions as far as recommended changes, whether it's because I did something else wrong and just don't know it yet (quite likely) or if I made anything cheap. Bear in mind, use of the custom ability "Invoke Spell" is based upon prior knowledge of the existance of the "magic words", so to speak. Just let me know if I'm being too cheap or whatever.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...