Murdoc Posted September 19, 2010 Author Share Posted September 19, 2010 Add Additional Equipment in Eclipse Origins===============================This tutorial will demonstrate how to add an additional equipment slot (more may be added).Client Side–---------In modConstants add a constant BEFORE the shield constant, like so:```' Item constantsPublic Const ITEM_TYPE_NONE As Byte = 0Public Const ITEM_TYPE_WEAPON As Byte = 1Public Const ITEM_TYPE_ARMOR As Byte = 2Public Const ITEM_TYPE_HELMET As Byte = 3Public Const ITEM_TYPE_LEGWEAR As Byte = 4Public Const ITEM_TYPE_SHIELD As Byte = 5Public Const ITEM_TYPE_POTIONADDHP As Byte = 6Public Const ITEM_TYPE_POTIONADDMP As Byte = 7Public Const ITEM_TYPE_POTIONADDSP As Byte = 8Public Const ITEM_TYPE_POTIONSUBHP As Byte = 9Public Const ITEM_TYPE_POTIONSUBMP As Byte = 10Public Const ITEM_TYPE_POTIONSUBSP As Byte = 11Public Const ITEM_TYPE_KEY As Byte = 12Public Const ITEM_TYPE_CURRENCY As Byte = 13Public Const ITEM_TYPE_SPELL As Byte = 14```I used LEGWEAR as an example, but you can add anything you want.You'll notice the constant value for shields is up by one, as are the rest. (this needs to be the same on server side)In modGameLogic under ' For the stats label .. add a case:```Case ITEM_TYPE_LEGWEAR.lblItemDescStats.Caption = "Defence: " & Item(itemnum).Data2```In modEnumerations under 'Equipment used by Players: Add before Shield:```Legwear```In modHandleData under Sub HandlePlayerWornEq AND Sub HandleMapWornEq add:```Call SetPlayerEquipment(MyIndex, Buffer.ReadLong, Legwear)```Server Side:–----------In modPlayer under Sub CheckEquippedItems add:```Case Equipment.Neckwear If Item(itemNum).Type <> ITEM_TYPE_LEGWEAR Then SetPlayerEquipment Index, 0, I```Under Function GetPlayerProtection add:```Dim Legwear As Long```After "Helm = GetPlayerEquipment.." add:```Legwear = GetPlayerEquipment(Index, Legwear)```and near bottom add:```If Neckwear > 0 Then GetPlayerProtection = GetPlayerProtection + Item(Legwearwear).Data2 End If```Under the Sub HandleUseItem:Add:```Case ITEM_TYPE_LEGWEAR For I = 1 To Stats.Stat_Count - 1 If GetPlayerStat(Index, I) < Item(GetPlayerInvItemNum(Index, InvNum)).Stat_Req(I) Then PlayerMsg Index, "You do not meet the stat requirements to equip this item.", BrightRed Exit Sub End If Next If GetPlayerEquipment(Index, Legwear) > 0 Then TempItem = GetPlayerEquipment(Index, Legwear) End If SetPlayerEquipment Index, GetPlayerInvItemNum(Index, InvNum), Legwear PlayerMsg Index, "You equip " & CheckGrammar(Item(GetPlayerInvItemNum(Index, InvNum)).Name), BrightGreen TakeInvItem Index, GetPlayerInvItemNum(Index, InvNum), 0 If TempItem > 0 Then GiveInvItem Index, TempItem, 0 ' give back the stored item TempItem = 0 End If Call SendWornEquipment(Index) Call SendMapEquipment(Index)```Under Sub SendWornEquipment add:```Buffer.WriteLong GetPlayerEquipment(Index, Legwear)```**Do same for SendMapEquipment and SendMapEquipmentTo**In modEnumerations under 'Equipment used by Player add "Legwear" (again, before Shield)Add to ' Item constants:```Public const ITEM_TYPE_LEGWEAR As Byte = 4```(same as client side)Lastly, go into properties for cmbType in frmEditor_Item, select Categorized tab, and add "Legwear" to the list there.And that should just bout do it.If you want to create more slots, simply repeat the above procedure. :) Link to comment Share on other sites More sharing options...
kibbelz Posted September 21, 2010 Share Posted September 21, 2010 Nice work, Can you post a screeny or two? Link to comment Share on other sites More sharing options...
Guest Posted October 11, 2010 Share Posted October 11, 2010 Thanks for the tut, I still don't see why leg armour wasn't in origins :/ Link to comment Share on other sites More sharing options...
GreenBlaze Posted October 17, 2010 Share Posted October 17, 2010 Very good but a few mistakes i would like to point out:```Case Equipment.Neckwear If Item(itemNum).Type <> ITEM_TYPE_LEGWEAR Then SetPlayerEquipment Index, 0, I```just to avoid errors while compling change "Neckwear" to "Legwear" same with the other codes like that.ALSO- i may want to point out I just a error code '9' doing this therefore i had to delete my admin account for my game to work again. Apart from that I think it was good help. Link to comment Share on other sites More sharing options...
Guest Posted October 17, 2010 Share Posted October 17, 2010 Is that all you have to do to get rid of that :O!? >_> Link to comment Share on other sites More sharing options...
Sputnak Posted October 17, 2010 Share Posted October 17, 2010 I tried to add this to my game but when I compiled the server it said:> Compile error:> > Variable not defined.and it highlighted "ITEM_TYPE_LEGS" (I changed legwear to legs)Under "Sub HandleUseItem"Do you know how this went wrong? Link to comment Share on other sites More sharing options...
Guest Posted October 18, 2010 Share Posted October 18, 2010 @-sigh-:> I tried to add this to my game but when I compiled the server it said:> > > Compile error:> > > > Variable not defined.> > and it highlighted "ITEM_TYPE_LEGS" (I changed legwear to legs)> Under "Sub HandleUseItem"> Do you know how this went wrong?Do ctrl-f and find something like helm and repeat what it does everywhere e.g. if a line said IF Helm = Helm (idk :P) then you would put IF Legs = Legs, etc. Link to comment Share on other sites More sharing options...
Sputnak Posted October 19, 2010 Share Posted October 19, 2010 Thanks, I can remember adding in the item constants but for some reason they weren't there ?~? I remember adding them server and client Link to comment Share on other sites More sharing options...
DshWinchester Posted October 22, 2010 Share Posted October 22, 2010 @-sigh-:> Thanks, I can remember adding in the item constants but for some reason they weren't there ?~? I remember adding them server and clientdid you compiled it or save ? :huh: Link to comment Share on other sites More sharing options...
Sputnak Posted October 22, 2010 Share Posted October 22, 2010 Compile. Link to comment Share on other sites More sharing options...
Azebu Posted December 27, 2010 Share Posted December 27, 2010 any hints what to do in order to make extra place for them? Because after doing that your shield lands on weapon slot (not meaning weapon is worn off). Link to comment Share on other sites More sharing options...
Robin Posted December 27, 2010 Share Posted December 27, 2010 Make sure you add the new stuff to the bottom of the enumeration and make sure it's consistent between server and client. Link to comment Share on other sites More sharing options...
Azebu Posted December 27, 2010 Share Posted December 27, 2010 i mean, to see them in Character section in-game. It is working very well at Items Editor menu Link to comment Share on other sites More sharing options...
Azebu Posted December 27, 2010 Share Posted December 27, 2010 it looks like that -> Shield Armor Helmet MyItem, but when i check shield tooltip, it shows me sword tool tip. I want to know how to make extra row (or 2) down of first one for extra 4 (or 8) items Link to comment Share on other sites More sharing options...
Robin Posted December 27, 2010 Share Posted December 27, 2010 Change the Equipment position settings in modConstants. Link to comment Share on other sites More sharing options...
Azebu Posted December 27, 2010 Share Posted December 27, 2010 Hmm, how can i put additional rows in there? Because i wish to make it look like thisOOOOOOOOOOOO Link to comment Share on other sites More sharing options...
Robin Posted December 27, 2010 Share Posted December 27, 2010 Set the column size to 4 then change it to 12 equipment slots. Link to comment Share on other sites More sharing options...
Azebu Posted December 27, 2010 Share Posted December 27, 2010 wouldn't it end up making one row with 12 items?Also came up to idea of adding "EqOffsetY As Byte = 10" to source. Is it going to work? Link to comment Share on other sites More sharing options...
VitinhooxD Posted December 27, 2010 Share Posted December 27, 2010 Do what robin said. Link to comment Share on other sites More sharing options...
Robin Posted December 27, 2010 Share Posted December 27, 2010 @Azebu:> wouldn't it end up making one row with 12 items?@Robin:> Set the column size to 4 Link to comment Share on other sites More sharing options...
Azebu Posted December 27, 2010 Share Posted December 27, 2010 Sorry, i misread. Link to comment Share on other sites More sharing options...
Azebu Posted December 28, 2010 Share Posted December 28, 2010 dunno what you mean changing it to 12 item slots.if i make column size 4 i end up with 3 items on same place.I made it myself (BTW, my first code ^^)All Client basedFind in modDD7 and replace```.Top = EqTop``````.Top = EqTop + ((EqOffsetY + 32) * ((i - 1) \ EqColumns))```do the same thing in frmMainGame.At the end find```Public Const EqOffsetX As Byte = ```and below add```Public Const EqOffsetY As Byte = X```at place of X you enter the distance.BTW, Robin, what about adding Boots, Gloves, Ring and whateva slots in EO 1.2.1? Link to comment Share on other sites More sharing options...
BlazingShadow Posted December 28, 2010 Share Posted December 28, 2010 Hey How would I make it like this?O OO OO X OO OO OO=Inv slotX=Preview of characterOr maybe without the preview if it can't be done/is too complicated.But definitely with the gap in the middle, maybe character stats there.I'll make a new thread if necessary. Link to comment Share on other sites More sharing options...
Azebu Posted December 28, 2010 Share Posted December 28, 2010 Check my post up, select column size 2, and just make X and Y variables to fit. Link to comment Share on other sites More sharing options...
Azebu Posted December 28, 2010 Share Posted December 28, 2010 question, - i found 1.2.0, but i can't find 'for the stats and everything under it what is supposed to be here. Where it is managed to be? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now