Game Development Community

car in the engine

by Noah Gomes · in Torque 3D Professional · 07/18/2009 (7:26 pm) · 12 replies

I need help putting the car in the engine. I know how in the old engine
Thanks
Noah

#1
07/19/2009 (9:13 pm)
I wasn't aware of anything that had changed with respect to setting up WheeledVehicles. What is it that you're having trouble with?

Quote:I need help putting the car in the engine.

You're doing it wrong => the engine goes in the car, not the other way around! ;-) (sorry couldn't resist).
#2
07/19/2009 (10:15 pm)
LOL @ Chris :D

Take a look at the buggy example (car.cs) and/or the assaultbuggy (in the FPSkit) to see how to add/use a wheeled vehicle.
Quote:
I know how in the old engine
It's the exact same procedure in Torque 3D only the scripts and the datablocks have been split apart.
  • script = "game/script/server"
  • datablocks = "game/art/datablocks"

  • Or do you want to know how to spawn the player as a vehicle instead of a player?
    #3
    07/20/2009 (2:59 pm)
    Michael
    I don't know what is wrong.. Can you e-mail me on what files to change? I changed game.cs
    #4
    07/20/2009 (10:05 pm)
    Are you using the Full Template or modding the FPS kit?

    To make new files get exec'd you would have to edit "game/scripts/server/scriptExec" to include your new scripts, and you would edit "game/art/datablocks/datablockExec" to include your new datablocks.

    The datablock/script split is for organizational purposes so you don't have to split them apart if you don't won't to.

    Once you have your new script file(s) being exec'd you should be good to go. Default behavior for when you drop a vehicle into the game is for the player to mount it upon collision with it. Nothing else is necessary for this default behavior to happen. Of course you may want to switch key maps and push a dashboard Gui or something else to that effect also.

    I would have to know whether you are using the Template or the FPSkit to tell you how to "properly" start as a vehicle. But you can modify a spawnpoint to let you spawn as a vehicle -- you can now actually spawn a variety of things from spawnpoints :D

    Here's how to setup a spawnpoint to spawn player as a vehicle -- but note that there will be a few issues from doing this because the stock scripts don't account for this situation.
    new SpawnSphere()
    {
       canSaveDynamicFields = "1";
       Position = "10 10 2";
       rotation = "1 0 0 0";
       scale = "1 1 1";
       dataBlock = "SpawnSphereMarker";
       radius = "5";
       spawnClass = "WheeledVehicle";
       spawnDatablock = "AssaultBuggy";
       autoSpawn = "false";
       sphereWeight = "1";
       indoorWeight = "1";
       outdoorWeight = "1";
       Enabled = "1";
       homingCount = "0";
       lockCount = "0";
    };
    spawnClass and spawnDatablock enable the "magic" of the new spawn system.
    #5
    07/20/2009 (10:14 pm)
    I'm using the full template
    #6
    07/20/2009 (10:15 pm)
    Email could still be an option, but I think it's good to share the new ways of doing things here so that everyone can benefit. We all win if helping you also helps someone else.

    But do feel free to email me any changes you've made that are giving you problems and I'll see if I can spot anything.
    #7
    07/20/2009 (10:19 pm)
    OK. How do you like the road mesh editor
    #8
    07/20/2009 (10:39 pm)
    It's a cool tool, but could still use a little work and functionality in my opinion. I've done crazy things like making walls and bridges with it too. In combination with the decal roads you can make the in-game environment much more believable for vehicle-based games.

    I'll start taking a closer look at the template and try to see what all could be done differently in there to make it easier for you start as a vehicle, though I think the spawnsphere "magic" will work for you there (it should anyway). It was the FPS kit that I tested that spawnsphere in so I think the issues I noticed would only pertain to it.
    #9
    07/20/2009 (11:22 pm)
    that worked. I forgot one little word, didn't work
    After the engine get final, want to help with a game. I have everything written out, I just need some help

    Thanks again
    #10
    07/20/2009 (11:35 pm)
    Not a problem, glad you got it woking. I'm always willing to help so feel free to ask.
    #11
    10/28/2009 (10:27 pm)
    Thanks for the great info above but i still can get a basic bot in the game? Using the new SpawnSphere() example above I only want to place a basic bot but i am not sure what to put in the:

    spawnClass = "WheeledVehicle";
    spawnDatablock = "AssaultBuggy";

    to make it work?
    I dont need a wheeled Vehicle just a basic bot with a diffrent model than the player?

    Silly question I know!

    Thanks in advance
    #12
    11/03/2009 (11:14 am)
    Errol spawnClass for a Player is "player"
    And in spawnDatablock you just put the name of your basic bot Datablock.

    Hope this helps.