Implementing logical puzzles for Stendhal: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Hendrik Brummermann
Created page with "{{Stendhal code design}}{{Navigation for Stendhal Top|Developing}}__NOTOC__ This page describes a concept for implementing logical puzzles in Stendhal. {{Future Concept}} =..."
imported>Hendrik Brummermann
No edit summary
Line 33: Line 33:


=== Door ===
=== Door ===

A door is a barrier that prevents player from crossing unless it is ''active''.

=== Moveable block ===

=== Moveable block receiver ===

=== Timer ===

; time :
: datatype: integer
: required
: The number of seconds until an action occurs.

; target :
: datatype: entity reference
: required
: The target entity to modify

; propname :
: datatype: string
: required
: The name of the property of the target entity that will be changed

; propvalue :
: datatype: string
: required
: The new value of the property of the target entity

== Backend implementation ==

* Although most puzzles will be confined to one zone each, the backend must support multi zone puzzles.
* Entity references default to entities in the same zone, unless an optional zone name was specified.
* Event bus or listeners
* Events are fired on change of a property (setting a property to the value, which it already had, must not fire an event)
* Limit number of nested events to prevent infinite loops