The scripting is the easy bit here.
Starting from a copy of FP HH.lua, first thing is to duplicate the group of lines for the second arm and change the index from 2 to 3. I would call the stop arms Home1, Home2, Home3 in the blueprint, then it is dead simple that SEM_CHILD_NAME Home3 is the child which corresponds to the [3] entries and link 3.
In my view, you fare best with one stop arm and thus one pair of animation files used for all three stop arms. Then the animation names are the same for all of them.
If the call-on arm only works for one link, then it is simply as in the manual. You name the child Call On and your group of lines could look like this:
- Code: Select all
gArmTable[1][ARM_CALLON][SEM_CHILD_NAME] = "Call On"
gArmTable[1][ARM_CALLON][SEM_PROCEED_ANIM] = "Clear01"
gArmTable[1][ARM_CALLON][SEM_BLOCKED_ANIM] = "Stop01"
(Or Stop instead of Stop01, as always.)
Now if you want to clear the Call-on for other routes, too, you can boldly duplicate that line group and have a copy for index 2, i.e., link 2, using exactly the same SEM_CHILD_NAME. This only works because the script does nothing with all the arms most of the time. That is, [1][ARM_CALLON] will not move when [2][ARM_CALLON] is cleared. Only after [2][ARM_CALLON] is reset to closed, there is a chance of [1][ARM_CALLON] getting cleared.
Same for route 3, if you like.
For the lights, I don't know what your plans are. If you can pull off the shader/material tricks to have the green/blue light actually shine through the red glass and appear red and bright enough in game, the following is irrelevant.
If you want to take a bit of a shortcut as a modeller, you can switch on and off lights, i.e., nodes as if it were a CLS.
To do this, you are free to add any of the following functions (compare section 8.6.1 in the manual): startOpening, finishOpening, startClosing and finishClosing.
Each looks like this:
- Code: Select all
function startOpening(routeIndex, armIndex)
...
end
At ... you insert any of the following:
- Code: Select all
Call("Home1:ActivateNode", "red", 0)
to turn off a node named red that is part of the arm shape.
- Code: Select all
Call("ActivateNode", "green", 1)
to turn on a node named green that is part of the main post shape.
Node means a part of the 3D model (named object or whatever in your modelling program) that gets exported together with the main post. I.e., each .igs file can consist of several parts = nodes and each of them can be shown and hidden using 1 and 0 in these ActivateNode calls. Of course, having extra parts for no reason is discouraged for performance reasons but for CLS, this is how it is done.
Just when you do the switching is your choice, I don't have a trigger halfway through the animation. I would go for startOpening for red-to-green and finishClosing for green-to-red.