SetHidden on a player
by dragonlady · in Technical Issues · 02/10/2008 (9:24 pm) · 8 replies
Good evening,
I was wondering if there was a way to call setHidden on a player without Torque crashing. I understand that setHidden is a ShapeBase method, which is why it crashes when called on a player, but is there a way to get an equivalent effect? I tried setCloaked, but I still saw the player outline; I want my dude to be completely invisible.
Thanks :)
I was wondering if there was a way to call setHidden on a player without Torque crashing. I understand that setHidden is a ShapeBase method, which is why it crashes when called on a player, but is there a way to get an equivalent effect? I tried setCloaked, but I still saw the player outline; I want my dude to be completely invisible.
Thanks :)
#2
Yes, I see what you're saying, and I think that's why my game is crashing, because I'm making a player invisible then trying to update its position.
Here's what I'm trying to accomplish. I want to make a boss that goes invisible, chases the player around, and reappears randomly. If you ever played any of the older Zelda games where as the final boss, Ganon was invisible as he moved around the room, that's sort of the effect that I'm going for :)
02/11/2008 (7:38 am)
William,Yes, I see what you're saying, and I think that's why my game is crashing, because I'm making a player invisible then trying to update its position.
Here's what I'm trying to accomplish. I want to make a boss that goes invisible, chases the player around, and reappears randomly. If you ever played any of the older Zelda games where as the final boss, Ganon was invisible as he moved around the room, that's sort of the effect that I'm going for :)
#3
02/11/2008 (8:16 am)
You could swap to a different datablock that contains a dts model with a transperent PNG texture file.
#4
I was thinking just teleport him outside the room, then back again.
Hmmm how would you teleport him? Seems like that would be possible.
02/12/2008 (12:40 am)
That's iffy. You'd have to delete and recreate the player object. It is an interesting idea, though.I was thinking just teleport him outside the room, then back again.
Hmmm how would you teleport him? Seems like that would be possible.
#5
I found another thread where someone wanted to swap player datablocks in-game. I think there was also a description there of how to change shapefiles. So I'm gonna give that a stab and see how it goes :)
02/12/2008 (7:14 am)
Thanks David and Lee :)I found another thread where someone wanted to swap player datablocks in-game. I think there was also a description there of how to change shapefiles. So I'm gonna give that a stab and see how it goes :)
#6
02/12/2008 (10:20 am)
Ooo, where's this thread? Swapping datablocks would be great, I'm planning on using a class in my game that can transform into a turret or a vehicle, and doing mount calls all the time would still leave the player model around to mess things up.
#7
02/12/2008 (10:28 am)
Swapping datablocks at runtime is just going to cause you even more problems. The easiest solution would be to just swap the skin with a transparent one. You don't need to swap entire datablocks to do that, Torque allows it by default. Look up setSkin.
#8
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12853
02/15/2008 (11:14 am)
This is a good resource for that...http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=12853
Torque 3D Owner Avid Gamer
What end result are you looking for? Why do you want the guy invisible and in what situation? Just to make sure the advice given is the correct advice...
EDIT:
Just wanted to point out that calling parent functions on a derived class is one of the huge benefits of inheritance. Calling the function does not cause your crash simply because the method is not implemented in the player class, it is likely caused later when gameConnection tries to update the players move.