Game Development Community

2 Questions

by Stephen · in Torque Game Engine · 03/19/2005 (7:21 pm) · 11 replies

The first question is how to spawn a new player in-game. Lets say that I have a horse model as a player model. It has a player datablock (so if I wanted to I can spawn as the horse when the game started), Now I spawn in the game as the orc and want to spawn a horse so I can mount it. How would I add that horse in the game?

Second question. Once I spawn a horse and mounted it, how can I use different controls? I have looked at this resource and tried it but it's not working how I want it to (the resource does work, no my functions).

I don't need to use the horse pack. I was only using the horse as a example.

Thanks,
Stephen

#1
03/20/2005 (8:31 am)
A little help would be appreciated!

Thanks
Stephen
#2
03/20/2005 (11:22 am)
Try either of these:

http://www.hallofworlds.com/pages/Torque/EssentialGuide/EGTGE.zip

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5638

They're what I learned from.
#3
03/20/2005 (12:20 pm)
I made a new function to spawn the player in-game. So I solved my first question, but I still need help on the second question.
#4
03/20/2005 (12:24 pm)
Hey Stephen,

Can I ask what you mean by controls? Do you mean movement?

Also, can I ask what level you are with scripting?

I ask because it would be easier to figure out how to answer you.

A more specific answer the better
#5
03/20/2005 (1:33 pm)
What I mean by controls is the movement. Lets say I spawned the horse in game then I mount it, I want to use the arrow keys to move the horse instead of using w,a,s,d keys to move it. Then when I unmount the horse the keys go back to w,a,s,d to move.

The level of scripting that I'm at is fair.

Sorry for not being more specific.
#6
03/20/2005 (1:41 pm)
Look in the default.binds.cs and your config.cs and pref.cs files. They contain the keybindings.
#7
03/20/2005 (2:17 pm)
I know the keybinds are in those files, thats not want I'm looking for. In this resource, when you mount a vehicle it uses a different set of keybinds, then when you unmount the vehicle the binds go back to use the default binds. That's what I'm trying to found out how to do. Make some functions that say when you mount this vehicle to use different binds and not the defaults. You might say then use that resource, well I'm not mounting vehicles. I'm mounting players, like a horse. The horse is just like a player model.

Thanks
Stephen
#8
03/20/2005 (2:25 pm)
On mount exec the new binds.cs and on unmount exec default.bind.cs

or use something like
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7311
#9
03/20/2005 (5:11 pm)
How could I set that up?
#10
03/21/2005 (12:25 pm)
Actually, that's not the correct way to do it.

The right way to do it is to set up a second ActionMap. Push it onto the stack of action maps when you mount, and pop it off when you unmount. I think the Tank pack does this, among other things. For pushing/popping examples see how the actionmap from default.bind.cs is turned on/off.
#11
03/21/2005 (3:05 pm)
I finally got it working! Thanks guys