hi evry1, i am learning jass and THERE IS a trigger i found usefull : but i dont understand it a all : this trigger is suposed to work like this : a unit is allowed to wear ONLY 1 ITEM of id "I01X" if he pick up the item the item stay on ground...... glitch : but if he drop the ticket he have HE cannot retake same ticket or another 1. so i would like to understand the function well and fix the glitch also ^^
can some1 explain me this trigger because i don't understand those 2 function UnituserData & removeitemswapped ? what is so different from removeitem ?
and how can i fix the glitch i explain "uper"
i had no reason to understand the trigger until i found the glitch ....XD
some1 can help me ? + rep for all helper
p.s. i got jngp is there any book or guide i can download to explain me how tu use jass native function ?there is so much function.... and there some of them that i don't even know what they do......XD
sorry for my bad english.... trying to fix
edit : i dont know what userunitdata mean but i have made a trigger : when he drop set user data to 0
but i still want to know if there is a guide book function for jass O_O
can some1 explain me this trigger because i don't understand those 2 function UnituserData & removeitemswapped ? what is so different from removeitem ?
and how can i fix the glitch i explain "uper"
i had no reason to understand the trigger until i found the glitch ....XD
some1 can help me ? + rep for all helper
p.s. i got jngp is there any book or guide i can download to explain me how tu use jass native function ?there is so much function.... and there some of them that i don't even know what they do......XD
sorry for my bad english.... trying to fix
JASS:
function Trig_One_Ticket_Only_Func003C takes nothing returns boolean
return((GetOwningPlayer(GetManipulatingUnit())==Player(0)))or((GetOwningPlayer(GetManipulatingUnit())==Player(1)))or((GetOwningPlayer(GetManipulatingUnit())==Player(2)))or((GetOwningPlayer(GetManipulatingUnit())==Player(3)))or((GetOwningPlayer(GetManipulatingUnit())==Player(5)))or((GetOwningPlayer(GetManipulatingUnit())==Player(6)))
endfunction
function Trig_One_Ticket_Only_Conditions takes nothing returns boolean
return((GetItemTypeId(GetManipulatedItem())=='I01X'))and(Trig_One_Ticket_Only_Func003C())
endfunction
function Trig_One_Ticket_Only_Func001C takes nothing returns boolean
return((GetUnitUserData(GetManipulatingUnit())==1))
endfunction
function Trig_One_Ticket_Only_Actions takes nothing returns nothing
if(Trig_One_Ticket_Only_Func001C())then
call UnitRemoveItemSwapped(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),'I01X'),GetManipulatingUnit())
else
call SetUnitUserData(GetManipulatingUnit(),1)
endif
endfunction
set udg_trigger11=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(udg_trigger11,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(udg_trigger11,Condition(function Trig_One_Ticket_Only_Conditions))
call TriggerAddAction(udg_trigger11,function Trig_One_Ticket_Only_Actions)
edit : i dont know what userunitdata mean but i have made a trigger : when he drop set user data to 0
Last edited: