Schyy
New Member
- Reaction score
- 5
hi guys,
i have a very big problem using Toadcops BX-TRSII Inventory System
would be very nice if someone know this system and could help me please
if there is someone who dont know the system but wanna set what it is and how it works
here is the link to the system:
http://www.wc3campaigns.net/showthread.php?t=91163
so here are the facts:
I imported the Inventory system to my map and everything worked fine
but there are some reasons i have to change the system
1. i need a diffrent style of the system but this was no problem and now i have the style i want (works fine)
2. i need a save/load system to save the equipped items in the TRSII (but this is not my problem at the moment i will go for the save/load a little later)
3. (and this is my problem at the moment) i need some items (like mana or heal potions, questitems, scrolls and so on)that could be picked up by the user and go into the normal 6 slot hero inventory of wc3 (for better and faster use in fight ofc)
so i searched the forums and found a very nice code that check the itemsclass wich go into the TRSII via a boolean
ok so i put the code into my map and i couldnt trust my eyes it worked
the items go were i want them to go (so the normal equipment items go into the TRSII Inventory and the usable items go into the normal inventory
i was very happy to see this and tryed to use an item in my normal inventory and kaboom "wc3 crit error"
i tryed again and again ... i can equip the items in the TRSII and they work fine... so TRSII works very well but only if i use an item in the normal 6 slot inventory of warcraft it will crash
so here are all the changes i made at the main code of TRSII:
so i changed the gridcreate function in TRSInv to get my own style if the inventory
TRSInv
then i added the boolean in the EquipItem code
EquipItem
and the opposite in the UnequipItem code
UnequipItem
i didnt changed anything else at the core or something
so these are all changes so far but it must be a reason of the Equip and Unequip code that i added because i tryed to change only the Equip and Unequip code in the DemoMap of TRSII and it also crashes...
so ...
is there anybody out there who could help me ?
ofc i will give Rep for this ! xD
Thanks & regards
Schyy
i have a very big problem using Toadcops BX-TRSII Inventory System
would be very nice if someone know this system and could help me please
if there is someone who dont know the system but wanna set what it is and how it works
here is the link to the system:
http://www.wc3campaigns.net/showthread.php?t=91163
so here are the facts:
I imported the Inventory system to my map and everything worked fine
but there are some reasons i have to change the system
1. i need a diffrent style of the system but this was no problem and now i have the style i want (works fine)
2. i need a save/load system to save the equipped items in the TRSII (but this is not my problem at the moment i will go for the save/load a little later)
3. (and this is my problem at the moment) i need some items (like mana or heal potions, questitems, scrolls and so on)that could be picked up by the user and go into the normal 6 slot hero inventory of wc3 (for better and faster use in fight ofc)
so i searched the forums and found a very nice code that check the itemsclass wich go into the TRSII via a boolean
ok so i put the code into my map and i couldnt trust my eyes it worked
the items go were i want them to go (so the normal equipment items go into the TRSII Inventory and the usable items go into the normal inventory
i was very happy to see this and tryed to use an item in my normal inventory and kaboom "wc3 crit error"
i tryed again and again ... i can equip the items in the TRSII and they work fine... so TRSII works very well but only if i use an item in the normal 6 slot inventory of warcraft it will crash
so here are all the changes i made at the main code of TRSII:
so i changed the gridcreate function in TRSInv to get my own style if the inventory
TRSInv
JASS:
function CreateGridExec takes nothing returns nothing
local real x=TRSGridX()
local real y=TRSGridY()
local integer i=eax
local real xstep=TRSXstep()
set InvPlayerX<i>=x+(i*xstep)
set InvPlayerY<i>=y+2
call CreateGridBR(i,null,x+(i*xstep),y,6,7,0,"inv","TRS\\TRSINVtrk.mdx",TRSInvSetup_INVINVSlotIcon(),-15.5,8.90,TRSInvSetup_IconSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null)
// Right Side
call CreateGridBR(i,"right",x+(i*xstep),y,1,1,1,"helm","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVHelmSlotIcon(),-18.4,8.55,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Helm
call CreateGridBR(i,"right",x+(i*xstep),y,1,1,2,"shoulder","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVShoulderLeftSlotIcon(),-18.4,5.883,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Shoulder
//call CreateGridBR(i,"right",x+(i*xstep),y,1,1,3,"weapon","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVWeaponSlotIcon(),-18.4,3.216,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),Condition(function INVCustomReqWeaponSlot)) // Weapon
call CreateGridBR(i,"right",x+(i*xstep),y,1,1,3,"armor","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVArmorSlotIcon(),-18.4,3.216,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Armor
call CreateGridBR(i,"right",x+(i*xstep),y,1,1,4,"belt","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVBeltSlotIcon(),-18.4,0.549,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Belt
call CreateGridBR(i,"right",x+(i*xstep),y,1,1,5,"pants","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVPantsSlotIcon(),-18.4,-2.118,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Pants
// Ring
call CreateGridBR(i,"right",x+(i*xstep),y,1,1,6,"ring","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVRingRightSlotIcon(),-18.4,-4.785,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Ring
call CreateGridBR(i,"right",x+(i*xstep),y,1,1,7,"ring","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVRingRightSlotIcon(),-15.7,-4.785,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Ring
// Left Side
call CreateGridBR(i,"left",x+(i*xstep),y,1,1,8,"amulet","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVAmuletSlotIcon(),-4.75,8.55,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Amulet
call CreateGridBR(i,"left",x+(i*xstep),y,1,1,9,"shoulder","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVShoulderRightSlotIcon(),-4.75,5.883,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Shoulder
//call CreateGridBR(i,"left",x+(i*xstep),y,1,1,10,"shield","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVShieldSlotIcon(),-4.75,3.216,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),Condition(function INVCustomReqWeaponSlot)) // Shield
call CreateGridBR(i,"left",x+(i*xstep),y,1,1,10,"gloves","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVGlovesSlotIcon(),-4.75,3.216,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Gloves
call CreateGridBR(i,"left",x+(i*xstep),y,1,1,11,"bracers","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVBracersSlotIcon(),-4.75,0.549,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Bracers
call CreateGridBR(i,"left",x+(i*xstep),y,1,1,12,"boots","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVBootsSlotIcon(),-4.75,-2.118,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Boots
// Ring
call CreateGridBR(i,"left",x+(i*xstep),y,1,1,13,"ring","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVRingLeftSlotIcon(),-4.75,-4.785,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Ring
call CreateGridBR(i,"left",x+(i*xstep),y,1,1,14,"ring","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVRingLeftSlotIcon(),-7.455,-4.785,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Ring
set InvMinChargedSlot<i>=17
set InvMaxChargedSlot<i>=18
// Charms
call CreateGridBR(i,"UseSlot1",x+(i*xstep),y,1,1,17,"charged","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVCharged2SlotIcon(),-7.455,-6.785,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Charged
call CreateGridBR(i,"UseSlot2",x+(i*xstep),y,1,1,18,"charged","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVCharged1SlotIcon(),-15.7,-6.785,TRSInvSetup_IconEquipmentSizeAspect(),0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Charged
//Weapons
call CreateGridBR(i,"right",x+(i*xstep),y,1,1,15,"weapon","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVWeaponSlotIcon(),-13.355,-5,TRSInvSetup_IconEquipmentSizeAspect()+0.05,0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),Condition(function INVCustomReqWeaponSlot)) // Weapon
call CreateGridBR(i,"left",x+(i*xstep),y,1,1,16,"shield","TRS\\TRSINVtrkEx.mdx",TRSInvSetup_INVShieldSlotIcon(),-10.36,-5,TRSInvSetup_IconEquipmentSizeAspect()+0.05,0,0,function Track,function Hit,Condition(function TRSTrue),Condition(function TRSTrue),Condition(function INVCustomReqWeaponSlot)) // Shield
// Merchant
call CreateGridBR(i,null,x+(i*xstep),y,8,4,0,"merchant","TRS\\TRSINVtrk.mdx",TRSInvSetup_INVINVSlotIcon(),0.5,0.5,TRSInvSetup_IconSizeAspect(),0,0,function TrackMerch,function HitMerch,Condition(function TRSTrue),Condition(function TRSTrue),null)
// Background
call CreateGridBR(i,null,x+(i*xstep),y,1,1,0,"background","TRS\\TRSINVtrkBack.mdx",0,0,0,0,0,0,function Track,function Track,Condition(function TRSTrue),Condition(function TRSTrue),null)
// command buttons
// call CreateGridBR(i,null,x+(i*xstep),y,1,1,0,"pagedown","TRS\\TRSINVtrk0x1.mdx",TRSInvSetup_PageListDownDis(),-5.5,-9.8,TRSInvSetup_PageListSize(),0,0,function Track,function INVPageDown,Condition(function TRSTrue),Condition(function TRSTrue),null) // Page Down
// call CreateGridBR(i,null,x+(i*xstep),y,1,1,0,"pageup","TRS\\TRSINVtrk0x1.mdx",TRSInvSetup_PageListUpDis(),-5.5,10.6,TRSInvSetup_PageListSize(),0,0,function Track,function INVPageUp,Condition(function TRSTrue),Condition(function TRSTrue),null) // Page Up
// call CreateGridBR(i,null,x+(i*xstep),y,1,1,0,"pagedownmerch","TRS\\TRSINVtrk0x1.mdx",TRSInvSetup_PageListDownDis(),15.73,-3.95,TRSInvSetup_PageListSize(),0,0,function Track,function INVPageDownMerch,Condition(function TRSInvIsByMerchant),Condition(function TRSInvIsByMerchant),null) // Page Down merchant
// call CreateGridBR(i,null,x+(i*xstep),y,1,1,0,"pageupmerch","TRS\\TRSINVtrk0x1.mdx",TRSInvSetup_PageListUpDis(),15.73,6.95,TRSInvSetup_PageListSize(),0,0,function Track,function INVPageUpMerch,Condition(function TRSInvIsByMerchant),Condition(function TRSInvIsByMerchant),null) // Page Up merchant
call CreateGridBR(i,null,x+(i*xstep),y,1,1,0,"sellitem","TRS\\TRSINVtrk.mdx",TRSInvSetup_INVSellItem(),-1.25,-1.25,TRSInvSetup_INVSellItemButtonSize(),0,0,function Track,function MerchantSellItemBR,Condition(function TRSInvIsByMerchant),Condition(function TRSInvIsByMerchant),null) // Exit
call CreateGridBR(i,null,x+(i*xstep),y,1,1,0,"buyitem","TRS\\TRSINVtrk.mdx",TRSInvSetup_INVBuyItem(),-1.25,-3.5,TRSInvSetup_INVBuyItemButtonSize(),0,0,function Track,function MerchantBuyItemBR,Condition(function TRSInvIsByMerchant),Condition(function TRSInvIsByMerchant),null) // Exit
call CreateGridBR(i,null,x+(i*xstep),y,1,1,0,"exit","TRS\\TRSINVtrk.mdx",TRSInvSetup_INVCancelButton(),-6.5,-8.0,TRSInvSetup_INVCancelButtonSize(),0,0,function Track,function INVButtonExit,Condition(function TRSTrue),Condition(function TRSTrue),null) // Exit
call CreateGridBR(i,null,x+(i*xstep),y,1,1,0,"drop","TRS\\TRSINVtrk.mdx",TRSInvSetup_INVDropButton(),-4,-8.0,TRSInvSetup_INVDropButtonSize(),0,0,function Track,function INVDropItem,Condition(function TRSTrue),Condition(function TRSTrue),null) // Drop Item
call StoreInteger(TRSInv,"PlayerInv"+I2S(i),"Size",42)
call StoreInteger(TRSInv,"PlayerInv"+I2S(i),"MerchantSize",32)
call StoreInteger(TRSInv,"PlayerInv"+I2S(i),"ExtraSlots",16)
endfunction</i></i></i></i>
then i added the boolean in the EquipItem code
EquipItem
JASS:
function EquipItemCondition takes nothing returns boolean
return not ebx32
endfunction
function EquipItemAct takes nothing returns nothing
local boolean equiped=false
local boolean ex=GetUnitAbilityLevel(GetManipulatingUnit(),TRSExInvId())>0
if (GetItemType(GetManipulatedItem()) == ITEM_TYPE_CAMPAIGN) then
call TRSGetInvBR(GetManipulatingUnit())
if GetItemUserData(GetManipulatedItem())==0 then
call SetItemUserData(GetManipulatedItem(),GetCustomItemID())
endif
call PreGenerateParBR(I2S(GetItemTypeId(GetManipulatedItem())),I2S(GetItemUserData(GetManipulatedItem())))
if GetStoredString(TRSItems,I2S(GetItemTypeId(GetManipulatedItem())),"type")=="charm" and ex then
call EquipItemBR(GetManipulatingUnit(),I2S(GetItemTypeId(GetManipulatedItem())),I2S(GetItemUserData(GetManipulatedItem())),true)
endif
if not ex then
set equiped=AddItemToCusInvBR(GetManipulatingUnit(),I2S(GetItemUserData(GetManipulatedItem())))
if equiped==false then
call UnitRemoveItem(GetManipulatingUnit(),GetManipulatedItem())
else
call RemoveItem(GetManipulatedItem())
endif
endif
endif
endfunction
//===========================================================================
function InitTrig_EquipItem takes nothing returns nothing
set gg_trg_EquipItem = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_EquipItem,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddAction(gg_trg_EquipItem,function EquipItemAct)
call TriggerAddCondition(gg_trg_EquipItem,Condition(function EquipItemCondition))
endfunction
and the opposite in the UnequipItem code
UnequipItem
JASS:
function UnequipItemAct takes nothing returns nothing
if (GetItemType(GetManipulatedItem()) != ITEM_TYPE_CAMPAIGN) then
return
endif
if GetUnitAbilityLevel(GetTriggerUnit(),TRSExInvId())>0 then
call UnequipItemBR(GetTriggerUnit(),I2S(GetItemTypeId(GetManipulatedItem())),I2S(GetItemUserData(GetManipulatedItem())),true)
endif
endfunction
//===========================================================================
function InitTrig_UnequipItem takes nothing returns nothing
set gg_trg_UnequipItem = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_UnequipItem,EVENT_PLAYER_UNIT_DROP_ITEM)
call TriggerAddAction(gg_trg_UnequipItem,function UnequipItemAct)
endfunction
i didnt changed anything else at the core or something
so these are all changes so far but it must be a reason of the Equip and Unequip code that i added because i tryed to change only the Equip and Unequip code in the DemoMap of TRSII and it also crashes...
so ...
is there anybody out there who could help me ?
ofc i will give Rep for this ! xD
Thanks & regards
Schyy