Difference between revisions of "Common Bugs"
Jump to navigation
Jump to search
→Adding Multiple Items with the Same Script
imported>Dev akm (→Adding Multiple Items with the Same Script: cleanup) |
imported>Dev akm |
||
Line 84: | Line 84: | ||
#to the same container | #to the same container | ||
#at or about the same time. | #at or about the same time. | ||
This seems to happen for several situations: | |||
*You add an item, which in turn adds another item | *You add an item, which in turn adds another item | ||
*An item that runs when the player adds them to a container, or the player takes them from a container | *An item that runs when the player adds them to a container, or the player takes them from a container | ||
**For example, if you have 2 of an item in a container (same base object), and the player double-clicks them, thus adding one after the other, you'll hit this bug | **For example, if you have 2 of an item in a container (same base object), and the player double-clicks them, thus adding one after the other, you'll hit this bug | ||
**But using 'AddItem SomeItem 2' seems to work without hitting the bug | **But using 'AddItem SomeItem 2' seems to work without hitting the bug | ||
*[http://www.bethsoft.com/bgsforums/index.php?s=&showtopic=628331&view=findpost&p=10126100|More examples] | *[http://www.bethsoft.com/bgsforums/index.php?s=&showtopic=628331&view=findpost&p=10126100| More examples]. | ||
What exactly is going is anyone's guess, and the problems that can occur are very, very bizarre making them hard to trace. Also, the bug seems to be intermittent, sometimes working and sometimes not, and some scripts don't seem to run into the problem. The a few points to take away from this: | |||
*Adding two or more items with the same script can produce weird results | *Adding two or more items with the same script can produce weird results | ||
*If you're adding multiple items and getting weird results, put a frame or two between when you add one and when you add the other | *If you're adding multiple items and getting weird results, put a frame or two between when you add one and when you add the other |