Difference between revisions of "Debugging"
m
"getdistance player >0" CHANGED TO "getdistance player > 0"
imported>Dev akm |
imported>P.lo m ("getdistance player >0" CHANGED TO "getdistance player > 0") |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__TOC__When something just isn't working right, look here for possible causes and ways to track down the bug. | |||
== Comma Instead of Period == | == Comma Instead of Period == | ||
Line 41: | Line 39: | ||
When called in a scripteffect spell, the statement sometimes evaluates true for the player. The easiest solution is to add another condition to double-check it, such as: | When called in a scripteffect spell, the statement sometimes evaluates true for the player. The easiest solution is to add another condition to double-check it, such as: | ||
getdistance player >0 | getdistance player > 0 | ||
However, [[getDistance]] is unreliable if the player is swimming. | However, [[getDistance]] is unreliable if the player is swimming. | ||
Line 49: | Line 47: | ||
set refVar to getSelf | set refVar to getSelf | ||
if ( refVar.getIsReference player == 0 ) | if ( refVar.getIsReference player == 0 ) | ||
== Using PlaceAtMe's referenced item in the same frame == | |||
If you use the referenced item of a PlaceAtMe call in the same frame | |||
<pre>set pItem to (player.PlaceAtMe IronBow 1, 0, 0) | |||
pItem.Activate player ;this adds the bow to the player</pre> | |||
the script on the object may not run. | |||
[[Category:Troubleshooting]] | [[Category:Troubleshooting]] |