Not logged inOpenClonk Forum
Up Topic Basic functionality for switches

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to Marky
There was once an idea to create a basic functionality for switches, but I couldn't find the thread anymore, so I created a new one. Anyway, currently there are some switch implementations (normal switch, floor switch, keypad) and they both use different callbacks. Additionally, all of them implement their custom logic for opening/closing doors. Add custom packs, such as Hazard, and you have even more custom switches with their own logic and callbacks - however, I want to get rid of that and provide an interface for switches and switch targets, so that switch puzzles (or production lines, or whatever) can be created easily.

A lot of good concepts are in the current code already, such as evaluating the actions that can be assigned in editor mode. What I still have problems with:
* The easiest implementation is a switch that has two states, as most switches currently have. Still, I can see cases where you'd have 3 or 4 states, or an arbitrary number. Should the implementation be able to handle this, or not?
* What about the door stuff? I'd like to handle opening and closing doors the same way as interacting with any other switch target. However, the use action is currently executed in addition to opening/closing a door. A possible solution to this is allow multiple targets and actions for each state (such as: right position => open door to treasure, sound alarm; left position: close door to treasure; separate object: button for deactivating alarm).

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill