On/off invisible-transparent dts (models) and difs (buildings)
by Javier Canon · in Torque Game Engine · 10/30/2007 (9:42 am) · 6 replies
Hi, i am planning a RTS strategy game.
wich is the best way/approach to turn off/on if a model is visible or not? the idea is if a model is in the range of view of a friendly unit, make the enemy model visible.
how its possible make the dif buildings transparent only for the player owner if a model is inside the building?
wich is the best way/approach to turn off/on if a model is visible or not? the idea is if a model is in the range of view of a friendly unit, make the enemy model visible.
how its possible make the dif buildings transparent only for the player owner if a model is inside the building?
About the author
On the bus again... :)
#2
Diff? No clue...
As for highlighting.
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=13688
10/30/2007 (10:20 am)
There is a fade like property for most DTS/Shape class shapes, just do an %obj.dump(); In the console, where %obj is the ID or name of your object...i for get what the command is, its a fade or somthing, that you can set the time frame, and %opacity/transparency.Diff? No clue...
As for highlighting.
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=13688
#3
10/31/2007 (7:36 am)
Thanks Allyn and Jason, i was thinking too change the textures on the fly for transparent png..., its possible change the texture of difs in runtime?, because i was read that for collision and get more FPS (buildings) is better make difs that dts.
#4
If you happen to figure it out before me, please feel free to let me know :)
10/31/2007 (10:21 am)
It is true that Difs make better buildings for both the reasons you stated. I am currently writing my own lightmap generation handler to support dynamic building placement and time-of-day changes. Once I'm done with that I'll see about looking into manipulating DiFs parts and pieces. I do expect it to require some engine changes as I've not seen any Torquescript references to such actions.If you happen to figure it out before me, please feel free to let me know :)
#5
11/03/2007 (12:56 am)
Check out this resource I found for swapping .dif textures on the fly. It might get you going in the right direction.
#6
%obj.setCloaked()
Or
%obj.startFade() - ( int fadeTimeMS, int fadeDelayMS, bool fadeOut )
11/03/2007 (1:07 pm)
Ah, i recall the call i was referring to now.%obj.setCloaked()
Or
%obj.startFade() - ( int fadeTimeMS, int fadeDelayMS, bool fadeOut )
Torque Owner Jason Gossiaux
Indie Dev
This was what I used to get bounding boxes on my DTS shapes when selected. So I'd use the code there as a starting point.
I too am trying to find a way to make a building highlight or show a bounding box when selected. I have the selection working for DTS models (its render code was more straightforward and showcased in a few resources here), but adjusting how Interiors are rendered has proven challenging :P If I figure anything out I'll be sure to let you know.