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

Swords?

I had 2 proplems then

A. the end of my forth line reads "al)" not just "a)"
and B. my 13 line is n = Items_FindItem(_location.items.(alName), &randItem);

this is 20 lines down from the forth instance

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->void RandItems_SpawnRandItem(int _index, aref _location, aref al)

{
    aref randItem;
    string lastSpawnTimeString;
    int n;

    string alName = GetAttributeName(al);
    string alNameAttribute = "items."+alName;
    // NK temporarily locations with named rand items will ignore the name. BUT if ID == blade1, will still gen that.
    bool temp = true;
    if (CheckAttribute(_location, alNameAttribute))
    {
 if(_location.items.(alName) == "blade1")
 {
     temp = false;
     n = Items_FindItem(_location.items.(alName), &randItem);
     if (n == -1)
   return;

     lastSpawnTimeString = "LastSpawnTime"+_index;
     _location.(lastSpawnTimeString) = Items_MakeTime(0, 15, 1, 2003);
 }
    }
    //else
    if(temp)
    {<!--c2--></div><!--ec2-->
 
Well, I have this:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->void RandItems_SpawnRandItem(int _index, aref _location, aref al)
{
    aref randItem;
    string lastSpawnTimeString;
    int n;

    string alName = GetAttributeName(al);
    string alNameAttribute = "items."+alName;
    // NK temporarily locations with named rand items will ignore the name. BUT if ID == blade1, will still gen that.
    // NK 05-03-25 fix this so it checks location's randitemsstay attribute.
    bool temp = true;
    if (CheckAttribute(_location, alNameAttribute))
    {
 if(checkattribute(_location,"randitemsstay") && sti(_location.randitemsstay))
 {
     temp = false;
     n = Items_FindItem(_location.items.(alName), &randItem);
     if (n == -1)
   return;

     lastSpawnTimeString = "LastSpawnTime"+_index;
     _location.(lastSpawnTimeString) = Items_MakeTime(0, 15, 1, 2003);
 }
    }
    //else
    if(temp)
    {
 // NK <--
 n = Items_FindItem(RandItems[rand(RANDITEMS_QUANTITY-1)].id, &randItem);
 if (n == -1)
     return;

 lastSpawnTimeString = "LastSpawnTime"+_index;
 _location.(lastSpawnTimeString) = Items_MakeTime(GetTime(), GetDataDay(), GetDataMonth(), GetDataYear());
    }

    if (randItem.model == "")
    {
 Trace("ItemLogic: no model for item "+_location.id+"."+randItem.id);
 return;
    }

    Items_LoadModel(&randItemModels[_index],  randItem);
    SendMessage(&randItemModels[_index], "lffffffffffff", MSG_MODEL_SET_POSITION, makeFloat(al.x), makeFloat(al.y), makeFloat(al.z), makeFloat(al.vx.x), makeFloat(al.vx.y), -makeFloat(al.vx.z), makeFloat(al.vy.x), makeFloat(al.vy.y), -makeFloat(al.vy.z), makeFloat(al.vz.x), makeFloat(al.vz.y), -makeFloat(al.vz.z));

    lastSpawnTimeString = "RandItemType"+_index;
    _location.(lastSpawnTimeString) = n;
}<!--c2--></div><!--ec2-->

Try pasting it into your file (replacing your 20 lines and some more up to the closing curled brace) and then replace the line as Nathan indicated.

And sorry folks for again posting so much unaltered code here.
 
What PotC installation do you have, Inez? Build 12.1, Pre Build 13?
 
<!--QuoteBegin-Pieter Boelen+May 16 2005, 10:38 AM--><div class='quotetop'>QUOTE(Pieter Boelen @ May 16 2005, 10:38 AM)</div><div class='quotemain'><!--QuoteEBegin-->What PotC installation do you have, Inez? Build 12.1, Pre Build 13?
<div align="right">[snapback]105457[/snapback]</div><!--QuoteEnd--></div><!--QuoteEEnd-->
The latest I could get, whatever that is (I think pre13, and the newest fleets code).
I'm afraid you and Nathan are currently the ony ones who even have an idea which version contains what.
 
Regarding swords, I´ve got a question as well. I´d like to disable some swords for spawned characters while using the weaponsmod. The problem is, by now the enemies get the best swords as well, kiling me despite of blocking, and now that´s merely frustrating, especially if I´ve got to handle all the fights on land, the bandits or the guys in the Douwesen cave etc. These landfights are a necessary evil, with pronounciation on evil.

Now, the way the itemsinit handles the weapons, it is easy to disable blades for the weaponsmod _disabled_, but not enabled. If the weaponsmod is disabled, each weapon has lines like this:

itm.skiptrade = false;
itm.skiprand = false;
itm.skipequip = false;

so, to disable a weapon to be equipped to a spawned character, I suppose you just set skipequip to "true".

With the weaponsmod enabled, however, the weapons are organized in a table, which is referred to in the function

int InitBlade( ref ItemIndex,
string id,
string ModelID,
string picTexture,
int picIndex,
float Rare,
int MinLevel,
int Price,
float DmgMin,
float DmgMax,
int Piercing,
int Blocking)

with the rest following. This however does not allow for selecting a single weapon to be disabled, unless you would enter a line like

bool Skipequip to the ref- function and in the table. At least, that´s what I supspect how the code works, now I´d like to know whether or not I´m right.
 
Yup, you're right.
For example:
under
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->string BladeID;<!--c2--></div><!--ec2-->
add
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->bool QualityEquip;<!--c2--></div><!--ec2-->

then assign that true or false under each case in the big for loop below, i.e. say in case 0 (quality -2), QualityEquip = true; and so forth.

Near the bottom of the the function, you will see
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->blade.skipequip  = false;<!--c2--></div><!--ec2-->
Change that to
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->blade.skipequip  = !QualityEquip;<!--c2--></div><!--ec2-->

And yes, there should indeed be a ! there.
 
But that would only mean a blade of a certain *quality* would not be given to opposites (that much I know that ! is a sign of negation in code), but not the sword at all (like the Bosun´s Choice or Solingen Rapier). So what I´d figure to have to do is adding a new collumn in the blade table (I know it´s been done in Pieters mod for the new weapons with certain weapons assigned to specific nations) saying either "true" or "false" for each blade and put the skipequip check into the function above. Slowly I start to understand this coding thing, but very slowly , indeed.
 
I have found something odd which I hope has been tracked down and fixed (have not had a chance to test this yet). I've reported it several times already. I get a "average" quality top blade - the Solingen Rapier - which has incredible stats for blocking. Works just fine when you use it as is, but the moment you take it to the blacksmith and he tinkers with it, the block seems useless.

I had one when I was working on the Animist quest fix, and when I was attacked by the Animists in the church on Redmond, I had trouble blocking blows from their daggers. I don't think I have to tell you that it's ridiculous to be killed by three guys with daggers when you are holding and using a sword that (presumably) has such high block capabilities. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" />

Has anyone taken a look at that yet? <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've got other projects on my plate that need attention... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/poet.gif" style="vertical-align:middle" emoid=":hmm" border="0" alt="poet.gif" />
 
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/modding.gif" style="vertical-align:middle" emoid=":modding" border="0" alt="modding.gif" /> Arrrrgh, I <i>thought</i> I got it, but obviously I didn´t - again. I just wonder why.

This is the weapon table for the Scheffnows Weapon mod in inititems.c:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> n = InitBlade(n, "blade5",  "blade5",  6,  9, 0.90,  0,   250,  4.0, 10.0, 25,  0, true); // Dagger                  
           n = InitBlade(n, "blade2",  "blade2",  6, 10, 0.90,  1,   500,  8.0, 12.0, 20, 10, true); // Rapier                  
           n = InitBlade(n, "blade1",  "blade1",  6, 11, 0.90,  2,   500,  8.0, 13.0, 10, 10, false); // Saber                  
           n = InitBlade(n, "blade4",  "blade4",  6,  7, 0.90,  3,   500,  8.0, 14.0, 10,  5, true); // Cutlass                
           n = InitBlade(n, "blade7",  "blade7",  6, 13, 0.70,  4,   500,  9.0, 15.0, 15,  5, true); // Yataghan                
           n = InitBlade(n, "blade3",  "blade3",  6,  8, 0.60,  5,  1000, 10.0, 16.0, 10, 10, true); // Badelaire              
           n = InitBlade(n, "blade6",  "blade6",  6, 12, 0.60,  6,  1000, 10.0, 17.0, 15, 15, true); // Schiavona              
           n = InitBlade(n, "blade13", "blade13", 3,  6, 0.40,  7,  2000, 11.0, 18.0, 25, 20, true); // Needle                  
           n = InitBlade(n, "blade11", "blade11", 3,  4, 0.40,  8,  2000, 11.0, 19.0, 20, 15, true); // Highlander              
           n = InitBlade(n, "blade8",  "blade8",  3,  1, 0.30,  9,  4000, 12.0, 20.0, 15, 10, true); // Maltese Knight          
           n = InitBlade(n, "blade12", "blade12", 3,  5, 0.30, 10,  4000, 12.0, 20.0, 20, 20, true); // Dragon's Tongue        
           n = InitBlade(n, "blade18", "blade18", 3, 11, 0.30, 11,  4000, 12.0, 21.0, 25, 25, true); // Sharp's Saber
           n = InitBlade(n, "blade15", "blade15", 3,  8, 0.25, 12,  8000, 12.0, 22.0, 30, 25, true); // Brazo del Colon        
           n = InitBlade(n, "blade10", "blade10", 3,  3, 0.25, 13,  2000, 13.0, 23.0, 20, 10, true); // Piranha                
           n = InitBlade(n, "blade16", "blade16", 3,  9, 0.25, 14,  8000, 13.0, 24.0, 25, 20, true); // Tizona                  
           n = InitBlade(n, "blade19", "blade19", 3, 12, 0.25, 15,  8000, 13.0, 25.0, 25, 40, true); // Vagrant                
           n = InitBlade(n, "blade20", "blade20", 3, 13, 0.20, 16, 16000, 14.0, 26.0, 30, 30, true); // Squall                  
           n = InitBlade(n, "blade21", "blade21", 3, 14, 0.20, 17, 16000, 14.0, 27.0, 25, 15, true); // Falchion                
           n = InitBlade(n, "blade17", "blade17", 3, 10, 0.20, 18, 16000, 14.0, 28.0, 25, 10, true); // Flamigera              
           n = InitBlade(n, "blade9",  "blade9",  3,  2, 0.10, 19, 32000, 15.0, 29.0, 45, 45, true); // Silver Leaf
           n = InitBlade(n, "blade14", "blade14", 3,  7, 0.10, 20, 32000, 15.0, 29.0, 20, 90, true); // Conquistador            
           n = InitBlade(n, "blade22", "blade22", 3, 15, 0.10, 21, 32000, 15.0, 29.0, 90, 20, true); // Corsair's Pride        
           n = InitBlade(n, "blade23", "blade23", 3, 16, 0.10, 22, 32000, 15.0, 29.0, 40, 30, true); // Windmill Slayer        
           n = InitBlade(n, "blade25", "blade25", 6, 15, 0.05, 23, 64000, 16.0, 30.0, 95, 70, true); // Cardinal's Guard        
           n = InitBlade(n, "blade26", "blade26", 3,  6, 0.05, 23, 64000, 16.0, 31.0, 70, 95, true); // Solingen Rapier        
           n = InitBlade(n, "blade24", "blade24", 6, 14, 0.05, 24, 64000, 16.0, 32.0, 80, 85, true); // Atwood's Saber        
           n = InitBlade(n, "blade27", "blade27", 6, 16, 0.05, 25, 64000, 16.0, 36.0, 50, 30, true); // Bosun's Choice
    n = InitBlade(n, "blade28", "blade19", 3, 12, 0.01,  0,   500, 12.0, 18.0, 12, 10, true); // Longsword
    n = InitBlade(n, "blade29", "blade23", 3, 16, 0.01,  0,   600, 15.0, 20.0, 20, 15, true); // English Longsword
    n = InitBlade(n, "blade30", "blade9",  3,  2, 0.01,  0,   600, 15.0, 20.0, 20, 15, true); // French Longsword
    n = InitBlade(n, "blade31", "blade14", 3,  7, 0.01,  0,   600, 15.0, 20.0, 20, 15, true); // Spanish Longsword<!--c2--></div><!--ec2-->

I added the boolean variable at the end of the table for the skipequip function and for testing purposes all weapons but the saber were set to true (meaning no other weapon should be equipped).

This is the rest of the sword relevant function:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->int InitBlade(  ref     ItemIndex,
               string  id,
               string  ModelID,
               string  picTexture,
               int     picIndex,
               float   Rare,
               int     MinLevel,
               int     Price,
               float   DmgMin,
               float   DmgMax,
               int     Piercing,
               int     Blocking,
 bool    skipequip) //Grimm
{
    ref    blade;
    int    i;
    int    BladeIndex;
    int    QualityPiercing;
    int    QualityBlocking;
    int    QualityMinLevel;
    int    QualityPrice;
    float  QualityRare;
    float  QualityDmgMin;
   float  QualityDmgMax;
   bool   QualitySkipRand;
   bool   QualitySkipTrade;
    string QualityTexture;
    string QualityName;
    string BladeID;

    BladeIndex = ItemIndex;
    for (i = 0; i < 6; i++)
    {
       QualityDmgMin    = (0.5 + i * 0.25) * DmgMin;
       QualityDmgMax    = (0.5 + i * 0.25) * DmgMax;
       QualityPrice     = (0.5 + stf(i * 0.25)) * Price;
       QualityRare      = Rare * (1.0 - 0.1 * i);
       QualityBlocking  = sti(-2 + i + Blocking);
       QualitySkipTrade = false;
       QualitySkipRand  = false;
       switch(i)
       {
           case 0:
               QualityTexture   = "ITEMS_" + picTexture + "-2";
               QualityName      = "Badly worn";
               BladeID          = id + "-2";
           break;

           case 1:
               QualityTexture   = "ITEMS_" + picTexture + "-1";
               QualityName      = "Worn";
               BladeID          = id + "-1";
           break;

           case 3:
               QualityTexture   = "ITEMS_" + picTexture + "+1";
               QualityName      = "Good";
               BladeID          = id + "+1";
           break;

           case 4:
               QualityTexture   = "ITEMS_" + picTexture + "+2";
               QualityName      = "Fine";
               BladeID          = id + "+2";
               QualitySkipRand  = true;
           break;

           case 5:
               QualityTexture   = "ITEMS_" + picTexture + "+3";
               QualityName      = "Exellent";
               BladeID          = id + "+3";
               QualitySkipTrade = true;
               QualitySkipRand  = true;
           break;

           QualityTexture  = "ITEMS_" + picTexture;
           QualityName     = "Average";
           BladeID         = id;
       }

       if(QualityBlocking < 0)
       {
           QualityBlocking = 0;
       }
       QualityPiercing = sti(-2 + i + Piercing);
       if(QualityPiercing < 0)
       {
           QualityPiercing = 0;
       }
       QualityMinLevel = sti(-2 + i + MinLevel);
       if(QualityMinLevel < 0)
       {
           QualityMinLevel = 0;
       }
       makeref(blade,Items[BladeIndex]);
       // quality invariant properties
       blade.id               = BladeID;
       blade.BladeQuality     = i;
       blade.groupID          = BLADE_ITEM_TYPE;
       blade.name             = "itmname_" + id;
       blade.describe         = "itmdescr_" + id;
       blade.model            = ModelID;
    blade.skipequip        = skipequip;  //Grimm      
    // quality affected properties
       blade.QualityName      = QualityName;
       blade.picTexture       = QualityTexture;
       blade.picIndex         = picIndex;
       blade.minlevel         = QualityMinLevel;
       blade.price            = QualityPrice;
       blade.dmg_min          = QualityDmgMin;
       blade.dmg_max          = QualityDmgMax;
       blade.piercing         = QualityPiercing;
       blade.block            = QualityBlocking;
       blade.rare             = QualityRare;
       blade.skiptrade        = QualitySkipTrade;
       blade.skiprand         = QualitySkipRand;
       // invariant properties
       blade.folder           = "ammo";
       
       blade.param.time       = 0.05;
       blade.param.colorstart = argb(64, 64, 64, 64);
       blade.param.colorend   = argb(0, 32, 32, 32);
       BladeIndex++;
   }
   return BladeIndex++;
}<!--c2--></div><!--ec2-->

Now, still in boarding, enemies get equipped with other weapons than the saber, WHY? I´ll have yet to try land encounters in the wilderness, but I´m rather pessimistic about it.
 
<!--QuoteBegin-CatalinaThePirate+May 19 2005, 07:01 AM--><div class='quotetop'>QUOTE(CatalinaThePirate @ May 19 2005, 07:01 AM)</div><div class='quotemain'><!--QuoteEBegin-->I have found something odd which I hope has been tracked down and fixed (have not had a chance to test this yet).  <div align="right">[snapback]105794[/snapback]</div><!--QuoteEnd--></div><!--QuoteEEnd--> Finally got a chance to test this today; looks like things are normal again. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" /> Thanks and a shipload of your favorite liquid repast to whomever fixed this! <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" />
 
To v_Grimmelshausen:

Try changing the line "blade.skiprand = QualitySkipRand;" into "blade.skiprand = skipequip; //Grimm". (That's the line that should be changed, right? If not, the same trick might work for the line that <i>should</i> be changed.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->int InitBlade(  ref     ItemIndex,
                string  id,
                string  ModelID,
                string  picTexture,
                int     picIndex,
                float   Rare,
                int     MinLevel,
                int     Price,
                float   DmgMin,
                float   DmgMax,
                int     Piercing,
                int     Blocking,
  bool    skipequip) //Grimm
{
    ref    blade;
    int    i;
    int    BladeIndex;
    int    QualityPiercing;
    int    QualityBlocking;
    int    QualityMinLevel;
    int    QualityPrice;
    float  QualityRare;
    float  QualityDmgMin;
    float  QualityDmgMax;
    bool   QualitySkipRand;
    bool   QualitySkipTrade;
    string QualityTexture;
    string QualityName;
    string BladeID;

    BladeIndex = ItemIndex;
    for (i = 0; i < 6; i++)
    {
        QualityDmgMin    = (0.5 + i * 0.25) * DmgMin;
        QualityDmgMax    = (0.5 + i * 0.25) * DmgMax;
        QualityPrice     = (0.5 + stf(i * 0.25)) * Price;
        QualityRare      = Rare * (1.0 - 0.1 * i);
        QualityBlocking  = sti(-2 + i + Blocking);
        QualitySkipTrade = false;
        QualitySkipRand  = false;
        switch(i)
        {
            case 0:
                QualityTexture   = "ITEMS_" + picTexture + "-2";
                QualityName      = "Badly worn";
                BladeID          = id + "-2";
            break;

            case 1:
                QualityTexture   = "ITEMS_" + picTexture + "-1";
                QualityName      = "Worn";
                BladeID          = id + "-1";
            break;

            case 3:
                QualityTexture   = "ITEMS_" + picTexture + "+1";
                QualityName      = "Good";
                BladeID          = id + "+1";
            break;

            case 4:
                QualityTexture   = "ITEMS_" + picTexture + "+2";
                QualityName      = "Fine";
                BladeID          = id + "+2";
                QualitySkipRand  = true;
            break;

            case 5:
                QualityTexture   = "ITEMS_" + picTexture + "+3";
                QualityName      = "Exellent";
                BladeID          = id + "+3";
                QualitySkipTrade = true;
                QualitySkipRand  = true;
            break;

            QualityTexture  = "ITEMS_" + picTexture;
            QualityName     = "Average";
            BladeID         = id;
        }

        if(QualityBlocking < 0)
        {
            QualityBlocking = 0;
        }
        QualityPiercing = sti(-2 + i + Piercing);
        if(QualityPiercing < 0)
        {
            QualityPiercing = 0;
        }
        QualityMinLevel = sti(-2 + i + MinLevel);
        if(QualityMinLevel < 0)
        {
            QualityMinLevel = 0;
        }
        makeref(blade,Items[BladeIndex]);
        // quality invariant properties
        blade.id               = BladeID;
        blade.BladeQuality     = i;
        blade.groupID          = BLADE_ITEM_TYPE;
        blade.name             = "itmname_" + id;
        blade.describe         = "itmdescr_" + id;
        blade.model            = ModelID;
    blade.skipequip        = skipequip;  //Grimm      
    // quality affected properties
        blade.QualityName      = QualityName;
        blade.picTexture       = QualityTexture;
        blade.picIndex         = picIndex;
        blade.minlevel         = QualityMinLevel;
        blade.price            = QualityPrice;
        blade.dmg_min          = QualityDmgMin;
        blade.dmg_max          = QualityDmgMax;
        blade.piercing         = QualityPiercing;
        blade.block            = QualityBlocking;
        blade.rare             = QualityRare;
        blade.skiptrade        = QualitySkipTrade;
        blade.skiprand         = skipequip;  //Grimm
        // invariant properties
        blade.folder           = "ammo";
        
        blade.param.time       = 0.05;
        blade.param.colorstart = argb(64, 64, 64, 64);
        blade.param.colorend   = argb(0, 32, 32, 32);
        BladeIndex++;
    }
    return BladeIndex++;
}<!--c2--></div><!--ec2-->

To CatalinaThe Pirate: It's fixed? In what mod was it fixed? Not that I ever experienced any troubles with it; at least not for as far as I can remember... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
Congrats anyway! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />
 
Thank you Pieter, I´ll try that one, even though I inended the skipping to be independent of quality, i.e. the weapon should not be equipped no matter what quality it has. And, as it seems, skiprand means a type of that blade cannot be found as a random item in chests or the like, but skipequip would influence whether or not a weapon is given to random enemies. Or am I wrong there?
 
Pieter:
Your suggestion didn´t work, at last not in a re-inited loaded game and even starting a new game gave me some merchants in the oxbay streets (the one introduced by the build, I mean, those wandering about) who were equipped with other weapons than sabres. This is really weird.
 
Should "skipequip" be a "bool"? I don't know what a "bool" is, so I don't know.
Wait a second: I think I've got the bug. You might need to remove the QualitySkipRand = false; line from the code excerpt you posted.
BTW: My suggestion shouldn't be influenced by quality.

Hope this does some good... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
<!--QuoteBegin-Pieter Boelen+May 28 2005, 10:50 AM--><div class='quotetop'>QUOTE(Pieter Boelen @ May 28 2005, 10:50 AM)</div><div class='quotemain'><!--QuoteEBegin-->Should "skipequip" be a "bool"? I don't know what a "bool" is, so I don't know.
Wait a second: I think I've got the bug. You might need to remove the QualitySkipRand  = false; line from the code excerpt you posted.
BTW: My suggestion shouldn't be influenced by quality.

Hope this does some good... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
<div align="right">[snapback]107796[/snapback]</div><!--QuoteEnd--></div><!--QuoteEEnd-->

A boolean variable (part of Boolean Logic) can only be "true" or "false".

Ae you sure about the QualitySkipRand line? As fa as I understand it, it sets quality based possibility to randomly come across a blade to true (means you can find them, skip =false means it´s <i>not</i> skipped, a double negation) per default. Thepoint is, quality isn´t supposed to have anything to do with what I want, I just want to prevent certain blades to be given to enemies at all, and that should be the skipequip or maybe the skiprand function. But then again, looking at other items than weapons, there are some you can find, but not plunder from enemies, and they usually are coded:

skipequip = true
skiprand = false
 
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->       QualityDmgMin    = (0.5 + i * 0.25) * DmgMin;
       QualityDmgMax    = (0.5 + i * 0.25) * DmgMax;
       QualityPrice     = (0.5 + stf(i * 0.25)) * Price;
       QualityRare      = Rare * (1.0 - 0.1 * i);
       QualityBlocking  = sti(-2 + i + Blocking);
       QualitySkipTrade = false;
       QualitySkipRand  = false; <--<!--c2--></div><!--ec2-->The line I marked with a "<--" sets every single sword in the Scheffnow's weapons mod to not be skipped when equiping (if I understand correctly). You could set it to "true", but then the enemies probably won't have any swords at all. Since you added the bool skipequip (thanks for explaning about that, by the way <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/danse1.gif" style="vertical-align:middle" emoid=":dance" border="0" alt="danse1.gif" /> ), I reckon you should be able to change the line to "QualitySkipRand = skipequip;". Then change "blade.skiprand = skipequip;" back into "blade.skiprand = QualitySkipRand;" and, since I see that particular line is added twice in a previously posted excerpt of code (probably my own mistake <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/mybad.gif" style="vertical-align:middle" emoid=":facepalm" border="0" alt="mybad.gif" /> ), one of them should be completely removed. Now the game should use the SkipRand true/false specified in the weapon table. At least, I hope it will; I'm not very experienced at this, so I'm not entirely sure... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
Anyway: Hope this helps you. And sorry for giving advice that didn't do much good; I'm not very knowledgeable. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />

<span style='color:red'>Edit:</span> After having a look at the full unedited code in my game, it seems you need to do four things:
1) Add the true/false settings for skiprand to the 'table-code'.
2) Add bool SkipRandGrimm (or whatever you want to name it) to "int InitBlade( *** )".
3) Remove all lines having to do with "QualitySkipRand", except "blade.skiprand = QualitySkipRand;".
4) Change "blade.skiprand = QualitySkipRand;" into "blade.skiprand = SkipRandGrimm;".
Now, I reckon all sabers in the weapon's mod should use the SkipRandGrimm true/false value speciafied in the 'table-code'.
I hope some of my suggestions can do do some good... <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":?" border="0" alt="unsure.gif" />
 
I´ll try it as soon as I can, about tuesday or wednesday we´ll know.
Though I´m still somewhat curious why it´s the skiprand instead of the skipequip function...
However, adding a variable in the initblade to assign certain blades to specific nations worked in your modpack (though you used a string variable for the different countries, if my memory serves right). <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/dunno.gif" style="vertical-align:middle" emoid=":shrug" border="0" alt="dunno.gif" />
 
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" />

In stock PotC, enemies never used guns.

What code prevented this?
I'm thinking it should be somewhere in CCC's Vice City code.

Can that code be used to prevent them from using specific swords?
 
Actually, they did, when they could get any because of their level, which was in turn decided by your level. Usually you had to be around level 50 for them to use any guns.
 
Back
Top