• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

How to add new items to the build?

alan_smithee

Corsair
Storm Modder
I don't think any of the help files cover this in Build 11... How do you add new items now? The line "#define ITEMS_QUANTITY" in items.h is replaced by some other stuff, and I don't see just what I have to change to reflect a new larger quantity.

(Also, what I am trying to add, specifically, is a `poison-tipped` dagger, to make the little blighters suffer just a bit more. Is this really possible? I tried to simply paste the line "pchar.chr_ai.poison = 20 + rand(50 -sti(PChar.skill.Sneak) -sti(PChar.skill.defence) );" at the bottom of the dagger's qualities, but I dunno yet if this will actually do anything.
 
Adding new weapons is relatively simple but I'm not sure if you can add a poison effect to a weapon and even if you could it would be fairly complex due to Scheffnow's weapon mod. But there's only one way to find out and that's by trial and error.

To add a new weapon you'll have to add it in two locations to reflect the Scheffnow's weapons mod being either enabled or disabled.

1. Search for the first "Bosun's Choice" entry and at the end of it (after n++; and before // NK/Sailor Al <--) add a new entry for your dagger. It might be easier to just copy the normal dagger entry and change the itm.id to blade28. You can try to add your poison line there.
2. Find the second Bosun's Choice entry and you'll find yourself in a table that lists all of the weapons. Add your new dagger here as well.

The next step would be much more complex and I'll have to think about the best way to do it as with the weapons mod enabled there are different qualities of weapon like Worn and Fine. Adding poison effects to this would be fairly complex and you might have to add an option to all of the blades to tell them if they are poisoned or not.

The easiest way to playtest this to see if you can add a poison effect to a weapon would be to do the first step above and then disable the weapons mod by going into the BuildSettings.h file and changing #define ENABLE_WEAPONSMOD to 0
You can then give yourself the new dagger by modifying the characters_init.c file and find the Blaze entry. Then add the following line in there that gives you the blade. GiveItem2Character(ch, "blade28");

So when you start a new game you should start with the poisoned dagger.

The line "pchar.chr_ai.poison = 20 + rand(50 -sti(PChar.skill.Sneak) -sti(PChar.skill.defence) );" might actually end up poisoning your character, so you could try something like "chr_ai.poison = 20 + rand(50 -sti(PChar.skill.Sneak) -sti(PChar.skill.defence) );" or "enemy.chr_ai.poison = 20 + rand(50 -sti(PChar.skill.Sneak) -sti(PChar.skill.defence) );"
 
Thanks Sirius, I'll try all that out. No stranger to three hours of t&e, this bloke...

That's where I got the line, Cat. Though I noticed a rat running around in the game last night and thought it would be wonderful to make a few random "plagued" rats to bite you then scurry away as you're in the towns. hee hee!
 
Heh, that is good, Alan! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" /> And when they bite you the screen could give you a little update that says, "AW RATS! You've been bitten!" <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/w00t.gif" style="vertical-align:middle" emoid=":woot" border="0" alt="w00t.gif" />
 
Thinking back to those classic quest video games as I mention in another post, there were so many little jobs you could do to raise money... exterminate rats, clean out some stalls... Maybe once your character gets good enough at a skill, he could teach others for a fee.

You ever play that simple rats extermination game on the PC, where you have to wipe them out quicker than they can reproduce (with accompanying risque sound effects)?
 
...No good. Instead of giving me a new dagger, it removes all inventory items from me and everybody. The stores are empty (items only; goods remain) and even bad guys have nothing, so they just wander around aimless yet menacing.

There must be an items count function I need to update... I found a count of 512 in something once, but increasing it by one didn't help. I could try doing both that AND everything you suggested, but I'll wait first and see what someone can tell me.
 
I think MuddyMonkey77 was working on a mod that created new items for the store... Ah yes, here's the topic:

http://forum.piratesahoy.net/ftopic..." emoid=":cat" border="0" alt="par-ty.gif" />
 
I believe that Scheffnow's weapons mod allows up to 200 different blades and with the various qualities it curreently only uses 162, so there is still some space left for new blades.

What I suggest is going back to the original initItems.c file and find the following:
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->       //Bosun's Choice
        makeref(itm,Items[n]);
        itm.id = "blade27";
        // NK -->
        itm.skiptrade = false;
        itm.skiprand = false;
        itm.skipequip = false;
        // NK <--
        itm.groupID = BLADE_ITEM_TYPE;
        itm.name = "itmname_blade27";
        itm.describe = "itmdescr_blade27";
        itm.folder = "ammo";
        itm.model = "blade27";
        itm.picIndex = 16;
        itm.picTexture = "ITEMS_6";
        itm.price = 20000;
        itm.dmg_min = 40.0;
        itm.dmg_max = 55.0;
        itm.piercing = 55;
        itm.minlevel = 12;
        itm.rare = 0.05;
        itm.block = 55;
        itm.param.time = 0.1;
        itm.param.colorstart = argb(64, 64, 64, 64);
        itm.param.colorend = argb(0, 32, 32, 32);
        n++;
       // NK/Sailor Al <--<!--QuoteEnd--></div><!--QuoteEEnd-->
Between the n+++; and // NK/Sailor Al <-- lines add in you dagger like this:
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->        n++;

       //Poisoned Dagger
        makeref(itm,Items[n]);
        itm.id = "blade28";
        // NK -->
        itm.skiptrade = false;
        itm.skiprand = false;
        itm.skipequip = false;
        // NK <--
        itm.groupID = BLADE_ITEM_TYPE;
        itm.name = "itmname_blade28";
        itm.describe = "itmdescr_blade28";
        itm.folder = "ammo";
        itm.model = "blade5";
        itm.picIndex = 9;
        itm.picTexture = "ITEMS_6";
        itm.price = 250;
        itm.dmg_min = 6.0;
//                  enemy.chr_ai.poison = 20 + rand(50 -sti(PChar.skill.Sneak) -sti(PChar.skill.defence) );
        itm.dmg_max = 10.0;
        itm.piercing = 25;
        itm.minlevel = 0;
        itm.rare = 0.9;
        itm.block = 0;
        itm.param.time = 0.1;
        itm.param.colorstart = argb(64, 64, 64, 64);
        itm.param.colorend = argb(0, 32, 32, 32);
        n++;

       // NK/Sailor Al <--<!--QuoteEnd--></div><!--QuoteEEnd-->
You'll note that the poisoned line has been commented out, I'll say whay I suggest commenting it out later.
Also you'll need to go to the RESOURCEINITEXTSENGLISH folder and open up ItemsDescribe.txt and find the following text:
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->itmname_blade27 {Bosun's Choice}
itmdescr_blade27
{
Once Bosun Malcolm settled on a life ashore, he decided that someone should make good blade for Bosuns, for working sailors, not just fancy blades for officers. Magnificent cutlasses like this are the result of his effort.
}<!--QuoteEnd--></div><!--QuoteEEnd-->
And add the entry for youe poisoned dagger like this:
<!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->itmname_blade28 {Poisoned Dagger}
itmdescr_blade28
{
Evil looking poisoned dagger.
}<!--QuoteEnd--></div><!--QuoteEEnd-->

Hopefully the new dagger should be enabled to buy in stores as well as randomly found.
The reason why I suggested that the poison line be commented out is because it could cause problems and I suggest that you try adding a normal dagger first just to see if the stores and armed men aren't affected by the change. Then if that works OK you can save the game, exit and uncomment the poison line and see if that works. You might have to `re-initialise` by pressing "I" just to make sure that the new code has been enabled.
 
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/onya.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="onya.gif" /> That's great, Sirus, - I didn't know much about this part of the code, glad you could chime in on it. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />

So Alan, will the poison of this blade be curable by the antidote potion?

I'd like to interject something here, while we're talking about knives - Something I suggested a while ago when we were betatesting Build 11.0 - There should be a "lockpicking knife" as an item - something that boosts your luck up so that you are better able to pick those pesky sometimes boobytrapped chests (if you have that part of the mod on). It wouldn't have to be fancy and it wouldn't need to look even remotely like the dagger (except it would probably have a point whereupon you could cut yourself when lockpicking, LOL), and obviously would not necessarily have to be "enabled" for you to use it - just have it in your inventory (like the lucky ring, for instance) to boost your chances of being able to pick that lock...

I thought it would *not* be an item sold in any stores, as it would probably be considered illegal in an "honest" town (heh!) - maybe something you could get only from one of those roving type vendors.... Somebody *unsavory*, someone who deals in stolen goods ("wanna buy a watch?"), haha...

It's a thought, and something no one had time to pick up and run with when I made that suggestion a while ago... This reminded me of it. I think I'll try putting this together, especially if I can `re-skin` someone to be the random street peddler... Hee hee! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />

(did I say I was going to take a break from modding? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" /> LOL!)

In any case, let us know how this poisoned dagger project goes, Alan! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
Aye,great idea Catalina,at would be great if ye be able tew purchase a proper lock pick'n tool from a," Hey ye wanna buy an Island" typeCharacter <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
Heh... "Got a great deal for you on this bridge on Isla Muelle... Oh, you've SEEN that one, eh? All right, the bridge on Falaise de Fleur!" <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="icon_wink.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" />
 
Thanks SD; I did all the copying and pasting and editing correctly, to insert the new item, but I'll try it now w/o the poison.

And yeah, Cat, this would be regular poison, far as I know, curable by antidote... but it's up to the bad guys whether they have that or not. Though I guess they might end up equipped with it too...
I just got the idea because I thought it was a little silly that wounded people automatically <i>recover their health</i>, instead of getting worse. Plus if you ever embarked on a career as an assassin, this mode of killing would contain quite a bit more panache`.

I've thought about the lockpick idea too, but having it simply increase your luck is kind of generic; it isn't aimed at locked chests. Still, I guess it's the best you could do.
How about locked doors? I mean, ones you can open, not the permanently locked ones. Is there a way, you think, to apply the code for locked chests to doors, and require a lockpick for those?
And someone's mentioned it before but I'd like to confirm... _can_ you change a permanently locked door and add a room location to it?
 
It should be possible to add a lock pick tool and make it so that you can only pick locks when you've got the tool.

The file that looks like it is controlling the locks on the chests is itemLogic.c in the PROGRAMITEMS folder line 563 seems to be the general area. So it should be possible to do some code that checks your inventory to see if you have the lock pick.


Alan, the locked doors can be unlocked but only through adding code and adding a location that they unlock to. Most of the doors remain locked because until there is a good reason to unlock a door there is little point in doing so due to the time involved in adding a new location.
 
Sirus, I think I'd like to make the lockpicking knife an item that is not *essential* but will make things easier (like upping your luck - which plays a big part in this opening chest mod). It should go along with some other strange items I'm going to cook up for this "Sneaky Item Trader" character which I will create. He can carry items like "hot" jewelry, the lockpick, a crowbar, swampland, &tc... It can be a small bit of comic relief like Gregor Samsa...

Do you think I should make it so that the lockpick knife will disable the boobytrap bomb? I'd say *that* would be much more useful than merely "luck" in opening those chests... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />

I think I'll make a new topic for this...
 
Speaking of items, I just dug the strangest thing out of a treasure chest on some ship I'd boarded last night. I kid you not:

<img src="http://img78.photobucket.com/albums/v251/alan_smithee/deadbird.jpg" border="0" class="linked-image" />

(That parrot is most definately deceased! Kaput, expired! Shuffled off the mortal coil...!) Sold 'er for 22 pirate dollars.

I laughed so hard when I got it... AlexusB or Morgan responsible for this? Someone not from the States is all I can figure.
 
I dunno. That's a gull, not a cormorant - something I have been meaning to go in and fix... Actually, it seems to boost your skills, can't recall which, maybe leadership and melee? <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
I thought that the cormorant increased your melee skill but reduced your leadership and luck. If I find them in a chest I always leave them behind as they aren't worth anything.
 
Aye it jest seems bad luck tew be carry'n a dead bird around <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />
 
How come Fred Bob ne'er finds no footballs or hockey sticks in dem chests?! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
Back
Top