Jump to content

Jeebus I hate dealing with custom items.


Couch

Recommended Posts

Here's the problem: the BoA Editor won't recognise my custom item and its graphic. Did I do something wrong? Here's the code, saved in the proper scenario folder and named handgun.txt:

 

beginscendatascript

begindefineitem 445;

item_name = Handgun;

item_full_name = Handgun;

it_variety = 6;

it_damage_per_level = 8;

it_weapon_skill_used = 10;

it_encumbrance = 0;

it_floor_which_sheet = 502;

it_inventory_icon = 502;

it_value = 300;

it_weight = 3;

it_identified = 1;

it_missile_anim_type = 11;

Link to comment
Share on other sites

To begin with, you probably need some quotation marks around the item's names. Beyond that, what exact error message do you mean by "won't recognize"? Some, such as that odd "out of memory" message, are easily fixed by quitting and restarting the Editor.

Link to comment
Share on other sites

Gah! Quote marks? I didn't know I was supposed to put in those.

As for the editor not recognising the handgun, the weapon doesn't show up in the items menu. Item # 445 is blank. I'll try the quote marks and get back to ya' on that...

 

...Added quotation marks to the name, didnt work. Item 445 is still blank. Maybe there's a problem with the graphics sheets?

Link to comment
Share on other sites

. . . . and a good place to find custom item scripts: look at the scenario data scripts for the prepackaged scenarios (i.e. valleydydata.txt).

 

EDIT: By the way, spyderbytes, since you use the editor far more than I do: I've been assuming that I get the "out of memory" error because I'm doing sloppy and stupid swapping back and forth between BoA and the Editor (since quitting either usually eliminates the error), and not because there's an actual bug in the Editor. Have you run into the error? (If it happens, it does so the first time the Editor tries to load a new graphic.)

Link to comment
Share on other sites

Custom items are defined in the INIT_STATE of the main scenario script. They don't have their own separate scripts. Even if they have scripted behavior (i.e., abilities 207 or 208), it's just handled from a state in the scenario script.

 

Actually, I suppose the main reason I might not have the memory problems is that I'm on OS X (which allocates memory much differently) and have a boatload of physical RAM. If the editor needs more, it just asks the OS and gets it dynamically. smile

 

EDIT: My original answer was just plain wrong. smile Look in the data script (scenario_namedata.txt) for definitions of custom items.

Link to comment
Share on other sites

Scenario_namedata.txt? I only see hellholeravine.txt in the scenarios folder, and scen.txt in the BOA files folder. confused

I used sherlock and it didn't come up with anything. So I am to assume that you mean something else that relates to Scenario_namedata.txt. Oh well, I'll check out scen.txt now. Hellholeravine.txt yielded nothing except for shop stuff.

Link to comment
Share on other sites

You may have figured this out by now, but the problem is in your script name. All custom items must be in a script named in this format:

scen_namedata.txt (Where scen_name is, of course, the name of your scenario file.)

 

Trying to place a custom item in any other script won't work - the editor won't look for them anywhere else.

 

Problem clearly given here:

Quote:
Here's the code, saved in the proper scenario folder and named handgun.txt
Link to comment
Share on other sites

Crap. This just in, I created a proper freakin' data file, now the stupid editor is b*tching about an invalid symbol in line one... Here's the current code:

 

// Hellhole Ravine Custom Object Types

 

beginscendatascript;

 

// ITEM TYPES

begindefineitem 450;

clear;

it_full_name = "Handgun";

it_variety = 6;

it_damage_per_level = 4;

it_bonus = 3;

it_weapon_skill_used = 10;

it_floor_which_sheet = 502;

it_floor_which_icon = 1;

it_inventory_icon = 0;

it_value = 300;

it_weight = 30;

it_identified = 1;

it_missile_anim_type = 11;

 

begindefineitem 451;

clear;

it_full_name = "bullets";

it_variety = 23;

it_bonus = 1;

it_charges = 12;

it_floor_which_sheet = 502;

it_floor_which_icon = 2;

it_inventory_icon = 2;

it_value = 20;

it_weight = 10;

it_cursed = 0;

confused

Link to comment
Share on other sites

Comments before beginscendatascript work fine for me and are in the prepackaged scenarios' scripts. Nor could I reproduce the error by pasting the entire snippet into a new file -- which might then be the solution, if no help for an explanation (what app are you using to write your scripts?).

Link to comment
Share on other sites

The docs say script names can only be a maximum of 13 characters (not counting the .txt) long. 'hellholeravinedata' is 18 characters. 'hellholeravine' is 14.

 

And yes, I realize the editor says your scenario filename can be up to 20 characters, in the dialog when you first create it, but I'd bet that your filenames are just too long.

Link to comment
Share on other sites

I changed the filename to hellholedata.txt, but now I'm facing other problems... The editor is again refusing to recognise these custom items because of the changed filename. I might have to create a new scenario with a shorter name (luckily I haven't bothered with outdoor terrain yet, so all I have to do is import the town of Weaselden). D'you think that would work?

Link to comment
Share on other sites

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