http://etherealsoftware.com.au/ultima/files/TPLGlassStatue.7z
Simply extract to the Data directory, select the mod and go to the Imperial City.
I'm thinking I might release a mod pack of a bunch of statues/items if I get around to making more.
ref.getSoundPlaying "C*" 35That will return true if a collision sound was playing within 35 units from the calling ref.
ref.getSoundPlaying "C*" 35That will return true if a collision sound was playing within 35 units from the calling ref.
scn AATPLGlassStatueSCRIPTfloat xPosfloat yPosfloat zPosfloat xPosOldfloat yPosOldfloat zPosOldfloat xDifffloat yDifffloat zDifffloat fastSpeedfloat slowSpeedshort doOncefloat movingFastTimerref glassRefref myRefbegin OnAdd set doOnce to 1 set xPos to GetPos x set yPos to GetPos y set zPos to GetPos z set xPosOld to xPos set yPosOld to yPos set zPosOld to zPos set myRef to GetSelfendbegin OnDrop set doOnce to 1 set xPos to GetPos x set yPos to GetPos y set zPos to GetPos z set xPosOld to xPos set yPosOld to yPos set zPosOld to zPos set myRef to GetSelfendbegin GameMode if GetDisabled return endif if doOnce == 0 set doOnce to 1 set xPos to GetPos x set yPos to GetPos y set zPos to GetPos z set xPosOld to xPos set yPosOld to yPos set zPosOld to zPos set myRef to GetSelf endif set movingFastTimer to movingFastTimer - GetSecondsPassed set xPos to GetPos x set yPos to GetPos y set zPos to GetPos z if IsControlPressed 28 == 0 set xDiff to xPos - xPosOld set yDiff to yPos - yPosOld set zDiff to zPos - zPosOld if xDiff < 0 set xDiff to 0 - xDiff endif if yDiff < 0 set yDiff to 0 - yDiff endif if zDiff < 0 set zDiff to 0 - zDiff endif set slowSpeed to 1 * GetSecondsPassed if myRef.GetSoundPlaying "CGlass*" 50 if movingFastTimer > 0 set glassRef to PlaceAtMe AATPLGlassStatueBrokenTop 1 glassRef.SetAngle X 50 glassRef.SetAngle Y 45 glassRef.SetAngle Z 143 set glassRef to PlaceAtMe AATPLGlassStatueBrokenBottom 1 0 30 glassRef.SetAngle X 120 glassRef.SetAngle Y 14 glassRef.SetAngle Z -153 Disable endif endif set fastSpeed to 50 * GetSecondsPassed if xDiff > fastSpeed set movingFastTimer to 0.1 endif if yDiff > fastSpeed set movingFastTimer to 0.1 endif if zDiff > fastSpeed set movingFastTimer to 0.1 endif endif set xPosOld to xPos set yPosOld to yPos set zPosOld to zPosend
if GetDisabled return endif... set glassRef to PlaceAtMe AATPLGlassStatueBrokenTop 1... set glassRef to PlaceAtMe AATPLGlassStatueBrokenBottom 1 0 30... DisableBecause he ends with that disable, and starts with if GetDisabled Return, the script will only call PlaceAtMe twice. PlaceAtMe is bad if you're calling it infinitely. Twice is OK. Even a hundred, two hundred times would be ok - as long as it's finite. The problem was when a script would call PlaceAtMe all the time, and often needlessly. Here, Thepal probably does need to use PlaceAtMe to achieve the effect, and it isn't "bloat" - you want the broken halves of the statue to be there!