Matt Posted May 26, 2012 Author Share Posted May 26, 2012 A massive thank you to Growlith1223 and Soul for helping me :)This tutorial will give you the option to make weapons as a two handed weapons. This will unequip shields if one is worn and unequip two handed weapons if a shield is equipped.This is the updated version.Client side:Go to FrmEditorItem and place a checkbox wherever you want. Name it: ChkTwoh.Double click on it. Paste this:```  ' If debug mode, handle error then exit out  If Options.Debug = 1 Then On Error GoTo errorhandler  If chkTwoh.Value = 0 Then    Item(EditorIndex).istwohander = False  Else    Item(EditorIndex).istwohander = True  End If  ' Error handler  Exit Suberrorhandler:  HandleError "chkTwoh", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext  Err.Clear  Exit Sub```Now we will go to modTypes and at the bottom of```Private Type ItemRec  Name As String * NAME_LENGTH  Desc As String * 255  Sound As String * NAME_LENGTH  Pic As Long  Type As Byte  Data1 As Long  Data2 As Long  Data3 As Long  ClassReq As Long  AccessReq As Long  LevelReq As Long  Mastery As Byte  Price As Long  Add_Stat(1 To Stats.Stat_Count - 1) As Byte  Rarity As Byte  Speed As Long  Handed As Long  BindType As Byte  Stat_Req(1 To Stats.Stat_Count - 1) As Byte  Animation As Long  Paperdoll As Long```we will put there```  istwohander As Boolean```Now we head on over to modGameEditors.Find:```Public Sub ItemEditorInit()```Under```    ' Type specific settings    If (frmEditor_Item.cmbType.ListIndex >= ITEM_TYPE_WEAPON) And (frmEditor_Item.cmbType.ListIndex <= ITEM_TYPE_SHIELD) Then      frmEditor_Item.fraEquipment.Visible = True      frmEditor_Item.scrlDamage.Value = .Data2      frmEditor_Item.cmbTool.ListIndex = .Data3      If .Speed < 100 Then .Speed = 100      frmEditor_Item.scrlSpeed.Value = .Speed```we'll put there```      If Item(EditorIndex).istwohander Then      frmEditor_Item.chkTwoh.Value = 1    Else      frmEditor_Item.chkTwoh.Value = 0    End If```Save and compile.Server:Go to modTypes and at the bottom of```Private Type ItemRec  Name As String * NAME_LENGTH  Desc As String * 255  Sound As String * NAME_LENGTH  Pic As Long  Type As Byte  Data1 As Long  Data2 As Long  Data3 As Long  ClassReq As Long  AccessReq As Long  LevelReq As Long  Mastery As Byte  Price As Long  Add_Stat(1 To Stats.Stat_Count - 1) As Byte  Rarity As Byte  Speed As Long  Handed As Long  BindType As Byte  Stat_Req(1 To Stats.Stat_Count - 1) As Byte  Animation As Long  Paperdoll As Long```we will put there```  istwohander As Boolean```Now we go to ModPlayer```Dim n As Long, i As Long, tempItem As Long, x As Long, y As Long, itemnum As Long```This is the second line of code in that sub. We will add on to that this```, b As Long, j As Long```Right under what we just pasted, put there```  For j = 1 To MAX_INV  Next  b = FindOpenInvSlot(index, j)```find:```Case ITEM_TYPE_WEAPON```in mod player. Right under```' access requirement        If Not GetPlayerAccess(index) >= Item(itemnum).AccessReq Then          PlayerMsg index, "You do not meet the access requirement to equip this item.", BrightRed          Exit Sub        End If```We will put there```If Item(itemnum).istwohander = True Then          If GetPlayerEquipment(index, Shield) > 0 Then            If GetPlayerEquipment(index, Weapon) > 0 Then              If b < 1 Then                Call PlayerMsg(index, "You have no room in your inventory.", BrightRed)                Exit Sub                End If              End If            End If          End If```Scroll further down (still in the case weapon) and find```Call SendWornEquipment(index)        Call SendMapEquipment(index)```Right under that, we will put there```If Item(itemnum).istwohander = True Then        If GetPlayerEquipment(index, Shield) > 0 Then        GiveInvItem index, GetPlayerEquipment(index, Shield), 0        SetPlayerEquipment index, 0, Shield        End If        End If        Call SendWornEquipment(index)        Call SendMapEquipment(index)```now find```Call SendWornEquipment(index)        Call SendMapEquipment(index)```in```Case ITEM_TYPE_SHIELD```Right under that we will put there```If GetPlayerEquipment(index, Weapon) > 0 Then          If Item(GetPlayerEquipment(index, Weapon)).istwohander = True Then        GiveInvItem index, GetPlayerEquipment(index, Weapon), 0        SetPlayerEquipment index, 0, Weapon        End If        End If        Call SendWornEquipment(index)        Call SendMapEquipment(index)```Save, compile, and enjoy. Link to comment Share on other sites More sharing options...
or3o Posted May 26, 2012 Share Posted May 26, 2012 I was trying to figure out how to do this for quite a while! thank you ill tell ya if i find anything i cant figure out. Thanks agian oh and it works perfectly! Link to comment Share on other sites More sharing options...
Matt Posted May 26, 2012 Author Share Posted May 26, 2012 @or3o:> I was trying to figure out how to do this for quite a while! thank you ill tell ya if i find anything i cant figure out. Thanks agianNo problem! Link to comment Share on other sites More sharing options...
Matt Posted May 26, 2012 Author Share Posted May 26, 2012 Just realized i didnt make a check to see if there is free space in the inventory. I'll fix it tomorow when i'm more awake. Link to comment Share on other sites More sharing options...
abhi2011 Posted May 26, 2012 Share Posted May 26, 2012 Nice tut. Wanted to ask if a paperdoll is added will it show? Also isn't a 2H a weapon? So shouldn't cmbType or whatever it's name is, so only if 2h chkbox be visible if the item type is a weapon? Link to comment Share on other sites More sharing options...
tslusny Posted May 26, 2012 Share Posted May 26, 2012 Nice tutorial. Little simple but nice work :cheesy: . And Abhi yes it will show paperdoll. Link to comment Share on other sites More sharing options...
abhi2011 Posted May 26, 2012 Share Posted May 26, 2012 Will it show the character holding the weapon in 2 hands or just one? Link to comment Share on other sites More sharing options...
tslusny Posted May 26, 2012 Share Posted May 26, 2012 this code doing this - if you equip weapon that have value istwohander checked it will unequip equiped shield and equiped weapon and equip that 2handed weapon, thats allits not code for double weapons like if u equip dagger, u will have dagger in left and right hand.U can edit this code to make that if u equip for example dagger it will give that item to weapon slot and to shield slot too and make paperdoll that has dagger in left and right hand Link to comment Share on other sites More sharing options...
tslusny Posted May 26, 2012 Share Posted May 26, 2012 I can make tutorial for it Link to comment Share on other sites More sharing options...
Zetasis Posted May 26, 2012 Share Posted May 26, 2012 @abhi2011:> Will it show the character holding the weapon in 2 hands or just one?If you're using paperdolled items just make two weapons for the paperdolled image. It's that simple. Link to comment Share on other sites More sharing options...
Matt Posted May 26, 2012 Author Share Posted May 26, 2012 @Deathbeam:> I can make tutorial for itWouldn't that double the stats? Link to comment Share on other sites More sharing options...
Matt Posted May 27, 2012 Author Share Posted May 27, 2012 Updated and fixed the tutorial! Hopefully it works! :) Link to comment Share on other sites More sharing options...
abhi2011 Posted May 27, 2012 Share Posted May 27, 2012 Deathbeam, I know that it will auto un-equip shield slot and equip item slot. And I also know it is possible for doing a dagger in two hands. But my question was will the paperdoll appear as the character is holding one hand with the weapon or 2 hands. Well Zetasis answered my question. And Sigridunset double weapons can be made possibile with a certain type of weapon equiped in the weapon slot. That way there is no worry about double points because not all weapons will give this stat. P.S Deathbeam are you Tsulny? Link to comment Share on other sites More sharing options...
tslusny Posted May 27, 2012 Share Posted May 27, 2012 yes im tslusny and im now trying to make if you equip a weapon that have dagger stat it will equip that weapon to weapon slot and if u equip another dagger it will check if weapon slot is free and if not it will unequip shield and equip that dagger on shield slot. Im modifing PlayerUnequipItem sub and UseItem sub. Link to comment Share on other sites More sharing options...
abhi2011 Posted May 27, 2012 Share Posted May 27, 2012 Best of luck. Hoping to see it. Link to comment Share on other sites More sharing options...
Matt Posted May 27, 2012 Author Share Posted May 27, 2012 @Zetasis:> If you're using paperdolled items just make two weapons for the paperdolled image. It's that simple.+ 1 to you. No tutorial is neccesary. Just make the item image two daggers and the paperdoll two daggers. Link to comment Share on other sites More sharing options...
tslusny Posted May 27, 2012 Share Posted May 27, 2012 Ok i maked this (i will add tutorial in few minutes) - if u equip weapon that has dagger attribute checked, it will equip it on weapon slot, and if u have equipped weapon and shield , it will unequip weapon and equip dagger on that slot and if u equip another dagger, it will unequip shield and equip that dagger on shield slot.But i need help with paperdolling. I tried to make this - if dagger is equipped on shield slot, it will change DaggerEq boolean to true ( and i added DaggerEq to ItemRec) and on client side i tried to add scrollbar similar do Paperdoll scrollbar, but it will give atribute Item(EditorIndex).DaggerPaperdoll and i tried to add DaggerPaperdoll as Long attribute to ItemRecon sub BltPaperdoll i tried to add checkIf Item(GetPlayerEquipment(Index, PaperdollOrder(I)))).DaggerEq = True ThenCall BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(I))).DaggerPaperdoll, Anim, SpriteTop)ElseCall BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(I))).Paperdoll, Anim, SpriteTop)But it dont worked Link to comment Share on other sites More sharing options...
Matt Posted May 27, 2012 Author Share Posted May 27, 2012 @Deathbeam:> Ok i maked this (i will add tutorial in few minutes) - if u equip weapon that has dagger attribute checked, it will equip it on weapon slot, and if u have equipped weapon and shield , it will unequip weapon and equip dagger on that slot and if u equip another dagger, it will unequip shield and equip that dagger on shield slot.> > But i need help with paperdolling. I tried to make this - if dagger is equipped on shield slot, it will change DaggerEq boolean to true ( and i added DaggerEq to ItemRec) and on client side i tried to add scrollbar similar do Paperdoll scrollbar, but it will give atribute Item(EditorIndex).DaggerPaperdoll and i tried to add DaggerPaperdoll as Long attribute to ItemRec> > on sub BltPaperdoll i tried to add check> > If Item(GetPlayerEquipment(Index, PaperdollOrder(I)))).DaggerEq = True Then> Call BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(I))).DaggerPaperdoll, Anim, SpriteTop)> Else> Call BltPaperdoll(x, y, Item(GetPlayerEquipment(Index, PaperdollOrder(I))).Paperdoll, Anim, SpriteTop)> > But it dont workedWhy are you posting your progress on a completely different tutorial on my tutorial? Link to comment Share on other sites More sharing options...
tslusny Posted May 27, 2012 Share Posted May 27, 2012 Becouse its not different its almost same and i tried to answer abhi question about double weapon paperdolls Link to comment Share on other sites More sharing options...
SkyStudios Posted May 27, 2012 Share Posted May 27, 2012 i thank u 100 times Link to comment Share on other sites More sharing options...
Matt Posted May 27, 2012 Author Share Posted May 27, 2012 @skystudios:> i thank u 100 timesNo problem! Let me know if you find any problems! Link to comment Share on other sites More sharing options...
or3o Posted May 27, 2012 Share Posted May 27, 2012 Ive been testing this for a little while now and just wanted to tell ya i havent figured out any problems yet. Link to comment Share on other sites More sharing options...
Fuyuumi Posted January 15, 2013 Share Posted January 15, 2013 Does this code work with EO 2.3? I just want to be 100% sure, so I'm not typing some code that won't work (I know a bit of Java and C++) Link to comment Share on other sites More sharing options...
Matt Posted January 15, 2013 Author Share Posted January 15, 2013 90% sure it works with 2.3. Link to comment Share on other sites More sharing options...
Fuyuumi Posted January 17, 2013 Share Posted January 17, 2013 > 90% sure it works with 2.3.It works like charm. Thank you! 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