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
The first part is finished and can be tested here: https://github.com/gitMarky/openclonk/tree/switches

This is only the internal restructuring: a library for switches and one for mechanisms.
- when implementing a switch you can now call the generic functions DoSwitchOn(), DoSwitchOff() to operate the connected object. Could be replaced by one function with boolean argument if desired.
- focusing player view on the mechanism that is being operated (such as a door) is now handled by the mechanism itself, instead of the switch - so you don't have to code that anymore
- in the editor you can invert the logic of the switch target, for example pressing up on a spin wheel would then close the door instead of opening it. You can also disable auto-focus in the editor.

I'd like to merge this back to the main branch, so it would be great if someone could review the code, and testing is always welcome, of course.

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill