Game Development Community

Player Spawns

by alex burke · in Torque 3D Professional · 04/08/2011 (9:41 pm) · 13 replies

Hello everyone :D
I am making a FPS in torque 3D..I have a little problem..
When I try and make more spawn points for my players to spawn it keeps only spawning at 1 spawn point.
The "deaultspawn" thats located at "0 0 0" This is a problem because my game level is below that point so my player starts off in the air and falls for a half a minute :P
I tried moving the "defaultspawn" onto the map and even deleting it. No matter what it keeps spawning at the deaultspawn at 0 0 0 and it just keeps on recreating its self.

So my question is How can I make multiple spawns and delete or move "default spawn"

Thanks in advance
Alex

#1
04/09/2011 (6:46 am)
On a "Full Project" look for "SpawnGroups" ... scripts/server/gamecore.cs ... hint hint
#2
04/09/2011 (7:23 am)
last night I went into my .MIS folder of my level and added
Quote: new SpawnSphere(DefaultPlayerSpawnSphere) {
spawnClass = "Player";
spawnDatablock = "DefaultPlayerData";
autoSpawn = "0";
radius = "100";
sphereWeight = "100";
indoorWeight = "100";
outdoorWeight = "100";
dataBlock = "SpawnSphereMarker";
position = "20 20 -70";
rotation = "1 0 0 0";
scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1";
};
That overrided the default spawn so now I have 1 working spawn..
Now I need more then 1 spawn..
Thanks
#3
04/09/2011 (9:28 am)
Someone? anyone?
#4
04/09/2011 (10:21 am)
Make sure that all new spawnpoints are added to either the PlayerDropPoints or the PlayerSpawnPoints simgroup when you add them in the editor.

The spawn code looks for declared simgroup*, then it walks through the group and picks a spawnpoint at random. If the spawnpoints are not in that group then it can't find them and thus reverts back to a default.

* Default spawn Simgroup names are set at the top of core/scripts/server/spawn.cs. These are in turn overridden by the gametype, which by default will always be the DMGame. gameDM.cs has the overrides (well technically they're the same defaults, but you could override them there in function DeathMatchGame::initGameVars()
$Game::DefaultPlayerSpawnGroups  = "PlayerSpawnPoints PlayerDropPoints";
#5
04/09/2011 (1:53 pm)
Okay I created 2 folders/simgroups called "PlayerDropPoints" "PlayerSpawnPoints"

I created a "player drop point" and put it where I wanted my player to spawn.. made sure it was in the right sim group.. Nope..

Hmm
#6
04/09/2011 (2:41 pm)
copy/paste your .mis file here
#7
04/09/2011 (4:57 pm)
Its 2 big to copy and paste so I uploaded it to rapidshare.
http://rapidshare.com/files/456685588/alexsmoney.mis
#8
04/09/2011 (5:44 pm)
Your droppoints are not inside the Simgroup.
i167.photobucket.com/albums/u143/heretek/torque/spgrp.png
You can either drag them from the tree to the desired Simgroup, or before you create them right-click the SimGroup in the tree and choose "Add new objects here".

You also don't need both PlayerSpawnPoints and PlayerDropPoints simgroups, only one or the other. One is there for backwards compatibility. Or if you choose to create your own custom spawngroup you can override the default as mentioned.
#9
04/09/2011 (5:46 pm)
Here's the issue:

new SimGroup(PlayerSpawnPoints) {
      canSave = "1";
      canSaveDynamicFields = "1";
   };
   new SpawnSphere(DefaultPlayerSpawnSphere) {
      spawnClass = "Player";
      spawnDatablock = "DefaultPlayerData";
      autoSpawn = "0";
      radius = "100";
      sphereWeight = "100";
      indoorWeight = "100";
      outdoorWeight = "100";
      dataBlock = "SpawnSphereMarker";
      position = "20 20 -70";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      canSave = "1";
      canSaveDynamicFields = "1";
   };

The SpawnSphere object should be nested within PlayerSpawnPoints, like this:

new SimGroup(PlayerSpawnPoints) {
      canSave = "1";
      canSaveDynamicFields = "1";

// I'm moving the brace down...

     new SpawnSphere(DefaultPlayerSpawnSphere) {
        spawnClass = "Player";
        spawnDatablock = "DefaultPlayerData";
        autoSpawn = "0";
        radius = "100";
        sphereWeight = "100";
        indoorWeight = "100";
        outdoorWeight = "100";
        dataBlock = "SpawnSphereMarker";
        position = "20 20 -70";
        rotation = "1 0 0 0";
        scale = "1 1 1";
        canSave = "1";
        canSaveDynamicFields = "1";
   };
}; // ...to here. Nested!
#10
04/09/2011 (5:47 pm)
Inside the .mis file it should like this when objects are properly nested inside a Simgroup:
new SimGroup(PlayerDropPoints) {
   canSaveDynamicFields = "1";
   enabled = "1";

   new SpawnSphere() {
      // stuff
      // more stuff
   }; // ends the SpawnSphere
}; // ends the Simgroup
#11
04/09/2011 (11:30 pm)
Thanks you were right!
They wern't inside the sim group :P
All I had to do was drag the spawns onto the folder/sim group!

Thanks!
#12
02/27/2012 (6:31 pm)
So I,m having the same problem with my player not spawning at my spawn points. Everything is setup right but when I start it up and check the start up script it says:
scripts/server/gameCore.cs (617):unable to find function PickPlayerSpawnPoint

#13
02/27/2012 (7:04 pm)
pickPlayerSpawnPoint is in spawn.cs somewhere inside core, make sure that you haven't un-execed references to core files.