Add object to engine via script
by AIDan · in Torque Game Engine · 11/27/2001 (11:23 am) · 4 replies
Hi
I want to show points made by the player over the destroyed objects. How can I add a model via script and move it then??
greetings
Daniel
I want to show points made by the player over the destroyed objects. How can I add a model via script and move it then??
greetings
Daniel
About the author
#2
I'm not sure if there is a function any more to change a skin :( So you'd have to code that in yourself.
To fade it in/out you would use:
%obj.startFade();
If you wanted to fade it out over the span of 3 seconds you would use:
%obj.startFade(3000, 0, true);
So it starts fading out slowly, and in 3 seconds it will be invisible.
But what if you want it to hang around for a little while? How about 5 seconds:
%obj.startFade(3000, 5000, true);
The second parameter tells it to start fading out in 5 seconds. So it waits 5 seconds, and 3 seconds after that it's invisible.
The third parameter tells it to fade either in or out. True is out, and false is in. The first and second parameters work the same whether you're fading it in or out.
You should also check out %obj.setCloaked(), it's pretty cool.
Dark
11/29/2001 (4:21 pm)
You would add it the same way you add anything else, look at the way the camera and player is added in game.cs. Look at the items too.I'm not sure if there is a function any more to change a skin :( So you'd have to code that in yourself.
To fade it in/out you would use:
%obj.startFade();
If you wanted to fade it out over the span of 3 seconds you would use:
%obj.startFade(3000, 0, true);
So it starts fading out slowly, and in 3 seconds it will be invisible.
But what if you want it to hang around for a little while? How about 5 seconds:
%obj.startFade(3000, 5000, true);
The second parameter tells it to start fading out in 5 seconds. So it waits 5 seconds, and 3 seconds after that it's invisible.
The third parameter tells it to fade either in or out. True is out, and false is in. The first and second parameters work the same whether you're fading it in or out.
You should also check out %obj.setCloaked(), it's pretty cool.
Dark
#3
Maybe I can change the texture by using animations.
11/30/2001 (4:25 pm)
THX, and I think this makes it become a billboard:datablock ...
{
...
faceViewer = true;
...
}Maybe I can change the texture by using animations.
Torque Owner AIDan
- Add a billboard
- Change the texture to show different numbers
- Change alpha channel to fade them out