I've looked through the documentation, but didn't see how to do this:
I have a simple decoration (a security camera) that has 4 frames of animation where the "light" (read a few green pixels) on it is one colour, then another 4 frames of animation where it is a different colour (then it returns to the start). This works fine as a sprite, but I don't know how to get it to work as a model.
I've got the animation working just fine - the camera pans from side to side. However, in order to complete what I want, the camera also needs to be able to change colour on the second pan. How do I do this in modeldef? I think I somehow need to be able to define a second skin to be used by the model during the second set of frames, but I don't know how.
The animation is like this (all using frames CAME*0)
ABCBADED - the first colour
FGHGFIJI - the second colour
Currently my modeldef looks like this:
Model CameraPanning
{
Path "Models"
Model 0 "camera.md2"
Skin 0 "camera.png"
Scale 1.0 1.0 1.0
Frame CAME A 0 "camera1"
Frame CAME B 0 "camera2"
Frame CAME C 0 "camera3"
Frame CAME D 0 "camera4"
Frame CAME E 0 "camera5"
Frame CAME F 0 "camera1"
Frame CAME G 0 "camera2"
Frame CAME H 0 "camera3"
Frame CAME I 0 "camera4"
Frame CAME J 0 "camera5"
}
Thanks for any help.
Modelef question - different skins, different frames - how?
Moderator: Graf Zahl
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
- Nash
- Developer
- Posts: 1226
- Joined: Sun Sep 25, 2005 1:49
- Location: Kuala Lumpur, Malaysia
- Contact:
It is cases like this where I wish there was a code pointer to change model skins on the fly.
The best hack I can think of is, first you have to add separate frames for your camera's DECORATE to differentiate the on an doff state. Since your camera is CAME*, add CAMO* (O for "on"
) states to the DECORATE.
Now for the MODELDEF hackery:
Be sure to put both in the same MODELDEFS.
The best hack I can think of is, first you have to add separate frames for your camera's DECORATE to differentiate the on an doff state. Since your camera is CAME*, add CAMO* (O for "on"

Now for the MODELDEF hackery:
Code: Select all
Model CameraPanning
{
Path "Models"
Model 0 "camera.md2"
Skin 0 "camera.png"
Scale 1.0 1.0 1.0
Frame CAME A 0 "camera1"
Frame CAME B 0 "camera2"
Frame CAME C 0 "camera3"
Frame CAME D 0 "camera4"
Frame CAME E 0 "camera5"
Frame CAME F 0 "camera1"
Frame CAME G 0 "camera2"
Frame CAME H 0 "camera3"
Frame CAME I 0 "camera4"
Frame CAME J 0 "camera5"
}
Model CameraPanning // uses different modelindex
{
Path "Models"
Model 1 "camera.md2"
Skin 1 "camera2.png" // different texture
Scale 1.0 1.0 1.0
Frame CAMO A 1 "camera1"
Frame CAMO B 1 "camera2"
Frame CAMO C 1 "camera3"
Frame CAMO D 1 "camera4"
Frame CAMO E 1 "camera5"
Frame CAMO F 1 "camera1"
Frame CAMO G 1 "camera2"
Frame CAMO H 1 "camera3"
Frame CAMO I 1 "camera4"
Frame CAMO J 1 "camera5"
}
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:
- Nash
- Developer
- Posts: 1226
- Joined: Sun Sep 25, 2005 1:49
- Location: Kuala Lumpur, Malaysia
- Contact:
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact: