I'm not really familiar with jass/vjass events and just in general, what' i'm trying to do is when an item is equipped with The_Witcher's equipment system it then triggers a bag system by IcemanBo to add a bag. It then works in reverse with unequipping. The code is all very simple really I just don't know exactly how to combine the two (mostly the event from the equipment system).
Instructions per The_Witcher
Add code from the bag system (conveniently almost jass anyway i guess haha) I don't actually need the text display, seems like only the AddBag line is needed if there will only ever be a max of 1 bag?
the itemID i'm using for the trigger is the bag I think so: I000
the unit will be: udg_Survivors[player number of triggering player]
so what I need help with is the trigger event in jass for when itemid I000 is equipped as per functionRegisterItemEquipEvent to also run the code from IcemanBo. I could probably do the unequip myself as I figure it's almost identical.
Thanks in advance for any guidance!
Instructions per The_Witcher
Code:
--------- 4) Trigger Events (4 ---------
function RegisterItemEquipEvent takes code func returns nothing
function RegisterItemUnequipEvent takes code func returns nothing
//use GetTriggeringItemId and GetEquippingUnit to get the involved units
Add code from the bag system (conveniently almost jass anyway i guess haha) I don't actually need the text display, seems like only the AddBag line is needed if there will only ever be a max of 1 bag?
Code:
Custom script: local integer i = GetBags(udg_u)
Custom script: call AddBag(udg_u, 1)
Custom script: if GetBags(udg_u) == i then
Custom script: call DisplayTextToForce( GetPlayersAll(), ( "max bags: " + I2S(GetBags(udg_u)) ) )
Custom script: else
Custom script: call DisplayTextToForce( GetPlayersAll(), ( "bags: " + I2S(GetBags(udg_u)) ) )
Custom script: endif
the itemID i'm using for the trigger is the bag I think so: I000
the unit will be: udg_Survivors[player number of triggering player]
so what I need help with is the trigger event in jass for when itemid I000 is equipped as per functionRegisterItemEquipEvent to also run the code from IcemanBo. I could probably do the unequip myself as I figure it's almost identical.
Thanks in advance for any guidance!