Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005389opensim[REGION] Scripting Enginepublic2011-02-16 20:482019-02-11 06:07
Assigned Totampa 
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Versionmaster (dev code) 
Target VersionFixed in Version 
Summary0005389: state default state_entry() method not driven after llResetScript
DescriptionThe state_entry method is supposed to be driven after llResetScript. In the attached script, which changes state before invoking llResetScript, it isn't.

Reproduce the problem by adding this script to a prim. Let the script initialize. Take the prim, then rez it again. The prim will be in the default state, but the state_entry method has not been run. Touch the prim. The default state touch method is invoked.

The default_state method displays a message when it is invoked. This does not occur in the script as written.
Additional InformationEven further (accidental) investigation found that the problem is not described precisely. What actually happens when llResetScript is invoked in any state_entry method is that all global variables are reset, but the script continues to operate! The state does change to the default state, but statements following the llResetScript call in the current state_entry are executed as if they were default state state_entry statements. When the state_entry terminates, the script is in the default state. The default state_entry method is not invoked.

It does not matter whether llResetScript is invoked directly or from within a subroutine.
TagsNo tags attached.
Git Revision or version numberOSgrid 0.7.1 (Dev) 2171539: 2011-02-10 git hash : 21715396fa0d87bd4936bd37151487346794806d
Run Mode Grid (Multiple Regions per Sim)
Physics EngineODE
Environment.NET / Windows32
Mono VersionNone
ViewerImprudence 1.3.0
Attached Files? file icon demo.lsl [^] (1,728 bytes) 2011-02-16 20:48

- Relationships

-  Notes
CrasherRob (reporter)
2011-02-17 12:25

Further investigation shows that the problem occurs when llResetScript is invoked inside of any state_entry method. While somewhat surprising, this might actually avoid more problems than it creates.

The result I intended can easily be achieved by adding a llSetTimerEvent in the state_entry method and moving the llResetScript to the timer method. The default state_entry method is then invoked after the reset. This makes the work-around very trivial.

Since llResetScript in the default state_entry method would normally result in a resource-consuming loop, the better way for fixing the problem is probably via documentation rather than code. I'm changing the priority to none since this mantis itself now more precisely documents how llResetScript works, to wit:

The default state_entry method is not invoked after the reset if llResetScript is invoked inside of a state_entry method. A trivial work-around is described above.

- Issue History
Date Modified Username Field Change
2011-02-16 20:48 CrasherRob New Issue
2011-02-16 20:48 CrasherRob File Added: demo.lsl
2011-02-16 20:48 CrasherRob Git Revision => OSgrid 0.7.1 (Dev) 2171539: 2011-02-10 git hash : 21715396fa0d87bd4936bd37151487346794806d
2011-02-16 20:48 CrasherRob SVN Revision => 0
2011-02-16 20:48 CrasherRob Run Mode => Grid (Multiple Regions per Sim)
2011-02-16 20:48 CrasherRob Physics Engine => ODE
2011-02-16 20:48 CrasherRob Environment => .NET / Windows32
2011-02-16 20:48 CrasherRob Mono Version => None
2011-02-16 20:48 CrasherRob Viewer => Imprudence 1.3.0
2011-02-17 12:25 CrasherRob Note Added: 0018082
2011-02-17 12:25 CrasherRob Priority normal => none
2011-04-10 12:14 CrasherRob Additional Information Updated
2019-02-10 19:09 tampa Status new => resolved
2019-02-10 19:09 tampa Resolution open => no change required
2019-02-10 19:09 tampa Assigned To => tampa
2019-02-11 06:07 BillBlight Status resolved => closed

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker