beginner flow control question
Hello everyone,
I have a beginner's question on flow control that I couldn't find an answer to with forum topic search. My script involves the MainView navigating a maze. There are "setup" hotspots in various locations which set up other "trial" hotspots, which are the ones in which we are interested. The hotspots are working great, but when the MainView reaches the trial hotspot, I would like to do the following: 1. Move the MainView to a specific location 2. Present the user with a text choice 3. Halt all script and inputs until the user presses one of two keys 4. Move the MainView to one of two destinations depending on the keypress Number 3 is the one I'm having trouble with. I would like to make it such that until the user presses one of two keys, the only action that can be taken is that the MainView can pivot. I would like to make it so that the MainView cannot move through inputs, and that the this condition will last until one of two keys are pressed. I'm familiar with events but don't see how I can "shut down" the Vizard environment until the appropriate keyevent fires. Any help is greatly appreciated! Jason |
I'm not sure what you mean by "shutting down the Vizard environment".
In general though, it sounds like you should be using the viztask module. The documentation describes how to use tasks, and they are ideal for controlling the flow of a script in stages. You would probably implement each stage as a subtask and have a high-level main task that simply runs each stage consecutively. Let me know if you have more specific questions. |
More specific flow control questions
Thanks for the reply. I had looked at tasks initially, but got a little lost in their implementation. After your suggestion that they are the appropriate way to proceed, I took a closer look.
I integrated my task into a hot spot event. When a particular hot spot is entered it executes a hot spot event handler, which schedules the desired task: Code:
# define the hotspot events Can you describe how I might prevent that navigation? Let me know if this question isn't specific enough and I'll try again. Thanks, Jason |
How are you moving around? If you are using the mouse you could just disable mouse navigation.
Code:
viz.mouse(viz.OFF) |
Ah! That sounds so simple. I am indeed using a mouse while in debug mode. In the actual trials there will be a visor and motion capture, but I'll tackle the code to disable that in the future.
Thanks! |
All times are GMT -7. The time now is 01:18 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC