• 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!

Codes

Vassal

Hopeless Pirate Modder
Storm Modder
Greetings mateys <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> ....well i need a tutorial or help for coding on how to add new guns and how to make them put in random location, for sale in stores....me need help for codings <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
Nathankell <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> ....can you help me??? i have finish making the code in itemsinit.c and the itemsdescribe <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> ...is there anythings else to add??? And how im gonna make it appear in your inventory after you finish the tutorial with malcom (like in StormyStartMod) <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
Oh, sorry, right. I was actually just now editing the inititems file..
If you've done those two things--you're done!
Wait. Did you add a normal item define, or a InitGun() call? Or both?
The former is seldom used anymore because we mostly all use Scheffnow's weapons mod.
if you've not added an InitGun() line, find the big block of InitGun() calls in inititems.c:
they work like this:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->        //----------------------------------------------------------------------------------------------------

       // GUNS:       ItemIndex                  picIndex         Price             Accuracy

       //              |  gunID   modelID            | rare         | minDamage        | Charges

       //              |   |          |  picTexture  |  |  MinLevel |     | maxDamage  |  |  Reload time

       //--------------|---|----------|----------|---|--|-----|-----|-----|-----|------|--|---|-----------------

           n = InitGun(n, "pistol1", "pistol1",  6,  1, 0.50,  3,  1500, 15.0, 30.0,  30, 1,  8); // Short Pistol<!--c2--></div><!--ec2-->
Add a new n = InitGun() line after Alan Smithee's, and replace the names and stats with those you desire.

To give it to the player at start: open up questsboth_reaction.c
find (if you're running PB's modpack)
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->/*

     GiveItem2Character(Pchar, "giveitm");    // PB: Gives you any item you might want to test when you start a new game

       //     Replace "giveitm" with the item you want to be given (find names in initItems.c)      */<!--c2--></div><!--ec2-->
Remove the /* and the */, and replace "giveitm" with the ID of your gun.
 
Ok...i will try <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/bookish.gif" style="vertical-align:middle" emoid=":mm" border="0" alt="bookish.gif" /> ....i post again when im lost <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/bookish.gif" style="vertical-align:middle" emoid=":mm" border="0" alt="bookish.gif" />
 
Nathan <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/ohmy.gif" style="vertical-align:middle" emoid=":eek:" border="0" alt="ohmy.gif" /> , is it really need to add in this code?

code:
--------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------
// GUNS: ItemIndex picIndex Price Accuracy
// | gunID modelID | rare | minDamage | Charges
// | | | picTexture | | MinLevel | | maxDamage | | Reload time
//--------------|---|----------|----------|---|--|-----|-----|-----|-----|------|--|---|-----------------
n = InitGun(n, "pistol1", "pistol1", 6, 1, 0.50, 3, 1500, 15.0, 30.0, 30, 1, <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/cool.gif" style="vertical-align:middle" emoid="8)" border="0" alt="cool.gif" />; // Short Pistol
--------------------------------------------------------------------------------

I think its only for having like for example: worn out pistol etc. like that??
 
<!--`QuoteBegin-NathanKell`+--><div class='quotetop'>QUOTE(NathanKell)</div><div class='quotemain'><!--QuoteEBegin--><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->/*

     GiveItem2Character(Pchar, "giveitm");    // PB: Gives you any item you might want to test when you start a new game

       //     Replace "giveitm" with the item you want to be given (find names in initItems.c)      */<!--c2--></div><!--ec2-->[/quote]Hey! Is that code still in there? I thought I had removed it again. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_eek.gif" style="vertical-align:middle" emoid=":shock:" border="0" alt="icon_eek.gif" />
I had been wanting to set that item in BS.h, but failed all the time. I thought it might be useful if you were wanting to test a certain item and didn't want to search for it.

If you want your gun in the game just like any normal gun (badly `worn-excellent`), you do need to add that line. If one quality is fine enough, add the normal code somewhere near the SWAK weapons.
 
Ooops <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_eek.gif" style="vertical-align:middle" emoid=":shock:" border="0" alt="icon_eek.gif" /> i think im gonna let a modder check my codes, i will let modder check it when im done <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/bookish.gif" style="vertical-align:middle" emoid=":mm" border="0" alt="bookish.gif" />
 
Back
Top