Copyright VirtualSim 2004-2020 - All rights reserved
Detect and Fire
Let's create a basic task which will use the line of sight capability of the VBS-IG so that to automatically aim and fire at target whenever this one is visible from the tank.
For that we will open the Tank Logic and add some objects for this new behavior.
In the Tank Logic, let's add a new Task (right-click on the logic background):
Detect
Let's rename it: detection.
Then let's add one Entry Point and one Exit Point. Click on the green needle then click on the Task to add the EPoint then click on the red needle then click on the Task to add the XPoint.
Now, double-click each of them and add the b_B event as the reaction. This event is triggered by the gamepad when the B (red) button if depressed.
Do not forget the make the EPoint persistent so that to reactivate it when the task is terminated:
Now, open the detection task and add the following code in each section: