Controlling Player From Script + Hiding Created Shape
by Charlie Sibbach · in Torque Game Engine · 08/04/2008 (10:18 pm) · 6 replies
Hey all,
Just run into an issue with our game, where if you hit a certain key, we want a set of scripted actions to happen, using the in-game mechanics. What's the best way to do this? I can think of a few, but they all feel clunky- mainly variations of commandToClient that sets the $Move variables and removes the player input, or recreates the player object as an aiSpaceVehicle and controls him that way. I'm sure this has been covered a million times before, but I can't find anything in the forums or resources, so I must be asking the wrong questions to the search engine.
Can anybody point me to the proper places, or just lay out what I need to do?
The other question is way different, but hopefully also easy: I have two vehicle objects for the player to be using, but he can only use one at a time. I want both objects to keep existing, though. How can I "hide" the second object so that it's still in the tree() but not in the game? I'm sure there's a single function call to do this, but I don't know what it is and I'm tired 'cause it's late.
Thanks!
Just run into an issue with our game, where if you hit a certain key, we want a set of scripted actions to happen, using the in-game mechanics. What's the best way to do this? I can think of a few, but they all feel clunky- mainly variations of commandToClient that sets the $Move variables and removes the player input, or recreates the player object as an aiSpaceVehicle and controls him that way. I'm sure this has been covered a million times before, but I can't find anything in the forums or resources, so I must be asking the wrong questions to the search engine.
Can anybody point me to the proper places, or just lay out what I need to do?
The other question is way different, but hopefully also easy: I have two vehicle objects for the player to be using, but he can only use one at a time. I want both objects to keep existing, though. How can I "hide" the second object so that it's still in the tree() but not in the game? I'm sure there's a single function call to do this, but I don't know what it is and I'm tired 'cause it's late.
Thanks!
#2
08/04/2008 (11:11 pm)
The movements are pretty simple; rotate into the proper direction and hit the accelerator- I don't need a full scripted cinematic system for the player (AI is another, yet far simpler, matter). I'll check out what you have there for TGB, though- maybe I can lift a few of your key methods. Thanks!
#3
That's without knowing how complex your actions might be. heh. Good luck
08/04/2008 (11:14 pm)
Sounds to me like you want to turn the player into a camera and simply allow him to rotate the scene and then yeah.. script the action that you need to happen as an AI control. That's without knowing how complex your actions might be. heh. Good luck
#4
How quick do you guys think the process would be to "hide" the player object (see second question) and spawn a bot in his place, given the need to do an aiconnect() and all that jazz? Seamless?
08/04/2008 (11:26 pm)
Actually I don't want to make the player into a camera while doing this; I need it to work like a scripted action when he hits a key. First he needs to stop (in space w/o drag, he needs to do a 180 degree turn into the direction of his current velocity and floor it till velocity = 0), and then turn again into the new direction and punch it. I already have a key that will do the first 180 automagically, but the second turn is trickier to calculate; to do it like the first one I'd have to use up a whole trigger channel, which I'd rather not do for a movement that is never done by the player. How quick do you guys think the process would be to "hide" the player object (see second question) and spawn a bot in his place, given the need to do an aiconnect() and all that jazz? Seamless?
#5
08/05/2008 (12:06 am)
Actually that's just a link to a video, sorry. But feel free to email me.
#6
Still have a question about Hiding objects in the game. I came across a setHidden method that seems to be the one, but I don't have any documentation on it. Anything I should know? Do hidden objects interact with anything, are they processed? Or are they frozen in time, waiting for an Object.setHidden(false)? That would be best, for sure.
08/19/2008 (2:00 pm)
In the interest of getting the prototype out quickly, I haven't had a chance to pursue this any farther, but I do have James' code in hand and will be investigating it closely going forward. Still have a question about Hiding objects in the game. I came across a setHidden method that seems to be the one, but I don't have any documentation on it. Anything I should know? Do hidden objects interact with anything, are they processed? Or are they frozen in time, waiting for an Object.setHidden(false)? That would be best, for sure.
Associate James Ford
Sickhead Games
Most likely it will feel clunky, because there is not a system in place for "scripted cinematic sequences", although I was recently looking into making one for TGB...
www.garagegames.com/mg/forums/result.thread.php?qt=77415