Any suggestions?
How to stop item vanishing with last charge?
#1
Posté 06 décembre 2010 - 09:00
Any suggestions?
#2
Posté 06 décembre 2010 - 09:49
One
Make it to where the Item cam not be destroyed using the SetIsDestroyable function
// Set the destroyable status of the caller.
// - bDestroyable: If this is FALSE, the caller does not fade out on death, but
// sticks around as a corpse.
// - bRaiseable: If this is TRUE, the caller can be raised via resurrection.
// - bSelectableWhenDead: If this is TRUE, the caller is selectable after death.
void SetIsDestroyable(int bDestroyable, int bRaiseable=TRUE, int bSelectableWhenDead=FALSE)
Two]
Give the Item an Odd number of charges that will never be able to reduce the iten to 0 charges.
Ex.
Have the item use 2 charges per use and have 11 charges.
that way after the item is used 5 times it still have one charge but can not be used again.
EDIT: Option 2 is better then option 1. Even if the item is not destroyed after using SetIsDestroyable(FALSE); on it. You will find that other things will arise that will have to be dealt with after the item drops to 0 charges.
Modifié par Lightfoot8, 06 décembre 2010 - 09:54 .
#3
Posté 07 décembre 2010 - 01:18
#4
Posté 07 décembre 2010 - 01:42
#5
Posté 07 décembre 2010 - 02:47
#6
Posté 07 décembre 2010 - 03:31
... And I have a weirder story as to what was typing on my keyboard...
#7
Posté 07 décembre 2010 - 05:08
#8
Posté 08 décembre 2010 - 01:50
Lightfoot8 wrote...
There are two ways to go about it.
One
Make it to where the Item cam not be destroyed using the SetIsDestroyable function// Set the destroyable status of the caller.
// - bDestroyable: If this is FALSE, the caller does not fade out on death, but
// sticks around as a corpse.
// - bRaiseable: If this is TRUE, the caller can be raised via resurrection.
// - bSelectableWhenDead: If this is TRUE, the caller is selectable after death.
void SetIsDestroyable(int bDestroyable, int bRaiseable=TRUE, int bSelectableWhenDead=FALSE)
Two]
Give the Item an Odd number of charges that will never be able to reduce the iten to 0 charges.
Ex.
Have the item use 2 charges per use and have 11 charges.
that way after the item is used 5 times it still have one charge but can not be used again.
EDIT: Option 2 is better then option 1. Even if the item is not destroyed after using SetIsDestroyable(FALSE); on it. You will find that other things will arise that will have to be dealt with after the item drops to 0 charges.
Due to my inquisitive nature, could you illuminate the possibly bad side effects of setting the destroyable int?
Edit: I don't really do much. I just ask a bunch of questions and the community usually supplies the answers, but thanks Tyn you rock man.
Modifié par Baragg, 08 décembre 2010 - 01:51 .
#9
Posté 08 décembre 2010 - 09:32
Once an item uses its last charge it it gets marked as not having charges. When you try to add charges back to the item using SetItemCharges It simply does nothing. In order to fix this and allow the item to charge again you have to add a new item property to the Item and remove the old one. It can get a little tricky because some of the functions run while the script is running (Like SetCharges) while other run after the script finishes(RemoveItemProptery). So just about every function needs to be delayed untill after the script inorder to happen in the right order.
Edit: lol , Well I think you answered the question form the OP here. I think it was from one of your posts that I originaly read the idea to give the item an odd number of charges.
EDIT2: OOps it was WhiZard's post.
http://nwn.bioware.c...721678&forum=46
Modifié par Lightfoot8, 08 décembre 2010 - 10:20 .





Retour en haut






