Jump to content
MakeWebGames

[Request] Secondary Weapon For V2


Mark F

Recommended Posts

Re: [Request] Secondary Weapon For V2

FYI, I have a legal version of the script, I think that I explained everything incorrectly. I want it so that you can only equip certain weapons as primary, and certain weapons as secondary like in TC.

E.G. In TC the Steyr AUG can only be equipped as a primary weapon, and the Magnum can only be equipped as a secondary weapon.

Link to comment
Share on other sites

Re: [Request] Secondary Weapon For V2

You'll need to modify the attack script in order to be able to use that secondary weapon.

I personally don't touch mccodes attack script because I have looked at it in the past and I couldn't make sense of it.

Otherwise I'd offer to install the Horizons style equipment mod for ya. lol ;)

Link to comment
Share on other sites

Re: [Request] Secondary Weapon For V2

The attack script does allow you to use secondary weapons...

Rocky Horror, what you need to do is restrict the weapons from primary/secondary in the equip_weapon file. The easiest way would be to organize your primary/secondary weapons into different item types and then use that to do your restrictions. If you need more help, let me know.

Link to comment
Share on other sites

Re: [Request] Secondary Weapon For V2

 

The attack script does allow you to use secondary weapons...

Rocky Horror, what you need to do is restrict the weapons from primary/secondary in the equip_weapon file. The easiest way would be to organize your primary/secondary weapons into different item types and then use that to do your restrictions. If you need more help, let me know.

I have looked at equip_weapon.php and do not know what to change, any help would be appreciated. I will try and figure it out, though I probably won't get anywhere.

Link to comment
Share on other sites

Re: [Request] Secondary Weapon For V2

I could be wrong, but if you add a new column to items for secondary weapons, wouldn't attack need to be modified to look for that new column?

Like I said, I could be wrong...

I suppose if you add in a flag to the items table for primary/secondary and use the weapons column for the weapons strength, you could sidestep that.

Link to comment
Share on other sites

Re: [Request] Secondary Weapon For V2

 

I could be wrong, but if you add a new column to items for secondary weapons, wouldn't attack need to be modified to look for that new column?

Like I said, I could be wrong...

I suppose if you add in a flag to the items table for primary/secondary and use the weapons column for the weapons strength, you could sidestep that.

This is already implemented in v2, there are are three equip fields: equip_primary, equip_secondary, and equip_armor. The attack script uses these already so there is no need to add anything to the items table.

 

I have looked at equip_weapon.php and do not know what to change, any help would be appreciated. I will try and figure it out, though I probably won't get anywhere.

in equip_weapon.php find the line:

Please choose the slot to equip {$r['itmname']} to, if there is already a weapon in that slot, it will be removed back to your inventory.

.
.
.
<input type='submit' value='Equip Weapon' /></form>

 

replace that with:

   Please choose the slot to equip {$r['itmname']} to, if there is already a weapon in that slot, it will be removed back to your inventory.
";
   if($r['itmtype']==primary_type)
   {
       print"<input type='radio' name='type' value='equip_primary' checked='checked' /> Primary< />";
   }
   elseif($r['itmtype'] == secondary_type)
   {
       print"<input type='radio' name='type' value='equip_secondary'  /> Secondary
";
   }
   else
   {
       print"error";
   }
   print"<input type='submit' value='Equip Weapon' /></form>";

 

change primary_type with your item type id for primary weapons, and secondary_type with the item type id for secondary weapons.

 

I have not tested this, but it should give you what you're looking for.

Link to comment
Share on other sites

Re: [Request] Secondary Weapon For V2

Ah yes, paralem, that makes sense.

I tend to think in terms of expandability. For instance, making it so that you could have any number of item types as secondary weapons instead of tying code to one particular item type. In that scenario, it would make sense to added a secondary_weapon field to items table. Any item/item_type with a secondary_weapon flag would be an equipable item_type.

That would allow a bit more flexibility.

But going for using the item_type itself works too. Good job ;)

Link to comment
Share on other sites

Re: [Request] Secondary Weapon For V2

 

I could be wrong, but if you add a new column to items for secondary weapons, wouldn't attack need to be modified to look for that new column?

Like I said, I could be wrong...

I suppose if you add in a flag to the items table for primary/secondary and use the weapons column for the weapons strength, you could sidestep that.

This is already implemented in v2, there are are three equip fields: equip_primary, equip_secondary, and equip_armor. The attack script uses these already so there is no need to add anything to the items table.

 

I have looked at equip_weapon.php and do not know what to change, any help would be appreciated. I will try and figure it out, though I probably won't get anywhere.

in equip_weapon.php find the line:

Please choose the slot to equip {$r['itmname']} to, if there is already a weapon in that slot, it will be removed back to your inventory.

.
.
.
<input type='submit' value='Equip Weapon' /></form>

 

replace that with:

   Please choose the slot to equip {$r['itmname']} to, if there is already a weapon in that slot, it will be removed back to your inventory.
";
   if($r['itmtype']==primary_type)
   {
       print"<input type='radio' name='type' value='equip_primary' checked='checked' /> Primary< />";
   }
   elseif($r['itmtype'] == secondary_type)
   {
       print"<input type='radio' name='type' value='equip_secondary'  /> Secondary
";
   }
   else
   {
       print"error";
   }
   print"<input type='submit' value='Equip Weapon' /></form>";

 

change primary_type with your item type id for primary weapons, and secondary_type with the item type id for secondary weapons.

 

I have not tested this, but it should give you what you're looking for.

Thanks a lot for your help!

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...