Game Development Community

Starting clean with terrain water demo, player spawn help

by Darkfire Games · in Torque Game Engine Advanced · 03/06/2007 (6:00 am) · 4 replies

I have been playing around with starter.fps for a little bit and i thought it time to start to build the basic things up in a fresh game.

First task, get a player to spawn.

From what i can see, essentially for example, in newPlayer.cs, we have a PlayerData datablock, in game.cs we execute that file, and in the GameConnection:CreatePlayer function we assign the datablock to be whatever we named the datablock.

When i load a mission, its just a camera, no player.

Any thoughts?

#1
03/06/2007 (12:13 pm)
Did you add a player spawn point to the mission file?

Go to World Creator, select shapes, marker and find the spawn shape, it gives the script something to hone in on when deciding where to spawn the player model as I understand it ;)

It uses the octahedron.dts

Also did you copy the scripts from starter.fps, im not sure if the terrain demo scripts are setup properly...?

Im new too, but just trying to help :)

addikt
#2
03/06/2007 (12:18 pm)
First of all, watch out for the split between "demo" and "terrain_water_demo." They are really two separate "games" as far as TGEA is concerned. So first, make sure you copy over any files you need from Demo to Terrain_Water_Demo. Second, there's a call to "%this.spawnPlayer()" at the end of GameConnection::onClientEnterGame in game.cs; uncomment it. That function calls createPlayer which is where a new Player is instanced and assigned a Datablock.

That whole "chain" will let you know if all your files and scripts are in the right place because of several things:
A) the script containing the Datablock will need to have been run by that point or the call will fail
B) the DTS referenced by the PlayerData datablock will need to be in the proper location, local to the "game mod" this is why it must be copied from "Demo" to "terrain_water_demo"
C) the DTS needs to have the script containing its TSShapeConstructor object run or you will get now animations

Hope all of this helps.
#3
03/06/2007 (3:35 pm)
Thanks mark, i missed the commented spawnplayer call.

I have a player spawning now, im using the space orc from the demo, but it does not have the cubemap effect, the material file for the model says its WChrome but i cannot find it anywhere else, only the png files, is it an auto call to a directory?

If im asking questions that are actually documented somewhere feel free direct me there and point :)
#4
03/06/2007 (3:44 pm)
If you go to the Demo > Data > Textures folder you will see all the textures you need. Just add the chrome ones to your Texture folder and it will find them. It locates them via the client > scripts > commonmaterials.cs file.

addikt