Page 1 of 1

equipment permissions

Posted: 22 Dec 2012, 00:07
by o11c
I just noticed that the new script function "RequireStat" sometimes calls unequipbyid during an equip script.

This does NOT work - it leads to doubled bonuses and/or corruption.

Instead, schedule a timer with a delay of 0 that removes the item. If you first check that no such timer is already scheduled, it will DTRT if the player somehow has multiple restricted items equipped.

(also, it would be better to pass the bStr directly instead of passing a string)

Re: equipment permissions

Posted: 22 Dec 2012, 01:46
by v0id
This does NOT work - it leads to doubled bonuses and/or corruption
you can spot a doubled bonuses which is only temporary (in fact, it appears between 2 iterations of a loop).
So far I can say this works.
Instead, schedule a timer with a delay of 0 that removes the item. If you first check that no such timer is already scheduled, it will DTRT if the player somehow has multiple restricted items equipped.
There are various timers available. And not everything works in equip scripts. Need detail.
Otherwise I CWLK.

Re: equipment permissions

Posted: 22 Dec 2012, 01:56
by o11c
v0id wrote: There are various timers available. And not everything works in equip scripts. Need detail.
Otherwise I CWLK.
CWLK = ?

I mean player-attached timers - in this case addtimer(). (areatimer is the other way of attaching a timer to a player)

(the only other timers are NPC timers - initnpctimer and family)