Prof. Monster's Switcher

Hi,

Here is a new GameLogic that is laying around on my disc for quite a while. As there was a request for such thing, I removed the dust, polished it and now it is here.


Models are from the contributors of AddAThing - OutdoorItems.
[INDENT]The Switcher
[/INDENT]Runs on 2.49 and 2.5x.

What is it good for?

Quite simple: The switcher switches through a list of objects.

Setup:

E.g. you want to switch through multiple cameras

  • Apply some logic when to switch (e.g. Keyboard sensors),
  • trigger the switchers methods which set up and activate
  • a Scene Actuator in “Set Camera” mode.


You can activate multiple actutators.
You can activate multiple actuators on multiple objects.
It switches from the currently set acutaors parameter.

The objects to switch through can be tagged with a property e.g. “camera”. This name must be the value of property “property” at the switcher object.

Please have a look at the Demo file for the Python code and multiple examples. I hope it is not to confusing. Check the AAREADME how to run the demo, see the in-game text for more.

Tested actuators are:

  • Camera actuator
  • Scene actuator “Set Scene”
  • Parent actuator “Set Parent”
  • TrackTo actuator

Example in detail:

Switcher object

Properties:
string property “property” value: “camera”
Logic Bricks:

Keyboard “Q” -> Python Module “Switch.next” -> Scene Actuator “Set Camera”
Keyboard “A” -> Python Module “Switch.prev” -> the same actuator

Cameras to be switched to

Properties:
“camera” - type and value do not matter

I hope you can use it.
I know the Demo file looks a bit complicated. If you need help … ask :slight_smile:

Monster

Attachments

SwitcherDemo_.blend (922 KB)

Very nice work, this would be great for options scenes that switch display and camera switching in animated sequences in a game, plenty of tips and tricks though out the file (water works well too btw).

Just to mke it clear, the models are not mine they are from the AddAThing challenge.

The commendation goes to Josip Kladaric for his Island.

Thank you Monster, a most excellent contribution I will be able to earn alot from this. Downloaded and saved.:slight_smile: